@forgeax/game 0.2.4 → 0.3.1

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.
@@ -0,0 +1,177 @@
1
+ # Asset3D local provider and Engine transaction
2
+
3
+ Asset3D is a project-local integration composed from three separately reviewed
4
+ inputs: the `asset3d-search` provider bundle, the `art-3d-asset-library` workflow
5
+ package, and the released ForgeaX Engine SDK. `@forgeax/game` owns installation,
6
+ configuration, quarantine validation, transaction state, and the handoff to the
7
+ Engine CLI. It does not call an asset service directly and does not implement a
8
+ second importer or Preview server.
9
+
10
+ > [!IMPORTANT]
11
+ > Asset3D is disabled by default. `install` and ordinary `init` neither contact the
12
+ > internal catalog nor write Asset3D project state. The user must run `asset3d enable`
13
+ > inside an already initialized Engine game.
14
+
15
+ > [!IMPORTANT]
16
+ > Provider archives are platform-specific artifacts. The npm package embeds the
17
+ > currently released Darwin arm64 archive so a cache-empty user does not depend on a
18
+ > private source repository or release download. Installation deliberately returns
19
+ > `provider_platform_mismatch` when an archive target differs from the current host.
20
+ > Each bundled target therefore needs its own digest, offline verification, MCP
21
+ > handshake, and real service-path evidence.
22
+
23
+ ## Trust and data flow
24
+
25
+ ```mermaid
26
+ flowchart LR
27
+ U["Hidden key input or automation secret"] --> CRED["Private user credential file"]
28
+ B["Provider archive bundled in npm"] --> C["Managed digest cache"]
29
+ PKG["Exact K0 workflow TGZ"] --> S["Nine project Skill mounts"]
30
+ C --> M["Project-local stdio MCP"]
31
+ CRED --> M
32
+ M --> H["AW HybridSearch access check"]
33
+ H --> D["Exact signed-download origins"]
34
+ M --> Q["Private transaction quarantine"]
35
+ Q --> V["Checked result and file manifest"]
36
+ V --> A["Atomic asset-directory publication"]
37
+ A --> E["Exact Engine semantic-only asset add"]
38
+ E --> R["Engine verify, list, and inspect"]
39
+ R --> P["Per-file provenance and terminal result"]
40
+ ```
41
+
42
+ The provider is the only network adapter. `asset3d enable` invokes its bounded
43
+ `--check-aw-access` mode before publishing project configuration. That mode calls AW
44
+ `HybridSearch` with the documented `X-Sandbox-Key` header and required 3D search
45
+ fields, then emits only `authentication=sandbox-key` plus the canonical origins of
46
+ returned short-lived `res_url` values. Asset IDs, candidates, signed URLs, request
47
+ bodies, and the key are never returned by the access check.
48
+
49
+ Installed download authorities are
50
+ lexically exact `http://host:port` or `https://host:port` values: explicit port,
51
+ no path (including `/`), no query, fragment, userinfo, or wildcard. The canonical
52
+ one-to-eight member set is sorted and encoded as compact JSON in
53
+ `AW_DOWNLOAD_ORIGINS`; `.forgeax/asset3d-install.json` records only its SHA-256
54
+ digest. The provider is responsible for enforcing that set on both initial and
55
+ redirect requests.
56
+
57
+ Normal installation writes the normalized AW service root to `AW_API_BASE_URL` and an
58
+ absolute user credential-file path to `AW_API_CREDENTIAL_FILE`. It never writes
59
+ `AW_API_SANDBOX_KEY` into project MCP configuration. `--catalog-base-url` remains a
60
+ maintainer-only compatibility adapter for the retired directory service; when used,
61
+ its authority must also appear in `--download-origin`.
62
+
63
+ ## Installation ownership
64
+
65
+ `asset3d enable` requires an AW gateway or full service URL through `--base-url` or
66
+ `FORGEAX_ASSET_LIBRARY_BASE_URL`. No private-network endpoint is compiled into the
67
+ package. The first interactive run asks for the AW Sandbox Key with terminal echo
68
+ disabled. Automation can supply `FORGEAX_ASSET3D_AW_SANDBOX_KEY` from a secret store;
69
+ command-line key arguments are deliberately unsupported.
70
+
71
+ The credential is stored outside the project at
72
+ `~/.forgeax/credentials/asset3d-aw.json` by default. The directory is `0700`; the
73
+ file must be regular, owned by the current user, non-symlink, at most 4 KiB, and
74
+ `0600`. The Provider accepts only the versioned AW credential schema. A failed access
75
+ check or downstream installation rolls back a newly written value. An existing valid
76
+ credential makes repeat enablement idempotent. The plugin never treats Anthropic or
77
+ another model-provider credential as an Asset3D key.
78
+
79
+ The command reuses an exact verified cache when present. Otherwise it opens the
80
+ platform archive carried by the installed `@forgeax/game` package and verifies the
81
+ pinned SHA-256 before any provisioning. No Provider download or source-repository
82
+ authentication occurs during `asset3d enable`. Bundle schema, provider commit,
83
+ platform, Python range, and checked result/receipt schema digests are then verified
84
+ before invoking the offline bundle verifier. Provisioning uses system
85
+ Python 3.11 or 3.12 and the Provider's hash-locked `--provision` flow. The published
86
+ cache is keyed by archive digest under `~/.forgeax/providers/asset3d-search/`.
87
+
88
+ The low-level `asset3d install --provider-bundle ...` command remains a maintainer
89
+ surface for bundle production and controlled evidence; users enable the pinned
90
+ archive carried by their installed Game Plugin rather than selecting an arbitrary
91
+ archive.
92
+
93
+ The installer merges, rather than replaces, the complete `.forgeax/mcp.json` object.
94
+ Unrelated top-level keys and servers survive. The owned entries are local stdio only:
95
+
96
+ | Server | Tool timeout | Operation bound |
97
+ |:--|--:|--:|
98
+ | `asset3d-search` / `search_asset` | 195,000 ms | provider work 180,000 ms plus cleanup and bridge margin |
99
+ | `forgeax` / `forgeax_run_current_game` | 165,000 ms | Game Plugin build/readiness 150,000 ms plus cleanup and bridge margin |
100
+ | either server, unknown tool | 30,000 ms | project-MCP default |
101
+
102
+ A conflicting server is not overwritten. `--replace-owned` is accepted only when the
103
+ current entry still matches the prior ownership digest. Configuration, manifests,
104
+ journals, locks, and provenance are private; file publication uses same-directory
105
+ temporary files, file and directory fsync, and atomic rename. Reinstall is byte
106
+ idempotent. Uninstall removes only entries and Skill files that still match owned
107
+ digests, leaving user-modified or unrelated content in place and reporting the
108
+ collision.
109
+
110
+ The workflow package is projected beneath `art-3d-asset-library/` in exactly these
111
+ mounts unless `--ide` selects a subset:
112
+
113
+ ```text
114
+ .agents/skills .claude/skills
115
+ .cursor/skills .trae/skills
116
+ .codebuddy/skills .codeium/windsurf/skills
117
+ .vscode/skills .zcode/skills
118
+ .config/opencode/skills
119
+ ```
120
+
121
+ `workbuddy` is an input alias for the `.codebuddy/skills` mount. Every projected file
122
+ has its path, byte count, and digest in the ownership manifest.
123
+
124
+ ## Transaction protocol
125
+
126
+ 1. `asset3d begin` records a private journal with a new execution UUID, query digest,
127
+ provider identity, exact Engine identity, requested count, and the only allowed
128
+ quarantine root. It returns the relative `output_dir` for `search_asset`; the
129
+ provider's `MCP_SHARED_PATH` is the same private `workspace/` root, so declared
130
+ manifest paths and transaction validation address identical bytes.
131
+ 2. The configured provider writes beneath that directory and returns one checked
132
+ `forgeax.asset3d-search-result/1.0.0` TextContent JSON object.
133
+ 3. `asset3d commit --provider-result-stdin` reads at most 1 MiB, validates exact
134
+ fields/counts/roles/digests/sorted relative paths, and ignores `downloaded_to`.
135
+ 4. The transaction rejects symlinks, special files, undeclared files, realpath escape,
136
+ byte mismatch, or digest mismatch before a project asset write.
137
+ 5. A 30-second per-asset lock serializes publication at
138
+ `assets/3d/ea-3d/<safeAssetId>`. The complete prior directory is preserved as the
139
+ refresh/rollback snapshot.
140
+ 6. With the game root as `cwd`, Game Plugin runs the exact released Engine CLI:
141
+
142
+ ```text
143
+ asset add assets/3d/ea-3d/<safeAssetId> --reimport-policy semantic-only --json
144
+ asset verify --json
145
+ asset list --json
146
+ asset inspect <guid> --json
147
+ ```
148
+
149
+ Each command must produce exactly one newline-terminated, at-most-1-MiB
150
+ `CommandEnvelope@1.0.0`. Game Plugin does not filter diagnostic stdout into a
151
+ synthetic success.
152
+ 7. Only after Engine readback succeeds does `.forgeax-asset.json` publish the provider
153
+ commit, origin-set digest, exact Engine version/commit, per-file role/digest/bytes,
154
+ Engine rows, and catalog readback. An Engine failure restores the whole previous
155
+ asset directory.
156
+
157
+ Same provider ID and aggregate digest can reuse the existing directory only when all
158
+ declared live files still match and recorded Engine GUIDs remain in list/inspect
159
+ readback. A changed digest fails unless `--refresh` is explicit. `asset3d doctor`
160
+ restores a stale `committing` snapshot and never reports the interrupted operation as
161
+ successful; `asset3d abort` removes only its transaction quarantine.
162
+
163
+ ## Distribution and evidence boundary
164
+
165
+ The packed Game Plugin includes the self-contained CLI bundle, existing connector
166
+ Skill, exact K0 TGZ, checked P0 result/receipt schemas, and the immutable URL/digest
167
+ table for supported Provider targets. It does not embed the Provider runtime archive,
168
+ Engine payload, source checkout, credentials, or workspace links. Provider archives
169
+ are separate release assets so a disabled installation downloads nothing. The package
170
+ artifact gate recomputes every embedded predecessor digest.
171
+
172
+ Controlled external-consumer evidence may establish package installation, raw MCP
173
+ framing, local redirect/ZIP handling, multi-GLB and texture import, reuse, refresh,
174
+ failure rollback, offline recovery, Engine build/Preview health, uninstall, and
175
+ process cleanup. Its status is `PASS_SUPPORTING`. Real provider network results,
176
+ Studio project-MCP discovery, supported-host permission behavior, RuntimeInstance UI,
177
+ visible Play, and final independent acceptance remain outside this repository unit.
@@ -0,0 +1,100 @@
1
+ # `@forgeax/game` 0.3.0 release guide
2
+
3
+ ## User-visible contract
4
+
5
+ Version `0.3.0` makes the public onboarding flow exactly two commands:
6
+
7
+ ```bash
8
+ npx -y @forgeax/game install --ide codex,cursor,claude
9
+ cd /path/to/a-genuinely-empty-directory
10
+ npx -y @forgeax/game init
11
+ ```
12
+
13
+ Restart or reload an Agent host when the install command asks. `init` creates the
14
+ Engine-owned standalone game in the current directory through the exact
15
+ `@forgeax/engine-sdk@0.1.7` carrier, then installs the same Game Plugin Skill/routing
16
+ contract for every selected host. Users do not run `forgeax new` separately.
17
+
18
+ Standalone author source is `<game-root>/src`. `.forgeax/games/<slug>` belongs to the
19
+ Studio-hosted project model and is not created by this package.
20
+
21
+ ## Agent authoring and Preview
22
+
23
+ After `init`, ask the Agent to create a game and open Preview. A valid completion must
24
+ include all of the following:
25
+
26
+ - concrete `forge.json` id/name and a non-template package name;
27
+ - one coherent README with controls and no Empty package-output residue;
28
+ - a behavior test that imports and exercises a named game-specific state transition or
29
+ rule; renaming an Empty template test is insufficient;
30
+ - UI mounted under Engine Host `uiRoot` or `#game-ui`; direct `document.body` mutation
31
+ is rejected because the released standalone Host provides `#game-ui`;
32
+ - a successful `forgeax_run_current_game` response containing
33
+ `preview.status: ready`, the exact root, Engine release, build digest, Preview
34
+ instance ID, and the returned loopback URL.
35
+
36
+ An MCP error, a bare HTTP 200, a PID, an old build, or a localhost URL discovered by
37
+ shell probing is not Preview evidence. When another game owns the Preview port, stop
38
+ that exact verified game first:
39
+
40
+ ```bash
41
+ forgeax-game preview stop --target-dir /path/to/the-running-game
42
+ ```
43
+
44
+ The internal 3D catalog is disabled by default and is not contacted by `install` or
45
+ ordinary `init`. A user opts one initialized project in with:
46
+
47
+ ```bash
48
+ npx -y @forgeax/game asset3d enable
49
+ ```
50
+
51
+ The current `http://21.214.216.8:5180` catalog is network-gated and its body-free
52
+ access probe requires no API Key. In particular, `ANTHROPIC_API_KEY` is unrelated and
53
+ must not be supplied. If the service changes to `401`/`403` without publishing a
54
+ supported authentication contract, enablement fails closed. If
55
+ `asset3d-search/search_asset` is absent, the Agent must report
56
+ `BLOCKED(asset-library-tools-missing)`. Procedural meshes and `forgeax_generate_3d`
57
+ are not evidence that the reusable asset library is available.
58
+
59
+ ## Upgrade and compatibility
60
+
61
+ - Node.js `>=22.13.0` is required.
62
+ - Existing exact Engine games can rerun `forgeax-game init` to refresh project Skill,
63
+ routing, and authoring baseline without recreating gameplay source.
64
+ - `install` and `init` are idempotent for already-current owned state.
65
+ - Unknown non-empty directories fail before carrier execution or workspace mutation.
66
+ - Engine-owned `forgeax-engine-*` Skills remain supplied by the selected Engine game;
67
+ this release changes only the Game Plugin-owned `forgeax-game` Skill and rule.
68
+
69
+ ## Release verification
70
+
71
+ Before publishing, maintainers must run:
72
+
73
+ ```bash
74
+ bun run typecheck
75
+ bun test test/*.test.ts
76
+ bun run build
77
+ npm pack --json
78
+ bun scripts/check-package-artifact.ts /absolute/path/to/forgeax-game-0.3.0.tgz
79
+ ```
80
+
81
+ Then use the TGZ from a fresh consumer to verify:
82
+
83
+ 1. blank-directory `init`;
84
+ 2. identical Skill/rule projection for configured hosts;
85
+ 3. changed gameplay with stale template identity/tests fails closed;
86
+ 4. Engine build diagnostics before the terminal JSON frame are accepted;
87
+ 5. duplicate JSON or post-frame diagnostics fail closed;
88
+ 6. Preview failure is returned with MCP `isError: true`;
89
+ 7. a different game's occupied port is never reported as the new game's Preview;
90
+ 8. after stopping the old verified Preview, the new game returns its own exact
91
+ root/build/instance identity and loopback URL.
92
+
93
+ Publishing and npm dist-tag changes remain separate maintainer actions after the MR
94
+ and required checks are approved.
95
+
96
+ > [!CAUTION]
97
+ > Do not publish the npm dist-tag until every advertised host target has a Provider
98
+ > release artifact at the exact URL pinned by the package and its SHA-256 has been
99
+ > verified. The current source pins only `darwin-arm64`; other targets intentionally
100
+ > fail with `asset3d_provider_target_unreleased`.
@@ -0,0 +1,107 @@
1
+ # `@forgeax/game` 0.3.1 release guide
2
+
3
+ Version `0.3.1` keeps the two-command ForgeaX onboarding contract from `0.3.0` and
4
+ replaces the Asset3D default route with the documented AW `HybridSearch` contract.
5
+ Asset3D remains optional and disabled until a user explicitly enables it.
6
+
7
+ ## User contract
8
+
9
+ The ordinary setup flow is unchanged:
10
+
11
+ ```bash
12
+ npx -y @forgeax/game install --ide codex,cursor,claude
13
+ cd /path/to/a-genuinely-empty-directory
14
+ npx -y @forgeax/game init
15
+ ```
16
+
17
+ Inside an initialized project, enable AW Asset3D separately:
18
+
19
+ ```bash
20
+ npx -y @forgeax/game asset3d enable --base-url <aw-gateway-or-service-url>
21
+ npx -y @forgeax/game asset3d doctor --json
22
+ ```
23
+
24
+ `--base-url` can be replaced by `FORGEAX_ASSET_LIBRARY_BASE_URL`. The first
25
+ interactive enable asks for the AW Sandbox Key with hidden input. CI or another
26
+ non-interactive host must inject `FORGEAX_ASSET3D_AW_SANDBOX_KEY` from its own secret
27
+ store.
28
+
29
+ > [!IMPORTANT]
30
+ > Do not place the key on the command line, in `.forgeax/mcp.json`, in a repository
31
+ > `.env`, or in a release artifact. `ANTHROPIC_API_KEY` is unrelated and is never
32
+ > accepted as an Asset3D credential.
33
+
34
+ ## What changed
35
+
36
+ | Area | `0.3.0` | `0.3.1` |
37
+ |:--|:--|:--|
38
+ | Search adapter | Explicit internal directory catalog | AW `HybridSearch` through the packaged Provider |
39
+ | Authentication | Network gate, reported `authentication=none` | Required `X-Sandbox-Key`, validated before success |
40
+ | Service address | Compiled catalog origin | Explicit `--base-url` or environment configuration |
41
+ | Credential storage | None | User-level versioned JSON, directory `0700`, file `0600` |
42
+ | Project MCP config | Catalog origin and download origins | AW service URL, credential-file path, exact download origins |
43
+ | Failure behavior | Failed when an unknown auth contract appeared | Invalid key/network/address fails closed; new credential is rolled back |
44
+ | Provider delivery | Private external release URL | Digest-pinned archive embedded in the npm package |
45
+
46
+ The Provider accepts either an AW gateway root or the complete
47
+ `trpc.oasismetric.omcontentserver.http` service root and appends `HybridSearch`
48
+ exactly once. Its request includes `depot_name`, `asset_type=1`, text content type,
49
+ the query, `similarity_score`, and page size. Short-lived signed `res_url` values stay
50
+ inside the Provider; the access check exposes only their canonical origins for the
51
+ download sandbox.
52
+
53
+ ## Security and artifact gates
54
+
55
+ Before publishing, the exact npm tarball and Provider archive must pass all of these
56
+ checks:
57
+
58
+ - [ ] TypeScript typecheck, full Game Plugin test suite, and build.
59
+ - [ ] Provider AW/catalog/security tests and Python compile check.
60
+ - [ ] Two independently built Provider archives are byte-identical.
61
+ - [ ] Provider verifier provisions the archive under its exact SHA-256 cache key.
62
+ - [ ] Real AW access check succeeds without printing the key or a signed URL.
63
+ - [ ] Real search/download and Engine import/readback succeed in a fresh project.
64
+ - [ ] Package artifact gate accepts only the declared files and immutable digests.
65
+ - [ ] Secret scan covers source diff, npm tarball, its embedded workflow TGZ and
66
+ Provider archive, manifests, and file names.
67
+ - [ ] Registry-downloaded npm tarball is byte-identical to the audited candidate.
68
+
69
+ > [!WARNING]
70
+ > A successful search or download is not Preview acceptance. Release evidence must
71
+ > report Provider access, download, Engine import/readback, and visible Play as
72
+ > separate gates. AW responses do not establish license or commercial-use clearance;
73
+ > those remain asset-release requirements.
74
+
75
+ ## Provider inclusion
76
+
77
+ The pinned Darwin arm64 Provider identity for this release is:
78
+
79
+ ```text
80
+ provider commit: c181c48fbffc933a7ce9a0836f7878ca5e6d77e1
81
+ archive sha256: c8d2afd7ba68ae4b3540c927a2ff7133a82ea90975d09cab1d10b003fbbdeed3
82
+ ```
83
+
84
+ The exact archive is embedded beneath `assets/asset3d/provider/` in the npm tarball.
85
+ `asset3d enable` verifies this SHA-256 before provisioning and does not fetch Provider
86
+ code from GitHub, Gongfeng, or another repository. This makes cache-empty enablement
87
+ depend only on npm installation, local Python 3.11/3.12, the explicitly configured AW
88
+ service, and a valid user-supplied AW key.
89
+
90
+ The repository intentionally does not track the generated 17.2 MB Provider binary.
91
+ Release packaging injects the already audited archive through
92
+ `FORGEAX_ASSET3D_PROVIDER_BUNDLE`; the package artifact gate rejects any tarball that
93
+ omits it or contains different bytes.
94
+
95
+ ## Maintainer commands
96
+
97
+ ```bash
98
+ bun run typecheck
99
+ bun test test/*.test.ts
100
+ FORGEAX_ASSET3D_PROVIDER_BUNDLE=<audited-provider-archive> bun run build
101
+ FORGEAX_ASSET3D_PROVIDER_BUNDLE=<audited-provider-archive> \
102
+ npm pack --ignore-scripts --json --pack-destination <audited-directory>
103
+ bun scripts/check-package-artifact.ts <audited-directory>/forgeax-game-0.3.1.tgz
104
+ ```
105
+
106
+ Publishing, npm registry readback, and any merge request are separate irreversible or
107
+ remote-state steps. Record the exact Git heads and artifact digests at each boundary.
package/package.json CHANGED
@@ -1,16 +1,17 @@
1
1
  {
2
2
  "packageManager": "bun@1.3.14",
3
3
  "name": "@forgeax/game",
4
- "version": "0.2.4",
4
+ "version": "0.3.1",
5
5
  "private": false,
6
6
  "type": "module",
7
- "description": "@forgeax/game \u2014 ForgeaX game development as a plugin for MCP-capable agent CLIs (Codex, Claude Code, Cursor, Trae, ZCode, OpenCode, WorkBuddy). Single binary, dual mode: no args = stdio MCP server, subcommand = CLI.",
7
+ "description": "@forgeax/game — an MCP/CLI connector for exact released ForgeaX Engine games and Engine-owned Preview.",
8
8
  "main": "./dist/main.js",
9
9
  "bin": {
10
- "forgeax-game": "dist/main.js"
10
+ "forgeax-game": "dist/main.js",
11
+ "game": "dist/main.js"
11
12
  },
12
13
  "engines": {
13
- "node": ">=18"
14
+ "node": ">=22.13.0"
14
15
  },
15
16
  "publishConfig": {
16
17
  "access": "public",
@@ -18,13 +19,17 @@
18
19
  },
19
20
  "files": [
20
21
  "dist",
21
- "assets/skills",
22
+ "assets",
23
+ "docs/asset3d.md",
24
+ "docs/release-0.3.0.md",
25
+ "docs/release-0.3.1.md",
22
26
  "README.md"
23
27
  ],
24
28
  "scripts": {
25
29
  "build": "bun build.mjs",
26
30
  "release:check": "bun scripts/check-package-artifact.ts",
27
31
  "acceptance": "bun scripts/accept-packed-consumer.ts",
32
+ "acceptance:asset3d": "bun scripts/accept-asset3d-packed-consumer.ts",
28
33
  "release:publish": "bun scripts/publish-package.ts",
29
34
  "prepack": "bun build.mjs",
30
35
  "typecheck": "tsc --noEmit",
@@ -42,10 +47,16 @@
42
47
  ],
43
48
  "license": "MIT",
44
49
  "dependencies": {
45
- "@forgeax/game-runtime": "0.3.33"
50
+ "@forgeax/engine-sdk": "0.1.7",
51
+ "pnpm": "11.7.0"
46
52
  },
47
53
  "devDependencies": {
48
54
  "@types/bun": "^1.2.0",
49
55
  "typescript": "^5.9.2"
50
- }
56
+ },
57
+ "directories": {
58
+ "doc": "docs",
59
+ "test": "test"
60
+ },
61
+ "author": ""
51
62
  }
