brosh 0.2.2 → 0.2.3

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 (42) hide show
  1. package/README.github.md +169 -0
  2. package/README.md +18 -141
  3. package/README.npm.md +58 -0
  4. package/dist/lib.d.ts +1 -1
  5. package/dist/lib.d.ts.map +1 -1
  6. package/dist/lib.js +1 -1
  7. package/dist/lib.js.map +1 -1
  8. package/dist/terminal/index.d.ts +1 -1
  9. package/dist/terminal/index.d.ts.map +1 -1
  10. package/dist/terminal/index.js +1 -1
  11. package/dist/terminal/index.js.map +1 -1
  12. package/dist/terminal/session.d.ts +14 -1
  13. package/dist/terminal/session.d.ts.map +1 -1
  14. package/dist/terminal/session.js +263 -78
  15. package/dist/terminal/session.js.map +1 -1
  16. package/package.json +7 -4
  17. package/packages/desktop-electron/build/afterInstall-linux.sh +4 -0
  18. package/packages/desktop-electron/build/afterPack.cjs +29 -19
  19. package/packages/desktop-electron/build/entitlements.mac.inherit.plist +14 -0
  20. package/packages/desktop-electron/build/entitlements.mac.plist +16 -0
  21. package/packages/desktop-electron/package-lock.json +666 -165
  22. package/packages/desktop-electron/package.json +53 -14
  23. package/packages/desktop-electron/scripts/bundle-main.mjs +97 -0
  24. package/packages/desktop-electron/scripts/bytecode-compiler.cjs +3 -0
  25. package/packages/desktop-electron/scripts/fix-dev-entitlements.js +56 -0
  26. package/packages/desktop-electron/vite.config.ts +13 -0
  27. package/packaging/aur/.SRCINFO +20 -0
  28. package/packaging/aur/PKGBUILD +26 -0
  29. package/vendor/xterm-headless-5.5.0.tgz +0 -0
  30. package/vendor/xterm-xterm-5.5.0.tgz +0 -0
  31. package/website/CNAME +1 -0
  32. package/website/assets/images/.gitkeep +0 -0
  33. package/website/assets/videos/.gitkeep +0 -0
  34. package/website/css/styles.css +735 -0
  35. package/website/gpg.key +37 -0
  36. package/website/index.html +314 -0
  37. package/website/install.sh.asc +16 -0
  38. package/website/js/main.js +293 -0
  39. package/website/rpm/brosh.repo +6 -0
  40. package/website/uninstall.sh +10 -0
  41. package/packages/desktop-electron/tests/main/error-triage/buildTriagePrompt.test.ts +0 -133
  42. package/packages/desktop-electron/tests/main/error-triage/parseTriageResponse.test.ts +0 -123
@@ -52,10 +52,20 @@ function formatMB(bytes) {
52
52
  return (bytes / 1024 / 1024).toFixed(1) + "MB";
53
53
  }
54
54
 
