@tora-editor/tora 0.2.0 → 0.3.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.
Files changed (107) hide show
  1. package/README.md +5 -6
  2. package/bin/tora.mjs +255 -29
  3. package/crates/packer/trusted/native-3d-meta.json +3 -3
  4. package/crates/packer/trusted/native-3d.js +180 -180
  5. package/crates/packer/trusted/native-meta.json +3 -3
  6. package/crates/packer/trusted/native.js +5 -5
  7. package/crates/packer/trusted/release-manifest.json +17 -17
  8. package/crates/packer/trusted/review-runtime-meta.json +3 -3
  9. package/crates/packer/trusted/review-runtime.js +182 -182
  10. package/docs/MIGRATION_0_3.md +39 -0
  11. package/docs/NATIVE_AGENT_TOOLS.md +12 -363
  12. package/docs/TORA_AGENT_SETUP.md +24 -106
  13. package/docs/TORA_CREATION_API.md +63 -365
  14. package/docs/reference/CORE_AUTHORING.md +8 -2
  15. package/docs/reference/PLAYABLE_STARTERS.md +1 -1
  16. package/docs/reference/packs/3d.md +2 -0
  17. package/package.json +6 -6
  18. package/packages/creative-project/project-v21.schema.json +108 -1
  19. package/scripts/lean/editor/entry.js +11 -6
  20. package/scripts/lean/editor/project-launcher.js +116 -0
  21. package/scripts/lean/editor/quick-edit-panel.js +479 -0
  22. package/scripts/lean/editor/review-editor.css +246 -68
  23. package/scripts/lean/editor/review-editor.js +1731 -1099
  24. package/scripts/lean/editor-state.mjs +6 -0
  25. package/scripts/lean/editor.mjs +6 -3
  26. package/scripts/lean/matrix.mjs +5 -0
  27. package/scripts/lean/native/agent-tools.mjs +35 -58
  28. package/scripts/lean/native/api.mjs +148 -134
  29. package/scripts/lean/native/audio-assets.mjs +30 -0
  30. package/scripts/lean/native/browser-pool.mjs +34 -0
  31. package/scripts/lean/native/build-cache.mjs +36 -5
  32. package/scripts/lean/native/contracts.mjs +8 -6
  33. package/scripts/lean/native/creative-qa.mjs +66 -12
  34. package/scripts/lean/native/demos.mjs +11 -20
  35. package/scripts/lean/native/document.mjs +14 -2
  36. package/scripts/lean/native/local-bundle.mjs +4 -2
  37. package/scripts/lean/native/mcp-server.mjs +16 -35
  38. package/scripts/lean/native/modules/harvest-restore.mjs +3 -284
  39. package/scripts/lean/native/modules/sort-puzzle.mjs +51 -0
  40. package/scripts/lean/native/modules/star-salvage.mjs +3 -368
  41. package/scripts/lean/native/project-bundle.mjs +3 -2
  42. package/scripts/lean/native/project-index.mjs +0 -2
  43. package/scripts/lean/native/qa-adapters.mjs +10 -0
  44. package/scripts/lean/native/quick-edit.mjs +328 -0
  45. package/scripts/lean/native/review.mjs +203 -572
  46. package/scripts/lean/native/schema-vocabulary.mjs +10 -0
  47. package/scripts/lean/native/schema.mjs +1 -1
  48. package/scripts/lean/native/scope.mjs +45 -0
  49. package/scripts/lean/native/service.mjs +242 -70
  50. package/scripts/lean/native/starters.mjs +135 -8
  51. package/scripts/lean/native/variant-adapters.mjs +8 -0
  52. package/scripts/lean/native/variants-core.mjs +186 -0
  53. package/scripts/lean/native/variants.mjs +63 -0
  54. package/scripts/lean/native/win-cues.mjs +1 -1
  55. package/skills/tora-playables/SKILL.md +1 -1
  56. package/scripts/lean/editor/review-intake.js +0 -837
  57. package/scripts/lean/model-client.mjs +0 -119
  58. package/scripts/lean/native/author-expansion-proofs.mjs +0 -143
  59. package/scripts/lean/native/author-fps.mjs +0 -545
  60. package/scripts/lean/native/author-games.mjs +0 -160
  61. package/scripts/lean/native/author-harvest.mjs +0 -74
  62. package/scripts/lean/native/author-primitive-proofs.mjs +0 -875
  63. package/scripts/lean/native/author-salvage.mjs +0 -71
  64. package/scripts/lean/native/chat-compose.mjs +0 -287
  65. package/scripts/lean/native/check-harvest-outcome-audio.mjs +0 -190
  66. package/scripts/lean/native/check-salvage.mjs +0 -200
  67. package/scripts/lean/native/compatibility.mjs +0 -34
  68. package/scripts/lean/native/concept.mjs +0 -633
  69. package/scripts/lean/native/draw-stroke.mjs +0 -26
  70. package/scripts/lean/native/erase-mask.mjs +0 -18
  71. package/scripts/lean/native/glb-loader.mjs +0 -468
  72. package/scripts/lean/native/harvest-recipe.mjs +0 -21
  73. package/scripts/lean/native/instance-steering.mjs +0 -24
  74. package/scripts/lean/native/intake-creator-agent.mjs +0 -98
  75. package/scripts/lean/native/intake-creator-tools.mjs +0 -218
  76. package/scripts/lean/native/interaction-gestures.mjs +0 -45
  77. package/scripts/lean/native/match-board.mjs +0 -138
  78. package/scripts/lean/native/modules/index.mjs +0 -54
  79. package/scripts/lean/native/modules/tap-collect.mjs +0 -54
  80. package/scripts/lean/native/path-network.mjs +0 -132
  81. package/scripts/lean/native/physics-2d.mjs +0 -154
  82. package/scripts/lean/native/physics-3d.mjs +0 -259
  83. package/scripts/lean/native/prepare-audio-collections.mjs +0 -112
  84. package/scripts/lean/native/prepare-fps-assets.mjs +0 -330
  85. package/scripts/lean/native/prepare-game-audio.mjs +0 -372
  86. package/scripts/lean/native/prepare-golf-3d-assets.py +0 -177
  87. package/scripts/lean/native/prepare-golf-assets.py +0 -211
  88. package/scripts/lean/native/prepare-harvest-audio.mjs +0 -83
  89. package/scripts/lean/native/prepare-harvest-images.mjs +0 -31
  90. package/scripts/lean/native/prepare-primitive-images.py +0 -25
  91. package/scripts/lean/native/prepare-space-salvage-images.mjs +0 -89
  92. package/scripts/lean/native/prepare-traffic-assets.py +0 -329
  93. package/scripts/lean/native/presentation.mjs +0 -335
  94. package/scripts/lean/native/review-agent-tools.mjs +0 -561
  95. package/scripts/lean/native/review-connection.mjs +0 -303
  96. package/scripts/lean/native/review-fields.mjs +0 -24
  97. package/scripts/lean/native/review-intake.mjs +0 -385
  98. package/scripts/lean/native/review-intents.mjs +0 -217
  99. package/scripts/lean/native/review-provider.mjs +0 -580
  100. package/scripts/lean/native/review-receipts.mjs +0 -76
  101. package/scripts/lean/native/review-resolver.mjs +0 -429
  102. package/scripts/lean/native/review-targets.mjs +0 -35
  103. package/scripts/lean/native/runtime.mjs +0 -1809
  104. package/scripts/lean/native/salvage-recipe.mjs +0 -20
  105. package/scripts/lean/native/stage-3d.mjs +0 -1121
  106. package/scripts/lean/native/verify.mjs +0 -4
  107. package/scripts/lean/scene-document.mjs +0 -48
