unity-open-mcp 1.2.3 → 1.3.0

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 (169) hide show
  1. package/README.md +33 -2
  2. package/dist/agent-identity.d.ts +12 -0
  3. package/dist/agent-identity.js +2 -0
  4. package/dist/agent-identity.js.map +1 -1
  5. package/dist/batch-spawn.d.ts +39 -0
  6. package/dist/batch-spawn.js +287 -69
  7. package/dist/batch-spawn.js.map +1 -1
  8. package/dist/capabilities/build-capabilities.js +2 -0
  9. package/dist/capabilities/build-capabilities.js.map +1 -1
  10. package/dist/capabilities/discovery.d.ts +51 -0
  11. package/dist/capabilities/discovery.js +87 -0
  12. package/dist/capabilities/discovery.js.map +1 -0
  13. package/dist/capabilities/lifecycle.d.ts +6 -0
  14. package/dist/capabilities/lifecycle.js +17 -1
  15. package/dist/capabilities/lifecycle.js.map +1 -1
  16. package/dist/capabilities/tool-groups.js +1 -0
  17. package/dist/capabilities/tool-groups.js.map +1 -1
  18. package/dist/child-supervision.d.ts +6 -0
  19. package/dist/child-supervision.js +12 -0
  20. package/dist/child-supervision.js.map +1 -1
  21. package/dist/cli/args.d.ts +24 -2
  22. package/dist/cli/args.js +97 -2
  23. package/dist/cli/args.js.map +1 -1
  24. package/dist/cli/cli.js +42 -3
  25. package/dist/cli/cli.js.map +1 -1
  26. package/dist/cli/help-text.d.ts +1 -0
  27. package/dist/cli/help-text.js +71 -3
  28. package/dist/cli/help-text.js.map +1 -1
  29. package/dist/cli/json-guards.d.ts +2 -0
  30. package/dist/cli/json-guards.js +5 -0
  31. package/dist/cli/json-guards.js.map +1 -0
  32. package/dist/cli/setup-command.d.ts +88 -0
  33. package/dist/cli/setup-command.js +444 -0
  34. package/dist/cli/setup-command.js.map +1 -0
  35. package/dist/cli/update-command.d.ts +30 -0
  36. package/dist/cli/update-command.js +271 -0
  37. package/dist/cli/update-command.js.map +1 -0
  38. package/dist/compile-verify.d.ts +3 -0
  39. package/dist/compile-verify.js +4 -0
  40. package/dist/compile-verify.js.map +1 -1
  41. package/dist/constants.d.ts +10 -2
  42. package/dist/constants.js +10 -2
  43. package/dist/constants.js.map +1 -1
  44. package/dist/dialog-dismiss.d.ts +108 -12
  45. package/dist/dialog-dismiss.js +294 -109
  46. package/dist/dialog-dismiss.js.map +1 -1
  47. package/dist/dialog-policy.d.ts +55 -9
  48. package/dist/dialog-policy.js +85 -15
  49. package/dist/dialog-policy.js.map +1 -1
  50. package/dist/editor-search.d.ts +2 -0
  51. package/dist/editor-search.js +8 -0
  52. package/dist/editor-search.js.map +1 -0
  53. package/dist/gate-error.d.ts +3 -0
  54. package/dist/gate-error.js.map +1 -1
  55. package/dist/index.js +55 -1
  56. package/dist/index.js.map +1 -1
  57. package/dist/instance-discovery.d.ts +16 -0
  58. package/dist/instance-discovery.js +45 -0
  59. package/dist/instance-discovery.js.map +1 -1
  60. package/dist/jobs/adapters.d.ts +15 -0
  61. package/dist/jobs/adapters.js +147 -0
  62. package/dist/jobs/adapters.js.map +1 -0
  63. package/dist/jobs/handler.d.ts +3 -0
  64. package/dist/jobs/handler.js +29 -0
  65. package/dist/jobs/handler.js.map +1 -0
  66. package/dist/jobs/job-manager.d.ts +123 -0
  67. package/dist/jobs/job-manager.js +290 -0
  68. package/dist/jobs/job-manager.js.map +1 -0
  69. package/dist/live-client.d.ts +50 -2
  70. package/dist/live-client.js +221 -26
  71. package/dist/live-client.js.map +1 -1
  72. package/dist/local-tools.d.ts +17 -0
  73. package/dist/local-tools.js +47 -0
  74. package/dist/local-tools.js.map +1 -0
  75. package/dist/project-path.d.ts +86 -0
  76. package/dist/project-path.js +159 -0
  77. package/dist/project-path.js.map +1 -0
  78. package/dist/release-lookup.d.ts +32 -0
  79. package/dist/release-lookup.js +147 -0
  80. package/dist/release-lookup.js.map +1 -0
  81. package/dist/routers.d.ts +17 -3
  82. package/dist/routers.js +28 -8
  83. package/dist/routers.js.map +1 -1
  84. package/dist/running-unity.d.ts +21 -0
  85. package/dist/running-unity.js +50 -0
  86. package/dist/running-unity.js.map +1 -1
  87. package/dist/schema-defaults.d.ts +4 -3
  88. package/dist/schema-defaults.js +20 -6
  89. package/dist/schema-defaults.js.map +1 -1
  90. package/dist/server-instructions.js +7 -1
  91. package/dist/server-instructions.js.map +1 -1
  92. package/dist/server.d.ts +10 -3
  93. package/dist/server.js +24 -25
  94. package/dist/server.js.map +1 -1
  95. package/dist/setup/portable-config.d.ts +60 -0
  96. package/dist/setup/portable-config.js +249 -0
  97. package/dist/setup/portable-config.js.map +1 -0
  98. package/dist/skill/SKILL.md +68 -0
  99. package/dist/skill/copy-references.d.ts +2 -0
  100. package/dist/skill/copy-references.js +16 -0
  101. package/dist/skill/copy-references.js.map +1 -0
  102. package/dist/skill/generate-skill.js +5 -3
  103. package/dist/skill/generate-skill.js.map +1 -1
  104. package/dist/skill/references/batch-and-gates.md +142 -0
  105. package/dist/skill/references/compile-and-safe-mode.md +163 -0
  106. package/dist/skill/references/discovery-and-groups.md +30 -0
  107. package/dist/skill/references/routing-and-lifecycle.md +62 -0
  108. package/dist/skill/references/senses-and-tests.md +41 -0
  109. package/dist/skill/references/yaml-and-offline-work.md +33 -0
  110. package/dist/templates/mcp-wrapper.sh +35 -0
  111. package/dist/tool-contract.d.ts +8 -0
  112. package/dist/tool-contract.js +253 -0
  113. package/dist/tool-contract.js.map +1 -0
  114. package/dist/tool-router.d.ts +62 -7
  115. package/dist/tool-router.js +455 -17
  116. package/dist/tool-router.js.map +1 -1
  117. package/dist/tool-session-state.d.ts +6 -0
  118. package/dist/tool-session-state.js +14 -0
  119. package/dist/tool-session-state.js.map +1 -1
  120. package/dist/tools/agent-capabilities.js +9 -0
  121. package/dist/tools/agent-capabilities.js.map +1 -1
  122. package/dist/tools/batch-execute.js +17 -14
  123. package/dist/tools/batch-execute.js.map +1 -1
  124. package/dist/tools/bridge-status.js +4 -5
  125. package/dist/tools/bridge-status.js.map +1 -1
  126. package/dist/tools/compile-check.js +6 -4
  127. package/dist/tools/compile-check.js.map +1 -1
  128. package/dist/tools/component-get.js +2 -2
  129. package/dist/tools/component-get.js.map +1 -1
  130. package/dist/tools/component-modify.js +4 -4
  131. package/dist/tools/component-modify.js.map +1 -1
  132. package/dist/tools/execute-csharp.js +8 -4
  133. package/dist/tools/execute-csharp.js.map +1 -1
  134. package/dist/tools/gameobject-modify.js +2 -1
  135. package/dist/tools/gameobject-modify.js.map +1 -1
  136. package/dist/tools/index.d.ts +2 -0
  137. package/dist/tools/index.js +10 -2
  138. package/dist/tools/index.js.map +1 -1
  139. package/dist/tools/inputsim-key.js +12 -14
  140. package/dist/tools/inputsim-key.js.map +1 -1
  141. package/dist/tools/inputsim-pointer.js +3 -3
  142. package/dist/tools/inputsim-pointer.js.map +1 -1
  143. package/dist/tools/inputsim-step.js +7 -8
  144. package/dist/tools/inputsim-step.js.map +1 -1
  145. package/dist/tools/inputsim-touch.js +9 -10
  146. package/dist/tools/inputsim-touch.js.map +1 -1
  147. package/dist/tools/jobs.d.ts +40 -0
  148. package/dist/tools/jobs.js +18 -0
  149. package/dist/tools/jobs.js.map +1 -0
  150. package/dist/tools/manage-tools.js +10 -5
  151. package/dist/tools/manage-tools.js.map +1 -1
  152. package/dist/tools/project-commands.d.ts +40 -0
  153. package/dist/tools/project-commands.js +23 -0
  154. package/dist/tools/project-commands.js.map +1 -0
  155. package/dist/tools/read-compile-errors.js +14 -93
  156. package/dist/tools/read-compile-errors.js.map +1 -1
  157. package/dist/tools/scan-paths.js +4 -4
  158. package/dist/tools/scan-paths.js.map +1 -1
  159. package/dist/tools/schema-fragments.d.ts +15 -3
  160. package/dist/tools/schema-fragments.js +23 -13
  161. package/dist/tools/schema-fragments.js.map +1 -1
  162. package/dist/tools/upgrade.d.ts +40 -0
  163. package/dist/tools/upgrade.js +55 -0
  164. package/dist/tools/upgrade.js.map +1 -0
  165. package/dist/unity-install-discovery.d.ts +24 -0
  166. package/dist/unity-install-discovery.js +113 -4
  167. package/dist/unity-install-discovery.js.map +1 -1
  168. package/package.json +4 -3
  169. package/templates/mcp-wrapper.sh +35 -0
