unity-agentic-tools 0.6.1 → 0.7.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 +18 -2
- package/dist/bridge-install.d.ts +6 -1
- package/dist/bridge-install.d.ts.map +1 -1
- package/dist/bridge-install.js +75 -4
- package/dist/bridge-install.js.map +1 -1
- package/dist/cli.js +432 -161
- package/dist/cli.js.map +1 -1
- package/dist/editor-client.d.ts +8 -1
- package/dist/editor-client.d.ts.map +1 -1
- package/dist/editor-client.js +256 -54
- package/dist/editor-client.js.map +1 -1
- package/dist/index.d.ts +0 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +39 -972
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +16 -239
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -0
- package/dist/types.js.map +1 -1
- package/package.json +8 -13
- package/dist/cli-output.d.ts +0 -7
- package/dist/cli-output.d.ts.map +0 -1
- package/dist/cli-output.js +0 -24
- package/dist/cli-output.js.map +0 -1
- package/dist/doc-indexer-cli.js +0 -3218
- package/dist/guid-cache.d.ts +0 -45
- package/dist/guid-cache.d.ts.map +0 -1
- package/dist/guid-cache.js +0 -111
- package/dist/guid-cache.js.map +0 -1
- package/dist/project-search.d.ts +0 -16
- package/dist/project-search.d.ts.map +0 -1
- package/dist/project-search.js +0 -538
- package/dist/project-search.js.map +0 -1
- package/dist/scanner.d.ts +0 -150
- package/dist/scanner.d.ts.map +0 -1
- package/dist/scanner.js +0 -223
- package/dist/scanner.js.map +0 -1
- package/dist/setup.d.ts +0 -25
- package/dist/setup.d.ts.map +0 -1
- package/dist/setup.js +0 -185
- package/dist/setup.js.map +0 -1
- package/native/index.d.ts +0 -335
- package/native/index.js +0 -330
- package/native/unity-file-tools.darwin-arm64.node +0 -0
- package/native/unity-file-tools.darwin-x64.node +0 -0
- package/native/unity-file-tools.linux-x64-gnu.node +0 -0
- package/native/unity-file-tools.win32-x64-msvc.node +0 -0
package/README.md
CHANGED
|
@@ -14,6 +14,8 @@ unity-agentic-tools stream console -p /path/to/UnityProject
|
|
|
14
14
|
unity-agentic-tools cleanup -p /path/to/UnityProject
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
+
By default, `install` writes the GitHub package URL. For local bridge package development, use `unity-agentic-tools install --local [path]`; existing `file:` dependencies are preserved unless `unity-agentic-tools install --remote` is passed.
|
|
18
|
+
|
|
17
19
|
## Command Surface
|
|
18
20
|
|
|
19
21
|
The CLI intentionally exposes seven broad commands:
|
|
@@ -26,10 +28,18 @@ The CLI intentionally exposes seven broad commands:
|
|
|
26
28
|
| `install` | Install the Unity bridge package |
|
|
27
29
|
| `uninstall` | Remove the Unity bridge package |
|
|
28
30
|
| `cleanup` | Remove stale bridge state or rebuildable `.unity-agentic` caches |
|
|
29
|
-
| `status` | Check command runner and bridge reachability |
|
|
31
|
+
| `status` | Check command runner and bridge reachability, and what the Editor is busy with |
|
|
30
32
|
|
|
31
33
|
There are no hidden local serialized-file mutation commands or editor APIs.
|
|
32
34
|
|
|
35
|
+
## Domain Reloads
|
|
36
|
+
|
|
37
|
+
Script edits and entering play mode reload Unity's domain, which takes the bridge down for seconds at a time. Read commands and `play.enter`/`play.exit` wait that window out automatically — up to 30s, and only while the Unity process is still alive — so expect a slow call rather than a failure. `stream` reconnects on the same budget and reports `Stream lost: ...` if it cannot.
|
|
38
|
+
|
|
39
|
+
Mutating commands are deliberately not retried across a reload: the request may already be executing on Unity's main thread, and replaying it could apply it twice. Treat `Editor invoke was interrupted by a server transition ...` as "result unknown", check the side effects, then decide whether to re-run.
|
|
40
|
+
|
|
41
|
+
`play.enter` and `play.exit` report the state at the moment they return, not the requested one — `requested` names the intent, `state` and `isPlaying` are queried live. Gate on `play.state`.
|
|
42
|
+
|
|
33
43
|
## Examples
|
|
34
44
|
|
|
35
45
|
```bash
|
|
@@ -43,7 +53,13 @@ unity-agentic-tools stream console --type Error -p <project>
|
|
|
43
53
|
unity-agentic-tools cleanup --cache -p <project>
|
|
44
54
|
```
|
|
45
55
|
|
|
46
|
-
|
|
56
|
+
Structured arguments go positionally in single quotes — the CLI encodes the outer JSON array itself:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
unity-agentic-tools run update.batch Assets/Scenes/Main.unity '[{"gameObjectPath":"Player","propertyPath":"m_Name","value":"Hero"}]' -p <project>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
`--args '<json array>'` sends the same payload with the escaping done by hand. Reach for it only when an argument starts with `-`, which the option parser would otherwise claim.
|
|
47
63
|
|
|
48
64
|
## Project Commands
|
|
49
65
|
|
package/dist/bridge-install.d.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
export interface BridgeInstallOptions {
|
|
2
|
+
remote?: boolean;
|
|
3
|
+
local_package_path?: string;
|
|
4
|
+
require_local?: boolean;
|
|
5
|
+
}
|
|
1
6
|
interface BridgeInstallResult {
|
|
2
7
|
success: true;
|
|
3
8
|
action: 'added' | 'updated' | 'preserved';
|
|
4
9
|
name: string;
|
|
5
10
|
version: string;
|
|
6
11
|
}
|
|
7
|
-
export declare function install_bridge_package(project_path: string): BridgeInstallResult | {
|
|
12
|
+
export declare function install_bridge_package(project_path: string, options?: BridgeInstallOptions): BridgeInstallResult | {
|
|
8
13
|
error: string;
|
|
9
14
|
};
|
|
10
15
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge-install.d.ts","sourceRoot":"","sources":["../src/bridge-install.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bridge-install.d.ts","sourceRoot":"","sources":["../src/bridge-install.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,oBAAoB;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,UAAU,mBAAmB;IACzB,OAAO,EAAE,IAAI,CAAC;IACd,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,WAAW,CAAC;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACnB;AAMD,wBAAgB,sBAAsB,CAClC,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE,oBAAyB,GACnC,mBAAmB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAuBzC"}
|
package/dist/bridge-install.js
CHANGED
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.install_bridge_package = install_bridge_package;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const path_1 = require("path");
|
|
4
6
|
const packages_1 = require("./packages");
|
|
5
7
|
const BRIDGE_PACKAGE_NAME = 'com.unity-agentic-tools.editor-bridge';
|
|
6
|
-
const
|
|
7
|
-
function install_bridge_package(project_path) {
|
|
8
|
+
const REMOTE_BRIDGE_PACKAGE_VERSION = 'https://github.com/taconotsandwich/unity-agentic-tools.git?path=unity-package';
|
|
9
|
+
function install_bridge_package(project_path, options = {}) {
|
|
10
|
+
const target = resolve_bridge_package_target(options);
|
|
11
|
+
if ('error' in target) {
|
|
12
|
+
return target;
|
|
13
|
+
}
|
|
8
14
|
const manifest_result = (0, packages_1.load_manifest)(project_path);
|
|
9
15
|
if ('error' in manifest_result) {
|
|
10
16
|
return manifest_result;
|
|
11
17
|
}
|
|
12
18
|
const existing_version = manifest_result.manifest.dependencies[BRIDGE_PACKAGE_NAME];
|
|
13
|
-
|
|
19
|
+
const should_preserve_existing_file = !options.remote && !options.local_package_path && !options.require_local;
|
|
20
|
+
if (should_preserve_existing_file && typeof existing_version === 'string' && existing_version.startsWith('file:')) {
|
|
14
21
|
return {
|
|
15
22
|
success: true,
|
|
16
23
|
action: 'preserved',
|
|
@@ -18,6 +25,70 @@ function install_bridge_package(project_path) {
|
|
|
18
25
|
version: existing_version,
|
|
19
26
|
};
|
|
20
27
|
}
|
|
21
|
-
return (0, packages_1.add_package)(project_path, BRIDGE_PACKAGE_NAME,
|
|
28
|
+
return (0, packages_1.add_package)(project_path, BRIDGE_PACKAGE_NAME, target.version);
|
|
29
|
+
}
|
|
30
|
+
function resolve_bridge_package_target(options) {
|
|
31
|
+
if (options.remote && (options.local_package_path || options.require_local)) {
|
|
32
|
+
return { error: 'Use either --local or --remote, not both.' };
|
|
33
|
+
}
|
|
34
|
+
if (options.remote) {
|
|
35
|
+
return { version: REMOTE_BRIDGE_PACKAGE_VERSION };
|
|
36
|
+
}
|
|
37
|
+
if (options.local_package_path) {
|
|
38
|
+
const local_path = (0, path_1.resolve)(options.local_package_path);
|
|
39
|
+
return local_package_target(local_path);
|
|
40
|
+
}
|
|
41
|
+
if (options.require_local) {
|
|
42
|
+
const detected_path = detect_local_bridge_package_path();
|
|
43
|
+
if (detected_path) {
|
|
44
|
+
return local_package_target(detected_path);
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
error: 'Local bridge package could not be auto-detected. Pass --local <path-to-unity-package> or run from a source checkout.',
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return { version: REMOTE_BRIDGE_PACKAGE_VERSION };
|
|
51
|
+
}
|
|
52
|
+
function detect_local_bridge_package_path() {
|
|
53
|
+
const candidate = (0, path_1.resolve)(__dirname, '..', '..', 'unity-package');
|
|
54
|
+
return is_bridge_package(candidate) ? candidate : undefined;
|
|
55
|
+
}
|
|
56
|
+
function local_package_target(package_path) {
|
|
57
|
+
const normalized_path = normalize_local_bridge_package_path(package_path);
|
|
58
|
+
if (!normalized_path) {
|
|
59
|
+
return {
|
|
60
|
+
error: `Local bridge package not found at ${package_path}. Expected package.json with name "${BRIDGE_PACKAGE_NAME}".`,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
return { version: to_file_dependency(normalized_path) };
|
|
64
|
+
}
|
|
65
|
+
function normalize_local_bridge_package_path(package_path) {
|
|
66
|
+
if (is_bridge_package(package_path)) {
|
|
67
|
+
return package_path;
|
|
68
|
+
}
|
|
69
|
+
const nested_package_path = (0, path_1.join)(package_path, 'unity-package');
|
|
70
|
+
if (is_bridge_package(nested_package_path)) {
|
|
71
|
+
return nested_package_path;
|
|
72
|
+
}
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
75
|
+
function is_bridge_package(package_path) {
|
|
76
|
+
const package_json_path = (0, path_1.join)(package_path, 'package.json');
|
|
77
|
+
if (!(0, fs_1.existsSync)(package_json_path)) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
try {
|
|
81
|
+
const parsed = JSON.parse((0, fs_1.readFileSync)(package_json_path, 'utf-8'));
|
|
82
|
+
return is_record(parsed) && parsed.name === BRIDGE_PACKAGE_NAME;
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function is_record(value) {
|
|
89
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
90
|
+
}
|
|
91
|
+
function to_file_dependency(package_path) {
|
|
92
|
+
return `file:${package_path.replace(/\\/g, '/')}`;
|
|
22
93
|
}
|
|
23
94
|
//# sourceMappingURL=bridge-install.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge-install.js","sourceRoot":"","sources":["../src/bridge-install.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"bridge-install.js","sourceRoot":"","sources":["../src/bridge-install.ts"],"names":[],"mappings":";;AAwBA,wDA0BC;AAlDD,2BAA8C;AAC9C,+BAAqC;AACrC,yCAAwD;AAExD,MAAM,mBAAmB,GAAG,uCAAuC,CAAC;AACpE,MAAM,6BAA6B,GAAG,+EAA+E,CAAC;AAmBtH,SAAgB,sBAAsB,CAClC,YAAoB,EACpB,UAAgC,EAAE;IAElC,MAAM,MAAM,GAAG,6BAA6B,CAAC,OAAO,CAAC,CAAC;IACtD,IAAI,OAAO,IAAI,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