ue-mcp 0.5.4 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/README.md +0 -4
  2. package/dist/flow/bridge-task.d.ts +18 -0
  3. package/dist/flow/bridge-task.js +34 -0
  4. package/dist/flow/bridge-task.js.map +1 -0
  5. package/dist/flow/context.d.ts +7 -0
  6. package/dist/flow/context.js +2 -0
  7. package/dist/flow/context.js.map +1 -0
  8. package/dist/flow/flow-tool.d.ts +4 -0
  9. package/dist/flow/flow-tool.js +87 -0
  10. package/dist/flow/flow-tool.js.map +1 -0
  11. package/dist/flow/index.d.ts +8 -0
  12. package/dist/flow/index.js +7 -0
  13. package/dist/flow/index.js.map +1 -0
  14. package/dist/flow/loader.d.ts +13 -0
  15. package/dist/flow/loader.js +45 -0
  16. package/dist/flow/loader.js.map +1 -0
  17. package/dist/flow/registry.d.ts +11 -0
  18. package/dist/flow/registry.js +34 -0
  19. package/dist/flow/registry.js.map +1 -0
  20. package/dist/flow/schema.d.ts +146 -0
  21. package/dist/flow/schema.js +14 -0
  22. package/dist/flow/schema.js.map +1 -0
  23. package/dist/flow/task-factory.d.ts +12 -0
  24. package/dist/flow/task-factory.js +46 -0
  25. package/dist/flow/task-factory.js.map +1 -0
  26. package/dist/index.js +51 -9
  27. package/dist/index.js.map +1 -1
  28. package/dist/init.js +46 -3
  29. package/dist/init.js.map +1 -1
  30. package/dist/tools/animation.js +32 -68
  31. package/dist/tools/animation.js.map +1 -1
  32. package/dist/tools/asset.js +33 -57
  33. package/dist/tools/asset.js.map +1 -1
  34. package/dist/tools/audio.js +6 -10
  35. package/dist/tools/audio.js.map +1 -1
  36. package/dist/tools/blueprint.js +29 -56
  37. package/dist/tools/blueprint.js.map +1 -1
  38. package/dist/tools/demo.js +3 -4
  39. package/dist/tools/demo.js.map +1 -1
  40. package/dist/tools/editor.js +42 -82
  41. package/dist/tools/editor.js.map +1 -1
  42. package/dist/tools/feedback.js +2 -1
  43. package/dist/tools/feedback.js.map +1 -1
  44. package/dist/tools/foliage.js +8 -14
  45. package/dist/tools/foliage.js.map +1 -1
  46. package/dist/tools/gameplay.js +37 -82
  47. package/dist/tools/gameplay.js.map +1 -1
  48. package/dist/tools/gas.js +10 -18
  49. package/dist/tools/gas.js.map +1 -1
  50. package/dist/tools/landscape.js +11 -20
  51. package/dist/tools/landscape.js.map +1 -1
  52. package/dist/tools/level.js +26 -44
  53. package/dist/tools/level.js.map +1 -1
  54. package/dist/tools/material.js +19 -37
  55. package/dist/tools/material.js.map +1 -1
  56. package/dist/tools/networking.js +12 -22
  57. package/dist/tools/networking.js.map +1 -1
  58. package/dist/tools/niagara.js +12 -23
  59. package/dist/tools/niagara.js.map +1 -1
  60. package/dist/tools/pcg.js +13 -24
  61. package/dist/tools/pcg.js.map +1 -1
  62. package/dist/tools/project.js +14 -16
  63. package/dist/tools/project.js.map +1 -1
  64. package/dist/tools/reflection.js +7 -12
  65. package/dist/tools/reflection.js.map +1 -1
  66. package/dist/tools/widget.js +15 -28
  67. package/dist/tools/widget.js.map +1 -1
  68. package/dist/types.d.ts +4 -2
  69. package/dist/types.js +16 -6
  70. package/dist/types.js.map +1 -1
  71. package/dist/ue-mcp.default.yml +1849 -0
  72. package/package.json +4 -2
