@bongos/core 1.19.884 → 1.19.886
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/.bongos-core.json +20 -285
- package/docs/architecture.md +0 -1
- package/docs/file-map.md +0 -1
- package/docs/module-api-changelog.md +4 -0
- package/package-lock.json +2 -2
- package/package.json +1 -1
- package/scripts/gds/gen-session-index.js +8 -1
- package/src/bongos/serve-internal.js +10 -56
- package/src/module-api.js +1 -1
- package/src/platform-server.js +0 -1
- package/tests/host_topology_skips.mjs +0 -1
- package/tests/instance_release_config.mjs +27 -26
- package/tests/session_rename_fallback.mjs +8 -90
- package/modules/dev-box/app/README.md +0 -74
- package/modules/dev-box/app/assets/tray/mac-alertTemplate.png +0 -0
- package/modules/dev-box/app/assets/tray/mac-alertTemplate@2x.png +0 -0
- package/modules/dev-box/app/assets/tray/mac-busyTemplate.png +0 -0
- package/modules/dev-box/app/assets/tray/mac-busyTemplate@2x.png +0 -0
- package/modules/dev-box/app/assets/tray/mac-offTemplate.png +0 -0
- package/modules/dev-box/app/assets/tray/mac-offTemplate@2x.png +0 -0
- package/modules/dev-box/app/assets/tray/mac-onTemplate.png +0 -0
- package/modules/dev-box/app/assets/tray/mac-onTemplate@2x.png +0 -0
- package/modules/dev-box/app/assets/tray/win-alert.png +0 -0
- package/modules/dev-box/app/assets/tray/win-busy.png +0 -0
- package/modules/dev-box/app/assets/tray/win-off.png +0 -0
- package/modules/dev-box/app/assets/tray/win-on.png +0 -0
- package/modules/dev-box/app/build-resources/dmg-background.png +0 -0
- package/modules/dev-box/app/build-resources/dmg-background@2x.png +0 -0
- package/modules/dev-box/app/build-resources/icon.png +0 -0
- package/modules/dev-box/app/electron-builder.tmpl.yml +0 -95
- package/modules/dev-box/app/electron-builder.yml +0 -95
- package/modules/dev-box/app/package-lock.json +0 -5291
- package/modules/dev-box/app/package.json +0 -30
- package/modules/dev-box/app/renderer/app.js +0 -319
- package/modules/dev-box/app/renderer/index.html +0 -45
- package/modules/dev-box/app/renderer/styles.css +0 -248
- package/modules/dev-box/app/renderer/theme.generated.css +0 -16
- package/modules/dev-box/app/scripts/apply-dmg-backdrop.sh +0 -82
- package/modules/dev-box/app/scripts/dmgbuild-settings.py +0 -39
- package/modules/dev-box/app/scripts/gen-brand.js +0 -138
- package/modules/dev-box/app/scripts/gen-dmg-backdrop.py +0 -323
- package/modules/dev-box/app/scripts/gen-icons.js +0 -286
- package/modules/dev-box/app/scripts/vendor-client.js +0 -23
- package/modules/dev-box/app/src/box-controller.js +0 -287
- package/modules/dev-box/app/src/brand.generated.json +0 -13
- package/modules/dev-box/app/src/brand.js +0 -16
- package/modules/dev-box/app/src/config.js +0 -31
- package/modules/dev-box/app/src/gds-client.js +0 -96
- package/modules/dev-box/app/src/main.js +0 -610
- package/modules/dev-box/app/src/pairing.js +0 -57
- package/modules/dev-box/app/src/preload.js +0 -29
- package/modules/dev-box/app/src/session-store.js +0 -82
- package/modules/dev-box/app/src/ssh-setup.js +0 -569
- package/modules/dev-box/app/src/task-picker.js +0 -70
- package/modules/dev-box/app/src/tray.js +0 -99
- package/modules/dev-box/app/src/updater.js +0 -55
- package/modules/dev-box/app/src/vendor/bongos-client.cjs +0 -1014
- package/modules/dev-box/app/test/unit.mjs +0 -526
- package/src/devbox-downloads.js +0 -67
- package/tests/devbox_artifact_gate.mjs +0 -75
- package/tests/devbox_dmg_backdrop.mjs +0 -137
- package/tests/devbox_downloads.mjs +0 -140
- package/tests/devbox_icons.mjs +0 -304
- package/tests/devbox_installer_brand.mjs +0 -232
- package/tests/devbox_key_register.mjs +0 -234
- package/tests/devbox_update_path.mjs +0 -84
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
// devbox-app/src/tray.js — the menu-bar (mac) / system-tray (Windows) face.
|
|
2
|
-
//
|
|
3
|
-
// macOS gets monochrome TEMPLATE images (the OS recolors them for light/dark
|
|
4
|
-
// menu bars; the shape carries the state). Windows gets colored PNGs. Four
|
|
5
|
-
// states: off (outline), on (filled), busy (half), alert (bang).
|
|
6
|
-
|
|
7
|
-
const path = require('node:path');
|
|
8
|
-
const { Tray, Menu, nativeImage } = require('electron');
|
|
9
|
-
|
|
10
|
-
const ASSETS = path.join(__dirname, '..', 'assets', 'tray');
|
|
11
|
-
const IS_MAC = process.platform === 'darwin';
|
|
12
|
-
|
|
13
|
-
// status (box-controller vocabulary) → icon variant
|
|
14
|
-
function iconVariant(status) {
|
|
15
|
-
switch (status) {
|
|
16
|
-
case 'active': return 'on';
|
|
17
|
-
case 'provisioning':
|
|
18
|
-
case 'closing': return 'busy';
|
|
19
|
-
case 'error': return 'alert';
|
|
20
|
-
default: return 'off'; // none / signed_out / loading
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function loadIcon(variant) {
|
|
25
|
-
const file = IS_MAC ? `mac-${variant}Template.png` : `win-${variant}.png`;
|
|
26
|
-
const img = nativeImage.createFromPath(path.join(ASSETS, file));
|
|
27
|
-
if (IS_MAC) img.setTemplateImage(true);
|
|
28
|
-
return img;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function statusLine(snapshot) {
|
|
32
|
-
switch (snapshot.status) {
|
|
33
|
-
case 'signed_out': return 'Not signed in';
|
|
34
|
-
case 'loading': return 'Checking…';
|
|
35
|
-
case 'none': return 'Box: off';
|
|
36
|
-
case 'provisioning': return 'Box: starting up…';
|
|
37
|
-
case 'active': return `Box: ON${snapshot.box && snapshot.box.hostname ? ` — ${snapshot.box.hostname}` : ''}`;
|
|
38
|
-
case 'closing': return 'Box: shutting down…';
|
|
39
|
-
case 'error': return 'Box: error — open the panel';
|
|
40
|
-
default: return 'Dev Box';
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// createTray({ onOpen, onToggle, onOpenTerminal, onOpenHall, onQuit,
|
|
45
|
-
// getLoginItem, setLoginItem }) → { update(snapshot), destroy() }
|
|
46
|
-
function createTray(handlers) {
|
|
47
|
-
const tray = new Tray(loadIcon('off'));
|
|
48
|
-
let current = { status: 'loading' };
|
|
49
|
-
|
|
50
|
-
function buildMenu() {
|
|
51
|
-
const s = current;
|
|
52
|
-
const onOrOff = s.status === 'active' || s.status === 'closing';
|
|
53
|
-
return Menu.buildFromTemplate([
|
|
54
|
-
{ label: statusLine(s), enabled: false },
|
|
55
|
-
{ type: 'separator' },
|
|
56
|
-
{ label: 'Open Dev Box panel', click: handlers.onOpen },
|
|
57
|
-
{
|
|
58
|
-
label: onOrOff ? 'Turn box off' : 'Turn box on',
|
|
59
|
-
enabled: s.status !== 'signed_out' && s.status !== 'loading' && !s.busy
|
|
60
|
-
&& s.status !== 'provisioning' && s.status !== 'closing',
|
|
61
|
-
click: handlers.onToggle,
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
label: 'Open browser terminal',
|
|
65
|
-
enabled: Boolean(s.terminal && s.terminal.url),
|
|
66
|
-
click: handlers.onOpenTerminal,
|
|
67
|
-
},
|
|
68
|
-
{ label: 'Open the builders’ hall', click: handlers.onOpenHall },
|
|
69
|
-
{ type: 'separator' },
|
|
70
|
-
{
|
|
71
|
-
label: 'Start at login',
|
|
72
|
-
type: 'checkbox',
|
|
73
|
-
checked: handlers.getLoginItem(),
|
|
74
|
-
click: (item) => handlers.setLoginItem(item.checked),
|
|
75
|
-
},
|
|
76
|
-
{ type: 'separator' },
|
|
77
|
-
{ label: 'Quit', click: handlers.onQuit },
|
|
78
|
-
]);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// Left-click opens the panel; right-click (and mac ctrl-click) the menu.
|
|
82
|
-
tray.on('click', handlers.onOpen);
|
|
83
|
-
tray.on('right-click', () => tray.popUpContextMenu(buildMenu()));
|
|
84
|
-
|
|
85
|
-
return {
|
|
86
|
-
update(snapshot) {
|
|
87
|
-
current = snapshot;
|
|
88
|
-
tray.setImage(loadIcon(iconVariant(snapshot.status)));
|
|
89
|
-
tray.setToolTip(statusLine(snapshot));
|
|
90
|
-
// Keep a context menu reachable on platforms that route both buttons to
|
|
91
|
-
// 'click' — popUpContextMenu handles the rest.
|
|
92
|
-
if (!IS_MAC) tray.setContextMenu(buildMenu());
|
|
93
|
-
},
|
|
94
|
-
bounds() { return tray.getBounds(); },
|
|
95
|
-
destroy() { tray.destroy(); },
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
module.exports = { createTray, iconVariant, statusLine };
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
// devbox-app/src/updater.js — pure update-check logic (#924). No Electron, no
|
|
2
|
-
// network: deciding "is a newer release available?" and "which installer target
|
|
3
|
-
// do I need?" are pure functions so test/unit.mjs proves them without a GUI. The
|
|
4
|
-
// Electron wiring (poll the endpoint, download, launch the installer) is in main.js.
|
|
5
|
-
|
|
6
|
-
// Parse "X.Y.Z" → [X, Y, Z] numbers, or null for anything that isn't a clean
|
|
7
|
-
// three-part numeric version (the same shape devbox-downloads.js enforces on the
|
|
8
|
-
// server), so a malformed value can never be mistaken for an upgrade.
|
|
9
|
-
function parseVersion(v) {
|
|
10
|
-
if (typeof v !== 'string') return null;
|
|
11
|
-
const m = /^(\d+)\.(\d+)\.(\d+)$/.exec(v.trim());
|
|
12
|
-
return m ? [Number(m[1]), Number(m[2]), Number(m[3])] : null;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
// -1 if a<b, 0 if equal, 1 if a>b. An unparseable side sorts BELOW a parseable
|
|
16
|
-
// one (and two bad ones are equal), so a malformed version never reads as newer.
|
|
17
|
-
function compareVersions(a, b) {
|
|
18
|
-
const pa = parseVersion(a);
|
|
19
|
-
const pb = parseVersion(b);
|
|
20
|
-
if (!pa || !pb) {
|
|
21
|
-
if (!pa && !pb) return 0;
|
|
22
|
-
return pa ? 1 : -1;
|
|
23
|
-
}
|
|
24
|
-
for (let i = 0; i < 3; i++) {
|
|
25
|
-
if (pa[i] !== pb[i]) return pa[i] < pb[i] ? -1 : 1;
|
|
26
|
-
}
|
|
27
|
-
return 0;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// The load-bearing decision: the "update available" banner shows ONLY when the
|
|
31
|
-
// published release is STRICTLY newer than what's running. This replaces the
|
|
32
|
-
// naive `latest !== current` check, which would advertise a DOWNGRADE whenever
|
|
33
|
-
// the published config trails the installed app (the live state today: app 1.0.6
|
|
34
|
-
// vs config 1.0.5). Returns false on any unparseable version — never a
|
|
35
|
-
// false-positive.
|
|
36
|
-
function isUpdateAvailable(currentVersion, latestVersion) {
|
|
37
|
-
if (!parseVersion(currentVersion) || !parseVersion(latestVersion)) return false;
|
|
38
|
-
return compareVersions(latestVersion, currentVersion) > 0;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// Map the running (platform, arch) to a config/devbox-app.json asset target key.
|
|
42
|
-
// Mirrors the four built targets. Anything else (e.g. linux) → null = no
|
|
43
|
-
// in-app installer for this platform (the banner simply won't offer one).
|
|
44
|
-
function resolveTarget(platform, arch) {
|
|
45
|
-
if (platform === 'darwin') return arch === 'arm64' ? 'mac-arm64' : 'mac-x64';
|
|
46
|
-
if (platform === 'win32') return arch === 'arm64' ? 'win-arm64' : 'win-x64';
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// The exact banner copy the task specifies: "Update available — v1.0.6".
|
|
51
|
-
function updateBannerText(latestVersion) {
|
|
52
|
-
return `Update available — v${latestVersion}`;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
module.exports = { parseVersion, compareVersions, isUpdateAvailable, resolveTarget, updateBannerText };
|