@neuralnomads/codenomad-dev 0.13.1-dev-20260331-197dee2a → 0.13.1-dev-20260331-64ac8851
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/clients/connection-manager.js +93 -0
- package/dist/plugins/voice-mode.js +77 -0
- package/dist/server/http-server.js +16 -1
- package/dist/server/routes/events.js +24 -1
- package/dist/server/routes/plugin.js +4 -7
- package/package.json +1 -1
- package/public/assets/{ChangesTab-C8zdDjmi.js → ChangesTab-RTdJ_Y1y.js} +2 -2
- package/public/assets/{DiffToolbar-9t70qPdk.js → DiffToolbar-C1xO2z35.js} +1 -1
- package/public/assets/{FilesTab-D7BmKaIy.js → FilesTab-07IkVogN.js} +2 -2
- package/public/assets/{GitChangesTab-LxDWDUWh.js → GitChangesTab-fjdsfZUU.js} +2 -2
- package/public/assets/{SplitFilePanel-CiGeO3Fu.js → SplitFilePanel-D0HTUMZ8.js} +1 -1
- package/public/assets/StatusTab-CcKxUIUL.js +1 -0
- package/public/assets/{bundle-full-Ci4Nsw1a.js → bundle-full-BOM3Ly92.js} +1 -1
- package/public/assets/{diff-viewer-DUacI4bj.js → diff-viewer-DOx_14Jw.js} +1 -1
- package/public/assets/index--5k23mCQ.js +1 -0
- package/public/assets/index-9PXn07aX.js +2 -0
- package/public/assets/index-B7X7f2WF.js +1 -0
- package/public/assets/index-BNyw4BqI.js +1 -0
- package/public/assets/{index-C2RrcFJ5.css → index-CDoHZhl9.css} +1 -1
- package/public/assets/{index-5Van9SDX.js → index-CssW65fw.js} +1 -1
- package/public/assets/index-DtbKZTUc.js +1 -0
- package/public/assets/index-RGo94eU_.js +1 -0
- package/public/assets/index-Z9-T3Z05.js +1 -0
- package/public/assets/{index-BbGDMdki.js → index-mkwJJU52.js} +1 -1
- package/public/assets/{loading-5fXD_yBJ.js → loading-B_dejC1m.js} +1 -1
- package/public/assets/main-CJ6AzDA8.js +56 -0
- package/public/assets/{markdown-DZ9UzdXg.js → markdown-BtFDy3nR.js} +3 -3
- package/public/assets/monaco-viewer-UU9TfOpS.js +15 -0
- package/public/assets/{todo-BxfNuKUB.js → todo-DRKp_1_C.js} +1 -1
- package/public/assets/{tool-call-Bakver9o.js → tool-call-B4P-PiNS.js} +3 -3
- package/public/assets/{unified-picker-Qz5srwQH.js → unified-picker-DEBwixc1.js} +1 -1
- package/public/index.html +4 -4
- package/public/loading.html +4 -4
- package/public/sw.js +1 -1
- package/public/assets/StatusTab-Aa5lKnqY.js +0 -1
- package/public/assets/index-BMjCY26M.js +0 -1
- package/public/assets/index-CAUPG2JG.js +0 -1
- package/public/assets/index-DBKPDTTj.js +0 -1
- package/public/assets/index-DNAppyAC.js +0 -2
- package/public/assets/index-DzF6d6KL.js +0 -1
- package/public/assets/index-Xia2ufwz.js +0 -1
- package/public/assets/index-hY6tafTK.js +0 -1
- package/public/assets/main-JkDQRHSo.js +0 -56
- package/public/assets/monaco-viewer-DK-6pkvP.js +0 -15
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
const STALE_CONNECTION_TIMEOUT_MS = 45000;
|
|
2
|
+
const STALE_SWEEP_INTERVAL_MS = 5000;
|
|
3
|
+
export class ClientConnectionManager {
|
|
4
|
+
constructor(logger) {
|
|
5
|
+
this.logger = logger;
|
|
6
|
+
this.connections = new Map();
|
|
7
|
+
this.subscribers = new Set();
|
|
8
|
+
this.sweepTimer = setInterval(() => this.sweepStaleConnections(), STALE_SWEEP_INTERVAL_MS);
|
|
9
|
+
this.sweepTimer.unref?.();
|
|
10
|
+
}
|
|
11
|
+
shutdown() {
|
|
12
|
+
clearInterval(this.sweepTimer);
|
|
13
|
+
for (const connection of Array.from(this.connections.values())) {
|
|
14
|
+
this.disconnect(connection.key, "shutdown", false);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
subscribe(listener) {
|
|
18
|
+
this.subscribers.add(listener);
|
|
19
|
+
return () => this.subscribers.delete(listener);
|
|
20
|
+
}
|
|
21
|
+
register(input) {
|
|
22
|
+
const key = getConnectionKey(input);
|
|
23
|
+
const now = Date.now();
|
|
24
|
+
const existing = this.connections.get(key);
|
|
25
|
+
if (existing) {
|
|
26
|
+
this.logger.debug({ clientId: input.clientId, connectionId: input.connectionId }, "Replacing existing client connection");
|
|
27
|
+
this.disconnect(key, "replaced");
|
|
28
|
+
}
|
|
29
|
+
const connection = {
|
|
30
|
+
key,
|
|
31
|
+
clientId: input.clientId,
|
|
32
|
+
connectionId: input.connectionId,
|
|
33
|
+
connectedAt: now,
|
|
34
|
+
lastSeenAt: now,
|
|
35
|
+
close: input.close,
|
|
36
|
+
};
|
|
37
|
+
this.connections.set(key, connection);
|
|
38
|
+
this.logger.debug({ clientId: input.clientId, connectionId: input.connectionId }, "Client connected");
|
|
39
|
+
this.notify({ type: "connected", connection });
|
|
40
|
+
return () => this.disconnect(key, "closed");
|
|
41
|
+
}
|
|
42
|
+
pong(input) {
|
|
43
|
+
const key = getConnectionKey(input);
|
|
44
|
+
const connection = this.connections.get(key);
|
|
45
|
+
if (!connection) {
|
|
46
|
+
this.logger.debug({ clientId: input.clientId, connectionId: input.connectionId }, "Ignoring pong for unknown client connection");
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
connection.lastSeenAt = Date.now();
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
isConnected(input) {
|
|
53
|
+
return this.connections.has(getConnectionKey(input));
|
|
54
|
+
}
|
|
55
|
+
sweepStaleConnections() {
|
|
56
|
+
const cutoff = Date.now() - STALE_CONNECTION_TIMEOUT_MS;
|
|
57
|
+
for (const connection of Array.from(this.connections.values())) {
|
|
58
|
+
if (connection.lastSeenAt > cutoff)
|
|
59
|
+
continue;
|
|
60
|
+
this.logger.debug({ clientId: connection.clientId, connectionId: connection.connectionId }, "Client connection timed out");
|
|
61
|
+
this.disconnect(connection.key, "timeout");
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
disconnect(key, reason, invokeClose = true) {
|
|
65
|
+
const connection = this.connections.get(key);
|
|
66
|
+
if (!connection)
|
|
67
|
+
return;
|
|
68
|
+
this.connections.delete(key);
|
|
69
|
+
this.logger.debug({ clientId: connection.clientId, connectionId: connection.connectionId, reason }, "Client disconnected");
|
|
70
|
+
if (invokeClose) {
|
|
71
|
+
try {
|
|
72
|
+
connection.close();
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
this.logger.warn({ err: error, clientId: connection.clientId, connectionId: connection.connectionId }, "Failed to close stale client connection");
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
this.notify({ type: "disconnected", connection, reason });
|
|
79
|
+
}
|
|
80
|
+
notify(event) {
|
|
81
|
+
for (const subscriber of this.subscribers) {
|
|
82
|
+
try {
|
|
83
|
+
subscriber(event);
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
this.logger.warn({ err: error, eventType: event.type }, "Client connection subscriber failed");
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function getConnectionKey(input) {
|
|
92
|
+
return `${input.clientId}:${input.connectionId}`;
|
|
93
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export class VoiceModeManager {
|
|
2
|
+
constructor(options) {
|
|
3
|
+
this.options = options;
|
|
4
|
+
this.enabledConnectionsByInstance = new Map();
|
|
5
|
+
this.aggregateByInstance = new Map();
|
|
6
|
+
this.options.connections.subscribe((event) => {
|
|
7
|
+
if (event.type !== "disconnected")
|
|
8
|
+
return;
|
|
9
|
+
this.clearConnection(event.connection);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
setEnabled(instanceId, connection, enabled) {
|
|
13
|
+
if (enabled && !this.options.connections.isConnected(connection)) {
|
|
14
|
+
this.options.logger.debug({ instanceId, clientId: connection.clientId, connectionId: connection.connectionId }, "Ignoring voice mode enable for disconnected client connection");
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const key = getConnectionKey(connection);
|
|
18
|
+
const current = this.enabledConnectionsByInstance.get(instanceId) ?? new Set();
|
|
19
|
+
if (enabled) {
|
|
20
|
+
current.add(key);
|
|
21
|
+
this.enabledConnectionsByInstance.set(instanceId, current);
|
|
22
|
+
}
|
|
23
|
+
else if (current.delete(key)) {
|
|
24
|
+
if (current.size === 0) {
|
|
25
|
+
this.enabledConnectionsByInstance.delete(instanceId);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
this.enabledConnectionsByInstance.set(instanceId, current);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
this.options.logger.debug({ instanceId, clientId: connection.clientId, connectionId: connection.connectionId, enabled }, "Voice mode updated for client connection");
|
|
32
|
+
this.publishIfChanged(instanceId);
|
|
33
|
+
}
|
|
34
|
+
syncInstance(instanceId) {
|
|
35
|
+
this.options.channel.send(instanceId, buildVoiceModeEvent(this.isEnabled(instanceId)));
|
|
36
|
+
}
|
|
37
|
+
isEnabled(instanceId) {
|
|
38
|
+
return this.aggregateByInstance.get(instanceId) === true;
|
|
39
|
+
}
|
|
40
|
+
clearConnection(connection) {
|
|
41
|
+
const key = getConnectionKey(connection);
|
|
42
|
+
for (const [instanceId, enabledConnections] of Array.from(this.enabledConnectionsByInstance.entries())) {
|
|
43
|
+
if (!enabledConnections.delete(key))
|
|
44
|
+
continue;
|
|
45
|
+
if (enabledConnections.size === 0) {
|
|
46
|
+
this.enabledConnectionsByInstance.delete(instanceId);
|
|
47
|
+
}
|
|
48
|
+
this.publishIfChanged(instanceId);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
publishIfChanged(instanceId) {
|
|
52
|
+
const enabled = (this.enabledConnectionsByInstance.get(instanceId)?.size ?? 0) > 0;
|
|
53
|
+
const previous = this.aggregateByInstance.get(instanceId) === true;
|
|
54
|
+
if (enabled === previous)
|
|
55
|
+
return;
|
|
56
|
+
if (enabled) {
|
|
57
|
+
this.aggregateByInstance.set(instanceId, true);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
this.aggregateByInstance.delete(instanceId);
|
|
61
|
+
}
|
|
62
|
+
this.options.logger.debug({ instanceId, enabled }, "Broadcasting aggregate voice mode");
|
|
63
|
+
this.options.channel.send(instanceId, buildVoiceModeEvent(enabled));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function buildVoiceModeEvent(enabled) {
|
|
67
|
+
return {
|
|
68
|
+
type: "codenomad.voiceMode",
|
|
69
|
+
properties: {
|
|
70
|
+
enabled,
|
|
71
|
+
formatVersion: "v1",
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function getConnectionKey(connection) {
|
|
76
|
+
return `${connection.clientId}:${connection.connectionId}`;
|
|
77
|
+
}
|
|
@@ -19,7 +19,9 @@ import { registerSpeechRoutes } from "./routes/speech";
|
|
|
19
19
|
import { BackgroundProcessManager } from "../background-processes/manager";
|
|
20
20
|
import { registerAuthRoutes } from "./routes/auth";
|
|
21
21
|
import { sendUnauthorized, wantsHtml } from "../auth/http-auth";
|
|
22
|
+
import { ClientConnectionManager } from "../clients/connection-manager";
|
|
22
23
|
import { PluginChannelManager } from "../plugins/channel";
|
|
24
|
+
import { VoiceModeManager } from "../plugins/voice-mode";
|
|
23
25
|
export function createHttpServer(deps) {
|
|
24
26
|
// Fastify's type-level RawServer inference gets noisy when toggling HTTP vs HTTPS.
|
|
25
27
|
// We keep the runtime behavior correct and cast the instance to a generic FastifyInstance.
|
|
@@ -126,7 +128,13 @@ export function createHttpServer(deps) {
|
|
|
126
128
|
eventBus: deps.eventBus,
|
|
127
129
|
logger: deps.logger.child({ component: "background-processes" }),
|
|
128
130
|
});
|
|
131
|
+
const clientConnectionManager = new ClientConnectionManager(deps.logger.child({ component: "client-connections" }));
|
|
129
132
|
const pluginChannel = new PluginChannelManager(deps.logger.child({ component: "plugin-channel" }));
|
|
133
|
+
const voiceModeManager = new VoiceModeManager({
|
|
134
|
+
connections: clientConnectionManager,
|
|
135
|
+
channel: pluginChannel,
|
|
136
|
+
logger: deps.logger.child({ component: "voice-mode" }),
|
|
137
|
+
});
|
|
130
138
|
registerAuthRoutes(app, { authManager: deps.authManager });
|
|
131
139
|
app.addHook("preHandler", (request, reply, done) => {
|
|
132
140
|
const rawUrl = request.raw.url ?? request.url;
|
|
@@ -187,7 +195,12 @@ export function createHttpServer(deps) {
|
|
|
187
195
|
registerSettingsRoutes(app, { settings: deps.settings, logger: apiLogger });
|
|
188
196
|
registerFilesystemRoutes(app, { fileSystemBrowser: deps.fileSystemBrowser });
|
|
189
197
|
registerMetaRoutes(app, { serverMeta: deps.serverMeta });
|
|
190
|
-
registerEventRoutes(app, {
|
|
198
|
+
registerEventRoutes(app, {
|
|
199
|
+
eventBus: deps.eventBus,
|
|
200
|
+
registerClient: registerSseClient,
|
|
201
|
+
logger: sseLogger,
|
|
202
|
+
connectionManager: clientConnectionManager,
|
|
203
|
+
});
|
|
191
204
|
registerWorktreeRoutes(app, { workspaceManager: deps.workspaceManager });
|
|
192
205
|
registerStorageRoutes(app, {
|
|
193
206
|
instanceStore: deps.instanceStore,
|
|
@@ -200,6 +213,7 @@ export function createHttpServer(deps) {
|
|
|
200
213
|
eventBus: deps.eventBus,
|
|
201
214
|
logger: proxyLogger,
|
|
202
215
|
channel: pluginChannel,
|
|
216
|
+
voiceModeManager,
|
|
203
217
|
});
|
|
204
218
|
registerBackgroundProcessRoutes(app, { backgroundProcessManager });
|
|
205
219
|
registerInstanceProxyRoutes(app, { workspaceManager: deps.workspaceManager, logger: proxyLogger });
|
|
@@ -258,6 +272,7 @@ export function createHttpServer(deps) {
|
|
|
258
272
|
},
|
|
259
273
|
stop: () => {
|
|
260
274
|
closeSseClients();
|
|
275
|
+
clientConnectionManager.shutdown();
|
|
261
276
|
return app.close();
|
|
262
277
|
},
|
|
263
278
|
};
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
1
2
|
let nextClientId = 0;
|
|
3
|
+
const ConnectionQuerySchema = z.object({
|
|
4
|
+
clientId: z.string().trim().min(1),
|
|
5
|
+
connectionId: z.string().trim().min(1),
|
|
6
|
+
});
|
|
7
|
+
const PongBodySchema = ConnectionQuerySchema.extend({
|
|
8
|
+
pingTs: z.number().optional(),
|
|
9
|
+
});
|
|
2
10
|
export function registerEventRoutes(app, deps) {
|
|
3
11
|
app.get("/api/events", (request, reply) => {
|
|
4
12
|
const clientId = ++nextClientId;
|
|
13
|
+
const connection = ConnectionQuerySchema.parse(request.query ?? {});
|
|
5
14
|
deps.logger.debug({ clientId }, "SSE client connected");
|
|
6
15
|
const origin = request.headers.origin ?? "*";
|
|
7
16
|
reply.raw.setHeader("Access-Control-Allow-Origin", origin);
|
|
@@ -20,7 +29,8 @@ export function registerEventRoutes(app, deps) {
|
|
|
20
29
|
};
|
|
21
30
|
const unsubscribe = deps.eventBus.onEvent(send);
|
|
22
31
|
const heartbeat = setInterval(() => {
|
|
23
|
-
|
|
32
|
+
const ping = { ts: Date.now() };
|
|
33
|
+
reply.raw.write(`event: codenomad.client.ping\ndata: ${JSON.stringify(ping)}\n\n`);
|
|
24
34
|
}, 15000);
|
|
25
35
|
let closed = false;
|
|
26
36
|
const close = () => {
|
|
@@ -33,11 +43,24 @@ export function registerEventRoutes(app, deps) {
|
|
|
33
43
|
deps.logger.debug({ clientId }, "SSE client disconnected");
|
|
34
44
|
};
|
|
35
45
|
const unregister = deps.registerClient(close);
|
|
46
|
+
const unregisterConnection = deps.connectionManager.register({
|
|
47
|
+
...connection,
|
|
48
|
+
close,
|
|
49
|
+
});
|
|
36
50
|
const handleClose = () => {
|
|
37
51
|
close();
|
|
38
52
|
unregister();
|
|
53
|
+
unregisterConnection();
|
|
39
54
|
};
|
|
40
55
|
request.raw.on("close", handleClose);
|
|
41
56
|
request.raw.on("error", handleClose);
|
|
42
57
|
});
|
|
58
|
+
app.post("/api/client-connections/pong", (request, reply) => {
|
|
59
|
+
const body = PongBodySchema.parse(request.body ?? {});
|
|
60
|
+
if (!deps.connectionManager.pong(body)) {
|
|
61
|
+
reply.code(404).send({ error: "Client connection not found" });
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
reply.code(204).send();
|
|
65
|
+
});
|
|
43
66
|
}
|
|
@@ -6,6 +6,8 @@ const PluginEventSchema = z.object({
|
|
|
6
6
|
});
|
|
7
7
|
const VoiceModeStateSchema = z.object({
|
|
8
8
|
enabled: z.boolean(),
|
|
9
|
+
clientId: z.string().trim().min(1),
|
|
10
|
+
connectionId: z.string().trim().min(1),
|
|
9
11
|
});
|
|
10
12
|
export function registerPluginRoutes(app, deps) {
|
|
11
13
|
app.get("/workspaces/:id/plugin/events", (request, reply) => {
|
|
@@ -20,6 +22,7 @@ export function registerPluginRoutes(app, deps) {
|
|
|
20
22
|
reply.raw.flushHeaders?.();
|
|
21
23
|
reply.hijack();
|
|
22
24
|
const registration = deps.channel.register(request.params.id, reply);
|
|
25
|
+
deps.voiceModeManager.syncInstance(request.params.id);
|
|
23
26
|
const heartbeat = setInterval(() => {
|
|
24
27
|
deps.channel.send(request.params.id, buildPingEvent());
|
|
25
28
|
}, 15000);
|
|
@@ -38,13 +41,7 @@ export function registerPluginRoutes(app, deps) {
|
|
|
38
41
|
return;
|
|
39
42
|
}
|
|
40
43
|
const payload = VoiceModeStateSchema.parse(request.body ?? {});
|
|
41
|
-
deps.
|
|
42
|
-
type: "codenomad.voiceMode",
|
|
43
|
-
properties: {
|
|
44
|
-
enabled: payload.enabled,
|
|
45
|
-
formatVersion: "v1",
|
|
46
|
-
},
|
|
47
|
-
});
|
|
44
|
+
deps.voiceModeManager.setEnabled(request.params.id, { clientId: payload.clientId, connectionId: payload.connectionId }, payload.enabled);
|
|
48
45
|
return { enabled: payload.enabled };
|
|
49
46
|
});
|
|
50
47
|
const handleWildcard = async (request, reply) => {
|
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-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-9PXn07aX.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-C1xO2z35.js";import{S as H}from"./SplitFilePanel-D0HTUMZ8.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./main-CJ6AzDA8.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}))),de=e=>{const M=f(()=>e.activeSessionId()),S=f(()=>!!(M()&&M()!=="info")),D=f(()=>S()?e.activeSessionDiffs():null),y=f(()=>{const n=D();return Array.isArray(n)?[...n].sort((i,l)=>String(i.file||"").localeCompare(String(l.file||""))):[]}),I=f(()=>y().reduce((n,i)=>(n.additions+=typeof i.additions=="number"?i.additions:0,n.deletions+=typeof i.deletions=="number"?i.deletions:0,n),{additions:0,deletions:0})),O=f(()=>{const n=y();return n.length===0?null:n.reduce((i,l)=>{const v=typeof(i==null?void 0:i.additions)=="number"?i.additions:0,m=typeof(i==null?void 0:i.deletions)=="number"?i.deletions:0,x=v+m,k=typeof(l==null?void 0:l.additions)=="number"?l.additions:0,t=typeof(l==null?void 0:l.deletions)=="number"?l.deletions:0,r=k+t;return r>x?l:r<x?i:String(l.file||"").localeCompare(String((i==null?void 0:i.file)||""))<0?l:i},n[0])}),P=f(()=>{const n=e.selectedFile(),i=y();if(n){const l=i.find(v=>v.file===n);if(l)return l}return O()}),p=f(()=>`${e.instanceId}:${S()?M():"no-session"}`),V=f(()=>{if(!S())return e.t("instanceShell.sessionChanges.noSessionSelected");const n=D();return n===void 0?e.t("instanceShell.sessionChanges.loading"):!Array.isArray(n)||n.length===0?e.t("instanceShell.sessionChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty")}),A=f(()=>{const n=P();return n!=null&&n.file?String(n.file):e.t("instanceShell.rightPanel.tabs.changes")});return B(()=>{const n=y(),i=I(),l=P(),v=()=>(()=>{var t=J(),r=t.firstChild;return a(r,c(W,{get when(){return l&&S()&&n.length>0?l:null},get fallback(){return(()=>{var o=E(),s=o.firstChild;return a(s,V),o})()},children:o=>c(j,{get fallback(){return(()=>{var s=E(),u=s.firstChild;return a(u,()=>e.t("instanceInfo.loading")),s})()},get children(){return c(Z,{get scopeKey(){return p()},get path(){return String(o().file||"")},get before(){return String(o().before||"")},get after(){return String(o().after||"")},get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrap(){return e.diffWordWrapMode()}})}})})),t})(),m=()=>(()=>{var t=Q();return a(t,V),t})();return c(H,{get header(){return[(()=>{var t=U(),r=t.firstChild;return a(r,A),L(()=>w(t,"title",A())),t})(),(()=>{var t=X(),r=t.firstChild,o=r.firstChild;o.firstChild;var s=r.nextSibling,u=s.firstChild;return u.firstChild,a(o,()=>i.additions,null),a(u,()=>i.deletions,null),t})(),(()=>{var t=Y();return a(t,c(G,{get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrapMode(){return e.diffWordWrapMode()},get onViewModeChange(){return e.onViewModeChange},get onContextModeChange(){return e.onContextModeChange},get onWordWrapModeChange(){return e.onWordWrapModeChange}})),t})()]},list:{panel:()=>c(W,{get when(){return n.length>0},get fallback(){return m()},get children(){return c(T,{each:n,children:t=>(()=>{var r=R(),o=r.firstChild,s=o.firstChild,u=s.firstChild,b=s.nextSibling,h=b.firstChild;h.firstChild;var C=h.nextSibling;return C.firstChild,r.$$click=()=>{e.onSelectFile(t.file,e.isPhoneLayout())},a(u,()=>t.file),a(h,()=>t.additions,null),a(C,()=>t.deletions,null),L(d=>{var _=`file-list-item ${(l==null?void 0:l.file)===t.file?"file-list-item-active":""}`,$=t.file;return _!==d.e&&F(r,d.e=_),$!==d.t&&w(s,"title",d.t=$),d},{e:void 0,t:void 0}),r})()})}}),overlay:()=>c(W,{get when(){return n.length>0},get fallback(){return m()},get children(){return c(T,{each:n,children:t=>(()=>{var r=R(),o=r.firstChild,s=o.firstChild,u=s.firstChild,b=s.nextSibling,h=b.firstChild;h.firstChild;var C=h.nextSibling;return C.firstChild,r.$$click=()=>{e.onSelectFile(t.file,!0)},a(u,()=>t.file),a(h,()=>t.additions,null),a(C,()=>t.deletions,null),L(d=>{var _=`file-list-item ${(l==null?void 0:l.file)===t.file?"file-list-item-active":""}`,$=t.file,z=t.file;return _!==d.e&&F(r,d.e=_),$!==d.t&&w(r,"title",d.t=$),z!==d.a&&w(s,"title",d.a=z),d},{e:void 0,t:void 0,a:void 0}),r})()})}})},get viewer(){return v()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.changes")}})})};N(["click"]);export{de as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as $,i as c,m as S,d as n,a as T,f as C}from"./monaco-viewer-
|
|
1
|
+
import{t as $,i as c,m as S,d as n,a as T,f as C}from"./monaco-viewer-UU9TfOpS.js";import{u as N}from"./index-9PXn07aX.js";import{n as i,m as h,a as V}from"./git-diff-vendor-CAv-4upN.js";import{I as f,J as U,K as A}from"./main-CJ6AzDA8.js";const I=[["line",{x1:"3",x2:"21",y1:"6",y2:"6",key:"4m8b97"}],["line",{x1:"3",x2:"21",y1:"12",y2:"12",key:"10d38w"}],["line",{x1:"3",x2:"21",y1:"18",y2:"18",key:"kwyyxn"}]],J=t=>i(f,h(t,{name:"AlignJustify",iconNode:I})),j=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m15 5-3-3-3 3",key:"itvq4r"}]],D=t=>i(f,h(t,{name:"UnfoldVertical",iconNode:j})),E=[["line",{x1:"3",x2:"21",y1:"6",y2:"6",key:"4m8b97"}],["path",{d:"M3 12h15a3 3 0 1 1 0 6h-4",key:"1cl7v7"}],["polyline",{points:"16 16 14 18 16 20",key:"1jznyi"}],["line",{x1:"3",x2:"10",y1:"18",y2:"18",key:"1h33wv"}]],F=t=>i(f,h(t,{name:"WrapText",iconNode:E}));var H=$("<div class=file-viewer-toolbar><button type=button class=file-viewer-toolbar-icon-button></button><button type=button class=file-viewer-toolbar-icon-button></button><button type=button>");const R=t=>{const{t:o}=N(),s=()=>t.viewMode==="split"?"unified":"split",r=()=>t.contextMode==="collapsed"?"expanded":"collapsed",y=()=>t.wordWrapMode==="on"?"off":"on",v=()=>s()==="split"?o("instanceShell.diff.switchToSplit"):o("instanceShell.diff.switchToUnified"),u=()=>r()==="collapsed"?o("instanceShell.diff.hideUnchanged"):o("instanceShell.diff.showFull"),b=()=>y()==="on"?o("instanceShell.diff.enableWordWrap"):o("instanceShell.diff.disableWordWrap");return(()=>{var x=H(),a=x.firstChild,l=a.nextSibling,d=l.nextSibling;return a.$$click=()=>t.onViewModeChange(s()),c(a,(()=>{var e=S(()=>s()==="split");return()=>e()?i(U,{class:"h-4 w-4","aria-hidden":"true"}):i(J,{class:"h-4 w-4","aria-hidden":"true"})})()),l.$$click=()=>t.onContextModeChange(r()),c(l,(()=>{var e=S(()=>r()==="collapsed");return()=>e()?i(A,{class:"h-4 w-4","aria-hidden":"true"}):i(D,{class:"h-4 w-4","aria-hidden":"true"})})()),d.$$click=()=>t.onWordWrapModeChange(y()),c(d,i(F,{class:"h-4 w-4","aria-hidden":"true"})),V(e=>{var m=v(),w=v(),k=u(),M=u(),p=`file-viewer-toolbar-icon-button${t.wordWrapMode==="on"?" active":""}`,W=b(),g=b();return m!==e.e&&n(a,"aria-label",e.e=m),w!==e.t&&n(a,"title",e.t=w),k!==e.a&&n(l,"aria-label",e.a=k),M!==e.o&&n(l,"title",e.o=M),p!==e.i&&T(d,e.i=p),W!==e.n&&n(d,"aria-label",e.n=W),g!==e.s&&n(d,"title",e.s=g),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),x})()};C(["click"]);export{R as D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-
|
|
2
|
-
import{_ as R}from"./index-
|
|
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-9PXn07aX.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-D0HTUMZ8.js";import{I as A,R as y}from"./main-CJ6AzDA8.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};
|
|
@@ -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-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-9PXn07aX.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-C1xO2z35.js";import{S as q}from"./SplitFilePanel-D0HTUMZ8.js";import{R as H}from"./main-CJ6AzDA8.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";var S=h("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),J=h('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),Q=h('<div class="p-3 text-xs text-secondary">'),A=h('<span class="text-[10px] text-secondary">'),z=h("<span class=file-list-item-additions>+"),O=h("<span class=file-list-item-deletions>-"),T=h("<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class=file-list-item-stats>"),U=h("<span class=files-tab-selected-path><span class=file-path-text>"),X=h('<div class=files-tab-stats style="flex:0 0 auto"><span class="files-tab-stat files-tab-stat-additions"><span class=files-tab-stat-value>+</span></span><span class="files-tab-stat files-tab-stat-deletions"><span class=files-tab-stat-value>-'),Y=h("<button type=button class=files-header-icon-button style=margin-left:auto>"),Z=h("<span class=text-error>");const p=N(()=>B(()=>import("./monaco-viewer-UU9TfOpS.js").then(e=>e.aa),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),he=e=>{const P=f(()=>e.activeSessionId()),y=f(()=>!!(P()&&P()!=="info")),M=f(()=>y()?e.entries():null),b=f(()=>{const o=M();return Array.isArray(o)?[...o].sort((s,g)=>String(s.path||"").localeCompare(String(g.path||""))):[]}),F=f(()=>b().reduce((o,s)=>(o.additions+=typeof s.added=="number"?s.added:0,o.deletions+=typeof s.removed=="number"?s.removed:0,o),{additions:0,deletions:0})),L=f(()=>b().filter(o=>o&&o.status!=="deleted")),I=f(()=>{const o=b(),s=e.selectedPath(),g=e.mostChangedPath();return(o.find(_=>_.path===s)||(g?o.find(_=>_.path===g):void 0))??null}),W=f(()=>y()?M()===null?e.t("instanceShell.gitChanges.loading"):L().length===0?e.t("instanceShell.gitChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty"):e.t("instanceShell.gitChanges.noSessionSelected"));return V(()=>{const o=F(),s=I(),g=b(),x=L(),_=()=>(()=>{var t=J(),l=t.firstChild;return r(l,d(c,{get when(){return e.selectedLoading()},get fallback(){return d(c,{get when(){return e.selectedError()},get fallback(){return d(c,{get when(){return V(()=>!!(s&&e.selectedBefore()!==null&&e.selectedAfter()!==null&&s.status!=="deleted"))()?{path:s.path,before:e.selectedBefore(),after:e.selectedAfter()}:null},get fallback(){return(()=>{var i=S(),a=i.firstChild;return r(a,W),i})()},children:i=>d(G,{get fallback(){return(()=>{var a=S(),u=a.firstChild;return r(u,()=>e.t("instanceInfo.loading")),a})()},get children(){return d(p,{get scopeKey(){return e.scopeKey()},get path(){return String(i().path||"")},get before(){return String(i().before||"")},get after(){return String(i().after||"")},get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrap(){return e.diffWordWrapMode()}})}})})},children:i=>(()=>{var a=S(),u=a.firstChild;return r(u,i),a})()})},get children(){var i=S(),a=i.firstChild;return r(a,()=>e.t("instanceInfo.loading")),i}})),t})(),k=()=>(()=>{var t=Q();return r(t,W),t})();return d(q,{get header(){return[(()=>{var t=U(),l=t.firstChild;return r(l,()=>(s==null?void 0:s.path)||e.t("instanceShell.rightPanel.tabs.gitChanges")),w(()=>$(t,"title",(s==null?void 0:s.path)||e.t("instanceShell.rightPanel.tabs.gitChanges"))),t})(),(()=>{var t=X(),l=t.firstChild,i=l.firstChild;i.firstChild;var a=l.nextSibling,u=a.firstChild;return u.firstChild,r(i,()=>o.additions,null),r(u,()=>o.deletions,null),r(t,d(c,{get when(){return e.statusError()},children:v=>(()=>{var n=Z();return r(n,v),n})()}),null),t})(),(()=>{var t=Y();return t.$$click=()=>e.onRefresh(),r(t,d(H,{get class(){return`h-4 w-4${e.statusLoading()?" animate-spin":""}`}})),w(l=>{var i=e.t("instanceShell.rightPanel.actions.refresh"),a=e.t("instanceShell.rightPanel.actions.refresh"),u=!y()||e.statusLoading()||M()===null;return i!==l.e&&$(t,"title",l.e=i),a!==l.t&&$(t,"aria-label",l.t=a),u!==l.a&&(t.disabled=l.a=u),l},{e:void 0,t:void 0,a:void 0}),t})(),d(j,{get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrapMode(){return e.diffWordWrapMode()},get onViewModeChange(){return e.onViewModeChange},get onContextModeChange(){return e.onContextModeChange},get onWordWrapModeChange(){return e.onWordWrapModeChange}})]},list:{panel:()=>d(c,{get when(){return x.length>0},get fallback(){return k()},get children(){return d(R,{each:g,children:t=>(()=>{var l=T(),i=l.firstChild,a=i.firstChild,u=a.firstChild,v=a.nextSibling;return l.$$click=()=>{e.onOpenFile(t.path)},r(u,()=>t.path),r(v,d(c,{get when(){return t.status==="deleted"},get children(){var n=A();return r(n,()=>e.t("instanceShell.gitChanges.deleted")),n}}),null),r(v,d(c,{get when(){return t.status!=="deleted"},get children(){return[(()=>{var n=z();return n.firstChild,r(n,()=>t.added,null),n})(),(()=>{var n=O();return n.firstChild,r(n,()=>t.removed,null),n})()]}}),null),w(n=>{var C=`file-list-item ${e.selectedPath()===t.path?"file-list-item-active":""}`,m=t.path;return C!==n.e&&D(l,n.e=C),m!==n.t&&$(a,"title",n.t=m),n},{e:void 0,t:void 0}),l})()})}}),overlay:()=>d(c,{get when(){return x.length>0},get fallback(){return k()},get children(){return d(R,{each:g,children:t=>(()=>{var l=T(),i=l.firstChild,a=i.firstChild,u=a.firstChild,v=a.nextSibling;return l.$$click=()=>e.onOpenFile(t.path),r(u,()=>t.path),r(v,d(c,{get when(){return t.status==="deleted"},get children(){var n=A();return r(n,()=>e.t("instanceShell.gitChanges.deleted")),n}}),null),r(v,d(c,{get when(){return t.status!=="deleted"},get children(){return[(()=>{var n=z();return n.firstChild,r(n,()=>t.added,null),n})(),(()=>{var n=O();return n.firstChild,r(n,()=>t.removed,null),n})()]}}),null),w(n=>{var C=`file-list-item ${e.selectedPath()===t.path?"file-list-item-active":""}`,m=t.path,E=t.path;return C!==n.e&&D(l,n.e=C),m!==n.t&&$(l,"title",n.t=m),E!==n.a&&$(a,"title",n.a=E),n},{e:void 0,t:void 0,a:void 0}),l})()})}})},get viewer(){return _()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.gitChanges")}})})};K(["click"]);export{he as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as d,i as l,d as m,j as s,m as b,g as _,f as w}from"./monaco-viewer-
|
|
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-9PXn07aX.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,N as Ze,O as F,P as se,Q as Je,T as et,U as Pe,V as Ie,W as Te,X as tt,Y as ue,Z as ie,_ as le,$ as $e,a0 as te,a1 as ne,a2 as nt,a3 as he,a4 as ot,a5 as st,a6 as E,a7 as me,a8 as it,a9 as rt,aa as lt,ab as A,ac as at,ad as ct,ae as we,af as dt,ag as ge,ah as ut,ai as gt,aj as pt,ak as ft}from"./main-CJ6AzDA8.js";import{u as ht}from"./index-9PXn07aX.js";import{T as mt}from"./todo-DRKp_1_C.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};
|