* feat(electron): add Linux AppImage releases * ci: cache Linux OpenCode CLI artifacts * fix(ci): await Linux release inventory check * fix(electron): add frameless window controls on Linux desktop Linux AppImages were created without native WM decorations and without in-app controls, leaving users unable to close the window with a mouse. Treat Linux like Windows: frameless BrowserWindow plus the existing WindowsWindowControls header buttons and app-menu entry. macOS keeps hidden title bar with traffic lights unchanged. Shared usesFramelessElectronChrome() helper drives main window, mini chat, header insets, and titlebar controls. Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com> * feat(desktop): add configurable window controls position by OS Add desktopWindowControlsPosition setting (auto/left/right) with OS-aware defaults: Linux left, Windows right. Wire frameless chrome controls in Header, TitlebarLeftControls, and MiniChatLayout, plus a Sessions settings control for Windows and Linux desktop shells. Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com> * fix(desktop): address Linux AppImage release review findings Propagate updater capability errors to the UI, treat missing latest-linux.yml feeds as no-update, stop installed-apps IPC spam on Linux, document FUSE/AppImage limits, add CHANGELOG entry, migrate remaining btriapitsyn URLs, and run Electron Linux unit tests on PRs. Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com> --------- Co-authored-by: jibanez-staticduo <staticduo@gmail.com> Co-authored-by: Serhii Dziupin <makeittech@users.noreply.github.com>
78 lines
2.6 KiB
JavaScript
78 lines
2.6 KiB
JavaScript
const ARCHITECTURES = {
|
|
x64: {
|
|
node: 'x64',
|
|
electronBuilder: 'x64',
|
|
opencode: 'x64',
|
|
},
|
|
arm64: {
|
|
node: 'arm64',
|
|
electronBuilder: 'arm64',
|
|
opencode: 'arm64',
|
|
},
|
|
};
|
|
|
|
const ARCHITECTURE_ALIASES = new Map([
|
|
['x64', 'x64'],
|
|
['amd64', 'x64'],
|
|
['x86_64', 'x64'],
|
|
['arm64', 'arm64'],
|
|
['aarch64', 'arm64'],
|
|
]);
|
|
|
|
export const normalizeTargetArchitecture = (value, source = 'target architecture') => {
|
|
const normalized = ARCHITECTURE_ALIASES.get(String(value || '').trim().toLowerCase());
|
|
if (!normalized) {
|
|
throw new Error(
|
|
`Unsupported ${source} ${JSON.stringify(value)}. Supported architectures: x64, arm64.`,
|
|
);
|
|
}
|
|
return ARCHITECTURES[normalized];
|
|
};
|
|
|
|
export const readElectronBuilderArchitecture = (args = []) => {
|
|
const requested = [];
|
|
for (let index = 0; index < args.length; index += 1) {
|
|
const argument = args[index];
|
|
if (argument === '--x64' || argument === '--arm64') requested.push(argument.slice(2));
|
|
if (argument === '--arch' && args[index + 1]) requested.push(args[index + 1]);
|
|
if (argument.startsWith('--arch=')) requested.push(argument.slice('--arch='.length));
|
|
}
|
|
if (requested.length === 0) return null;
|
|
|
|
const architectures = new Set(requested.map((value) => normalizeTargetArchitecture(value, 'electron-builder architecture').node));
|
|
if (architectures.size !== 1) {
|
|
throw new Error(`Exactly one Electron target architecture is required, got: ${requested.join(', ')}.`);
|
|
}
|
|
return [...architectures][0];
|
|
};
|
|
|
|
export const resolveTargetArchitecture = ({
|
|
platform = process.platform,
|
|
hostArchitecture = process.arch,
|
|
environment = process.env,
|
|
builderArgs = [],
|
|
} = {}) => {
|
|
const host = normalizeTargetArchitecture(hostArchitecture, 'host architecture');
|
|
const builderArchitecture = readElectronBuilderArchitecture(builderArgs);
|
|
const requestedValues = [
|
|
environment.OPENCHAMBER_TARGET_ARCH,
|
|
environment.ELECTRON_BUILDER_ARCH,
|
|
builderArchitecture,
|
|
].filter(Boolean);
|
|
const requestedArchitectures = new Set(
|
|
requestedValues.map((value) => normalizeTargetArchitecture(value, 'target architecture').node),
|
|
);
|
|
if (requestedArchitectures.size > 1) {
|
|
throw new Error(`Conflicting target architectures: ${requestedValues.join(', ')}.`);
|
|
}
|
|
|
|
const target = normalizeTargetArchitecture(requestedValues[0] || host.node);
|
|
if (platform === 'linux' && target.node !== host.node) {
|
|
throw new Error(
|
|
`Linux AppImages must be built natively: host is ${host.node}, target is ${target.node}. `
|
|
+ `Run this build on a ${target.node} Linux host.`,
|
|
);
|
|
}
|
|
return target;
|
|
};
|