ue-mcp 1.3.7 → 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.
- package/README.md +2 -2
- package/dist/action-class.d.ts +22 -1
- package/dist/action-class.js +17 -1
- package/dist/action-class.js.map +1 -1
- package/dist/action-effects.d.ts +84 -0
- package/dist/action-effects.js +214 -0
- package/dist/action-effects.js.map +1 -0
- package/dist/action-schema.d.ts +16 -3
- package/dist/action-schema.js +2 -2
- package/dist/action-schema.js.map +1 -1
- package/dist/action-verbs.d.ts +45 -0
- package/dist/action-verbs.js +64 -0
- package/dist/action-verbs.js.map +1 -0
- package/dist/editor-gate.js +34 -6
- package/dist/editor-gate.js.map +1 -1
- package/dist/epic-input.d.ts +22 -0
- package/dist/epic-input.js +120 -0
- package/dist/epic-input.js.map +1 -0
- package/dist/epic-surface.d.ts +47 -0
- package/dist/epic-surface.js +37 -0
- package/dist/epic-surface.js.map +1 -0
- package/dist/flow/flow-tool.js +6 -0
- package/dist/flow/flow-tool.js.map +1 -1
- package/dist/flow/guard-schema.d.ts +28 -16
- package/dist/flow/guard-schema.js +16 -2
- package/dist/flow/guard-schema.js.map +1 -1
- package/dist/flow/guard.d.ts +37 -7
- package/dist/flow/guard.js +57 -19
- package/dist/flow/guard.js.map +1 -1
- package/dist/flow/guards.js +34 -11
- package/dist/flow/guards.js.map +1 -1
- package/dist/flow/journal-actions.js +18 -0
- package/dist/flow/journal-actions.js.map +1 -1
- package/dist/flow/schema.d.ts +10 -10
- package/dist/flow/skill-actions.d.ts +15 -1
- package/dist/flow/skill-actions.js +33 -6
- package/dist/flow/skill-actions.js.map +1 -1
- package/dist/flow/write-methods.d.ts +0 -24
- package/dist/flow/write-methods.js +21 -5
- package/dist/flow/write-methods.js.map +1 -1
- package/dist/guard-task.d.ts +125 -0
- package/dist/guard-task.js +85 -0
- package/dist/guard-task.js.map +1 -0
- package/dist/index.js +25 -77
- package/dist/index.js.map +1 -1
- package/dist/init.js +6 -6
- package/dist/init.js.map +1 -1
- package/dist/lean-context.js +16 -0
- package/dist/lean-context.js.map +1 -1
- package/dist/lock-owner.d.ts +13 -0
- package/dist/lock-owner.js +26 -0
- package/dist/lock-owner.js.map +1 -0
- package/dist/locking.d.ts +30 -15
- package/dist/locking.js +45 -54
- package/dist/locking.js.map +1 -1
- package/dist/plugin/injection.js +7 -0
- package/dist/plugin/injection.js.map +1 -1
- package/dist/plugin/manifest.d.ts +46 -16
- package/dist/plugin/manifest.js +9 -0
- package/dist/plugin/manifest.js.map +1 -1
- package/dist/plugin/provision.js +6 -0
- package/dist/plugin/provision.js.map +1 -1
- package/dist/schemas.js +1 -1
- package/dist/schemas.js.map +1 -1
- package/dist/session.js +1 -1
- package/dist/session.js.map +1 -1
- package/dist/skill-packs.d.ts +10 -2
- package/dist/skill-packs.js +12 -7
- package/dist/skill-packs.js.map +1 -1
- package/dist/tool-counts.json +26 -24
- package/dist/tools/animation.js +118 -115
- package/dist/tools/animation.js.map +1 -1
- package/dist/tools/asset.js +141 -126
- package/dist/tools/asset.js.map +1 -1
- package/dist/tools/audio.js +51 -51
- package/dist/tools/audio.js.map +1 -1
- package/dist/tools/blueprint.js +89 -84
- package/dist/tools/blueprint.js.map +1 -1
- package/dist/tools/chooser.js +9 -9
- package/dist/tools/chooser.js.map +1 -1
- package/dist/tools/conversation.d.ts +10 -0
- package/dist/tools/conversation.js +12 -0
- package/dist/tools/conversation.js.map +1 -0
- package/dist/tools/dataflow.d.ts +15 -0
- package/dist/tools/dataflow.js +17 -0
- package/dist/tools/dataflow.js.map +1 -0
- package/dist/tools/demo.js +4 -4
- package/dist/tools/demo.js.map +1 -1
- package/dist/tools/editor.js +123 -102
- package/dist/tools/editor.js.map +1 -1
- package/dist/tools/epic/animation.generated.d.ts +6 -0
- package/dist/tools/epic/animation.generated.js +875 -0
- package/dist/tools/epic/animation.generated.js.map +1 -0
- package/dist/tools/epic/asset.generated.d.ts +6 -0
- package/dist/tools/epic/asset.generated.js +226 -0
- package/dist/tools/epic/asset.generated.js.map +1 -0
- package/dist/tools/epic/blueprint.generated.d.ts +6 -0
- package/dist/tools/epic/blueprint.generated.js +168 -0
- package/dist/tools/epic/blueprint.generated.js.map +1 -0
- package/dist/tools/epic/conversation.generated.d.ts +6 -0
- package/dist/tools/epic/conversation.generated.js +37 -0
- package/dist/tools/epic/conversation.generated.js.map +1 -0
- package/dist/tools/epic/dataflow.generated.d.ts +6 -0
- package/dist/tools/epic/dataflow.generated.js +88 -0
- package/dist/tools/epic/dataflow.generated.js.map +1 -0
- package/dist/tools/epic/editor.generated.d.ts +6 -0
- package/dist/tools/epic/editor.generated.js +88 -0
- package/dist/tools/epic/editor.generated.js.map +1 -0
- package/dist/tools/epic/effects.d.ts +25 -0
- package/dist/tools/epic/effects.js +1716 -0
- package/dist/tools/epic/effects.js.map +1 -0
- package/dist/tools/epic/epic.generated.d.ts +6 -0
- package/dist/tools/epic/epic.generated.js +39 -0
- package/dist/tools/epic/epic.generated.js.map +1 -0
- package/dist/tools/epic/gameplay.generated.d.ts +6 -0
- package/dist/tools/epic/gameplay.generated.js +113 -0
- package/dist/tools/epic/gameplay.generated.js.map +1 -0
- package/dist/tools/epic/gas.generated.d.ts +6 -0
- package/dist/tools/epic/gas.generated.js +59 -0
- package/dist/tools/epic/gas.generated.js.map +1 -0
- package/dist/tools/epic/index.d.ts +40 -0
- package/dist/tools/epic/index.js +41 -0
- package/dist/tools/epic/index.js.map +1 -0
- package/dist/tools/epic/level.generated.d.ts +6 -0
- package/dist/tools/epic/level.generated.js +135 -0
- package/dist/tools/epic/level.generated.js.map +1 -0
- package/dist/tools/epic/material.generated.d.ts +6 -0
- package/dist/tools/epic/material.generated.js +114 -0
- package/dist/tools/epic/material.generated.js.map +1 -0
- package/dist/tools/epic/niagara.generated.d.ts +6 -0
- package/dist/tools/epic/niagara.generated.js +186 -0
- package/dist/tools/epic/niagara.generated.js.map +1 -0
- package/dist/tools/epic/pcg.generated.d.ts +6 -0
- package/dist/tools/epic/pcg.generated.js +116 -0
- package/dist/tools/epic/pcg.generated.js.map +1 -0
- package/dist/tools/epic/plugins.generated.d.ts +6 -0
- package/dist/tools/epic/plugins.generated.js +78 -0
- package/dist/tools/epic/plugins.generated.js.map +1 -0
- package/dist/tools/epic/project.generated.d.ts +6 -0
- package/dist/tools/epic/project.generated.js +61 -0
- package/dist/tools/epic/project.generated.js.map +1 -0
- package/dist/tools/epic/reflection.generated.d.ts +6 -0
- package/dist/tools/epic/reflection.generated.js +37 -0
- package/dist/tools/epic/reflection.generated.js.map +1 -0
- package/dist/tools/epic/statetree.generated.d.ts +6 -0
- package/dist/tools/epic/statetree.generated.js +41 -0
- package/dist/tools/epic/statetree.generated.js.map +1 -0
- package/dist/tools/epic/widget.generated.d.ts +6 -0
- package/dist/tools/epic/widget.generated.js +140 -0
- package/dist/tools/epic/widget.generated.js.map +1 -0
- package/dist/tools/epic.js +7 -4
- package/dist/tools/epic.js.map +1 -1
- package/dist/tools/fab.js +8 -8
- package/dist/tools/fab.js.map +1 -1
- package/dist/tools/feedback.js +4 -0
- package/dist/tools/feedback.js.map +1 -1
- package/dist/tools/foliage.js +17 -13
- package/dist/tools/foliage.js.map +1 -1
- package/dist/tools/gameplay.js +101 -98
- package/dist/tools/gameplay.js.map +1 -1
- package/dist/tools/gas.js +36 -33
- package/dist/tools/gas.js.map +1 -1
- package/dist/tools/landscape.js +35 -35
- package/dist/tools/landscape.js.map +1 -1
- package/dist/tools/level.js +113 -92
- package/dist/tools/level.js.map +1 -1
- package/dist/tools/material.js +52 -49
- package/dist/tools/material.js.map +1 -1
- package/dist/tools/networking.js +11 -11
- package/dist/tools/networking.js.map +1 -1
- package/dist/tools/niagara.js +47 -42
- package/dist/tools/niagara.js.map +1 -1
- package/dist/tools/pcg.js +22 -19
- package/dist/tools/pcg.js.map +1 -1
- package/dist/tools/plugins.js +7 -0
- package/dist/tools/plugins.js.map +1 -1
- package/dist/tools/project.js +101 -10
- package/dist/tools/project.js.map +1 -1
- package/dist/tools/reflection.js +16 -13
- package/dist/tools/reflection.js.map +1 -1
- package/dist/tools/statetree.js +51 -48
- package/dist/tools/statetree.js.map +1 -1
- package/dist/tools/widget.js +52 -49
- package/dist/tools/widget.js.map +1 -1
- package/dist/tools.js +4 -0
- package/dist/tools.js.map +1 -1
- package/dist/types.d.ts +108 -6
- package/dist/types.js +21 -7
- package/dist/types.js.map +1 -1
- package/dist/ue-mcp.default.yml +6358 -1786
- package/package.json +11 -3
- package/plugin/ue_mcp_bridge/UE_MCP_Bridge.uplugin +2 -2
- package/skills/ue-mcp-workflow/SKILL.md +1 -1
- package/assets/epic-catalog.snapshot.json +0 -15758
- package/dist/epic-cache.d.ts +0 -43
- package/dist/epic-cache.js +0 -81
- package/dist/epic-cache.js.map +0 -1
- package/dist/epic-enrich.d.ts +0 -47
- package/dist/epic-enrich.js +0 -323
- package/dist/epic-enrich.js.map +0 -1
package/dist/flow/schema.d.ts
CHANGED
|
@@ -676,7 +676,7 @@ export declare const FlowConfigSchema: z.ZodObject<{
|
|
|
676
676
|
}>, "many">>;
|
|
677
677
|
guards: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
|
|
678
678
|
description: z.ZodOptional<z.ZodString>;
|
|
679
|
-
scope: z.ZodDefault<z.ZodEnum<["all", "mutations", "writes"]>>;
|
|
679
|
+
scope: z.ZodDefault<z.ZodEnum<["all", "mutations", "writes", "reads", "unknown"]>>;
|
|
680
680
|
order: z.ZodDefault<z.ZodNumber>;
|
|
681
681
|
before: z.ZodOptional<z.ZodObject<{
|
|
682
682
|
class_path: z.ZodString;
|
|
@@ -700,7 +700,7 @@ export declare const FlowConfigSchema: z.ZodObject<{
|
|
|
700
700
|
}>>;
|
|
701
701
|
}, "strip", z.ZodTypeAny, {
|
|
702
702
|
order: number;
|
|
703
|
-
scope: "all" | "mutations" | "writes";
|
|
703
|
+
scope: "unknown" | "all" | "mutations" | "writes" | "reads";
|
|
704
704
|
description?: string | undefined;
|
|
705
705
|
before?: {
|
|
706
706
|
options: Record<string, unknown>;
|
|
@@ -711,9 +711,8 @@ export declare const FlowConfigSchema: z.ZodObject<{
|
|
|
711
711
|
class_path: string;
|
|
712
712
|
} | undefined;
|
|
713
713
|
}, {
|
|
714
|
-
description?: string | undefined;
|
|
715
714
|
order?: number | undefined;
|
|
716
|
-
|
|
715
|
+
description?: string | undefined;
|
|
717
716
|
before?: {
|
|
718
717
|
class_path: string;
|
|
719
718
|
options?: Record<string, unknown> | undefined;
|
|
@@ -722,9 +721,10 @@ 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
|
-
scope: "all" | "mutations" | "writes";
|
|
727
|
+
scope: "unknown" | "all" | "mutations" | "writes" | "reads";
|
|
728
728
|
description?: string | undefined;
|
|
729
729
|
before?: {
|
|
730
730
|
options: Record<string, unknown>;
|
|
@@ -735,9 +735,8 @@ export declare const FlowConfigSchema: z.ZodObject<{
|
|
|
735
735
|
class_path: string;
|
|
736
736
|
} | undefined;
|
|
737
737
|
}, {
|
|
738
|
-
description?: string | undefined;
|
|
739
738
|
order?: number | undefined;
|
|
740
|
-
|
|
739
|
+
description?: string | 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: {
|
|
@@ -816,7 +816,7 @@ export declare const FlowConfigSchema: z.ZodObject<{
|
|
|
816
816
|
}>;
|
|
817
817
|
guards: Record<string, {
|
|
818
818
|
order: number;
|
|
819
|
-
scope: "all" | "mutations" | "writes";
|
|
819
|
+
scope: "unknown" | "all" | "mutations" | "writes" | "reads";
|
|
820
820
|
description?: string | undefined;
|
|
821
821
|
before?: {
|
|
822
822
|
options: Record<string, unknown>;
|
|
@@ -977,9 +977,8 @@ export declare const FlowConfigSchema: z.ZodObject<{
|
|
|
977
977
|
max_age_hours?: number | undefined;
|
|
978
978
|
} | undefined;
|
|
979
979
|
guards?: Record<string, {
|
|
980
|
-
description?: string | undefined;
|
|
981
980
|
order?: number | undefined;
|
|
982
|
-
|
|
981
|
+
description?: string | 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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ActionSpec, ToolDef } from "../types.js";
|
|
1
|
+
import type { ActionEffect, ActionSpec, ToolDef } from "../types.js";
|
|
2
2
|
/**
|
|
3
3
|
* The flow tool's own actions, the three that are not journal or skill.
|
|
4
4
|
*
|
|
@@ -9,6 +9,20 @@ import type { ActionSpec, ToolDef } from "../types.js";
|
|
|
9
9
|
* tool, so it cannot drift into being the lie it is there to prevent.
|
|
10
10
|
*/
|
|
11
11
|
export declare const FLOW_OWN_ACTIONS: readonly ["run", "plan", "list"];
|
|
12
|
+
/**
|
|
13
|
+
* What each of those three does to the addressed editor.
|
|
14
|
+
*
|
|
15
|
+
* Restated here rather than read off the built tool because `flow-tool.ts`
|
|
16
|
+
* imports this module and importing it back would close a cycle at module
|
|
17
|
+
* init. `tests/unit/flow-action-contract.test.ts` fails when the two disagree,
|
|
18
|
+
* so the restatement cannot drift into a second opinion.
|
|
19
|
+
*
|
|
20
|
+
* `run` is `mutate` rather than `unknown` even though a flow is only ever
|
|
21
|
+
* whatever its steps are: a flow of pure reads is theoretically a read, no
|
|
22
|
+
* flow in this repo or any shipped plugin is one, and both labels gate
|
|
23
|
+
* identically. The wider answer is the one that stands.
|
|
24
|
+
*/
|
|
25
|
+
export declare const FLOW_OWN_EFFECTS: Record<(typeof FLOW_OWN_ACTIONS)[number], ActionEffect>;
|
|
12
26
|
/** The flow category as a graph entry, for the check to hold packs against. */
|
|
13
27
|
export declare function flowCategoryForCheck(): ToolDef;
|
|
14
28
|
export declare const skillActions: Record<string, ActionSpec>;
|
|
@@ -56,18 +56,35 @@ function discover(ctx) {
|
|
|
56
56
|
* tool, so it cannot drift into being the lie it is there to prevent.
|
|
57
57
|
*/
|
|
58
58
|
export const FLOW_OWN_ACTIONS = ["run", "plan", "list"];
|
|
59
|
+
/**
|
|
60
|
+
* What each of those three does to the addressed editor.
|
|
61
|
+
*
|
|
62
|
+
* Restated here rather than read off the built tool because `flow-tool.ts`
|
|
63
|
+
* imports this module and importing it back would close a cycle at module
|
|
64
|
+
* init. `tests/unit/flow-action-contract.test.ts` fails when the two disagree,
|
|
65
|
+
* so the restatement cannot drift into a second opinion.
|
|
66
|
+
*
|
|
67
|
+
* `run` is `mutate` rather than `unknown` even though a flow is only ever
|
|
68
|
+
* whatever its steps are: a flow of pure reads is theoretically a read, no
|
|
69
|
+
* flow in this repo or any shipped plugin is one, and both labels gate
|
|
70
|
+
* identically. The wider answer is the one that stands.
|
|
71
|
+
*/
|
|
72
|
+
export const FLOW_OWN_EFFECTS = {
|
|
73
|
+
run: "mutate",
|
|
74
|
+
plan: "read",
|
|
75
|
+
list: "read",
|
|
76
|
+
};
|
|
59
77
|
/** The flow category as a graph entry, for the check to hold packs against. */
|
|
60
78
|
export function flowCategoryForCheck() {
|
|
61
|
-
const
|
|
62
|
-
...FLOW_OWN_ACTIONS,
|
|
63
|
-
...Object.keys(journalActions),
|
|
64
|
-
...Object.keys(skillActions),
|
|
65
|
-
];
|
|
79
|
+
const own = Object.entries(FLOW_OWN_EFFECTS).map(([name, effect]) => [name, { kind: "handler", effect, handler: async () => ({}) }]);
|
|
66
80
|
return {
|
|
67
81
|
name: "flow",
|
|
68
82
|
description: "",
|
|
69
83
|
schema: {},
|
|
70
|
-
|
|
84
|
+
// The real specs for everything but the three own actions, so a check that
|
|
85
|
+
// reads an effect off this stand-in reads the declaration rather than a
|
|
86
|
+
// placeholder that happens to be next to it.
|
|
87
|
+
actions: { ...Object.fromEntries(own), ...journalActions, ...skillActions },
|
|
71
88
|
handler: async () => ({}),
|
|
72
89
|
};
|
|
73
90
|
}
|
|
@@ -86,6 +103,8 @@ function requireProjectDir(ctx, verb) {
|
|
|
86
103
|
}
|
|
87
104
|
export const skillActions = {
|
|
88
105
|
skill_list: {
|
|
106
|
+
kind: "handler",
|
|
107
|
+
effect: "read",
|
|
89
108
|
description: "Every skill pack this server can see: the ones bundled with ue-mcp, the ones contributed by "
|
|
90
109
|
+ "loaded plugins (any plugin package shipping skills/<name>/SKILL.md), and the ones installed "
|
|
91
110
|
+ "into this project's .claude/skills. Each row carries the description an agent reads to decide "
|
|
@@ -95,6 +114,8 @@ export const skillActions = {
|
|
|
95
114
|
handler: async (ctx, params) => skillList(ctx, params),
|
|
96
115
|
},
|
|
97
116
|
skill_get: {
|
|
117
|
+
kind: "handler",
|
|
118
|
+
effect: "read",
|
|
98
119
|
description: "One skill pack in full, optionally including its markdown, so an agent can read the workflow "
|
|
99
120
|
+ "without leaving the tool surface. Reports whether the project's installed copy matches the "
|
|
100
121
|
+ "available one, which is how a stale install is spotted. Params: skillName, includeBody? "
|
|
@@ -102,6 +123,8 @@ export const skillActions = {
|
|
|
102
123
|
handler: async (ctx, params) => skillGet(ctx, params),
|
|
103
124
|
},
|
|
104
125
|
skill_check: {
|
|
126
|
+
kind: "handler",
|
|
127
|
+
effect: "read",
|
|
105
128
|
description: "Verify every skill pack against the live action surface. A pack is prose that names calls, so a "
|
|
106
129
|
+ "renamed or removed action leaves a document that teaches a call the server refuses; this reads "
|
|
107
130
|
+ "every category(action=\"x\") out of every pack and reports the ones that no longer resolve, with "
|
|
@@ -112,6 +135,8 @@ export const skillActions = {
|
|
|
112
135
|
handler: async (ctx) => skillCheck(ctx),
|
|
113
136
|
},
|
|
114
137
|
skill_install: {
|
|
138
|
+
kind: "handler",
|
|
139
|
+
effect: "mutate",
|
|
115
140
|
description: "Copy skill packs into this project's .claude/skills, SKILL.md and ue-mcp.yml sidecar together. "
|
|
116
141
|
+ "Idempotent and specific about it: a pack whose destination already holds the same bytes comes "
|
|
117
142
|
+ "back as unchanged rather than counted as installed, so a repeat call is distinguishable from a "
|
|
@@ -121,6 +146,8 @@ export const skillActions = {
|
|
|
121
146
|
handler: async (ctx, params) => skillInstall(ctx, params),
|
|
122
147
|
},
|
|
123
148
|
skill_remove: {
|
|
149
|
+
kind: "handler",
|
|
150
|
+
effect: "mutate",
|
|
124
151
|
description: "Remove installed skill packs from this project's .claude/skills. Deletes the SKILL.md and its "
|
|
125
152
|
+ "sidecar, then the pack directory only if it ends up empty and the skills directory only if it "
|
|
126
153
|
+ "does too, so anything the user added alongside survives. Idempotent: a pack that was not "
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-actions.js","sourceRoot":"","sources":["../../src/flow/skill-actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,C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AC,YAAY,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IACvD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -1,27 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Write classification for the source-control guard.
|
|
3
|
-
*
|
|
4
|
-
* The guard needs to know, for a given bridge method + params, which asset
|
|
5
|
-
* content paths the call is about to modify, so it can check them out (or refuse
|
|
6
|
-
* on a human's lock) BEFORE the write reaches disk. This module is the single
|
|
7
|
-
* place that encodes that knowledge.
|
|
8
|
-
*
|
|
9
|
-
* Two layers:
|
|
10
|
-
* 1. An explicit map for methods whose path lives under an unusual param
|
|
11
|
-
* shape (batches, rename descriptors).
|
|
12
|
-
* 2. A verb+param heuristic for the common case: a method named with a write
|
|
13
|
-
* verb (`save_`, `set_`, ...) carrying a recognizable asset-path param.
|
|
14
|
-
*
|
|
15
|
-
* Classification returns UE content paths (e.g. "/Game/Foo"). Resolving those to
|
|
16
|
-
* on-disk files, and deciding which already exist (modify -> checkout) versus do
|
|
17
|
-
* not (create -> skip, it will be `p4 add`ed later), is the caller's job.
|
|
18
|
-
*
|
|
19
|
-
* Design note: this is intentionally conservative. An unmapped write falls
|
|
20
|
-
* through as "not a write" (fail-open). The cost of a miss is that the agent
|
|
21
|
-
* hits Unreal's own read-only failure and can check out explicitly - visible,
|
|
22
|
-
* not silent corruption. The cost of a false positive is an unnecessary
|
|
23
|
-
* checkout, which takes a lock. We bias toward not over-locking.
|
|
24
|
-
*/
|
|
25
1
|
export interface WriteClassification {
|
|
26
2
|
/**
|
|
27
3
|
* Whether this call modifies named content, which is what a source-control
|
|
@@ -9,8 +9,19 @@
|
|
|
9
9
|
* Two layers:
|
|
10
10
|
* 1. An explicit map for methods whose path lives under an unusual param
|
|
11
11
|
* shape (batches, rename descriptors).
|
|
12
|
-
* 2.
|
|
13
|
-
*
|
|
12
|
+
* 2. The method's DECLARED effect plus a recognizable asset-path param. A
|
|
13
|
+
* declared read writes nothing whatever path it was handed; anything else
|
|
14
|
+
* is a candidate.
|
|
15
|
+
*
|
|
16
|
+
* Layer two used to be a hand-written list of write verbs matched against the
|
|
17
|
+
* method NAME, and the list is gone rather than kept as a fallback: there is
|
|
18
|
+
* nothing left for it to answer. `bridgeMethodEffect` has no undefined case,
|
|
19
|
+
* so every method reaching here has an effect from the actions that forward to
|
|
20
|
+
* it, from the table of methods a handler calls directly, or from the default
|
|
21
|
+
* that treats an unrecognised method as a change. The list was also wrong in
|
|
22
|
+
* the expensive direction: `unwrap_uvs` rewrites a mesh's UV layout in place
|
|
23
|
+
* and `mesh_boolean` overwrites a StaticMesh package, and neither matched it,
|
|
24
|
+
* so neither was ever checked out before the write reached disk.
|
|
14
25
|
*
|
|
15
26
|
* Classification returns UE content paths (e.g. "/Game/Foo"). Resolving those to
|
|
16
27
|
* on-disk files, and deciding which already exist (modify -> checkout) versus do
|
|
@@ -22,8 +33,7 @@
|
|
|
22
33
|
* not silent corruption. The cost of a false positive is an unnecessary
|
|
23
34
|
* checkout, which takes a lock. We bias toward not over-locking.
|
|
24
35
|
*/
|
|
25
|
-
|
|
26
|
-
const WRITE_VERB = /^(save|set|create|add|delete|remove|import|rename|move|duplicate|reparent|compile|apply|assign|modify|bake|generate|build)_/;
|
|
36
|
+
import { bridgeMethodEffect } from "../action-effects.js";
|
|
27
37
|
/** Single-value params that carry an asset content path. */
|
|
28
38
|
const PATH_KEYS = ["assetPath", "sourcePath", "destinationPath", "packagePath", "path"];
|
|
29
39
|
/** Array params that carry asset content paths. */
|
|
@@ -119,7 +129,13 @@ export function classifyWrite(method, params) {
|
|
|
119
129
|
const contentPaths = dedupe(explicit(params));
|
|
120
130
|
return { writes: contentPaths.length > 0, contentPaths };
|
|
121
131
|
}
|
|
122
|
-
|
|
132
|
+
// A declared read writes no content, whatever path it was handed. Anything
|
|
133
|
+
// else is a candidate, whatever its name looks like. `unknown` is a
|
|
134
|
+
// candidate for the same reason it gates like a mutation everywhere else,
|
|
135
|
+
// and an unnecessary checkout is the cheap side of this decision.
|
|
136
|
+
// With the parameters, so a wrapped engine tool is judged by which tool it
|
|
137
|
+
// is rather than by the one method all 830 of them share.
|
|
138
|
+
if (bridgeMethodEffect(method, params).effect === "read") {
|
|
123
139
|
return { writes: false, contentPaths: [] };
|
|
124
140
|
}
|
|
125
141
|
const contentPaths = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-methods.js","sourceRoot":"","sources":["../../src/flow/write-methods.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"write-methods.js","sourceRoot":"","sources":["../../src/flow/write-methods.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAe1D,4DAA4D;AAC5D,MAAM,SAAS,GAAG,CAAC,WAAW,EAAE,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC;AACxF,mDAAmD;AACnD,MAAM,eAAe,GAAG,CAAC,YAAY,EAAE,aAAa,EAAE,kBAAkB,CAAC,CAAC;AAI1E,qDAAqD;AACrD,SAAS,GAAG,CAAC,CAAU;IACrB,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC1D,CAAC;AAED,uDAAuD;AACvD,SAAS,QAAQ,CAAC,CAAU;IAC1B,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,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C,OAAO,EAAE,MAAM,EAAE,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,YAAY,EAAE,CAAC;IAC3D,CAAC;IAED,2EAA2E;IAC3E,oEAAoE;IACpE,0EAA0E;IAC1E,kEAAkE;IAClE,2EAA2E;IAC3E,0DAA0D;IAC1D,IAAI,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;QACzD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC;IAC7C,CAAC;IAED,MAAM,YAAY,GAAa,EAAE,CAAC;IAClC,KAAK,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC;QAC5B,MAAM,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QAC3B,IAAI,CAAC;YAAE,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC9B,CAAC;IACD,KAAK,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;QAClC,YAAY,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC9C,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;IACrC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC;AAC/D,CAAC;AAED,SAAS,MAAM,CAAC,EAAY;IAC1B,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -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":"AA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