windows-development-sandbox 1.25.0 → 1.27.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/config.example.json +17 -5
- package/dist/app/features/accounts/services.def.d.ts +1 -1
- package/dist/app/features/accounts/services.def.js +1 -1
- package/dist/app/features/data/data.def.d.ts +4 -4
- package/dist/app/features/data/data.run.d.ts +1 -1
- package/dist/app/features/defs.d.ts +356 -6
- package/dist/app/features/defs.js +15 -0
- package/dist/app/features/projects/projects.def.d.ts +1 -1
- package/dist/app/features/projects/projects.run.d.ts +1 -1
- package/dist/app/features/settings/categories.def.js +1 -0
- package/dist/app/features/unity/index.d.ts +2 -0
- package/dist/app/features/unity/index.js +3 -0
- package/dist/app/features/unity/unity.def.d.ts +294 -0
- package/dist/app/features/unity/unity.def.js +471 -0
- package/dist/app/features/unity/unity.run.d.ts +142 -0
- package/dist/app/features/unity/unity.run.js +363 -0
- package/dist/app/features/unreal/index.d.ts +2 -0
- package/dist/app/features/unreal/index.js +3 -0
- package/dist/app/features/unreal/unreal.def.d.ts +236 -0
- package/dist/app/features/unreal/unreal.def.js +379 -0
- package/dist/app/features/unreal/unreal.run.d.ts +96 -0
- package/dist/app/features/unreal/unreal.run.js +217 -0
- package/dist/app/registry.js +11 -0
- package/dist/bin/agent-sandbox.js +2 -2
- package/dist/bin/{chunk-IZRGTSQ5.js → chunk-6WWMBCT2.js} +4632 -1941
- package/dist/bin/{chunk-SUYYVIDW.js → chunk-JXL6ZOO3.js} +126 -6
- package/dist/bin/{chunk-KH4MI2U5.js → chunk-ZXCAVVS4.js} +1 -1
- package/dist/bin/claude-host.js +2 -2
- package/dist/bin/claude-sbx.js +2 -2
- package/dist/bin/codex-sbx.js +2 -2
- package/dist/bin/gemini-sbx.js +2 -2
- package/dist/bin/sandbox.js +2 -2
- package/dist/bin/sbx-hide.js +2 -2
- package/dist/bin/sbx-show.js +2 -2
- package/dist/cli/commands/launch/launch.js +17 -2
- package/dist/cli/commands/registry.js +6 -0
- package/dist/cli/manifest.d.ts +51 -1
- package/dist/cli/manifest.js +58 -1
- package/dist/cli/menu/coverage-exempt.js +2 -0
- package/dist/cli/menu/pages/sandbox-page.d.ts +6 -0
- package/dist/cli/menu/pages/sandbox-page.js +71 -4
- package/dist/cli/menu/views.js +4 -0
- package/dist/core/config/defaults.js +33 -6
- package/dist/core/schema/accounts.d.ts +3 -0
- package/dist/core/schema/accounts.js +1 -0
- package/dist/core/schema/config.d.ts +32 -14
- package/dist/core/schema/github.d.ts +1 -0
- package/dist/core/schema/github.js +3 -0
- package/dist/core/schema/pc-installs.d.ts +5 -2
- package/dist/core/schema/pc-installs.js +16 -2
- package/dist/core/schema/toolchains.d.ts +8 -0
- package/dist/core/schema/toolchains.js +20 -5
- package/dist/guest/accounts/adapters.js +2 -0
- package/dist/guest/accounts/apply.d.ts +4 -2
- package/dist/guest/accounts/kinds/epic.js +18 -13
- package/dist/guest/accounts/kinds/perplexityapp.d.ts +7 -0
- package/dist/guest/accounts/kinds/perplexityapp.js +53 -0
- package/dist/guest/accounts/kinds/unity.d.ts +27 -0
- package/dist/guest/accounts/kinds/unity.js +164 -7
- package/dist/guest/apps/after-install.d.ts +1 -1
- package/dist/guest/apps/after-install.js +6 -1
- package/dist/guest/apps/app-installer.d.ts +1 -0
- package/dist/guest/apps/app-installer.js +31 -3
- package/dist/guest/apps/comet-unpack.js +3 -2
- package/dist/guest/apps/resolvers-gamedev.js +55 -1
- package/dist/guest/apps/store-app.d.ts +4 -0
- package/dist/guest/apps/store-app.js +19 -0
- package/dist/guest/apps/store-check.d.ts +8 -0
- package/dist/guest/apps/store-check.js +33 -0
- package/dist/guest/boot/boot.js +15 -2
- package/dist/guest/boot/guide.js +42 -0
- package/dist/guest/browser/comet.d.ts +3 -1
- package/dist/guest/browser/comet.js +1 -1
- package/dist/guest/browser/perplexity-app.d.ts +12 -0
- package/dist/guest/browser/perplexity-app.js +60 -0
- package/dist/guest/daemon/daemon.js +5 -0
- package/dist/guest/devtools/devtool.d.ts +1 -1
- package/dist/guest/devtools/registry.js +1 -2
- package/dist/guest/entries/tool.js +1 -1
- package/dist/guest/setup/addon-mcp.d.ts +12 -0
- package/dist/guest/setup/addon-mcp.js +29 -4
- package/dist/guest/setup/browser-gpu.js +14 -11
- package/dist/guest/setup/github-token.js +4 -4
- package/dist/guest/setup/headroom.js +4 -0
- package/dist/guest/setup/unity-agent.d.ts +11 -0
- package/dist/guest/setup/unity-agent.js +36 -0
- package/dist/guest/toolchains/engines/epic-launcher.d.ts +26 -0
- package/dist/guest/toolchains/engines/epic-launcher.js +127 -0
- package/dist/guest/toolchains/engines/unity-cli.d.ts +24 -0
- package/dist/guest/toolchains/engines/unity-cli.js +74 -0
- package/dist/guest/toolchains/engines/unity-hub.d.ts +2 -0
- package/dist/guest/toolchains/engines/unity-hub.js +27 -0
- package/dist/guest/toolchains/engines/unity-release.d.ts +4 -15
- package/dist/guest/toolchains/engines/unity-release.js +17 -5
- package/dist/guest/toolchains/engines/unity-status.d.ts +11 -0
- package/dist/guest/toolchains/engines/unity-status.js +39 -0
- package/dist/guest/toolchains/engines/unity.d.ts +20 -1
- package/dist/guest/toolchains/engines/unity.js +250 -3
- package/dist/guest/toolchains/engines/unreal-engines.d.ts +21 -1
- package/dist/guest/toolchains/engines/unreal-engines.js +163 -3
- package/dist/guest/toolchains/engines/unreal-status.d.ts +13 -0
- package/dist/guest/toolchains/engines/unreal-status.js +41 -0
- package/dist/guest/toolchains/native/debuggers.d.ts +6 -0
- package/dist/guest/toolchains/native/debuggers.js +57 -0
- package/dist/guest/toolchains/native/mesa.js +15 -8
- package/dist/guest/toolchains/native/rust-extras.d.ts +7 -0
- package/dist/guest/toolchains/native/rust-extras.js +23 -1
- package/dist/guest/toolchains/native/unreal.d.ts +2 -2
- package/dist/guest/toolchains/native/unreal.js +96 -18
- package/dist/guest/toolchains/plan.js +17 -2
- package/dist/guest/toolchains/tools/cli.js +2 -2
- package/dist/guest/toolchains/tools/vscode-profile.js +2 -0
- package/dist/host/accounts/deliver.js +4 -0
- package/dist/host/accounts/kinds/epic.js +11 -5
- package/dist/host/accounts/kinds/perplexityapp.d.ts +2 -0
- package/dist/host/accounts/kinds/perplexityapp.js +8 -0
- package/dist/host/accounts/kinds/unity.d.ts +1 -1
- package/dist/host/accounts/kinds/unity.js +60 -8
- package/dist/host/accounts/leases.d.ts +2 -1
- package/dist/host/accounts/source.d.ts +2 -0
- package/dist/host/accounts/source.js +1 -0
- package/dist/host/accounts/sources.js +2 -0
- package/dist/host/apps/index.d.ts +1 -0
- package/dist/host/apps/index.js +2 -0
- package/dist/host/apps/store-package.d.ts +51 -0
- package/dist/host/apps/store-package.js +209 -0
- package/dist/host/github/deliver.d.ts +8 -3
- package/dist/host/github/deliver.js +42 -29
- package/dist/host/github/index.d.ts +1 -0
- package/dist/host/github/index.js +1 -0
- package/dist/host/github/pc-login.d.ts +27 -0
- package/dist/host/github/pc-login.js +129 -0
- package/dist/host/pc-installs/discover.d.ts +6 -0
- package/dist/host/pc-installs/discover.js +37 -5
- package/dist/host/pc-installs/epic.d.ts +3 -0
- package/dist/host/pc-installs/epic.js +33 -2
- package/dist/host/pc-installs/source.d.ts +1 -1
- package/dist/host/pc-installs/unity-assets.d.ts +5 -0
- package/dist/host/pc-installs/unity-assets.js +18 -0
- package/dist/host/pc-installs/unity.d.ts +20 -0
- package/dist/host/pc-installs/unity.js +135 -2
- package/dist/host/pc-installs/unreal-vault.d.ts +11 -0
- package/dist/host/pc-installs/unreal-vault.js +78 -0
- package/dist/host/pc-installs/unreal.d.ts +36 -0
- package/dist/host/pc-installs/unreal.js +145 -2
- package/dist/host/profile/claude-profile.d.ts +8 -0
- package/dist/host/profile/claude-profile.js +43 -4
- package/dist/host/profile/index.d.ts +1 -1
- package/dist/host/profile/index.js +1 -1
- package/dist/runtime/agent.js +197 -18
- package/dist/runtime/daemon.js +3938 -1386
- package/dist/runtime/db.js +197 -18
- package/dist/runtime/main.js +4336 -1978
- package/dist/runtime/netproxy.js +197 -18
- package/dist/runtime/tool.js +214 -38
- package/dist/runtime/view.js +197 -18
- package/dist/selftest/agent-paths.test.js +1 -0
- package/dist/selftest/agents-web.test.js +14 -1
- package/dist/selftest/engines.test.js +602 -3
- package/dist/selftest/github.test.js +64 -1
- package/dist/selftest/heavy-load.test.js +3 -1
- package/dist/selftest/hostile-input.test.js +11 -1
- package/dist/selftest/index.js +12 -0
- package/dist/selftest/menu-screens.js +5 -1
- package/dist/selftest/mixamo.test.d.ts +2 -0
- package/dist/selftest/mixamo.test.js +60 -0
- package/dist/selftest/persisted-installs.test.js +1 -1
- package/dist/selftest/secrets.test.js +36 -1
- package/dist/selftest/service-accounts.test.js +1 -1
- package/dist/selftest/store-app.test.d.ts +2 -0
- package/dist/selftest/store-app.test.js +162 -0
- package/dist/selftest/support/engine-golden.js +10 -0
- package/dist/selftest/support/fixtures.d.ts +13 -2
- package/dist/selftest/support/unity-sample.d.ts +2 -0
- package/dist/selftest/support/unity-sample.js +80 -0
- package/dist/selftest/support/unreal-sample.d.ts +2 -0
- package/dist/selftest/support/unreal-sample.js +83 -0
- package/dist/selftest/toolchains.test.js +32 -2
- package/dist/selftest/unity-accounts.test.d.ts +2 -0
- package/dist/selftest/unity-accounts.test.js +106 -0
- package/dist/selftest/unity-agent.test.d.ts +2 -0
- package/dist/selftest/unity-agent.test.js +47 -0
- package/dist/selftest/unity-page.test.d.ts +2 -0
- package/dist/selftest/unity-page.test.js +177 -0
- package/dist/selftest/unity-setup.test.d.ts +2 -0
- package/dist/selftest/unity-setup.test.js +49 -0
- package/dist/selftest/unity.test.js +238 -3
- package/dist/shared/accounts/index.d.ts +2 -1
- package/dist/shared/accounts/index.js +2 -1
- package/dist/shared/accounts/kinds/epic.d.ts +6 -1
- package/dist/shared/accounts/kinds/epic.js +11 -1
- package/dist/shared/accounts/kinds/unity.d.ts +28 -0
- package/dist/shared/accounts/kinds/unity.js +88 -0
- package/dist/shared/accounts/kinds.d.ts +2 -2
- package/dist/shared/accounts/kinds.js +23 -1
- package/dist/shared/accounts/payloads.d.ts +52 -0
- package/dist/shared/accounts/payloads.js +14 -2
- package/dist/shared/apps/associations.d.ts +7 -0
- package/dist/shared/apps/associations.js +26 -0
- package/dist/shared/apps/catalogue-agents-web.d.ts +11 -1
- package/dist/shared/apps/catalogue-agents-web.js +28 -2
- package/dist/shared/apps/catalogue-gamedev.d.ts +3 -0
- package/dist/shared/apps/catalogue-gamedev.js +102 -1
- package/dist/shared/apps/catalogue.d.ts +8 -0
- package/dist/shared/apps/index.d.ts +5 -2
- package/dist/shared/apps/index.js +5 -2
- package/dist/shared/apps/preview.d.ts +2 -0
- package/dist/shared/apps/preview.js +10 -0
- package/dist/shared/apps/selection.d.ts +6 -0
- package/dist/shared/apps/selection.js +9 -0
- package/dist/shared/apps/store-package.d.ts +31 -0
- package/dist/shared/apps/store-package.js +34 -0
- package/dist/shared/browser-policy.d.ts +14 -0
- package/dist/shared/browser-policy.js +22 -0
- package/dist/shared/channel/schema.d.ts +24 -0
- package/dist/shared/channel/secrets.d.ts +17 -0
- package/dist/shared/io/index.d.ts +1 -0
- package/dist/shared/io/index.js +1 -0
- package/dist/shared/io/rotate-log.d.ts +2 -0
- package/dist/shared/io/rotate-log.js +16 -0
- package/dist/shared/memory/policy.d.ts +5 -0
- package/dist/shared/memory/policy.js +7 -0
- package/dist/shared/paths/pc-installs.d.ts +13 -2
- package/dist/shared/paths/pc-installs.js +2 -0
- package/dist/shared/readiness.d.ts +2 -3
- package/dist/shared/readiness.js +2 -3
- package/dist/shared/signer.d.ts +4 -0
- package/dist/shared/signer.js +2 -0
- package/dist/shared/unity/asset-cache.d.ts +20 -0
- package/dist/shared/unity/asset-cache.js +44 -0
- package/dist/shared/unity/cli.d.ts +40 -0
- package/dist/shared/unity/cli.js +77 -0
- package/dist/shared/unity/editors.d.ts +46 -0
- package/dist/shared/unity/editors.js +89 -0
- package/dist/shared/unity/guide.d.ts +9 -0
- package/dist/shared/unity/guide.js +84 -0
- package/dist/shared/unity/index.d.ts +9 -0
- package/dist/shared/unity/index.js +11 -0
- package/dist/shared/unity/manifest.d.ts +10 -0
- package/dist/shared/unity/manifest.js +53 -0
- package/dist/shared/unity/mcp.d.ts +8 -0
- package/dist/shared/unity/mcp.js +12 -0
- package/dist/shared/unity/release.d.ts +28 -0
- package/dist/shared/unity/release.js +83 -0
- package/dist/shared/unity/status.d.ts +59 -0
- package/dist/shared/unity/status.js +45 -0
- package/dist/shared/unity/version.d.ts +27 -0
- package/dist/shared/unity/version.js +75 -0
- package/dist/shared/unreal/engines.d.ts +161 -0
- package/dist/shared/unreal/engines.js +308 -0
- package/dist/shared/unreal/guide.d.ts +19 -0
- package/dist/shared/unreal/guide.js +105 -0
- package/dist/shared/unreal/index.d.ts +7 -0
- package/dist/shared/unreal/index.js +8 -0
- package/dist/shared/unreal/launcher-files.d.ts +88 -0
- package/dist/shared/unreal/launcher-files.js +292 -0
- package/dist/shared/unreal/mixamo.d.ts +5 -0
- package/dist/shared/unreal/mixamo.js +16 -0
- package/dist/shared/unreal/room.d.ts +17 -0
- package/dist/shared/unreal/room.js +34 -0
- package/dist/shared/unreal/status.d.ts +54 -0
- package/dist/shared/unreal/status.js +57 -0
- package/dist/shared/unreal/vault.d.ts +21 -0
- package/dist/shared/unreal/vault.js +67 -0
- package/dist/shared/unreal/vs-check.d.ts +39 -0
- package/dist/shared/unreal/vs-check.js +79 -0
- package/dist/web/index.html +1 -1
- package/dist/web/{main-CCILLX2M.js → main-VPMYTSUL.js} +87 -87
- package/native/csharp/HcsHost/AssemblyInfo.cs +3 -3
- package/native/csharp/HostTools/AssemblyInfo.cs +3 -3
- package/native/csharp/StorageHelper/AssemblyInfo.cs +3 -3
- package/native/scripts/get-store-package.ps1 +58 -0
- package/package.json +1 -1
- package/sandbox/addons/openupm-cli/package-lock.json +2921 -0
- package/sandbox/addons/openupm-cli/package.json +7 -0
- package/sandbox/addons/unity-mcp/requirements.in +1 -0
- package/sandbox/addons/unity-mcp/requirements.txt +1165 -0
- package/sandbox/csharp/AppActivation.cs +38 -0
- package/sandbox/csharp/VsSetup.cs +210 -0
- package/sandbox/scripts/get-vs-setup.ps1 +93 -0
- package/sandbox/scripts/install-store-package.ps1 +28 -0
- package/sandbox/scripts/set-registry-values.ps1 +35 -0
- package/sandbox/scripts/start-store-app.ps1 +29 -0
- package/schemas/config.schema.json +96 -8
- package/schemas/sandbox-config.schema.json +46 -6
- package/dist/guest/devtools/unity.d.ts +0 -2
- package/dist/guest/devtools/unity.js +0 -7
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// Unity's release API (services.api.unity.com): the editor installer, its changeset and its modules for one version.
|
|
2
|
+
// The answer is untrusted JSON: it is parsed with zod, every list and text bounded.
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { UNITY_CHANGESET } from './version.js';
|
|
5
|
+
const API = 'https://services.api.unity.com/unity/editor/release/v1/releases';
|
|
6
|
+
const MARGIN = 1.1;
|
|
7
|
+
/** The request for one editor version (Windows, x86_64, one result). */
|
|
8
|
+
export function releaseUrl(version) {
|
|
9
|
+
return API + '?version=' + encodeURIComponent(version) + '&platform=WINDOWS&architecture=X86_64&limit=1';
|
|
10
|
+
}
|
|
11
|
+
const Size = z.object({ value: z.number().min(0) });
|
|
12
|
+
const Text = (max) => z.string().max(max);
|
|
13
|
+
const SubModule = z.lazy(() => z.object({
|
|
14
|
+
id: z.string().regex(/^[A-Za-z0-9._-]{1,80}$/),
|
|
15
|
+
downloadSize: Size.optional(),
|
|
16
|
+
installedSize: Size.optional(),
|
|
17
|
+
integrity: Text(200).optional(),
|
|
18
|
+
subModules: z.array(SubModule).max(50).optional(),
|
|
19
|
+
}));
|
|
20
|
+
const ReleaseResponseSchema = z.object({
|
|
21
|
+
results: z
|
|
22
|
+
.array(z.object({
|
|
23
|
+
version: Text(40),
|
|
24
|
+
shortRevision: z.string().regex(UNITY_CHANGESET),
|
|
25
|
+
downloads: z
|
|
26
|
+
.array(z.object({
|
|
27
|
+
url: z.string().url().max(2000).startsWith('https://'),
|
|
28
|
+
type: Text(20),
|
|
29
|
+
integrity: Text(200).optional(),
|
|
30
|
+
downloadSize: Size,
|
|
31
|
+
installedSize: Size,
|
|
32
|
+
modules: z.array(SubModule).max(200).default([]),
|
|
33
|
+
}))
|
|
34
|
+
.min(1)
|
|
35
|
+
.max(10),
|
|
36
|
+
}))
|
|
37
|
+
.max(10),
|
|
38
|
+
});
|
|
39
|
+
function flatten(m, depth = 0) {
|
|
40
|
+
if (depth > 3)
|
|
41
|
+
return [];
|
|
42
|
+
return (m.subModules ?? []).flatMap((s) => [s, ...flatten(s, depth + 1)]);
|
|
43
|
+
}
|
|
44
|
+
/** The first release an API answer holds (the EXE installer), or null when it holds none or has another shape. */
|
|
45
|
+
export function pickRelease(json) {
|
|
46
|
+
const parsed = ReleaseResponseSchema.safeParse(json);
|
|
47
|
+
if (!parsed.success)
|
|
48
|
+
return null;
|
|
49
|
+
const r = parsed.data.results[0];
|
|
50
|
+
const d = r?.downloads.find((x) => x.type.toUpperCase() === 'EXE') ?? r?.downloads[0];
|
|
51
|
+
if (!r || !d)
|
|
52
|
+
return null;
|
|
53
|
+
return {
|
|
54
|
+
version: r.version,
|
|
55
|
+
changeset: r.shortRevision,
|
|
56
|
+
editor: {
|
|
57
|
+
url: d.url,
|
|
58
|
+
integrity: d.integrity ?? null,
|
|
59
|
+
downloadBytes: d.downloadSize.value,
|
|
60
|
+
installedBytes: d.installedSize.value,
|
|
61
|
+
},
|
|
62
|
+
modules: d.modules.map((m) => {
|
|
63
|
+
const kids = flatten(m);
|
|
64
|
+
return {
|
|
65
|
+
id: m.id,
|
|
66
|
+
downloadBytes: m.downloadSize?.value ?? 0,
|
|
67
|
+
installedBytes: m.installedSize?.value ?? 0,
|
|
68
|
+
integrity: m.integrity ?? null,
|
|
69
|
+
children: kids.map((k) => k.id),
|
|
70
|
+
childDownloadBytes: kids.reduce((n, k) => n + (k.downloadSize?.value ?? 0), 0),
|
|
71
|
+
childInstalledBytes: kids.reduce((n, k) => n + (k.installedSize?.value ?? 0), 0),
|
|
72
|
+
};
|
|
73
|
+
}),
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/** Room an install needs: (editor download + installed + the chosen modules with their children) plus 10%. */
|
|
77
|
+
export function installNeedBytes(r, modules) {
|
|
78
|
+
let bytes = r.editor.downloadBytes + r.editor.installedBytes;
|
|
79
|
+
for (const m of r.modules)
|
|
80
|
+
if (modules.includes(m.id))
|
|
81
|
+
bytes += m.downloadBytes + m.installedBytes + m.childDownloadBytes + m.childInstalledBytes;
|
|
82
|
+
return Math.ceil(bytes * MARGIN);
|
|
83
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** The file in tools\unity. */
|
|
3
|
+
export declare const UNITY_STATUS_FILE = "status.json";
|
|
4
|
+
export declare const UnityStatusSchema: z.ZodObject<{
|
|
5
|
+
updatedAt: z.ZodString;
|
|
6
|
+
cli: z.ZodNullable<z.ZodObject<{
|
|
7
|
+
version: z.ZodString;
|
|
8
|
+
path: z.ZodString;
|
|
9
|
+
}, z.core.$strip>>;
|
|
10
|
+
editors: z.ZodArray<z.ZodObject<{
|
|
11
|
+
version: z.ZodString;
|
|
12
|
+
root: z.ZodString;
|
|
13
|
+
origin: z.ZodEnum<{
|
|
14
|
+
pc: "pc";
|
|
15
|
+
data: "data";
|
|
16
|
+
}>;
|
|
17
|
+
writable: z.ZodBoolean;
|
|
18
|
+
modules: z.ZodArray<z.ZodString>;
|
|
19
|
+
sizeBytes: z.ZodNullable<z.ZodNumber>;
|
|
20
|
+
}, z.core.$strip>>;
|
|
21
|
+
projects: z.ZodArray<z.ZodObject<{
|
|
22
|
+
workspace: z.ZodString;
|
|
23
|
+
version: z.ZodNullable<z.ZodString>;
|
|
24
|
+
editor: z.ZodNullable<z.ZodString>;
|
|
25
|
+
reason: z.ZodString;
|
|
26
|
+
bridge: z.ZodNullable<z.ZodEnum<{
|
|
27
|
+
pipeline: "pipeline";
|
|
28
|
+
coplay: "coplay";
|
|
29
|
+
}>>;
|
|
30
|
+
}, z.core.$strip>>;
|
|
31
|
+
licence: z.ZodObject<{
|
|
32
|
+
state: z.ZodEnum<{
|
|
33
|
+
unknown: "unknown";
|
|
34
|
+
none: "none";
|
|
35
|
+
active: "active";
|
|
36
|
+
invalid: "invalid";
|
|
37
|
+
}>;
|
|
38
|
+
kind: z.ZodString;
|
|
39
|
+
detail: z.ZodString;
|
|
40
|
+
user: z.ZodNullable<z.ZodString>;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
assetCache: z.ZodObject<{
|
|
43
|
+
mode: z.ZodEnum<{
|
|
44
|
+
pc: "pc";
|
|
45
|
+
persisted: "persisted";
|
|
46
|
+
local: "local";
|
|
47
|
+
}>;
|
|
48
|
+
dir: z.ZodNullable<z.ZodString>;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
pcAssets: z.ZodArray<z.ZodString>;
|
|
51
|
+
hub: z.ZodObject<{
|
|
52
|
+
installed: z.ZodBoolean;
|
|
53
|
+
path: z.ZodNullable<z.ZodString>;
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
mcp: z.ZodNullable<z.ZodString>;
|
|
56
|
+
skills: z.ZodBoolean;
|
|
57
|
+
problem: z.ZodNullable<z.ZodString>;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
export type UnityStatus = z.infer<typeof UnityStatusSchema>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// What the sandbox last found for Unity (tools\unity\status.json): the CLI, the editors, which editor each project
|
|
2
|
+
// opens with, the licence, the Asset Store cache. The sandbox writes it; the Unity page on this PC reads it with this
|
|
3
|
+
// schema (bounded strings and lists) and prints its text through safeText.
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
/** The file in tools\unity. */
|
|
6
|
+
export const UNITY_STATUS_FILE = 'status.json';
|
|
7
|
+
const Text = (max = 400) => z.string().max(max);
|
|
8
|
+
export const UnityStatusSchema = z.object({
|
|
9
|
+
updatedAt: Text(40),
|
|
10
|
+
cli: z.object({ version: Text(40), path: Text() }).nullable(),
|
|
11
|
+
editors: z
|
|
12
|
+
.array(z.object({
|
|
13
|
+
version: Text(40),
|
|
14
|
+
root: Text(),
|
|
15
|
+
origin: z.enum(['pc', 'data']),
|
|
16
|
+
writable: z.boolean(),
|
|
17
|
+
modules: z.array(Text(60)).max(20),
|
|
18
|
+
sizeBytes: z.number().int().min(0).nullable(),
|
|
19
|
+
}))
|
|
20
|
+
.max(32),
|
|
21
|
+
projects: z
|
|
22
|
+
.array(z.object({
|
|
23
|
+
workspace: Text(),
|
|
24
|
+
/** The version its ProjectVersion.txt asks for. */
|
|
25
|
+
version: Text(40).nullable(),
|
|
26
|
+
/** The root of the editor it opens with, null when there is none for it. */
|
|
27
|
+
editor: Text().nullable(),
|
|
28
|
+
reason: Text(),
|
|
29
|
+
bridge: z.enum(['pipeline', 'coplay']).nullable(),
|
|
30
|
+
}))
|
|
31
|
+
.max(64),
|
|
32
|
+
licence: z.object({
|
|
33
|
+
state: z.enum(['active', 'none', 'invalid', 'unknown']),
|
|
34
|
+
kind: Text(60),
|
|
35
|
+
detail: Text(),
|
|
36
|
+
user: Text(256).nullable(),
|
|
37
|
+
}),
|
|
38
|
+
assetCache: z.object({ mode: z.enum(['persisted', 'pc', 'local']), dir: Text().nullable() }),
|
|
39
|
+
pcAssets: z.array(Text()).max(4),
|
|
40
|
+
hub: z.object({ installed: z.boolean(), path: Text().nullable() }),
|
|
41
|
+
/** The MCP server's name when it was registered. */
|
|
42
|
+
mcp: Text(100).nullable(),
|
|
43
|
+
skills: z.boolean(),
|
|
44
|
+
problem: Text(600).nullable(),
|
|
45
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare const UNITY_VERSION: RegExp;
|
|
2
|
+
/** A changeset (short revision) as Unity prints it. */
|
|
3
|
+
export declare const UNITY_CHANGESET: RegExp;
|
|
4
|
+
export interface UnityVersion {
|
|
5
|
+
readonly major: number;
|
|
6
|
+
readonly minor: number;
|
|
7
|
+
readonly patch: number;
|
|
8
|
+
/** a (alpha), b (beta), f (final), p (patch). */
|
|
9
|
+
readonly stage: 'a' | 'b' | 'f' | 'p';
|
|
10
|
+
readonly build: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function parseUnityVersion(text: string): UnityVersion | null;
|
|
13
|
+
/** Negative when a is older than b, 0 when equal; an unreadable version sorts first. */
|
|
14
|
+
export declare function compareUnityVersions(a: string, b: string): number;
|
|
15
|
+
export interface ProjectVersion {
|
|
16
|
+
readonly version: string;
|
|
17
|
+
readonly changeset: string | null;
|
|
18
|
+
}
|
|
19
|
+
/** The editor a ProjectVersion.txt asks for: m_EditorVersion, and the changeset of m_EditorVersionWithRevision. */
|
|
20
|
+
export declare function parseProjectVersion(text: string): ProjectVersion | null;
|
|
21
|
+
/**
|
|
22
|
+
* The editor to open a project with: its own ProjectVersion.txt always wins (another version upgrades its files); the
|
|
23
|
+
* setting's version ("project" or e.g. "6000.0.32f1") is only for folders without one.
|
|
24
|
+
*/
|
|
25
|
+
export declare function wantedVersion(projectFile: string | null, setting: string): ProjectVersion | null;
|
|
26
|
+
/** The Unity Pipeline package (and so `unity command` / `unity eval`) needs Unity 6 or later. */
|
|
27
|
+
export declare function supportsPipeline(version: string): boolean;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// Unity editor versions ("6000.0.58f2") and the ProjectSettings/ProjectVersion.txt that names one. Pure; the text read
|
|
2
|
+
// from a project is bounded (the first 50 lines of at most 64 KB).
|
|
3
|
+
export const UNITY_VERSION = /^(\d{1,4})\.(\d{1,3})\.(\d{1,3})([abfp])(\d{1,3})$/;
|
|
4
|
+
/** A changeset (short revision) as Unity prints it. */
|
|
5
|
+
export const UNITY_CHANGESET = /^[0-9a-f]{12}$/;
|
|
6
|
+
const MAX_PROJECT_VERSION_BYTES = 64 * 1024;
|
|
7
|
+
const MAX_PROJECT_VERSION_LINES = 50;
|
|
8
|
+
const STAGES = 'abfp';
|
|
9
|
+
export function parseUnityVersion(text) {
|
|
10
|
+
const m = UNITY_VERSION.exec(text);
|
|
11
|
+
if (!m)
|
|
12
|
+
return null;
|
|
13
|
+
return {
|
|
14
|
+
major: Number(m[1]),
|
|
15
|
+
minor: Number(m[2]),
|
|
16
|
+
patch: Number(m[3]),
|
|
17
|
+
stage: m[4],
|
|
18
|
+
build: Number(m[5]),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/** Negative when a is older than b, 0 when equal; an unreadable version sorts first. */
|
|
22
|
+
export function compareUnityVersions(a, b) {
|
|
23
|
+
const x = parseUnityVersion(a);
|
|
24
|
+
const y = parseUnityVersion(b);
|
|
25
|
+
if (!x || !y)
|
|
26
|
+
return x ? 1 : y ? -1 : a.localeCompare(b);
|
|
27
|
+
return (x.major - y.major ||
|
|
28
|
+
x.minor - y.minor ||
|
|
29
|
+
x.patch - y.patch ||
|
|
30
|
+
STAGES.indexOf(x.stage) - STAGES.indexOf(y.stage) ||
|
|
31
|
+
x.build - y.build);
|
|
32
|
+
}
|
|
33
|
+
/** The editor a ProjectVersion.txt asks for: m_EditorVersion, and the changeset of m_EditorVersionWithRevision. */
|
|
34
|
+
export function parseProjectVersion(text) {
|
|
35
|
+
let version = null;
|
|
36
|
+
let changeset = null;
|
|
37
|
+
const lines = text.slice(0, MAX_PROJECT_VERSION_BYTES).split('\n', MAX_PROJECT_VERSION_LINES);
|
|
38
|
+
for (const raw of lines) {
|
|
39
|
+
const line = raw.replace(/^\uFEFF/, '').trim();
|
|
40
|
+
if (line.startsWith('m_EditorVersionWithRevision:')) {
|
|
41
|
+
const rest = line.slice('m_EditorVersionWithRevision:'.length).trim();
|
|
42
|
+
const open = rest.indexOf('(');
|
|
43
|
+
const close = rest.indexOf(')', open);
|
|
44
|
+
const v = (open < 0 ? rest : rest.slice(0, open)).trim();
|
|
45
|
+
if (UNITY_VERSION.test(v))
|
|
46
|
+
version ??= v;
|
|
47
|
+
if (open >= 0 && close > open) {
|
|
48
|
+
const cs = rest.slice(open + 1, close).trim();
|
|
49
|
+
if (UNITY_CHANGESET.test(cs))
|
|
50
|
+
changeset = cs;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
else if (line.startsWith('m_EditorVersion:')) {
|
|
54
|
+
const v = line.slice('m_EditorVersion:'.length).trim();
|
|
55
|
+
if (UNITY_VERSION.test(v))
|
|
56
|
+
version = v;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return version ? { version, changeset } : null;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The editor to open a project with: its own ProjectVersion.txt always wins (another version upgrades its files); the
|
|
63
|
+
* setting's version ("project" or e.g. "6000.0.32f1") is only for folders without one.
|
|
64
|
+
*/
|
|
65
|
+
export function wantedVersion(projectFile, setting) {
|
|
66
|
+
const own = projectFile === null ? null : parseProjectVersion(projectFile);
|
|
67
|
+
if (own)
|
|
68
|
+
return own;
|
|
69
|
+
return setting !== 'project' && UNITY_VERSION.test(setting) ? { version: setting, changeset: null } : null;
|
|
70
|
+
}
|
|
71
|
+
/** The Unity Pipeline package (and so `unity command` / `unity eval`) needs Unity 6 or later. */
|
|
72
|
+
export function supportsPipeline(version) {
|
|
73
|
+
const v = parseUnityVersion(version);
|
|
74
|
+
return v !== null && v.major >= 6000;
|
|
75
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/** Where an engine came from, which decides whether it is writable and how it is listed. */
|
|
2
|
+
export type EngineOrigin =
|
|
3
|
+
/** Installed on this PC, mapped read-only under C:\PcInstalls\unreal (pcInstalls.unrealEngines). */
|
|
4
|
+
'pc'
|
|
5
|
+
/** A folder of this PC you registered (pcInstalls.unrealEngineFolders), mapped writable. */
|
|
6
|
+
| 'pc-folder'
|
|
7
|
+
/** Installed by the Epic Games Launcher in a sandbox, in tools\unreal\engines on the data disk. */
|
|
8
|
+
| 'launcher'
|
|
9
|
+
/** Another engine folder in tools\unreal\engines (a source build or a copy). */
|
|
10
|
+
| 'data'
|
|
11
|
+
/** A source build found in a project root (C:\Projects\<root>\<folder>). */
|
|
12
|
+
| 'project';
|
|
13
|
+
export declare const ORIGIN_LABELS: Readonly<Record<EngineOrigin, string>>;
|
|
14
|
+
export interface BuildVersion {
|
|
15
|
+
readonly major: number;
|
|
16
|
+
readonly minor: number;
|
|
17
|
+
readonly patch: number;
|
|
18
|
+
readonly changelist: number;
|
|
19
|
+
readonly branch: string;
|
|
20
|
+
}
|
|
21
|
+
/** One engine the sandbox knows. */
|
|
22
|
+
export interface UnrealEngine {
|
|
23
|
+
/** UE_5.4 for an installed build; the source build's registered name (a GUID or a plain name). */
|
|
24
|
+
readonly id: string;
|
|
25
|
+
/** The engine's folder (holds Engine\Build\Build.version). */
|
|
26
|
+
readonly dir: string;
|
|
27
|
+
readonly version: BuildVersion;
|
|
28
|
+
/** "installed": a launcher or installed build (InstalledBuild.txt); "source": built from the engine's source. */
|
|
29
|
+
readonly build: 'installed' | 'source';
|
|
30
|
+
readonly origin: EngineOrigin;
|
|
31
|
+
readonly writable: boolean;
|
|
32
|
+
}
|
|
33
|
+
/** How engine files are read: bounded reads, folder lists, existence. */
|
|
34
|
+
export interface EngineFs {
|
|
35
|
+
exists(file: string): boolean;
|
|
36
|
+
/** At most `max` bytes, null when it is missing, too big or not a file. */
|
|
37
|
+
read(file: string, max: number): Buffer | null;
|
|
38
|
+
/** The names in a folder ([] when it is not one). */
|
|
39
|
+
list(dir: string): string[];
|
|
40
|
+
}
|
|
41
|
+
/** Engine\Build\Build.version: the version of an engine folder, or null when the text is not one. */
|
|
42
|
+
export declare function parseBuildVersion(text: string): BuildVersion | null;
|
|
43
|
+
/** "5.4": the name the launcher and the registry give an engine version. */
|
|
44
|
+
export declare const majorMinor: (v: BuildVersion) => string;
|
|
45
|
+
/** "5.4.4": the full version for people. */
|
|
46
|
+
export declare const versionText: (v: BuildVersion) => string;
|
|
47
|
+
/** "UE_5.4": the launcher's app name (and the folder it installs into). */
|
|
48
|
+
export declare const launcherAppName: (v: BuildVersion) => string;
|
|
49
|
+
export declare function compareVersions(a: BuildVersion, b: BuildVersion): number;
|
|
50
|
+
/** Engine\Build\Build.version of a folder, or null when it is not an engine. */
|
|
51
|
+
export declare function readEngineVersion(dir: string, fs: EngineFs): BuildVersion | null;
|
|
52
|
+
/** Whether an engine folder is an installed build (what the launcher installs): Engine\Build\InstalledBuild.txt. */
|
|
53
|
+
export declare function isInstalledBuild(dir: string, fs: EngineFs): boolean;
|
|
54
|
+
/** Whether a name can be a source build's registered name (UnrealVersionSelector writes a {GUID}). */
|
|
55
|
+
export declare const isBuildId: (id: string) => boolean;
|
|
56
|
+
/**
|
|
57
|
+
* A source build's registered name when it has none of its own: a GUID made from its folder, so it is the same every
|
|
58
|
+
* boot and a project that was switched to it keeps finding it.
|
|
59
|
+
*/
|
|
60
|
+
export declare function stableBuildId(dir: string): string;
|
|
61
|
+
/** The engine in a folder, or null when it is not one. `id`: a source build's registered name (else one is made). */
|
|
62
|
+
export declare function engineAt(dir: string, origin: EngineOrigin, writable: boolean, fs: EngineFs, id?: string): UnrealEngine | null;
|
|
63
|
+
/** What the guest knows of this PC's engines (session.json's pcInstalls items of kind "unreal"). */
|
|
64
|
+
export interface MappedEngine {
|
|
65
|
+
readonly guest: string;
|
|
66
|
+
readonly id: string;
|
|
67
|
+
/** A registered folder of this PC: mapped writable. */
|
|
68
|
+
readonly writable?: boolean;
|
|
69
|
+
/** A source build's registered name on this PC (HKCU ... Builds), kept so the project's association still matches. */
|
|
70
|
+
readonly buildId?: string;
|
|
71
|
+
}
|
|
72
|
+
export interface EngineSources {
|
|
73
|
+
/** Engines of this PC mapped into the sandbox. */
|
|
74
|
+
readonly mapped: readonly MappedEngine[];
|
|
75
|
+
/** tools\unreal\engines on the data disk. */
|
|
76
|
+
readonly enginesRoot: string;
|
|
77
|
+
/** The folders of the engines the launcher installed there (from its saved manifests). */
|
|
78
|
+
readonly launcherDirs: readonly string[];
|
|
79
|
+
/** Project roots in the sandbox (C:\Projects\<root>): their folders are looked at for source builds. */
|
|
80
|
+
readonly projectRoots: readonly string[];
|
|
81
|
+
}
|
|
82
|
+
/** At most this many engines are used. */
|
|
83
|
+
export declare const MAX_ENGINES = 16;
|
|
84
|
+
/** Every engine the sandbox can use, in a fixed order (this PC's, the data disk's, the project roots'), once each. */
|
|
85
|
+
export declare function findEngines(s: EngineSources, fs: EngineFs): UnrealEngine[];
|
|
86
|
+
export type EngineAssociation = {
|
|
87
|
+
readonly kind: 'none';
|
|
88
|
+
} | {
|
|
89
|
+
readonly kind: 'version';
|
|
90
|
+
readonly version: string;
|
|
91
|
+
} | {
|
|
92
|
+
readonly kind: 'build';
|
|
93
|
+
readonly id: string;
|
|
94
|
+
};
|
|
95
|
+
/** What a .uproject's EngineAssociation names: "5.4" (an installed build), "{GUID}" or a name (a source build). */
|
|
96
|
+
export declare function parseEngineAssociation(value: unknown): EngineAssociation;
|
|
97
|
+
/** The EngineAssociation of a .uproject's text (null when it is not JSON). */
|
|
98
|
+
export declare function uprojectAssociation(text: string): EngineAssociation | null;
|
|
99
|
+
/** A project's .uproject: in its folder, else one folder down (the first by name), or null. */
|
|
100
|
+
export declare function findUproject(workspace: string, fs: EngineFs): string | null;
|
|
101
|
+
export interface EngineChoice {
|
|
102
|
+
readonly engine: UnrealEngine | null;
|
|
103
|
+
/** Why this one, in plain words (or why none). */
|
|
104
|
+
readonly reason: string;
|
|
105
|
+
/** The name the project gave a source build that is not registered here by that name: register it for this engine. */
|
|
106
|
+
readonly alias?: string;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The engine a project builds with: the one its EngineAssociation names (a version: a writable one before this PC's
|
|
110
|
+
* read-only one; a build: that registered build), else the newest. Null when the project names one that is not here.
|
|
111
|
+
*/
|
|
112
|
+
export declare function chooseEngine(engines: readonly UnrealEngine[], association: EngineAssociation): EngineChoice;
|
|
113
|
+
/** One registry value the sandbox writes (string values only). */
|
|
114
|
+
export interface RegistryValue {
|
|
115
|
+
readonly hive: 'HKLM' | 'HKCU';
|
|
116
|
+
readonly key: string;
|
|
117
|
+
/** '' is the default value. */
|
|
118
|
+
readonly name: string;
|
|
119
|
+
readonly value: string;
|
|
120
|
+
}
|
|
121
|
+
/** Installed builds: where an installer records them (UnrealVersionSelector and the editor read it). */
|
|
122
|
+
export declare const INSTALLED_KEY = "SOFTWARE\\EpicGames\\Unreal Engine";
|
|
123
|
+
/** Source builds: UnrealVersionSelector's list (name = the build's id, value = its folder). */
|
|
124
|
+
export declare const BUILDS_KEY = "Software\\Epic Games\\Unreal Engine\\Builds";
|
|
125
|
+
/**
|
|
126
|
+
* The installed build of each version that the editor and UnrealVersionSelector use: one per major.minor, chosen the
|
|
127
|
+
* way chooseEngine chooses (writable before read-only, then the newest).
|
|
128
|
+
*/
|
|
129
|
+
export declare function preferredInstalled(engines: readonly UnrealEngine[]): UnrealEngine[];
|
|
130
|
+
/**
|
|
131
|
+
* The registry values that make Unreal find the engines: an installed build as HKLM\SOFTWARE\EpicGames\Unreal
|
|
132
|
+
* Engine\<5.4> InstalledDirectory (one per version: the one a project would pick), a source build as a value under
|
|
133
|
+
* HKCU\Software\Epic Games\Unreal Engine\Builds. `aliases`: names a project uses for a source build here (its GUID on
|
|
134
|
+
* this PC), registered for the folder they stand for, so the .uproject works unchanged.
|
|
135
|
+
*/
|
|
136
|
+
export declare function registryPlan(engines: readonly UnrealEngine[], aliases?: readonly {
|
|
137
|
+
readonly id: string;
|
|
138
|
+
readonly dir: string;
|
|
139
|
+
}[]): RegistryValue[];
|
|
140
|
+
/** UnrealVersionSelector inside an engine (it opens, switches and generates project files for .uproject files). */
|
|
141
|
+
export declare function versionSelectorIn(dir: string): string;
|
|
142
|
+
/**
|
|
143
|
+
* The .uproject file association UnrealVersionSelector /fileassociations writes (per user): open in the editor, launch
|
|
144
|
+
* the game, generate Visual Studio project files, switch the engine version.
|
|
145
|
+
*/
|
|
146
|
+
export declare function fileAssociationPlan(selector: string): RegistryValue[];
|
|
147
|
+
/** The folders of an engine an agent runs its tools from (those that exist), in PATH order. */
|
|
148
|
+
export declare function engineToolDirs(dir: string, fs: Pick<EngineFs, 'exists'>): string[];
|
|
149
|
+
/** The engine folders put at the END of PATH: they hold many DLLs, which every program started from PATH would load. */
|
|
150
|
+
export declare function engineExtraDirs(dir: string, fs: Pick<EngineFs, 'exists'>): string[];
|
|
151
|
+
/** Variables for the project's engine: UE_ROOT (the engine folder) and UE_ENGINE_DIR (its Engine folder). */
|
|
152
|
+
export declare function engineVars(engine: UnrealEngine): Record<string, string>;
|
|
153
|
+
/**
|
|
154
|
+
* The derived data cache: UE-LocalDataCachePath moves the local cache (and from 5.4 the Zen store, in its Zen
|
|
155
|
+
* subfolder) out of the engine and off the sandbox's disk. "local" leaves Unreal's own place (the sandbox's disk).
|
|
156
|
+
*/
|
|
157
|
+
export declare function ddcVars(mode: 'persisted' | 'local', ddcDir: string): Record<string, string>;
|
|
158
|
+
/** The editor's MCP server (Unreal 5.8's ModelContextProtocol plugin): its default address. */
|
|
159
|
+
export declare const UNREAL_MCP_URL = "http://127.0.0.1:8000/mcp";
|
|
160
|
+
/** Whether an engine ships the ModelContextProtocol plugin (5.8 and later). */
|
|
161
|
+
export declare function hasMcpPlugin(engine: UnrealEngine, fs: Pick<EngineFs, 'exists'>): boolean;
|