zidane-gui 7.0.29 → 7.0.30
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 +54 -15
- package/package.json +2 -2
package/out/main/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { resolve, delimiter, join, dirname, basename, isAbsolute } from "node:pa
|
|
|
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,
|
|
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, resolveSessionCwd, modelSupportsReasoning, enabledModelOptions, buildModelCatalog, modelsForDescriptor, getContextWindow, truncateTurnsAt, deleteTurnSafely, generateSessionTitle, writeSessionExport, toolResultText, sumRunCosts, 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, existsSync, accessSync, constants, statSync, readdirSync, copyFileSync, rmSync } from "node:fs";
|
|
8
8
|
import { homedir, userInfo } from "node:os";
|
|
@@ -3142,6 +3142,22 @@ const LAST_FOLDER_KEY = "last_folder";
|
|
|
3142
3142
|
function announceSessionsTouch(sessionId) {
|
|
3143
3143
|
getDaemonClient()?.notify("sessions.touch", { sessionId });
|
|
3144
3144
|
}
|
|
3145
|
+
async function patchSessionMetaSafely(sessionId, patch, rpc) {
|
|
3146
|
+
const daemon = getDaemonClient();
|
|
3147
|
+
if (daemon && rpc) {
|
|
3148
|
+
try {
|
|
3149
|
+
await rpc(daemon);
|
|
3150
|
+
return;
|
|
3151
|
+
} catch (err) {
|
|
3152
|
+
guiLog.warn("daemon metadata RPC failed; falling back to the in-process host", {
|
|
3153
|
+
scope: "daemon",
|
|
3154
|
+
error: err?.message ?? String(err)
|
|
3155
|
+
});
|
|
3156
|
+
}
|
|
3157
|
+
}
|
|
3158
|
+
await getChatHost().patchSessionMeta(sessionId, patch);
|
|
3159
|
+
announceSessionsTouch(sessionId);
|
|
3160
|
+
}
|
|
3145
3161
|
async function disposeOrRebuild(sessionId) {
|
|
3146
3162
|
const daemon = getDaemonClient();
|
|
3147
3163
|
if (daemon) {
|
|
@@ -3497,6 +3513,7 @@ function registerChatIpc() {
|
|
|
3497
3513
|
} catch {
|
|
3498
3514
|
}
|
|
3499
3515
|
}
|
|
3516
|
+
await getChatHost().setLiveSessionAgentId(id, agentId);
|
|
3500
3517
|
patchSessionScope(id, { agentId });
|
|
3501
3518
|
await disposeOrRebuild(id);
|
|
3502
3519
|
announceSessionsTouch(id);
|
|
@@ -3519,32 +3536,54 @@ function registerChatIpc() {
|
|
|
3519
3536
|
announceSessionsTouch(id);
|
|
3520
3537
|
invalidateGitRepoCache();
|
|
3521
3538
|
});
|
|
3522
|
-
ipcMain.handle("sessions:setEffort", (_e, id, effort) => {
|
|
3523
|
-
|
|
3524
|
-
|
|
3539
|
+
ipcMain.handle("sessions:setEffort", async (_e, id, effort) => {
|
|
3540
|
+
await patchSessionMetaSafely(
|
|
3541
|
+
id,
|
|
3542
|
+
{ effort },
|
|
3543
|
+
(daemon) => daemon.request("sessions.setEffort", { sessionId: id, effort })
|
|
3544
|
+
);
|
|
3525
3545
|
});
|
|
3526
3546
|
ipcMain.handle(
|
|
3527
3547
|
"sessions:setModel",
|
|
3528
3548
|
async (_e, id, providerKey, modelId, fallbacks) => {
|
|
3529
|
-
|
|
3549
|
+
const data = await getSessionStore().load(id);
|
|
3550
|
+
const providers = await providersFor(data ? resolveSessionCwd(data) : void 0);
|
|
3551
|
+
const descriptor = descriptorFor(providerKey, providers);
|
|
3552
|
+
const priorEffort = data?.metadata?.effort;
|
|
3553
|
+
const effort = typeof priorEffort === "string" && descriptor && modelSupportsReasoning(descriptor, modelId) ? priorEffort : void 0;
|
|
3554
|
+
const pick = {
|
|
3530
3555
|
providerKey,
|
|
3531
3556
|
modelId,
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
}
|
|
3535
|
-
|
|
3557
|
+
...fallbacks && fallbacks.length > 0 ? { fallbacks: [...fallbacks] } : {},
|
|
3558
|
+
...effort ? { effort } : {}
|
|
3559
|
+
};
|
|
3560
|
+
const daemon = getDaemonClient();
|
|
3561
|
+
if (daemon) {
|
|
3562
|
+
try {
|
|
3563
|
+
await daemon.request("sessions.setModel", { sessionId: id, ...pick });
|
|
3564
|
+
return;
|
|
3565
|
+
} catch (err) {
|
|
3566
|
+
guiLog.warn("sessions.setModel RPC failed; falling back to the in-process host", {
|
|
3567
|
+
scope: "daemon",
|
|
3568
|
+
error: err?.message ?? String(err)
|
|
3569
|
+
});
|
|
3570
|
+
}
|
|
3571
|
+
}
|
|
3572
|
+
await getChatHost().setSessionModel(id, pick);
|
|
3536
3573
|
announceSessionsTouch(id);
|
|
3537
3574
|
}
|
|
3538
3575
|
);
|
|
3539
3576
|
ipcMain.handle("sessions:setModelOptions", async (_e, id, options) => {
|
|
3540
3577
|
const data = await getSessionStore().load(id);
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
modelOptions: enabledModelOptions(options)
|
|
3545
|
-
})
|
|
3578
|
+
const modelOptions = modelOptionsForSession({
|
|
3579
|
+
...data?.metadata ?? {},
|
|
3580
|
+
modelOptions: enabledModelOptions(options)
|
|
3546
3581
|
});
|
|
3547
|
-
|
|
3582
|
+
await patchSessionMetaSafely(
|
|
3583
|
+
id,
|
|
3584
|
+
{ modelOptions },
|
|
3585
|
+
(daemon) => daemon.request("sessions.setModelOptions", { sessionId: id, options: modelOptions })
|
|
3586
|
+
);
|
|
3548
3587
|
});
|
|
3549
3588
|
ipcMain.handle("sessions:listModels", async (_e, cwd) => {
|
|
3550
3589
|
applyAuthEnv();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zidane-gui",
|
|
3
3
|
"productName": "Zidane",
|
|
4
|
-
"version": "7.0.
|
|
4
|
+
"version": "7.0.30",
|
|
5
5
|
"description": "Zidane Desktop",
|
|
6
6
|
"author": "StackBlitz",
|
|
7
7
|
"type": "module",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"shiki": "^4.1.0",
|
|
60
60
|
"electron": "^41.7.0",
|
|
61
61
|
"tippy.js": "^6.3.7",
|
|
62
|
-
"zidane": "7.0.
|
|
62
|
+
"zidane": "7.0.30",
|
|
63
63
|
"zod": "^4.4.3"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|