aegisone 1.0.57 → 1.0.59

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 (73) hide show
  1. package/README.md +4 -2
  2. package/package.json +3 -2
  3. package/scripts/predist.mjs +1 -1
  4. package/src/doctor.js +1 -1
  5. package/vendor/cli/README.md +2 -2
  6. package/vendor/cli/package.json +1 -1
  7. package/vendor/cli/src/app.js +1 -1
  8. package/vendor/cli/src/commands.js +2 -2
  9. package/vendor/cli/src/config.js +1 -1
  10. package/vendor/cli/src/panels.js +1 -1
  11. package/vendor/cli/vendor/client/model-autosync.js +3 -0
  12. package/vendor/cli/vendor/client/model-sync.js +3 -0
  13. package/vendor/cli/vendor/client/prefs.js +1 -1
  14. package/vendor/cli/vendor/client/skills.js +3 -0
  15. package/vendor/cli/vendor/client/speech.js +3 -0
  16. package/vendor/cli/vendor/desktop/lib/local/engine.js +1 -1
  17. package/vendor/cli/vendor/desktop/lib/local/integrity.js +1 -1
  18. package/vendor/cli/vendor/desktop/lib/local/sandbox-appcontainer.js +6 -6
  19. package/vendor/cli/vendor/desktop/lib/local/sandbox-bwrap.js +7 -7
  20. package/vendor/cli/vendor/desktop/lib/local/sandbox.js +17 -11
  21. package/vendor/cli/vendor/desktop/main.js +406 -2
  22. package/vendor/cli/vendor/one/src/iface/pty.js +3 -0
  23. package/vendor/cli/vendor/one/src/protocol.js +3 -0
  24. package/vendor/desktop/lib/local/cli-face.js +1 -1
  25. package/vendor/desktop/lib/local/engine.js +1 -1
  26. package/vendor/desktop/lib/local/integrity.js +1 -1
  27. package/vendor/desktop/lib/local/pty-host.js +3 -0
  28. package/vendor/desktop/lib/local/sandbox-appcontainer.js +6 -6
  29. package/vendor/desktop/lib/local/sandbox-bwrap.js +7 -7
  30. package/vendor/desktop/lib/local/sandbox.js +17 -11
  31. package/vendor/desktop/lib/skills-host.js +3 -0
  32. package/vendor/desktop/lib/speech-host.js +3 -0
  33. package/vendor/desktop/lib/speech-resolve.js +3 -0
  34. package/vendor/desktop/main.js +406 -2
  35. package/vendor/desktop/package.json +4 -3
  36. package/vendor/desktop/preload.js +1 -1
  37. package/vendor/desktop/renderer/app.js +3 -3
  38. package/vendor/desktop/renderer/avatar/avatar.css +29 -1
  39. package/vendor/desktop/renderer/avatar/pane.js +1 -1
  40. package/vendor/desktop/renderer/dictation.js +3 -0
  41. package/vendor/desktop/renderer/index.html +200 -2
  42. package/vendor/desktop/renderer/pty-panel.js +3 -0
  43. package/vendor/desktop/renderer/settings-skills.js +3 -0
  44. package/vendor/desktop/renderer/style.css +230 -0
  45. package/vendor/desktop/renderer/vendor/NOTICE.md +10 -2
  46. package/vendor/desktop/renderer/vendor/xterm.css +285 -0
  47. package/vendor/desktop/renderer/vendor/xterm.js +1 -0
  48. package/vendor/desktop/vendor/faces/cli/README.md +2 -2
  49. package/vendor/desktop/vendor/faces/cli/package.json +1 -1
  50. package/vendor/desktop/vendor/faces/cli/src/app.js +1 -1
  51. package/vendor/desktop/vendor/faces/cli/src/commands.js +2 -2
  52. package/vendor/desktop/vendor/faces/cli/src/config.js +1 -1
  53. package/vendor/desktop/vendor/faces/cli/src/panels.js +1 -1
  54. package/vendor/desktop/vendor/faces/cli/vendor/client/model-autosync.js +3 -0
  55. package/vendor/desktop/vendor/faces/cli/vendor/client/model-sync.js +3 -0
  56. package/vendor/desktop/vendor/faces/cli/vendor/client/prefs.js +1 -1
  57. package/vendor/desktop/vendor/faces/cli/vendor/client/skills.js +3 -0
  58. package/vendor/desktop/vendor/faces/cli/vendor/client/speech.js +3 -0
  59. package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/engine.js +1 -1
  60. package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/integrity.js +1 -1
  61. package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/sandbox-appcontainer.js +1 -1
  62. package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/sandbox-bwrap.js +1 -1
  63. package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/sandbox.js +1 -1
  64. package/vendor/desktop/vendor/faces/cli/vendor/desktop/main.js +3 -3
  65. package/vendor/desktop/vendor/faces/cli/vendor/one/src/iface/pty.js +3 -0
  66. package/vendor/desktop/vendor/faces/cli/vendor/one/src/protocol.js +3 -0
  67. package/vendor/desktop/vendor/model-autosync.js +3 -0
  68. package/vendor/desktop/vendor/model-sync.js +3 -0
  69. package/vendor/desktop/vendor/prefs.js +1 -1
  70. package/vendor/desktop/vendor/protocol.js +3 -0
  71. package/vendor/desktop/vendor/pty.js +3 -0
  72. package/vendor/desktop/vendor/skills.js +3 -0
  73. package/vendor/desktop/vendor/speech.js +3 -0