@@ -1,396 +1,94 @@
1
- # Tora native authoring API
1
+ # Tora native authoring contract
2
2
 
3
- Native authoring creates an empty Creative Project 2.1 scene. The HTTP API and the
4
- local editor use the same `NativeService`, `ProjectStore`, `EditorState` commit
5
- lock, atomic history-pointer writer, validator, asset lowering, and compiler.
6
- Manual authoring and the supplied clients make zero model calls.
3
+ Tora 0.3 is a local, MCP-first authoring framework. External AI clients own reasoning, models, credentials, and execution. Tora provides deterministic native transactions, asset preparation, starters, scoped review candidates, QA, exports, and revision history. No Tora workflow calls a model provider.
7
4
 
8
- Run `npm run setup` to build the bounded PNG/JPEG decoder and optimizer entry points
9
- (`inspect_native` and `optimize_native`). Start `npm run dev:editor` and open
10
- <http://127.0.0.1:8001/?project=tiny-harvest-win-cta>. The default store is
11
- `.tora/native-projects`. `EDITOR_PORT`, `EDITOR_STORE`, and
12
- `EDITOR_PROJECT` override the defaults. The project URL opens its playable preview and review workspace.
5
+ Start the local editor with `npx @tora-editor/tora editor`, or `npm run dev:editor` from a source checkout. The default is `http://127.0.0.1:8001/?view=new`; projects live in `.tora/native-projects`. `EDITOR_PORT`, `EDITOR_STORE`, and `EDITOR_PROJECT` override source-checkout defaults.
13
6
 
14
- The supplied projects are unaccepted drafts with an example Google Play URL.
15
- Configure the intended store destination before creative approval or campaign use.
16
- Standalone export is not network qualification. The native compiler also supports
17
- `unity-ads-ua-playable`, `applovin-growth-playable`, `meta-audience-playable`,
18
- `google-ads-app-playable`, `ironsource-levelplay-playable`, `mintegral-appgrowth-zip`,
19
- and `tiktok-ads-playable`; their output is `ASSEMBLED_UNVERIFIED` until the exact HTML
20
- or ZIP passes static inspection. Official network preview and device acceptance remain
21
- separate gates. Unsupported network exports fail explicitly.
7
+ ## Native projects and transactions
22
8
 
23
- ## Asset sourcing
9
+ Projects remain Creative Project `2.1.0` documents. Scenes, components, variables, gameplay behaviors, events, event bindings, assets, variants, and revision identities use the existing serialized format. Do not rewrite stored projects when changing authoring clients.
24
10
 
25
- Studio intake retains authorized game assets with source hashes and a rights
26
- declaration. Sourced packs use free third-party artwork and audio with verified
27
- commercial-use licenses. Select one visual pack or style family for the whole
28
- playable. Audio may use a separate compatible pack. Record source URLs, authors,
29
- license identifiers and texts, attribution requirements, and original file hashes.
30
- Preserve downloaded source files through faithful asset preparation. Creating or
31
- generating replacement artwork and sound is outside this workflow.
11
+ Every edit is a `tora-transaction-1` envelope:
32
12
 
