unity-open-mcp 0.5.0 → 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 (95) hide show
  1. package/README.md +15 -12
  2. package/dist/batch-spawn.d.ts +4 -0
  3. package/dist/batch-spawn.js +55 -11
  4. package/dist/batch-spawn.js.map +1 -1
  5. package/dist/capabilities/cost-hints.js +20 -0
  6. package/dist/capabilities/cost-hints.js.map +1 -1
  7. package/dist/cli/commands.js +9 -8
  8. package/dist/cli/commands.js.map +1 -1
  9. package/dist/constants.d.ts +89 -0
  10. package/dist/constants.js +109 -0
  11. package/dist/constants.js.map +1 -0
  12. package/dist/dialog-dismiss.d.ts +0 -7
  13. package/dist/dialog-dismiss.js +17 -19
  14. package/dist/dialog-dismiss.js.map +1 -1
  15. package/dist/hub-control.d.ts +6 -2
  16. package/dist/hub-control.js +8 -8
  17. package/dist/hub-control.js.map +1 -1
  18. package/dist/index.js +6 -5
  19. package/dist/index.js.map +1 -1
  20. package/dist/instance-discovery.js +2 -1
  21. package/dist/instance-discovery.js.map +1 -1
  22. package/dist/live-client.d.ts +49 -0
  23. package/dist/live-client.js +292 -255
  24. package/dist/live-client.js.map +1 -1
  25. package/dist/offline/api.d.ts +171 -0
  26. package/dist/offline/api.js +852 -0
  27. package/dist/offline/api.js.map +1 -0
  28. package/dist/offline/hierarchy.d.ts +24 -0
  29. package/dist/offline/hierarchy.js +242 -0
  30. package/dist/offline/hierarchy.js.map +1 -0
  31. package/dist/offline/index-builders.d.ts +11 -0
  32. package/dist/offline/index-builders.js +202 -0
  33. package/dist/offline/index-builders.js.map +1 -0
  34. package/dist/offline/model.d.ts +8 -0
  35. package/dist/offline/model.js +188 -0
  36. package/dist/offline/model.js.map +1 -0
  37. package/dist/offline/names.d.ts +7 -0
  38. package/dist/offline/names.js +20 -0
  39. package/dist/offline/names.js.map +1 -0
  40. package/dist/offline/overrides.d.ts +17 -0
  41. package/dist/offline/overrides.js +266 -0
  42. package/dist/offline/overrides.js.map +1 -0
  43. package/dist/offline/parse.d.ts +25 -0
  44. package/dist/offline/parse.js +236 -0
  45. package/dist/offline/parse.js.map +1 -0
  46. package/dist/offline/paths.d.ts +4 -0
  47. package/dist/offline/paths.js +23 -0
  48. package/dist/offline/paths.js.map +1 -0
  49. package/dist/offline/primitives.d.ts +17 -0
  50. package/dist/offline/primitives.js +195 -0
  51. package/dist/offline/primitives.js.map +1 -0
  52. package/dist/offline/references.d.ts +9 -0
  53. package/dist/offline/references.js +55 -0
  54. package/dist/offline/references.js.map +1 -0
  55. package/dist/offline/types.d.ts +65 -0
  56. package/dist/offline/types.js +154 -0
  57. package/dist/offline/types.js.map +1 -0
  58. package/dist/offline.d.ts +2 -180
  59. package/dist/offline.js +27 -2282
  60. package/dist/offline.js.map +1 -1
  61. package/dist/project-health.d.ts +1 -1
  62. package/dist/project-health.js +66 -3
  63. package/dist/project-health.js.map +1 -1
  64. package/dist/routers.js +6 -5
  65. package/dist/routers.js.map +1 -1
  66. package/dist/tool-router.d.ts +12 -0
  67. package/dist/tool-router.js +72 -100
  68. package/dist/tool-router.js.map +1 -1
  69. package/dist/tools/component-get.js +44 -11
  70. package/dist/tools/component-get.js.map +1 -1
  71. package/dist/tools/editor-status.js +3 -2
  72. package/dist/tools/editor-status.js.map +1 -1
  73. package/dist/tools/execute-csharp.js +3 -2
  74. package/dist/tools/execute-csharp.js.map +1 -1
  75. package/dist/tools/index.js +19 -17
  76. package/dist/tools/index.js.map +1 -1
  77. package/dist/tools/inputsystem-asset-create.js +4 -4
  78. package/dist/tools/inputsystem-asset-create.js.map +1 -1
  79. package/dist/tools/invoke-method.js +2 -1
  80. package/dist/tools/invoke-method.js.map +1 -1
  81. package/dist/tools/navigation-surface-add.js +6 -5
  82. package/dist/tools/navigation-surface-add.js.map +1 -1
  83. package/dist/tools/probuilder-create-shape.js +4 -4
  84. package/dist/tools/probuilder-create-shape.js.map +1 -1
  85. package/dist/tools/read-compile-errors.js +44 -31
  86. package/dist/tools/read-compile-errors.js.map +1 -1
  87. package/dist/tools/scene-get-data.js +10 -2
  88. package/dist/tools/scene-get-data.js.map +1 -1
  89. package/dist/tools/scene-save.js +16 -5
  90. package/dist/tools/scene-save.js.map +1 -1
  91. package/dist/tools/scene-set-active.js +22 -6
  92. package/dist/tools/scene-set-active.js.map +1 -1
  93. package/dist/tools/scene-unload.js +20 -6
  94. package/dist/tools/scene-unload.js.map +1 -1
  95. package/package.json +1 -1
