@directivegames/genesys.sdk 3.2.2 → 3.2.5

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 (125) hide show
  1. package/README.md +60 -60
  2. package/dist/src/asset-pack/eslint.config.js +4 -4
  3. package/dist/src/core/cli.js +22 -22
  4. package/dist/src/core/common.js +2 -2
  5. package/dist/src/core/tools/build-project.js +1 -1
  6. package/dist/src/core/tools/new-asset-pack.js +1 -1
  7. package/dist/src/core/tools/new-project.js +1 -1
  8. package/dist/src/dependencies.js +1 -1
  9. package/dist/src/electron/backend/tools/const.js +1 -1
  10. package/dist/src/electron/backend/tools/open-project.js +1 -1
  11. package/dist/src/templates/eslint.config.js +4 -4
  12. package/dist/src/templates/scripts/genesys/calc-bounding-box.js +2 -2
  13. package/dist/src/templates/scripts/genesys/dev/dump-default-scene.js +1 -1
  14. package/dist/src/templates/scripts/genesys/dev/generate-manifest.js +1 -1
  15. package/dist/src/templates/scripts/genesys/dev/launcher.js +1 -1
  16. package/dist/src/templates/scripts/genesys/dev/storage-provider.js +4 -4
  17. package/dist/src/templates/scripts/genesys/genesys-mcp.js +26 -26
  18. package/dist/src/templates/scripts/genesys/mcp/doc-tools.js +2 -2
  19. package/dist/src/templates/scripts/genesys/mcp/editor-functions.js +5 -5
  20. package/dist/src/templates/scripts/genesys/mcp/search-actors.js +1 -1
  21. package/dist/src/templates/scripts/genesys/mcp/search-assets.js +1 -1
  22. package/dist/src/templates/scripts/genesys/mcp/utils.js +1 -1
  23. package/dist/src/templates/scripts/genesys/misc.js +1 -1
  24. package/dist/src/templates/scripts/genesys/mock.js +1 -1
  25. package/dist/src/templates/scripts/genesys/place-actors.js +1 -1
  26. package/dist/src/templates/scripts/genesys/post-install.js +1 -1
  27. package/dist/src/templates/scripts/genesys/storageProvider.js +2 -2
  28. package/dist/src/templates/src/index.js +1 -1
  29. package/dist/src/templates/src/templates/firstPerson/src/game.js +1 -1
  30. package/dist/src/templates/src/templates/firstPerson/src/player.js +1 -1
  31. package/dist/src/templates/src/templates/fps/src/game.js +1 -1
  32. package/dist/src/templates/src/templates/fps/src/player.js +1 -1
  33. package/dist/src/templates/src/templates/fps/src/weapon.js +1 -1
  34. package/dist/src/templates/src/templates/freeCamera/src/game.js +1 -1
  35. package/dist/src/templates/src/templates/freeCamera/src/player.js +1 -1
  36. package/dist/src/templates/src/templates/sideScroller/src/game.js +1 -1
  37. package/dist/src/templates/src/templates/sideScroller/src/level-generator.js +1 -1
  38. package/dist/src/templates/src/templates/sideScroller/src/player.js +1 -1
  39. package/dist/src/templates/src/templates/thirdPerson/src/game.js +1 -1
  40. package/dist/src/templates/src/templates/thirdPerson/src/player.js +1 -1
  41. package/dist/src/templates/src/templates/vehicle/src/base-vehicle.js +1 -1
  42. package/dist/src/templates/src/templates/vehicle/src/game.js +1 -1
  43. package/dist/src/templates/src/templates/vehicle/src/mesh-vehicle.js +1 -1
  44. package/dist/src/templates/src/templates/vehicle/src/player.js +1 -1
  45. package/dist/src/templates/src/templates/vehicle/src/primitive-vehicle.js +1 -1
  46. package/dist/src/templates/src/templates/vehicle/src/ui-hints.js +31 -31
  47. package/dist/src/templates/src/templates/vr-game/src/game.js +1 -1
  48. package/dist/src/templates/src/templates/vr-game/src/sample-vr-actor.js +1 -1
  49. package/package.json +176 -176
  50. package/scripts/post-install.ts +143 -143
  51. package/src/asset-pack/.gitattributes +88 -88
  52. package/src/asset-pack/eslint.config.js +45 -45
  53. package/src/asset-pack/gitignore +11 -11
  54. package/src/asset-pack/scripts/postinstall.ts +81 -81
  55. package/src/asset-pack/tsconfig.json +33 -33
  56. package/src/templates/.cursor/mcp.json +20 -20
  57. package/src/templates/.cursorignore +2 -2
  58. package/src/templates/.gitattributes +88 -88
  59. package/src/templates/.vscode/settings.json +6 -6
  60. package/src/templates/AGENTS.md +86 -86
  61. package/src/templates/README.md +24 -24
  62. package/src/templates/eslint.config.js +45 -45
  63. package/src/templates/gitignore +11 -11
  64. package/src/templates/index.html +34 -34
  65. package/src/templates/pnpm-lock.yaml +3676 -3676
  66. package/src/templates/scripts/genesys/build-project.ts +51 -51
  67. package/src/templates/scripts/genesys/calc-bounding-box.ts +272 -272
  68. package/src/templates/scripts/genesys/common.ts +46 -46
  69. package/src/templates/scripts/genesys/const.ts +9 -9
  70. package/src/templates/scripts/genesys/dev/dump-default-scene.ts +11 -11
  71. package/src/templates/scripts/genesys/dev/generate-manifest.ts +146 -146
  72. package/src/templates/scripts/genesys/dev/launcher.ts +46 -46
  73. package/src/templates/scripts/genesys/dev/storage-provider.ts +229 -229
  74. package/src/templates/scripts/genesys/dev/update-template-scenes.ts +84 -84
  75. package/src/templates/scripts/genesys/doc-server.ts +16 -16
  76. package/src/templates/scripts/genesys/genesys-mcp.ts +526 -526
  77. package/src/templates/scripts/genesys/mcp/doc-tools.ts +86 -86
  78. package/src/templates/scripts/genesys/mcp/editor-functions.ts +151 -151
  79. package/src/templates/scripts/genesys/mcp/editor-tools.ts +73 -73
  80. package/src/templates/scripts/genesys/mcp/get-scene-state.ts +35 -35
  81. package/src/templates/scripts/genesys/mcp/run-subprocess.ts +30 -30
  82. package/src/templates/scripts/genesys/mcp/search-actors.ts +858 -858
  83. package/src/templates/scripts/genesys/mcp/search-assets.ts +380 -380
  84. package/src/templates/scripts/genesys/mcp/utils.ts +281 -281
  85. package/src/templates/scripts/genesys/misc.ts +42 -42
  86. package/src/templates/scripts/genesys/mock.ts +6 -6
  87. package/src/templates/scripts/genesys/place-actors.ts +179 -179
  88. package/src/templates/scripts/genesys/post-install.ts +30 -30
  89. package/src/templates/scripts/genesys/prefab.schema.json +84 -84
  90. package/src/templates/scripts/genesys/remove-engine-comments.ts +134 -134
  91. package/src/templates/scripts/genesys/run-mcp-inspector.bat +4 -4
  92. package/src/templates/scripts/genesys/storageProvider.ts +182 -182
  93. package/src/templates/scripts/genesys/validate-prefabs.ts +138 -138
  94. package/src/templates/src/index.ts +22 -22
  95. package/src/templates/src/templates/firstPerson/assets/default.genesys-scene +165 -165
  96. package/src/templates/src/templates/firstPerson/src/game.ts +39 -39
  97. package/src/templates/src/templates/firstPerson/src/player.ts +63 -63
  98. package/src/templates/src/templates/fps/assets/default.genesys-scene +9459 -9459
  99. package/src/templates/src/templates/fps/src/game.ts +39 -39
  100. package/src/templates/src/templates/fps/src/player.ts +69 -69
  101. package/src/templates/src/templates/fps/src/weapon.ts +54 -54
  102. package/src/templates/src/templates/freeCamera/assets/default.genesys-scene +165 -165
  103. package/src/templates/src/templates/freeCamera/src/game.ts +39 -39
  104. package/src/templates/src/templates/freeCamera/src/player.ts +45 -45
  105. package/src/templates/src/templates/sideScroller/assets/default.genesys-scene +121 -121
  106. package/src/templates/src/templates/sideScroller/src/const.ts +45 -45
  107. package/src/templates/src/templates/sideScroller/src/game.ts +122 -122
  108. package/src/templates/src/templates/sideScroller/src/level-generator.ts +361 -361
  109. package/src/templates/src/templates/sideScroller/src/player.ts +125 -125
  110. package/src/templates/src/templates/thirdPerson/assets/default.genesys-scene +165 -165
  111. package/src/templates/src/templates/thirdPerson/src/game.ts +39 -39
  112. package/src/templates/src/templates/thirdPerson/src/player.ts +61 -61
  113. package/src/templates/src/templates/vehicle/assets/default.genesys-scene +225 -225
  114. package/src/templates/src/templates/vehicle/src/base-vehicle.ts +145 -145
  115. package/src/templates/src/templates/vehicle/src/game.ts +43 -43
  116. package/src/templates/src/templates/vehicle/src/mesh-vehicle.ts +191 -191
  117. package/src/templates/src/templates/vehicle/src/player.ts +109 -109
  118. package/src/templates/src/templates/vehicle/src/primitive-vehicle.ts +266 -266
  119. package/src/templates/src/templates/vehicle/src/ui-hints.ts +101 -101
  120. package/src/templates/src/templates/vr-game/assets/default.genesys-scene +246 -246
  121. package/src/templates/src/templates/vr-game/src/auto-imports.ts +1 -1
  122. package/src/templates/src/templates/vr-game/src/game.ts +66 -66
  123. package/src/templates/src/templates/vr-game/src/sample-vr-actor.ts +26 -26
  124. package/src/templates/tsconfig.json +34 -34
  125. package/src/templates/vite.config.ts +52 -52
