unreal-engine-mcp-server 0.5.0 → 0.5.1

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 (139) hide show
  1. package/.env.example +1 -1
  2. package/.github/release-drafter-config.yml +51 -0
  3. package/.github/workflows/greetings.yml +5 -1
  4. package/.github/workflows/labeler.yml +2 -1
  5. package/.github/workflows/publish-mcp.yml +1 -0
  6. package/.github/workflows/release-drafter.yml +1 -1
  7. package/.github/workflows/release.yml +3 -3
  8. package/CHANGELOG.md +71 -0
  9. package/CONTRIBUTING.md +1 -1
  10. package/GEMINI.md +115 -0
  11. package/Public/Plugin_setup_guide.mp4 +0 -0
  12. package/README.md +166 -200
  13. package/dist/config.d.ts +0 -1
  14. package/dist/config.js +0 -1
  15. package/dist/constants.d.ts +4 -0
  16. package/dist/constants.js +4 -0
  17. package/dist/graphql/loaders.d.ts +64 -0
  18. package/dist/graphql/loaders.js +117 -0
  19. package/dist/graphql/resolvers.d.ts +3 -3
  20. package/dist/graphql/resolvers.js +33 -30
  21. package/dist/graphql/server.js +3 -1
  22. package/dist/graphql/types.d.ts +2 -0
  23. package/dist/index.d.ts +2 -0
  24. package/dist/index.js +13 -2
  25. package/dist/server-setup.d.ts +0 -1
  26. package/dist/server-setup.js +0 -40
  27. package/dist/tools/actors.d.ts +40 -24
  28. package/dist/tools/actors.js +8 -2
  29. package/dist/tools/assets.d.ts +19 -71
  30. package/dist/tools/assets.js +28 -22
  31. package/dist/tools/base-tool.d.ts +4 -4
  32. package/dist/tools/base-tool.js +1 -1
  33. package/dist/tools/blueprint.d.ts +33 -61
  34. package/dist/tools/consolidated-tool-handlers.js +96 -110
  35. package/dist/tools/dynamic-handler-registry.d.ts +11 -9
  36. package/dist/tools/dynamic-handler-registry.js +17 -95
  37. package/dist/tools/editor.d.ts +19 -193
  38. package/dist/tools/editor.js +8 -0
  39. package/dist/tools/environment.d.ts +8 -14
  40. package/dist/tools/foliage.d.ts +18 -143
  41. package/dist/tools/foliage.js +4 -2
  42. package/dist/tools/handlers/actor-handlers.js +0 -5
  43. package/dist/tools/handlers/asset-handlers.js +454 -454
  44. package/dist/tools/landscape.d.ts +16 -116
  45. package/dist/tools/landscape.js +7 -3
  46. package/dist/tools/level.d.ts +22 -103
  47. package/dist/tools/level.js +24 -16
  48. package/dist/tools/lighting.js +5 -1
  49. package/dist/tools/materials.js +5 -1
  50. package/dist/tools/niagara.js +37 -2
  51. package/dist/tools/performance.d.ts +0 -1
  52. package/dist/tools/performance.js +0 -1
  53. package/dist/tools/physics.js +5 -1
  54. package/dist/tools/sequence.d.ts +24 -24
  55. package/dist/tools/sequence.js +13 -0
  56. package/dist/tools/ui.d.ts +0 -2
  57. package/dist/types/automation-responses.d.ts +115 -0
  58. package/dist/types/automation-responses.js +2 -0
  59. package/dist/types/responses.d.ts +249 -0
  60. package/dist/types/responses.js +2 -0
  61. package/dist/types/tool-interfaces.d.ts +135 -135
  62. package/dist/utils/command-validator.js +3 -2
  63. package/dist/utils/path-security.d.ts +2 -0
  64. package/dist/utils/path-security.js +24 -0
  65. package/dist/utils/response-factory.d.ts +4 -4
  66. package/dist/utils/response-factory.js +15 -21
  67. package/docs/Migration-Guide-v0.5.0.md +1 -9
  68. package/docs/testing-guide.md +2 -2
  69. package/package.json +12 -6
  70. package/scripts/run-all-tests.mjs +25 -20
  71. package/server.json +3 -2
  72. package/src/config.ts +1 -1
  73. package/src/constants.ts +7 -0
  74. package/src/graphql/loaders.ts +244 -0
  75. package/src/graphql/resolvers.ts +47 -49
  76. package/src/graphql/server.ts +3 -1
  77. package/src/graphql/types.ts +3 -0
  78. package/src/index.ts +15 -2
  79. package/src/resources/assets.ts +5 -4
  80. package/src/server-setup.ts +3 -37
  81. package/src/tools/actors.ts +36 -28
  82. package/src/tools/animation.ts +1 -0
  83. package/src/tools/assets.ts +74 -63
  84. package/src/tools/base-tool.ts +3 -3
  85. package/src/tools/blueprint.ts +59 -59
  86. package/src/tools/consolidated-tool-handlers.ts +129 -150
  87. package/src/tools/dynamic-handler-registry.ts +22 -140
  88. package/src/tools/editor.ts +39 -26
  89. package/src/tools/environment.ts +21 -27
  90. package/src/tools/foliage.ts +28 -25
  91. package/src/tools/handlers/actor-handlers.ts +2 -8
  92. package/src/tools/handlers/asset-handlers.ts +484 -484
  93. package/src/tools/handlers/sequence-handlers.ts +1 -1
  94. package/src/tools/landscape.ts +34 -28
  95. package/src/tools/level.ts +96 -76
  96. package/src/tools/lighting.ts +6 -1
  97. package/src/tools/materials.ts +8 -2
  98. package/src/tools/niagara.ts +44 -2
  99. package/src/tools/performance.ts +1 -2
  100. package/src/tools/physics.ts +7 -1
  101. package/src/tools/sequence.ts +41 -25
  102. package/src/tools/ui.ts +0 -2
  103. package/src/types/automation-responses.ts +119 -0
  104. package/src/types/responses.ts +355 -0
  105. package/src/types/tool-interfaces.ts +135 -135
  106. package/src/utils/command-validator.ts +3 -2
  107. package/src/utils/normalize.test.ts +162 -0
  108. package/src/utils/path-security.ts +43 -0
  109. package/src/utils/response-factory.ts +29 -24
  110. package/src/utils/safe-json.test.ts +90 -0
  111. package/src/utils/validation.test.ts +184 -0
  112. package/tests/test-animation.mjs +358 -33
  113. package/tests/test-asset-graph.mjs +311 -0
  114. package/tests/test-audio.mjs +314 -116
  115. package/tests/test-behavior-tree.mjs +327 -144
  116. package/tests/test-blueprint-graph.mjs +343 -12
  117. package/tests/test-control-editor.mjs +85 -53
  118. package/tests/test-graphql.mjs +58 -8
  119. package/tests/test-input.mjs +349 -0
  120. package/tests/test-inspect.mjs +291 -61
  121. package/tests/test-landscape.mjs +304 -48
  122. package/tests/test-lighting.mjs +428 -0
  123. package/tests/test-manage-level.mjs +70 -51
  124. package/tests/test-performance.mjs +539 -0
  125. package/tests/test-sequence.mjs +82 -46
  126. package/tests/test-system.mjs +72 -33
  127. package/tests/test-wasm.mjs +98 -8
  128. package/vitest.config.ts +35 -0
  129. package/.github/release-drafter.yml +0 -148
  130. package/dist/prompts/index.d.ts +0 -21
  131. package/dist/prompts/index.js +0 -217
  132. package/dist/tools/blueprint/helpers.d.ts +0 -29
  133. package/dist/tools/blueprint/helpers.js +0 -182
  134. package/src/prompts/index.ts +0 -249
  135. package/src/tools/blueprint/helpers.ts +0 -189
  136. package/tests/test-blueprint-events.mjs +0 -35
  137. package/tests/test-extra-tools.mjs +0 -38
  138. package/tests/test-render.mjs +0 -33
  139. package/tests/test-search-assets.mjs +0 -66
