oda-engine 0.0.0-stage → 0.1.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 (204) hide show
  1. package/README.md +151 -2
  2. package/bin/nowhere.mjs +352 -0
  3. package/lib/account.mjs +57 -0
  4. package/lib/agentModules.mjs +57 -0
  5. package/lib/devServer.mjs +351 -0
  6. package/lib/headless.mjs +231 -0
  7. package/lib/headlessPreview.mjs +212 -0
  8. package/lib/keys.mjs +517 -0
  9. package/lib/make.mjs +855 -0
  10. package/lib/mcp.mjs +537 -0
  11. package/lib/open.mjs +22 -0
  12. package/lib/preview.mjs +87 -0
  13. package/lib/previewRpc.mjs +134 -0
  14. package/lib/project.mjs +359 -0
  15. package/lib/publishFlow.mjs +90 -0
  16. package/lib/resources.mjs +50 -0
  17. package/lib/rules.mjs +60 -0
  18. package/lib/scaffold.mjs +42 -0
  19. package/lib/setup.mjs +59 -0
  20. package/lib/tools.mjs +668 -0
  21. package/package.json +51 -4
  22. package/template/game.config.json +9 -0
  23. package/template/scene.json +4 -0
  24. package/template/src/main.ts +11 -0
  25. package/vendor/DOCS.md +447 -0
  26. package/vendor/agent/appRun.mjs +520 -0
  27. package/vendor/agent/assets/brief.mjs +242 -0
  28. package/vendor/agent/assets/collider.mjs +531 -0
  29. package/vendor/agent/assets/environments/index.mjs +12 -0
  30. package/vendor/agent/assets/environments/worldlabs.mjs +161 -0
  31. package/vendor/agent/assets/fetch.mjs +168 -0
  32. package/vendor/agent/assets/footprint.mjs +13 -0
  33. package/vendor/agent/assets/gltf.mjs +547 -0
  34. package/vendor/agent/assets/hdr.mjs +269 -0
  35. package/vendor/agent/assets/imageOps.mjs +171 -0
  36. package/vendor/agent/assets/images/codex.mjs +307 -0
  37. package/vendor/agent/assets/images/fal.mjs +75 -0
  38. package/vendor/agent/assets/images/gemini.mjs +84 -0
  39. package/vendor/agent/assets/images/index.mjs +25 -0
  40. package/vendor/agent/assets/images/openai.mjs +75 -0
  41. package/vendor/agent/assets/images/stability.mjs +71 -0
  42. package/vendor/agent/assets/images/views.mjs +31 -0
  43. package/vendor/agent/assets/import.mjs +1352 -0
  44. package/vendor/agent/assets/inspect.mjs +465 -0
  45. package/vendor/agent/assets/jobs.mjs +196 -0
  46. package/vendor/agent/assets/ktx2.mjs +290 -0
  47. package/vendor/agent/assets/ledger.mjs +466 -0
  48. package/vendor/agent/assets/net.mjs +254 -0
  49. package/vendor/agent/assets/prices.json +39 -0
  50. package/vendor/agent/assets/providers/fal.mjs +115 -0
  51. package/vendor/agent/assets/providers/index.mjs +22 -0
  52. package/vendor/agent/assets/providers/meshy.mjs +119 -0
  53. package/vendor/agent/assets/providers/tripo.mjs +188 -0
  54. package/vendor/agent/assets/sources/ambientcg.mjs +129 -0
  55. package/vendor/agent/assets/sources/index.mjs +23 -0
  56. package/vendor/agent/assets/sources/polyhaven.mjs +237 -0
  57. package/vendor/agent/assets/sources/polypizza.mjs +121 -0
  58. package/vendor/agent/assets/splat.mjs +631 -0
  59. package/vendor/agent/assets/targets.mjs +122 -0
  60. package/vendor/agent/assets/tile.mjs +261 -0
  61. package/vendor/agent/assets/unzip.mjs +180 -0
  62. package/vendor/agent/blender/cleanup.py +360 -0
  63. package/vendor/agent/blender/convert.py +167 -0
  64. package/vendor/agent/blender/find.mjs +192 -0
  65. package/vendor/agent/blender/nw_export.py +104 -0
  66. package/vendor/agent/blender/nw_rubric.py +426 -0
  67. package/vendor/agent/blender/run.mjs +193 -0
  68. package/vendor/agent/blender/runner.py +252 -0
  69. package/vendor/agent/blender/sheet.py +743 -0
  70. package/vendor/agent/depth.mjs +134 -0
  71. package/vendor/agent/director/board.mjs +451 -0
  72. package/vendor/agent/director/contracts.mjs +663 -0
  73. package/vendor/agent/director/director.mjs +2365 -0
  74. package/vendor/agent/director/estimate.mjs +200 -0
  75. package/vendor/agent/director/gate.mjs +802 -0
  76. package/vendor/agent/director/limits.json +16 -0
  77. package/vendor/agent/director/methods.mjs +457 -0
  78. package/vendor/agent/director/policy.json +33 -0
  79. package/vendor/agent/director/prompts.mjs +244 -0
  80. package/vendor/agent/director/reading.mjs +341 -0
  81. package/vendor/agent/director/router.mjs +184 -0
  82. package/vendor/agent/director/seams.mjs +243 -0
  83. package/vendor/agent/director/session.mjs +643 -0
  84. package/vendor/agent/director/store.mjs +119 -0
  85. package/vendor/agent/director/taskGate.mjs +110 -0
  86. package/vendor/agent/director/teamLedger.mjs +118 -0
  87. package/vendor/agent/director/triage.mjs +63 -0
  88. package/vendor/agent/downloads.cjs +363 -0
  89. package/vendor/agent/flow.mjs +78 -0
  90. package/vendor/agent/guard.mjs +613 -0
  91. package/vendor/agent/host.mjs +1736 -0
  92. package/vendor/agent/language.mjs +58 -0
  93. package/vendor/agent/ledger.mjs +360 -0
  94. package/vendor/agent/locale.cjs +186 -0
  95. package/vendor/agent/loop/capacity.mjs +74 -0
  96. package/vendor/agent/loop/compose.mjs +127 -0
  97. package/vendor/agent/loop/gate.mjs +205 -0
  98. package/vendor/agent/loop/judge.mjs +189 -0
  99. package/vendor/agent/loop/levels.mjs +273 -0
  100. package/vendor/agent/loop/state.mjs +358 -0
  101. package/vendor/agent/notes.cjs +278 -0
  102. package/vendor/agent/pace.mjs +258 -0
  103. package/vendor/agent/panels.mjs +431 -0
  104. package/vendor/agent/prompt.mjs +342 -0
  105. package/vendor/agent/reference/board.mjs +410 -0
  106. package/vendor/agent/reference/compose.mjs +364 -0
  107. package/vendor/agent/reference/decode.mjs +56 -0
  108. package/vendor/agent/reference/facts.mjs +1874 -0
  109. package/vendor/agent/reference/png.mjs +107 -0
  110. package/vendor/agent/reference/records.mjs +63 -0
  111. package/vendor/agent/reference/web.mjs +252 -0
  112. package/vendor/agent/roles/artist.mjs +69 -0
  113. package/vendor/agent/roles/builder.mjs +79 -0
  114. package/vendor/agent/roles/checks.mjs +223 -0
  115. package/vendor/agent/roles/common.mjs +188 -0
  116. package/vendor/agent/roles/critic.mjs +171 -0
  117. package/vendor/agent/roles/index.mjs +39 -0
  118. package/vendor/agent/roles/modeller.mjs +142 -0
  119. package/vendor/agent/roles/qa.mjs +58 -0
  120. package/vendor/agent/roles/rubrics.mjs +79 -0
  121. package/vendor/agent/roles/sound.mjs +69 -0
  122. package/vendor/agent/rounds.cjs +333 -0
  123. package/vendor/agent/shared.mjs +284 -0
  124. package/vendor/agent/stopGate.mjs +574 -0
  125. package/vendor/agent/subagents.mjs +129 -0
  126. package/vendor/agent/tools/assets.mjs +499 -0
  127. package/vendor/agent/tools/blender.mjs +754 -0
  128. package/vendor/agent/tools/cards.mjs +479 -0
  129. package/vendor/agent/tools/choices.mjs +479 -0
  130. package/vendor/agent/tools/compose.mjs +74 -0
  131. package/vendor/agent/tools/environment.mjs +488 -0
  132. package/vendor/agent/tools/eyes.mjs +733 -0
  133. package/vendor/agent/tools/generate.mjs +338 -0
  134. package/vendor/agent/tools/guide.mjs +46 -0
  135. package/vendor/agent/tools/harness.mjs +193 -0
  136. package/vendor/agent/tools/image.mjs +643 -0
  137. package/vendor/agent/tools/index.mjs +162 -0
  138. package/vendor/agent/tools/look.mjs +578 -0
  139. package/vendor/agent/tools/loop.mjs +858 -0
  140. package/vendor/agent/tools/others.mjs +123 -0
  141. package/vendor/agent/tools/pictures.mjs +535 -0
  142. package/vendor/agent/tools/reference.mjs +366 -0
  143. package/vendor/agent/transcripts.mjs +118 -0
  144. package/vendor/agent-loop.mjs +602 -0
  145. package/vendor/agent-plugin/.claude-plugin/plugin.json +5 -0
  146. package/vendor/agent-plugin/skills/art-direction/SKILL.md +82 -0
  147. package/vendor/agent-plugin/skills/asset-legality/SKILL.md +101 -0
  148. package/vendor/agent-plugin/skills/asset-sources/SKILL.md +111 -0
  149. package/vendor/agent-plugin/skills/blender-modeling/SKILL.md +97 -0
  150. package/vendor/agent-plugin/skills/look-dev/SKILL.md +104 -0
  151. package/vendor/agent-plugin/skills/playtesting/SKILL.md +74 -0
  152. package/vendor/agent-plugin/skills/reference-loop/SKILL.md +102 -0
  153. package/vendor/agent-plugin/skills/sound-design/SKILL.md +60 -0
  154. package/vendor/agent-plugin/skills/style/SKILL.md +35 -0
  155. package/vendor/agent-plugin/skills/tsl-r185/SKILL.md +107 -0
  156. package/vendor/auth.cjs +570 -0
  157. package/vendor/build.cjs +953 -0
  158. package/vendor/catalog.json +455 -0
  159. package/vendor/connectors.cjs +688 -0
  160. package/vendor/eyes.mjs +733 -0
  161. package/vendor/gameExports.json +1390 -0
  162. package/vendor/git.cjs +222 -0
  163. package/vendor/models.json +57 -0
  164. package/vendor/publish.cjs +1018 -0
  165. package/vendor/refBoard.cjs +301 -0
  166. package/vendor/schema/dist/assets.d.ts +335 -0
  167. package/vendor/schema/dist/assets.js +439 -0
  168. package/vendor/schema/dist/brief.d.ts +357 -0
  169. package/vendor/schema/dist/brief.js +302 -0
  170. package/vendor/schema/dist/common.d.ts +9 -0
  171. package/vendor/schema/dist/common.js +13 -0
  172. package/vendor/schema/dist/config.d.ts +406 -0
  173. package/vendor/schema/dist/config.js +355 -0
  174. package/vendor/schema/dist/contract.d.ts +599 -0
  175. package/vendor/schema/dist/contract.js +1146 -0
  176. package/vendor/schema/dist/index.d.ts +14 -0
  177. package/vendor/schema/dist/index.js +21 -0
  178. package/vendor/schema/dist/look.d.ts +463 -0
  179. package/vendor/schema/dist/look.js +681 -0
  180. package/vendor/schema/dist/lookStats.d.ts +230 -0
  181. package/vendor/schema/dist/lookStats.js +768 -0
  182. package/vendor/schema/dist/pilot.d.ts +32 -0
  183. package/vendor/schema/dist/pilot.js +44 -0
  184. package/vendor/schema/dist/publish.d.ts +214 -0
  185. package/vendor/schema/dist/publish.js +291 -0
  186. package/vendor/schema/dist/scene.d.ts +75 -0
  187. package/vendor/schema/dist/scene.js +120 -0
  188. package/vendor/schema/dist/skyLight.d.ts +141 -0
  189. package/vendor/schema/dist/skyLight.js +436 -0
  190. package/vendor/schema/dist/style.d.ts +131 -0
  191. package/vendor/schema/dist/style.js +155 -0
  192. package/vendor/schema/package.json +1 -0
  193. package/vendor/selectionPrompt.mjs +51 -0
  194. package/vendor/useTools.mjs +195 -0
  195. package/vendor/userMessage.mjs +26 -0
  196. package/web-dist/assets/GaussianSplatUtils-CB77cP9U.js +1 -0
  197. package/web-dist/assets/KTX2Loader-6OIWUF7s.js +2 -0
  198. package/web-dist/assets/SPZLoader-zYj0Alfv.js +1 -0
  199. package/web-dist/assets/gaussianSplat-CJTI1sEh.js +1 -0
  200. package/web-dist/assets/index-CcjyyQco.css +1 -0
  201. package/web-dist/assets/index-DMyJcoZJ.js +693 -0
  202. package/web-dist/assets/meshopt_decoder.module-BvwdjiD3.js +1 -0
  203. package/web-dist/assets/zstddec.module-CfFeQW7d.js +1 -0
  204. package/web-dist/index.html +34 -0