@@ -134,7 +134,7 @@ const UNITS = Object.freeze([
134
134
  * (`tools/desktop-seal.mjs` in the source tree, `tools/obfuscate-faces.mjs`
135
135
  * after obfuscation), never by hand.
136
136
  */
137
- const SEALED = 'fc6c814a2883e78a441c3bccd268b120013bb8e93aeaf40d5bcd7dbd782408fc';
137
+ const SEALED = '5341a7c977edddc9d4a83f23912ffaa34255a95d4cba038184fc4b14a16bc86a';
138
138
 
139
139
  /**
140
140
  * Ask the question. Never throws — a check that can break the program it is
@@ -69,19 +69,19 @@ const VENDOR_REL = path.join('vendor', 'sandbox');
69
69
  * then starts the child, so the file+args shape differs. Pretending it is a
70
70
  * bwrap drop-in would make the eventual implementation a rewrite of `wrap()`.
71
71
  */
72
- function helperCandidates(appDir, env = process.env) {
72
+ function helperCandidates(appDir, env = process.env, arch = process.arch) {
73
73
  const out = [];
74
74
  if (env && env.AEGIS_SANDBOX_HOST) out.push(String(env.AEGIS_SANDBOX_HOST));
75
75
  if (appDir) {
76
- out.push(path.join(appDir, VENDOR_REL, `${process.arch}-win32`, 'aegis-sandbox-host.exe'));
76
+ out.push(path.join(appDir, VENDOR_REL, `${arch}-win32`, 'aegis-sandbox-host.exe'));
77
77
  out.push(path.join(appDir, VENDOR_REL, 'win32', 'aegis-sandbox-host.exe'));
78
78
  }
79
79
  return out;
80
80
  }
81
81
 
82
82
  /** First existing helper, or null. */
83
- function findHelper(appDir, env) {
84
- for (const c of helperCandidates(appDir, env)) {
83
+ function findHelper(appDir, env, arch = process.arch) {
84
+ for (const c of helperCandidates(appDir, env, arch)) {
85
85
  try {
86
86
  const st = fs.statSync(c);
87
87
  if (st.isFile()) return c;
@@ -108,7 +108,7 @@ function findHelper(appDir, env) {
108
108
  * If a helper appears AND a probe is supplied, this returns available. That is
109
109
  * the seam: implementation work lands in `probeHelper`, not in this contract.
110
110
  */
111
- function detect({ appDir, env = process.env, platform = process.platform, probe } = {}) {
111
+ function detect({ appDir, env = process.env, platform = process.platform, arch = process.arch, probe } = {}) {
112
112
  if (platform !== 'win32') {
113
113
  return {
114
114
  available: false,
@@ -117,7 +117,7 @@ function detect({ appDir, env = process.env, platform = process.platform, probe
117
117
  probed: false,
118
118
  };
119
119
  }
120
- const bin = findHelper(appDir, env);
120
+ const bin = findHelper(appDir, env, arch);
121
121
  if (!bin) {
122
122
  return {
123
123
  available: false,
@@ -36,7 +36,7 @@ const VENDOR_REL = path.join('vendor', 'sandbox');
36
36
  * comparison set vendors its own: a distro package can be absent, or can be a
37
37
  * version whose flags differ, and the sandbox must not vary by distro.
38
38
  */
39
- function candidates(appDir, env = process.env) {
39
+ function candidates(appDir, env = process.env, arch = process.arch) {
40
40
  const out = [];
41
41
  if (appDir) {
42
42
  // A PACKAGED appDir ends in `app.asar`, and asar is an ARCHIVE: Electron's
@@ -50,10 +50,10 @@ function candidates(appDir, env = process.env) {
50
50
  ? String(appDir).replace(/app\.asar[\\/]?$/, 'app.asar.unpacked')
51
51
  : String(appDir).replace(/app\.asar([\\/])/, 'app.asar.unpacked$1');
52
52
  if (unpacked !== appDir) {
53
- out.push(path.join(unpacked, VENDOR_REL, `${process.arch}-linux`, 'bwrap'));
53
+ out.push(path.join(unpacked, VENDOR_REL, `${arch}-linux`, 'bwrap'));
54
54
  out.push(path.join(unpacked, VENDOR_REL, 'linux', 'bwrap'));
55
55
  }
56
- out.push(path.join(appDir, VENDOR_REL, `${process.arch}-linux`, 'bwrap'));
56
+ out.push(path.join(appDir, VENDOR_REL, `${arch}-linux`, 'bwrap'));
57
57
  out.push(path.join(appDir, VENDOR_REL, 'linux', 'bwrap'));
58
58
  }
59
59
  if (env && env.AEGIS_SANDBOX_BWRAP) out.push(String(env.AEGIS_SANDBOX_BWRAP));
@@ -62,8 +62,8 @@ function candidates(appDir, env = process.env) {
62
62
  }
63
63
 
64
64
  /** First candidate that exists and is executable, or null. */
65
- function findBwrap(appDir, env) {
66
- for (const c of candidates(appDir, env)) {
65
+ function findBwrap(appDir, env, arch = process.arch) {
66
+ for (const c of candidates(appDir, env, arch)) {
67
67
  try {
68
68
  const st = fs.statSync(c);
69
69
  if (st.isFile()) {
@@ -87,11 +87,11 @@ function findBwrap(appDir, env) {
87
87
  *
88
88
  * @returns {{ available: boolean, path: string|null, reason: string|null, probed: boolean }}
89
89
  */
90
- function detect({ appDir, env = process.env, platform = process.platform, probe } = {}) {
90
+ function detect({ appDir, env = process.env, platform = process.platform, arch = process.arch, probe } = {}) {
91
91
  if (platform !== 'linux') {
92
92
  return { available: false, path: null, reason: `no linux mechanism on ${platform}`, probed: false };
93
93
  }
94
- const bin = findBwrap(appDir, env);
94
+ const bin = findBwrap(appDir, env, arch);
95
95
  if (!bin) {
96
96
  return { available: false, path: null, reason: 'bwrap not found', probed: false };
97
97
  }
@@ -105,7 +105,7 @@ function supported(platform = process.platform) {
105
105
  *
106
106
  * @returns {{ available: boolean, path: string|null, reason: string|null, probed: boolean }}
107
107
  */
108
- function detect({ appDir, env = process.env, platform = process.platform, probe } = {}) {
108
+ function detect({ appDir, env = process.env, platform = process.platform, arch = process.arch, probe } = {}) {
109
109
  const mod = mechanism(platform);
110
110
  if (!mod) {
111
111
  return {
@@ -118,7 +118,7 @@ function detect({ appDir, env = process.env, platform = process.platform, probe
118
118
  // A module that exists but is unimplemented still owns the REASON string —
119
119
  // it knows why it cannot confine, and duplicating that sentence here would
120
120
  // let the two drift apart.
121
- return mod.detect({ appDir, env, platform, probe });
121
+ return mod.detect({ appDir, env, platform, arch, probe });
122
122
  }
123
123
 
124
124
  /**
@@ -143,8 +143,14 @@ function detect({ appDir, env = process.env, platform = process.platform, probe
143
143
  */
144
144
  const probeCache = new Map();
145
145
 
146
- function cacheKey(appDir, platform) {
147
- return `${platform}\u0000${appDir ? path.resolve(String(appDir)) : ''}`;
146
+ function cacheKey(appDir, platform, arch = process.arch) {
147
+ // ARCH IS PART OF THE KEY, not just the platform. The vendored binary resolves
148
+ // through a path that names the architecture (`sandbox/<arch>-linux/bwrap`), so
149
+ // an x64 answer memoised for one appDir would be served to an arm64 question
150
+ // about the same appDir — a cache that answers a question it was never asked.
151
+ // It is threaded as a parameter for the same reason `platform` is: a branch
152
+ // that reads `process.arch` directly cannot be exercised on one host.
153
+ return `${platform}\u0000${arch}\u0000${appDir ? path.resolve(String(appDir)) : ''}`;
148
154
  }
149
155
 
150
156
  /**
@@ -152,12 +158,12 @@ function cacheKey(appDir, platform) {
152
158
  *
153
159
  * @returns {{ available: boolean, path: string|null, reason: string|null, probed: boolean, cached?: boolean }}
154
160
  */
155
- function detectCached({ appDir, env = process.env, platform = process.platform, probe } = {}) {
161
+ function detectCached({ appDir, env = process.env, platform = process.platform, arch = process.arch, probe } = {}) {
156
162
  // An injected probe is a TEST seam: caching it would make the stub's second
157
163
  // answer depend on the first, so it always runs live and never touches the
158
164
  // cache. Same reasoning for any non-default env.
159
- if (typeof probe === 'function') return detect({ appDir, env, platform, probe });
160
- const key = cacheKey(appDir, platform);
165
+ if (typeof probe === 'function') return detect({ appDir, env, platform, arch, probe });
166
+ const key = cacheKey(appDir, platform, arch);
161
167
  const hit = probeCache.get(key);
162
168
  if (hit && hit.env === env) {
163
169
  // vouch for the binary still being the one that was probed
@@ -170,7 +176,7 @@ function detectCached({ appDir, env = process.env, platform = process.platform,
170
176
  if (same) return { ...hit.state, cached: true };
171
177
  probeCache.delete(key);
172
178
  }
173
- const state = detect({ appDir, env, platform });
179
+ const state = detect({ appDir, env, platform, arch });
174
180
  let mtimeMs = null;
175
181
  if (state.path) {
176
182
  try {
@@ -184,9 +190,9 @@ function detectCached({ appDir, env = process.env, platform = process.platform,
184
190
  }
185
191
 
186
192
  /** Drop a memoised probe. Called when a policy save could change the answer. */
187
- function invalidateProbe(appDir, platform = process.platform) {
193
+ function invalidateProbe(appDir, platform = process.platform, arch = process.arch) {
188
194
  if (appDir === undefined) return probeCache.clear();
189
- return probeCache.delete(cacheKey(appDir, platform));
195
+ return probeCache.delete(cacheKey(appDir, platform, arch));
190
196
  }
191
197
 
192
198
  /**
@@ -412,7 +418,7 @@ function spawnPlan(cfg, cmd, args, opts = {}) {
412
418
  return { ok: true, file: cmd, args: args.slice(), degraded: null };
413
419
  }
414
420
 
415
- const state = cfg.state || detect({ appDir: cfg.appDir, env: cfg.env, platform: cfg.platform });
421
+ const state = cfg.state || detect({ appDir: cfg.appDir, env: cfg.env, platform: cfg.platform, arch: cfg.arch });
416
422
  if (!state.available) {
417
423
  if (strict) return { ok: false, reason: describe(state, policy) };
418
424
  return { ok: true, file: cmd, args: args.slice(), degraded: describe(state, policy) };