@aeonsparx/pi-unreal 0.0.0-stage → 1.0.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/LICENSE +21 -0
- package/README.md +202 -2
- package/docs/internals.md +184 -0
- package/extensions/unreal/index.ts +682 -0
- package/extensions/unreal/lib/cache.ts +190 -0
- package/extensions/unreal/lib/compiledb.ts +491 -0
- package/extensions/unreal/lib/descriptors.ts +631 -0
- package/extensions/unreal/lib/engine-resolver.ts +443 -0
- package/extensions/unreal/lib/pi-tools.ts +402 -0
- package/extensions/unreal/lib/plugin-resolver.ts +305 -0
- package/extensions/unreal/lib/query.ts +272 -0
- package/extensions/unreal/lib/registry.ts +208 -0
- package/extensions/unreal/lib/scan.ts +510 -0
- package/extensions/unreal/lib/store.ts +900 -0
- package/extensions/unreal/lib/tools.ts +614 -0
- package/extensions/unreal/lib/ubt.ts +373 -0
- package/extensions/unreal/lib/util.ts +210 -0
- package/package.json +59 -4
- package/prompts/unreal-context.md +26 -0
- package/skills/ue-engine-resolution/SKILL.md +96 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ue-engine-resolution
|
|
3
|
+
description: Resolve which Unreal Engine installation a .uproject actually uses, and read .uproject/.uplugin facts from engine-authored schemas. Use when an engine path, version, plugin availability, or descriptor field must be established as fact, before UE builds, plugin edits, or any "which engine version is this?" question.
|
|
4
|
+
compatibility: Windows-first (registry via pwsh); resolver core is platform-neutral.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Unreal Engine resolution
|
|
8
|
+
|
|
9
|
+
Never infer an engine root from a directory name, a `UE_*` folder, or an environment variable alone.
|
|
10
|
+
Resolve it, then quote the resolved value.
|
|
11
|
+
|
|
12
|
+
## Order of truth
|
|
13
|
+
|
|
14
|
+
1. Run `unreal_resolve_engine` (or `/unreal`) first. It reports `engineRoot`, `identifier`,
|
|
15
|
+
`Build.version`, source rank, and — on failure — the rejected candidates with reasons.
|
|
16
|
+
2. Only after a resolution exists should a build command, a `.Build.cs` read, or an
|
|
17
|
+
engine-source lookup name a concrete engine path.
|
|
18
|
+
|
|
19
|
+
Resolution mirrors the engine's own algorithm
|
|
20
|
+
(`Engine/Source/Developer/DesktopPlatform/Private/DesktopPlatformBase.cpp:459-511`, UE 5.8):
|
|
21
|
+
|
|
22
|
+
| Association in `.uproject` | Meaning | Engine source of truth |
|
|
23
|
+
| --- | --- | --- |
|
|
24
|
+
| `5.8` | installed (Launcher) build | `HKLM:\SOFTWARE\EpicGames\Unreal Engine\5.8` → `InstalledDirectory`, plus `<installDirDefault>\UE_5.8` |
|
|
25
|
+
| `{GUID}` | source build | `HKCU:\SOFTWARE\Epic Games\Unreal Engine\Builds` → root path |
|
|
26
|
+
| engine-root **path** | explicit pin, bypasses registration | validated as `<root>/Engine/Binaries` + `<root>/Engine/Build` |
|
|
27
|
+
| **empty** | project is inside an engine tree | walk up 12 levels for `Engine/Config/BaseEngine.ini` |
|
|
28
|
+
|
|
29
|
+
An association that matches more than one valid root is reported **ambiguous** — the engine
|
|
30
|
+
refuses to pick, so neither should the agent. Pass `engineRootHint` to disambiguate.
|
|
31
|
+
|
|
32
|
+
## Machine-local facts that are not inferable
|
|
33
|
+
|
|
34
|
+
- `HKLM` registers UE 4.0 … 5.7. **UE 5.8 has no registry key**: it is found by scanning
|
|
35
|
+
`C:/Program Files/Epic Games` for `UE_*`, or by `$env:UNREAL_ENGINE`, which points at it.
|
|
36
|
+
- 5.5 and 5.6 registry entries point at directories that do not exist. A registry hit is a
|
|
37
|
+
**candidate**, never a conclusion — every candidate is validated
|
|
38
|
+
(`Engine/Binaries` + `Engine/Build` + `Engine/Build/Build.version` major.minor match)
|
|
39
|
+
before it can be reported.
|
|
40
|
+
- `D:/UnrealEngine/Source` is a source build (5.7.4) registered under a GUID in `HKCU`.
|
|
41
|
+
|
|
42
|
+
## Descriptor fields: read them from the parser, not from memory
|
|
43
|
+
|
|
44
|
+
Field names, host types, and loading phases come from the engine's own serializers, not from
|
|
45
|
+
blog posts. `unreal_project_inspect` / `unreal_plugin_inspect` report the engine's names:
|
|
46
|
+
|
|
47
|
+
- `.uproject` → `Engine/Source/Runtime/Projects/Private/ProjectDescriptor.cpp:100-225`
|
|
48
|
+
- `.uplugin` → `Engine/Source/Runtime/Projects/Private/PluginDescriptor.cpp:263-409`
|
|
49
|
+
- module entries → `Engine/Source/Runtime/Projects/Private/ModuleDescriptor.cpp`
|
|
50
|
+
(`Type` is **required**; `EHostType::FromString` → `Max` → descriptor load fails)
|
|
51
|
+
- plugin references → `Engine/Source/Runtime/Projects/Private/PluginReferenceDescriptor.cpp:130-180`
|
|
52
|
+
(`Enabled` is **required**; a reference without it is rejected)
|
|
53
|
+
|
|
54
|
+
Host types (`EHostType::ToString`) and phases (`ELoadingPhase`) are enumerated by the parser;
|
|
55
|
+
an unrecognized value is reported with the engine's own failure text. Do not "fix" a descriptor
|
|
56
|
+
by inventing a key name — fix it to the key the engine reads.
|
|
57
|
+
|
|
58
|
+
`.uplugin` has **no** `Enabled` key. Enablement is `EnabledByDefault`
|
|
59
|
+
(`PluginManager.cpp:421-431`) plus the project's `"Enabled": true` reference.
|
|
60
|
+
|
|
61
|
+
## Plugin availability
|
|
62
|
+
|
|
63
|
+
`unreal_project_inspect` resolves every reference against an index built in
|
|
64
|
+
UnrealBuildTool's discovery order (`Engine/Source/Programs/UnrealBuildTool/System/Plugins.cs:322`):
|
|
65
|
+
Engine → Project (`Plugins/`) → Mod (`Mods/`) → `AdditionalPluginDirectories`, with later scans
|
|
66
|
+
shadowing earlier ones on name collision. Use the reported status (`resolved`, `missing`,
|
|
67
|
+
`disabled`, `version-warning`, `shadowed`, `no-modules`) instead of assuming a plugin is
|
|
68
|
+
available. `Binaries/`, `Intermediate/`, `Saved/`, and `ThirdParty/` are never scanned.
|
|
69
|
+
|
|
70
|
+
## After resolution: where declarations and build context come from
|
|
71
|
+
|
|
72
|
+
`unreal_resolve_engine` answers *which engine*. The rest of the navigation questions are answered
|
|
73
|
+
by the index tools, and they use the resolved root — a wrong engine root means a wrong index:
|
|
74
|
+
|
|
75
|
+
- `unreal_symbol` — declaration site + owning module for a type, function, `UPROPERTY`, delegate.
|
|
76
|
+
Engine scope is opt-in (`scope: "engine"`) and its areas come from
|
|
77
|
+
`PublicDependencyModuleNames` in the modules under `Engine/Source/<area>`, so the scan follows
|
|
78
|
+
what the project actually depends on.
|
|
79
|
+
- `unreal_context` — include paths, C++ standard, compiler, the real `WITH_*` defines read from
|
|
80
|
+
`Definitions.<Module>.h`, and the module's public/private dependency lists.
|
|
81
|
+
- `unreal_index` — build/refresh/patch/status, `moduleRefs` for the dependency graph, and the
|
|
82
|
+
UnrealBuildTool `-Mode=Query` cache underneath.
|
|
83
|
+
|
|
84
|
+
No compiler, no IDE database, nothing written inside the project: the index lives in
|
|
85
|
+
`~/.pi/agent/unreal-cache` (`$PI_UNREAL_CACHE_DIR`). clangd stays the authority for references,
|
|
86
|
+
overrides, and diagnostics — see `ue-symbol-navigation` in a UE project's `.agents/skills/`.
|
|
87
|
+
|
|
88
|
+
## Conventions this package enforces
|
|
89
|
+
|
|
90
|
+
- `.uasset` and `.umap` are cooked binary — author them in the running editor, never by editing
|
|
91
|
+
bytes. The gate blocks such writes.
|
|
92
|
+
- Newly compiled C++ does not load into a running editor: close the editor, then build with
|
|
93
|
+
`UnrealEngine-BuildProjectEditor`. The gate warns when `UnrealEditor*` is running during a C++ edit.
|
|
94
|
+
- Never run `clang-format` on `*.cs`: it applies the C# language rule and can empty the file
|
|
95
|
+
(verified on `Source/Lp.Target.cs`). The gate blocks such commands. Format C++ with
|
|
96
|
+
`Script/Dev/Format-Cpp.ps1`.
|