@@ -0,0 +1,142 @@
1
+ // The 3D modeller: one asset per task, made the way the director chose for
2
+ // it (its method: the project's own file, a CC0 library, a Blender model
3
+ // scripted for it, image-to-3D from the reference's crop, or a picture
4
+ // generated for it first and image-to-3D from that; director/methods.mjs),
5
+ // at the brief's real size and inside its class's budget. Keeps
6
+ // blender-modeler's loop (subagents.mjs) with the brief as the source of
7
+ // every value and no toolkit to build from. Judged by the critic on the
8
+ // contact sheets, beside what the model was made from.
9
+
10
+ import { RoleReport } from '../director/contracts.mjs'
11
+ import { methodLine, usesPictures } from '../director/methods.mjs'
12
+ import { SHARED_RULES, buildSession, checksOf, literalOwned } from './common.mjs'
13
+ import { RUBRICS } from './rubrics.mjs'
14
+
15
+ export const MODELLER_PROMPT = `You are the 3D modeller on an Oda game team: you make one asset per task and bring it into the project. You never talk to the creator and never use their mouse, keyboard or browser; only the director reads your report.
16
+
17
+ ## Your work
18
+
19
+ - How your asset is made is your task's method, which the director chose for it (your task message says it, with the first tool inputs): the project's own file; a CC0 library (asset_search, asset_fetch, asset_import: Poly Haven, ambientCG, Kenney through Poly Pizza); a model you build in Blender with a bpy script written for it (nw_blender); image-to-3D from the reference's crop of its subject (asset_generate, asset_job); or a picture you make for it first with image_generate, then image-to-3D from that picture. Make it that way; when it cannot be made that way, say why in notDone rather than making it another way. Every outside file comes in through asset_import, which cleans the model up in Blender (its size, its origin, its triangles to the class and its textures) and records its licence (the nowhere:asset-legality skill).
20
+ - A picture for image-to-3D (image_generate): write its prompt for this asset from the brief and the reference: the object alone and whole, its form and its parts biggest first with their proportions, its materials and colours from the brief, on a plain background, nothing in front of it, no lettering, and never a specific character or logo of the reference; start from the subject's crop when your task gives one. Look at what comes back before image-to-3D is spent on it, and make it again with words that fix what is wrong. Then asset_generate (image-to-3d from one view, multi-image-to-3d from several, the front first), asset_job until it is done, and asset_import from its gen- id with your asset check's class and size; look at its contact sheets as you would at a Blender model's.
21
+ - In Blender: read the nowhere:blender-modeling skill (nw_guide name "blender-modeling" when it is not loaded) before your first script. Decide the form first, from the brief and the reference (the subject your model is, a box of the picture, holds its proportion): at the top of blender/<asset>.py write what the asset is for, its size in metres, its silhouette from the front, side and top, its parts biggest first with their sizes, and which of the brief's materials each surface takes. Then model exactly that in plain bpy and bmesh (there is no toolkit or kit of parts), at real size (metres, Z up, the front facing -Y, the origin at the base centre): the masses, the secondary forms, the edges, the materials from the brief's colours (sRGB hex) and roughness ranges, and the detail the close-up shows.
22
+ - Run nw_blender with out "assets/<asset>.glb", class and expect. Look at both contact sheets beside the 1.75 m figure, read the numbers and the rubric line and what it says to fix first. Compare with the reference and the brief's forms: the silhouette, the proportion, the key details, the materials. Change the model to fix the biggest difference from the brief and run again (a rubric number is a measurement, a difference only where this brief asks for something else). A round changes the model in answer to what the sheets showed; running an unchanged script is a look, not a round. At least three rounds for a hero.
23
+ - Keep it glTF-safe and inside its class: Principled BSDF and image textures; procedural nodes do not export, so bake them or model the detail; a Decimate copy in a collection of its own is a lighter copy when the triangles are over the class's line.
24
+ - Never run anything you downloaded, and never open a .blend that came from the web.
25
+ - Your model takes over one of the blockout's placements (your task message names it): when your task ends, the director puts the file in the game there itself, where the stand-in stood and at the size the file has, so the size you export is the size the game shows. Placing it is not yours to do or to ask for. Your report's assets may give each file with its class, its size in metres and its triangles; what the director reads is the file and its ledger entry.
26
+
27
+ ${SHARED_RULES}`
28
+
29
+ const MODEL_PARTS = ['subjects', 'forms', 'materials', 'palette', 'detail', 'performance', 'exclusions']
30
+
31
+ /** The asset classes by the asset's largest side, for a default asset check. */
32
+ function classBySize(size) {
33
+ const m = Math.max(size?.h ?? 0, size?.w ?? 0, size?.d ?? 0)
34
+ if (!(m > 0)) return 'prop'
35
+ return m < 0.5 ? 'small' : m < 3 ? 'prop' : m < 8 ? 'large' : 'building'
36
+ }
37
+
38
+ /** The brief's scale line for an asset, by its file name. */
39
+ function scaleFor(brief, file) {
40
+ const stem = String(file).split('/').pop().replace(/\.[a-z0-9]+$/i, '').replace(/[-_]+/g, ' ').toLowerCase()
41
+ return (brief?.forms?.scale ?? []).find((s) => {
42
+ const words = String(s.element ?? '').toLowerCase()
43
+ return stem && (words.includes(stem) || stem.split(' ').some((w) => w.length > 2 && words.includes(w)))
44
+ })
45
+ }
46
+
47
+ /**
48
+ * How the task's asset is made, in words, with the first tool inputs worked
49
+ * out from the method, the crop the director wrote and the asset check (the
50
+ * prompt of a picture is the modeller's own to write).
51
+ */
52
+ function methodWords(task, checks) {
53
+ const m = task.method
54
+ const asset = checks.find((c) => c.kind === 'asset')
55
+ const out = asset?.path ?? 'assets/<asset>.glb'
56
+ const stem = out.replace(/^assets\//, '').replace(/\.(glb|gltf)$/i, '')
57
+ const size = asset?.size ? JSON.stringify(asset.size) : null
58
+ const imported = `asset_import ${JSON.stringify({ from: 'gen-<the job id>-1', as: out, class: asset?.class ?? 'prop', ...(asset?.size ? { size: asset.size } : {}) })}`
59
+ const lines = [`How this asset is made (the director chose it): ${methodLine(m)}.`]
60
+ // The script goes where the task may write: a .py it owns, else its own folder under blender/.
61
+ const owned = (task.owns ?? []).find((g) => /^blender\/[^*?[{]+\.py$/.test(g))
62
+ const script = owned ?? ((task.owns ?? []).includes(`blender/${stem}/**`) ? `blender/${stem}/${stem}.py` : `blender/${stem}.py`)
63
+ if (m.how === 'blender') lines.push(`Write ${script} for it and run nw_blender ${JSON.stringify({ script, out, class: asset?.class ?? 'prop', ...(size ? { expect: asset.size } : {}) })}.`)
64
+ if (m.how === 'library') lines.push(`asset_search for it (kind model), pick the hit closest to the brief's form, asset_fetch it, then asset_import it as ${out} with class ${asset?.class ?? 'prop'}${size ? ` and size ${size}` : ''}.`)
65
+ if (m.how === 'project') lines.push(`It is the project's ${m.file}: make sure ${out} is that model, at its class and size, recorded in assets.lock.json.`)
66
+ if (m.how === 'crop-3d') {
67
+ lines.push(task.crop ? `The reference's crop of ${m.subject} is ${task.crop} (cut by the director).` : `The reference's crop of ${m.subject} could not be cut: report it in notDone.`)
68
+ lines.push(`asset_generate ${JSON.stringify({ action: 'submit', provider: m.mesh, task: 'image-to-3d', image: task.crop ?? `<the crop of ${m.subject}>` })}, then asset_job until it is done, then ${imported}.`)
69
+ }
70
+ if (m.how === 'image-3d') {
71
+ const views = m.views ?? 1
72
+ const first = `blender/${stem}/view.png`
73
+ lines.push(task.crop ? `The reference's crop of ${m.subject} is ${task.crop} (cut by the director): start from it.` : m.subject ? `${m.subject}'s crop is not sent: write the picture from the brief alone.` : 'There is no crop to start from: write the picture from the brief.')
74
+ lines.push(`image_generate ${JSON.stringify({ action: 'submit', provider: m.image, prompt: '<your words for this asset>', ...(task.crop ? { from: [task.crop] } : {}), views, out: first })}; look at ${views === 1 ? 'it' : 'them'}.`)
75
+ lines.push(
76
+ views === 1
77
+ ? `Then asset_generate ${JSON.stringify({ action: 'submit', provider: m.mesh, task: 'image-to-3d', image: first })}, asset_job until it is done, then ${imported}.`
78
+ : `Then asset_generate ${JSON.stringify({ action: 'submit', provider: m.mesh, task: 'multi-image-to-3d', images: Array.from({ length: views }, (_, k) => (k === 0 ? first : `blender/${stem}/view-${k + 1}.png`)) })}, asset_job until it is done, then ${imported}.`,
79
+ )
80
+ }
81
+ return lines.join('\n')
82
+ }
83
+
84
+ export const modeller = {
85
+ id: 'modeller',
86
+ lane: 'blender',
87
+ prompt: MODELLER_PROMPT,
88
+ builtIns: ['Read', 'Write', 'Edit', 'Glob', 'Grep', 'Skill'],
89
+ nwTools: ['nw_blender', 'nw_guide', 'nw_docs', 'asset_search', 'asset_fetch', 'asset_import', 'asset_ledger', 'nw_take_download', 'nw_reference'],
90
+ /** Only in a task the board's paid lines name or whose method sends
91
+ * pictures to a service, after the cost card, never with declinePaid. */
92
+ paidTools: ['asset_generate', 'asset_job'],
93
+ /** A task whose method makes a picture first. */
94
+ imageTools: ['image_generate'],
95
+ skills: ['nowhere:blender-modeling', 'nowhere:asset-sources', 'nowhere:asset-legality'],
96
+ mayOwn: ['blender/**', 'assets/**', '!assets/audio/**'],
97
+ rubric: RUBRICS.modeller,
98
+ maxTurns: 120,
99
+ catalogue: {
100
+ does: 'One asset per task at the brief\'s real size and its class\'s budget, made the way its method says: the project\'s own model, a CC0 library, a Blender model scripted for it (at least three render rounds on a hero), image-to-3D from the reference\'s crop, or a picture generated for it first and image-to-3D from that. Owns blender/** and assets/** (not assets/audio/**).',
101
+ size: 'One asset (one GLB and its script) per task.',
102
+ checks: ['asset', 'ledger', 'palette'],
103
+ },
104
+ /** asset for its GLB (class and size from the brief's scale line), ledger, and palette on its scripts. */
105
+ defaultChecks(task, brief) {
106
+ const out = []
107
+ const glb = literalOwned(task).find((p) => /^assets\/.+\.(glb|gltf)$/i.test(p))
108
+ if (glb) {
109
+ const scale = scaleFor(brief, glb)
110
+ const size = scale?.sizeM ? { ...(scale.sizeM.h !== undefined ? { height: scale.sizeM.h } : {}), ...(scale.sizeM.w !== undefined ? { width: scale.sizeM.w } : {}), ...(scale.sizeM.d !== undefined ? { depth: scale.sizeM.d } : {}) } : undefined
111
+ out.push({ id: 'asset', kind: 'asset', path: glb, class: classBySize(scale?.sizeM), ...(size && Object.keys(size).length ? { size } : {}), hero: task.tier === 'top' })
112
+ }
113
+ out.push({ id: 'ledger', kind: 'ledger' })
114
+ const scripts = (task.owns ?? []).filter((g) => g.startsWith('blender/'))
115
+ if (scripts.length) out.push({ id: 'palette', kind: 'palette', files: scripts })
116
+ return out
117
+ },
118
+ checksFor(task, brief) {
119
+ return checksOf(task, this.defaultChecks(task, brief))
120
+ },
121
+ /** The paid tools join the session only when the board names this task in
122
+ * a paid line or its method sends pictures to a service, and the creator
123
+ * has not declined paid generation; image_generate when its method makes
124
+ * a picture first. */
125
+ toolsFor(task, { paid = [], declinePaid = false } = {}) {
126
+ const named = !declinePaid && (paid.some((p) => p.for === task.id) || usesPictures(task.method))
127
+ const image = !declinePaid && task.method?.how === 'image-3d'
128
+ return [...this.nwTools, ...(named ? this.paidTools : []), ...(image ? this.imageTools : [])]
129
+ },
130
+ session(task, input) {
131
+ const spec = buildSession(this, task, input, {
132
+ parts: MODEL_PARTS,
133
+ schema: RoleReport,
134
+ images: input.refImages ?? [],
135
+ extra: [
136
+ task.method ? methodWords(task, this.checksFor(task, input.brief)) : '',
137
+ input.declinePaid ? 'Paid generation is declined for this production: use the project, a CC0 library or Blender.' : 'Paid generation is only for a task the board names in a paid line or whose method sends pictures to a service, after its cost card.',
138
+ ].filter(Boolean),
139
+ })
140
+ return { ...spec, nwTools: this.toolsFor(task, { paid: input.paid ?? [], declinePaid: input.declinePaid }) }
141
+ },
142
+ }
@@ -0,0 +1,58 @@
1
+ // The playtester: read-only. Writes a playtest script for every signature
2
+ // moment and interaction, runs them, and reports bugs with steps that
3
+ // reproduce them, the owner role and the files it suspects. Its output is a
4
+ // QAReport, not a RoleReport; the director turns its major bugs into fix
5
+ // tasks.
6
+
7
+ import { QAReport } from '../director/contracts.mjs'
8
+ import { POINT, SHARED_RULES, buildSession, checksOf, playExample, playKeys } from './common.mjs'
9
+ import { RUBRICS } from './rubrics.mjs'
10
+
11
+ export const QA_PROMPT = `You are the playtester on an Oda game team: you play the game the way a visitor would and report what does not work. You own nothing and change nothing: you only read files and run the game. You never talk to the creator, and only the director reads your report.
12
+
13
+ ## Your work
14
+
15
+ - Read the nowhere:playtesting skill first. Then for every signature moment and every interaction the brief names, write a script: nw_play steps (walk there with goto, act with keys, turn with look) and what must hold afterwards, each as an nw_eval expression with an op (==, >=, <=, between, truthy) and a value. A step's shape: { "goto": "<a placement id or kind, a world kind or an object name in the game>", "seconds": 12 }, or goto a point [x, y, z] in metres.
16
+ - Run each script: nw_play, then the nw_eval expects. Read the frames it returns and nw_logs for errors. A walk that ends "blocked" or "timeout" is a finding in itself (an unreachable goal), not a reason to give up on the script.
17
+ - A bug says: a short title; the steps that reproduce it (the exact nw_play input); what was expected and what happened; its severity (blocker: the game cannot be played or crashes; major: a moment or an interaction the brief names does not work; minor: anything else); the owner role (builder for layout, rules and integration; artist for the look and materials; modeller for an asset; sound for a sound); the files you suspect; and script, the id of the script that shows it (its fix is judged by playing that script again).
18
+ - Never edit a file, and never put a probe in the source: nw_eval reads the running game.
19
+ - Your report is the structured output: scripts (each with its id, what it covers, its steps and expects), results (one per script: ok and what you observed) and bugs.
20
+
21
+ ${SHARED_RULES.replace('say so in changesNeeded (the path, whose it is, what and why), and the director hands it to its owner', 'report it as a bug with its owner, and the director hands it on').replace('Then finish with your report (the structured output): what you did, what is not done, what you assumed, and changesNeeded.', 'Then finish with your report (the structured output: scripts, results and bugs).')}`
22
+
23
+ const QA_PARTS = ['play', 'requestElements', 'cameras', 'sound', 'performance']
24
+
25
+ export const qa = {
26
+ id: 'qa',
27
+ lane: 'preview',
28
+ prompt: QA_PROMPT,
29
+ builtIns: ['Read', 'Glob', 'Grep', 'Skill'],
30
+ nwTools: ['nw_docs', 'nw_play', 'nw_eval', 'nw_logs', 'nw_status', 'nw_view'],
31
+ skills: ['nowhere:playtesting'],
32
+ mayOwn: [],
33
+ rubric: RUBRICS.qa,
34
+ maxTurns: 60,
35
+ catalogue: {
36
+ does: 'Playtest scripts for every signature moment and interaction (nw_play with goto, keys and look; expects through nw_eval), runs them, and reports bugs with repro steps, severity, the owner role and the files it suspects. Owns nothing.',
37
+ size: 'One pass over the whole game per task.',
38
+ checks: [],
39
+ },
40
+ /** None of its own: its gate is its report. */
41
+ defaultChecks() {
42
+ return []
43
+ },
44
+ checksFor(task, brief) {
45
+ return checksOf(task, this.defaultChecks(task, brief))
46
+ },
47
+ session(task, input) {
48
+ const moments = (input.vision?.moments ?? []).map((m) => `- ${m.id} at camera ${m.camera}: ${m.does}. Accepted when: ${m.acceptance}`)
49
+ return buildSession(this, task, input, {
50
+ parts: QA_PARTS,
51
+ schema: QAReport,
52
+ extra: [
53
+ moments.length ? `Every signature moment of the vision, each needing a script:\n${moments.join('\n')}` : '',
54
+ `An nw_play input in the shape a script takes: ${playExample(POINT, playKeys(task))}. Its keys are the ones this game reads (read src/ for them). goto takes a point [x, y, z] in metres, as here, or the id or kind of a placement, a world kind or an object name that is in the game: read scene.json and src/ for the names, and never walk to a request element's id or a moment's.`,
55
+ ],
56
+ })
57
+ },
58
+ }
@@ -0,0 +1,79 @@
1
+ // What "good" means, per role and for the critic, as words a judge scores
2
+ // against. There is no design bar here: no style, palette, size or light of
3
+ // its own. Every dimension is judged against this request (its brief, its
4
+ // reference, the vision's moments and the criteria the plan wrote for the
5
+ // task), and the anchors say how close a view comes to that, never "good for
6
+ // a game an agent made". The critic scores the five dimensions of
7
+ // CriticReport (form, detail, composition, colour, light) and reads the
8
+ // role's rubric as what to look at first; play is judged by the play checks
9
+ // and the playtester, never from a picture.
10
+
11
+ /** 1 to 5, the same ladder for every dimension (orchestrator spec 5.6). */
12
+ export const ANCHORS = {
13
+ 1: 'a blockout or a default: a stand-in grey, a box where the brief names a form, a stock light',
14
+ 2: 'recognisable, but generic: it could be any game of this kind',
15
+ 3: 'reads as the brief intends: the forms, palette and light the brief names are there',
16
+ 4: 'close to the reference\'s quality in this view: a person would put them side by side',
17
+ 5: 'matches the reference in this view',
18
+ }
19
+
20
+ /** The critic's five dimensions, in the order it judges them (each one hides
21
+ * the next), each against the brief and the reference. */
22
+ export const DIMENSIONS = [
23
+ { id: 'form', label: 'Form', what: "the shapes, silhouettes and proportions the brief names, and scale against the 1.75 m player" },
24
+ { id: 'detail', label: 'Detail', what: 'how much detail there is near, mid and far, against what the brief and the reference have' },
25
+ { id: 'composition', label: 'Composition', what: "what each of the brief's cameras frames, and what reads first" },
26
+ { id: 'colour', label: 'Colour', what: "the brief's palette and values, as the reference has them" },
27
+ { id: 'light', label: 'Light and atmosphere', what: "the brief's light and atmosphere, as the reference has them" },
28
+ ]
29
+
30
+ /** Each role's rubric: the general axes its work is judged on, most telling
31
+ * first. What each one means for a task is the task's own criteria. */
32
+ export const RUBRICS = {
33
+ artist: {
34
+ judge: 'critic',
35
+ dimensions: [
36
+ { id: 'colour', what: "the brief's palette and values against the reference's" },
37
+ { id: 'light', what: "the brief's light and atmosphere against the reference's" },
38
+ { id: 'detail', what: "each surface as the brief's materials describe it" },
39
+ ],
40
+ },
41
+ builder: {
42
+ judge: 'critic',
43
+ dimensions: [
44
+ { id: 'form', what: "the brief's forms and sizes against the 1.75 m player" },
45
+ { id: 'composition', what: "what the brief's cameras frame, and what the player sees first" },
46
+ { id: 'play', what: "the brief's play and the vision's moments, through the board's play checks" },
47
+ ],
48
+ },
49
+ modeller: {
50
+ judge: 'critic',
51
+ dimensions: [
52
+ { id: 'form', what: "the asset's silhouette and proportions against the brief's forms and the reference" },
53
+ { id: 'detail', what: 'the secondary forms and the detail the brief and the reference have' },
54
+ { id: 'colour', what: "the brief's colours and roughness on the asset's surfaces" },
55
+ ],
56
+ },
57
+ sound: {
58
+ judge: 'tools',
59
+ dimensions: [
60
+ { id: 'coverage', what: 'every event of the brief renders' },
61
+ { id: 'levels', what: 'peaks under -1 dBFS, nothing silent' },
62
+ { id: 'clicks', what: 'clean onsets and loop seams' },
63
+ ],
64
+ },
65
+ qa: {
66
+ judge: 'report',
67
+ dimensions: [
68
+ { id: 'play', what: 'a script for every signature moment and interaction the brief and the vision name' },
69
+ { id: 'repro', what: 'every bug with steps that reproduce it, its owner and the files it suspects' },
70
+ ],
71
+ },
72
+ }
73
+
74
+ /** The anchors and the dimensions as lines for a prompt. */
75
+ export function rubricText(role) {
76
+ const anchors = Object.entries(ANCHORS).map(([n, words]) => `${n}: ${words}`)
77
+ const own = RUBRICS[role]?.dimensions?.map((d) => `- ${d.id}: ${d.what}`) ?? []
78
+ return [`Scores, for every dimension:\n${anchors.join('\n')}`, own.length ? `What this work is judged on first:\n${own.join('\n')}` : ''].filter(Boolean).join('\n\n')
79
+ }
@@ -0,0 +1,69 @@
1
+ // The sound designer: one Web Audio synthesis graph designed per event of
2
+ // the brief, from its mood and sources, in one module that bundles alone. Judged
3
+ // by tools only in v0 (every event renders, levels, clicks): there is no
4
+ // audio critic yet.
5
+
6
+ import { RoleReport } from '../director/contracts.mjs'
7
+ import { SHARED_RULES, buildSession, checksOf } from './common.mjs'
8
+ import { RUBRICS } from './rubrics.mjs'
9
+
10
+ /** The module the audio interface's seam re-exports, and what it must export. */
11
+ export const SOUND_MODULE = 'src/audio/sound.ts'
12
+ export const SOUND_EXPORTS = ['createAudio', 'renderOffline']
13
+
14
+ export const SOUND_PROMPT = `You are the sound designer on an Oda game team: you make every sound the brief names by synthesis in Web Audio. You never talk to the creator, and only the director reads your report.
15
+
16
+ ## Your work
17
+
18
+ - One module, ${SOUND_MODULE}, that imports nothing but types (so it bundles on its own) and exports:
19
+
20
+ \`\`\`ts
21
+ export interface GameAudio {
22
+ readonly events: readonly string[]
23
+ play(event: string, opts?: { at?: [number, number, number]; gain?: number }): void
24
+ update(dt: number, listener?: { position: [number, number, number]; forward: [number, number, number] }): void
25
+ dispose(): void
26
+ }
27
+ export function createAudio(ctx: { input: { pressed(code: string): boolean } }): GameAudio
28
+ export function renderOffline(event: string, sampleRate?: number): Promise<Float32Array>
29
+ \`\`\`
30
+
31
+ createAudio makes one AudioContext lazily, resumes it on the first key the visitor presses (browsers start audio only after input), and closes it in dispose(). renderOffline builds the same graph for one event in an OfflineAudioContext and returns its samples: it is what the audio check measures, so the sound the check hears is the sound the game plays.
32
+ - One sound designed per brief event (sound.events, by its id), from what the brief says about it: its sources, the size and material of what makes it, the place and the action, and sound.mood. Decide each parameter from those words and write which word set which number above the event's function. An event with loop true is an ambience that runs until dispose and meets its own start without a click. Read the nowhere:sound-design skill before you start: it has the Web Audio facts and what the audio check measures. There is no stock sound set; every sound is made for this brief.
33
+ - Levels: peaks under -1 dBFS (0.89), nothing silent, an onset within 10 ms, no click at a loop's seam.
34
+ - A file for the sound (a CC0 recording) comes in through asset_import into assets/audio/ only; synthesis is the default, because it is small and licence-free.
35
+ - Your report's events list every event id you made.
36
+
37
+ ${SHARED_RULES}`
38
+
39
+ const SOUND_PARTS = ['subject', 'play', 'sound', 'exclusions']
40
+
41
+ export const sound = {
42
+ id: 'sound',
43
+ lane: 'free',
44
+ prompt: SOUND_PROMPT,
45
+ builtIns: ['Read', 'Write', 'Edit', 'Glob', 'Grep', 'Skill'],
46
+ nwTools: ['nw_guide', 'nw_docs', 'asset_search', 'asset_import', 'asset_ledger'],
47
+ skills: ['nowhere:sound-design', 'nowhere:asset-legality'],
48
+ mayOwn: ['src/audio/**', '!src/audio/index.ts', 'assets/audio/**'],
49
+ rubric: RUBRICS.sound,
50
+ maxTurns: 60,
51
+ catalogue: {
52
+ does: `Every sound event of the brief by Web Audio synthesis in ${SOUND_MODULE} (createAudio and renderOffline), shaped by the brief's mood and sources; loops for ambience. Owns src/audio/** (not src/audio/index.ts) and assets/audio/**.`,
53
+ size: 'All the brief\'s sound events in one task (up to about 12).',
54
+ checks: ['module', 'audio'],
55
+ },
56
+ /** module (the two exports) and audio for every event of the brief. */
57
+ defaultChecks(task, brief) {
58
+ const out = [{ id: 'module', kind: 'module', path: SOUND_MODULE, exports: [...SOUND_EXPORTS] }]
59
+ const events = (brief?.sound?.events ?? []).map((e) => e.id)
60
+ if (events.length) out.push({ id: 'audio', kind: 'audio', events })
61
+ return out
62
+ },
63
+ checksFor(task, brief) {
64
+ return checksOf(task, this.defaultChecks(task, brief))
65
+ },
66
+ session(task, input) {
67
+ return buildSession(this, task, input, { parts: SOUND_PARTS, schema: RoleReport })
68
+ },
69
+ }