package/README.md CHANGED
@@ -94,10 +94,6 @@ Requires `PythonScriptPlugin` (ships with UE 4.26+).
94
94
 
95
95
  Issues and pull requests welcome. If an AI agent had to fall back to `execute_python` during your session, it will offer to submit structured feedback automatically — this helps us prioritize which native handlers to add next.
96
96
 
97
- ### Contributors
98
-
99
- - [@robinduckett](https://github.com/robinduckett) — Linux platform support ([#96](https://github.com/db-lyon/ue-mcp/pull/96))
100
-
101
97
  ## License
102
98
 
103
99
  MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,18 @@
1
+ import { BaseTask, type TaskResult } from "@db-lyon/flowkit";
2
+ /**
3
+ * Generic task for bridge-delegation actions.
4
+ *
5
+ * Used two ways:
6
+ *
7
+ * 1. **YAML-defined tasks** (`class_path: flow.bridge`):
8
+ * The `method` option specifies the bridge method to call.
9
+ * Remaining options are passed as bridge params.
10
+ *
11
+ * 2. **Built-in tasks** via `bridgeTaskClass()` factory:
12
+ * The bridge method is baked into the class closure.
13
+ * Options are passed through as bridge params.
14
+ */
15
+ export declare class BridgeTask extends BaseTask {
16
+ get taskName(): string;
17
+ execute(): Promise<TaskResult>;
18
+ }
@@ -0,0 +1,34 @@
1
+ import { BaseTask } from "@db-lyon/flowkit";
2
+ /**
3
+ * Generic task for bridge-delegation actions.
4
+ *
5
+ * Used two ways:
6
+ *
7
+ * 1. **YAML-defined tasks** (`class_path: flow.bridge`):
8
+ * The `method` option specifies the bridge method to call.
9
+ * Remaining options are passed as bridge params.
10
+ *
11
+ * 2. **Built-in tasks** via `bridgeTaskClass()` factory:
12
+ * The bridge method is baked into the class closure.
13
+ * Options are passed through as bridge params.
14
+ */
15
+ export class BridgeTask extends BaseTask {
16
+ get taskName() {
17
+ return `bridge:${this.options.method ?? "unknown"}`;
18
+ }
19
+ async execute() {
20
+ const { method, ...params } = this.options;
21
+ if (!method || typeof method !== "string") {
22
+ throw new Error('BridgeTask requires a "method" option');
23
+ }
24
+ const ctx = this.ctx;
25
+ const data = await ctx.bridge.call(method, params);
26
+ return {
27
+ success: true,
28
+ data: typeof data === "object" && data !== null
29
+ ? data
30
+ : { result: data },
31
+ };
32
+ }
33
+ }
34
+ //# sourceMappingURL=bridge-task.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bridge-task.js","sourceRoot":"","sources":["../../src/flow/bridge-task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAmB,MAAM,kBAAkB,CAAC;AAG7D;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,UAAW,SAAQ,QAAQ;IACtC,IAAI,QAAQ;QACV,OAAO,UAAW,IAAI,CAAC,OAAmC,CAAC,MAAM,IAAI,SAAS,EAAE,CAAC;IACnF,CAAC;IAED,KAAK,CAAC,OAAO;QACX,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC,OAAkC,CAAC;QACtE,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC1C,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAC3D,CAAC;QACD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAkB,CAAC;QACpC,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,MAAgB,EAAE,MAAM,CAAC,CAAC;QAC7D,OAAO;YACL,OAAO,EAAE,IAAI;YACb,IAAI,EAAE,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI;gBAC7C,CAAC,CAAE,IAAgC;gBACnC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE;SACrB,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,7 @@
1
+ import type { TaskContext } from "@db-lyon/flowkit";
2
+ import type { IBridge } from "../bridge.js";
3
+ import type { ProjectContext } from "../project.js";
4
+ export interface FlowContext extends TaskContext {
5
+ bridge: IBridge;
6
+ project: ProjectContext;
7
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/flow/context.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { TaskRegistry } from "@db-lyon/flowkit";
2
+ import type { FlowConfig } from "./schema.js";
3
+ import type { ToolDef } from "../types.js";
4
+ export declare function createFlowTool(registry: TaskRegistry, config: FlowConfig): ToolDef;
@@ -0,0 +1,87 @@
1
+ import { z } from "zod";
2
+ import { FlowRunner } from "@db-lyon/flowkit";
3
+ export function createFlowTool(registry, config) {
4
+ const flowNames = Object.keys(config.flows);
5
+ return {
6
+ name: "flow",
7
+ description: `Run or inspect named flows defined in ue-mcp.yml.\n\n` +
8
+ `Available flows: ${flowNames.length > 0 ? flowNames.join(", ") : "(none — add flows to ue-mcp.yml)"}` +
9
+ `\n\nActions:\n` +
10
+ `- run: Execute a flow. Params: flowName, skip?\n` +
11
+ `- plan: Show execution plan without running. Params: flowName\n` +
12
+ `- list: List available flows`,
13
+ schema: {
14
+ action: z.enum(["run", "plan", "list"]).describe("Action to perform"),
15
+ flowName: z.string().optional().describe("Flow name from ue-mcp.yml"),
16
+ skip: z.array(z.string()).optional().describe("Step names or numbers to skip"),
17
+ },
18
+ actions: {
19
+ run: { handler: async (ctx, params) => runFlow(registry, config, ctx, params) },
20
+ plan: { handler: async (ctx, params) => planFlow(registry, config, ctx, params) },
21
+ list: { handler: async () => listFlows(config) },
22
+ },
23
+ handler: async (ctx, params) => {
24
+ const action = params.action;
25
+ if (action === "list")
26
+ return listFlows(config);
27
+ if (action === "plan")
28
+ return planFlow(registry, config, ctx, params);
29
+ if (action === "run")
30
+ return runFlow(registry, config, ctx, params);
31
+ throw new Error(`Unknown flow action: ${action}`);
32
+ },
33
+ };
34
+ }
35
+ function listFlows(config) {
36
+ const flows = Object.entries(config.flows).map(([name, def]) => ({
37
+ name,
38
+ description: def.description,
39
+ stepCount: Object.keys(def.steps).length,
40
+ }));
41
+ return { flowCount: flows.length, flows };
42
+ }
43
+ async function planFlow(registry, config, ctx, params) {
44
+ const flowName = params.flowName;
45
+ if (!flowName)
46
+ throw new Error("flowName is required");
47
+ const runner = makeRunner(registry, config, ctx);
48
+ return runner.run({ flowName, plan: true });
49
+ }
50
+ async function runFlow(registry, config, ctx, params) {
51
+ const flowName = params.flowName;
52
+ if (!flowName)
53
+ throw new Error("flowName is required");
54
+ const skip = params.skip ?? [];
55
+ const runner = makeRunner(registry, config, ctx);
56
+ const result = await runner.run({ flowName, skip });
57
+ return formatFlowResult(result);
58
+ }
59
+ function makeRunner(registry, config, ctx) {
60
+ const flowCtx = {
61
+ bridge: ctx.bridge,
62
+ project: ctx.project,
63
+ };
64
+ return new FlowRunner({
65
+ tasks: config.tasks,
66
+ flows: config.flows,
67
+ registry,
68
+ context: flowCtx,
69
+ });
70
+ }
71
+ function formatFlowResult(result) {
72
+ return {
73
+ success: result.success,
74
+ duration: result.duration,
75
+ error: result.error?.message,
76
+ steps: result.steps.map((s) => ({
77
+ step: s.stepNumber,
78
+ name: s.name,
79
+ type: s.type,
80
+ skipped: s.skipped,
81
+ success: s.result?.success ?? null,
82
+ duration: s.duration,
83
+ error: s.result?.error?.message,
84
+ })),
85
+ };
86
+ }
87
+ //# sourceMappingURL=flow-tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flow-tool.js","sourceRoot":"","sources":["../../src/flow/flow-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAM9C,MAAM,UAAU,cAAc,CAC5B,QAAsB,EACtB,MAAkB;IAElB,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAE5C,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,WAAW,EACT,uDAAuD;YACvD,oBAAoB,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,kCAAkC,EAAE;YACtG,gBAAgB;YAChB,kDAAkD;YAClD,iEAAiE;YACjE,8BAA8B;QAChC,MAAM,EAAE;YACN,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,mBAAmB,CAAC;YACrE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;YACrE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAA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ACrB,CAAC;IAEF,OAAO,IAAI,UAAU,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC,KAAuC;QACrD,KAAK,EAAE,MAAM,CAAC,KAAuC;QACrD,QAAQ;QACR,OAAO,EAAE,OAAO;KACjB,CAAC,CAAC;AACL,CAAC;AAED,SAAS,gBAAgB,CAAC,MAAqB;IAC7C,OAAO;QACL,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,OAAO;QAC5B,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC9B,IAAI,EAAE,CAAC,CAAC,UAAU;YAClB,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,OAAO,EAAE,CAAC,CAAC,OAAO;YAClB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,OAAO,IAAI,IAAI;YAClC,QAAQ,EAAE,CAAC,CAAC,QAAQ;YACpB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO;SAChC,CAAC,CAAC;KACJ,CAAC;AACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ export type { FlowContext } from "./context.js";
2
+ export { BridgeTask } from "./bridge-task.js";
3
+ export { bridgeTaskClass, handlerTaskClass } from "./task-factory.js";
4
+ export { FlowConfigSchema } from "./schema.js";
5
+ export type { FlowConfig } from "./schema.js";
6
+ export { loadFlowConfig, buildDefaults } from "./loader.js";
7
+ export { buildFlowRegistry } from "./registry.js";
8
+ export { createFlowTool } from "./flow-tool.js";
@@ -0,0 +1,7 @@
1
+ export { BridgeTask } from "./bridge-task.js";
2
+ export { bridgeTaskClass, handlerTaskClass } from "./task-factory.js";
3
+ export { FlowConfigSchema } from "./schema.js";
4
+ export { loadFlowConfig, buildDefaults } from "./loader.js";
5
+ export { buildFlowRegistry } from "./registry.js";
6
+ export { createFlowTool } from "./flow-tool.js";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/flow/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { type LoadedConfig } from "@db-lyon/flowkit";
2
+ import { type FlowConfig } from "./schema.js";
3
+ import type { ToolDef } from "../types.js";
4
+ /**
5
+ * Build the defaults object from tool definitions.
6
+ * This is the runtime equivalent of scripts/generate-default-config.ts.
7
+ */
8
+ export declare function buildDefaults(tools: ToolDef[]): Record<string, unknown>;
9
+ /**
10
+ * Load ue-mcp.yml from the given directory, layered on top of built-in defaults.
11
+ * Returns the merged config even if no project ue-mcp.yml exists.
12
+ */
13
+ export declare function loadFlowConfig(tools: ToolDef[], configDir?: string): LoadedConfig<FlowConfig> | null;
@@ -0,0 +1,45 @@
1
+ import * as fs from "node:fs";
2
+ import * as path from "node:path";
3
+ import { loadConfig } from "@db-lyon/flowkit";
4
+ import { FlowConfigSchema } from "./schema.js";
5
+ /**
6
+ * Build the defaults object from tool definitions.
7
+ * This is the runtime equivalent of scripts/generate-default-config.ts.
8
+ */
9
+ export function buildDefaults(tools) {
10
+ const tasks = {};
11
+ for (const tool of tools) {
12
+ for (const [actionName, spec] of Object.entries(tool.actions)) {
13
+ const taskName = `${tool.name}.${actionName}`;
14
+ const isBridge = !!spec.bridge;
15
+ const taskDef = {
16
+ class_path: isBridge ? "ue-mcp.bridge" : taskName,
17
+ group: tool.name,
18
+ };
19
+ if (spec.description)
20
+ taskDef.description = spec.description;
21
+ if (isBridge)
22
+ taskDef.options = { method: spec.bridge };
23
+ tasks[taskName] = taskDef;
24
+ }
25
+ }
26
+ return { tasks, flows: {} };
27
+ }
28
+ /**
29
+ * Load ue-mcp.yml from the given directory, layered on top of built-in defaults.
30
+ * Returns the merged config even if no project ue-mcp.yml exists.
31
+ */
32
+ export function loadFlowConfig(tools, configDir) {
33
+ const dir = configDir ?? process.cwd();
34
+ const configPath = path.join(dir, "ue-mcp.yml");
35
+ if (!fs.existsSync(configPath))
36
+ return null;
37
+ return loadConfig({
38
+ filename: "ue-mcp.yml",
39
+ schema: FlowConfigSchema,
40
+ defaults: buildDefaults(tools),
41
+ envVar: "UE_MCP_ENV",
42
+ configDir: dir,
43
+ });
44
+ }
45
+ //# sourceMappingURL=loader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.js","sourceRoot":"","sources":["../../src/flow/loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,UAAU,EAAqB,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,aAAa,CAAC;AAGhE;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,KAAgB;IAC5C,MAAM,KAAK,GAA4B,EAAE,CAAC;IAE1C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,KAAK,MAAM,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YAC9D,MAAM,QAAQ,GAAG,GAAG,IAAI,CAAC,IAAI,IAAI,UAAU,EAAE,CAAC;YAC9C,MAAM,QAAQ,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;YAE/B,MAAM,OAAO,GAA4B;gBACvC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,QAAQ;gBACjD,KAAK,EAAE,IAAI,CAAC,IAAI;aACjB,CAAC;YACF,IAAI,IAAI,CAAC,WAAW;gBAAE,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;YAC7D,IAAI,QAAQ;gBAAE,OAAO,CAAC,OAAO,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;YAExD,KAAK,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC;QAC5B,CAAC;IACH,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;AAC9B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAC5B,KAAgB,EAChB,SAAkB;IAElB,MAAM,GAAG,GAAG,SAAS,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IACvC,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;IAEhD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;QAAE,OAAO,IAAI,CAAC;IAE5C,OAAO,UAAU,CAAC;QAChB,QAAQ,EAAE,YAAY;QACtB,MAAM,EAAE,gBAAgB;QACxB,QAAQ,EAAE,aAAa,CAAC,KAAK,CAAC;QAC9B,MAAM,EAAE,YAAY;QACpB,SAAS,EAAE,GAAG;KACf,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { TaskRegistry } from "@db-lyon/flowkit";
2
+ import type { ToolDef } from "../types.js";
3
+ /**
4
+ * Walk all category tools and register every action as a flowkit task.
5
+ *
6
+ * - Bridge actions → factory classes with method + mapParams in closure
7
+ * - Handler actions → factory classes wrapping the existing handler function
8
+ *
9
+ * Also registers `ue-mcp.bridge` as a class_path for YAML-defined bridge tasks.
10
+ */
11
+ export declare function buildFlowRegistry(tools: ToolDef[]): TaskRegistry;
@@ -0,0 +1,34 @@
1
+ import { TaskRegistry } from "@db-lyon/flowkit";
2
+ import { BridgeTask } from "./bridge-task.js";
3
+ import { bridgeTaskClass, handlerTaskClass } from "./task-factory.js";
4
+ /**
5
+ * Walk all category tools and register every action as a flowkit task.
6
+ *
7
+ * - Bridge actions → factory classes with method + mapParams in closure
8
+ * - Handler actions → factory classes wrapping the existing handler function
9
+ *
10
+ * Also registers `ue-mcp.bridge` as a class_path for YAML-defined bridge tasks.
11
+ */
12
+ export function buildFlowRegistry(tools) {
13
+ const registry = new TaskRegistry();
14
+ // Register the generic BridgeTask for YAML class_path: ue-mcp.bridge
15
+ registry.registerClassPath("ue-mcp.bridge", BridgeTask);
16
+ for (const tool of tools) {
17
+ for (const [actionName, spec] of Object.entries(tool.actions)) {
18
+ const taskName = `${tool.name}.${actionName}`;
19
+ if (spec.handler) {
20
+ // Wrap the existing handler function — adapt ToolContext to FlowContext
21
+ const originalHandler = spec.handler;
22
+ registry.register(taskName, handlerTaskClass(taskName, (ctx, params) => {
23
+ const toolCtx = { bridge: ctx.bridge, project: ctx.project };
24
+ return originalHandler(toolCtx, params);
25
+ }));
26
+ }
27
+ else if (spec.bridge) {
28
+ registry.register(taskName, bridgeTaskClass(taskName, spec.bridge, spec.mapParams));
29
+ }
30
+ }
31
+ }
32
+ return registry;
33
+ }
34
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/flow/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAIhD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAEtE;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAgB;IAChD,MAAM,QAAQ,GAAG,IAAI,YAAY,EAAE,CAAC;IAEpC,qEAAqE;IACrE,QAAQ,CAAC,iBAAiB,CAAC,eAAe,EAAE,UAAwC,CAAC,CAAC;IAEtF,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,KAAK,MAAM,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YAC9D,MAAM,QAAQ,GAAG,GAAG,IAAI,CAAC,IAAI,IAAI,UAAU,EAAE,CAAC;YAE9C,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;gBACjB,wEAAwE;gBACxE,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC;gBACrC,QAAQ,CAAC,QAAQ,CACf,QAAQ,EACR,gBAAgB,CAAC,QAAQ,EAAE,CAAC,GAAgB,EAAE,MAA+B,EAAE,EAAE;oBAC/E,MAAM,OAAO,GAAgB,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;oBAC1E,OAAO,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;gBAC1C,CAAC,CAAC,CACH,CAAC;YACJ,CAAC;iBAAM,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;gBACvB,QAAQ,CAAC,QAAQ,CACf,QAAQ,EACR,eAAe,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CACvD,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,146 @@
1
+ import { z } from "zod";
2
+ export declare const FlowVersionSchema: z.ZodObject<{
3
+ version: z.ZodLiteral<1>;
4
+ }, "strip", z.ZodTypeAny, {
5
+ version: 1;
6
+ }, {
7
+ version: 1;
8
+ }>;
9
+ export declare const FlowProjectSchema: z.ZodOptional<z.ZodObject<{
10
+ name: z.ZodOptional<z.ZodString>;
11
+ engine: z.ZodOptional<z.ZodString>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ name?: string | undefined;
14
+ engine?: string | undefined;
15
+ }, {
16
+ name?: string | undefined;
17
+ engine?: string | undefined;
18
+ }>>;
19
+ export declare const FlowConfigSchema: z.ZodObject<{
20
+ tasks: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
21
+ class_path: z.ZodString;
22
+ description: z.ZodOptional<z.ZodString>;
23
+ group: z.ZodOptional<z.ZodString>;
24
+ options: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
25
+ }, "strip", z.ZodTypeAny, {
26
+ options: Record<string, unknown>;
27
+ class_path: string;
28
+ description?: string | undefined;
29
+ group?: string | undefined;
30
+ }, {
31
+ class_path: string;
32
+ options?: Record<string, unknown> | undefined;
33
+ description?: string | undefined;
34
+ group?: string | undefined;
35
+ }>>>;
36
+ flows: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
37
+ description: z.ZodString;
38
+ steps: z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
39
+ task: z.ZodOptional<z.ZodString>;
40
+ flow: z.ZodOptional<z.ZodString>;
41
+ shell: z.ZodOptional<z.ZodString>;
42
+ options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
43
+ }, "strip", z.ZodTypeAny, {
44
+ options?: Record<string, unknown> | undefined;
45
+ task?: string | undefined;
46
+ flow?: string | undefined;
47
+ shell?: string | undefined;
48
+ }, {
49
+ options?: Record<string, unknown> | undefined;
50
+ task?: string | undefined;
51
+ flow?: string | undefined;
52
+ shell?: string | undefined;
53
+ }>, {
54
+ options?: Record<string, unknown> | undefined;
55
+ task?: string | undefined;
56
+ flow?: string | undefined;
57
+ shell?: string | undefined;
58
+ }, {
59
+ options?: Record<string, unknown> | undefined;
60
+ task?: string | undefined;
61
+ flow?: string | undefined;
62
+ shell?: string | undefined;
63
+ }>>;
64
+ }, "strip", z.ZodTypeAny, {
65
+ description: string;
66
+ steps: Record<string, {
67
+ options?: Record<string, unknown> | undefined;
68
+ task?: string | undefined;
69
+ flow?: string | undefined;
70
+ shell?: string | undefined;
71
+ }>;
72
+ }, {
73
+ description: string;
74
+ steps: Record<string, {
75
+ options?: Record<string, unknown> | undefined;
76
+ task?: string | undefined;
77
+ flow?: string | undefined;
78
+ shell?: string | undefined;
79
+ }>;
80
+ }>>>;
81
+ } & {
82
+ "ue-mcp": z.ZodOptional<z.ZodObject<{
83
+ version: z.ZodLiteral<1>;
84
+ }, "strip", z.ZodTypeAny, {
85
+ version: 1;
86
+ }, {
87
+ version: 1;
88
+ }>>;
89
+ project: z.ZodOptional<z.ZodObject<{
90
+ name: z.ZodOptional<z.ZodString>;
91
+ engine: z.ZodOptional<z.ZodString>;
92
+ }, "strip", z.ZodTypeAny, {
93
+ name?: string | undefined;
94
+ engine?: string | undefined;
95
+ }, {
96
+ name?: string | undefined;
97
+ engine?: string | undefined;
98
+ }>>;
99
+ }, "strip", z.ZodTypeAny, {
100
+ tasks: Record<string, {
101
+ options: Record<string, unknown>;
102
+ class_path: string;
103
+ description?: string | undefined;
104
+ group?: string | undefined;
105
+ }>;
106
+ flows: Record<string, {
107
+ description: string;
108
+ steps: Record<string, {
109
+ options?: Record<string, unknown> | undefined;
110
+ task?: string | undefined;
111
+ flow?: string | undefined;
112
+ shell?: string | undefined;
113
+ }>;
114
+ }>;
115
+ "ue-mcp"?: {
116
+ version: 1;
117
+ } | undefined;
118
+ project?: {
119
+ name?: string | undefined;
120
+ engine?: string | undefined;
121
+ } | undefined;
122
+ }, {
123
+ "ue-mcp"?: {
124
+ version: 1;
125
+ } | undefined;
126
+ project?: {
127
+ name?: string | undefined;
128
+ engine?: string | undefined;
129
+ } | undefined;
130
+ tasks?: Record<string, {
131
+ class_path: string;
132
+ options?: Record<string, unknown> | undefined;
133
+ description?: string | undefined;
134
+ group?: string | undefined;
135
+ }> | undefined;
136
+ flows?: Record<string, {
137
+ description: string;
138
+ steps: Record<string, {
139
+ options?: Record<string, unknown> | undefined;
140
+ task?: string | undefined;
141
+ flow?: string | undefined;
142
+ shell?: string | undefined;
143
+ }>;
144
+ }> | undefined;
145
+ }>;
146
+ export type FlowConfig = z.infer<typeof FlowConfigSchema>;
@@ -0,0 +1,14 @@
1
+ import { z } from "zod";
2
+ import { EngineConfigSchema } from "@db-lyon/flowkit";
3
+ export const FlowVersionSchema = z.object({
4
+ version: z.literal(1),
5
+ });
6
+ export const FlowProjectSchema = z.object({
7
+ name: z.string().optional(),
8
+ engine: z.string().optional(),
9
+ }).optional();
10
+ export const FlowConfigSchema = EngineConfigSchema.extend({
11
+ "ue-mcp": FlowVersionSchema.optional(),
12
+ project: FlowProjectSchema,
13
+ });
14
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/flow/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;CACtB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAC,QAAQ,EAAE,CAAC;AAEd,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,CAAC,MAAM,CAAC;IACxD,QAAQ,EAAE,iBAAiB,CAAC,QAAQ,EAAE;IACtC,OAAO,EAAE,iBAAiB;CAC3B,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { type TaskConstructor } from "@db-lyon/flowkit";
2
+ import type { FlowContext } from "./context.js";
3
+ /**
4
+ * Create a TaskConstructor for a bridge-delegation action.
5
+ * The bridge method (and optional param mapper) are closed over in the class.
6
+ */
7
+ export declare function bridgeTaskClass(name: string, method: string, mapParams?: (p: Record<string, unknown>) => Record<string, unknown>): TaskConstructor;
8
+ /**
9
+ * Create a TaskConstructor that wraps an existing async handler function.
10
+ * Used for the ~19 direct-handler actions (editor control, project ops, etc.).
11
+ */
12
+ export declare function handlerTaskClass(name: string, fn: (ctx: FlowContext, params: Record<string, unknown>) => Promise<unknown>): TaskConstructor;
@@ -0,0 +1,46 @@
1
+ import { BaseTask } from "@db-lyon/flowkit";
2
+ /**
3
+ * Create a TaskConstructor for a bridge-delegation action.
4
+ * The bridge method (and optional param mapper) are closed over in the class.
5
+ */
6
+ export function bridgeTaskClass(name, method, mapParams) {
7
+ class FactoryBridgeTask extends BaseTask {
8
+ get taskName() { return name; }
9
+ async execute() {
10
+ const ctx = this.ctx;
11
+ const params = mapParams
12
+ ? mapParams(this.options)
13
+ : this.options;
14
+ const data = await ctx.bridge.call(method, params);
15
+ return {
16
+ success: true,
17
+ data: typeof data === "object" && data !== null
18
+ ? data
19
+ : { result: data },
20
+ };
21
+ }
22
+ }
23
+ Object.defineProperty(FactoryBridgeTask, "name", { value: `BridgeTask_${name}` });
24
+ return FactoryBridgeTask;
25
+ }
26
+ /**
27
+ * Create a TaskConstructor that wraps an existing async handler function.
28
+ * Used for the ~19 direct-handler actions (editor control, project ops, etc.).
29
+ */
30
+ export function handlerTaskClass(name, fn) {
31
+ class FactoryHandlerTask extends BaseTask {
32
+ get taskName() { return name; }
33
+ async execute() {
34
+ const data = await fn(this.ctx, this.options);
35
+ return {
36
+ success: true,
37
+ data: typeof data === "object" && data !== null
38
+ ? data
39
+ : { result: data },
40
+ };
41
+ }
42
+ }
43
+ Object.defineProperty(FactoryHandlerTask, "name", { value: `HandlerTask_${name}` });
44
+ return FactoryHandlerTask;
45
+ }
46
+ //# sourceMappingURL=task-factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-factory.js","sourceRoot":"","sources":["../../src/flow/task-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAA2D,MAAM,kBAAkB,CAAC;AAGrG;;;GAGG;AACH,MAAM,UAAU,eAAe,CAC7B,IAAY,EACZ,MAAc,EACd,SAAmE;IAEnE,MAAM,iBAAkB,SAAQ,QAAQ;QACtC,IAAI,QAAQ,KAAK,OAAO,IAAI,CAAC,CAAC,CAAC;QAC/B,KAAK,CAAC,OAAO;YACX,MAAM,GAAG,GAAG,IAAI,CAAC,GAAkB,CAAC;YACpC,MAAM,MAAM,GAAG,SAAS;gBACtB,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,OAAkC,CAAC;gBACpD,CAAC,CAAC,IAAI,CAAC,OAAkC,CAAC;YAC5C,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YACnD,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,IAAI,EAAE,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI;oBAC7C,CAAC,CAAE,IAAgC;oBACnC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE;aACrB,CAAC;QACJ,CAAC;KACF;IACD,MAAM,CAAC,cAAc,CAAC,iBAAiB,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,cAAc,IAAI,EAAE,EAAE,CAAC,CAAC;IAClF,OAAO,iBAA+C,CAAC;AACzD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAC9B,IAAY,EACZ,EAA2E;IAE3E,MAAM,kBAAmB,SAAQ,QAAQ;QACvC,IAAI,QAAQ,KAAK,OAAO,IAAI,CAAC,CAAC,CAAC;QAC/B,KAAK,CAAC,OAAO;YACX,MAAM,IAAI,GA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