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.
- package/README.md +15 -12
- package/dist/batch-spawn.d.ts +4 -0
- package/dist/batch-spawn.js +55 -11
- package/dist/batch-spawn.js.map +1 -1
- package/dist/capabilities/cost-hints.js +20 -0
- package/dist/capabilities/cost-hints.js.map +1 -1
- package/dist/cli/commands.js +9 -8
- package/dist/cli/commands.js.map +1 -1
- package/dist/constants.d.ts +89 -0
- package/dist/constants.js +109 -0
- package/dist/constants.js.map +1 -0
- package/dist/dialog-dismiss.d.ts +0 -7
- package/dist/dialog-dismiss.js +17 -19
- package/dist/dialog-dismiss.js.map +1 -1
- package/dist/hub-control.d.ts +6 -2
- package/dist/hub-control.js +8 -8
- package/dist/hub-control.js.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/instance-discovery.js +2 -1
- package/dist/instance-discovery.js.map +1 -1
- package/dist/live-client.d.ts +49 -0
- package/dist/live-client.js +292 -255
- package/dist/live-client.js.map +1 -1
- package/dist/offline/api.d.ts +171 -0
- package/dist/offline/api.js +852 -0
- package/dist/offline/api.js.map +1 -0
- package/dist/offline/hierarchy.d.ts +24 -0
- package/dist/offline/hierarchy.js +242 -0
- package/dist/offline/hierarchy.js.map +1 -0
- package/dist/offline/index-builders.d.ts +11 -0
- package/dist/offline/index-builders.js +202 -0
- package/dist/offline/index-builders.js.map +1 -0
- package/dist/offline/model.d.ts +8 -0
- package/dist/offline/model.js +188 -0
- package/dist/offline/model.js.map +1 -0
- package/dist/offline/names.d.ts +7 -0
- package/dist/offline/names.js +20 -0
- package/dist/offline/names.js.map +1 -0
- package/dist/offline/overrides.d.ts +17 -0
- package/dist/offline/overrides.js +266 -0
- package/dist/offline/overrides.js.map +1 -0
- package/dist/offline/parse.d.ts +25 -0
- package/dist/offline/parse.js +236 -0
- package/dist/offline/parse.js.map +1 -0
- package/dist/offline/paths.d.ts +4 -0
- package/dist/offline/paths.js +23 -0
- package/dist/offline/paths.js.map +1 -0
- package/dist/offline/primitives.d.ts +17 -0
- package/dist/offline/primitives.js +195 -0
- package/dist/offline/primitives.js.map +1 -0
- package/dist/offline/references.d.ts +9 -0
- package/dist/offline/references.js +55 -0
- package/dist/offline/references.js.map +1 -0
- package/dist/offline/types.d.ts +65 -0
- package/dist/offline/types.js +154 -0
- package/dist/offline/types.js.map +1 -0
- package/dist/offline.d.ts +2 -180
- package/dist/offline.js +27 -2282
- package/dist/offline.js.map +1 -1
- package/dist/project-health.d.ts +1 -1
- package/dist/project-health.js +66 -3
- package/dist/project-health.js.map +1 -1
- package/dist/routers.js +6 -5
- package/dist/routers.js.map +1 -1
- package/dist/tool-router.d.ts +12 -0
- package/dist/tool-router.js +72 -100
- package/dist/tool-router.js.map +1 -1
- package/dist/tools/component-get.js +44 -11
- package/dist/tools/component-get.js.map +1 -1
- package/dist/tools/editor-status.js +3 -2
- package/dist/tools/editor-status.js.map +1 -1
- package/dist/tools/execute-csharp.js +3 -2
- package/dist/tools/execute-csharp.js.map +1 -1
- package/dist/tools/index.js +19 -17
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/inputsystem-asset-create.js +4 -4
- package/dist/tools/inputsystem-asset-create.js.map +1 -1
- package/dist/tools/invoke-method.js +2 -1
- package/dist/tools/invoke-method.js.map +1 -1
- package/dist/tools/navigation-surface-add.js +6 -5
- package/dist/tools/navigation-surface-add.js.map +1 -1
- package/dist/tools/probuilder-create-shape.js +4 -4
- package/dist/tools/probuilder-create-shape.js.map +1 -1
- package/dist/tools/read-compile-errors.js +44 -31
- package/dist/tools/read-compile-errors.js.map +1 -1
- package/dist/tools/scene-get-data.js +10 -2
- package/dist/tools/scene-get-data.js.map +1 -1
- package/dist/tools/scene-save.js +16 -5
- package/dist/tools/scene-save.js.map +1 -1
- package/dist/tools/scene-set-active.js +22 -6
- package/dist/tools/scene-set-active.js.map +1 -1
- package/dist/tools/scene-unload.js +20 -6
- package/dist/tools/scene-unload.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
// M16 Plan 10 / T6.6.5 — ProBuilder extension tool.
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
// active scene path.
|
|
1
|
+
// M16 Plan 10 / T6.6.5 — ProBuilder extension tool. The bridge-side handler
|
|
2
|
+
// is embedded in the bridge (compile-gated by UNITY_OPEN_MCP_EXT_PROBUILDER,
|
|
3
|
+
// active when com.unity.probuilder is present). Mutating: runs the full gate
|
|
4
|
+
// path; paths_hint is the active scene path.
|
|
5
5
|
export const probuilderCreateShape = {
|
|
6
6
|
name: "unity_open_mcp_probuilder_create_shape",
|
|
7
7
|
description: "Create a new editable ProBuilderMesh GameObject from a ShapeType primitive " +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"probuilder-create-shape.js","sourceRoot":"","sources":["../../src/tools/probuilder-create-shape.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"probuilder-create-shape.js","sourceRoot":"","sources":["../../src/tools/probuilder-create-shape.ts"],"names":[],"mappings":"AAEA,4EAA4E;AAC5E,6EAA6E;AAC7E,6EAA6E;AAC7E,6CAA6C;AAC7C,MAAM,CAAC,MAAM,qBAAqB,GAAS;IACzC,IAAI,EAAE,wCAAwC;IAC9C,WAAW,EACT,6EAA6E;QAC7E,2EAA2E;QAC3E,8EAA8E;QAC9E,2EAA2E;QAC3E,8EAA8E;IAChF,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,CAAC,YAAY,CAAC;QACxB,UAAU,EAAE;YACV,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,MAAM;gBACf,WAAW,EACT,0EAA0E;oBAC1E,yCAAyC;aAC5C;YACD,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2BAA2B,EAAE;YAClE,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,iEAAiE;aAC/E;YACD,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,+BAA+B,EAAE;YAC1E,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,+CAA+C,EAAE;YAC1F,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4BAA4B,EAAE;YACpE,UAAU,EAAE;gBACV,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACzB,WAAW,EAAE,0EAA0E;aACxF;YACD,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE;SAC/D;QACD,oBAAoB,EAAE,KAAK;KAC5B;CACF,CAAC"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
// Offline, filesystem-only tool: reads the tail of Unity's Editor.log and
|
|
2
|
-
// extracts BOTH C# compiler errors AND package / assembly-level red flags
|
|
3
|
-
// The one recovery channel that works when the
|
|
4
|
-
// failed to compile — in that state every in-bridge
|
|
5
|
-
// editor_status) is dead with it, and compile_check
|
|
6
|
-
// batch entry point shares the broken assembly, and
|
|
7
|
-
// blocks a second instance). The live Editor still
|
|
8
|
-
// AND assembly-resolution failures AND Package
|
|
9
|
-
//
|
|
10
|
-
// Unity or the
|
|
2
|
+
// extracts BOTH C# compiler errors AND package / assembly-level red flags AND
|
|
3
|
+
// a hard Editor hang signal. The one recovery channel that works when the
|
|
4
|
+
// bridge assembly itself has failed to compile — in that state every in-bridge
|
|
5
|
+
// channel (read_console, editor_status) is dead with it, and compile_check
|
|
6
|
+
// can't run either (the batch entry point shares the broken assembly, and
|
|
7
|
+
// Unity's per-project lock blocks a second instance). The live Editor still
|
|
8
|
+
// writes CSxxxx diagnostics AND assembly-resolution failures AND Package
|
|
9
|
+
// Manager notices AND the Bee build-driver hang stack to Editor.log regardless
|
|
10
|
+
// of bridge health, so this tool retrieves them without touching Unity or the
|
|
11
|
+
// bridge.
|
|
11
12
|
//
|
|
12
13
|
// Log resolution: Unity 6000.5+ moved the Editor.log to a project-relative
|
|
13
14
|
// path (<project>/Logs/Editor.log) and stops writing to the global per-user
|
|
@@ -22,36 +23,48 @@
|
|
|
22
23
|
// - unhealthy: true when compiler errors OR issues are present
|
|
23
24
|
// - headline: one-line triage summary (empty when healthy)
|
|
24
25
|
// - errors[]: structured CSxxxx diagnostics (file/line/code/message)
|
|
25
|
-
// - issues[]: package / assembly red flags with kind + hint:
|
|
26
|
+
// - issues[]: package / assembly / Editor red flags with kind + hint:
|
|
26
27
|
// * assembly_resolution — Mono.Cecil unresolved-assembly failures
|
|
27
28
|
// (classic package-version / Unity-version mismatch, e.g. ProBuilder
|
|
28
29
|
// 5.x compiled against an assembly ProBuilder 6 removed)
|
|
29
30
|
// * package_deprecated — [Package Manager] <id> is deprecated
|
|
30
31
|
// * package_manager_error — other Package Manager conflict / resolution
|
|
31
32
|
// errors
|
|
33
|
+
// * editor_fd_exhaustion — the Editor hung mid-build after hitting an
|
|
34
|
+
// internal Mono/Unity file-descriptor limit (the Bee build driver's
|
|
35
|
+
// "Could not register to wait for file descriptor N" exception). This
|
|
36
|
+
// is NOT a code error and has no CSxxxx fix; the Editor must be
|
|
37
|
+
// restarted to recover. The hint carries restart instructions.
|
|
32
38
|
export const readCompileErrors = {
|
|
33
39
|
name: "unity_open_mcp_read_compile_errors",
|
|
34
|
-
description: "Read C# compiler errors AND package/assembly red flags
|
|
35
|
-
"Unity's Editor.log (offline, no bridge, no
|
|
36
|
-
"structured CSxxxx compiler errors
|
|
37
|
-
"`issues` list of
|
|
38
|
-
"`hint`: assembly_resolution (Mono.Cecil
|
|
39
|
-
"the classic package-version /
|
|
40
|
-
"5.x on Unity 6),
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
40
|
+
description: "Read C# compiler errors AND package/assembly red flags AND an Editor " +
|
|
41
|
+
"hang signal directly from Unity's Editor.log (offline, no bridge, no " +
|
|
42
|
+
"Unity spawn). Returns structured CSxxxx compiler errors " +
|
|
43
|
+
"(file/line/code/message) PLUS an `issues` list of red flags with " +
|
|
44
|
+
"per-issue `kind` + `hint`: assembly_resolution (Mono.Cecil " +
|
|
45
|
+
"unresolved-assembly failures — the classic package-version / " +
|
|
46
|
+
"Unity-version mismatch, e.g. ProBuilder 5.x on Unity 6), " +
|
|
47
|
+
"package_deprecated ([Package Manager] <id> is deprecated), " +
|
|
48
|
+
"package_manager_error (conflict / resolution errors), and " +
|
|
49
|
+
"editor_fd_exhaustion (the Editor hung mid-build after hitting an " +
|
|
50
|
+
"internal Mono/Unity file-descriptor limit — NOT a code error; the hint " +
|
|
51
|
+
"carries restart instructions). Use this when: (a) the bridge is " +
|
|
52
|
+
"unreachable after a recompile — a 'bridge_compile_failed' response " +
|
|
53
|
+
"points here, or ping returns connected:false unexpectedly; (b) Unity " +
|
|
54
|
+
"showed a 'package update' / incompatibility popup; (c) you suspect a " +
|
|
55
|
+
"package is too old for the current Editor; (d) the Editor appears hung " +
|
|
56
|
+
"after heavy automation (many recompiles) with no compile errors to " +
|
|
57
|
+
"explain it — editor_fd_exhaustion is the likely cause and only a " +
|
|
58
|
+
"restart recovers it. Works even when the bridge assembly itself is " +
|
|
59
|
+
"broken, because it reads the log file the Editor writes independently " +
|
|
60
|
+
"of the bridge. Check `unhealthy` first; when true, scan `headline` for " +
|
|
61
|
+
"a one-line triage then drill into `errors` and `issues`. When the " +
|
|
62
|
+
"response carries `staleLogSuspected: true`, the cited source files " +
|
|
63
|
+
"were edited more recently than Editor.log — the error block may " +
|
|
64
|
+
"reference on-disk code you have already fixed (Unity's incremental " +
|
|
65
|
+
"compiler no-op'd the recompile). Force a genuine recompile via " +
|
|
66
|
+
"unity_open_mcp_reimport_package (local package) or " +
|
|
67
|
+
"unity_open_mcp_compile_check before trusting the errors.",
|
|
55
68
|
inputSchema: {
|
|
56
69
|
type: "object",
|
|
57
70
|
properties: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-compile-errors.js","sourceRoot":"","sources":["../../src/tools/read-compile-errors.ts"],"names":[],"mappings":"AAEA,0EAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"read-compile-errors.js","sourceRoot":"","sources":["../../src/tools/read-compile-errors.ts"],"names":[],"mappings":"AAEA,0EAA0E;AAC1E,8EAA8E;AAC9E,0EAA0E;AAC1E,+EAA+E;AAC/E,2EAA2E;AAC3E,0EAA0E;AAC1E,4EAA4E;AAC5E,yEAAyE;AACzE,+EAA+E;AAC/E,8EAA8E;AAC9E,UAAU;AACV,EAAE;AACF,2EAA2E;AAC3E,4EAA4E;AAC5E,2EAA2E;AAC3E,4EAA4E;AAC5E,4EAA4E;AAC5E,2EAA2E;AAC3E,sCAAsC;AACtC,EAAE;AACF,mBAAmB;AACnB,yEAAyE;AACzE,iEAAiE;AACjE,6DAA6D;AAC7D,uEAAuE;AACvE,wEAAwE;AACxE,wEAAwE;AACxE,6EAA6E;AAC7E,iEAAiE;AACjE,sEAAsE;AACtE,8EAA8E;AAC9E,iBAAiB;AACjB,4EAA4E;AAC5E,4EAA4E;AAC5E,8EAA8E;AAC9E,wEAAwE;AACxE,uEAAuE;AACvE,MAAM,CAAC,MAAM,iBAAiB,GAAS;IACrC,IAAI,EAAE,oCAAoC;IAC1C,WAAW,EACT,uEAAuE;QACvE,uEAAuE;QACvE,0DAA0D;QAC1D,mEAAmE;QACnE,6DAA6D;QAC7D,+DAA+D;QAC/D,2DAA2D;QAC3D,6DAA6D;QAC7D,4DAA4D;QAC5D,mEAAmE;QACnE,yEAAyE;QACzE,kEAAkE;QAClE,qEAAqE;QACrE,uEAAuE;QACvE,uEAAuE;QACvE,yEAAyE;QACzE,qEAAqE;QACrE,mEAAmE;QACnE,qEAAqE;QACrE,wEAAwE;QACxE,yEAAyE;QACzE,oEAAoE;QACpE,qEAAqE;QACrE,kEAAkE;QAClE,qEAAqE;QACrE,iEAAiE;QACjE,qDAAqD;QACrD,0DAA0D;IAC5D,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,UAAU,EAAE;gBACV,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,MAAM;gBACf,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,OAAO;gBAChB,WAAW,EACT,6DAA6D;oBAC7D,oEAAoE;oBACpE,kEAAkE;oBAClE,mEAAmE;aACtE;SACF;QACD,oBAAoB,EAAE,KAAK;KAC5B;CACF,CAAC"}
|
|
@@ -13,15 +13,23 @@ export const sceneGetData = {
|
|
|
13
13
|
"`profile: 'full'` adds per-node transform (position/rotation/scale) and instance_id so the " +
|
|
14
14
|
"agent can chain gameobject_modify / component_modify without an extra lookup. " +
|
|
15
15
|
"Page large hierarchies with page_size/cursor. " +
|
|
16
|
+
"Scene identity is path-first: provide `path` to resolve an opened scene by its asset path, " +
|
|
17
|
+
"or `name` to resolve by display name; when both are supplied, `path` wins. " +
|
|
16
18
|
"Use scene_list_opened to enumerate scenes. Prefer this over read_asset on the .unity file " +
|
|
17
19
|
"(which is YAML-heavy and does not reflect unsaved editor state).",
|
|
18
20
|
inputSchema: {
|
|
19
21
|
type: "object",
|
|
20
22
|
properties: {
|
|
23
|
+
path: {
|
|
24
|
+
type: "string",
|
|
25
|
+
description: "Opened scene asset path (e.g. 'Assets/Scenes/Foo.unity') to read. Resolves the scene " +
|
|
26
|
+
"by its asset path — the authoritative identity. When supplied, takes precedence over " +
|
|
27
|
+
"`name`. Omit (and omit `name`) to read the active scene.",
|
|
28
|
+
},
|
|
21
29
|
name: {
|
|
22
30
|
type: "string",
|
|
23
|
-
description: "Opened scene name
|
|
24
|
-
"to enumerate opened scene names.",
|
|
31
|
+
description: "Opened scene name (fallback when `path` is not supplied). Omit (and omit `path`) to " +
|
|
32
|
+
"read the active scene. Use scene_list_opened to enumerate opened scene names.",
|
|
25
33
|
},
|
|
26
34
|
profile: {
|
|
27
35
|
enum: ["compact", "balanced", "full"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scene-get-data.js","sourceRoot":"","sources":["../../src/tools/scene-get-data.ts"],"names":[],"mappings":"AAEA,yEAAyE;AACzE,2EAA2E;AAC3E,yEAAyE;AACzE,+CAA+C;AAC/C,MAAM,CAAC,MAAM,YAAY,GAAS;IAChC,IAAI,EAAE,+BAA+B;IACrC,WAAW,EACT,0FAA0F;QAC1F,kFAAkF;QAClF,uGAAuG;QACvG,6FAA6F;QAC7F,8FAA8F;QAC9F,4FAA4F;QAC5F,6FAA6F;QAC7F,gFAAgF;QAChF,gDAAgD;QAChD,4FAA4F;QAC5F,kEAAkE;IACpE,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"scene-get-data.js","sourceRoot":"","sources":["../../src/tools/scene-get-data.ts"],"names":[],"mappings":"AAEA,yEAAyE;AACzE,2EAA2E;AAC3E,yEAAyE;AACzE,+CAA+C;AAC/C,MAAM,CAAC,MAAM,YAAY,GAAS;IAChC,IAAI,EAAE,+BAA+B;IACrC,WAAW,EACT,0FAA0F;QAC1F,kFAAkF;QAClF,uGAAuG;QACvG,6FAA6F;QAC7F,8FAA8F;QAC9F,4FAA4F;QAC5F,6FAA6F;QAC7F,gFAAgF;QAChF,gDAAgD;QAChD,6FAA6F;QAC7F,6EAA6E;QAC7E,4FAA4F;QAC5F,kEAAkE;IACpE,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,uFAAuF;oBACvF,uFAAuF;oBACvF,0DAA0D;aAC7D;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,sFAAsF;oBACtF,+EAA+E;aAClF;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,MAAM,CAAC;gBACrC,OAAO,EAAE,SAAS;gBAClB,WAAW,EACT,kGAAkG;oBAClG,kGAAkG;oBAClG,0GAA0G;oBAC1G,0FAA0F;aAC7F;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,CAAC;gBACV,WAAW,EACT,qGAAqG;oBACrG,wGAAwG;oBACxG,iDAAiD;aACpD;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,sGAAsG;aACzG;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,SAAS,CAAC;gBACtC,OAAO,EAAE,SAAS;gBAClB,WAAW,EACT,6FAA6F;oBAC7F,kDAAkD;aACrD;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,CAAC;gBACV,OAAO,EAAE,CAAC;gBACV,WAAW,EACT,yGAAyG;oBACzG,uEAAuE;aAC1E;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,GAAG;gBACZ,OAAO,EAAE,CAAC;gBACV,WAAW,EACT,sFAAsF;oBACtF,kEAAkE;aACrE;SACF;QACD,oBAAoB,EAAE,KAAK;KAC5B;CACF,CAAC"}
|
package/dist/tools/scene-save.js
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
// M16 Plan 3 — typed scene save. Mutating: writes an opened scene back to
|
|
2
2
|
// its .unity asset (or a new path). Runs the full gate path.
|
|
3
|
+
//
|
|
4
|
+
// Scene identity + destination: `path` does double duty. When it matches an
|
|
5
|
+
// opened scene's asset path, it selects that scene and saves it back to its
|
|
6
|
+
// own path (path-as-identity). When it does NOT match an opened scene, it is a
|
|
7
|
+
// save-as destination for the active (or `name`-selected) scene. `name`
|
|
8
|
+
// always selects an opened scene by display name when supplied.
|
|
3
9
|
export const sceneSave = {
|
|
4
10
|
name: "unity_open_mcp_scene_save",
|
|
5
11
|
description: "Save an opened scene back to its asset file, or to a new `.unity` path when `path` is " +
|
|
6
12
|
"provided. Mutating: runs the full gate path; `paths_hint` should be the destination `.unity` " +
|
|
7
|
-
"asset path. When `name` is omitted, saves the active scene.
|
|
8
|
-
"
|
|
9
|
-
"
|
|
13
|
+
"asset path. When `name` is omitted, saves the active scene. `path` is dual-purpose: when it " +
|
|
14
|
+
"matches an opened scene's asset path it selects that scene and saves it back to its own " +
|
|
15
|
+
"path (path-as-identity); otherwise it is a save-as destination for the active or " +
|
|
16
|
+
"`name`-selected scene. Returns { saved, name, path } with `saved: false` and a note when the " +
|
|
17
|
+
"scene was not dirty (idempotent). Prefer this over raw execute_csharp " +
|
|
18
|
+
"EditorSceneManager.SaveScene.",
|
|
10
19
|
inputSchema: {
|
|
11
20
|
type: "object",
|
|
12
21
|
required: ["paths_hint"],
|
|
@@ -18,8 +27,10 @@ export const sceneSave = {
|
|
|
18
27
|
},
|
|
19
28
|
path: {
|
|
20
29
|
type: "string",
|
|
21
|
-
description: "
|
|
22
|
-
"
|
|
30
|
+
description: "Dual-purpose. When it matches an opened scene's asset path (e.g. " +
|
|
31
|
+
"'Assets/Scenes/Foo.unity'), it selects that scene and saves it back to its own path " +
|
|
32
|
+
"(path-as-identity). When it does not match an opened scene, it is a save-as destination " +
|
|
33
|
+
"for the active or `name`-selected scene and must end with '.unity'.",
|
|
23
34
|
},
|
|
24
35
|
paths_hint: {
|
|
25
36
|
type: "array",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scene-save.js","sourceRoot":"","sources":["../../src/tools/scene-save.ts"],"names":[],"mappings":"AAEA,0EAA0E;AAC1E,6DAA6D;AAC7D,MAAM,CAAC,MAAM,SAAS,GAAS;IAC7B,IAAI,EAAE,2BAA2B;IACjC,WAAW,EACT,wFAAwF;QACxF,+FAA+F;QAC/F,
|
|
1
|
+
{"version":3,"file":"scene-save.js","sourceRoot":"","sources":["../../src/tools/scene-save.ts"],"names":[],"mappings":"AAEA,0EAA0E;AAC1E,6DAA6D;AAC7D,EAAE;AACF,4EAA4E;AAC5E,4EAA4E;AAC5E,+EAA+E;AAC/E,wEAAwE;AACxE,gEAAgE;AAChE,MAAM,CAAC,MAAM,SAAS,GAAS;IAC7B,IAAI,EAAE,2BAA2B;IACjC,WAAW,EACT,wFAAwF;QACxF,+FAA+F;QAC/F,8FAA8F;QAC9F,0FAA0F;QAC1F,mFAAmF;QACnF,+FAA+F;QAC/F,wEAAwE;QACxE,+BAA+B;IACjC,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,CAAC,YAAY,CAAC;QACxB,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,2EAA2E;oBAC3E,oDAAoD;aACvD;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,mEAAmE;oBACnE,sFAAsF;oBACtF,0FAA0F;oBAC1F,qEAAqE;aACxE;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACzB,WAAW,EACT,uFAAuF;oBACvF,qBAAqB;aACxB;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC;gBAChC,OAAO,EAAE,SAAS;aACnB;SACF;QACD,oBAAoB,EAAE,KAAK;KAC5B;CACF,CAAC"}
|
|
@@ -1,21 +1,37 @@
|
|
|
1
1
|
// M16 Plan 3 — typed scene set active. Mutating: marks an opened scene as
|
|
2
2
|
// the active scene. Runs the full gate path.
|
|
3
|
+
//
|
|
4
|
+
// Scene identity (path-first): `path` resolves an opened scene by its asset
|
|
5
|
+
// path; `name` resolves by display name. Precedence: when both are supplied,
|
|
6
|
+
// `path` wins (asset paths are the authoritative identity for an asset-centric
|
|
7
|
+
// MCP); `name` is the fallback when only it is supplied.
|
|
3
8
|
export const sceneSetActive = {
|
|
4
9
|
name: "unity_open_mcp_scene_set_active",
|
|
5
10
|
description: "Mark an opened scene as the editor's active scene (the scene new GameObjects are added to " +
|
|
6
11
|
"and the default for many operations). Mutating: runs the full gate path; `paths_hint` should " +
|
|
7
12
|
"be the scene's asset path. The target scene must already be opened (use scene_open first). " +
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
13
|
+
"Scene identity is path-first: provide `path` (the scene's `Assets/.../*.unity` asset path) to " +
|
|
14
|
+
"resolve unambiguously, or `name` to resolve by display name. When both are supplied, `path` " +
|
|
15
|
+
"wins and `name` is ignored. The response carries `resolvedBy` (\"path\" or \"name\") so the " +
|
|
16
|
+
"agent can tell which identity key resolved the target — useful for debugging duplicate-name " +
|
|
17
|
+
"ambiguity. Returns the post-set list of opened scenes (name/path/isDirty/" +
|
|
18
|
+
"isLoaded/rootCount/buildIndex/isActive) so the agent can confirm which scene is now active. " +
|
|
19
|
+
"Prefer this over raw execute_csharp EditorSceneManager.SetActiveScene.",
|
|
11
20
|
inputSchema: {
|
|
12
21
|
type: "object",
|
|
13
|
-
required: ["
|
|
22
|
+
required: ["paths_hint"],
|
|
14
23
|
properties: {
|
|
24
|
+
path: {
|
|
25
|
+
type: "string",
|
|
26
|
+
description: "Opened scene asset path (e.g. 'Assets/Scenes/Foo.unity') to mark as active. Resolves the " +
|
|
27
|
+
"scene by its asset path — the authoritative identity. When supplied, takes precedence " +
|
|
28
|
+
"over `name`. Use scene_list_opened to enumerate opened scene paths.",
|
|
29
|
+
},
|
|
15
30
|
name: {
|
|
16
31
|
type: "string",
|
|
17
|
-
description: "Name of the opened scene to mark as active
|
|
18
|
-
"scene_list_opened to enumerate opened scene
|
|
32
|
+
description: "Name of the opened scene to mark as active (fallback when `path` is not supplied). Must " +
|
|
33
|
+
"match an opened scene's display name. Use scene_list_opened to enumerate opened scene " +
|
|
34
|
+
"names.",
|
|
19
35
|
},
|
|
20
36
|
paths_hint: {
|
|
21
37
|
type: "array",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scene-set-active.js","sourceRoot":"","sources":["../../src/tools/scene-set-active.ts"],"names":[],"mappings":"AAEA,0EAA0E;AAC1E,6CAA6C;AAC7C,MAAM,CAAC,MAAM,cAAc,GAAS;IAClC,IAAI,EAAE,iCAAiC;IACvC,WAAW,EACT,4FAA4F;QAC5F,+FAA+F;QAC/F,6FAA6F;QAC7F,8FAA8F;QAC9F,
|
|
1
|
+
{"version":3,"file":"scene-set-active.js","sourceRoot":"","sources":["../../src/tools/scene-set-active.ts"],"names":[],"mappings":"AAEA,0EAA0E;AAC1E,6CAA6C;AAC7C,EAAE;AACF,4EAA4E;AAC5E,6EAA6E;AAC7E,+EAA+E;AAC/E,yDAAyD;AACzD,MAAM,CAAC,MAAM,cAAc,GAAS;IAClC,IAAI,EAAE,iCAAiC;IACvC,WAAW,EACT,4FAA4F;QAC5F,+FAA+F;QAC/F,6FAA6F;QAC7F,gGAAgG;QAChG,8FAA8F;QAC9F,8FAA8F;QAC9F,8FAA8F;QAC9F,2EAA2E;QAC3E,8FAA8F;QAC9F,wEAAwE;IAC1E,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,CAAC,YAAY,CAAC;QACxB,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,2FAA2F;oBAC3F,wFAAwF;oBACxF,qEAAqE;aACxE;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,0FAA0F;oBAC1F,wFAAwF;oBACxF,QAAQ;aACX;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACzB,WAAW,EAAE,0CAA0C;aACxD;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC;gBAChC,OAAO,EAAE,SAAS;aACnB;SACF;QACD,oBAAoB,EAAE,KAAK;KAC5B;CACF,CAAC"}
|
|
@@ -1,20 +1,34 @@
|
|
|
1
1
|
// M16 Plan 3 — typed scene unload. Mutating: removes an opened scene from
|
|
2
2
|
// the editor (without saving). Runs the full gate path.
|
|
3
|
+
//
|
|
4
|
+
// Scene identity (path-first): `path` resolves an opened scene by its asset
|
|
5
|
+
// path; `name` resolves by display name. Precedence: when both are supplied,
|
|
6
|
+
// `path` wins; `name` is the fallback when only it is supplied.
|
|
3
7
|
export const sceneUnload = {
|
|
4
8
|
name: "unity_open_mcp_scene_unload",
|
|
5
9
|
description: "Unload an opened scene from the Unity Editor (without saving — call scene_save first if " +
|
|
6
10
|
"the scene has unsaved changes you want to keep). Mutating: runs the full gate path; " +
|
|
7
|
-
"`paths_hint` should be the scene's asset path.
|
|
8
|
-
"
|
|
9
|
-
"
|
|
11
|
+
"`paths_hint` should be the scene's asset path. Scene identity is path-first: provide `path` " +
|
|
12
|
+
"(the scene's `Assets/.../*.unity` asset path) to resolve unambiguously, or `name` to resolve " +
|
|
13
|
+
"by display name. When both are supplied, `path` wins and `name` is ignored. The response " +
|
|
14
|
+
"carries `resolvedBy` (\"path\" or \"name\") so the agent can tell which identity key resolved " +
|
|
15
|
+
"the target. Returns the " +
|
|
16
|
+
"post-unload list of opened scenes (name/path/isDirty/isLoaded/rootCount/buildIndex/isActive). " +
|
|
17
|
+
"Prefer this over raw execute_csharp SceneManager.UnloadSceneAsync.",
|
|
10
18
|
inputSchema: {
|
|
11
19
|
type: "object",
|
|
12
|
-
required: ["
|
|
20
|
+
required: ["paths_hint"],
|
|
13
21
|
properties: {
|
|
22
|
+
path: {
|
|
23
|
+
type: "string",
|
|
24
|
+
description: "Opened scene asset path (e.g. 'Assets/Scenes/Foo.unity') to unload. Resolves the scene " +
|
|
25
|
+
"by its asset path — the authoritative identity. When supplied, takes precedence over " +
|
|
26
|
+
"`name`. Use scene_list_opened to enumerate opened scene paths.",
|
|
27
|
+
},
|
|
14
28
|
name: {
|
|
15
29
|
type: "string",
|
|
16
|
-
description: "Name of the opened scene to unload
|
|
17
|
-
"scene_list_opened to enumerate opened scene names.",
|
|
30
|
+
description: "Name of the opened scene to unload (fallback when `path` is not supplied). Must match " +
|
|
31
|
+
"an opened scene's display name. Use scene_list_opened to enumerate opened scene names.",
|
|
18
32
|
},
|
|
19
33
|
paths_hint: {
|
|
20
34
|
type: "array",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scene-unload.js","sourceRoot":"","sources":["../../src/tools/scene-unload.ts"],"names":[],"mappings":"AAEA,0EAA0E;AAC1E,wDAAwD;AACxD,MAAM,CAAC,MAAM,WAAW,GAAS;IAC/B,IAAI,EAAE,6BAA6B;IACnC,WAAW,EACT,0FAA0F;QAC1F,sFAAsF;QACtF,
|
|
1
|
+
{"version":3,"file":"scene-unload.js","sourceRoot":"","sources":["../../src/tools/scene-unload.ts"],"names":[],"mappings":"AAEA,0EAA0E;AAC1E,wDAAwD;AACxD,EAAE;AACF,4EAA4E;AAC5E,6EAA6E;AAC7E,gEAAgE;AAChE,MAAM,CAAC,MAAM,WAAW,GAAS;IAC/B,IAAI,EAAE,6BAA6B;IACnC,WAAW,EACT,0FAA0F;QAC1F,sFAAsF;QACtF,8FAA8F;QAC9F,+FAA+F;QAC/F,2FAA2F;QAC3F,gGAAgG;QAChG,0BAA0B;QAC1B,gGAAgG;QAChG,oEAAoE;IACtE,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,CAAC,YAAY,CAAC;QACxB,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,yFAAyF;oBACzF,uFAAuF;oBACvF,gEAAgE;aACnE;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,wFAAwF;oBACxF,wFAAwF;aAC3F;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACzB,WAAW,EACT,mFAAmF;oBACnF,gBAAgB;aACnB;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC;gBAChC,OAAO,EAAE,SAAS;aACnB;SACF;QACD,oBAAoB,EAAE,KAAK;KAC5B;CACF,CAAC"}
|