@zaisma/cli 0.53.0 → 0.55.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 +1 -1
- package/skill/references/developer-api.md +4 -4
- package/skill/references/game-server.md +2 -2
- package/skill/references/naming.md +1 -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.55.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
|
|
|
@@ -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
|
|
|
@@ -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.
|
|
@@ -1848,7 +1848,7 @@ The files a version needed before its first frame in its run in Chrome are prelo
|
|
|
1848
1848
|
|
|
1849
1849
|
## The upload command
|
|
1850
1850
|
|
|
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
|
|
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.
|
|
1852
1852
|
|
|
1853
1853
|
| Command | What it does | Call |
|
|
1854
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
|
|
|
@@ -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/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
|
|