@wrongstack/desktop 0.318.0 → 0.319.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.
package/dist/main/main.js
CHANGED
|
@@ -488,7 +488,9 @@ async function authorizeDesktopAction(boundary, action, logger) {
|
|
|
488
488
|
if (logger) {
|
|
489
489
|
logger.info("Trust boundary decision", auditEntry);
|
|
490
490
|
} else {
|
|
491
|
-
console.warn(
|
|
491
|
+
console.warn(
|
|
492
|
+
JSON.stringify({ level: "info", ...auditEntry, timestamp: (/* @__PURE__ */ new Date()).toISOString() })
|
|
493
|
+
);
|
|
492
494
|
}
|
|
493
495
|
return { allowed: isTrustDecisionAllowed(decision), reason: decision.reason };
|
|
494
496
|
}
|
|
@@ -864,7 +866,11 @@ function tMain(key) {
|
|
|
864
866
|
// src/main/desktop-config-io.ts
|
|
865
867
|
import * as fs from "node:fs/promises";
|
|
866
868
|
import * as path from "node:path";
|
|
867
|
-
import {
|
|
869
|
+
import {
|
|
870
|
+
decryptConfigSecrets,
|
|
871
|
+
DefaultSecretVault,
|
|
872
|
+
encryptConfigSecrets
|
|
873
|
+
} from "@wrongstack/core/security";
|
|
868
874
|
import { atomicWrite, wstackGlobalRoot } from "@wrongstack/core/utils";
|
|
869
875
|
var globalRoot = wstackGlobalRoot();
|
|
870
876
|
var bootstrapConfigPath = path.join(globalRoot, "config.json");
|
|
@@ -1980,9 +1986,7 @@ var DesktopWebuiController = class {
|
|
|
1980
1986
|
subject: { kind: "url", id: target, attributes: { protocol } },
|
|
1981
1987
|
risk: "elevated",
|
|
1982
1988
|
metadata: { operation: "webui-navigation" }
|
|
1983
|
-
}).then(
|
|
1984
|
-
(decision) => decision.allowed ? void shell.openExternal(target) : void 0
|
|
1985
|
-
).catch(() => void 0);
|
|
1989
|
+
}).then((decision) => decision.allowed ? void shell.openExternal(target) : void 0).catch(() => void 0);
|
|
1986
1990
|
}
|
|
1987
1991
|
publishStatus(next) {
|
|
1988
1992
|
this.status = next;
|
|
@@ -2184,11 +2188,20 @@ var DesktopWebuiController = class {
|
|
|
2184
2188
|
return new Promise((resolve4) => {
|
|
2185
2189
|
const fallbackTimer = setTimeout(() => {
|
|
2186
2190
|
if (!this.pendingAcks.has(requestId)) return;
|
|
2187
|
-
if (this.views.get(entry.runtimeId) !== entry || entry.view.webContents.isDestroyed())
|
|
2191
|
+
if (this.views.get(entry.runtimeId) !== entry || entry.view.webContents.isDestroyed())
|
|
2192
|
+
return;
|
|
2188
2193
|
void entry.view.webContents.executeJavaScript(buildWebuiCommandFallbackScript(outbound), true).catch(() => void 0);
|
|
2189
2194
|
}, WEBUI_COMMAND_FALLBACK_MS);
|
|
2190
|
-
const timer = setTimeout(
|
|
2191
|
-
|
|
2195
|
+
const timer = setTimeout(
|
|
2196
|
+
() => this.settleAck(requestId, false),
|
|
2197
|
+
WEBUI_COMMAND_ACK_TIMEOUT_MS
|
|
2198
|
+
);
|
|
2199
|
+
this.pendingAcks.set(requestId, {
|
|
2200
|
+
runtimeId: entry.runtimeId,
|
|
2201
|
+
timer,
|
|
2202
|
+
fallbackTimer,
|
|
2203
|
+
resolve: resolve4
|
|
2204
|
+
});
|
|
2192
2205
|
try {
|
|
2193
2206
|
entry.view.webContents.send(IPC.webuiCommand, outbound);
|
|
2194
2207
|
if (this.activeRuntimeId === entry.runtimeId) entry.view.webContents.focus();
|
|
@@ -2235,7 +2248,11 @@ var DesktopWebuiController = class {
|
|
|
2235
2248
|
}
|
|
2236
2249
|
if (!shouldExecuteFallback) {
|
|
2237
2250
|
entry.pendingCommands.length = 0;
|
|
2238
|
-
this.setEntryStatus(entry, {
|
|
2251
|
+
this.setEntryStatus(entry, {
|
|
2252
|
+
runtimeId: entry.runtimeId,
|
|
2253
|
+
status: "error",
|
|
2254
|
+
error: "WebUI command bridge did not become ready."
|
|
2255
|
+
});
|
|
2239
2256
|
return;
|
|
2240
2257
|
}
|
|
2241
2258
|
}
|
|
@@ -2291,7 +2308,13 @@ var DesktopWindowStateController = class {
|
|
|
2291
2308
|
return { width: state.width, height: state.height, maximized: state.maximized };
|
|
2292
2309
|
}
|
|
2293
2310
|
const candidate = { x: state.x, y: state.y, width: state.width, height: state.height };
|
|
2294
|
-
return this.ctx.getDisplays().some(({ workArea }) => intersects(candidate, workArea)) ? {
|
|
2311
|
+
return this.ctx.getDisplays().some(({ workArea }) => intersects(candidate, workArea)) ? {
|
|
2312
|
+
x: state.x,
|
|
2313
|
+
y: state.y,
|
|
2314
|
+
width: state.width,
|
|
2315
|
+
height: state.height,
|
|
2316
|
+
maximized: state.maximized
|
|
2317
|
+
} : null;
|
|
2295
2318
|
}
|
|
2296
2319
|
};
|
|
2297
2320
|
function intersects(left, right) {
|
|
@@ -2420,9 +2443,7 @@ function buildProjectsMenu(runtimes, actions, t) {
|
|
|
2420
2443
|
enabled: Boolean(group.sessions[0])
|
|
2421
2444
|
},
|
|
2422
2445
|
{ type: "separator" },
|
|
2423
|
-
...group.sessions.map(
|
|
2424
|
-
(runtime, index) => buildSessionMenu(runtime, index + 1, actions, t)
|
|
2425
|
-
)
|
|
2446
|
+
...group.sessions.map((runtime, index) => buildSessionMenu(runtime, index + 1, actions, t))
|
|
2426
2447
|
]
|
|
2427
2448
|
});
|
|
2428
2449
|
}
|
|
@@ -2708,7 +2729,15 @@ function configureApplicationMenu(ctx) {
|
|
|
2708
2729
|
}
|
|
2709
2730
|
};
|
|
2710
2731
|
const template = [
|
|
2711
|
-
buildFileMenu(
|
|
2732
|
+
buildFileMenu(
|
|
2733
|
+
ctx,
|
|
2734
|
+
actions,
|
|
2735
|
+
hasActiveRuntime,
|
|
2736
|
+
hasActiveProjectWebui,
|
|
2737
|
+
active,
|
|
2738
|
+
navigate,
|
|
2739
|
+
ctx.getActiveRuntimeId
|
|
2740
|
+
),
|
|
2712
2741
|
{
|
|
2713
2742
|
label: ctx.t("projects"),
|
|
2714
2743
|
submenu: buildProjectsMenu(snapshot.runtimes, actions, ctx.t)
|
|
@@ -3330,21 +3359,17 @@ async function boot() {
|
|
|
3330
3359
|
});
|
|
3331
3360
|
let lastWatchedLocale;
|
|
3332
3361
|
const activeProfileConfigPath = await resolveActiveProfileConfigPath();
|
|
3333
|
-
watchProviderConfig(
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
webuiController.broadcastLocale(updated);
|
|
3343
|
-
if (shellView && !shellView.webContents.isDestroyed()) {
|
|
3344
|
-
shellView.webContents.send(IPC.localeChanged, updated);
|
|
3345
|
-
}
|
|
3362
|
+
watchProviderConfig(activeProfileConfigPath, desktopConfigPaths.vault, (snapshot) => {
|
|
3363
|
+
const updated = snapshot.uiLocale;
|
|
3364
|
+
if (!updated || updated === lastWatchedLocale) return;
|
|
3365
|
+
lastWatchedLocale = updated;
|
|
3366
|
+
setMainLocale(updated);
|
|
3367
|
+
configureApplicationMenu2();
|
|
3368
|
+
webuiController.broadcastLocale(updated);
|
|
3369
|
+
if (shellView && !shellView.webContents.isDestroyed()) {
|
|
3370
|
+
shellView.webContents.send(IPC.localeChanged, updated);
|
|
3346
3371
|
}
|
|
3347
|
-
);
|
|
3372
|
+
});
|
|
3348
3373
|
mainWindow.on("close", (event) => {
|
|
3349
3374
|
if (quittingAfterCleanup) return;
|
|
3350
3375
|
event.preventDefault();
|