@joiner-platform/cli 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (303) hide show
  1. package/README.md +30 -2
  2. package/bundled-resources/poe-tile-templates/base/CLAUDE.md +72 -0
  3. package/bundled-resources/poe-tile-templates/base/README.md +7 -0
  4. package/bundled-resources/poe-tile-templates/base/_bunfig.toml +8 -0
  5. package/bundled-resources/poe-tile-templates/base/_gitignore +18 -0
  6. package/bundled-resources/poe-tile-templates/base/client.ts +12 -0
  7. package/bundled-resources/poe-tile-templates/base/package.json +36 -0
  8. package/bundled-resources/poe-tile-templates/base/playwright.config.ts +38 -0
  9. package/bundled-resources/poe-tile-templates/base/scripts/check-source.ts +148 -0
  10. package/bundled-resources/poe-tile-templates/base/scripts/dev.ts +19 -0
  11. package/bundled-resources/poe-tile-templates/base/scripts/doctor.sh +29 -0
  12. package/bundled-resources/poe-tile-templates/base/scripts/visual-check.ts +64 -0
  13. package/bundled-resources/poe-tile-templates/base/synced-store/backend-config.ts +9 -0
  14. package/bundled-resources/poe-tile-templates/base/synced-store/client-config.ts +8 -0
  15. package/bundled-resources/poe-tile-templates/base/synced-store/data/items.ts +16 -0
  16. package/bundled-resources/poe-tile-templates/base/synced-store/mutators/index.ts +10 -0
  17. package/bundled-resources/poe-tile-templates/base/synced-store/mutators/remove-todo.ts +5 -0
  18. package/bundled-resources/poe-tile-templates/base/synced-store/mutators/set-todo.ts +20 -0
  19. package/bundled-resources/poe-tile-templates/base/synced-store/mutators/types.ts +5 -0
  20. package/bundled-resources/poe-tile-templates/base/synced-store/mutators.test.ts +138 -0
  21. package/bundled-resources/poe-tile-templates/base/synced-store/schema.ts +40 -0
  22. package/bundled-resources/poe-tile-templates/base/tests/e2e.test.playwright.ts +92 -0
  23. package/bundled-resources/poe-tile-templates/base/tests/mobile-viewport.test.playwright.ts +111 -0
  24. package/bundled-resources/poe-tile-templates/base/tests/render-check.test.playwright.ts +128 -0
  25. package/bundled-resources/poe-tile-templates/base/tests/screenshot.test.playwright.ts +86 -0
  26. package/bundled-resources/poe-tile-templates/base/tests/setup-dom.ts +70 -0
  27. package/bundled-resources/poe-tile-templates/base/tile/src/backend.ts +3 -0
  28. package/bundled-resources/poe-tile-templates/base/tile/styles.css +47 -0
  29. package/bundled-resources/poe-tile-templates/base/tsconfig.json +13 -0
  30. package/bundled-resources/poe-tile-templates/coverage.config.json +6 -0
  31. package/bundled-resources/poe-tile-templates/index.ts +27 -0
  32. package/bundled-resources/poe-tile-templates/package.json +31 -0
  33. package/bundled-resources/poe-tile-templates/phaserjs/package.partial.json +6 -0
  34. package/bundled-resources/poe-tile-templates/phaserjs/tile/index.html +14 -0
  35. package/bundled-resources/poe-tile-templates/phaserjs/tile/src/entry.ts +35 -0
  36. package/bundled-resources/poe-tile-templates/phaserjs/ui/App.test.happydom.tsx +98 -0
  37. package/bundled-resources/poe-tile-templates/phaserjs/ui/App.ts +180 -0
  38. package/bundled-resources/poe-tile-templates/phaserjs/ui/phaser-scene.ts +174 -0
  39. package/bundled-resources/poe-tile-templates/phaserjs/vite.config.ts +28 -0
  40. package/bundled-resources/poe-tile-templates/preact/package.partial.json +9 -0
  41. package/bundled-resources/poe-tile-templates/preact/postcss.config.js +5 -0
  42. package/bundled-resources/poe-tile-templates/preact/tile/index.html +14 -0
  43. package/bundled-resources/poe-tile-templates/preact/tile/src/entry.tsx +36 -0
  44. package/bundled-resources/poe-tile-templates/preact/tile/styles.css +51 -0
  45. package/bundled-resources/poe-tile-templates/preact/tsconfig.json +15 -0
  46. package/bundled-resources/poe-tile-templates/preact/ui/App.test.happydom.tsx +69 -0
  47. package/bundled-resources/poe-tile-templates/preact/ui/App.tsx +116 -0
  48. package/bundled-resources/poe-tile-templates/preact/vite.config.ts +18 -0
  49. package/bundled-resources/poe-tile-templates/react/package.partial.json +12 -0
  50. package/bundled-resources/poe-tile-templates/react/postcss.config.js +5 -0
  51. package/bundled-resources/poe-tile-templates/react/tile/index.html +14 -0
  52. package/bundled-resources/poe-tile-templates/react/tile/src/entry.tsx +38 -0
  53. package/bundled-resources/poe-tile-templates/react/tile/styles.css +51 -0
  54. package/bundled-resources/poe-tile-templates/react/tsconfig.json +14 -0
  55. package/bundled-resources/poe-tile-templates/react/ui/App.test.happydom.tsx +71 -0
  56. package/bundled-resources/poe-tile-templates/react/ui/App.tsx +110 -0
  57. package/bundled-resources/poe-tile-templates/react/vite.config.ts +21 -0
  58. package/bundled-resources/poe-tile-templates/scripts/cleanup.ts +10 -0
  59. package/bundled-resources/poe-tile-templates/scripts/generate.ts +57 -0
  60. package/bundled-resources/poe-tile-templates/scripts/install-diagnostics.ts +52 -0
  61. package/bundled-resources/poe-tile-templates/scripts/paths.ts +7 -0
  62. package/bundled-resources/poe-tile-templates/scripts/sdk-dependency-key.ts +288 -0
  63. package/bundled-resources/poe-tile-templates/scripts/verify-all-sdks.ts +132 -0
  64. package/bundled-resources/poe-tile-templates/scripts/verify-local-sdk-command.ts +30 -0
  65. package/bundled-resources/poe-tile-templates/scripts/verify-local-sdk-tarball.ts +397 -0
  66. package/bundled-resources/poe-tile-templates/solidjs/_bunfig.toml +14 -0
  67. package/bundled-resources/poe-tile-templates/solidjs/package.partial.json +13 -0
  68. package/bundled-resources/poe-tile-templates/solidjs/postcss.config.js +5 -0
  69. package/bundled-resources/poe-tile-templates/solidjs/tests/solid-plugin.ts +49 -0
  70. package/bundled-resources/poe-tile-templates/solidjs/tile/index.html +14 -0
  71. package/bundled-resources/poe-tile-templates/solidjs/tile/src/entry.tsx +36 -0
  72. package/bundled-resources/poe-tile-templates/solidjs/tile/styles.css +51 -0
  73. package/bundled-resources/poe-tile-templates/solidjs/tsconfig.json +15 -0
  74. package/bundled-resources/poe-tile-templates/solidjs/ui/App.test.happydom.tsx +70 -0
  75. package/bundled-resources/poe-tile-templates/solidjs/ui/App.tsx +129 -0
  76. package/bundled-resources/poe-tile-templates/solidjs/vite.config.ts +18 -0
  77. package/bundled-resources/poe-tile-templates/tests/check-source.test.ts +131 -0
  78. package/bundled-resources/poe-tile-templates/tests/dev-script.test.slow.ts +166 -0
  79. package/bundled-resources/poe-tile-templates/tests/fixtures/customized-manager.ts +67 -0
  80. package/bundled-resources/poe-tile-templates/tests/fixtures/extended-mutators.ts.txt +106 -0
  81. package/bundled-resources/poe-tile-templates/tests/fixtures/multiplayer-verification.test.playwright.ts.txt +103 -0
  82. package/bundled-resources/poe-tile-templates/tests/fixtures/replace-starter-schema.ts +67 -0
  83. package/bundled-resources/poe-tile-templates/tests/fixtures/starter-demo/phaserjs.tsx.txt +85 -0
  84. package/bundled-resources/poe-tile-templates/tests/fixtures/starter-demo/preact.tsx.txt +69 -0
  85. package/bundled-resources/poe-tile-templates/tests/fixtures/starter-demo/react.tsx.txt +73 -0
  86. package/bundled-resources/poe-tile-templates/tests/fixtures/starter-demo/seating.ts.txt +54 -0
  87. package/bundled-resources/poe-tile-templates/tests/fixtures/starter-demo/solidjs.tsx.txt +70 -0
  88. package/bundled-resources/poe-tile-templates/tests/fixtures/starter-demo/vanilla-js.tsx.txt +85 -0
  89. package/bundled-resources/poe-tile-templates/tests/generated-templates.test.ts +278 -0
  90. package/bundled-resources/poe-tile-templates/tests/happy-dom-version.test.ts +27 -0
  91. package/bundled-resources/poe-tile-templates/tests/install-diagnostics.test.ts +99 -0
  92. package/bundled-resources/poe-tile-templates/tests/native-gesture-defaults.test.ts +23 -0
  93. package/bundled-resources/poe-tile-templates/tests/playwright-version.test.ts +84 -0
  94. package/bundled-resources/poe-tile-templates/tests/render-check-scaffold.test.ts +56 -0
  95. package/bundled-resources/poe-tile-templates/tests/sdk-dependency-key.test.ts +129 -0
  96. package/bundled-resources/poe-tile-templates/tests/visual-check.test.ts +90 -0
  97. package/bundled-resources/poe-tile-templates/vanilla-js/package.partial.json +3 -0
  98. package/bundled-resources/poe-tile-templates/vanilla-js/tile/index.html +14 -0
  99. package/bundled-resources/poe-tile-templates/vanilla-js/tile/src/entry.ts +35 -0
  100. package/bundled-resources/poe-tile-templates/vanilla-js/ui/App.test.happydom.tsx +96 -0
  101. package/bundled-resources/poe-tile-templates/vanilla-js/ui/App.ts +113 -0
  102. package/bundled-resources/poe-tile-templates/vanilla-js/vite.config.ts +17 -0
  103. package/cli.ts +134 -0
  104. package/index.ts +96 -0
  105. package/package.json +48 -5
  106. package/skills/audio-generation/.generated-by-poe-templated-docs +0 -0
  107. package/skills/audio-generation/SKILL.md +125 -0
  108. package/skills/finish-prototype/.generated-by-poe-templated-docs +0 -0
  109. package/skills/finish-prototype/SKILL.md +22 -0
  110. package/skills/help-me-build/.generated-by-poe-templated-docs +0 -0
  111. package/skills/help-me-build/SKILL.md +56 -0
  112. package/skills/image-generation/.generated-by-poe-templated-docs +0 -0
  113. package/skills/image-generation/SKILL.md +128 -0
  114. package/skills/one-shot/.generated-by-poe-templated-docs +0 -0
  115. package/skills/one-shot/SKILL.md +22 -0
  116. package/skills/platform-prototype/.generated-by-poe-templated-docs +0 -0
  117. package/skills/platform-prototype/SKILL.md +60 -0
  118. package/skills/platform-subagent/.generated-by-poe-templated-docs +0 -0
  119. package/skills/platform-subagent/SKILL.md +16 -0
  120. package/skills/poe-tiles-cli/.generated-by-poe-templated-docs +0 -0
  121. package/skills/poe-tiles-cli/SKILL.md +609 -0
  122. package/skills/poe-tiles-cli/references/device-motion.md +40 -0
  123. package/skills/poe-tiles-cli/references/player-updates.md +41 -0
  124. package/skills/prototype/.generated-by-poe-templated-docs +0 -0
  125. package/skills/prototype/SKILL.md +149 -0
  126. package/skills/publish/.generated-by-poe-templated-docs +0 -0
  127. package/skills/publish/SKILL.md +73 -0
  128. package/skills/synced-store/.generated-by-poe-templated-docs +0 -0
  129. package/skills/synced-store/SKILL.md +583 -0
  130. package/skills/synced-store/references/actions.md +85 -0
  131. package/skills/synced-store/references/api-patterns.md +245 -0
  132. package/skills/synced-store/references/architecture-scaling-and-performance.md +280 -0
  133. package/skills/synced-store/references/client-api-reference.md +263 -0
  134. package/skills/synced-store/references/data-visibility.md +95 -0
  135. package/skills/synced-store/references/external-stores.md +162 -0
  136. package/skills/synced-store/references/file-uploads.md +216 -0
  137. package/skills/synced-store/references/getting-user-info-of-members.md +228 -0
  138. package/skills/synced-store/references/limitations.md +72 -0
  139. package/skills/synced-store/references/live-data-limit-hook.md +131 -0
  140. package/skills/synced-store/references/mutator-rules.md +169 -0
  141. package/skills/synced-store/references/platform.md +49 -0
  142. package/skills/synced-store/references/schema-and-bindings.md +85 -0
  143. package/skills/synced-store/references/schema-libraries.md +57 -0
  144. package/skills/synced-store/references/schema-migrations.md +119 -0
  145. package/skills/synced-store/references/searchable-tables.md +27 -0
  146. package/skills/synced-store/references/server-forking.md +115 -0
  147. package/skills/synced-store/references/singleton-tables.md +61 -0
  148. package/skills/synced-store/references/sort-keys.md +253 -0
  149. package/skills/synced-store/references/ui-patterns.md +95 -0
  150. package/skills/tile-creator/.generated-by-poe-templated-docs +0 -0
  151. package/skills/tile-creator/SKILL.md +197 -0
  152. package/skills/tile-creator/references/assets.md +124 -0
  153. package/skills/tile-creator/references/backend-api.md +354 -0
  154. package/skills/tile-creator/references/cli-limitations.md +64 -0
  155. package/skills/tile-creator/references/cli.md +604 -0
  156. package/skills/tile-creator/references/client-api.md +2407 -0
  157. package/skills/tile-creator/references/composing-apps.md +166 -0
  158. package/skills/tile-creator/references/e2e-tests.md +55 -0
  159. package/skills/tile-creator/references/game-ux-best-practices.md +57 -0
  160. package/skills/tile-creator/references/migrating-pre-rename-tiles.md +79 -0
  161. package/skills/tile-creator/references/multiplayer-api-recipe.md +205 -0
  162. package/skills/tile-creator/references/native-results.md +100 -0
  163. package/skills/tile-creator/references/platform-integration.md +201 -0
  164. package/skills/tile-creator/references/power-report.md +199 -0
  165. package/skills/tile-creator/references/publish-rollout.md +166 -0
  166. package/skills/tile-creator/references/publishing.md +33 -0
  167. package/skills/tile-creator/references/push-notification-guidelines.md +58 -0
  168. package/skills/tile-creator/references/render-check.md +266 -0
  169. package/skills/tile-creator/references/running-the-client-api-on-a-server-owned-by-the-user.md +95 -0
  170. package/skills/tile-creator/references/safe-area-insets.md +79 -0
  171. package/skills/tile-creator/references/sandbox-limitations.md +32 -0
  172. package/skills/tile-creator/references/scaffolded-tile-folder-structure.md +48 -0
  173. package/skills/tile-creator/references/scaffolding-a-new-app.md +202 -0
  174. package/skills/tile-creator/references/simulations.md +125 -0
  175. package/skills/tile-creator/references/synced-store-client-reference.md +92 -0
  176. package/skills/tile-creator/references/troubleshooting.md +22 -0
  177. package/skills/tile-creator/references/turn-based-mutator.md +43 -0
  178. package/skills/tile-creator/references/user-erasure.md +14 -0
  179. package/skills/tile-creator/references/vite-plugin.md +166 -0
  180. package/skills/tile-creator/references/workspace-retention.md +72 -0
  181. package/src/admin-conversions-client.ts +28 -0
  182. package/src/admin-reviews-client.ts +36 -0
  183. package/src/api.generated.ts +1527 -0
  184. package/src/auth-token.ts +198 -0
  185. package/src/bounded-read.ts +35 -0
  186. package/src/bun-version.ts +33 -0
  187. package/src/checkout-base.ts +207 -0
  188. package/src/cli-bun-version.ts +16 -0
  189. package/src/cli-env.ts +28 -0
  190. package/src/cli-name.ts +23 -0
  191. package/src/client.ts +2474 -0
  192. package/src/collect-files.ts +226 -0
  193. package/src/commands/accounts.ts +55 -0
  194. package/src/commands/admin-abandon-conversion.ts +60 -0
  195. package/src/commands/admin-reviews.ts +66 -0
  196. package/src/commands/admin.ts +219 -0
  197. package/src/commands/auth.ts +89 -0
  198. package/src/commands/checkout-prototype.ts +67 -0
  199. package/src/commands/creator-source-capability.ts +11 -0
  200. package/src/commands/doctor-bun.ts +145 -0
  201. package/src/commands/doctor-command.ts +64 -0
  202. package/src/commands/doctor-package-json.ts +47 -0
  203. package/src/commands/doctor-sdk-pin.ts +156 -0
  204. package/src/commands/doctor-store-keys-lexer.ts +213 -0
  205. package/src/commands/doctor-store-keys-scan.ts +262 -0
  206. package/src/commands/doctor-store-keys.ts +196 -0
  207. package/src/commands/doctor.ts +371 -0
  208. package/src/commands/init/blank-scaffold-templates.ts +397 -0
  209. package/src/commands/init/index.ts +170 -0
  210. package/src/commands/init/internal-toolchain.ts +49 -0
  211. package/src/commands/init/manager-test-template.ts +107 -0
  212. package/src/commands/init/multiplayer-test-template.ts +217 -0
  213. package/src/commands/init/name-input.tsx +167 -0
  214. package/src/commands/init/no-store-scaffold-templates.ts +281 -0
  215. package/src/commands/init/no-store-scaffold.ts +134 -0
  216. package/src/commands/init/package-json-scripts.ts +72 -0
  217. package/src/commands/init/scaffold.ts +960 -0
  218. package/src/commands/init/sdk-tarball-url.generated.ts +4 -0
  219. package/src/commands/init/sdk-tarball-url.ts +31 -0
  220. package/src/commands/init/template-picker.tsx +147 -0
  221. package/src/commands/inspect-child-entry.ts +107 -0
  222. package/src/commands/inspect-contract.ts +87 -0
  223. package/src/commands/inspect-freshness.ts +217 -0
  224. package/src/commands/inspect-lock.ts +201 -0
  225. package/src/commands/inspect-options.ts +360 -0
  226. package/src/commands/inspect-orchestrate.ts +375 -0
  227. package/src/commands/inspect-process.ts +172 -0
  228. package/src/commands/inspect-ready.ts +65 -0
  229. package/src/commands/inspect-report.ts +235 -0
  230. package/src/commands/inspect-run-state.ts +296 -0
  231. package/src/commands/inspect-run.ts +157 -0
  232. package/src/commands/inspect-watchdog.ts +74 -0
  233. package/src/commands/install-joiner.ts +208 -0
  234. package/src/commands/login.ts +308 -0
  235. package/src/commands/models.ts +40 -0
  236. package/src/commands/parse-options.ts +36 -0
  237. package/src/commands/remix-package-json.ts +64 -0
  238. package/src/commands/remix.ts +379 -0
  239. package/src/commands/sdk-url.ts +141 -0
  240. package/src/commands/simulations.ts +133 -0
  241. package/src/commands/skills.ts +108 -0
  242. package/src/commands/store-files.ts +92 -0
  243. package/src/commands/stores.ts +703 -0
  244. package/src/commands/tiles-channel-commands.ts +115 -0
  245. package/src/commands/tiles-checkout.ts +351 -0
  246. package/src/commands/tiles-gallery-command.ts +95 -0
  247. package/src/commands/tiles-get-helpers.ts +27 -0
  248. package/src/commands/tiles-inspect.ts +276 -0
  249. package/src/commands/tiles-power-command.ts +308 -0
  250. package/src/commands/tiles-power-format.ts +396 -0
  251. package/src/commands/tiles-power-versions.ts +299 -0
  252. package/src/commands/tiles-publish-helpers.ts +145 -0
  253. package/src/commands/tiles-upload-command.ts +277 -0
  254. package/src/commands/tiles-version-commands.ts +201 -0
  255. package/src/commands/tiles-visibility-command.ts +103 -0
  256. package/src/commands/tiles.ts +257 -0
  257. package/src/commands/upgrade.ts +307 -0
  258. package/src/commit-in-progress.ts +42 -0
  259. package/src/creator-source-context.ts +97 -0
  260. package/src/creator-source-publish.ts +52 -0
  261. package/src/deferred-assets.ts +125 -0
  262. package/src/distribution.ts +28 -0
  263. package/src/errors.ts +61 -0
  264. package/src/install-command.ts +43 -0
  265. package/src/output.ts +62 -0
  266. package/src/poe-tile-config-files.ts +100 -0
  267. package/src/poe-tile-config-players.ts +168 -0
  268. package/src/poe-tile-config-remix.ts +166 -0
  269. package/src/poe-tile-config.ts +831 -0
  270. package/src/power-report-client.ts +55 -0
  271. package/src/prototype-startup.ts +21 -0
  272. package/src/publish-change-summary.ts +55 -0
  273. package/src/publish-overrides-validation.ts +49 -0
  274. package/src/publish-pack.ts +167 -0
  275. package/src/publish-phases.ts +57 -0
  276. package/src/publish-retry.ts +51 -0
  277. package/src/publish-tile-from-config.ts +434 -0
  278. package/src/recorder-stream.ts +169 -0
  279. package/src/remix-provenance.ts +156 -0
  280. package/src/resolve-client-credential.ts +71 -0
  281. package/src/resolve-media-uploads.ts +147 -0
  282. package/src/sdk-dependency.ts +54 -0
  283. package/src/sdk-skills.ts +85 -0
  284. package/src/should-skip-client-setup.ts +20 -0
  285. package/src/simulation-snapshot.ts +123 -0
  286. package/src/simulation-types.ts +74 -0
  287. package/src/simulations-client.ts +112 -0
  288. package/src/source-bundle.ts +466 -0
  289. package/src/staged-publish-cleanup.ts +44 -0
  290. package/src/staged-publish-deferred.ts +160 -0
  291. package/src/staged-publish.ts +401 -0
  292. package/src/store-file-upload.ts +268 -0
  293. package/src/store-request.ts +168 -0
  294. package/src/tar-canonical.ts +41 -0
  295. package/src/tar-extensions.ts +159 -0
  296. package/src/tar-extract.ts +193 -0
  297. package/src/tar-parse.ts +224 -0
  298. package/src/tar.ts +231 -0
  299. package/src/template-check-scripts.ts +18 -0
  300. package/src/tile-gallery-client.ts +82 -0
  301. package/src/types.ts +258 -0
  302. package/src/upload-concurrency.ts +54 -0
  303. package/src/whole-tile.ts +52 -0