33
- `assets/free-assets/catalog.json` also exposes `audioCollections` for **Casual Warm**
34
- (`casual-warm`) and **Arcade Pop** (`arcade-pop`). Each maps `ambient`, `tap`,
35
- `match`, `reject`, `reward`, `win`, and `loss` to a distinct catalog cue ID. Ambient
36
- music comes from the retained CC0 Tarush Singhal and 3xBlast downloads; other cues
37
- retain their individual Kenney Interface Sounds or Music Jingles provenance rather
38
- than claiming to come from one archive. `audio-conversion.json` beside each family
39
- records source/output hashes and Web Audio conversion settings. Metadata is
40
- `auditionStatus:"analyzed"`: PCM measurements and licensing checks are complete,
41
- but human speaker/headphone audition and creative suitability remain separate.
42
-
43
- The BYOK creator uses the same validated transaction and media pipeline. Its three
44
- asset-source modes are enforced server-side: uploads only, uploads plus verified
45
- CC0, or verified CC0 only. The local catalog records dimensions/durations, 3D
46
- mesh facts, style families, hashes, authors, source URLs, and license evidence.
47
- Discovery searches Kenney, Quaternius, and CC0-filtered OpenGameArt. Automatic
48
- 3D fetching was verified with Kenney and OpenGameArt. The fetcher checks that the download
49
- and each redirect use HTTPS and an allowed origin with public DNS. It applies
50
- streaming and ZIP limits and stores normalized media with immutable v2 receipts
51
- under `.tora/remote-asset-cache/`. Each file and model dependency must pass the
52
- license checks in its nearest directory scope. Same-directory license conflicts
53
- fail closed. Each 3D preparation variant has a distinct stageable ID and a
54
- retained lossless master. The receipt records skipped models and their causes.
55
- Quaternius pages that only expose an external drive return structured
56
- manual-download guidance. Connectivity failures return local and cached matches.
57
- Downloads with unverifiable license evidence are rejected. A build is capped at
58
- 12 model turns and four minutes, supports cancellation and retry, and persists
59
- progress in the intake's `build.json`. Provider use remains billable to the
60
- creator's connected key.
61
-
62
- ## HTTP boundary
63
-
64
- Mutations require the exact local Origin and Host, `Content-Type: application/json`,
65
- and a body no larger than 1 MiB, except project/intake asset uploads, which allow
66
- 12 MiB to carry an 8 MB raw file in base64 JSON. IDs are local identifiers, never filesystem paths.
67
- Project IDs use lowercase letters, digits, and hyphens, start with a letter, and
68
- contain 2–48 characters. Object/record IDs permit lowercase letters, digits,
69
- underscores, dots, and hyphens, start with a letter, and contain at most 96 characters.
70
- `constructor`, `prototype`, and `__proto__` are reserved IDs; project ID `compose` is reserved for the legacy composer route.
71
-
72
- | Endpoint | Result |
73
- |---|---|
74
- | `POST /api/review/connection` | Local editor only. Accepts `{apiKey}`, checks it using the authenticated OrcaRouter model catalog, stores a valid key and returns `{configured:true}` |
75
- | `GET /api/projects/:id/review` | Feedback, candidate status, and configured feedback models |
76
- | `POST /api/projects/:id/review` | `action:"request"` saves notes with their expected revision and runs DeepSeek when configured. Set `paid:true` to opt that request into DeepSeek Pro. With the local `TORA_DETERMINISTIC_REVIEW=1` pilot, complete literal CTA commands and explicit typed outcome-cue controls instead use the same candidate service with zero provider calls. `action:"resolve"` resumes a saved request by ID. `action:"answer"` accepts `{requestId,answer}` for a clarification. Candidates await creator approval. |
77
- | `GET /api/creation/capabilities` | Registered visual/behavior contracts, typed defaults, constraints, units, operations, limits, conditions, and actual targets |
78
- | `POST /api/projects` | `{id,name,kind:"native-scene",androidUrl?}` → empty default scene and working revision |
79
- | `GET /api/projects` | Valid projects, kind, and native working revision |
80
- | `GET /api/assets/catalog` | Search verified local/cached assets and optionally live CC0 providers with `query`, `kind`, `styleFamily`, `includeRemote`, and `limit` |
81
- | `POST /api/assets/fetch-cc0` | Fetch a verified CC0 pack with `sourceUrl`, optional `fileFilter`/`fileFilters`, `kind`, 3D optimization options (`targetTriangles`, texture/byte targets, pivot/up-axis, preservation flags), and `maxFiles`; full parity with `tora_fetch_cc0_pack` |
82
- | `POST /api/assets/prep` | Prepare one or more workspace image/model items through the same hash-bound pipeline as `tora_prep_assets` |
83
- | `POST /api/projects/:id/stage-cc0` | `{expected,items}` stages verified assets atomically with optional per-item 3D overrides and retained-master lineage |
84
- | `GET /api/demos` | List only demos whose source assets are installed or whose projects are already materialized; lean npm installs return `{demos:[]}` |
85
- | `POST /api/demos/open` | Materialize an available demo, or return `422 E_DEMO_ASSETS_UNAVAILABLE` when its source pack is absent |
86
- | `GET /api/projects/:id?revision=ID` | Chosen immutable revision, or the working head when the query is absent |
87
- | `POST /api/projects/:id/transactions/preview` | Validate a transaction; return its digest, affected records, dependencies, asset references, and warnings |
88
- | `POST /api/projects/:id/transactions` | Build and atomically commit the exact previewed transaction |
89
- | `POST /api/projects/:id/history` | `{expected:{revisionId,contentHash},action:"save"\|"undo"\|"redo"}` |
90
- | `POST /api/projects/:id/accept` | Explicit `{revisionId,contentHash}` approval; no automatic acceptance |
91
- | `POST /api/projects/:id/export` | Explicit `{revisionId,target,fitTargetBudget?}` for standalone or any of the seven network profiles → HTML and manifest (with byte budget ledger and delivered `assetHashes`), plus `archiveBase64`/`archiveFilename` for ZIP targets. Set `fitTargetBudget:true` to opt in to deterministic export-time fitting without mutating stored revisions |
92
- | `POST /api/review-intakes/:id/submit` | `{}` or `{mode:"auto"\|"byok"\|"mcp"}`. A verified Gemini/OpenAI/Anthropic connection starts an asynchronous BYOK build; otherwise the existing `$0` MCP handoff is queued. |
93
- | `POST /api/review-intakes/:id/cancel` | `{}` aborts the active BYOK build and preserves its uploads and partial draft. |
94
- | `POST /api/review-intakes/:id/retry` | `{}` resumes a failed/cancelled BYOK build without re-uploading assets. |
95
- | `POST /api/projects/:id/assets` | `{expected,asset:{id,mime,data,rights,optimize?,preserveResolution?,maxTextureSide?,preserveGeometry?,targetTriangles?,useOriginal?}}` or batch `{expected,assets:[...]}`; raw base64 up to 8 MB (local MCP `filePath` supports up to 32 MiB for `.glb`/`.gltf`/`.obj`), non-destructive optimization, per-revision lineage tracking, real delivery decode validation, then one revision. `useOriginal:true` or a retained `sourceHash` may replace `data` when re-optimizing an existing asset |
96
- | `GET /api/projects/:id/assets/:assetId` | Asset hash, MIME, byte count, rights declaration, and provenance |
97
- | `GET /api/projects/:id/render?revision=ID` | Verified, lowered asset bytes and artifact identity for editor rendering |
98
-
99
- The review workspace uses the public project and revision endpoints directly.
100
-
101
- Successful transaction responses include `revisionId`, `contentHash`,
102
- `previousRevisionId`, artifact identity, actual effects, capabilities, and editor URL.
103
-
104
- Errors are JSON objects containing a stable `E_*` code, without stack traces or
105
- filesystem paths: 400 malformed input, 403 origin/protection failure, 404 missing
106
- project/revision/asset, 409 stale revision/preview or duplicate project, 413 limits,
107
- and 422 invalid references, contracts, resulting documents, or unsupported targets.
108
-
109
- ## Creative QA and review providers
110
-
111
- HTML export runs deterministic Creative QA before returning an artifact. It checks
112
- audio semantics/acoustics and pixel text statically, then reuses one Playwright
113
- browser across 320×568, 390×844, 768×1024, and 844×390 for layout and primary-input
114
- response within 150 ms. Blockers return `E_CREATIVE_QA` with a `tora-creative-qa-1`
115
- report; successful export manifests include QA evidence. Review candidates must pass
116
- the same gate before staging. MCP `tora_qa` runs it on demand and writes labeled PNGs.
117
- The CLI equivalent is:
118
-
119
- ```sh
120
- node scripts/lean/native/creative-qa.mjs path/to/index.html --output reports/creative-qa
121
- ```
122
-
123
- Opening and first-input states are covered by the integrated service. Generic
124
- end-card/timeout states require `--state-hook <globalFunction>` and are honestly
125
- reported as skipped or unavailable otherwise. This gate is not full-loop human
126
- playtesting, audio audition, device certification, or ad-network acceptance.
127
-
128
- OrcaRouter/DeepSeek remains the review default. `TORA_REVIEW_PROVIDER` also accepts
129
- `openai`, `anthropic`, `gemini`, and `openai-compatible`. Configure
130
- `TORA_REVIEW_MODEL` plus `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GEMINI_API_KEY`, or
131
- `TORA_REVIEW_API_KEY` respectively. `TORA_REVIEW_ENDPOINT` overrides the HTTPS URL
132
- (and is required for compatible endpoints); `TORA_REVIEW_PAID_MODEL` sets the paid
133
- route. Provider screenshots require explicit `TORA_REVIEW_VISION=1` and a suitable
134
- vision model. Otherwise they are omitted and counted in the textual request. No
135
- provider route bypasses typed edits, QA, candidate review, or explicit approval.
136
-
137
- ## Transaction example
138
-
139
- ```js
140
- const origin = 'http://127.0.0.1:8001';
141
- async function post(path, body) {
142
- const response = await fetch(origin + path, {
143
- method: 'POST', headers: {'Content-Type': 'application/json', Origin: origin},
144
- body: JSON.stringify(body),
145
- });
146
- const result = await response.json();
147
- if (!response.ok) throw Error(result.error);
148
- return result;
13
+ ```json
14
+ {
15
+ "format": "tora-transaction-1",
16
+ "expected": {"revisionId": "initial", "contentHash": "sha256:..."},
17
+ "operations": [
18
+ {"kind": "createComponent", "component": {
19
+ "id": "cta", "contract": "native.button.v1", "sceneId": "scene.play",
20
+ "transform": [1, 0, 0, 1, 80, 250], "parameters": {"width": 180, "height": 80}
21
+ }}
22
+ ]
149
23
  }
