@aefree/pi-unity 0.9.2 → 0.9.3

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/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project follows semantic versioning for public package releases.
7
7
 
8
+ ## [0.9.3] - 2026-08-10
9
+
10
+ ### Added
11
+
12
+ - Added an optional `automated` parameter to `unity_open_editor`, forwarding Unity Editor's `-automated` flag through both Unity CLI and direct Editor launch paths.
13
+
8
14
  ## [0.9.2] - 2026-08-08
9
15
 
10
16
  ### Changed
package/README.md CHANGED
@@ -43,7 +43,7 @@ A timeout is uncertain: work may still be running. The tools do not silently can
43
43
 
44
44
  ### Editor and batchmode
45
45
 
46
- - `unity_open_editor` — open the Unity Editor GUI.
46
+ - `unity_open_editor` — open the Unity Editor GUI. Pass `automated: true` to add the Unity Editor `-automated` flag; this is distinct from the Unity CLI's own `--non-interactive` option.
47
47
  - `unity_launch_batchmode` — run a bounded batchmode command through Unity CLI or the direct Editor executable.
48
48
  - `unity_run_test_batch` — run one isolated or report-producing Unity Test Framework platform with generated XML and log paths.
49
49
  - `unity_inspect_artifacts` — summarize existing Unity Test Framework XML and Unity logs without launching Unity.
package/index.ts CHANGED
@@ -103,6 +103,7 @@ type UnityLauncherPreference = "auto" | "unity-cli" | "editor-executable";
103
103
  const OPEN_EDITOR_PARAMS = Type.Object({
104
104
  path: Type.Optional(Type.String({ description: "Unity project path, workspace copy root, or folder containing project copies." })),
105
105
  unityEditorPath: Type.Optional(Type.String({ description: "Optional explicit Unity executable path override." })),
106
+ automated: Type.Optional(Type.Boolean({ default: false, description: "Pass Unity Editor's -automated flag when opening the project. Defaults to false." })),
106
107
  launcher: LAUNCHER_SCHEMA,
107
108
  });
108
109
 
@@ -1578,7 +1579,7 @@ export default function freeUnityPi(pi: ExtensionAPI) {
1578
1579
  pi.registerTool({
1579
1580
  name: "unity_open_editor",
1580
1581
  label: "Unity Open Editor",
1581
- description: "Open the Unity Editor GUI for a Unity project copy.",
1582
+ description: "Open the Unity Editor GUI for a Unity project copy, optionally passing Unity Editor's -automated flag.",
1582
1583
  promptSnippet: "Open the Unity Editor GUI for a resolved Unity project when the user explicitly asks for the editor to open.",
1583
1584
  promptGuidelines: [
1584
1585
  "Use this tool only when the user explicitly wants the Unity Editor GUI opened.",
@@ -1605,11 +1606,12 @@ export default function freeUnityPi(pi: ExtensionAPI) {
1605
1606
  launch = launchUnityCliOpenDetached(candidate.projectRoot, {
1606
1607
  editorVersion: candidate.unityVersion,
1607
1608
  editorPath: params.unityEditorPath,
1609
+ automated: params.automated,
1608
1610
  });
1609
1611
  } else {
1610
1612
  await assertUnityProjectNotBusy(candidate.projectRoot);
1611
1613
  editorPath = await resolveUnityEditorPath(candidate.unityVersion, { overridePath: params.unityEditorPath });
1612
- launch = launchUnityEditorDetached(editorPath, candidate.projectRoot);
1614
+ launch = launchUnityEditorDetached(editorPath, candidate.projectRoot, { automated: params.automated });
1613
1615
  }
1614
1616
  const text = buildEditorLaunchSummary(ctx.cwd, candidate, editorPath, discoveryWarning, launcher);
1615
1617
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aefree/pi-unity",
3
- "version": "0.9.2",
3
+ "version": "0.9.3",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.ts"
package/src/unity-cli.ts CHANGED
@@ -18,6 +18,8 @@ export type UnityCliLaunchOptions = {
18
18
  timeoutSeconds?: number;
19
19
  cliCommand?: string;
20
20
  useGraphics?: boolean;
21
+ /** Forward Unity Editor's -automated flag through `unity open --args`. */
22
+ automated?: boolean;
21
23
  };
22
24
 
23
25
  export type UnityCliPipelineInstance = {
@@ -80,6 +82,7 @@ function appendUnityCliEditorOptions(args: string[], options: UnityCliLaunchOpti
80
82
  export function createUnityCliOpenCommand(projectRoot: string, options: UnityCliLaunchOptions = {}): UnityCliCommand {
81
83
  const args = [...unityCliBaseArgs(), "open", projectRoot];
82
84
  appendUnityCliEditorOptions(args, options);
85
+ if (options.automated) args.push("--args", "-automated");
83
86
  return {
84
87
  command: resolveUnityCliCommand(options),
85
88
  args,
package/src/unity-core.ts CHANGED
@@ -64,8 +64,13 @@ export function buildUnityEditorCandidates(
64
64
  ];
65
65
  }
66
66
 
67
- export function buildUnityOpenEditorArgs(projectRoot: string): string[] {
68
- return ["-projectPath", projectRoot];
67
+ export type UnityOpenEditorArgsOptions = {
68
+ /** Pass Unity Editor's -automated flag. */
69
+ automated?: boolean;
70
+ };
71
+
72
+ export function buildUnityOpenEditorArgs(projectRoot: string, options: UnityOpenEditorArgsOptions = {}): string[] {
73
+ return ["-projectPath", projectRoot, ...(options.automated ? ["-automated"] : [])];
69
74
  }
70
75
 
71
76
  export type UnityBatchmodeArgsOptions = {
@@ -7,6 +7,7 @@ import {
7
7
  buildUnityOpenEditorArgs,
8
8
  normalizeUnityEditorOverride,
9
9
  type SupportedPlatform,
10
+ type UnityOpenEditorArgsOptions,
10
11
  } from "./unity-core";
11
12
  import { createUnityCliOpenCommand, type UnityCliLaunchOptions } from "./unity-cli";
12
13
 
@@ -47,8 +48,12 @@ export async function resolveUnityEditorPath(
47
48
  );
48
49
  }
49
50
 
50
- export function launchUnityEditorDetached(editorPath: string, projectRoot: string): { pid: number | undefined; args: string[]; command: string } {
51
- const args = buildUnityOpenEditorArgs(projectRoot);
51
+ export function launchUnityEditorDetached(
52
+ editorPath: string,
53
+ projectRoot: string,
54
+ options: UnityOpenEditorArgsOptions = {},
55
+ ): { pid: number | undefined; args: string[]; command: string } {
56
+ const args = buildUnityOpenEditorArgs(projectRoot, options);
52
57
  const child = spawn(editorPath, args, {
53
58
  detached: true,
54
59
  stdio: "ignore",