zidane-gui 8.2.4 → 8.2.5
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/chunks/{history-pager-Bd5PUapJ.js → history-pager-DWgllMof.js} +3 -43
- package/out/main/chunks/session-search-sql-BrNTuwjH.js +196 -0
- package/out/main/chunks/transcript-sql-DbZ-a5wb.js +43 -0
- package/out/main/history-worker.js +2 -1
- package/out/main/index.js +116 -210
- package/out/main/session-search-worker.js +20 -0
- package/out/preload/index.mjs +2 -1
- package/out/renderer/assets/{ghostty-web-BTRdAlae.js → ghostty-web-wgkS5jGl.js} +1 -1
- package/out/renderer/assets/{index-D0Yl489p.js → index-CebkAnp4.js} +429 -72
- package/out/renderer/assets/{index-BI29HKE2.css → index-DqGrzqUj.css} +1 -1
- package/out/renderer/index.html +2 -2
- package/package.json +2 -2
package/out/main/index.js
CHANGED
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
import { readFileSync, mkdirSync, writeFileSync, renameSync, existsSync, accessSync, constants, statSync, readdirSync, rmSync, mkdtempSync, realpathSync, watch as watch$1, createReadStream } from "node:fs";
|
|
2
2
|
import { resolve, join, dirname, delimiter, isAbsolute, sep, relative, normalize } from "node:path";
|
|
3
|
-
import { resolveStorageDirs, shellPath, mergePath, shellPathAsync, createMachineLinkHandlers, createMachineHandlers, IPC_BUILD_ID, defaultSocketPath, probeSocket, ensureDaemonRunning, connectIpcClient, IpcVersionMismatchError, IPC_PROTOCOL_VERSION, runWorkspaceExecStream, loadSessionDocument, loadEventsPage, IpcErrorCode, runRemoteOAuth } from "zidane/ipc";
|
|
3
|
+
import { resolveStorageDirs, shellPath, mergePath, shellPathAsync, createMachineLinkHandlers, createMachineHandlers, IPC_BUILD_ID, defaultSocketPath, probeSocket, ensureDaemonRunning, connectIpcClient, IpcVersionMismatchError, IPC_PROTOCOL_VERSION, runWorkspaceExecStream, loadSessionDocument, loadEventsPage, IpcErrorCode, runRemoteOAuth, createWorkerRpcClient, WorkerRequestError, WorkerUnavailableError } from "zidane/ipc";
|
|
4
4
|
import { homedir, tmpdir, userInfo, hostname } from "node:os";
|
|
5
5
|
import { pathToFileURL } from "node:url";
|
|
6
6
|
import { config } from "dotenv";
|
|
7
7
|
import { shell, app, BrowserWindow, ipcMain, nativeImage, Notification, session, webContents, utilityProcess, powerMonitor, dialog, net, protocol, nativeTheme } from "electron";
|
|
8
8
|
import { migrateSessionArtifactDirs, createRingBufferSink, fanoutSink, consoleSink, createLogger, createSqliteDriver, createSqliteWriteQueue, createSqliteSessionStore, createExtensionBus, createExtensionHostRuntimeBridge, createExtensionHud, inlineLoadedExtension, discoverAndBuildExtensionRegistry, disposeExtensionRegistry, toWireConfigSchema, resolveCompletionSubmit, installExtensionFromSpec, ExtensionInstallError, updateInstalledExtension, removeInstalledExtension, sanitizeExtensionConfigActionPatch, loginMcpServer, clearMcpSignIn, mcpOAuthProviderFor, saveMcpClientSecret, refreshArtifact, BUILTIN_ARTIFACT_KINDS, renderArtifactRow, sessionBadges, normalizeBadgeTarget, extensionBadgeActions, runBadgeAction, resolveInlineSuggestion, createPathAutocompleteProvider, extensionScaffold, parseGithubRefKey, githubPullUrl, pullFromMeta, githubPullConfirmedAt, isPullFresh, viewForRead, queueGithubPull, pullMeta, referenceProviderWires, GITHUB_PULL_PROVIDER_ID, GITHUB_ISSUE_PROVIDER_ID, createReferenceResolver, isThinkingLevel, loadSession, githubClient, isGhRateLimitError, rateLimitResetFromJson, configureGithubClient, createFileGithubStateStore } from "zidane";
|
|
9
9
|
import { randomUUID, createHash } from "node:crypto";
|
|
10
|
-
import { parseEditorCommand, keybindingsPath, stripJsonComments, normalizeBindingValue, ensureKeybindingsFile, readProjects, writeProjects, credentialsPath, applyApiKeyEnv, BUILTIN_PROVIDERS, readCredentials, detectAuth, supportsOAuth, runOAuthLogin, DEFAULT_OAUTH_ACCOUNT_LABEL, setProviderCredential, resolveConfig, scopeCwd, settingsFromStored, DEFAULT_SETTINGS, SETTINGS_DEFAULTS_VERSION_KEY, SETTINGS_DEFAULTS_VERSION, enforceSettingsInvariants, sparseSettingsUpdate, createExtensionMcpHost, createFileMcpCredentialStore, mcpsWritePath, upsertMcpServer, discoverProjectMcps, removeMcpServer, compactPath as compactPath$1, loadMcpToolsCache, subscribeMcpToolsCache, refreshMcpToolsCatalog, classifyMcpTest, describeForkFailure, DEFAULT_SPACE_ID, SPACE_METADATA_KEY, TITLE_SOURCE_KEY, toTodosSnapshot, projectRootOf, createChatHost, findGitRoot, fileEntriesFromPaths, toolResultText, sumRunCosts, lastContextSizeFromTurns, availableAgents, groupArtifacts, defaultModelOf, restoreModelOptions, enabledModelOptions, modelOptionsFor, readProviderCredential, removeProviderCredential, setPreferredCredential, removeStoredCredential, setCredentialLabel, hasClaudeCodeSetup, countClaudeSessionFiles, previewClaudeImport, importFromClaudeCode, runInProgress, runProgress, resolveSessionCwd, effectiveContextWindow, getContextWindow, modelSupportsReasoning, fmtTokens, listProjectFiles, discoverProjectPlugins, applyEnvironmentSettingsChange, hasUntimedOpenCalls, withRunningCallStarts, buildModelCatalog, modelsForDescriptor, listDecisionModels, listImageModels, testDecisionModel, testModel, providerFactoryOptions, describeTitleStatus, overlayHostSettings, splitHostSettingsPatch, settingsToWire, onboardingInstallSignals, needsOnboarding, mergeOnboardingState, migratedOnboardingRecords, detectOnboardingEnvironment, onboardingProviders, BUILTIN_THEMES, connectorGithubToken,
|
|
10
|
+
import { parseEditorCommand, keybindingsPath, stripJsonComments, normalizeBindingValue, ensureKeybindingsFile, readProjects, writeProjects, credentialsPath, applyApiKeyEnv, BUILTIN_PROVIDERS, readCredentials, detectAuth, supportsOAuth, runOAuthLogin, DEFAULT_OAUTH_ACCOUNT_LABEL, setProviderCredential, resolveConfig, scopeCwd, settingsFromStored, DEFAULT_SETTINGS, SETTINGS_DEFAULTS_VERSION_KEY, SETTINGS_DEFAULTS_VERSION, enforceSettingsInvariants, sparseSettingsUpdate, createExtensionMcpHost, createFileMcpCredentialStore, mcpsWritePath, upsertMcpServer, discoverProjectMcps, removeMcpServer, compactPath as compactPath$1, loadMcpToolsCache, subscribeMcpToolsCache, refreshMcpToolsCatalog, classifyMcpTest, describeForkFailure, DEFAULT_SPACE_ID, SPACE_METADATA_KEY, TITLE_SOURCE_KEY, toTodosSnapshot, projectRootOf, createChatHost, findGitRoot, fileEntriesFromPaths, toolResultText, sumRunCosts, lastContextSizeFromTurns, availableAgents, groupArtifacts, defaultModelOf, restoreModelOptions, enabledModelOptions, modelOptionsFor, readProviderCredential, removeProviderCredential, setPreferredCredential, removeStoredCredential, setCredentialLabel, hasClaudeCodeSetup, countClaudeSessionFiles, previewClaudeImport, importFromClaudeCode, runInProgress, runProgress, resolveSessionCwd, effectiveContextWindow, getContextWindow, modelSupportsReasoning, fmtTokens, listProjectFiles, discoverProjectPlugins, applyEnvironmentSettingsChange, hasUntimedOpenCalls, withRunningCallStarts, buildModelCatalog, modelsForDescriptor, listDecisionModels, listImageModels, testDecisionModel, testModel, providerFactoryOptions, describeTitleStatus, overlayHostSettings, splitHostSettingsPatch, settingsToWire, onboardingInstallSignals, needsOnboarding, mergeOnboardingState, migratedOnboardingRecords, detectOnboardingEnvironment, onboardingProviders, BUILTIN_THEMES, connectorGithubToken, spaceIdForNewSession, newSessionModel, defaultSessionModel, defaultSessionKnobs, sessionModelFallbacks, defaultSessionAgent, deleteSessionData, writeSessionExport, sessionEnvironmentSummary, readSessionSpaceId, isMainSession, readSessionAccount, deriveSessionTitle, isStaleRunMarker, toolCallPreview, readSessionEnvironment, assertEnvironmentReady, discoverProjectSkills, selectActiveTodos, setTodosForRun, sanitizeTodoItems, DEFAULT_MAX_TODO_ITEMS, fetchAllProviderUsage, fetchProviderUsage, fetchGithubUsage, watchInstalledVersion, checkForUpdate, upgradeInstalledPackages, performSelfUpdate, compareSemver, findInstalledCompanion } from "zidane/chat";
|
|
11
11
|
import { execFile, spawn } from "node:child_process";
|
|
12
|
-
import {
|
|
12
|
+
import { createPresenceMerge, createHostIndex, LOCAL_HOST_NAME, LOCAL_HOST_KEY, isMethodNotFound, HostRemovedError, sideSessionParent, orchestratedBy, BrowserOpError, normalizeBrowserUrl, isAllowedBrowserUrl, BROWSER_OUTLINE_MAX_ELEMENTS, BROWSER_TEXT_MAX_CHARS, BROWSER_EVALUATE_MAX_BYTES, BROWSER_MAX_WAIT_MS, BROWSER_ACTION_TIMEOUT_MS, BROWSER_WAIT_TIMEOUT_MS, BROWSER_OPEN_MOUNT_MS, TERMINAL_VIEW_MAX_LINES, daemonGate, remoteHostsGate, resolvePanelLoadContext, normalizePanelContent, normalizePaletteItems, normalizePaletteRunResult, HostRegistryError, SYNC_MODES, SYNC_CATEGORIES, toMachineName, isValidMachineName, engagedKillSwitches, isPaletteContext, BASH_CALL_ID_PREFIX, parseMachineKind } from "zidane/chat/pure";
|
|
13
13
|
import { createRequire } from "node:module";
|
|
14
14
|
import { DatabaseSync } from "node:sqlite";
|
|
15
15
|
import { u as usageAssistantDaily$1, a as usageUserDaily$1, b as usageSessionDaily$1 } from "./chunks/usage-sql-C2Tg1u44.js";
|
|
16
|
-
import {
|
|
16
|
+
import { N as NOT_SIDE_SQL, c as createSessionSearchSql, a as sessionKey, b as serverIdOf, L as LOCAL_SESSION_HOST, p as parseSessionKey, d as asSessionKey, e as siblingSessionKey, f as sessionIdOf, l as localSessionKey, s as searchSessions } from "./chunks/session-search-sql-BrNTuwjH.js";
|
|
17
|
+
import { s as sessionExistsOn, p as parseRows, r as readRuns, a as parseRow, b as readTranscript } from "./chunks/transcript-sql-DbZ-a5wb.js";
|
|
17
18
|
import { installSkillFromSpec, SkillInstallError, browseSkillSource } from "zidane/skills";
|
|
18
19
|
import { mkdtemp, mkdir, writeFile, readFile, rm, stat, rename, unlink, realpath, readdir, chmod } from "node:fs/promises";
|
|
19
20
|
import { promisify } from "node:util";
|
|
20
21
|
import { Worker } from "node:worker_threads";
|
|
21
22
|
import { connect } from "node:net";
|
|
22
|
-
import {
|
|
23
|
+
import { a as createLocalHistoryPager, E as EVENTS_PAGE_TURNS } from "./chunks/history-pager-DWgllMof.js";
|
|
23
24
|
import { tailTruncate } from "zidane/tools";
|
|
24
25
|
import { m as makeToolContext } from "./chunks/context-77_UZfgL.js";
|
|
25
26
|
import { request } from "node:http";
|
|
26
27
|
import { Readable } from "node:stream";
|
|
28
|
+
import "node:timers/promises";
|
|
27
29
|
import __cjs_mod__ from "node:module";
|
|
28
30
|
const __filename = import.meta.filename;
|
|
29
31
|
const __dirname = import.meta.dirname;
|
|
@@ -669,7 +671,9 @@ function startOAuth(provider, options = {}) {
|
|
|
669
671
|
broadcastOAuth({ requestId, kind: "progress", message: message2 });
|
|
670
672
|
},
|
|
671
673
|
...interactive,
|
|
672
|
-
signal: controller2.signal
|
|
674
|
+
signal: controller2.signal,
|
|
675
|
+
// `onUrl` already opened it; a second launch would open a duplicate tab.
|
|
676
|
+
openBrowser: false
|
|
673
677
|
}).then((creds) => {
|
|
674
678
|
const label = options.label?.trim() || DEFAULT_OAUTH_ACCOUNT_LABEL;
|
|
675
679
|
setProviderCredential(
|
|
@@ -916,11 +920,10 @@ function safeParseRecord(text2) {
|
|
|
916
920
|
return {};
|
|
917
921
|
}
|
|
918
922
|
}
|
|
919
|
-
const NOT_SIDE_SQL = "COALESCE(CASE WHEN json_valid(metadata) THEN json_type(metadata, '$.sideOf') = 'text' END, 0) = 0";
|
|
920
923
|
function buildListFilter(filter) {
|
|
921
924
|
const conditions = [];
|
|
922
925
|
const params = [];
|
|
923
|
-
|
|
926
|
+
{
|
|
924
927
|
conditions.push(NOT_SIDE_SQL);
|
|
925
928
|
}
|
|
926
929
|
if (filter.agentId) {
|
|
@@ -1096,41 +1099,10 @@ function findTurnsContaining(id, needle, limit) {
|
|
|
1096
1099
|
).all(id, `%${escaped}%`, limit);
|
|
1097
1100
|
return parseRows(rows);
|
|
1098
1101
|
}
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
);
|
|
1104
|
-
return rows.map((r) => ({ id: r.id, metadata: safeParseRecord(r.metadata), updatedAt: r.updated_at }));
|
|
1105
|
-
}
|
|
1106
|
-
function turnsMatchWhere(needleCount) {
|
|
1107
|
-
return Array.from({ length: needleCount }, () => "instr(lower(data), ?) > 0").join(" AND ");
|
|
1108
|
-
}
|
|
1109
|
-
const SEARCH_CHUNK_ROWS = 2e3;
|
|
1110
|
-
function matchTurnsChunk(id, lowerNeedles, fromSeq, parseLimit) {
|
|
1111
|
-
if (lowerNeedles.length === 0) {
|
|
1112
|
-
return { count: 0, turns: [], nextSeq: null };
|
|
1113
|
-
}
|
|
1114
|
-
const boundary = prepare("SELECT seq FROM turns WHERE session_id = ? AND seq >= ? ORDER BY seq LIMIT 1 OFFSET ?").get(
|
|
1115
|
-
id,
|
|
1116
|
-
fromSeq,
|
|
1117
|
-
SEARCH_CHUNK_ROWS
|
|
1118
|
-
);
|
|
1119
|
-
const rangeWhere = `session_id = ? AND seq >= ? ${boundary ? "AND seq < ?" : ""} AND ${turnsMatchWhere(lowerNeedles.length)}`;
|
|
1120
|
-
const rangeParams = boundary ? [id, fromSeq, boundary.seq] : [id, fromSeq];
|
|
1121
|
-
const matches = prepare(`SELECT seq FROM turns WHERE ${rangeWhere} ORDER BY seq`).all(
|
|
1122
|
-
...rangeParams,
|
|
1123
|
-
...lowerNeedles
|
|
1124
|
-
);
|
|
1125
|
-
const turns = matches.slice(0, Math.max(0, parseLimit)).flatMap((m) => {
|
|
1126
|
-
const turn = loadTurnAt(id, m.seq);
|
|
1127
|
-
return turn ? [turn] : [];
|
|
1128
|
-
});
|
|
1129
|
-
return { count: matches.length, turns, nextSeq: boundary ? boundary.seq : null };
|
|
1130
|
-
}
|
|
1131
|
-
function findFirstUserTurn(id) {
|
|
1132
|
-
const row = prepare("SELECT data FROM turns WHERE session_id = ? AND role = 'user' ORDER BY seq LIMIT 1").get(id);
|
|
1133
|
-
return row ? parseRow(row.data) : null;
|
|
1102
|
+
let searchSql = null;
|
|
1103
|
+
function sessionSearchSource() {
|
|
1104
|
+
searchSql ??= createSessionSearchSql(open().driver);
|
|
1105
|
+
return searchSql;
|
|
1134
1106
|
}
|
|
1135
1107
|
function usageAssistantDaily() {
|
|
1136
1108
|
return usageAssistantDaily$1(open().raw);
|
|
@@ -2018,33 +1990,6 @@ function cancelAllMcpLogins() {
|
|
|
2018
1990
|
flights.clear();
|
|
2019
1991
|
latestFlightByName.clear();
|
|
2020
1992
|
}
|
|
2021
|
-
const LOCAL_SESSION_HOST = LOCAL_HOST_KEY;
|
|
2022
|
-
function sessionKey(hostId2, sessionId) {
|
|
2023
|
-
return sessionKey$1(hostId2, sessionId);
|
|
2024
|
-
}
|
|
2025
|
-
function localSessionKey(sessionId) {
|
|
2026
|
-
return sessionKey(null, sessionId);
|
|
2027
|
-
}
|
|
2028
|
-
function parseSessionKey(key) {
|
|
2029
|
-
const { hostKey, sessionId } = parseSessionKey$1(key);
|
|
2030
|
-
return { hostId: hostKey, sessionId };
|
|
2031
|
-
}
|
|
2032
|
-
function sessionIdOf(key) {
|
|
2033
|
-
return parseSessionKey(key).sessionId;
|
|
2034
|
-
}
|
|
2035
|
-
function serverIdOf(key) {
|
|
2036
|
-
const { hostId: hostId2 } = parseSessionKey(key);
|
|
2037
|
-
return hostId2 === LOCAL_SESSION_HOST ? null : hostId2;
|
|
2038
|
-
}
|
|
2039
|
-
function siblingSessionKey(of, id) {
|
|
2040
|
-
return sessionKey(serverIdOf(of), id);
|
|
2041
|
-
}
|
|
2042
|
-
function asSessionKey(value) {
|
|
2043
|
-
if (typeof value !== "string" || value.length === 0) throw new Error("A session key must be a non-empty string.");
|
|
2044
|
-
const { sessionId } = parseSessionKey(value);
|
|
2045
|
-
if (sessionId.length === 0) throw new Error("A session key must name a session.");
|
|
2046
|
-
return value;
|
|
2047
|
-
}
|
|
2048
1993
|
const bySource = /* @__PURE__ */ new Map();
|
|
2049
1994
|
function setHudState(source, hostId2, sessions, badges = {}) {
|
|
2050
1995
|
const keyed = { sessions: {}, badges: {} };
|
|
@@ -6592,14 +6537,26 @@ function isRuntimeSessionRunning(key) {
|
|
|
6592
6537
|
async function isAgentRunningInCheckout(cwd, sessionId) {
|
|
6593
6538
|
const running2 = (key) => isRuntimeSessionRunning(key).catch(() => false);
|
|
6594
6539
|
if (typeof sessionId === "string" && await running2(sessionId)) return true;
|
|
6540
|
+
const found = checkoutSessions(cwd, sessionId);
|
|
6541
|
+
if (!found || found.list.length === 0) return false;
|
|
6542
|
+
const { list: sessions, inCheckout } = found;
|
|
6543
|
+
const local = await localRunningSessions();
|
|
6544
|
+
if (local && sessions.some((m) => serverIdOf(m.id) === null && local(sessionIdOf(m.id)) && inCheckout(m.cwd))) {
|
|
6545
|
+
return true;
|
|
6546
|
+
}
|
|
6547
|
+
const probed = sessions.filter((m) => !(local && serverIdOf(m.id) === null) && inCheckout(m.cwd));
|
|
6548
|
+
const answers = await Promise.all(probed.map((m) => running2(m.id)));
|
|
6549
|
+
return answers.some(Boolean);
|
|
6550
|
+
}
|
|
6551
|
+
function checkoutSessions(cwd, except, alsoFrom) {
|
|
6595
6552
|
let checkout;
|
|
6596
6553
|
let projects;
|
|
6597
6554
|
try {
|
|
6598
6555
|
const real = realpathSync.native(cwd);
|
|
6599
6556
|
checkout = findGitRoot(real) ?? real;
|
|
6600
|
-
projects = /* @__PURE__ */ new Set([projectRootOf(real), projectRootOf(cwd)]);
|
|
6557
|
+
projects = /* @__PURE__ */ new Set([projectRootOf(real), projectRootOf(cwd), ...alsoFrom ? [projectRootOf(alsoFrom)] : []]);
|
|
6601
6558
|
} catch {
|
|
6602
|
-
return
|
|
6559
|
+
return null;
|
|
6603
6560
|
}
|
|
6604
6561
|
const inCheckout = (folder) => {
|
|
6605
6562
|
try {
|
|
@@ -6610,15 +6567,13 @@ async function isAgentRunningInCheckout(cwd, sessionId) {
|
|
|
6610
6567
|
return false;
|
|
6611
6568
|
}
|
|
6612
6569
|
};
|
|
6613
|
-
const
|
|
6614
|
-
|
|
6615
|
-
|
|
6616
|
-
|
|
6617
|
-
|
|
6618
|
-
|
|
6619
|
-
|
|
6620
|
-
const answers = await Promise.all(probed.map((m) => running2(m.id)));
|
|
6621
|
-
return answers.some(Boolean);
|
|
6570
|
+
const list = [...projects].flatMap((projectRoot) => listSessionCwds(projectRoot)).map((m) => ({ id: m.id, cwd: m.cwd })).filter((m) => m.id !== except && m.cwd);
|
|
6571
|
+
return { list, inCheckout };
|
|
6572
|
+
}
|
|
6573
|
+
function localChatsInCheckout(worktree, from, except) {
|
|
6574
|
+
const sessions = checkoutSessions(worktree, except, from);
|
|
6575
|
+
if (!sessions) return [];
|
|
6576
|
+
return sessions.list.filter((m) => serverIdOf(m.id) === null && sessions.inCheckout(m.cwd)).map((m) => m.id);
|
|
6622
6577
|
}
|
|
6623
6578
|
async function localRunningSessions() {
|
|
6624
6579
|
const client2 = getDaemonClient();
|
|
@@ -8981,7 +8936,7 @@ function checkResult(result) {
|
|
|
8981
8936
|
latencyMs: result.latencyMs
|
|
8982
8937
|
} : { ok: false, error: result.error, message: result.message };
|
|
8983
8938
|
}
|
|
8984
|
-
function refusal(err, token) {
|
|
8939
|
+
function refusal$1(err, token) {
|
|
8985
8940
|
if (err instanceof HostRegistryError) return { ok: false, error: err.code, message: scrubToken(err.message, token) };
|
|
8986
8941
|
const message2 = scrubToken(err instanceof Error ? err.message : String(err), token);
|
|
8987
8942
|
return { ok: false, error: remoteHostsEnabled() ? "unknown" : "disabled", message: message2 };
|
|
@@ -9078,7 +9033,7 @@ function registerHostChannels({ ipc }) {
|
|
|
9078
9033
|
...server ? { host: summarize(server, entry) } : {}
|
|
9079
9034
|
};
|
|
9080
9035
|
} catch (err) {
|
|
9081
|
-
return refusal(err, token);
|
|
9036
|
+
return refusal$1(err, token);
|
|
9082
9037
|
}
|
|
9083
9038
|
}
|
|
9084
9039
|
);
|
|
@@ -9094,7 +9049,7 @@ function registerHostChannels({ ipc }) {
|
|
|
9094
9049
|
const checked = checkResult(await (await requireRemoteHosts()).test(probe2));
|
|
9095
9050
|
return checked.ok ? checked : { ...checked, message: scrubToken(checked.message, token) };
|
|
9096
9051
|
} catch (err) {
|
|
9097
|
-
return refusal(err, token);
|
|
9052
|
+
return refusal$1(err, token);
|
|
9098
9053
|
}
|
|
9099
9054
|
}
|
|
9100
9055
|
);
|
|
@@ -9106,7 +9061,7 @@ function registerHostChannels({ ipc }) {
|
|
|
9106
9061
|
);
|
|
9107
9062
|
return { ok: true, name: entry.name };
|
|
9108
9063
|
} catch (err) {
|
|
9109
|
-
return refusal(err);
|
|
9064
|
+
return refusal$1(err);
|
|
9110
9065
|
}
|
|
9111
9066
|
});
|
|
9112
9067
|
ipc.handle(
|
|
@@ -10204,129 +10159,49 @@ function registerSafeModeChannels({ ipc }) {
|
|
|
10204
10159
|
ipc.handle("safeMode:denyAll", (_e, sessionId) => denyAllPending(sessionId));
|
|
10205
10160
|
ipc.handle("safeMode:listPending", () => listPendingApprovals());
|
|
10206
10161
|
}
|
|
10207
|
-
const
|
|
10208
|
-
const
|
|
10209
|
-
const
|
|
10210
|
-
|
|
10211
|
-
|
|
10212
|
-
|
|
10213
|
-
|
|
10214
|
-
if (tokens.length === 0 || limit <= 0) {
|
|
10215
|
-
return [];
|
|
10216
|
-
}
|
|
10217
|
-
const lowerTokens = tokens.map((t) => t.toLowerCase());
|
|
10218
|
-
const archiveAxis = filter?.archive ?? "active";
|
|
10219
|
-
const candidates = listSearchCandidates(
|
|
10220
|
-
filter && "projectRoot" in filter ? { projectRoot: filter.projectRoot ?? null } : void 0
|
|
10221
|
-
);
|
|
10222
|
-
const hits = [];
|
|
10223
|
-
let scanned = 0;
|
|
10224
|
-
for (const candidate of candidates) {
|
|
10225
|
-
if (generation !== scanGeneration || hits.length >= limit || scanned >= MAX_SCANNED_SESSIONS) {
|
|
10226
|
-
break;
|
|
10227
|
-
}
|
|
10228
|
-
const archived = candidate.metadata.archived === true;
|
|
10229
|
-
if (archiveAxis === "active" && archived || archiveAxis === "archived" && !archived) {
|
|
10230
|
-
continue;
|
|
10231
|
-
}
|
|
10232
|
-
scanned += 1;
|
|
10233
|
-
let matchCount = 0;
|
|
10234
|
-
const matchedTurns = [];
|
|
10235
|
-
let cursor = 0;
|
|
10236
|
-
while (cursor !== null && generation === scanGeneration) {
|
|
10237
|
-
const chunk = matchTurnsChunk(
|
|
10238
|
-
candidate.id,
|
|
10239
|
-
lowerTokens,
|
|
10240
|
-
cursor,
|
|
10241
|
-
Math.max(0, MATCHING_TURNS_PER_SESSION - matchedTurns.length)
|
|
10242
|
-
);
|
|
10243
|
-
matchCount += chunk.count;
|
|
10244
|
-
matchedTurns.push(...chunk.turns);
|
|
10245
|
-
cursor = chunk.nextSeq;
|
|
10246
|
-
await setImmediate$1();
|
|
10247
|
-
}
|
|
10248
|
-
if (generation !== scanGeneration) {
|
|
10249
|
-
break;
|
|
10250
|
-
}
|
|
10251
|
-
if (matchCount > 0) {
|
|
10252
|
-
const excerpt = buildExcerpt(matchedTurns, query, lowerTokens);
|
|
10253
|
-
if (excerpt) {
|
|
10254
|
-
hits.push({
|
|
10255
|
-
sessionId: localSessionKey(candidate.id),
|
|
10256
|
-
title: titleFor(candidate),
|
|
10257
|
-
excerpt,
|
|
10258
|
-
matchCount,
|
|
10259
|
-
updatedAt: candidate.updatedAt
|
|
10260
|
-
});
|
|
10261
|
-
}
|
|
10262
|
-
}
|
|
10263
|
-
}
|
|
10264
|
-
return hits;
|
|
10265
|
-
}
|
|
10266
|
-
function buildExcerpt(turns, query, lowerTokens) {
|
|
10267
|
-
const match = searchSessionHistory(turns, query, 1);
|
|
10268
|
-
const canonical = match?.excerpts[0]?.text;
|
|
10269
|
-
if (canonical) {
|
|
10270
|
-
return collapseWhitespace(canonical);
|
|
10271
|
-
}
|
|
10272
|
-
for (const turn of turns) {
|
|
10273
|
-
const text2 = searchableTurnText(turn);
|
|
10274
|
-
const lowerText = text2.toLowerCase();
|
|
10275
|
-
for (const token of lowerTokens) {
|
|
10276
|
-
const at = lowerText.indexOf(token);
|
|
10277
|
-
if (at === -1) {
|
|
10278
|
-
continue;
|
|
10279
|
-
}
|
|
10280
|
-
const start = Math.max(0, at - FALLBACK_EXCERPT_RADIUS);
|
|
10281
|
-
const end = Math.min(text2.length, at + token.length + FALLBACK_EXCERPT_RADIUS);
|
|
10282
|
-
return collapseWhitespace(text2.slice(start, end));
|
|
10283
|
-
}
|
|
10284
|
-
}
|
|
10285
|
-
return null;
|
|
10286
|
-
}
|
|
10287
|
-
function collapseWhitespace(text2) {
|
|
10288
|
-
return text2.replace(/\s+/g, " ").trim();
|
|
10162
|
+
const SEARCH_WORKER_KILL_SWITCH = "ZIDANE_NO_SEARCH_WORKER";
|
|
10163
|
+
const SEARCH_TIMEOUT_MS = 12e4;
|
|
10164
|
+
const IN_FLIGHT = /* @__PURE__ */ Symbol("in flight");
|
|
10165
|
+
function spawnSearchWorker() {
|
|
10166
|
+
const file = join(__dirname, "session-search-worker.js");
|
|
10167
|
+
if (!existsSync(file)) throw new Error(`session search worker: no ${file}`);
|
|
10168
|
+
return new Worker(file);
|
|
10289
10169
|
}
|
|
10290
|
-
|
|
10291
|
-
|
|
10292
|
-
|
|
10293
|
-
|
|
10294
|
-
|
|
10295
|
-
const
|
|
10296
|
-
return
|
|
10297
|
-
|
|
10298
|
-
|
|
10299
|
-
|
|
10300
|
-
|
|
10301
|
-
|
|
10302
|
-
|
|
10303
|
-
|
|
10304
|
-
|
|
10305
|
-
|
|
10306
|
-
|
|
10307
|
-
|
|
10308
|
-
|
|
10309
|
-
|
|
10310
|
-
|
|
10311
|
-
|
|
10312
|
-
|
|
10313
|
-
|
|
10314
|
-
|
|
10315
|
-
|
|
10316
|
-
i += 1;
|
|
10317
|
-
}
|
|
10318
|
-
if (value.length > 0) {
|
|
10319
|
-
tokens.push(value);
|
|
10170
|
+
const debugFallback = process.env.ZIDANE_DEBUG ? (error) => console.error("[gui] content search fell back to the main thread:", error) : () => {
|
|
10171
|
+
};
|
|
10172
|
+
function createLocalSessionSearch(deps) {
|
|
10173
|
+
let client2 = null;
|
|
10174
|
+
let closed = false;
|
|
10175
|
+
const local = ({ query, filter, options }) => searchSessions(deps.source(), query, filter, options);
|
|
10176
|
+
return {
|
|
10177
|
+
async search(request2) {
|
|
10178
|
+
if (closed || process.env[SEARCH_WORKER_KILL_SWITCH] === "1") return local(request2);
|
|
10179
|
+
await deps.pendingWrites();
|
|
10180
|
+
if (closed) return local(request2);
|
|
10181
|
+
client2 ??= createWorkerRpcClient({
|
|
10182
|
+
name: "session search worker",
|
|
10183
|
+
create: deps.create ?? spawnSearchWorker,
|
|
10184
|
+
init: { dbPath: deps.dbPath() }
|
|
10185
|
+
});
|
|
10186
|
+
let dispatched = false;
|
|
10187
|
+
try {
|
|
10188
|
+
const reply = client2.request(request2, { timeoutMs: SEARCH_TIMEOUT_MS });
|
|
10189
|
+
dispatched = await Promise.race([reply, IN_FLIGHT]) === IN_FLIGHT;
|
|
10190
|
+
return await reply;
|
|
10191
|
+
} catch (err) {
|
|
10192
|
+
if (err instanceof WorkerRequestError) throw new Error(err.message);
|
|
10193
|
+
if (!(err instanceof WorkerUnavailableError)) throw err;
|
|
10194
|
+
debugFallback(err);
|
|
10195
|
+
if (dispatched && (closed || !err.degraded)) return [];
|
|
10320
10196
|
}
|
|
10321
|
-
|
|
10322
|
-
}
|
|
10323
|
-
|
|
10324
|
-
|
|
10325
|
-
|
|
10197
|
+
return local(request2);
|
|
10198
|
+
},
|
|
10199
|
+
close() {
|
|
10200
|
+
closed = true;
|
|
10201
|
+
client2?.close();
|
|
10202
|
+
client2 = null;
|
|
10326
10203
|
}
|
|
10327
|
-
|
|
10328
|
-
}
|
|
10329
|
-
return tokens;
|
|
10204
|
+
};
|
|
10330
10205
|
}
|
|
10331
10206
|
function tooOldServerError(err, host2, action) {
|
|
10332
10207
|
if (!host2.remote || !isUnsupportedMethod(err)) return err;
|
|
@@ -10440,13 +10315,16 @@ function registerSessionListChannels(ipc) {
|
|
|
10440
10315
|
}
|
|
10441
10316
|
);
|
|
10442
10317
|
let sessionSearchToken = 0;
|
|
10318
|
+
const localSearch = createLocalSessionSearch({ source: sessionSearchSource, dbPath: sessionsDbPath, pendingWrites });
|
|
10319
|
+
app.on("will-quit", () => localSearch.close());
|
|
10443
10320
|
ipc.handle(
|
|
10444
10321
|
"sessions:search",
|
|
10445
|
-
async (_e, query, filter) => {
|
|
10322
|
+
async (_e, query, filter, channel) => {
|
|
10446
10323
|
const token = ++sessionSearchToken;
|
|
10447
10324
|
const text2 = typeof query === "string" ? query : "";
|
|
10325
|
+
const options = { channel: channel === "palette" ? channel : "sidebar" };
|
|
10448
10326
|
const [local, servers] = await Promise.all([
|
|
10449
|
-
|
|
10327
|
+
localSearch.search({ query: text2, ...filter ? { filter } : {}, options }),
|
|
10450
10328
|
text2.trim() ? searchServerSessions(text2, filter) : Promise.resolve([])
|
|
10451
10329
|
]);
|
|
10452
10330
|
return { token, results: [...local, ...servers] };
|
|
@@ -12142,6 +12020,13 @@ function summarizeGitError(raw) {
|
|
|
12142
12020
|
const shown2 = files.slice(0, 3).join(", ");
|
|
12143
12021
|
return `${first} ${shown2}${files.length > 3 ? ` and ${files.length - 3} more` : ""}`;
|
|
12144
12022
|
}
|
|
12023
|
+
function blockingWorktree(raw) {
|
|
12024
|
+
return /already (?:used by worktree|checked out) at '([^'\n]+)'/.exec(raw)?.[1];
|
|
12025
|
+
}
|
|
12026
|
+
function refusal(raw) {
|
|
12027
|
+
const worktree = blockingWorktree(raw);
|
|
12028
|
+
return { ok: false, error: summarizeGitError(raw), ...worktree ? { worktree } : {} };
|
|
12029
|
+
}
|
|
12145
12030
|
async function gitSwitch(cwd, target, running2 = false) {
|
|
12146
12031
|
if (!await isDir$1(cwd)) return { ok: false, error: "Not a folder." };
|
|
12147
12032
|
if (running2) return { ok: false, error: "The agent is working in this folder. Switch once it is done." };
|
|
@@ -12154,12 +12039,25 @@ async function gitSwitch(cwd, target, running2 = false) {
|
|
|
12154
12039
|
for (const key of prCache.keys()) if (key.startsWith(`${cwd}\0`)) prCache.delete(key);
|
|
12155
12040
|
return { ok: true };
|
|
12156
12041
|
}
|
|
12157
|
-
return
|
|
12042
|
+
return refusal(r.err);
|
|
12043
|
+
}
|
|
12044
|
+
async function gitCreateBranch(cwd, name, running2 = false) {
|
|
12045
|
+
if (!await isDir$1(cwd)) return { ok: false, error: "Not a folder." };
|
|
12046
|
+
if (running2) return { ok: false, error: "The agent is working in this folder. Switch once it is done." };
|
|
12047
|
+
const valid = typeof name === "string" && name !== "" && !name.startsWith("-") && await git$1(cwd, ["check-ref-format", "--branch", name]) !== null;
|
|
12048
|
+
if (!valid) return { ok: false, error: `${name} is not a valid branch name.` };
|
|
12049
|
+
if (await git$1(cwd, ["show-ref", "--verify", "--quiet", `refs/heads/${name}`]) !== null) {
|
|
12050
|
+
return { ok: false, error: `A branch named ${name} already exists.` };
|
|
12051
|
+
}
|
|
12052
|
+
const r = await run("git", cwd, ["switch", "-c", name]);
|
|
12053
|
+
if (!r.ok) return refusal(r.err);
|
|
12054
|
+
for (const key of prCache.keys()) if (key.startsWith(`${cwd}\0`)) prCache.delete(key);
|
|
12055
|
+
return { ok: true };
|
|
12158
12056
|
}
|
|
12159
12057
|
async function checkoutPr(cwd, pr) {
|
|
12160
12058
|
if (!Number.isInteger(pr) || pr <= 0) return { ok: false, error: "Not a pull request." };
|
|
12161
12059
|
const r = await run("gh", cwd, ["pr", "checkout", String(pr)], 6e4);
|
|
12162
|
-
if (!r.ok) return
|
|
12060
|
+
if (!r.ok) return refusal(r.err);
|
|
12163
12061
|
for (const key of prCache.keys()) if (key.startsWith(`${cwd}\0`)) prCache.delete(key);
|
|
12164
12062
|
for (const key of prListCache.keys()) if (key.startsWith(`${cwd}\0`)) prListCache.delete(key);
|
|
12165
12063
|
return { ok: true };
|
|
@@ -12827,7 +12725,15 @@ function registerWorkspaceChannels({ ipc }) {
|
|
|
12827
12725
|
const pr = typeof target === "object" && target !== null ? target.pr : void 0;
|
|
12828
12726
|
if (typeof target !== "string" && typeof pr !== "number") return { ok: false, error: "Nothing to switch to." };
|
|
12829
12727
|
const running2 = await isAgentRunningInCheckout(cwd, sessionId).catch(() => false);
|
|
12830
|
-
|
|
12728
|
+
const result = await gitSwitch(cwd, typeof target === "string" ? target : { pr }, running2);
|
|
12729
|
+
if (result.ok || !result.worktree) return result;
|
|
12730
|
+
return { ...result, chats: localChatsInCheckout(result.worktree, cwd, sessionId) };
|
|
12731
|
+
});
|
|
12732
|
+
ipc.handle("workspace:gitCreateBranch", async (_e, cwd, name, sessionId) => {
|
|
12733
|
+
if (typeof cwd !== "string" || typeof name !== "string") return { ok: false, error: "Nothing to create." };
|
|
12734
|
+
if (inSandbox(cwd)) return { ok: false, error: "Create branches inside the sandbox." };
|
|
12735
|
+
const running2 = await isAgentRunningInCheckout(cwd, sessionId).catch(() => false);
|
|
12736
|
+
return gitCreateBranch(cwd, name, running2);
|
|
12831
12737
|
});
|
|
12832
12738
|
ipc.handle("workspace:gitSync", async (_e, cwd, sessionId) => {
|
|
12833
12739
|
if (typeof cwd !== "string") return { ok: false, error: "Not a folder." };
|
|
@@ -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
|
+
});
|
package/out/preload/index.mjs
CHANGED
|
@@ -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),
|
|
@@ -297,6 +297,7 @@ const api = {
|
|
|
297
297
|
gitBranches: (cwd) => ipcRenderer.invoke("workspace:gitBranches", cwd),
|
|
298
298
|
gitPrList: (cwd, query, fresh) => ipcRenderer.invoke("workspace:gitPrList", cwd, query, fresh),
|
|
299
299
|
gitSwitch: (cwd, target, sessionId) => ipcRenderer.invoke("workspace:gitSwitch", cwd, target, sessionId ?? null),
|
|
300
|
+
gitCreateBranch: (cwd, name, sessionId) => ipcRenderer.invoke("workspace:gitCreateBranch", cwd, name, sessionId ?? null),
|
|
300
301
|
gitSync: (cwd, sessionId) => ipcRenderer.invoke("workspace:gitSync", cwd, sessionId ?? null)
|
|
301
302
|
},
|
|
302
303
|
browser: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as __vitePreload } from "./index-
|
|
1
|
+
import { _ as __vitePreload } from "./index-CebkAnp4.js";
|
|
2
2
|
var p = /* @__PURE__ */ ((B) => (B[B.CURSOR_KEY_APPLICATION = 0] = "CURSOR_KEY_APPLICATION", B[B.KEYPAD_KEY_APPLICATION = 1] = "KEYPAD_KEY_APPLICATION", B[B.IGNORE_KEYPAD_WITH_NUMLOCK = 2] = "IGNORE_KEYPAD_WITH_NUMLOCK", B[B.ALT_ESC_PREFIX = 3] = "ALT_ESC_PREFIX", B[B.MODIFY_OTHER_KEYS_STATE_2 = 4] = "MODIFY_OTHER_KEYS_STATE_2", B[B.KITTY_KEYBOARD_FLAGS = 5] = "KITTY_KEYBOARD_FLAGS", B))(p || {}), u = /* @__PURE__ */ ((B) => (B[B.RELEASE = 0] = "RELEASE", B[B.PRESS = 1] = "PRESS", B[B.REPEAT = 2] = "REPEAT", B))(u || {}), i = /* @__PURE__ */ ((B) => (B[B.UNIDENTIFIED = 0] = "UNIDENTIFIED", B[B.GRAVE = 1] = "GRAVE", B[B.BACKSLASH = 2] = "BACKSLASH", B[B.BRACKET_LEFT = 3] = "BRACKET_LEFT", B[B.BRACKET_RIGHT = 4] = "BRACKET_RIGHT", B[B.COMMA = 5] = "COMMA", B[B.ZERO = 6] = "ZERO", B[B.ONE = 7] = "ONE", B[B.TWO = 8] = "TWO", B[B.THREE = 9] = "THREE", B[B.FOUR = 10] = "FOUR", B[B.FIVE = 11] = "FIVE", B[B.SIX = 12] = "SIX", B[B.SEVEN = 13] = "SEVEN", B[B.EIGHT = 14] = "EIGHT", B[B.NINE = 15] = "NINE", B[B.EQUAL = 16] = "EQUAL", B[B.INTL_BACKSLASH = 17] = "INTL_BACKSLASH", B[B.INTL_RO = 18] = "INTL_RO", B[B.INTL_YEN = 19] = "INTL_YEN", B[B.A = 20] = "A", B[B.B = 21] = "B", B[B.C = 22] = "C", B[B.D = 23] = "D", B[B.E = 24] = "E", B[B.F = 25] = "F", B[B.G = 26] = "G", B[B.H = 27] = "H", B[B.I = 28] = "I", B[B.J = 29] = "J", B[B.K = 30] = "K", B[B.L = 31] = "L", B[B.M = 32] = "M", B[B.N = 33] = "N", B[B.O = 34] = "O", B[B.P = 35] = "P", B[B.Q = 36] = "Q", B[B.R = 37] = "R", B[B.S = 38] = "S", B[B.T = 39] = "T", B[B.U = 40] = "U", B[B.V = 41] = "V", B[B.W = 42] = "W", B[B.X = 43] = "X", B[B.Y = 44] = "Y", B[B.Z = 45] = "Z", B[B.MINUS = 46] = "MINUS", B[B.PERIOD = 47] = "PERIOD", B[B.QUOTE = 48] = "QUOTE", B[B.SEMICOLON = 49] = "SEMICOLON", B[B.SLASH = 50] = "SLASH", B[B.ALT_LEFT = 51] = "ALT_LEFT", B[B.ALT_RIGHT = 52] = "ALT_RIGHT", B[B.BACKSPACE = 53] = "BACKSPACE", B[B.CAPS_LOCK = 54] = "CAPS_LOCK", B[B.CONTEXT_MENU = 55] = "CONTEXT_MENU", B[B.CONTROL_LEFT = 56] = "CONTROL_LEFT", B[B.CONTROL_RIGHT = 57] = "CONTROL_RIGHT", B[B.ENTER = 58] = "ENTER", B[B.META_LEFT = 59] = "META_LEFT", B[B.META_RIGHT = 60] = "META_RIGHT", B[B.SHIFT_LEFT = 61] = "SHIFT_LEFT", B[B.SHIFT_RIGHT = 62] = "SHIFT_RIGHT", B[B.SPACE = 63] = "SPACE", B[B.TAB = 64] = "TAB", B[B.CONVERT = 65] = "CONVERT", B[B.KANA_MODE = 66] = "KANA_MODE", B[B.NON_CONVERT = 67] = "NON_CONVERT", B[B.DELETE = 68] = "DELETE", B[B.END = 69] = "END", B[B.HELP = 70] = "HELP", B[B.HOME = 71] = "HOME", B[B.INSERT = 72] = "INSERT", B[B.PAGE_DOWN = 73] = "PAGE_DOWN", B[B.PAGE_UP = 74] = "PAGE_UP", B[B.DOWN = 75] = "DOWN", B[B.LEFT = 76] = "LEFT", B[B.RIGHT = 77] = "RIGHT", B[B.UP = 78] = "UP", B[B.NUM_LOCK = 79] = "NUM_LOCK", B[B.KP_0 = 80] = "KP_0", B[B.KP_1 = 81] = "KP_1", B[B.KP_2 = 82] = "KP_2", B[B.KP_3 = 83] = "KP_3", B[B.KP_4 = 84] = "KP_4", B[B.KP_5 = 85] = "KP_5", B[B.KP_6 = 86] = "KP_6", B[B.KP_7 = 87] = "KP_7", B[B.KP_8 = 88] = "KP_8", B[B.KP_9 = 89] = "KP_9", B[B.KP_PLUS = 90] = "KP_PLUS", B[B.KP_BACKSPACE = 91] = "KP_BACKSPACE", B[B.KP_CLEAR = 92] = "KP_CLEAR", B[B.KP_CLEAR_ENTRY = 93] = "KP_CLEAR_ENTRY", B[B.KP_COMMA = 94] = "KP_COMMA", B[B.KP_PERIOD = 95] = "KP_PERIOD", B[B.KP_DIVIDE = 96] = "KP_DIVIDE", B[B.KP_ENTER = 97] = "KP_ENTER", B[B.KP_EQUAL = 98] = "KP_EQUAL", B[B.KP_MEMORY_ADD = 99] = "KP_MEMORY_ADD", B[B.KP_MEMORY_CLEAR = 100] = "KP_MEMORY_CLEAR", B[B.KP_MEMORY_RECALL = 101] = "KP_MEMORY_RECALL", B[B.KP_MEMORY_STORE = 102] = "KP_MEMORY_STORE", B[B.KP_MEMORY_SUBTRACT = 103] = "KP_MEMORY_SUBTRACT", B[B.KP_MULTIPLY = 104] = "KP_MULTIPLY", B[B.KP_PAREN_LEFT = 105] = "KP_PAREN_LEFT", B[B.KP_PAREN_RIGHT = 106] = "KP_PAREN_RIGHT", B[B.KP_MINUS = 107] = "KP_MINUS", B[B.KP_SEPARATOR = 108] = "KP_SEPARATOR", B[B.NUMPAD_UP = 109] = "NUMPAD_UP", B[B.NUMPAD_DOWN = 110] = "NUMPAD_DOWN", B[B.NUMPAD_RIGHT = 111] = "NUMPAD_RIGHT", B[B.NUMPAD_LEFT = 112] = "NUMPAD_LEFT", B[B.NUMPAD_BEGIN = 113] = "NUMPAD_BEGIN", B[B.NUMPAD_HOME = 114] = "NUMPAD_HOME", B[B.NUMPAD_END = 115] = "NUMPAD_END", B[B.NUMPAD_INSERT = 116] = "NUMPAD_INSERT", B[B.NUMPAD_DELETE = 117] = "NUMPAD_DELETE", B[B.NUMPAD_PAGE_UP = 118] = "NUMPAD_PAGE_UP", B[B.NUMPAD_PAGE_DOWN = 119] = "NUMPAD_PAGE_DOWN", B[B.ESCAPE = 120] = "ESCAPE", B[B.F1 = 121] = "F1", B[B.F2 = 122] = "F2", B[B.F3 = 123] = "F3", B[B.F4 = 124] = "F4", B[B.F5 = 125] = "F5", B[B.F6 = 126] = "F6", B[B.F7 = 127] = "F7", B[B.F8 = 128] = "F8", B[B.F9 = 129] = "F9", B[B.F10 = 130] = "F10", B[B.F11 = 131] = "F11", B[B.F12 = 132] = "F12", B[B.F13 = 133] = "F13", B[B.F14 = 134] = "F14", B[B.F15 = 135] = "F15", B[B.F16 = 136] = "F16", B[B.F17 = 137] = "F17", B[B.F18 = 138] = "F18", B[B.F19 = 139] = "F19", B[B.F20 = 140] = "F20", B[B.F21 = 141] = "F21", B[B.F22 = 142] = "F22", B[B.F23 = 143] = "F23", B[B.F24 = 144] = "F24", B[B.F25 = 145] = "F25", B[B.FN_LOCK = 146] = "FN_LOCK", B[B.PRINT_SCREEN = 147] = "PRINT_SCREEN", B[B.SCROLL_LOCK = 148] = "SCROLL_LOCK", B[B.PAUSE = 149] = "PAUSE", B[B.BROWSER_BACK = 150] = "BROWSER_BACK", B[B.BROWSER_FAVORITES = 151] = "BROWSER_FAVORITES", B[B.BROWSER_FORWARD = 152] = "BROWSER_FORWARD", B[B.BROWSER_HOME = 153] = "BROWSER_HOME", B[B.BROWSER_REFRESH = 154] = "BROWSER_REFRESH", B[B.BROWSER_SEARCH = 155] = "BROWSER_SEARCH", B[B.BROWSER_STOP = 156] = "BROWSER_STOP", B[B.EJECT = 157] = "EJECT", B[B.LAUNCH_APP_1 = 158] = "LAUNCH_APP_1", B[B.LAUNCH_APP_2 = 159] = "LAUNCH_APP_2", B[B.LAUNCH_MAIL = 160] = "LAUNCH_MAIL", B[B.MEDIA_PLAY_PAUSE = 161] = "MEDIA_PLAY_PAUSE", B[B.MEDIA_SELECT = 162] = "MEDIA_SELECT", B[B.MEDIA_STOP = 163] = "MEDIA_STOP", B[B.MEDIA_TRACK_NEXT = 164] = "MEDIA_TRACK_NEXT", B[B.MEDIA_TRACK_PREVIOUS = 165] = "MEDIA_TRACK_PREVIOUS", B[B.POWER = 166] = "POWER", B[B.SLEEP = 167] = "SLEEP", B[B.AUDIO_VOLUME_DOWN = 168] = "AUDIO_VOLUME_DOWN", B[B.AUDIO_VOLUME_MUTE = 169] = "AUDIO_VOLUME_MUTE", B[B.AUDIO_VOLUME_UP = 170] = "AUDIO_VOLUME_UP", B[B.WAKE_UP = 171] = "WAKE_UP", B[B.COPY = 172] = "COPY", B[B.CUT = 173] = "CUT", B[B.PASTE = 174] = "PASTE", B))(i || {}), r = /* @__PURE__ */ ((B) => (B[B.NONE = 0] = "NONE", B[B.SHIFT = 1] = "SHIFT", B[B.CTRL = 2] = "CTRL", B[B.ALT = 4] = "ALT", B[B.SUPER = 8] = "SUPER", B[B.CAPSLOCK = 16] = "CAPSLOCK", B[B.NUMLOCK = 32] = "NUMLOCK", B))(r || {}), S = /* @__PURE__ */ ((B) => (B[B.NONE = 0] = "NONE", B[B.PARTIAL = 1] = "PARTIAL", B[B.FULL = 2] = "FULL", B))(S || {});
|
|
3
3
|
const f = 80;
|
|
4
4
|
var G = /* @__PURE__ */ ((B) => (B[B.BOLD = 1] = "BOLD", B[B.ITALIC = 2] = "ITALIC", B[B.UNDERLINE = 4] = "UNDERLINE", B[B.STRIKETHROUGH = 8] = "STRIKETHROUGH", B[B.INVERSE = 16] = "INVERSE", B[B.INVISIBLE = 32] = "INVISIBLE", B[B.BLINK = 64] = "BLINK", B[B.FAINT = 128] = "FAINT", B))(G || {});
|