local-operator-ui 0.19.6 → 0.20.0
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/bin/ensure-electron.js +47 -0
- package/bin/linux-sandbox.js +27 -18
- package/bin/postinstall.js +55 -33
- package/out/main/index.js +209 -417
- package/out/renderer/assets/{_basePickBy-Duzo68Xw.js → _basePickBy-FfClaKQg.js} +1 -1
- package/out/renderer/assets/{_baseUniq-BeJmcE9M.js → _baseUniq-C9SvGZui.js} +1 -1
- package/out/renderer/assets/{agent-details-page-B-rZ1RvZ.js → agent-details-page-AoSG_fVH.js} +1 -1
- package/out/renderer/assets/{agent-hub-page-CBL3Npvq.js → agent-hub-page-CaZjaTZe.js} +1 -1
- package/out/renderer/assets/{agents-page-7rG5Vl9M.js → agents-page-RS6PE_fF.js} +2 -2
- package/out/renderer/assets/{architectureDiagram-IEHRJDOE-BsT5wnLG.js → architectureDiagram-IEHRJDOE-Be7LQKHg.js} +1 -1
- package/out/renderer/assets/{blockDiagram-JOT3LUYC-JEwDyed4.js → blockDiagram-JOT3LUYC-iWnvArS2.js} +1 -1
- package/out/renderer/assets/{c4Diagram-VJAJSXHY-C4pGCoOs.js → c4Diagram-VJAJSXHY-BBuir5yQ.js} +1 -1
- package/out/renderer/assets/channel-D4JK8GjQ.js +1 -0
- package/out/renderer/assets/{chunk-4BMEZGHF-CNXrCcWD.js → chunk-4BMEZGHF-DzRvFZnz.js} +1 -1
- package/out/renderer/assets/{chunk-A2AXSNBT-Cs3JTrFa.js → chunk-A2AXSNBT-4uP9DbW7.js} +1 -1
- package/out/renderer/assets/{chunk-AEK57VVT-Cf3YXadW.js → chunk-AEK57VVT-BL3rbHq4.js} +1 -1
- package/out/renderer/assets/{chunk-D6G4REZN-Broh2kYr.js → chunk-D6G4REZN-D6wbdfUw.js} +1 -1
- package/out/renderer/assets/{chunk-RZ5BOZE2-CidGAd_y.js → chunk-RZ5BOZE2-D2Fl_NaB.js} +1 -1
- package/out/renderer/assets/{chunk-XZIHB7SX-BMBZY-Ob.js → chunk-XZIHB7SX-DN5jo0Xq.js} +1 -1
- package/out/renderer/assets/classDiagram-GIVACNV2-yxaMQW5a.js +1 -0
- package/out/renderer/assets/classDiagram-v2-COTLJTTW-yxaMQW5a.js +1 -0
- package/out/renderer/assets/clone-B7rlppnW.js +1 -0
- package/out/renderer/assets/{compact-pagination-n3Xl8pZ8.js → compact-pagination-20O8NjDK.js} +1 -1
- package/out/renderer/assets/{dagre-OKDRZEBW-Bz_ICygp.js → dagre-OKDRZEBW-BYIesx33.js} +1 -1
- package/out/renderer/assets/{diagram-SSKATNLV-BTVMb1kE.js → diagram-SSKATNLV-DP6lL-Te.js} +1 -1
- package/out/renderer/assets/{diagram-VNBRO52H-DfljiV4G.js → diagram-VNBRO52H-bmsCnWFr.js} +1 -1
- package/out/renderer/assets/{erDiagram-Q7BY3M3F-BRUMJB0F.js → erDiagram-Q7BY3M3F-EsgbzeoI.js} +1 -1
- package/out/renderer/assets/{flowDiagram-4HSFHLVR-BjcUuq_P.js → flowDiagram-4HSFHLVR-DOiNzXZN.js} +1 -1
- package/out/renderer/assets/{ganttDiagram-APWFNJXF-ovQikGsn.js → ganttDiagram-APWFNJXF-DJmMxmWH.js} +1 -1
- package/out/renderer/assets/{gitGraphDiagram-7IBYFJ6S-CrDG1pZY.js → gitGraphDiagram-7IBYFJ6S-CsW8qQBE.js} +1 -1
- package/out/renderer/assets/{graph-kwCSE5gm.js → graph-DPdUvm6W.js} +1 -1
- package/out/renderer/assets/{icon-DaedMBiD.css → icon-HSrrv8O-.css} +1 -1
- package/out/renderer/assets/{index-BbTvTNw0.js → index-BHWYYomf.js} +1 -1
- package/out/renderer/assets/{index-D3g23Ep3.js → index-C2JWjezT.js} +1 -1
- package/out/renderer/assets/{index-DOpsBDAL.js → index-DTxYU-h1.js} +310 -310
- package/out/renderer/assets/{infoDiagram-PH2N3AL5-CBAvcVVb.js → infoDiagram-PH2N3AL5-DlGp0OAs.js} +1 -1
- package/out/renderer/assets/{installer-poO56j69.js → installer-Ck14_4Oh.js} +1 -1
- package/out/renderer/assets/{journeyDiagram-U35MCT3I-kxtnE0E0.js → journeyDiagram-U35MCT3I-BMKeuZdQ.js} +1 -1
- package/out/renderer/assets/{kanban-definition-NDS4AKOZ-Cp_ZcAfm.js → kanban-definition-NDS4AKOZ-CBMkFWiV.js} +1 -1
- package/out/renderer/assets/{layout-DkMOECVe.js → layout-CQLCCDdm.js} +1 -1
- package/out/renderer/assets/{legacy-agents-page-Bm9y4VzQ.js → legacy-agents-page-DaL-s8eO.js} +1 -1
- package/out/renderer/assets/{mermaid.core-BdThqeRN.js → mermaid.core-zhMaqo9l.js} +5 -5
- package/out/renderer/assets/{mindmap-definition-ALO5MXBD-CmnY7qkU.js → mindmap-definition-ALO5MXBD-ChxcwGV6.js} +1 -1
- package/out/renderer/assets/{page-header-zecAylNs.js → page-header-D-uc8qqA.js} +1 -1
- package/out/renderer/assets/{parseISO-BBQqU7gh.js → parseISO-Bgv71POy.js} +1 -1
- package/out/renderer/assets/{pieDiagram-IB7DONF6-CT6aweg_.js → pieDiagram-IB7DONF6-BMEW9BJi.js} +1 -1
- package/out/renderer/assets/{quadrantDiagram-7GDLP6J5-B9mprDDC.js → quadrantDiagram-7GDLP6J5-D-ErPCKs.js} +1 -1
- package/out/renderer/assets/{radar-MK3ICKWK-BbnAUJmd.js → radar-MK3ICKWK-2tp4r77h.js} +1 -1
- package/out/renderer/assets/{radient-auth-buttons-DQwcB7Kb.js → radient-auth-buttons-klNSjDud.js} +1 -1
- package/out/renderer/assets/{requirementDiagram-KVF5MWMF-vDOfXFEQ.js → requirementDiagram-KVF5MWMF-nNjxV4M0.js} +1 -1
- package/out/renderer/assets/{sankeyDiagram-QLVOVGJD-B4f16uUk.js → sankeyDiagram-QLVOVGJD-HK65A8n7.js} +1 -1
- package/out/renderer/assets/{schedules-page-B8xcfay1.js → schedules-page-CLrcFhCL.js} +1 -1
- package/out/renderer/assets/{sequenceDiagram-X6HHIX6F-B99VW_Zk.js → sequenceDiagram-X6HHIX6F-D3VDaA9I.js} +1 -1
- package/out/renderer/assets/{settings-page-DCLwiyj6.js → settings-page-CKVWBbsu.js} +1 -1
- package/out/renderer/assets/{square-pen-CdJTC74b.js → square-pen-CQEKS3JT.js} +1 -1
- package/out/renderer/assets/{stateDiagram-DGXRK772-DrhFdhdz.js → stateDiagram-DGXRK772-BJMfya--.js} +1 -1
- package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-CmCw0Yzl.js +1 -0
- package/out/renderer/assets/{timeline-definition-BDJGKUSR-D_VVC3lo.js → timeline-definition-BDJGKUSR-wvXoFLOl.js} +1 -1
- package/out/renderer/assets/{use-agent-like-mutation-C8Hn5OU7.js → use-agent-like-mutation-DAmS19om.js} +1 -1
- package/out/renderer/assets/{xychartDiagram-VJFVF3MP-CHmZVi_C.js → xychartDiagram-VJFVF3MP-DnyQ060j.js} +1 -1
- package/out/renderer/index.html +3 -3
- package/out/renderer/installer.html +3 -3
- package/package.json +69 -58
- package/out/renderer/assets/channel-C4lq_kmR.js +0 -1
- package/out/renderer/assets/classDiagram-GIVACNV2-BpO5Iy7a.js +0 -1
- package/out/renderer/assets/classDiagram-v2-COTLJTTW-BpO5Iy7a.js +0 -1
- package/out/renderer/assets/clone-CuQYVeZK.js +0 -1
- package/out/renderer/assets/stateDiagram-v2-YXO3MK2T-uaCZR48L.js +0 -1
- /package/out/renderer/assets/{icon-DMNb6cX-.js → icon-RIkwUxL5.js} +0 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Make sure the Electron runtime the BUILD shells out to is on disk.
|
|
5
|
+
*
|
|
6
|
+
* WHY A BUILD NEEDS THE BINARY AT ALL: electron-vite's bytecode step runs the
|
|
7
|
+
* Electron binary from `node_modules/electron/dist` to produce `.jsc` for the
|
|
8
|
+
* exact V8 it will load under — so the build needs a real dist/, and it does
|
|
9
|
+
* not go through `require("electron")`, which is the call that would fetch the
|
|
10
|
+
* runtime on demand. Missing dist/ therefore fails the build with
|
|
11
|
+
* `[vite:bytecode] spawn … ENOENT` rather than downloading anything.
|
|
12
|
+
*
|
|
13
|
+
* WHY THIS EXISTS BESIDE bin/postinstall.js: since Electron 42 the `electron`
|
|
14
|
+
* package has no postinstall, so `node_modules/electron/dist` is absent on a
|
|
15
|
+
* fresh install until something fetches it. bin/postinstall.js fetches it on
|
|
16
|
+
* every platform, which covers `pnpm install`; this script covers the trees
|
|
17
|
+
* that hook cannot reach — `pnpm install --ignore-scripts`, and the common
|
|
18
|
+
* local case of a dist/ deleted or replaced by hand — by running from the
|
|
19
|
+
* `prebuild` hook, before anything reads it. Both call the same
|
|
20
|
+
* ensureElectronDist() so there is one implementation of "what counts as
|
|
21
|
+
* present" and one fetch.
|
|
22
|
+
*
|
|
23
|
+
* It is IDEMPOTENT and cache-backed: with dist/ present this exits in well
|
|
24
|
+
* under a second without touching the network.
|
|
25
|
+
*
|
|
26
|
+
* It FAILS the build when the runtime cannot be fetched, unlike the postinstall
|
|
27
|
+
* (which must never fail an install). There is no way for the build to succeed
|
|
28
|
+
* without it, and a named failure with the one command that fixes it beats the
|
|
29
|
+
* ENOENT this exists to prevent.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
const path = require("node:path");
|
|
33
|
+
const { ensureElectronDist } = require("./linux-sandbox.js");
|
|
34
|
+
|
|
35
|
+
const packageRoot = path.join(__dirname, "..");
|
|
36
|
+
|
|
37
|
+
if (!ensureElectronDist(packageRoot, { quiet: false })) {
|
|
38
|
+
console.error(
|
|
39
|
+
"local-operator-ui: the Electron runtime is missing from node_modules and could not be fetched.",
|
|
40
|
+
);
|
|
41
|
+
console.error(
|
|
42
|
+
"The build needs it: electron-vite compiles the main bundle to V8 bytecode for that exact runtime (the preload ships as plain JS — bytecode cannot load in an Electron 44 renderer, see electron.vite.config.js).",
|
|
43
|
+
);
|
|
44
|
+
console.error("Fetch it explicitly, then build again:");
|
|
45
|
+
console.error(" npx install-electron --no && pnpm build");
|
|
46
|
+
process.exit(1);
|
|
47
|
+
}
|
package/bin/linux-sandbox.js
CHANGED
|
@@ -411,16 +411,31 @@ const exitCodeFor = (code, signal) => {
|
|
|
411
411
|
* That is the failure mode this file's whole design is meant to avoid, so it is
|
|
412
412
|
* recorded here rather than quietly corrected.
|
|
413
413
|
*
|
|
414
|
+
* That ordering argument is history since Electron 42, and the function is
|
|
415
|
+
* MORE load-bearing for it, not less: the `electron` package no longer runs a
|
|
416
|
+
* postinstall at all, so nothing downloads dist/ during an install any more,
|
|
417
|
+
* while `electron-vite`'s bytecode step spawns the binary straight from
|
|
418
|
+
* `dist/` (never through `require("electron")`, which is the call that would
|
|
419
|
+
* fetch it on demand). See bin/postinstall.js and bin/ensure-electron.js --
|
|
420
|
+
* between them they are the only things that put the runtime on disk.
|
|
421
|
+
*
|
|
414
422
|
* The fix is to drive Electron's own installer first. It is idempotent and
|
|
415
423
|
* cache-backed: with a valid dist/ already present it returns in ~0.08s without
|
|
416
424
|
* touching the network, and npm's later invocation of the same script is then
|
|
417
425
|
* the no-op instead. It also preserves a setuid bit we have already set
|
|
418
426
|
* (verified), so the ordering between the two runs does not matter.
|
|
419
427
|
*
|
|
420
|
-
* Returns true when
|
|
421
|
-
*
|
|
428
|
+
* Returns true when the Electron runtime itself is present afterwards (keyed on
|
|
429
|
+
* `dist/version`, the marker Electron's own installer uses). Every failure
|
|
430
|
+
* degrades to false: the install must still succeed (see bin/postinstall.js).
|
|
431
|
+
*
|
|
432
|
+
* `quiet` silences the installer, which is what the install path wants -- the
|
|
433
|
+
* download prints a progress bar that would otherwise appear twice in one
|
|
434
|
+
* `npm install`, once from us and once from npm's own run of the same script.
|
|
435
|
+
* The build path passes `quiet: false`, because there the download IS the
|
|
436
|
+
* visible work and a silent multi-minute wait reads as a hang.
|
|
422
437
|
*/
|
|
423
|
-
const ensureElectronDist = (packageRoot) => {
|
|
438
|
+
const ensureElectronDist = (packageRoot, { quiet = true } = {}) => {
|
|
424
439
|
const installer = path.join(
|
|
425
440
|
packageRoot,
|
|
426
441
|
"node_modules",
|
|
@@ -431,29 +446,23 @@ const ensureElectronDist = (packageRoot) => {
|
|
|
431
446
|
return false;
|
|
432
447
|
}
|
|
433
448
|
const distDir = path.join(packageRoot, "node_modules", "electron", "dist");
|
|
434
|
-
//
|
|
435
|
-
//
|
|
436
|
-
//
|
|
437
|
-
//
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
) {
|
|
449
|
+
// The fast path keys on `dist/version` ALONE. It used to also require
|
|
450
|
+
// `dist/chrome-sandbox`, which exists only on Linux, so on macOS and Windows
|
|
451
|
+
// every install re-ran the installer (idempotent, but a 10-minute-bounded
|
|
452
|
+
// spawn per install) and -- now that this function is also what fetches the
|
|
453
|
+
// runtime off Linux -- every build too. `dist/version` is the complete-extraction
|
|
454
|
+
// marker because electron's own isInstalled() reads the same file.
|
|
455
|
+
if (fs.existsSync(path.join(distDir, "version"))) {
|
|
442
456
|
return true;
|
|
443
457
|
}
|
|
444
|
-
// Inherit nothing on stdout: the download prints a progress bar that would
|
|
445
|
-
// otherwise appear twice in the install log, once here and once from npm's
|
|
446
|
-
// own run of the same script.
|
|
447
458
|
const result = spawnSync(process.execPath, [installer], {
|
|
448
459
|
cwd: path.dirname(installer),
|
|
449
|
-
stdio: "ignore",
|
|
460
|
+
stdio: quiet ? "ignore" : "inherit",
|
|
450
461
|
// A hung download must not hang the install. Ten minutes is generous for a
|
|
451
462
|
// ~100MB fetch on a slow link and still bounded.
|
|
452
463
|
timeout: 10 * 60 * 1000,
|
|
453
464
|
});
|
|
454
|
-
return (
|
|
455
|
-
result.status === 0 && fs.existsSync(path.join(distDir, "chrome-sandbox"))
|
|
456
|
-
);
|
|
465
|
+
return result.status === 0 && fs.existsSync(path.join(distDir, "version"));
|
|
457
466
|
};
|
|
458
467
|
|
|
459
468
|
module.exports = {
|
package/bin/postinstall.js
CHANGED
|
@@ -1,22 +1,36 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Two install-time duties, one script, because both are "the install did not
|
|
5
|
+
* leave this tree runnable" problems and npm's lifecycle gives us one hook:
|
|
5
6
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* 1. Fetch the Electron runtime. Since Electron 42 the `electron` package has
|
|
8
|
+
* no postinstall that downloads the binary, and `electron-vite`'s bytecode
|
|
9
|
+
* step spawns the binary straight from `dist/` rather than through
|
|
10
|
+
* `require("electron")` (the one call that would fetch it on demand). So
|
|
11
|
+
* without this, a fresh clone or a cold CI runner fails its first
|
|
12
|
+
* `pnpm build` with `[vite:bytecode] spawn ... ENOENT` -- on macOS and
|
|
13
|
+
* Windows too, not only on Linux. bin/ensure-electron.js calls the same
|
|
14
|
+
* helper from the build path, for trees installed with --ignore-scripts or
|
|
15
|
+
* with dist/ removed afterwards.
|
|
16
|
+
*
|
|
17
|
+
* 2. Restore the setuid bit on Electron's chrome-sandbox helper. npm strips
|
|
18
|
+
* setuid bits from package contents by design, so the helper lands
|
|
19
|
+
* root:root 0755 and Chromium aborts for a non-root user (issue #91). We fix
|
|
20
|
+
* it here because `sudo npm install -g` -- the ordinary way to install a
|
|
21
|
+
* global CLI -- runs this script as root, which is the one moment in the
|
|
22
|
+
* lifecycle where we hold the privilege the fix needs. Linux only: the
|
|
23
|
+
* helper does not exist anywhere else.
|
|
11
24
|
*
|
|
12
25
|
* THIS SCRIPT MUST NEVER FAIL THE INSTALL. An unprivileged `npm install -g`
|
|
13
26
|
* (prefix in $HOME), a container without CAP_CHOWN, macOS and Windows where the
|
|
14
|
-
* helper does not exist, and an install where the
|
|
15
|
-
* skipped are all normal situations
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
27
|
+
* helper does not exist, and an install where the Electron download failed or
|
|
28
|
+
* was skipped are all normal situations. Leaving the user with no package at
|
|
29
|
+
* all would be a worse defect than the one being fixed, so every failure path
|
|
30
|
+
* exits 0. Where the runtime could not be fetched, `bin/ensure-electron.js`
|
|
31
|
+
* fails the build with the exact command instead, and where the repair does not
|
|
32
|
+
* happen the launcher's post-mortem guidance (bin/local-operator-ui.js) covers
|
|
33
|
+
* it.
|
|
20
34
|
*
|
|
21
35
|
* It is quiet on success for the same reason npm scripts generally are: the
|
|
22
36
|
* common case is a working install and noise there trains people to ignore it.
|
|
@@ -24,22 +38,6 @@
|
|
|
24
38
|
|
|
25
39
|
const process = require("node:process");
|
|
26
40
|
|
|
27
|
-
// Silence is the contract on non-Linux: the helper is a Linux-only artifact, so
|
|
28
|
-
// there is nothing to repair and nothing worth printing on a Mac.
|
|
29
|
-
//
|
|
30
|
-
// LOCAL_OPERATOR_UI_FORCE_POSTINSTALL exists so the test suite can reach the
|
|
31
|
-
// repair path on a macOS developer machine and on CI's ubuntu runner alike.
|
|
32
|
-
// Without it the only assertion this script's test could make on darwin was
|
|
33
|
-
// "exit 0", which it satisfies by returning here before doing anything -- a
|
|
34
|
-
// vacuous test that passed while the whole body was mutated away. It is read
|
|
35
|
-
// only, never written by us, and namespaced so it cannot be set by accident.
|
|
36
|
-
if (
|
|
37
|
-
process.platform !== "linux" &&
|
|
38
|
-
process.env.LOCAL_OPERATOR_UI_FORCE_POSTINSTALL !== "1"
|
|
39
|
-
) {
|
|
40
|
-
process.exit(0);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
41
|
const main = () => {
|
|
44
42
|
const path = require("node:path");
|
|
45
43
|
const {
|
|
@@ -47,12 +45,36 @@ const main = () => {
|
|
|
47
45
|
repairSandboxHelper,
|
|
48
46
|
} = require("./linux-sandbox.js");
|
|
49
47
|
|
|
50
|
-
//
|
|
51
|
-
//
|
|
52
|
-
//
|
|
53
|
-
//
|
|
48
|
+
// Fetch BEFORE the platform guard, because the build needs the runtime on
|
|
49
|
+
// every platform and this is the only hook that runs on a plain
|
|
50
|
+
// `pnpm install`. The installer is silent here on purpose: the download
|
|
51
|
+
// prints a progress bar that would otherwise appear twice in one install,
|
|
52
|
+
// once from us and once from npm's own run of the same script.
|
|
54
53
|
const packageRoot = path.join(__dirname, "..");
|
|
55
|
-
|
|
54
|
+
const distReady = ensureElectronDist(packageRoot);
|
|
55
|
+
|
|
56
|
+
// Silence is the contract on non-Linux: the helper is a Linux-only artifact,
|
|
57
|
+
// so with the runtime in place there is nothing left to repair and nothing
|
|
58
|
+
// worth printing on a Mac.
|
|
59
|
+
//
|
|
60
|
+
// LOCAL_OPERATOR_UI_FORCE_POSTINSTALL exists so the test suite can reach the
|
|
61
|
+
// repair path on a macOS developer machine and on CI's ubuntu runner alike.
|
|
62
|
+
// Without it the only assertion this script's test could make on darwin was
|
|
63
|
+
// "exit 0", which it satisfies by returning here before doing anything -- a
|
|
64
|
+
// vacuous test that passed while the whole body was mutated away. It is read
|
|
65
|
+
// only, never written by us, and namespaced so it cannot be set by accident.
|
|
66
|
+
if (
|
|
67
|
+
process.platform !== "linux" &&
|
|
68
|
+
process.env.LOCAL_OPERATOR_UI_FORCE_POSTINSTALL !== "1"
|
|
69
|
+
) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Do NOT resolve the helper through require("electron"): that call fetches
|
|
74
|
+
// the runtime on demand when it is missing, which inside an install is a
|
|
75
|
+
// synchronous download in the wrong place. ensureElectronDist() above is the
|
|
76
|
+
// one that drives electron's installer, on purpose.
|
|
77
|
+
if (!distReady) {
|
|
56
78
|
// No Electron to repair: optional install skipped, or the download failed.
|
|
57
79
|
// The launcher reports that case with its own guidance.
|
|
58
80
|
return;
|