@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.
- package/README.md +5 -6
- package/bin/tora.mjs +255 -29
- package/crates/packer/trusted/native-3d-meta.json +3 -3
- package/crates/packer/trusted/native-3d.js +180 -180
- package/crates/packer/trusted/native-meta.json +3 -3
- package/crates/packer/trusted/native.js +5 -5
- package/crates/packer/trusted/release-manifest.json +17 -17
- package/crates/packer/trusted/review-runtime-meta.json +3 -3
- package/crates/packer/trusted/review-runtime.js +182 -182
- package/docs/MIGRATION_0_3.md +39 -0
- package/docs/NATIVE_AGENT_TOOLS.md +12 -363
- package/docs/TORA_AGENT_SETUP.md +24 -106
- package/docs/TORA_CREATION_API.md +63 -365
- package/docs/reference/CORE_AUTHORING.md +8 -2
- package/docs/reference/PLAYABLE_STARTERS.md +1 -1
- package/docs/reference/packs/3d.md +2 -0
- package/package.json +6 -6
- package/packages/creative-project/project-v21.schema.json +108 -1
- package/scripts/lean/editor/entry.js +11 -6
- package/scripts/lean/editor/project-launcher.js +116 -0
- package/scripts/lean/editor/quick-edit-panel.js +479 -0
- package/scripts/lean/editor/review-editor.css +246 -68
- package/scripts/lean/editor/review-editor.js +1731 -1099
- package/scripts/lean/editor-state.mjs +6 -0
- package/scripts/lean/editor.mjs +6 -3
- package/scripts/lean/matrix.mjs +5 -0
- package/scripts/lean/native/agent-tools.mjs +35 -58
- package/scripts/lean/native/api.mjs +148 -134
- package/scripts/lean/native/audio-assets.mjs +30 -0
- package/scripts/lean/native/browser-pool.mjs +34 -0
- package/scripts/lean/native/build-cache.mjs +36 -5
- package/scripts/lean/native/contracts.mjs +8 -6
- package/scripts/lean/native/creative-qa.mjs +66 -12
- package/scripts/lean/native/demos.mjs +11 -20
- package/scripts/lean/native/document.mjs +14 -2
- package/scripts/lean/native/local-bundle.mjs +4 -2
- package/scripts/lean/native/mcp-server.mjs +16 -35
- package/scripts/lean/native/modules/harvest-restore.mjs +3 -284
- package/scripts/lean/native/modules/sort-puzzle.mjs +51 -0
- package/scripts/lean/native/modules/star-salvage.mjs +3 -368
- package/scripts/lean/native/project-bundle.mjs +3 -2
- package/scripts/lean/native/project-index.mjs +0 -2
- package/scripts/lean/native/qa-adapters.mjs +10 -0
- package/scripts/lean/native/quick-edit.mjs +328 -0
- package/scripts/lean/native/review.mjs +203 -572
- package/scripts/lean/native/schema-vocabulary.mjs +10 -0
- package/scripts/lean/native/schema.mjs +1 -1
- package/scripts/lean/native/scope.mjs +45 -0
- package/scripts/lean/native/service.mjs +242 -70
- package/scripts/lean/native/starters.mjs +135 -8
- package/scripts/lean/native/variant-adapters.mjs +8 -0
- package/scripts/lean/native/variants-core.mjs +186 -0
- package/scripts/lean/native/variants.mjs +63 -0
- package/scripts/lean/native/win-cues.mjs +1 -1
- package/skills/tora-playables/SKILL.md +1 -1
- package/scripts/lean/editor/review-intake.js +0 -837
- package/scripts/lean/model-client.mjs +0 -119
- package/scripts/lean/native/author-expansion-proofs.mjs +0 -143
- package/scripts/lean/native/author-fps.mjs +0 -545
- package/scripts/lean/native/author-games.mjs +0 -160
- package/scripts/lean/native/author-harvest.mjs +0 -74
- package/scripts/lean/native/author-primitive-proofs.mjs +0 -875
- package/scripts/lean/native/author-salvage.mjs +0 -71
- package/scripts/lean/native/chat-compose.mjs +0 -287
- package/scripts/lean/native/check-harvest-outcome-audio.mjs +0 -190
- package/scripts/lean/native/check-salvage.mjs +0 -200
- package/scripts/lean/native/compatibility.mjs +0 -34
- package/scripts/lean/native/concept.mjs +0 -633
- package/scripts/lean/native/draw-stroke.mjs +0 -26
- package/scripts/lean/native/erase-mask.mjs +0 -18
- package/scripts/lean/native/glb-loader.mjs +0 -468
- package/scripts/lean/native/harvest-recipe.mjs +0 -21
- package/scripts/lean/native/instance-steering.mjs +0 -24
- package/scripts/lean/native/intake-creator-agent.mjs +0 -98
- package/scripts/lean/native/intake-creator-tools.mjs +0 -218
- package/scripts/lean/native/interaction-gestures.mjs +0 -45
- package/scripts/lean/native/match-board.mjs +0 -138
- package/scripts/lean/native/modules/index.mjs +0 -54
- package/scripts/lean/native/modules/tap-collect.mjs +0 -54
- package/scripts/lean/native/path-network.mjs +0 -132
- package/scripts/lean/native/physics-2d.mjs +0 -154
- package/scripts/lean/native/physics-3d.mjs +0 -259
- package/scripts/lean/native/prepare-audio-collections.mjs +0 -112
- package/scripts/lean/native/prepare-fps-assets.mjs +0 -330
- package/scripts/lean/native/prepare-game-audio.mjs +0 -372
- package/scripts/lean/native/prepare-golf-3d-assets.py +0 -177
- package/scripts/lean/native/prepare-golf-assets.py +0 -211
- package/scripts/lean/native/prepare-harvest-audio.mjs +0 -83
- package/scripts/lean/native/prepare-harvest-images.mjs +0 -31
- package/scripts/lean/native/prepare-primitive-images.py +0 -25
- package/scripts/lean/native/prepare-space-salvage-images.mjs +0 -89
- package/scripts/lean/native/prepare-traffic-assets.py +0 -329
- package/scripts/lean/native/presentation.mjs +0 -335
- package/scripts/lean/native/review-agent-tools.mjs +0 -561
- package/scripts/lean/native/review-connection.mjs +0 -303
- package/scripts/lean/native/review-fields.mjs +0 -24
- package/scripts/lean/native/review-intake.mjs +0 -385
- package/scripts/lean/native/review-intents.mjs +0 -217
- package/scripts/lean/native/review-provider.mjs +0 -580
- package/scripts/lean/native/review-receipts.mjs +0 -76
- package/scripts/lean/native/review-resolver.mjs +0 -429
- package/scripts/lean/native/review-targets.mjs +0 -35
- package/scripts/lean/native/runtime.mjs +0 -1809
- package/scripts/lean/native/salvage-recipe.mjs +0 -20
- package/scripts/lean/native/stage-3d.mjs +0 -1121
- package/scripts/lean/native/verify.mjs +0 -4
- package/scripts/lean/scene-document.mjs +0 -48
|
@@ -30,7 +30,9 @@
|
|
|
30
30
|
"maxLength": 2048
|
|
31
31
|
},
|
|
32
32
|
"language": {
|
|
33
|
-
"
|
|
33
|
+
"type": "string",
|
|
34
|
+
"maxLength": 16,
|
|
35
|
+
"pattern": "^[a-z]{2,3}(?:-[A-Z][a-z]{3})?(?:-(?:[A-Z]{2}|[0-9]{3}))?$"
|
|
34
36
|
}
|
|
35
37
|
},
|
|
36
38
|
"required": [
|
|
@@ -1205,6 +1207,13 @@
|
|
|
1205
1207
|
"right"
|
|
1206
1208
|
]
|
|
1207
1209
|
},
|
|
1210
|
+
"direction": {
|
|
1211
|
+
"enum": [
|
|
1212
|
+
"auto",
|
|
1213
|
+
"ltr",
|
|
1214
|
+
"rtl"
|
|
1215
|
+
]
|
|
1216
|
+
},
|
|
1208
1217
|
"color": {
|
|
1209
1218
|
"type": "string",
|
|
1210
1219
|
"pattern": "^#[0-9a-fA-F]{6}([0-9a-fA-F]{2})?$"
|
|
@@ -4836,6 +4845,104 @@
|
|
|
4836
4845
|
"kind",
|
|
4837
4846
|
"parameters"
|
|
4838
4847
|
]
|
|
4848
|
+
},
|
|
4849
|
+
{
|
|
4850
|
+
"type": "object",
|
|
4851
|
+
"additionalProperties": false,
|
|
4852
|
+
"properties": {
|
|
4853
|
+
"id": {
|
|
4854
|
+
"type": "string",
|
|
4855
|
+
"pattern": "^[a-z][a-z0-9_.-]{0,95}$"
|
|
4856
|
+
},
|
|
4857
|
+
"componentId": {
|
|
4858
|
+
"type": "string",
|
|
4859
|
+
"pattern": "^[a-z][a-z0-9_.-]{0,95}$"
|
|
4860
|
+
},
|
|
4861
|
+
"kind": {
|
|
4862
|
+
"const": "ui-anchor-3d"
|
|
4863
|
+
},
|
|
4864
|
+
"parameters": {
|
|
4865
|
+
"type": "object",
|
|
4866
|
+
"additionalProperties": false,
|
|
4867
|
+
"properties": {
|
|
4868
|
+
"targetId": {
|
|
4869
|
+
"type": "string",
|
|
4870
|
+
"maxLength": 96
|
|
4871
|
+
},
|
|
4872
|
+
"anchor": {
|
|
4873
|
+
"enum": [
|
|
4874
|
+
"center",
|
|
4875
|
+
"top",
|
|
4876
|
+
"bottom"
|
|
4877
|
+
]
|
|
4878
|
+
},
|
|
4879
|
+
"offsetX": {
|
|
4880
|
+
"type": "number",
|
|
4881
|
+
"minimum": -1024,
|
|
4882
|
+
"maximum": 1024
|
|
4883
|
+
},
|
|
4884
|
+
"offsetY": {
|
|
4885
|
+
"type": "number",
|
|
4886
|
+
"minimum": -1024,
|
|
4887
|
+
"maximum": 1024
|
|
4888
|
+
},
|
|
4889
|
+
"fitToProjectedBounds": {
|
|
4890
|
+
"type": "boolean"
|
|
4891
|
+
},
|
|
4892
|
+
"paddingPx": {
|
|
4893
|
+
"type": "number",
|
|
4894
|
+
"minimum": 0,
|
|
4895
|
+
"maximum": 128
|
|
4896
|
+
},
|
|
4897
|
+
"minSizePx": {
|
|
4898
|
+
"type": "number",
|
|
4899
|
+
"minimum": 16,
|
|
4900
|
+
"maximum": 512
|
|
4901
|
+
},
|
|
4902
|
+
"maxSizePx": {
|
|
4903
|
+
"type": "number",
|
|
4904
|
+
"minimum": 32,
|
|
4905
|
+
"maximum": 1024
|
|
4906
|
+
},
|
|
4907
|
+
"squareBounds": {
|
|
4908
|
+
"type": "boolean"
|
|
4909
|
+
},
|
|
4910
|
+
"showHighlight": {
|
|
4911
|
+
"type": "boolean"
|
|
4912
|
+
},
|
|
4913
|
+
"highlightStyle": {
|
|
4914
|
+
"enum": [
|
|
4915
|
+
"ring",
|
|
4916
|
+
"pulse-ring",
|
|
4917
|
+
"box"
|
|
4918
|
+
]
|
|
4919
|
+
},
|
|
4920
|
+
"highlightColor": {
|
|
4921
|
+
"type": "string",
|
|
4922
|
+
"pattern": "^#[0-9a-fA-F]{6}([0-9a-fA-F]{2})?$"
|
|
4923
|
+
},
|
|
4924
|
+
"syncVisibility": {
|
|
4925
|
+
"type": "boolean"
|
|
4926
|
+
},
|
|
4927
|
+
"offscreen": {
|
|
4928
|
+
"enum": [
|
|
4929
|
+
"hide",
|
|
4930
|
+
"clamp",
|
|
4931
|
+
"none"
|
|
4932
|
+
]
|
|
4933
|
+
}
|
|
4934
|
+
},
|
|
4935
|
+
"required": [
|
|
4936
|
+
"targetId"
|
|
4937
|
+
]
|
|
4938
|
+
}
|
|
4939
|
+
},
|
|
4940
|
+
"required": [
|
|
4941
|
+
"id",
|
|
4942
|
+
"componentId",
|
|
4943
|
+
"kind",
|
|
4944
|
+
"parameters"
|
|
4945
|
+
]
|
|
4839
4946
|
}
|
|
4840
4947
|
]
|
|
4841
4948
|
},
|
|
@@ -7,12 +7,17 @@ function showBootError(error) {
|
|
|
7
7
|
document.body.innerHTML = `
|
|
8
8
|
<main class="tora-creator-wrap">
|
|
9
9
|
<div class="tora-creator-card">
|
|
10
|
-
<h2>
|
|
10
|
+
<h2>Could not connect to Tora Studio</h2>
|
|
11
11
|
<p>${String(error?.message ?? error).replace(/[<>&]/g, '')}</p>
|
|
12
|
-
<p>
|
|
12
|
+
<p>Start Tora Studio locally with <code>npx @tora-editor/tora editor</code> (or <code>npm run dev:editor</code> from a source checkout), then click Retry below.</p>
|
|
13
|
+
<div class="review-actions">
|
|
14
|
+
<button type="button" class="review-primary" id="tora-boot-retry">Retry connection</button>
|
|
15
|
+
</div>
|
|
13
16
|
</div>
|
|
14
17
|
</main>
|
|
15
18
|
`;
|
|
19
|
+
const retry = document.getElementById('tora-boot-retry');
|
|
20
|
+
if (retry) retry.onclick = () => location.reload();
|
|
16
21
|
}
|
|
17
22
|
|
|
18
23
|
async function fetchReviewMetadata(projectId) {
|
|
@@ -34,8 +39,8 @@ async function tryOpenDemo(projectId) {
|
|
|
34
39
|
|
|
35
40
|
try {
|
|
36
41
|
if (query.get('view') === 'new' || !project) {
|
|
37
|
-
const {
|
|
38
|
-
await
|
|
42
|
+
const {openLauncher} = await import('./project-launcher.js');
|
|
43
|
+
await openLauncher();
|
|
39
44
|
} else {
|
|
40
45
|
let activeId = project;
|
|
41
46
|
let metadata = await fetchReviewMetadata(activeId);
|
|
@@ -54,8 +59,8 @@ try {
|
|
|
54
59
|
const {openReview} = await import('./review-editor.js');
|
|
55
60
|
await openReview(activeId, metadata);
|
|
56
61
|
} else {
|
|
57
|
-
const {
|
|
58
|
-
await
|
|
62
|
+
const {openLauncher} = await import('./project-launcher.js');
|
|
63
|
+
await openLauncher();
|
|
59
64
|
}
|
|
60
65
|
}
|
|
61
66
|
} catch (error) {
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/* global location */
|
|
2
|
+
import {errorLabels,reviewElement,reviewRequest,reviewShell} from './review-editor.js';
|
|
3
|
+
|
|
4
|
+
export async function openLauncher() {
|
|
5
|
+
const $ = reviewShell(`
|
|
6
|
+
<header class="review-header">
|
|
7
|
+
<img class="review-wordmark" src="./brand/tora-wordmark.svg" alt="Tora">
|
|
8
|
+
<h1>Tora projects</h1>
|
|
9
|
+
<nav class="review-actions" aria-label="Workspace actions">
|
|
10
|
+
<button type="button" id="launcher-import">Import .tora.json</button>
|
|
11
|
+
<input type="file" id="launcher-import-picker" accept=".json,.tora.json,application/json" hidden>
|
|
12
|
+
<details class="review-menu" id="launcher-projects" hidden>
|
|
13
|
+
<summary>Open project</summary>
|
|
14
|
+
<div><form id="launcher-existing">
|
|
15
|
+
<label>Playable project <select id="launcher-project-choice" required></select></label>
|
|
16
|
+
<button type="submit">Open playable</button>
|
|
17
|
+
</form></div>
|
|
18
|
+
</details>
|
|
19
|
+
</nav>
|
|
20
|
+
</header>
|
|
21
|
+
<main class="tora-creator-wrap">
|
|
22
|
+
<section class="tora-creator-card">
|
|
23
|
+
<h2>Start locally, edit deterministically</h2>
|
|
24
|
+
<p>Open a saved project, import an editable bundle, or create a draft from a tested starter.</p>
|
|
25
|
+
<p id="launcher-status" role="status"></p>
|
|
26
|
+
<p id="launcher-error" class="review-error" role="alert"></p>
|
|
27
|
+
</section>
|
|
28
|
+
<section class="tora-demo-strip" id="launcher-starters" aria-label="Create from a starter" hidden>
|
|
29
|
+
<div class="tora-demo-strip-head"><div><h2>Create from a starter</h2><span>Editable native projects with bundled, licensed assets</span></div></div>
|
|
30
|
+
<div class="tora-demo-grid" id="launcher-starter-grid"></div>
|
|
31
|
+
</section>
|
|
32
|
+
<section class="tora-demo-strip" id="launcher-demos" aria-label="Showcase demos" hidden>
|
|
33
|
+
<div class="tora-demo-strip-head"><div><h2>Open a showcase demo</h2><span>Explore and edit preserved native projects</span></div></div>
|
|
34
|
+
<div class="tora-demo-grid" id="launcher-demo-grid"></div>
|
|
35
|
+
</section>
|
|
36
|
+
<section class="tora-creator-card">
|
|
37
|
+
<h2>Create a custom playable with your AI client</h2>
|
|
38
|
+
<p>Connect Tora to your MCP-compatible client in this workspace. Ask it to read <code>tora_brief</code>, discover <code>tora_capabilities</code>, then use <code>tora_create</code> and <code>tora_edit</code>. Your client owns the model, credentials, reasoning, and execution.</p>
|
|
39
|
+
<pre><code>npx @tora-editor/tora init --client codex</code></pre>
|
|
40
|
+
<p>After the client saves the project, return here and choose <strong>Open project</strong>. Translations and scoped review proposals also arrive through the connected client.</p>
|
|
41
|
+
</section>
|
|
42
|
+
</main>
|
|
43
|
+
`);
|
|
44
|
+
const status = $('launcher-status'), error = $('launcher-error');
|
|
45
|
+
const run = async (button, task) => {
|
|
46
|
+
button.disabled = true; error.textContent = '';
|
|
47
|
+
try { await task(); } catch (failure) {
|
|
48
|
+
error.textContent = errorLabels[failure.message] ?? failure.message;
|
|
49
|
+
button.disabled = false;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
$('launcher-import').onclick = () => $('launcher-import-picker').click();
|
|
53
|
+
$('launcher-import-picker').onchange = async event => {
|
|
54
|
+
const file = event.target.files?.[0]; event.target.value = '';
|
|
55
|
+
if (!file) return;
|
|
56
|
+
await run($('launcher-import'), async () => {
|
|
57
|
+
if (file.size > 64 * 1024 * 1024) throw Error('E_BUNDLE_SIZE');
|
|
58
|
+
status.textContent = `Importing ${file.name}…`;
|
|
59
|
+
const imported = await reviewRequest('/api/projects/import', {bundleText: await file.text(), copy: true});
|
|
60
|
+
location.href = imported.editorUrl ?? ('?project=' + encodeURIComponent(imported.projectId));
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
void reviewRequest('/api/projects').then(({projects}) => {
|
|
64
|
+
const native = projects.filter(project => project.kind === 'native-scene');
|
|
65
|
+
if (!native.length) return;
|
|
66
|
+
const selector = $('launcher-project-choice');
|
|
67
|
+
selector.replaceChildren(...native.map(project => {
|
|
68
|
+
const option = reviewElement('option', project.name && project.name !== project.id ? `${project.name} · ${project.id}` : project.id);
|
|
69
|
+
option.value = project.id; return option;
|
|
70
|
+
}));
|
|
71
|
+
$('launcher-existing').onsubmit = event => {
|
|
72
|
+
event.preventDefault(); location.href = '?project=' + encodeURIComponent(selector.value);
|
|
73
|
+
};
|
|
74
|
+
$('launcher-projects').hidden = false;
|
|
75
|
+
}).catch(() => {});
|
|
76
|
+
void reviewRequest('/api/starters').then(({templates}) => {
|
|
77
|
+
if (!templates?.length) return;
|
|
78
|
+
$('launcher-starter-grid').replaceChildren(...templates.map(template => {
|
|
79
|
+
const card = reviewElement('button', '', 'tora-template-card'); card.type = 'button';
|
|
80
|
+
card.dataset.starterId = template.id;
|
|
81
|
+
const head = reviewElement('div', '', 'tora-demo-card-head');
|
|
82
|
+
head.append(reviewElement('strong', template.name), reviewElement('span', template.genre, 'tora-pill tora-pill-mint'));
|
|
83
|
+
const cta = reviewElement('span', 'Create editable project →', 'tora-demo-card-cta');
|
|
84
|
+
card.append(head, reviewElement('p', template.description), cta);
|
|
85
|
+
card.onclick = () => run(card, async () => {
|
|
86
|
+
cta.textContent = 'Creating project…';
|
|
87
|
+
try {
|
|
88
|
+
const created = await reviewRequest('/api/starters/compose', {starter: template.id, name: template.name});
|
|
89
|
+
location.href = created.editorUrl ?? ('?project=' + encodeURIComponent(created.projectId));
|
|
90
|
+
} catch (failure) {
|
|
91
|
+
cta.textContent = 'Create editable project →';
|
|
92
|
+
throw failure;
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
return card;
|
|
96
|
+
}));
|
|
97
|
+
$('launcher-starters').hidden = false;
|
|
98
|
+
}).catch(() => {});
|
|
99
|
+
void reviewRequest('/api/demos').then(({demos}) => {
|
|
100
|
+
if (!demos?.length) return;
|
|
101
|
+
$('launcher-demo-grid').replaceChildren(...demos.map(demo => {
|
|
102
|
+
const card = reviewElement('button', '', 'tora-demo-card'); card.type = 'button';
|
|
103
|
+
card.dataset.demoId = demo.id;
|
|
104
|
+
const head = reviewElement('div', '', 'tora-demo-card-head');
|
|
105
|
+
head.append(reviewElement('strong', demo.name), reviewElement('span', demo.genre, 'tora-pill'));
|
|
106
|
+
const cta = reviewElement('span', 'Open in editor →', 'tora-demo-card-cta');
|
|
107
|
+
card.append(head, reviewElement('p', demo.tagline), cta);
|
|
108
|
+
card.onclick = () => run(card, async () => {
|
|
109
|
+
const opened = await reviewRequest('/api/demos/open', {id: demo.id});
|
|
110
|
+
location.href = '?project=' + encodeURIComponent(opened.projectId ?? demo.id);
|
|
111
|
+
});
|
|
112
|
+
return card;
|
|
113
|
+
}));
|
|
114
|
+
$('launcher-demos').hidden = false;
|
|
115
|
+
}).catch(() => {});
|
|
116
|
+
}
|