150
- const project = await post('/api/projects', {
151
- id: 'my-native-game', name: 'My native game', kind: 'native-scene',
152
- });
153
- const envelope = {
154
- format: 'tora-transaction-1',
155
- expected: {revisionId: project.revisionId, contentHash: project.contentHash},
156
- operations: [
157
- {kind: 'createComponent', component: {
158
- id: 'target', contract: 'native.button.v1', sceneId: 'scene.play',
159
- transform: [1, 0, 0, 1, 100, 250], parameters: {width: 180, height: 100},
160
- }},
161
- {kind: 'putVariable', variable: {
162
- id: 'score', label: 'Score', type: 'number', initial: 0,
163
- }},
164
- {kind: 'putEvent', event: {id: 'tap', kind: 'click', componentId: 'target'}},
165
- {kind: 'putBinding', binding: {
166
- id: 'award', eventId: 'tap', actions: [{kind: 'add', variableId: 'score', value: 1}],
167
- }},
168
- ],
169
- };
170
- const preview = await post('/api/projects/my-native-game/transactions/preview', envelope);
171
- // Review preview.effects, particularly dependency removals and shared references.
172
- const committed = await post('/api/projects/my-native-game/transactions', {
173
- ...envelope, previewDigest: preview.previewDigest,
174
- });
175
24
  ```
176
25
 
177
- The preview digest binds the base revision/hash, operation order, resulting
178
- content, and effects. Caller-supplied owner, protection, approval, or scope fields
179
- are rejected. Stale clients get a conflict rather than a silent rebase. The final
180
- candidate is validated and built before the locked head check and atomic publish.
181
- A failed operation or build leaves the previous revision and artifact usable.
182
-
183
- ## Document ownership
184
-
185
- The 2.1 schema is `packages/creative-project/project-v21.schema.json`. Structural
186
- TypeScript types and Rust schema identity are generated from the contract registry
187
- with `node scripts/m2/generate-project-v21.mjs`. `parseCreativeProject` recognizes
188
- both 2.0 and 2.1; the existing `parseProjectV2` entry point retains its 2.0 behavior.
189
- Rust `parse_project` recognizes both. The existing canonical content codec and hash
190
- domain are reused, with `revisionId` excluded from content identity.
26
+ Preview first, inspect actual changed records and dependency cascades, then commit the exact `previewDigest`. `scope` lists every intended changed record. `$project.base` authorizes project settings such as the Store URL and start scene. With `scopeCreates:true`, new records are allowed only when all their pre-existing component, behavior, event, binding, and variable references are also in scope. New assets and project settings are never implicitly authorized.
191
27
 
192
- Native documents have `base.kind="native-scene"`, runtime `tora-native/1.0.0`, and
193
- no Merge runtime spec or bundle reference. Components own their `sceneId`, optional
194
- `parentId`, numeric sibling `order`, local six-number affine `transform`, typed
195
- `parameters`, and asset slots. Scene membership and world transforms are derived.
196
- No editable scene tree is kept in extension data. Raster images are atomic leaves.
28
+ Operations cover scene creation/rename/deletion, component creation/rename/duplication/deletion, parameters, transforms, prototypes, ordering, reparenting, grouping, variables, behaviors, events, bindings, registered assets, asset replacement, start scene, and Store URL. Discover the exact operation and property vocabulary with `tora_capabilities`; do not rely on prose as the schema.
197
29
 
198
- `variables`, `gameplay`, `events`, and `eventBindings` are first-class collections.
199
- Bindings reference shared event sources by `eventId`, with typed conditions and
200
- ordered actions. `putBinding` also accepts an inline `event` as convenience input;
201
- the executor expands it to the stable ID `BINDING_ID.event`. The stored binding
202
- contains only the reference. Use explicit event IDs for long binding identifiers
203
- or intentionally shared sources.
30
+ Preview and commit use the same `NativeService`, validator, asset lowering, compiler, commit lock, and atomic history guards over MCP, HTTP, and the small CLI. A stale revision or digest fails without rebasing. Each commit is one undoable revision and does not itself grant creative approval.
204
31
 
205
- ## Operations and semantics
32
+ ## MCP authoring
206
33
 
207
- - Scenes: `createScene`, `renameScene`, `deleteScene`, `setStartScene`.
208
- - Objects: `createComponent`, `renameComponent`, `duplicateComponent`,
209
- `deleteComponent`, `setParameter`, `setTransform`, `setPrototype`,
210
- `reorderComponent`, `reparentComponent`, `group`, `ungroup`.
211
- - Gameplay: `putVariable`, `deleteVariable`, `putBehavior`, `deleteBehavior`,
212
- `putEvent`, `deleteEvent`, `putBinding`, `deleteBinding`.
213
- - Assets/store: `registerAsset`, `updateAsset` (replace the record for the same asset ID), `replaceAsset` (rewire a component), `setStore`.
34
+ Call `tora_brief` before authoring, then use `tora_capabilities({summary:true})` and scoped compact capability discovery. The 0.3 surface contains 20 tools:
214
35
 
215
- Read the capabilities response for the current contract/property vocabulary.
216
- Registered contracts are group, rectangle, ellipse, bounded vector path, image,
217
- sprite, walk sprite, text, and button. `native.sprite.v1` uses an image atlas in
218
- its `source` slot; `frameCount`, `frameColumns`, and `frameRate` select frames at
219
- runtime, while edit mode shows the first frame. `native.walk-sprite.v1` uses the
220
- same atlas properties, advances frames only when its world position changes, and
221
- returns to frame zero after movement stops. A text object can interpolate a
222
- declared variable as `{{score}}`.
223
- Buttons provide enabled/hover/pressed/disabled visual states and child visuals.
224
- Authors can set a button's optional `presentation` to `pixel-cta` for a beveled
225
- pixel face and a single reveal glint beneath its child label. Use the button's
226
- fill, hover fill, pressed fill, and stroke color to match the scene's palette.
36
+ - Discovery: `tora_brief`, `tora_capabilities`, `tora_inspect`, `tora_starters`.
37
+ - Projects: `tora_create`, `tora_compose_starter`, `tora_edit`, `tora_history`.
38
+ - Assets: `tora_list_assets`, `tora_fetch_cc0_pack`, `tora_stage_cc0_assets`, `tora_prep_assets`, `tora_upload_assets`.
39
+ - Delivery: `tora_render`, `tora_qa`, `tora_export`, `tora_variants`.
40
+ - External review: `tora_review_claim`, `tora_review_propose`, `tora_review_needs_scope`.
227
41
 
228
- `deleteComponent` takes `ids` and mode `subtree` or `retainChildren`. Ancestor and
229
- descendant selections are normalized. The preview lists dependency removals,
230
- including behaviors, event sources, and bindings. The reviewed digest is required
231
- for commit. Shared assets
232
- are retained. Deleting a variable still referenced by text requires an explicit
233
- text edit in the transaction; it cannot leave a dangling interpolation.
42
+ Use `tora_create` for an empty native project and `tora_edit` for generic scene authoring. The three starters are `stack-and-serve` (3D burger), `tap-targets` (2D racing), and `tap-targets-3d` (3D multi-target tap with `ui-anchor-3d`). `tora_starters` is also the source of browser card metadata. `deliver:true` writes the draft, editable bundle, and QA evidence.
234
43
 
235
- Reparenting accepts optional `parentId` and/or destination `sceneId`. It preserves
236
- the full world affine matrix, rejects singular destination transforms and cycles,
237
- and warns about changed inherited clipping, opacity, or lifecycle. Grouping uses
238
- the nearest common parent. Sibling order drives painting and reverse hit-testing.
239
- Duplication remaps subtree objects, behaviors, event sources, and bindings; external
240
- references remain external and are listed in the preview.
44
+ `tora_upload_assets` handles one or up to 32 assets; use a one-item batch for a single file. Prefer workspace `filePath` values to avoid MCP frame limits. PNG/JPEG/WAV/MP3 uploads accept up to 8 MB; workspace GLB/glTF/OBJ inputs accept up to 32 MiB. Delivery assets are bounded to 700,000 bytes and original masters and license evidence are retained. Use `tora_prep_assets` for mechanical image work and dependency-aware 3D preparation.
241
45
 
242
- Each transaction is one history entry. Save persists the shared working pointer;
243
- it does not approve content. Undo/redo move that pointer. Accepted snapshots remain
244
- immutable; subsequent edits produce new working revisions. Native history lives in
245
- the existing `.tora/editor-state` service, not a rescue-specific save directory.
46
+ `tora_inspect({id,tree:true})` returns a compact scene outline. `includeReview:true` adds compact pending review summaries. `tora_variants` manages locale and creative overlays. External clients supply translations through `upsert`; there is no automatic translation operation.
246
47
 
247
- ## Runtime and asset bounds
248
-
249
- | Resource | Limit |
250
- |---|---:|
251
- | Authored objects / scenes | 384 / 16 |
252
- | Behavior + binding records | 384 combined |
253
- | Event sources / variables | 256 / 64 |
254
- | Operations / transaction bytes | 256 / 1 MiB |
255
- | Authored document / parsed nodes / nesting | 4 MiB / 100,000 / 64 |
256
- | Spawned root instances / runtime nodes | 128 / 4,096 |
257
- | Particles / colliders / narrow-phase pairs per frame | 256 / 256 / 4,096 |
258
- | Physics bodies / adaptive substeps | 64 / 16 |
259
- | Path nodes / edges / agents per network document | 64 / 128 / 64 |
260
- | Processed events / actions per frame | 256 / 1,024 |
261
- | Raw image/audio upload / optimized delivery asset | 8,000,000 / 700,000 bytes |
262
- | Raw 3D model upload / optimized delivery asset | 32 MiB via workspace `filePath` / 700,000 bytes |
263
- | 3D automatic soft target / explicit byte target | 250,000 / 4,096–700,000 bytes |
264
- | 3D triangle target / texture delivery cap | 32–50,000 / 16–1,024 px per side |
265
- | 3D skins / joints per skin / animation clips | 4 / 64 / 16 (`LINEAR` or `STEP`) |
266
- | Other individual assets (including Tora meshes) | 700,000 bytes |
267
-
268
- The simulation uses a 1/60-second fixed step and at most five catch-up steps per
269
- animation frame. Pause/visibility changes reset accumulated time. Replay resets
270
- runtime variables, instances, contacts, animations, particles, and audio without
271
- rewriting authored data. Instances have runtime IDs and refer back to authored
272
- prototype subtrees. They never enter authoring history.
273
-
274
- Behaviors implement axis/both-axis dragging, velocity/gravity, timers and authored
275
- spawn schedules, box/circle colliders, property animation, particle emitters, and
276
- audio. Colliders use the same world transforms and inherited visibility/clipping
277
- as rendering. Circle collision uses a bounded 32-sided approximation after affine
278
- transformation. Execution budgets terminate the offending chain and expose a
279
- runtime diagnostic.
280
-
281
- ### Physics, paths, economy, and camera primitives
282
-
283
- All packs remain additive Creative Project 2.1 JSON; authors never supply functions, property paths, or executable simulation code. Discover the exact descriptors through `/api/creation/capabilities`.
284
-
285
- - `physics-body`: `dynamic`, `static`, or `kinematic` circles/boxes with bounded restitution, rolling `friction`, `linearDamping`, `gravity`, speed/rest thresholds, optional `wallBounce`, and optional `spinToRotation`. Dynamic bodies use at most 16 adaptive substeps per fixed tick. Linear `motion` cannot share a component with a physics body.
286
- - `aim-launch`: pullback (`invert:true`) or direct aiming on the body or anywhere, bounded pull/speed ranges, rest gating, 3–16 trajectory dots with up to two predicted bounces, and optional numeric `powerVariableId`. It requires a dynamic `physics-body` on the same component. Release emits `launch`.
287
- - `capture-zone`: speed-gated radial capture with optional rim `pullStrength`, body stopping, and captured-object hiding. `oscillate` provides deterministic sinusoidal kinematic gates on x/y with analytical velocity.
288
- - `path-network`: attached to a group; contains 2–64 unique `{id,x,y,holdSeconds?,cost?}` nodes and 1–128 unique `{id,from,to,speedScale?,enabled?,bidirectional?,cost?}` edges. Routing is deterministic Dijkstra with lexical ID tie-breaking. `path-agent` selects network/start/target, speed and optional numeric speed multiplier, headway `spacing`, rounded corners, orientation, loop mode, and active state. `path-gate` provides open/closed/cycle control, phase offsets, and per-agent holds. Edge/gate edits replan live agents from their next node without teleporting.
289
- - `value-meter`: scales a visual on x/y from a numeric variable between `min < max`, in either direction with deterministic smoothing. `camera-follow` belongs on a root world group and follows a same-scene target within world bounds using bounded smoothing and zoom. Camera-world children may extend beyond the stage without a false stage-overflow finding.
290
-
291
- Physics events are `launch`, `bodyBounce`, `bodyRest`, and `zoneCapture`; path events are `pathArrive` and `pathBlocked`. They use `componentId`, optional `otherId`, or optional `nodeId` as described by the generated schema.
292
-
293
- New actions are `setVelocity`, `applyImpulse`, `setPosition`, `stopBody`, `setPathEdge`, `setPathTarget`, `setPathGate`, `spawnOnPath`, and `spawnAt`. `compute` applies `add | sub | mul | div | min | max | set` to a numeric variable using either `value` or `operandVariableId`, with optional integer `round`. Results must remain finite and within the runtime variable bound. Conditions accept either a literal `value` or `compareVariableId`, for example `{variableId:'cash',op:'gte',compareVariableId:'upgradeCost'}`.
294
-
295
- `spawnOnPath` requires a path-agent prototype and an existing network/start/target. `setPathEdge` takes the network behavior ID and optional non-negative `cost`; `setPathGate` takes the gate behavior ID. Runtime `state()` exposes read-only `physics` body/aim snapshots and `paths` network, route, active-agent, and queued-agent snapshots. Generic editor review supports `opening`, `first-input`, `end-card`, and `timeout` for the new genres while retaining the dedicated Harvest and Salvage replay paths.
296
-
297
- Use emitter shape `pixel-confetti` for stepped pieces with varied size, turn, and
298
- timing. Optional `color2` and `color3` add to the base `color`. Use
299
- `origin: "anchor"` for the component's local origin or omit it for the
300
- component's center. Set optional `direction` in degrees to aim the spread (up
301
- is -90 and left is -180). Confetti within a clipping group stays inside
302
- that group. The runtime honors reduced motion by suppressing pixel confetti and
303
- the CTA glint while retaining the static button treatment. Set pixel-confetti
304
- `coverage: "screen"` for a shower distributed across the canvas.
305
-
306
- Edit mode does not advance simulation or execute scene-entry actions. Inspection
307
- of another scene cannot unlock audio or invoke the store. Audio requires permitted
308
- interaction; store actions additionally require a current trusted interaction.
309
- Store opening requires a trusted pointer release over the original target.
310
- Store destinations are HTTPS Google Play/App Store URLs.
311
-
312
- Network exports bind the exact host adapter: Unity Ads requires MRAID 3.0, AppLovin
313
- requires MRAID 2.0, Meta calls `FbPlayableAd.onCTAClick()`, Google Ads calls
314
- `ExitApi.exit()`, ironSource uses DAPI, Mintegral uses its gameReady/gameStart/install
315
- lifecycle, and TikTok calls `openAppStore()`. Only the declared Google ExitApi and
316
- TikTok SDK script URLs are embedded; all other hosts are injected and no navigation
317
- fallback exists. Simulation starts only after host readiness, visibility, and the
318
- first trusted interaction. Hidden/closed hosts cancel input and suspend or stop audio.
319
- Only a deliberate CTA invokes the vendor store method. Network builds use the pinned
320
- `crates/packer/trusted/native.js` or `native-3d.js` bundle and fail if it is stale.
321
- Google/Mintegral/TikTok produce deterministic ZIPs with fixed timestamps, sorted paths,
322
- CRC32 checks, and exact profile-specific layouts.
323
-
324
- Check the exact exported `index.html` before review:
325
-
326
- ```sh
327
- cargo run -p playable-cli -- artifact check index.html \
328
- --network unity-ads-ua-playable --confirm-reviewed 2026-11-20 --json
329
- cargo run -p playable-cli -- artifact check index.html \
330
- --network applovin-growth-playable --confirm-reviewed 2026-11-24 --json
331
- cargo run -p playable-cli -- artifact check my-game-tiktok.zip \
332
- --network tiktok-ads-playable --confirm-reviewed 2026-11-26 --json
333
- ```
48
+ ## HTTP boundary
334
49
 
335
- Use each profile's current `reviewedAt` date for confirmation. Mintegral requires
336
- `project-id.zip` containing `project-id/project-id.html`; TikTok ZIPs contain root
337
- `index.html` and `config.json`; Google ZIPs contain root `index.html`.
50
+ Mutations require the exact local Origin and Host, `Content-Type: application/json`, and the documented body limits. Project IDs use 2–48 lowercase letters, digits, and hyphens and start with a letter. Record IDs permit lowercase letters, digits, underscores, dots, and hyphens, start with a letter, and are at most 96 characters.
338
51
 
339
- `STATIC_PASS` covers the reviewed rules, fixed shell/runtime, schema, inline assets,
340
- hashes, size, responsive orientation, and destination. It does not establish human
341
- creative approval, physical-device behavior, official network acceptance, or campaign
342
- effectiveness.
52
+ | Endpoint | Behavior |
53
+ |---|---|
54
+ | `GET /api/creation/capabilities` | Canonical contracts, operations, limits, and network targets |
55
+ | `GET/POST /api/projects` | List or create empty native projects |
56
+ | `POST /api/projects/import` | Import an editable `.tora.json` bundle |
57
+ | `GET /api/starters`, `POST /api/starters/compose` | Discover or instantiate the two starters |
58
+ | `GET /api/demos`, `POST /api/demos/open` | List available showcases or import their preserved native fixture |
59
+ | `GET /api/projects/:id` | Read the working or requested immutable revision; `tree=1` returns an outline |
60
+ | `POST /api/projects/:id/transactions/preview` | Validate operations and return effects and digest |
61
+ | `POST /api/projects/:id/transactions` | Commit the exact preview atomically |
62
+ | `POST /api/projects/:id/history` | Save, undo, or redo against the expected identity |
63
+ | `POST /api/projects/:id/accept` | Explicitly approve a revision |
64
+ | `POST /api/projects/:id/assets` | Upload one asset or `{assets:[...]}` in one revision |
65
+ | `GET /api/assets/catalog`, `POST /api/assets/fetch-cc0`, `POST /api/assets/prep` | Discover, fetch, and prepare verified assets |
66
+ | `POST /api/projects/:id/stage-cc0` | Stage verified CC0 assets atomically |
67
+ | `GET/POST /api/projects/:id/variants` | List, materialize, upsert, delete, or preset variants |
68
+ | `POST /api/projects/:id/export` | Export standalone or one of seven network profiles |
69
+ | `POST /api/projects/:id/export-matrix` | Start a pinned target/variant matrix; poll its job URL |
70
+ | `POST /api/projects/:id/qa` | Run Creative QA on a revision |
71
+ | `GET /api/projects/:id/render` | Lower assets and return preview identity |
72
+ | `GET/POST /api/projects/:id/review` | Create/read scoped requests and candidates, promote, or discard |
343
73
 
344
- PNG/JPEG uploads use a separate bounded Rust optimizer that accepts benign color
345
- metadata and normalizes uploaded pixels without weakening strict artifact inspection.
346
- Auto mode searches exact PNG encodings, selects JPEG for suitable opaque photo-like
347
- images, quantizes when needed, and uses bounded proportional downscaling only to meet
348
- limits. Lossless mode never quantizes or resizes; `none` retains exact bytes only when
349
- they already fit delivery constraints. WAV/MP3 optimization uses local GStreamer or
350
- FFmpeg when available and otherwise falls back to deterministic PCM WAV downsampling.
351
- SVG/HTML uploads are rejected. Decode staging is removed on failure. Untouched original
352
- uploads are content-addressed under `sources/assets/originals/`; delivery bytes and
353
- optimization receipts live under `sources/assets/`. Authored asset records retain the
354
- same six schema fields, rights, and provenance. Preview and export lower the same
355
- verified delivery bytes. Object deletion does
356
- not remove shared source assets. No automatic unreferenced-asset cleanup runs.
74
+ Removed provider, intake, free-pack/chat composition, automatic translation, and legacy composition routes return the normal unknown-route response. Store changes use ordinary native transactions.
357
75
 
358
- ## Reproduce and verify
76
+ ## Scoped external review
359
77
 
360
- Use new IDs when reproducing; existing projects are never overwritten:
78
+ A new request uses journal format `tora-review-journal-2` and contains a request UUID, exact baseline, and one to eight notes. Each note has its own UUID, text, optional captured JPEG frame and scene/moment context, explicit record scopes, and `allowCreates`. General notes must choose a scope. `$project.base` explicitly authorizes project settings.
361
79
 
362
- ```sh
363
- node scripts/lean/native/author-games.mjs http://127.0.0.1:8001 rescue-copy rescue reports/rescue-copy
364
- node scripts/lean/native/author-games.mjs http://127.0.0.1:8001 tap-copy tap reports/tap-copy
365
- npm run test:native
366
- ```
80
+ The external client calls `tora_review_claim`, inspects the baseline, then calls `tora_review_propose` with native `operations`, a proposal UUID, summary, and every note UUID in `addressedNoteIds`. It does not submit a scope; effective authorization comes only from the stored request. Use `tora_review_needs_scope` when broader authorization is required.
367
81
 
368
- The client reads capabilities, creates an empty project, uploads sourced audio with verified license evidence,
369
- authors all objects and gameplay through transactions, and exports the identified
370
- revision. It writes downloaded HTML/manifests only. It never edits project storage,
371
- injects scripts, or modifies compiled HTML.
82
+ Tora previews the operations, enforces scope against the actual diff including cascades and deletions, builds an isolated candidate, and runs standalone-browser QA. The working revision does not move. Proposals may reference registered project assets but cannot ingest asset bytes. Failed QA remains diagnostic and cannot be promoted. Duplicate proposal UUIDs are idempotent only for identical payloads.
372
83
 
373
- Packaged-game evidence in `docs/evidence/native-authoring` covers offline
374
- playback of both exported concepts, win and loss, replay, and trusted CTA activation.
375
- Native tests also cover transaction conflicts, execution budgets and asset rejection. Browser and agent
376
- visual checks do not constitute human creative approval, physical-device testing,
377
- official network acceptance, or advertising-effectiveness evidence.
84
+ The browser presents baseline/candidate previews and accept/discard controls. Acceptance rechecks baseline and digest and commits one undoable revision. Stale or failed candidates cannot be promoted. Previous review journals remain read-only history; create a fresh scoped request to reuse their notes.
378
85
 
379
- ## Verification dependencies
86
+ ## QA, exports, and saved content
380
87
 
381
- `npm run verify:native` checks only the native SaaS stack, including the Creative QA
382
- unit gate, trusted runtime parity, native browser tests, and the relevant Rust crates.
383
- Native composition and native browser tests use the native asset decoder and optimizer.
88
+ Creative QA checks static audio/text rules and exercises 320×568, 390×844, 768×1024, and 844×390 layouts and primary input. Review candidates use standalone-browser QA; network acceptance remains an export concern. `tora_qa` can also capture motion filmstrips and optional WebM footage. Inspect real full-size screenshots and playback, not only contact sheets.
384
89
 
385
- ## Legacy compatibility
90
+ The seven network targets are Unity Ads, AppLovin, Meta, Google Ads, ironSource/LevelPlay, Mintegral, and TikTok. Network exports run Creative QA and independent Rust artifact inspection on the exact delivered bytes. Google, Mintegral, and TikTok use deterministic ZIPs. `fitTargetBudget:true` re-optimizes from retained masters without changing the stored revision. `confirmReviewed` is forwarded only when explicitly supplied.
386
91
 
387
- `POST /api/projects` with `kind:"legacy-template"` explicitly selects the existing
388
- legacy initializer. `/api/projects/compose` retains its merge-grid creative-plan
389
- vocabulary, expected `revision/contentDigest`, and existing request bounds. It does
390
- not compose native mechanics. Existing 2.0 projects are not migrated on open.
92
+ Showcase demos import preserved editable native fixtures from `source/showcase`; large fixtures and asset packs are excluded from the lean package and unavailable demos stay hidden. Existing saved projects, legacy gameplay behaviors, specialized QA playthroughs, and supported variant overlays remain intact. The Rust verifier remains an independent offline check even where JS has equivalent validation.
391
93
 
392
- Legacy shared artwork definitions are separated from their visual instances for
393
- parenting/deletion and preview restoration. The fixed Ding & Dang runtime, model,
394
- compiler, workspace, bridge, fixtures, tests, obsolete saves, and generated outputs
395
- were removed using the explicit inventory in
396
- `reports/native-production/retirement-inventory.json`. No archive was created.
94
+ Engineering verification, AI visual inspection, human approval, physical-device testing, and official ad-network acceptance are separate statuses.
@@ -5,9 +5,9 @@ Native projects are editable Creative Project `2.1.0` documents running on `tora
5
5
  ## Required workflow
