@anweather/game-plugin-ssdk 1.26.0 → 1.28.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.
@@ -6,7 +6,7 @@ export type { ServePluginOptions, PluginServiceDefinition, PluginApp, RunningPlu
6
6
  export { createRegistrationLoop } from "./registration";
7
7
  export type { RegistrationOptions, RegistrationLoop } from "./registration";
8
8
  export { runConformance, assertConformance } from "./conformance";
9
- export { validatePresentation, assertPresentation, PRESENTATION_CATEGORIES, MAX_PRESENTATION_BYTES } from "./presentation";
9
+ export { validatePresentation, assertPresentation, PRESENTATION_CATEGORIES, MAX_PRESENTATION_BYTES, RESERVED_TUTORIAL_SLUGS, TUTORIAL_SLUG_PATTERN, MAX_TUTORIAL_PLAYERS, } from "./presentation";
10
10
  export type { PluginPresentation, PresentationCategory } from "./presentation";
11
11
  export type { ConformanceOptions, ConformanceReport } from "./conformance";
12
12
  export { PLUGIN_PROTOCOL_VERSION, runtimeVersion } from "./version";
@@ -1,5 +1,15 @@
1
1
  export declare const PRESENTATION_CATEGORIES: readonly ["classic", "strategy", "cards", "word", "wip"];
2
2
  export type PresentationCategory = (typeof PRESENTATION_CATEGORIES)[number];
3
+ /** First path segments the platform's site already uses, which a tutorial
4
+ * slug may not take, so `{site}/{slug}/tutorial` can never shadow a page
5
+ * (`/spaces/tutorial` stays a Space). The platform's
6
+ * TutorialDeclaration.RESERVED_SLUGS and presentation.schema.json carry the
7
+ * same list. */
8
+ export declare const RESERVED_TUTORIAL_SLUGS: readonly ["api", "assets", "chats", "games", "health", "icons", "leaderboard", "nerdle", "players", "plugins", "save-files", "saved-data", "spaces", "style-guide", "tutorial", "tutorials", "wordle"];
9
+ /** A tutorial slug: lowercase words joined by single hyphens. */
10
+ export declare const TUTORIAL_SLUG_PATTERN: RegExp;
11
+ /** The most seats a tutorial may declare. */
12
+ export declare const MAX_TUTORIAL_PLAYERS = 16;
3
13
  /** The platform refuses a registration whose presentation serialises
4
14
  * larger than this. */
5
15
  export declare const MAX_PRESENTATION_BYTES: number;
@@ -59,6 +69,23 @@ export interface PluginPresentation {
59
69
  rematch?: {
60
70
  seatNames: [string, string];
61
71
  };
72
+ /** A tutorial deep link, `{site}/{slug}/tutorial`: opening it resumes the
73
+ * player's unfinished tutorial Game of this type, or creates one with
74
+ * `config` and starts it. */
75
+ tutorial?: {
76
+ /** The URL's friendly name, e.g. "spirit-island": lowercase words
77
+ * joined by hyphens, and none of RESERVED_TUTORIAL_SLUGS. */
78
+ slug: string;
79
+ /** Merged into the new Game's config, e.g. { "tutorial": true }. At
80
+ * least one field: a Game whose config holds every one of these keys
81
+ * and values is how the platform recognises a tutorial to resume. */
82
+ config: Record<string, unknown>;
83
+ /** Seats, the learner included; the rest are filled with bots at the
84
+ * default level. Default 1, and within GetMetadata's min..maxPlayers. */
85
+ players?: number;
86
+ /** E.g. "Learn Spirit Island": the link's label and the new Game's name. */
87
+ title?: string;
88
+ };
62
89
  }
63
90
  /** Every problem with `value` as a presentation, strictest reading: wrong
64
91
  * types, unknown enum values, and unknown fields. Empty means valid. */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@anweather/game-plugin-ssdk",
3
3
  "description": "Generated GamePlugin RPC types/server (plugin-protocol/model/game-plugin.smithy) plus a hand-written Express bridge and default-handler wrapper (./runtime) -- see plugin-protocol/CLAUDE.md's \"Publishing for cross-repo plugins\".",
4
- "version": "1.26.0",
4
+ "version": "1.28.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'npm:build:cjs' 'npm:build:es' 'npm:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",