@forgeax/game 0.3.5 → 0.3.7

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/README.md CHANGED
@@ -93,12 +93,17 @@ connector refuses Preview until the Agent has replaced the template identity, ke
93
93
  single game README heading, removed the Empty package output name, updated gameplay
94
94
  tests, and documented controls. A valid behavior test imports a named game-specific
95
95
  state transition or rule and exercises it with an assertion; merely renaming an Empty
96
- template test does not qualify. Standalone source remains in `<game-root>/src`; the
97
- Studio-hosted `.forgeax/games/<slug>` layout is never created by this package.
96
+ template test does not qualify. Authoring layout follows the installed Engine and
97
+ `forge.json` (v2 uses `assets/` and `plugins[]`); the Studio-hosted
98
+ `.forgeax/games/<slug>` layout is never created by this package.
98
99
 
99
100
  Every supported host receives the same packaged `forgeax-game` Skill and routing rule.
100
101
  They require UI to mount under the Engine Host `uiRoot` or `#game-ui`. The released
101
102
  standalone Host provides `#game-ui`; direct `document.body` mutation is rejected.
103
+ Preview `ready` verifies startup and ownership, not playable behavior. Agents use
104
+ available browser tools for task-relevant interaction checks, or clearly report
105
+ gameplay as unverified and provide manual checks. This guidance does not prescribe
106
+ a game genre, UI implementation, browser brand, or additional blocking gate.
102
107
  An explicit request for an existing/library 3D asset requires the separately installed
103
108
  project-local `asset3d-search/search_asset` tool. When it is absent, Agents must report
104
109
  `BLOCKED(asset-library-tools-missing)` instead of relabeling procedural geometry or
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: art-3d-asset-library
3
+ description: Search and import reusable EA/AW assets, including native Pack sources, through the installed ForgeaX game plugin. Use when making games with existing library assets.
4
+ ---
5
+
6
+ # Asset library: Game Plugin adapter
7
+
8
+ This entry is owned by `@forgeax/game` and matches its pinned Provider. The original
9
+ `@vibegame/art-3d-asset-library@2.0.0` documents remain under `legacy/` for provenance;
10
+ their GLB-only transport and asset-add-only instructions are not this version's contract.
11
+
12
+ ## Search and import
13
+
14
+ 1. Check the project has Asset3D enabled and the current session exposes
15
+ `asset3d-search/list_asset_candidates` and `search_asset`. Missing tools are a configuration blocker, not
16
+ an empty library. Do not substitute generated geometry or handwritten HTTP.
17
+ 2. Use the same installed `forgeax-game` CLI as the project's `forgeax` MCP server.
18
+ For a local candidate, use its installed absolute CLI path, not npm's older release.
19
+ `pnpm exec` can resolve a global CLI when no project dependency exists; verify
20
+ that executable matches the MCP launcher before starting a transaction.
21
+ Call `list_asset_candidates` with English queries. Choose a suitable returned
22
+ `assetId` using its name and format; do not invent an ID or silently take the
23
+ first candidate. If none fits, refine the query or report no suitable result.
24
+ Run `forgeax-game asset3d begin --query "<same English query>" --json`.
25
+ 3. Call `search_asset` with `queries: [{content: "<same English query>", assetId: "<selected ID>"}]`, returned `execution`, and
26
+ `output_format: "asset"` to preserve native `.pack.ts` / `.pack.json` when returned.
27
+ `asset` is the request enum, not `pack.json`. Explicit `glb` requests retain the
28
+ GLB conversion route. The tool schema must advertise `asset`; otherwise report
29
+ a Provider version mismatch. Never supply an output directory. Explicit selection
30
+ uses the calling Agent's judgment and does not need a separate LLM service.
31
+ 4. Run `forgeax-game asset3d commit --execution <execution> --json`.
32
+ The MCP bridge already stores the checked receipt. Inspect per-item failures,
33
+ `deliveredFormat` in the search result, and the actual returned Engine identities.
34
+ A successful GLB result is not evidence of a Pack result. If Pack is required but
35
+ none is returned, report that mismatch rather than renaming or converting source.
36
+
37
+ ## Use the returned assets
38
+
39
+ - Pack: commit uses the exact Engine build and verified build catalog; use its
40
+ returned scene/mesh GUIDs. Do not run `asset add` on native Pack source or infer
41
+ failure solely from a source-only `asset list/inspect` result.
42
+ - GLB: commit uses Engine asset add and catalog readback.
43
+ - Keep the full declared source/helper/texture closure, material parameters and
44
+ stable identities. Runtime loads cooked assets by GUID. Do not execute downloaded
45
+ helpers directly. Executable Pack build requires a trusted source; Engine is not
46
+ itself a security sandbox.
47
+ - Integrate the selected asset into the requested game's normal scene/plugin path,
48
+ using the installed Engine skills. Choose gameplay, camera and composition to suit
49
+ the user rather than following a fixed sample game.
50
+ - Call `forgeax_run_current_game`, then verify visible assets and requested input in
51
+ its verified Preview URL. Search, import, build, and visible gameplay are separate
52
+ results. Preserve failures, attribution/license gaps and unverified stages.
53
+
54
+ Asset3D is opt-in. Configure EA using `forgeax-game asset3d enable --library ea
55
+ --ide codex` (choose the requested host). Missing credentials require user setup;
56
+ do not read or expose keys in prompts. Use doctor for diagnosis, not proof of search.
@@ -39,6 +39,9 @@
39
39
  {
40
40
  "$ref": "#/$defs/success"
41
41
  },
