ue-mcp 1.3.2 → 1.3.4

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 (36) hide show
  1. package/dist/dialog-guard.d.ts +287 -0
  2. package/dist/dialog-guard.js +700 -0
  3. package/dist/dialog-guard.js.map +1 -0
  4. package/dist/editor-control.d.ts +77 -3
  5. package/dist/editor-control.js +163 -108
  6. package/dist/editor-control.js.map +1 -1
  7. package/dist/epic-cache.d.ts +12 -0
  8. package/dist/epic-cache.js +13 -0
  9. package/dist/epic-cache.js.map +1 -1
  10. package/dist/flow/guarded-bridge.d.ts +44 -10
  11. package/dist/flow/guarded-bridge.js +88 -20
  12. package/dist/flow/guarded-bridge.js.map +1 -1
  13. package/dist/flow/http-server.js +47 -4
  14. package/dist/flow/http-server.js.map +1 -1
  15. package/dist/flow/task-factory.js +41 -0
  16. package/dist/flow/task-factory.js.map +1 -1
  17. package/dist/flow/task-guards.js +17 -1
  18. package/dist/flow/task-guards.js.map +1 -1
  19. package/dist/index.js +201 -16
  20. package/dist/index.js.map +1 -1
  21. package/dist/locking.js +15 -0
  22. package/dist/locking.js.map +1 -1
  23. package/dist/offline.js +11 -2
  24. package/dist/offline.js.map +1 -1
  25. package/dist/session.js +8 -1
  26. package/dist/session.js.map +1 -1
  27. package/dist/tool-counts.json +2 -2
  28. package/dist/tools/editor.js +27 -5
  29. package/dist/tools/editor.js.map +1 -1
  30. package/package.json +2 -2
  31. package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Tests/BridgeProtocolTests.cpp +1 -1
  32. package/plugin/ue_mcp_bridge/Source/UE_MCP_Bridge/Private/Tests/SequencerScrubTests.cpp +1 -1
  33. package/plugin/ue_mcp_bridge/UE_MCP_Bridge.uplugin +1 -1
  34. package/dist/dialog-gate.d.ts +0 -48
  35. package/dist/dialog-gate.js +0 -93
  36. package/dist/dialog-gate.js.map +0 -1
@@ -1,93 +0,0 @@
1
- /** Actions that must stay reachable, or the dialog could never be answered. */
2
- const ALWAYS_ALLOWED = new Set([
3
- "editor.list_dialogs",
4
- "editor.respond_to_dialog",
5
- "editor.get_dialog_policy",
6
- "editor.set_dialog_policy",
7
- "editor.clear_dialog_policy",
8
- // Reading engine state is how a caller works out what is going on, and it is
9
- // served without the game thread, so it answers while a modal is up.
10
- "editor.get_engine_state",
11
- "project.get_status",
12
- ]);
13
- /** True for the refusal shape the plugin's gate returns. */
14
- export function isDialogRefusal(v) {
15
- return (typeof v === "object"
16
- && v !== null
17
- && v.dialogBlocking === true);
18
- }
19
- const latched = new WeakMap();
20
- /** Remember that this editor is sitting on a modal. */
21
- export function noteDialogBlocking(session, info) {
22
- latched.set(session, {
23
- dialogTitle: info.dialogTitle ?? "",
24
- dialogMessage: info.dialogMessage ?? "",
25
- buttons: Array.isArray(info.buttons) ? info.buttons : [],
26
- choices: Array.isArray(info.choices) ? info.choices : [],
27
- });
28
- }
29
- /** Forget it, once the dialog is gone. */
30
- export function clearDialogBlocking(session) {
31
- latched.delete(session);
32
- }
33
- export function latchedDialog(session) {
34
- return latched.get(session);
35
- }
36
- /**
37
- * The refusal a gated call gets, in the same shape the plugin emits so a
38
- * caller has one thing to branch on wherever the refusal came from.
39
- */
40
- export function buildRefusal(taskName, info) {
41
- return {
42
- success: false,
43
- dialogBlocking: true,
44
- refusedMethod: taskName,
45
- dialogTitle: info.dialogTitle,
46
- dialogMessage: info.dialogMessage,
47
- buttons: info.buttons,
48
- choices: info.choices,
49
- error: `A modal dialog is blocking the editor, so '${taskName}' was refused without running. `
50
- + "Unreal cannot execute anything else until the dialog is answered. Read it in "
51
- + "dialogMessage, choose a button, and press it with the call beside it in choices. "
52
- + "Every other action returns this same refusal until then.",
53
- };
54
- }
55
- /**
56
- * Whether this call is gated, re-probing the editor so a dialog answered by
57
- * hand in the editor window does not leave the latch stuck on.
58
- *
59
- * `probe` runs `list_dialogs`. A probe that throws leaves the latch alone and
60
- * lets the call through: the editor being unreachable is a different failure,
61
- * and reporting it as a dialog would be a lie.
62
- */
63
- export async function gateForDialog(session, taskName, probe) {
64
- if (ALWAYS_ALLOWED.has(taskName))
65
- return null;
66
- if (!latched.has(session))
67
- return null;
68
- let live;
69
- try {
70
- live = await probe();
71
- }
72
- catch {
73
- return null;
74
- }
75
- const dialogs = live?.dialogs;
76
- const first = Array.isArray(dialogs) ? dialogs[0] : undefined;
77
- if (!first) {
78
- clearDialogBlocking(session);
79
- return null;
80
- }
81
- const d = first;
82
- const refreshed = {
83
- dialogTitle: typeof d.title === "string" ? d.title : "",
84
- dialogMessage: typeof d.message === "string" ? d.message : "",
85
- buttons: Array.isArray(d.buttons) ? d.buttons : [],
86
- choices: Array.isArray(d.choices)
87
- ? d.choices
88
- : [],
89
- };
90
- noteDialogBlocking(session, refreshed);
91
- return buildRefusal(taskName, refreshed);
92
- }
93
- //# sourceMappingURL=dialog-gate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dialog-gate.js","sourceRoot":"","sources":["../src/dialog-gate.ts"],"names":[],"mappings":"AAiBA,+EAA+E;AAC/E,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;IAC7B,qBAAqB;IACrB,0BAA0B;IAC1B,0BAA0B;IAC1B,0BAA0B;IAC1B,4BAA4B;IAC5B,6EAA6E;IAC7E,qEAAqE;IACrE,yBAAyB;IACzB,oBAAoB;CACrB,CAAC,CAAC;AASH,4DAA4D;AAC5D,MAAM,UAAU,eAAe,CAAC,CAAU;IACxC,OAAO,CACL,OAAO,CAAC,KAAK,QAAQ;WAClB,CAAC,KAAK,IAAI;WACT,CAA6B,CAAC,cAAc,KAAK,IAAI,CAC1D,CAAC;AACJ,CAAC;AAED,MAAM,OAAO,GAAG,IAAI,OAAO,EAAqC,CAAC;AAEjE,uDAAuD;AACvD,MAAM,UAAU,kBAAkB,CAAC,OAAsB,EAAE,IAAwB;IACjF,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE;QACnB,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,E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