@@ -0,0 +1,253 @@
1
+ import { implementedRules } from "./capabilities/rule-catalog.js";
2
+ // Explicit semantic inventory: prose edits must never change a locator contract.
3
+ const GAME_OBJECT_PATH_TOOLS = new Set([
4
+ "unity_senses_spatial_query",
5
+ "unity_open_mcp_prefab_create",
6
+ "unity_open_mcp_prefab_apply",
7
+ "unity_open_mcp_prefab_revert",
8
+ "unity_open_mcp_prefab_unpack",
9
+ "unity_open_mcp_prefab_get_overrides",
10
+ "unity_open_mcp_prefab_status",
11
+ "unity_open_mcp_gameobject_destroy",
12
+ "unity_open_mcp_gameobject_duplicate",
13
+ "unity_open_mcp_gameobject_find",
14
+ "unity_open_mcp_gameobject_modify",
15
+ "unity_open_mcp_gameobject_set_parent",
16
+ "unity_open_mcp_component_add",
17
+ "unity_open_mcp_component_destroy",
18
+ "unity_open_mcp_component_get",
19
+ "unity_open_mcp_component_modify",
20
+ "unity_open_mcp_scene_focus",
21
+ "unity_open_mcp_selection_set",
22
+ "unity_open_mcp_navigation_surface_add",
23
+ "unity_open_mcp_navigation_set_bake_settings",
24
+ "unity_open_mcp_navigation_surface_bake",
25
+ "unity_open_mcp_navigation_modifier_add",
26
+ "unity_open_mcp_navigation_modifier_volume_add",
27
+ "unity_open_mcp_navigation_link_add",
28
+ "unity_open_mcp_navigation_agent_add",
29
+ "unity_open_mcp_navigation_agent_set_destination",
30
+ "unity_open_mcp_navigation_get",
31
+ "unity_open_mcp_navigation_modify",
32
+ "unity_open_mcp_probuilder_get_mesh_info",
33
+ "unity_open_mcp_probuilder_extrude",
34
+ "unity_open_mcp_probuilder_delete_faces",
35
+ "unity_open_mcp_probuilder_set_face_material",
36
+ "unity_open_mcp_particle_system_get",
37
+ "unity_open_mcp_particle_system_modify",
38
+ "unity_open_mcp_splines_add_knot",
39
+ "unity_open_mcp_splines_set_knot",
40
+ "unity_open_mcp_splines_set_tangent_mode",
41
+ "unity_open_mcp_splines_evaluate",
42
+ "unity_open_mcp_splines_get_knots",
43
+ "unity_open_mcp_splines_modify",
44
+ "unity_open_mcp_light_add",
45
+ "unity_open_mcp_light_set",
46
+ "unity_open_mcp_light_modify",
47
+ "unity_open_mcp_reflection_probe_bake",
48
+ "unity_open_mcp_reflection_probe_get",
49
+ "unity_open_mcp_audio_source_add",
50
+ "unity_open_mcp_audio_source_modify",
51
+ "unity_open_mcp_ui_canvas_add",
52
+ "unity_open_mcp_ui_layout_group_add",
53
+ "unity_open_mcp_ui_element_modify",
54
+ "unity_open_mcp_constraint_add",
55
+ "unity_open_mcp_lod_group_configure",
56
+ "unity_open_mcp_lod_add_level",
57
+ "unity_open_mcp_terrain_set_heights",
58
+ "unity_open_mcp_terrain_paint_layer",
59
+ "unity_open_mcp_terrain_place_trees",
60
+ "unity_open_mcp_terrain_set_neighbors",
61
+ "unity_open_mcp_cinemachine_set_targets",
62
+ "unity_open_mcp_cinemachine_set_lens",
63
+ "unity_open_mcp_cinemachine_set_body",
64
+ "unity_open_mcp_cinemachine_set_noise",
65
+ "unity_open_mcp_cinemachine_brain_ensure",
66
+ "unity_open_mcp_timeline_director_bind",
67
+ "unity_open_mcp_tilemap_set_tile",
68
+ "unity_open_mcp_tilemap_box_fill",
69
+ ]);
70
+ const ASSET_PATH_TOOLS = new Set([
71
+ "unity_open_mcp_scene_create",
72
+ "unity_open_mcp_scene_open",
73
+ "unity_open_mcp_scene_save",
74
+ "unity_open_mcp_scene_unload",
75
+ "unity_open_mcp_scene_set_active",
76
+ "unity_open_mcp_scene_get_data",
77
+ ]);
78
+ // GameObject host selectors for the "supply only one selector" rule. `name`
79
+ // selects by name unless the tool uses it as a payload; such tools name their
80
+ // by-name selector here and publish their full set as `x-gameobject-selectors`,
81
+ // which the bridge's BatchSchemaValidator reads from the generated schema.
82
+ const DEFAULT_GAMEOBJECT_SELECTORS = ["instance_id", "game_object_path", "path", "target_path", "name"];
83
+ const NAME_SELECTOR_OVERRIDES = {
84
+ // `name` is the new name; the target is resolved by name_target.
85
+ unity_open_mcp_gameobject_modify: "name_target",
86
+ };
87
+ /** Selector keys the one-selector rule applies to; null when the schema has no GameObject host. */
88
+ function gameObjectSelectors(schema) {
89
+ if (Array.isArray(schema["x-gameobject-selectors"]))
90
+ return schema["x-gameobject-selectors"];
91
+ if (schema["x-project-command"] || !schema.properties?.game_object_path)
92
+ return null;
93
+ return DEFAULT_GAMEOBJECT_SELECTORS.filter(k => schema.properties[k]);
94
+ }
95
+ /** Locator names are explicit in the published contract; aliases retain their wire key. */
96
+ export function canonicalSchema(name, input) {
97
+ const schema = structuredClone(input);
98
+ const props = schema.properties;
99
+ // offline_integrity is a reporting aggregator, not a registered VerifyRunner rule.
100
+ for (const key of ["include_rules", "exclude_rules", ...(name === "unity_open_mcp_scan_paths" ? ["categories"] : [])])
101
+ if (props[key]?.items)
102
+ props[key].items.enum = implementedRules().filter(r => r.id !== "offline_integrity").map(r => r.id);
103
+ const rename = (s, old, key) => {
104
+ if (!s.properties?.[old] || s.properties[key])
105
+ return;
106
+ s.properties[key] = { ...s.properties[old], "x-wire-key": old };
107
+ s.properties[old] = { ...s.properties[old], deprecated: true, "x-alias-for": key,
108
+ description: `Deprecated alias; use ${key}.` };
109
+ delete s.properties[old].default;
110
+ if (s.required?.includes(old)) {
111
+ s.required = s.required.filter((k) => k !== old);
112
+ s.allOf = [...(s.allOf ?? []), { anyOf: [{ required: [key] }, { required: [old] }] }];
113
+ }
114
+ };
115
+ if (GAME_OBJECT_PATH_TOOLS.has(name))
116
+ rename(schema, "path", "game_object_path");
117
+ if (ASSET_PATH_TOOLS.has(name))
118
+ rename(schema, "path", "asset_path");
119
+ rename(schema, "prefab_asset_path", "asset_path");
120
+ if (props.prefab_asset_path)
121
+ props.prefab_path = { type: "string", deprecated: true, "x-alias-for": "asset_path", description: "Deprecated alias; use asset_path." };
122
+ if (props.game_object_path && !props.target_path)
123
+ props.target_path = { type: "string", deprecated: true, "x-alias-for": "game_object_path", description: "Deprecated alias; use game_object_path." };
124
+ if (/component_(get|modify|add)/.test(name))
125
+ rename(schema, "type_name", "component_type");
126
+ if (name.endsWith("component_modify"))
127
+ rename(props.fields.items, "path", "property_path");
128
+ if (name === "unity_open_mcp_find_references" || name === "unity_open_mcp_dependencies") {
129
+ props.path = { type: "string", deprecated: true, "x-alias-for": "asset_path", description: "Deprecated alias; use asset_path." };
130
+ for (const branch of schema.oneOf ?? [])
131
+ if (branch.required?.includes("asset_path")) {
132
+ branch.required = branch.required.filter((k) => k !== "asset_path");
133
+ branch.anyOf = [{ required: ["asset_path"] }, { required: ["path"] }];
134
+ }
135
+ }
136
+ if (props.prefab_path)
137
+ for (const clause of schema.allOf ?? [])
138
+ if (clause.anyOf?.some((b) => b.required?.includes("asset_path")))
139
+ clause.anyOf.push({ required: ["prefab_path"] });
140
+ if (props.game_object_path) {
141
+ const nameSelector = NAME_SELECTOR_OVERRIDES[name] ?? "name";
142
+ if (nameSelector !== "name")
143
+ schema["x-gameobject-selectors"] = DEFAULT_GAMEOBJECT_SELECTORS.map(k => k === "name" ? nameSelector : k).filter(k => props[k]);
144
+ props.game_object_path.description = `GameObject hierarchy path, e.g. Root/Child. Supply only one host selector: instance_id, game_object_path, or ${nameSelector}.`;
145
+ }
146
+ if (props.component_type)
147
+ props.component_type.description = "Component type (full name preferred); alternative to component_instance_id.";
148
+ return schema;
149
+ }
150
+ /**
151
+ * An explicit `null` for an OPTIONAL property whose schema declares a
152
+ * non-null type is read as "omitted": MCP clients routinely serialize an
153
+ * absent optional argument as null, and the bridge's own readers treat such a
154
+ * value as absent. A required property, a property without a declared type
155
+ * (opaque patch values such as component_modify's `value`) and a type that
156
+ * lists `null` keep the value as sent.
157
+ */
158
+ function isNullOmitted(schema, key, value) {
159
+ if (value !== null)
160
+ return false;
161
+ if ((schema.required ?? []).includes(key))
162
+ return false;
163
+ const type = schema.properties?.[key]?.type;
164
+ if (!type)
165
+ return false;
166
+ return !(Array.isArray(type) ? type : [type]).includes("null");
167
+ }
168
+ /** `value` without its null-omitted properties; the input object is not mutated. */
169
+ function withoutNullOmitted(value, schema) {
170
+ if (!schema.properties)
171
+ return value;
172
+ const kept = Object.entries(value).filter(([key, v]) => !isNullOmitted(schema, key, v));
173
+ return kept.length === Object.keys(value).length ? value : Object.fromEntries(kept);
174
+ }
175
+ /** Validate before dispatch, including nested records; arbitrary value payloads stay opaque. */
176
+ export function validateSchema(value, schema, path = "args") {
177
+ if (value && typeof value === "object" && !Array.isArray(value))
178
+ value = withoutNullOmitted(value, schema);
179
+ const errors = [];
180
+ for (const op of ["anyOf", "oneOf", "allOf"])
181
+ if (schema[op]) {
182
+ const n = schema[op].filter((s) => validateSchema(value, s, path).length === 0).length;
183
+ if ((op === "anyOf" && !n) || (op === "oneOf" && n !== 1) || (op === "allOf" && n !== schema[op].length))
184
+ errors.push(`${path} must satisfy ${op}`);
185
+ }
186
+ const matches = (t) => t === "array" ? Array.isArray(value) : t === "object" ? value !== null && typeof value === "object" && !Array.isArray(value) : t === "integer" ? Number.isInteger(value) : t === "null" ? value === null : typeof value === t;
187
+ if (schema.type && !(Array.isArray(schema.type) ? schema.type : [schema.type]).some(matches))
188
+ return [`${path} must be ${schema.type}`];
189
+ if (schema.enum && !schema.enum.includes(value))
190
+ errors.push(`${path} must be one of ${schema.enum.join(", ")}`);
191
+ if (value && typeof value === "object" && !Array.isArray(value)) {
192
+ for (const key of schema.required ?? [])
193
+ if (value[key] === undefined)
194
+ errors.push(`${path}.${key} is required`);
195
+ const selectorKeys = gameObjectSelectors(schema);
196
+ if (selectorKeys) {
197
+ const supplied = (k) => value[k] !== undefined && value[k] !== null && value[k] !== "" && value[k] !== 0 && value[k] !== "0";
198
+ const selectors = selectorKeys.filter(supplied);
199
+ if (selectors.length > 1)
200
+ errors.push(`${path}: supply only one GameObject selector (prefer game_object_path); ignored keys: ${selectors.join(", ")}`);
201
+ if (supplied("component_instance_id") && ["component_type", "type_name"].some(supplied))
202
+ errors.push(`${path}: component_instance_id and component_type are alternatives`);
203
+ }
204
+ if (schema.properties)
205
+ for (const [key, child] of Object.entries(value)) {
206
+ const prop = Object.prototype.hasOwnProperty.call(schema.properties, key) ? schema.properties[key] : undefined;
207
+ if (!prop && schema.additionalProperties === false)
208
+ errors.push(`${path}.${key} is unknown; canonical keys: ${Object.keys(schema.properties).filter(k => !schema.properties[k].deprecated).join(", ")}`);
209
+ if (prop) {
210
+ if (prop["x-alias-for"] && Object.keys(value).some(other => other !== key && (other === prop["x-alias-for"] || schema.properties[other]?.["x-alias-for"] === prop["x-alias-for"])))
211
+ errors.push(`${path}.${key} conflicts with another selector; use only ${prop["x-alias-for"]}`);
212
+ errors.push(...validateSchema(child, prop, `${path}.${key}`));
213
+ }
214
+ }
215
+ }
216
+ if (Array.isArray(value) && schema.items)
217
+ value.forEach((v, i) => errors.push(...validateSchema(v, schema.items, `${path}[${i}]`)));
218
+ if (typeof value === "string" && schema.pattern && !new RegExp(schema.pattern).test(value))
219
+ errors.push(`${path} does not match ${schema.pattern}`);
220
+ const size = typeof value === "number" ? value : typeof value === "string" || Array.isArray(value) ? value.length : undefined;
221
+ if (size !== undefined) {
222
+ for (const k of ["minimum", "minItems", "minLength"])
223
+ if (schema[k] !== undefined && size < schema[k])
224
+ errors.push(`${path} violates ${k}`);
225
+ if (typeof value === "number" && schema.exclusiveMinimum !== undefined && value <= schema.exclusiveMinimum)
226
+ errors.push(`${path} violates exclusiveMinimum`);
227
+ if (typeof value === "number" && schema.exclusiveMaximum !== undefined && value >= schema.exclusiveMaximum)
228
+ errors.push(`${path} violates exclusiveMaximum`);
229
+ for (const k of ["maximum", "maxItems", "maxLength"])
230
+ if (schema[k] !== undefined && size > schema[k])
231
+ errors.push(`${path} violates ${k}`);
232
+ }
233
+ return errors;
234
+ }
235
+ export function wireArguments(value, schema, notes = []) {
236
+ if (Array.isArray(value))
237
+ return value.map(v => wireArguments(v, schema.items ?? {}, notes));
238
+ if (!value || typeof value !== "object" || !schema.properties)
239
+ return value;
240
+ const out = {};
241
+ // Null-omitted properties never reach the wire: the bridge validates the
242
+ // same schema and would otherwise refuse the null the server just waived.
243
+ for (const [key, v] of Object.entries(withoutNullOmitted(value, schema))) {
244
+ const p = schema.properties[key] ?? {};
245
+ const canonical = p["x-alias-for"];
246
+ if (canonical)
247
+ notes.push(`${key} is deprecated; use ${canonical}.`);
248
+ const target = p["x-wire-key"] ?? (canonical ? schema.properties[canonical]?.["x-wire-key"] ?? canonical : key);
249
+ out[target] = wireArguments(v, p, notes);
250
+ }
251
+ return out;
252
+ }
253
+ //# sourceMappingURL=tool-contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-contract.js","sourceRoot":"","sources":["../src/tool-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAKlE,iFAAiF;AACjF,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC;IACrC,4BAA4B;IAC5B,8BAA8B;IAC9B,6BAA6B;IAC7B,8BAA8B;IAC9B,8BAA8B;IAC9B,qCAAqC;IACrC,8BAA8B;IAC9B,mCAAmC;IACnC,qCAAqC;IACrC,gCAAgC;IAChC,kCAAkC;IAClC,sCAAsC;IACtC,8BAA8B;IAC9B,kCAAkC;IAClC,8BAA8B;IAC9B,iCAAiC;IACjC,4BAA4B;IAC5B,8BAA8B;IAC9B,uCAAuC;IACvC,6CAA6C;IAC7C,wCAAwC;IACxC,wCAAwC;IACxC,+CAA+C;IAC/C,oCAAoC;IACpC,qCAAqC;IACrC,iDAAiD;IACjD,+BAA+B;IAC/B,kCAAkC;IAClC,yCAAyC;IACzC,mCAAmC;IACnC,wCAAwC;IACxC,6CAA6C;IAC7C,oCAAoC;IACpC,uCAAuC;IACvC,iCAAiC;IACjC,iCAAiC;IACjC,yCAAyC;IACzC,iCAAiC;IACjC,kCAAkC;IAClC,+BAA+B;IAC/B,0BAA0B;IAC1B,0BAA0B;IAC1B,6BAA6B;IAC7B,sCAAsC;IACtC,qCAAqC;IACrC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KAAK,IAAI,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;IAC7F,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,UAAU;QAAE,OAAO,KAAK,CAAC;IAC5E,MAAM,GAAG,GAA4B,EAAE,CAAC;IACxC,yEAAyE;IACzE,0EAA0E;IAC1E,KAAK,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;QACzE,MAAM,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;QACvC,MAAM,SAAS,GAAG,CAAC,CAAC,aAAa,CAAC,CAAC;QACnC,IAAI,SAAS;YAAE,KAAK,CAAC,IAAI,CAAC,GAAG,GAAG,uBAAuB,SAAS,GAAG,CAAC,CAAC;QACrE,MAAM,MAAM,GAAG,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAChH,GAAG,CAAC,MAAM,CAAC,GAAG,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;IAC3C,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -1,7 +1,9 @@
1
+ import { JobManager } from "./jobs/job-manager.js";
2
+ import { type RequestIdentity } from "./agent-identity.js";
3
+ import { type BridgeTagConfirmation } from "./release-lookup.js";
1
4
  import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
