@game-infra/story-schemas 0.2.0 → 0.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.
- package/README.md +9 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/storyPayloads.d.ts +62 -2
- package/dist/storyPayloads.d.ts.map +1 -1
- package/dist/storyPayloads.js +7 -1
- package/dist/storyPayloads.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -102,6 +102,15 @@ if (parsed.success) console.log(parsed.output.description, parsed.output.choices
|
|
|
102
102
|
|
|
103
103
|
**Use the lenient DTOs, not the strict ones.** `StrictPreconditionDTOSchema` and `StrictActivationDTOSchema` enumerate one game's vocabulary (`strength`, `mana`, `LearnSpell`, `SpecificLecture`). A design world declares its own stats, skills, perks and resources, so a story client uses the lenient `{ type, params }` forms and validates `type` and the ids in `params` against the world it belongs to.
|
|
104
104
|
|
|
105
|
+
### What this package is not for
|
|
106
|
+
|
|
107
|
+
Everything here is **authored** — written once, read by every player, and the
|
|
108
|
+
same tomorrow as today. Anything that changes because someone is _playing_ —
|
|
109
|
+
a session in progress, its journal of turns, a save slot — belongs to
|
|
110
|
+
`@game-infra/game-state-schemas` and `game-state-service` instead. Freeform
|
|
111
|
+
mode's turn journal and synapse memory live there, in
|
|
112
|
+
`FreeformTurnPayloadSchema` and friends.
|
|
113
|
+
|
|
105
114
|
### Beat addressing
|
|
106
115
|
|
|
107
116
|
A beat's identity is the trail of choices taken to reach it — that is what makes "has this branch been travelled before?" a lookup rather than a search. The client minting ids and the service sweeping subtrees import the same helpers:
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { DESIGN_CONTENT_CASCADES, DESIGN_CONTENT_TYPES, DesignContentBulkSaveRequestSchema, DesignContentBulkSaveResponseSchema, DesignContentCascadeSchema, DesignContentDeleteResponseSchema, DesignContentListResponseSchema, DesignContentLoadResponseSchema, DesignContentRecordSchema, DesignContentReplaceScopeSchema, DesignContentSaveRequestSchema, DesignContentSaveResponseSchema, ROOT_SCOPE, } from "./designContent.js";
|
|
2
2
|
export type { DesignContentBulkSaveRequest, DesignContentBulkSaveResponse, DesignContentCascade, DesignContentDeleteResponse, DesignContentListResponse, DesignContentLoadResponse, DesignContentRecord, DesignContentReplaceScope, DesignContentSaveRequest, DesignContentSaveResponse, DesignContentType, } from "./designContent.js";
|
|
3
|
-
export { ActivationDTOSchema, ChoiceDefinitionDTOSchema, ConsumableConditionDTOSchema, EncounterStageDTOSchema, PreconditionDTOSchema, STORY_BEAT_ORIGINS, StoryArcPayloadSchema, StoryBeatOriginSchema, StoryBeatPayloadSchema, WorldPayloadSchema, } from "./storyPayloads.js";
|
|
4
|
-
export type { ActivationDTO, ChoiceDefinitionDTO, ConsumableConditionDTO, EncounterStageDTO, PreconditionDTO, StoryArcPayload, StoryBeatOrigin, StoryBeatPayload, WorldPayload, } from "./storyPayloads.js";
|
|
3
|
+
export { ActivationDTOSchema, ChoiceDefinitionDTOSchema, ConditionalTextDTOSchema, ConsumableConditionDTOSchema, EncounterStageDTOSchema, PreconditionDTOSchema, STORY_BEAT_ORIGINS, TextFragmentDTOSchema, TextVariantDTOSchema, conditionalTextFrom, flattenConditionalText, resolveConditionalText, resolveConditionalTextParts, StoryArcPayloadSchema, StoryBeatOriginSchema, StoryBeatPayloadSchema, WorldPayloadSchema, } from "./storyPayloads.js";
|
|
4
|
+
export type { ActivationDTO, ChoiceDefinitionDTO, ConditionalTextDTO, ConsumableConditionDTO, EncounterStageDTO, PreconditionDTO, PreconditionPredicate, ResolvedTextFragment, StoryArcPayload, StoryBeatOrigin, StoryBeatPayload, WorldPayload, } from "./storyPayloads.js";
|
|
5
5
|
export { NODE_ID_SEPARATOR, ROOT_NODE_ID, childStoryNodeId, isStoryNodeAtOrBelow, parentStoryNodeId, storyNodeChoiceIds, storyNodeDepth, storyNodeId, storyNodePath, } from "./nodePaths.js";
|
|
6
6
|
export { designContentBulkSaveContract, designContentDeleteContract, designContentListContract, designContentLoadContract, designContentSaveContract, } from "./contracts.js";
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,kCAAkC,EAClC,mCAAmC,EACnC,0BAA0B,EAC1B,iCAAiC,EACjC,+BAA+B,EAC/B,+BAA+B,EAC/B,yBAAyB,EACzB,+BAA+B,EAC/B,8BAA8B,EAC9B,+BAA+B,EAC/B,UAAU,GACX,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,4BAA4B,EAC5B,6BAA6B,EAC7B,oBAAoB,EACpB,2BAA2B,EAC3B,yBAAyB,EACzB,yBAAyB,EACzB,mBAAmB,EACnB,yBAAyB,EACzB,wBAAwB,EACxB,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAO5B,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,4BAA4B,EAC5B,uBAAuB,EACvB,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,aAAa,EACb,mBAAmB,EACnB,sBAAsB,EACtB,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,YAAY,GACb,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,WAAW,EACX,aAAa,GACd,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,EAC3B,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,kCAAkC,EAClC,mCAAmC,EACnC,0BAA0B,EAC1B,iCAAiC,EACjC,+BAA+B,EAC/B,+BAA+B,EAC/B,yBAAyB,EACzB,+BAA+B,EAC/B,8BAA8B,EAC9B,+BAA+B,EAC/B,UAAU,GACX,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,4BAA4B,EAC5B,6BAA6B,EAC7B,oBAAoB,EACpB,2BAA2B,EAC3B,yBAAyB,EACzB,yBAAyB,EACzB,mBAAmB,EACnB,yBAAyB,EACzB,wBAAwB,EACxB,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAO5B,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,wBAAwB,EACxB,4BAA4B,EAC5B,uBAAuB,EACvB,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACtB,2BAA2B,EAC3B,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,YAAY,GACb,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,WAAW,EACX,aAAa,GACd,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,EAC3B,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ export { DESIGN_CONTENT_CASCADES, DESIGN_CONTENT_TYPES, DesignContentBulkSaveReq
|
|
|
7
7
|
//
|
|
8
8
|
// A beat is an encounter stage and a branch is a choice: the event editor's own
|
|
9
9
|
// DTOs, re-exported here so a story client needs one import rather than two.
|
|
10
|
-
export { ActivationDTOSchema, ChoiceDefinitionDTOSchema, ConsumableConditionDTOSchema, EncounterStageDTOSchema, PreconditionDTOSchema, STORY_BEAT_ORIGINS, StoryArcPayloadSchema, StoryBeatOriginSchema, StoryBeatPayloadSchema, WorldPayloadSchema, } from "./storyPayloads.js";
|
|
10
|
+
export { ActivationDTOSchema, ChoiceDefinitionDTOSchema, ConditionalTextDTOSchema, ConsumableConditionDTOSchema, EncounterStageDTOSchema, PreconditionDTOSchema, STORY_BEAT_ORIGINS, TextFragmentDTOSchema, TextVariantDTOSchema, conditionalTextFrom, flattenConditionalText, resolveConditionalText, resolveConditionalTextParts, StoryArcPayloadSchema, StoryBeatOriginSchema, StoryBeatPayloadSchema, WorldPayloadSchema, } from "./storyPayloads.js";
|
|
11
11
|
// Beat addressing, shared by the client that mints ids and the service that
|
|
12
12
|
// sweeps subtrees.
|
|
13
13
|
export { NODE_ID_SEPARATOR, ROOT_NODE_ID, childStoryNodeId, isStoryNodeAtOrBelow, parentStoryNodeId, storyNodeChoiceIds, storyNodeDepth, storyNodeId, storyNodePath, } from "./nodePaths.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAE7E,8EAA8E;AAC9E,kBAAkB;AAClB,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,kCAAkC,EAClC,mCAAmC,EACnC,0BAA0B,EAC1B,iCAAiC,EACjC,+BAA+B,EAC/B,+BAA+B,EAC/B,yBAAyB,EACzB,+BAA+B,EAC/B,8BAA8B,EAC9B,+BAA+B,EAC/B,UAAU,GACX,MAAM,oBAAoB,CAAC;AAe5B,gFAAgF;AAChF,6DAA6D;AAC7D,EAAE;AACF,gFAAgF;AAChF,6EAA6E;AAC7E,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,4BAA4B,EAC5B,uBAAuB,EACvB,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAE7E,8EAA8E;AAC9E,kBAAkB;AAClB,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,kCAAkC,EAClC,mCAAmC,EACnC,0BAA0B,EAC1B,iCAAiC,EACjC,+BAA+B,EAC/B,+BAA+B,EAC/B,yBAAyB,EACzB,+BAA+B,EAC/B,8BAA8B,EAC9B,+BAA+B,EAC/B,UAAU,GACX,MAAM,oBAAoB,CAAC;AAe5B,gFAAgF;AAChF,6DAA6D;AAC7D,EAAE;AACF,gFAAgF;AAChF,6EAA6E;AAC7E,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,wBAAwB,EACxB,4BAA4B,EAC5B,uBAAuB,EACvB,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACtB,2BAA2B,EAC3B,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAgB5B,4EAA4E;AAC5E,mBAAmB;AACnB,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,WAAW,EACX,aAAa,GACd,MAAM,gBAAgB,CAAC;AAExB,2EAA2E;AAC3E,mFAAmF;AACnF,oDAAoD;AACpD,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,EAC3B,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC"}
|
package/dist/storyPayloads.d.ts
CHANGED
|
@@ -111,6 +111,12 @@ export type StoryBeatOrigin = InferOutput<typeof StoryBeatOriginSchema>;
|
|
|
111
111
|
* `conditionsToShow`, `conditionsToEnable`, `consumableConditions`, `effects`
|
|
112
112
|
* and an outcome config exactly as an event's choice does.
|
|
113
113
|
*
|
|
114
|
+
* A beat that reads differently depending on what the player has done carries
|
|
115
|
+
* `conditionalDescription` beside `description` (see `ConditionalTextDTO`): the
|
|
116
|
+
* fragments a reader in this state is shown, with `description` holding the
|
|
117
|
+
* flattened reading for anything that cannot evaluate preconditions. Branch
|
|
118
|
+
* labels vary the same way through a choice's `conditionalName`.
|
|
119
|
+
*
|
|
114
120
|
* The beat's *address* is not in here — it is the row's `contentId`, the trail
|
|
115
121
|
* of choices taken to reach it (see `nodePaths.ts`). Keeping the address out of
|
|
116
122
|
* the payload is what keeps the two from disagreeing. The stage's own `id` is
|
|
@@ -143,10 +149,64 @@ export declare const StoryBeatPayloadSchema: import("valibot").ObjectSchema<{
|
|
|
143
149
|
readonly id: import("valibot").StringSchema<undefined>;
|
|
144
150
|
readonly title: import("valibot").StringSchema<undefined>;
|
|
145
151
|
readonly description: import("valibot").StringSchema<undefined>;
|
|
152
|
+
readonly conditionalDescription: import("valibot").OptionalSchema<import("valibot").ObjectSchema<{
|
|
153
|
+
readonly fragments: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
154
|
+
readonly id: import("valibot").StringSchema<undefined>;
|
|
155
|
+
readonly text: import("valibot").StringSchema<undefined>;
|
|
156
|
+
readonly conditions: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
157
|
+
readonly type: import("valibot").StringSchema<undefined>;
|
|
158
|
+
readonly params: import("valibot").RecordSchema<import("valibot").StringSchema<undefined>, import("valibot").UnknownSchema, undefined>;
|
|
159
|
+
}, undefined>, undefined>, undefined>;
|
|
160
|
+
readonly variants: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
161
|
+
readonly conditions: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
162
|
+
readonly type: import("valibot").StringSchema<undefined>;
|
|
163
|
+
readonly params: import("valibot").RecordSchema<import("valibot").StringSchema<undefined>, import("valibot").UnknownSchema, undefined>;
|
|
164
|
+
}, undefined>, undefined>;
|
|
165
|
+
readonly text: import("valibot").StringSchema<undefined>;
|
|
166
|
+
}, undefined>, undefined>, undefined>;
|
|
167
|
+
}, undefined>, undefined>;
|
|
168
|
+
readonly separator: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
169
|
+
}, undefined>, undefined>;
|
|
146
170
|
readonly choices: import("valibot").RecordSchema<import("valibot").StringSchema<undefined>, import("valibot").ObjectSchema<{
|
|
147
171
|
readonly id: import("valibot").StringSchema<undefined>;
|
|
148
172
|
readonly name: import("valibot").StringSchema<undefined>;
|
|
149
173
|
readonly description: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
174
|
+
readonly conditionalName: import("valibot").OptionalSchema<import("valibot").ObjectSchema<{
|
|
175
|
+
readonly fragments: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
176
|
+
readonly id: import("valibot").StringSchema<undefined>;
|
|
177
|
+
readonly text: import("valibot").StringSchema<undefined>;
|
|
178
|
+
readonly conditions: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
179
|
+
readonly type: import("valibot").StringSchema<undefined>;
|
|
180
|
+
readonly params: import("valibot").RecordSchema<import("valibot").StringSchema<undefined>, import("valibot").UnknownSchema, undefined>;
|
|
181
|
+
}, undefined>, undefined>, undefined>;
|
|
182
|
+
readonly variants: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
183
|
+
readonly conditions: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
184
|
+
readonly type: import("valibot").StringSchema<undefined>;
|
|
185
|
+
readonly params: import("valibot").RecordSchema<import("valibot").StringSchema<undefined>, import("valibot").UnknownSchema, undefined>;
|
|
186
|
+
}, undefined>, undefined>;
|
|
187
|
+
readonly text: import("valibot").StringSchema<undefined>;
|
|
188
|
+
}, undefined>, undefined>, undefined>;
|
|
189
|
+
}, undefined>, undefined>;
|
|
190
|
+
readonly separator: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
191
|
+
}, undefined>, undefined>;
|
|
192
|
+
readonly conditionalDescription: import("valibot").OptionalSchema<import("valibot").ObjectSchema<{
|
|
193
|
+
readonly fragments: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
194
|
+
readonly id: import("valibot").StringSchema<undefined>;
|
|
195
|
+
readonly text: import("valibot").StringSchema<undefined>;
|
|
196
|
+
readonly conditions: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
197
|
+
readonly type: import("valibot").StringSchema<undefined>;
|
|
198
|
+
readonly params: import("valibot").RecordSchema<import("valibot").StringSchema<undefined>, import("valibot").UnknownSchema, undefined>;
|
|
199
|
+
}, undefined>, undefined>, undefined>;
|
|
200
|
+
readonly variants: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
201
|
+
readonly conditions: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
202
|
+
readonly type: import("valibot").StringSchema<undefined>;
|
|
203
|
+
readonly params: import("valibot").RecordSchema<import("valibot").StringSchema<undefined>, import("valibot").UnknownSchema, undefined>;
|
|
204
|
+
}, undefined>, undefined>;
|
|
205
|
+
readonly text: import("valibot").StringSchema<undefined>;
|
|
206
|
+
}, undefined>, undefined>, undefined>;
|
|
207
|
+
}, undefined>, undefined>;
|
|
208
|
+
readonly separator: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
|
|
209
|
+
}, undefined>, undefined>;
|
|
150
210
|
readonly effects: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
151
211
|
readonly type: import("valibot").StringSchema<undefined>;
|
|
152
212
|
readonly params: import("valibot").RecordSchema<import("valibot").StringSchema<undefined>, import("valibot").UnknownSchema, undefined>;
|
|
@@ -221,6 +281,6 @@ export type StoryBeatPayload = InferOutput<typeof StoryBeatPayloadSchema>;
|
|
|
221
281
|
* Re-exported so a story client needs one import, not two, for the shapes it
|
|
222
282
|
* reads out of a beat.
|
|
223
283
|
*/
|
|
224
|
-
export { ActivationDTOSchema, ChoiceDefinitionDTOSchema, ConsumableConditionDTOSchema, EncounterStageDTOSchema, PreconditionDTOSchema, } from "@game-infra/event-schemas";
|
|
225
|
-
export type { ActivationDTO, ChoiceDefinitionDTO, ConsumableConditionDTO, EncounterStageDTO, PreconditionDTO, } from "@game-infra/event-schemas";
|
|
284
|
+
export { ActivationDTOSchema, ChoiceDefinitionDTOSchema, ConditionalTextDTOSchema, ConsumableConditionDTOSchema, EncounterStageDTOSchema, PreconditionDTOSchema, TextFragmentDTOSchema, TextVariantDTOSchema, conditionalTextFrom, flattenConditionalText, resolveConditionalText, resolveConditionalTextParts, } from "@game-infra/event-schemas";
|
|
285
|
+
export type { ActivationDTO, ChoiceDefinitionDTO, ConditionalTextDTO, ConsumableConditionDTO, EncounterStageDTO, PreconditionDTO, PreconditionPredicate, ResolvedTextFragment, } from "@game-infra/event-schemas";
|
|
226
286
|
//# sourceMappingURL=storyPayloads.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storyPayloads.d.ts","sourceRoot":"","sources":["../src/storyPayloads.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,KAAK,WAAW,EASjB,MAAM,SAAS,CAAC;AAE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;AACnF,eAAO,MAAM,kBAAkB,YAAI,WAAW,EAAE,UAAU,CAAU,CAAC;AAErE,eAAO,MAAM,qBAAqB,iFAA+B,CAAC;AAElE,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAExE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEjC,6EAA6E;;;IAG7E,wDAAwD;;IAExD,qDAAqD;;aAErD,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE1E;;;GAGG;AACH,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,wBAAwB,EACxB,4BAA4B,EAC5B,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACtB,2BAA2B,GAC5B,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,2BAA2B,CAAC"}
|
package/dist/storyPayloads.js
CHANGED
|
@@ -96,6 +96,12 @@ export const StoryBeatOriginSchema = picklist(STORY_BEAT_ORIGINS);
|
|
|
96
96
|
* `conditionsToShow`, `conditionsToEnable`, `consumableConditions`, `effects`
|
|
97
97
|
* and an outcome config exactly as an event's choice does.
|
|
98
98
|
*
|
|
99
|
+
* A beat that reads differently depending on what the player has done carries
|
|
100
|
+
* `conditionalDescription` beside `description` (see `ConditionalTextDTO`): the
|
|
101
|
+
* fragments a reader in this state is shown, with `description` holding the
|
|
102
|
+
* flattened reading for anything that cannot evaluate preconditions. Branch
|
|
103
|
+
* labels vary the same way through a choice's `conditionalName`.
|
|
104
|
+
*
|
|
99
105
|
* The beat's *address* is not in here — it is the row's `contentId`, the trail
|
|
100
106
|
* of choices taken to reach it (see `nodePaths.ts`). Keeping the address out of
|
|
101
107
|
* the payload is what keeps the two from disagreeing. The stage's own `id` is
|
|
@@ -138,5 +144,5 @@ export const StoryBeatPayloadSchema = object({
|
|
|
138
144
|
* Re-exported so a story client needs one import, not two, for the shapes it
|
|
139
145
|
* reads out of a beat.
|
|
140
146
|
*/
|
|
141
|
-
export { ActivationDTOSchema, ChoiceDefinitionDTOSchema, ConsumableConditionDTOSchema, EncounterStageDTOSchema, PreconditionDTOSchema, } from "@game-infra/event-schemas";
|
|
147
|
+
export { ActivationDTOSchema, ChoiceDefinitionDTOSchema, ConditionalTextDTOSchema, ConsumableConditionDTOSchema, EncounterStageDTOSchema, PreconditionDTOSchema, TextFragmentDTOSchema, TextVariantDTOSchema, conditionalTextFrom, flattenConditionalText, resolveConditionalText, resolveConditionalTextParts, } from "@game-infra/event-schemas";
|
|
142
148
|
//# sourceMappingURL=storyPayloads.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storyPayloads.js","sourceRoot":"","sources":["../src/storyPayloads.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,sBAAsB,EACtB,iBAAiB,EACjB,gCAAgC,EAChC,qBAAqB,GACtB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEL,KAAK,EACL,OAAO,EACP,MAAM,EACN,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,MAAM,GACP,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;IACvC,KAAK,EAAE,MAAM,EAAE;IACf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;CACtC,CAAC,CAAC;AAIH,mFAAmF;AACnF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,WAAW,EAAE,UAAU,CAAU,CAAC;AAErE,MAAM,CAAC,MAAM,qBAAqB,GAAG,QAAQ,CAAC,kBAAkB,CAAC,CAAC;AAIlE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC;IAC3C,GAAG,uBAAuB,CAAC,OAAO;IAClC,6EAA6E;IAC7E,KAAK,EAAE,MAAM,EAAE;IACf,MAAM,EAAE,qBAAqB;IAC7B,wDAAwD;IACxD,QAAQ,EAAE,MAAM,EAAE;IAClB,qDAAqD;IACrD,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;CACvB,CAAC,CAAC;AAIH;;;GAGG;AACH,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,wBAAwB,EACxB,4BAA4B,EAC5B,uBAAuB,EACvB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACtB,2BAA2B,GAC5B,MAAM,2BAA2B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@game-infra/story-schemas",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Story-mode API contract: branching arcs and beats built on the event-editor's encounter-stage and choice DTOs, behind one design-content resource",
|
|
5
5
|
"homepage": "https://github.com/kibertoad/game-infra/tree/main/packages/schemas/story-schemas#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@toad-contracts/core": "0.4.0",
|
|
31
31
|
"@toad-contracts/valibot": "0.5.0",
|
|
32
32
|
"@game-infra/api-schemas-core": "0.3.0",
|
|
33
|
-
"@game-infra/event-schemas": "1.
|
|
33
|
+
"@game-infra/event-schemas": "1.1.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/node": "^26.1.2",
|