zidane-gui 8.2.4 → 9.0.1

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.
Files changed (42) hide show
  1. package/README.md +3 -2
  2. package/out/main/chunks/{history-pager-Bd5PUapJ.js → history-pager-DUFgTrih.js} +5 -56
  3. package/out/main/chunks/session-search-sql-BrNTuwjH.js +196 -0
  4. package/out/main/chunks/tool-results-sql-C0MqWcQc.js +41 -0
  5. package/out/main/chunks/transcript-sql-DbZ-a5wb.js +43 -0
  6. package/out/main/chunks/usage-sql-DiITGx8Q.js +67 -0
  7. package/out/main/history-worker.js +2 -4
  8. package/out/main/index.js +2275 -3375
  9. package/out/main/lsp-host.js +17 -4
  10. package/out/main/session-search-worker.js +20 -0
  11. package/out/main/tool-results-worker.js +17 -0
  12. package/out/main/usage-worker.js +5 -19
  13. package/out/preload/index.mjs +69 -5
  14. package/out/renderer/assets/CodeEditor-in2F3Rz-.js +12771 -0
  15. package/out/renderer/assets/ComposerEditor-DzKoxH6Z.js +68 -0
  16. package/out/renderer/assets/DiffsTab-Ceh4E5wW.js +540 -0
  17. package/out/renderer/assets/EditorWorkers-Bhv2OJRb.js +67 -0
  18. package/out/renderer/assets/FileIcon-CYgGSQ59.js +781 -0
  19. package/out/renderer/assets/FilesTab-DESQMqGK.js +11763 -0
  20. package/out/renderer/assets/core-xOIU6ifr.js +9977 -0
  21. package/out/renderer/assets/file-tabs-Cozt9Sho.js +105 -0
  22. package/out/renderer/assets/{ghostty-web-BTRdAlae.js → ghostty-web-BTHoKwMc.js} +1 -1
  23. package/out/renderer/assets/index-DkE-xvCG.js +9525 -0
  24. package/out/renderer/assets/index-DogoEzwx.js +10868 -0
  25. package/out/renderer/assets/{index-BI29HKE2.css → index-DrLLItLS.css} +2481 -2639
  26. package/out/renderer/assets/kit-BUt8oFlT.js +64699 -0
  27. package/out/renderer/assets/pierre-theme-Bj5EAt1L.js +4312 -0
  28. package/out/renderer/assets/useDetachCleanup-Bb7k1ePf.js +3138 -0
  29. package/out/renderer/assets/useFolderChanges-B4X4n6NV.js +7896 -0
  30. package/out/renderer/assets/vendor-BvslLX9q.js +20410 -0
  31. package/out/renderer/assets/vendor-D_E2rLzO.css +388 -0
  32. package/out/renderer/assets/vendor-editor-Bx3dRdBD.js +26391 -0
  33. package/out/renderer/assets/vendor-motion-BLeNAEjH.js +9376 -0
  34. package/out/renderer/assets/vendor-react-DltKc0Ts.js +14275 -0
  35. package/out/renderer/assets/vendor-shiki-ba8IDo5s.js +459 -0
  36. package/out/renderer/index.html +11 -3
  37. package/package.json +10 -4
  38. package/scripts/postinstall.mjs +2 -1
  39. package/out/main/chunks/context-77_UZfgL.js +0 -61
  40. package/out/main/chunks/usage-sql-C2Tg1u44.js +0 -81
  41. package/out/renderer/assets/index-D0Yl489p.js +0 -191283
  42. /package/out/renderer/assets/{working-tree-parse.worker-BAW1QWyk.js → patch-parse.worker-BAW1QWyk.js} +0 -0
@@ -1,7 +1,7 @@
1
1
  import { spawn } from "node:child_process";
2
2
  import { posix, join, dirname, relative } from "node:path";
3
3
  import { pathToFileURL } from "node:url";
4
- import { m as makeToolContext } from "./chunks/context-77_UZfgL.js";
4
+ import { makeToolContext } from "zidane/chat";
5
5
  import { realpathSync, existsSync } from "node:fs";
6
6
  import { access } from "node:fs/promises";
7
7
  import { createRequire } from "node:module";
