@seriousgaming/sdk-tools 1.3.0 → 1.4.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.
Files changed (36) hide show
  1. package/dist/cli.js +3216 -2538
  2. package/dist/client.js +693 -161
  3. package/dist/core/session-host.d.ts +4 -2
  4. package/dist/core/settings-locks.d.ts +27 -2
  5. package/dist/dev/console/assets/{index-DEV8N0na.js → index-BvB-LFQZ.js} +10 -10
  6. package/dist/dev/console/index.html +1 -1
  7. package/dist/dev/routes.d.ts +4 -0
  8. package/dist/dev/view/batch.d.ts +7 -1
  9. package/dist/docs/api/index.md +1 -1
  10. package/dist/docs/api/sdk-tools-client.md +1 -0
  11. package/dist/docs/api/sdk.md +79 -2
  12. package/dist/docs/changelog.md +25 -0
  13. package/dist/docs/concepts/terminology.md +1 -1
  14. package/dist/docs/guides/capabilities.md +2 -0
  15. package/dist/docs/guides/endpoints.md +2 -2
  16. package/dist/docs/guides/engine-testing.md +1 -1
  17. package/dist/docs/guides/file-handling.md +113 -21
  18. package/dist/docs/guides/llm-integration.md +1 -1
  19. package/dist/docs/guides/scenario-editor.md +1 -1
  20. package/dist/docs/guides/scenarios.md +9 -1
  21. package/dist/docs/guides/settings.md +62 -2
  22. package/dist/docs/guides/validators.md +62 -4
  23. package/dist/docs/recipes/upload-and-display-files.md +7 -7
  24. package/dist/docs/recipes/validate-scenarios.md +4 -1
  25. package/dist/execution/endpoint-runner.d.ts +6 -0
  26. package/dist/execution/logic-calls.d.ts +7 -2
  27. package/dist/execution/scenario-gates.d.ts +21 -1
  28. package/dist/guide/settings.d.ts +1 -1
  29. package/dist/host.js +64 -2
  30. package/dist/runtime/manifest-version.d.ts +1 -1
  31. package/dist/runtime.js +7 -2
  32. package/dist/storage/asset-resolver.d.ts +24 -1
  33. package/dist/storage/blob-store.d.ts +7 -0
  34. package/dist/utils/local-refs.d.ts +40 -0
  35. package/dist/utils/schema-members.d.ts +19 -0
  36. package/package.json +3 -3
@@ -55,12 +55,14 @@ export interface SessionHost {
55
55
  /**
56
56
  * What a call from the scenario editor resolves against (§6.5, §6.12):
57
57
  * the scenario it is editing, and its draft over that scenario's
58
- * settings, the `game` settings included, and its display name. Absent
59
- * names the one in force.
58
+ * settings, the `game` settings included, its display name, and the
59
+ * root its `asset:` references resolve against. Absent names the one in
60
+ * force.
60
61
  */
61
62
  scenarioBeingEdited(scenarioId: string | null | undefined): {
62
63
  settings: Record<string, Record<string, unknown>>;
63
64
  scenarioName: string | null;
65
+ scenarioRoot: string | null;
64
66
  };
65
67
  teamBounds(): TeamBounds;
66
68
  tickLimit(): number | null;
@@ -6,11 +6,36 @@ import type { JSONSchema7 } from 'json-schema';
6
6
  * resolve: an override naming a locked value is refused, so none ever reaches
7
7
  * the resolver. A locked object locks everything under it.
8
8
  */
9
- /** The paths a settings schema locks, each as its keys below the resource. */
9
+ /**
10
+ * The paths a settings schema locks, each as its keys below the resource.
11
+ * Locks sit on named properties alone (§6.1a), reached through a local
12
+ * `$ref` as through one written in place. A shape that holds itself through
13
+ * named properties is followed once along any path, since a schema alone
14
+ * cannot say how deep a value will go; {@link lockedPathsNamed} follows the
15
+ * value instead.
16
+ */
10
17
  export declare function lockedPaths(schema: JSONSchema7 | undefined): string[][];
11
18
  /** The locked paths an override of one settings resource names. */
12
19
  export declare function lockedPathsNamed(override: unknown, schema: JSONSchema7 | undefined): string[][];
13
- /** A locked value as a facilitator or an author reads it: `engine.Rate`. */
20
+ /** A `readOnly` the runtime cannot enforce, inside a list's items or a map's entries. */
21
+ export interface UnenforceableLock {
22
+ /** Where the lock sits: `[]` steps into a list's items, `*` or `/pattern/` into a map's entries. */
23
+ path: string[];
24
+ /** The list or map to lock instead. */
25
+ container: string[];
26
+ kind: 'list' | 'map';
27
+ }
28
+ /**
29
+ * Every `readOnly` beneath `items`, `additionalProperties` or
30
+ * `patternProperties` (§6.1a). Scenarios add and remove a list's items and a
31
+ * map's entries, so there is no single game value for such a lock to keep;
32
+ * the build refuses it, and the list or map is locked whole instead. A lock
33
+ * on the list or map itself covers all beneath it, so the walk stops there.
34
+ */
35
+ export declare function unenforceableLocks(schema: JSONSchema7): UnenforceableLock[];
36
+ /** An {@link UnenforceableLock} as a build error line. */
37
+ export declare function unenforceableLockMessage(identifier: string, lock: UnenforceableLock): string;
38
+ /** A locked value as a facilitator or an author reads it, as a setting path (§6.1a): `engine.Rate`. */
14
39
  export declare function lockedSettingName(identifier: string, path: readonly string[]): string;
15
40
  export declare function lockedSettingMessage(identifier: string, path: readonly string[]): string;
16
41
  /**