You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -185,6 +186,35 @@ Choices are important elements that let players control game progression. You ca
185
186
- `npm run docs:build` - Build documentation
186
187
- `npm run docs:preview` - Preview built documentation
187
188
189
+
## Scenario Validation API
190
+
191
+
webTaleKit provides a public API for validating scenario arrays and non-destructively sanitizing HTML-like string content.
192
+
193
+
- `validateScenarioObjects` returns validation results and a sanitized scenario
194
+
- `formatValidationOutput` converts errors and warnings into display-friendly strings
195
+
- `createScenarioValidationError` builds an `Error` from validation results
196
+
- `assertScenarioValidation` throws when validation errors exist
197
+
- `reportScenarioValidation` sends warnings and errors through the logger
198
+
199
+
These APIs are not automatically enforced by the engine at runtime. They are intended to be called explicitly by the user from scene import flows, editor integrations, custom build steps, or server-side tooling.
200
+
201
+
```ts
202
+
import {
203
+
assertScenarioValidation,
204
+
reportScenarioValidation,
205
+
validateScenarioObjects,
206
+
} from './src/utils/validateScenario'
207
+
208
+
const result = validateScenarioObjects(scenarioObjects, commandList)
0 commit comments