@puzzmo/cli 1.0.83 → 1.0.84

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@puzzmo/cli",
3
- "version": "1.0.83",
3
+ "version": "1.0.84",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "puzzmo": "./lib/index.js"
@@ -2,74 +2,211 @@
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "$ref": "#/definitions/PuzzmoFile",
4
4
  "definitions": {
5
- "PuzzmoFile": {
5
+ "DeedKeys": {
6
+ "type": "string"
7
+ },
8
+ "LeaderboardExpressionSetup": {
6
9
  "type": "object",
7
10
  "properties": {
8
- "$schema": {
11
+ "displayName": {
9
12
  "type": "string",
10
- "description": "Editor hint pointing at this JSON schema (path or URL). Ignored by the CLI."
13
+ "description": "What do we call this datum"
11
14
  },
12
- "game": {
13
- "type": "object",
14
- "properties": {
15
- "displayName": {
16
- "type": "string",
17
- "description": "Display name shown in the UI, use | to indicate where a line break should go. Synced to the game on every upload; seeds a newly created game."
18
- },
19
- "slug": {
20
- "type": "string",
21
- "description": "URL-friendly identifier for the game"
22
- },
23
- "teamID": {
24
- "type": "string",
25
- "description": "The team ID that owns this game"
26
- },
27
- "oneliner": {
28
- "type": "string",
29
- "description": "Short tagline for the game. Synced to the game on every upload when present; seeds a newly created game."
30
- },
31
- "description": {
32
- "type": "string",
33
- "description": "Longer description of the game. Synced to the game on every upload when present; seeds a newly created game."
34
- },
35
- "highlightColor": {
36
- "type": "string",
37
- "description": "Hex highlight color (e.g. \"#FF8800\"). Synced to the game on every upload when present; seeds a newly created game.",
38
- "pattern": "^#[0-9a-fA-F]{3}([0-9a-fA-F]{3})?$"
39
- },
40
- "iconPath": {
41
- "type": "string",
42
- "description": "Path to the game's icon SVG, relative to this file (e.g. \"./icon.svg\"). Synced to the game on every upload when present. The icon is recolored at runtime, so it must be two-color: #000000 for the foreground, #FFFFFF for the background, with width, height and viewBox attributes, and under 8,000 characters."
43
- },
44
- "helpPath": {
45
- "type": "string",
46
- "description": "Path to the game's how-to-play Markdown, relative to this file (e.g. \"./help.md\"). Synced to the game's in-game help on every upload when present, replacing anything edited in Workshop. Must not be empty or the untouched placeholder template, and under 20,000 characters."
47
- }
48
- },
49
- "required": ["displayName", "slug", "teamID"],
50
- "additionalProperties": false,
51
- "description": "Metadata about the game"
15
+ "secondaryName": {
16
+ "type": "string",
17
+ "description": "An optional secondary name for this config. For example, on a leaderboard this is used in the completion sidebar"
52
18
  },
53
- "integrations": {
54
- "$ref": "#/definitions/Augmentations",
55
- "description": "Game integrations with Puzzmo platform systems (leaderboards, stats, completion UI, etc.)"
19
+ "sortValue": {
20
+ "type": "number",
21
+ "description": "Different augmentations would do different things with this sort value. Leaderboards for example use this when displaying on a page."
56
22
  },
57
- "output": {
58
- "type": "object",
59
- "properties": {
60
- "dir": {
61
- "type": "string",
62
- "description": "Path to the built artifacts. Resolved relative to the puzzmo.json's directory. Can be shared across games (e.g. `../../dist/<slug>`) or per-game (e.g. `./build`)."
63
- }
23
+ "order": {
24
+ "type": "string",
25
+ "enum": ["Higher=better", "Lower=better"],
26
+ "description": "Just saying it how it is, for some augmentations, this isn't necessary"
27
+ },
28
+ "deedID": {
29
+ "$ref": "#/definitions/DeedKeys",
30
+ "description": "Sometimes, instead of an expression, you may need to hook up to a deed"
31
+ },
32
+ "formatString": {
33
+ "type": "string",
34
+ "description": "A custom string formatter, slightly based on printf.\n\n- `%+`: Adds a plus sign _only_ to positive numbers\n- `%@`: Takes the value and replaces the token with the value. If a number it is 'toLocaleString(\"en-US\")'ed\n- `%TD`: Takes the text definition for a deed and replaces the token with the value\n- `\"[time]\"`: Converts a number of seconds to a colon-separated time string (must be exact match)"
35
+ },
36
+ "filterExp": {
37
+ "type": "string",
38
+ "description": "An expression string which can stop something from happening. A concrete example: Whether to post to a leaderboard or not. If the expression returns true or > 0 then the entry is considered allowed for the leaderboard."
39
+ },
40
+ "valueExp": {
41
+ "type": "string",
42
+ "description": "An expression string which can be used to generate the value for whatever your config is based on. The API will provide a set of appropriate variables for you to use in this JS-like expression string. They are based on \"AngularJS Expressions\" which you can read about here: https://docs.angularjs.org/guide/expression"
43
+ },
44
+ "stableID": {
45
+ "type": ["string", "null"],
46
+ "description": "For a lot of augmentations, this acts as an \"id\" and should be unique and treated as a lower, kebab-case string.\n\nFor a leaderboard:\n- A stable ID has to be in the format of `game-[gameslug]:[your value name]` for a game-based leaderboard\n(value here likely can be your deedID). The formatting will get validated on puzzle creation, and in TypeScript."
47
+ },
48
+ "scoreTechnique": {
49
+ "type": ["string", "null"],
50
+ "enum": ["AggregateOfBest", "AggregateOfAll", null],
51
+ "description": "Provides a way to control how we handle different scoring algorithms, right now you have the default (overwrite on best) and \"AggregateOfBest\" which aggregates based on the"
52
+ },
53
+ "rotation": {
54
+ "type": "string",
55
+ "enum": ["Weekly", "Monthly"],
56
+ "description": "How often does this leaderboard rotate? Leaving empty is means daily"
57
+ },
58
+ "icons": {
59
+ "type": "array",
60
+ "items": {
61
+ "type": "string"
64
62
  },
65
- "required": ["dir"],
66
- "additionalProperties": false,
67
- "description": "Where the built game artifacts live for this game. Used by `puzzmo games upload` and `puzzmo games validate` to find the dist folder when running from a repo root. If omitted, the CLI looks for a `dist`, `build`, or `built` folder — first next to puzzmo.json, then walking up to the repo root, optionally with `<slug>` as a sub-folder for shared output dirs."
63
+ "description": "What icons should show above the leaderboard? These want to be game slugs"
64
+ },
65
+ "rules": {
66
+ "type": "string",
67
+ "description": "A \\n separated list of rules to put under a leaderboard"
68
+ },
69
+ "subscoreExp": {
70
+ "type": "string",
71
+ "description": "An expression to grab a subscore"
72
+ },
73
+ "championsLeague": {
74
+ "type": "boolean",
75
+ "const": true,
76
+ "description": "Support having a champion's league, where we extract the top players from the game and move them into a new league. Only available for use on the Game augmentations (and not at puzzles/variants/runtime etc) and on leaderboards with a rotation of null (daily.)"
77
+ },
78
+ "postCompletion": {
79
+ "type": "boolean",
80
+ "const": true,
81
+ "description": "This leaderboard is only submitted to via a post-completion checkpoint, not during the normal completion pipeline. We use this for games which have secret metagames which occur after the game has been completed."
82
+ },
83
+ "hidden": {
84
+ "type": "boolean",
85
+ "const": true,
86
+ "description": "This leaderboard is not shown in the default listings. Records still get posted to it as normal, but it only becomes visible for a play where the game named its stableID in `showLeaderboards` at completion. Lets a game pick which of its extra leaderboards are worth showing for a given play."
68
87
  }
69
88
  },
70
- "required": ["game"],
89
+ "required": ["displayName", "formatString", "stableID"],
90
+ "additionalProperties": false
91
+ },
92
+ "ExpressionSetup": {
93
+ "type": "object",
94
+ "properties": {
95
+ "displayName": {
96
+ "type": "string",
97
+ "description": "What do we call this datum"
98
+ },
99
+ "secondaryName": {
100
+ "type": "string",
101
+ "description": "An optional secondary name for this config. For example, on a leaderboard this is used in the completion sidebar"
102
+ },
103
+ "stableID": {
104
+ "type": ["string", "null"],
105
+ "description": "For a lot of augmentations, this acts as an \"id\" and should be unique and treated as a lower, kebab-case string.\n\nFor a leaderboard:\n- A stable ID has to be in the format of `game-[gameslug]:[your value name]` for a game-based leaderboard\n(value here likely can be your deedID). The formatting will get validated on puzzle creation, and in TypeScript."
106
+ },
107
+ "order": {
108
+ "type": "string",
109
+ "enum": ["Higher=better", "Lower=better"],
110
+ "description": "Just saying it how it is, for some augmentations, this isn't necessary"
111
+ },
112
+ "deedID": {
113
+ "$ref": "#/definitions/DeedKeys",
114
+ "description": "Sometimes, instead of an expression, you may need to hook up to a deed"
115
+ },
116
+ "formatString": {
117
+ "type": "string",
118
+ "description": "A custom string formatter, slightly based on printf.\n\n- `%+`: Adds a plus sign _only_ to positive numbers\n- `%@`: Takes the value and replaces the token with the value. If a number it is 'toLocaleString(\"en-US\")'ed\n- `%TD`: Takes the text definition for a deed and replaces the token with the value\n- `\"[time]\"`: Converts a number of seconds to a colon-separated time string (must be exact match)"
119
+ },
120
+ "filterExp": {
121
+ "type": "string",
122
+ "description": "An expression string which can stop something from happening. A concrete example: Whether to post to a leaderboard or not. If the expression returns true or > 0 then the entry is considered allowed for the leaderboard."
123
+ },
124
+ "valueExp": {
125
+ "type": "string",
126
+ "description": "An expression string which can be used to generate the value for whatever your config is based on. The API will provide a set of appropriate variables for you to use in this JS-like expression string. They are based on \"AngularJS Expressions\" which you can read about here: https://docs.angularjs.org/guide/expression"
127
+ },
128
+ "sortValue": {
129
+ "type": "number",
130
+ "description": "Different augmentations would do different things with this sort value. Leaderboards for example use this when displaying on a page."
131
+ }
132
+ },
133
+ "required": ["displayName", "formatString"],
71
134
  "additionalProperties": false,
72
- "description": "The schema for a puzzmo.json file that lives alongside a game's build artifacts"
135
+ "description": "Data given by either via a puzzle in front-matter, or a game in completion. A general unit of data which can be used to represent a lot of configuration points from the game to the API."
136
+ },
137
+ "ChecklistAugmentationItem": {
138
+ "type": "object",
139
+ "properties": {
140
+ "title": {
141
+ "type": "string",
142
+ "description": "The item's headline in the tutorial UI; when omitted nothing is shown.",
143
+ "examples": ["\"Easy\""]
144
+ },
145
+ "subtitle": {
146
+ "type": "string",
147
+ "description": "Supporting line rendered under the title.",
148
+ "examples": ["\"Open the Poker Hand reference\""]
149
+ },
150
+ "expandMD": {
151
+ "type": "string",
152
+ "description": "The body revealed when the item is expanded, as markdown.",
153
+ "examples": ["\"Tap the button on the lower left side of the screen with the book icon on it\""]
154
+ },
155
+ "targetCount": {
156
+ "type": "number",
157
+ "description": "Target count to mark this item complete (uses `incrementExp` as an expression to determine the count from deeds sent via a checkpoint).",
158
+ "examples": ["2"]
159
+ },
160
+ "incrementExp": {
161
+ "type": "string",
162
+ "description": "Expression evaluated against the deed scope; the result is added to `count`.",
163
+ "examples": ["\"threeOfAKindCount\"", "\"flushCount >= 3\""]
164
+ },
165
+ "filterExp": {
166
+ "type": "string",
167
+ "description": "Optional gate expression — when falsy, the item is skipped for evaluation.",
168
+ "examples": ["\"excessMoves === 0\""]
169
+ },
170
+ "liveUpdate": {
171
+ "type": "boolean",
172
+ "description": "When true, the item updates during checkpoints, not only at completion."
173
+ }
174
+ },
175
+ "additionalProperties": false
176
+ },
177
+ "ChecklistAugmentation": {
178
+ "type": "object",
179
+ "properties": {
180
+ "stableID": {
181
+ "type": "string",
182
+ "description": "Stable identifier used to de-dupe the checklist",
183
+ "examples": ["\"[gameslug]:tutorial\""]
184
+ },
185
+ "type": {
186
+ "type": "string",
187
+ "const": "tutorial",
188
+ "description": "The kind of checklist. Currently only `tutorial` is available"
189
+ },
190
+ "title": {
191
+ "type": "string",
192
+ "description": "Display title shown above the checklist.",
193
+ "examples": ["\"Poker Hands\""]
194
+ },
195
+ "instructionsVisibleFromItemIndex": {
196
+ "type": "number",
197
+ "description": "How many steps the player must finish before the help/instructions become visible; before that point they are gated to the tutorial steps. Omit to make the instructions available from the start.",
198
+ "examples": ["2"]
199
+ },
200
+ "items": {
201
+ "type": "array",
202
+ "items": {
203
+ "$ref": "#/definitions/ChecklistAugmentationItem"
204
+ },
205
+ "description": "The individual steps, in the order the player works through them."
206
+ }
207
+ },
208
+ "required": ["stableID", "type", "items"],
209
+ "additionalProperties": false
73
210
  },
74
211
  "Augmentations": {
75
212
  "type": "object",
@@ -86,14 +223,14 @@
86
223
  "items": {
87
224
  "type": "object",
88
225
  "properties": {
226
+ "stableID": {
227
+ "type": ["string", "null"],
228
+ "description": "For a lot of augmentations, this acts as an \"id\" and should be unique and treated as a lower, kebab-case string.\n\nFor a leaderboard:\n- A stable ID has to be in the format of `game-[gameslug]:[your value name]` for a game-based leaderboard\n(value here likely can be your deedID). The formatting will get validated on puzzle creation, and in TypeScript."
229
+ },
89
230
  "deedID": {
90
231
  "$ref": "#/definitions/DeedKeys",
91
232
  "description": "Sometimes, instead of an expression, you may need to hook up to a deed"
92
233
  },
93
- "stableID": {
94
- "type": ["string", "null"],
95
- "description": "For a lot of augmentations, this acts as an \"id\" and should be unique and treated as a lower, kebab-case string.\n\nFor a leaderboard:\n- A stable ID has to be in the format of `game-[gameslug]:[your value name]` for a game-based leaderboard (value here likely can be your deedID). The formatting will get validated on puzzle creation, and in TypeScript."
96
- },
97
234
  "filterExp": {
98
235
  "type": "string",
99
236
  "description": "An expression string which can stop something from happening. A concrete example: Whether to post to a leaderboard or not. If the expression returns true or > 0 then the entry is considered allowed for the leaderboard."
@@ -105,21 +242,21 @@
105
242
  },
106
243
  "additionalProperties": false
107
244
  },
108
- "description": "Puzzle-specific aggregate stats that track data across all completions of a specific puzzle (e.g. \"how many perfect scores on this puzzle\"). Unlike `userAggregateStats` which are per-user, these accumulate data across all players for a single puzzle instance.\n\nEvaluated at game completion. Expression scope includes:\n\n- All deed values from the gameplay (camelCase keys, e.g. `excessMoves` from `excess-moves` deed)\n- `prior`: The previous value of this stat for the puzzle\n- `wallClockComplete`: Seconds since daily start when completed (if today's daily)\n\nTwo ways to define stats:\n\n1. Via `deedID`: Looks up the deed value and adds it to prior (simple accumulation) 2. Via `valueExp`: Full expression control, e.g. `prior + 1` to count occurrences\n\nUse `filterExp` to conditionally update, e.g. `excessMoves === 0` to only count perfect games. The `stableID` is required and used as the storage key for this stat.\n\nExample: Count perfect completions\n\n```json { \"stableID\": \"perfects\", \"filterExp\": \"excessMoves === 0\", \"valueExp\": \"prior + 1\" } ```"
245
+ "description": "Puzzle-specific aggregate stats that track data across all completions of a specific puzzle (e.g. \"how many perfect scores on this puzzle\"). Unlike `userAggregateStats` which are per-user, these accumulate data across all players for a single puzzle instance.\n\nEvaluated at game completion. Expression scope includes:\n\n- All deed values from the gameplay (camelCase keys, e.g. `excessMoves` from `excess-moves` deed)\n- `prior`: The previous value of this stat for the puzzle\n- `wallClockComplete`: Seconds since daily start when completed (if today's daily)\n\nTwo ways to define stats:\n\n1. Via `deedID`: Looks up the deed value and adds it to prior (simple accumulation) 2. Via `valueExp`: Full expression control, e.g. `prior + 1` to count occurrences\n\nUse `filterExp` to conditionally update, e.g. `excessMoves === 0` to only count perfect games. The `stableID` is required and used as the storage key for this stat.\n\nExample: Count perfect completions\n\n```json\n{ \"stableID\": \"perfects\", \"filterExp\": \"excessMoves === 0\", \"valueExp\": \"prior + 1\" }\n```"
109
246
  },
110
247
  "userAggregateStats": {
111
248
  "type": "array",
112
249
  "items": {
113
250
  "type": "object",
114
251
  "properties": {
252
+ "stableID": {
253
+ "type": ["string", "null"],
254
+ "description": "For a lot of augmentations, this acts as an \"id\" and should be unique and treated as a lower, kebab-case string.\n\nFor a leaderboard:\n- A stable ID has to be in the format of `game-[gameslug]:[your value name]` for a game-based leaderboard\n(value here likely can be your deedID). The formatting will get validated on puzzle creation, and in TypeScript."
255
+ },
115
256
  "deedID": {
116
257
  "$ref": "#/definitions/DeedKeys",
117
258
  "description": "Sometimes, instead of an expression, you may need to hook up to a deed"
118
259
  },
119
- "stableID": {
120
- "type": ["string", "null"],
121
- "description": "For a lot of augmentations, this acts as an \"id\" and should be unique and treated as a lower, kebab-case string.\n\nFor a leaderboard:\n- A stable ID has to be in the format of `game-[gameslug]:[your value name]` for a game-based leaderboard (value here likely can be your deedID). The formatting will get validated on puzzle creation, and in TypeScript."
122
- },
123
260
  "filterExp": {
124
261
  "type": "string",
125
262
  "description": "An expression string which can stop something from happening. A concrete example: Whether to post to a leaderboard or not. If the expression returns true or > 0 then the entry is considered allowed for the leaderboard."
@@ -131,7 +268,7 @@
131
268
  },
132
269
  "additionalProperties": false
133
270
  },
134
- "description": "User-specific aggregate stats stored per-user, tied to the game or remix. These track lifetime stats for individual players (e.g. \"total points earned\", \"best score\"). Stats are keyed by game symbol, or `{symbol}-{remixSlug}` if the remix has the uniqueStats flag.\n\nEvaluated at game completion. Expression scope includes:\n\n- `deeds`: All deed values from the gameplay (camelCase keys, e.g. `deeds.tilesCleared`)\n- `prior`: The previous value of this stat for the user (for running totals/max/min)\n- `uas`: The user's existing aggregate stats object\n- Game symbol keys containing prior deed stats\n\nTwo ways to define stats:\n\n1. Via `deedID`: Looks up the deed value and adds it to prior (simple accumulation) 2. Via `valueExp`: Full expression control, e.g. `prior > deeds.score ? prior : deeds.score` for max\n\nUse `filterExp` to conditionally update (e.g. only count completed games). The `stableID` is required and used as the storage key for this stat.\n\nExample: Track the user's best score\n\n```json { \"stableID\": \"best-score\", \"valueExp\": \"prior > deeds.score ? prior : deeds.score\" } ```"
271
+ "description": "User-specific aggregate stats stored per-user, tied to the game or remix. These track lifetime stats for individual players (e.g. \"total points earned\", \"best score\"). Stats are keyed by game symbol, or `{symbol}-{remixSlug}` if the remix has the uniqueStats flag.\n\nEvaluated at game completion. Expression scope includes:\n\n- `deeds`: All deed values from the gameplay (camelCase keys, e.g. `deeds.tilesCleared`)\n- `prior`: The previous value of this stat for the user (for running totals/max/min)\n- `uas`: The user's existing aggregate stats object\n- Game symbol keys containing prior deed stats\n\nTwo ways to define stats:\n\n1. Via `deedID`: Looks up the deed value and adds it to prior (simple accumulation) 2. Via `valueExp`: Full expression control, e.g. `prior > deeds.score ? prior : deeds.score` for max\n\nUse `filterExp` to conditionally update (e.g. only count completed games). The `stableID` is required and used as the storage key for this stat.\n\nExample: Track the user's best score\n\n```json\n{ \"stableID\": \"best-score\", \"valueExp\": \"prior > deeds.score ? prior : deeds.score\" }\n```"
135
272
  },
136
273
  "userStatDisplays": {
137
274
  "type": "array",
@@ -162,14 +299,17 @@
162
299
  "required": ["userAggregateStatStableID", "formatString", "displayID"],
163
300
  "additionalProperties": false
164
301
  },
165
- "description": "Configuration for how user aggregate stats are displayed on user profiles. Maps stats from `userAggregateStats` to formatted display strings shown in the profile stats section.\n\nThe profile section automatically includes prefix stats (games played, hours played, best streak) before any custom stats defined here.\n\nThe `hideExp` expression receives `{ value }` in scope where `value` is the stat's current value. Common pattern: `\"!value\"` to hide when zero/undefined."
302
+ "description": "Configuration for how user aggregate stats are displayed on user profiles. Maps stats from `userAggregateStats` to formatted display strings shown in the profile stats section.\n\nThe profile section automatically includes prefix stats (games played, hours played, best streak) before any custom stats defined here.\n\nThe `hideExp` expression receives `{ value }` in scope where `value` is the stat's current value. Common pattern: `\"!value\"` to hide when zero/undefined.",
303
+ "examples": [
304
+ "Display the user's best score on their profile, but only if it's above zero:\n\n ```json\n {\n \"userAggregateStatStableID\": \"best-score\",\n \"formatString\": \"Best score: %@\",\n \"displayID\": 1,\n \"hideExp\": \"!value\",\n \"order\": 0\n }\n ```"
305
+ ]
166
306
  },
167
307
  "persistedDeeds": {
168
308
  "type": "array",
169
309
  "items": {
170
310
  "$ref": "#/definitions/ExpressionSetup"
171
311
  },
172
- "description": "Converts temporary (pipeline) deeds into persisted deeds at game completion time. Use this to persist computed values derived from temporary deed data.\n\nFor each config, the `valueExp` is evaluated against the deed scope, and the result is stored as a permanent deed using `stableID` (or `deedID`) as the storage key.\n\nExpression scope includes all deeds from the gameplay (camelCase keys, e.g. `points` from `points` deed). Values are floored to integers before storage.\n\nUse `filterExp` to conditionally persist (e.g. only persist if a threshold is met). Either `stableID` or `deedID` is required as the storage key.\n\nExample: Persist a computed score only when player achieves a threshold\n\n```json { \"stableID\": \"computed-bonus\", \"filterExp\": \"points > 100\", \"valueExp\": \"points * 2\" } ```\n\nCommon use case: Take a temporary deed and persist it for use in completion tables or sidebars."
312
+ "description": "Converts temporary (pipeline) deeds into persisted deeds at game completion time. Use this to persist computed values derived from temporary deed data.\n\nFor each config, the `valueExp` is evaluated against the deed scope, and the result is stored as a permanent deed using `stableID` (or `deedID`) as the storage key.\n\nExpression scope includes all deeds from the gameplay (camelCase keys, e.g. `points` from `points` deed). Values are floored to integers before storage.\n\nUse `filterExp` to conditionally persist (e.g. only persist if a threshold is met). Either `stableID` or `deedID` is required as the storage key.\n\nExample: Persist a computed score only when player achieves a threshold\n\n```json\n{ \"stableID\": \"computed-bonus\", \"filterExp\": \"points > 100\", \"valueExp\": \"points * 2\" }\n```\n\nCommon use case: Take a temporary deed and persist it for use in completion tables or sidebars."
173
313
  },
174
314
  "completionTable": {
175
315
  "type": "array",
@@ -192,14 +332,14 @@
192
332
  "required": ["title", "persistedDeedID", "formatString"],
193
333
  "additionalProperties": false
194
334
  },
195
- "description": "Additional rows to display in the Today page completion table for a completed game. Shows custom stats alongside the default game stats (time, score, hints, etc.).\n\nEach entry looks up a persisted deed by `persistedDeedID` and formats its value using `formatString`. Custom entries appear before the default game stats. The table is rendered as title/value pairs.\n\nNote: Only works with persisted deeds. Use `persistedDeeds` augmentation first if you need to convert temporary deeds into persisted ones for display here.\n\nExample: Show a custom \"Bonus Points\" stat\n\n```json { \"title\": \"Bonus Points\", \"persistedDeedID\": \"bonus-points\", \"formatString\": \"%@ pts\" } ```"
335
+ "description": "Additional rows to display in the Today page completion table for a completed game. Shows custom stats alongside the default game stats (time, score, hints, etc.).\n\nEach entry looks up a persisted deed by `persistedDeedID` and formats its value using `formatString`. Custom entries appear before the default game stats. The table is rendered as title/value pairs.\n\nNote: Only works with persisted deeds. Use `persistedDeeds` augmentation first if you need to convert temporary deeds into persisted ones for display here.\n\nExample: Show a custom \"Bonus Points\" stat\n\n```json\n{ \"title\": \"Bonus Points\", \"persistedDeedID\": \"bonus-points\", \"formatString\": \"%@ pts\" }\n```"
196
336
  },
197
337
  "completionSidebar": {
198
338
  "type": "array",
199
339
  "items": {
200
340
  "$ref": "#/definitions/ExpressionSetup"
201
341
  },
202
- "description": "Additional stats to display in the game completion sidebar/popover on the Today page. Use this to show deed values that don't have an associated leaderboard.\n\nThese items are merged with leaderboard entries, sorted by `sortValue`, and displayed as a list of stats after game completion. Each entry looks up a deed by `deedID` and formats its value using `formatString`.\n\nItems can include:\n\n- `display` or `secondaryName`: Label shown for the stat\n- `deedID`: Which deed to look up for the value\n- `formatString`: How to format the value (e.g. \"%@ pts\")\n- `sortValue`: Order relative to other sidebar items (lower = earlier)\n- `order`: \"Lower=better\" or default (higher=better) for directional indicators\n\nExample: Show a custom \"Combos\" stat\n\n```json { \"completionSidebar\": [ { \"deedID\": \"combo-count\", \"displayName\": \"Combos\", \"formatString\": \"%@\", \"sortValue\": 10 } ] } ```"
342
+ "description": "Additional stats to display in the game completion sidebar/popover on the Today page. Use this to show deed values that don't have an associated leaderboard.\n\nThese items are merged with leaderboard entries, sorted by `sortValue`, and displayed as a list of stats after game completion. Each entry looks up a deed by `deedID` and formats its value using `formatString`.\n\nItems can include:\n\n- `display` or `secondaryName`: Label shown for the stat\n- `deedID`: Which deed to look up for the value\n- `formatString`: How to format the value (e.g. \"%@ pts\")\n- `sortValue`: Order relative to other sidebar items (lower = earlier)\n- `order`: \"Lower=better\" or default (higher=better) for directional indicators\n\nExample: Show a custom \"Combos\" stat\n\n```json\n{ \"completionSidebar\": [ { \"deedID\": \"combo-count\", \"displayName\": \"Combos\", \"formatString\": \"%@\", \"sortValue\": 10 } ] }\n```"
203
343
  },
204
344
  "completionNotables": {
205
345
  "type": "array",
@@ -222,7 +362,7 @@
222
362
  "required": ["valueExp", "notableName"],
223
363
  "additionalProperties": false
224
364
  },
225
- "description": "Awards notables (achievements/badges) to users when conditions are met at game completion. When a notable is awarded, it appears on the user's profile and creates a social news item.\n\nThe `valueExp` is evaluated against the game's deed scope. If it returns truthy, the notable is awarded. Expression scope includes all deed values from the gameplay (camelCase keys).\n\nTwo types of notables:\n\n1. **Code-based notables**: Use `notableName` (e.g. \"jokinAround\") with `notableIndex` (0 or 1). These reference predefined notables in UserAwardsBitmapKeys (index 0) or UserAwardsBitmap1Keys (index 1). **Restricted to games owned by the Puzzmo team.** 2. **System notables**: Use `notableName` as \"{index}-{bitmapValue}\" format (e.g. \"2-4\"). These reference dynamic notables stored in the SystemNotable database table. Available to all games.\n\nExample: Award a notable when player scores over 100 points\n\n```json { \"completionNotables\": [ { \"valueExp\": \"score > 100\", \"notableIndex\": 0, \"notableName\": \"jokinAround\" }, { \"valueExp\": \"perfect === true\", \"notableName\": \"2-4\" } ] } ```"
365
+ "description": "Awards notables (achievements/badges) to users when conditions are met at game completion. When a notable is awarded, it appears on the user's profile and creates a social news item.\n\nThe `valueExp` is evaluated against the game's deed scope. If it returns truthy, the notable is awarded. Expression scope includes all deed values from the gameplay (camelCase keys).\n\nTwo types of notables:\n\n1. **Code-based notables**: Use `notableName` (e.g. \"jokinAround\") with `notableIndex` (0 or 1). These reference predefined notables in UserAwardsBitmapKeys (index 0) or UserAwardsBitmap1Keys (index 1). **Restricted to games owned by the Puzzmo team.** 2. **System notables**: Use `notableName` as \"{index}-{bitmapValue}\" format (e.g. \"2-4\"). These reference dynamic notables stored in the SystemNotable database table. Available to all games.\n\nExample: Award a notable when player scores over 100 points\n\n```json\n{ \"completionNotables\": [ { \"valueExp\": \"score > 100\", \"notableIndex\": 0, \"notableName\": \"jokinAround\" }, { \"valueExp\": \"perfect === true\", \"notableName\": \"2-4\" } ] }\n```"
226
366
  },
227
367
  "checklists": {
228
368
  "type": "array",
@@ -233,217 +373,80 @@
233
373
  },
234
374
  "forceGameSettings": {
235
375
  "type": "object",
236
- "description": "Forces specific game settings for this puzzle, overriding user preferences. Only applies when set via puzzle front-matter (not from game-level augmentations).\n\nWhen a puzzle has forced settings, those settings are locked in the UI and displayed as read-only with a note that the setting is specific to this puzzle. Users cannot change forced settings.\n\nThe settings object keys/values are game-specific. To find valid settings for a game, set the setting yourself in the game and check your user profile in the admin to see the stored format.\n\nExample: Force monochrome grid mode for a crossword puzzle\n\n```json { \"forceGameSettings\": { \"monoGrid\": true } } ```"
376
+ "description": "Forces specific game settings for this puzzle, overriding user preferences. Only applies when set via puzzle front-matter (not from game-level augmentations).\n\nWhen a puzzle has forced settings, those settings are locked in the UI and displayed as read-only with a note that the setting is specific to this puzzle. Users cannot change forced settings.\n\nThe settings object keys/values are game-specific. To find valid settings for a game, set the setting yourself in the game and check your user profile in the admin to see the stored format.\n\nExample: Force monochrome grid mode for a crossword puzzle\n\n```json\n{ \"forceGameSettings\": { \"monoGrid\": true } }\n```"
237
377
  }
238
378
  },
239
379
  "additionalProperties": false,
240
380
  "description": "Site-wide hooks which are sent at puzzle creation, (via front-matter), via the game, and gameplay completion messages.\n\nGames/Variants/FrontMatter: Supports All Fields. Game Completion: Just \"leaderboards\" and \"completionNotables\""
241
381
  },
242
- "LeaderboardExpressionSetup": {
382
+ "PuzzmoFile": {
243
383
  "type": "object",
244
- "additionalProperties": false,
245
384
  "properties": {
246
- "stableID": {
247
- "type": ["string", "null"],
248
- "description": "For a lot of augmentations, this acts as an \"id\" and should be unique and treated as a lower, kebab-case string.\n\nFor a leaderboard:\n- A stable ID has to be in the format of `game-[gameslug]:[your value name]` for a game-based leaderboard (value here likely can be your deedID). The formatting will get validated on puzzle creation, and in TypeScript."
249
- },
250
- "scoreTechnique": {
251
- "type": ["string", "null"],
252
- "enum": ["AggregateOfBest", "AggregateOfAll", null],
253
- "description": "Provides a way to control how we handle different scoring algorithms, right now you have the default (overwrite on best) and \"AggregateOfBest\" which aggregates based on the"
254
- },
255
- "rotation": {
385
+ "$schema": {
256
386
  "type": "string",
257
- "enum": ["Weekly", "Monthly"],
258
- "description": "How often does this leaderboard rotate? Leaving empty is means daily"
387
+ "description": "Editor hint pointing at this JSON schema (path or URL). Ignored by the CLI."
259
388
  },
260
- "icons": {
261
- "type": "array",
262
- "items": {
263
- "type": "string"
389
+ "game": {
390
+ "type": "object",
391
+ "properties": {
392
+ "displayName": {
393
+ "type": "string",
394
+ "description": "Display name shown in the UI, use | to indicate where a line break should go. Synced to the game on every upload; seeds a newly created game."
395
+ },
396
+ "slug": {
397
+ "type": "string",
398
+ "description": "URL-friendly identifier for the game"
399
+ },
400
+ "teamID": {
401
+ "type": "string",
402
+ "description": "The team ID that owns this game"
403
+ },
404
+ "oneliner": {
405
+ "type": "string",
406
+ "description": "Short tagline for the game. Synced to the game on every upload when present; seeds a newly created game."
407
+ },
408
+ "description": {
409
+ "type": "string",
410
+ "description": "Longer description of the game. Synced to the game on every upload when present; seeds a newly created game."
411
+ },
412
+ "highlightColor": {
413
+ "type": "string",
414
+ "description": "Hex highlight color (e.g. \"#FF8800\"). Synced to the game on every upload when present; seeds a newly created game.",
415
+ "pattern": "^#[0-9a-fA-F]{3}([0-9a-fA-F]{3})?$"
416
+ },
417
+ "iconPath": {
418
+ "type": "string",
419
+ "description": "Path to the game's icon SVG, relative to this file (e.g. \"./icon.svg\"). Synced to the game on every upload when present. The icon is recolored at runtime, so it must be two-color: #000000 for the foreground, #FFFFFF for the background, with width, height and viewBox attributes, and under 8,000 characters."
420
+ },
421
+ "helpPath": {
422
+ "type": "string",
423
+ "description": "Path to the game's how-to-play Markdown, relative to this file (e.g. \"./help.md\"). Synced to the game's in-game help on every upload when present, replacing anything edited in Workshop. Must not be empty or the untouched placeholder template, and under 20,000 characters."
424
+ }
264
425
  },
265
- "description": "What icons should show above the leaderboard? These want to be game slugs"
266
- },
267
- "rules": {
268
- "type": "string",
269
- "description": "A \\n separated list of rules to put under a leaderboard"
270
- },
271
- "subscoreExp": {
272
- "type": "string",
273
- "description": "An expression to grab a subscore"
274
- },
275
- "championsLeague": {
276
- "type": "boolean",
277
- "const": true,
278
- "description": "Support having a champion's league, where we extract the top players from the game and move them into a new league. Only available for use on the Game augmentations (and not at puzzles/variants/runtime etc) and on leaderboards with a rotation of null (daily.)"
279
- },
280
- "postCompletion": {
281
- "type": "boolean",
282
- "const": true,
283
- "description": "This leaderboard is only submitted to via a post-completion checkpoint, not during the normal completion pipeline. We use this for games which have secret metagames which occur after the game has been completed."
284
- },
285
- "hidden": {
286
- "type": "boolean",
287
- "const": true,
288
- "description": "This leaderboard is not shown in the default listings. Records still get posted to it as normal, but it only becomes visible for a play where the game named its stableID in `showLeaderboards` at completion. Lets a game pick which of its extra leaderboards are worth showing for a given play."
289
- },
290
- "displayName": {
291
- "type": "string",
292
- "description": "What do we call this datum"
293
- },
294
- "secondaryName": {
295
- "type": "string",
296
- "description": "An optional secondary name for this config. For example, on a leaderboard this is used in the completion sidebar"
297
- },
298
- "order": {
299
- "type": "string",
300
- "enum": ["Higher=better", "Lower=better"],
301
- "description": "Just saying it how it is, for some augmentations, this isn't necessary"
302
- },
303
- "deedID": {
304
- "$ref": "#/definitions/DeedKeys",
305
- "description": "Sometimes, instead of an expression, you may need to hook up to a deed"
306
- },
307
- "formatString": {
308
- "type": "string",
309
- "description": "A custom string formatter, slightly based on printf.\n\n- `%+`: Adds a plus sign _only_ to positive numbers\n- `%@`: Takes the value and replaces the token with the value. If a number it is 'toLocaleString(\"en-US\")'ed\n- `%TD`: Takes the text definition for a deed and replaces the token with the value\n- `\"[time]\"`: Converts a number of seconds to a colon-separated time string (must be exact match)"
310
- },
311
- "filterExp": {
312
- "type": "string",
313
- "description": "An expression string which can stop something from happening. A concrete example: Whether to post to a leaderboard or not. If the expression returns true or > 0 then the entry is considered allowed for the leaderboard."
314
- },
315
- "valueExp": {
316
- "type": "string",
317
- "description": "An expression string which can be used to generate the value for whatever your config is based on. The API will provide a set of appropriate variables for you to use in this JS-like expression string. They are based on \"AngularJS Expressions\" which you can read about here: https://docs.angularjs.org/guide/expression"
318
- },
319
- "sortValue": {
320
- "type": "number",
321
- "description": "Different augmentations would do different things with this sort value. Leaderboards for example use this when displaying on a page."
322
- }
323
- },
324
- "required": ["displayName", "formatString", "stableID"]
325
- },
326
- "DeedKeys": {
327
- "type": "string"
328
- },
329
- "ExpressionSetup": {
330
- "type": "object",
331
- "properties": {
332
- "displayName": {
333
- "type": "string",
334
- "description": "What do we call this datum"
335
- },
336
- "secondaryName": {
337
- "type": "string",
338
- "description": "An optional secondary name for this config. For example, on a leaderboard this is used in the completion sidebar"
339
- },
340
- "stableID": {
341
- "type": ["string", "null"],
342
- "description": "For a lot of augmentations, this acts as an \"id\" and should be unique and treated as a lower, kebab-case string.\n\nFor a leaderboard:\n- A stable ID has to be in the format of `game-[gameslug]:[your value name]` for a game-based leaderboard (value here likely can be your deedID). The formatting will get validated on puzzle creation, and in TypeScript."
343
- },
344
- "order": {
345
- "type": "string",
346
- "enum": ["Higher=better", "Lower=better"],
347
- "description": "Just saying it how it is, for some augmentations, this isn't necessary"
348
- },
349
- "deedID": {
350
- "$ref": "#/definitions/DeedKeys",
351
- "description": "Sometimes, instead of an expression, you may need to hook up to a deed"
352
- },
353
- "formatString": {
354
- "type": "string",
355
- "description": "A custom string formatter, slightly based on printf.\n\n- `%+`: Adds a plus sign _only_ to positive numbers\n- `%@`: Takes the value and replaces the token with the value. If a number it is 'toLocaleString(\"en-US\")'ed\n- `%TD`: Takes the text definition for a deed and replaces the token with the value\n- `\"[time]\"`: Converts a number of seconds to a colon-separated time string (must be exact match)"
356
- },
357
- "filterExp": {
358
- "type": "string",
359
- "description": "An expression string which can stop something from happening. A concrete example: Whether to post to a leaderboard or not. If the expression returns true or > 0 then the entry is considered allowed for the leaderboard."
360
- },
361
- "valueExp": {
362
- "type": "string",
363
- "description": "An expression string which can be used to generate the value for whatever your config is based on. The API will provide a set of appropriate variables for you to use in this JS-like expression string. They are based on \"AngularJS Expressions\" which you can read about here: https://docs.angularjs.org/guide/expression"
364
- },
365
- "sortValue": {
366
- "type": "number",
367
- "description": "Different augmentations would do different things with this sort value. Leaderboards for example use this when displaying on a page."
368
- }
369
- },
370
- "required": ["displayName", "formatString"],
371
- "additionalProperties": false,
372
- "description": "Data given by either via a puzzle in front-matter, or a game in completion. A general unit of data which can be used to represent a lot of configuration points from the game to the API."
373
- },
374
- "ChecklistAugmentation": {
375
- "type": "object",
376
- "properties": {
377
- "stableID": {
378
- "type": "string",
379
- "description": "Stable identifier used to de-dupe the checklist",
380
- "examples": ["[gameslug]:tutorial"]
381
- },
382
- "type": {
383
- "type": "string",
384
- "const": "tutorial",
385
- "description": "The kind of checklist. Currently only `tutorial` is available"
386
- },
387
- "title": {
388
- "type": "string",
389
- "description": "Display title shown above the checklist.",
390
- "examples": ["Poker Hands"]
426
+ "required": ["displayName", "slug", "teamID"],
427
+ "additionalProperties": false,
428
+ "description": "Metadata about the game"
391
429
  },
392
- "instructionsVisibleFromItemIndex": {
393
- "type": "number",
394
- "description": "How many steps the player must finish before the help/instructions become visible; before that point they are gated to the tutorial steps. Omit to make the instructions available from the start.",
395
- "examples": [2]
430
+ "integrations": {
431
+ "$ref": "#/definitions/Augmentations",
432
+ "description": "Game integrations with Puzzmo platform systems (leaderboards, stats, completion UI, etc.)"
396
433
  },
397
- "items": {
398
- "type": "array",
399
- "items": {
400
- "$ref": "#/definitions/ChecklistAugmentationItem"
434
+ "output": {
435
+ "type": "object",
436
+ "properties": {
437
+ "dir": {
438
+ "type": "string",
439
+ "description": "Path to the built artifacts. Resolved relative to the puzzmo.json's directory. Can be shared across games (e.g. `../../dist/<slug>`) or per-game (e.g. `./build`)."
440
+ }
401
441
  },
402
- "description": "The individual steps, in the order the player works through them."
403
- }
404
- },
405
- "required": ["stableID", "type", "items"],
406
- "additionalProperties": false
407
- },
408
- "ChecklistAugmentationItem": {
409
- "type": "object",
410
- "properties": {
411
- "title": {
412
- "type": "string",
413
- "description": "The item's headline in the tutorial UI; when omitted nothing is shown.",
414
- "examples": ["Easy"]
415
- },
416
- "subtitle": {
417
- "type": "string",
418
- "description": "Supporting line rendered under the title.",
419
- "examples": ["Open the Poker Hand reference"]
420
- },
421
- "expandMD": {
422
- "type": "string",
423
- "description": "The body revealed when the item is expanded, as markdown.",
424
- "examples": ["Tap the button on the lower left side of the screen with the book icon on it"]
425
- },
426
- "targetCount": {
427
- "type": "number",
428
- "description": "Target count to mark this item complete (uses `incrementExp` as an expression to determine the count from deeds sent via a checkpoint).",
429
- "examples": [2]
430
- },
431
- "incrementExp": {
432
- "type": "string",
433
- "description": "Expression evaluated against the deed scope; the result is added to `count`.",
434
- "examples": ["threeOfAKindCount", "flushCount >= 3"]
435
- },
436
- "filterExp": {
437
- "type": "string",
438
- "description": "Optional gate expression — when falsy, the item is skipped for evaluation.",
439
- "examples": ["excessMoves === 0"]
440
- },
441
- "liveUpdate": {
442
- "type": "boolean",
443
- "description": "When true, the item updates during checkpoints, not only at completion."
442
+ "required": ["dir"],
443
+ "additionalProperties": false,
444
+ "description": "Where the built game artifacts live for this game. Used by `puzzmo games upload` and `puzzmo games validate` to find the dist folder when running from a repo root. If omitted, the CLI looks for a `dist`, `build`, or `built` folder — first next to puzzmo.json, then walking up to the repo root, optionally with `<slug>` as a sub-folder for shared output dirs."
444
445
  }
445
446
  },
446
- "additionalProperties": false
447
+ "required": ["game"],
448
+ "additionalProperties": false,
449
+ "description": "The schema for a puzzmo.json file that lives alongside a game's build artifacts"
447
450
  }
448
451
  }
449
452
  }