@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,96 +0,0 @@
|
|
|
1
|
-
// devbox-app/src/gds-client.js — authenticated client over the GDS API.
|
|
2
|
-
//
|
|
3
|
-
// Backed by the GENERATED typed client (task 1996 / R09), vendored in verbatim at
|
|
4
|
-
// src/vendor/bongos-client.cjs (scripts/vendor-client.js copies it from the repo's
|
|
5
|
-
// clients/bongos-client/ so it ships inside the asar — see ADR 0045: the app is a
|
|
6
|
-
// zero-dep, separately-packaged subproject). This module keeps the SAME method
|
|
7
|
-
// surface + GdsError contract its callers (box-controller, main) rely on, so the
|
|
8
|
-
// only thing that changed is the transport: the endpoint paths are now the
|
|
9
|
-
// spec-derived generated methods, which can never drift from the routes.
|
|
10
|
-
//
|
|
11
|
-
// Endpoints use the canonical unversioned /api/bongos base (ADR 0117); the generated
|
|
12
|
-
// methods are relative to it. The permanent /api/gds alias is what ALREADY-SHIPPED
|
|
13
|
-
// binaries call — editing this source cannot reach them, and the server mounts both,
|
|
14
|
-
// so a future build asking for the canonical path costs nobody anything (task 1003707).
|
|
15
|
-
|
|
16
|
-
const createGeneratedClient = require('./vendor/bongos-client.cjs');
|
|
17
|
-
const { apiBase } = require('./config');
|
|
18
|
-
|
|
19
|
-
class GdsError extends Error {
|
|
20
|
-
constructor(status, body) {
|
|
21
|
-
super((body && (body.message || body.error)) || `HTTP ${status}`);
|
|
22
|
-
this.status = status;
|
|
23
|
-
this.body = body || {};
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// createClient({ getToken, getApiBase, fetchImpl }) — getToken/getApiBase are read
|
|
28
|
-
// per call so a re-auth or a base change is picked up immediately (the generated
|
|
29
|
-
// client captures them at construction, so we construct per call — cheap closures).
|
|
30
|
-
// fetchImpl is a seam for tests; it defaults to the platform fetch.
|
|
31
|
-
function createClient({ getToken, getApiBase, fetchImpl } = {}) {
|
|
32
|
-
// Build a generated client bound to the current origin + token. `root` is the
|
|
33
|
-
// base path under the origin ('/api/bongos' for the API, '' for same-origin static
|
|
34
|
-
// assets like the release manifest). throwOnError:false → result-mode, which we
|
|
35
|
-
// translate back into the GdsError contract callers expect.
|
|
36
|
-
function gen(root) {
|
|
37
|
-
return createGeneratedClient({
|
|
38
|
-
baseUrl: apiBase(getApiBase ? getApiBase() : null) + root,
|
|
39
|
-
token: getToken ? getToken() : null,
|
|
40
|
-
throwOnError: false,
|
|
41
|
-
fetch: fetchImpl || undefined,
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
const gds = () => gen('/api/bongos');
|
|
45
|
-
|
|
46
|
-
// Unwrap a result-mode { status, ok, data } into the legacy contract: return the
|
|
47
|
-
// parsed body on 2xx, throw GdsError(status, body) otherwise — byte-identical to
|
|
48
|
-
// the old hand-written `call()` behavior (callers read err.status + err.body).
|
|
49
|
-
async function unwrap(promise) {
|
|
50
|
-
const res = await promise;
|
|
51
|
-
if (!res.ok) throw new GdsError(res.status, res.data);
|
|
52
|
-
return res.data;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return {
|
|
56
|
-
// Generic escape hatch, kept for parity with the old surface. `path` is the full
|
|
57
|
-
// path under the origin (e.g. '/api/bongos/box/me'), so it routes through baseUrl:''.
|
|
58
|
-
call: (method, path, body) => unwrap(gen('').request(method, path, body !== undefined ? { body } : {})),
|
|
59
|
-
// identity
|
|
60
|
-
logout: () => unwrap(gds().auth.postAuthLogout()),
|
|
61
|
-
// pairing (public)
|
|
62
|
-
pairStart: (deviceName, platform) =>
|
|
63
|
-
unwrap(gds().auth.postAuthAppPairStart({ body: { device_name: deviceName, platform } })),
|
|
64
|
-
pairPoll: (pollToken) =>
|
|
65
|
-
unwrap(gds().auth.postAuthAppPairPoll({ body: { poll_token: pollToken } })),
|
|
66
|
-
// box
|
|
67
|
-
boxMe: () => unwrap(gds().box.getBoxMe()),
|
|
68
|
-
boxEnsure: () => unwrap(gds().box.postBoxEnsure()),
|
|
69
|
-
boxClose: () => unwrap(gds().box.postBoxClose()),
|
|
70
|
-
// Leg 3: body-less keep-alive. No body → the server bumps last_activity_at only
|
|
71
|
-
// and leaves claude_active untouched, so an idle box still reaps (cost posture).
|
|
72
|
-
boxHeartbeat: () => unwrap(gds().box.postBoxHeartbeat()),
|
|
73
|
-
boxTerminal: () => unwrap(gds().box.getBoxTerminal()),
|
|
74
|
-
registerSshKey: (publicKey, label) =>
|
|
75
|
-
unwrap(gds().box.postBoxSshKey({ body: { public_key: publicKey, label } })),
|
|
76
|
-
// The VERIFY half of registration (task 1002509): a 201 is not proof the key is
|
|
77
|
-
// on the account, so ssh-setup re-reads the list and looks for the fingerprint.
|
|
78
|
-
listSshKeys: () => unwrap(gds().box.getBoxSshKey()),
|
|
79
|
-
managedSettings: () => unwrap(gds().box.getBoxManagedSettings()),
|
|
80
|
-
// task pick + confirm (BV1.R100 / goal 1000051). These ride the generic
|
|
81
|
-
// request() escape hatch (like latestRelease) rather than a named generated
|
|
82
|
-
// method, so the shipped binary keeps working regardless of whether the
|
|
83
|
-
// vendored client has been regenerated for the new /box/scope route yet.
|
|
84
|
-
claimableTasks: () => unwrap(gen('').request('GET', '/api/bongos/tasks/claimable')),
|
|
85
|
-
claimTask: (taskId) => unwrap(gen('').request('POST', '/api/bongos/claims', { body: { task_id: taskId } })),
|
|
86
|
-
boxScope: () => unwrap(gen('').request('GET', '/api/bongos/box/scope')),
|
|
87
|
-
// update check (public route at the origin root, not under /api/bongos).
|
|
88
|
-
// task 1002649: polls the EXTENSIONLESS /version twin, NOT latest.json — a
|
|
89
|
-
// front proxy with a file-matcher can eat *.json paths before Node (the
|
|
90
|
-
// live instance's pre-ADR-0152 vhost 404'd latest.json empty while this
|
|
91
|
-
// endpoint worked), and the updater only needs { version, assets } anyway.
|
|
92
|
-
latestRelease: () => unwrap(gen('').request('GET', '/downloads/devbox/version')),
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
module.exports = { createClient, GdsError };
|