2
5
  import type { Router } from "./router.js";
3
- import type { LiveClient } from "./live-client.js";
4
- import type { BatchSpawn } from "./batch-spawn.js";
6
+ import { LiveClient } from "./live-client.js";
5
7
  import type { BridgeEventStream } from "./event-stream.js";
6
8
  export declare function resolveRouteLogEnabled(env?: NodeJS.ProcessEnv): boolean;
7
9
  export declare const ROUTE_LOG_ENABLED: boolean;
@@ -23,7 +25,8 @@ export interface HubControlBackend {
23
25
  getInstallPath(): InstallPathResult;
24
26
  setInstallPath(path: string): ReturnType<typeof setInstallPath>;
25
27
  }
26
- import type { ToolSessionState } from "./tool-session-state.js";
28
+ import { BatchSpawn } from "./batch-spawn.js";
29
+ import { type ToolSessionState } from "./tool-session-state.js";
27
30
  export type SourceTag = "live" | "offline" | "local";
28
31
  export interface RouteMeta {
29
32
  /**
@@ -45,6 +48,19 @@ export interface RouteMeta {
45
48
  */
46
49
  editorPid?: number;
47
50
  }
51
+ /**
52
+ * Release lookups behind `unity_open_mcp_upgrade`. Injectable so unit tests
53
+ * never touch npm or GitHub; production uses the shared `release-lookup`
54
+ * module with the global fetch.
55
+ */
56
+ export interface ReleaseLookup {
57
+ latest(): Promise<{
58
+ version: string;
59
+ }>;
60
+ confirmBridgeTag(version: string): Promise<BridgeTagConfirmation>;
61
+ }
62
+ /** Test seam for the upgrade route's network lookups. Returns a restore function. */
63
+ export declare function setReleaseLookupForTest(lookup: ReleaseLookup | null): () => void;
48
64
  export declare class ToolRouter implements Router {
49
65
  private live;
50
66
  private batch;
@@ -54,6 +70,10 @@ export declare class ToolRouter implements Router {
54
70
  private onToolListChanged?;
55
71
  private hubBackend;
56
72
  private globalLogPathOverride?;
73
+ private jobManager?;
74
+ get jobs(): JobManager;
75
+ closeJobs(): void;
76
+ routeJobs(args: Record<string, unknown>, identity?: RequestIdentity): Promise<CallToolResult>;
57
77
  private readonly modelCache;
58
78
  /**
59
79
  * M28-refactoring Plan 3 (T3.2) — named-tool dispatch map. Replaces the
@@ -68,17 +88,41 @@ export declare class ToolRouter implements Router {
68
88
  private routeHandlers?;
69
89
  private getRouteHandlers;
70
90
  constructor(live: LiveClient, batch: BatchSpawn, projectPath: string, eventStream: BridgeEventStream, sessionState: ToolSessionState, onToolListChanged?: (() => void | Promise<void>) | undefined, hubBackend?: HubControlBackend, globalLogPathOverride?: string | undefined);
71
- route(toolName: string, args: Record<string, unknown>): Promise<CallToolResult>;
91
+ route(toolName: string, args: Record<string, unknown>, identity?: RequestIdentity): Promise<CallToolResult>;
92
+ /**
93
+ * `capabilities` / `bridge_status` with an explicit project_path, from any
94
+ * entry point (direct, manage_tools invoke, port override). The probe router
95
+ * gets the arguments without project_path, so it dispatches normally. A
96
+ * per-request port override is refused rather than dropped or mixed in:
97
+ * project_path brings its own port/auth discovery, and pinging the override
98
+ * port would present another bridge's answer as the probed project's.
99
+ */
100
+ private routeProjectProbe;
101
+ /**
102
+ * Router for a read-only probe of another project: its own port/auth
103
+ * discovery and a throwaway copy of this session. Discovery still reconciles
104
+ * auto-activation against the probed project's inventory, so the probe
105
+ * reports that project's view, but only the copy changes — this session's
106
+ * active groups and tools/list stay put, and no list_changed is wired. The
107
+ * probe tools are local-only and never spawn Unity; the probe's own batch
108
+ * router only answers headless availability for that project's editor.
109
+ */
110
+ private projectProbeRouter;
111
+ private static readonly PROBE_BATCH_CACHE_SIZE;
112
+ private readonly probeBatchByProject;
113
+ private projectProbeBatch;
72
114
  /**
73
115
  * M23 Plan 3 — route with a per-call live-client override. Used when a
74
116
  * per-request `_meta.port` override targets a different bridge instance than
75
117
  * the default. The override client bypasses shared session state (it is a
76
118
  * fresh LiveClient aimed at the override port); all other routing logic is
77
- * identical to {@link route}. When `overrideLive` is null the default client
78
- * is used (identical to {@link route}).
119
+ * identical to {@link route}. `identity` carries the override port and the
120
+ * request's agent id.
79
121
  */
80
- routeOverride(toolName: string, args: Record<string, unknown>, overrideLive: LiveClient): Promise<CallToolResult>;
122
+ routeOverride(toolName: string, args: Record<string, unknown>, overrideLive: LiveClient, identity: RequestIdentity): Promise<CallToolResult>;
81
123
  private routeCore;
124
+ private routeValidated;
125
+ private routeUnchecked;
82
126
  private batchPingResult;
83
127
  /**
84
128
  * feedback-fable-04-08 §7 — when a `live_unavailable` batch fallback lands
@@ -106,6 +150,17 @@ export declare class ToolRouter implements Router {
106
150
  private routeListRules;
107
151
  private routeGenerateSkill;
108
152
  private routeManageTools;
153
+ /**
154
+ * `unity_open_mcp_upgrade` is a live tool, but its network lookups run HERE
155
+ * rather than inside the bridge: the bridge tool executes on the Editor main
156
+ * thread, where a 10 s registry timeout would freeze the Editor and every
157
+ * queued bridge request. The bridge only ever receives a resolved
158
+ * `target_version`, and an apply that will re-pin through UPM is forwarded
159
+ * only after the `bridge-v<version>` release tag was confirmed to exist —
160
+ * the same preview → confirm → apply order the bridge window follows.
161
+ */
162
+ private routeUpgrade;
163
+ private routeProjectCommands;
109
164
  private manageToolsListGroups;
110
165
  private manageToolsSuggest;
111
166
  private manageToolsActivateFor;