@@ -1,217 +0,0 @@
1
- function clampChoice(value, choices, defaultChoice) {
2
- if (typeof value === 'string') {
3
- const normalized = value.toLowerCase();
4
- if (choices.includes(normalized)) {
5
- return normalized;
6
- }
7
- }
8
- return defaultChoice;
9
- }
10
- function coerceNumber(value, defaultValue, min, max) {
11
- const num = typeof value === 'number' ? value : Number(value);
12
- if (!Number.isFinite(num)) {
13
- return defaultValue;
14
- }
15
- if (min !== undefined && num < min) {
16
- return min;
17
- }
18
- if (max !== undefined && num > max) {
19
- return max;
20
- }
21
- return num;
22
- }
23
- function formatVector(value) {
24
- if (!value || typeof value !== 'object') {
25
- return null;
26
- }
27
- const vector = value;
28
- const x = typeof vector.x === 'number' ? vector.x : Number(vector.x);
29
- const y = typeof vector.y === 'number' ? vector.y : Number(vector.y);
30
- const z = typeof vector.z === 'number' ? vector.z : Number(vector.z);
31
- if ([x, y, z].some((component) => !Number.isFinite(component))) {
32
- return null;
33
- }
34
- return `${x.toFixed(2)}, ${y.toFixed(2)}, ${z.toFixed(2)}`;
35
- }
36
- export const prompts = [
37
- {
38
- name: 'setup_three_point_lighting',
39
- description: 'Author a cinematic three-point lighting rig aligned to the active camera focus.',
40
- arguments: {
41
- intensity: {
42
- type: 'string',
43
- enum: ['low', 'medium', 'high'],
44
- default: 'medium',
45
- description: 'Overall lighting mood. Low = dramatic contrast, high = bright key light.'
46
- }
47
- },
48
- build: (args) => {
49
- const intensity = clampChoice(args.intensity, ['low', 'medium', 'high'], 'medium');
50
- const moodHints = {
51
- low: 'gentle key with strong contrast and subtle rim highlights',
52
- medium: 'balanced key/fill ratio for natural coverage',
53
- high: 'bright key with energetic fill and crisp rim separation'
54
- };
55
- const text = `Configure a three-point lighting rig around the current cinematic focus.
56
-
57
- Tasks:
58
- - Position a key light roughly 45° off-axis at eye level. Target the subject center and tune intensity for ${intensity} output (${moodHints[intensity]}).
59
- - Add a fill light on the opposite side with wider spread and softened shadows to control contrast.
60
- - Place a rim/back light to outline silhouettes and separate the subject from the background.
61
- - Ensure all lights use physically plausible color temperature, enable shadow casting where helpful, and adjust attenuation to avoid spill.
62
- - Once balanced, report the final intensity values, color temperatures, and any blockers encountered.`;
63
- return [{
64
- role: 'user',
65
- content: { type: 'text', text }
66
- }];
67
- }
68
- },
69
- {
70
- name: 'create_fps_controller',
71
- description: 'Spin up a first-person controller blueprint with input mappings, collision, and starter movement.',
72
- arguments: {
73
- spawnLocation: {
74
- type: 'vector',
75
- description: 'Optional XYZ spawn position for the player pawn.',
76
- required: false
77
- }
78
- },
79
- build: (args) => {
80
- const spawnVector = formatVector(args.spawnLocation);
81
- const spawnLine = spawnVector ? `Spawn the pawn at world coordinates (${spawnVector}).` : 'Spawn the pawn at a safe default player start or the origin.';
82
- const text = `Build a First Person Character blueprint with:
83
- - Camera + arms mesh, basic WASD input, jump, crouch, and sprint bindings using Enhanced Input.
84
- - Proper collision capsule sizing for a 180cm tall human.
85
- - Momentum-preserving air control with configurable acceleration and friction.
86
- - A configurable base turn rate with mouse sensitivity scaling.
87
- - Serialized defaults for walking speed (600 uu/s) and sprint speed (900 uu/s).
88
- - Expose key movement settings as editable defaults.
89
- - ${spawnLine}
90
-
91
- Finish by compiling, saving, and summarizing the created blueprint path plus the mapped input actions.`;
92
- return [{
93
- role: 'user',
94
- content: { type: 'text', text }
95
- }];
96
- }
97
- },
98
- {
99
- name: 'setup_post_processing',
100
- description: 'Author a post-process volume tuned to a named cinematic grade.',
101
- arguments: {
102
- style: {
103
- type: 'string',
104
- enum: ['cinematic', 'realistic', 'stylized', 'noir'],
105
- default: 'cinematic',
106
- description: 'Look preset to emphasize color grading and tone-mapping style.'
107
- }
108
- },
109
- build: (args) => {
110
- const style = clampChoice(args.style, ['cinematic', 'realistic', 'stylized', 'noir'], 'cinematic');
111
- const styleNotes = {
112
- cinematic: 'filmic tonemapper, gentle bloom, warm highlights, cool shadows, slight vignette',
113
- realistic: 'minimal grading, accurate white balance, restrained bloom, detail-preserving sharpening',
114
- stylized: 'bold saturation shifts, custom color LUT, exaggerated contrast, selective bloom',
115
- noir: 'monochrome conversion, strong contrast curve, subtle film grain, heavy vignette'
116
- };
117
- const text = `Create a global post-process volume with priority over level defaults.
118
- - Apply the "${style}" look: ${styleNotes[style]}.
119
- - Configure tone mapping, exposure, bloom, chromatic aberration, and LUTs as required.
120
- - Ensure the volume is unbound unless level-specific constraints apply.
121
- - Provide sanity checks for HDR output and keep auto-exposure transitions smooth.
122
- - Summarize all modified settings with their final numeric values or asset references.`;
123
- return [{
124
- role: 'user',
125
- content: { type: 'text', text }
126
- }];
127
- }
128
- },
129
- {
130
- name: 'setup_dynamic_day_night_cycle',
131
- description: 'Create or update a Blueprint to drive a dynamic day/night cycle with optional weather hooks.',
132
- arguments: {
133
- startTime: {
134
- type: 'string',
135
- enum: ['dawn', 'noon', 'dusk', 'midnight'],
136
- default: 'dawn',
137
- description: 'Initial lighting state for the cycle.'
138
- },
139
- transitionMinutes: {
140
- type: 'number',
141
- default: 5,
142
- description: 'Game-time minutes to blend between major lighting states.'
143
- },
144
- enableWeather: {
145
- type: 'boolean',
146
- default: false,
147
- description: 'Whether to expose hooks for weather-driven sky adjustments.'
148
- }
149
- },
150
- build: (args) => {
151
- const startTime = clampChoice(args.startTime, ['dawn', 'noon', 'dusk', 'midnight'], 'dawn');
152
- const transitionMinutes = coerceNumber(args.transitionMinutes, 5, 1, 60);
153
- const enableWeather = Boolean(args.enableWeather);
154
- const weatherLine = enableWeather
155
- ? '- Expose interfaces for cloud opacity, precipitation-driven skylight updates, and lightning flashes.'
156
- : '- Weather hooks are disabled; keep the blueprint lean';
157
- const text = `Implement a Blueprint-based day/night cycle manager.
158
- - Start the sequence at ${startTime} lighting.
159
- - Advance sun rotation, skylight captures, fog, and sky atmosphere continuously with ${transitionMinutes} minute blends between key states.
160
- - Sync directional light intensity/color with real-world sun elevation and inject moonlight at night.
161
- - ${weatherLine}.
162
- - Provide editor controls for time-of-day multiplier and manual overrides.
163
- - Document the generated blueprint path and exposed parameters.`;
164
- return [{
165
- role: 'user',
166
- content: { type: 'text', text }
167
- }];
168
- }
169
- },
170
- {
171
- name: 'design_cinematic_camera_move',
172
- description: 'Author a sequencer shot with a polished camera move and easing markers.',
173
- arguments: {
174
- durationSeconds: {
175
- type: 'number',
176
- default: 6,
177
- description: 'Shot duration in seconds.'
178
- },
179
- moveStyle: {
180
- type: 'string',
181
- enum: ['push_in', 'orbit', 'tracking', 'crane'],
182
- default: 'push_in',
183
- description: 'Camera move archetype to emphasize.'
184
- },
185
- focusTarget: {
186
- type: 'string',
187
- description: 'Optional actor or component name to keep in focus.',
188
- required: false
189
- }
190
- },
191
- build: (args) => {
192
- const duration = coerceNumber(args.durationSeconds, 6, 2, 30);
193
- const moveStyle = clampChoice(args.moveStyle, ['push_in', 'orbit', 'tracking', 'crane'], 'push_in');
194
- const focusLine = typeof args.focusTarget === 'string' && args.focusTarget.trim().length > 0
195
- ? `Lock focus distance on "${args.focusTarget}" and animate depth of field pulls if necessary.`
196
- : 'Pick the most prominent subject in frame and maintain crisp focus throughout the move.';
197
- const moveHints = {
198
- push_in: 'Ease-in push toward the subject with gentle camera roll stabilization.',
199
- orbit: '360° orbit with consistent parallax and a tracked look-at target.',
200
- tracking: 'Match the subject velocity along a spline with smoothed acceleration.',
201
- crane: 'Combine vertical rise with lateral drift for a reveal shot.'
202
- };
203
- const text = `In Sequencer, author a ${duration.toFixed(1)} second cinematic shot.
204
- - Movement style: ${moveStyle} (${moveHints[moveStyle]}).
205
- - Key auto-exposure, camera focal length, and focal distance for a premium look.
206
- - Add ease-in/ease-out tangents at shot boundaries to avoid abrupt starts/stops.
207
- - ${focusLine}
208
- - Annotate the timeline with intent markers (intro beat, climax, resolve).
209
- - Render a preview range and summarize the created assets.`;
210
- return [{
211
- role: 'user',
212
- content: { type: 'text', text }
213
- }];
214
- }
215
- }
216
- ];
217
- //# sourceMappingURL=index.js.map
@@ -1,29 +0,0 @@
1
- export type TransformInput = {
2
- location?: unknown;
3
- rotation?: unknown;
4
- scale?: unknown;
5
- };
6
- export declare function toFiniteNumber(raw: unknown): number | undefined;
7
- export declare function normalizePartialVector(value: unknown, alternateKeys?: string[]): Record<string, number> | undefined;
8
- export declare function normalizeTransformInput(transform: TransformInput | undefined): Record<string, unknown> | undefined;
9
- export type BlueprintScsOperationInput = {
10
- type: string;
11
- componentName?: string;
12
- componentClass?: string;
13
- attachTo?: string;
14
- transform?: TransformInput;
15
- properties?: Record<string, unknown>;
16
- };
17
- export declare function sanitizeScsOperation(rawOperation: BlueprintScsOperationInput, index: number): {
18
- ok: true;
19
- operation: Record<string, unknown>;
20
- } | {
21
- ok: false;
22
- error: string;
23
- };
24
- export declare function resolveBlueprintCandidates(rawName: string | undefined): {
25
- primary: string | undefined;
26
- candidates: string[];
27
- };
28
- export declare function inferVariableTypeFromValue(value: unknown): string | undefined;
29
- //# sourceMappingURL=helpers.d.ts.map
@@ -1,182 +0,0 @@
1
- import { coerceString } from '../../utils/result-helpers.js';
2
- export function toFiniteNumber(raw) {
3
- if (typeof raw === 'number' && Number.isFinite(raw))
4
- return raw;
5
- if (typeof raw === 'string') {
6
- const trimmed = raw.trim();
7
- if (trimmed.length === 0)
8
- return undefined;
9
- const parsed = Number(trimmed);
10
- if (Number.isFinite(parsed))
11
- return parsed;
12
- }
13
- return undefined;
14
- }
15
- export function normalizePartialVector(value, alternateKeys = ['x', 'y', 'z']) {
16
- if (value === undefined || value === null) {
17
- return undefined;
18
- }
19
- const result = {};
20
- const assignIfPresent = (component, raw) => {
21
- const numberValue = toFiniteNumber(raw);
22
- if (numberValue !== undefined) {
23
- result[component] = numberValue;
24
- }
25
- };
26
- if (Array.isArray(value)) {
27
- if (value.length > 0)
28
- assignIfPresent('x', value[0]);
29
- if (value.length > 1)
30
- assignIfPresent('y', value[1]);
31
- if (value.length > 2)
32
- assignIfPresent('z', value[2]);
33
- }
34
- else if (typeof value === 'object') {
35
- const obj = value;
36
- assignIfPresent('x', obj.x ?? obj[alternateKeys[0]]);
37
- assignIfPresent('y', obj.y ?? obj[alternateKeys[1]]);
38
- assignIfPresent('z', obj.z ?? obj[alternateKeys[2]]);
39
- }
40
- else {
41
- assignIfPresent('x', value);
42
- }
43
- return Object.keys(result).length > 0 ? result : undefined;
44
- }
45
- export function normalizeTransformInput(transform) {
46
- if (!transform || typeof transform !== 'object')
47
- return undefined;
48
- const result = {};
49
- const location = normalizePartialVector(transform.location);
50
- if (location)
51
- result.location = location;
52
- const rotation = normalizePartialVector(transform.rotation, ['pitch', 'yaw', 'roll']);
53
- if (rotation)
54
- result.rotation = rotation;
55
- const scale = normalizePartialVector(transform.scale);
56
- if (scale)
57
- result.scale = scale;
58
- return Object.keys(result).length > 0 ? result : undefined;
59
- }
60
- export function sanitizeScsOperation(rawOperation, index) {
61
- if (!rawOperation || typeof rawOperation !== 'object') {
62
- return { ok: false, error: `Operation at index ${index} must be an object.` };
63
- }
64
- const type = (rawOperation.type || '').toString().trim().toLowerCase();
65
- if (!type)
66
- return { ok: false, error: `Operation at index ${index} missing type.` };
67
- const operation = { type };
68
- const op = rawOperation;
69
- const componentName = op.componentName ?? op.name;
70
- const componentClass = op.componentClass ?? op.componentType ?? op.class;
71
- const attachTo = op.attachTo ?? op.parent ?? op.attach;
72
- const transform = normalizeTransformInput(op.transform);
73
- const properties = rawOperation.properties && typeof rawOperation.properties === 'object' ? rawOperation.properties : undefined;
74
- switch (type) {
75
- case 'add_component': {
76
- if (!componentName)
77
- return { ok: false, error: `add_component operation at index ${index} requires componentName.` };
78
- if (!componentClass)
79
- return { ok: false, error: `add_component operation for ${componentName} missing componentClass.` };
80
- operation.componentName = componentName;
81
- operation.componentClass = componentClass;
82
- if (attachTo)
83
- operation.attachTo = attachTo;
84
- if (transform)
85
- operation.transform = transform;
86
- if (properties)
87
- operation.properties = properties;
88
- break;
89
- }
90
- case 'remove_component': {
91
- if (!componentName)
92
- return { ok: false, error: `remove_component operation at index ${index} requires componentName.` };
93
- operation.componentName = componentName;
94
- break;
95
- }
96
- case 'set_component_properties': {
97
- if (!componentName)
98
- return { ok: false, error: `set_component_properties operation at index ${index} requires componentName.` };
99
- if (!properties)
100
- return { ok: false, error: `set_component_properties operation at index ${index} missing properties object.` };
101
- operation.componentName = componentName;
102
- operation.properties = properties;
103
- if (transform)
104
- operation.transform = transform;
105
- break;
106
- }
107
- case 'modify_component': {
108
- if (!componentName)
109
- return { ok: false, error: `modify_component operation at index ${index} requires componentName.` };
110
- if (!transform && !properties)
111
- return { ok: false, error: `modify_component operation at index ${index} requires transform or properties.` };
112
- operation.componentName = componentName;
113
- if (transform)
114
- operation.transform = transform;
115
- if (properties)
116
- operation.properties = properties;
117
- break;
118
- }
119
- case 'attach_component': {
120
- const parent = op.parentComponent ?? op.parent;
121
- if (!componentName)
122
- return { ok: false, error: `attach_component operation at index ${index} requires componentName.` };
123
- if (!parent)
124
- return { ok: false, error: `attach_component operation at index ${index} requires parentComponent.` };
125
- operation.componentName = componentName;
126
- operation.attachTo = parent;
127
- break;
128
- }
129
- default:
130
- return { ok: false, error: `Unknown SCS operation type: ${type}` };
131
- }
132
- return { ok: true, operation };
133
- }
134
- export function resolveBlueprintCandidates(rawName) {
135
- const trimmed = coerceString(rawName)?.trim();
136
- if (!trimmed)
137
- return { primary: undefined, candidates: [] };
138
- const normalized = trimmed.replace(/\\/g, '/').replace(/\/+/g, '/');
139
- const withoutLeading = normalized.replace(/^\/+/, '');
140
- const candidates = new Set();
141
- const add = (path) => {
142
- if (path && path.trim())
143
- candidates.add(path.replace(/\/+/g, '/'));
144
- };
145
- if (normalized.includes('/')) {
146
- const basename = withoutLeading.split('/').pop();
147
- if (basename) {
148
- add(`/Game/Blueprints/${basename}`);
149
- add(`/Game/${basename}`);
150
- }
151
- add(normalized);
152
- add(normalized.startsWith('/') ? normalized : `/${withoutLeading}`);
153
- }
154
- else {
155
- add(`/Game/Blueprints/${withoutLeading}`);
156
- add(`/Game/${withoutLeading}`);
157
- add(normalized);
158
- add(`/${withoutLeading}`);
159
- }
160
- const ordered = Array.from(candidates);
161
- return { primary: ordered[0], candidates: ordered };
162
- }
163
- export function inferVariableTypeFromValue(value) {
164
- if (value === null || value === undefined)
165
- return undefined;
166
- if (typeof value === 'boolean')
167
- return 'Bool';
168
- if (typeof value === 'number')
169
- return Number.isInteger(value) ? 'Int' : 'Float';
170
- if (typeof value === 'string')
171
- return 'String';
172
- if (Array.isArray(value))
173
- return 'Array';
174
- if (typeof value === 'object') {
175
- const keys = Object.keys(value);
176
- if (keys.includes('x') && keys.includes('y') && keys.includes('z'))
177
- return 'Vector';
178
- return 'Struct';
179
- }
180
- return undefined;
181
- }
182
- //# sourceMappingURL=helpers.js.map
@@ -1,249 +0,0 @@
1
- export interface PromptArgument {
2
- type: string;
3
- description?: string;
4
- enum?: string[];
5
- default?: unknown;
6
- required?: boolean;
7
- }
8
-
9
- export interface PromptTemplate {
10
- name: string;
11
- description: string;
12
- arguments?: Record<string, PromptArgument>;
13
- build: (args: Record<string, unknown>) => Array<{
14
- role: 'user' | 'assistant';
15
- content: { type: 'text'; text: string };
16
- }>;
17
- }
18
-
19
- function clampChoice(value: unknown, choices: string[], defaultChoice: string): string {
20
- if (typeof value === 'string') {
21
- const normalized = value.toLowerCase();
22
- if (choices.includes(normalized)) {
23
- return normalized;
24
- }
25
- }
26
- return defaultChoice;
27
- }
28
-
29
- function coerceNumber(value: unknown, defaultValue: number, min?: number, max?: number): number {
30
- const num = typeof value === 'number' ? value : Number(value);
31
- if (!Number.isFinite(num)) {
32
- return defaultValue;
33
- }
34
- if (min !== undefined && num < min) {
35
- return min;
36
- }
37
- if (max !== undefined && num > max) {
38
- return max;
39
- }
40
- return num;
41
- }
42
-
43
- function formatVector(value: unknown): string | null {
44
- if (!value || typeof value !== 'object') {
45
- return null;
46
- }
47
- const vector = value as Record<string, unknown>;
48
- const x = typeof vector.x === 'number' ? vector.x : Number(vector.x);
49
- const y = typeof vector.y === 'number' ? vector.y : Number(vector.y);
50
- const z = typeof vector.z === 'number' ? vector.z : Number(vector.z);
51
- if ([x, y, z].some((component) => !Number.isFinite(component))) {
52
- return null;
53
- }
54
- return `${x.toFixed(2)}, ${y.toFixed(2)}, ${z.toFixed(2)}`;
55
- }
56
-
57
- export const prompts: PromptTemplate[] = [
58
- {
59
- name: 'setup_three_point_lighting',
60
- description: 'Author a cinematic three-point lighting rig aligned to the active camera focus.',
61
- arguments: {
62
- intensity: {
63
- type: 'string',
64
- enum: ['low', 'medium', 'high'],
65
- default: 'medium',
66
- description: 'Overall lighting mood. Low = dramatic contrast, high = bright key light.'
67
- }
68
- },
69
- build: (args) => {
70
- const intensity = clampChoice(args.intensity, ['low', 'medium', 'high'], 'medium');
71
- const moodHints: Record<string, string> = {
72
- low: 'gentle key with strong contrast and subtle rim highlights',
73
- medium: 'balanced key/fill ratio for natural coverage',
74
- high: 'bright key with energetic fill and crisp rim separation'
75
- };
76
-
77
- const text = `Configure a three-point lighting rig around the current cinematic focus.
78
-
79
- Tasks:
80
- - Position a key light roughly 45° off-axis at eye level. Target the subject center and tune intensity for ${intensity} output (${moodHints[intensity]}).
81
- - Add a fill light on the opposite side with wider spread and softened shadows to control contrast.
82
- - Place a rim/back light to outline silhouettes and separate the subject from the background.
83
- - Ensure all lights use physically plausible color temperature, enable shadow casting where helpful, and adjust attenuation to avoid spill.
84
- - Once balanced, report the final intensity values, color temperatures, and any blockers encountered.`;
85
-
86
- return [{
87
- role: 'user',
88
- content: { type: 'text', text }
89
- }];
90
- }
91
- },
92
- {
93
- name: 'create_fps_controller',
94
- description: 'Spin up a first-person controller blueprint with input mappings, collision, and starter movement.',
95
- arguments: {
96
- spawnLocation: {
97
- type: 'vector',
98
- description: 'Optional XYZ spawn position for the player pawn.',
99
- required: false
100
- }
101
- },
102
- build: (args) => {
103
- const spawnVector = formatVector(args.spawnLocation);
104
- const spawnLine = spawnVector ? `Spawn the pawn at world coordinates (${spawnVector}).` : 'Spawn the pawn at a safe default player start or the origin.';
105
-
106
- const text = `Build a First Person Character blueprint with:
107
- - Camera + arms mesh, basic WASD input, jump, crouch, and sprint bindings using Enhanced Input.
108
- - Proper collision capsule sizing for a 180cm tall human.
109
- - Momentum-preserving air control with configurable acceleration and friction.
110
- - A configurable base turn rate with mouse sensitivity scaling.
111
- - Serialized defaults for walking speed (600 uu/s) and sprint speed (900 uu/s).
112
- - Expose key movement settings as editable defaults.
113
- - ${spawnLine}
114
-
115
- Finish by compiling, saving, and summarizing the created blueprint path plus the mapped input actions.`;
116
-
117
- return [{
118
- role: 'user',
119
- content: { type: 'text', text }
120
- }];
121
- }
122
- },
123
- {
124
- name: 'setup_post_processing',
125
- description: 'Author a post-process volume tuned to a named cinematic grade.',
126
- arguments: {
127
- style: {
128
- type: 'string',
129
- enum: ['cinematic', 'realistic', 'stylized', 'noir'],
130
- default: 'cinematic',
131
- description: 'Look preset to emphasize color grading and tone-mapping style.'
132
- }
133
- },
134
- build: (args) => {
135
- const style = clampChoice(args.style, ['cinematic', 'realistic', 'stylized', 'noir'], 'cinematic');
136
- const styleNotes: Record<string, string> = {
137
- cinematic: 'filmic tonemapper, gentle bloom, warm highlights, cool shadows, slight vignette',
138
- realistic: 'minimal grading, accurate white balance, restrained bloom, detail-preserving sharpening',
139
- stylized: 'bold saturation shifts, custom color LUT, exaggerated contrast, selective bloom',
140
- noir: 'monochrome conversion, strong contrast curve, subtle film grain, heavy vignette'
141
- };
142
-
143
- const text = `Create a global post-process volume with priority over level defaults.
144
- - Apply the "${style}" look: ${styleNotes[style]}.
145
- - Configure tone mapping, exposure, bloom, chromatic aberration, and LUTs as required.
146
- - Ensure the volume is unbound unless level-specific constraints apply.
147
- - Provide sanity checks for HDR output and keep auto-exposure transitions smooth.
148
- - Summarize all modified settings with their final numeric values or asset references.`;
149
-
150
- return [{
151
- role: 'user',
152
- content: { type: 'text', text }
153
- }];
154
- }
155
- },
156
- {
157
- name: 'setup_dynamic_day_night_cycle',
158
- description: 'Create or update a Blueprint to drive a dynamic day/night cycle with optional weather hooks.',
159
- arguments: {
160
- startTime: {
161
- type: 'string',
162
- enum: ['dawn', 'noon', 'dusk', 'midnight'],
163
- default: 'dawn',
164
- description: 'Initial lighting state for the cycle.'
165
- },
166
- transitionMinutes: {
167
- type: 'number',
168
- default: 5,
169
- description: 'Game-time minutes to blend between major lighting states.'
170
- },
171
- enableWeather: {
172
- type: 'boolean',
173
- default: false,
174
- description: 'Whether to expose hooks for weather-driven sky adjustments.'
175
- }
176
- },
177
- build: (args) => {
178
- const startTime = clampChoice(args.startTime, ['dawn', 'noon', 'dusk', 'midnight'], 'dawn');
179
- const transitionMinutes = coerceNumber(args.transitionMinutes, 5, 1, 60);
180
- const enableWeather = Boolean(args.enableWeather);
181
-
182
- const weatherLine = enableWeather
183
- ? '- Expose interfaces for cloud opacity, precipitation-driven skylight updates, and lightning flashes.'
184
- : '- Weather hooks are disabled; keep the blueprint lean';
185
-
186
- const text = `Implement a Blueprint-based day/night cycle manager.
187
- - Start the sequence at ${startTime} lighting.
188
- - Advance sun rotation, skylight captures, fog, and sky atmosphere continuously with ${transitionMinutes} minute blends between key states.
189
- - Sync directional light intensity/color with real-world sun elevation and inject moonlight at night.
190
- - ${weatherLine}.
191
- - Provide editor controls for time-of-day multiplier and manual overrides.
192
- - Document the generated blueprint path and exposed parameters.`;
193
-
194
- return [{
195
- role: 'user',
196
- content: { type: 'text', text }
197
- }];
198
- }
199
- },
200
- {
201
- name: 'design_cinematic_camera_move',
202
- description: 'Author a sequencer shot with a polished camera move and easing markers.',
203
- arguments: {
204
- durationSeconds: {
205
- type: 'number',
206
- default: 6,
207
- description: 'Shot duration in seconds.'
208
- },
209
- moveStyle: {
210
- type: 'string',
211
- enum: ['push_in', 'orbit', 'tracking', 'crane'],
212
- default: 'push_in',
213
- description: 'Camera move archetype to emphasize.'
214
- },
215
- focusTarget: {
216
- type: 'string',
217
- description: 'Optional actor or component name to keep in focus.',
218
- required: false
219
- }
220
- },
221
- build: (args) => {
222
- const duration = coerceNumber(args.durationSeconds, 6, 2, 30);
223
- const moveStyle = clampChoice(args.moveStyle, ['push_in', 'orbit', 'tracking', 'crane'], 'push_in');
224
- const focusLine = typeof args.focusTarget === 'string' && args.focusTarget.trim().length > 0
225
- ? `Lock focus distance on "${args.focusTarget}" and animate depth of field pulls if necessary.`
226
- : 'Pick the most prominent subject in frame and maintain crisp focus throughout the move.';
227
-
228
- const moveHints: Record<string, string> = {
229
- push_in: 'Ease-in push toward the subject with gentle camera roll stabilization.',
230
- orbit: '360° orbit with consistent parallax and a tracked look-at target.',
231
- tracking: 'Match the subject velocity along a spline with smoothed acceleration.',
232
- crane: 'Combine vertical rise with lateral drift for a reveal shot.'
233
- };
234
-
235
- const text = `In Sequencer, author a ${duration.toFixed(1)} second cinematic shot.
236
- - Movement style: ${moveStyle} (${moveHints[moveStyle]}).
237
- - Key auto-exposure, camera focal length, and focal distance for a premium look.
238
- - Add ease-in/ease-out tangents at shot boundaries to avoid abrupt starts/stops.
239
- - ${focusLine}
240
- - Annotate the timeline with intent markers (intro beat, climax, resolve).
241
- - Render a preview range and summarize the created assets.`;
242
-
243
- return [{
244
- role: 'user',
245
- content: { type: 'text', text }
246
- }];
247
- }
248
- }
249
- ];