ue-mcp 1.3.8-beta → 1.3.8-beta.3

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 (62) hide show
  1. package/README.md +2 -2
  2. package/dist/action-class.js +4 -0
  3. package/dist/action-class.js.map +1 -1
  4. package/dist/bridge-parity.d.ts +77 -0
  5. package/dist/bridge-parity.js +96 -0
  6. package/dist/bridge-parity.js.map +1 -0
  7. package/dist/bridge-timeouts.js +2 -0
  8. package/dist/bridge-timeouts.js.map +1 -1
  9. package/dist/flow/guard-schema.d.ts +4 -4
  10. package/dist/flow/guards.js +31 -10
  11. package/dist/flow/guards.js.map +1 -1
  12. package/dist/flow/schema.d.ts +3 -3
  13. package/dist/guard-task.d.ts +125 -0
  14. package/dist/guard-task.js +85 -0
  15. package/dist/guard-task.js.map +1 -0
  16. package/dist/plugin/manifest.d.ts +3 -3
  17. package/dist/schemas.d.ts +157 -0
  18. package/dist/schemas.js +20 -0
  19. package/dist/schemas.js.map +1 -1
  20. package/dist/tool-counts.json +9 -9
  21. package/dist/tools/animation.js +77 -7
  22. package/dist/tools/animation.js.map +1 -1
  23. package/dist/tools/asset.js +14 -1
  24. package/dist/tools/asset.js.map +1 -1
  25. package/dist/tools/blueprint.js +12 -1
  26. package/dist/tools/blueprint.js.map +1 -1
  27. package/dist/tools/editor.js +21 -8
  28. package/dist/tools/editor.js.map +1 -1
  29. package/dist/tools/level.js +11 -3
  30. package/dist/tools/level.js.map +1 -1
  31. package/dist/tools/material.js +3 -2
  32. package/dist/tools/material.js.map +1 -1
  33. package/dist/tools/project.js +18 -1
  34. package/dist/tools/project.js.map +1 -1
  35. package/dist/ue-mcp.default.yml +69 -9
  36. package/package.json +6 -2
  37. package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/AnimationHandlers.cpp +226 -0
  38. package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/AnimationHandlers.h +7 -0
  39. package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/AnimationHandlers_ControlRigSequencer.cpp +932 -27
  40. package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/AnimationHandlers_IKRetargeterAuthoring.cpp +394 -0
  41. package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/AnimationHandlers_SkeletalLive.cpp +115 -0
  42. package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/AnimationHandlers_StateMachine.cpp +22 -0
  43. package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/AssetHandlers_Import.cpp +33 -2
  44. package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/BlueprintHandlers.cpp +3 -0
  45. package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/BlueprintHandlers.h +3 -0
  46. package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/BlueprintHandlers_Depth.cpp +164 -0
  47. package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/BlueprintHandlers_Graph.cpp +25 -4
  48. package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/BlueprintHandlers_Search.cpp +440 -0
  49. package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/EditorHandlers.cpp +432 -44
  50. package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/EditorHandlers.h +1 -0
  51. package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/MaterialHandlers.cpp +243 -93
  52. package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/MaterialHandlers.h +1 -0
  53. package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/SkeletalMeshHandlers.cpp +793 -0
  54. package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/SkeletalMeshHandlers.h +2 -0
  55. package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Handlers/SplineHandlers.cpp +228 -19
  56. package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Tests/AnimationSkeletonCreateTests.cpp +46 -0
  57. package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Tests/LivePostProcessAnimBlueprintTests.cpp +65 -0
  58. package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Tests/SplineHandlersTests.cpp +92 -0
  59. package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Tests/ViewportCameraHandlerTests.cpp +114 -0
  60. package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/UE_MCP_Bridge.Build.cs +3 -0
  61. package/plugin/ue_mcp_bridge/UE_MCP_Bridge.uplugin +2 -2
  62. package/skills/ue-mcp-animation/SKILL.md +29 -1
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  [![stars](https://img.shields.io/github/stars/db-lyon/ue-mcp)](https://github.com/db-lyon/ue-mcp/stargazers)
6
6
  [![MIT](https://img.shields.io/npm/l/ue-mcp)](LICENSE)
7
7
 
8
- **Unreal Engine Model Context Protocol Server** - gives AI assistants deep read/write access to the Unreal Editor through <!-- count:tools -->26<!-- /count --> category tools covering <!-- count:actions -->1920+<!-- /count --> actions, plus a YAML flow engine for multi-step workflows and an npm plugin system for extending the surface.
8
+ **Unreal Engine Model Context Protocol Server** - gives AI assistants deep read/write access to the Unreal Editor through <!-- count:tools -->26<!-- /count --> category tools covering <!-- count:actions -->1930+<!-- /count --> actions, plus a YAML flow engine for multi-step workflows and an npm plugin system for extending the surface.
9
9
 
10
10
  On UE 5.8+ it also wraps Epic's entire native AI Toolset Registry - 830 official Unreal tools, called in-process and surfaced as `epic_*` actions in the matching category: Sequencer in `animation`, PCG in `pcg`, static meshes in `asset`.
11
11
 
@@ -139,7 +139,7 @@ flows:
139
139
  flow(action="run", flowName="build_and_check")
140
140
  ```
141
141
 
142
- Every one of the <!-- count:actions -->1920+<!-- /count --> actions is also a flow task. Flows support step references, retries, rollback, custom tasks in your own `.js`/`.ts`, and shell steps. See [Flows](https://ue-mcp.com/docs/flows/).
142
+ Every one of the <!-- count:actions -->1930+<!-- /count --> actions is also a flow task. Flows support step references, retries, rollback, custom tasks in your own `.js`/`.ts`, and shell steps. See [Flows](https://ue-mcp.com/docs/flows/).
143
143
 
144
144
  ## Plugins
145
145
 
@@ -216,6 +216,8 @@ const OVERRIDES = {
216
216
  // Reads Control Rig controls and keys from an edit session. The `edit`
217
217
  // segment names the session type; this action does not modify it.
218
218
  "animation.read_control_rig_edit": "read",
219
+ // Captures current in-memory Control Rig values without changing Sequencer.
220
+ "animation.capture_control_rig_pose": "read",
219
221
  // Reads animation data, but optionally writes validation artifacts under
220
222
  // the addressed project's Saved directory.
221
223
  "animation.analyze_animation": "unknown",
@@ -258,6 +260,8 @@ const OVERRIDES = {
258
260
  // ── Writes whose verb reads as a read ───────────────────────────────
259
261
  // Drives the editor's preview: it plays an animation in a viewport.
260
262
  "animation.preview_animation": "mutate",
263
+ // Replaces a running component's transient post-process AnimBP override.
264
+ "animation.set_live_post_process_anim_blueprint": "mutate",
261
265
  // Renders to a file on disk.
262
266
  "material.render_preview": "mutate",
263
267
  "asset.export": "mutate",
@@ -1 +1 @@
1
- {"version":3,"file":"action-class.js","sourceRoot":"","sources":["../src/action-class.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAmBnE;;;;;;;;;;GAUG;AACH,MAAM,YAAY,GAAwB,IAAI,GAAG,CAAS;IACxD,GAAG,eAAe;IAClB,gDAAgD;IAChD,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM;IAC1C,iCAAiC;IACjC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAA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mB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC;AACjD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAAC,GAAgB;IACrD,OAAO,GAAG,KAAK,MAAM,CAAC;AACxB,CAAC"}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Does the plugin we reached actually implement what we advertise? (#1021)
3
+ *
4
+ * `pluginBuildStale` answers a different question. It compares timestamps: is
5
+ * the compiled bridge older than its source. That catches the common cause of
6
+ * a missing handler and is worth reporting, but it is not evidence about the
7
+ * handlers themselves, and a report against 1.2.4 said so exactly: a session
8
+ * reported `pluginBuildStale: false` while an advertised method was absent,
9
+ * and every discovery of that came one failed call at a time.
10
+ *
11
+ * The evidence has been on the wire the whole time. The handshake carries the
12
+ * registered method list read out of the running binary, which the C++ that
13
+ * builds it describes as the only answer a stale DLL cannot fake. Nothing
14
+ * compared it to the surface, so it was used to word an error AFTER a call had
15
+ * already failed and never to say anything beforehand.
16
+ *
17
+ * This compares them. What comes out is not a guess about why a method is
18
+ * missing, and deliberately so: a plugin behind its source, a plugin from
19
+ * another checkout, a partially deployed one and a handler that failed to
20
+ * register all look identical from here, and naming one of them would be
21
+ * inventing a cause. It reports WHICH advertised methods the running plugin
22
+ * does not have, which is the fact, and leaves the diagnosis to the reader.
23
+ */
24
+ import type { BridgeCapabilities } from "./bridge.js";
25
+ import type { ToolDef } from "./types.js";
26
+ export interface BridgeParity {
27
+ /** False when the plugin published no action list, so nothing was compared. */
28
+ checked: boolean;
29
+ /** Distinct bridge methods the advertised surface can dispatch to. */
30
+ advertised: number;
31
+ /** Methods the running plugin registered. */
32
+ registered: number;
33
+ /**
34
+ * Advertised methods the running plugin does not have, sorted. Every one is
35
+ * a call that will come back "Unknown method".
36
+ */
37
+ missing: string[];
38
+ /** One line for a caller to surface, or null when there is nothing to say. */
39
+ message: string | null;
40
+ }
41
+ /**
42
+ * Compare the advertised surface against what the connected plugin registered.
43
+ *
44
+ * `graph` is the tool graph this server actually dispatches, so a category the
45
+ * user disabled and a plugin's injected actions are counted as they really
46
+ * are rather than from the pristine declaration.
47
+ */
48
+ export declare function checkBridgeParity(graph: ToolDef[], capabilities: BridgeCapabilities | null | undefined): BridgeParity;
49
+ /**
50
+ * What the binary that answered says about itself, or undefined when nothing
51
+ * answered or it had nothing to add.
52
+ *
53
+ * `project(get_status)` already reports `pluginBuildStale` and
54
+ * `bridgeApiVersion`, and both are read off the SOURCE and the header on disk.
55
+ * `docs/architecture.md` states that distinction and it is the useful one, so
56
+ * the running binary's own account lives here as one field rather than as
57
+ * three more siblings next to them.
58
+ *
59
+ * Undefined on a healthy connected session, so a status payload only grows
60
+ * when there is something to say.
61
+ */
62
+ export declare function deployedPlugin(capabilities: BridgeCapabilities | null | undefined, parity: BridgeParity): {
63
+ builtAt?: string;
64
+ missingActions?: number;
65
+ warning?: string;
66
+ } | undefined;
67
+ /**
68
+ * The same comparison the other way: methods the plugin has that nothing
69
+ * advertises.
70
+ *
71
+ * Not a defect and not reported by default. A handler can exist under an
72
+ * alternate spelling, or ship ahead of the TypeScript that will expose it, and
73
+ * `scripts/audit-handlers.mjs` is where that question is asked properly with
74
+ * the alternate-spelling table to hand. Here for a caller that wants the whole
75
+ * picture rather than only the half that breaks calls.
76
+ */
77
+ export declare function unadvertisedMethods(graph: ToolDef[], capabilities: BridgeCapabilities | null | undefined): string[];
@@ -0,0 +1,96 @@
1
+ /** How many missing methods to name before summarising the rest. */
2
+ const NAMED = 8;
3
+ /**
4
+ * Compare the advertised surface against what the connected plugin registered.
5
+ *
6
+ * `graph` is the tool graph this server actually dispatches, so a category the
7
+ * user disabled and a plugin's injected actions are counted as they really
8
+ * are rather than from the pristine declaration.
9
+ */
10
+ export function checkBridgeParity(graph, capabilities) {
11
+ const registered = capabilities?.actions;
12
+ if (!Array.isArray(registered) || registered.length === 0) {
13
+ // An older plugin that predates the action list in the handshake. Silent
14
+ // rather than alarming: nothing was compared, so nothing is known, and
15
+ // saying "0 missing" would be the same false assurance this module exists
16
+ // to remove.
17
+ return { checked: false, advertised: 0, registered: 0, missing: [], message: null };
18
+ }
19
+ const have = new Set(registered);
20
+ const advertised = new Set();
21
+ for (const tool of graph) {
22
+ for (const spec of Object.values(tool.actions)) {
23
+ if (spec.kind === "bridge")
24
+ advertised.add(spec.bridge);
25
+ }
26
+ }
27
+ const missing = [...advertised].filter((m) => !have.has(m)).sort();
28
+ return {
29
+ checked: true,
30
+ advertised: advertised.size,
31
+ registered: registered.length,
32
+ missing,
33
+ message: missing.length === 0 ? null : describe(missing, advertised.size, registered.length),
34
+ };
35
+ }
36
+ function describe(missing, advertised, registered) {
37
+ const named = missing.slice(0, NAMED).join(", ");
38
+ const rest = missing.length > NAMED ? `, and ${missing.length - NAMED} more` : "";
39
+ return (`${missing.length} of the ${advertised} bridge methods this server advertises are not `
40
+ + `registered by the plugin it is connected to (${registered} registered): ${named}${rest}. `
41
+ + "Calling one returns 'Unknown method'. The usual cause is a deployed plugin behind this "
42
+ + "package: redeploy and rebuild it (npm run up:build, or ue-mcp deploy then a build). "
43
+ + "This is read from the running binary's own handler list, so it holds whatever the build "
44
+ + "timestamps say.");
45
+ }
46
+ /**
47
+ * What the binary that answered says about itself, or undefined when nothing
48
+ * answered or it had nothing to add.
49
+ *
50
+ * `project(get_status)` already reports `pluginBuildStale` and
51
+ * `bridgeApiVersion`, and both are read off the SOURCE and the header on disk.
52
+ * `docs/architecture.md` states that distinction and it is the useful one, so
53
+ * the running binary's own account lives here as one field rather than as
54
+ * three more siblings next to them.
55
+ *
56
+ * Undefined on a healthy connected session, so a status payload only grows
57
+ * when there is something to say.
58
+ */
59
+ export function deployedPlugin(capabilities, parity) {
60
+ if (!capabilities)
61
+ return undefined;
62
+ const missing = parity.missing.length > 0 ? parity.missing.length : undefined;
63
+ // The build time is the half that catches a handler which is PRESENT and
64
+ // old. #1002 was a DataTable resolution fix that shipped on 2026-08-28 and
65
+ // was reported as broken three days later by a session whose deployed plugin
66
+ // predated it, and nothing in reach said so: parity sees an absent method,
67
+ // not a stale one.
68
+ const builtAt = capabilities.builtAt;
69
+ if (!builtAt && missing === undefined)
70
+ return undefined;
71
+ return { builtAt, missingActions: missing, warning: parity.message ?? undefined };
72
+ }
73
+ /**
74
+ * The same comparison the other way: methods the plugin has that nothing
75
+ * advertises.
76
+ *
77
+ * Not a defect and not reported by default. A handler can exist under an
78
+ * alternate spelling, or ship ahead of the TypeScript that will expose it, and
79
+ * `scripts/audit-handlers.mjs` is where that question is asked properly with
80
+ * the alternate-spelling table to hand. Here for a caller that wants the whole
81
+ * picture rather than only the half that breaks calls.
82
+ */
83
+ export function unadvertisedMethods(graph, capabilities) {
84
+ const registered = capabilities?.actions;
85
+ if (!Array.isArray(registered))
86
+ return [];
87
+ const advertised = new Set();
88
+ for (const tool of graph) {
89
+ for (const spec of Object.values(tool.actions)) {
90
+ if (spec.kind === "bridge")
91
+ advertised.add(spec.bridge);
92
+ }
93
+ }
94
+ return registered.filter((m) => !advertised.has(m)).sort();
95
+ }
96
+ //# sourceMappingURL=bridge-parity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bridge-parity.js","sourceRoot":"","sources":["../src/bridge-parity.ts"],"names":[],"mappings":"AA0CA,oEAAoE;AACpE,MAAM,KAAK,GAAG,CAAC,CAAC;AAEhB;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAAgB,EAChB,YAAmD;IAEnD,MAAM,UAAU,GAAG,YAAY,EAAE,OAAO,CAAC;IACzC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1D,yEAAyE;QACzE,uEAAuE;QACvE,0EAA0E;QAC1E,aAAa;QACb,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IACtF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AAC;IACD,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AAC7D,CAAC"}
@@ -70,6 +70,7 @@ export const REGISTERED_HANDLER_TIMEOUT_SECONDS = {
70
70
  fix_asset_hygiene: 300,
71
71
  fixup_redirectors: 300,
72
72
  generate_mesh_collision: 300,
73
+ get_blueprint_connections: 600,
73
74
  get_landscape_height_region: 120,
74
75
  get_landscape_holes: 120,
75
76
  get_landscape_layer_weight_region: 120,
@@ -91,6 +92,7 @@ export const REGISTERED_HANDLER_TIMEOUT_SECONDS = {
91
92
  sculpt_landscape: 120,
92
93
  sculpt_landscape_region: 300,
93
94
  search_blueprint_call_sites: 600,
95
+ search_blueprint_nodes: 600,
94
96
  set_actor_hlod_layer: 300,
95
97
  set_component_materials: 300,
96
98
  set_landscape_height_region: 300,
@@ -1 +1 @@
1
- {"version":3,"file":"bridge-timeouts.js","sourceRoot":"","sources":["../src/bridge-timeouts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,4EAA4E;AAC5E,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,CAAC;AAE9C,gEAAgE;AAChE,MAAM,CAAC,MAAM,qBAAqB,GAAG,SAAS,CAAC;AAE/C,4EAA4E;AAC5E,MAAM,CAAC,MAAM,eAAe,GAAG,0BAA0B,CAAC;AAE1D;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAqC;IAClF,yBAAyB,EAAE,GAAG;IAC9B,uBAAuB,EAAE,GAAG;IAC5B,mBAAmB,EAAE,GAAG;IACxB,oBAAoB,EAAE,GAAG;IACzB,iBAAiB,EAAE,GAAG;IACtB,iBAAiB,EAAE,GAAG;IACtB,mBAAmB,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AAO,SAAS,CAAC;IACtD,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAC3B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,IAAI,CAAC;QAAE,OAAO,SAAS,CAAC;IAC9D,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;AACjD,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAAc,EACd,UAAmB,EACnB,MAAyB,OAAO,CAAC,GAAG;IAEpC,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;QACpF,OAAO,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,qBAAqB,CAAC,CAAC;IACrD,CAAC;IACD,MAAM,UAAU,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAC/C,MAAM,UAAU,GAAG;QACjB,yBAAyB;QACzB,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC;QAC9B,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,GAAG,wBAAwB;KACrE,CAAC;IACF,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,EAAE,qBAAqB,CAAC,CAAC;AAClE,CAAC"}
@@ -95,7 +95,6 @@ export declare const GuardDeclarationSchema: z.ZodEffects<z.ZodObject<{
95
95
  }, {
96
96
  order?: number | undefined;
97
97
  description?: string | undefined;
98
- scope?: "unknown" | "all" | "mutations" | "writes" | "reads" | undefined;
99
98
  before?: {
100
99
  class_path: string;
101
100
  options?: Record<string, unknown> | undefined;
@@ -104,6 +103,7 @@ export declare const GuardDeclarationSchema: z.ZodEffects<z.ZodObject<{
104
103
  class_path: string;
105
104
  options?: Record<string, unknown> | undefined;
106
105
  } | undefined;
106
+ scope?: "unknown" | "all" | "mutations" | "writes" | "reads" | undefined;
107
107
  }>, {
108
108
  order: number;
109
109
  scope: "unknown" | "all" | "mutations" | "writes" | "reads";
@@ -119,7 +119,6 @@ export declare const GuardDeclarationSchema: z.ZodEffects<z.ZodObject<{
119
119
  }, {
120
120
  order?: number | undefined;
121
121
  description?: string | undefined;
122
- scope?: "unknown" | "all" | "mutations" | "writes" | "reads" | undefined;
123
122
  before?: {
124
123
  class_path: string;
125
124
  options?: Record<string, unknown> | undefined;
@@ -128,6 +127,7 @@ export declare const GuardDeclarationSchema: z.ZodEffects<z.ZodObject<{
128
127
  class_path: string;
129
128
  options?: Record<string, unknown> | undefined;
130
129
  } | undefined;
130
+ scope?: "unknown" | "all" | "mutations" | "writes" | "reads" | undefined;
131
131
  }>;
132
132
  /** Guards keyed by name. The name is an identifier, not a phase encoding. */
133
133
  export declare const GuardsSchema: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
@@ -176,7 +176,6 @@ export declare const GuardsSchema: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodEf
176
176
  }, {
177
177
  order?: number | undefined;
178
178
  description?: string | undefined;
179
- scope?: "unknown" | "all" | "mutations" | "writes" | "reads" | undefined;
180
179
  before?: {
181
180
  class_path: string;
182
181
  options?: Record<string, unknown> | undefined;
@@ -185,6 +184,7 @@ export declare const GuardsSchema: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodEf
185
184
  class_path: string;
186
185
  options?: Record<string, unknown> | undefined;
187
186
  } | undefined;
187
+ scope?: "unknown" | "all" | "mutations" | "writes" | "reads" | undefined;
188
188
  }>, {
189
189
  order: number;
190
190
  scope: "unknown" | "all" | "mutations" | "writes" | "reads";
@@ -200,7 +200,6 @@ export declare const GuardsSchema: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodEf
200
200
  }, {
201
201
  order?: number | undefined;
202
202
  description?: string | undefined;
203
- scope?: "unknown" | "all" | "mutations" | "writes" | "reads" | undefined;
204
203
  before?: {
205
204
  class_path: string;
206
205
  options?: Record<string, unknown> | undefined;
@@ -209,6 +208,7 @@ export declare const GuardsSchema: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodEf
209
208
  class_path: string;
210
209
  options?: Record<string, unknown> | undefined;
211
210
  } | undefined;
211
+ scope?: "unknown" | "all" | "mutations" | "writes" | "reads" | undefined;
212
212
  }>>>;
213
213
  export type GuardScope = z.infer<typeof GuardScopeSchema>;
214
214
  export type GuardHook = z.infer<typeof GuardHookSchema>;
@@ -3,6 +3,7 @@ import { withoutDialogActuation } from "../dialog-guard.js";
3
3
  import { DialogGatedBridge } from "./guarded-bridge.js";
4
4
  import { McpError, ErrorCode } from "../errors.js";
5
5
  import { debug } from "../log.js";
6
+ import { GUARD_CALL_KEY, GUARD_CONFIG_KEY, } from "../guard-task.js";
6
7
  /**
7
8
  * The context a hook task runs in.
8
9
  *
@@ -22,22 +23,42 @@ function hookContext(cc, deps) {
22
23
  session: cc.session,
23
24
  };
24
25
  }
25
- /** What a hook is told about the call it is guarding. */
26
- function hookOptions(cc, declared, result) {
26
+ /**
27
+ * What a hook is told about the call it is guarding.
28
+ *
29
+ * Two shapes, deliberately. The flattened keys are what a guard written
30
+ * against `UeMcpTask` reads, and they keep their old meaning exactly: the
31
+ * declaration goes in first so the call being guarded wins a collision, which
32
+ * is the behaviour those guards were written against.
33
+ *
34
+ * The two reserved keys are what `UeMcpGuard` reads, and they exist because
35
+ * that flattening is a hazard: a guard whose option is named `method` loses
36
+ * it, and the phase can only be inferred from `result` happening to be there.
37
+ * Nested, the configuration and the subject cannot touch each other, and the
38
+ * phase is stated rather than detected.
39
+ */
40
+ function hookOptions(cc, declared, phase, result) {
41
+ const paths = cc.writeFiles();
27
42
  return {
28
- // The declaration first, so the call being guarded always wins a
29
- // collision: a guard reads its configuration and its subject from one
30
- // object, and the subject is never masked by a stale default.
31
43
  ...declared,
32
44
  method: cc.method,
33
45
  params: cc.params,
34
- paths: cc.writeFiles(),
46
+ paths,
35
47
  ...(result !== undefined ? { result } : {}),
48
+ [GUARD_CALL_KEY]: {
49
+ phase,
50
+ method: cc.method,
51
+ params: cc.params,
52
+ paths,
53
+ session: cc.session,
54
+ ...(result !== undefined ? { result } : {}),
55
+ },
56
+ [GUARD_CONFIG_KEY]: declared,
36
57
  };
37
58
  }
38
59
  /** Run one hook and give back what it answered. */
39
- async function runHook(hook, cc, deps, result) {
40
- const task = await deps.registry.create(hook.class_path, hookContext(cc, deps), hookOptions(cc, hook.options, result));
60
+ async function runHook(hook, cc, deps, phase, result) {
61
+ const task = await deps.registry.create(hook.class_path, hookContext(cc, deps), hookOptions(cc, hook.options, phase, result));
41
62
  return (await task.execute());
42
63
  }
43
64
  /** The message a denial carries, from wherever the hook put it. */
@@ -92,7 +113,7 @@ export async function buildGuards(declarations, deps, source) {
92
113
  before: async (cc) => {
93
114
  let answered;
94
115
  try {
95
- answered = await runHook(decl.before, cc, deps);
116
+ answered = await runHook(decl.before, cc, deps, "before");
96
117
  }
97
118
  catch (e) {
98
119
  // A hook that threw denies the call. It is the same outcome as
@@ -114,7 +135,7 @@ export async function buildGuards(declarations, deps, source) {
114
135
  after: async (cc, result) => {
115
136
  let answered;
116
137
  try {
117
- answered = await runHook(decl.after, cc, deps, result);
138
+ answered = await runHook(decl.after, cc, deps, "after", result);
118
139
  }
119
140
  catch (e) {
120
141
  // The call already happened. Failing it now would report a
@@ -1 +1 @@
1
- {"version":3,"file":"guards.js","sourceRoot":"","sources":["../../src/flow/guards.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,aAAa,EACb,SAAS,EACT,YAAY,EACZ,UAAU,GAGX,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,K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BAAgB;cAChB,iBAAiB;cACjB,WAAW,SAAS,KAAK;cACzB,oBAAoB,KAAK,IAAI;cAC7B,aAAa,IAAI,KAAK;cACtB,wDAAwD,CAC3D,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,MAAM,IAAI,KAAK,CACb,GAAG,MAAM,CAAC,KAAK,aAAa,MAAM,CAAC,MAAM,qDAAqD;UAC5F,6FAA6F;UAC7F,wFAAwF;UACxF,eAAe,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM;UAC1C,sFAAsF,CACzF,CAAC;AACJ,CAAC"}
@@ -713,7 +713,6 @@ export declare const FlowConfigSchema: z.ZodObject<{
713
713
  }, {
714
714
  order?: number | undefined;
715
715
  description?: string | undefined;
716
- scope?: "unknown" | "all" | "mutations" | "writes" | "reads" | undefined;
717
716
  before?: {
718
717
  class_path: string;
719
718
  options?: Record<string, unknown> | undefined;
@@ -722,6 +721,7 @@ export declare const FlowConfigSchema: z.ZodObject<{
722
721
  class_path: string;
723
722
  options?: Record<string, unknown> | undefined;
724
723
  } | undefined;
724
+ scope?: "unknown" | "all" | "mutations" | "writes" | "reads" | undefined;
725
725
  }>, {
726
726
  order: number;
727
727
  scope: "unknown" | "all" | "mutations" | "writes" | "reads";
@@ -737,7 +737,6 @@ export declare const FlowConfigSchema: z.ZodObject<{
737
737
  }, {
738
738
  order?: number | undefined;
739
739
  description?: string | undefined;
740
- scope?: "unknown" | "all" | "mutations" | "writes" | "reads" | undefined;
741
740
  before?: {
742
741
  class_path: string;
743
742
  options?: Record<string, unknown> | undefined;
@@ -746,6 +745,7 @@ export declare const FlowConfigSchema: z.ZodObject<{
746
745
  class_path: string;
747
746
  options?: Record<string, unknown> | undefined;
748
747
  } | undefined;
748
+ scope?: "unknown" | "all" | "mutations" | "writes" | "reads" | undefined;
749
749
  }>>>;
750
750
  }, "strip", z.ZodTypeAny, {
751
751
  plugins: {
@@ -979,7 +979,6 @@ export declare const FlowConfigSchema: z.ZodObject<{
979
979
  guards?: Record<string, {
980
980
  order?: number | undefined;
981
981
  description?: string | undefined;
982
- scope?: "unknown" | "all" | "mutations" | "writes" | "reads" | undefined;
983
982
  before?: {
984
983
  class_path: string;
985
984
  options?: Record<string, unknown> | undefined;
@@ -988,6 +987,7 @@ export declare const FlowConfigSchema: z.ZodObject<{
988
987
  class_path: string;
989
988
  options?: Record<string, unknown> | undefined;
990
989
  } | undefined;
990
+ scope?: "unknown" | "all" | "mutations" | "writes" | "reads" | undefined;
991
991
  }> | undefined;
992
992
  agents?: Record<string, {
993
993
  description?: string | undefined;
@@ -0,0 +1,125 @@
1
+ /**
2
+ * Public guard-authoring surface for ue-mcp.
3
+ *
4
+ * A guard is not a task. `flow/guards.ts` has said so since guards stopped
5
+ * being tasks whose NAME encoded their phase and scope, and the declaration
6
+ * side reflects it: a guard is declared with `scope`, `order`, `before` and
7
+ * `after`, and is merely IMPLEMENTED BY a task named by `class_path`.
8
+ *
9
+ * The authoring side did not reflect it. Writing a guard meant extending
10
+ * `UeMcpTask` and implementing `execute()`, which left three things wrong:
11
+ *
12
+ * Nothing was typed. `this.options` is `Record<string, unknown>`, so every
13
+ * guard cast or guessed its way to `method` and `paths`.
14
+ *
15
+ * Configuration and subject shared one namespace. The declared `options` and
16
+ * the call being guarded were flattened into one bag, and the call won any
17
+ * collision, so a guard with an option named `method` silently lost it.
18
+ *
19
+ * The phase was implicit. One `execute()` served both hooks, and a class
20
+ * used for both could only tell them apart by sniffing for a `result` key.
21
+ * `TaskResult.data` meanwhile means "replace the call's result" after the
22
+ * call and means nothing before it.
23
+ *
24
+ * `UeMcpGuard` fixes all three without moving the runtime: it still registers
25
+ * as a task, so `class_path` resolution, plugin loading and the pipeline are
26
+ * unchanged, and a guard written against `UeMcpTask` keeps working exactly as
27
+ * it did.
28
+ *
29
+ * ```ts
30
+ * import { UeMcpGuard, type GuardedCall } from "ue-mcp/guard";
31
+ *
32
+ * export default class Freeze extends UeMcpGuard<{ enabled?: boolean }> {
33
+ * get taskName() { return "freeze"; }
34
+ * async before(call: GuardedCall) {
35
+ * if (this.config.enabled === false) return this.allow();
36
+ * return this.deny(`Blocked '${call.method}'.`);
37
+ * }
38
+ * }
39
+ * ```
40
+ */
41
+ import type { TaskResult } from "@db-lyon/flowkit";
42
+ import type { EditorSession } from "./session.js";
43
+ import { UeMcpTask } from "./task.js";
44
+ /**
45
+ * Where the pipeline puts the call being guarded, and the guard's own declared
46
+ * options, so the two cannot collide with each other or with anything a guard
47
+ * chooses to name.
48
+ *
49
+ * Reserved keys rather than symbols: the options object crosses the task
50
+ * registry, and a key that survives being spread is the one thing that has to
51
+ * hold. Both are also still flattened into the bag alongside these, because a
52
+ * guard written against `UeMcpTask` reads them there and must keep working.
53
+ */
54
+ export declare const GUARD_CALL_KEY = "__ueMcpGuardCall";
55
+ export declare const GUARD_CONFIG_KEY = "__ueMcpGuardConfig";
56
+ /** Which hook is running. */
57
+ export type GuardPhase = "before" | "after";
58
+ /** The call a guard is being asked about. */
59
+ export interface GuardedCall {
60
+ /** Which hook this is. */
61
+ readonly phase: GuardPhase;
62
+ /** The bridge method. For a wrapped engine tool this is `epic_call_tool`. */
63
+ readonly method: string;
64
+ /** The arguments the call carries. */
65
+ readonly params: Record<string, unknown>;
66
+ /**
67
+ * Existing files on disk the call would modify. Empty for a read, and empty
68
+ * for a mutation that names no content path, which is why a guard that wants
69
+ * "everything that changes" is declared `scope: mutations` rather than
70
+ * inferring it from this being non-empty.
71
+ */
72
+ readonly paths: readonly string[];
73
+ /** The editor this call is bound to, when it has one. */
74
+ readonly session?: EditorSession;
75
+ }
76
+ /** What a `before` hook answers. Build one with `allow()` or `deny()`. */
77
+ export type GuardVerdict = TaskResult;
78
+ /** The payload `flow/guards.ts` hands a guard task. */
79
+ export interface GuardHookPayload {
80
+ phase: GuardPhase;
81
+ method: string;
82
+ params: Record<string, unknown>;
83
+ paths: string[];
84
+ result?: unknown;
85
+ session?: EditorSession;
86
+ }
87
+ /**
88
+ * Base class for a ue-mcp guard.
89
+ *
90
+ * Implement `before`, `after`, or both. `execute()` is wired once here and
91
+ * routes to whichever the pipeline asked for, so the phase is a signature
92
+ * rather than something to detect.
93
+ */
94
+ export declare abstract class UeMcpGuard<TConfig = Record<string, unknown>> extends UeMcpTask {
95
+ /**
96
+ * The options this guard was DECLARED with, and nothing else.
97
+ *
98
+ * `this.options` still holds the flattened bag for compatibility. This is
99
+ * the one to read: the call being guarded cannot mask a key of yours in it.
100
+ */
101
+ protected get config(): TConfig;
102
+ /** Let the call proceed. */
103
+ protected allow(): GuardVerdict;
104
+ /**
105
+ * Refuse the call. The reason reaches the caller as a WRITE_BLOCKED error,
106
+ * so write it for whoever is about to read it in an agent transcript.
107
+ */
108
+ protected deny(reason: string): GuardVerdict;
109
+ /**
110
+ * Runs before the call. Returning `deny()` stops it; the call never happens.
111
+ * Throwing denies it too, because a guard that errored is not one that
112
+ * approved.
113
+ */
114
+ protected before?(call: GuardedCall): Promise<GuardVerdict> | GuardVerdict;
115
+ /**
116
+ * Runs after a call that succeeded, and cannot deny it: it already happened.
117
+ * Return an object to REPLACE the result, or nothing to leave it alone.
118
+ *
119
+ * An object rather than anything, because that is what the pipeline can
120
+ * actually carry: a replacement travels back as a task result's `data`, and
121
+ * a scalar there has nowhere to go.
122
+ */
123
+ protected after?(call: GuardedCall, result: unknown): Promise<Record<string, unknown> | void> | Record<string, unknown> | void;
124
+ execute(): Promise<TaskResult>;
125
+ }