zidane-gui 7.0.14 → 7.0.16
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/out/main/index.js
CHANGED
|
@@ -2,11 +2,11 @@ import { resolve, join, dirname, delimiter, basename } from "node:path";
|
|
|
2
2
|
import { config } from "dotenv";
|
|
3
3
|
import { app, shell, BrowserWindow, ipcMain, dialog, nativeImage } from "electron";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
|
-
import { parseEditorCommand, keybindingsPath, stripJsonComments, ensureKeybindingsFile, readProjects, writeProjects, credentialsPath, applyApiKeyEnv, BUILTIN_PROVIDERS, readCredentials, detectAuth, supportsOAuth, runOAuthLogin, setProviderCredential, scopeCwd, resolveConfig, DEFAULT_SETTINGS, enforceSettingsInvariants, mcpsWritePath, upsertMcpServer, discoverProjectMcps, removeMcpServer, loadMcpToolsCache, subscribeMcpToolsCache, refreshMcpToolsCatalog, createFileMcpCredentialStore, createChatHost, toTodosSnapshot, searchSessionHistory, searchableTurnText, deriveSessionTitle, toolCallPreview, modelChainMetadata, sessionModelFallbacks, enabledModelOptions, buildModelCatalog, modelsForDescriptor, modelSupportsReasoning, getContextWindow, truncateTurnsAt, deleteTurnSafely, generateSessionTitle, writeSessionExport, toolResultText, sumRunCosts, resolveSessionCwd, effectiveContextWindow, lastContextSizeFromTurns, fmtTokens, selectActiveTodos, setTodosForRun, sanitizeTodoItems, DEFAULT_MAX_TODO_ITEMS, fetchAllProviderUsage, fetchProviderUsage, listProjectFiles, discoverProjectSkills, discoverProjectPlugins, readProviderCredential, removeProviderCredential, setPreferredCredential, hasClaudeCodeSetup, countClaudeSessionFiles, importFromClaudeCode, isMainSession, findGitRoot, restoreModelOptions, modelOptionsFor, eventsFromTurns } from "zidane/chat";
|
|
5
|
+
import { parseEditorCommand, keybindingsPath, stripJsonComments, ensureKeybindingsFile, readProjects, writeProjects, credentialsPath, applyApiKeyEnv, BUILTIN_PROVIDERS, readCredentials, detectAuth, supportsOAuth, runOAuthLogin, setProviderCredential, scopeCwd, resolveConfig, DEFAULT_SETTINGS, enforceSettingsInvariants, mcpsWritePath, upsertMcpServer, discoverProjectMcps, removeMcpServer, loadMcpToolsCache, subscribeMcpToolsCache, refreshMcpToolsCatalog, createFileMcpCredentialStore, createChatHost, toTodosSnapshot, searchSessionHistory, searchableTurnText, deriveSessionTitle, toolCallPreview, modelChainMetadata, sessionModelFallbacks, enabledModelOptions, buildModelCatalog, modelsForDescriptor, modelSupportsReasoning, getContextWindow, truncateTurnsAt, deleteTurnSafely, generateSessionTitle, writeSessionExport, toolResultText, sumRunCosts, resolveSessionCwd, effectiveContextWindow, lastContextSizeFromTurns, fmtTokens, groupArtifacts, selectActiveTodos, setTodosForRun, sanitizeTodoItems, DEFAULT_MAX_TODO_ITEMS, fetchAllProviderUsage, fetchProviderUsage, listProjectFiles, discoverProjectSkills, discoverProjectPlugins, readProviderCredential, removeProviderCredential, setPreferredCredential, hasClaudeCodeSetup, countClaudeSessionFiles, importFromClaudeCode, isMainSession, findGitRoot, restoreModelOptions, modelOptionsFor, eventsFromTurns } from "zidane/chat";
|
|
6
6
|
import { spawn, execFile } from "node:child_process";
|
|
7
7
|
import { mkdirSync, readFileSync, writeFileSync, readdirSync, existsSync, copyFileSync, rmSync } from "node:fs";
|
|
8
8
|
import { homedir, userInfo } from "node:os";
|
|
9
|
-
import { migrateSessionArtifactDirs, createRingBufferSink, fanoutSink, consoleSink, createLogger, createExtensionBus, createExtensionHostRuntimeBridge, toWireConfigSchema, resolveCompletionSubmit, inlineLoadedExtension, discoverAndBuildExtensionRegistry, disposeExtensionRegistry, installExtensionFromSpec, ExtensionInstallError, updateInstalledExtension, removeInstalledExtension, sanitizeExtensionConfigActionPatch, loginMcpServer, McpOAuthProvider, extensionScaffold, resolveInlineSuggestion, createPathAutocompleteProvider, editSessionMetadata, loadSession } from "zidane";
|
|
9
|
+
import { migrateSessionArtifactDirs, createRingBufferSink, fanoutSink, consoleSink, createLogger, createExtensionBus, createExtensionHostRuntimeBridge, toWireConfigSchema, resolveCompletionSubmit, inlineLoadedExtension, discoverAndBuildExtensionRegistry, disposeExtensionRegistry, installExtensionFromSpec, ExtensionInstallError, updateInstalledExtension, removeInstalledExtension, sanitizeExtensionConfigActionPatch, loginMcpServer, McpOAuthProvider, refreshArtifact, extensionScaffold, resolveInlineSuggestion, createPathAutocompleteProvider, editSessionMetadata, renderArtifactRow, loadSession } from "zidane";
|
|
10
10
|
import { IPC_BUILD_ID, defaultSocketPath, probeSocket, connectIpcClient, IpcVersionMismatchError } from "zidane/ipc";
|
|
11
11
|
import { DatabaseSync } from "node:sqlite";
|
|
12
12
|
import { P as PARENT_USER_TURN, u as usageAssistantDaily$1, b as usageUserDaily$1, a as usageSessionDaily$1 } from "./chunks/usage-sql-BdDLRz11.js";
|
|
@@ -2097,6 +2097,8 @@ function broadcast(signal) {
|
|
|
2097
2097
|
case "model:fallback":
|
|
2098
2098
|
case "work:snapshot":
|
|
2099
2099
|
case "todos:snapshot":
|
|
2100
|
+
case "artifact:recorded":
|
|
2101
|
+
case "artifact:changed":
|
|
2100
2102
|
/*
|
|
2101
2103
|
* Forwarded so the renderer HAS the data: the GUI does not render a
|
|
2102
2104
|
* cache chip or an Instructions/SYSTEM.md surface yet, but both signals
|
|
@@ -2358,6 +2360,62 @@ function getTodosSnapshot(sessionId) {
|
|
|
2358
2360
|
}
|
|
2359
2361
|
return getChatHost().getTodosSnapshot(sessionId);
|
|
2360
2362
|
}
|
|
2363
|
+
async function listArtifacts(query) {
|
|
2364
|
+
const daemon = getDaemonClient();
|
|
2365
|
+
if (daemon) {
|
|
2366
|
+
try {
|
|
2367
|
+
return "sessionId" in query ? await daemon.request("sessions.artifacts", { sessionId: query.sessionId }) : await daemon.request("artifacts.list", { projectRoot: query.projectRoot });
|
|
2368
|
+
} catch {
|
|
2369
|
+
return [];
|
|
2370
|
+
}
|
|
2371
|
+
}
|
|
2372
|
+
const store2 = getSessionStore();
|
|
2373
|
+
if (!store2.listArtifacts) {
|
|
2374
|
+
return [];
|
|
2375
|
+
}
|
|
2376
|
+
return "sessionId" in query ? store2.listArtifacts({ sessionId: query.sessionId }) : store2.listArtifacts({ projectRoot: query.projectRoot });
|
|
2377
|
+
}
|
|
2378
|
+
async function deleteArtifact(sessionId, artifactId) {
|
|
2379
|
+
const daemon = getDaemonClient();
|
|
2380
|
+
if (daemon) {
|
|
2381
|
+
try {
|
|
2382
|
+
return await daemon.request("artifacts.delete", { sessionId, artifactId });
|
|
2383
|
+
} catch {
|
|
2384
|
+
return false;
|
|
2385
|
+
}
|
|
2386
|
+
}
|
|
2387
|
+
const store2 = getSessionStore();
|
|
2388
|
+
if (!store2.deleteArtifact) {
|
|
2389
|
+
return false;
|
|
2390
|
+
}
|
|
2391
|
+
await store2.deleteArtifact(sessionId, artifactId);
|
|
2392
|
+
broadcast({ kind: "artifact:changed", sessionId, op: "delete", artifactId });
|
|
2393
|
+
return true;
|
|
2394
|
+
}
|
|
2395
|
+
async function refreshSessionArtifact(artifact) {
|
|
2396
|
+
const updated = await refreshArtifact(artifact);
|
|
2397
|
+
if (!updated) {
|
|
2398
|
+
return null;
|
|
2399
|
+
}
|
|
2400
|
+
const daemon = getDaemonClient();
|
|
2401
|
+
if (daemon) {
|
|
2402
|
+
try {
|
|
2403
|
+
return await daemon.request("artifacts.upsert", { artifact: updated });
|
|
2404
|
+
} catch {
|
|
2405
|
+
return null;
|
|
2406
|
+
}
|
|
2407
|
+
}
|
|
2408
|
+
const store2 = getSessionStore();
|
|
2409
|
+
const stored = await store2.upsertArtifact?.(updated) ?? updated;
|
|
2410
|
+
broadcast({
|
|
2411
|
+
kind: "artifact:changed",
|
|
2412
|
+
sessionId: stored.sessionId,
|
|
2413
|
+
op: "upsert",
|
|
2414
|
+
artifactId: stored.id,
|
|
2415
|
+
artifact: stored
|
|
2416
|
+
});
|
|
2417
|
+
return stored;
|
|
2418
|
+
}
|
|
2361
2419
|
async function setSessionTodos(sessionId, items) {
|
|
2362
2420
|
const daemon = getDaemonClient();
|
|
2363
2421
|
if (daemon) {
|
|
@@ -3635,6 +3693,30 @@ function registerChatIpc() {
|
|
|
3635
3693
|
const valid = ["all", "30d", "7d"];
|
|
3636
3694
|
return getUsageSummary(valid.includes(range) ? range : "all");
|
|
3637
3695
|
});
|
|
3696
|
+
ipcMain.handle(
|
|
3697
|
+
"artifacts:list",
|
|
3698
|
+
async (_e, query) => {
|
|
3699
|
+
const rows = await listArtifacts(
|
|
3700
|
+
"sessionId" in query && typeof query.sessionId === "string" ? { sessionId: query.sessionId } : { projectRoot: String(query.projectRoot) }
|
|
3701
|
+
);
|
|
3702
|
+
return groupArtifacts(rows).map((group) => ({
|
|
3703
|
+
kind: group.kind,
|
|
3704
|
+
label: group.label,
|
|
3705
|
+
rows: group.rows.map(({ artifact, row }) => ({ artifact, row }))
|
|
3706
|
+
}));
|
|
3707
|
+
}
|
|
3708
|
+
);
|
|
3709
|
+
ipcMain.handle(
|
|
3710
|
+
"artifacts:delete",
|
|
3711
|
+
(_e, sessionId, artifactId) => deleteArtifact(String(sessionId), String(artifactId))
|
|
3712
|
+
);
|
|
3713
|
+
ipcMain.handle("artifacts:refresh", async (_e, artifact) => {
|
|
3714
|
+
const updated = await refreshSessionArtifact(artifact);
|
|
3715
|
+
if (!updated) {
|
|
3716
|
+
return null;
|
|
3717
|
+
}
|
|
3718
|
+
return { artifact: updated, row: renderArtifactRow(updated) };
|
|
3719
|
+
});
|
|
3638
3720
|
ipcMain.handle("todos:get", async (_e, sessionId) => {
|
|
3639
3721
|
const state = await getTodosSnapshot(sessionId);
|
|
3640
3722
|
if (!state) {
|
|
@@ -4260,6 +4342,7 @@ function createWindow() {
|
|
|
4260
4342
|
};
|
|
4261
4343
|
ipcMain.removeHandler("app:rendererReady");
|
|
4262
4344
|
ipcMain.handle("app:rendererReady", show);
|
|
4345
|
+
ipcMain.handle("app:version", () => app.getVersion());
|
|
4263
4346
|
setTimeout(show, 1500);
|
|
4264
4347
|
win.webContents.setWindowOpenHandler(({ url }) => {
|
|
4265
4348
|
try {
|
package/out/preload/index.mjs
CHANGED
|
@@ -49,6 +49,7 @@ const api = {
|
|
|
49
49
|
},
|
|
50
50
|
app: {
|
|
51
51
|
rendererReady: () => ipcRenderer.invoke("app:rendererReady"),
|
|
52
|
+
version: () => ipcRenderer.invoke("app:version"),
|
|
52
53
|
// Synchronous — webFrame lives in this process; no IPC roundtrip.
|
|
53
54
|
getZoomFactor: () => webFrame.getZoomFactor()
|
|
54
55
|
},
|
|
@@ -102,6 +103,11 @@ const api = {
|
|
|
102
103
|
get: (sessionId) => ipcRenderer.invoke("todos:get", sessionId),
|
|
103
104
|
set: (sessionId, items) => ipcRenderer.invoke("todos:set", sessionId, items)
|
|
104
105
|
},
|
|
106
|
+
artifacts: {
|
|
107
|
+
list: (query) => ipcRenderer.invoke("artifacts:list", query),
|
|
108
|
+
delete: (sessionId, artifactId) => ipcRenderer.invoke("artifacts:delete", sessionId, artifactId),
|
|
109
|
+
refresh: (artifact) => ipcRenderer.invoke("artifacts:refresh", artifact)
|
|
110
|
+
},
|
|
105
111
|
providerUsage: {
|
|
106
112
|
fetchAll: (cwd, opts) => ipcRenderer.invoke("usage:fetchAll", cwd, opts),
|
|
107
113
|
fetch: (providerKey, cwd, opts) => ipcRenderer.invoke("usage:fetch", providerKey, cwd, opts)
|