fraim-hub 2.0.250 → 2.0.251

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.
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.certPaths = certPaths;
6
7
  exports.loadOrCreateCert = loadOrCreateCert;
7
8
  exports.trustCert = trustCert;
8
9
  const fs_1 = __importDefault(require("fs"));
@@ -40,27 +41,24 @@ async function loadOrCreateCert() {
40
41
  fs_1.default.mkdirSync(path_1.default.dirname(keyPath), { recursive: true });
41
42
  fs_1.default.writeFileSync(keyPath, pem.private, { mode: 0o600 });
42
43
  fs_1.default.writeFileSync(certPath, pem.cert, { mode: 0o644 });
43
- // NOTE: we deliberately do NOT install this into the OS trusted-root store here.
44
- // Desktop Word/PowerPoint reach the pane over plain HTTP loopback and need no cert.
45
- // Trusting a root CA triggers a Windows security popup on every add/remove and is
46
- // invasive, so it is reserved for explicit Word-Online opt-in via trustCert() below.
44
+ // The caller decides when to trust this certificate. Word Online requires the
45
+ // HTTPS loopback certificate to be trusted before it can render the task pane.
47
46
  return { key: pem.private, cert: pem.cert };
48
47
  }
49
48
  /**
50
49
  * Installs the cert as a trusted root CA in the user's OS certificate store.
51
50
  * ONLY call this for explicit Word-Online support — it prompts a Windows security
52
- * dialog. It is idempotent: it no-ops if a matching localhost cert is already
53
- * trusted, so it never produces the delete/add popup churn.
54
- * Windows: certutil -addstore -user Root (skipped if already present)
51
+ * dialog. It never deletes certs; importing the same cert is idempotent in the
52
+ * user root store and also repairs stale installs when the cached cert changed.
53
+ * Windows: certutil -addstore -user Root
55
54
  * macOS: security add-trusted-cert -r trustRoot -k login.keychain
56
55
  */
57
56
  function trustCert(certPath) {
58
57
  if (process.platform === 'win32') {
59
- // Skip if a localhost cert is already trusted avoids the confirmation popup.
60
- const check = (0, child_process_1.spawnSync)('certutil', ['-user', '-store', 'Root', 'localhost'], { encoding: 'utf8' });
61
- if (check.status === 0 && /localhost/i.test(check.stdout))
62
- return;
63
- (0, child_process_1.spawnSync)('certutil', ['-addstore', '-user', 'Root', certPath], { stdio: 'ignore' });
58
+ const result = (0, child_process_1.spawnSync)('certutil', ['-addstore', '-user', 'Root', certPath], { encoding: 'utf8' });
59
+ if (result.status !== 0) {
60
+ console.warn('[fraim] could not trust localhost certificate:', result.stderr || result.stdout);
61
+ }
64
62
  return;
65
63
  }
66
64
  if (process.platform === 'darwin') {
@@ -326,6 +326,12 @@ async function launchDesktopShell(options) {
326
326
  // Generate (or load cached) self-signed cert for HTTPS.
327
327
  // Fast on subsequent launches (file read); ~200ms on first launch (key gen).
328
328
  const certBundle = await (0, cert_store_1.loadOrCreateCert)();
329
+ try {
330
+ (0, cert_store_1.trustCert)((0, cert_store_1.certPaths)().certPath);
331
+ }
332
+ catch (err) {
333
+ console.warn('[fraim] could not trust localhost certificate:', err);
334
+ }
329
335
  server = new server_1.AiHubServer({
330
336
  ...(options.projectPath ? { projectPath: options.projectPath } : {}),
331
337
  // Issue #701: no local DB. Persona/manager-team state resolves through the hosted
@@ -63,7 +63,7 @@ function generatedManifestPath(entry, userDataDir) {
63
63
  return path_1.default.join(userDataDir, 'office-manifests', entry.guid, 'manifest.xml');
64
64
  }
65
65
  function manifestXmlForPort(xml, httpPort) {
66
- return xml.replace(/https?:\/\/(?:localhost|127\.0\.0\.1):43091/g, `http://127.0.0.1:${httpPort}`);
66
+ return xml.replace(/https?:\/\/(?:localhost|127\.0\.0\.1):(43091|43092)/g, `http://127.0.0.1:${httpPort}`);
67
67
  }
68
68
  function shouldSkipSideloadForFlag(existingFlag, expectedFlag, sideloaded) {
69
69
  return existingFlag?.trim() === expectedFlag && sideloaded;
@@ -9,8 +9,8 @@
9
9
  <DefaultLocale>en-US</DefaultLocale>
10
10
  <DisplayName DefaultValue="FRAIM"/>
11
11
  <Description DefaultValue="AI Hub for your document - legal, product, engineering, and more in one task pane."/>
12
- <IconUrl DefaultValue="http://127.0.0.1:43091/word-taskpane/icon-64.png"/>
13
- <HighResolutionIconUrl DefaultValue="http://127.0.0.1:43091/word-taskpane/icon-64.png"/>
12
+ <IconUrl DefaultValue="https://localhost:43092/word-taskpane/icon-64.png"/>
13
+ <HighResolutionIconUrl DefaultValue="https://localhost:43092/word-taskpane/icon-64.png"/>
14
14
  <AppDomains>
15
15
  <AppDomain>https://appsforoffice.microsoft.com</AppDomain>
16
16
  </AppDomains>
@@ -26,7 +26,7 @@
26
26
  </Requirements>
27
27
 
28
28
  <DefaultSettings>
29
- <SourceLocation DefaultValue="http://127.0.0.1:43091/word-taskpane/"/>
29
+ <SourceLocation DefaultValue="https://localhost:43092/word-taskpane/"/>
30
30
  </DefaultSettings>
31
31
 
32
32
  <Permissions>ReadWriteDocument</Permissions>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fraim-hub",
3
- "version": "2.0.250",
3
+ "version": "2.0.251",
4
4
  "description": "FRAIM Hub local companion package.",
5
5
  "bin": {
6
6
  "fraim-hub": "bin/fraim-hub.js",
@@ -163,7 +163,7 @@
163
163
  "electron": "^41.2.2",
164
164
  "electron-updater": "^6.8.9",
165
165
  "express": "^5.2.1",
166
- "fraim": "2.0.250",
166
+ "fraim": "2.0.251",
167
167
  "mongodb": "^7.0.0",
168
168
  "node-cron": "4.2.1",
169
169
  "node-edge-tts": "^1.2.10",