unreal-engine-mcp-server 0.6.0-beta-c → 0.6.0-beta-e

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 (102) hide show
  1. package/CHANGELOG.md +148 -9
  2. package/README.md +2 -2
  3. package/dist/gateway/gateway-manifest.generated.json +838 -133
  4. package/dist/proxy/native-proxy.js +6 -5
  5. package/dist/server/gateway/gateway-execute-dispatch.js +2 -1
  6. package/dist/server/gateway/gateway-execute-envelope.js +5 -1
  7. package/dist/server/gateway/gateway-execute-lookup.js +1 -1
  8. package/dist/server/gateway/gateway-execute.js +17 -4
  9. package/dist/server/gateway/gateway-schema-validate.js +13 -2
  10. package/dist/server/gateway/gateway-task-results.d.ts +6 -0
  11. package/dist/server/gateway/gateway-task-results.js +40 -0
  12. package/dist/server/tool-registry-manage-tools.js +4 -1
  13. package/dist/tools/catalog/capabilities/generated/canonical-registry.generated.d.ts +2 -2
  14. package/dist/tools/catalog/capabilities/generated/canonical-registry.generated.js +2 -2
  15. package/dist/tools/catalog/capabilities/generated/canonical-registry.generated.json +4079 -618
  16. package/dist/tools/catalog/capabilities/generated/capability-cost-index.generated.d.ts +1 -1
  17. package/dist/tools/catalog/capabilities/generated/capability-cost-index.generated.js +18 -1
  18. package/dist/tools/catalog/capabilities/generated/parent-tool-definitions.generated.js +1546 -212
  19. package/dist/tools/catalog/capabilities/records/aggregate.d.ts +1 -1
  20. package/dist/tools/catalog/capabilities/records/aggregate.js +1 -1
  21. package/dist/tools/catalog/capabilities/records/build-environment/spline.data.js +4 -3
  22. package/dist/tools/catalog/capabilities/records/build-environment/water.data.js +8 -5
  23. package/dist/tools/catalog/capabilities/records/control-actor/advanced-records.js +29 -8
  24. package/dist/tools/catalog/capabilities/records/control-actor/search-records.js +2 -2
  25. package/dist/tools/catalog/capabilities/records/control-actor/spawn-records.js +13 -5
  26. package/dist/tools/catalog/capabilities/records/control-actor/state-records.js +2 -1
  27. package/dist/tools/catalog/capabilities/records/control-actor/transform-records.js +27 -9
  28. package/dist/tools/catalog/capabilities/records/control-editor/asset.js +4 -1
  29. package/dist/tools/catalog/capabilities/records/control-editor/camera.js +5 -1
  30. package/dist/tools/catalog/capabilities/records/control-editor/command.js +5 -1
  31. package/dist/tools/catalog/capabilities/records/control-editor/input.js +2 -1
  32. package/dist/tools/catalog/capabilities/records/control-editor/screenshot.js +2 -1
  33. package/dist/tools/catalog/capabilities/records/control-editor/session.js +8 -1
  34. package/dist/tools/catalog/capabilities/records/control-editor/timing.js +5 -3
  35. package/dist/tools/catalog/capabilities/records/core/builder.d.ts +1 -0
  36. package/dist/tools/catalog/capabilities/records/core/builder.js +1 -0
  37. package/dist/tools/catalog/capabilities/records/folds/build-environment.folds.js +2 -2
  38. package/dist/tools/catalog/capabilities/records/folds/control-actor.folds.js +2 -2
  39. package/dist/tools/catalog/capabilities/records/folds/manage-asset.folds.js +8 -8
  40. package/dist/tools/catalog/capabilities/records/folds/manage-audio.folds.js +5 -5
  41. package/dist/tools/catalog/capabilities/records/folds/manage-blueprint.folds.js +2 -2
  42. package/dist/tools/catalog/capabilities/records/folds/manage-effect.folds.js +3 -3
  43. package/dist/tools/catalog/capabilities/records/folds/manage-sequence.folds.js +6 -6
  44. package/dist/tools/catalog/capabilities/records/folds/system-control.folds.js +2 -2
  45. package/dist/tools/catalog/capabilities/records/gameplay/animation-physics/animation-properties.js +7 -5
  46. package/dist/tools/catalog/capabilities/records/gameplay/animation-physics/authoring-1.data.js +86 -1
  47. package/dist/tools/catalog/capabilities/records/gameplay/animation-physics/authoring-2.data.js +7 -2
  48. package/dist/tools/catalog/capabilities/records/gameplay/manage-effect/effect-properties.js +7 -6
  49. package/dist/tools/catalog/capabilities/records/gameplay/manage-effect/effect.data.js +38 -27
  50. package/dist/tools/catalog/capabilities/records/inspect/component-actor.data.js +1 -1
  51. package/dist/tools/catalog/capabilities/records/inspect/object-property.data.js +188 -10
  52. package/dist/tools/catalog/capabilities/records/inspect/properties.d.ts +1 -0
  53. package/dist/tools/catalog/capabilities/records/inspect/properties.js +2 -1
  54. package/dist/tools/catalog/capabilities/records/inspect/runtime.data.js +2 -1
  55. package/dist/tools/catalog/capabilities/records/inspect/stats.data.js +6 -2
  56. package/dist/tools/catalog/capabilities/records/manage-asset/asset-advanced.js +46 -0
  57. package/dist/tools/catalog/capabilities/records/manage-asset/asset-lifecycle.js +2 -2
  58. package/dist/tools/catalog/capabilities/records/manage-asset/asset-query.js +4 -3
  59. package/dist/tools/catalog/capabilities/records/manage-asset/builder.d.ts +3 -0
  60. package/dist/tools/catalog/capabilities/records/manage-asset/builder.js +3 -0
  61. package/dist/tools/catalog/capabilities/records/manage-asset/content-sources.js +3 -1
  62. package/dist/tools/catalog/capabilities/records/manage-asset/material-create.js +17 -2
  63. package/dist/tools/catalog/capabilities/records/manage-asset/material-graph.js +7 -5
  64. package/dist/tools/catalog/capabilities/records/manage-asset/material-params.js +5 -5
  65. package/dist/tools/catalog/capabilities/records/manage-audio/authoring.data.js +15 -5
  66. package/dist/tools/catalog/capabilities/records/manage-audio/runtime.data.js +1 -0
  67. package/dist/tools/catalog/capabilities/records/manage-blueprint/functions-events.js +3 -2
  68. package/dist/tools/catalog/capabilities/records/manage-blueprint/graph-batch.js +2 -2
  69. package/dist/tools/catalog/capabilities/records/manage-blueprint/graph-pins.js +6 -2
  70. package/dist/tools/catalog/capabilities/records/manage-blueprint/properties.js +4 -2
  71. package/dist/tools/catalog/capabilities/records/manage-blueprint/scs-components.js +7 -2
  72. package/dist/tools/catalog/capabilities/records/manage-blueprint/variables-metadata.js +8 -2
  73. package/dist/tools/catalog/capabilities/records/manage-blueprint/widget-animation.js +14 -4
  74. package/dist/tools/catalog/capabilities/records/manage-blueprint/widget-lifecycle.js +13 -5
  75. package/dist/tools/catalog/capabilities/records/manage-blueprint/widget-panels.js +1 -1
  76. package/dist/tools/catalog/capabilities/records/manage-sequence/cinematic.js +12 -3
  77. package/dist/tools/catalog/capabilities/records/manage-sequence/helpers.js +2 -2
  78. package/dist/tools/catalog/capabilities/records/manage-sequence/mrq.js +23 -4
  79. package/dist/tools/catalog/capabilities/records/manage-sequence/timeline-bindings.js +2 -2
  80. package/dist/tools/catalog/capabilities/records/manage-sequence/timeline-lifecycle.js +7 -2
  81. package/dist/tools/catalog/capabilities/records/manage-sequence/timeline-playback.js +9 -5
  82. package/dist/tools/catalog/capabilities/records/manage-sequence/timeline-state-ranges.js +19 -0
  83. package/dist/tools/catalog/capabilities/records/manage-sequence/timeline-tracks.js +10 -5
  84. package/dist/tools/catalog/capabilities/records/manage-tools/index.js +30 -2
  85. package/dist/tools/catalog/capabilities/records/system-control/console.js +3 -1
  86. package/dist/tools/catalog/capabilities/records/system-control/system-ops.js +122 -10
  87. package/dist/tools/catalog/capabilities/records/utility/output-glossary.js +11 -0
  88. package/dist/tools/catalog/capabilities/records/utility/utility-schema-pins.js +6 -3
  89. package/dist/tools/catalog/capabilities/records/world/manage-geometry.optimize.data.js +29 -0
  90. package/dist/tools/catalog/capabilities/records/world/manage-geometry.primitives.data.js +2 -1
  91. package/dist/tools/catalog/capabilities/records/world/properties.js +2 -2
  92. package/dist/tools/catalog/capabilities/semantic/envelope.d.ts +1 -1
  93. package/dist/tools/catalog/capabilities/semantic/errors.d.ts +1 -1
  94. package/dist/tools/catalog/unreal-gateway-definition.js +2 -2
  95. package/dist/utils/responses/gateway-reply-compaction.d.ts +6 -0
  96. package/dist/utils/responses/gateway-reply-compaction.js +264 -0
  97. package/dist/utils/responses/response-content.d.ts +0 -1
  98. package/dist/utils/responses/response-content.js +0 -172
  99. package/dist/utils/responses/response-validator.d.ts +1 -1
  100. package/dist/utils/responses/response-validator.js +39 -8
  101. package/package.json +2 -2
  102. package/server.json +2 -2
