@zaisma/cli 0.51.0 → 0.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/check.mjs +1 -1
- package/chrome.mjs +2 -1
- package/package.json +3 -3
- package/performance.mjs +1 -1
- package/skill/SKILL.md +3 -3
- package/skill/references/developer-api.md +8 -7
- package/skill/references/game-server.md +3 -3
- package/skill/references/naming.md +1 -1
- package/skill/references/sdk.md +2 -1
- package/zaisma.mjs +2 -2
package/README.md
CHANGED
|
@@ -19,4 +19,4 @@ A background shader lives in a folder of its own: `image.glsl` (Shadertoy's `mai
|
|
|
19
19
|
|
|
20
20
|
For scripts, CI and AI tools: every command takes `--json` and prints the API's answer as-is, or its `{ "error": { code, message, field, fix, retry_after_sec } }`. Commands refuse flags and choices they don't take instead of ignoring them, and the exit code says how it went: `0` done (for upload: passed), `1` failed, `2` a wrong command line (nothing was sent), `3` held for a person to look at, `4` rejected, `5` still scanning, `6` the check found something to fix. `zaisma help --json` lists every command, flag and code.
|
|
21
21
|
|
|
22
|
-
Found a bug in Zaisma, or missing something? Search the developer forum first with `zaisma forum --search "too_big"`. `zaisma forum post --kind bug --title "…" --category mcp --text "…"` starts a public topic, and `zaisma forum message …` sends Zaisma a private one (logs, an unreleased game). `zaisma forum` lists your topics and messages, `zaisma forum <topic_id>` shows one with its replies, and `zaisma forum reply <topic_id> --text "…"` replies (`--reopen` if a fixed one is back). Posts say an AI wrote them unless you add `--by-me`. Everything here uses the [developer API](https://github.com/zaisma/zaisma/blob/main/docs/DEVELOPER-API.md#the-upload-command).
|
|
22
|
+
Found a bug in Zaisma, or missing something? Search the developer forum first with `zaisma forum --search "too_big"`. `zaisma forum post --kind bug --title "…" --category mcp --text "…"` starts a public topic, and `zaisma forum message …` sends Zaisma a private one (logs, an unreleased game). `zaisma forum` lists your topics and messages, `zaisma forum <topic_id>` shows one with its replies, and `zaisma forum reply <topic_id> --text "…"` replies (`--reopen` if a fixed one is back). Posts say an AI wrote them unless you add `--by-me`. Everything here uses the [developer API](https://github.com/zaisma/zaisma-sdk/blob/main/docs/DEVELOPER-API.md#the-upload-command).
|
package/check.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// refuse in a game, and what won't work inside its game frame, each with how to fix it, and the notes on
|
|
3
3
|
// files that could be much smaller (performance.mjs). Plain JavaScript with no imports but its neighbour, so
|
|
4
4
|
// the upload command runs it in Node and the site imports it as it is.
|
|
5
|
-
// Docs: https://github.com/zaisma/zaisma/blob/main/docs/DEVELOPER-API.md#checking-a-game
|
|
5
|
+
// Docs: https://github.com/zaisma/zaisma-sdk/blob/main/docs/DEVELOPER-API.md#checking-a-game
|
|
6
6
|
import { findAssetNotes } from "./performance.mjs";
|
|
7
7
|
|
|
8
8
|
/** Every file type a game may contain: the extensions in CONTENT_TYPES (packages/core/src/mime.ts), in its order. */
|
package/chrome.mjs
CHANGED
|
@@ -54,8 +54,9 @@ function playwrightChromes() {
|
|
|
54
54
|
* test/node/chrome-no-gpu.test.ts holds this, and that nothing else starts a Chrome.
|
|
55
55
|
*/
|
|
56
56
|
export function chromeFlags({ isDrawingOnCpu = false } = {}) {
|
|
57
|
+
// Always muted: a scripted Chrome never plays sound on the Mac it runs on (~/studio/rules/previews.md).
|
|
57
58
|
const drawing = isDrawingOnCpu ? ["--disable-gpu"] : ["--use-angle=swiftshader", "--enable-unsafe-swiftshader"];
|
|
58
|
-
return ["--headless=new", "--remote-debugging-port=0", "--no-first-run", "--no-default-browser-check", ...drawing, "--autoplay-policy=no-user-gesture-required", "--hide-scrollbars", "--disable-renderer-backgrounding", "--disable-background-timer-throttling", "--disable-backgrounding-occluded-windows"];
|
|
59
|
+
return ["--headless=new", "--remote-debugging-port=0", "--no-first-run", "--no-default-browser-check", ...drawing, "--autoplay-policy=no-user-gesture-required", "--mute-audio", "--hide-scrollbars", "--disable-renderer-backgrounding", "--disable-background-timer-throttling", "--disable-backgrounding-occluded-windows"];
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
/**
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zaisma/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.54.0",
|
|
4
4
|
"description": "Upload and publish browser games on Zaisma from the command line.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://zaisma.com",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/zaisma/zaisma.git",
|
|
9
|
+
"url": "git+https://github.com/zaisma/zaisma-sdk.git",
|
|
10
10
|
"directory": "packages/cli"
|
|
11
11
|
},
|
|
12
|
-
"bugs": "https://
|
|
12
|
+
"bugs": "https://zaisma.com/forum",
|
|
13
13
|
"keywords": [
|
|
14
14
|
"zaisma",
|
|
15
15
|
"games",
|
package/performance.mjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// without mesh compression, and engine development builds, each with about what it saves and the fix. They never
|
|
4
4
|
// hold a version. `zaisma check`, check_game and the Chrome run after upload share them. Plain JavaScript with no
|
|
5
5
|
// imports, like check.mjs, so the upload command runs it in Node and the site imports it as it is.
|
|
6
|
-
// Docs: https://github.com/zaisma/zaisma/blob/main/docs/DEVELOPER-API.md#how-it-started-in-chrome
|
|
6
|
+
// Docs: https://github.com/zaisma/zaisma-sdk/blob/main/docs/DEVELOPER-API.md#how-it-started-in-chrome
|
|
7
7
|
|
|
8
8
|
const MEGABYTE_BYTES = 1024 * 1024;
|
|
9
9
|
|
package/skill/SKILL.md
CHANGED
|
@@ -5,7 +5,7 @@ description: Make, upload, publish, update or fix a browser game on Zaisma (zais
|
|
|
5
5
|
|
|
6
6
|
# Zaisma
|
|
7
7
|
|
|
8
|
-
Zaisma hosts browser games: any web game, from any engine, plays from one link (`zaisma.com/g/<slug>`) in any browser, as a guest, with no install. It takes no cut of sales and charges no fee to list; each game gets free hosting every month, and only a game that grows past it pays for hosting, a few cents a player.
|
|
8
|
+
Zaisma hosts browser games: any web game, from any engine, plays from one link (`zaisma.com/g/<slug>`) in any browser, as a guest, with no install. It takes no cut of sales and charges no fee to list; each game gets free hosting every month, and only a game that grows past it pays for hosting, a few cents a player. Zaisma's developer tools are open source, so a game is never locked in: every building block it runs (rooms, player passes, saves) also works on the developer's own server.
|
|
9
9
|
|
|
10
10
|
This skill is the workflow. The references beside it hold the details; open one only when the game needs it (the table at the end says when).
|
|
11
11
|
|
|
@@ -20,7 +20,7 @@ The MCP also serves this skill and its references as resources (`zaisma://skill`
|
|
|
20
20
|
## The workflow
|
|
21
21
|
|
|
22
22
|
1. **Make the game.** `create_game` with a title (and a slug, or one is made from the title). It starts as a draft only its developer can see.
|
|
23
|
-
2. **Try it first, on this computer.** `npx @zaisma/cli play-locally` in the game's folder runs the game and its game server with no key or internet; the bench's Add a player opens a second player. Run it with `--no-open --json` in the background to test it yourself through the bench's API at `http://localhost:4800/bench/api` (`references/game-server.md`).
|
|
23
|
+
2. **Try it first, on this computer.** `npx @zaisma/cli play-locally` in the game's folder runs the game and its game server with no key or internet; the bench's Add a player opens a second player. Run it with `--no-open --json` in the background to test it yourself through the bench's API at `http://localhost:4800/bench/api` (`references/game-server.md`). This is where multiplayer is tested while building: it runs the same game server, SDK and game page as Zaisma, and costs no review. A preview link doesn't join rooms, so never publish just to test rooms.
|
|
24
24
|
3. **Check, then upload a version.**
|
|
25
25
|
- Under 5 MB (a single-file HTML game and the like): `check_game`, then `upload_files` with the file contents.
|
|
26
26
|
- Bigger: `npx @zaisma/cli upload <folder> --game <slug>`. It runs the same check first (`npx @zaisma/cli check <folder>` runs it alone, with no key), downloads files the game loads from other sites, unpacks pre-compressed builds and sends only changed files.
|
|
@@ -29,7 +29,7 @@ The MCP also serves this skill and its references as resources (`zaisma://skill`
|
|
|
29
29
|
5. **Show the developer the preview link.** A passed version gets a private preview link that opens only for its developer. Always show it before publishing.
|
|
30
30
|
6. **The AI review.** A version others can reach gets an AI review against the content rules before it goes live. `is_ai_review_needed_to_publish` and `usual_ai_review_duration_min` on the version say so first: tell the developer how long it usually takes, never as a promise. `start_ai_review` starts it ahead of publishing. A developer who has earned it (`get_access`, `standing.publish_before_ai_review_enabled`) can go live at once with the review pending. A game only its developer can reach never gets one.
|
|
31
31
|
7. **Publish.** `publish_version` makes a passed version live, now or at `scheduled_publish_at`, and rolls back to an older one the same way. A publish is a quiet patch unless `is_big_update` is true (with `patch_notes`): only that shows players the Updated tag. `match_update_mode: "now"` switches running matches within seconds instead of at their next match.
|
|
32
|
-
8. **Choose who plays.** `update_game` with `visibility`: `listed` (everyone, in Zaisma's lists from the first day), `unlisted` (anyone with the link), `private` or `draft`. To let testers play first, keep it private and make tester links with `add_tester_link`.
|
|
32
|
+
8. **Choose who plays.** `update_game` with `visibility`: `listed` (everyone, in Zaisma's lists from the first day), `unlisted` (anyone with the link), `private` or `draft`. To let testers play first, keep it private and make tester links with `add_tester_link`. Before a multiplayer game goes public, test it once on Zaisma's rooms through a tester link on the live version (`version_choice: "live"`): that's where the game server's CPU limits, real networks and the chat filter show.
|
|
33
33
|
|
|
34
34
|
**Ask the developer first** before making a game players can play private or a draft again (they lose access), and before ending a live room; those calls need `"confirm": true`. Anything that spends money (top-ups, budgets, Stripe) or deletes a game others played waits for the developer's passkey on zaisma.com: show them `confirm_url` from the `confirmation_needed` answer.
|
|
35
35
|
|
|
@@ -25,7 +25,7 @@ Every tool has an output schema, and answers are compact JSON. Arguments are clo
|
|
|
25
25
|
Zaisma teaches any AI its own workflow, the same way everywhere, from one source in the repository (`skills/zaisma/`, the open SKILL.md format):
|
|
26
26
|
|
|
27
27
|
- **The skill.** `npx @zaisma/cli skill` installs the Zaisma skill into every AI tool it finds on the computer: Claude Code (`~/.claude/skills/zaisma`), Codex (`~/.codex/skills/zaisma`), Cursor (`~/.cursor/skills/zaisma`), Gemini CLI (`~/.gemini/skills/zaisma`), and the shared `~/.agents/skills/zaisma` that several tools read. It writes only where a tool's own folder is already there (and always the shared one), lists each folder and asks once first; `--yes` skips the question, `--project` installs into the current project's folders instead, and `--folder <folder>` into one folder only. With `--json` it needs `--yes` (`install_not_confirmed` otherwise) and answers `{ installed_copies: [{ tool, folder }], skipped_tools }`. It never writes over a `zaisma` skill it didn't install (`skill_not_ours`). Every later run of any `zaisma` command updates the copies it installed to its own version, saying so in one line (with `--json`, a `skill_updates` list of `{ tool, folder, from_version, to_version }` in the answer).
|
|
28
|
-
- **The Claude Code plugin,** the MCP and the skill together, from
|
|
28
|
+
- **The Claude Code plugin,** the MCP and the skill together, from the developer tools' repository: `/plugin marketplace add zaisma/zaisma-sdk`, then `/plugin install zaisma@zaisma`.
|
|
29
29
|
- **The MCP's resources and prompts.** With nothing installed, any AI connected to the MCP reads the same skill: resources `zaisma://skill` (read first), `zaisma://sdk`, `zaisma://naming`, `zaisma://errors`, `zaisma://game-server` and `zaisma://developer-api` (this page), and the guides `zaisma://multiplayer`, `zaisma://loading`, `zaisma://phones` and `zaisma://saves`, each opened only when the game needs it (`resources/list`, `resources/read`, all `text/markdown`). Three prompts start from the moments an AI starts from (`prompts/list`, `prompts/get`): `make_game` (`idea`), `publish_game` (`slug`) and `fix_problem` (`slug`, and `error_code` or `version_id`, one of them).
|
|
30
30
|
- **llms.txt.** `https://zaisma.com/llms.txt` answers "tell me about Zaisma" in the llms.txt format; `https://zaisma.com/llms-full.txt` is the skill, this page and the SDK reference in one file.
|
|
31
31
|
- **Error pages.** Every error code has its own page, `https://zaisma.com/developers/errors/<code>` (all of them at `/developers/errors`), with what it means and the general fix, and every error answer links it as `help_url`.
|
|
@@ -591,7 +591,7 @@ Allowed, even where other platforms ban it (`ALLOWED_CONTENT`): the AI review pa
|
|
|
591
591
|
|
|
592
592
|
One kind of content plays only in games for 16 and up: lifelike gore, meaning photo-real or lifelike injury shown up close (dismemberment, torture, exposed organs). Cartoon, pixel and stylized blood are fine for everyone. The AI review holds a version with lifelike gore on a game for everyone 13 and up (`ai_lifelike_gore`): set `minimum_player_age_years` to `16` and it passes by itself, or make the gore stylized and upload again. Publishing or giving a tester link such a version while the game is for everyone 13 and up, or lowering the age to `13` while players can reach one, answers `content_needs_minimum_age`. Covers and gallery pictures never show lifelike gore, whatever the age. Players never see the age.
|
|
593
593
|
|
|
594
|
-
For
|
|
594
|
+
For where each line is, see the yes/no test under each rule at [zaisma.com/legal/content-rules](https://zaisma.com/legal/content-rules).
|
|
595
595
|
|
|
596
596
|
## Signing in
|
|
597
597
|
|
|
@@ -678,7 +678,7 @@ Every call is checked before any of it runs, in this order: the key's access, wh
|
|
|
678
678
|
|
|
679
679
|
A game looks like: `slug`, `page_url`, `title`, `description`, `visibility`, `visibility_after_ai_review`, `review_status`, `review_reason`, `erases_at`, `is_erase_now_allowed`, `country_blocks`, `devices`, `controls`, `genres`, `screen_orientation`, `play_modes`, `cloud_saves_enabled`, `account_offer_enabled`, `deleted_account_erase_enabled`, `friend_joins_enabled`, `performance_measuring_enabled`, `multiplayer_mode`, `room_browsing`, `account_requirement`, `minimum_player_age_years`, `game_server_allowed_hosts`, `own_server_urls`, `links`, `details_waiting_for_review`, `title_listing_reason`, `glass_tint_color`, `monthly_budget_cents` (`null`: no paid hosting), `purchase_label` (what the game page says it sells, see In-game purchases), `refund_policy` and `refund_policy_text` (`null` until it states one), `full_game_item_name` (`null`: free to play), `demo_game_slug` (`null`: no demo), `first_published_at` (when it first went live; it never moves), `big_update_at` (the last marked big update; `null`: none yet), `recently_updated_at` (where Browse's Recently updated places it) and `updated_at`.
|
|
680
680
|
|
|
681
|
-
- **visibility:** `draft`, `listed` (home page, search and search engines), `unlisted` (anyone with the link, never in lists or search engines) or `private`. Draft and private games open only through preview links and tester links (below). A game is listed only with at least one gallery picture, sent or approved: `listed` without one answers `gallery_picture_needed`, and so does removing the last gallery picture of a listed game.
|
|
681
|
+
- **visibility:** `draft`, `listed` (home page, search and search engines), `unlisted` (anyone with the link, never in lists or search engines) or `private`. Draft and private games open only through preview links and tester links (below), and on their own page for their developer, signed in. There a multiplayer game plays online while the page plays the live version; a newer version not yet published plays alone, and joining a room says so. A game is listed only with at least one gallery picture, sent or approved: `listed` without one answers `gallery_picture_needed`, and so does removing the last gallery picture of a listed game.
|
|
682
682
|
- **review_status** is ours and separate: `pending` (no version has passed review yet), `live`, `held` or `removed`, and `review_reason` says why it's held or removed (see Holds and takedowns). Changing visibility never undoes a takedown.
|
|
683
683
|
- **country_blocks** lists the countries whose players can't open the game, each `{ country_code, country_name, review_reason, blocked_at }`, `[]` for none (see Holds and takedowns).
|
|
684
684
|
- **play_modes:** how it's played, shown on the game page with icons: a list with one entry per way to play, like `[{"mode": "single"}, {"mode": "online", "minimum_player_count": 2, "maximum_player_count": 4, "play_style": "co-op"}]`. `mode` is `single`, `local` (together on one device or screen) or `online` (each on their own device). `single` takes no counts; the others need `minimum_player_count` (2 or more) and `play_style` (`co-op`, `versus` or `both`), and `maximum_player_count: null` means no limit ("2+ players"). Answers give every key, `null` where it doesn't apply. `null` clears it.
|
|
@@ -703,7 +703,7 @@ A game looks like: `slug`, `page_url`, `title`, `description`, `visibility`, `vi
|
|
|
703
703
|
| Call | What it does |
|
|
704
704
|
| --- | --- |
|
|
705
705
|
| `GET /games/:slug/reports?cursor=` | Player reports from the last 90 days (`period_duration_days`), counted by reason in `reasons` (`reason`, `label`, `open_count`, `closed_count`), and `bug_reports`: reports that report triage sorted as bugs, each with `player_text`, a one-line `summary`, the `version_id` they played and `reported_at`, and `player_reports`: reports about one of your game's players that Zaisma passed to you, newest first, up to 50, each with its `reason` (`harassment`, `cheating`, `other`, or one of the four Zaisma looks at itself when a person passed it on: `real_life_threat`, `personal_details`, `following_after_block`, `sexual`), `player_text`, `chat_messages` (the last chat lines, up to 20, between the reported player and the reporter, from the reporter's screen: `from_player_id`, the reported player's or `null` for anyone else's, `text` and `sent_at`; `[]` when none), `reported_player_id`, `reported_player_name`, `room_code`, `version_id` and `reported_at`. How players treat each other is your game's call, with mute and block always there; Zaisma itself acts only on threats that reach into real life, sharing someone's personal details, following someone after they blocked them, and anything sexual toward a teen. Pass the `next_cursor` from your last call as `cursor` to get only the bug and player reports that arrived after it. Child-safety reports are never counted or shown, and no report says who sent it. |
|
|
706
|
-
| `GET /games/:slug/stats?period_duration_days=30` | How the game is played, up to 90 days (`play_stats`, see Play stats below), how many accounts have it in their favorites now (`favorite_count`, never who), how it runs on players' devices (`performance`, the same section), and multiplayer use per day in `multiplayer_days`: `date`, `room_count`, `room_play_duration_min`, `message_count` (messages and bytes players sent), the day's room traffic per player a second (`inbound_messages_per_player_sec`, `inbound_size_bytes_per_player_sec`, `outbound_messages_per_player_sec`, `outbound_size_bytes_per_player_sec`, divided by its player time, each message out counted once per player it reached) and `game_server_cpu_duration_sec`, the time the game's own game server ran in its rooms (each call's time less its waits on the database, other servers and its own timers). `hosting_use_this_month`: the game's month on its one hosting meter (see Hosting and credit): `free_used_pct`, `shares`, `is_paused`, `paused_reason`, `paused_at`, `resets_on_date`, `monthly_budget_cents`, `spent_from_credit_cents`, and the raw counts behind it, facts for tuning that are never priced on their own: `room_play_duration_hours` on Zaisma rooms, `relayed_size_bytes` (the data Zaisma's relay sent the game's players for their connections to each other, read from Cloudflare about once an hour), `game_server_cpu_duration_sec` (its rooms, and requests, schedule runs and webhooks past their first 10 ms), `request_count` (requests, webhook events and schedule runs), `written_row_count`, `read_row_count`, `database_size_bytes` and `adult_chat_check_count`. Rooms on your own server aren't counted. `room_traffic`: this month's traffic per player a second (the same four numbers), `message_types`, its 10 biggest message types by bytes (`message_type`: a message's `data.type`, or `(none)`, `(bytes)`, `(zaisma)` for Zaisma's own, `(state)` for state sync's updates (`stateSyncEnabled`) and `(other)` past a room's first 20; `direction` `inbound` or `outbound`; `message_count`, `size_bytes`, `largest_size_bytes`, `average_size_bytes`), and `traffic_hints`, each a `code` and a `message` with the game's numbers: `json_messages_large` (a JSON type averages 512 bytes or more at 5 or more a player-second: send it as bytes), `outbound_heavy` (each player gets 32 KB a second or more: send only what changed and what they can see, with `stateSyncEnabled` and `stateView`), `message_near_limit` (a message of 12 KB or more, near the 16 KB limit) and `latest_only_available` (a type goes to each player 10 or more times a second, and 10% or more of it went to players whose connection was backed up: send it with `delivery: "latest_only"`). Rooms on your own server aren't counted. `schedules`: the live version's schedules (see "Schedules" in the README), read within a minute of it going live, each with `schedule_name`, `cron` (UTC), `version_id`, `next_run_at` and `last_run_at` (`null` until it first runs); `[]` when it has none or players can't play the game. For games whose own game server runs on Zaisma (rooms on `own`, or any requests or schedules), each day's `game_server` has `call_count` (calls from its rooms), `request_count` (requests to `onRequest`, see "Requests to your game server" in the README), `scheduled_run_count` (runs of `onSchedule`), `crash_count` (a handler threw; that call, request or run is lost), `stopped_count` (ran on too long, like an endless loop; the match froze about 2 seconds, or the request or run failed) and `ended_match_count` (stopped twice), and `game_server_errors` lists the 20 most recent distinct errors: `kind`, `message` with the file and line it came from (a game server that didn't start says why, like an option it doesn't take, with the ones it does, or a cron that doesn't read; a run's error starts with its schedule's name), `occurrence_count`, `version_id`, `first_at` and `last_at`. Other games get `game_server: null` and `game_server_errors: []`. |
|
|
706
|
+
| `GET /games/:slug/stats?period_duration_days=30` | How the game is played, up to 90 days (`play_stats`, see Play stats below), how many accounts have it in their favorites now (`favorite_count`, never who), how it runs on players' devices (`performance`, the same section), and multiplayer use per day in `multiplayer_days`: `date`, `room_count`, `room_play_duration_min`, `message_count` (messages and bytes players sent), the day's room traffic per player a second (`inbound_messages_per_player_sec`, `inbound_size_bytes_per_player_sec`, `outbound_messages_per_player_sec`, `outbound_size_bytes_per_player_sec`, divided by its player time, each message out counted once per player it reached) and `game_server_cpu_duration_sec`, the time the game's own game server ran in its rooms (each call's time less its waits on the database, other servers and its own timers). `hosting_use_this_month`: the game's month on its one hosting meter (see Hosting and credit): `free_used_pct`, `shares`, `is_paused`, `paused_reason`, `paused_at`, `resets_on_date`, `monthly_budget_cents`, `spent_from_credit_cents`, and the raw counts behind it, facts for tuning that are never priced on their own: `room_play_duration_hours` on Zaisma rooms, `relayed_size_bytes` (the data Zaisma's relay sent the game's players for their connections to each other, read from Cloudflare about once an hour), `game_server_cpu_duration_sec` (its rooms, and requests, schedule runs and webhooks past their first 10 ms), `request_count` (requests, webhook events and schedule runs), `written_row_count`, `read_row_count`, `database_size_bytes` and `adult_chat_check_count`. Rooms on your own server aren't counted. `room_traffic`: this month's traffic per player a second (the same four numbers), `message_types`, its 10 biggest message types by bytes (`message_type`: a message's `data.type`, or `(none)`, `(bytes)`, `(zaisma)` for Zaisma's own, `(state)` for state sync's updates (`stateSyncEnabled`) and `(other)` past a room's first 20; `direction` `inbound` or `outbound`; `message_count`, `size_bytes`, `largest_size_bytes`, `average_size_bytes`), and `traffic_hints`, each a `code` and a `message` with the game's numbers: `json_messages_large` (a JSON type averages 512 bytes or more at 5 or more a player-second: send it as bytes), `outbound_heavy` (each player gets 32 KB a second or more: send only what changed and what they can see, with `stateSyncEnabled` and `stateView`), `message_near_limit` (a message of 12 KB or more, near the 16 KB limit) and `latest_only_available` (a type goes to each player 10 or more times a second, and 10% or more of it went to players whose connection was backed up: send it with `delivery: "latest_only"`). Rooms on your own server aren't counted. `schedules`: the live version's schedules (see "Schedules" in the README), read within a minute of it going live, each with `schedule_name`, `cron` (UTC), `version_id`, `next_run_at` and `last_run_at` (`null` until it first runs); `[]` when it has none or players can't play the game. For games whose own game server runs on Zaisma (rooms on `own`, or any requests or schedules), each day's `game_server` has `call_count` (calls from its rooms), `request_count` (requests to `onRequest`, see "Requests to your game server" in the README), `scheduled_run_count` (runs of `onSchedule`), `crash_count` (a handler threw; that call, request or run is lost), `stopped_count` (ran on too long, like an endless loop; the match froze about 2 seconds, or the request or run failed) and `ended_match_count` (stopped twice, or 20 of its calls in a minute went past their 50 ms of CPU), and `game_server_errors` lists the 20 most recent distinct errors: `kind`, `message` with the file and line it came from (a game server that didn't start says why, like an option it doesn't take, with the ones it does, or a cron that doesn't read; a run's error starts with its schedule's name), `occurrence_count`, `version_id`, `first_at` and `last_at`. Other games get `game_server: null` and `game_server_errors: []`. |
|
|
707
707
|
| `GET /games/:slug/history` | What happened to the game in `events`, newest first, up to 100: `description`, `version_id`, `subject_name` (what it was done to, like a secret's name), `done_by` (`you`, `api_key`, `ai` or `zaisma`), `api_key_name`, where it came from (`device`, `network_name`, `city_name`, `region_name`, `country_code`, `connection_address`: kept 90 days, and `null` with Keep where my account is used from off, except that uploads keep their address 90 days either way), `is_new_place` (a key's first change from a network and country it hadn't been used from), `occurrence_count` (SQL writes, imports, exports and save reads and changes from one key within the hour fold into one event), `happened_at`, `last_happened_at` and, for a hold, rejection or takedown, its `review_reason` (otherwise `null`). Besides uploads, scans and publishes it holds database writes, imports, exports and restores (a restore's `subject_name` is the time it went back to; an undo's, the restore it undid), a re-upload of the game by another developer that Zaisma stopped (its `subject_name` is their username; you also get an email), save reads and changes, secrets and tester links; a key that isn't limited to some games also sees your webhooks and sign-in apps. |
|
|
708
708
|
| `GET /games/:slug/qr-code?room_code=` | The game's link as a QR code: `link_url` (the game page, or with `room_code` a room in it) and `qr_code_svg`, an SVG document, black on white with its margin, to save as a `.svg` file or turn into a PNG at any size for posters, booths and trailers. The dashboard has it under Details with SVG and PNG downloads, and players get the same code from Share on the game page. `room_code` that isn't a room's code answers `bad_room_code`. |
|
|
709
709
|
|
|
@@ -804,7 +804,7 @@ Everything a game runs on Zaisma's servers is on one meter per game, shown as a
|
|
|
804
804
|
- `monthly_budget_cents` and `spent_from_credit_cents`: the game's budget and what credit paid for it this month.
|
|
805
805
|
- **Where the hours went:** `play_hours`, this month's totals, never who: `total_duration_hours`, of it `new_player_duration_hours` and `returning_player_duration_hours`, and of it again `rented_network_duration_hours` and `other_network_duration_hours`, with `rented_share_used_pct`.
|
|
806
806
|
- **Real players go last:** traffic from rented-server networks has its own share of 10% of the game's free hosting and of its budget, counting only its own use, and everyone else plays from the rest, with no extra free time and no gap in the meter. On that share: anyone on a rented-server network without history, and anyone at all whose browser shows no input and no graphics chip. An account a week old, or that played before or bought something, and a browser that played this game before, play from the rest on any network. Past it those players get `rented_share_used` from rooms, requests and the relay, and in a match they get an hour; everyone else plays on. A game on its own server isn't on the meter, and never hears any of it.
|
|
807
|
-
- The counts behind it: `room_awake_duration_hours`, `room_connection_count`, `inbound_message_count`, `relayed_size_bytes`, `game_server_cpu_duration_sec` (of it `startup_cpu_duration_sec`), `game_server_session_count`, `loaded_version_count`, `outside_call_count`, `log_file_count`, `request_count`, `awake_duration_hours`, `database_call_count`, `written_row_count`, `read_row_count`, `bookkeeping_written_row_count` and `database_size_bytes`; and `room_play_duration_hours`, player time in rooms, a fact for tuning that isn't priced.
|
|
807
|
+
- The counts behind it: `room_awake_duration_hours`, `room_connection_count`, `inbound_message_count`, `relayed_size_bytes`, `game_server_cpu_duration_sec` (of it `startup_cpu_duration_sec`), `game_server_session_count`, `game_server_invocation_count` (calls into it as Cloudflare counts them: each tick, message, join, request, schedule run, webhook event and start; the stats' `call_count` is only its rooms' calls, for its health), `loaded_version_count`, `outside_call_count`, `log_file_count`, `request_count`, `awake_duration_hours`, `database_call_count`, `written_row_count`, `read_row_count`, `bookkeeping_written_row_count` and `database_size_bytes`; and `room_play_duration_hours`, player time in rooms, a fact for tuning that isn't priced.
|
|
808
808
|
|
|
809
809
|
**A second free allowance, once.** The first time a game with real players fills its free hosting, it gets a second allowance free that month, so it doesn't stop before you can react: `second_free_allowance_started` tells you. A game with no real players doesn't get it yet, and doesn't lose it. A game with a budget isn't charged for it. From the next month it has one allowance again.
|
|
810
810
|
|
|
@@ -813,6 +813,7 @@ Everything a game runs on Zaisma's servers is on one meter per game, shown as a
|
|
|
813
813
|
**Past the free hosting.** A game without a budget pauses at 100%. A game with one (`monthly_budget_cents` on `PATCH /games/:slug`, in cents: 5000 is $50) draws from your credit past it, never more than its budget in a month, at these prices:
|
|
814
814
|
|
|
815
815
|
- **Rooms:** $23.04 per 1,000 hours a room is awake (a ticking room all the while it ticks; a turn-based room for 10 seconds after each event, a move or its check on its players every 30 seconds, and asleep in between), $0.03 per million messages players send, $1.80 per million times a player connects, $0.60 per million times a room wakes on its own or is called by another of the game's rooms, and the rows Zaisma writes for it (its listing, saves and seats) at the database's price.
|
|
816
|
+
- **Game server calls:** $1.20 per million calls into it: each tick, message, join, request, schedule run, webhook event and start. Ticks are most of them: a room at 10 ticks a second is about $0.043 an hour, at 60 about $0.26, so tick only as fast as the game needs (`ticksPerSec`).
|
|
816
817
|
- **Game server:** $0.08 per 1,000 CPU-seconds wherever it runs (rooms, requests, schedule runs and webhooks), starting up included, counting only the time your code runs: its waits on the database, other servers (including reading their answers) and its own timers don't count, calls made at the same moment count only their own time, and each call it makes to another server counts 1 ms; $1.20 per million times it's started (a room starting it, a restart after a failure, its requests' object waking); $0.008 for each version loaded on a day (UTC); $18 per million files of its logs. A running room's ticks and messages to it cost only their CPU.
|
|
817
818
|
- **Relayed data:** $0.20 per GB.
|
|
818
819
|
- **Database:** $0.60 per million calls, $4 per million rows written, $0.004 per million read, $0.80 per GB-month stored, and $23.04 per 1,000 hours awake.
|
|
@@ -1757,7 +1758,7 @@ Files are stored once, by their SHA-256, and shared by every version that has th
|
|
|
1757
1758
|
- Same rules as zips: `index.html` at the top, no hidden files, no pre-compressed `.gz` or `.br` files, only the file types games use. Up to 20,000 files per version and 500 MB per file, at any size per game: see Storage for what an account can keep. Up to 100 versions per game a day.
|
|
1758
1759
|
- Each version is scanned. Image matching also checks the pictures stored inside engine packs (Godot `.pck`, `.glb`, `.data`, `.dat`, `.bin`, `.wasm`); one it can't read, like a GPU texture, isn't held for it. An update sends only new pictures and videos through image matching (one checked in the last 30 days isn't sent again), so it's checked in seconds however big the game is.
|
|
1759
1760
|
- A version most of whose files another developer sent first (leaving out engines, libraries and asset packs many developers share) is held with `matches_another_developers_game` until a person looks, usually within a day; your own games never count. If it's your game on another account, or you have permission, say so with `message_zaisma`. When a person finds it's a re-upload, the original developer hears, with your username.
|
|
1760
|
-
- One that passes waits as a draft with a private preview link for you and your AI, `https://zaisma.com/p/<secret>`, that works even while the game is a draft or private. Every call answers a fresh one, each working for a day (`preview_url_expires_at`); to show a version to anyone else, make a tester link. It opens the version inside the real game page, details first, then Play with the Zaisma overlay, as players will meet it; `https://zaisma.com/p/<secret>/game` opens the bare game alone, for quick test loops. Either way it plays at the game's fixed preview address, `https://<slug>--preview.zaismausercontent.com/`, so a game address never holds a key, and preview saves stay in that address's own browser storage, from one build to the next.
|
|
1761
|
+
- One that passes waits as a draft with a private preview link for you and your AI, `https://zaisma.com/p/<secret>`, that works even while the game is a draft or private. Every call answers a fresh one, each working for a day (`preview_url_expires_at`); to show a version to anyone else, make a tester link. It opens the version inside the real game page, details first, then Play with the Zaisma overlay, as players will meet it; `https://zaisma.com/p/<secret>/game` opens the bare game alone, for quick test loops. Either way it plays at the game's fixed preview address, `https://<slug>--preview.zaismausercontent.com/`, so a game address never holds a key, and preview saves stay in that address's own browser storage, from one build to the next. A preview link doesn't join rooms: build and test multiplayer with `npx @zaisma/cli play-locally` (the same game server, SDK and game page, on your computer, with no review), and before release test it once on Zaisma's rooms through a tester link on a published version of the game while it's private (`add_tester_link` with `version_choice` `live`). That checks what only Zaisma's rooms have: the game server's CPU limits, real networks and regions, the chat filter, and rooms restarting under players.
|
|
1761
1762
|
- A version can use only files you sent yourself: a file another developer sent counts as missing for you until you send it once too (storage still keeps one copy), so a file's hash neither gets someone else's file nor says whether Zaisma has it.
|
|
1762
1763
|
- Publishing makes it the version players get. We keep the live version plus the last 5 that passed, for rolling back.
|
|
1763
1764
|
- Drafts nobody publishes are deleted after 30 days, and files no version uses after a day. Held and rejected versions are kept.
|
|
@@ -1847,7 +1848,7 @@ The files a version needed before its first frame in its run in Chrome are prelo
|
|
|
1847
1848
|
|
|
1848
1849
|
## The upload command
|
|
1849
1850
|
|
|
1850
|
-
`zaisma` ([`@zaisma/cli`](https://www.npmjs.com/package/@zaisma/cli), source `packages/cli/zaisma.mjs`) runs these calls from a terminal or CI: `npx @zaisma/cli <command>`, with `ZAISMA_KEY` set to an API key. `zaisma help` lists every command; `zaisma help --json` gives the same as JSON: each command's arguments and flags (with `has_value`, `is_required` and `choices`), a shader's folder (`shader_folder`), the exit codes and the error codes below. Each release is published from
|
|
1851
|
+
`zaisma` ([`@zaisma/cli`](https://www.npmjs.com/package/@zaisma/cli), source `packages/cli/zaisma.mjs`) runs these calls from a terminal or CI: `npx @zaisma/cli <command>`, with `ZAISMA_KEY` set to an API key. `zaisma help` lists every command; `zaisma help --json` gives the same as JSON: each command's arguments and flags (with `has_value`, `is_required` and `choices`), a shader's folder (`shader_folder`), the exit codes and the error codes below. Each release is published from the main branch of [zaisma/zaisma-sdk](https://github.com/zaisma/zaisma-sdk) by `.github/workflows/publish-cli.yml` with npm provenance, so npm shows the commit that built it.
|
|
1851
1852
|
|
|
1852
1853
|
| Command | What it does | Call |
|
|
1853
1854
|
| --- | --- | --- |
|
|
@@ -44,8 +44,8 @@ Games join it with `Zaisma.joinRoom({ serverUrl, transport: "webtransport" })`,
|
|
|
44
44
|
|
|
45
45
|
A mistake in your game server's code becomes a coded error in the game's logs, never a silent success, and the Node runner behaves the same as Zaisma's rooms. Versions follow semver: within 1.x the package only gains things.
|
|
46
46
|
|
|
47
|
-
- The game server, handler by handler: the "
|
|
48
|
-
- Every name and option follows [`docs/NAMING.md`](https://github.com/zaisma/zaisma/blob/main/docs/NAMING.md).
|
|
47
|
+
- The game server, handler by handler: the "Multiplayer" section of the [README](https://github.com/zaisma/zaisma-sdk#multiplayer) and [`docs/DEVELOPER-API.md`](https://github.com/zaisma/zaisma-sdk/blob/main/docs/DEVELOPER-API.md).
|
|
48
|
+
- Every name and option follows [`docs/NAMING.md`](https://github.com/zaisma/zaisma-sdk/blob/main/docs/NAMING.md).
|
|
49
49
|
|
|
50
50
|
MIT licensed.
|
|
51
51
|
|
|
@@ -139,7 +139,7 @@ zaisma-server/
|
|
|
139
139
|
|
|
140
140
|
- **Plain JavaScript ES modules:** `zaisma-server/index.js` default-exports the game server above, and can import the folder's other files by relative path: `.js` code, `.json` data (`import levels from "./levels.json"`) and `.wasm` WebAssembly, like a physics engine (`import mod from "./physics.wasm"` gives a `WebAssembly.Module`; `new WebAssembly.Instance(mod, imports)` starts it). Packages from npm (`import "lodash"`) and TypeScript need a build step: bundle into one `zaisma-server.js` at the top of the upload instead (`npx esbuild server.ts --format=esm --bundle --outfile=zaisma-server.js`), or into `zaisma-server/index.js` when it has data files. Up to 500 files and 64 MB in all, data files included, of which the code (`.js`, `.json` and `.wasm`) is up to 32 MB (`GAME_SERVER_LIMITS`).
|
|
141
141
|
- **Data files:** every other file in `zaisma-server/` (`.bin`, `.gz`, `.txt`, anything but `.js`, `.json` and `.wasm`) ships beside the code as a data file, like prebuilt navigation meshes, level geometry or a dictionary. `room.readDataFile("maps/docks.bin")` (or `server.readDataFile` in `onRequest`, `onSchedule` and `onWebhook`) answers it as an `ArrayBuffer`, by its path from `zaisma-server/`: no base64, no download, and nothing on the meter, since it comes with the code. It's the same `ArrayBuffer` every time, shared by every room of the version running in the same place, so read it and never change it; keep what you build from it in a variable outside the handlers (`const meshes = new Map()`) and every room there shares it too. A path with no data file throws a `GameServerError` `bad_room_call`. On your own server, data files are read from the game server's folder (`--data-folder`, or `startServer({ dataFolder })`; `zaisma-server` by default).
|
|
142
|
-
- **Time to start:** each call into the game server, a tick with the messages since the last one, a join, a request, has 50 ms of CPU (`GAME_SERVER_LIMITS.maximumCallCpuDurationMs`). A start has 5 seconds (`maximumStartCpuDurationMs`): loading the game server, `setup`, `onRestored`, and a real-time room's first tick after any of them, or after the room puts its state back in a fresh copy of the game server (one that started again and lost its memory, or one opened again after a stop), whether or not the game has `onRestored`, so build what the match needs once (a map's navigation, its collision) in that first tick, not spread over many. The game server's top-level code, outside its handlers, has Cloudflare's 1 second as it loads (`maximumLoadCpuDurationMs`), so heavy work goes in that first tick. One copy of the game server, shared by the version's rooms in one place, has 128 MB of memory (`maximumMemorySizeBytes`), its data files included: they load from storage into that memory when the copy starts, so with 64 MB of files about 60 MB is left for the matches. Every second of CPU is on the game's hosting meter, starts included.
|
|
142
|
+
- **Time to start:** each call into the game server, a tick with the messages since the last one, a join, a request, has 50 ms of CPU (`GAME_SERVER_LIMITS.maximumCallCpuDurationMs`), as Cloudflare measures it. Cloudflare itself stops a call only at about 2 seconds, which freezes the match that long, so the room keeps the 50 ms: when 20 of a room's calls within a minute go past it, the game server stops and the match ends, as for one that keeps failing, and its logs say so. A start has 5 seconds (`maximumStartCpuDurationMs`): loading the game server, `setup`, `onRestored`, and a real-time room's first tick after any of them, or after the room puts its state back in a fresh copy of the game server (one that started again and lost its memory, or one opened again after a stop), whether or not the game has `onRestored`, so build what the match needs once (a map's navigation, its collision) in that first tick, not spread over many. The game server's top-level code, outside its handlers, has Cloudflare's 1 second as it loads (`maximumLoadCpuDurationMs`), so heavy work goes in that first tick. One copy of the game server, shared by the version's rooms in one place, has 128 MB of memory (`maximumMemorySizeBytes`), its data files included: they load from storage into that memory when the copy starts, so with 64 MB of files about 60 MB is left for the matches. Every second of CPU is on the game's hosting meter, starts included.
|
|
143
143
|
- **Sealed off:** nothing of Zaisma's but its own game's database and secrets, and other servers only on the hosts you list (below), so it talks to its players through `room` and its answers to their requests. State is plain JSON.
|
|
144
144
|
- **Private:** players never get its files; the game domain refuses `zaisma-server/` and `zaisma-server.js`.
|
|
145
145
|
- **Real-time rooms batch input:** in a room with `ticksPerSec`, the state stays inside the sandbox, and players' messages and bytes reach `onMessage` and `onBytes` just before the next `onTick`, in the order they came, with what they send going out then (at most a tick later). A handler that throws leaves the rest of the batch to run, and what it changed in the state before throwing stays, as on your own server, where they run as they come. Either way a room's handlers run one at a time: one that awaits (the database, say) finishes before the room's next message, bytes or tick reaches the game server.
|
|
@@ -311,7 +311,7 @@ One name per concept. The API and MCP column is snake_case; the SDK and game ser
|
|
|
311
311
|
| A network Zaisma counts as rented servers, and the part of a game's meter its traffic gets | a rented network; the rented share: error `rented_share_used` |
|
|
312
312
|
| A browser's signed first play of a game, kept only in the browser | `play_mark` |
|
|
313
313
|
| A door's input refused by its stated shape | error `wrong_shape` |
|
|
314
|
-
| A game's free hosting this month and what used it: one meter, a percentage, never dollars | `hosting_use_this_month`: `free_used_pct`, `second_free_allowance_month_start_date` (alert `second_free_allowance_started`), `free_rooms_stopped_at` (alert `free_rooms_stopped`), `shares` (each `{ kind, share_pct }`, `kind` one of `rooms`, `game_server`, `relayed_data`, `database`, `requests`), `is_paused`, `paused_reason` (`free_used`, `budget_used`, `credit_used`, `no_real_players`, `free_hosting_ended`, `null`), `paused_at`, `resets_on_date`, `monthly_budget_cents`, `spent_from_credit_cents`, and the counts `room_play_duration_hours`, `room_awake_duration_hours`, `room_connection_count`, `inbound_message_count`, `relayed_size_bytes`, `game_server_cpu_duration_sec`, `startup_cpu_duration_sec`, `game_server_session_count`, `loaded_version_count`, `outside_call_count`, `log_file_count`, `request_count`, `awake_duration_hours`, `database_call_count`, `written_row_count`, `read_row_count`, `bookkeeping_written_row_count`, `database_size_bytes`; refused with `hosting_paused`. Inside: `game_hosting_months` (`used_cents`, `charged_cents`, `written_off_cents`, `paused_at_ms`, `paused_reason`), `room_usage`'s counts (`room_awake_duration_sec`, `room_connection_count`, `object_request_count`, `game_server_session_count`, `game_server_startup_cpu_duration_ms`, `outside_call_count`, `object_awake_duration_sec`, `bookkeeping_written_row_count`, `log_file_count`, `database_call_count`, `database_awake_duration_sec`), `loaded_versions`, `HOSTING_PRICES`, `OUTSIDE_CALL_CPU_DURATION_MS`, `FREE_HOSTING_CENTS_PER_MONTH`, `hostingCostCents`, `hostingUseThisMonth`, `isHostingPaused`, `AwakeTime` | `hosting_paused` (a room's refusal, a request's error, a database error) |
|
|
314
|
+
| A game's free hosting this month and what used it: one meter, a percentage, never dollars | `hosting_use_this_month`: `free_used_pct`, `second_free_allowance_month_start_date` (alert `second_free_allowance_started`), `free_rooms_stopped_at` (alert `free_rooms_stopped`), `shares` (each `{ kind, share_pct }`, `kind` one of `rooms`, `game_server`, `relayed_data`, `database`, `requests`), `is_paused`, `paused_reason` (`free_used`, `budget_used`, `credit_used`, `no_real_players`, `free_hosting_ended`, `null`), `paused_at`, `resets_on_date`, `monthly_budget_cents`, `spent_from_credit_cents`, and the counts `room_play_duration_hours`, `room_awake_duration_hours`, `room_connection_count`, `inbound_message_count`, `relayed_size_bytes`, `game_server_cpu_duration_sec`, `startup_cpu_duration_sec`, `game_server_session_count`, `game_server_invocation_count` (every call into the game server as Cloudflare counts it, starts, requests, schedules and webhooks included, which the meter prices; not the stats' `game_server.call_count`, its rooms' calls for its health), `loaded_version_count`, `outside_call_count`, `log_file_count`, `request_count`, `awake_duration_hours`, `database_call_count`, `written_row_count`, `read_row_count`, `bookkeeping_written_row_count`, `database_size_bytes`; refused with `hosting_paused`. Inside: `game_hosting_months` (`used_cents`, `charged_cents`, `written_off_cents`, `paused_at_ms`, `paused_reason`), `room_usage`'s counts (`room_awake_duration_sec`, `room_connection_count`, `object_request_count`, `game_server_session_count`, `game_server_startup_cpu_duration_ms`, `outside_call_count`, `object_awake_duration_sec`, `bookkeeping_written_row_count`, `log_file_count`, `database_call_count`, `database_awake_duration_sec`), `loaded_versions`, `HOSTING_PRICES`, `OUTSIDE_CALL_CPU_DURATION_MS`, `FREE_HOSTING_CENTS_PER_MONTH`, `hostingCostCents`, `hostingUseThisMonth`, `isHostingPaused`, `AwakeTime` | `hosting_paused` (a room's refusal, a request's error, a database error) |
|
|
315
315
|
| What a game may draw from its developer's credit each month | `monthly_budget_cents` on a game (`null`: no paid hosting); error `bad_monthly_budget_cents`; alerts `hosting_budget_nearly_used`, `hosting_paused` with `budget_used` | |
|
|
316
316
|
| A developer's credit | `credit`: `balance_cents`, `is_credit_low` (and the `credit_low` alert), `waiting_spending_requests` (on `get_credit`), `top_ups` (each `{ id, amount_cents, refundable_cents, refund_ends_at, created_at }`), `games` (each `{ slug, title, monthly_budget_cents, spent_from_credit_this_month_cents, last_month_beyond_free_cents }`), `entries` (each `{ id, entry_kind, amount_cents, game_slug, created_at }`, `entry_kind` one of `top_up`, `hosting_charge`, `refund`, `written_off`); a top-up's `amount_cents`, Stripe's `checkout_url`; `refunded_cents`; key area `credit_access`; `credit_balance_cents` in `get_access`; tools `get_credit`, `top_up_credit`, `refund_top_up`, `get_spending_request` (answers `spending_request`: `{ id, request_kind, game_slug, game_title, requested_change, current_setting, request_status, created_at, expires_at, answered_at }`; `confirmation_needed` adds `spending_request_id`); errors `no_spending_request` (`request_kind` is `game_budget` or `credit_plan_refill_level`; `request_status` is `waiting`, `approved`, `declined` or `expired`, which is never stored, only answered a day after the ask); errors `confirmation_needed` (with `confirm_url`), `account_not_protected`, `bad_top_up_amount`, `no_top_up`, `top_up_not_refundable`, `stripe_unavailable`. Inside: `credit_entries`, `owners.credit_balance_cents`, `owners.credit_low_line_cents`, `pending_refunds` (a deleted account's refund Stripe hasn't taken yet; `pending_refund_…` IDs), `CREDIT_LIMITS`, `creditOf`, `isCreditLow`, `addCreditEntry`, `refundableTopUps` | |
|
|
317
317
|
| The monthly credit plan | Always "credit plan", never "plan" alone (that's `free` or `pro`) or "subscription": `credit_plan` on `credit` (`null` with none): `{ refill_level_cents, plan_status, next_payment_at, next_payment_cents, started_at }`, `plan_status` `running` or `payment_failing`; input `refill_level_cents`; tools `start_credit_plan`, `change_credit_plan`, `stop_credit_plan`; errors `bad_refill_level_cents`, `already_credit_plan`, `no_credit_plan`; spending request kind `credit_plan_refill_level` (its change `{ refill_level_cents }`); emails `credit_plan_payment_failed`, `credit_plan_stopped`. Inside: `owners.credit_plan_subscription_id`, `credit_plan_refill_level_cents`, `credit_plan_status`, `credit_plan_started_at_ms`, `credit_plan_event_at_ms`, `spending_requests.refill_level_cents`, `CREDIT_LIMITS.minimumRefillLevelCents`, `maximumRefillLevelCents`, `minimumRefillCents`, `creditPlanCheckout`, `addRefillToInvoice`, `stopCreditPlan`, `STRIPE_CREDIT_PLAN_PRICE_ID`, Stripe metadata `subscription_kind` (`pro`, `credit_plan`) | |
|
package/skill/references/sdk.md
CHANGED
|
@@ -2148,7 +2148,8 @@ type RequestErrorCode =
|
|
|
2148
2148
|
|
|
2149
2149
|
/**
|
|
2150
2150
|
* The codes the SDK's errors have: a room's ({@link RoomErrorCode}), and:
|
|
2151
|
-
* - unchecked: no player pass, because the game isn't played on its zaisma.com page
|
|
2151
|
+
* - unchecked: no player pass, because the game isn't played on its zaisma.com page, Zaisma couldn't check the browser, or it's a preview
|
|
2152
|
+
* of a version players don't have yet (its message says so: test online play with play-locally or a tester link).
|
|
2152
2153
|
* - unknown_option, unknown_event: a call the SDK doesn't take; the message lists what it does.
|
|
2153
2154
|
* - slow_down: too many calls; try again in a minute.
|
|
2154
2155
|
* - zaisma_rooms_not_used: the game doesn't use Zaisma rooms.
|
package/zaisma.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// The Zaisma upload command. No dependencies; Node 18 or newer (22.13 or newer for .sqlite files).
|
|
3
|
-
// Docs: https://github.com/zaisma/zaisma/blob/main/docs/DEVELOPER-API.md#the-upload-command
|
|
3
|
+
// Docs: https://github.com/zaisma/zaisma-sdk/blob/main/docs/DEVELOPER-API.md#the-upload-command
|
|
4
4
|
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
import { createReadStream, createWriteStream, readFileSync } from "node:fs";
|
|
@@ -2363,7 +2363,7 @@ async function installSkill(flags) {
|
|
|
2363
2363
|
const skippedTools = places.filter((place) => !place.isFound).map((place) => place.tool);
|
|
2364
2364
|
if (isJson) return printAnswer({ installed_copies: chosen.map((place) => ({ tool: place.tool, folder: place.folder })), skipped_tools: skippedTools });
|
|
2365
2365
|
for (const place of chosen) console.log(`Installed the Zaisma skill for ${place.toolName}: ${place.folder}`);
|
|
2366
|
-
console.log("It updates itself whenever a zaisma command runs. In Claude Code you can also add the plugin: /plugin marketplace add zaisma/zaisma, then /plugin install zaisma@zaisma.");
|
|
2366
|
+
console.log("It updates itself whenever a zaisma command runs. In Claude Code you can also add the plugin: /plugin marketplace add zaisma/zaisma-sdk, then /plugin install zaisma@zaisma.");
|
|
2367
2367
|
return EXIT_CODES.done;
|
|
2368
2368
|
}
|
|
2369
2369
|
|