@neuralnomads/codenomad-dev 0.18.0-dev-20260704-e8623d31 → 0.18.0-dev-20260709-ca06bd99
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/events/bus.js +4 -0
- package/dist/permissions/auto-accept-manager.js +215 -0
- package/dist/permissions/auto-accept-manager.test.js +528 -0
- package/dist/permissions/auto-accept-store.js +115 -0
- package/dist/permissions/auto-accept-store.test.js +157 -0
- package/dist/permissions/opencode-replier.js +31 -0
- package/dist/server/http-server.js +14 -0
- package/dist/server/routes/yolo.js +12 -0
- package/dist/workspaces/instance-client.js +40 -0
- package/package.json +2 -1
- package/public/assets/{FilesTab-BvAKbOAe.js → FilesTab-4OYnsEpA.js} +2 -2
- package/public/assets/{GitChangesTab-CvmcUbYv.js → GitChangesTab-BRg5IAgC.js} +2 -2
- package/public/assets/{SplitFilePanel-CxDUaPOb.js → SplitFilePanel-CBrsPjMw.js} +1 -1
- package/public/assets/{StatusTab-D5zJNjO2.js → StatusTab-DKKxkw1O.js} +1 -1
- package/public/assets/{align-justify-Bn8CDzlS.js → align-justify-BBbFmxDX.js} +1 -1
- package/public/assets/{bundle-full-DBhFsM8v.js → bundle-full-CaqU_-Bu.js} +1 -1
- package/public/assets/{diff-viewer-CovNS2gz.js → diff-viewer-X5HokaV7.js} +1 -1
- package/public/assets/{index-SO3ktACc.js → index-BVzVj6yO.js} +1 -1
- package/public/assets/{index-D0m4YbHz.js → index-B_mSCVdz.js} +1 -1
- package/public/assets/{index-CGKhj9MH.js → index-BbH6mwer.js} +1 -1
- package/public/assets/{index-D8Us4B7P.js → index-BcHO9P9h.js} +1 -1
- package/public/assets/{index-DtbpjUma.js → index-CNR6iBgw.js} +1 -1
- package/public/assets/{index-DlKCavfp.js → index-Cb1cfkUb.js} +1 -1
- package/public/assets/{index-byf9BI5h.js → index-DHYmm6_R.js} +2 -2
- package/public/assets/{index-CWut2MH1.js → index-DcfoDBMN.js} +1 -1
- package/public/assets/{index-Df02kJ_l.js → index-DqvdokW8.js} +1 -1
- package/public/assets/{index-coIdctUe.js → index-cfYxASJ7.js} +1 -1
- package/public/assets/{index-Dwb5ls4Z.js → index-jd2JD4UX.js} +1 -1
- package/public/assets/{loading-BitVzHui.js → loading-Bm_4ihk-.js} +1 -1
- package/public/assets/main-BYOHwhSs.js +68 -0
- package/public/assets/{markdown-0328GCk-.js → markdown-AEVUKCN6.js} +3 -3
- package/public/assets/{monaco-viewer-q26M2dw6.js → monaco-viewer-B3Jl6a5p.js} +3 -3
- package/public/assets/{tool-call-B8_OPv1H.js → tool-call-Bp55vSts.js} +7 -7
- package/public/assets/{unified-picker-bwjTqCPs.js → unified-picker-_ya4P-Mo.js} +1 -1
- package/public/assets/{wrap-text-DnuQ9rVl.js → wrap-text-Clu8BV6B.js} +1 -1
- package/public/index.html +3 -3
- package/public/loading.html +3 -3
- package/public/sw.js +1 -1
- package/public/assets/main-DMQeFbbj.js +0 -68
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { describe, it } from "node:test";
|
|
3
|
+
import { AutoAcceptStore, resolveFamilyRoot } from "./auto-accept-store";
|
|
4
|
+
describe("resolveFamilyRoot", () => {
|
|
5
|
+
it("returns the session id itself when no info is known", () => {
|
|
6
|
+
assert.equal(resolveFamilyRoot("orphan", () => undefined), "orphan");
|
|
7
|
+
});
|
|
8
|
+
it("keeps a loaded child as root when its parent is missing", () => {
|
|
9
|
+
const root = resolveFamilyRoot("child", (id) => id === "child" ? { id: "child", parentId: "parent" } : undefined);
|
|
10
|
+
assert.equal(root, "child");
|
|
11
|
+
});
|
|
12
|
+
it("resolves to the master session when the full parent chain is loaded", () => {
|
|
13
|
+
const root = resolveFamilyRoot("grandchild", (id) => {
|
|
14
|
+
if (id === "grandchild")
|
|
15
|
+
return { id: "grandchild", parentId: "child" };
|
|
16
|
+
if (id === "child")
|
|
17
|
+
return { id: "child", parentId: "master" };
|
|
18
|
+
if (id === "master")
|
|
19
|
+
return { id: "master", parentId: null };
|
|
20
|
+
return undefined;
|
|
21
|
+
});
|
|
22
|
+
assert.equal(root, "master");
|
|
23
|
+
});
|
|
24
|
+
it("keeps a fork session (with revert) as its own root", () => {
|
|
25
|
+
const root = resolveFamilyRoot("fork", (id) => {
|
|
26
|
+
if (id === "fork")
|
|
27
|
+
return { id: "fork", parentId: "master", revert: { messageID: "msg", partID: "part" } };
|
|
28
|
+
if (id === "master")
|
|
29
|
+
return { id: "master", parentId: null };
|
|
30
|
+
return undefined;
|
|
31
|
+
});
|
|
32
|
+
assert.equal(root, "fork");
|
|
33
|
+
});
|
|
34
|
+
it("terminates on cyclic parent chains without looping forever", () => {
|
|
35
|
+
const root = resolveFamilyRoot("a", (id) => {
|
|
36
|
+
if (id === "a")
|
|
37
|
+
return { id: "a", parentId: "b" };
|
|
38
|
+
if (id === "b")
|
|
39
|
+
return { id: "b", parentId: "a" };
|
|
40
|
+
return undefined;
|
|
41
|
+
});
|
|
42
|
+
// cycle: last known id before re-entering the cycle is returned
|
|
43
|
+
assert.ok(root === "a" || root === "b");
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
describe("AutoAcceptStore inheritance", () => {
|
|
47
|
+
it("is disabled by default for an unknown session", () => {
|
|
48
|
+
const store = new AutoAcceptStore();
|
|
49
|
+
assert.equal(store.isEnabled("inst", "s1"), false);
|
|
50
|
+
});
|
|
51
|
+
it("enabling a parent enables every descendant that resolves to it", () => {
|
|
52
|
+
const store = new AutoAcceptStore();
|
|
53
|
+
store.upsertSession("inst", { id: "master", parentId: null });
|
|
54
|
+
store.upsertSession("inst", { id: "child", parentId: "master" });
|
|
55
|
+
store.upsertSession("inst", { id: "grandchild", parentId: "child" });
|
|
56
|
+
store.setEnabled("inst", "master", true);
|
|
57
|
+
assert.equal(store.isEnabled("inst", "master"), true);
|
|
58
|
+
assert.equal(store.isEnabled("inst", "child"), true);
|
|
59
|
+
assert.equal(store.isEnabled("inst", "grandchild"), true);
|
|
60
|
+
});
|
|
61
|
+
it("enabling a child also covers the parent family root and siblings", () => {
|
|
62
|
+
const store = new AutoAcceptStore();
|
|
63
|
+
store.upsertSession("inst", { id: "master", parentId: null });
|
|
64
|
+
store.upsertSession("inst", { id: "child-a", parentId: "master" });
|
|
65
|
+
store.upsertSession("inst", { id: "child-b", parentId: "master" });
|
|
66
|
+
store.setEnabled("inst", "child-a", true);
|
|
67
|
+
assert.equal(store.isEnabled("inst", "child-a"), true);
|
|
68
|
+
assert.equal(store.isEnabled("inst", "child-b"), true);
|
|
69
|
+
assert.equal(store.isEnabled("inst", "master"), true);
|
|
70
|
+
});
|
|
71
|
+
it("a fork session is isolated: enabling it does not enable its parent", () => {
|
|
72
|
+
const store = new AutoAcceptStore();
|
|
73
|
+
store.upsertSession("inst", { id: "master", parentId: null });
|
|
74
|
+
store.upsertSession("inst", {
|
|
75
|
+
id: "fork",
|
|
76
|
+
parentId: "master",
|
|
77
|
+
revert: { messageID: "msg", partID: "part" },
|
|
78
|
+
});
|
|
79
|
+
store.setEnabled("inst", "fork", true);
|
|
80
|
+
assert.equal(store.isEnabled("inst", "fork"), true);
|
|
81
|
+
assert.equal(store.isEnabled("inst", "master"), false);
|
|
82
|
+
});
|
|
83
|
+
it("disabling the family root clears the setting for all descendants", () => {
|
|
84
|
+
const store = new AutoAcceptStore();
|
|
85
|
+
store.upsertSession("inst", { id: "master", parentId: null });
|
|
86
|
+
store.upsertSession("inst", { id: "child", parentId: "master" });
|
|
87
|
+
store.setEnabled("inst", "child", true);
|
|
88
|
+
assert.equal(store.isEnabled("inst", "child"), true);
|
|
89
|
+
store.setEnabled("inst", "master", false);
|
|
90
|
+
assert.equal(store.isEnabled("inst", "child"), false);
|
|
91
|
+
assert.equal(store.isEnabled("inst", "master"), false);
|
|
92
|
+
});
|
|
93
|
+
it("toggle flips the resolved family-root state and reports the new value", () => {
|
|
94
|
+
const store = new AutoAcceptStore();
|
|
95
|
+
store.upsertSession("inst", { id: "master", parentId: null });
|
|
96
|
+
store.upsertSession("inst", { id: "child", parentId: "master" });
|
|
97
|
+
assert.equal(store.toggle("inst", "child"), true);
|
|
98
|
+
assert.equal(store.isEnabled("inst", "child"), true);
|
|
99
|
+
assert.equal(store.toggle("inst", "master"), false);
|
|
100
|
+
assert.equal(store.isEnabled("inst", "child"), false);
|
|
101
|
+
});
|
|
102
|
+
it("keeps per-instance state independent", () => {
|
|
103
|
+
const store = new AutoAcceptStore();
|
|
104
|
+
store.upsertSession("inst-a", { id: "root", parentId: null });
|
|
105
|
+
store.upsertSession("inst-b", { id: "root", parentId: null });
|
|
106
|
+
store.setEnabled("inst-a", "root", true);
|
|
107
|
+
assert.equal(store.isEnabled("inst-a", "root"), true);
|
|
108
|
+
assert.equal(store.isEnabled("inst-b", "root"), false);
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
describe("AutoAcceptStore session tree maintenance", () => {
|
|
112
|
+
it("migrates enabled root when a parent is discovered later", () => {
|
|
113
|
+
const store = new AutoAcceptStore();
|
|
114
|
+
store.upsertSession("inst", { id: "child", parentId: "parent" });
|
|
115
|
+
// parent unknown -> child is its own root
|
|
116
|
+
store.setEnabled("inst", "child", true);
|
|
117
|
+
// later the parent shows up — root should migrate from "child" to "parent"
|
|
118
|
+
store.upsertSession("inst", { id: "parent", parentId: null });
|
|
119
|
+
assert.equal(store.isEnabled("inst", "parent"), true);
|
|
120
|
+
assert.equal(store.isEnabled("inst", "child"), true);
|
|
121
|
+
});
|
|
122
|
+
it("removing a session does not clear an enabled family root", () => {
|
|
123
|
+
const store = new AutoAcceptStore();
|
|
124
|
+
store.upsertSession("inst", { id: "master", parentId: null });
|
|
125
|
+
store.setEnabled("inst", "master", true);
|
|
126
|
+
store.removeSession("inst", "master");
|
|
127
|
+
// the toggle is independent of the session tree: it survives session deletion
|
|
128
|
+
assert.equal(store.isEnabled("inst", "master"), true);
|
|
129
|
+
});
|
|
130
|
+
it("clearInstance drops both tree and enabled state", () => {
|
|
131
|
+
const store = new AutoAcceptStore();
|
|
132
|
+
store.upsertSession("inst", { id: "master", parentId: null });
|
|
133
|
+
store.setEnabled("inst", "master", true);
|
|
134
|
+
store.clearInstance("inst");
|
|
135
|
+
assert.equal(store.isEnabled("inst", "master"), false);
|
|
136
|
+
store.upsertSession("inst", { id: "master", parentId: null });
|
|
137
|
+
assert.equal(store.isEnabled("inst", "master"), false);
|
|
138
|
+
});
|
|
139
|
+
it("changing revert status re-roots a session as a fork", () => {
|
|
140
|
+
const store = new AutoAcceptStore();
|
|
141
|
+
store.upsertSession("inst", { id: "master", parentId: null });
|
|
142
|
+
store.upsertSession("inst", { id: "child", parentId: "master" });
|
|
143
|
+
store.setEnabled("inst", "child", true);
|
|
144
|
+
// parent family enabled
|
|
145
|
+
assert.equal(store.isEnabled("inst", "master"), true);
|
|
146
|
+
// child becomes a fork
|
|
147
|
+
store.upsertSession("inst", {
|
|
148
|
+
id: "child",
|
|
149
|
+
parentId: "master",
|
|
150
|
+
revert: { messageID: "m", partID: "p" },
|
|
151
|
+
});
|
|
152
|
+
// now child resolves to itself; the family setting was on "master" so still on for master
|
|
153
|
+
assert.equal(store.isEnabled("inst", "master"), true);
|
|
154
|
+
// child is its own root now, not enabled unless toggled
|
|
155
|
+
assert.equal(store.isEnabled("inst", "child"), false);
|
|
156
|
+
});
|
|
157
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createInstanceClient } from "../workspaces/instance-client";
|
|
2
|
+
/**
|
|
3
|
+
* Default {@link PermissionReplier} that calls the OpenCode instance via the
|
|
4
|
+
* generated SDK client over loopback, using the same `"once"` reply the UI
|
|
5
|
+
* previously sent.
|
|
6
|
+
*
|
|
7
|
+
* Uses `createInstanceClient` so routes and body shapes are always correct
|
|
8
|
+
* for the installed SDK version — no hand-assembled URLs.
|
|
9
|
+
*/
|
|
10
|
+
export function createOpencodePermissionReplier(deps) {
|
|
11
|
+
return async (reply) => {
|
|
12
|
+
const client = createInstanceClient(deps.workspaceManager, reply.instanceId);
|
|
13
|
+
if (!client) {
|
|
14
|
+
throw new Error(`Yolo: instance ${reply.instanceId} has no open port`);
|
|
15
|
+
}
|
|
16
|
+
const opts = { throwOnError: true };
|
|
17
|
+
if (reply.source === "v2") {
|
|
18
|
+
await client.v2.session.permission.reply({
|
|
19
|
+
sessionID: reply.sessionId,
|
|
20
|
+
requestID: reply.permissionId,
|
|
21
|
+
reply: reply.reply,
|
|
22
|
+
}, opts);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
await client.permission.reply({
|
|
26
|
+
requestID: reply.permissionId,
|
|
27
|
+
reply: reply.reply,
|
|
28
|
+
}, opts);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -16,6 +16,7 @@ import { registerEventRoutes } from "./routes/events";
|
|
|
16
16
|
import { registerStorageRoutes } from "./routes/storage";
|
|
17
17
|
import { registerPluginRoutes } from "./routes/plugin";
|
|
18
18
|
import { registerBackgroundProcessRoutes } from "./routes/background-processes";
|
|
19
|
+
import { registerYoloRoutes } from "./routes/yolo";
|
|
19
20
|
import { registerWorktreeRoutes } from "./routes/worktrees";
|
|
20
21
|
import { registerSpeechRoutes } from "./routes/speech";
|
|
21
22
|
import { registerRemoteServerRoutes } from "./routes/remote-servers";
|
|
@@ -23,6 +24,8 @@ import { registerRemoteProxyRoutes } from "./routes/remote-proxy";
|
|
|
23
24
|
import { registerSideCarRoutes } from "./routes/sidecars";
|
|
24
25
|
import { registerPreviewRoutes } from "./routes/previews";
|
|
25
26
|
import { BackgroundProcessManager } from "../background-processes/manager";
|
|
27
|
+
import { AutoAcceptManager } from "../permissions/auto-accept-manager";
|
|
28
|
+
import { createOpencodePermissionReplier } from "../permissions/opencode-replier";
|
|
26
29
|
import { registerAuthRoutes } from "./routes/auth";
|
|
27
30
|
import { sendUnauthorized, wantsHtml } from "../auth/http-auth";
|
|
28
31
|
export function createHttpServer(deps) {
|
|
@@ -131,6 +134,15 @@ export function createHttpServer(deps) {
|
|
|
131
134
|
eventBus: deps.eventBus,
|
|
132
135
|
logger: deps.logger.child({ component: "background-processes" }),
|
|
133
136
|
});
|
|
137
|
+
const yoloManager = new AutoAcceptManager({
|
|
138
|
+
eventBus: deps.eventBus,
|
|
139
|
+
logger: deps.logger.child({ component: "yolo" }),
|
|
140
|
+
replier: createOpencodePermissionReplier({
|
|
141
|
+
workspaceManager: deps.workspaceManager,
|
|
142
|
+
logger: deps.logger.child({ component: "yolo" }),
|
|
143
|
+
}),
|
|
144
|
+
});
|
|
145
|
+
yoloManager.start();
|
|
134
146
|
registerAuthRoutes(app, { authManager: deps.authManager });
|
|
135
147
|
app.addHook("preHandler", (request, reply, done) => {
|
|
136
148
|
const rawUrl = request.raw.url ?? request.url;
|
|
@@ -232,6 +244,7 @@ export function createHttpServer(deps) {
|
|
|
232
244
|
voiceModeManager: deps.voiceModeManager,
|
|
233
245
|
});
|
|
234
246
|
registerBackgroundProcessRoutes(app, { backgroundProcessManager });
|
|
247
|
+
registerYoloRoutes(app, { yoloManager });
|
|
235
248
|
registerInstanceProxyRoutes(app, { workspaceManager: deps.workspaceManager, logger: proxyLogger });
|
|
236
249
|
if (deps.uiDevServerUrl) {
|
|
237
250
|
setupDevProxy(app, deps.uiDevServerUrl, deps.authManager, deps.previewManager, proxyLogger);
|
|
@@ -287,6 +300,7 @@ export function createHttpServer(deps) {
|
|
|
287
300
|
return { port: actualPort, url: serverUrl, displayHost };
|
|
288
301
|
},
|
|
289
302
|
stop: () => {
|
|
303
|
+
yoloManager.stop();
|
|
290
304
|
closeSseClients();
|
|
291
305
|
return app.close();
|
|
292
306
|
},
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function registerYoloRoutes(app, deps) {
|
|
2
|
+
app.get("/workspaces/:id/yolo/sessions/:sessionId", async (request) => {
|
|
3
|
+
const { id, sessionId } = request.params;
|
|
4
|
+
return { enabled: deps.yoloManager.isEnabled(id, sessionId) };
|
|
5
|
+
});
|
|
6
|
+
app.post("/workspaces/:id/yolo/sessions/:sessionId/toggle", async (request, reply) => {
|
|
7
|
+
const { id, sessionId } = request.params;
|
|
8
|
+
const enabled = deps.yoloManager.toggle(id, sessionId);
|
|
9
|
+
reply.code(200);
|
|
10
|
+
return { enabled };
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { createOpencodeClient } from "@opencode-ai/sdk/v2/client";
|
|
2
|
+
const INSTANCE_HOST = "127.0.0.1";
|
|
3
|
+
const LOOPBACK_TIMEOUT_MS = 10000;
|
|
4
|
+
/**
|
|
5
|
+
* Creates an OpenCode SDK client for direct loopback communication with a
|
|
6
|
+
* running workspace instance.
|
|
7
|
+
*
|
|
8
|
+
* Routes and body shapes come from the auto-generated SDK contract
|
|
9
|
+
* (`@opencode-ai/sdk`), eliminating handwritten URL construction that can
|
|
10
|
+
* drift between SDK versions. Other server modules that need to call the
|
|
11
|
+
* OpenCode instance directly should use this factory rather than building
|
|
12
|
+
* `http://127.0.0.1:{port}/...` URLs by hand.
|
|
13
|
+
*
|
|
14
|
+
* All requests carry a 10-second timeout — loopback calls should be
|
|
15
|
+
* near-instant; a hang indicates a stuck instance.
|
|
16
|
+
*
|
|
17
|
+
* The client is cheap to create (object only, no connection); create one per
|
|
18
|
+
* call or cache per instance as needed. Returns `null` when the instance has
|
|
19
|
+
* no open port yet.
|
|
20
|
+
*/
|
|
21
|
+
export function createInstanceClient(workspaceManager, instanceId) {
|
|
22
|
+
const port = workspaceManager.getInstancePort(instanceId);
|
|
23
|
+
if (!port)
|
|
24
|
+
return null;
|
|
25
|
+
const headers = {};
|
|
26
|
+
const authorization = workspaceManager.getInstanceAuthorizationHeader(instanceId);
|
|
27
|
+
if (authorization) {
|
|
28
|
+
headers.authorization = authorization;
|
|
29
|
+
}
|
|
30
|
+
const workspace = workspaceManager.get(instanceId);
|
|
31
|
+
return createOpencodeClient({
|
|
32
|
+
baseUrl: `http://${INSTANCE_HOST}:${port}/`,
|
|
33
|
+
headers,
|
|
34
|
+
fetch: (url, init) => fetch(url, {
|
|
35
|
+
...init,
|
|
36
|
+
signal: init?.signal ?? AbortSignal.timeout(LOOPBACK_TIMEOUT_MS),
|
|
37
|
+
}),
|
|
38
|
+
...(workspace?.path ? { directory: workspace.path } : {}),
|
|
39
|
+
});
|
|
40
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neuralnomads/codenomad-dev",
|
|
3
|
-
"version": "0.18.0-dev-
|
|
3
|
+
"version": "0.18.0-dev-20260709-ca06bd99",
|
|
4
4
|
"description": "CodeNomad Server",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"@fastify/cors": "^8.5.0",
|
|
29
29
|
"@fastify/reply-from": "^9.8.0",
|
|
30
30
|
"@fastify/static": "^7.0.4",
|
|
31
|
+
"@opencode-ai/sdk": "^1.17.8",
|
|
31
32
|
"commander": "^12.1.0",
|
|
32
33
|
"fastify": "^4.28.1",
|
|
33
34
|
"fuzzysort": "^2.0.4",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-
|
|
2
|
-
import{a6 as J,m,t as h,i as s,d as u,a as C,u as U,_ as X,f as Y}from"./monaco-viewer-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-B3Jl6a5p.js","assets/git-diff-vendor-CSgooKT_.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a6 as J,m,t as h,i as s,d as u,a as C,u as U,_ as X,f as Y}from"./monaco-viewer-B3Jl6a5p.js";import{d as K,b as P,c as $,n as o,S as g,a as w,z as Z,A as p,F as ee}from"./git-diff-vendor-CSgooKT_.js";import{S as te}from"./SplitFilePanel-CBrsPjMw.js";import{R as O,O as le,M as re,Q as ne,C as ae,e as ie,T as se}from"./main-BYOHwhSs.js";import{W as oe}from"./wrap-text-Clu8BV6B.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./index-DHYmm6_R.js";var ce=h('<div class="px-2 py-2 border-b border-base"><div class=selector-input-group><div class="flex items-center gap-2 px-3 text-muted"></div><input type=text class=selector-input>'),de=h("<div class=file-list-header><span class=file-list-title></span><span class=file-list-count>"),V=h('<div class="p-3 text-xs text-secondary">'),he=h("<div class=file-list-item><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text>.."),ue=h('<div class="p-3 text-xs text-error">'),ve=h('<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class="flex items-center gap-2 shrink-0"><div class=file-list-item-stats><span class="text-[10px] text-secondary"></span></div><button type=button class=git-change-row-action>'),x=h("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),fe=h('<div class="file-viewer-panel flex-1"><div>'),ge=h('<div class="h-full outline-none"tabindex=0>'),we=h("<span>"),be=h("<div class=files-tab-stats><span class=files-tab-stat><span class=files-tab-selected-path><span class=file-path-text>"),Se=h("<button type=button style=margin-inline-start:auto>"),me=h("<button type=button>"),Q=h("<button type=button class=files-header-icon-button>"),$e=h("<span class=text-error>");const ye=p(()=>X(()=>import("./monaco-viewer-B3Jl6a5p.js").then(e=>e.ar),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoFileViewer})));function _e(e){return e?/\.(md|markdown|mdown|mkdn)$/i.test(e):!1}const De=e=>{const[E,L]=K(""),{isDark:q}=J(),[N,M]=K(!1);let b;P(()=>{e.browserPath(),L("")});const H=$(()=>[...e.browserEntries()||[]].sort((i,d)=>{const l=i.type==="directory"?0:1,t=d.type==="directory"?0:1;return l!==t?l-t:String(i.name||"").localeCompare(String(d.name||""))})),W=$(()=>E().trim().toLowerCase()),k=$(()=>{const r=W(),i=H();return r?i.filter(d=>String(d.name||"").toLowerCase().includes(r)):i}),y=()=>e.browserLoading()&&e.browserEntries()===null,j=()=>W()?e.t("instanceShell.filesShell.search.empty"):e.t("instanceShell.filesShell.listEmpty"),_=$(()=>_e(e.browserSelectedPath())),S=$(()=>_()&&N());P(()=>{_()||M(!1)});const T=()=>{const r=e.browserSelectedContent();r!=null&&e.onSave(r)},B=async(r,i)=>{i==null||i.stopPropagation();const d=await ie(r);se({message:d?e.t("instanceShell.filesShell.toast.copyPathSuccess"):e.t("instanceShell.filesShell.toast.copyPathError"),variant:d?"success":"error"})};P(()=>{S()&&requestAnimationFrame(()=>b==null?void 0:b.focus())});const D=()=>[(()=>{var r=ce(),i=r.firstChild,d=i.firstChild,l=d.nextSibling;return s(d,o(ne,{class:"w-4 h-4"})),l.$$input=t=>L(t.currentTarget.value),w(t=>{var a=e.t("instanceShell.filesShell.search.placeholder"),n=e.t("instanceShell.filesShell.search.ariaLabel");return a!==t.e&&u(l,"placeholder",t.e=a),n!==t.t&&u(l,"aria-label",t.t=n),t},{e:void 0,t:void 0}),w(()=>l.value=E()),r})(),(()=>{var r=de(),i=r.firstChild,d=i.nextSibling;return s(i,()=>e.t("instanceShell.filesShell.fileListTitle")),s(d,()=>k().length),r})(),o(g,{get when(){return e.parentPath()},children:r=>(()=>{var i=he(),d=i.firstChild,l=d.firstChild;return i.$$click=()=>e.onLoadEntries(r()),w(()=>u(l,"title",r())),i})()}),o(g,{get when(){return y()},get children(){var r=V();return s(r,()=>e.t("instanceInfo.loading")),r}}),o(g,{get when(){return m(()=>!e.browserError()&&!y())()&&k().length>0},get fallback(){return m(()=>!y())()?m(()=>!!e.browserError())()?(()=>{var r=ue();return s(r,()=>e.browserError()),r})():(()=>{var r=V();return s(r,j),r})():void 0},get children(){return o(ee,{get each(){return k()},children:r=>(()=>{var i=ve(),d=i.firstChild,l=d.firstChild,t=l.firstChild,a=l.nextSibling,n=a.firstChild,c=n.firstChild,f=n.nextSibling;return i.$$click=()=>{if(r.type==="directory"){e.onLoadEntries(r.path);return}e.onRequestOpenFile(r.path)},s(t,()=>r.name),s(c,()=>r.type),f.$$click=v=>void B(r.path,v),s(f,o(ae,{class:"w-3 h-3"})),w(v=>{var F=`file-list-item ${e.browserSelectedPath()===r.path?"file-list-item-active":""}`,z=r.path,R=r.path,I=e.t("instanceShell.filesShell.actions.copyPath"),A=e.t("instanceShell.filesShell.actions.copyPath");return F!==v.e&&C(i,v.e=F),z!==v.t&&u(i,"title",v.t=z),R!==v.a&&u(l,"title",v.a=R),I!==v.o&&u(f,"title",v.o=I),A!==v.i&&u(f,"aria-label",v.i=A),v},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),i})()})}})],G=r=>{!(r.ctrlKey||r.metaKey)||r.key.toLowerCase()!=="s"||e.browserSelectedSaving()||!e.browserSelectedDirty()||(r.preventDefault(),T())};return m(()=>{const r=()=>e.browserSelectedPath()||e.browserPath(),i=()=>y()?e.t("instanceInfo.loading"):e.t("instanceShell.filesShell.viewerEmpty"),d=()=>(()=>{var l=fe(),t=l.firstChild;return s(t,o(g,{get when(){return e.browserSelectedLoading()},get fallback(){return o(g,{get when(){return e.browserSelectedError()},get fallback(){return o(g,{get when(){return m(()=>!!(e.browserSelectedPath()&&e.browserSelectedContent()!==null))()?{path:e.browserSelectedPath(),content:e.browserSelectedContent()}:null},get fallback(){return(()=>{var a=x(),n=a.firstChild;return s(n,i),a})()},children:a=>o(g,{get when(){return S()},get fallback(){return o(Z,{get fallback(){return(()=>{var n=x(),c=n.firstChild;return s(c,()=>e.t("instanceInfo.loading")),n})()},get children(){return o(ye,{get scopeKey(){return e.scopeKey()},get path(){return a().path},get content(){return a().content},get wordWrap(){return e.wordWrapMode()},get onSave(){return e.onSave},get onContentChange(){return e.onContentChange}})}})},get children(){var n=ge();n.$$mousedown=()=>b==null?void 0:b.focus(),n.$$keydown=G;var c=b;return typeof c=="function"?U(c,n):b=n,s(n,o(re,{get part(){return{type:"text",text:a().content}},get isDark(){return q()},escapeRawHtml:!0})),n}})})},children:a=>(()=>{var n=x(),c=n.firstChild;return s(c,a),n})()})},get children(){var a=x(),n=a.firstChild;return s(n,()=>e.t("instanceInfo.loading")),a}})),w(()=>C(t,S()?"file-viewer-content":"file-viewer-content file-viewer-content--monaco")),l})();return o(te,{get header(){return[(()=>{var l=be(),t=l.firstChild,a=t.firstChild,n=a.firstChild;return s(n,r),s(l,o(g,{get when(){return e.browserLoading()},get children(){var c=we();return s(c,()=>e.t("instanceInfo.loading")),c}}),null),s(l,o(g,{get when(){return e.browserError()},children:c=>(()=>{var f=$e();return s(f,c),f})()}),null),w(()=>u(a,"title",r())),l})(),(()=>{var l=Se();return l.$$click=()=>_()&&M(t=>!t),s(l,(()=>{var t=m(()=>!!S());return()=>t()?e.t("instanceShell.filesShell.showSource"):e.t("instanceShell.filesShell.previewMarkdown")})()),w(t=>{var a=`file-viewer-toolbar-button${S()?" active":""}`,n=!_();return a!==t.e&&C(l,t.e=a),n!==t.t&&(l.disabled=t.t=n),t},{e:void 0,t:void 0}),l})(),(()=>{var l=me();return l.$$click=()=>e.onWordWrapModeChange(e.wordWrapMode()==="on"?"off":"on"),s(l,o(oe,{class:"h-4 w-4"})),w(t=>{var a=`file-viewer-toolbar-icon-button${e.wordWrapMode()==="on"?" active":""}`,n=e.wordWrapMode()==="on"?e.t("instanceShell.filesShell.disableWordWrap"):e.t("instanceShell.filesShell.enableWordWrap"),c=e.wordWrapMode()==="on"?e.t("instanceShell.filesShell.disableWordWrap"):e.t("instanceShell.filesShell.enableWordWrap"),f=S();return a!==t.e&&C(l,t.e=a),n!==t.t&&u(l,"title",t.t=n),c!==t.a&&u(l,"aria-label",t.a=c),f!==t.o&&(l.disabled=t.o=f),t},{e:void 0,t:void 0,a:void 0,o:void 0}),l})(),(()=>{var l=Q();return l.$$click=T,s(l,o(g,{get when(){return e.browserSelectedSaving()},get fallback(){return o(le,{class:"h-4 w-4"})},get children(){return o(O,{class:"h-4 w-4 animate-spin"})}})),w(t=>{var a=e.t("instanceShell.rightPanel.actions.save")||"Save (Ctrl+S)",n=e.t("instanceShell.rightPanel.actions.save")||"Save",c=e.browserSelectedSaving()||!e.browserSelectedDirty();return a!==t.e&&u(l,"title",t.e=a),n!==t.t&&u(l,"aria-label",t.t=n),c!==t.a&&(l.disabled=t.a=c),t},{e:void 0,t:void 0,a:void 0}),l})(),(()=>{var l=Q();return l.$$click=()=>e.onRefresh(),s(l,o(O,{get class(){return`h-4 w-4${e.browserLoading()?" animate-spin":""}`}})),w(t=>{var a=e.t("instanceShell.rightPanel.actions.refresh"),n=e.t("instanceShell.rightPanel.actions.refresh"),c=e.browserLoading();return a!==t.e&&u(l,"title",t.e=a),n!==t.t&&u(l,"aria-label",t.t=n),c!==t.a&&(l.disabled=t.a=c),t},{e:void 0,t:void 0,a:void 0}),l})()]},list:{panel:()=>o(D,{}),overlay:()=>o(D,{})},get viewer(){return d()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.files")}})})};Y(["input","click","keydown","mousedown"]);export{De as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-
|
|
2
|
-
import{t as u,i as n,m as D,d as g,a as q,f as ae,h as ee,_ as re}from"./monaco-viewer-q26M2dw6.js";import{n as i,m as ce,a as P,c as b,S as k,F as te,z as oe,A as de}from"./git-diff-vendor-CSgooKT_.js";import{u as he}from"./index-byf9BI5h.js";import{I as ge,S as ue,G as fe,H as ve,R as me,J as ne,K as ie,N as be}from"./main-DMQeFbbj.js";import{A as $e}from"./align-justify-Bn8CDzlS.js";import{W as Ce}from"./wrap-text-DnuQ9rVl.js";import{S as we}from"./SplitFilePanel-CxDUaPOb.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const _e=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m15 5-3-3-3 3",key:"itvq4r"}]],Se=e=>i(ge,ce(e,{name:"UnfoldVertical",iconNode:_e}));var ye=u("<div class=file-viewer-toolbar><button type=button class=file-viewer-toolbar-icon-button></button><button type=button class=file-viewer-toolbar-icon-button></button><button type=button>");const xe=e=>{const{t:S}=he(),L=()=>e.viewMode==="split"?"unified":"split",V=()=>e.contextMode==="collapsed"?"expanded":"collapsed",O=()=>e.wordWrapMode==="on"?"off":"on",w=()=>L()==="split"?S("instanceShell.diff.switchToSplit"):S("instanceShell.diff.switchToUnified"),K=()=>V()==="collapsed"?S("instanceShell.diff.hideUnchanged"):S("instanceShell.diff.showFull"),B=()=>O()==="on"?S("instanceShell.diff.enableWordWrap"):S("instanceShell.diff.disableWordWrap");return(()=>{var U=ye(),T=U.firstChild,E=T.nextSibling,I=E.nextSibling;return T.$$click=()=>e.onViewModeChange(L()),n(T,(()=>{var c=D(()=>L()==="split");return()=>c()?i(ue,{class:"h-4 w-4","aria-hidden":"true"}):i($e,{class:"h-4 w-4","aria-hidden":"true"})})()),E.$$click=()=>e.onContextModeChange(V()),n(E,(()=>{var c=D(()=>V()==="collapsed");return()=>c()?i(fe,{class:"h-4 w-4","aria-hidden":"true"}):i(Se,{class:"h-4 w-4","aria-hidden":"true"})})()),I.$$click=()=>e.onWordWrapModeChange(O()),n(I,i(Ce,{class:"h-4 w-4","aria-hidden":"true"})),P(c=>{var N=w(),o=w(),d=K(),y=K(),x=`file-viewer-toolbar-icon-button${e.wordWrapMode==="on"?" active":""}`,W=B(),G=B();return N!==c.e&&g(T,"aria-label",c.e=N),o!==c.t&&g(T,"title",c.t=o),d!==c.a&&g(E,"aria-label",c.a=d),y!==c.o&&g(E,"title",c.o=y),x!==c.i&&q(I,c.i=x),W!==c.n&&g(I,"aria-label",c.n=W),G!==c.s&&g(I,"title",c.s=G),c},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),U})()};ae(["click"]);var H=u("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),Me=u('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),ke=u('<div class="p-3 text-xs text-secondary">'),Ie=u('<span class="git-change-row-action-bar git-change-row-action-bar-vertical">'),We=u('<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class=git-change-list-item-right><div class=file-list-item-stats><span class=file-list-item-additions>+</span><span class=file-list-item-deletions>-</span></div></div></div><div class=git-change-list-item-actions-zone><div class=git-change-list-item-actions><button type=button class=git-change-row-action><span aria-hidden=true><span class="git-change-row-action-bar git-change-row-action-bar-horizontal">'),Le=u("<div class=git-change-section-items>"),Ve=u("<div class=git-change-section><button type=button class=git-change-section-header><span class=git-change-section-header-main><span class=git-change-section-chevron></span><span class=git-change-section-title></span></span><span class=git-change-section-count>"),Te=u('<div class=git-change-section-items><div class=git-change-commit-box><div class=git-change-commit-input-wrap><textarea class=git-change-commit-input rows=1></textarea><button type=button class="git-change-commit-button git-change-commit-button-overlay">'),Ee=u("<div class=git-change-sections><div class=git-change-section><button type=button class=git-change-section-header><span class=git-change-section-header-main><span class=git-change-section-chevron></span><span class=git-change-section-title-row><span class=git-change-section-title></span></span></span><span class=git-change-section-count>"),Ae=u('<span class="status-indicator session-status-list worktree-indicator git-change-section-badge"><span class=worktree-indicator-label>'),Pe=u("<span class=files-tab-selected-path><span class=file-path-text>"),Re=u('<div class=files-tab-stats style="flex:0 0 auto"><span class="files-tab-stat files-tab-stat-additions"><span class=files-tab-stat-value>+</span></span><span class="files-tab-stat files-tab-stat-deletions"><span class=files-tab-stat-value>-'),ze=u("<button type=button class=files-header-icon-button style=margin-left:auto>"),De=u("<span class=text-error>");const Be=de(()=>re(()=>import("./monaco-viewer-q26M2dw6.js").then(e=>e.as),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),je=e=>{const S=b(()=>e.activeSessionId()),L=b(()=>!!(S()&&S()!=="info")),V=b(()=>L()?e.entries():null),O=b(()=>{const o=V();return Array.isArray(o)?[...o].sort((d,y)=>String(d.path||"").localeCompare(String(y.path||""))):[]}),w=b(()=>ve(O())),K=b(()=>w().reduce((o,d)=>(o.additions+=typeof d.additions=="number"?d.additions:0,o.deletions+=typeof d.deletions=="number"?d.deletions:0,o),{additions:0,deletions:0})),B=b(()=>w().filter(o=>o.section==="staged")),U=b(()=>w().filter(o=>o.section==="unstaged")),T=b(()=>B().length>0&&e.commitMessage().trim().length>0&&!e.commitSubmitting()),E=b(()=>{const o=w(),d=e.selectedItemId(),y=e.mostChangedItemId(),x=o.find(W=>W.id===d)||(y?o.find(W=>W.id===y):void 0);return(x==null?void 0:x.entry)??null}),I=b(()=>L()?V()===null?e.t("instanceShell.gitChanges.loading"):w().length===0?e.t("instanceShell.gitChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty"):e.t("instanceShell.gitChanges.noSessionSelected")),c=b(()=>e.selectedError()===e.t("instanceShell.gitChanges.binaryViewer"));return D(()=>{const o=K(),d=E(),y=w(),x=B(),W=U(),G=()=>(()=>{var t=Me(),r=t.firstChild;return n(r,i(k,{get when(){return e.selectedLoading()},get fallback(){return i(k,{get when(){return e.selectedError()},get fallback(){return i(k,{get when(){return D(()=>!!(d&&e.selectedBefore()!==null&&e.selectedAfter()!==null))()?{path:d.path,before:e.selectedBefore(),after:e.selectedAfter()}:null},get fallback(){return(()=>{var a=H(),s=a.firstChild;return n(s,I),a})()},children:a=>i(oe,{get fallback(){return(()=>{var s=H(),l=s.firstChild;return n(l,()=>e.t("instanceInfo.loading")),s})()},get children(){return i(Be,{get scopeKey(){return e.scopeKey()},get path(){return String(a().path||"")},get before(){return String(a().before||"")},get after(){return String(a().after||"")},get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrap(){return e.diffWordWrapMode()},get insertContextLabel(){return e.t("instanceShell.gitChanges.actions.insertContext")},get onRequestInsertContext(){return c()?void 0:s=>{const l=e.selectedItemId();if(!l)return;const f=w().find(v=>v.id===l);f&&e.onInsertContext(f,s)}}})}})})},children:a=>(()=>{var s=H(),l=s.firstChild;return n(l,a),s})()})},get children(){var a=H(),s=a.firstChild;return n(s,()=>e.t("instanceInfo.loading")),a}})),t})(),le=()=>(()=>{var t=ke();return n(t,I),t})(),J=t=>{const r=b(()=>e.selectedBulkItemIds().has(t.id)),a=t.section==="staged"?e.t("instanceShell.gitChanges.actions.unstage"):e.t("instanceShell.gitChanges.actions.stage"),s=()=>{t.section==="staged"?e.onUnstageFile(t):e.onStageFile(t)};return(()=>{var l=We(),f=l.firstChild,v=f.firstChild,R=v.firstChild,$=v.nextSibling,_=$.firstChild,C=_.firstChild;C.firstChild;var M=C.nextSibling;M.firstChild;var F=f.nextSibling,m=F.firstChild,A=m.firstChild,z=A.firstChild;return z.firstChild,l.$$click=h=>e.onRowClick(t,h),l.$$mousedown=h=>{(h.shiftKey||h.ctrlKey||h.metaKey)&&h.preventDefault()},n(R,()=>t.path),n(C,()=>t.additions,null),n(M,()=>t.deletions,null),A.$$click=h=>{h.stopPropagation(),s()},g(A,"title",a),g(A,"aria-label",a),n(z,i(k,{get when(){return t.section!=="staged"},get children(){return Ie()}}),null),P(h=>{var Q=`file-list-item git-change-list-item ${e.selectedItemId()===t.id?"file-list-item-active":""} ${r()?"git-change-list-item-bulk-selected":""}`,X=t.path,Y=t.path,Z=t.path,p=`git-change-row-action-glyph ${t.section==="staged"?"git-change-row-action-glyph-minus":"git-change-row-action-glyph-plus"}`;return Q!==h.e&&q(l,h.e=Q),X!==h.t&&g(l,"title",h.t=X),Y!==h.a&&g(f,"title",h.a=Y),Z!==h.o&&g(v,"title",h.o=Z),p!==h.i&&q(z,h.i=p),h},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),l})()},se=(t,r,a,s)=>(()=>{var l=Ve(),f=l.firstChild,v=f.firstChild,R=v.firstChild,$=R.nextSibling,_=v.nextSibling;return ee(f,"click",s,!0),n(R,a?i(ne,{class:"h-3.5 w-3.5"}):i(ie,{class:"h-3.5 w-3.5"})),n($,t),n(_,()=>r.length),n(l,i(k,{when:a,get children(){var C=Le();return n(C,i(te,{each:r,children:M=>J(M)})),C}}),null),l})(),j=()=>i(k,{get when(){return y.length>0},get fallback(){return le()},get children(){var t=Ee(),r=t.firstChild,a=r.firstChild,s=a.firstChild,l=s.firstChild,f=l.nextSibling,v=f.firstChild,R=s.nextSibling;return ee(a,"click",e.onToggleStagedOpen,!0),n(l,(()=>{var $=D(()=>!!e.stagedOpen());return()=>$()?i(ne,{class:"h-3.5 w-3.5"}):i(ie,{class:"h-3.5 w-3.5"})})()),n(v,()=>e.t("instanceShell.gitChanges.sections.staged")),n(f,i(k,{get when(){return e.branchLabel()},children:$=>(()=>{var _=Ae(),C=_.firstChild;return n(_,i(be,{class:"w-3.5 h-3.5","aria-hidden":"true"}),C),n(C,$),P(()=>g(_,"title",`Branch: ${$()}`)),_})()}),null),n(R,()=>x.length),n(r,i(k,{get when(){return e.stagedOpen()},get children(){var $=Te(),_=$.firstChild,C=_.firstChild,M=C.firstChild,F=M.nextSibling;return M.$$input=m=>e.onCommitMessageInput(m.currentTarget.value),F.$$click=()=>e.onSubmitCommit(),n(F,(()=>{var m=D(()=>!!e.commitSubmitting());return()=>m()?e.t("instanceShell.gitChanges.commit.submitting"):e.t("instanceShell.gitChanges.commit.submit")})()),n($,i(te,{each:x,children:m=>J(m)}),null),P(m=>{var A=e.t("instanceShell.gitChanges.commit.placeholder"),z=!T();return A!==m.e&&g(M,"placeholder",m.e=A),z!==m.t&&(F.disabled=m.t=z),m},{e:void 0,t:void 0}),P(()=>M.value=e.commitMessage()),$}}),null),n(t,()=>se(e.t("instanceShell.gitChanges.sections.unstaged"),W,e.unstagedOpen(),e.onToggleUnstagedOpen),null),t}});return i(we,{get header(){return[(()=>{var t=Pe(),r=t.firstChild;return n(r,()=>(d==null?void 0:d.path)||e.t("instanceShell.rightPanel.tabs.gitChanges")),P(()=>g(t,"title",(d==null?void 0:d.path)||e.t("instanceShell.rightPanel.tabs.gitChanges"))),t})(),(()=>{var t=Re(),r=t.firstChild,a=r.firstChild;a.firstChild;var s=r.nextSibling,l=s.firstChild;return l.firstChild,n(a,()=>o.additions,null),n(l,()=>o.deletions,null),n(t,i(k,{get when(){return e.statusError()},children:f=>(()=>{var v=De();return n(v,f),v})()}),null),t})(),(()=>{var t=ze();return t.$$click=()=>e.onRefresh(),n(t,i(me,{get class(){return`h-4 w-4${e.statusLoading()?" animate-spin":""}`}})),P(r=>{var a=e.t("instanceShell.rightPanel.actions.refresh"),s=e.t("instanceShell.rightPanel.actions.refresh"),l=!L()||e.statusLoading()||V()===null;return a!==r.e&&g(t,"title",r.e=a),s!==r.t&&g(t,"aria-label",r.t=s),l!==r.a&&(t.disabled=r.a=l),r},{e:void 0,t:void 0,a:void 0}),t})(),i(xe,{get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrapMode(){return e.diffWordWrapMode()},get onViewModeChange(){return e.onViewModeChange},get onContextModeChange(){return e.onContextModeChange},get onWordWrapModeChange(){return e.onWordWrapModeChange}})]},list:{panel:j,overlay:j},get viewer(){return G()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.gitChanges")}})})};ae(["mousedown","click","input"]);export{je as default};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-B3Jl6a5p.js","assets/git-diff-vendor-CSgooKT_.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as u,i as n,m as D,d as g,a as q,f as ae,h as ee,_ as re}from"./monaco-viewer-B3Jl6a5p.js";import{n as i,m as ce,a as P,c as b,S as k,F as te,z as oe,A as de}from"./git-diff-vendor-CSgooKT_.js";import{u as he}from"./index-DHYmm6_R.js";import{I as ge,S as ue,G as fe,H as ve,R as me,J as ne,K as ie,N as be}from"./main-BYOHwhSs.js";import{A as $e}from"./align-justify-BBbFmxDX.js";import{W as Ce}from"./wrap-text-Clu8BV6B.js";import{S as we}from"./SplitFilePanel-CBrsPjMw.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const _e=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m15 5-3-3-3 3",key:"itvq4r"}]],Se=e=>i(ge,ce(e,{name:"UnfoldVertical",iconNode:_e}));var ye=u("<div class=file-viewer-toolbar><button type=button class=file-viewer-toolbar-icon-button></button><button type=button class=file-viewer-toolbar-icon-button></button><button type=button>");const xe=e=>{const{t:S}=he(),L=()=>e.viewMode==="split"?"unified":"split",V=()=>e.contextMode==="collapsed"?"expanded":"collapsed",O=()=>e.wordWrapMode==="on"?"off":"on",w=()=>L()==="split"?S("instanceShell.diff.switchToSplit"):S("instanceShell.diff.switchToUnified"),K=()=>V()==="collapsed"?S("instanceShell.diff.hideUnchanged"):S("instanceShell.diff.showFull"),B=()=>O()==="on"?S("instanceShell.diff.enableWordWrap"):S("instanceShell.diff.disableWordWrap");return(()=>{var U=ye(),T=U.firstChild,E=T.nextSibling,I=E.nextSibling;return T.$$click=()=>e.onViewModeChange(L()),n(T,(()=>{var c=D(()=>L()==="split");return()=>c()?i(ue,{class:"h-4 w-4","aria-hidden":"true"}):i($e,{class:"h-4 w-4","aria-hidden":"true"})})()),E.$$click=()=>e.onContextModeChange(V()),n(E,(()=>{var c=D(()=>V()==="collapsed");return()=>c()?i(fe,{class:"h-4 w-4","aria-hidden":"true"}):i(Se,{class:"h-4 w-4","aria-hidden":"true"})})()),I.$$click=()=>e.onWordWrapModeChange(O()),n(I,i(Ce,{class:"h-4 w-4","aria-hidden":"true"})),P(c=>{var N=w(),o=w(),d=K(),y=K(),x=`file-viewer-toolbar-icon-button${e.wordWrapMode==="on"?" active":""}`,W=B(),G=B();return N!==c.e&&g(T,"aria-label",c.e=N),o!==c.t&&g(T,"title",c.t=o),d!==c.a&&g(E,"aria-label",c.a=d),y!==c.o&&g(E,"title",c.o=y),x!==c.i&&q(I,c.i=x),W!==c.n&&g(I,"aria-label",c.n=W),G!==c.s&&g(I,"title",c.s=G),c},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),U})()};ae(["click"]);var H=u("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),Me=u('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),ke=u('<div class="p-3 text-xs text-secondary">'),Ie=u('<span class="git-change-row-action-bar git-change-row-action-bar-vertical">'),We=u('<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class=git-change-list-item-right><div class=file-list-item-stats><span class=file-list-item-additions>+</span><span class=file-list-item-deletions>-</span></div></div></div><div class=git-change-list-item-actions-zone><div class=git-change-list-item-actions><button type=button class=git-change-row-action><span aria-hidden=true><span class="git-change-row-action-bar git-change-row-action-bar-horizontal">'),Le=u("<div class=git-change-section-items>"),Ve=u("<div class=git-change-section><button type=button class=git-change-section-header><span class=git-change-section-header-main><span class=git-change-section-chevron></span><span class=git-change-section-title></span></span><span class=git-change-section-count>"),Te=u('<div class=git-change-section-items><div class=git-change-commit-box><div class=git-change-commit-input-wrap><textarea class=git-change-commit-input rows=1></textarea><button type=button class="git-change-commit-button git-change-commit-button-overlay">'),Ee=u("<div class=git-change-sections><div class=git-change-section><button type=button class=git-change-section-header><span class=git-change-section-header-main><span class=git-change-section-chevron></span><span class=git-change-section-title-row><span class=git-change-section-title></span></span></span><span class=git-change-section-count>"),Ae=u('<span class="status-indicator session-status-list worktree-indicator git-change-section-badge"><span class=worktree-indicator-label>'),Pe=u("<span class=files-tab-selected-path><span class=file-path-text>"),Re=u('<div class=files-tab-stats style="flex:0 0 auto"><span class="files-tab-stat files-tab-stat-additions"><span class=files-tab-stat-value>+</span></span><span class="files-tab-stat files-tab-stat-deletions"><span class=files-tab-stat-value>-'),ze=u("<button type=button class=files-header-icon-button style=margin-left:auto>"),De=u("<span class=text-error>");const Be=de(()=>re(()=>import("./monaco-viewer-B3Jl6a5p.js").then(e=>e.as),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),je=e=>{const S=b(()=>e.activeSessionId()),L=b(()=>!!(S()&&S()!=="info")),V=b(()=>L()?e.entries():null),O=b(()=>{const o=V();return Array.isArray(o)?[...o].sort((d,y)=>String(d.path||"").localeCompare(String(y.path||""))):[]}),w=b(()=>ve(O())),K=b(()=>w().reduce((o,d)=>(o.additions+=typeof d.additions=="number"?d.additions:0,o.deletions+=typeof d.deletions=="number"?d.deletions:0,o),{additions:0,deletions:0})),B=b(()=>w().filter(o=>o.section==="staged")),U=b(()=>w().filter(o=>o.section==="unstaged")),T=b(()=>B().length>0&&e.commitMessage().trim().length>0&&!e.commitSubmitting()),E=b(()=>{const o=w(),d=e.selectedItemId(),y=e.mostChangedItemId(),x=o.find(W=>W.id===d)||(y?o.find(W=>W.id===y):void 0);return(x==null?void 0:x.entry)??null}),I=b(()=>L()?V()===null?e.t("instanceShell.gitChanges.loading"):w().length===0?e.t("instanceShell.gitChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty"):e.t("instanceShell.gitChanges.noSessionSelected")),c=b(()=>e.selectedError()===e.t("instanceShell.gitChanges.binaryViewer"));return D(()=>{const o=K(),d=E(),y=w(),x=B(),W=U(),G=()=>(()=>{var t=Me(),r=t.firstChild;return n(r,i(k,{get when(){return e.selectedLoading()},get fallback(){return i(k,{get when(){return e.selectedError()},get fallback(){return i(k,{get when(){return D(()=>!!(d&&e.selectedBefore()!==null&&e.selectedAfter()!==null))()?{path:d.path,before:e.selectedBefore(),after:e.selectedAfter()}:null},get fallback(){return(()=>{var a=H(),s=a.firstChild;return n(s,I),a})()},children:a=>i(oe,{get fallback(){return(()=>{var s=H(),l=s.firstChild;return n(l,()=>e.t("instanceInfo.loading")),s})()},get children(){return i(Be,{get scopeKey(){return e.scopeKey()},get path(){return String(a().path||"")},get before(){return String(a().before||"")},get after(){return String(a().after||"")},get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrap(){return e.diffWordWrapMode()},get insertContextLabel(){return e.t("instanceShell.gitChanges.actions.insertContext")},get onRequestInsertContext(){return c()?void 0:s=>{const l=e.selectedItemId();if(!l)return;const f=w().find(v=>v.id===l);f&&e.onInsertContext(f,s)}}})}})})},children:a=>(()=>{var s=H(),l=s.firstChild;return n(l,a),s})()})},get children(){var a=H(),s=a.firstChild;return n(s,()=>e.t("instanceInfo.loading")),a}})),t})(),le=()=>(()=>{var t=ke();return n(t,I),t})(),J=t=>{const r=b(()=>e.selectedBulkItemIds().has(t.id)),a=t.section==="staged"?e.t("instanceShell.gitChanges.actions.unstage"):e.t("instanceShell.gitChanges.actions.stage"),s=()=>{t.section==="staged"?e.onUnstageFile(t):e.onStageFile(t)};return(()=>{var l=We(),f=l.firstChild,v=f.firstChild,R=v.firstChild,$=v.nextSibling,_=$.firstChild,C=_.firstChild;C.firstChild;var M=C.nextSibling;M.firstChild;var F=f.nextSibling,m=F.firstChild,A=m.firstChild,z=A.firstChild;return z.firstChild,l.$$click=h=>e.onRowClick(t,h),l.$$mousedown=h=>{(h.shiftKey||h.ctrlKey||h.metaKey)&&h.preventDefault()},n(R,()=>t.path),n(C,()=>t.additions,null),n(M,()=>t.deletions,null),A.$$click=h=>{h.stopPropagation(),s()},g(A,"title",a),g(A,"aria-label",a),n(z,i(k,{get when(){return t.section!=="staged"},get children(){return Ie()}}),null),P(h=>{var Q=`file-list-item git-change-list-item ${e.selectedItemId()===t.id?"file-list-item-active":""} ${r()?"git-change-list-item-bulk-selected":""}`,X=t.path,Y=t.path,Z=t.path,p=`git-change-row-action-glyph ${t.section==="staged"?"git-change-row-action-glyph-minus":"git-change-row-action-glyph-plus"}`;return Q!==h.e&&q(l,h.e=Q),X!==h.t&&g(l,"title",h.t=X),Y!==h.a&&g(f,"title",h.a=Y),Z!==h.o&&g(v,"title",h.o=Z),p!==h.i&&q(z,h.i=p),h},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),l})()},se=(t,r,a,s)=>(()=>{var l=Ve(),f=l.firstChild,v=f.firstChild,R=v.firstChild,$=R.nextSibling,_=v.nextSibling;return ee(f,"click",s,!0),n(R,a?i(ne,{class:"h-3.5 w-3.5"}):i(ie,{class:"h-3.5 w-3.5"})),n($,t),n(_,()=>r.length),n(l,i(k,{when:a,get children(){var C=Le();return n(C,i(te,{each:r,children:M=>J(M)})),C}}),null),l})(),j=()=>i(k,{get when(){return y.length>0},get fallback(){return le()},get children(){var t=Ee(),r=t.firstChild,a=r.firstChild,s=a.firstChild,l=s.firstChild,f=l.nextSibling,v=f.firstChild,R=s.nextSibling;return ee(a,"click",e.onToggleStagedOpen,!0),n(l,(()=>{var $=D(()=>!!e.stagedOpen());return()=>$()?i(ne,{class:"h-3.5 w-3.5"}):i(ie,{class:"h-3.5 w-3.5"})})()),n(v,()=>e.t("instanceShell.gitChanges.sections.staged")),n(f,i(k,{get when(){return e.branchLabel()},children:$=>(()=>{var _=Ae(),C=_.firstChild;return n(_,i(be,{class:"w-3.5 h-3.5","aria-hidden":"true"}),C),n(C,$),P(()=>g(_,"title",`Branch: ${$()}`)),_})()}),null),n(R,()=>x.length),n(r,i(k,{get when(){return e.stagedOpen()},get children(){var $=Te(),_=$.firstChild,C=_.firstChild,M=C.firstChild,F=M.nextSibling;return M.$$input=m=>e.onCommitMessageInput(m.currentTarget.value),F.$$click=()=>e.onSubmitCommit(),n(F,(()=>{var m=D(()=>!!e.commitSubmitting());return()=>m()?e.t("instanceShell.gitChanges.commit.submitting"):e.t("instanceShell.gitChanges.commit.submit")})()),n($,i(te,{each:x,children:m=>J(m)}),null),P(m=>{var A=e.t("instanceShell.gitChanges.commit.placeholder"),z=!T();return A!==m.e&&g(M,"placeholder",m.e=A),z!==m.t&&(F.disabled=m.t=z),m},{e:void 0,t:void 0}),P(()=>M.value=e.commitMessage()),$}}),null),n(t,()=>se(e.t("instanceShell.gitChanges.sections.unstaged"),W,e.unstagedOpen(),e.onToggleUnstagedOpen),null),t}});return i(we,{get header(){return[(()=>{var t=Pe(),r=t.firstChild;return n(r,()=>(d==null?void 0:d.path)||e.t("instanceShell.rightPanel.tabs.gitChanges")),P(()=>g(t,"title",(d==null?void 0:d.path)||e.t("instanceShell.rightPanel.tabs.gitChanges"))),t})(),(()=>{var t=Re(),r=t.firstChild,a=r.firstChild;a.firstChild;var s=r.nextSibling,l=s.firstChild;return l.firstChild,n(a,()=>o.additions,null),n(l,()=>o.deletions,null),n(t,i(k,{get when(){return e.statusError()},children:f=>(()=>{var v=De();return n(v,f),v})()}),null),t})(),(()=>{var t=ze();return t.$$click=()=>e.onRefresh(),n(t,i(me,{get class(){return`h-4 w-4${e.statusLoading()?" animate-spin":""}`}})),P(r=>{var a=e.t("instanceShell.rightPanel.actions.refresh"),s=e.t("instanceShell.rightPanel.actions.refresh"),l=!L()||e.statusLoading()||V()===null;return a!==r.e&&g(t,"title",r.e=a),s!==r.t&&g(t,"aria-label",r.t=s),l!==r.a&&(t.disabled=r.a=l),r},{e:void 0,t:void 0,a:void 0}),t})(),i(xe,{get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrapMode(){return e.diffWordWrapMode()},get onViewModeChange(){return e.onViewModeChange},get onContextModeChange(){return e.onContextModeChange},get onWordWrapModeChange(){return e.onWordWrapModeChange}})]},list:{panel:j,overlay:j},get viewer(){return G()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.gitChanges")}})})};ae(["mousedown","click","input"]);export{je as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as d,i as l,d as m,h as s,m as b,g as _,f as w}from"./monaco-viewer-
|
|
1
|
+
import{t as d,i as l,d as m,h as s,m as b,g as _,f as w}from"./monaco-viewer-B3Jl6a5p.js";import{a as g,n as r,S as n}from"./git-diff-vendor-CSgooKT_.js";import{u as S}from"./index-DHYmm6_R.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 fe,P as ze,M as Ve,t as F,i as g,a as Xe,d as L,f as Ye}from"./monaco-viewer-q26M2dw6.js";import{n as a,m as T,q as ae,s as O,d as $,b as B,o as E,c as k,k as le,S as J,l as ce,t as Ge,w as Se,a as ke,F as Pe}from"./git-diff-vendor-CSgooKT_.js";import{I as me,U as Te,W as H,X as Ie,Y as $e,Z as he,_ as Je,$ as ge,a0 as re,a1 as de,a2 as De,a3 as te,a4 as ne,a5 as Ze,a6 as be,a7 as Qe,a8 as et,a9 as M,aa as ve,ab as tt,ac as nt,ad as ot,ae as st,af as A,ag as it,ah as rt,ai as at,aj as lt,ak as ct,al as Z,J as dt,am as ut,an as pe,ao as gt,ap as pt,aq as ht,ar as ft,as as mt}from"./main-DMQeFbbj.js";import{u as bt}from"./index-byf9BI5h.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const vt=[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}]],yt=e=>a(me,T(e,{name:"BellRing",iconNode:vt})),xt=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],Ct=e=>a(me,T(e,{name:"TerminalSquare",iconNode:xt})),wt=[["polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2",key:"h1p8hx"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],St=e=>a(me,T(e,{name:"XOctagon",iconNode:wt}));var Pt={};ve(Pt,{Arrow:()=>Te,Content:()=>_e,Portal:()=>Me,Root:()=>Ae,Tooltip:()=>ee,Trigger:()=>Ee,useTooltipContext:()=>ue});var Oe=le();function ue(){const e=ce(Oe);if(e===void 0)throw new Error("[kobalte]: `useTooltipContext` must be used within a `Tooltip` component");return e}function _e(e){const i=ue(),c=H({id:i.generateId("content")},e),[l,n]=O(c,["ref","style"]);return B(()=>E(i.registerContentId(n.id))),a(J,{get when(){return i.contentPresent()},get children(){return a(De.Positioner,{get children(){return a(Ze,T({ref(s){var t=te(o=>{i.setContentRef(o)},l.ref);typeof t=="function"&&t(s)},role:"tooltip",disableOutsidePointerEvents:!1,get style(){return be({"--kb-tooltip-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},l.style)},onFocusOutside:s=>s.preventDefault(),onDismiss:()=>i.hideTooltip(!0)},()=>i.dataset(),n))}})}})}function Me(e){const i=ue();return a(J,{get when(){return i.contentPresent()},get children(){return a(ze,e)}})}function kt(e,i,c){const l=e.split("-")[0],n=i.getBoundingClientRect(),s=c.getBoundingClientRect(),t=[],o=n.left+n.width/2,r=n.top+n.height/2;switch(l){case"top":t.push([n.left,r]),t.push([s.left,s.bottom]),t.push([s.left,s.top]),t.push([s.right,s.top]),t.push([s.right,s.bottom]),t.push([n.right,r]);break;case"right":t.push([o,n.top]),t.push([s.left,s.top]),t.push([s.right,s.top]),t.push([s.right,s.bottom]),t.push([s.left,s.bottom]),t.push([o,n.bottom]);break;case"bottom":t.push([n.left,r]),t.push([s.left,s.top]),t.push([s.left,s.bottom]),t.push([s.right,s.bottom]),t.push([s.right,s.top]),t.push([n.right,r]);break;case"left":t.push([o,n.top]),t.push([s.right,s.top]),t.push([s.left,s.top]),t.push([s.left,s.bottom]),t.push([s.right,s.bottom]),t.push([o,n.bottom]);break}return t}var j={},Tt=0,X=!1,_,Q,Y;function Ae(e){const i=`tooltip-${ae()}`,c=`${++Tt}`,l=H({id:i,openDelay:700,closeDelay:300,skipDelayDuration:300},e),[n,s]=O(l,["id","open","defaultOpen","onOpenChange","disabled","triggerOnFocusOnly","openDelay","closeDelay","skipDelayDuration","ignoreSafeArea","forceMount"]);let t;const[o,r]=$(),[d,m]=$(),[h,y]=$(),[b,x]=$(s.placement),v=Ie({open:()=>n.open,defaultOpen:()=>n.defaultOpen,onOpenChange:f=>{var D;return(D=n.onOpenChange)==null?void 0:D.call(n,f)}}),{present:w}=$e({show:()=>n.forceMount||v.isOpen(),element:()=>h()??null}),p=()=>{j[c]=u},S=()=>{for(const f in j)f!==c&&(j[f](!0),delete j[f])},u=(f=!1)=>{f||n.closeDelay&&n.closeDelay<=0?(window.clearTimeout(t),t=void 0,v.close()):t||(t=window.setTimeout(()=>{t=void 0,v.close()},n.closeDelay)),window.clearTimeout(_),_=void 0,n.skipDelayDuration&&n.skipDelayDuration>=0&&(Y=window.setTimeout(()=>{window.clearTimeout(Y),Y=void 0},n.skipDelayDuration)),X&&(window.clearTimeout(Q),Q=window.setTimeout(()=>{delete j[c],Q=void 0,X=!1},n.closeDelay))},R=()=>{clearTimeout(t),t=void 0,S(),p(),X=!0,v.open(),window.clearTimeout(_),_=void 0,window.clearTimeout(Q),Q=void 0,window.clearTimeout(Y),Y=void 0},N=()=>{S(),p(),!v.isOpen()&&!_&&!X?_=window.setTimeout(()=>{_=void 0,X=!0,R()},n.openDelay):v.isOpen()||R()},W=(f=!1)=>{!f&&n.openDelay&&n.openDelay>0&&!t&&!Y?N():R()},z=()=>{window.clearTimeout(_),_=void 0,X=!1},q=()=>{window.clearTimeout(t),t=void 0},K=f=>ge(d(),f)||ge(h(),f),V=f=>{const D=d(),U=h();if(!(!D||!U))return kt(f,D,U)},C=f=>{const D=f.target;if(K(D)){q();return}if(!n.ignoreSafeArea){const U=V(b());if(U&&Qe(et(f),U)){q();return}}t||u()};B(()=>{if(!v.isOpen())return;const f=he();f.addEventListener("pointermove",C,!0),E(()=>{f.removeEventListener("pointermove",C,!0)})}),B(()=>{const f=d();if(!f||!v.isOpen())return;const D=qe=>{const je=qe.target;ge(je,f)&&u(!0)},U=Je();U.addEventListener("scroll",D,{capture:!0}),E(()=>{U.removeEventListener("scroll",D,{capture:!0})})}),E(()=>{clearTimeout(t),j[c]&&delete j[c]});const I={dataset:k(()=>({"data-expanded":v.isOpen()?"":void 0,"data-closed":v.isOpen()?void 0:""})),isOpen:v.isOpen,isDisabled:()=>n.disabled??!1,triggerOnFocusOnly:()=>n.triggerOnFocusOnly??!1,contentId:o,contentPresent:w,openTooltip:W,hideTooltip:u,cancelOpening:z,generateId:de(()=>l.id),registerContentId:re(r),isTargetOnTooltip:K,setTriggerRef:m,setContentRef:y};return a(Oe.Provider,{value:I,get children(){return a(De,T({anchorRef:d,contentRef:h,onCurrentPlacementChange:x},s))}})}function Ee(e){let i;const c=ue(),[l,n]=O(e,["ref","onPointerEnter","onPointerLeave","onPointerDown","onClick","onFocus","onBlur"]);let s=!1,t=!1,o=!1;const r=()=>{s=!1},d=()=>{!c.isOpen()&&(t||o)&&c.openTooltip(o)},m=p=>{c.isOpen()&&!t&&!o&&c.hideTooltip(p)},h=p=>{M(p,l.onPointerEnter),!(p.pointerType==="touch"||c.triggerOnFocusOnly()||c.isDisabled()||p.defaultPrevented)&&(t=!0,d())},y=p=>{M(p,l.onPointerLeave),p.pointerType!=="touch"&&(t=!1,o=!1,c.isOpen()?m():c.cancelOpening())},b=p=>{M(p,l.onPointerDown),s=!0,he(i).addEventListener("pointerup",r,{once:!0})},x=p=>{M(p,l.onClick),t=!1,o=!1,m(!0)},v=p=>{M(p,l.onFocus),!(c.isDisabled()||p.defaultPrevented||s)&&(o=!0,d())},w=p=>{M(p,l.onBlur);const S=p.relatedTarget;c.isTargetOnTooltip(S)||(t=!1,o=!1,m(!0))};return E(()=>{he(i).removeEventListener("pointerup",r)}),a(ne,T({as:"button",ref(p){var S=te(u=>{c.setTriggerRef(u),i=u},l.ref);typeof S=="function"&&S(p)},get"aria-describedby"(){return fe(()=>!!c.isOpen())()?c.contentId():void 0},onPointerEnter:h,onPointerLeave:y,onPointerDown:b,onClick:x,onFocus:v,onBlur:w},()=>c.dataset(),n))}var ee=Object.assign(Ae,{Arrow:Te,Content:_e,Portal:Me,Trigger:Ee}),It={};ve(It,{Collapsible:()=>$t,Content:()=>ye,Root:()=>xe,Trigger:()=>Ce,useCollapsibleContext:()=>oe});var Fe=le();function oe(){const e=ce(Fe);if(e===void 0)throw new Error("[kobalte]: `useCollapsibleContext` must be used within a `Collapsible.Root` component");return e}function ye(e){const[i,c]=$(),l=oe(),n=H({id:l.generateId("content")},e),[s,t]=O(n,["ref","id","style"]),{present:o}=$e({show:l.shouldMount,element:()=>i()??null}),[r,d]=$(0),[m,h]=$(0);let b=l.isOpen()||o();return Ge(()=>{const x=requestAnimationFrame(()=>{b=!1});E(()=>{cancelAnimationFrame(x)})}),B(Se(o,()=>{if(!i())return;i().style.transitionDuration="0s",i().style.animationName="none";const x=i().getBoundingClientRect();d(x.height),h(x.width),b||(i().style.transitionDuration="",i().style.animationName="")})),B(Se(l.isOpen,x=>{!x&&i()&&(i().style.transitionDuration="",i().style.animationName="")},{defer:!0})),B(()=>E(l.registerContentId(s.id))),a(J,{get when(){return o()},get children(){return a(ne,T({as:"div",ref(x){var v=te(c,s.ref);typeof v=="function"&&v(x)},get id(){return s.id},get style(){return be({"--kb-collapsible-content-height":r()?`${r()}px`:void 0,"--kb-collapsible-content-width":m()?`${m()}px`:void 0},s.style)}},()=>l.dataset(),t))}})}function xe(e){const i=`collapsible-${ae()}`,c=H({id:i},e),[l,n]=O(c,["open","defaultOpen","onOpenChange","disabled","forceMount"]),[s,t]=$(),o=Ie({open:()=>l.open,defaultOpen:()=>l.defaultOpen,onOpenChange:m=>{var h;return(h=l.onOpenChange)==null?void 0:h.call(l,m)}}),r=k(()=>({"data-expanded":o.isOpen()?"":void 0,"data-closed":o.isOpen()?void 0:"","data-disabled":l.disabled?"":void 0})),d={dataset:r,isOpen:o.isOpen,disabled:()=>l.disabled??!1,shouldMount:()=>l.forceMount||o.isOpen(),contentId:s,toggle:o.toggle,generateId:de(()=>n.id),registerContentId:re(t)};return a(Fe.Provider,{value:d,get children(){return a(ne,T({as:"div"},r,n))}})}function Ce(e){const i=oe(),[c,l]=O(e,["onClick"]);return a(tt,T({get"aria-expanded"(){return i.isOpen()},get"aria-controls"(){return fe(()=>!!i.isOpen())()?i.contentId():void 0},get disabled(){return i.disabled()},onClick:s=>{M(s,c.onClick),i.toggle()}},()=>i.dataset(),l))}var $t=Object.assign(xe,{Content:ye,Trigger:Ce}),G={};ve(G,{Accordion:()=>Dt,Content:()=>Ue,Header:()=>Le,Item:()=>He,Root:()=>Ne,Trigger:()=>We,useAccordionContext:()=>we});var Re=le();function Ke(){const e=ce(Re);if(e===void 0)throw new Error("[kobalte]: `useAccordionItemContext` must be used within a `Accordion.Item` component");return e}function Ue(e){const i=Ke(),c=i.generateId("content"),l=H({id:c},e),[n,s]=O(l,["id","style"]);return B(()=>E(i.registerContentId(n.id))),a(ye,T({role:"region",get"aria-labelledby"(){return i.triggerId()},get style(){return be({"--kb-accordion-content-height":"var(--kb-collapsible-content-height)","--kb-accordion-content-width":"var(--kb-collapsible-content-width)"},n.style)}},s))}function Le(e){const i=oe();return a(ne,T({as:"h3"},()=>i.dataset(),e))}var Be=le();function we(){const e=ce(Be);if(e===void 0)throw new Error("[kobalte]: `useAccordionContext` must be used within a `Accordion.Root` component");return e}function He(e){const i=we(),c=`${i.generateId("item")}-${ae()}`,l=H({id:c},e),[n,s]=O(l,["value","disabled"]),[t,o]=$(),[r,d]=$(),m=()=>i.listState().selectionManager(),h=()=>m().isSelected(n.value),y={value:()=>n.value,triggerId:t,contentId:r,generateId:de(()=>s.id),registerTriggerId:re(o),registerContentId:re(d)};return a(Re.Provider,{value:y,get children(){return a(xe,T({get open(){return h()},get disabled(){return n.disabled}},s))}})}function Ne(e){let i;const c=`accordion-${ae()}`,l=H({id:c,multiple:!1,collapsible:!1,shouldFocusWrap:!0},e),[n,s]=O(l,["id","ref","value","defaultValue","onChange","multiple","collapsible","shouldFocusWrap","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]),[t,o]=$([]),{DomCollectionProvider:r}=nt({items:t,onItemsChange:o}),d=ot({selectedKeys:()=>n.value,defaultSelectedKeys:()=>n.defaultValue,onSelectionChange:y=>{var b;return(b=n.onChange)==null?void 0:b.call(n,Array.from(y))},disallowEmptySelection:()=>!n.multiple&&!n.collapsible,selectionMode:()=>n.multiple?"multiple":"single",dataSource:t});d.selectionManager().setFocusedKey("item-1");const m=st({selectionManager:()=>d.selectionManager(),collection:()=>d.collection(),disallowEmptySelection:()=>d.selectionManager().disallowEmptySelection(),shouldFocusWrap:()=>n.shouldFocusWrap,disallowTypeAhead:!0,allowsTabNavigation:!0},()=>i),h={listState:()=>d,generateId:de(()=>n.id)};return a(r,{get children(){return a(Be.Provider,{value:h,get children(){return a(ne,T({as:"div",get id(){return n.id},ref(y){var b=te(x=>i=x,n.ref);typeof b=="function"&&b(y)},get onKeyDown(){return A([n.onKeyDown,m.onKeyDown])},get onMouseDown(){return A([n.onMouseDown,m.onMouseDown])},get onFocusIn(){return A([n.onFocusIn])},get onFocusOut(){return A([n.onFocusOut,m.onFocusOut])}},s))}})}})}function We(e){let i;const c=we(),l=Ke(),n=oe(),s=l.generateId("trigger"),t=H({id:s},e),[o,r]=O(t,["ref","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);it({getItem:()=>({ref:()=>i,type:"item",key:l.value(),textValue:"",disabled:n.disabled()})});const d=rt({key:()=>l.value(),selectionManager:()=>c.listState().selectionManager(),disabled:()=>n.disabled(),shouldSelectOnPressUp:!0},()=>i),m=h=>{["Enter"," "].includes(h.key)&&h.preventDefault(),M(h,o.onKeyDown),M(h,d.onKeyDown)};return B(()=>E(l.registerTriggerId(r.id))),a(Ce,T({ref(h){var y=te(b=>i=b,o.ref);typeof y=="function"&&y(h)},get"data-key"(){return d.dataKey()},get onPointerDown(){return A([o.onPointerDown,d.onPointerDown])},get onPointerUp(){return A([o.onPointerUp,d.onPointerUp])},get onClick(){return A([o.onClick,d.onClick])},onKeyDown:m,get onMouseDown(){return A([o.onMouseDown,d.onMouseDown])},get onFocus(){return A([o.onFocus,d.onFocus])}},r))}var Dt=Object.assign(Ne,{Content:Ue,Header:Le,Item:He,Trigger:We}),se=F('<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">'),Ot=F('<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 _t=e=>{const{t:i}=bt(),{preferences:c}=Ve(),l=k(()=>c().showUsageMetrics??!0),n=k(()=>at(e.instanceId,e.sessionId)??{cost:0,contextWindow:0,isSubscriptionModel:!1,inputTokens:0,outputTokens:0,reasoningTokens:0,actualUsageTokens:0,modelOutputLimit:0,contextAvailableTokens:null}),s=k(()=>lt(e.instanceId,e.sessionId)),t=k(()=>s().length>0),o=k(()=>t()?ct(e.instanceId,e.sessionId)??{cost:0,inputTokens:0,outputTokens:0,reasoningTokens:0}:{cost:0,inputTokens:0,outputTokens:0,reasoningTokens:0}),r=k(()=>`$${o().cost.toFixed(2)}`),d=k(()=>o().inputTokens),m=k(()=>o().outputTokens),h=k(()=>o().reasoningTokens),y=k(()=>n().inputTokens??0),b=k(()=>n().outputTokens??0),x=k(()=>{const w=n().isSubscriptionModel?0:n().cost;return w>0?w:0}),v=k(()=>`$${x().toFixed(2)}`);return(()=>{var w=Ot(),p=w.firstChild,S=p.firstChild,u=S.firstChild,R=u.nextSibling,N=S.nextSibling,W=N.firstChild,z=W.nextSibling,q=N.nextSibling,K=q.firstChild,V=K.nextSibling;return g(u,()=>i("contextUsagePanel.labels.input")),g(R,()=>Z(y())),g(W,()=>i("contextUsagePanel.labels.output")),g(z,()=>Z(b())),g(K,()=>i("contextUsagePanel.labels.cost")),g(V,v),g(p,a(J,{get when(){return fe(()=>!!t())()&&l()},get children(){return[(()=>{var C=se(),P=C.firstChild,I=P.nextSibling;return g(P,()=>i("contextUsagePanel.labels.totalInput")),g(I,()=>Z(d())),C})(),(()=>{var C=se(),P=C.firstChild,I=P.nextSibling;return g(P,()=>i("contextUsagePanel.labels.totalOutput")),g(I,()=>Z(m())),C})(),(()=>{var C=se(),P=C.firstChild,I=P.nextSibling;return g(P,()=>i("contextUsagePanel.labels.totalCost")),g(I,r),C})(),(()=>{var C=se(),P=C.firstChild,I=P.nextSibling;return g(P,()=>i("contextUsagePanel.labels.totalReasoning")),g(I,()=>Z(h())),C})()]}}),null),ke(()=>Xe(w,`session-context-panel px-4 py-2 ${e.class??""}`)),w})()};var ie=F('<div class="right-panel-empty right-panel-empty--left"><span class=text-xs>'),Mt=F('<div class="rounded-md border border-base bg-surface-secondary px-3 py-2"><div class="flex items-start justify-between gap-3"><div class=min-w-0><div class="text-sm font-medium text-primary"></div><p class="mt-1 text-xs text-secondary">'),At=F('<div class="flex flex-col gap-2">'),Et=F("<span>"),Ft=F('<div class=status-process-card><div class=status-process-header><span class=status-process-title></span><div class=status-process-meta><span></span><span></span></div></div><div class=status-process-actions><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center"></button><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center"></button><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center">'),Rt=F("<div class=status-tab-container>"),Kt=F("<span class=section-left><span class=section-label>");const qt=e=>{const i=t=>e.expandedItems().includes(t),s=[{id:"yolo-mode",labelKey:"instanceShell.rightPanel.sections.yoloMode",tooltipKey:"instanceShell.rightPanel.sections.yoloMode.tooltip",render:()=>{const t=e.activeSession();return t?(()=>{var o=Mt(),r=o.firstChild,d=r.firstChild,m=d.firstChild,h=m.nextSibling;return g(m,()=>e.t("instanceShell.yoloMode.title")),g(h,()=>e.t("instanceShell.yoloMode.description")),g(r,a(ht,{get checked(){return pt(e.instanceId,t.id)},color:"warning",size:"small",get inputProps(){return{"aria-label":e.t("instanceShell.yoloMode.title")}},onChange:()=>gt(e.instanceId,t.id)}),null),o})():(()=>{var o=ie(),r=o.firstChild;return g(r,()=>e.t("instanceShell.yoloMode.noSessionSelected")),o})()}},{id:"plan",labelKey:"instanceShell.rightPanel.sections.plan",tooltipKey:"instanceShell.rightPanel.sections.plan.tooltip",render:()=>{const t=e.activeSessionId();if(!t||t==="info")return(()=>{var r=ie(),d=r.firstChild;return g(d,()=>e.t("instanceShell.plan.noSessionSelected")),r})();const o=e.latestTodoState();return o?a(ft,{state:o,get emptyLabel(){return e.t("instanceShell.plan.empty")},showStatusLabel:!1}):(()=>{var r=ie(),d=r.firstChild;return g(d,()=>e.t("instanceShell.plan.empty")),r})()}},{id:"background-processes",labelKey:"instanceShell.rightPanel.sections.backgroundProcesses",tooltipKey:"instanceShell.rightPanel.sections.backgroundProcesses.tooltip",render:()=>{const t=e.backgroundProcessList();return t.length===0?(()=>{var o=ie(),r=o.firstChild;return g(r,()=>e.t("instanceShell.backgroundProcesses.empty")),o})():(()=>{var o=At();return g(o,a(Pe,{each:t,children:r=>(()=>{var d=Ft(),m=d.firstChild,h=m.firstChild,y=h.nextSibling,b=y.firstChild,x=b.nextSibling,v=m.nextSibling,w=v.firstChild,p=w.nextSibling,S=p.nextSibling;return g(h,()=>r.title),g(b,a(yt,{class:"h-3.5 w-3.5"})),g(x,()=>e.t("instanceShell.backgroundProcesses.status",{status:r.status})),g(y,a(J,{get when(){return typeof r.outputSizeBytes=="number"},get children(){var u=Et();return g(u,()=>e.t("instanceShell.backgroundProcesses.output",{sizeKb:Math.round((r.outputSizeBytes??0)/1024)})),u}}),null),w.$$click=()=>e.onOpenBackgroundOutput(r),g(w,a(Ct,{class:"h-4 w-4"})),p.$$click=()=>e.onStopBackgroundProcess(r.id),g(p,a(St,{class:"h-4 w-4"})),S.$$click=()=>e.onTerminateBackgroundProcess(r.id),g(S,a(mt,{class:"h-4 w-4"})),ke(u=>{var R=!!r.notifyEnabled,N=!r.notifyEnabled,W=e.t(r.notifyEnabled?"instanceShell.backgroundProcesses.notify.enabled":"instanceShell.backgroundProcesses.notify.disabled"),z=e.t(r.notifyEnabled?"instanceShell.backgroundProcesses.notify.enabled":"instanceShell.backgroundProcesses.notify.disabled"),q=e.t("instanceShell.backgroundProcesses.actions.output"),K=e.t("instanceShell.backgroundProcesses.actions.output"),V=r.status!=="running",C=e.t("instanceShell.backgroundProcesses.actions.stop"),P=e.t("instanceShell.backgroundProcesses.actions.stop"),I=e.t("instanceShell.backgroundProcesses.actions.terminate"),f=e.t("instanceShell.backgroundProcesses.actions.terminate");return R!==u.e&&b.classList.toggle("text-success",u.e=R),N!==u.t&&b.classList.toggle("text-tertiary",u.t=N),W!==u.a&&L(b,"aria-label",u.a=W),z!==u.o&&L(b,"title",u.o=z),q!==u.i&&L(w,"aria-label",u.i=q),K!==u.n&&L(w,"title",u.n=K),V!==u.s&&(p.disabled=u.s=V),C!==u.h&&L(p,"aria-label",u.h=C),P!==u.r&&L(p,"title",u.r=P),I!==u.d&&L(S,"aria-label",u.d=I),f!==u.l&&L(S,"title",u.l=f),u},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0}),d})()})),o})()}},{id:"mcp",labelKey:"instanceShell.rightPanel.sections.mcp",tooltipKey:"instanceShell.rightPanel.sections.mcp.tooltip",render:()=>a(pe,{get initialInstance(){return e.instance},sections:["mcp"],showSectionHeadings:!1,class:"space-y-2"})},{id:"lsp",labelKey:"instanceShell.rightPanel.sections.lsp",tooltipKey:"instanceShell.rightPanel.sections.lsp.tooltip",render:()=>a(pe,{get initialInstance(){return e.instance},sections:["lsp"],showSectionHeadings:!1,class:"space-y-2"})},{id:"plugins",labelKey:"instanceShell.rightPanel.sections.plugins",tooltipKey:"instanceShell.rightPanel.sections.plugins.tooltip",render:()=>a(pe,{get initialInstance(){return e.instance},sections:["plugins"],showSectionHeadings:!1,class:"space-y-2"})}];return(()=>{var t=Rt();return g(t,a(J,{get when(){return e.activeSession()},children:o=>a(_t,{get instanceId(){return e.instanceId},get sessionId(){return o().id},class:"status-tab-context-panel"})}),null),g(t,a(G.Root,{class:"right-panel-accordion",collapsible:!0,multiple:!0,get value(){return e.expandedItems()},get onChange(){return e.onExpandedItemsChange},get children(){return a(Pe,{each:s,children:o=>a(G.Item,{get value(){return o.id},class:"right-panel-accordion-item",get children(){return[a(G.Header,{class:"right-panel-accordion-header-row",get children(){return[a(G.Trigger,{class:"right-panel-accordion-trigger",get children(){return[(()=>{var r=Kt(),d=r.firstChild;return g(d,()=>e.t(o.labelKey)),r})(),a(dt,{get class(){return`right-panel-accordion-chevron ${i(o.id)?"right-panel-accordion-chevron-expanded":""}`}})]}}),a(ee,{openDelay:200,gutter:4,placement:"top",get children(){return[a(ee.Trigger,{as:"button",type:"button",class:"section-info-trigger",get"aria-label"(){return e.t(o.tooltipKey)},get children(){return a(ut,{class:"section-info-icon"})}}),a(ee.Portal,{get children(){return a(ee.Content,{class:"section-info-tooltip",get children(){return e.t(o.tooltipKey)}})}})]}})]}}),a(G.Content,{class:"right-panel-accordion-content",get children(){return o.render()}})]}})})}}),null),t})()};Ye(["click"]);export{qt as default};
|
|
1
|
+
import{m as fe,P as ze,M as Ve,t as F,i as g,a as Xe,d as L,f as Ye}from"./monaco-viewer-B3Jl6a5p.js";import{n as a,m as T,q as ae,s as O,d as $,b as B,o as E,c as k,k as le,S as J,l as ce,t as Ge,w as Se,a as ke,F as Pe}from"./git-diff-vendor-CSgooKT_.js";import{I as me,U as Te,W as H,X as Ie,Y as $e,Z as he,_ as Je,$ as ge,a0 as re,a1 as de,a2 as De,a3 as te,a4 as ne,a5 as Ze,a6 as be,a7 as Qe,a8 as et,a9 as M,aa as ve,ab as tt,ac as nt,ad as ot,ae as st,af as A,ag as it,ah as rt,ai as at,aj as lt,ak as ct,al as Z,J as dt,am as ut,an as pe,ao as gt,ap as pt,aq as ht,ar as ft,as as mt}from"./main-BYOHwhSs.js";import{u as bt}from"./index-DHYmm6_R.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const vt=[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}]],yt=e=>a(me,T(e,{name:"BellRing",iconNode:vt})),xt=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],Ct=e=>a(me,T(e,{name:"TerminalSquare",iconNode:xt})),wt=[["polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2",key:"h1p8hx"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],St=e=>a(me,T(e,{name:"XOctagon",iconNode:wt}));var Pt={};ve(Pt,{Arrow:()=>Te,Content:()=>_e,Portal:()=>Me,Root:()=>Ae,Tooltip:()=>ee,Trigger:()=>Ee,useTooltipContext:()=>ue});var Oe=le();function ue(){const e=ce(Oe);if(e===void 0)throw new Error("[kobalte]: `useTooltipContext` must be used within a `Tooltip` component");return e}function _e(e){const i=ue(),c=H({id:i.generateId("content")},e),[l,n]=O(c,["ref","style"]);return B(()=>E(i.registerContentId(n.id))),a(J,{get when(){return i.contentPresent()},get children(){return a(De.Positioner,{get children(){return a(Ze,T({ref(s){var t=te(o=>{i.setContentRef(o)},l.ref);typeof t=="function"&&t(s)},role:"tooltip",disableOutsidePointerEvents:!1,get style(){return be({"--kb-tooltip-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},l.style)},onFocusOutside:s=>s.preventDefault(),onDismiss:()=>i.hideTooltip(!0)},()=>i.dataset(),n))}})}})}function Me(e){const i=ue();return a(J,{get when(){return i.contentPresent()},get children(){return a(ze,e)}})}function kt(e,i,c){const l=e.split("-")[0],n=i.getBoundingClientRect(),s=c.getBoundingClientRect(),t=[],o=n.left+n.width/2,r=n.top+n.height/2;switch(l){case"top":t.push([n.left,r]),t.push([s.left,s.bottom]),t.push([s.left,s.top]),t.push([s.right,s.top]),t.push([s.right,s.bottom]),t.push([n.right,r]);break;case"right":t.push([o,n.top]),t.push([s.left,s.top]),t.push([s.right,s.top]),t.push([s.right,s.bottom]),t.push([s.left,s.bottom]),t.push([o,n.bottom]);break;case"bottom":t.push([n.left,r]),t.push([s.left,s.top]),t.push([s.left,s.bottom]),t.push([s.right,s.bottom]),t.push([s.right,s.top]),t.push([n.right,r]);break;case"left":t.push([o,n.top]),t.push([s.right,s.top]),t.push([s.left,s.top]),t.push([s.left,s.bottom]),t.push([s.right,s.bottom]),t.push([o,n.bottom]);break}return t}var j={},Tt=0,X=!1,_,Q,Y;function Ae(e){const i=`tooltip-${ae()}`,c=`${++Tt}`,l=H({id:i,openDelay:700,closeDelay:300,skipDelayDuration:300},e),[n,s]=O(l,["id","open","defaultOpen","onOpenChange","disabled","triggerOnFocusOnly","openDelay","closeDelay","skipDelayDuration","ignoreSafeArea","forceMount"]);let t;const[o,r]=$(),[d,m]=$(),[h,y]=$(),[b,x]=$(s.placement),v=Ie({open:()=>n.open,defaultOpen:()=>n.defaultOpen,onOpenChange:f=>{var D;return(D=n.onOpenChange)==null?void 0:D.call(n,f)}}),{present:w}=$e({show:()=>n.forceMount||v.isOpen(),element:()=>h()??null}),p=()=>{j[c]=u},S=()=>{for(const f in j)f!==c&&(j[f](!0),delete j[f])},u=(f=!1)=>{f||n.closeDelay&&n.closeDelay<=0?(window.clearTimeout(t),t=void 0,v.close()):t||(t=window.setTimeout(()=>{t=void 0,v.close()},n.closeDelay)),window.clearTimeout(_),_=void 0,n.skipDelayDuration&&n.skipDelayDuration>=0&&(Y=window.setTimeout(()=>{window.clearTimeout(Y),Y=void 0},n.skipDelayDuration)),X&&(window.clearTimeout(Q),Q=window.setTimeout(()=>{delete j[c],Q=void 0,X=!1},n.closeDelay))},R=()=>{clearTimeout(t),t=void 0,S(),p(),X=!0,v.open(),window.clearTimeout(_),_=void 0,window.clearTimeout(Q),Q=void 0,window.clearTimeout(Y),Y=void 0},N=()=>{S(),p(),!v.isOpen()&&!_&&!X?_=window.setTimeout(()=>{_=void 0,X=!0,R()},n.openDelay):v.isOpen()||R()},W=(f=!1)=>{!f&&n.openDelay&&n.openDelay>0&&!t&&!Y?N():R()},z=()=>{window.clearTimeout(_),_=void 0,X=!1},q=()=>{window.clearTimeout(t),t=void 0},K=f=>ge(d(),f)||ge(h(),f),V=f=>{const D=d(),U=h();if(!(!D||!U))return kt(f,D,U)},C=f=>{const D=f.target;if(K(D)){q();return}if(!n.ignoreSafeArea){const U=V(b());if(U&&Qe(et(f),U)){q();return}}t||u()};B(()=>{if(!v.isOpen())return;const f=he();f.addEventListener("pointermove",C,!0),E(()=>{f.removeEventListener("pointermove",C,!0)})}),B(()=>{const f=d();if(!f||!v.isOpen())return;const D=qe=>{const je=qe.target;ge(je,f)&&u(!0)},U=Je();U.addEventListener("scroll",D,{capture:!0}),E(()=>{U.removeEventListener("scroll",D,{capture:!0})})}),E(()=>{clearTimeout(t),j[c]&&delete j[c]});const I={dataset:k(()=>({"data-expanded":v.isOpen()?"":void 0,"data-closed":v.isOpen()?void 0:""})),isOpen:v.isOpen,isDisabled:()=>n.disabled??!1,triggerOnFocusOnly:()=>n.triggerOnFocusOnly??!1,contentId:o,contentPresent:w,openTooltip:W,hideTooltip:u,cancelOpening:z,generateId:de(()=>l.id),registerContentId:re(r),isTargetOnTooltip:K,setTriggerRef:m,setContentRef:y};return a(Oe.Provider,{value:I,get children(){return a(De,T({anchorRef:d,contentRef:h,onCurrentPlacementChange:x},s))}})}function Ee(e){let i;const c=ue(),[l,n]=O(e,["ref","onPointerEnter","onPointerLeave","onPointerDown","onClick","onFocus","onBlur"]);let s=!1,t=!1,o=!1;const r=()=>{s=!1},d=()=>{!c.isOpen()&&(t||o)&&c.openTooltip(o)},m=p=>{c.isOpen()&&!t&&!o&&c.hideTooltip(p)},h=p=>{M(p,l.onPointerEnter),!(p.pointerType==="touch"||c.triggerOnFocusOnly()||c.isDisabled()||p.defaultPrevented)&&(t=!0,d())},y=p=>{M(p,l.onPointerLeave),p.pointerType!=="touch"&&(t=!1,o=!1,c.isOpen()?m():c.cancelOpening())},b=p=>{M(p,l.onPointerDown),s=!0,he(i).addEventListener("pointerup",r,{once:!0})},x=p=>{M(p,l.onClick),t=!1,o=!1,m(!0)},v=p=>{M(p,l.onFocus),!(c.isDisabled()||p.defaultPrevented||s)&&(o=!0,d())},w=p=>{M(p,l.onBlur);const S=p.relatedTarget;c.isTargetOnTooltip(S)||(t=!1,o=!1,m(!0))};return E(()=>{he(i).removeEventListener("pointerup",r)}),a(ne,T({as:"button",ref(p){var S=te(u=>{c.setTriggerRef(u),i=u},l.ref);typeof S=="function"&&S(p)},get"aria-describedby"(){return fe(()=>!!c.isOpen())()?c.contentId():void 0},onPointerEnter:h,onPointerLeave:y,onPointerDown:b,onClick:x,onFocus:v,onBlur:w},()=>c.dataset(),n))}var ee=Object.assign(Ae,{Arrow:Te,Content:_e,Portal:Me,Trigger:Ee}),It={};ve(It,{Collapsible:()=>$t,Content:()=>ye,Root:()=>xe,Trigger:()=>Ce,useCollapsibleContext:()=>oe});var Fe=le();function oe(){const e=ce(Fe);if(e===void 0)throw new Error("[kobalte]: `useCollapsibleContext` must be used within a `Collapsible.Root` component");return e}function ye(e){const[i,c]=$(),l=oe(),n=H({id:l.generateId("content")},e),[s,t]=O(n,["ref","id","style"]),{present:o}=$e({show:l.shouldMount,element:()=>i()??null}),[r,d]=$(0),[m,h]=$(0);let b=l.isOpen()||o();return Ge(()=>{const x=requestAnimationFrame(()=>{b=!1});E(()=>{cancelAnimationFrame(x)})}),B(Se(o,()=>{if(!i())return;i().style.transitionDuration="0s",i().style.animationName="none";const x=i().getBoundingClientRect();d(x.height),h(x.width),b||(i().style.transitionDuration="",i().style.animationName="")})),B(Se(l.isOpen,x=>{!x&&i()&&(i().style.transitionDuration="",i().style.animationName="")},{defer:!0})),B(()=>E(l.registerContentId(s.id))),a(J,{get when(){return o()},get children(){return a(ne,T({as:"div",ref(x){var v=te(c,s.ref);typeof v=="function"&&v(x)},get id(){return s.id},get style(){return be({"--kb-collapsible-content-height":r()?`${r()}px`:void 0,"--kb-collapsible-content-width":m()?`${m()}px`:void 0},s.style)}},()=>l.dataset(),t))}})}function xe(e){const i=`collapsible-${ae()}`,c=H({id:i},e),[l,n]=O(c,["open","defaultOpen","onOpenChange","disabled","forceMount"]),[s,t]=$(),o=Ie({open:()=>l.open,defaultOpen:()=>l.defaultOpen,onOpenChange:m=>{var h;return(h=l.onOpenChange)==null?void 0:h.call(l,m)}}),r=k(()=>({"data-expanded":o.isOpen()?"":void 0,"data-closed":o.isOpen()?void 0:"","data-disabled":l.disabled?"":void 0})),d={dataset:r,isOpen:o.isOpen,disabled:()=>l.disabled??!1,shouldMount:()=>l.forceMount||o.isOpen(),contentId:s,toggle:o.toggle,generateId:de(()=>n.id),registerContentId:re(t)};return a(Fe.Provider,{value:d,get children(){return a(ne,T({as:"div"},r,n))}})}function Ce(e){const i=oe(),[c,l]=O(e,["onClick"]);return a(tt,T({get"aria-expanded"(){return i.isOpen()},get"aria-controls"(){return fe(()=>!!i.isOpen())()?i.contentId():void 0},get disabled(){return i.disabled()},onClick:s=>{M(s,c.onClick),i.toggle()}},()=>i.dataset(),l))}var $t=Object.assign(xe,{Content:ye,Trigger:Ce}),G={};ve(G,{Accordion:()=>Dt,Content:()=>Ue,Header:()=>Le,Item:()=>He,Root:()=>Ne,Trigger:()=>We,useAccordionContext:()=>we});var Re=le();function Ke(){const e=ce(Re);if(e===void 0)throw new Error("[kobalte]: `useAccordionItemContext` must be used within a `Accordion.Item` component");return e}function Ue(e){const i=Ke(),c=i.generateId("content"),l=H({id:c},e),[n,s]=O(l,["id","style"]);return B(()=>E(i.registerContentId(n.id))),a(ye,T({role:"region",get"aria-labelledby"(){return i.triggerId()},get style(){return be({"--kb-accordion-content-height":"var(--kb-collapsible-content-height)","--kb-accordion-content-width":"var(--kb-collapsible-content-width)"},n.style)}},s))}function Le(e){const i=oe();return a(ne,T({as:"h3"},()=>i.dataset(),e))}var Be=le();function we(){const e=ce(Be);if(e===void 0)throw new Error("[kobalte]: `useAccordionContext` must be used within a `Accordion.Root` component");return e}function He(e){const i=we(),c=`${i.generateId("item")}-${ae()}`,l=H({id:c},e),[n,s]=O(l,["value","disabled"]),[t,o]=$(),[r,d]=$(),m=()=>i.listState().selectionManager(),h=()=>m().isSelected(n.value),y={value:()=>n.value,triggerId:t,contentId:r,generateId:de(()=>s.id),registerTriggerId:re(o),registerContentId:re(d)};return a(Re.Provider,{value:y,get children(){return a(xe,T({get open(){return h()},get disabled(){return n.disabled}},s))}})}function Ne(e){let i;const c=`accordion-${ae()}`,l=H({id:c,multiple:!1,collapsible:!1,shouldFocusWrap:!0},e),[n,s]=O(l,["id","ref","value","defaultValue","onChange","multiple","collapsible","shouldFocusWrap","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]),[t,o]=$([]),{DomCollectionProvider:r}=nt({items:t,onItemsChange:o}),d=ot({selectedKeys:()=>n.value,defaultSelectedKeys:()=>n.defaultValue,onSelectionChange:y=>{var b;return(b=n.onChange)==null?void 0:b.call(n,Array.from(y))},disallowEmptySelection:()=>!n.multiple&&!n.collapsible,selectionMode:()=>n.multiple?"multiple":"single",dataSource:t});d.selectionManager().setFocusedKey("item-1");const m=st({selectionManager:()=>d.selectionManager(),collection:()=>d.collection(),disallowEmptySelection:()=>d.selectionManager().disallowEmptySelection(),shouldFocusWrap:()=>n.shouldFocusWrap,disallowTypeAhead:!0,allowsTabNavigation:!0},()=>i),h={listState:()=>d,generateId:de(()=>n.id)};return a(r,{get children(){return a(Be.Provider,{value:h,get children(){return a(ne,T({as:"div",get id(){return n.id},ref(y){var b=te(x=>i=x,n.ref);typeof b=="function"&&b(y)},get onKeyDown(){return A([n.onKeyDown,m.onKeyDown])},get onMouseDown(){return A([n.onMouseDown,m.onMouseDown])},get onFocusIn(){return A([n.onFocusIn])},get onFocusOut(){return A([n.onFocusOut,m.onFocusOut])}},s))}})}})}function We(e){let i;const c=we(),l=Ke(),n=oe(),s=l.generateId("trigger"),t=H({id:s},e),[o,r]=O(t,["ref","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);it({getItem:()=>({ref:()=>i,type:"item",key:l.value(),textValue:"",disabled:n.disabled()})});const d=rt({key:()=>l.value(),selectionManager:()=>c.listState().selectionManager(),disabled:()=>n.disabled(),shouldSelectOnPressUp:!0},()=>i),m=h=>{["Enter"," "].includes(h.key)&&h.preventDefault(),M(h,o.onKeyDown),M(h,d.onKeyDown)};return B(()=>E(l.registerTriggerId(r.id))),a(Ce,T({ref(h){var y=te(b=>i=b,o.ref);typeof y=="function"&&y(h)},get"data-key"(){return d.dataKey()},get onPointerDown(){return A([o.onPointerDown,d.onPointerDown])},get onPointerUp(){return A([o.onPointerUp,d.onPointerUp])},get onClick(){return A([o.onClick,d.onClick])},onKeyDown:m,get onMouseDown(){return A([o.onMouseDown,d.onMouseDown])},get onFocus(){return A([o.onFocus,d.onFocus])}},r))}var Dt=Object.assign(Ne,{Content:Ue,Header:Le,Item:He,Trigger:We}),se=F('<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">'),Ot=F('<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 _t=e=>{const{t:i}=bt(),{preferences:c}=Ve(),l=k(()=>c().showUsageMetrics??!0),n=k(()=>at(e.instanceId,e.sessionId)??{cost:0,contextWindow:0,isSubscriptionModel:!1,inputTokens:0,outputTokens:0,reasoningTokens:0,actualUsageTokens:0,modelOutputLimit:0,contextAvailableTokens:null}),s=k(()=>lt(e.instanceId,e.sessionId)),t=k(()=>s().length>0),o=k(()=>t()?ct(e.instanceId,e.sessionId)??{cost:0,inputTokens:0,outputTokens:0,reasoningTokens:0}:{cost:0,inputTokens:0,outputTokens:0,reasoningTokens:0}),r=k(()=>`$${o().cost.toFixed(2)}`),d=k(()=>o().inputTokens),m=k(()=>o().outputTokens),h=k(()=>o().reasoningTokens),y=k(()=>n().inputTokens??0),b=k(()=>n().outputTokens??0),x=k(()=>{const w=n().isSubscriptionModel?0:n().cost;return w>0?w:0}),v=k(()=>`$${x().toFixed(2)}`);return(()=>{var w=Ot(),p=w.firstChild,S=p.firstChild,u=S.firstChild,R=u.nextSibling,N=S.nextSibling,W=N.firstChild,z=W.nextSibling,q=N.nextSibling,K=q.firstChild,V=K.nextSibling;return g(u,()=>i("contextUsagePanel.labels.input")),g(R,()=>Z(y())),g(W,()=>i("contextUsagePanel.labels.output")),g(z,()=>Z(b())),g(K,()=>i("contextUsagePanel.labels.cost")),g(V,v),g(p,a(J,{get when(){return fe(()=>!!t())()&&l()},get children(){return[(()=>{var C=se(),P=C.firstChild,I=P.nextSibling;return g(P,()=>i("contextUsagePanel.labels.totalInput")),g(I,()=>Z(d())),C})(),(()=>{var C=se(),P=C.firstChild,I=P.nextSibling;return g(P,()=>i("contextUsagePanel.labels.totalOutput")),g(I,()=>Z(m())),C})(),(()=>{var C=se(),P=C.firstChild,I=P.nextSibling;return g(P,()=>i("contextUsagePanel.labels.totalCost")),g(I,r),C})(),(()=>{var C=se(),P=C.firstChild,I=P.nextSibling;return g(P,()=>i("contextUsagePanel.labels.totalReasoning")),g(I,()=>Z(h())),C})()]}}),null),ke(()=>Xe(w,`session-context-panel px-4 py-2 ${e.class??""}`)),w})()};var ie=F('<div class="right-panel-empty right-panel-empty--left"><span class=text-xs>'),Mt=F('<div class="rounded-md border border-base bg-surface-secondary px-3 py-2"><div class="flex items-start justify-between gap-3"><div class=min-w-0><div class="text-sm font-medium text-primary"></div><p class="mt-1 text-xs text-secondary">'),At=F('<div class="flex flex-col gap-2">'),Et=F("<span>"),Ft=F('<div class=status-process-card><div class=status-process-header><span class=status-process-title></span><div class=status-process-meta><span></span><span></span></div></div><div class=status-process-actions><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center"></button><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center"></button><button type=button class="button-tertiary w-full p-1 inline-flex items-center justify-center">'),Rt=F("<div class=status-tab-container>"),Kt=F("<span class=section-left><span class=section-label>");const qt=e=>{const i=t=>e.expandedItems().includes(t),s=[{id:"yolo-mode",labelKey:"instanceShell.rightPanel.sections.yoloMode",tooltipKey:"instanceShell.rightPanel.sections.yoloMode.tooltip",render:()=>{const t=e.activeSession();return t?(()=>{var o=Mt(),r=o.firstChild,d=r.firstChild,m=d.firstChild,h=m.nextSibling;return g(m,()=>e.t("instanceShell.yoloMode.title")),g(h,()=>e.t("instanceShell.yoloMode.description")),g(r,a(ht,{get checked(){return pt(e.instanceId,t.id)},color:"warning",size:"small",get inputProps(){return{"aria-label":e.t("instanceShell.yoloMode.title")}},onChange:()=>gt(e.instanceId,t.id)}),null),o})():(()=>{var o=ie(),r=o.firstChild;return g(r,()=>e.t("instanceShell.yoloMode.noSessionSelected")),o})()}},{id:"plan",labelKey:"instanceShell.rightPanel.sections.plan",tooltipKey:"instanceShell.rightPanel.sections.plan.tooltip",render:()=>{const t=e.activeSessionId();if(!t||t==="info")return(()=>{var r=ie(),d=r.firstChild;return g(d,()=>e.t("instanceShell.plan.noSessionSelected")),r})();const o=e.latestTodoState();return o?a(ft,{state:o,get emptyLabel(){return e.t("instanceShell.plan.empty")},showStatusLabel:!1}):(()=>{var r=ie(),d=r.firstChild;return g(d,()=>e.t("instanceShell.plan.empty")),r})()}},{id:"background-processes",labelKey:"instanceShell.rightPanel.sections.backgroundProcesses",tooltipKey:"instanceShell.rightPanel.sections.backgroundProcesses.tooltip",render:()=>{const t=e.backgroundProcessList();return t.length===0?(()=>{var o=ie(),r=o.firstChild;return g(r,()=>e.t("instanceShell.backgroundProcesses.empty")),o})():(()=>{var o=At();return g(o,a(Pe,{each:t,children:r=>(()=>{var d=Ft(),m=d.firstChild,h=m.firstChild,y=h.nextSibling,b=y.firstChild,x=b.nextSibling,v=m.nextSibling,w=v.firstChild,p=w.nextSibling,S=p.nextSibling;return g(h,()=>r.title),g(b,a(yt,{class:"h-3.5 w-3.5"})),g(x,()=>e.t("instanceShell.backgroundProcesses.status",{status:r.status})),g(y,a(J,{get when(){return typeof r.outputSizeBytes=="number"},get children(){var u=Et();return g(u,()=>e.t("instanceShell.backgroundProcesses.output",{sizeKb:Math.round((r.outputSizeBytes??0)/1024)})),u}}),null),w.$$click=()=>e.onOpenBackgroundOutput(r),g(w,a(Ct,{class:"h-4 w-4"})),p.$$click=()=>e.onStopBackgroundProcess(r.id),g(p,a(St,{class:"h-4 w-4"})),S.$$click=()=>e.onTerminateBackgroundProcess(r.id),g(S,a(mt,{class:"h-4 w-4"})),ke(u=>{var R=!!r.notifyEnabled,N=!r.notifyEnabled,W=e.t(r.notifyEnabled?"instanceShell.backgroundProcesses.notify.enabled":"instanceShell.backgroundProcesses.notify.disabled"),z=e.t(r.notifyEnabled?"instanceShell.backgroundProcesses.notify.enabled":"instanceShell.backgroundProcesses.notify.disabled"),q=e.t("instanceShell.backgroundProcesses.actions.output"),K=e.t("instanceShell.backgroundProcesses.actions.output"),V=r.status!=="running",C=e.t("instanceShell.backgroundProcesses.actions.stop"),P=e.t("instanceShell.backgroundProcesses.actions.stop"),I=e.t("instanceShell.backgroundProcesses.actions.terminate"),f=e.t("instanceShell.backgroundProcesses.actions.terminate");return R!==u.e&&b.classList.toggle("text-success",u.e=R),N!==u.t&&b.classList.toggle("text-tertiary",u.t=N),W!==u.a&&L(b,"aria-label",u.a=W),z!==u.o&&L(b,"title",u.o=z),q!==u.i&&L(w,"aria-label",u.i=q),K!==u.n&&L(w,"title",u.n=K),V!==u.s&&(p.disabled=u.s=V),C!==u.h&&L(p,"aria-label",u.h=C),P!==u.r&&L(p,"title",u.r=P),I!==u.d&&L(S,"aria-label",u.d=I),f!==u.l&&L(S,"title",u.l=f),u},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0}),d})()})),o})()}},{id:"mcp",labelKey:"instanceShell.rightPanel.sections.mcp",tooltipKey:"instanceShell.rightPanel.sections.mcp.tooltip",render:()=>a(pe,{get initialInstance(){return e.instance},sections:["mcp"],showSectionHeadings:!1,class:"space-y-2"})},{id:"lsp",labelKey:"instanceShell.rightPanel.sections.lsp",tooltipKey:"instanceShell.rightPanel.sections.lsp.tooltip",render:()=>a(pe,{get initialInstance(){return e.instance},sections:["lsp"],showSectionHeadings:!1,class:"space-y-2"})},{id:"plugins",labelKey:"instanceShell.rightPanel.sections.plugins",tooltipKey:"instanceShell.rightPanel.sections.plugins.tooltip",render:()=>a(pe,{get initialInstance(){return e.instance},sections:["plugins"],showSectionHeadings:!1,class:"space-y-2"})}];return(()=>{var t=Rt();return g(t,a(J,{get when(){return e.activeSession()},children:o=>a(_t,{get instanceId(){return e.instanceId},get sessionId(){return o().id},class:"status-tab-context-panel"})}),null),g(t,a(G.Root,{class:"right-panel-accordion",collapsible:!0,multiple:!0,get value(){return e.expandedItems()},get onChange(){return e.onExpandedItemsChange},get children(){return a(Pe,{each:s,children:o=>a(G.Item,{get value(){return o.id},class:"right-panel-accordion-item",get children(){return[a(G.Header,{class:"right-panel-accordion-header-row",get children(){return[a(G.Trigger,{class:"right-panel-accordion-trigger",get children(){return[(()=>{var r=Kt(),d=r.firstChild;return g(d,()=>e.t(o.labelKey)),r})(),a(dt,{get class(){return`right-panel-accordion-chevron ${i(o.id)?"right-panel-accordion-chevron-expanded":""}`}})]}}),a(ee,{openDelay:200,gutter:4,placement:"top",get children(){return[a(ee.Trigger,{as:"button",type:"button",class:"section-info-trigger",get"aria-label"(){return e.t(o.tooltipKey)},get children(){return a(ut,{class:"section-info-icon"})}}),a(ee.Portal,{get children(){return a(ee.Content,{class:"section-info-tooltip",get children(){return e.t(o.tooltipKey)}})}})]}})]}}),a(G.Content,{class:"right-panel-accordion-content",get children(){return o.render()}})]}})})}}),null),t})()};Ye(["click"]);export{qt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as n}from"./main-
|
|
1
|
+
import{I as n}from"./main-BYOHwhSs.js";import{n as o,m as y}from"./git-diff-vendor-CSgooKT_.js";const i=[["line",{x1:"3",x2:"21",y1:"6",y2:"6",key:"4m8b97"}],["line",{x1:"3",x2:"21",y1:"12",y2:"12",key:"10d38w"}],["line",{x1:"3",x2:"21",y1:"18",y2:"18",key:"kwyyxn"}]],t=e=>o(n,y(e,{name:"AlignJustify",iconNode:i}));export{t as A};
|