@@ -1075,6 +1075,8 @@ class LspManager {
1075
1075
  #starting = /* @__PURE__ */ new Map();
1076
1076
  /** Which client has each open document (`${cwd}\0${path}`). */
1077
1077
  #docClients = /* @__PURE__ */ new Map();
1078
+ /** Opens still finding their document's client (detection, a server start), counted per document. */
1079
+ #attaching = /* @__PURE__ */ new Map();
1078
1080
  /** Project root per (cwd, server, folder); misses expire (a manifest can appear). */
1079
1081
  #roots = /* @__PURE__ */ new Map();
1080
1082
  /** Clients that could not be made (no binary), by key, with when. */
@@ -1138,7 +1140,15 @@ class LspManager {
1138
1140
  if (!serverFor(path)) return [];
1139
1141
  const docKey = `${cwd}\0${path}`;
1140
1142
  const step = this.#owners.open(docKey, owner);
1141
- const client = await this.#clientFor(cwd, path);
1143
+ this.#attaching.set(docKey, (this.#attaching.get(docKey) ?? 0) + 1);
1144
+ let client;
1145
+ try {
1146
+ client = await this.#clientFor(cwd, path);
1147
+ } finally {
1148
+ const left = (this.#attaching.get(docKey) ?? 1) - 1;
1149
+ if (left > 0) this.#attaching.set(docKey, left);
1150
+ else this.#attaching.delete(docKey);
1151
+ }
1142
1152
  if (!client) return [];
1143
1153
  if (!this.#owners.owns(docKey, owner)) return [];
1144
1154
  this.#docClients.set(docKey, client);
@@ -1170,8 +1180,11 @@ class LspManager {
1170
1180
  return client ? client.definition(path, line, character) : [];
1171
1181
  }
1172
1182
  async hover(cwd, path, line, character) {
1173
- const client = this.#docClients.get(`${cwd}\0${path}`);
1174
- return client ? client.hover(path, line, character) : { text: null };
1183
+ const docKey = `${cwd}\0${path}`;
1184
+ const client = this.#docClients.get(docKey);
1185
+ if (client) return client.hover(path, line, character);
1186
+ const server = this.#attaching.has(docKey) ? serverFor(path) : null;
1187
+ return server ? { text: null, busy: `${server.binary}: starting` } : { text: null };
1175
1188
  }
1176
1189
  /** Bring `path` up to `text` (as `open` does), then ask for completions at the 1-based position. */
1177
1190
  async completion(cwd, path, text, changes, line, character, trigger, owner = DEFAULT_OWNER) {
@@ -0,0 +1,20 @@
1
+ import { DatabaseSync } from "node:sqlite";
2
+ import { createSqliteDriver } from "zidane";
3
+ import { serveWorkerRpc } from "zidane/ipc";
4
+ import { c as createSessionSearchSql, s as searchSessions } from "./chunks/session-search-sql-BrNTuwjH.js";
5
+ import "node:timers/promises";
6
+ import "zidane/chat";
7
+ import "zidane/chat/pure";
8
+ import "./chunks/transcript-sql-DbZ-a5wb.js";
9
+ let source = null;
10
+ void serveWorkerRpc({
11
+ init({ dbPath }) {
12
+ const db = new DatabaseSync(dbPath, { readOnly: true });
13
+ db.exec("PRAGMA busy_timeout = 5000");
14
+ source = createSessionSearchSql(createSqliteDriver(db));
15
+ },
16
+ handle({ query, filter, options }) {
17
+ if (!source) throw new Error("session search worker: no database open");
18
+ return searchSessions(source, query, filter, options);
19
+ }
20
+ });
@@ -0,0 +1,17 @@
1
+ import { DatabaseSync } from "node:sqlite";
2
+ import { createSqliteDriver } from "zidane";
3
+ import { serveWorkerRpc } from "zidane/ipc";
4
+ import { s as serveToolResultsCall } from "./chunks/tool-results-sql-C0MqWcQc.js";
5
+ import "./chunks/transcript-sql-DbZ-a5wb.js";
6
+ let driver = null;
7
+ void serveWorkerRpc({
8
+ init({ dbPath }) {
9
+ const db = new DatabaseSync(dbPath, { readOnly: true });
10
+ db.exec("PRAGMA busy_timeout = 5000");
11
+ driver = createSqliteDriver(db);
12
+ },
13
+ handle(call) {
14
+ if (!driver) throw new Error("tool results worker: no database open");
15
+ return serveToolResultsCall(driver, call);
16
+ }
17
+ });
@@ -1,19 +1,5 @@
1
- import { DatabaseSync } from "node:sqlite";
2
- import { parentPort } from "node:worker_threads";
3
- import { r as runUsageAggregates } from "./chunks/usage-sql-C2Tg1u44.js";
4
- if (!parentPort) {
5
- throw new Error("usage-worker must run as a worker thread");
6
- }
7
- parentPort.on("message", (request) => {
8
- let reply;
9
- let db;
10
- try {
11
- db = new DatabaseSync(request.dbPath, { readOnly: true });
12
- reply = { ok: true, buckets: runUsageAggregates(db) };
13
- } catch (err) {
14
- reply = { ok: false, error: err instanceof Error ? err.message : String(err) };
15
- } finally {
16
- db?.close();
17
- }
18
- parentPort.postMessage(reply);
19
- });
1
+ import { serveWorkerRpc } from "zidane/ipc";
2
+ import { c as createUsageScanner } from "./chunks/usage-sql-DiITGx8Q.js";
3
+ import "node:sqlite";
4
+ import "zidane";
5
+ void serveWorkerRpc(createUsageScanner());
@@ -1,4 +1,4 @@
1
- import { contextBridge, ipcRenderer, webFrame } from "electron";
1
+ import { contextBridge, ipcRenderer, webUtils, webFrame } from "electron";
2
2
  function createChannelFanout(transport, reportError = (err) => {
3
3
  queueMicrotask(() => {
4
4
  throw err;
@@ -42,7 +42,7 @@ const api = {
42
42
  sessions: {
43
43
  list: (filter, hostId) => ipcRenderer.invoke("sessions:list", filter, hostId),
44
44
  ids: () => ipcRenderer.invoke("sessions:ids"),
45
- search: (query, filter) => ipcRenderer.invoke("sessions:search", query, filter),
45
+ search: (query, filter, channel) => ipcRenderer.invoke("sessions:search", query, filter, channel),
46
46
  create: (input) => ipcRenderer.invoke("sessions:create", input),
47
47
  setTitle: (id, title) => ipcRenderer.invoke("sessions:setTitle", id, title),
48
48
  setAgentId: (id, agentId) => ipcRenderer.invoke("sessions:setAgentId", id, agentId),
@@ -65,7 +65,7 @@ const api = {
65
65
  delete: (id) => ipcRenderer.invoke("sessions:delete", id),
66
66
  sideSession: (parent) => ipcRenderer.invoke("sessions:sideSession", parent),
67
67
  retryEnvironment: (id) => ipcRenderer.invoke("sessions:retryEnvironment", id),
68
- moveEnvironment: (id, environment) => ipcRenderer.invoke("sessions:moveEnvironment", id, environment),
68
+ moveEnvironment: (id, environment, cwd, options) => ipcRenderer.invoke("sessions:moveEnvironment", id, environment, cwd, options),
69
69
  environmentActions: (id) => ipcRenderer.invoke("sessions:environmentActions", id),
70
70
  runEnvironmentAction: (id, actionId) => ipcRenderer.invoke("sessions:runEnvironmentAction", id, actionId),
71
71
  generateTitle: (id) => ipcRenderer.invoke("sessions:generateTitle", id),
@@ -102,6 +102,7 @@ const api = {
102
102
  repo: {
103
103
  defaultParent: () => ipcRenderer.invoke("repo:defaultParent"),
104
104
  clone: (input, parent) => ipcRenderer.invoke("repo:clone", input, parent),
105
+ info: (input) => ipcRenderer.invoke("repo:info", input),
105
106
  cancel: () => ipcRenderer.invoke("repo:cancel"),
106
107
  onProgress: (cb) => subscribe("repo:progress", cb)
107
108
  },
@@ -109,6 +110,7 @@ const api = {
109
110
  get: (hostId) => ipcRenderer.invoke("settings:get", hostId),
110
111
  set: (patch, hostId) => ipcRenderer.invoke("settings:set", patch, hostId),
111
112
  killSwitches: () => ipcRenderer.invoke("settings:killSwitches"),
113
+ durabilityAvailable: () => ipcRenderer.invoke("settings:durabilityAvailable"),
112
114
  onChanged: (cb) => subscribe("settings:changed", cb)
113
115
  },
114
116
  environments: {
@@ -226,6 +228,7 @@ const api = {
226
228
  system: {
227
229
  openPath: (path) => ipcRenderer.invoke("system:openPath", path),
228
230
  revealPath: (path) => ipcRenderer.invoke("system:revealPath", path),
231
+ revealConfig: (location) => ipcRenderer.invoke("system:revealConfig", location),
229
232
  repoWebBase: (cwd) => ipcRenderer.invoke("system:repoWebBase", cwd)
230
233
  },
231
234
  shell: {
@@ -275,6 +278,13 @@ const api = {
275
278
  read: (cwd, path) => ipcRenderer.invoke("workspace:read", cwd, path),
276
279
  resolvePaths: (cwd, texts) => ipcRenderer.invoke("workspace:resolvePaths", cwd, texts),
277
280
  write: (cwd, path, contents, expectedMtimeMs) => ipcRenderer.invoke("workspace:write", cwd, path, contents, expectedMtimeMs),
281
+ create: (cwd, path, kind) => ipcRenderer.invoke("workspace:create", cwd, path, kind),
282
+ move: (cwd, from, to) => ipcRenderer.invoke("workspace:move", cwd, from, to),
283
+ copy: (cwd, from, toDir) => ipcRenderer.invoke("workspace:copy", cwd, from, toDir),
284
+ remove: (cwd, path) => ipcRenderer.invoke("workspace:remove", cwd, path),
285
+ importPaths: (cwd, dir, paths) => ipcRenderer.invoke("workspace:importPaths", cwd, dir, paths),
286
+ // The absolute path behind a dropped `File` (a drop from the file manager); '' for one made in the page.
287
+ pathForFile: (file) => webUtils.getPathForFile(file),
278
288
  diagnosticsTools: (cwd) => ipcRenderer.invoke("workspace:diagnosticsTools", cwd),
279
289
  diagnosticsInvalidate: (cwd) => ipcRenderer.invoke("workspace:diagnosticsInvalidate", cwd),
280
290
  lspConfigure: (opts) => ipcRenderer.invoke("workspace:lspConfigure", opts),
@@ -286,6 +296,7 @@ const api = {
286
296
  lspCompletion: (cwd, path, text, changes, line, column, trigger) => ipcRenderer.invoke("workspace:lspCompletion", cwd, path, text, changes, line, column, trigger),
287
297
  lspResolveCompletion: (cwd, path, id, index) => ipcRenderer.invoke("workspace:lspResolveCompletion", cwd, path, id, index),
288
298
  diagnostics: (cwd, paths, opts) => ipcRenderer.invoke("workspace:diagnostics", cwd, paths, opts),
299
+ diagnosticsCancel: (requestId) => ipcRenderer.invoke("workspace:diagnosticsCancel", requestId),
289
300
  gitStatus: (cwd) => ipcRenderer.invoke("workspace:gitStatus", cwd),
290
301
  // Infinity does not survive structured clone; null stands for it.
291
302
  gitDiff: (cwd, path, context) => ipcRenderer.invoke("workspace:gitDiff", cwd, path, context === Infinity ? null : context),
@@ -293,10 +304,12 @@ const api = {
293
304
  gitCommit: (cwd, sha) => ipcRenderer.invoke("workspace:gitCommit", cwd, sha),
294
305
  search: (cwd, query, opts) => ipcRenderer.invoke("workspace:search", cwd, query, opts),
295
306
  gitInfo: (cwd) => ipcRenderer.invoke("workspace:gitInfo", cwd),
307
+ gitOrigin: (cwd) => ipcRenderer.invoke("workspace:gitOrigin", cwd),
296
308
  gitPr: (cwd, branch, fresh) => ipcRenderer.invoke("workspace:gitPr", cwd, branch, fresh),
297
309
  gitBranches: (cwd) => ipcRenderer.invoke("workspace:gitBranches", cwd),
298
310
  gitPrList: (cwd, query, fresh) => ipcRenderer.invoke("workspace:gitPrList", cwd, query, fresh),
299
311
  gitSwitch: (cwd, target, sessionId) => ipcRenderer.invoke("workspace:gitSwitch", cwd, target, sessionId ?? null),
312
+ gitCreateBranch: (cwd, name, sessionId) => ipcRenderer.invoke("workspace:gitCreateBranch", cwd, name, sessionId ?? null),
300
313
  gitSync: (cwd, sessionId) => ipcRenderer.invoke("workspace:gitSync", cwd, sessionId ?? null)
301
314
  },
302
315
  browser: {
@@ -404,7 +417,9 @@ const api = {
404
417
  probeTools: (cwd, name) => ipcRenderer.invoke("mcps:probeTools", cwd, name),
405
418
  onAuthEvent: (cb) => subscribe("mcps:authEvent", cb),
406
419
  upsert: (cwd, req) => ipcRenderer.invoke("mcps:upsert", cwd, req),
407
- remove: (cwd, name) => ipcRenderer.invoke("mcps:remove", cwd, name)
420
+ remove: (cwd, name) => ipcRenderer.invoke("mcps:remove", cwd, name),
421
+ instances: (cwd) => ipcRenderer.invoke("mcps:instances", cwd),
422
+ restart: (name, cwd) => ipcRenderer.invoke("mcps:restart", name, cwd)
408
423
  },
409
424
  interactions: {
410
425
  list: (sessionId) => ipcRenderer.invoke("interactions:list", sessionId),
@@ -474,10 +489,16 @@ const api = {
474
489
  add: (input) => ipcRenderer.invoke("hosts:add", input),
475
490
  test: (target) => ipcRenderer.invoke("hosts:test", target),
476
491
  rename: (id, name) => ipcRenderer.invoke("hosts:rename", id, name),
492
+ setUrl: (id, url) => ipcRenderer.invoke("hosts:setUrl", id, url),
477
493
  remove: (id) => ipcRenderer.invoke("hosts:remove", id),
478
494
  retry: (id) => ipcRenderer.invoke("hosts:retry", id),
479
495
  listDirs: (hostId, path) => ipcRenderer.invoke("hosts:listDirs", hostId, path),
496
+ mkdir: (hostId, parent, name) => ipcRenderer.invoke("hosts:mkdir", hostId, parent, name),
497
+ searchDirs: (hostId, query, path) => ipcRenderer.invoke("hosts:searchDirs", hostId, query, path),
498
+ clone: (hostId, input, parent) => ipcRenderer.invoke("hosts:clone", hostId, input, parent),
480
499
  authStatus: (hostId) => ipcRenderer.invoke("hosts:authStatus", hostId),
500
+ capabilities: (hostId, refresh) => ipcRenderer.invoke("hosts:capabilities", hostId, refresh),
501
+ selfUpdate: (hostId, action, enabled) => ipcRenderer.invoke("hosts:selfUpdate", hostId, action, enabled),
481
502
  authSetApiKey: (hostId, provider, key) => ipcRenderer.invoke("hosts:authSetApiKey", hostId, provider, key),
482
503
  authRemove: (hostId, provider, account) => ipcRenderer.invoke("hosts:authRemove", hostId, provider, account),
483
504
  catalog: (hostId, kind, cwd) => ipcRenderer.invoke("hosts:catalog", hostId, kind, cwd),
@@ -488,11 +509,16 @@ const api = {
488
509
  oauthCancel: (flowKey) => ipcRenderer.invoke("hosts:oauthCancel", flowKey),
489
510
  onOAuthStart: (cb) => subscribe("hosts:oauthStart", cb),
490
511
  installsAllowed: (hostId) => ipcRenderer.invoke("hosts:installsAllowed", hostId),
512
+ methods: (hostId) => ipcRenderer.invoke("hosts:methods", hostId),
491
513
  install: (hostId, kind, spec, options) => ipcRenderer.invoke("hosts:install", hostId, kind, spec, options),
492
514
  uninstall: (hostId, kind, name) => ipcRenderer.invoke("hosts:uninstall", hostId, kind, name),
493
515
  update: (hostId, kind, name) => ipcRenderer.invoke("hosts:update", hostId, kind, name),
494
- mcpUpsert: (hostId, config) => ipcRenderer.invoke("hosts:mcpUpsert", hostId, config),
516
+ mcpUpsert: (hostId, config, options) => ipcRenderer.invoke("hosts:mcpUpsert", hostId, config, options),
495
517
  mcpRemove: (hostId, name) => ipcRenderer.invoke("hosts:mcpRemove", hostId, name),
518
+ mcpTest: (hostId, name, cwd) => ipcRenderer.invoke("hosts:mcpTest", hostId, name, cwd),
519
+ mcpSignOut: (hostId, name) => ipcRenderer.invoke("hosts:mcpSignOut", hostId, name),
520
+ mcpInstances: (hostId, cwd) => ipcRenderer.invoke("hosts:mcpInstances", hostId, cwd),
521
+ mcpRestart: (hostId, name, cwd) => ipcRenderer.invoke("hosts:mcpRestart", hostId, name, cwd),
496
522
  onCatalogChanged: (cb) => subscribe("hosts:catalogChanged", cb),
497
523
  // Settings sync, this computer → a saved server.
498
524
  syncState: (hostId) => ipcRenderer.invoke("hosts:syncState", hostId),
@@ -511,6 +537,7 @@ const api = {
511
537
  useServer: (hostId, enabled) => ipcRenderer.invoke("machines:useServer", hostId, enabled),
512
538
  list: (hostId) => ipcRenderer.invoke("machines:list", hostId),
513
539
  forget: (hostId, machineId) => ipcRenderer.invoke("machines:forget", hostId, machineId),
540
+ invite: (hostId, name) => ipcRenderer.invoke("machines:invite", hostId, name),
514
541
  listDirs: (hostId, machineId, path) => ipcRenderer.invoke("machines:listDirs", hostId, machineId, path),
515
542
  onLinks: (cb) => subscribe("machines:links", cb),
516
543
  onStatus: (cb) => subscribe("machines:status", cb)
@@ -522,6 +549,43 @@ const api = {
522
549
  }),
523
550
  watch: (topic, cwd) => ipcRenderer.invoke("invalidate:watch", topic, cwd),
524
551
  unwatch: (topic, cwd) => ipcRenderer.invoke("invalidate:unwatch", topic, cwd)
552
+ },
553
+ perf: {
554
+ history: () => ipcRenderer.invoke("perf:history"),
555
+ watch: (cb) => {
556
+ const off = subscribe("perf:sample", cb);
557
+ ipcRenderer.send("perf:subscribe");
558
+ return () => {
559
+ off();
560
+ ipcRenderer.send("perf:unsubscribe");
561
+ };
562
+ },
563
+ threads: (pid) => ipcRenderer.invoke("perf:threads", pid),
564
+ resetCounters: () => ipcRenderer.invoke("perf:resetCounters"),
565
+ report: () => ipcRenderer.invoke("perf:report"),
566
+ profile: (target, seconds) => ipcRenderer.invoke("perf:profile", target, seconds),
567
+ onCollect: (provide) => subscribe("perf:collect", () => ipcRenderer.send("perf:renderer", provide())),
568
+ remoteHistory: (hostId) => ipcRenderer.invoke("perf:remoteHistory", hostId),
569
+ remoteWatch: (hostId, cb, onError) => {
570
+ let live = true;
571
+ const off = subscribe("perf:remoteSample", (signal) => {
572
+ if (signal.hostId === hostId) cb(signal.sample);
573
+ });
574
+ void ipcRenderer.invoke("perf:remoteWatch", hostId).then(
575
+ (outcome) => {
576
+ if (live && !outcome.ok) onError(outcome.error);
577
+ },
578
+ (err) => {
579
+ if (live) onError({ kind: "failed", detail: err instanceof Error ? err.message : String(err) });
580
+ }
581
+ );
582
+ return () => {
583
+ live = false;
584
+ off();
585
+ ipcRenderer.send("perf:remoteUnwatch", hostId);
586
+ };
587
+ },
588
+ remoteThreads: (hostId, pid) => ipcRenderer.invoke("perf:remoteThreads", hostId, pid)
525
589
  }
526
590
  };
527
591
  contextBridge.exposeInMainWorld("api", api);