@@ -1,81 +0,0 @@
1
- # Verified Engine authoring traps
2
-
3
- Each entry below was hit while authoring a working game against this Engine pin and
4
- confirmed against Engine source. They are the failures that do **not** announce
5
- themselves: the game keeps running, nothing throws, and only the picture or the input
6
- is wrong. Check them before debugging anything else.
7
-
8
- ## Camera `fov` is vertical **radians**
9
-
10
- `Camera.fov` is passed unchanged to `mat4.perspective(out, fovYRadians, …)`. Degrees
11
- silently frame the wrong volume — the scene renders, so it reads as a layout bug.
12
-
13
- ```ts
14
- // wrong: 50 radians
15
- perspective({ fov: 50, aspect, near: 0.1, far: 200 })
16
- // right
17
- perspective({ fov: Math.PI / 4, aspect, near: 0.1, far: 200 })
18
- ```
19
-
20
- Some doc comments in `camera.ts` show `fov: 60`, and the preview host's own fallback
21
- camera does the same. Trust `mat4.perspective`, not those examples.
22
-
23
- ## Keyboard is dead until an InputMap resource exists
24
-
25
- The input scan system publishes `INPUT_SNAPSHOT_RESOURCE_KEY` only when an InputMap is
26
- registered. Without it `hasResource` is false forever and every key read is skipped —
27
- with no error.
28
-
29
- ```ts
30
- const KEY = (key: string) => ({ type: 'key', key } as const);
31
- world.insertResource(INPUT_MAP_KEY, [
32
- { action: 'up', bindings: [KEY('ArrowUp'), KEY('w')] },
33
- ] satisfies ActionConfig[]);
34
- ```
35
-
36
- The snapshot also lands only after the first `world.update`, so read
37
- `createInputSnapshot()` as an empty fallback rather than branching every frame.
38
-
39
- ## Action readpoints are functions, not properties
40
-
41
- ```ts
42
- input.action('up').justPressed // a function object — always truthy, fires every frame
43
- input.action('up').justPressed() // the actual edge
44
- ```
45
-
46
- `isPressed`, `justPressed` and `justReleased` are all calls; `strength` is a number.
47
-
48
- ## Diagnose "nothing renders" with `frustumStats`, not screenshots
49
-
50
- `__forgeax.renderer.frustumStats` reports `{ culled, total }`. `culled` equal to
51
- `total` means the camera is aimed away from the content — an orientation or `fov`
52
- problem, not a material or mesh problem. `__forgeax` also exposes `world`, `app`
53
- (with `lastError`) and `renderer.perFramePassNames`.
54
-
55
- ## An unlit dark material is indistinguishable from the cleared background
56
-
57
- `Materials.standard` with a low `baseColor` and no `emissive` renders as near-black on
58
- a dark `clearColor`, which looks identical to "not rendering". Give static geometry a
59
- small `emissive` value while bringing a scene up, then tune once it is visibly drawing.
60
-
61
- ## A pure top-down camera hits the degenerate `up` path
62
-
63
- `quat.fromLookAt(out, eye, target, up)` auto-selects an alternative `up` when `up` is
64
- collinear with the view direction. Prefer a tilted eye, and prefer `fromLookAt` over a
65
- hand-built axis-angle pitch so the forward/up convention stays the Engine's.
66
-
67
- ## The entry is `bootstrap(world, ctx)` — world first
68
-
69
- The preview host instantiates the default scene, then calls
70
- `export async function bootstrap(world: World, ctx?: BootstrapContext)`. It only spawns
71
- its own fallback camera when no game entry resolves, so a game that exports `bootstrap`
72
- owns the camera.
73
-
74
- ## `Materials.standard` returns the asset, not a Result
75
-
76
- ```ts
77
- world.allocSharedRef<'MaterialAsset', MaterialAsset>('MaterialAsset', Materials.standard({ … }))
78
- ```
79
-
80
- The `.value` seen in some `mesh-renderer.ts` examples belongs to
81
- `engine.assets.catalog(...)`, not to `Materials.standard`.
@@ -1,35 +0,0 @@
1
- # Engine project map
2
-
3
- Keep these boundaries in working memory while changing a ForgeaX game.
4
-
5
- | Concern | Authoritative location |
6
- |:--|:--|
7
- | Game selected by the user | `.forgeax/active-game.json` |
8
- | Game source and local assets | `.forgeax/games/<slug>/` |
9
- | Engine SDK declarations, templates, skills, and source | `.forgeax/engine-sdk/` |
10
- | SDK/runtime identity | `.forgeax/engine-sdk.json` and `forgeax_run_current_game` output |
11
- | New-game scaffold | ForgeaX server `POST /api/workbench/games` |
12
- | New-game template authority | `.forgeax/engine-sdk/templates/game-default/` and `.forgeax/engine-sdk/templates/game-empty/` |
13
- | Engine implementation source | `.forgeax/engine-sdk/source/<package>/src/` |
14
- | Runtime output owned by this plugin | `.forgeax/logs/runtime/runtime.log` |
15
-
16
- `forgeax-game init` calls the server scaffold endpoint. Do not copy the template by
17
- hand: that would bypass the server's active-game update and instance-root checks.
18
-
19
- ## Change a game
20
-
21
- - Work only under the active game's directory unless the request explicitly changes
22
- shared engine behavior.
23
- - Preserve the existing ECS and lifecycle style in that game; inspect neighboring
24
- systems before introducing a new abstraction.
25
- - Keep asset paths relative to the game and use the existing asset-loading APIs.
26
- - Do not make subagents independently edit `.forgeax/games/<slug>/src/`; the primary
27
- agent owns the source and the hot-reload feedback loop.
28
- - Use a nearby game under `.forgeax/games/` or `packages/games/` as an example, not as
29
- a template to duplicate wholesale.
30
-
31
- The plugin materializes the SDK from the same Engine pin used by its selected Runtime package.
32
- Read the relevant `package.json`, declaration files, and template first. If the bundled
33
- snapshot lacks an API, inspect the matching implementation source under `source/` rather
34
- than substituting a guessed import. A successful TypeScript transform does not prove that
35
- the preview is running the intended Engine.
@@ -1,24 +0,0 @@
1
- # Engine skills available in Runtime 0.3.33
2
-
3
- Derived from the Engine skills carried by the installed Runtime package. Invoke only
4
- ids listed here; Engine package names and skill ids are not interchangeable.
5
-
6
- | Skill id | Covers |
7
- |:--|:--|
8
- | `forgeax-engine-app` | ForgeaX application bootstrap and browser frame loop. |
9
- | `forgeax-engine-assets` | forgeax-engine 资产链路:GUID sidecar → CLI 校验 → vite 折 pack-index → runtime 按 GUID 取 payload, `<packagePath>.<name>` 两段式 identity。 |
10
- | `forgeax-engine-audio` | ForgeaX realm-neutral ECS audio with Host-owned Web Audio playback. |
11
- | `forgeax-engine-cli` | forgeax-engine 远程求值:对运行中引擎活实例执行 eval(script) + kubectl 式 plugin bin。 |
12
- | `forgeax-engine-debug` | forgeax-engine 渲染 / 测试 / CI 实战排查手册——按"症状 → 根因 → 修法"索引已踩过的坑(贴图纯白、 CI 断言全过却 exit 1、worktree 本地假失败、热更新贴图丢失等)。 |
13
- | `forgeax-engine-debug-draw` | forgeax-engine immediate-mode 调试可视化层:line / sphere / aabb / frustum / arrow / axes 线框 overlay, runtime 自动挂载 app.debugDraw(零配置),low path 手写 RHI flush(自定义 graph / 录帧脚本)。 |
14
- | `forgeax-engine-ecs` | ForgeaX archetype ECS: define SoA components and systems, attach systems to the Update or FixedUpdate schedule with token-first World APIs, and advance a World through world.update |
15
- | `forgeax-engine-material` | Build and debug visible ForgeaX materials through the single MaterialAsset route. |
16
- | `forgeax-engine-math` | forgeax-engine 的纯函数数学库:vec / mat / quat / euler / color 的 out-param 风格函数, 从 Transform.world mat4 读 pose,screenToRay / rayAabbIntersects 做拾取。 |
17
- | `forgeax-engine-physics` | forgeax-engine 物理:给 entity 挂 Transform + RigidBody + Collider 即被每帧驱动位置。 |
18
- | `forgeax-engine-render-pipeline` | forgeax-engine 渲染管线、后处理与 typed RenderGraph。Use when toggling camera effects, authoring a custom RenderPipeline, contributing compute or raster RenderFeature work, or tracing graph |
19
- | `forgeax-engine-rhi` | forgeax-engine 底层渲染硬件接口(贡献者向):spec-aligned 纯接口、opaque handle、 math-free、双实现同发、capability gate。Use when contributing to or debugging the RHI backend, reading capability gates, or tr |
20
- | `forgeax-engine-rhi-debug` | forgeax-engine 的 RHI 帧录制 + 确定性 replay + 离线 per-draw inspect(RenderDoc 思想)。 |
21
- | `forgeax-engine-sdk` | Build and verify the portable ForgeaX browser-game SDK ZIP from an Engine checkout. |
22
- | `forgeax-engine-shader` | Author WGSL modules that are consumed by cooked MaterialAsset contracts. |
23
- | `forgeax-engine-state` | forgeax-engine typed state-machine: defineState creates a StateToken, setNextState requests a transition, state-scoped entities auto-despawn via despawnOnExit/despawnOnEnter, OnEnt |
24
- | `forgeax-engine-vfx` | ForgeaX code-first GPU VFX: author two WGSL hooks, cook Pack v2, play through ECS, and render executable billboard, mesh, ribbon, trail, or beam output. |
@@ -1,26 +0,0 @@
1
- # Validation loop
2
-
3
- Use the narrowest proof that exercises the user's real path, then run the repository
4
- gate before shipping a product change.
5
-
6
- 1. Call `forgeax://status` or `forgeax_status_lite` and record the active game.
7
- 2. Run focused tests for the changed code.
8
- 3. Call `forgeax_run_current_game` and use the returned URLs.
9
- 4. For Studio or viewport behavior, open `http://localhost:18920` and exercise the
10
- embedded editor path. For standalone Play behavior, exercise the returned Play URL.
11
- 5. Inspect browser errors and the runtime log returned by the tool.
12
- 6. Run `bun fx check` for a normal repository change. Run the owning repository's
13
- `bun fx ci` before creating or updating a pull request.
14
-
15
- ## Evidence boundary
16
-
17
- | Result | What it proves |
18
- |:--|:--|
19
- | MCP handshake and status | The host can load the plugin and bind the project |
20
- | Focused tests | The changed code's asserted contract |
21
- | Play URL responds | The standalone runtime is reachable |
22
- | Real Studio interaction | The assembled product path works |
23
- | Full repository gate | The broader source tree remains compatible |
24
-
25
- Do not collapse these into one “green” claim. Mark any layer that was not exercised as
26
- unverified.