local-operator-ui 0.15.0 → 0.15.2
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/linux-sandbox.js +471 -0
- package/bin/local-operator-ui.js +161 -4
- package/bin/postinstall.js +120 -0
- package/out/main/index.js +5841 -2
- package/out/preload/index.js +256 -2
- package/out/renderer/assets/{_basePickBy-DXhUAd_N.js → _basePickBy-CefSvQ3Q.js} +1 -1
- package/out/renderer/assets/{_baseUniq-DlFVQAlu.js → _baseUniq-DlDqTbuA.js} +1 -1
- package/out/renderer/assets/{agent-details-page-B9eWi49z.js → agent-details-page-BCuUg55n.js} +1 -1
- package/out/renderer/assets/{agent-hub-page-CqX3bQfI.js → agent-hub-page-BqCCuxo-.js} +1 -1
- package/out/renderer/assets/{agents-page-DAI9VoAM.js → agents-page-DG4vCZu3.js} +1 -1
- package/out/renderer/assets/{architectureDiagram-IEHRJDOE-CPNfOdG0.js → architectureDiagram-IEHRJDOE-CUlo4ACF.js} +1 -1
- package/out/renderer/assets/{blockDiagram-JOT3LUYC-XC3eF9cF.js → blockDiagram-JOT3LUYC-nU3IOM88.js} +1 -1
- package/out/renderer/assets/{c4Diagram-VJAJSXHY-CUuxmLz_.js → c4Diagram-VJAJSXHY-MT0nxa4-.js} +1 -1
- package/out/renderer/assets/channel-CCadi6VR.js +1 -0
- package/out/renderer/assets/{chunk-4BMEZGHF-BCDjRz7B.js → chunk-4BMEZGHF-CXkPsNEi.js} +1 -1
- package/out/renderer/assets/{chunk-A2AXSNBT-BGk_fc2X.js → chunk-A2AXSNBT-DiTT6jkA.js} +1 -1
- package/out/renderer/assets/{chunk-AEK57VVT-P169lUDF.js → chunk-AEK57VVT-CIZ7-t01.js} +1 -1
- package/out/renderer/assets/{chunk-D6G4REZN-BgWFLC2Y.js → chunk-D6G4REZN-BIKuFzEX.js} +1 -1
- package/out/renderer/assets/{chunk-RZ5BOZE2-DRcbmOqb.js → chunk-RZ5BOZE2-byZRPh67.js} +1 -1
- package/out/renderer/assets/{chunk-XZIHB7SX-CQ1CDaSL.js → chunk-XZIHB7SX-BM-t-ERh.js} +1 -1
- package/out/renderer/assets/{classDiagram-GIVACNV2-CWVPF1fq.js → classDiagram-GIVACNV2-Bkvtrmw4.js} +1 -1
- package/out/renderer/assets/{classDiagram-v2-COTLJTTW-CWVPF1fq.js → classDiagram-v2-COTLJTTW-Bkvtrmw4.js} +1 -1
- package/out/renderer/assets/clone-DTDvO4Il.js +1 -0
- package/out/renderer/assets/{dagre-OKDRZEBW-DcplU9Tr.js → dagre-OKDRZEBW-DU9huU8P.js} +1 -1
- package/out/renderer/assets/{diagram-SSKATNLV-D7nIUHT6.js → diagram-SSKATNLV-C6KmXMQc.js} +1 -1
- package/out/renderer/assets/{diagram-VNBRO52H-CtHW_VR1.js → diagram-VNBRO52H-B2c-8R3S.js} +1 -1
- package/out/renderer/assets/{erDiagram-Q7BY3M3F-CS8LKTSQ.js → erDiagram-Q7BY3M3F-D6QA70K4.js} +1 -1
- package/out/renderer/assets/{flowDiagram-4HSFHLVR-HiiezFeW.js → flowDiagram-4HSFHLVR-Dk0lRNK2.js} +1 -1
- package/out/renderer/assets/{ganttDiagram-APWFNJXF-CmEaG9j5.js → ganttDiagram-APWFNJXF-BevHed3v.js} +1 -1
- package/out/renderer/assets/{gitGraphDiagram-7IBYFJ6S-CnTFE1Co.js → gitGraphDiagram-7IBYFJ6S-CmOfsj5i.js} +1 -1
- package/out/renderer/assets/{graph-5nnrkuoT.js → graph-CUJVKfm_.js} +1 -1
- package/out/renderer/assets/{index-C41a-6TC.js → index-8mt-yi7u.js} +1 -1
- package/out/renderer/assets/{index-CX5wIjGn.js → index-DZnGa8Vt.js} +305 -305
- package/out/renderer/assets/{index-CGBtWp01.js → index-Eh3n7DJx.js} +1 -1
- package/out/renderer/assets/{infoDiagram-PH2N3AL5-bex3c04p.js → infoDiagram-PH2N3AL5-DWdIO3pN.js} +1 -1
- package/out/renderer/assets/{journeyDiagram-U35MCT3I-BmT6ciaL.js → journeyDiagram-U35MCT3I-BNOCDq91.js} +1 -1
- package/out/renderer/assets/{kanban-definition-NDS4AKOZ-DFCmhsUw.js → kanban-definition-NDS4AKOZ-CIVzZzmM.js} +1 -1
- package/out/renderer/assets/{layout-BAUNLEuC.js → layout-zNSVRDKv.js} +1 -1
- package/out/renderer/assets/{mermaid.core-B-DXhPjH.js → mermaid.core-CFY9BM3R.js} +5 -5
- package/out/renderer/assets/{mindmap-definition-ALO5MXBD-DsHfZO-y.js → mindmap-definition-ALO5MXBD-yS5L1WQ2.js} +1 -1
- package/out/renderer/assets/{parseISO-B2aAC4oP.js → parseISO-DIyaQXAe.js} +1 -1
- package/out/renderer/assets/{pieDiagram-IB7DONF6-BsZzfife.js → pieDiagram-IB7DONF6-BPWYAs8_.js} +1 -1
- package/out/renderer/assets/{quadrantDiagram-7GDLP6J5-BHdQ3IkD.js → quadrantDiagram-7GDLP6J5-B82PFOoq.js} +1 -1
- package/out/renderer/assets/{radar-MK3ICKWK-Bj1MqFqI.js → radar-MK3ICKWK-Z4U7o29x.js} +1 -1
- package/out/renderer/assets/{requirementDiagram-KVF5MWMF-D3CbLNoW.js → requirementDiagram-KVF5MWMF-BwhazqTR.js} +1 -1
- package/out/renderer/assets/{sankeyDiagram-QLVOVGJD-yPjPHebO.js → sankeyDiagram-QLVOVGJD-Cg4M6UvE.js} +1 -1
- package/out/renderer/assets/{schedules-page-CzDl4gcX.js → schedules-page-ChiypWrp.js} +1 -1
- package/out/renderer/assets/{sequenceDiagram-X6HHIX6F-xox5xT20.js → sequenceDiagram-X6HHIX6F-hTniLZHQ.js} +1 -1
- package/out/renderer/assets/{settings-page-D6tm6mvY.js → settings-page-CKzoAptg.js} +59 -59
- package/out/renderer/assets/{stateDiagram-DGXRK772-xh_3dJO8.js → stateDiagram-DGXRK772-DI0pBdbL.js} +1 -1
- package/out/renderer/assets/{stateDiagram-v2-YXO3MK2T-DBCN6hzC.js → stateDiagram-v2-YXO3MK2T-CG5hsBHO.js} +1 -1
- package/out/renderer/assets/{timeline-definition-BDJGKUSR-B_4Brszy.js → timeline-definition-BDJGKUSR-t0KbQhGu.js} +1 -1
- package/out/renderer/assets/{use-agent-like-mutation-aWi_aykU.js → use-agent-like-mutation-C_nJtNuz.js} +1 -1
- package/out/renderer/assets/{xychartDiagram-VJFVF3MP-CICcYxti.js → xychartDiagram-VJFVF3MP-BQjVqv5u.js} +1 -1
- package/out/renderer/index.html +1 -1
- package/package.json +17 -8
- package/out/main/bytecode-loader.cjs +0 -72
- package/out/main/index.jsc +0 -0
- package/out/preload/bytecode-loader.cjs +0 -72
- package/out/preload/index.jsc +0 -0
- package/out/renderer/assets/channel-CnDziUjq.js +0 -1
- package/out/renderer/assets/clone-D4Nmu6t-.js +0 -1
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Restore the setuid bit on Electron's chrome-sandbox helper after install.
|
|
5
|
+
*
|
|
6
|
+
* npm strips setuid bits from package contents by design, so the helper lands
|
|
7
|
+
* root:root 0755 and Chromium aborts for a non-root user (issue #91). We fix it
|
|
8
|
+
* here because `sudo npm install -g` — the ordinary way to install a global CLI
|
|
9
|
+
* — runs this script as root, which is the one moment in the lifecycle where we
|
|
10
|
+
* hold the privilege the fix needs.
|
|
11
|
+
*
|
|
12
|
+
* THIS SCRIPT MUST NEVER FAIL THE INSTALL. An unprivileged `npm install -g`
|
|
13
|
+
* (prefix in $HOME), a container without CAP_CHOWN, macOS and Windows where the
|
|
14
|
+
* helper does not exist, and an install where the optional Electron download was
|
|
15
|
+
* skipped are all normal situations in which the repair cannot happen. Leaving
|
|
16
|
+
* the user with no package at all would be a worse defect than the one being
|
|
17
|
+
* fixed, so every failure path exits 0. Where the repair does not happen, the
|
|
18
|
+
* launcher's post-mortem guidance (bin/local-operator-ui.js) covers it with the
|
|
19
|
+
* exact commands.
|
|
20
|
+
*
|
|
21
|
+
* It is quiet on success for the same reason npm scripts generally are: the
|
|
22
|
+
* common case is a working install and noise there trains people to ignore it.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
const process = require("node:process");
|
|
26
|
+
|
|
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
|
+
const main = () => {
|
|
44
|
+
const path = require("node:path");
|
|
45
|
+
const {
|
|
46
|
+
ensureElectronDist,
|
|
47
|
+
repairSandboxHelper,
|
|
48
|
+
} = require("./linux-sandbox.js");
|
|
49
|
+
|
|
50
|
+
// Do NOT resolve the helper through require("electron"). npm runs this script
|
|
51
|
+
// BEFORE electron's own postinstall downloads dist/, so at this point that
|
|
52
|
+
// call throws and the helper does not exist yet. ensureElectronDist() drives
|
|
53
|
+
// electron's installer first; see the long note on it for the measurements.
|
|
54
|
+
const packageRoot = path.join(__dirname, "..");
|
|
55
|
+
if (!ensureElectronDist(packageRoot)) {
|
|
56
|
+
// No Electron to repair: optional install skipped, or the download failed.
|
|
57
|
+
// The launcher reports that case with its own guidance.
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const helper = path.join(
|
|
62
|
+
packageRoot,
|
|
63
|
+
"node_modules",
|
|
64
|
+
"electron",
|
|
65
|
+
"dist",
|
|
66
|
+
"chrome-sandbox",
|
|
67
|
+
);
|
|
68
|
+
const result = repairSandboxHelper(helper);
|
|
69
|
+
|
|
70
|
+
if (result.outcome === "unsafe") {
|
|
71
|
+
// The helper path is a symlink or not a regular file. We refuse to chown
|
|
72
|
+
// and chmod 4755 through it as root -- that would apply the setuid bit to
|
|
73
|
+
// whatever the link points at (see the O_NOFOLLOW note in linux-sandbox.js).
|
|
74
|
+
// Say so loudly: this is not a normal install state, and it is the one case
|
|
75
|
+
// here that warrants suspicion rather than a shrug.
|
|
76
|
+
console.log(
|
|
77
|
+
"local-operator-ui: refusing to modify the Chromium sandbox helper" +
|
|
78
|
+
" because it is not a regular file (possible symlink). Nothing was" +
|
|
79
|
+
" changed. Please report this.",
|
|
80
|
+
);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (result.outcome === "not-permitted") {
|
|
85
|
+
// Distinguish the two ways this branch is reached. An unprivileged install
|
|
86
|
+
// genuinely cannot chown, and that is expected. Reaching it AS ROOT means
|
|
87
|
+
// the repair itself is broken -- which is exactly what a chmod-before-chown
|
|
88
|
+
// ordering bug produces, since chown clears the setuid bit again -- and
|
|
89
|
+
// reporting that as "not running as root" would send the reader to
|
|
90
|
+
// diagnose their permissions instead of our code.
|
|
91
|
+
const asRoot =
|
|
92
|
+
typeof process.getuid === "function" && process.getuid() === 0;
|
|
93
|
+
if (asRoot) {
|
|
94
|
+
console.log(
|
|
95
|
+
"local-operator-ui: the Chromium sandbox helper is still not setuid" +
|
|
96
|
+
" after running as root; this is a packaging defect, please report it.",
|
|
97
|
+
);
|
|
98
|
+
} else {
|
|
99
|
+
console.log(
|
|
100
|
+
"local-operator-ui: could not set the Chromium sandbox helper setuid" +
|
|
101
|
+
" (this install is not running as root).",
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
console.log(
|
|
105
|
+
"If the app fails to start on Linux, it will print the exact commands to fix it.",
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
try {
|
|
111
|
+
main();
|
|
112
|
+
} catch (err) {
|
|
113
|
+
// Defensive: nothing above is expected to throw, and if something does the
|
|
114
|
+
// install must still succeed. See the header.
|
|
115
|
+
console.log(
|
|
116
|
+
`local-operator-ui: skipped the Chromium sandbox check (${err.message}).`,
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
process.exit(0);
|