@zaisma/cli 0.61.0 → 0.62.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/package.json
CHANGED
|
@@ -680,7 +680,7 @@ A game looks like: `slug`, `page_url`, `can_change_slug`, `title`, `description`
|
|
|
680
680
|
|
|
681
681
|
| Call | What it does |
|
|
682
682
|
| --- | --- |
|
|
683
|
-
| `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
|
|
683
|
+
| `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`; age reports, `wrong_age` and `under_13`, stay with Zaisma), `player_text`, `chat_messages` (the reported player's own chat lines the reporter ticked, up to 20, from the reporter's screen: `from_player_id`, `text` and `sent_at`; `[]` when none; the reporter's own lines never leave Zaisma, since their text and times would say who reported), `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. |
|
|
684
684
|
| `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) `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"`) and `input_frequent` (players' games send 15 or more messages a second each: unless the game needs every one, send input when it changes and positions with `delivery: "latest_only"`). Messages inside a combined message (the SDK's `sendCombiningEnabled`) count one by one in `message_types`, and once in `message_count`. 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 CPU: 50 ms, or 50 ms for each tick a call carries), 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: []`. |
|
|
685
685
|
| `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. |
|
|
686
686
|
| `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`. |
|
|
@@ -894,7 +894,7 @@ Players type to each other through Zaisma's chat hosting: one call in the game,
|
|
|
894
894
|
- **Your game server decides first:** `onChat(state, player, room, { text, toPlayerIds })` runs before Zaisma's filter, in both runtimes, the way `canJoin` runs before a join: answer `true` to send it, `false` to stop it (the sender's `room.chat` fails with `chat_stopped`, reason `stopped_by_game`, "Your message wasn't sent."), or `{ toPlayerIds }` to send it to fewer players (a team chat, a player your moderators muted). It can only narrow: players outside what Zaisma allows are dropped. Only decide in it: `room` can be read, not changed. A game server without `onChat` sends every message on to the filter.
|
|
895
895
|
- **The filter:** every message to or from an under-18 account is checked on Zaisma's side. It stops contact details in any disguise (numbers written as words or sent a few digits at a time, handles, links, "add me on…"), moving to another app or meeting up in real life, personal details (where someone lives, their school, their full name, photos) and sexual content. Swearing and slurs are your call: it flags them (`hasSwearing`, `hasSlur`) and lets them through. What the rules can't tell goes to a small AI model, a narrow second look that blocks only what clearly is one of those four kinds; when in doubt, or when it can't look, the message goes. The verdict is one for the whole message, never per receiver, so it never says which player is under 18.
|
|
896
896
|
- **Between adults** the filter only flags, unless your game server sets `adultChatFilterEnabled: true`: then the same checks run, and each message the AI looks at counts on your hosting meter (`adult_chat_checks`, $0.20 per 1,000 checks). Zaisma pays for the checks on under-18s' chat.
|
|
897
|
-
- **Reports carry the lines:** `room.report
|
|
897
|
+
- **Reports carry the lines:** on a Zaisma page, `room.report(playerId, reason, details)` opens Zaisma's report sheet beside the game, filled in, and resolves `{ isReported: true }` once the player sends it, or rejects with `error.code` `"report_not_sent"` when they close it without sending. The sheet asks the SDK for that player's last 20 lines on this screen, and the player ticks the ones to send. Only a report the player sends from Zaisma counts toward the steps a few trusted reports take at once (a mute in that room, a chat pause): a report a game sends by itself, off Zaisma or from its own server, still reaches Zaisma but never counts. `get_reports` and the `player_reported` webhook carry the reported player's own ticked lines as `chat_messages` (`from_player_id`, `text`, `sent_at`): what the reporter's game showed, not a record Zaisma kept. Reasons are `real_life_threat`, `personal_details`, `following_after_block`, `sexual`, `wrong_age` and `under_13` (Zaisma looks), and `harassment`, `cheating` and `other` (passed to you).
|
|
898
898
|
|
|
899
899
|
A chat box to copy, all of it in the game (a `<div id="chat-log">`, an `<input id="chat-input">` and a `<button id="chat-send">`; games run in a frame that doesn't submit forms, so it sends on the button and Enter):
|
|
900
900
|
|
|
@@ -929,7 +929,7 @@ input.addEventListener("keydown", (event) => event.key === "Enter" && sendLine()
|
|
|
929
929
|
Every answer from the filter is `{ isAllowed, reason, message, hasSwearing, hasSlur }`: `reason` is `contact_details`, `personal_details`, `sexual`, `chat_paused` (the sender's chat is paused or removed), `too_long` (over 2000 characters: checked whole, never cut), `unchecked` (Zaisma's check couldn't run just now, so the message is held: the player sends it again in a moment) or `not_allowed_to_chat` (own servers' `checkChat` only: `canChat` says no for a receiver), and `message` is the words to show the sender, which never mention age or the other player ("Contact details can't be sent here.").
|
|
930
930
|
|
|
931
931
|
- **Other text players type:** `Zaisma.checkChat(text)` answers the same for up to 2000 characters (`too_long` past that), with the tidied `text`, for text that isn't chat, like a name for a world. It checks the text alone and keeps nothing.
|
|
932
|
-
- **On your own server without the runner:** `checkChat({ text, senderPass, receiverPasses, isAdultFilterEnabled })` from `@zaisma/game-server`, with the players' passes as your server received them, after `canChat`. The runner does this for `room.chat` itself. It keeps each sender's last 5 messages from the last 2 minutes in memory and sends them along, and it answers `unchecked` when Zaisma can't be reached: don't deliver those. Zaisma applies `canChat`'s rule itself too: if the sender may not chat with any receiver, it answers `not_allowed_to_chat`, one verdict for the message that never says which receiver. It's free, except the checks between adults when `isAdultFilterEnabled` is `true`. A player your server let in from outside Zaisma (a game played off its Zaisma page, `kind` `outside_zaisma`) goes as `null` in place of a pass: a message between them and an under-18 account is `not_allowed_to_chat`, between them and adults it's checked as between adults, and one among such players only is allowed without asking Zaisma. Underneath it's `POST https://rooms.zaisma.com/v1/chat/check` with `{ gameSlug, senderPass, receiverPasses, text, recentTexts, isAdultFilterEnabled }` (up to 50 receivers, 2000 characters, 5 recent texts), up to 120 a minute per game and sender; a pass that isn't valid for the game is `bad_pass` with its `field` (`senderPass` or `receiverPasses`). In Zaisma rooms, `checkChat` throws a `ChatCheckError` with code `own_server_only`: send chat with `room.chat` there.
|
|
932
|
+
- **On your own server without the runner:** `checkChat({ text, senderPass, receiverPasses, isAdultFilterEnabled })` from `@zaisma/game-server`, with the players' passes as your server received them, after `canChat`. The runner does this for `room.chat` itself. It keeps each sender's last 5 messages from the last 2 minutes in memory and sends them along, and it answers `unchecked` when Zaisma can't be reached: don't deliver those. Zaisma applies `canChat`'s rule itself too: if the sender may not chat with any receiver, it answers `not_allowed_to_chat`, one verdict for the message that never says which receiver. It's free, except the checks between adults when `isAdultFilterEnabled` is `true`. A player your server let in from outside Zaisma (a game played off its Zaisma page, `kind` `outside_zaisma`) goes as `null` in place of a pass: a message between them and an under-18 account is `not_allowed_to_chat`, between them and adults it's checked as between adults, and one among such players only is allowed without asking Zaisma. Underneath it's `POST https://rooms.zaisma.com/v1/chat/check` with `{ gameSlug, senderPass, receiverPasses, text, recentTexts, isAdultFilterEnabled, roomCode }` (`roomCode` optional: the room's six-letter code, so a player trusted reports muted in that room stays muted there; a pause everywhere reaches your server through the pass's `who_can_chat`, `nobody`) (up to 50 receivers, 2000 characters, 5 recent texts), up to 120 a minute per game and sender; a pass that isn't valid for the game is `bad_pass` with its `field` (`senderPass` or `receiverPasses`). In Zaisma rooms, `checkChat` throws a `ChatCheckError` with code `own_server_only`: send chat with `room.chat` there.
|
|
933
933
|
|
|
934
934
|
Contact or personal details stopped toward under-18 accounts five times in a day pause the sender's chat for an hour. A paused account's next pass says `who_can_chat: "nobody"`, so `canChat` stops it on your server too. Zaisma keeps no chat, except a sexual message from an adult to a teen that reached the filter from an own server, kept for review.
|
|
935
935
|
|
package/skill/references/sdk.md
CHANGED
|
@@ -1527,8 +1527,11 @@ interface Room {
|
|
|
1527
1527
|
block(playerId: string): Promise<boolean>;
|
|
1528
1528
|
/**
|
|
1529
1529
|
* Report a player to Zaisma, with what happened in the player's own words if they gave any (details).
|
|
1530
|
-
*
|
|
1531
|
-
*
|
|
1530
|
+
* On Zaisma it opens Zaisma's report sheet beside the game, filled in with the player, reason and words,
|
|
1531
|
+
* where the player picks the messages to send and sends it: only reports a player sends there count
|
|
1532
|
+
* toward muting someone. Resolves once they send it; rejects with error.code "report_not_sent" when they
|
|
1533
|
+
* close it without sending. Off Zaisma (a game's own site) the last chat lines (up to 20) they sent this
|
|
1534
|
+
* player, or this player sent them, go with it; nothing else about the reporting player is sent.
|
|
1532
1535
|
*/
|
|
1533
1536
|
report(playerId: string, reason: ReportReason, details?: string): Promise<ReportAnswer>;
|
|
1534
1537
|
/**
|
|
@@ -2171,6 +2174,7 @@ type RequestErrorCode =
|
|
|
2171
2174
|
* - slow_down: too many calls; try again in a minute.
|
|
2172
2175
|
* - zaisma_rooms_not_used: the game doesn't use Zaisma rooms.
|
|
2173
2176
|
* - bad_report: a report whose reason isn't a {@link ReportReason}, or whose player ID isn't one.
|
|
2177
|
+
* - report_not_sent: the player closed Zaisma's report sheet, which {@link Room.report} opened, without sending it.
|
|
2174
2178
|
* - bad_origin: the call didn't come from the game's own page.
|
|
2175
2179
|
* - not_on_zaisma: the game is played off Zaisma, so it has no player passes, sign-in or room lists; joinRoom and server.request need {@link setUpOffZaisma} and a serverUrl.
|
|
2176
2180
|
* - bad_game_slug: {@link setUpOffZaisma}'s gameSlug isn't a game slug: 1 to 40 lowercase letters, digits or hyphens.
|
|
@@ -2205,6 +2209,7 @@ type ErrorCode =
|
|
|
2205
2209
|
```ts
|
|
2206
2210
|
| RoomErrorCode
|
|
2207
2211
|
| RequestErrorCode
|
|
2212
|
+
| "report_not_sent"
|
|
2208
2213
|
| "chat_stopped"
|
|
2209
2214
|
| "chat_not_allowed"
|
|
2210
2215
|
| "chat_empty"
|
|
@@ -2326,7 +2331,7 @@ type ChatCheckReason = "contact_details" | "personal_details" | "slur" | "sexual
|
|
|
2326
2331
|
|
|
2327
2332
|
```ts
|
|
2328
2333
|
/** What happened, in a player report. Zaisma looks at real_life_threat (a threat that reaches past the game: their real details, finding them, a plan), personal_details (sharing someone's), following_after_block and sexual (behavior); harassment, cheating and other go to the game's developer. */
|
|
2329
|
-
type ReportReason = "real_life_threat" | "personal_details" | "following_after_block" | "sexual" | "harassment" | "cheating" | "other";
|
|
2334
|
+
type ReportReason = "real_life_threat" | "personal_details" | "following_after_block" | "sexual" | "harassment" | "cheating" | "wrong_age" | "under_13" | "other";
|
|
2330
2335
|
```
|
|
2331
2336
|
|
|
2332
2337
|
### ReportAnswer
|