@@ -91,7 +91,56 @@ export declare class LiveClient implements Router {
91
91
  private handleToolCall;
92
92
  private handleRunTests;
93
93
  private pollTestResults;
94
+ /**
95
+ * POST a tool call to the bridge and shape the response. Decomposed in
96
+ * M28-refactoring Plan 3 (T3.3) into named steps so retry, compile-wait,
97
+ * transient-offline handling, and result shaping are independently readable.
98
+ *
99
+ * Pipeline:
100
+ * 1. {@link postToolFetch} — POST with a timeout floored above the bridge's
101
+ * own default wait, handling 503-compile-retry and non-OK HTTP.
102
+ * 2. {@link shapeToolResult} — parse the body and dispatch mutation-envelope
103
+ * vs direct-body vs inline-image vs reload/corruption outcomes.
104
+ * 3. On a transient fetch failure, {@link handlePostFailure} classifies +
105
+ * recovers (re-syncing the endpoint, waiting out a reload, or surfacing
106
+ * the structured offline/dead-bridge error) and re-POSTs only when safe.
107
+ *
108
+ * The retry/compile contract is unchanged from the former monolithic body.
109
+ */
94
110
  private postTool;
111
+ /**
112
+ * Step 1 of {@link postTool}: perform the HTTP POST with the timeout floor,
113
+ * then handle 503-compile-retry and non-OK HTTP. Returns either a shaped
114
+ * {@link CallToolResult} (handed straight back by postTool) or a sentinel
115
+ * `{ _repostAfterCompile: true }` signaling a clean compile settle that
116
+ * should re-POST without 503 retry. Throws on transient fetch failure so the
117
+ * caller's catch runs {@link handlePostFailure}.
118
+ */
119
+ private postToolFetch;
120
+ /**
121
+ * Step 2 of {@link postTool}: parse the bridge response body and shape it into
122
+ * a {@link CallToolResult}. Handles the four response outcomes:
123
+ * - inline-image unwrap (capture_inline → MCP image block + metadata),
124
+ * - mutation envelope (derive isError from mutation.success),
125
+ * - compile-reload empty body (triggered_reload — likely-success domain
126
+ * reload tore down the socket mid-response),
127
+ * - direct body (verbatim, isError when a top-level error field is present),
128
+ * - unparsable body (bridge_response_unparsable corruption error).
129
+ */
130
+ private shapeToolResult;
131
+ /**
132
+ * Step 3 of {@link postTool}: classify + recover from a transient POST
133
+ * failure (ECONNREFUSED / timeout during a domain reload). Re-syncs the cached
134
+ * endpoint from the lock first (so a Unity restart self-heals), waits out a
135
+ * reload, and re-POSTs ONLY when safe (endpoint changed during recovery, or a
136
+ * genuine connection failure where no bytes reached the server).
137
+ *
138
+ * Re-POST discipline (specs/feedback.md entry 4A — duplicate side-effects):
139
+ * when the endpoint is unchanged the same live bridge is still processing —
140
+ * or has queued — the original POST's Work; re-POSTing would run the mutation
141
+ * a second time. In that case surface the timeout instead of retrying.
142
+ */
143
+ private handlePostFailure;
95
144
  private ensureReady;
96
145
  /**
97
146
  * M20 Plan 4-5 / T-fix-2 — classify a transient /ping or tool-POST failure