@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.
Files changed (164) hide show
  1. package/LICENSE +15 -0
  2. package/README.md +192 -0
  3. package/dist/.tsbuildinfo +1 -0
  4. package/dist/__tests__/archive.test.d.ts +2 -0
  5. package/dist/__tests__/archive.test.d.ts.map +1 -0
  6. package/dist/__tests__/assets.test.d.ts +2 -0
  7. package/dist/__tests__/assets.test.d.ts.map +1 -0
  8. package/dist/__tests__/bootstrap-commands.test.d.ts +2 -0
  9. package/dist/__tests__/bootstrap-commands.test.d.ts.map +1 -0
  10. package/dist/__tests__/dist.test.d.ts +2 -0
  11. package/dist/__tests__/dist.test.d.ts.map +1 -0
  12. package/dist/__tests__/host.test.d.ts +2 -0
  13. package/dist/__tests__/host.test.d.ts.map +1 -0
  14. package/dist/__tests__/init.test.d.ts +2 -0
  15. package/dist/__tests__/init.test.d.ts.map +1 -0
  16. package/dist/__tests__/plugin-authoring.test.d.ts +2 -0
  17. package/dist/__tests__/plugin-authoring.test.d.ts.map +1 -0
  18. package/dist/__tests__/project.test.d.ts +2 -0
  19. package/dist/__tests__/project.test.d.ts.map +1 -0
  20. package/dist/__tests__/rhi-debug-cold-start.integration.test.d.ts +2 -0
  21. package/dist/__tests__/rhi-debug-cold-start.integration.test.d.ts.map +1 -0
  22. package/dist/__tests__/rhi-debug-error-consumer.test-d.d.ts +2 -0
  23. package/dist/__tests__/rhi-debug-error-consumer.test-d.d.ts.map +1 -0
  24. package/dist/__tests__/rhi-debug-operations.test-d.d.ts +2 -0
  25. package/dist/__tests__/rhi-debug-operations.test-d.d.ts.map +1 -0
  26. package/dist/__tests__/rhi-debug-operations.unit.test.d.ts +2 -0
  27. package/dist/__tests__/rhi-debug-operations.unit.test.d.ts.map +1 -0
  28. package/dist/__tests__/sdk-install.test.d.ts +2 -0
  29. package/dist/__tests__/sdk-install.test.d.ts.map +1 -0
  30. package/dist/__tests__/skill-install.test.d.ts +2 -0
  31. package/dist/__tests__/skill-install.test.d.ts.map +1 -0
  32. package/dist/__tests__/tool-migration.test.d.ts +2 -0
  33. package/dist/__tests__/tool-migration.test.d.ts.map +1 -0
  34. package/dist/archive.d.ts +6 -0
  35. package/dist/archive.d.ts.map +1 -0
  36. package/dist/assets.d.ts +6 -0
  37. package/dist/assets.d.ts.map +1 -0
  38. package/dist/bootstrap-commands.d.ts +12 -0
  39. package/dist/bootstrap-commands.d.ts.map +1 -0
  40. package/dist/cli.d.ts +2 -0
  41. package/dist/cli.d.ts.map +1 -0
  42. package/dist/cli.mjs +4862 -0
  43. package/dist/cli.mjs.map +1 -0
  44. package/dist/commands.d.ts +19 -0
  45. package/dist/commands.d.ts.map +1 -0
  46. package/dist/dist.d.ts +24 -0
  47. package/dist/dist.d.ts.map +1 -0
  48. package/dist/host/base-host.d.ts +18 -0
  49. package/dist/host/base-host.d.ts.map +1 -0
  50. package/dist/host/project-bootstrap.d.ts +11 -0
  51. package/dist/host/project-bootstrap.d.ts.map +1 -0
  52. package/dist/host/resource-bootstrap.d.ts +23 -0
  53. package/dist/host/resource-bootstrap.d.ts.map +1 -0
  54. package/dist/host.d.ts +13 -0
  55. package/dist/host.d.ts.map +1 -0
  56. package/dist/index.d.ts +28 -0
  57. package/dist/index.d.ts.map +1 -0
  58. package/dist/index.mjs +5762 -0
  59. package/dist/index.mjs.map +1 -0
  60. package/dist/init.d.ts +20 -0
  61. package/dist/init.d.ts.map +1 -0
  62. package/dist/plugin-authoring.d.ts +4 -0
  63. package/dist/plugin-authoring.d.ts.map +1 -0
  64. package/dist/project.d.ts +5 -0
  65. package/dist/project.d.ts.map +1 -0
  66. package/dist/rhi-debug/cli-context.d.ts +3 -0
  67. package/dist/rhi-debug/cli-context.d.ts.map +1 -0
  68. package/dist/rhi-debug/operations.d.ts +83 -0
  69. package/dist/rhi-debug/operations.d.ts.map +1 -0
  70. package/dist/sdk-cli.d.ts +2 -0
  71. package/dist/sdk-cli.d.ts.map +1 -0
  72. package/dist/sdk-cli.mjs +5560 -0
  73. package/dist/sdk-cli.mjs.map +1 -0
  74. package/dist/sdk-install.d.ts +7 -0
  75. package/dist/sdk-install.d.ts.map +1 -0
  76. package/dist/sdk.d.ts +69 -0
  77. package/dist/sdk.d.ts.map +1 -0
  78. package/dist/shader-check.d.ts +3 -0
  79. package/dist/shader-check.d.ts.map +1 -0
  80. package/dist/skill-install.d.ts +16 -0
  81. package/dist/skill-install.d.ts.map +1 -0
  82. package/dist/tools/__tests__/browser-host-port.test.d.ts +2 -0
  83. package/dist/tools/__tests__/browser-host-port.test.d.ts.map +1 -0
  84. package/dist/tools/__tests__/carrier-faults.integration.test.d.ts +2 -0
  85. package/dist/tools/__tests__/carrier-faults.integration.test.d.ts.map +1 -0
  86. package/dist/tools/__tests__/carrier-provider.integration.test.d.ts +2 -0
  87. package/dist/tools/__tests__/carrier-provider.integration.test.d.ts.map +1 -0
  88. package/dist/tools/__tests__/commands.test.d.ts +2 -0
  89. package/dist/tools/__tests__/commands.test.d.ts.map +1 -0
  90. package/dist/tools/__tests__/coverage-gaps.test.d.ts +2 -0
  91. package/dist/tools/__tests__/coverage-gaps.test.d.ts.map +1 -0
  92. package/dist/tools/__tests__/domain-catalog.test.d.ts +2 -0
  93. package/dist/tools/__tests__/domain-catalog.test.d.ts.map +1 -0
  94. package/dist/tools/__tests__/preview-owner-gate.test.d.ts +2 -0
  95. package/dist/tools/__tests__/preview-owner-gate.test.d.ts.map +1 -0
  96. package/dist/tools/__tests__/preview-publication.test.d.ts +2 -0
  97. package/dist/tools/__tests__/preview-publication.test.d.ts.map +1 -0
  98. package/dist/tools/__tests__/realm-dispatch.integration.test.d.ts +2 -0
  99. package/dist/tools/__tests__/realm-dispatch.integration.test.d.ts.map +1 -0
  100. package/dist/tools/benchmark/__tests__/admission-fixtures.test.d.ts +2 -0
  101. package/dist/tools/benchmark/__tests__/admission-fixtures.test.d.ts.map +1 -0
  102. package/dist/tools/benchmark/harness.d.ts +17 -0
  103. package/dist/tools/benchmark/harness.d.ts.map +1 -0
  104. package/dist/tools/benchmark/index.d.ts +4 -0
  105. package/dist/tools/benchmark/index.d.ts.map +1 -0
  106. package/dist/tools/benchmark/report.d.ts +54 -0
  107. package/dist/tools/benchmark/report.d.ts.map +1 -0
  108. package/dist/tools/benchmark/statistics.d.ts +8 -0
  109. package/dist/tools/benchmark/statistics.d.ts.map +1 -0
  110. package/dist/tools/bootstrap.d.ts +49 -0
  111. package/dist/tools/bootstrap.d.ts.map +1 -0
  112. package/dist/tools/browser-host.d.ts +27 -0
  113. package/dist/tools/browser-host.d.ts.map +1 -0
  114. package/dist/tools/cache.d.ts +14 -0
  115. package/dist/tools/cache.d.ts.map +1 -0
  116. package/dist/tools/capability.d.ts +2 -0
  117. package/dist/tools/capability.d.ts.map +1 -0
  118. package/dist/tools/carrier-provider.d.ts +31 -0
  119. package/dist/tools/carrier-provider.d.ts.map +1 -0
  120. package/dist/tools/carrier-rendezvous.d.ts +16 -0
  121. package/dist/tools/carrier-rendezvous.d.ts.map +1 -0
  122. package/dist/tools/catalog.d.ts +66 -0
  123. package/dist/tools/catalog.d.ts.map +1 -0
  124. package/dist/tools/cli-adapter.d.ts +5 -0
  125. package/dist/tools/cli-adapter.d.ts.map +1 -0
  126. package/dist/tools/client.d.ts +18 -0
  127. package/dist/tools/client.d.ts.map +1 -0
  128. package/dist/tools/commands.d.ts +6 -0
  129. package/dist/tools/commands.d.ts.map +1 -0
  130. package/dist/tools/contributions.d.ts +6 -0
  131. package/dist/tools/contributions.d.ts.map +1 -0
  132. package/dist/tools/library.d.ts +3 -0
  133. package/dist/tools/library.d.ts.map +1 -0
  134. package/dist/tools/migration.d.ts +36 -0
  135. package/dist/tools/migration.d.ts.map +1 -0
  136. package/dist/tools/native-preview.d.ts +4 -0
  137. package/dist/tools/native-preview.d.ts.map +1 -0
  138. package/dist/tools/offline-analysis.d.ts +22 -0
  139. package/dist/tools/offline-analysis.d.ts.map +1 -0
  140. package/dist/tools/preview-catalog.d.ts +8 -0
  141. package/dist/tools/preview-catalog.d.ts.map +1 -0
  142. package/dist/tools/preview-contributions.d.ts +12 -0
  143. package/dist/tools/preview-contributions.d.ts.map +1 -0
  144. package/dist/tools/preview-host.d.ts +85 -0
  145. package/dist/tools/preview-host.d.ts.map +1 -0
  146. package/dist/tools/preview-migration.d.ts +4 -0
  147. package/dist/tools/preview-migration.d.ts.map +1 -0
  148. package/dist/tools/private-executor.d.ts +3 -0
  149. package/dist/tools/private-executor.d.ts.map +1 -0
  150. package/dist/tools/project-tools.d.ts +23 -0
  151. package/dist/tools/project-tools.d.ts.map +1 -0
  152. package/dist/tools/realms.d.ts +22 -0
  153. package/dist/tools/realms.d.ts.map +1 -0
  154. package/dist/tools/run-command.d.ts +17 -0
  155. package/dist/tools/run-command.d.ts.map +1 -0
  156. package/dist/tools/runtime.d.ts +5 -0
  157. package/dist/tools/runtime.d.ts.map +1 -0
  158. package/dist/tools/service-transport.d.ts +17 -0
  159. package/dist/tools/service-transport.d.ts.map +1 -0
  160. package/dist/tools/service.d.ts +22 -0
  161. package/dist/tools/service.d.ts.map +1 -0
  162. package/dist/types.d.ts +84 -0
  163. package/dist/types.d.ts.map +1 -0
  164. 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>