package/README.md CHANGED
@@ -1,3 +1,31 @@
1
- # Temporary Holding Version
1
+ # @joiner-platform/cli
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The Joiner command line: create, test, and publish Joiner tiles.
4
+
5
+ ## Install
6
+
7
+ Joiner runs on [Bun](https://bun.sh) 1.4.2 or later.
8
+
9
+ ```bash
10
+ npm install -g @joiner-platform/cli
11
+ joiner login
12
+ ```
13
+
14
+ ## Agent skills
15
+
16
+ The package ships agent skills (tile-creator, synced-store, prototype, and
17
+ more) under `skills/<name>/SKILL.md`. Install them for every project:
18
+
19
+ ```bash
20
+ joiner skills install --global
21
+ ```
22
+
23
+ This writes `~/.claude/skills` and `~/.agents/skills`. Inside one project,
24
+ `joiner skills install` writes that project's `.claude/skills` and
25
+ `.agents/skills` instead. `joiner tiles init` does this for new projects.
26
+
27
+ ## Upgrade
28
+
29
+ ```bash
30
+ joiner upgrade
31
+ ```
@@ -0,0 +1,72 @@
1
+ # Joiner tile — {{APP_NAME}}
2
+
3
+ **Load the `tile-creator` skill before editing this tile**, following the host's skill-loading policy. It covers scaffold workflow, sandbox restrictions, schema/mutator patterns, and testing setup.
4
+
5
+ For synced-store work specifically, also load `synced-store`.
6
+
7
+ ## Verification
8
+
9
+ - Test creator-authored behavior with mutator/unit tests and Happy DOM UI tests.
10
+ Jest DOM matchers are configured in `tests/setup-dom.ts`. In Happy DOM tests,
11
+ query the returned container; Testing Library's global `screen` can bind
12
+ before the preloaded document exists. Add browser-only coverage when the
13
+ behavior needs it. Before publishing a multiplayer tile, adapt and run
14
+ a two-client browser test, including reconnect and persisted server state.
15
+ - Follow the `tile-creator` skill for `bun run verify` (including existing browser smoke
16
+ checks) and ad-hoc browser tooling. `tests/multiplayer.ts` is the
17
+ multiplayer browser recipe.
18
+ - The Creator host owns publication when its system prompt says so. Finish
19
+ verification and report its results; do not invoke publication commands.
20
+
21
+ ## Multiplayer golden path
22
+
23
+ The scaffold already contains the complete typed path; start by editing it
24
+ instead of searching the SDK or declaration files:
25
+
26
+ 1. Define tile-owned state and mutators in `synced-store/schema.ts`.
27
+ 2. Auto-seat members in `synced-store/hooks.ts` using `onAddUsers`. Keep the
28
+ hook deterministic and wired into both client and backend configs.
29
+ 3. Import `AppReadContext` from `client.ts` for reusable readers. It includes
30
+ tile tables plus `$users`, `$userInfo`, `$permissions`, and `$$system`.
31
+ In React, use `useLiveQuery` from `joiner-sdk/v1/react`; in Solid, use
32
+ `createLiveQueryResource` from `joiner-sdk/v1/solid`; in Preact, subscribe
33
+ from `useEffect` and return the unsubscribe function; in Vanilla JS and the
34
+ Phaser DOM shell, pass the module-level `(ctx: AppReadContext) => ...` reader
35
+ to `store.subscribe`. Keep Phaser itself behind the scaffold's dynamic import,
36
+ feed it snapshots from the DOM shell, and mutate only on semantic input—not
37
+ from the frame loop. The generated `ui/App.*` demonstrates each path.
38
+ The reader's tile rows, profiles, and return value are inferred; do not add
39
+ manual row types or inspect SDK declarations.
40
+ 4. Keep production and Happy DOM UI wiring on the shared `ui/app-contract.ts`
41
+ contract. Add platform capabilities to `AppProps` using SDK types such as
42
+ `PoeAPI["haptics"]` or `typeof resumeAudioContext`, wire the real value in
43
+ `tile/src/entry.*`, and update `createTestAppProps` in
44
+ `tests/app-test-props.ts` with the test value. Do not duplicate handwritten
45
+ callback signatures in the component or its tests.
46
+ 5. Read participant names and avatars from `$userInfo`; never display raw user
47
+ IDs as profile labels.
48
+ 6. Test with `createPoeTileTestHarness`. Each `createClient({ userId })` creates
49
+ `$users` and `$userInfo` rows and runs `onAddUsers`; the default profile name
50
+ equals `userId`. Pass `userInfo: { displayName, profilePicture }` on the
51
+ FIRST `createClient` for a user — a seeded profile is frozen after that, and
52
+ a later differing value throws rather than silently diverging from the
53
+ `$userInfo` row the store already committed. Always call `harness.dispose()`.
54
+
55
+ The generated mutator and Happy DOM tests are executable examples of this
56
+ flow. The default multiplayer starter also ships `synced-store/manager.test.ts`:
57
+ adapt it for typed manager-harness setup and turn/unread/Activity-tab/push assertions.
58
+ A temporary `$userInfo` inspection test should never be necessary.
59
+ Keep those focused tests small while iterating. Follow the skill's visual
60
+ verification guidance for task-appropriate browser checks.
61
+
62
+ ## Type-checking
63
+
64
+ Use `bun run type-check` so the project's configured compiler and options
65
+ apply. Keep `tests/` included in `tsconfig.json`: optional Playwright specs and
66
+ `tests/multiplayer.ts` still need type coverage even when they are not run.
67
+ Do not exclude those sources to make a check pass.
68
+
69
+ `bun run type-check` first runs `scripts/check-source.ts`. It fails on any
70
+ source file over 1500 lines, any `@ts-nocheck`, `@ts-ignore` or
71
+ `@ts-expect-error`, and any JavaScript file in a type-checked folder. Split the
72
+ file or fix the types; do not change the script or the `type-check` command.
@@ -0,0 +1,7 @@
1
+ <!-- TODO: update this README before publishing. -->
2
+ # {{APP_NAME}}
3
+
4
+ TODO: a short, player-facing description (2–4 sentences of prose) of what you
5
+ actually do in this app — written for someone deciding whether to play, not a
6
+ feature spec. No "What you can do" bullet list and no "Built on Synced-Store"
7
+ section; match the player-facing READMEs shipped under `poe-tiles/*`.
@@ -0,0 +1,8 @@
1
+ [test]
2
+ preload = ["fake-indexeddb/auto", "./tests/setup-dom.ts"]
3
+ coverage = true
4
+ coverageDir = "coverage"
5
+ coverageReporter = ["lcov"]
6
+
7
+ [test.reporter]
8
+ junit = "junit.xml"
@@ -0,0 +1,18 @@
1
+ node_modules/
2
+
3
+ # Build output
4
+ dist/
5
+
6
+ # Local CLI credential filenames. The CLI normally reads them from ~/.poe-tiles/.
7
+ .poe-tiles-token
8
+ poe-tiles-api-key
9
+ poe-tiles-session-token
10
+
11
+ # Keep app metadata images trackable. Commit any local profilePicture file
12
+ # referenced by .poe-tile.json.
13
+ .poe-tile-change-summary
14
+
15
+ # Local verification screenshots and recordings (scripts/visual-check.ts).
16
+ # Also excluded from the published source bundle, so nothing here counts
17
+ # toward its size limit.
18
+ .visual-checks/
@@ -0,0 +1,12 @@
1
+ import type { InferSyncedStoreClient } from "joiner-sdk/v1/client.js";
2
+ import type { TodoSchema } from "./synced-store/schema";
3
+
4
+ export type { TodoSchema, todoSchema } from "./synced-store/schema";
5
+ export type TodoStoreClient = InferSyncedStoreClient<TodoSchema>;
6
+ export { todoClientConfig } from "./synced-store/client-config";
7
+ export type {
8
+ TodoItem,
9
+ TodoReadContext as AppReadContext,
10
+ TodoTableTypes,
11
+ } from "./synced-store/data/items";
12
+ export { todoMutatorHandlers } from "./synced-store/mutators/index";
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "{{APP_NAME}}",
3
+ "version": "0.0.1",
4
+ "type": "module",
5
+ "scripts": {
6
+ "doctor": "./scripts/doctor.sh",
7
+ "dev": "bun scripts/check-bun.ts && bun scripts/dev.ts",
8
+ "build": "bun scripts/check-bun.ts && vite build",
9
+ "type-check": "bun scripts/check-source.ts && tsc --noEmit",
10
+ "test": "bun test --conditions browser ./synced-store ./ui/App.test.happydom.tsx",
11
+ "test:playwright": "bun run build && bunx playwright install chromium && bunx playwright test --update-snapshots",
12
+ "test:all": "bun run type-check && bun run test",
13
+ "verify": "bun run type-check && bun run test && bun run build && bunx playwright install chromium && bunx playwright test && bun run doctor",
14
+ "regenerate-screenshot": "bun run build && bunx playwright install chromium && REGEN_SCREENSHOTS=1 bunx playwright test tests/screenshot.test.playwright.ts",
15
+ "render-check": "bun run build && bunx playwright install chromium && RENDER_CHECK=1 bunx playwright test tests/render-check.test.playwright.ts",
16
+ "publish-to-poe-tiles": "bun run build && poe-tiles tiles upload",
17
+ "preinstall": "bun scripts/check-bun.ts"
18
+ },
19
+ "dependencies": {
20
+ "joiner-sdk": "{{POE_SDK_VERSION}}"
21
+ },
22
+ "devDependencies": {
23
+ "@playwright/test": "1.61.1",
24
+ "@testing-library/jest-dom": "6.9.1",
25
+ "@types/bun": "1.3.12",
26
+ "fake-indexeddb": "6.2.5",
27
+ "happy-dom": "20.11.2",
28
+ "typescript": "7.0.2",
29
+ "vite": "6.4.2",
30
+ "zod": "4.5.4"
31
+ },
32
+ "engines": {
33
+ "bun": ">=1.4.2 <1.5.0",
34
+ "node": ">=22.22.0"
35
+ }
36
+ }
@@ -0,0 +1,38 @@
1
+ import { defineConfig, devices } from "@playwright/test";
2
+
3
+ export default defineConfig({
4
+ testDir: "./tests",
5
+ testMatch: "*.test.playwright.ts",
6
+ projects: [
7
+ {
8
+ name: "desktop",
9
+ use: { ...devices["Desktop Chrome"] },
10
+ testIgnore: [
11
+ "**/mobile-viewport.test.playwright.ts",
12
+ "**/render-check.test.playwright.ts",
13
+ ],
14
+ },
15
+ {
16
+ // Named `mobile-viewport`, not `mobile`: this is Chromium with
17
+ // phone-shaped dimensions, NOT real WebKit. Safari-specific quirks
18
+ // (momentum scroll, address-bar dvh/vh, focus/keyboard) need real
19
+ // iOS Safari. The `browserName` override is required because
20
+ // `devices["iPhone 13"]` defaults to webkit but only Chromium is
21
+ // installed on CI / devcontainer images — mirrors the Pixel 7
22
+ // setup in projects/benchmarks/src/web-ui/playwright.config.ts.
23
+ name: "mobile-viewport",
24
+ use: {
25
+ ...devices["iPhone 13"],
26
+ browserName: "chromium",
27
+ defaultBrowserType: "chromium",
28
+ },
29
+ // The render check runs here too: the phone descriptor's scale factor
30
+ // and touch emulation are what let the render budget resolve its
31
+ // mobile defaults inside the tile frame.
32
+ testMatch: [
33
+ "**/mobile-viewport.test.playwright.ts",
34
+ "**/render-check.test.playwright.ts",
35
+ ],
36
+ },
37
+ ],
38
+ });
@@ -0,0 +1,148 @@
1
+ /**
2
+ * Source rules `bun run type-check` enforces before running `tsc`. Each one
3
+ * closes a way for tile code to grow past what the type checker and an agent
4
+ * editing it can keep correct:
5
+ *
6
+ * - A type-check suppression comment hides real errors, and a whole-file
7
+ * `nocheck` turns the checker off for everything later added to that file.
8
+ * - JavaScript in a type-checked folder is invisible to `tsc`.
9
+ * - A file over MAX_SOURCE_LINES cannot be read whole, so edits to it miss
10
+ * the other places that need the same change.
11
+ *
12
+ * Folders whose names start with a dot are skipped: copied skills quote the
13
+ * suppression comments, and `.visual-checks/` holds no source.
14
+ */
15
+ import { readdirSync, readFileSync } from "node:fs";
16
+ import { extname, join, relative, sep } from "node:path";
17
+
18
+ export const MAX_SOURCE_LINES = 1500;
19
+
20
+ const CODE_EXTENSIONS = new Set([
21
+ ".ts",
22
+ ".tsx",
23
+ ".mts",
24
+ ".cts",
25
+ ".js",
26
+ ".jsx",
27
+ ".mjs",
28
+ ".cjs",
29
+ ]);
30
+ const JS_EXTENSIONS = new Set([".js", ".jsx", ".mjs", ".cjs"]);
31
+ const SKIPPED_DIRS = new Set(["node_modules", "dist"]);
32
+ /** The folders `tsconfig.json` includes, where JavaScript escapes `tsc`. */
33
+ const TYPED_DIRS = ["tile/src", "synced-store", "ui", "tests"];
34
+ /** A directive TypeScript honors: the comment opens with it. */
35
+ const SUPPRESSION = /(?:\/\/|\/\*)[/*!\s]*@ts-(nocheck|ignore|expect-error)\b/;
36
+ /** The same directive on a later line of a block comment opened above. */
37
+ const CONTINUED_SUPPRESSION = /^[\s*]*@ts-(nocheck|ignore|expect-error)\b/;
38
+
39
+ /** Code files under `dir`, as absolute paths. O(files in the tree). */
40
+ function codeFiles(dir: string): string[] {
41
+ const files: string[] = [];
42
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
43
+ if (entry.name.startsWith(".") || SKIPPED_DIRS.has(entry.name)) continue;
44
+ const path = join(dir, entry.name);
45
+ if (entry.isDirectory()) files.push(...codeFiles(path));
46
+ else if (entry.isFile() && CODE_EXTENSIONS.has(extname(entry.name)))
47
+ files.push(path);
48
+ }
49
+ return files;
50
+ }
51
+
52
+ function isInTypedDir(relPath: string): boolean {
53
+ const posixPath = relPath.split(sep).join("/");
54
+ return (
55
+ posixPath.startsWith("client.") ||
56
+ TYPED_DIRS.some((dir) => posixPath.startsWith(`${dir}/`))
57
+ );
58
+ }
59
+
60
+ /** One message per broken rule in `relPath`. O(lines in the file). */
61
+ function fileProblems({
62
+ relPath,
63
+ text,
64
+ }: {
65
+ relPath: string;
66
+ text: string;
67
+ }): string[] {
68
+ const problems: string[] = [];
69
+ if (JS_EXTENSIONS.has(extname(relPath)) && isInTypedDir(relPath)) {
70
+ problems.push(
71
+ `${relPath}: JavaScript is not type-checked. Rename it to TypeScript and fix the errors tsc reports.`,
72
+ );
73
+ }
74
+ const lines = text.split("\n");
75
+ if (lines.at(-1) === "") lines.pop();
76
+ if (lines.length > MAX_SOURCE_LINES) {
77
+ problems.push(
78
+ `${relPath}: ${lines.length} lines. Split it into focused modules of at most ${MAX_SOURCE_LINES} lines each.`,
79
+ );
80
+ }
81
+ return [...problems, ...suppressionProblems({ relPath, lines })];
82
+ }
83
+
84
+ /**
85
+ * Whether a block comment is still open after `line`. Strings are not parsed,
86
+ * so a `/*` inside one can open a comment early; that only matters when a
87
+ * following line then starts with a directive. O(line length).
88
+ */
89
+ function blockCommentOpenAfter({
90
+ line,
91
+ open,
92
+ }: {
93
+ line: string;
94
+ open: boolean;
95
+ }): boolean {
96
+ let isOpen = open;
97
+ let from = 0;
98
+ for (;;) {
99
+ const at = line.indexOf(isOpen ? "*/" : "/*", from);
100
+ if (at === -1) return isOpen;
101
+ isOpen = !isOpen;
102
+ from = at + 2;
103
+ }
104
+ }
105
+
106
+ /** One message per suppression directive. O(lines in the file). */
107
+ function suppressionProblems({
108
+ relPath,
109
+ lines,
110
+ }: {
111
+ relPath: string;
112
+ lines: string[];
113
+ }): string[] {
114
+ const problems: string[] = [];
115
+ let inBlockComment = false;
116
+ lines.forEach((line, index) => {
117
+ const continued = inBlockComment ? CONTINUED_SUPPRESSION.exec(line) : null;
118
+ const directive = (continued ?? SUPPRESSION.exec(line))?.[1];
119
+ inBlockComment = blockCommentOpenAfter({ line, open: inBlockComment });
120
+ if (!directive) return;
121
+ problems.push(
122
+ `${relPath}:${index + 1}: @ts-${directive} hides type errors. Remove it and fix the errors tsc reports.`,
123
+ );
124
+ });
125
+ return problems;
126
+ }
127
+
128
+ /** Every broken rule under the tile at `root`. O(total source size). */
129
+ export function findSourceProblems(root: string): string[] {
130
+ return codeFiles(root)
131
+ .sort()
132
+ .flatMap((path) =>
133
+ fileProblems({
134
+ relPath: relative(root, path),
135
+ text: readFileSync(path, "utf8"),
136
+ }),
137
+ );
138
+ }
139
+
140
+ if (import.meta.main) {
141
+ const problems = findSourceProblems(process.cwd());
142
+ if (problems.length > 0) {
143
+ console.error(
144
+ `Source check failed (scripts/check-source.ts):\n${problems.map((problem) => ` ${problem}`).join("\n")}`,
145
+ );
146
+ process.exit(1);
147
+ }
148
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Dev server for {{APP_NAME}}.
3
+ *
4
+ * Spawns `vite build --watch`, serves the bundle through TestServer, and
5
+ * injects browser auto-reload on rebuild.
6
+ *
7
+ * bun run dev
8
+ */
9
+
10
+ import { dirname, resolve } from "node:path";
11
+ import { fileURLToPath } from "node:url";
12
+ import { runPoeTileDevServer } from "joiner-sdk/v1/test-utils/dev-server.js";
13
+
14
+ const __dirname = dirname(fileURLToPath(import.meta.url));
15
+
16
+ await runPoeTileDevServer({
17
+ tileTypeId: "{{APP_NAME}}",
18
+ tileRootDir: resolve(__dirname, ".."),
19
+ });
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env bash
2
+ # Diagnostic launcher for a scaffolded Poe tile.
3
+ #
4
+ # Run from the project root:
5
+ #
6
+ # ./scripts/doctor.sh
7
+
8
+ set -euo pipefail
9
+
10
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
11
+ PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
12
+ REPO_ROOT="$(git -C "$PROJECT_ROOT" rev-parse --show-toplevel 2>/dev/null || printf '%s\n' "$PROJECT_ROOT")"
13
+ REPO_CLI="$REPO_ROOT/projects/poe-tiles-cli/cli.ts"
14
+
15
+ if [[ -f "$REPO_CLI" ]] && command -v bun >/dev/null 2>&1; then
16
+ exec bun "$REPO_CLI" doctor --cwd "$PROJECT_ROOT"
17
+ fi
18
+
19
+ if command -v poe-tiles >/dev/null 2>&1; then
20
+ exec poe-tiles doctor --cwd "$PROJECT_ROOT"
21
+ fi
22
+
23
+ if command -v bun >/dev/null 2>&1; then
24
+ exec bunx --bun poe-tiles doctor --cwd "$PROJECT_ROOT"
25
+ fi
26
+
27
+ echo "Could not run Joiner doctor because Bun is not available."
28
+ echo "Install Bun from https://bun.sh, then open a new terminal or restart the agent."
29
+ exit 1
@@ -0,0 +1,64 @@
1
+ import { mkdirSync } from "node:fs";
2
+ import { join } from "node:path";
3
+
4
+ /**
5
+ * Where ad-hoc verification screenshots and recordings go. Gitignored and
6
+ * excluded from the published source bundle, so frames left here for review
7
+ * never count toward the bundle's size limit.
8
+ */
9
+ export const VISUAL_CHECKS_DIR = ".visual-checks";
10
+
11
+ /** A path under {@link VISUAL_CHECKS_DIR}, creating the directory on first use. */
12
+ export function visualCheckPath(name: string, root = process.cwd()): string {
13
+ const dir = join(root, VISUAL_CHECKS_DIR);
14
+ mkdirSync(dir, { recursive: true });
15
+ return join(dir, name);
16
+ }
17
+
18
+ function callLog(error: unknown): string {
19
+ if (!(error instanceof Error) || !("callLog" in error)) return "";
20
+ const log = error.callLog;
21
+ if (typeof log === "string") return log;
22
+ if (Array.isArray(log) && log.every((line) => typeof line === "string")) {
23
+ return log.join("\n");
24
+ }
25
+ return "";
26
+ }
27
+
28
+ /** Resolves once everything already written to stdout and stderr is flushed. */
29
+ async function flushOutput(): Promise<void> {
30
+ await Promise.all(
31
+ [process.stdout, process.stderr].map(
32
+ (stream) =>
33
+ new Promise<void>((resolve) => stream.write("", () => resolve())),
34
+ ),
35
+ );
36
+ }
37
+
38
+ /**
39
+ * Run an ad-hoc browser check as the script's last statement, then end the
40
+ * process: exit 0 once the body resolves, or print the failure without an
41
+ * uncaught library code frame and exit 1.
42
+ *
43
+ * Ending on success is deliberate. A check that leaves its `TestServer` or
44
+ * browser open (no `server.close()` in its `finally`) keeps the event loop
45
+ * alive after its last screenshot, so the command would otherwise run until a
46
+ * timeout kills it.
47
+ */
48
+ export async function runVisualCheck(
49
+ fn: () => void | Promise<void>,
50
+ ): Promise<never> {
51
+ let exitCode = 0;
52
+ try {
53
+ await fn();
54
+ } catch (error) {
55
+ const message = error instanceof Error ? error.message : String(error);
56
+ console.error(message);
57
+ // Playwright usually includes its call log in message already.
58
+ const log = callLog(error);
59
+ if (log && !message.includes(log)) console.error(log);
60
+ exitCode = 1;
61
+ }
62
+ await flushOutput();
63
+ process.exit(exitCode);
64
+ }
@@ -0,0 +1,9 @@
1
+ import { defineBackendConfig } from "joiner-sdk/v1/backend.js";
2
+ import { todoMutatorHandlers } from "./mutators/index";
3
+ import { todoSchema } from "./schema";
4
+
5
+ export const todoBackendConfig = defineBackendConfig({
6
+ schema: todoSchema,
7
+ mutators: todoMutatorHandlers,
8
+ actions: {},
9
+ });
@@ -0,0 +1,8 @@
1
+ import { defineClientConfig } from "joiner-sdk/v1/client.js";
2
+ import { todoMutatorHandlers } from "./mutators/index";
3
+ import type { todoSchema } from "./schema";
4
+
5
+ export const todoClientConfig = defineClientConfig<typeof todoSchema>({
6
+ mutators: todoMutatorHandlers,
7
+ schemaVersion: 1,
8
+ });
@@ -0,0 +1,16 @@
1
+ import type {
2
+ InferReadContext,
3
+ InferSchemaTableTypes,
4
+ } from "joiner-sdk/v1/client.js";
5
+ import type { TodoSchema } from "../schema";
6
+
7
+ export type TodoTableTypes = InferSchemaTableTypes<TodoSchema>;
8
+ export type TodoItem = TodoTableTypes["items"];
9
+ export type TodoReadContext = InferReadContext<TodoSchema>;
10
+
11
+ export async function readTodo(
12
+ ctx: TodoReadContext,
13
+ id: string,
14
+ ): Promise<TodoItem | undefined> {
15
+ return (await ctx.table("items").get(id)) as TodoItem | undefined;
16
+ }
@@ -0,0 +1,10 @@
1
+ import { removeTodo } from "./remove-todo";
2
+ import { setTodo } from "./set-todo";
3
+ import type { TodoMutators } from "./types";
4
+
5
+ export const todoMutatorHandlers: TodoMutators = {
6
+ setTodo,
7
+ removeTodo,
8
+ };
9
+
10
+ export type { TodoMutator, TodoMutators } from "./types";
@@ -0,0 +1,5 @@
1
+ import type { TodoMutator } from "./types";
2
+
3
+ export const removeTodo: TodoMutator<"removeTodo"> = async (ctx, input) => {
4
+ await ctx.table("items").delete(input.id);
5
+ };
@@ -0,0 +1,20 @@
1
+ import { readTodo, type TodoItem } from "../data/items";
2
+ import type { TodoMutator } from "./types";
3
+
4
+ export const setTodo: TodoMutator<"setTodo"> = async (ctx, input) => {
5
+ const existing = await readTodo(ctx, input.id);
6
+ const createdAt = input.createdAt ?? existing?.createdAt;
7
+ if (createdAt === undefined) {
8
+ throw new Error("createdAt is required when creating a todo");
9
+ }
10
+ const order = input.order ?? existing?.order ?? createdAt;
11
+ const todo: TodoItem = {
12
+ id: input.id,
13
+ text: input.text ?? existing?.text ?? "",
14
+ completed: input.completed ?? existing?.completed ?? false,
15
+ createdAt,
16
+ createdBy: existing?.createdBy ?? ctx.userId,
17
+ order,
18
+ };
19
+ await ctx.table("items").set({ itemKey: input.id, value: todo });
20
+ };
@@ -0,0 +1,5 @@
1
+ import type { InferMutatorHandlers } from "joiner-sdk/v1/client.js";
2
+ import type { TodoSchema } from "../schema";
3
+
4
+ export type TodoMutators = InferMutatorHandlers<TodoSchema>;
5
+ export type TodoMutator<Name extends keyof TodoMutators> = TodoMutators[Name];