6
6
 
7
7
  1. Read the production, playable, win/CTA, and UI briefs returned with this guide. They remain authoritative.
8
- 2. Discover exact contracts before editing. Use `tora_capabilities({packs:[...]})` or BYOK `discover_contracts({packs:[...]})` for only the mechanics you need. Use `tora_brief({packs:[...]})` for the matching guides. `full:true` returns the complete legacy authoring references.
8
+ 2. Discover exact contracts before editing. Use `tora_capabilities({packs:[...]})` for only the mechanics you need. Use `tora_brief({packs:[...]})` for the matching guides. `full:true` returns the complete authoring reference.
9
9
  3. Create or inspect a project and retain its exact `{revisionId,contentHash}`. Build edits as `tora-transaction-1` operations. Preview them, review effects and dependency removals, list every intended changed record in `scope`, then commit the exact preview digest. Reinspect stale revisions rather than replaying edits.
10
- 4. Use sourced assets with verified commercial-use rights. Keep one visual style family per playable; audio may use a separate compatible family. Preserve source URLs, authors, licenses, original paths, and hashes. Upload through the asset operation or BYOK `stage_assets`.
10
+ 4. Use sourced assets with verified commercial-use rights. Keep one visual style family per playable; audio may use a separate compatible family. Preserve source URLs, authors, licenses, original paths, and hashes. Upload through the asset operation.
11
11
  5. Render, run Creative QA, export, and inspect actual packaged screenshots and motion. Automated QA is not human visual approval, device testing, campaign-effectiveness evidence, or official network acceptance.