@@ -23,6 +23,16 @@ export const UTILITY_OUTPUT_FIELDS = Object.freeze({
23
23
  consumeInput: bool('Whether the Input Action consumes the input it handles.'),
24
24
  effectiveInOpenLevel: bool('Whether the open level runs this game mode in play: its World Settings override names it, or it has none and this is the project default.'),
25
25
  duration: num('Length of the inspected sound in seconds.'),
26
+ peakDb: num('Loudest level the sound reached, in dB of full scale (0 is full scale, -120 means no signal). The mixer meters each sound after its own volume and before distance attenuation; the editor being in the background does not lower it.'),
27
+ averageDb: num('Mean level over every reading in dB, the release tail included.'),
28
+ silent: bool('True when the peak stayed below -60 dB: the sound played but produced no audio; the warning says the likely cause.'),
29
+ envelopeUpdates: num('Meter readings that arrived, about one per editor frame; 0 means the engine never rendered the sound.'),
30
+ endedBecause: str('finished (the sound ended on its own), maxSeconds (cut there, as looping sounds and music always are) or stopped (stopped by another call, or its Play-In-Editor world ended).'),
31
+ timeline: { type: 'array', items: { type: ['number', 'null'] }, description: 'Loudest reading in dB in each timelineStepSeconds step from the start, null for a step no reading landed in (a slow editor frame).' },
32
+ timelineStepSeconds: num('Seconds each timeline entry covers: 0.05 for sounds up to 5 s, longer so there are at most 100 entries.'),
33
+ wavePeakDb: num('A Sound Wave only: the loudest sample of the recording itself, in dB of full scale, read from its imported audio rather than the meter, so it holds however few frames the editor drew. Before volume. Compare sounds by this when matching levels.'),
34
+ waveRmsDb: num('A Sound Wave only: the average (RMS) level of the whole recording in dB, before volume.'),
35
+ waveSeconds: num('A Sound Wave only: the length of the recording in seconds.'),
26
36
  existsAfter: bool('Whether the asset still resolved after the action completed.'),
27
37
  falloffDistance: num('Distance in centimetres over which the attenuation falls off.'),
28
38
  functionName: str('Name of the Blueprint RPC function that was created.'),
@@ -49,6 +59,7 @@ export const UTILITY_OUTPUT_FIELDS = Object.freeze({
49
59
  rootNodeClass: str('Class of the node now at the root of the Sound Cue.'),
50
60
  drivesNode: str('Name of the node the inserted node now plays.'),
51
61
  saved: bool('Whether the asset was saved to disk.'),
62
+ oneShot: bool('Whether the new MetaSound is a one-shot source; false when it was made continuous (no On Finished output).'),
52
63
  nodes: { type: 'array', items: { type: 'object', additionalProperties: true, [REFLECTION_BOUNDARY]: true }, description: 'Every node: nodeId, name, className, kind (Node, GraphInput, GraphOutput, Literal, Variable...), inputs [{name, type, literal}] and outputs [{name, type}].' },
53
64
  nodeIds: reflected('Batch step id -> node id for every node the batch created.'),
54
65
  numChannels: num('Number of audio channels in the inspected Sound Wave.'),
@@ -7,7 +7,7 @@ export const BOOLEAN_FIELDS = new Set([
7
7
  'canRespawn', 'systemWide', 'makeDefault',
8
8
  'indefinite', 'bypass', 'applyToChildren', 'applyEQ', 'spatialize', 'replace',
9
9
  'shift', 'ctrl', 'alt', 'cmd',
10
- 'smoothing', 'all',
10
+ 'smoothing', 'all', 'oneShot',
11
11
  ]);
12
12
  export const NUMBER_FIELDS = new Set([
13
13
  'volume', 'pitch', 'startTime', 'fadeTime', 'fadeInTime', 'fadeOutTime',
@@ -24,6 +24,7 @@ export const NUMBER_FIELDS = new Set([
24
24
  'midFrequency', 'midGain', 'highMidFrequency', 'highMidGain', 'highFrequency', 'highGain',
25
25
  'density', 'diffusion', 'gain', 'gainHF', 'decayTime', 'decayHFRatio', 'lfeBleed',
26
26
  'voiceCenterChannelVolume', 'micInputGain', 'noiseGateThreshold', 'silenceDetectionThreshold', 'sampleRate',
27
+ 'maxSeconds',
27
28
  ]);
28
29
  export const OBJECT_FIELDS = new Set(['properties', 'settings', 'voiceSettings', 'eqSettings']);
29
30
  export const VECTOR_FIELDS = new Set(['location', 'rotation', 'size']);
@@ -44,7 +45,7 @@ export const FIELD_DESCRIPTIONS = {
44
45
  attachPointName: 'Socket or bone name to attach the sound to.',
45
46
  attenuationPath: 'Canonical /Game SoundAttenuation asset path.',
46
47
  attenuationShape: 'Attenuation shape (Sphere, Capsule, Box, Cone).',
47
- autoPlay: 'Whether the sound starts playing when it is created (default true).',
48
+ autoPlay: 'Whether the sound plays now and again every time the game starts (default true); false leaves starting it to a Blueprint.',
48
49
  componentName: 'Name of the component to create or address.',
49
50
  concurrencyPath: 'Canonical /Game SoundConcurrency asset path.',
50
51
  defaultValue: 'Default value for the input.',
@@ -60,12 +61,14 @@ export const FIELD_DESCRIPTIONS = {
60
61
  fadeType: 'Fade curve type (FadeTo, FadeIn, FadeOut).',
61
62
  falloffDistance: 'Distance over which attenuation falls off, in centimetres.',
62
63
  falloffMode: 'Attenuation falloff mode.',
63
- innerRadius: 'Inner radius of full volume, in centimetres.',
64
+ innerRadius: 'Inner radius of full volume, in centimetres: a Box shape takes it as its half-size on every axis, a Capsule as its radius (half height at least that), a Sphere or Cone as its radius.',
64
65
  inputName: 'Graph input name.',
65
66
  inputType: 'Graph input data type (Float, Int32, Bool, String, Trigger, Audio).',
66
67
  location: 'World location as [x, y, z] (an {x, y, z} object is accepted).',
67
68
  looping: 'Whether playback loops.',
69
+ oneShot: 'Whether the MetaSound is a one-shot source that ends when On Finished fires; false is a continuous source the engine virtualizes like a loop.',
68
70
  lowPassFilterFrequency: 'Low-pass filter cutoff frequency in Hz.',
71
+ maxSeconds: 'Longest the measurement runs, in seconds (default 5, 0.2 to 20). A sound that ends sooner ends it then; looping sounds, music and MetaSounds that never trigger On Finished play until this.',
69
72
  mixName: 'Sound Mix name.',
70
73
  nodeClassName: 'Node class name; short names such as Sine resolve against the MetaSound registry (UE.Sine.Audio).',
71
74
  nodeType: 'Node type or class short name.',
@@ -236,6 +236,35 @@ export const GEOMETRY_OPTIMIZE_RECORDS = [
236
236
  },
237
237
  exampleInput: { action: 'convert_to_static_mesh', targetActor: 'DM_A', outputPath: '/Game/Meshes/SM_Baked', materials: ['/Engine/BasicShapes/BasicShapeMaterial'] },
238
238
  }),
239
+ buildWorldRecord({
240
+ parentTool: 'manage_geometry', action: 'split_mesh', plugins: PLUGIN,
241
+ topics: ['split mesh', 'separate mesh parts', 'break a mesh apart', 'mesh pack into separate props', 'split mesh by material'],
242
+ family: F, summary: 'Split a static mesh asset into one static mesh per connected part (or per material slot), each with its own pivot, the materials it uses and a collision choice.',
243
+ whenToUse: ['A library pack or kit came in as one static mesh and its props must be placed one by one: split it, then place each new mesh (offset says where its pivot stood in the source, so the original layout can be rebuilt).',
244
+ 'A mesh must be separated by material slot (by material).'],
245
+ whenNotToUse: ['A dynamic mesh actor being modelled must become an asset (use convert_to_static_mesh).'],
246
+ inputProps: {
247
+ meshPath: { type: 'string', description: 'The static mesh asset to split; it is not changed.' },
248
+ by: { type: 'string', enum: ['parts', 'material'], description: 'parts (default): one mesh per separate object, where connected pieces whose bounds touch or come within gap cm are one object (a crate\'s planks stay one crate); material: one per material slot.' },
249
+ gap: { type: 'number', description: 'With by parts: pieces whose bounds come within this many cm of each other are one object (default 2).' },
250
+ outputPath: { type: 'string', description: 'Folder for the new meshes (default: the folder of the source mesh).' },
251
+ namePrefix: { type: 'string', description: 'Names are <namePrefix>01, <namePrefix>02 ..., largest part first (default <source name>_Part); a name already taken refuses the split before anything is made.' },
252
+ pivot: { type: 'string', enum: ['bottom', 'center', 'source'], description: 'Each new mesh\'s pivot: bottom (default), the bottom centre of its bounds, so it stands on what it is placed on; center; or source, the source\'s own origin.' },
253
+ minTriangles: { type: 'number', description: 'Objects with fewer triangles are left out (default 12): loose bits, decal cards.' },
254
+ maxParts: { type: 'number', description: 'More parts than this (default 64) refuses the split with nothing made.' },
255
+ dropRepeats: { type: 'boolean', description: 'Leave out an object that only repeats a larger one where it stands, such as an LOD copy an importer merged into the mesh (default true).' },
256
+ dryRun: { type: 'boolean', description: 'Answer the meshes the split would make (size, triangles, offset, and exists when the name is taken) and create nothing, to tune gap and minTriangles first. A large pack can take longer than one call waits.' },
257
+ collision: CONVERT_COLLISION,
258
+ },
259
+ required: ['meshPath'], effect: 'write', costLatency: 'interactive', costResources: 'medium',
260
+ outputProps: {
261
+ meshPath: { type: 'string', description: 'The source mesh.' },
262
+ meshes: { type: 'array', description: 'One entry per new mesh, largest first: assetPath, triangles, size [x, y, z], offset [x, y, z] (its pivot in the source\'s space), slots; saved: false when it could not be written to disk.', items: { type: 'object', additionalProperties: true, 'x-unreal-reflection-boundary': true } },
263
+ skippedSmall: { type: 'number', description: 'Objects left out for having fewer than minTriangles triangles.' },
264
+ droppedRepeats: { type: 'number', description: 'Objects left out as repeats of a larger one.' },
265
+ },
266
+ exampleInput: { action: 'split_mesh', meshPath: '/Game/Imports/SM_CratePack', outputPath: '/Game/Props/Crates', namePrefix: 'SM_Crate' },
267
+ }),
239
268
  buildWorldRecord({
240
269
  parentTool: 'manage_geometry', action: 'get_mesh_info', plugins: PLUGIN,
241
270
  topics: ['vertex count', 'triangle count', 'has uvs and normals', 'how many vertices does a mesh have'],
@@ -85,7 +85,7 @@ export const GEOMETRY_PRIMITIVES_RECORDS = [
85
85
  }),
86
86
  buildWorldRecord({
87
87
  parentTool: 'manage_geometry', action: 'create_plane', plugins: PLUGIN,
88
- family: F, summary: 'Create a plane dynamic mesh actor.', whenToUse: ['A flat plane primitive must be created.'], whenNotToUse: ['A box is needed; use create_box.'],
88
+ family: F, summary: 'Create a plane dynamic mesh actor: flat in XY, centred on its origin, facing +Z.', whenToUse: ['A flat plane primitive must be created.', 'A sign, banner or flag needs a subdivided sheet: stand the plane up with a 90 degree roll on the component that draws it.'], whenNotToUse: ['A box is needed; use create_box.'],
89
89
  inputProps: { ...IDENT, ...XFORM, width: P.width, depth: P.depth, widthSegments: P.widthSegments, heightSegments: P.heightSegments }, required: [], effect: 'write', costLatency: 'interactive', costResources: 'low',
90
90
  exampleInput: { action: 'create_plane', width: 500, depth: 500 },
91
91
  }),
@@ -150,6 +150,7 @@ export const GEOMETRY_PRIMITIVES_RECORDS = [
150
150
  materialId: { type: 'integer', description: 'Material slot of that surface.' },
151
151
  triangles: { type: 'integer', description: 'Triangles of that surface; 0 when another shape covered it entirely.' },
152
152
  copies: { type: 'integer', description: 'How many shapes this entry became with its repeat and mirror (the shape itself included); absent for a single shape.' },
153
+ warning: { type: 'string', description: 'Present when a union shape is under two grid cells across: its surface can come out ragged, or as almost nothing when it formed under 24 triangles; raise resolution or thicken it.' },
153
154
  },
154
155
  },
155
156
  },
@@ -99,13 +99,13 @@ export const P = {
99
99
  topRadius: num('Cone top radius; non-zero makes a truncated cone. Defaults to 0.'),
100
100
  floating: bool('Build the stairs as free-floating steps with no solid underside.'),
101
101
  width: num('Primitive width along X.'),
102
- depth: num('Primitive depth along Z.'),
102
+ depth: num('Primitive depth: a box\'s size along Z; a plane\'s size along Y (a plane lies flat in XY, centred, facing +Z).'),
103
103
  scale: vec3('Spawn scale {x, y, z}.'),
104
104
  thickness: num('Shell wall thickness (scalar).'),
105
105
  innerRadius: num('Inner radius (torus minor radius, ring/pipe inner wall).'),
106
106
  outerRadius: num('Outer radius for ring and pipe primitives.'),
107
107
  widthSegments: int('Tessellation segments along width.'),
108
- heightSegments: int('Tessellation segments along height.'),
108
+ heightSegments: int('Tessellation segments along height (on a plane, along its depth, Y).'),
109
109
  depthSegments: int('Tessellation segments along depth.'),
110
110
  radialSegments: int('Radial tessellation segments for circular primitives.'),
111
111
  numSides: int('Number of sides for cylinder, cone, disc, ring, torus.'),
@@ -104,8 +104,8 @@ export declare const ReceiptSchema: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.Zod
104
104
  state: z.ZodEnum<{
105
105
  completed: "completed";
106
106
  failed: "failed";
107
- running: "running";
108
107
  queued: "queued";
108
+ running: "running";
109
109
  cancelled: "cancelled";
110
110
  }>;
111
111
  progress: z.ZodOptional<z.ZodNumber>;
@@ -102,8 +102,8 @@ export declare const TaskStatusSchema: z.ZodReadonly<z.ZodObject<{
102
102
  state: z.ZodEnum<{
103
103
  completed: "completed";
104
104
  failed: "failed";
105
- running: "running";
106
105
  queued: "queued";
106
+ running: "running";
107
107
  cancelled: "cancelled";
108
108
  }>;
109
109
  progress: z.ZodOptional<z.ZodNumber>;
@@ -61,7 +61,7 @@ export const unrealGatewayToolDefinition = {
61
61
  package: { type: 'integer', minimum: 1 }
62
62
  },
63
63
  additionalProperties: false,
64
- description: 'Live editor-state revisions to pin; the call is refused with STALE_STATE when one has moved.'
64
+ description: 'Live editor-state revisions to pin, as the ue://state/revisions resource reports them; the call is refused with STALE_STATE when one has moved.'
65
65
  },
66
66
  timeoutMs: { type: 'integer', minimum: 1, maximum: 600000, description: 'Deadline for this call in milliseconds.' }
67
67
  },
@@ -86,7 +86,7 @@ export const unrealGatewayToolDefinition = {
86
86
  message: { type: 'string' },
87
87
  results: { type: 'array' },
88
88
  result: {},
89
- data: { description: "Execute payload projected against the capability's declared output schema. Bound to receipt.dataDigest, and the same location the native /mcp surface publishes." },
89
+ data: { description: "Execute payload projected against the capability's declared output schema; the same location the native /mcp surface publishes." },
90
90
  tool: { type: 'string' },
91
91
  action: { type: 'string' },
92
92
  param: { type: 'string' },
@@ -0,0 +1,6 @@
1
+ export declare const LOG_ONLY_EXECUTE_FIELDS: readonly ["capabilityId", "capability", "tool", "action", "status", "options", "catalogRevision", "capabilityRevision", "schemaRevision", "correlationId", "replayedFrom", "liveRevisions"];
2
+ export declare const RESOLVED_IDENTITY_FIELDS: readonly ["capabilityId", "capability", "tool", "action"];
3
+ export declare const RECEIPT_OUTCOME_LISTS: readonly ["nextCalls", "handles", "changes", "warnings"];
4
+ export declare const STOCK_OUTPUT_PROPERTIES: Readonly<Record<string, string>>;
5
+ export declare function compactGatewayReply(reply: unknown): unknown;
6
+ //# sourceMappingURL=gateway-reply-compaction.d.ts.map
@@ -0,0 +1,264 @@
1
+ import { isRecord } from '../validation/type-guards.js';
2
+ export const LOG_ONLY_EXECUTE_FIELDS = [
3
+ 'capabilityId', 'capability', 'tool', 'action', 'status', 'options', 'catalogRevision',
4
+ 'capabilityRevision', 'schemaRevision', 'correlationId', 'replayedFrom', 'liveRevisions'
5
+ ];
6
+ export const RESOLVED_IDENTITY_FIELDS = ['capabilityId', 'capability', 'tool', 'action'];
7
+ export const RECEIPT_OUTCOME_LISTS = ['nextCalls', 'handles', 'changes', 'warnings'];
8
+ export const STOCK_OUTPUT_PROPERTIES = {
9
+ success: 'Whether the action succeeded.',
10
+ message: 'Human-readable result message.',
11
+ details: 'Additional handler result fields not named by the contract.'
12
+ };
13
+ const SEARCH_ROW_RANKING_FIELDS = ['matchReasons', 'score'];
14
+ const same = (left, right) => left !== undefined && right !== undefined && JSON.stringify(left) === JSON.stringify(right);
15
+ function omit(source, keys) {
16
+ const out = { ...source };
17
+ for (const key of keys)
18
+ delete out[key];
19
+ return out;
20
+ }
21
+ function strings(value) {
22
+ return Array.isArray(value) ? value.filter((item) => typeof item === 'string') : [];
23
+ }
24
+ function withoutListed(payload, field, listed) {
25
+ const out = { ...payload };
26
+ const list = out[field];
27
+ if (Array.isArray(list) && list.every((item) => typeof item === 'string' && listed.includes(item)))
28
+ delete out[field];
29
+ if (isRecord(out.details))
30
+ out.details = withoutListed(out.details, field, listed);
31
+ return out;
32
+ }
33
+ function withoutRepeatedValues(data) {
34
+ if (!isRecord(data.details))
35
+ return data;
36
+ const declared = Object.entries(data).filter(([key, value]) => key !== 'details' && typeof value === 'string').map(([, value]) => value);
37
+ const details = { ...data.details };
38
+ for (const [key, value] of Object.entries(details)) {
39
+ if (typeof value === 'string' && value.length >= 8 && declared.includes(value))
40
+ delete details[key];
41
+ }
42
+ const out = { ...data, details };
43
+ if (Object.keys(details).length === 0)
44
+ delete out.details;
45
+ return out;
46
+ }
47
+ function receiptOutcome(receipt, reply) {
48
+ const out = {};
49
+ for (const key of RECEIPT_OUTCOME_LISTS) {
50
+ const list = receipt[key];
51
+ if (Array.isArray(list) && list.length > 0)
52
+ out[key] = list;
53
+ }
54
+ if (isRecord(receipt.task))
55
+ out.task = receipt.task;
56
+ if (isRecord(receipt.error)) {
57
+ const typed = isRecord(reply.typedError) ? reply.typedError : {};
58
+ const error = { ...receipt.error };
59
+ for (const key of Object.keys(error)) {
60
+ if (same(error[key], typed[key]) || same(error[key], reply[key]))
61
+ delete error[key];
62
+ }
63
+ if (Object.keys(error).length > 0)
64
+ out.error = error;
65
+ }
66
+ return Object.keys(out).length > 0 ? out : undefined;
67
+ }
68
+ const DETAIL_BOOKKEEPING = ['type', 'requestId', 'liveRevisions'];
69
+ function compactDetail(detail, reply) {
70
+ const out = omit(detail, DETAIL_BOOKKEEPING);
71
+ if (same(out.success, reply.success))
72
+ delete out.success;
73
+ if (same(out.message, reply.message))
74
+ delete out.message;
75
+ if (same(out.error, reply.message) || same(out.error, reply.errorCode))
76
+ delete out.error;
77
+ if (isRecord(out.error) && same(out.error.message, reply.message) && same(out.error.code, reply.errorCode))
78
+ delete out.error;
79
+ if (isRecord(out.data) && Object.keys(out.data).length === 0)
80
+ delete out.data;
81
+ if (isRecord(out.result)) {
82
+ const inner = compactDetail(out.result, reply);
83
+ if (inner === undefined)
84
+ delete out.result;
85
+ else
86
+ out.result = inner;
87
+ }
88
+ return Object.keys(out).length > 0 ? out : undefined;
89
+ }
90
+ function compactTypedError(typedError, reply) {
91
+ const out = { ...typedError };
92
+ for (const key of Object.keys(out)) {
93
+ if (same(out[key], reply[key]))
94
+ delete out[key];
95
+ }
96
+ if (same(out.handlerCode, reply.errorCode))
97
+ delete out.handlerCode;
98
+ if (isRecord(out.unrealDetail)) {
99
+ const detail = compactDetail(out.unrealDetail, reply);
100
+ if (detail === undefined)
101
+ delete out.unrealDetail;
102
+ else
103
+ out.unrealDetail = detail;
104
+ }
105
+ return out;
106
+ }
107
+ function compactExecute(reply) {
108
+ const out = omit(reply, LOG_ONLY_EXECUTE_FIELDS);
109
+ const migrated = isRecord(reply.migratedFrom) ? reply.migratedFrom : undefined;
110
+ const translated = reply.resolvedFromAlias !== undefined ||
111
+ (migrated !== undefined && !(same(migrated.tool, reply.tool) && same(migrated.action, reply.action)));
112
+ if (translated) {
113
+ for (const key of RESOLVED_IDENTITY_FIELDS)
114
+ if (key in reply)
115
+ out[key] = reply[key];
116
+ }
117
+ else {
118
+ delete out.migratedFrom;
119
+ }
120
+ if (same(out.error, out.message))
121
+ delete out.error;
122
+ if (out.success === true && isRecord(out.data))
123
+ delete out.result;
124
+ if (out.success === false && isRecord(out.result)) {
125
+ const detail = compactDetail(out.result, out);
126
+ if (detail === undefined)
127
+ delete out.result;
128
+ else
129
+ out.result = detail;
130
+ }
131
+ const receipt = isRecord(reply.receipt) ? receiptOutcome(reply.receipt, reply) : undefined;
132
+ if (receipt === undefined)
133
+ delete out.receipt;
134
+ else
135
+ out.receipt = receipt;
136
+ if (isRecord(out.typedError))
137
+ out.typedError = compactTypedError(out.typedError, out);
138
+ const listed = strings(receipt?.warnings);
139
+ if (Array.isArray(out.warnings) && out.warnings.every((item) => typeof item === 'string' && listed.includes(item))) {
140
+ delete out.warnings;
141
+ }
142
+ if (isRecord(out.data)) {
143
+ const changes = strings(receipt?.changes);
144
+ let data = withoutListed(out.data, 'warnings', listed);
145
+ for (const field of ['changedAssets', 'changedEntities', 'deleted'])
146
+ data = withoutListed(data, field, changes);
147
+ data = withoutRepeatedValues(data);
148
+ if (same(data.success, out.success))
149
+ delete data.success;
150
+ if (same(data.message, out.message))
151
+ delete data.message;
152
+ out.data = data;
153
+ }
154
+ return out;
155
+ }
156
+ function compactSchema(schema, parameters) {
157
+ const out = omit(schema, ['$schema']);
158
+ if (!isRecord(out.properties) || !Array.isArray(parameters))
159
+ return out;
160
+ const listed = new Map(parameters.filter(isRecord).map((parameter) => [parameter.name, parameter.description]));
161
+ const properties = {};
162
+ for (const [name, property] of Object.entries(out.properties)) {
163
+ properties[name] = isRecord(property) && same(property.description, listed.get(name))
164
+ ? omit(property, ['description'])
165
+ : property;
166
+ }
167
+ out.properties = properties;
168
+ return out;
169
+ }
170
+ function compactOutputSchema(schema) {
171
+ const out = omit(schema, ['$schema']);
172
+ const removed = [];
173
+ if (isRecord(out.properties)) {
174
+ const properties = { ...out.properties };
175
+ for (const [name, text] of Object.entries(STOCK_OUTPUT_PROPERTIES)) {
176
+ const property = properties[name];
177
+ if (isRecord(property) && property.description === text) {
178
+ delete properties[name];
179
+ removed.push(name);
180
+ }
181
+ }
182
+ if (Object.keys(properties).length === 0)
183
+ return undefined;
184
+ out.properties = properties;
185
+ }
186
+ if (Array.isArray(out.required)) {
187
+ const required = out.required.filter((name) => typeof name !== 'string' || !removed.includes(name));
188
+ if (required.length > 0)
189
+ out.required = required;
190
+ else
191
+ delete out.required;
192
+ }
193
+ return out;
194
+ }
195
+ const DESCRIBE_INTERNAL_FIELDS = ['topics', 'category', 'perActionSchemas'];
196
+ function compactDescribe(reply) {
197
+ const out = omit(reply, ['hashes', 'exampleCount']);
198
+ if (out.scope !== 'capability' && out.scope !== 'parameter')
199
+ return out;
200
+ if (out.success === true)
201
+ delete out.message;
202
+ for (const key of DESCRIBE_INTERNAL_FIELDS)
203
+ delete out[key];
204
+ const pair = { tool: out.tool ?? out.parentTool, action: out.action };
205
+ if (Array.isArray(out.aliases) && out.aliases.length === 0)
206
+ delete out.aliases;
207
+ if (Array.isArray(out.legacyIds) && out.legacyIds.length === 1 && same(out.legacyIds[0], pair))
208
+ delete out.legacyIds;
209
+ if (same(out.migratedFrom, pair))
210
+ delete out.migratedFrom;
211
+ if (Array.isArray(out.parameters) && out.parameterCount === out.parameters.length)
212
+ delete out.parameterCount;
213
+ if (out.runnable === true)
214
+ delete out.runnable;
215
+ for (const key of ['parent', 'parentTool']) {
216
+ if (same(out[key], out.tool))
217
+ delete out[key];
218
+ }
219
+ if (isRecord(out.behavior) && same(out.behavior.effect, out.effect))
220
+ out.behavior = omit(out.behavior, ['effect']);
221
+ if (Array.isArray(out.examples)) {
222
+ out.examples = out.examples.map((example) => isRecord(example) && same(example.title, out.summary) ? omit(example, ['title']) : example);
223
+ }
224
+ if (isRecord(out.inputSchema))
225
+ out.inputSchema = compactSchema(out.inputSchema, out.parameters);
226
+ if (isRecord(out.outputSchema)) {
227
+ const outputSchema = compactOutputSchema(out.outputSchema);
228
+ if (outputSchema === undefined)
229
+ delete out.outputSchema;
230
+ else
231
+ out.outputSchema = outputSchema;
232
+ }
233
+ return out;
234
+ }
235
+ function compactSearch(reply) {
236
+ const out = omit(reply, ['query']);
237
+ if (out.success === true)
238
+ delete out.message;
239
+ if (Array.isArray(out.results)) {
240
+ out.results = out.results.map((row) => {
241
+ if (!isRecord(row))
242
+ return row;
243
+ const kept = omit(row, SEARCH_ROW_RANKING_FIELDS);
244
+ const nextTool = isRecord(row.nextCall) ? row.nextCall.tool : undefined;
245
+ for (const key of ['parent', 'parentTool']) {
246
+ if (same(kept[key], nextTool))
247
+ delete kept[key];
248
+ }
249
+ return kept;
250
+ });
251
+ }
252
+ return out;
253
+ }
254
+ export function compactGatewayReply(reply) {
255
+ if (!isRecord(reply))
256
+ return reply;
257
+ switch (reply.operation) {
258
+ case 'execute': return compactExecute(reply);
259
+ case 'describe': return compactDescribe(reply);
260
+ case 'search': return compactSearch(reply);
261
+ default: return reply;
262
+ }
263
+ }
264
+ //# sourceMappingURL=gateway-reply-compaction.js.map
@@ -1,5 +1,4 @@
1
1
  export declare function hasExplicitFailurePayload(payload: unknown): boolean;
2
2
  export declare function flattenPayloadWrappers(payload: Record<string, unknown>): Record<string, unknown>;
3
- export declare function buildSummaryText(toolName: string, payload: unknown): string;
4
3
  export declare function buildImageContent(payload: unknown): Record<string, string> | undefined;
5
4
  //# sourceMappingURL=response-content.d.ts.map
@@ -1,121 +1,10 @@
1
1
  import { isRecord } from '../validation/type-guards.js';
2
- const SUMMARY_SKIP_KEYS = new Set(['requestId', 'type', 'data', 'result', 'warnings', 'imageBase64']);
3
- function normalizeText(text) {
4
- return text.replace(/\s+/g, ' ').trim();
5
- }
6
2
  export function hasExplicitFailurePayload(payload) {
7
3
  if (!isRecord(payload))
8
4
  return false;
9
5
  return (typeof payload.success === 'boolean' && payload.success === false) ||
10
6
  (typeof payload.error === 'string' && payload.error.length > 0);
11
7
  }
12
- function scalarToText(value) {
13
- if (typeof value === 'string')
14
- return value;
15
- if (typeof value === 'number' || typeof value === 'boolean' || typeof value === 'bigint')
16
- return String(value);
17
- return undefined;
18
- }
19
- function formatNestedValue(value) {
20
- const scalar = scalarToText(value);
21
- if (scalar !== undefined)
22
- return scalar;
23
- if (Array.isArray(value))
24
- return `${value.length} item${value.length === 1 ? '' : 's'}`;
25
- if (isRecord(value))
26
- return '{...}';
27
- if (value === null)
28
- return 'null';
29
- return String(value);
30
- }
31
- function formatRecordListItem(record) {
32
- const pinName = scalarToText(record.pinName);
33
- if (pinName !== undefined) {
34
- const pinParts = [`pinName=${pinName}`];
35
- for (const key of ['direction', 'pinType', 'defaultValue']) {
36
- const value = scalarToText(record[key]);
37
- if (value !== undefined)
38
- pinParts.push(`${key}=${value}`);
39
- }
40
- if (Array.isArray(record.linkedTo)) {
41
- const links = record.linkedTo;
42
- if (links.length === 0) {
43
- pinParts.push('linkedTo=0');
44
- }
45
- else {
46
- const shown = links.slice(0, 5).map(link => {
47
- if (isRecord(link)) {
48
- const nodeId = typeof link.nodeId === 'string' ? link.nodeId.slice(0, 8) : '';
49
- const pin = scalarToText(link.pinName);
50
- if (nodeId !== '')
51
- return pin !== undefined && pin !== '' ? `${nodeId}.${pin}` : nodeId;
52
- }
53
- return '?';
54
- });
55
- const spill = links.length > 5 ? ', ...' : '';
56
- pinParts.push(`linkedTo=[${shown.join(', ')}${spill}] (${links.length})`);
57
- }
58
- }
59
- return `{ ${pinParts.join(', ')} }`;
60
- }
61
- for (const key of ['name', 'path', 'id', 'nodeId', 'nodeName', 'className', 'displayName', 'type', 'assetPath', 'objectPath']) {
62
- const value = scalarToText(record[key]);
63
- if (value !== undefined && value.trim() !== '') {
64
- for (const addrKey of ['path', 'assetPath', 'objectPath', 'id']) {
65
- if (addrKey === key)
66
- continue;
67
- const addr = scalarToText(record[addrKey]);
68
- if (addr !== undefined && addr.trim() !== '' && addr !== value)
69
- return `${value} (${addr})`;
70
- }
71
- return value;
72
- }
73
- }
74
- const entries = Object.entries(record).filter(([, value]) => value !== undefined && value !== null).slice(0, 4);
75
- if (entries.length === 0)
76
- return '{}';
77
- const suffix = Object.keys(record).length > entries.length ? ' ...' : '';
78
- return `{ ${entries.map(([key, value]) => `${key}=${formatNestedValue(value)}`).join(', ')}${suffix} }`;
79
- }
80
- const OUTPUT_SUMMARY_LIMIT = 2000;
81
- const ARRAY_PREVIEW_LIMIT = 30;
82
- function formatOutputValue(val) {
83
- if (typeof val !== 'string')
84
- return formatValue(val);
85
- if (val.length <= OUTPUT_SUMMARY_LIMIT)
86
- return val;
87
- return `${val.slice(0, OUTPUT_SUMMARY_LIMIT)}... [output truncated: showing ${OUTPUT_SUMMARY_LIMIT} of ${val.length} chars — full text in structuredContent]`;
88
- }
89
- function formatValue(val) {
90
- if (val === null || val === undefined)
91
- return '';
92
- if (typeof val === 'string')
93
- return val.length > 150 ? val.slice(0, 150) + '...' : val;
94
- if (typeof val === 'number' || typeof val === 'boolean')
95
- return String(val);
96
- if (Array.isArray(val)) {
97
- if (val.length === 0)
98
- return '[] (0)';
99
- const items = val.slice(0, ARRAY_PREVIEW_LIMIT).map(v => isRecord(v) ? formatRecordListItem(v) : String(v));
100
- const suffix = val.length > ARRAY_PREVIEW_LIMIT
101
- ? `, ... (+${val.length - ARRAY_PREVIEW_LIMIT} more - full list in structuredContent)`
102
- : '';
103
- return `[${items.join(', ')}${suffix}] (${val.length})`;
104
- }
105
- if (isRecord(val)) {
106
- const keys = Object.keys(val);
107
- if (keys.some(k => ['x', 'y', 'z', 'pitch', 'yaw', 'roll'].includes(k))) {
108
- const x = val.x ?? val.pitch ?? 0;
109
- const y = val.y ?? val.yaw ?? 0;
110
- const z = val.z ?? val.roll ?? 0;
111
- return `[${x}, ${y}, ${z}]`;
112
- }
113
- const entries = Object.entries(val).slice(0, 8);
114
- const formatted = entries.map(([k, v]) => `${k}=${formatNestedValue(v)}`);
115
- return `{ ${formatted.join(', ')}${keys.length > 8 ? ' ...' : ''} }`;
116
- }
117
- return String(val);
118
- }
119
8
  export function flattenPayloadWrappers(payload) {
120
9
  const effectivePayload = { ...payload };
121
10
  const flattenWrappers = (obj, depth = 0) => {
@@ -135,67 +24,6 @@ export function flattenPayloadWrappers(payload) {
135
24
  flattenWrappers(effectivePayload);
136
25
  return effectivePayload;
137
26
  }
138
- export function buildSummaryText(toolName, payload) {
139
- if (typeof payload === 'string') {
140
- const normalized = payload.trim();
141
- return normalized || `${toolName} responded`;
142
- }
143
- if (typeof payload === 'number' || typeof payload === 'bigint' || typeof payload === 'boolean') {
144
- return `${toolName} responded: ${payload}`;
145
- }
146
- if (!isRecord(payload)) {
147
- return `${toolName} responded`;
148
- }
149
- const effectivePayload = flattenPayloadWrappers(payload);
150
- const parts = [];
151
- const addedKeys = new Set();
152
- for (const key of ['success', 'error']) {
153
- if (effectivePayload[key] !== undefined && !addedKeys.has(key)) {
154
- const formatted = formatValue(effectivePayload[key]);
155
- if (formatted) {
156
- parts.push(`${key}: ${formatted}`);
157
- addedKeys.add(key);
158
- }
159
- }
160
- }
161
- let hasArrays = false;
162
- for (const [key, val] of Object.entries(effectivePayload)) {
163
- if (addedKeys.has(key))
164
- continue;
165
- if (SUMMARY_SKIP_KEYS.has(key))
166
- continue;
167
- if (val === undefined || val === null)
168
- continue;
169
- if (typeof val === 'string' && val.trim() === '')
170
- continue;
171
- if (key === 'message')
172
- continue;
173
- if (Array.isArray(val) && val.length > 0)
174
- hasArrays = true;
175
- if ((key === 'count' || key === 'totalCount') && hasArrays)
176
- continue;
177
- const formatted = key === 'output' ? formatOutputValue(val) : formatValue(val);
178
- if (formatted) {
179
- parts.push(`${key}: ${formatted}`);
180
- addedKeys.add(key);
181
- }
182
- }
183
- const message = typeof effectivePayload.message === 'string' ? normalizeText(effectivePayload.message) : '';
184
- if (message && message.toLowerCase() !== 'success') {
185
- const isDuplicateInfo = /^(found|listed|retrieved|got|loaded|created|deleted|saved|spawned)\s+\d+/i.test(message) ||
186
- /Folders:\s*\[/.test(message) ||
187
- /\d+\s+(assets?|folders?|items?|actors?|components?)\s+(and|in|at)/i.test(message);
188
- const messageInParts = parts.some(p => p.toLowerCase().includes(message.toLowerCase().slice(0, 30)));
189
- if (!isDuplicateInfo && !messageInParts) {
190
- parts.push(message);
191
- }
192
- }
193
- const warnings = Array.isArray(effectivePayload.warnings) ? effectivePayload.warnings : [];
194
- if (warnings.length > 0) {
195
- parts.push(`Warnings: ${warnings.map((w) => typeof w === 'string' ? w : JSON.stringify(w)).join('; ')}`);
196
- }
197
- return parts.length > 0 ? parts.join(' | ') : `${toolName} responded`;
198
- }
199
27
  function findImagePayload(payload, depth = 0) {
200
28
  if (!isRecord(payload) || depth > 5)
201
29
  return undefined;