fraim-hub 2.0.252 → 2.0.254

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.
@@ -99,17 +99,21 @@ function configureAutoUpdater() {
99
99
  // ---------------------------------------------------------------------------
100
100
  // Word manifest sideload (runs once on first launch)
101
101
  // ---------------------------------------------------------------------------
102
- function ensureWordSideload(projectPath, httpPort) {
102
+ function ensureWordSideload(projectPath, httpsPort) {
103
103
  // Flag version bump: bump this string when new manifests are added so all
104
104
  // users get re-sideloaded on their next launch.
105
- const FLAG_VERSION = 'v4-dynamic-port';
106
- const expectedFlag = `${FLAG_VERSION}:${httpPort}`;
105
+ const FLAG_VERSION = 'v5-https-port';
106
+ const expectedFlag = `${FLAG_VERSION}:${httpsPort}`;
107
107
  const flagPath = path_1.default.join(electron_1.app.getPath('userData'), 'word-sideloaded.flag');
108
108
  const existingFlag = fs_1.default.existsSync(flagPath) ? fs_1.default.readFileSync(flagPath, 'utf8') : null;
109
109
  if ((0, office_sideload_1.shouldSkipSideloadForFlag)(existingFlag, expectedFlag, (0, office_sideload_1.isSideloaded)()))
110
110
  return;
111
- if (httpPort > 0) {
112
- const result = (0, office_sideload_1.sideloadManifest)(projectPath, { httpPort, userDataDir: electron_1.app.getPath('userData') });
111
+ if (httpsPort > 0) {
112
+ const result = (0, office_sideload_1.sideloadManifest)(projectPath, {
113
+ webPort: httpsPort,
114
+ webProtocol: 'https',
115
+ userDataDir: electron_1.app.getPath('userData'),
116
+ });
113
117
  if (!result.ok) {
114
118
  console.warn('[fraim] Office sideload skipped:', result.reason);
115
119
  return; // don't write flag — retry next launch
@@ -362,7 +366,7 @@ async function launchDesktopShell(options) {
362
366
  catch (err) {
363
367
  console.warn('[fraim] could not write hub runtime file:', err);
364
368
  }
365
- ensureWordSideload(resolvedProjectPath, httpPort);
369
+ ensureWordSideload(resolvedProjectPath, httpsPort);
366
370
  const hubUrl = `http://127.0.0.1:${httpPort}/ai-hub/`;
367
371
  createTray(hubUrl, runtimeId);
368
372
  await createWindow(hubUrl, runtimeId);
@@ -62,18 +62,20 @@ function macWefPath(container, guid) {
62
62
  function generatedManifestPath(entry, userDataDir) {
63
63
  return path_1.default.join(userDataDir, 'office-manifests', entry.guid, 'manifest.xml');
64
64
  }
65
- function manifestXmlForPort(xml, httpPort) {
66
- return xml.replace(/https?:\/\/(?:localhost|127\.0\.0\.1):(43091|43092)/g, `http://127.0.0.1:${httpPort}`);
65
+ function manifestXmlForPort(xml, webPort, protocol = 'https') {
66
+ return xml.replace(/https?:\/\/(?:localhost|127\.0\.0\.1):(43091|43092)/g, `${protocol}://127.0.0.1:${webPort}`);
67
67
  }
68
68
  function shouldSkipSideloadForFlag(existingFlag, expectedFlag, sideloaded) {
69
69
  return existingFlag?.trim() === expectedFlag && sideloaded;
70
70
  }
71
71
  function prepareManifestForSideload(entry, sourcePath, options) {
72
- if (!options.httpPort)
72
+ const webPort = options.webPort ?? options.httpPort;
73
+ if (!webPort)
73
74
  return sourcePath;
75
+ const webProtocol = options.webProtocol ?? 'https';
74
76
  const userDataDir = options.userDataDir || path_1.default.join(os_1.default.homedir(), '.fraim');
75
77
  const dest = generatedManifestPath(entry, userDataDir);
76
- const rendered = manifestXmlForPort(fs_1.default.readFileSync(sourcePath, 'utf8'), options.httpPort);
78
+ const rendered = manifestXmlForPort(fs_1.default.readFileSync(sourcePath, 'utf8'), webPort, webProtocol);
77
79
  fs_1.default.mkdirSync(path_1.default.dirname(dest), { recursive: true });
78
80
  fs_1.default.writeFileSync(dest, rendered, { encoding: 'utf8' });
79
81
  return dest;
@@ -106,20 +108,27 @@ function winRegisteredDefaultValue(guid) {
106
108
  return parseRegSzValue(r.stdout);
107
109
  }
108
110
  function winRegisteredValue(guid) {
109
- // Word resolves the braced GUID subkey. Prefer it even when a legacy root
110
- // value exists, so a stale effective registration cannot be hidden.
111
- return winRegisteredDefaultValue(guid) ?? winRegisteredRootValue(guid);
111
+ // Word's Developer Add-ins list resolves the named value directly under
112
+ // WEF\Developer. Keep the braced subkey for debugger/tooling compatibility,
113
+ // but treat the root value as the effective discovery registration.
114
+ return winRegisteredRootValue(guid) ?? winRegisteredDefaultValue(guid);
112
115
  }
113
116
  function winWriteRegisteredValue(guid, manifestPath) {
117
+ const root = (0, child_process_1.spawnSync)('reg', [
118
+ 'add', WEF_DEVELOPER_KEY,
119
+ '/v', guid, '/t', 'REG_SZ', '/d', manifestPath, '/f',
120
+ ], { encoding: 'utf8' });
121
+ if (root.status !== 0)
122
+ return { ok: false, reason: root.stderr || `reg add failed for ${guid}` };
114
123
  const r = (0, child_process_1.spawnSync)('reg', [
115
124
  'add', winDeveloperManifestSubkey(guid),
116
125
  '/ve', '/t', 'REG_SZ', '/d', manifestPath, '/f',
117
126
  ], { encoding: 'utf8' });
118
127
  if (r.status !== 0)
119
128
  return { ok: false, reason: r.stderr || `reg add failed for ${guid}` };
120
- // Remove the older root-value registration if present. Office does not need
121
- // it, and keeping two registration shapes makes stale-state diagnosis harder.
122
- (0, child_process_1.spawnSync)('reg', ['delete', WEF_DEVELOPER_KEY, '/v', guid, '/f'], { encoding: 'utf8' });
129
+ // Remove an accidental unbraced subkey left by older debugger settings. This
130
+ // is different from the root named value above, which Word needs.
131
+ (0, child_process_1.spawnSync)('reg', ['delete', `${WEF_DEVELOPER_KEY}\\${guid}`, '/f'], { encoding: 'utf8' });
123
132
  return { ok: true };
124
133
  }
125
134
  // ---------------------------------------------------------------------------
@@ -178,6 +187,7 @@ function removeSideload() {
178
187
  for (const entry of MANIFESTS) {
179
188
  if (process.platform === 'win32') {
180
189
  (0, child_process_1.spawnSync)('reg', ['delete', WEF_DEVELOPER_KEY, '/v', entry.guid, '/f'], { encoding: 'utf8' });
190
+ (0, child_process_1.spawnSync)('reg', ['delete', `${WEF_DEVELOPER_KEY}\\${entry.guid}`, '/f'], { encoding: 'utf8' });
181
191
  (0, child_process_1.spawnSync)('reg', ['delete', winDeveloperManifestSubkey(entry.guid), '/f'], { encoding: 'utf8' });
182
192
  }
183
193
  else if (process.platform === 'darwin') {
@@ -4,7 +4,7 @@
4
4
  xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
5
5
  xsi:type="TaskPaneApp">
6
6
  <Id>d1090951-50cf-4cf2-9d12-b0f8541d265c</Id>
7
- <Version>1.0.0.0</Version>
7
+ <Version>1.0.1.0</Version>
8
8
  <ProviderName>FRAIM</ProviderName>
9
9
  <DefaultLocale>en-US</DefaultLocale>
10
10
  <DisplayName DefaultValue="FRAIM"/>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fraim-hub",
3
- "version": "2.0.252",
3
+ "version": "2.0.254",
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.252",
166
+ "fraim": "2.0.254",
167
167
  "mongodb": "^7.0.0",
168
168
  "node-cron": "4.2.1",
169
169
  "node-edge-tts": "^1.2.10",