12
12
 
13
13
  ## Transaction and delivery essentials
@@ -34,6 +34,12 @@ Native projects are editable Creative Project `2.1.0` documents running on `tora
34
34
 
35
35
  Pack guides are intentionally concise. Exact property descriptors, bounds, defaults, operations, limits, conditions, variable types, and targets come from the capability registry rather than prose examples.
36
36
 
37
+ ## Preserved Crop Sort projects
38
+
39
+ Existing Crop Sort projects remain editable native documents. Each crop has a `drag` tag, its matching crate has a one-capacity `drop-zone` with `acceptTags` and `onOccupied:"reject"`, correct drops snap and score through `dragDrop`, and rejected drops use `returnToOrigin`. Idle drag guidance, responsive layouts, licensed audio, win and timeout scenes, and Store CTAs are preserved in `source/fixtures/crop-sort.tora.json`.
40
+
41
+ The sorting compatibility adapter supplies overlay-compatible `shorter-hook`, `easier-win`, and `high-contrast-cta` variant pieces. The easier preset changes the timer, initial time, and meter range together. QA plays all three real pointer drags and prepares timeout with a real rejected drag. Production editing and review use generic native operations rather than concept builders or game-specific review fields.
42
+
37
43
  ## Core authoring limits and safety
38
44
 
39
45
  Discover current numeric limits programmatically. Runtime execution budgets are fixed independently of authored collection caps. Large event/action chains terminate with diagnostics rather than running unbounded. Component, variable, behavior, event, asset, scene, path, and store references must resolve and have compatible types.
@@ -11,7 +11,7 @@ Call `tora_brief`, then `tora_starters` to see the play styles. For a simple coo
11
11
  }
12
12
  ```
