@forgeax/engine-devkit 0.1.2
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 +15 -0
- package/README.md +192 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/__tests__/archive.test.d.ts +2 -0
- package/dist/__tests__/archive.test.d.ts.map +1 -0
- package/dist/__tests__/assets.test.d.ts +2 -0
- package/dist/__tests__/assets.test.d.ts.map +1 -0
- package/dist/__tests__/bootstrap-commands.test.d.ts +2 -0
- package/dist/__tests__/bootstrap-commands.test.d.ts.map +1 -0
- package/dist/__tests__/dist.test.d.ts +2 -0
- package/dist/__tests__/dist.test.d.ts.map +1 -0
- package/dist/__tests__/host.test.d.ts +2 -0
- package/dist/__tests__/host.test.d.ts.map +1 -0
- package/dist/__tests__/init.test.d.ts +2 -0
- package/dist/__tests__/init.test.d.ts.map +1 -0
- package/dist/__tests__/plugin-authoring.test.d.ts +2 -0
- package/dist/__tests__/plugin-authoring.test.d.ts.map +1 -0
- package/dist/__tests__/project.test.d.ts +2 -0
- package/dist/__tests__/project.test.d.ts.map +1 -0
- package/dist/__tests__/rhi-debug-cold-start.integration.test.d.ts +2 -0
- package/dist/__tests__/rhi-debug-cold-start.integration.test.d.ts.map +1 -0
- package/dist/__tests__/rhi-debug-error-consumer.test-d.d.ts +2 -0
- package/dist/__tests__/rhi-debug-error-consumer.test-d.d.ts.map +1 -0
- package/dist/__tests__/rhi-debug-operations.test-d.d.ts +2 -0
- package/dist/__tests__/rhi-debug-operations.test-d.d.ts.map +1 -0
- package/dist/__tests__/rhi-debug-operations.unit.test.d.ts +2 -0
- package/dist/__tests__/rhi-debug-operations.unit.test.d.ts.map +1 -0
- package/dist/__tests__/sdk-install.test.d.ts +2 -0
- package/dist/__tests__/sdk-install.test.d.ts.map +1 -0
- package/dist/__tests__/skill-install.test.d.ts +2 -0
- package/dist/__tests__/skill-install.test.d.ts.map +1 -0
- package/dist/__tests__/tool-migration.test.d.ts +2 -0
- package/dist/__tests__/tool-migration.test.d.ts.map +1 -0
- package/dist/archive.d.ts +6 -0
- package/dist/archive.d.ts.map +1 -0
- package/dist/assets.d.ts +6 -0
- package/dist/assets.d.ts.map +1 -0
- package/dist/bootstrap-commands.d.ts +12 -0
- package/dist/bootstrap-commands.d.ts.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.mjs +4862 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/commands.d.ts +19 -0
- package/dist/commands.d.ts.map +1 -0
- package/dist/dist.d.ts +24 -0
- package/dist/dist.d.ts.map +1 -0
- package/dist/host/base-host.d.ts +18 -0
- package/dist/host/base-host.d.ts.map +1 -0
- package/dist/host/project-bootstrap.d.ts +11 -0
- package/dist/host/project-bootstrap.d.ts.map +1 -0
- package/dist/host/resource-bootstrap.d.ts +23 -0
- package/dist/host/resource-bootstrap.d.ts.map +1 -0
- package/dist/host.d.ts +13 -0
- package/dist/host.d.ts.map +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +5762 -0
- package/dist/index.mjs.map +1 -0
- package/dist/init.d.ts +20 -0
- package/dist/init.d.ts.map +1 -0
- package/dist/plugin-authoring.d.ts +4 -0
- package/dist/plugin-authoring.d.ts.map +1 -0
- package/dist/project.d.ts +5 -0
- package/dist/project.d.ts.map +1 -0
- package/dist/rhi-debug/cli-context.d.ts +3 -0
- package/dist/rhi-debug/cli-context.d.ts.map +1 -0
- package/dist/rhi-debug/operations.d.ts +83 -0
- package/dist/rhi-debug/operations.d.ts.map +1 -0
- package/dist/sdk-cli.d.ts +2 -0
- package/dist/sdk-cli.d.ts.map +1 -0
- package/dist/sdk-cli.mjs +5560 -0
- package/dist/sdk-cli.mjs.map +1 -0
- package/dist/sdk-install.d.ts +7 -0
- package/dist/sdk-install.d.ts.map +1 -0
- package/dist/sdk.d.ts +69 -0
- package/dist/sdk.d.ts.map +1 -0
- package/dist/shader-check.d.ts +3 -0
- package/dist/shader-check.d.ts.map +1 -0
- package/dist/skill-install.d.ts +16 -0
- package/dist/skill-install.d.ts.map +1 -0
- package/dist/tools/__tests__/browser-host-port.test.d.ts +2 -0
- package/dist/tools/__tests__/browser-host-port.test.d.ts.map +1 -0
- package/dist/tools/__tests__/carrier-faults.integration.test.d.ts +2 -0
- package/dist/tools/__tests__/carrier-faults.integration.test.d.ts.map +1 -0
- package/dist/tools/__tests__/carrier-provider.integration.test.d.ts +2 -0
- package/dist/tools/__tests__/carrier-provider.integration.test.d.ts.map +1 -0
- package/dist/tools/__tests__/commands.test.d.ts +2 -0
- package/dist/tools/__tests__/commands.test.d.ts.map +1 -0
- package/dist/tools/__tests__/coverage-gaps.test.d.ts +2 -0
- package/dist/tools/__tests__/coverage-gaps.test.d.ts.map +1 -0
- package/dist/tools/__tests__/domain-catalog.test.d.ts +2 -0
- package/dist/tools/__tests__/domain-catalog.test.d.ts.map +1 -0
- package/dist/tools/__tests__/preview-owner-gate.test.d.ts +2 -0
- package/dist/tools/__tests__/preview-owner-gate.test.d.ts.map +1 -0
- package/dist/tools/__tests__/preview-publication.test.d.ts +2 -0
- package/dist/tools/__tests__/preview-publication.test.d.ts.map +1 -0
- package/dist/tools/__tests__/realm-dispatch.integration.test.d.ts +2 -0
- package/dist/tools/__tests__/realm-dispatch.integration.test.d.ts.map +1 -0
- package/dist/tools/benchmark/__tests__/admission-fixtures.test.d.ts +2 -0
- package/dist/tools/benchmark/__tests__/admission-fixtures.test.d.ts.map +1 -0
- package/dist/tools/benchmark/harness.d.ts +17 -0
- package/dist/tools/benchmark/harness.d.ts.map +1 -0
- package/dist/tools/benchmark/index.d.ts +4 -0
- package/dist/tools/benchmark/index.d.ts.map +1 -0
- package/dist/tools/benchmark/report.d.ts +54 -0
- package/dist/tools/benchmark/report.d.ts.map +1 -0
- package/dist/tools/benchmark/statistics.d.ts +8 -0
- package/dist/tools/benchmark/statistics.d.ts.map +1 -0
- package/dist/tools/bootstrap.d.ts +49 -0
- package/dist/tools/bootstrap.d.ts.map +1 -0
- package/dist/tools/browser-host.d.ts +27 -0
- package/dist/tools/browser-host.d.ts.map +1 -0
- package/dist/tools/cache.d.ts +14 -0
- package/dist/tools/cache.d.ts.map +1 -0
- package/dist/tools/capability.d.ts +2 -0
- package/dist/tools/capability.d.ts.map +1 -0
- package/dist/tools/carrier-provider.d.ts +31 -0
- package/dist/tools/carrier-provider.d.ts.map +1 -0
- package/dist/tools/carrier-rendezvous.d.ts +16 -0
- package/dist/tools/carrier-rendezvous.d.ts.map +1 -0
- package/dist/tools/catalog.d.ts +66 -0
- package/dist/tools/catalog.d.ts.map +1 -0
- package/dist/tools/cli-adapter.d.ts +5 -0
- package/dist/tools/cli-adapter.d.ts.map +1 -0
- package/dist/tools/client.d.ts +18 -0
- package/dist/tools/client.d.ts.map +1 -0
- package/dist/tools/commands.d.ts +6 -0
- package/dist/tools/commands.d.ts.map +1 -0
- package/dist/tools/contributions.d.ts +6 -0
- package/dist/tools/contributions.d.ts.map +1 -0
- package/dist/tools/library.d.ts +3 -0
- package/dist/tools/library.d.ts.map +1 -0
- package/dist/tools/migration.d.ts +36 -0
- package/dist/tools/migration.d.ts.map +1 -0
- package/dist/tools/native-preview.d.ts +4 -0
- package/dist/tools/native-preview.d.ts.map +1 -0
- package/dist/tools/offline-analysis.d.ts +22 -0
- package/dist/tools/offline-analysis.d.ts.map +1 -0
- package/dist/tools/preview-catalog.d.ts +8 -0
- package/dist/tools/preview-catalog.d.ts.map +1 -0
- package/dist/tools/preview-contributions.d.ts +12 -0
- package/dist/tools/preview-contributions.d.ts.map +1 -0
- package/dist/tools/preview-host.d.ts +85 -0
- package/dist/tools/preview-host.d.ts.map +1 -0
- package/dist/tools/preview-migration.d.ts +4 -0
- package/dist/tools/preview-migration.d.ts.map +1 -0
- package/dist/tools/private-executor.d.ts +3 -0
- package/dist/tools/private-executor.d.ts.map +1 -0
- package/dist/tools/project-tools.d.ts +23 -0
- package/dist/tools/project-tools.d.ts.map +1 -0
- package/dist/tools/realms.d.ts +22 -0
- package/dist/tools/realms.d.ts.map +1 -0
- package/dist/tools/run-command.d.ts +17 -0
- package/dist/tools/run-command.d.ts.map +1 -0
- package/dist/tools/runtime.d.ts +5 -0
- package/dist/tools/runtime.d.ts.map +1 -0
- package/dist/tools/service-transport.d.ts +17 -0
- package/dist/tools/service-transport.d.ts.map +1 -0
- package/dist/tools/service.d.ts +22 -0
- package/dist/tools/service.d.ts.map +1 -0
- package/dist/types.d.ts +84 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +95 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Apache License 2.0
|
|
2
|
+
|
|
3
|
+
Copyright 2026 ForgeaXGame
|
|
4
|
+
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
|
|
9
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# @forgeax/engine-devkit
|
|
2
|
+
|
|
3
|
+
DevKit is the Node-only external-project seam for ForgeaX. It derives project
|
|
4
|
+
commands, authoring-preview contributions, and one AI-facing RHI-debug path from
|
|
5
|
+
the existing project authorities. It owns orchestration and file access; Engine
|
|
6
|
+
owns rendering, RHI events, replay backends, and preview execution.
|
|
7
|
+
|
|
8
|
+
> [!IMPORTANT]
|
|
9
|
+
> Keep one artifact reference across the RHI-debug flow. `rhi.summary` and
|
|
10
|
+
> `rhi.inspect` never rediscover a tape, infer a file pair, or parse error text.
|
|
11
|
+
|
|
12
|
+
## Navigation
|
|
13
|
+
|
|
14
|
+
- [CLI and catalog](#cli-and-catalog)
|
|
15
|
+
- [RHI-debug operations](#rhi-debug-operations)
|
|
16
|
+
- [Authoring preview](#authoring-preview)
|
|
17
|
+
- [Project authority](#project-authority)
|
|
18
|
+
- [Migration and carrier](#migration-and-carrier)
|
|
19
|
+
|
|
20
|
+
## CLI and catalog
|
|
21
|
+
|
|
22
|
+
The normal project commands remain available through the `forgeax` CLI:
|
|
23
|
+
|
|
24
|
+
```text
|
|
25
|
+
forgeax new [directory] [--template empty|game-default]
|
|
26
|
+
forgeax init
|
|
27
|
+
forgeax doctor
|
|
28
|
+
forgeax skill install
|
|
29
|
+
forgeax skill verify
|
|
30
|
+
forgeax test
|
|
31
|
+
forgeax dev
|
|
32
|
+
forgeax build
|
|
33
|
+
forgeax preview
|
|
34
|
+
forgeax package [--output release/game-web.zip]
|
|
35
|
+
forgeax list --json
|
|
36
|
+
forgeax describe project.build --json
|
|
37
|
+
forgeax run project.build --input request.json --json
|
|
38
|
+
forgeax exec program.mjs --json
|
|
39
|
+
forgeax run rhi.capture
|
|
40
|
+
forgeax run rhi.summary --artifact {ArtifactRef}
|
|
41
|
+
forgeax run rhi.inspect --artifact {ArtifactRef} --work-index {workIndex}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Static deployment is an Engine-owned build product. A publishing host supplies
|
|
45
|
+
the project root, public URL base, and dedicated output directory; DevKit owns
|
|
46
|
+
the generated host, asset cooking, shader compilation, Pack index, and
|
|
47
|
+
`forgeax-dist.json` closure.
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
forgeax build ./games/my-game \
|
|
51
|
+
--base /games/my-game/ \
|
|
52
|
+
--out-dir ./website-staging/games/my-game \
|
|
53
|
+
--json
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`--out-dir` resolves relative to the game project root unless it is absolute.
|
|
57
|
+
The selected directory is a derived build root and is emptied before writing.
|
|
58
|
+
`forgeax preview` continues to verify and serve the default `dist/` directory.
|
|
59
|
+
|
|
60
|
+
`forgeax new` accepts an absent or empty target only when that target is outside the unpacked SDK
|
|
61
|
+
root. An SDK-owned target fails before template copying with `project-target-inside-sdk`; use a
|
|
62
|
+
sibling directory or an absolute path outside the SDK.
|
|
63
|
+
|
|
64
|
+
`forgeax package` rebuilds with relative URLs, verifies the complete `forgeax-dist.json` closure,
|
|
65
|
+
and emits a deterministic Web ZIP plus an adjacent SHA-256 file. The archive contains the bundled
|
|
66
|
+
Engine JavaScript/WASM runtime and game assets at its root for HTTPS static or HTML-game hosting;
|
|
67
|
+
it does not contain source, `node_modules`, or a local development server. Use `forgeax preview`
|
|
68
|
+
for local HTTP acceptance. Opening the archived `index.html` through `file://` is unsupported.
|
|
69
|
+
|
|
70
|
+
`discoverRhiDebugOperations()` returns the same descriptors used by help and
|
|
71
|
+
schema output. The operation manifest is the single discovery and recovery
|
|
72
|
+
surface for RHI-debug.
|
|
73
|
+
|
|
74
|
+
Physical realm consumers use `createRealmDispatch`. Each descriptor is routed to
|
|
75
|
+
one owner for its declared `build`, `host`, or `engine` realm. A missing owner
|
|
76
|
+
returns `tool-capability-unavailable` with the realm in `detail`; it never falls
|
|
77
|
+
through to another realm.
|
|
78
|
+
|
|
79
|
+
## RHI-debug operations
|
|
80
|
+
|
|
81
|
+
```mermaid
|
|
82
|
+
sequenceDiagram
|
|
83
|
+
participant AI as "AI or CLI"
|
|
84
|
+
participant H as "Host"
|
|
85
|
+
participant D as "DevKit"
|
|
86
|
+
participant R as "Fresh replay backend"
|
|
87
|
+
AI->>H: "rhi.capture"
|
|
88
|
+
H-->>AI: "one ArtifactRef"
|
|
89
|
+
AI->>D: "rhi.summary + ArtifactRef"
|
|
90
|
+
D-->>AI: "FrameModel and workIndex"
|
|
91
|
+
AI->>R: "rhi.inspect + ArtifactRef + workIndex"
|
|
92
|
+
R-->>AI: "WorkInspection or structured failure"
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
| Operation | Input | Output | Owner |
|
|
96
|
+
|:--|:--|:--|:--|
|
|
97
|
+
| `rhi.capture` | Optional abort signal | One `ArtifactRef` plus capture bytes | Host and recorder attachment |
|
|
98
|
+
| `rhi.summary` | One `ArtifactRef` | Strict v7 tape decode and `FrameModel` | Protocol decoder and frame model |
|
|
99
|
+
| `rhi.inspect` | One `ArtifactRef`, one `workIndex`, optional fields | Fresh-backend `WorkInspection` | Replay session and readback matrix |
|
|
100
|
+
|
|
101
|
+
### ArtifactRef
|
|
102
|
+
|
|
103
|
+
`ArtifactRef` is the handoff SSOT:
|
|
104
|
+
|
|
105
|
+
| Field | Type | Meaning |
|
|
106
|
+
|:--|:--|:--|
|
|
107
|
+
| `kind` | `'rhi-tape'` | The only RHI-debug artifact kind. |
|
|
108
|
+
| `digest` | `string` | Digest of the canonical v7 tape payload. |
|
|
109
|
+
| `source` | `string` | Host or operation that produced the artifact. |
|
|
110
|
+
| `path` | `string` | Optional Node-side path owned by the host. |
|
|
111
|
+
| `bytes` | `Uint8Array` | Capture payload supplied at the host boundary. |
|
|
112
|
+
|
|
113
|
+
Consumers switch on `RhiDebugError.code`, then narrow `.detail`. `.expected`
|
|
114
|
+
and `.hint` provide the next action without message parsing. Unknown operation
|
|
115
|
+
names, fields, artifact kinds, and tape versions fail at the boundary.
|
|
116
|
+
|
|
117
|
+
## Authoring preview
|
|
118
|
+
|
|
119
|
+
Preview defaults to four explicit Engine-owned domain descriptors:
|
|
120
|
+
`material.preview`, `mesh.preview`, `vfx.preview`, and `texture.preview`.
|
|
121
|
+
Each follows the same `list -> describe -> run -> terminal` path and binds its
|
|
122
|
+
report and evidence to the requested subject and snapshot.
|
|
123
|
+
|
|
124
|
+
```mermaid
|
|
125
|
+
flowchart LR
|
|
126
|
+
catalog["Digest-bound catalog"] --> descriptor["Domain descriptor"]
|
|
127
|
+
descriptor --> owner["Engine realm owner"]
|
|
128
|
+
owner --> terminal["One terminal result"]
|
|
129
|
+
terminal --> evidence["PNG, RHI tape, and profile refs"]
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
The generic `asset.preview` and `preview.run` shapes are not discoverable. A
|
|
133
|
+
private legacy proof helper may remain for migration tests, but it cannot appear
|
|
134
|
+
in the default catalog or act as a second domain owner. Browser and Dawn
|
|
135
|
+
consumers must verify subject pixels and structured evidence; DOM liveness and
|
|
136
|
+
RhiNull readiness are not visual proof.
|
|
137
|
+
|
|
138
|
+
## Project authority
|
|
139
|
+
|
|
140
|
+
Game projects keep authority in `forge.json`, package manifests,
|
|
141
|
+
`package.json#forgeax.assets`, source Meta/Pack files, and imported game code.
|
|
142
|
+
DevKit derives Vite and producer assembly from those facts.
|
|
143
|
+
|
|
144
|
+
`forge.json#entry` is the required game bootstrap authority. When that module
|
|
145
|
+
is not also named by `forge.json.plugins[]`, DevKit adapts its named
|
|
146
|
+
`bootstrap(world, gameHost)` export into the native plugin lifecycle after the
|
|
147
|
+
declared project plugins are ready. Plugin install/uninstall updates
|
|
148
|
+
`forge.json.plugins[]`; a dependency failure restores the original manifest.
|
|
149
|
+
The next dev/build generation deterministically adds or removes the literal
|
|
150
|
+
Catalog import and production bundle reachability.
|
|
151
|
+
|
|
152
|
+
SDK-created games keep all Engine usage skills as ordinary, committable files
|
|
153
|
+
under root `skills/`. `skill install` idempotently projects those files into the
|
|
154
|
+
supported Agent discovery roots with relative symlinks and narrow managed
|
|
155
|
+
`.gitignore` blocks. `skill verify` checks the source inventory, local manifest,
|
|
156
|
+
links, and ignore rules; foreign content at a managed destination fails closed.
|
|
157
|
+
SDK-backed installs disable pnpm's side-effects cache so the manifest-bound
|
|
158
|
+
offline store remains unchanged.
|
|
159
|
+
|
|
160
|
+
Game modules default-export native Cordis plugins. Plugin install/uninstall
|
|
161
|
+
updates `forge.json.plugins[]`; a dependency failure restores the original
|
|
162
|
+
manifest. The next dev/build generation deterministically adds or removes the
|
|
163
|
+
literal Catalog import and production bundle reachability.
|
|
164
|
+
|
|
165
|
+
## Migration and carrier
|
|
166
|
+
|
|
167
|
+
Only operations with committed, owner-attributed ArtifactRef proofs are admitted
|
|
168
|
+
to the migration roster. Operations without a verifiable digest remain absent:
|
|
169
|
+
|
|
170
|
+
| Operation | Owner | Evidence | Fallback |
|
|
171
|
+
|:--|:--|:--|:--|
|
|
172
|
+
| `preview.run` | Preview host | RHI, ProfileCapture, and PNG refs | Private executor |
|
|
173
|
+
| `preview.offline-analysis` | RHI-debug consumer | RHI and ProfileCapture refs | Private executor |
|
|
174
|
+
|
|
175
|
+
`resolveMigration` rechecks target realm, catalog digest, RHI backend, and
|
|
176
|
+
evidence before selecting a service. Service admission is optional; absent or
|
|
177
|
+
invalid admission selects the private executor.
|
|
178
|
+
|
|
179
|
+
`createCarrierProviderService` owns an authenticated, ephemeral provider
|
|
180
|
+
process. It exposes only POD carrier routes and keeps no provider registry after
|
|
181
|
+
`close()`. Consumers validate descriptor and recipe digests before execution.
|
|
182
|
+
A provider exit after `started` returns a structured terminal failure and never
|
|
183
|
+
migrates the run to a private executor.
|
|
184
|
+
|
|
185
|
+
<details>
|
|
186
|
+
<summary>Ownership boundary</summary>
|
|
187
|
+
|
|
188
|
+
DevKit does not own World, Renderer, Canvas, Context, Fiber, RHI events, a
|
|
189
|
+
second operation registry, or a replay backend. The host supplies capture and
|
|
190
|
+
backend factories; Engine supplies the actual rendering and replay behavior.
|
|
191
|
+
|
|
192
|
+
</details>
|