ue-mcp 1.3.8-beta → 1.3.8-beta.2

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.
@@ -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,KAAK,EAAE,MAAM,WAAW,CAAC;AA+BlC;;;;;;;;GAQG;AACH,SAAS,WAAW,CAAC,EAAe,EAAE,IAAqB;IACzD,IAAI,CAAC,EAAE,CAAC,OAAO;QAAE,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC;IAChE,OAAO;QACL,GAAG,IAAI,CAAC,GAAG;QACX,MAAM,EAAE,sBAAsB,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC;QACxF,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO;QAC3B,OAAO,EAAE,EAAE,CAAC,OAAO;KACpB,CAAC;AACJ,CAAC;AAED,yDAAyD;AACzD,SAAS,WAAW,CAAC,EAAe,EAAE,QAAiC,EAAE,MAAgB;IACvF,OAAO;QACL,iEAAiE;QACjE,sEAAsE;QACtE,8DAA8D;QAC9D,GAAG,QAAQ;QACX,MAAM,EAAE,EAAE,CAAC,MAAM;QACjB,MAAM,EAAE,EAAE,CAAC,MAAM;QACjB,KAAK,EAAE,EAAE,CAAC,UAAU,EAAE;QACtB,GAAG,CAAC,MAAM,KAAK,SAAS,CA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,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAC/C,MAAM,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,GAAG,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAE,CAAC;QAClE,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC;QACtD,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC;QAC5D,OAAO,CACL,KAAK,IAAI,IAAI;cACX,gBAAgB;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
+ }
@@ -0,0 +1,85 @@
1
+ import { UeMcpTask } from "./task.js";
2
+ /**
3
+ * Where the pipeline puts the call being guarded, and the guard's own declared
4
+ * options, so the two cannot collide with each other or with anything a guard
5
+ * chooses to name.
6
+ *
7
+ * Reserved keys rather than symbols: the options object crosses the task
8
+ * registry, and a key that survives being spread is the one thing that has to
9
+ * hold. Both are also still flattened into the bag alongside these, because a
10
+ * guard written against `UeMcpTask` reads them there and must keep working.
11
+ */
12
+ export const GUARD_CALL_KEY = "__ueMcpGuardCall";
13
+ export const GUARD_CONFIG_KEY = "__ueMcpGuardConfig";
14
+ /**
15
+ * Base class for a ue-mcp guard.
16
+ *
17
+ * Implement `before`, `after`, or both. `execute()` is wired once here and
18
+ * routes to whichever the pipeline asked for, so the phase is a signature
19
+ * rather than something to detect.
20
+ */
21
+ export class UeMcpGuard extends UeMcpTask {
22
+ /**
23
+ * The options this guard was DECLARED with, and nothing else.
24
+ *
25
+ * `this.options` still holds the flattened bag for compatibility. This is
26
+ * the one to read: the call being guarded cannot mask a key of yours in it.
27
+ */
28
+ get config() {
29
+ const bag = this.options;
30
+ return (bag[GUARD_CONFIG_KEY] ?? {});
31
+ }
32
+ /** Let the call proceed. */
33
+ allow() {
34
+ return { success: true };
35
+ }
36
+ /**
37
+ * Refuse the call. The reason reaches the caller as a WRITE_BLOCKED error,
38
+ * so write it for whoever is about to read it in an agent transcript.
39
+ */
40
+ deny(reason) {
41
+ return { success: false, error: new Error(reason) };
42
+ }
43
+ async execute() {
44
+ const bag = (this.options ?? {});
45
+ const payload = bag[GUARD_CALL_KEY];
46
+ if (!payload) {
47
+ // Reached by invoking a guard as an ordinary task, which nothing in the
48
+ // pipeline does. Said plainly rather than reported as a guard that
49
+ // approved, because a guard that silently allows is the failure mode
50
+ // this whole layer exists to prevent.
51
+ return {
52
+ success: false,
53
+ error: new Error(`${this.taskName} is a guard and was run as a task. Guards are invoked by the `
54
+ + "bridge pipeline from a `guards:` declaration, not called directly."),
55
+ };
56
+ }
57
+ const call = {
58
+ phase: payload.phase,
59
+ method: payload.method,
60
+ params: payload.params,
61
+ paths: payload.paths,
62
+ session: payload.session,
63
+ };
64
+ if (call.phase === "before") {
65
+ if (!this.before) {
66
+ return {
67
+ success: false,
68
+ error: new Error(`${this.taskName} is declared as a 'before' hook but implements no before().`),
69
+ };
70
+ }
71
+ return await this.before(call);
72
+ }
73
+ if (!this.after) {
74
+ return {
75
+ success: false,
76
+ error: new Error(`${this.taskName} is declared as an 'after' hook but implements no after().`),
77
+ };
78
+ }
79
+ const replacement = await this.after(call, payload.result);
80
+ // `data` is how the pipeline replaces a result. Returning nothing leaves
81
+ // the call's own result standing, which is the common case for an audit.
82
+ return replacement === undefined ? { success: true } : { success: true, data: replacement };
83
+ }
84
+ }
85
+ //# sourceMappingURL=guard-task.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guard-task.js","sourceRoot":"","sources":["../src/guard-task.ts"],"names":[],"mappings":"AA0CA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,kBAAkB,CAAC;AACjD,MAAM,CAAC,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AAqCrD;;;;;;GAMG;AACH,MAAM,OAAgB,UAA8C,SAAQ,SAAS;IACnF;;;;;OAKG;IACH,IAAc,MAAM;QAClB,MAAM,GAAG,GAAG,IAAI,CAAC,OAAkC,CAAC;QACpD,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAY,CAAC;IAClD,CAAC;IAED,4BAA4B;IAClB,KAAK;QACb,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;IAED;;;OAGG;IACO,IAAI,CAAC,MAAc;QAC3B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,K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EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QAC3D,yEAAyE;QACzE,yEAAyE;QACzE,OAAO,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;IAC9F,CAAC;CACF"}
@@ -535,7 +535,6 @@ export declare const PluginManifestSchema: z.ZodObject<{
535
535
  }, {
536
536
  order?: number | undefined;
537
537
  description?: string | undefined;
538
- scope?: "unknown" | "all" | "mutations" | "writes" | "reads" | undefined;
539
538
  before?: {
540
539
  class_path: string;
541
540
  options?: Record<string, unknown> | undefined;
@@ -544,6 +543,7 @@ export declare const PluginManifestSchema: z.ZodObject<{
544
543
  class_path: string;
545
544
  options?: Record<string, unknown> | undefined;
546
545
  } | undefined;
546
+ scope?: "unknown" | "all" | "mutations" | "writes" | "reads" | undefined;
547
547
  }>, {
548
548
  order: number;
549
549
  scope: "unknown" | "all" | "mutations" | "writes" | "reads";
@@ -559,7 +559,6 @@ export declare const PluginManifestSchema: z.ZodObject<{
559
559
  }, {
560
560
  order?: number | undefined;
561
561
  description?: string | undefined;
562
- scope?: "unknown" | "all" | "mutations" | "writes" | "reads" | undefined;
563
562
  before?: {
564
563
  class_path: string;
565
564
  options?: Record<string, unknown> | undefined;
@@ -568,6 +567,7 @@ export declare const PluginManifestSchema: z.ZodObject<{
568
567
  class_path: string;
569
568
  options?: Record<string, unknown> | undefined;
570
569
  } | undefined;
570
+ scope?: "unknown" | "all" | "mutations" | "writes" | "reads" | undefined;
571
571
  }>>>;
572
572
  }, "strip", z.ZodTypeAny, {
573
573
  actionPrefix: string;
@@ -669,7 +669,6 @@ export declare const PluginManifestSchema: z.ZodObject<{
669
669
  guards?: Record<string, {
670
670
  order?: number | undefined;
671
671
  description?: string | undefined;
672
- scope?: "unknown" | "all" | "mutations" | "writes" | "reads" | undefined;
673
672
  before?: {
674
673
  class_path: string;
675
674
  options?: Record<string, unknown> | undefined;
@@ -678,6 +677,7 @@ export declare const PluginManifestSchema: z.ZodObject<{
678
677
  class_path: string;
679
678
  options?: Record<string, unknown> | undefined;
680
679
  } | undefined;
680
+ scope?: "unknown" | "all" | "mutations" | "writes" | "reads" | undefined;
681
681
  }> | undefined;
682
682
  inject?: Record<string, Record<string, {
683
683
  task: string;
@@ -33,6 +33,6 @@
33
33
  },
34
34
  "nativeToolsets": 0,
35
35
  "nativeToolActions": 0,
36
- "generatedAt": "2026-09-07T23:31:27.343Z",
37
- "version": "1.3.8-beta"
36
+ "generatedAt": "2026-09-08T01:03:21.042Z",
37
+ "version": "1.3.8-beta.2"
38
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ue-mcp",
3
- "version": "1.3.8-beta",
3
+ "version": "1.3.8-beta.2",
4
4
  "description": "Unreal Engine MCP server - 26 tools, 1920+ actions for AI-driven editor control",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -10,6 +10,10 @@
10
10
  "types": "./dist/task.d.ts",
11
11
  "default": "./dist/task.js"
12
12
  },
13
+ "./guard": {
14
+ "types": "./dist/guard-task.d.ts",
15
+ "default": "./dist/guard-task.js"
16
+ },
13
17
  "./package.json": "./package.json"
14
18
  },
15
19
  "bin": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "FileVersion": 3,
3
3
  "Version": 1,
4
- "VersionName": "1.3.8-beta",
4
+ "VersionName": "1.3.8-beta.2",
5
5
  "FriendlyName": "UE MCP Bridge",
6
6
  "Description": "C++ WebSocket bridge for UE-MCP, providing 1859+ editor actions over the MCP protocol",
7
7
  "Category": "Developer Tools",