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.
- package/README.md +33 -2
- package/dist/agent-identity.d.ts +12 -0
- package/dist/agent-identity.js +2 -0
- package/dist/agent-identity.js.map +1 -1
- package/dist/batch-spawn.d.ts +39 -0
- package/dist/batch-spawn.js +287 -69
- package/dist/batch-spawn.js.map +1 -1
- package/dist/capabilities/build-capabilities.js +2 -0
- package/dist/capabilities/build-capabilities.js.map +1 -1
- package/dist/capabilities/discovery.d.ts +51 -0
- package/dist/capabilities/discovery.js +87 -0
- package/dist/capabilities/discovery.js.map +1 -0
- package/dist/capabilities/lifecycle.d.ts +6 -0
- package/dist/capabilities/lifecycle.js +17 -1
- package/dist/capabilities/lifecycle.js.map +1 -1
- package/dist/capabilities/tool-groups.js +1 -0
- package/dist/capabilities/tool-groups.js.map +1 -1
- package/dist/child-supervision.d.ts +6 -0
- package/dist/child-supervision.js +12 -0
- package/dist/child-supervision.js.map +1 -1
- package/dist/cli/args.d.ts +24 -2
- package/dist/cli/args.js +97 -2
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/cli.js +42 -3
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/help-text.d.ts +1 -0
- package/dist/cli/help-text.js +71 -3
- package/dist/cli/help-text.js.map +1 -1
- package/dist/cli/json-guards.d.ts +2 -0
- package/dist/cli/json-guards.js +5 -0
- package/dist/cli/json-guards.js.map +1 -0
- package/dist/cli/setup-command.d.ts +88 -0
- package/dist/cli/setup-command.js +444 -0
- package/dist/cli/setup-command.js.map +1 -0
- package/dist/cli/update-command.d.ts +30 -0
- package/dist/cli/update-command.js +271 -0
- package/dist/cli/update-command.js.map +1 -0
- package/dist/compile-verify.d.ts +3 -0
- package/dist/compile-verify.js +4 -0
- package/dist/compile-verify.js.map +1 -1
- package/dist/constants.d.ts +10 -2
- package/dist/constants.js +10 -2
- package/dist/constants.js.map +1 -1
- package/dist/dialog-dismiss.d.ts +108 -12
- package/dist/dialog-dismiss.js +294 -109
- package/dist/dialog-dismiss.js.map +1 -1
- package/dist/dialog-policy.d.ts +55 -9
- package/dist/dialog-policy.js +85 -15
- package/dist/dialog-policy.js.map +1 -1
- package/dist/editor-search.d.ts +2 -0
- package/dist/editor-search.js +8 -0
- package/dist/editor-search.js.map +1 -0
- package/dist/gate-error.d.ts +3 -0
- package/dist/gate-error.js.map +1 -1
- package/dist/index.js +55 -1
- package/dist/index.js.map +1 -1
- package/dist/instance-discovery.d.ts +16 -0
- package/dist/instance-discovery.js +45 -0
- package/dist/instance-discovery.js.map +1 -1
- package/dist/jobs/adapters.d.ts +15 -0
- package/dist/jobs/adapters.js +147 -0
- package/dist/jobs/adapters.js.map +1 -0
- package/dist/jobs/handler.d.ts +3 -0
- package/dist/jobs/handler.js +29 -0
- package/dist/jobs/handler.js.map +1 -0
- package/dist/jobs/job-manager.d.ts +123 -0
- package/dist/jobs/job-manager.js +290 -0
- package/dist/jobs/job-manager.js.map +1 -0
- package/dist/live-client.d.ts +50 -2
- package/dist/live-client.js +221 -26
- package/dist/live-client.js.map +1 -1
- package/dist/local-tools.d.ts +17 -0
- package/dist/local-tools.js +47 -0
- package/dist/local-tools.js.map +1 -0
- package/dist/project-path.d.ts +86 -0
- package/dist/project-path.js +159 -0
- package/dist/project-path.js.map +1 -0
- package/dist/release-lookup.d.ts +32 -0
- package/dist/release-lookup.js +147 -0
- package/dist/release-lookup.js.map +1 -0
- package/dist/routers.d.ts +17 -3
- package/dist/routers.js +28 -8
- package/dist/routers.js.map +1 -1
- package/dist/running-unity.d.ts +21 -0
- package/dist/running-unity.js +50 -0
- package/dist/running-unity.js.map +1 -1
- package/dist/schema-defaults.d.ts +4 -3
- package/dist/schema-defaults.js +20 -6
- package/dist/schema-defaults.js.map +1 -1
- package/dist/server-instructions.js +7 -1
- package/dist/server-instructions.js.map +1 -1
- package/dist/server.d.ts +10 -3
- package/dist/server.js +24 -25
- package/dist/server.js.map +1 -1
- package/dist/setup/portable-config.d.ts +60 -0
- package/dist/setup/portable-config.js +249 -0
- package/dist/setup/portable-config.js.map +1 -0
- package/dist/skill/SKILL.md +68 -0
- package/dist/skill/copy-references.d.ts +2 -0
- package/dist/skill/copy-references.js +16 -0
- package/dist/skill/copy-references.js.map +1 -0
- package/dist/skill/generate-skill.js +5 -3
- package/dist/skill/generate-skill.js.map +1 -1
- package/dist/skill/references/batch-and-gates.md +142 -0
- package/dist/skill/references/compile-and-safe-mode.md +163 -0
- package/dist/skill/references/discovery-and-groups.md +30 -0
- package/dist/skill/references/routing-and-lifecycle.md +62 -0
- package/dist/skill/references/senses-and-tests.md +41 -0
- package/dist/skill/references/yaml-and-offline-work.md +33 -0
- package/dist/templates/mcp-wrapper.sh +35 -0
- package/dist/tool-contract.d.ts +8 -0
- package/dist/tool-contract.js +253 -0
- package/dist/tool-contract.js.map +1 -0
- package/dist/tool-router.d.ts +62 -7
- package/dist/tool-router.js +455 -17
- package/dist/tool-router.js.map +1 -1
- package/dist/tool-session-state.d.ts +6 -0
- package/dist/tool-session-state.js +14 -0
- package/dist/tool-session-state.js.map +1 -1
- package/dist/tools/agent-capabilities.js +9 -0
- package/dist/tools/agent-capabilities.js.map +1 -1
- package/dist/tools/batch-execute.js +17 -14
- package/dist/tools/batch-execute.js.map +1 -1
- package/dist/tools/bridge-status.js +4 -5
- package/dist/tools/bridge-status.js.map +1 -1
- package/dist/tools/compile-check.js +6 -4
- package/dist/tools/compile-check.js.map +1 -1
- package/dist/tools/component-get.js +2 -2
- package/dist/tools/component-get.js.map +1 -1
- package/dist/tools/component-modify.js +4 -4
- package/dist/tools/component-modify.js.map +1 -1
- package/dist/tools/execute-csharp.js +8 -4
- package/dist/tools/execute-csharp.js.map +1 -1
- package/dist/tools/gameobject-modify.js +2 -1
- package/dist/tools/gameobject-modify.js.map +1 -1
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.js +10 -2
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/inputsim-key.js +12 -14
- package/dist/tools/inputsim-key.js.map +1 -1
- package/dist/tools/inputsim-pointer.js +3 -3
- package/dist/tools/inputsim-pointer.js.map +1 -1
- package/dist/tools/inputsim-step.js +7 -8
- package/dist/tools/inputsim-step.js.map +1 -1
- package/dist/tools/inputsim-touch.js +9 -10
- package/dist/tools/inputsim-touch.js.map +1 -1
- package/dist/tools/jobs.d.ts +40 -0
- package/dist/tools/jobs.js +18 -0
- package/dist/tools/jobs.js.map +1 -0
- package/dist/tools/manage-tools.js +10 -5
- package/dist/tools/manage-tools.js.map +1 -1
- package/dist/tools/project-commands.d.ts +40 -0
- package/dist/tools/project-commands.js +23 -0
- package/dist/tools/project-commands.js.map +1 -0
- package/dist/tools/read-compile-errors.js +14 -93
- package/dist/tools/read-compile-errors.js.map +1 -1
- package/dist/tools/scan-paths.js +4 -4
- package/dist/tools/scan-paths.js.map +1 -1
- package/dist/tools/schema-fragments.d.ts +15 -3
- package/dist/tools/schema-fragments.js +23 -13
- package/dist/tools/schema-fragments.js.map +1 -1
- package/dist/tools/upgrade.d.ts +40 -0
- package/dist/tools/upgrade.js +55 -0
- package/dist/tools/upgrade.js.map +1 -0
- package/dist/unity-install-discovery.d.ts +24 -0
- package/dist/unity-install-discovery.js +113 -4
- package/dist/unity-install-discovery.js.map +1 -1
- package/package.json +4 -3
- package/templates/mcp-wrapper.sh +35 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export declare const jobs: {
|
|
2
|
+
inputSchema: {
|
|
3
|
+
[x: string]: unknown;
|
|
4
|
+
type: "object";
|
|
5
|
+
properties?: {
|
|
6
|
+
[x: string]: object;
|
|
7
|
+
} | undefined;
|
|
8
|
+
required?: string[] | undefined;
|
|
9
|
+
};
|
|
10
|
+
name: string;
|
|
11
|
+
description?: string | undefined;
|
|
12
|
+
outputSchema?: {
|
|
13
|
+
[x: string]: unknown;
|
|
14
|
+
type: "object";
|
|
15
|
+
properties?: {
|
|
16
|
+
[x: string]: object;
|
|
17
|
+
} | undefined;
|
|
18
|
+
required?: string[] | undefined;
|
|
19
|
+
} | undefined;
|
|
20
|
+
annotations?: {
|
|
21
|
+
title?: string | undefined;
|
|
22
|
+
readOnlyHint?: boolean | undefined;
|
|
23
|
+
destructiveHint?: boolean | undefined;
|
|
24
|
+
idempotentHint?: boolean | undefined;
|
|
25
|
+
openWorldHint?: boolean | undefined;
|
|
26
|
+
} | undefined;
|
|
27
|
+
execution?: {
|
|
28
|
+
taskSupport?: "optional" | "required" | "forbidden" | undefined;
|
|
29
|
+
} | undefined;
|
|
30
|
+
_meta?: {
|
|
31
|
+
[x: string]: unknown;
|
|
32
|
+
} | undefined;
|
|
33
|
+
icons?: {
|
|
34
|
+
src: string;
|
|
35
|
+
mimeType?: string | undefined;
|
|
36
|
+
sizes?: string[] | undefined;
|
|
37
|
+
theme?: "light" | "dark" | undefined;
|
|
38
|
+
}[] | undefined;
|
|
39
|
+
title?: string | undefined;
|
|
40
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { makeTool } from "./schema-fragments.js";
|
|
2
|
+
import { JOB_STATES } from "../jobs/job-manager.js";
|
|
3
|
+
export const jobs = makeTool("unity_open_mcp_jobs", "Observe session-owned asynchronous jobs: start, status, bounded wait, cooperative cancel, and paged list. Supported targets: unity_senses_run_tests and available async project commands. Other tools are unsupported. Test args are ordinary filters without run_id; project args contain nested args plus scope/gate options. Mutating starts require idempotency_key. Records expire 30 minutes after completion; server restart loses all records. Never blindly retry an orphaned job.", {
|
|
4
|
+
required: ["action"],
|
|
5
|
+
properties: {
|
|
6
|
+
action: { type: "string", enum: ["start", "status", "wait", "cancel", "list"] },
|
|
7
|
+
tool_or_command: { type: "string", minLength: 1, maxLength: 256 },
|
|
8
|
+
args: { type: "object", description: "Adapter arguments, including scope/gate intent where applicable." },
|
|
9
|
+
idempotency_key: { type: "string", minLength: 1, maxLength: 256 },
|
|
10
|
+
job_id: { type: "string", minLength: 1, maxLength: 128 },
|
|
11
|
+
timeout_ms: { type: "integer", minimum: 0, maximum: 30000 },
|
|
12
|
+
state: { type: "string", enum: [...JOB_STATES] },
|
|
13
|
+
operation: { type: "string", maxLength: 256 },
|
|
14
|
+
cursor: { type: "string", maxLength: 4096 },
|
|
15
|
+
limit: { type: "integer", minimum: 1, maximum: 100 },
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
//# sourceMappingURL=jobs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jobs.js","sourceRoot":"","sources":["../../src/tools/jobs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,MAAM,CAAC,MAAM,IAAI,GAAG,QAAQ,CAAC,qBAAqB,EAChD,6dAA6d,EAAE;IAC7d,QAAQ,EAAE,CAAC,QAAQ,CAAC;IACpB,UAAU,EAAE;QACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE;QAC/E,eAAe,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE;QACjE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kEAAkE,EAAE;QACzG,eAAe,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE;QACjE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE;QACxD,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE;QAC3D,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,GAAG,UAAU,CAAC,EAAE;QAChD,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,EAAE;QAC7C,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE;QAC3C,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE;KACrD;CACF,CAAC,CAAC"}
|
|
@@ -18,7 +18,7 @@ import { makeTool } from "./schema-fragments.js";
|
|
|
18
18
|
// set in one call and emits `notifications/tools/list_changed` when the
|
|
19
19
|
// visible surface changes. Unknown intent returns a structured empty
|
|
20
20
|
// recommendation (no invented groups) and points the caller at `list_groups`.
|
|
21
|
-
export const manageTools = makeTool("unity_open_mcp_manage_tools", "Manage
|
|
21
|
+
export const manageTools = makeTool("unity_open_mcp_manage_tools", "Manage tool visibility; invoke activated tools through a stable route; or use editor_search to build a human-facing Unity Search query (open_ui explicitly opts into focus). Sessions start " +
|
|
22
22
|
"with two groups enabled: `core` and `gate-and-verify`; activate other " +
|
|
23
23
|
"groups on demand to add their tools to your ListTools surface (and " +
|
|
24
24
|
"deactivate to hide them). State is ephemeral and per-session — it resets " +
|
|
@@ -46,19 +46,24 @@ export const manageTools = makeTool("unity_open_mcp_manage_tools", "Manage which
|
|
|
46
46
|
"`notifications/tools/list_changed`, but newly-activated tools only " +
|
|
47
47
|
"appear in your tool list if your client honors that notification and " +
|
|
48
48
|
"re-issues tools/list — if the tools do not show up, manually re-request " +
|
|
49
|
-
"the tool list, or
|
|
50
|
-
"
|
|
49
|
+
"the tool list, or call manage_tools(action: invoke, tool_name, arguments), which uses " +
|
|
50
|
+
"the normal tool route even without listChanged support.", {
|
|
51
51
|
required: ["action"],
|
|
52
52
|
properties: {
|
|
53
|
+
search_text: { type: "string", description: "Literal asset name for editor_search, a human collaboration aid; use search_assets/find_references for structured data." },
|
|
54
|
+
asset_type: { type: "string", pattern: "^[A-Za-z_][A-Za-z0-9_.]*$" },
|
|
55
|
+
open_ui: { type: "boolean", description: "editor_search only: explicitly open/focus Unity Search. Omitted/false returns the query without UI interaction." },
|
|
56
|
+
tool_name: { type: "string", description: "Exact activated tool name for invoke; obtain its schema from capabilities(tool_name)." },
|
|
57
|
+
arguments: { type: "object", additionalProperties: true, description: "Arguments for invoke; validated against the target schema before its normal route, gates and lifecycle checks." },
|
|
53
58
|
action: {
|
|
54
|
-
enum: ["list_groups", "activate", "deactivate", "reset", "suggest", "activate_for"],
|
|
59
|
+
enum: ["list_groups", "activate", "deactivate", "reset", "suggest", "activate_for", "invoke", "editor_search"],
|
|
55
60
|
description: "list_groups: enumerate every group with active flag + tool roster. " +
|
|
56
61
|
"activate / deactivate: toggle one group (requires `group`). " +
|
|
57
62
|
"reset: restore the two default-on groups. " +
|
|
58
63
|
"suggest: recommend groups for an `intent` and/or `tags` WITHOUT " +
|
|
59
64
|
"changing state (read-only). " +
|
|
60
65
|
"activate_for: activate the recommended groups for an `intent` " +
|
|
61
|
-
"and/or `tags` in one call (idempotent; emits list_changed when " +
|
|
66
|
+
"and/or `tags` in one call, returning compact new schemas (idempotent; emits list_changed when " +
|
|
62
67
|
"the visible set changes).",
|
|
63
68
|
},
|
|
64
69
|
group: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manage-tools.js","sourceRoot":"","sources":["../../src/tools/manage-tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,gEAAgE;AAChE,EAAE;AACF,8EAA8E;AAC9E,4EAA4E;AAC5E,+EAA+E;AAC/E,+EAA+E;AAC/E,EAAE;AACF,6EAA6E;AAC7E,4EAA4E;AAC5E,8DAA8D;AAC9D,EAAE;AACF,4EAA4E;AAC5E,4EAA4E;AAC5E,6EAA6E;AAC7E,yEAAyE;AACzE,4EAA4E;AAC5E,w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pE,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,iHAAiH,EAAE;QAC5J,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uFAAuF,EAAE;QACnI,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,oBAAoB,EAAE,IAAI,EAAE,WAAW,EAAE,gHAAgH,EAAE;QACxL,MAAM,EAAE;YACN,IAAI,EAAE,CAAC,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,eAAe,CAAC;YAC9G,WAAW,EACT,qEAAqE;gBACrE,8DAA8D;gBAC9D,4CAA4C;gBAC5C,kEAAkE;gBAClE,8BAA8B;gBAC9B,gEAAgE;gBAChE,gGAAgG;gBAChG,2BAA2B;SAC9B;QACD,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,+DAA+D;gBAC/D,iEAAiE;SACpE;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,6DAA6D;gBAC7D,gEAAgE;gBAChE,kEAAkE;gBAClE,qEAAqE;gBACrE,+DAA+D;gBAC/D,sCAAsC;SACzC;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACzB,WAAW,EACT,gEAAgE;gBAChE,mEAAmE;gBACnE,qEAAqE;gBACrE,+DAA+D;gBAC/D,kEAAkE;gBAClE,4BAA4B;SAC/B;KACF;CACN,CACF,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export declare const projectCommands: {
|
|
2
|
+
inputSchema: {
|
|
3
|
+
[x: string]: unknown;
|
|
4
|
+
type: "object";
|
|
5
|
+
properties?: {
|
|
6
|
+
[x: string]: object;
|
|
7
|
+
} | undefined;
|
|
8
|
+
required?: string[] | undefined;
|
|
9
|
+
};
|
|
10
|
+
name: string;
|
|
11
|
+
description?: string | undefined;
|
|
12
|
+
outputSchema?: {
|
|
13
|
+
[x: string]: unknown;
|
|
14
|
+
type: "object";
|
|
15
|
+
properties?: {
|
|
16
|
+
[x: string]: object;
|
|
17
|
+
} | undefined;
|
|
18
|
+
required?: string[] | undefined;
|
|
19
|
+
} | undefined;
|
|
20
|
+
annotations?: {
|
|
21
|
+
title?: string | undefined;
|
|
22
|
+
readOnlyHint?: boolean | undefined;
|
|
23
|
+
destructiveHint?: boolean | undefined;
|
|
24
|
+
idempotentHint?: boolean | undefined;
|
|
25
|
+
openWorldHint?: boolean | undefined;
|
|
26
|
+
} | undefined;
|
|
27
|
+
execution?: {
|
|
28
|
+
taskSupport?: "optional" | "required" | "forbidden" | undefined;
|
|
29
|
+
} | undefined;
|
|
30
|
+
_meta?: {
|
|
31
|
+
[x: string]: unknown;
|
|
32
|
+
} | undefined;
|
|
33
|
+
icons?: {
|
|
34
|
+
src: string;
|
|
35
|
+
mimeType?: string | undefined;
|
|
36
|
+
sizes?: string[] | undefined;
|
|
37
|
+
theme?: "light" | "dark" | undefined;
|
|
38
|
+
}[] | undefined;
|
|
39
|
+
title?: string | undefined;
|
|
40
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { makeTool, GATE_REQUEST_PROP } from "./schema-fragments.js";
|
|
2
|
+
export const projectCommands = makeTool("unity_open_mcp_project_commands", "Discover project-owned commands from the live Editor without a server release or tool-list refresh. list returns a bounded compact catalog; describe takes one exact id and returns its schema, safety declarations and registration diagnostics. invoke validates args against a fresh schema and uses the normal scope, gate and lifecycle pipeline. Async/cancellable remain declarations only.", {
|
|
3
|
+
required: ["action"],
|
|
4
|
+
properties: {
|
|
5
|
+
action: { type: "string", enum: ["list", "describe", "invoke"] },
|
|
6
|
+
id: { type: "string", description: "Exact catalog id, required for describe; aliases are metadata only." },
|
|
7
|
+
command_id: { type: "string", description: "Exact command id, required for invoke." },
|
|
8
|
+
args: { type: "object", description: "Command arguments using canonical keys from describe." },
|
|
9
|
+
schema_version: { type: "string", description: "Optional version from describe; a changed contract is rejected." },
|
|
10
|
+
paths_hint: { type: "array", items: { type: "string" }, description: "Explicit mutation scope when the command declares no paths." },
|
|
11
|
+
gate: { ...GATE_REQUEST_PROP },
|
|
12
|
+
ignore_scene_dirty: { type: "boolean" },
|
|
13
|
+
confirm_bypass: { type: "boolean" },
|
|
14
|
+
timeout_ms: { type: "integer", minimum: 1000, maximum: 55000 },
|
|
15
|
+
query: { type: "string", maxLength: 256, description: "Case-insensitive substring in id, title or description." },
|
|
16
|
+
tags: { type: "array", maxItems: 20, items: { type: "string", maxLength: 128 }, description: "Match all tags exactly." },
|
|
17
|
+
group: { type: "string", maxLength: 128 },
|
|
18
|
+
package: { type: "string", maxLength: 256 },
|
|
19
|
+
offset: { type: "integer", minimum: 0, maximum: 2147483647 },
|
|
20
|
+
limit: { type: "integer", minimum: 1, maximum: 100, description: "Page size, defaults to 20." },
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=project-commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-commands.js","sourceRoot":"","sources":["../../src/tools/project-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAEpE,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CACrC,iCAAiC,EACjC,oYAAoY,EACpY;IACE,QAAQ,EAAE,CAAC,QAAQ,CAAC;IACpB,UAAU,EAAE;QACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE;QAChE,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qEAAqE,EAAE;QAC1G,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wCAAwC,EAAE;QACrF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
|
6
6
|
// two can no longer drift.
|
|
7
7
|
const RECOMPILE_SCRIPTS_HINT = toolHintReference("unity_open_mcp_recompile_scripts");
|
|
8
8
|
const COMPILE_CHECK_HINT = toolHintReference("unity_open_mcp_compile_check");
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
// log. The tool prefers the project-relative log when it exists (using the
|
|
24
|
-
// --project path) and falls back to the global per-user log for older Unity
|
|
25
|
-
// versions. This matters most when the Editor is in Safe Mode with a broken
|
|
26
|
-
// bridge: the global log is stale there, and only the project-relative log
|
|
27
|
-
// carries the current compile errors.
|
|
28
|
-
//
|
|
29
|
-
// Response fields:
|
|
30
|
-
// - status: "compile_failed" | "project_unhealthy" | "no_errors_found"
|
|
31
|
-
// | "stale_log" (errors may not apply — stale log / version
|
|
32
|
-
// mismatch) | "indeterminate" (no errors, but read from the
|
|
33
|
-
// ROTATED prev_log_* — not a verified clean bill of health)
|
|
34
|
-
// - unhealthy: true when compiler errors OR issues are present
|
|
35
|
-
// - headline: one-line triage summary (empty when healthy)
|
|
36
|
-
// - errors[]: structured CSxxxx diagnostics (file/line/code/message)
|
|
37
|
-
// - issues[]: package / assembly / Editor red flags with kind + hint:
|
|
38
|
-
// * assembly_resolution — Mono.Cecil unresolved-assembly failures
|
|
39
|
-
// (classic package-version / Unity-version mismatch, e.g. ProBuilder
|
|
40
|
-
// 5.x compiled against an assembly ProBuilder 6 removed)
|
|
41
|
-
// * package_deprecated — [Package Manager] <id> is deprecated
|
|
42
|
-
// * package_manager_error — other Package Manager conflict / resolution
|
|
43
|
-
// errors
|
|
44
|
-
// * editor_fd_exhaustion — the Editor hung mid-build after hitting an
|
|
45
|
-
// internal Mono/Unity file-descriptor limit (the Bee build driver's
|
|
46
|
-
// "Could not register to wait for file descriptor N" exception). This
|
|
47
|
-
// is NOT a code error and has no CSxxxx fix; the Editor must be
|
|
48
|
-
// restarted to recover. The hint carries restart instructions.
|
|
49
|
-
export const readCompileErrors = makeTool("unity_open_mcp_read_compile_errors", "Read C# compiler errors AND package/assembly red flags AND an Editor " +
|
|
50
|
-
"hang signal directly from Unity's Editor.log (offline, no bridge, no " +
|
|
51
|
-
"Unity spawn). Returns structured CSxxxx compiler errors " +
|
|
52
|
-
"(file/line/code/message) PLUS an `issues` list of red flags with " +
|
|
53
|
-
"per-issue `kind` + `hint`: assembly_resolution (Mono.Cecil " +
|
|
54
|
-
"unresolved-assembly failures — the classic package-version / " +
|
|
55
|
-
"Unity-version mismatch, e.g. ProBuilder 5.x on Unity 6), " +
|
|
56
|
-
"package_deprecated ([Package Manager] <id> is deprecated), " +
|
|
57
|
-
"package_manager_error (conflict / resolution errors), and " +
|
|
58
|
-
"editor_fd_exhaustion (the Editor hung mid-build after hitting an " +
|
|
59
|
-
"internal Mono/Unity file-descriptor limit — NOT a code error; the hint " +
|
|
60
|
-
"carries restart instructions). Use this when: (a) the bridge is " +
|
|
61
|
-
"unreachable after a recompile — a 'bridge_compile_failed' response " +
|
|
62
|
-
"points here, or ping returns connected:false unexpectedly; (b) Unity " +
|
|
63
|
-
"showed a 'package update' / incompatibility popup; (c) you suspect a " +
|
|
64
|
-
"package is too old for the current Editor; (d) the Editor appears hung " +
|
|
65
|
-
"after heavy automation (many recompiles) with no compile errors to " +
|
|
66
|
-
"explain it — editor_fd_exhaustion is the likely cause and only a " +
|
|
67
|
-
"restart recovers it. Works even when the bridge assembly itself is " +
|
|
68
|
-
"broken, because it reads the log file the Editor writes independently " +
|
|
69
|
-
"of the bridge. Check `unhealthy` first; when true, scan `headline` for " +
|
|
70
|
-
"a one-line triage then drill into `errors` and `issues`. When the " +
|
|
71
|
-
"response carries `staleLogSuspected: true`, the cited source files " +
|
|
72
|
-
"were edited more recently than Editor.log — the error block may " +
|
|
73
|
-
"reference on-disk code you have already fixed (Unity's incremental " +
|
|
74
|
-
"compiler no-op'd the recompile). When the response carries " +
|
|
75
|
-
"`errorsMayPredateEdits: true`, at least one file the errors CITE is newer " +
|
|
76
|
-
"than the newest built assembly, so no compile has completed since you " +
|
|
77
|
-
"edited it and the error block is from an earlier compile — do not re-read " +
|
|
78
|
-
"or re-fix that code on the strength of it. When the response carries " +
|
|
79
|
-
"`staleAssembly: true`, at least one Assets/**/*.cs " +
|
|
80
|
-
"source is newer than the newest Library/ScriptAssemblies/*.dll — the " +
|
|
81
|
-
"running assembly predates the latest source, so a no_errors_found signal " +
|
|
82
|
-
"CANNOT be trusted until the assembly is rebuilt. When that flag is set " +
|
|
83
|
-
"WITH errors, the `headline` itself says the error block may predate the " +
|
|
84
|
-
"current sources (not just the separate staleAssemblyHint field). When " +
|
|
85
|
-
"`logSource` is a `prev_log_*` value (the read came from the ROTATED " +
|
|
86
|
-
"Editor-prev.log while a live Editor may be writing a different log) and " +
|
|
87
|
-
"no errors were found, `status` is `indeterminate`, NOT " +
|
|
88
|
-
"`no_errors_found` — a clean read from the rotated log is not a verified " +
|
|
89
|
-
"clean bill of health; confirm via the live bridge or re-read after the " +
|
|
90
|
-
"Editor settles. All staleness signals call for the " +
|
|
91
|
-
"same next step (one recommended path per situation, matching the runtime " +
|
|
92
|
-
`hints): call ${RECOMPILE_SCRIPTS_HINT} for a deterministic ` +
|
|
93
|
-
"force-recompile, then re-read compile errors; with the Editor closed or " +
|
|
94
|
-
`unreachable, ${COMPILE_CHECK_HINT} spawns a fresh headless recompile ` +
|
|
95
|
-
"instead. IMPORTANT — staged compilation: Unity compiles " +
|
|
96
|
-
"assemblies in dependency order, so when `errorCount` is small but the project " +
|
|
97
|
-
"has multiple assemblies (the response carries `partialCompileLikely: true` " +
|
|
98
|
-
"with `asmdefCount`/`assembliesWithErrors`), the reported errors may be a " +
|
|
99
|
-
"SUBSET — the failing assembly aborted the pipeline before dependent ones were " +
|
|
100
|
-
"reached. Do NOT treat `errorCount` as the complete picture; fix the reported " +
|
|
101
|
-
"errors and re-check until `errorCount` is 0.", {
|
|
9
|
+
// A bounded live compile snapshot is preferred; the filesystem fallback stays
|
|
10
|
+
// available when the bridge itself cannot compile, without launching Unity.
|
|
11
|
+
export const readCompileErrors = makeTool("unity_open_mcp_read_compile_errors", "Read current compiler state from the live CompilationPipeline when available, with a bounded " +
|
|
12
|
+
"read-only probe and offline Editor.log fallback (never spawns Unity). Live status distinguishes " +
|
|
13
|
+
"currently_compiling, assembly_stale, compile_failed, and no_errors_found. A completed compile " +
|
|
14
|
+
"generation with matching source content outranks historical log errors; generation and before/after " +
|
|
15
|
+
"assembly mtimes identify the evidence. historicalLogErrors and historicalLogIssues preserve older " +
|
|
16
|
+
"log evidence separately. Without confirmed live state, returns log diagnostics with source/authorship " +
|
|
17
|
+
"and staleAssembly/staleLogSuspected caveats; a clean rotated log is indeterminate. Log issues include " +
|
|
18
|
+
"assembly_resolution, package_deprecated, package_manager_error, and editor_fd_exhaustion. " +
|
|
19
|
+
`For stale sources call ${RECOMPILE_SCRIPTS_HINT}, then re-read. ` +
|
|
20
|
+
`With the Editor closed, ${COMPILE_CHECK_HINT} can verify headlessly; never launch a second Unity ` +
|
|
21
|
+
"while a live Editor owns the project. Check unhealthy, status, headline, errors, and issues; " +
|
|
22
|
+
"offline partialCompileLikely means a failing assembly may hide downstream errors.", {
|
|
102
23
|
properties: {
|
|
103
24
|
tail_bytes: {
|
|
104
25
|
type: "integer",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-compile-errors.js","sourceRoot":"","sources":["../../src/tools/read-compile-errors.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,4EAA4E;AAC5E,+EAA+E;AAC/E,8EAA8E;AAC9E,2BAA2B;AAC3B,MAAM,sBAAsB,GAAG,iBAAiB,CAAC,kCAAkC,CAAC,CAAC;AACrF,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,8BAA8B,CAAC,CAAC;AAE7E,
|
|
1
|
+
{"version":3,"file":"read-compile-errors.js","sourceRoot":"","sources":["../../src/tools/read-compile-errors.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,4EAA4E;AAC5E,+EAA+E;AAC/E,8EAA8E;AAC9E,2BAA2B;AAC3B,MAAM,sBAAsB,GAAG,iBAAiB,CAAC,kCAAkC,CAAC,CAAC;AACrF,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,8BAA8B,CAAC,CAAC;AAE7E,8EAA8E;AAC9E,4EAA4E;AAC5E,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,CACvC,oCAAoC,EACpC,+FAA+F;IAC7F,kGAAkG;IAClG,gGAAgG;IAChG,sGAAsG;IACtG,oGAAoG;IACpG,wGAAwG;IACxG,wGAAwG;IACxG,4FAA4F;IAC5F,0BAA0B,sBAAsB,kBAAkB;IAClE,2BAA2B,kBAAkB,sDAAsD;IACnG,+FAA+F;IAC/F,mFAAmF,EACrF;IACE,UAAU,EAAE;QACN,UAAU,EAAE;YACV,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,MAAM;YACf,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,OAAO;YAChB,WAAW,EACT,6DAA6D;gBAC7D,oEAAoE;gBACpE,kEAAkE;gBAClE,mEAAmE;SACtE;KACF;CACN,CACF,CAAC"}
|
package/dist/tools/scan-paths.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { makeTool } from "./schema-fragments.js";
|
|
2
2
|
export const scanPaths = makeTool("unity_open_mcp_scan_paths", "Run one or more ported verify rules scoped to paths. For a single rule, pass categories: [\"missing_references\"]. " +
|
|
3
|
-
"
|
|
3
|
+
"Valid rule IDs are enumerated in the schema; unknown IDs fail before dispatch. Use include_rules / exclude_rules to filter the auto-selected set " +
|
|
4
4
|
"(exclude always wins; include narrows an explicit categories list, otherwise it is additive). " +
|
|
5
5
|
"fail_on_severity defaults to the project setting verify.severityThreshold in .unity-open-mcp/settings.json. " +
|
|
6
6
|
"Default (`profile: 'compact'`) returns passed + issue counts grouped by severity (no per-issue list); raise to " +
|
|
@@ -13,7 +13,7 @@ export const scanPaths = makeTool("unity_open_mcp_scan_paths", "Run one or more
|
|
|
13
13
|
categories: {
|
|
14
14
|
type: "array",
|
|
15
15
|
items: { type: "string" },
|
|
16
|
-
description: "Verify rule IDs; auto-selected from paths if omitted.
|
|
16
|
+
description: "Verify rule IDs; auto-selected from paths if omitted. Valid IDs are enumerated below.",
|
|
17
17
|
},
|
|
18
18
|
include_rules: {
|
|
19
19
|
type: "array",
|
|
@@ -30,14 +30,14 @@ export const scanPaths = makeTool("unity_open_mcp_scan_paths", "Run one or more
|
|
|
30
30
|
profile: {
|
|
31
31
|
enum: ["compact", "balanced", "full"],
|
|
32
32
|
default: "compact",
|
|
33
|
-
description: "Token-budget output profile
|
|
33
|
+
description: "Token-budget output profile. 'compact' (default) = passed + issue counts grouped by severity " +
|
|
34
34
|
"(issues[] stripped; drill in with balanced/full). 'balanced'/'full' = the full issues list (paged when " +
|
|
35
35
|
"page_size is set).",
|
|
36
36
|
},
|
|
37
37
|
page_size: {
|
|
38
38
|
type: "integer",
|
|
39
39
|
minimum: 1,
|
|
40
|
-
description: "Page the issues list (
|
|
40
|
+
description: "Page the issues list (uniform paging; balanced/full). When set, the response carries a `pagination` block " +
|
|
41
41
|
"with a `next_cursor` to resume. Omit to receive the whole issues list in one response.",
|
|
42
42
|
},
|
|
43
43
|
cursor: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scan-paths.js","sourceRoot":"","sources":["../../src/tools/scan-paths.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAA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ACvB;QACD,SAAS,EAAE;YACT,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,CAAC;YACV,WAAW,EACT,4GAA4G;gBAC5G,wFAAwF;SAC3F;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,sGAAsG;SACzG;QACD,gBAAgB,EAAE;YAChB,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC;YACnD,WAAW,EACT,4EAA4E;gBAC5E,qFAAqF;SACxF;KACF;CACN,CACF,CAAC"}
|
|
@@ -11,6 +11,19 @@ export declare const GATE_PROP: {
|
|
|
11
11
|
enum: ["enforce", "warn", "off"];
|
|
12
12
|
default: "enforce";
|
|
13
13
|
};
|
|
14
|
+
/** Request-selected gate; omission delegates to the project's bridge setting. */
|
|
15
|
+
export declare const GATE_REQUEST_PROP: {
|
|
16
|
+
enum: ["enforce", "warn", "off"];
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Gate selector for the rare mutator whose bridge contract is explicitly
|
|
20
|
+
* gate-free because it writes external configuration/package pins rather than
|
|
21
|
+
* Unity assets. Keep the enum canonical while advertising the bridge default.
|
|
22
|
+
*/
|
|
23
|
+
export declare const GATE_OFF_PROP: {
|
|
24
|
+
enum: ["enforce", "warn", "off"];
|
|
25
|
+
default: "off";
|
|
26
|
+
};
|
|
14
27
|
/**
|
|
15
28
|
* The base `paths_hint` property: array-of-string with NO description. Almost
|
|
16
29
|
* every tool that declares `paths_hint` adds a per-tool description specific
|
|
@@ -79,8 +92,7 @@ export interface ToolSchemaBody {
|
|
|
79
92
|
* + `properties` + `additionalProperties: false`. The `additionalProperties`
|
|
80
93
|
* literal lives here once instead of being copy-pasted into every tool file.
|
|
81
94
|
*
|
|
82
|
-
* The body
|
|
83
|
-
*
|
|
84
|
-
* byte-identical to the pre-change inline form.
|
|
95
|
+
* The body is cloned and canonicalized without mutating shared fragments.
|
|
96
|
+
* Wire-key annotations keep handler arguments aligned with public locators.
|
|
85
97
|
*/
|
|
86
98
|
export declare function makeTool(name: string, description: string, body: ToolSchemaBody): Tool;
|
|
@@ -2,19 +2,18 @@
|
|
|
2
2
|
//
|
|
3
3
|
// Single source of truth for the schema boilerplate that was duplicated
|
|
4
4
|
// across ~265 tool files in this directory. The fragments are SPREAD into a
|
|
5
|
-
// per-tool property block
|
|
6
|
-
//
|
|
7
|
-
//
|
|
5
|
+
// per-tool property block, then canonical locator aliases and verify-rule
|
|
6
|
+
// constraints are applied by canonicalSchema. The golden snapshot pins the
|
|
7
|
+
// published result. Per-tool descriptions stay inline where
|
|
8
8
|
// they vary — only the truly shared boilerplate (enum/default/type) is
|
|
9
9
|
// centralized here.
|
|
10
10
|
//
|
|
11
11
|
// Design constraints:
|
|
12
12
|
//
|
|
13
|
-
// 1. **
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
// does not widen `enum` to `string[]`.
|
|
13
|
+
// 1. **Canonical output.** Shared fragments preserve their types;
|
|
14
|
+
// canonicalSchema adds locator wire mappings, deprecated aliases,
|
|
15
|
+
// and selectable verify-rule enums consistently across the registry.
|
|
16
|
+
// The golden snapshot makes every published change explicit.
|
|
18
17
|
//
|
|
19
18
|
// 2. **Description text stays per-tool where it varies.** Most tools have
|
|
20
19
|
// a unique `paths_hint` description ("Mutation scope — the .anim asset
|
|
@@ -39,6 +38,7 @@
|
|
|
39
38
|
// },
|
|
40
39
|
// });
|
|
41
40
|
// ```
|
|
41
|
+
import { canonicalSchema } from "../tool-contract.js";
|
|
42
42
|
/**
|
|
43
43
|
* The `gate` property: enum + default. Inlined in 137 tool files pre-change;
|
|
44
44
|
* 128 of those have NO description (pure enum + default), 9 add a per-tool
|
|
@@ -51,6 +51,17 @@ export const GATE_PROP = {
|
|
|
51
51
|
enum: ["enforce", "warn", "off"],
|
|
52
52
|
default: "enforce",
|
|
53
53
|
};
|
|
54
|
+
/** Request-selected gate; omission delegates to the project's bridge setting. */
|
|
55
|
+
export const GATE_REQUEST_PROP = { enum: GATE_PROP.enum };
|
|
56
|
+
/**
|
|
57
|
+
* Gate selector for the rare mutator whose bridge contract is explicitly
|
|
58
|
+
* gate-free because it writes external configuration/package pins rather than
|
|
59
|
+
* Unity assets. Keep the enum canonical while advertising the bridge default.
|
|
60
|
+
*/
|
|
61
|
+
export const GATE_OFF_PROP = {
|
|
62
|
+
enum: ["enforce", "warn", "off"],
|
|
63
|
+
default: "off",
|
|
64
|
+
};
|
|
54
65
|
/**
|
|
55
66
|
* The base `paths_hint` property: array-of-string with NO description. Almost
|
|
56
67
|
* every tool that declares `paths_hint` adds a per-tool description specific
|
|
@@ -99,21 +110,20 @@ export const CONFIRM_BYPASS_BASE = {
|
|
|
99
110
|
* + `properties` + `additionalProperties: false`. The `additionalProperties`
|
|
100
111
|
* literal lives here once instead of being copy-pasted into every tool file.
|
|
101
112
|
*
|
|
102
|
-
* The body
|
|
103
|
-
*
|
|
104
|
-
* byte-identical to the pre-change inline form.
|
|
113
|
+
* The body is cloned and canonicalized without mutating shared fragments.
|
|
114
|
+
* Wire-key annotations keep handler arguments aligned with public locators.
|
|
105
115
|
*/
|
|
106
116
|
export function makeTool(name, description, body) {
|
|
107
117
|
return {
|
|
108
118
|
name,
|
|
109
119
|
description,
|
|
110
|
-
inputSchema: {
|
|
120
|
+
inputSchema: canonicalSchema(name, {
|
|
111
121
|
type: "object",
|
|
112
122
|
...(body.required !== undefined ? { required: body.required } : {}),
|
|
113
123
|
properties: body.properties,
|
|
114
124
|
...(body.oneOf !== undefined ? { oneOf: body.oneOf } : {}),
|
|
115
125
|
additionalProperties: false,
|
|
116
|
-
},
|
|
126
|
+
}),
|
|
117
127
|
};
|
|
118
128
|
}
|
|
119
129
|
//# sourceMappingURL=schema-fragments.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-fragments.js","sourceRoot":"","sources":["../../src/tools/schema-fragments.ts"],"names":[],"mappings":"AAAA,+EAA+E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OAAgB;IACtB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAiB,EAAE;CACnC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,IAAI,EAAE,SAAkB;IACxB,OAAO,EAAE,KAAc;CACxB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,SAAkB;IACxB,OAAO,EAAE,KAAc;CACxB,CAAC;AAqBF;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ,CACtB,IAAY,EACZ,WAAmB,EACnB,IAAoB;IAEpB,OAAO;QACL,IAAI;QACJ,WAAW;QACX,WAAW,EAAE,eAAe,CAAC,IAAI,EAAE;YACjC,IAAI,EAAE,QAAQ;YACd,GAAG,CAAC,IAAI,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACnE,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC1D,oBAAoB,EAAE,KAAK;SAC5B,CAAC;KACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export declare const upgrade: {
|
|
2
|
+
inputSchema: {
|
|
3
|
+
[x: string]: unknown;
|
|
4
|
+
type: "object";
|
|
5
|
+
properties?: {
|
|
6
|
+
[x: string]: object;
|
|
7
|
+
} | undefined;
|
|
8
|
+
required?: string[] | undefined;
|
|
9
|
+
};
|
|
10
|
+
name: string;
|
|
11
|
+
description?: string | undefined;
|
|
12
|
+
outputSchema?: {
|
|
13
|
+
[x: string]: unknown;
|
|
14
|
+
type: "object";
|
|
15
|
+
properties?: {
|
|
16
|
+
[x: string]: object;
|
|
17
|
+
} | undefined;
|
|
18
|
+
required?: string[] | undefined;
|
|
19
|
+
} | undefined;
|
|
20
|
+
annotations?: {
|
|
21
|
+
title?: string | undefined;
|
|
22
|
+
readOnlyHint?: boolean | undefined;
|
|
23
|
+
destructiveHint?: boolean | undefined;
|
|
24
|
+
idempotentHint?: boolean | undefined;
|
|
25
|
+
openWorldHint?: boolean | undefined;
|
|
26
|
+
} | undefined;
|
|
27
|
+
execution?: {
|
|
28
|
+
taskSupport?: "optional" | "required" | "forbidden" | undefined;
|
|
29
|
+
} | undefined;
|
|
30
|
+
_meta?: {
|
|
31
|
+
[x: string]: unknown;
|
|
32
|
+
} | undefined;
|
|
33
|
+
icons?: {
|
|
34
|
+
src: string;
|
|
35
|
+
mimeType?: string | undefined;
|
|
36
|
+
sizes?: string[] | undefined;
|
|
37
|
+
theme?: "light" | "dark" | undefined;
|
|
38
|
+
}[] | undefined;
|
|
39
|
+
title?: string | undefined;
|
|
40
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { GATE_OFF_PROP, makeTool } from "./schema-fragments.js";
|
|
2
|
+
export const upgrade = makeTool("unity_open_mcp_upgrade", "Preview or apply a coordinated update of the open Unity project to one trio version. " +
|
|
3
|
+
"Scans project and home-scoped MCP client configs, agent-facing prose/examples, and the " +
|
|
4
|
+
"bridge + verify UPM pins. Home configs are rewritten only when their UNITY_PROJECT_PATH " +
|
|
5
|
+
"belongs exclusively to the open project. `dry_run` defaults true and returns the exact " +
|
|
6
|
+
"per-file report without writing. With `dry_run:false`, config/prose files receive one-time " +
|
|
7
|
+
"`.bak` backups before rewriting; a Git-installed bridge and verify pair are then re-pinned " +
|
|
8
|
+
"atomically through Unity Package Manager, which may reload the Editor. Embedded/file bridge " +
|
|
9
|
+
"installs are preserved and reported while selected config/prose updates remain available. " +
|
|
10
|
+
"Omit `target_version` to resolve the latest published npm version explicitly for this call.", {
|
|
11
|
+
properties: {
|
|
12
|
+
target_version: {
|
|
13
|
+
type: "string",
|
|
14
|
+
pattern: "^\\d+\\.\\d+\\.\\d+$",
|
|
15
|
+
description: "Target trio version (X.Y.Z). Omit to query the latest npm release.",
|
|
16
|
+
},
|
|
17
|
+
dry_run: {
|
|
18
|
+
type: "boolean",
|
|
19
|
+
default: true,
|
|
20
|
+
description: "Preview only by default. Set false to write selected files and schedule UPM.",
|
|
21
|
+
},
|
|
22
|
+
update_upm: {
|
|
23
|
+
type: "boolean",
|
|
24
|
+
default: true,
|
|
25
|
+
description: "Update the bridge + verify Git packages atomically when the bridge source is Git.",
|
|
26
|
+
},
|
|
27
|
+
update_project_configs: {
|
|
28
|
+
type: "boolean",
|
|
29
|
+
default: true,
|
|
30
|
+
description: "Update MCP client configs found in this project or its repository ancestors.",
|
|
31
|
+
},
|
|
32
|
+
update_home_configs: {
|
|
33
|
+
type: "boolean",
|
|
34
|
+
default: true,
|
|
35
|
+
description: "Update home-scoped configs only when the entry belongs exclusively to this project.",
|
|
36
|
+
},
|
|
37
|
+
update_prose: {
|
|
38
|
+
type: "boolean",
|
|
39
|
+
default: true,
|
|
40
|
+
description: "Update allowlisted agent prose, installed core skills, and MCP config examples.",
|
|
41
|
+
},
|
|
42
|
+
paths_hint: {
|
|
43
|
+
type: "array",
|
|
44
|
+
items: { type: "string" },
|
|
45
|
+
default: ["Packages/manifest.json"],
|
|
46
|
+
description: "Audit scope materialized automatically. The gate is off because this workflow mutates " +
|
|
47
|
+
"package/configuration pins rather than Unity assets; packages-lock.json is implicit.",
|
|
48
|
+
},
|
|
49
|
+
gate: {
|
|
50
|
+
...GATE_OFF_PROP,
|
|
51
|
+
description: "Defaults off: project-asset validation does not model external configs or UPM pins.",
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=upgrade.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upgrade.js","sourceRoot":"","sources":["../../src/tools/upgrade.ts"],"names":[],"mappings":"A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
14
|
+
export type UnityPathResolution = {
|
|
15
|
+
ok: true;
|
|
16
|
+
value: ResolvedUnityPath;
|
|
17
|
+
} | {
|
|
18
|
+
ok: false;
|
|
19
|
+
reason: "not_discovered" | "preferred_not_installed" | "env_version_mismatch";
|
|
20
|
+
preferredVersion?: string;
|
|
21
|
+
configuredVersion?: string;
|
|
22
|
+
availableVersions: string[];
|
|
23
|
+
};
|
|
24
|
+
/** Read the exact editor version recorded by a Unity project. */
|
|
25
|
+
export declare function readProjectUnityVersion(projectPath: string): string | null;
|
|
26
|
+
/**
|
|
27
|
+
* Best-effort version inference for a conventional Hub executable path.
|
|
28
|
+
* Unknown/custom layouts deliberately return null rather than guessing.
|
|
29
|
+
*/
|
|
30
|
+
export declare function inferUnityVersionFromExecutablePath(executablePath: string): string | null;
|
|
14
31
|
/**
|
|
15
32
|
* OS-default Unity Hub install roots, matching the Hub's
|
|
16
33
|
* `get_os_default_hub_paths()`. Each holds version-named subfolders
|
|
@@ -77,3 +94,10 @@ export declare function versionMatches(candidateVersion: string, projectVersion?
|
|
|
77
94
|
* real machine state.
|
|
78
95
|
*/
|
|
79
96
|
export declare function resolveUnityPath(preferredVersion?: string | null, roots?: string[]): ResolvedUnityPath | null;
|
|
97
|
+
/**
|
|
98
|
+
* Fail-closed resolver for opening a concrete project in batch mode.
|
|
99
|
+
* Unlike the legacy/general resolver above, a known project version never
|
|
100
|
+
* falls through to a neighbouring patch or the newest installed editor unless
|
|
101
|
+
* the operator explicitly opts in to a mismatch.
|
|
102
|
+
*/
|
|
103
|
+
export declare function resolveUnityPathForProject(preferredVersion: string | null, roots?: string[], allowVersionMismatch?: boolean): UnityPathResolution;
|