42
+ {
43
+ "$ref": "#/$defs/packSuccess"
44
+ },
42
45
  {
43
46
  "$ref": "#/$defs/error"
44
47
  }
@@ -59,7 +62,9 @@
59
62
  }
60
63
  },
61
64
  "then": {
62
- "required": ["receipt"]
65
+ "required": [
66
+ "receipt"
67
+ ]
63
68
  }
64
69
  }
65
70
  ],
@@ -75,7 +80,10 @@
75
80
  "maxLength": 128,
76
81
  "pattern": "^[A-Za-z0-9._-]+$",
77
82
  "not": {
78
- "enum": [".", ".."]
83
+ "enum": [
84
+ ".",
85
+ ".."
86
+ ]
79
87
  }
80
88
  },
81
89
  "sha256": {
@@ -91,7 +99,12 @@
91
99
  "manifestEntry": {
92
100
  "type": "object",
93
101
  "additionalProperties": false,
94
- "required": ["path", "role", "bytes", "sha256"],
102
+ "required": [
103
+ "path",
104
+ "role",
105
+ "bytes",
106
+ "sha256"
107
+ ],
95
108
  "properties": {
96
109
  "path": {
97
110
  "$ref": "#/$defs/relativePath"
@@ -237,6 +250,112 @@
237
250
  "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
238
251
  }
239
252
  }
253
+ },
254
+ "packManifestEntry": {
255
+ "type": "object",
256
+ "additionalProperties": false,
257
+ "required": [
258
+ "path",
259
+ "role",
260
+ "bytes",
261
+ "sha256"
262
+ ],
263
+ "properties": {
264
+ "path": {
265
+ "$ref": "#/$defs/relativePath"
266
+ },
267
+ "role": {
268
+ "enum": [
269
+ "primary-pack",
270
+ "auxiliary-pack",
271
+ "animation",
272
+ "auxiliary-model",
273
+ "texture",
274
+ "metadata"
275
+ ]
276
+ },
277
+ "bytes": {
278
+ "type": "integer",
279
+ "minimum": 1,
280
+ "maximum": 134217728
281
+ },
282
+ "sha256": {
283
+ "$ref": "#/$defs/sha256"
284
+ }
285
+ }
286
+ },
287
+ "packSuccess": {
288
+ "type": "object",
289
+ "additionalProperties": false,
290
+ "required": [
291
+ "status",
292
+ "queryIndex",
293
+ "query",
294
+ "provider",
295
+ "providerAssetId",
296
+ "assetName",
297
+ "deliveredFormat",
298
+ "sha256",
299
+ "bytes",
300
+ "primaryPack",
301
+ "manifest",
302
+ "originSetDigest"
303
+ ],
304
+ "properties": {
305
+ "status": {
306
+ "const": "ok"
307
+ },
308
+ "queryIndex": {
309
+ "$ref": "#/$defs/queryIndex"
310
+ },
311
+ "query": {
312
+ "type": "string",
313
+ "minLength": 1,
314
+ "maxLength": 200
315
+ },
316
+ "provider": {
317
+ "const": "ea-3d"
318
+ },
319
+ "providerAssetId": {
320
+ "$ref": "#/$defs/safeId"
321
+ },
322
+ "assetName": {
323
+ "type": "string",
324
+ "minLength": 1,
325
+ "maxLength": 128
326
+ },
327
+ "deliveredFormat": {
328
+ "const": "pack"
329
+ },
330
+ "sha256": {
331
+ "$ref": "#/$defs/sha256"
332
+ },
333
+ "bytes": {
334
+ "type": "integer",
335
+ "minimum": 1,
336
+ "maximum": 268435456
337
+ },
338
+ "manifest": {
339
+ "type": "array",
340
+ "minItems": 1,
341
+ "maxItems": 1024,
342
+ "items": {
343
+ "$ref": "#/$defs/packManifestEntry"
344
+ }
345
+ },
346
+ "originSetDigest": {
347
+ "$ref": "#/$defs/sha256"
348
+ },
349
+ "downloaded_to": {
350
+ "type": "string",
351
+ "minLength": 1,
352
+ "maxLength": 512,
353
+ "pattern": "^(?!/)(?!.*\\\\)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*//)[^\\u0000]+$"
354
+ },
355
+ "primaryPack": {
356
+ "$ref": "#/$defs/relativePath"
357
+ }
358
+ }
240
359
  }
241
360
  }