@@ -1,46 +1,46 @@
1
- import fs from 'fs';
2
- import path from 'path';
3
- import { fileURLToPath } from 'url';
4
-
5
- import { z } from 'zod';
6
-
7
- export const isDev = process.env.NODE_ENV === 'development' ||
8
- process.env.NODE_ENV === 'dev' ||
9
- process.argv.includes('--dev');
10
-
11
- export function mockEsModule() {
12
- const __filename = fileURLToPath(import.meta.url);
13
- const __dirname = path.dirname(__filename);
14
- (global as any).__filename = __filename;
15
- (global as any).__dirname = __dirname;
16
- }
17
-
18
- mockEsModule();
19
-
20
- export function getProjectRoot() {
21
- let currentDir = __dirname;
22
- while (true) {
23
- if (fs.existsSync(path.join(currentDir, 'package.json'))) {
24
- return currentDir;
25
- }
26
- const parentDir = path.dirname(currentDir);
27
- if (parentDir === currentDir) {
28
- throw new Error('Project root not found');
29
- }
30
- currentDir = parentDir;
31
- }
32
- }
33
-
34
- export const TransformSchema = z.object({
35
- position: z.array(z.number()).length(3).optional().describe('Position as [x, y, z]'),
36
- rotation: z.array(z.number()).length(3).optional().describe('Rotation in radians as [x, y, z]'),
37
- scale: z.array(z.number()).length(3).optional().describe('Scale as [x, y, z], use this to scale the actor up or down'),
38
- });
39
-
40
- export type Transform = z.infer<typeof TransformSchema>;
41
-
42
- export const ActorInfoSchema = z.object({
43
- displayName: z.string().describe('Display name of the actor'),
44
- description: z.string().optional().describe('Description of the actor, including its purpose, how to use it, etc.'),
45
- });
46
-
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import { fileURLToPath } from 'url';
4
+
5
+ import { z } from 'zod';
6
+
7
+ export const isDev = process.env.NODE_ENV === 'development' ||
8
+ process.env.NODE_ENV === 'dev' ||
9
+ process.argv.includes('--dev');
10
+
11
+ export function mockEsModule() {
12
+ const __filename = fileURLToPath(import.meta.url);
13
+ const __dirname = path.dirname(__filename);
14
+ (global as any).__filename = __filename;
15
+ (global as any).__dirname = __dirname;
16
+ }
17
+
18
+ mockEsModule();
19
+
20
+ export function getProjectRoot() {
21
+ let currentDir = __dirname;
22
+ while (true) {
23
+ if (fs.existsSync(path.join(currentDir, 'package.json'))) {
24
+ return currentDir;
25
+ }
26
+ const parentDir = path.dirname(currentDir);
27
+ if (parentDir === currentDir) {
28
+ throw new Error('Project root not found');
29
+ }
30
+ currentDir = parentDir;
31
+ }
32
+ }
33
+
34
+ export const TransformSchema = z.object({
35
+ position: z.array(z.number()).length(3).optional().describe('Position as [x, y, z]'),
36
+ rotation: z.array(z.number()).length(3).optional().describe('Rotation in radians as [x, y, z]'),
37
+ scale: z.array(z.number()).length(3).optional().describe('Scale as [x, y, z], use this to scale the actor up or down'),
38
+ });
39
+
40
+ export type Transform = z.infer<typeof TransformSchema>;
41
+
42
+ export const ActorInfoSchema = z.object({
43
+ displayName: z.string().describe('Display name of the actor'),
44
+ description: z.string().optional().describe('Description of the actor, including its purpose, how to use it, etc.'),
45
+ });
46
+
@@ -1,9 +1,9 @@
1
- // MUST be kept in sync with https://github.com/directivegames/genesys.ai/blob/develop/src/const.ts
2
- export const SCENE_EXTENSION: string = '.genesys-scene';
3
- export const PUBLIC_FOLDER: string = 'public';
4
- export const PROJECT_PREFIX: string = '@project';
5
- export const ENGINE_PREFIX: string = '@engine';
6
- export const DEFAULT_GAME_NAME: string = 'game.ts';
7
- export const DEFAULT_GAME_BUNDLE_NAME: string = 'game.js';
8
- export const BUILT_PROJECT_FOLDER: string = '.dist';
9
- export const JS_CLASSES_DIR_NAME: string = '@js-classes';
1
+ // MUST be kept in sync with https://github.com/directivegames/genesys.ai/blob/develop/src/const.ts
2
+ export const SCENE_EXTENSION: string = '.genesys-scene';
3
+ export const PUBLIC_FOLDER: string = 'public';
4
+ export const PROJECT_PREFIX: string = '@project';
5
+ export const ENGINE_PREFIX: string = '@engine';
6
+ export const DEFAULT_GAME_NAME: string = 'game.ts';
7
+ export const DEFAULT_GAME_BUNDLE_NAME: string = 'game.js';
8
+ export const BUILT_PROJECT_FOLDER: string = '.dist';
9
+ export const JS_CLASSES_DIR_NAME: string = '@js-classes';
@@ -1,11 +1,11 @@
1
- import * as ENGINE from 'genesys.js';
2
-
3
- import { defaultWorldOptions } from '../mcp/utils.js';
4
-
5
- function main() {
6
- const world = new ENGINE.World(defaultWorldOptions);
7
- ENGINE.GameBuilder.createDefaultEditorScene(world);
8
- console.log(JSON.stringify(world.asExportedObject(), null, 2));
9
- }
10
-
11
- main();
1
+ import * as ENGINE from '@directivegames/genesys.js';
2
+
3
+ import { defaultWorldOptions } from '../mcp/utils.js';
4
+
5
+ function main() {
6
+ const world = new ENGINE.World(defaultWorldOptions);
7
+ ENGINE.GameBuilder.createDefaultEditorScene(world);
8
+ console.log(JSON.stringify(world.asExportedObject(), null, 2));
9
+ }
10
+
11
+ main();
@@ -1,146 +1,146 @@
1
- // pnpm exec tsx ./scripts/genesys/dev/generate-manifest.ts
2
- import * as fs from 'fs';
3
- import * as path from 'path';
4
-
5
- import * as ENGINE from 'genesys.js';
6
-
7
- import { ManifestPath } from './storage-provider.js';
8
-
9
- import type { FileManifest, FileManifestItem} from './storage-provider.js';
10
-
11
- /**
12
- * Recursively scans a directory and returns file information
13
- */
14
- function scanDirectory(
15
- dirPath: string,
16
- basePath: string = '',
17
- ): FileManifestItem[] {
18
-
19
- const items: FileManifestItem[] = [];
20
-
21
- if (!fs.existsSync(dirPath)) {
22
- return items;
23
- }
24
-
25
- try {
26
- const entries = fs.readdirSync(dirPath, { withFileTypes: true });
27
-
28
- for (const entry of entries) {
29
- const fullPath = path.join(dirPath, entry.name);
30
- const relativePath = basePath ? path.join(basePath, entry.name) : entry.name;
31
- const stats = fs.statSync(fullPath);
32
-
33
- const item: FileManifestItem = {
34
- name: entry.name,
35
- path: relativePath.replace(/\\/g, '/'), // Normalize to forward slashes
36
- size: stats.size,
37
- modifiedTime: stats.mtime,
38
- isDirectory: entry.isDirectory(),
39
- contentType: getContentType(entry.name)
40
- };
41
-
42
- items.push(item);
43
-
44
- // Recursively scan subdirectories
45
- if (entry.isDirectory()) {
46
- const subItems = scanDirectory(fullPath, relativePath);
47
- items.push(...subItems);
48
- }
49
- }
50
- } catch (error) {
51
- console.warn(`Failed to scan directory ${dirPath}:`, error);
52
- }
53
-
54
- return items;
55
- }
56
-
57
- /**
58
- * Gets content type based on file extension
59
- */
60
- function getContentType(fileName: string): string | undefined {
61
- const ext = path.extname(fileName).toLowerCase();
62
- const contentTypes: Record<string, string> = {
63
- '.json': 'application/json',
64
- '.js': 'application/javascript',
65
- '.ts': 'application/typescript',
66
- '.html': 'text/html',
67
- '.css': 'text/css',
68
- '.png': 'image/png',
69
- '.jpg': 'image/jpeg',
70
- '.jpeg': 'image/jpeg',
71
- '.gif': 'image/gif',
72
- '.webp': 'image/webp',
73
- '.svg': 'image/svg+xml',
74
- '.glb': 'model/gltf-binary',
75
- '.gltf': 'model/gltf+json',
76
- '.wav': 'audio/wav',
77
- '.mp3': 'audio/mpeg',
78
- '.ogg': 'audio/ogg',
79
- '.genesys-scene': 'application/json',
80
- '.genesys-project': 'application/json'
81
- };
82
-
83
- return contentTypes[ext];
84
- }
85
-
86
- /**
87
- * Groups files by directory path for efficient lookup
88
- */
89
- function groupFilesByDirectory(files: FileManifestItem[]): Record<string, FileManifestItem[]> {
90
- const grouped: Record<string, FileManifestItem[]> = {};
91
-
92
- // Add root directory
93
- grouped[''] = [];
94
-
95
- for (const file of files) {
96
- const dir = path.dirname(file.path).replace(/\\/g, '/');
97
- const normalizedDir = dir === '.' ? '' : dir;
98
-
99
- if (!grouped[normalizedDir]) {
100
- grouped[normalizedDir] = [];
101
- }
102
-
103
- grouped[normalizedDir].push(file);
104
- }
105
-
106
- return grouped;
107
- }
108
-
109
- /**
110
- * Generates the file manifest
111
- */
112
- export async function generateManifest(): Promise<void> {
113
- console.log('Generating file manifest...');
114
-
115
- const manifest: FileManifest = {
116
- generated: new Date().toISOString(),
117
- projectFiles: {},
118
- engineFiles: {}
119
- };
120
-
121
- // Scan project files
122
- console.log('Scanning project files...');
123
- const projectRoot = process.cwd();
124
- const builtProjectRoot = path.join(projectRoot, ENGINE.BUILT_PROJECT_FOLDER);
125
- const projectFiles = scanDirectory(builtProjectRoot);
126
- manifest.projectFiles = groupFilesByDirectory(projectFiles);
127
-
128
- // Scan engine files
129
- console.log('Scanning engine files...');
130
- const engineAssetsRoot = path.join(projectRoot, 'node_modules', 'genesys.js', 'assets');
131
- if (fs.existsSync(engineAssetsRoot)) {
132
- const engineFiles = scanDirectory(engineAssetsRoot, 'assets');
133
- manifest.engineFiles = groupFilesByDirectory(engineFiles);
134
- console.log(`Engine files: ${Object.values(manifest.engineFiles).flat().length}`);
135
- }
136
-
137
- // Write manifest to public directory so it's accessible to the dev server
138
- const manifestPath = path.join(projectRoot, ManifestPath);
139
- fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2));
140
-
141
- console.log(`File manifest generated: ${manifestPath}`);
142
- console.log(`Project files: ${Object.values(manifest.projectFiles).flat().length}`);
143
- console.log(`Engine files: ${Object.values(manifest.engineFiles).flat().length}`);
144
- }
145
-
146
- generateManifest().catch(console.error);
1
+ // pnpm exec tsx ./scripts/genesys/dev/generate-manifest.ts
2
+ import * as fs from 'fs';
3
+ import * as path from 'path';
4
+
5
+ import * as ENGINE from '@directivegames/genesys.js';
6
+
7
+ import { ManifestPath } from './storage-provider.js';
8
+
9
+ import type { FileManifest, FileManifestItem} from './storage-provider.js';
10
+
11
+ /**
12
+ * Recursively scans a directory and returns file information
13
+ */
14
+ function scanDirectory(
15
+ dirPath: string,
16
+ basePath: string = '',
17
+ ): FileManifestItem[] {
18
+
19
+ const items: FileManifestItem[] = [];
20
+
21
+ if (!fs.existsSync(dirPath)) {
22
+ return items;
23
+ }
24
+
25
+ try {
26
+ const entries = fs.readdirSync(dirPath, { withFileTypes: true });
27
+
28
+ for (const entry of entries) {
29
+ const fullPath = path.join(dirPath, entry.name);
30
+ const relativePath = basePath ? path.join(basePath, entry.name) : entry.name;
31
+ const stats = fs.statSync(fullPath);
32
+
33
+ const item: FileManifestItem = {
34
+ name: entry.name,
35
+ path: relativePath.replace(/\\/g, '/'), // Normalize to forward slashes
36
+ size: stats.size,
37
+ modifiedTime: stats.mtime,
38
+ isDirectory: entry.isDirectory(),
39
+ contentType: getContentType(entry.name)
40
+ };
41
+
42
+ items.push(item);
43
+
44
+ // Recursively scan subdirectories
45
+ if (entry.isDirectory()) {
46
+ const subItems = scanDirectory(fullPath, relativePath);
47
+ items.push(...subItems);
48
+ }
49
+ }
50
+ } catch (error) {
51
+ console.warn(`Failed to scan directory ${dirPath}:`, error);
52
+ }
53
+
54
+ return items;
55
+ }
56
+
57
+ /**
58
+ * Gets content type based on file extension
59
+ */
60
+ function getContentType(fileName: string): string | undefined {
61
+ const ext = path.extname(fileName).toLowerCase();
62
+ const contentTypes: Record<string, string> = {
63
+ '.json': 'application/json',
64
+ '.js': 'application/javascript',
65
+ '.ts': 'application/typescript',
66
+ '.html': 'text/html',
67
+ '.css': 'text/css',
68
+ '.png': 'image/png',
69
+ '.jpg': 'image/jpeg',
70
+ '.jpeg': 'image/jpeg',
71
+ '.gif': 'image/gif',
72
+ '.webp': 'image/webp',
73
+ '.svg': 'image/svg+xml',
74
+ '.glb': 'model/gltf-binary',
75
+ '.gltf': 'model/gltf+json',
76
+ '.wav': 'audio/wav',
77
+ '.mp3': 'audio/mpeg',
78
+ '.ogg': 'audio/ogg',
79
+ '.genesys-scene': 'application/json',
80
+ '.genesys-project': 'application/json'
81
+ };
82
+
83
+ return contentTypes[ext];
84
+ }
85
+
86
+ /**
87
+ * Groups files by directory path for efficient lookup
88
+ */
89
+ function groupFilesByDirectory(files: FileManifestItem[]): Record<string, FileManifestItem[]> {
90
+ const grouped: Record<string, FileManifestItem[]> = {};
91
+
92
+ // Add root directory
93
+ grouped[''] = [];
94
+
95
+ for (const file of files) {
96
+ const dir = path.dirname(file.path).replace(/\\/g, '/');
97
+ const normalizedDir = dir === '.' ? '' : dir;
98
+
99
+ if (!grouped[normalizedDir]) {
100
+ grouped[normalizedDir] = [];
101
+ }
102
+
103
+ grouped[normalizedDir].push(file);
104
+ }
105
+
106
+ return grouped;
107
+ }
108
+
109
+ /**
110
+ * Generates the file manifest
111
+ */
112
+ export async function generateManifest(): Promise<void> {
113
+ console.log('Generating file manifest...');
114
+
115
+ const manifest: FileManifest = {
116
+ generated: new Date().toISOString(),
117
+ projectFiles: {},
118
+ engineFiles: {}
119
+ };
120
+
121
+ // Scan project files
122
+ console.log('Scanning project files...');
123
+ const projectRoot = process.cwd();
124
+ const builtProjectRoot = path.join(projectRoot, ENGINE.BUILT_PROJECT_FOLDER);
125
+ const projectFiles = scanDirectory(builtProjectRoot);
126
+ manifest.projectFiles = groupFilesByDirectory(projectFiles);
127
+
128
+ // Scan engine files
129
+ console.log('Scanning engine files...');
130
+ const engineAssetsRoot = path.join(projectRoot, 'node_modules', 'genesys.js', 'assets');
131
+ if (fs.existsSync(engineAssetsRoot)) {
132
+ const engineFiles = scanDirectory(engineAssetsRoot, 'assets');
133
+ manifest.engineFiles = groupFilesByDirectory(engineFiles);
134
+ console.log(`Engine files: ${Object.values(manifest.engineFiles).flat().length}`);
135
+ }
136
+
137
+ // Write manifest to public directory so it's accessible to the dev server
138
+ const manifestPath = path.join(projectRoot, ManifestPath);
139
+ fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2));
140
+
141
+ console.log(`File manifest generated: ${manifestPath}`);
142
+ console.log(`Project files: ${Object.values(manifest.projectFiles).flat().length}`);
143
+ console.log(`Engine files: ${Object.values(manifest.engineFiles).flat().length}`);
144
+ }
145
+
146
+ generateManifest().catch(console.error);
@@ -1,46 +1,46 @@
1
- import * as ENGINE from 'genesys.js';
2
-
3
- import { DevStorageProvider } from './storage-provider.js';
4
-
5
- // Ensure process is available globally with minimal implementation
6
- if (typeof globalThis.process === 'undefined') {
7
- (globalThis as any).process = {
8
- cwd: () => '/',
9
- env: {},
10
- };
11
- }
12
-
13
- // Initialize the game - can be called manually
14
- export async function launchGame() {
15
- const container = document.getElementById('game-container');
16
- if (!container) {
17
- console.error('Game container not found!');
18
- return;
19
- }
20
-
21
- try {
22
- // Create the storage provider for Vite dev environment
23
- const storageProvider = new DevStorageProvider();
24
-
25
- ENGINE.projectContext({
26
- project: 'dev-game',
27
- storageProvider,
28
- });
29
-
30
- // Create the game runtime
31
- const gameRuntime = new ENGINE.GameRuntime({
32
- provider: storageProvider,
33
- container: container,
34
- gameId: 'dev-game',
35
- buildProject: false,
36
- skipClearGameClasses: false
37
- });
38
-
39
- console.log('Starting game runtime...');
40
-
41
- // Start the game with the default scene
42
- await gameRuntime.startGame();
43
- } catch (error) {
44
- console.error('Failed to initialize game:', error);
45
- }
46
- }
1
+ import * as ENGINE from '@directivegames/genesys.js';
2
+
3
+ import { DevStorageProvider } from './storage-provider.js';
4
+
5
+ // Ensure process is available globally with minimal implementation
6
+ if (typeof globalThis.process === 'undefined') {
7
+ (globalThis as any).process = {
8
+ cwd: () => '/',
9
+ env: {},
10
+ };
11
+ }
12
+
13
+ // Initialize the game - can be called manually
14
+ export async function launchGame() {
15
+ const container = document.getElementById('game-container');
16
+ if (!container) {
17
+ console.error('Game container not found!');
18
+ return;
19
+ }
20
+
21
+ try {
22
+ // Create the storage provider for Vite dev environment
23
+ const storageProvider = new DevStorageProvider();
24
+
25
+ ENGINE.projectContext({
26
+ project: 'dev-game',
27
+ storageProvider,
28
+ });
29
+
30
+ // Create the game runtime
31
+ const gameRuntime = new ENGINE.GameRuntime({
32
+ provider: storageProvider,
33
+ container: container,
34
+ gameId: 'dev-game',
35
+ buildProject: false,
36
+ skipClearGameClasses: false
37
+ });
38
+
39
+ console.log('Starting game runtime...');
40
+
41
+ // Start the game with the default scene
42
+ await gameRuntime.startGame();
43
+ } catch (error) {
44
+ console.error('Failed to initialize game:', error);
45
+ }
46
+ }