13
13
 
14
- Pass that object to `tora_compose_starter`. For a tap-and-collect challenge, use `tap-targets` to start with four toy race cars arriving in different pit boxes. Choose a fresh ID for each project.
14
+ Pass that object to `tora_compose_starter`. For a 2D tap-and-collect challenge, use `tap-targets` to start with four toy race cars arriving in different pit boxes. For a 3D direct-tap playable with multiple tappable 3D objects, projected `ui-anchor-3d` touch rings, and portrait/landscape camera framing, use `tap-targets-3d` (`art` roles `target1`–`target4` accept any valid CC0 GLB models, normalized automatically onto the counter). Choose a fresh ID for each project.
15
15
 
16
16
  The starter can use a different palette (`background`, `surface`, `ink`, `accent` as six-digit hex colors), win or timeout title, or CTA label. Pass `durationSeconds` from 10 to 60 and `winHoldSeconds` from 0.25 to 3 to tune the timing. The win hold begins when the last goal is completed. Titles and CTA labels are up to three words and 24 characters. Headline and button text require a contrast ratio of at least 4.5:1 against their respective backgrounds.
17
17
 
@@ -8,6 +8,8 @@ For general 3D assets (`model/gltf-binary`), author multi-part textured `.obj`+`
8
8
 
9
9
  `physics-3d` supplies bounded dynamic/static/kinematic movement. `aim-launch-3d` handles pullback or direct launch and trajectory display. `capture-zone-3d` performs speed/height-gated capture, and `oscillate-3d` moves a component sinusoidally. These are separate from 2D canvas physics and cannot be assumed interchangeable.
10
10
 
11
+ To attach 2D UI rings, labels, callouts, or touch buttons directly to 3D objects without manual portrait/landscape coordinates, attach `ui-anchor-3d` to a 2D component (`button`, `group`, `text`, `ellipse`, `rectangle`, `image`) with `targetId` pointing to a `native.mesh3d.v1` in the same scene. `ui-anchor-3d` projects the target's world-space 3D `Box3` across portrait and landscape cameras (including boxed and full-bleed stages, nested `mesh3d` hierarchies, and moving 3D objects) before painting 2D layers. Set `anchor` (`center` | `top` | `bottom`) and optional `offsetX`/`offsetY` for callout placement; set `fitToProjectedBounds: true` (with `paddingPx`, `minSizePx` defaulting to `48`, `maxSizePx`, and optional `squareBounds: true`) to derive touch target dimensions directly from the projected 3D bounds; set `showHighlight: true` (`highlightStyle: 'pulse-ring' | 'ring' | 'box'`, `highlightColor`) to draw a projected highlight directly around the 3D object; and keep `syncVisibility: true` so hiding the 3D mesh automatically hides its 2D overlay. Do not combine `ui-anchor-3d` with `responsive-layout`, `drag`, or `motion` on the same component. Creative QA automatically audits `ui-anchor-3d` across all four viewports for off-screen/clipped 3D targets (`anchor-3d-target-offscreen`), misaligned overlays (`anchor-3d-misaligned`), and foreground 3D mesh occlusion (`anchor-3d-occluded`), and reports compact projected bounds in `checks.browser.anchors3d`.
12
+
11
13
  For a landing or impact, place a mesh origin at the contact point and attach an `emitter` with `origin: 'contact-3d'`, `coverage: 'local'`, and `shape: 'circle'` for crumbs or `shape: 'confetti'` for tumbling pieces. An invisible mesh can supply the point when the visible asset's pivot is elsewhere. Trigger `emit` when the pieces touch. The burst follows the 3D camera and respects depth and reduced motion. Speed and gravity use 100 authored units per world unit. Start with 12 particles, `speed: 145`, `gravity: 300`, `lifetime: 0.45`, and colors drawn from the artwork. Reserve screen-wide confetti for the outcome.
12
14
 
13
15
  For first-person 3D shooters and turret/arena games, attach `fps-controller-3d` to a `native.stage3d.v1`. Bind a `virtual-joystick` to `aimJoystickBehaviorId` to steer camera yaw/pitch aiming directly: `aimMode: 'delta'` (default) provides direct 1:1 thumb/mouse aiming (like Sniper 3D / COD Mobile — aim rotates only while moving and stops immediately when held still, using `lookSensitivity`), while `aimMode: 'rate'` pans continuously at `aimTurnSpeed` rad/s. Use `minYaw`/`maxYaw` and `minPitch`/`maxPitch` to bound the firing arc, `moveSpeed: 0` for a fixed-position turret/sniper shooter, or bind `joystickBehaviorId` (or `moveXVariableId`/`moveYVariableId`) for camera-relative movement with OBB wall-sliding against static `physics-3d` boxes; `lookMode: 'drag'` also supports multi-touch drag-to-look. Set `attachToCamera: true` on `native.mesh3d.v1` nodes for first-person viewmodels. Use `spawnAt3d` to instantiate `mesh3d` prototypes — pass `fromComponentId` or `fromTeam` with local yaw-rotated `offsetX`/`offsetY`/`offsetZ` so projectiles emerge directly from a living, visible 3D actor's actual weapon muzzle (and never fire from dead/hidden actors or random world coordinates), `steer-3d` for enemy pursuit/strafe/patrol or 3D homing projectiles (`stopDistance <= 0.5`), and `raycast3d` (`mode: 'crosshair' | 'pointer'`, optional `targetTeam`) to fire hitscan shots that emit `raycastHit3d` (integrating with `instance-state` / `modifyInstanceState` / `instanceDepleted` / `despawn`) or `raycastMiss3d`, while static `physics-3d` walls occlude shots.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tora-editor/tora",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Local MCP-first 2D & 3D HTML5 playable ad engine with Creative QA and 7 ad-network exporters.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -31,11 +31,11 @@
31
31
  "playwright": "1.64.1"
32
32
  },
33
33
  "optionalDependencies": {
34
- "@tora-editor/native-darwin-arm64": "0.2.0",
35
- "@tora-editor/native-darwin-x64": "0.2.0",
36
- "@tora-editor/native-linux-x64-gnu": "0.2.0",
37
- "@tora-editor/native-linux-arm64-gnu": "0.2.0",
38
- "@tora-editor/native-win32-x64-msvc": "0.2.0"
34
+ "@tora-editor/native-darwin-arm64": "0.3.0",
35
+ "@tora-editor/native-darwin-x64": "0.3.0",
36
+ "@tora-editor/native-linux-x64-gnu": "0.3.0",
37
+ "@tora-editor/native-linux-arm64-gnu": "0.3.0",
38
+ "@tora-editor/native-win32-x64-msvc": "0.3.0"
39
39
  },
40
40
  "engines": {
41
41
  "node": ">=22.0.0"