55
- function stripOnnxruntimeNode(resourcesDir, platform, arch) {
55
+ // With asar: false, modules are at app/node_modules/ instead of app.asar.unpacked/node_modules/
56
+ function getNodeModulesDir(resourcesDir) {
57
+ // Try asar-unpacked path first (asar: true), then loose app dir (asar: false)
58
+ const asarUnpacked = path.join(resourcesDir, "app.asar.unpacked/node_modules");
59
+ if (fs.existsSync(asarUnpacked)) return asarUnpacked;
60
+ const loose = path.join(resourcesDir, "app/node_modules");
61
+ if (fs.existsSync(loose)) return loose;
62
+ return null;
63
+ }
64
+
65
+ function stripOnnxruntimeNode(nodeModulesDir, platform, arch) {
56
66
  const onnxBinDir = path.join(
57
- resourcesDir,
58
- "app.asar.unpacked/node_modules/onnxruntime-node/bin/napi-v3"
67
+ nodeModulesDir,
68
+ "onnxruntime-node/bin/napi-v3"
59
69
  );
60
70
  if (!fs.existsSync(onnxBinDir)) return 0;
61
71
 
@@ -85,13 +95,10 @@ function stripOnnxruntimeNode(resourcesDir, platform, arch) {
85
95
  return removed;
86
96
  }
87
97
 
88
- function stripOnnxruntimeWeb(resourcesDir) {
98
+ function stripOnnxruntimeWeb(nodeModulesDir) {
89
99
  // onnxruntime-web is only needed for browser/WASM contexts.
90
100
  // We use onnxruntime-node for main process ML inference, so this is dead weight.
91
- const loc = path.join(
92
- resourcesDir,
93
- "app.asar.unpacked/node_modules/onnxruntime-web"
94
- );
101
+ const loc = path.join(nodeModulesDir, "onnxruntime-web");
95
102
  const size = dirSize(loc);
96
103
  if (rmSyncSafe(loc)) {
97
104
  console.log(` removed onnxruntime-web (${formatMB(size)})`);
@@ -100,19 +107,15 @@ function stripOnnxruntimeWeb(resourcesDir) {
100
107
  return 0;
101
108
  }
102
109
 
103
- function stripSharpPlatformModules(resourcesDir, platform, arch) {
104
- const unpackedModules = path.join(
105
- resourcesDir,
106
- "app.asar.unpacked/node_modules"
107
- );
108
- if (!fs.existsSync(unpackedModules)) return 0;
110
+ function stripSharpPlatformModules(nodeModulesDir, platform, arch) {
111
+ if (!fs.existsSync(nodeModulesDir)) return 0;
109
112
 
110
113
  const targetSuffix = `${platform}-${arch}`;
111
114
  let removed = 0;
112
115
 
113
- for (const dir of fs.readdirSync(unpackedModules)) {
116
+ for (const dir of fs.readdirSync(nodeModulesDir)) {
114
117
  if (!dir.startsWith("@img")) continue;
115
- const imgDir = path.join(unpackedModules, dir);
118
+ const imgDir = path.join(nodeModulesDir, dir);
116
119
  if (!fs.statSync(imgDir).isDirectory()) continue;
117
120
  for (const sub of fs.readdirSync(imgDir)) {
118
121
  const subPath = path.join(imgDir, sub);
@@ -137,11 +140,18 @@ exports.default = async function afterPack(context) {
137
140
  console.log(`\n afterPack: stripping binaries for ${platform}/${arch}`);
138
141
  console.log(` afterPack: resources at ${resourcesDir}`);
139
142
 
143
+ const nodeModulesDir = getNodeModulesDir(resourcesDir);
144
+ if (!nodeModulesDir) {
145
+ console.log(` afterPack: no node_modules found, skipping`);
146
+ return;
147
+ }
148
+ console.log(` afterPack: node_modules at ${nodeModulesDir}`);
149
+
140
150
  let totalSaved = 0;
141
151
 
142
- totalSaved += stripOnnxruntimeNode(resourcesDir, platform, arch);
143
- totalSaved += stripOnnxruntimeWeb(resourcesDir);
144
- totalSaved += stripSharpPlatformModules(resourcesDir, platform, arch);
152
+ totalSaved += stripOnnxruntimeNode(nodeModulesDir, platform, arch);
153
+ totalSaved += stripOnnxruntimeWeb(nodeModulesDir);
154
+ totalSaved += stripSharpPlatformModules(nodeModulesDir, platform, arch);
145
155
 
146
156
  console.log(` afterPack: total saved ${formatMB(totalSaved)}\n`);
147
157
  };
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>com.apple.security.cs.allow-jit</key>
6
+ <true/>
7
+ <key>com.apple.security.cs.allow-unsigned-executable-memory</key>
8
+ <true/>
9
+ <key>com.apple.security.cs.disable-library-validation</key>
10
+ <true/>
11
+ <key>com.apple.security.device.audio-input</key>
12
+ <true/>
13
+ </dict>
14
+ </plist>
@@ -0,0 +1,16 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>com.apple.security.cs.allow-jit</key>
6
+ <true/>
7
+ <key>com.apple.security.cs.allow-unsigned-executable-memory</key>
8
+ <true/>
9
+ <key>com.apple.security.cs.disable-library-validation</key>
10
+ <true/>
11
+ <key>com.apple.security.network.client</key>
12
+ <true/>
13
+ <key>com.apple.security.device.audio-input</key>
14
+ <true/>
15
+ </dict>
16
+ </plist>