@directivegames/genesys.sdk 3.3.7 → 3.3.9

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.
@@ -43,7 +43,7 @@ export const DEV_DEPENDENCIES = {
43
43
  '@electron/notarize': '3.1.1',
44
44
  '@modelcontextprotocol/sdk': '1.22.0',
45
45
  '@types/cors': '2.8.19',
46
- '@types/electron-store': '1.3.1',
46
+ '@types/electron-store': '3.2.2',
47
47
  '@types/express': '5.0.5',
48
48
  '@types/jsdom': '27.0.0',
49
49
  '@types/minimatch': '5.1.2',
@@ -58,7 +58,7 @@ export const DEV_DEPENDENCIES = {
58
58
  'ajv': '8.17.1',
59
59
  'concurrently': '9.2.1',
60
60
  'dotenv-cli': '8.0.0',
61
- 'electron': '39.2.3',
61
+ 'electron': '39.2.6',
62
62
  'electron-builder': '26.0.12',
63
63
  'eslint': '9.39.1',
64
64
  'eslint-plugin-import': '2.32.0',
@@ -1,8 +1,8 @@
1
+ import fs from 'fs';
1
2
  import path from 'path';
2
3
  import { fileURLToPath } from 'url';
3
- import { app, dialog, Menu } from 'electron';
4
+ import { app, dialog, Menu, session } from 'electron';
4
5
  import { BrowserWindow } from 'electron';
5
- import { installExtension, MOBX_DEVTOOLS, REACT_DEVELOPER_TOOLS } from 'electron-devtools-installer';
6
6
  import isDev from 'electron-is-dev';
7
7
  import log from 'electron-log';
8
8
  import electronUpdater from 'electron-updater';
@@ -270,13 +270,15 @@ function checkForUpdates() {
270
270
  logger.log('App update available');
271
271
  mainWindow?.webContents.send('update_available');
272
272
  });
273
- autoUpdater.on('update-downloaded', () => {
274
- logger.log('App update downloaded');
273
+ autoUpdater.on('update-downloaded', info => {
274
+ const currentVersion = app.getVersion();
275
+ logger.log(`App update downloaded: v${currentVersion} -> v${info.version}`);
275
276
  dialog.showMessageBox(mainWindow, {
276
277
  type: 'info',
277
278
  buttons: ['Restart', 'Later'],
278
279
  title: 'SDK App Update Ready',
279
- message: 'A new app version has been downloaded. Restart now to complete the update?',
280
+ message: `Update to v${info.version} is ready to install`,
281
+ detail: `Current version: v${currentVersion}\nNew version: v${info.version}\n\nRestart now to complete the update?`,
280
282
  }).then(({ response }) => {
281
283
  if (response === 0)
282
284
  autoUpdater.quitAndInstall();
@@ -287,6 +289,44 @@ function checkForUpdates() {
287
289
  });
288
290
  }
289
291
  let extensionsLoaded = false;
292
+ // Chrome Web Store extension IDs
293
+ const REACT_DEVELOPER_TOOLS_ID = 'fmkadmapgofadopljbjfkapdkoienihi';
294
+ const MOBX_DEVTOOLS_ID = 'pfgnfdagidkfgccljigdamigbcnndkod';
295
+ /** Get the path where Electron stores downloaded extensions */
296
+ function getExtensionsPath() {
297
+ return path.join(app.getPath('userData'), 'extensions');
298
+ }
299
+ /** Check if an extension is already downloaded */
300
+ function isExtensionDownloaded(extensionId) {
301
+ const extensionPath = path.join(getExtensionsPath(), extensionId);
302
+ return fs.existsSync(extensionPath);
303
+ }
304
+ /** Download extension using electron-devtools-installer (uses deprecated API but only for download) */
305
+ async function downloadExtension(extensionId, name) {
306
+ try {
307
+ // Dynamic import to avoid loading the module if not needed
308
+ const { installExtension } = await import('electron-devtools-installer');
309
+ await installExtension(extensionId);
310
+ logger.log(`🔧 Downloaded extension: ${name}`);
311
+ return path.join(getExtensionsPath(), extensionId);
312
+ }
313
+ catch (err) {
314
+ logger.log(`❌ Failed to download ${name}:`, err);
315
+ return null;
316
+ }
317
+ }
318
+ /** Load an extension using the new session.extensions API */
319
+ async function loadExtensionFromPath(extensionPath, name) {
320
+ try {
321
+ const extension = await session.defaultSession.extensions.loadExtension(extensionPath, { allowFileAccess: true });
322
+ logger.log(`🔧 Loaded extension: ${extension.name}`);
323
+ return true;
324
+ }
325
+ catch (err) {
326
+ logger.log(`❌ Failed to load ${name}:`, err);
327
+ return false;
328
+ }
329
+ }
290
330
  /** Load development extensions only once after website loads successfully */
291
331
  async function loadDevExtensions() {
292
332
  // Only load extensions in dev mode or when explicitly enabled
@@ -296,20 +336,21 @@ async function loadDevExtensions() {
296
336
  if (app.commandLine.hasSwitch('devtoolextensions') && app.commandLine.getSwitchValue('devtoolextensions') === '0') {
297
337
  return;
298
338
  }
299
- try {
300
- const reactDevTools = await installExtension(REACT_DEVELOPER_TOOLS);
301
- logger.log(`🔧 Added Extension: ${reactDevTools}`);
302
- }
303
- catch (err) {
304
- logger.log('❌ React DevTools installation failed:', err);
305
- }
306
- try {
307
- const mobxDevTools = await installExtension(MOBX_DEVTOOLS);
308
- logger.log(`🔧 Added Extension: ${mobxDevTools}`);
309
- }
310
- catch (err) {
311
- logger.log('❌ MobX DevTools installation failed:', err);
339
+ const extensions = [
340
+ { id: REACT_DEVELOPER_TOOLS_ID, name: 'React Developer Tools' },
341
+ { id: MOBX_DEVTOOLS_ID, name: 'MobX Developer Tools' },
342
+ ];
343
+ for (const ext of extensions) {
344
+ const extensionPath = path.join(getExtensionsPath(), ext.id);
345
+ // If extension is not downloaded, download it first (uses deprecated API internally)
346
+ if (!isExtensionDownloaded(ext.id)) {
347
+ const downloadedPath = await downloadExtension(ext.id, ext.name);
348
+ if (!downloadedPath)
349
+ continue;
350
+ }
351
+ // Load using new API
352
+ await loadExtensionFromPath(extensionPath, ext.name);
312
353
  }
313
354
  extensionsLoaded = true;
314
- logger.log('🔧 Extension loading completed');
355
+ logger.log('🔧 Extension loading completed.');
315
356
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@directivegames/genesys.sdk",
3
- "version": "3.3.7",
3
+ "version": "3.3.9",
4
4
  "description": "Genesys SDK - A development toolkit for game development",
5
5
  "author": "Directive Games",
6
6
  "main": "index.js",
@@ -143,7 +143,7 @@
143
143
  "@electron/notarize": "^3.1.0",
144
144
  "@modelcontextprotocol/sdk": "^1.22.0",
145
145
  "@types/cors": "^2.8.18",
146
- "@types/electron-store": "^1.3.1",
146
+ "@types/electron-store": "^3.2.2",
147
147
  "@types/express": "^5.0.2",
148
148
  "@types/jsdom": "^27.0.0",
149
149
  "@types/minimatch": "^5.1.2",
@@ -158,7 +158,7 @@
158
158
  "ajv": "^8.17.1",
159
159
  "concurrently": "^9.1.2",
160
160
  "dotenv-cli": "^8.0.0",
161
- "electron": "^39.2.3",
161
+ "electron": "^39.2.6",
162
162
  "electron-builder": "^26.0.12",
163
163
  "eslint": "^9.24.0",
164
164
  "eslint-plugin-import": "^2.31.0",
@@ -42,6 +42,14 @@
42
42
 
43
43
  ---
44
44
 
45
+ # Scene Files
46
+
47
+ **IMPORTANT:** Do **NOT** read or open genesys scene files (`*.genesys-scene`) unless the user explicitly requests it.
48
+
49
+ These scene files can be very large and consume significant tokens. They contain serialized scene data that is typically **not relevant** to programming tasks. The scene editor handles these files — you should focus on code implementation rather than scene file contents.
50
+
51
+ ---
52
+
45
53
  # Coding Rules
46
54
 
47
55
  **CRITICAL**: Never edit `auto-imports.ts` - This file is automatically generated by the build pipeline to register all @ENGINE.GameClass() decorated classes. Any manual changes will be overwritten and may break the build system. Classes with proper @ENGINE.GameClass() decorators are automatically discovered and imported.