@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.
- package/README.md +30 -2
- package/bundled-resources/poe-tile-templates/base/CLAUDE.md +72 -0
- package/bundled-resources/poe-tile-templates/base/README.md +7 -0
- package/bundled-resources/poe-tile-templates/base/_bunfig.toml +8 -0
- package/bundled-resources/poe-tile-templates/base/_gitignore +18 -0
- package/bundled-resources/poe-tile-templates/base/client.ts +12 -0
- package/bundled-resources/poe-tile-templates/base/package.json +36 -0
- package/bundled-resources/poe-tile-templates/base/playwright.config.ts +38 -0
- package/bundled-resources/poe-tile-templates/base/scripts/check-source.ts +148 -0
- package/bundled-resources/poe-tile-templates/base/scripts/dev.ts +19 -0
- package/bundled-resources/poe-tile-templates/base/scripts/doctor.sh +29 -0
- package/bundled-resources/poe-tile-templates/base/scripts/visual-check.ts +64 -0
- package/bundled-resources/poe-tile-templates/base/synced-store/backend-config.ts +9 -0
- package/bundled-resources/poe-tile-templates/base/synced-store/client-config.ts +8 -0
- package/bundled-resources/poe-tile-templates/base/synced-store/data/items.ts +16 -0
- package/bundled-resources/poe-tile-templates/base/synced-store/mutators/index.ts +10 -0
- package/bundled-resources/poe-tile-templates/base/synced-store/mutators/remove-todo.ts +5 -0
- package/bundled-resources/poe-tile-templates/base/synced-store/mutators/set-todo.ts +20 -0
- package/bundled-resources/poe-tile-templates/base/synced-store/mutators/types.ts +5 -0
- package/bundled-resources/poe-tile-templates/base/synced-store/mutators.test.ts +138 -0
- package/bundled-resources/poe-tile-templates/base/synced-store/schema.ts +40 -0
- package/bundled-resources/poe-tile-templates/base/tests/e2e.test.playwright.ts +92 -0
- package/bundled-resources/poe-tile-templates/base/tests/mobile-viewport.test.playwright.ts +111 -0
- package/bundled-resources/poe-tile-templates/base/tests/render-check.test.playwright.ts +128 -0
- package/bundled-resources/poe-tile-templates/base/tests/screenshot.test.playwright.ts +86 -0
- package/bundled-resources/poe-tile-templates/base/tests/setup-dom.ts +70 -0
- package/bundled-resources/poe-tile-templates/base/tile/src/backend.ts +3 -0
- package/bundled-resources/poe-tile-templates/base/tile/styles.css +47 -0
- package/bundled-resources/poe-tile-templates/base/tsconfig.json +13 -0
- package/bundled-resources/poe-tile-templates/coverage.config.json +6 -0
- package/bundled-resources/poe-tile-templates/index.ts +27 -0
- package/bundled-resources/poe-tile-templates/package.json +31 -0
- package/bundled-resources/poe-tile-templates/phaserjs/package.partial.json +6 -0
- package/bundled-resources/poe-tile-templates/phaserjs/tile/index.html +14 -0
- package/bundled-resources/poe-tile-templates/phaserjs/tile/src/entry.ts +35 -0
- package/bundled-resources/poe-tile-templates/phaserjs/ui/App.test.happydom.tsx +98 -0
- package/bundled-resources/poe-tile-templates/phaserjs/ui/App.ts +180 -0
- package/bundled-resources/poe-tile-templates/phaserjs/ui/phaser-scene.ts +174 -0
- package/bundled-resources/poe-tile-templates/phaserjs/vite.config.ts +28 -0
- package/bundled-resources/poe-tile-templates/preact/package.partial.json +9 -0
- package/bundled-resources/poe-tile-templates/preact/postcss.config.js +5 -0
- package/bundled-resources/poe-tile-templates/preact/tile/index.html +14 -0
- package/bundled-resources/poe-tile-templates/preact/tile/src/entry.tsx +36 -0
- package/bundled-resources/poe-tile-templates/preact/tile/styles.css +51 -0
- package/bundled-resources/poe-tile-templates/preact/tsconfig.json +15 -0
- package/bundled-resources/poe-tile-templates/preact/ui/App.test.happydom.tsx +69 -0
- package/bundled-resources/poe-tile-templates/preact/ui/App.tsx +116 -0
- package/bundled-resources/poe-tile-templates/preact/vite.config.ts +18 -0
- package/bundled-resources/poe-tile-templates/react/package.partial.json +12 -0
- package/bundled-resources/poe-tile-templates/react/postcss.config.js +5 -0
- package/bundled-resources/poe-tile-templates/react/tile/index.html +14 -0
- package/bundled-resources/poe-tile-templates/react/tile/src/entry.tsx +38 -0
- package/bundled-resources/poe-tile-templates/react/tile/styles.css +51 -0
- package/bundled-resources/poe-tile-templates/react/tsconfig.json +14 -0
- package/bundled-resources/poe-tile-templates/react/ui/App.test.happydom.tsx +71 -0
- package/bundled-resources/poe-tile-templates/react/ui/App.tsx +110 -0
- package/bundled-resources/poe-tile-templates/react/vite.config.ts +21 -0
- package/bundled-resources/poe-tile-templates/scripts/cleanup.ts +10 -0
- package/bundled-resources/poe-tile-templates/scripts/generate.ts +57 -0
- package/bundled-resources/poe-tile-templates/scripts/install-diagnostics.ts +52 -0
- package/bundled-resources/poe-tile-templates/scripts/paths.ts +7 -0
- package/bundled-resources/poe-tile-templates/scripts/sdk-dependency-key.ts +288 -0
- package/bundled-resources/poe-tile-templates/scripts/verify-all-sdks.ts +132 -0
- package/bundled-resources/poe-tile-templates/scripts/verify-local-sdk-command.ts +30 -0
- package/bundled-resources/poe-tile-templates/scripts/verify-local-sdk-tarball.ts +397 -0
- package/bundled-resources/poe-tile-templates/solidjs/_bunfig.toml +14 -0
- package/bundled-resources/poe-tile-templates/solidjs/package.partial.json +13 -0
- package/bundled-resources/poe-tile-templates/solidjs/postcss.config.js +5 -0
- package/bundled-resources/poe-tile-templates/solidjs/tests/solid-plugin.ts +49 -0
- package/bundled-resources/poe-tile-templates/solidjs/tile/index.html +14 -0
- package/bundled-resources/poe-tile-templates/solidjs/tile/src/entry.tsx +36 -0
- package/bundled-resources/poe-tile-templates/solidjs/tile/styles.css +51 -0
- package/bundled-resources/poe-tile-templates/solidjs/tsconfig.json +15 -0
- package/bundled-resources/poe-tile-templates/solidjs/ui/App.test.happydom.tsx +70 -0
- package/bundled-resources/poe-tile-templates/solidjs/ui/App.tsx +129 -0
- package/bundled-resources/poe-tile-templates/solidjs/vite.config.ts +18 -0
- package/bundled-resources/poe-tile-templates/tests/check-source.test.ts +131 -0
- package/bundled-resources/poe-tile-templates/tests/dev-script.test.slow.ts +166 -0
- package/bundled-resources/poe-tile-templates/tests/fixtures/customized-manager.ts +67 -0
- package/bundled-resources/poe-tile-templates/tests/fixtures/extended-mutators.ts.txt +106 -0
- package/bundled-resources/poe-tile-templates/tests/fixtures/multiplayer-verification.test.playwright.ts.txt +103 -0
- package/bundled-resources/poe-tile-templates/tests/fixtures/replace-starter-schema.ts +67 -0
- package/bundled-resources/poe-tile-templates/tests/fixtures/starter-demo/phaserjs.tsx.txt +85 -0
- package/bundled-resources/poe-tile-templates/tests/fixtures/starter-demo/preact.tsx.txt +69 -0
- package/bundled-resources/poe-tile-templates/tests/fixtures/starter-demo/react.tsx.txt +73 -0
- package/bundled-resources/poe-tile-templates/tests/fixtures/starter-demo/seating.ts.txt +54 -0
- package/bundled-resources/poe-tile-templates/tests/fixtures/starter-demo/solidjs.tsx.txt +70 -0
- package/bundled-resources/poe-tile-templates/tests/fixtures/starter-demo/vanilla-js.tsx.txt +85 -0
- package/bundled-resources/poe-tile-templates/tests/generated-templates.test.ts +278 -0
- package/bundled-resources/poe-tile-templates/tests/happy-dom-version.test.ts +27 -0
- package/bundled-resources/poe-tile-templates/tests/install-diagnostics.test.ts +99 -0
- package/bundled-resources/poe-tile-templates/tests/native-gesture-defaults.test.ts +23 -0
- package/bundled-resources/poe-tile-templates/tests/playwright-version.test.ts +84 -0
- package/bundled-resources/poe-tile-templates/tests/render-check-scaffold.test.ts +56 -0
- package/bundled-resources/poe-tile-templates/tests/sdk-dependency-key.test.ts +129 -0
- package/bundled-resources/poe-tile-templates/tests/visual-check.test.ts +90 -0
- package/bundled-resources/poe-tile-templates/vanilla-js/package.partial.json +3 -0
- package/bundled-resources/poe-tile-templates/vanilla-js/tile/index.html +14 -0
- package/bundled-resources/poe-tile-templates/vanilla-js/tile/src/entry.ts +35 -0
- package/bundled-resources/poe-tile-templates/vanilla-js/ui/App.test.happydom.tsx +96 -0
- package/bundled-resources/poe-tile-templates/vanilla-js/ui/App.ts +113 -0
- package/bundled-resources/poe-tile-templates/vanilla-js/vite.config.ts +17 -0
- package/cli.ts +134 -0
- package/index.ts +96 -0
- package/package.json +48 -5
- package/skills/audio-generation/.generated-by-poe-templated-docs +0 -0
- package/skills/audio-generation/SKILL.md +125 -0
- package/skills/finish-prototype/.generated-by-poe-templated-docs +0 -0
- package/skills/finish-prototype/SKILL.md +22 -0
- package/skills/help-me-build/.generated-by-poe-templated-docs +0 -0
- package/skills/help-me-build/SKILL.md +56 -0
- package/skills/image-generation/.generated-by-poe-templated-docs +0 -0
- package/skills/image-generation/SKILL.md +128 -0
- package/skills/one-shot/.generated-by-poe-templated-docs +0 -0
- package/skills/one-shot/SKILL.md +22 -0
- package/skills/platform-prototype/.generated-by-poe-templated-docs +0 -0
- package/skills/platform-prototype/SKILL.md +60 -0
- package/skills/platform-subagent/.generated-by-poe-templated-docs +0 -0
- package/skills/platform-subagent/SKILL.md +16 -0
- package/skills/poe-tiles-cli/.generated-by-poe-templated-docs +0 -0
- package/skills/poe-tiles-cli/SKILL.md +609 -0
- package/skills/poe-tiles-cli/references/device-motion.md +40 -0
- package/skills/poe-tiles-cli/references/player-updates.md +41 -0
- package/skills/prototype/.generated-by-poe-templated-docs +0 -0
- package/skills/prototype/SKILL.md +149 -0
- package/skills/publish/.generated-by-poe-templated-docs +0 -0
- package/skills/publish/SKILL.md +73 -0
- package/skills/synced-store/.generated-by-poe-templated-docs +0 -0
- package/skills/synced-store/SKILL.md +583 -0
- package/skills/synced-store/references/actions.md +85 -0
- package/skills/synced-store/references/api-patterns.md +245 -0
- package/skills/synced-store/references/architecture-scaling-and-performance.md +280 -0
- package/skills/synced-store/references/client-api-reference.md +263 -0
- package/skills/synced-store/references/data-visibility.md +95 -0
- package/skills/synced-store/references/external-stores.md +162 -0
- package/skills/synced-store/references/file-uploads.md +216 -0
- package/skills/synced-store/references/getting-user-info-of-members.md +228 -0
- package/skills/synced-store/references/limitations.md +72 -0
- package/skills/synced-store/references/live-data-limit-hook.md +131 -0
- package/skills/synced-store/references/mutator-rules.md +169 -0
- package/skills/synced-store/references/platform.md +49 -0
- package/skills/synced-store/references/schema-and-bindings.md +85 -0
- package/skills/synced-store/references/schema-libraries.md +57 -0
- package/skills/synced-store/references/schema-migrations.md +119 -0
- package/skills/synced-store/references/searchable-tables.md +27 -0
- package/skills/synced-store/references/server-forking.md +115 -0
- package/skills/synced-store/references/singleton-tables.md +61 -0
- package/skills/synced-store/references/sort-keys.md +253 -0
- package/skills/synced-store/references/ui-patterns.md +95 -0
- package/skills/tile-creator/.generated-by-poe-templated-docs +0 -0
- package/skills/tile-creator/SKILL.md +197 -0
- package/skills/tile-creator/references/assets.md +124 -0
- package/skills/tile-creator/references/backend-api.md +354 -0
- package/skills/tile-creator/references/cli-limitations.md +64 -0
- package/skills/tile-creator/references/cli.md +604 -0
- package/skills/tile-creator/references/client-api.md +2407 -0
- package/skills/tile-creator/references/composing-apps.md +166 -0
- package/skills/tile-creator/references/e2e-tests.md +55 -0
- package/skills/tile-creator/references/game-ux-best-practices.md +57 -0
- package/skills/tile-creator/references/migrating-pre-rename-tiles.md +79 -0
- package/skills/tile-creator/references/multiplayer-api-recipe.md +205 -0
- package/skills/tile-creator/references/native-results.md +100 -0
- package/skills/tile-creator/references/platform-integration.md +201 -0
- package/skills/tile-creator/references/power-report.md +199 -0
- package/skills/tile-creator/references/publish-rollout.md +166 -0
- package/skills/tile-creator/references/publishing.md +33 -0
- package/skills/tile-creator/references/push-notification-guidelines.md +58 -0
- package/skills/tile-creator/references/render-check.md +266 -0
- package/skills/tile-creator/references/running-the-client-api-on-a-server-owned-by-the-user.md +95 -0
- package/skills/tile-creator/references/safe-area-insets.md +79 -0
- package/skills/tile-creator/references/sandbox-limitations.md +32 -0
- package/skills/tile-creator/references/scaffolded-tile-folder-structure.md +48 -0
- package/skills/tile-creator/references/scaffolding-a-new-app.md +202 -0
- package/skills/tile-creator/references/simulations.md +125 -0
- package/skills/tile-creator/references/synced-store-client-reference.md +92 -0
- package/skills/tile-creator/references/troubleshooting.md +22 -0
- package/skills/tile-creator/references/turn-based-mutator.md +43 -0
- package/skills/tile-creator/references/user-erasure.md +14 -0
- package/skills/tile-creator/references/vite-plugin.md +166 -0
- package/skills/tile-creator/references/workspace-retention.md +72 -0
- package/src/admin-conversions-client.ts +28 -0
- package/src/admin-reviews-client.ts +36 -0
- package/src/api.generated.ts +1527 -0
- package/src/auth-token.ts +198 -0
- package/src/bounded-read.ts +35 -0
- package/src/bun-version.ts +33 -0
- package/src/checkout-base.ts +207 -0
- package/src/cli-bun-version.ts +16 -0
- package/src/cli-env.ts +28 -0
- package/src/cli-name.ts +23 -0
- package/src/client.ts +2474 -0
- package/src/collect-files.ts +226 -0
- package/src/commands/accounts.ts +55 -0
- package/src/commands/admin-abandon-conversion.ts +60 -0
- package/src/commands/admin-reviews.ts +66 -0
- package/src/commands/admin.ts +219 -0
- package/src/commands/auth.ts +89 -0
- package/src/commands/checkout-prototype.ts +67 -0
- package/src/commands/creator-source-capability.ts +11 -0
- package/src/commands/doctor-bun.ts +145 -0
- package/src/commands/doctor-command.ts +64 -0
- package/src/commands/doctor-package-json.ts +47 -0
- package/src/commands/doctor-sdk-pin.ts +156 -0
- package/src/commands/doctor-store-keys-lexer.ts +213 -0
- package/src/commands/doctor-store-keys-scan.ts +262 -0
- package/src/commands/doctor-store-keys.ts +196 -0
- package/src/commands/doctor.ts +371 -0
- package/src/commands/init/blank-scaffold-templates.ts +397 -0
- package/src/commands/init/index.ts +170 -0
- package/src/commands/init/internal-toolchain.ts +49 -0
- package/src/commands/init/manager-test-template.ts +107 -0
- package/src/commands/init/multiplayer-test-template.ts +217 -0
- package/src/commands/init/name-input.tsx +167 -0
- package/src/commands/init/no-store-scaffold-templates.ts +281 -0
- package/src/commands/init/no-store-scaffold.ts +134 -0
- package/src/commands/init/package-json-scripts.ts +72 -0
- package/src/commands/init/scaffold.ts +960 -0
- package/src/commands/init/sdk-tarball-url.generated.ts +4 -0
- package/src/commands/init/sdk-tarball-url.ts +31 -0
- package/src/commands/init/template-picker.tsx +147 -0
- package/src/commands/inspect-child-entry.ts +107 -0
- package/src/commands/inspect-contract.ts +87 -0
- package/src/commands/inspect-freshness.ts +217 -0
- package/src/commands/inspect-lock.ts +201 -0
- package/src/commands/inspect-options.ts +360 -0
- package/src/commands/inspect-orchestrate.ts +375 -0
- package/src/commands/inspect-process.ts +172 -0
- package/src/commands/inspect-ready.ts +65 -0
- package/src/commands/inspect-report.ts +235 -0
- package/src/commands/inspect-run-state.ts +296 -0
- package/src/commands/inspect-run.ts +157 -0
- package/src/commands/inspect-watchdog.ts +74 -0
- package/src/commands/install-joiner.ts +208 -0
- package/src/commands/login.ts +308 -0
- package/src/commands/models.ts +40 -0
- package/src/commands/parse-options.ts +36 -0
- package/src/commands/remix-package-json.ts +64 -0
- package/src/commands/remix.ts +379 -0
- package/src/commands/sdk-url.ts +141 -0
- package/src/commands/simulations.ts +133 -0
- package/src/commands/skills.ts +108 -0
- package/src/commands/store-files.ts +92 -0
- package/src/commands/stores.ts +703 -0
- package/src/commands/tiles-channel-commands.ts +115 -0
- package/src/commands/tiles-checkout.ts +351 -0
- package/src/commands/tiles-gallery-command.ts +95 -0
- package/src/commands/tiles-get-helpers.ts +27 -0
- package/src/commands/tiles-inspect.ts +276 -0
- package/src/commands/tiles-power-command.ts +308 -0
- package/src/commands/tiles-power-format.ts +396 -0
- package/src/commands/tiles-power-versions.ts +299 -0
- package/src/commands/tiles-publish-helpers.ts +145 -0
- package/src/commands/tiles-upload-command.ts +277 -0
- package/src/commands/tiles-version-commands.ts +201 -0
- package/src/commands/tiles-visibility-command.ts +103 -0
- package/src/commands/tiles.ts +257 -0
- package/src/commands/upgrade.ts +307 -0
- package/src/commit-in-progress.ts +42 -0
- package/src/creator-source-context.ts +97 -0
- package/src/creator-source-publish.ts +52 -0
- package/src/deferred-assets.ts +125 -0
- package/src/distribution.ts +28 -0
- package/src/errors.ts +61 -0
- package/src/install-command.ts +43 -0
- package/src/output.ts +62 -0
- package/src/poe-tile-config-files.ts +100 -0
- package/src/poe-tile-config-players.ts +168 -0
- package/src/poe-tile-config-remix.ts +166 -0
- package/src/poe-tile-config.ts +831 -0
- package/src/power-report-client.ts +55 -0
- package/src/prototype-startup.ts +21 -0
- package/src/publish-change-summary.ts +55 -0
- package/src/publish-overrides-validation.ts +49 -0
- package/src/publish-pack.ts +167 -0
- package/src/publish-phases.ts +57 -0
- package/src/publish-retry.ts +51 -0
- package/src/publish-tile-from-config.ts +434 -0
- package/src/recorder-stream.ts +169 -0
- package/src/remix-provenance.ts +156 -0
- package/src/resolve-client-credential.ts +71 -0
- package/src/resolve-media-uploads.ts +147 -0
- package/src/sdk-dependency.ts +54 -0
- package/src/sdk-skills.ts +85 -0
- package/src/should-skip-client-setup.ts +20 -0
- package/src/simulation-snapshot.ts +123 -0
- package/src/simulation-types.ts +74 -0
- package/src/simulations-client.ts +112 -0
- package/src/source-bundle.ts +466 -0
- package/src/staged-publish-cleanup.ts +44 -0
- package/src/staged-publish-deferred.ts +160 -0
- package/src/staged-publish.ts +401 -0
- package/src/store-file-upload.ts +268 -0
- package/src/store-request.ts +168 -0
- package/src/tar-canonical.ts +41 -0
- package/src/tar-extensions.ts +159 -0
- package/src/tar-extract.ts +193 -0
- package/src/tar-parse.ts +224 -0
- package/src/tar.ts +231 -0
- package/src/template-check-scripts.ts +18 -0
- package/src/tile-gallery-client.ts +82 -0
- package/src/types.ts +258 -0
- package/src/upload-concurrency.ts +54 -0
- package/src/whole-tile.ts +52 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Turn-based mutator recipe
|
|
2
|
+
|
|
3
|
+
Use this recipe for a sequential turn-based tile. Adapt the table and field names to the tile, but keep the SDK import and call placement.
|
|
4
|
+
|
|
5
|
+
## Pass or clear the turn from the mutator
|
|
6
|
+
|
|
7
|
+
Import both helpers from the client entry point. Call them after writing the new authoritative match state, in the same mutator that accepts the move. Do not wrap them in `if (ctx.isServer)`: the client pass clears or marks the caller optimistically, while the server pass performs the authoritative fan-out.
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
import { clearTurn, setTurn } from "joiner-sdk/v1/client.js";
|
|
11
|
+
import type { TileMutator } from "./types";
|
|
12
|
+
|
|
13
|
+
export const makeMove: TileMutator<"makeMove"> = async (ctx, input) => {
|
|
14
|
+
const match = await ctx.table("match").get("current");
|
|
15
|
+
if (!match) throw new Error("The match has not started");
|
|
16
|
+
|
|
17
|
+
// Validate the caller and move, then derive the complete next state from
|
|
18
|
+
// authoritative stored state. These names are tile-specific.
|
|
19
|
+
const { nextMatch, nextPlayerId, pushBody } = applyMove({
|
|
20
|
+
match,
|
|
21
|
+
userId: ctx.userId,
|
|
22
|
+
move: input,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
await ctx.table("match").set({
|
|
26
|
+
itemKey: "current",
|
|
27
|
+
value: nextMatch,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
if (nextMatch.status === "finished") {
|
|
31
|
+
await clearTurn(ctx, { all: true });
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
await setTurn(ctx, {
|
|
36
|
+
userIds: [nextPlayerId],
|
|
37
|
+
// setTurn pushes the caller too. Do not push a player for their own action.
|
|
38
|
+
push: nextPlayerId === ctx.userId ? false : { body: pushBody },
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
`setTurn` uses replace semantics by default, so passing the next player also clears the previous holder. Use the same pattern, with the same `ctx.userId` check, when a start, reset, rematch or seat-claim mutator makes the opening player actionable. Use `clearTurn(ctx, { all: true })` for every terminal path. A context-rich push body is preferred; omit `push` to use the generic default.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Historical account erasure
|
|
2
|
+
|
|
3
|
+
`await isUserErased(ctx, userId)` from `joiner-sdk/v1/backend.js` reads
|
|
4
|
+
positive account-erasure evidence for this store. Use it in server-side data
|
|
5
|
+
migrations to repair app-owned roster rows that predate your `onAnonymizeUser`
|
|
6
|
+
hook. Keep that hook for future erasures.
|
|
7
|
+
|
|
8
|
+
The helper returns `false` on optimistic clients and when this store has no
|
|
9
|
+
erasure record. A missing `$users` row alone is not evidence of erasure: a live
|
|
10
|
+
parent-room member may not be mirrored here yet. Erasures that predate the
|
|
11
|
+
platform's erasure records cannot be inferred from this helper. Do not remove
|
|
12
|
+
those ambiguous rows automatically. Evidence is scoped to this store instance;
|
|
13
|
+
it is not a global account lookup.
|
|
14
|
+
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
# Vite Plugin
|
|
2
|
+
|
|
3
|
+
The `poeTile()` Vite plugin handles the platform build concerns that every bundled iframe app needs. Import it from `joiner-sdk/vite`.
|
|
4
|
+
|
|
5
|
+
```typescript
|
|
6
|
+
import { defineConfig } from "vite";
|
|
7
|
+
import react from "@vitejs/plugin-react";
|
|
8
|
+
import { poeTile } from "joiner-sdk/vite";
|
|
9
|
+
|
|
10
|
+
export default defineConfig({
|
|
11
|
+
root: "tile",
|
|
12
|
+
build: {
|
|
13
|
+
outDir: "../dist",
|
|
14
|
+
emptyOutDir: true,
|
|
15
|
+
rollupOptions: {
|
|
16
|
+
output: {
|
|
17
|
+
entryFileNames: "tile-frontend.js",
|
|
18
|
+
assetFileNames: "[name][extname]",
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
plugins: [react(), poeTile()],
|
|
23
|
+
});
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The plugin handles:
|
|
27
|
+
|
|
28
|
+
- **Externals** — Prevents bundling platform-provided modules (`joiner-sdk/v1/client.js`) since these are provided at runtime via import map. The build writes the import-map name, poe-tiles-sdk/v1/client.js, for either SDK name.
|
|
29
|
+
- **Code splitting** — Rewrites dynamic `import()` calls to load chunks from the bundle as blob URLs, which work in sandboxed iframes.
|
|
30
|
+
- **Vendor extraction** — Shared dependencies (from `node_modules`) are automatically extracted into a `vendor` chunk so they aren't duplicated across lazy chunks.
|
|
31
|
+
- **Web Workers** — Fails the build on `new Worker(new URL(…, import.meta.url))` and on a `?worker` import missing `&inline`, neither of which can load in a sandboxed iframe. Use `?worker&inline`, which works with no help from the plugin. See [Web Workers](#web-workers) below.
|
|
32
|
+
- **Backend building** — Optionally builds the synced-store backend config as part of the Vite build.
|
|
33
|
+
|
|
34
|
+
The plugin does **not** set `root`, `outDir`, `entryFileNames`, or `assetFileNames` — consumers control their own directory structure and output naming via standard Vite config.
|
|
35
|
+
|
|
36
|
+
## Minimum SDK Version
|
|
37
|
+
|
|
38
|
+
When a tile requires a runtime method or named export with a documented minimum SDK version, set that exact numeric literal in `poeTile({ minSdkVersion })` in `vite.config.ts`. Preserve an existing minimum, raise it when a new required API needs a later version, and never guess a version. Omit the option when the tile has no documented requirement. It accepts a positive safe integer and cannot be combined with `rootTile: true`.
|
|
39
|
+
|
|
40
|
+
Raising the minimum does not mean waiting for players to update. The SDK version is the web runtime the platform serves, not the native app, so players never need to update their app and the creator can publish right away. Do not tell the creator to wait before publishing or that players must update their app; just set the minimum. The one exception: right after a new SDK version is released, publish can refuse with HTTP 409 `kernel_not_deployed` while the platform finishes deploying that runtime. Publish again in a few minutes.
|
|
41
|
+
|
|
42
|
+
Production builds automatically infer SDK 34 when emitted chunks import `createNativeResults`, or SDK 31 for `completeRound`, from `joiner-sdk/v1/client.js`. Namespace and dynamic imports of that module require SDK 34 because they can access either export. The inferred minimum never lowers an explicit minimum. Root tiles are exempt; development mode still uses the explicit option.
|
|
43
|
+
|
|
44
|
+
The plugin checks the injected kernel version before importing the tile's entry module. An incompatible tile shows refresh instructions and requests the manager's update flow on hosts that support it. The check runs again after reload; if an automatic update did not help, the manager offers manual retry. `Poe.has(...)` only guards optional calls after the SDK has loaded; it cannot protect a missing named import because module linking happens first.
|
|
45
|
+
|
|
46
|
+
## Backend Config Building
|
|
47
|
+
|
|
48
|
+
Pass `backendEntryPoint` to build the synced-store backend config automatically after the Vite build:
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
export default defineConfig({
|
|
52
|
+
root: "tile",
|
|
53
|
+
build: { outDir: "../dist" },
|
|
54
|
+
plugins: [
|
|
55
|
+
react(),
|
|
56
|
+
poeTile({ backendEntryPoint: "src/backend.ts" }),
|
|
57
|
+
],
|
|
58
|
+
});
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The path is resolved relative to the Vite root directory. The output (`synced-store-backend-config.js`) is placed in the Vite output directory. This eliminates the need for a separate `buildBackend()` call in your build script.
|
|
62
|
+
|
|
63
|
+
## Code Splitting
|
|
64
|
+
|
|
65
|
+
Dynamic `import()` calls are rewritten so that chunks are loaded from the bundle as blob URLs. This is more reliable than normal browser-cached imports — the browser's HTTP cache may evict entries at any time, so lazy-loaded chunks fetched over the network can fail offline. Assets loaded from the bundle are stored in IndexedDB by the top document, so they remain available even without a network connection.
|
|
66
|
+
|
|
67
|
+
## Web Workers
|
|
68
|
+
|
|
69
|
+
Import your worker with Vite's `?worker&inline` suffix:
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
// worker.ts
|
|
73
|
+
self.onmessage = (event) => {
|
|
74
|
+
self.postMessage(expensiveWork(event.data));
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
// entry.tsx
|
|
78
|
+
import MyWorker from "./worker.ts?worker&inline";
|
|
79
|
+
|
|
80
|
+
const worker = new MyWorker();
|
|
81
|
+
worker.onmessage = (event) => setResult(event.data);
|
|
82
|
+
worker.postMessage(input);
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
`&inline` is required — it is the whole reason this works. It bundles the worker
|
|
86
|
+
into your code and starts it from a blob URL, the only form the sandboxed iframe
|
|
87
|
+
allows. Two near-misses fail instead:
|
|
88
|
+
|
|
89
|
+
- `new Worker(new URL("./worker.ts", import.meta.url))` resolves against
|
|
90
|
+
`import.meta.url`, which is a `blob:` URL in a tile, so the call throws
|
|
91
|
+
`TypeError: Invalid URL`.
|
|
92
|
+
- A plain `?worker` (or `?sharedworker`) import compiles to
|
|
93
|
+
`new Worker("/assets/worker-hash.js")` — a path nothing serves here, since the
|
|
94
|
+
iframe makes no network requests.
|
|
95
|
+
|
|
96
|
+
**`poeTile()` fails the build on both**, with a message pointing at the fix, so
|
|
97
|
+
forgetting `&inline` is caught before you ship rather than breaking at runtime.
|
|
98
|
+
|
|
99
|
+
Constraints that come from the iframe sandbox:
|
|
100
|
+
|
|
101
|
+
- **Keep worker code statically imported.** A dynamic `import()` *inside* a worker
|
|
102
|
+
will not resolve. Regular top-level `import` statements are fine — they get
|
|
103
|
+
bundled into the worker.
|
|
104
|
+
- **Don't set `worker.format: "es"`** in `vite.config.ts`. It makes Vite's inline
|
|
105
|
+
wrapper request a module worker, which a blob URL cannot serve. The default
|
|
106
|
+
(`iife`) is what you want, and `poeTile()` pins it.
|
|
107
|
+
- **`SharedWorker` does not work at all** — shared workers are keyed by origin and
|
|
108
|
+
the iframe's origin is opaque, so the browser denies it (`Access to shared
|
|
109
|
+
workers is denied to origin 'null'`). `&inline` does not help. Use one regular
|
|
110
|
+
worker per frame.
|
|
111
|
+
- **No `localStorage`, `IndexedDB`, or direct network access** in the worker — it
|
|
112
|
+
inherits the tile's sandbox. Keep workers pure-compute (physics, pathfinding,
|
|
113
|
+
parsing, image processing) and do I/O on the main thread via `Poe`.
|
|
114
|
+
- **Big workers ride in your bundle.** The source is inlined into your code. If it
|
|
115
|
+
is large enough to matter for first paint, load it on demand instead:
|
|
116
|
+
`new Worker((await Poe.bundle.loadAsset("/workers/heavy.js")).url)` — classic scripts
|
|
117
|
+
only, and the file must end in `.js`.
|
|
118
|
+
|
|
119
|
+
### Without a bundler
|
|
120
|
+
|
|
121
|
+
No-build apps can't use `?worker&inline`, but the underlying primitive — a
|
|
122
|
+
**classic** worker started from a blob URL minted inside the iframe — is available
|
|
123
|
+
directly. Two recipes.
|
|
124
|
+
|
|
125
|
+
Worker source as a string:
|
|
126
|
+
|
|
127
|
+
```js
|
|
128
|
+
const workerSource = `
|
|
129
|
+
self.onmessage = (event) => {
|
|
130
|
+
self.postMessage(event.data.a + event.data.b);
|
|
131
|
+
};
|
|
132
|
+
`;
|
|
133
|
+
|
|
134
|
+
// The MIME type is required: the browser refuses to run a worker whose blob is
|
|
135
|
+
// text/plain or application/octet-stream.
|
|
136
|
+
const url = URL.createObjectURL(
|
|
137
|
+
new Blob([workerSource], { type: "text/javascript" }),
|
|
138
|
+
);
|
|
139
|
+
|
|
140
|
+
const worker = new Worker(url); // classic — do NOT pass { type: "module" }
|
|
141
|
+
worker.onmessage = (event) => console.log("sum:", event.data);
|
|
142
|
+
worker.postMessage({ a: 1, b: 2 });
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Or keep the worker in its own file and ask the host for it:
|
|
146
|
+
|
|
147
|
+
```js
|
|
148
|
+
// worker.js must ship in your app directory and end in .js — the host derives
|
|
149
|
+
// the blob's MIME type from the extension.
|
|
150
|
+
const { url } = await Poe.bundle.loadAsset("/worker.js");
|
|
151
|
+
const worker = new Worker(url); // classic only
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
The second form costs one round-trip on first use but keeps the worker out of your
|
|
155
|
+
initial HTML. Both require classic worker syntax (`importScripts`, no
|
|
156
|
+
`import`/`export`); a module script cannot be fetched from a blob URL here. A
|
|
157
|
+
`data:` URL is the one exception that does allow `{ type: "module" }`.
|
|
158
|
+
|
|
159
|
+
## No-Build vs Bundled
|
|
160
|
+
|
|
161
|
+
| | No-Build | Bundled |
|
|
162
|
+
|---|---|---|
|
|
163
|
+
| Import | poe-tiles-sdk/v1/client.js (the import-map name) | `joiner-sdk/v1/client.js` |
|
|
164
|
+
| Schema | Inline mutators | `defineSchema()` + `defineClientConfig()` |
|
|
165
|
+
| Config | `{ mutators, schemaVersion }` | Pre-built client config object |
|
|
166
|
+
| Types | None (plain JS) | Full type inference from Zod schema |
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Workspace retention and expiry
|
|
2
|
+
|
|
3
|
+
**This page applies to managed Creator workspaces** — the hosted sandbox some
|
|
4
|
+
products provide for building a tile. If the creator builds locally with
|
|
5
|
+
the CLI on their own machine, their files are their own and nothing here
|
|
6
|
+
applies.
|
|
7
|
+
|
|
8
|
+
A managed workspace holds the tile's source files, unpublished changes,
|
|
9
|
+
the session transcript, and rollback archives. It is durable but not
|
|
10
|
+
permanent; these are the retention rules, stated up front so none of them is a
|
|
11
|
+
surprise.
|
|
12
|
+
|
|
13
|
+
## While you work
|
|
14
|
+
|
|
15
|
+
- The workspace auto-backs up on a 60-second cadence, and recovery restores
|
|
16
|
+
the last **successful** backup. Normally that means about a minute of work
|
|
17
|
+
at risk if the sandbox is interrupted — but a backup that fails (for
|
|
18
|
+
example, a workspace whose archive exceeds the 2 GiB backup cap) leaves
|
|
19
|
+
everything since the last good backup unprotected until backups succeed
|
|
20
|
+
again.
|
|
21
|
+
- Rollback archives are kept on a ladder — the most recent saves at fine
|
|
22
|
+
grain, then 10-minute, hourly, and daily tiers — so recent states can be
|
|
23
|
+
restored precisely and older ones more coarsely.
|
|
24
|
+
|
|
25
|
+
## Running workspaces
|
|
26
|
+
|
|
27
|
+
- An account can have at most **8 managed workspaces running at the same
|
|
28
|
+
time**. A workspace counts as running while its sandbox is awake; a
|
|
29
|
+
workspace that has gone to sleep does not count, and its files are kept.
|
|
30
|
+
- Starting a ninth workspace is refused with a message that says so. Nothing
|
|
31
|
+
in that workspace is changed or lost. It starts once another workspace of
|
|
32
|
+
the same account stops: close one, or wait for an idle one to sleep.
|
|
33
|
+
|
|
34
|
+
## Inactivity expiry
|
|
35
|
+
|
|
36
|
+
- A workspace untouched for **180 days** is deleted: its container, source
|
|
37
|
+
files, rollback archives, and session transcript are all destroyed.
|
|
38
|
+
- A deletion warning is delivered into the workspace's session at **166 days**
|
|
39
|
+
of inactivity. Deletion never proceeds until that warning has actually been
|
|
40
|
+
delivered and at least **13 further days** have passed — a warning that
|
|
41
|
+
could not be delivered leaves the workspace alive.
|
|
42
|
+
- Returning to the workspace at any point before deletion cancels it and
|
|
43
|
+
resets the inactivity clock.
|
|
44
|
+
|
|
45
|
+
## What survives expiry
|
|
46
|
+
|
|
47
|
+
- The **published tile keeps running** for its players, and the source
|
|
48
|
+
uploaded with its most recent publish or preview upload is retained. Editing
|
|
49
|
+
or remixing the tile after expiry seeds a fresh workspace from that
|
|
50
|
+
retained source.
|
|
51
|
+
- Only what the uploaded source bundle actually contained is retained: the
|
|
52
|
+
bundle honors ignore rules (`.gitignore` and any configured exclusions), so
|
|
53
|
+
files sitting in an ignored or excluded path are not preserved even after a
|
|
54
|
+
successful upload.
|
|
55
|
+
- Everything unpublished is lost: work-in-progress changes since the last
|
|
56
|
+
upload, the session transcript, and the rollback history.
|
|
57
|
+
|
|
58
|
+
## The practical rule
|
|
59
|
+
|
|
60
|
+
**Publish to preserve — and verify what was uploaded.** Before a long absence,
|
|
61
|
+
anything worth keeping should be uploaded; a preview upload is enough, since
|
|
62
|
+
previews stay unlisted and the uploaded source is what outlives the workspace.
|
|
63
|
+
Before assuring a creator that their work will survive expiry, confirm that a
|
|
64
|
+
source-carrying upload succeeded and that the files they care about are inside
|
|
65
|
+
it (not excluded by ignore rules). How an upload happens is your HOST's rule:
|
|
66
|
+
a host that records versions automatically needs no extra upload from you —
|
|
67
|
+
starting one yourself can record a duplicate version — while a host that
|
|
68
|
+
leaves publishing to you should be offered an upload before a long absence
|
|
69
|
+
(see [publishing.md](publishing.md) only when your host states no
|
|
70
|
+
publishing rules). When a creator asks how long their work is kept, or a
|
|
71
|
+
deletion warning appears in a session, state these rules plainly.
|
|
72
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// owner: aaronroe
|
|
2
|
+
import type { components } from "./api.generated";
|
|
3
|
+
export interface ConversionIdentity {
|
|
4
|
+
instanceId: string;
|
|
5
|
+
conversionId: string;
|
|
6
|
+
}
|
|
7
|
+
export function createAdminConversionsClient(transport: {
|
|
8
|
+
get<T>(path: string): Promise<T>;
|
|
9
|
+
post<T>(path: string, body: unknown): Promise<T>;
|
|
10
|
+
}) {
|
|
11
|
+
return {
|
|
12
|
+
inspect(
|
|
13
|
+
input: ConversionIdentity,
|
|
14
|
+
): Promise<components["schemas"]["AdminCreatorV2AbandonmentSummary"]> {
|
|
15
|
+
return transport.get(
|
|
16
|
+
`/api/v1/admin/creator-v2/conversion?${new URLSearchParams({ ...input })}`,
|
|
17
|
+
);
|
|
18
|
+
},
|
|
19
|
+
abandon(
|
|
20
|
+
input: ConversionIdentity & { allowLocalOnlyQuarantine: true },
|
|
21
|
+
): Promise<components["schemas"]["AdminCreatorV2AbandonmentSummary"]> {
|
|
22
|
+
return transport.post(
|
|
23
|
+
"/api/v1/admin/creator-v2/abandon-conversion",
|
|
24
|
+
input,
|
|
25
|
+
);
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// owner: aaronroe
|
|
2
|
+
import type { components } from "./api.generated";
|
|
3
|
+
|
|
4
|
+
export type TileReviewScope =
|
|
5
|
+
| "full"
|
|
6
|
+
| "moderation"
|
|
7
|
+
| "quality"
|
|
8
|
+
| "classification";
|
|
9
|
+
|
|
10
|
+
export function createAdminReviewsClient(transport: {
|
|
11
|
+
get<T>(path: string): Promise<T>;
|
|
12
|
+
post<T>(
|
|
13
|
+
path: string,
|
|
14
|
+
body: { expectedGeneration: number; scope?: TileReviewScope },
|
|
15
|
+
): Promise<T>;
|
|
16
|
+
}) {
|
|
17
|
+
const path = (reportId: string) =>
|
|
18
|
+
`/api/v1/admin/tile-reviews/${encodeURIComponent(reportId)}`;
|
|
19
|
+
return {
|
|
20
|
+
inspect(
|
|
21
|
+
reportId: string,
|
|
22
|
+
): Promise<components["schemas"]["AdminTileReviewSuccess"]> {
|
|
23
|
+
return transport.get(path(reportId));
|
|
24
|
+
},
|
|
25
|
+
rerun(input: {
|
|
26
|
+
reportId: string;
|
|
27
|
+
expectedGeneration: number;
|
|
28
|
+
scope?: TileReviewScope;
|
|
29
|
+
}): Promise<components["schemas"]["AdminTileReviewSuccess"]> {
|
|
30
|
+
return transport.post(`${path(input.reportId)}/rerun`, {
|
|
31
|
+
expectedGeneration: input.expectedGeneration,
|
|
32
|
+
...(input.scope === undefined ? {} : { scope: input.scope }),
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}
|