@bongos/core 1.19.884 → 1.19.885

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.
Files changed (65) hide show
  1. package/.bongos-core.json +19 -284
  2. package/docs/architecture.md +0 -1
  3. package/docs/file-map.md +0 -1
  4. package/docs/module-api-changelog.md +2 -0
  5. package/package-lock.json +2 -2
  6. package/package.json +1 -1
  7. package/src/bongos/serve-internal.js +10 -56
  8. package/src/module-api.js +1 -1
  9. package/src/platform-server.js +0 -1
  10. package/tests/host_topology_skips.mjs +0 -1
  11. package/tests/instance_release_config.mjs +27 -26
  12. package/tests/session_rename_fallback.mjs +8 -90
  13. package/modules/dev-box/app/README.md +0 -74
  14. package/modules/dev-box/app/assets/tray/mac-alertTemplate.png +0 -0
  15. package/modules/dev-box/app/assets/tray/mac-alertTemplate@2x.png +0 -0
  16. package/modules/dev-box/app/assets/tray/mac-busyTemplate.png +0 -0
  17. package/modules/dev-box/app/assets/tray/mac-busyTemplate@2x.png +0 -0
  18. package/modules/dev-box/app/assets/tray/mac-offTemplate.png +0 -0
  19. package/modules/dev-box/app/assets/tray/mac-offTemplate@2x.png +0 -0
  20. package/modules/dev-box/app/assets/tray/mac-onTemplate.png +0 -0
  21. package/modules/dev-box/app/assets/tray/mac-onTemplate@2x.png +0 -0
  22. package/modules/dev-box/app/assets/tray/win-alert.png +0 -0
  23. package/modules/dev-box/app/assets/tray/win-busy.png +0 -0
  24. package/modules/dev-box/app/assets/tray/win-off.png +0 -0
  25. package/modules/dev-box/app/assets/tray/win-on.png +0 -0
  26. package/modules/dev-box/app/build-resources/dmg-background.png +0 -0
  27. package/modules/dev-box/app/build-resources/dmg-background@2x.png +0 -0
  28. package/modules/dev-box/app/build-resources/icon.png +0 -0
  29. package/modules/dev-box/app/electron-builder.tmpl.yml +0 -95
  30. package/modules/dev-box/app/electron-builder.yml +0 -95
  31. package/modules/dev-box/app/package-lock.json +0 -5291
  32. package/modules/dev-box/app/package.json +0 -30
  33. package/modules/dev-box/app/renderer/app.js +0 -319
  34. package/modules/dev-box/app/renderer/index.html +0 -45
  35. package/modules/dev-box/app/renderer/styles.css +0 -248
  36. package/modules/dev-box/app/renderer/theme.generated.css +0 -16
  37. package/modules/dev-box/app/scripts/apply-dmg-backdrop.sh +0 -82
  38. package/modules/dev-box/app/scripts/dmgbuild-settings.py +0 -39
  39. package/modules/dev-box/app/scripts/gen-brand.js +0 -138
  40. package/modules/dev-box/app/scripts/gen-dmg-backdrop.py +0 -323
  41. package/modules/dev-box/app/scripts/gen-icons.js +0 -286
  42. package/modules/dev-box/app/scripts/vendor-client.js +0 -23
  43. package/modules/dev-box/app/src/box-controller.js +0 -287
  44. package/modules/dev-box/app/src/brand.generated.json +0 -13
  45. package/modules/dev-box/app/src/brand.js +0 -16
  46. package/modules/dev-box/app/src/config.js +0 -31
  47. package/modules/dev-box/app/src/gds-client.js +0 -96
  48. package/modules/dev-box/app/src/main.js +0 -610
  49. package/modules/dev-box/app/src/pairing.js +0 -57
  50. package/modules/dev-box/app/src/preload.js +0 -29
  51. package/modules/dev-box/app/src/session-store.js +0 -82
  52. package/modules/dev-box/app/src/ssh-setup.js +0 -569
  53. package/modules/dev-box/app/src/task-picker.js +0 -70
  54. package/modules/dev-box/app/src/tray.js +0 -99
  55. package/modules/dev-box/app/src/updater.js +0 -55
  56. package/modules/dev-box/app/src/vendor/bongos-client.cjs +0 -1014
  57. package/modules/dev-box/app/test/unit.mjs +0 -526
  58. package/src/devbox-downloads.js +0 -67
  59. package/tests/devbox_artifact_gate.mjs +0 -75
  60. package/tests/devbox_dmg_backdrop.mjs +0 -137
  61. package/tests/devbox_downloads.mjs +0 -140
  62. package/tests/devbox_icons.mjs +0 -304
  63. package/tests/devbox_installer_brand.mjs +0 -232
  64. package/tests/devbox_key_register.mjs +0 -234
  65. 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 };