242
361
  }
@@ -22,14 +22,19 @@ the connector owns Engine CLI execution and Preview lifecycle.
22
22
  > [!IMPORTANT]
23
23
  > In an empty directory, `forgeax-game init` creates the Engine-owned standalone game
24
24
  > through the exact installed carrier. In an existing exact game it refreshes the
25
- > binding idempotently. Standalone source is `<game-root>/src`; do not create Studio's
26
- > hosted `.forgeax/games/<slug>` layout.
25
+ > binding idempotently. Follow `forge.json` and the installed Engine's authoring
26
+ > layout (Engine v2 uses `assets/` and `plugins[]`); preserve supported existing
27
+ > layouts rather than moving files to a prescribed directory. Do not create Studio's
28
+ > hosted `.forgeax/games/<slug>` layout inside a standalone game.
27
29
 
28
30
  ## Edit and verify
29
31
 
30
32
  1. Make the smallest coherent game-source change using normal file tools. Mount browser
31
33
  UI through the Engine Host `uiRoot` or `#game-ui`. The released standalone Host
32
- provides `#game-ui`; do not mutate `document.body` directly.
34
+ provides `#game-ui`; do not mutate `document.body` directly. Resolve Host access
35
+ and lifecycle from the installed Engine declarations/examples, not a guessed
36
+ injection name. Check that requested UI is actually mounted; optional chaining
37
+ that silently skips required UI is not proof it works.
33
38
  2. When turning the Empty template into a requested game, also replace the template
34
39
  identity in `forge.json`, `package.json`, and README; document controls and keep
35
40
  tests aligned. Export at least one named game-specific state transition or rule and
@@ -43,6 +48,14 @@ the connector owns Engine CLI execution and Preview lifecycle.
43
48
  6. After a code change, do not reuse an old visual observation as evidence; the new
44
49
  build digest and Preview instance must be observed.
45
50
 
51
+ Preview `ready` proves startup and ownership, not gameplay or visible UI. For a
52
+ playable-game request, use an available browser tool to check the requested core
53
+ interaction and feedback. Choose checks to fit the game, not a fixed checklist or
54
+ browser brand. If browser access is unavailable, deliver the verified Preview URL
55
+ with gameplay explicitly unverified and short manual checks; do not block useful
56
+ implementation or claim interactions were tested. An Engine-upgrade-only request
57
+ does not require a new gameplay quality review.
58
+
46
59
  ## Reuse 3D assets
47
60
 
48
61
  - When the user asks for an existing, reusable, library, stock, or licensed 3D asset,