@zaisma/cli 0.54.0 → 0.56.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
|
@@ -948,7 +948,7 @@ send.addEventListener("click", sendLine);
|
|
|
948
948
|
input.addEventListener("keydown", (event) => event.key === "Enter" && sendLine());
|
|
949
949
|
```
|
|
950
950
|
|
|
951
|
-
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) 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.").
|
|
951
|
+
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.").
|
|
952
952
|
|
|
953
953
|
- **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.
|
|
954
954
|
- **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.
|
|
@@ -1102,6 +1102,7 @@ A room answers a refusal with `{ type: "error", code, message }`, then closes th
|
|
|
1102
1102
|
| `bad_idle_timeout` | The SDK's own: an `idleTimeoutSec` that isn't from 30 to 86400. |
|
|
1103
1103
|
| `bad_transport` | The SDK's own: a `transport` that isn't `"websocket"` or `"webtransport"`. |
|
|
1104
1104
|
| `zaisma_rooms_not_used` | The SDK's own: the game doesn't use Zaisma rooms, so there are none to join or list. |
|
|
1105
|
+
| `no_online_play_in_preview` | The SDK's own: the game is a preview of a version players don't have yet, which never plays online, so a test build never reaches live rooms. Test online play with `npx @zaisma/cli play-locally`, or publish the version and play it through a tester link (`add_tester_link`). A draft or private game's own page plays its live version online for its developer. |
|
|
1105
1106
|
|
|
1106
1107
|
### Close codes
|
|
1107
1108
|
|
|
@@ -559,6 +559,7 @@ A room answers a refusal with `{ type: "error", code, message }`, then closes th
|
|
|
559
559
|
| `bad_idle_timeout` | The SDK's own: an `idleTimeoutSec` that isn't from 30 to 86400. |
|
|
560
560
|
| `bad_transport` | The SDK's own: a `transport` that isn't `"websocket"` or `"webtransport"`. |
|
|
561
561
|
| `zaisma_rooms_not_used` | The SDK's own: the game doesn't use Zaisma rooms, so there are none to join or list. |
|
|
562
|
+
| `no_online_play_in_preview` | The SDK's own: the game is a preview of a version players don't have yet, which never plays online, so a test build never reaches live rooms. Test online play with `npx @zaisma/cli play-locally`, or publish the version and play it through a tester link (`add_tester_link`). A draft or private game's own page plays its live version online for its developer. |
|
|
562
563
|
|
|
563
564
|
### Close codes
|
|
564
565
|
|
|
@@ -286,7 +286,7 @@ One name per concept. The API and MCP column is snake_case; the SDK and game ser
|
|
|
286
286
|
| A player's friends playing this game, the room to join each in, and why not | `server_url` (in Zaisma's own code: a room on the game's own servers) | `Zaisma.friends.list()` answers `{ friends }`, each `{ id, name, username, roomCode, serverUrl, joinRefusal }`; `joinRefusal`: `game_not_taking_joins`, `friend_not_taking_joins`, `private_room`, `room_closed`, `room_full`, `spectators_full`, `friend_not_in_room`; `Zaisma.friends.setRoom({ serverUrl, roomCode, friendJoinsEnabled })` (null when the player left), refused with `unlisted_server`; a friend's Join link's `?server=`, read as `Zaisma.rooms.linkedServerUrl` |
|
|
287
287
|
| A block between two players, either way (never who made it, never anyone's list of blocks) | | `room.hasBlockBetween(firstPlayerId, secondPlayerId)`; player pass claims `player_tag_id` (the account's own `player_tag_…` ID, different in every game) and `block_player_tag_ids` (the player tags of the accounts it has a block with), checked with `passesHaveBlockBetween(first, second)`; the room's `{ type: "blocks", playerIds }` to each player; a game's `{ type: "block", playerId }` and `{ type: "unblock", playerId }`; `room.block(playerId)`; quickJoin's hello `avoidBlockedPlayers: true`, turned away with `blocked_player_here` |
|
|
288
288
|
| Whether Zaisma's Join (friends on zaisma.com, `Zaisma.friends`) takes players into a game's rooms, or into one room, and whether a game joins players by itself | `friend_joins_enabled`, error `bad_friend_joins_enabled`; `quick_joined_at_ms` (Zaisma's own code) | `friendJoinsEnabled` in `joinRoom`, `quickJoin`, `room.reserve` and the room's settings; `room.setFriendJoinsEnabled(isEnabled)`; every hello from quickJoin says `isQuickJoin: true` |
|
|
289
|
-
| What Zaisma's chat filter stopped, and why (one set of reasons everywhere), and what it only flags | `reason`: `contact_details`, `personal_details`, `sexual`, `chat_paused`, `too_long`, `not_allowed_to_chat` (own servers' `checkChat` only), and `unchecked`
|
|
289
|
+
| What Zaisma's chat filter stopped, and why (one set of reasons everywhere), and what it only flags | `reason`: `contact_details`, `personal_details`, `sexual`, `chat_paused`, `too_long`, `not_allowed_to_chat` (own servers' `checkChat` only), and `unchecked` when Zaisma can't be reached or its check can't run just now (the message is held: send it again in a moment); a message kept for review is a `chat_review_…` ID, `chat_review_id` in the admin MCP | `Zaisma.checkChat` and the game server's `checkChat` answer `isAllowed`, `reason` (`ChatCheckReason`, the same values; the SDK's are the ones a game's own check can give), `message` (the words the sender sees), `hasSwearing` and `hasSlur` (allowed, flagged for the game), as a `ChatCheck` |
|
|
290
290
|
| What a game needs a Zaisma account for | `account_requirement`: `none`, `multiplayer`, `whole_game`; a guest turned away gets `account_needed` | error `code` `account_needed` |
|
|
291
291
|
| A game asking a guest to sign in while it runs, and the guest saying Not now | | `Zaisma.player.signIn()`; error `code` `sign_in_declined` |
|
|
292
292
|
| A secret kept in the database under a key the database never holds (`packages/core/src/sealed-secrets.ts`), and what finds it | `sealed_signing_secret`, `sealed_token`, never in an answer; `token_sha256`. The key's two slots: `STORED_SECRETS_KEY`, `SECOND_STORED_SECRETS_KEY`, and `IS_SECOND_STORED_SECRETS_KEY_IN_USE`, the same shape for each replaceable key (`scripts/replace-key.mjs`) | |
|
package/skill/references/sdk.md
CHANGED
|
@@ -2148,8 +2148,9 @@ 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
|
|
2152
|
-
*
|
|
2151
|
+
* - unchecked: no player pass, because the game isn't played on its zaisma.com page or Zaisma couldn't check the browser.
|
|
2152
|
+
* - no_online_play_in_preview: no player pass, because the game is a preview of a version players don't have yet, so a test build never
|
|
2153
|
+
* reaches live rooms. Test online play with `npx @zaisma/cli play-locally`, or publish the version and play it through a tester link.
|
|
2153
2154
|
* - unknown_option, unknown_event: a call the SDK doesn't take; the message lists what it does.
|
|
2154
2155
|
* - slow_down: too many calls; try again in a minute.
|
|
2155
2156
|
* - zaisma_rooms_not_used: the game doesn't use Zaisma rooms.
|
|
@@ -2195,6 +2196,7 @@ type ErrorCode =
|
|
|
2195
2196
|
| "chat_too_fast"
|
|
2196
2197
|
| "chat_not_here"
|
|
2197
2198
|
| "unchecked"
|
|
2199
|
+
| "no_online_play_in_preview"
|
|
2198
2200
|
| "unknown_option"
|
|
2199
2201
|
| "unknown_event"
|
|
2200
2202
|
| "slow_down"
|