@futdevpro/fsm-dynamo 1.20.102 → 1.20.104
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/build/_modules/game/_models/guided-onboarding.control-model.d.ts +81 -0
- package/build/_modules/game/_models/guided-onboarding.control-model.d.ts.map +1 -0
- package/build/_modules/game/_models/guided-onboarding.control-model.js +491 -0
- package/build/_modules/game/_models/guided-onboarding.control-model.js.map +1 -0
- package/build/_modules/game/_models/guided-onboarding.interface.d.ts +102 -0
- package/build/_modules/game/_models/guided-onboarding.interface.d.ts.map +1 -0
- package/build/_modules/game/_models/guided-onboarding.interface.js +3 -0
- package/build/_modules/game/_models/guided-onboarding.interface.js.map +1 -0
- package/build/_modules/game/_models/narration-player.control-model.d.ts +53 -0
- package/build/_modules/game/_models/narration-player.control-model.d.ts.map +1 -0
- package/build/_modules/game/_models/narration-player.control-model.js +223 -0
- package/build/_modules/game/_models/narration-player.control-model.js.map +1 -0
- package/build/_modules/game/_models/narration-player.interface.d.ts +64 -0
- package/build/_modules/game/_models/narration-player.interface.d.ts.map +1 -0
- package/build/_modules/game/_models/narration-player.interface.js +3 -0
- package/build/_modules/game/_models/narration-player.interface.js.map +1 -0
- package/build/_modules/game/index.d.ts +4 -0
- package/build/_modules/game/index.d.ts.map +1 -1
- package/build/_modules/game/index.js +4 -0
- package/build/_modules/game/index.js.map +1 -1
- package/build-esm/_modules/game/_models/guided-onboarding.control-model.js +486 -0
- package/build-esm/_modules/game/_models/guided-onboarding.interface.js +1 -0
- package/build-esm/_modules/game/_models/narration-player.control-model.js +218 -0
- package/build-esm/_modules/game/_models/narration-player.interface.js +1 -0
- package/build-esm/_modules/game/index.js +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { DyFM_OnboardingCapabilities, DyFM_OnboardingCatalog, DyFM_OnboardingEvaluation_Type, DyFM_OnboardingEvent, DyFM_OnboardingFinding, DyFM_OnboardingMigrationReport, DyFM_OnboardingPosition, DyFM_OnboardingState, DyFM_OnboardingStatus_Type } from './guided-onboarding.interface';
|
|
2
|
+
/**
|
|
3
|
+
* BFR-WARFACTORY-014 — content-agnostic guided onboarding: chapters of steps with STABLE ids, declarative commands and
|
|
4
|
+
* predicates resolved against the game's capability surface, state-regression recovery, bounded timeouts,
|
|
5
|
+
* skip / restart / resume, and a versioned, migratable progress state.
|
|
6
|
+
*
|
|
7
|
+
* It owns no timer and no DOM: the driver (a game loop tick, a state-change event, an Angular effect) calls
|
|
8
|
+
* `evaluate()`; the UI layer renders `position()` and listens to `onEvent()`. The clock is injectable, so timeouts are
|
|
9
|
+
* deterministic in tests.
|
|
10
|
+
*/
|
|
11
|
+
export declare class DyFM_GuidedOnboarding_ControlModel<TContext> {
|
|
12
|
+
private readonly catalog;
|
|
13
|
+
private readonly capabilities;
|
|
14
|
+
private readonly now;
|
|
15
|
+
private readonly steps;
|
|
16
|
+
private readonly chapterCount;
|
|
17
|
+
private status;
|
|
18
|
+
private currentIndex;
|
|
19
|
+
private enteredAtMs;
|
|
20
|
+
private readonly completed;
|
|
21
|
+
private readonly skipped;
|
|
22
|
+
private readonly listeners;
|
|
23
|
+
/** `importState` restored an active step, but it was not entered yet (`resume`). */
|
|
24
|
+
private pendingResume;
|
|
25
|
+
/** A transition (with a possibly async command) is running — a re-entrant `evaluate` waits it out. */
|
|
26
|
+
private transitioning;
|
|
27
|
+
/** Validates the catalog against the capabilities; any finding throws `DYFM-ONBOARDING-CATALOG` listing them all. */
|
|
28
|
+
constructor(catalog: DyFM_OnboardingCatalog, capabilities: DyFM_OnboardingCapabilities<TContext>, now?: () => number);
|
|
29
|
+
/**
|
|
30
|
+
* Every problem of a catalog, as data (never throws). With `capabilities`, each ref must name a registered command /
|
|
31
|
+
* predicate — a typo is caught when the game boots, not when a player reaches that step.
|
|
32
|
+
*/
|
|
33
|
+
static validateCatalog<TContext>(catalog: DyFM_OnboardingCatalog, capabilities?: DyFM_OnboardingCapabilities<TContext>): DyFM_OnboardingFinding[];
|
|
34
|
+
/** Subscribe; returns the unsubscribe. A throwing listener is logged and isolated — it never breaks the runtime. */
|
|
35
|
+
onEvent(listener: (event: DyFM_OnboardingEvent) => void): () => void;
|
|
36
|
+
getStatus(): DyFM_OnboardingStatus_Type;
|
|
37
|
+
/** Where the player is; `null` unless active. */
|
|
38
|
+
position(): DyFM_OnboardingPosition | null;
|
|
39
|
+
/** Starts a not-yet-started onboarding at its first step (no-op otherwise — a finished one is `restart`ed). */
|
|
40
|
+
start(context: TContext): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* One check of the active step: state regression → fallback · completion → next step · timeout → recorded and left.
|
|
43
|
+
* Call it from whatever drives the game (tick, state event); it never waits by itself.
|
|
44
|
+
*/
|
|
45
|
+
evaluate(context: TContext): Promise<DyFM_OnboardingEvaluation_Type>;
|
|
46
|
+
/** The player acknowledges a MANUAL step (no completion predicate); a gameplay step throws `DYFM-ONBOARDING-NOT-MANUAL`. */
|
|
47
|
+
next(context: TContext): Promise<void>;
|
|
48
|
+
/** Skip the active step, the rest of its chapter, or the whole onboarding. */
|
|
49
|
+
skip(context: TContext, scope: 'step' | 'chapter' | 'all'): Promise<void>;
|
|
50
|
+
/** Start over — all of it, or from a chapter on (earlier chapters keep their progress). */
|
|
51
|
+
restart(context: TContext, fromChapterId?: string): Promise<void>;
|
|
52
|
+
/** The progress as data (`dyfm-onboarding/1`); ids in catalog order, so two equal states serialise identically. */
|
|
53
|
+
exportState(): DyFM_OnboardingState;
|
|
54
|
+
/**
|
|
55
|
+
* Restores a save onto THIS catalog: ids are rewritten by the migration rules, vanished ids are dropped, and an
|
|
56
|
+
* active step that no longer exists (or is already done) continues at the first unfinished step. No command runs —
|
|
57
|
+
* an active onboarding must be `resume`d, and until then `evaluate` / `next` / `skip` throw
|
|
58
|
+
* `DYFM-ONBOARDING-NOT-RESUMED` (a forgotten resume would otherwise leave the player stuck, silently).
|
|
59
|
+
*/
|
|
60
|
+
importState(state: DyFM_OnboardingState): DyFM_OnboardingMigrationReport;
|
|
61
|
+
/**
|
|
62
|
+
* Enters the restored step after `importState`. Its command is NOT run again by default (it already ran before the
|
|
63
|
+
* save — e.g. placing a building twice would corrupt the game); pass `rerunCommand` for idempotent commands.
|
|
64
|
+
*/
|
|
65
|
+
resume(context: TContext, options?: {
|
|
66
|
+
rerunCommand?: boolean;
|
|
67
|
+
}): Promise<void>;
|
|
68
|
+
/** Leaves the active step (completed / skipped / timed out) and enters the next unfinished one — or finishes. */
|
|
69
|
+
private leave;
|
|
70
|
+
/** Makes `index` the active step; runs its command (a failing command is reported and the step stays active). */
|
|
71
|
+
private enter;
|
|
72
|
+
/** Evaluates a predicate; a throwing one becomes a debuggable `DYFM-ONBOARDING-PREDICATE` (step + predicate named). */
|
|
73
|
+
private predicate;
|
|
74
|
+
private transition;
|
|
75
|
+
private activeStep;
|
|
76
|
+
private assertResumed;
|
|
77
|
+
private isDone;
|
|
78
|
+
private indexOf;
|
|
79
|
+
private emit;
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=guided-onboarding.control-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guided-onboarding.control-model.d.ts","sourceRoot":"","sources":["../../../../src/_modules/game/_models/guided-onboarding.control-model.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,EACtB,8BAA8B,EAC9B,oBAAoB,EACpB,sBAAsB,EACtB,8BAA8B,EAC9B,uBAAuB,EAEvB,oBAAoB,EACpB,0BAA0B,EAE3B,MAAM,+BAA+B,CAAC;AAWvC;;;;;;;;GAQG;AACH,qBAAa,kCAAkC,CAAC,QAAQ;IAgBpD,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,GAAG;IAjBtB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAiC;IACvD,OAAO,CAAC,QAAQ,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AE,QAAQ,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAuBvE,mHAAmH;IACnH,WAAW,IAAI,oBAAoB;IAkBnC;;;;;OAKG;IACH,WAAW,CAAC,KAAK,EAAE,oBAAoB,GAAG,8BAA8B;IAgFxE;;;OAGG;IACG,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,GAAE;QAAE,YAAY,CAAC,EAAE,OAAO,CAAA;KAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAQxF,iHAAiH;YACnG,KAAK;IAyCnB,iHAAiH;YACnG,KAAK;IAmBnB,uHAAuH;IACvH,OAAO,CAAC,SAAS;YAaH,UAAU;IASxB,OAAO,CAAC,UAAU;IAalB,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,MAAM;IAMd,OAAO,CAAC,OAAO;IAcf,OAAO,CAAC,IAAI;CASb"}
|
|
@@ -0,0 +1,491 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DyFM_GuidedOnboarding_ControlModel = void 0;
|
|
4
|
+
const log_util_1 = require("../../../_collections/utils/log.util");
|
|
5
|
+
const error_control_model_1 = require("../../../_models/control-models/error.control-model");
|
|
6
|
+
const ISSUER = 'DyFM_GuidedOnboarding_ControlModel';
|
|
7
|
+
/**
|
|
8
|
+
* BFR-WARFACTORY-014 — content-agnostic guided onboarding: chapters of steps with STABLE ids, declarative commands and
|
|
9
|
+
* predicates resolved against the game's capability surface, state-regression recovery, bounded timeouts,
|
|
10
|
+
* skip / restart / resume, and a versioned, migratable progress state.
|
|
11
|
+
*
|
|
12
|
+
* It owns no timer and no DOM: the driver (a game loop tick, a state-change event, an Angular effect) calls
|
|
13
|
+
* `evaluate()`; the UI layer renders `position()` and listens to `onEvent()`. The clock is injectable, so timeouts are
|
|
14
|
+
* deterministic in tests.
|
|
15
|
+
*/
|
|
16
|
+
class DyFM_GuidedOnboarding_ControlModel {
|
|
17
|
+
catalog;
|
|
18
|
+
capabilities;
|
|
19
|
+
now;
|
|
20
|
+
steps = [];
|
|
21
|
+
chapterCount;
|
|
22
|
+
status = 'not-started';
|
|
23
|
+
currentIndex = -1;
|
|
24
|
+
enteredAtMs = 0;
|
|
25
|
+
completed = new Set();
|
|
26
|
+
skipped = new Set();
|
|
27
|
+
listeners = [];
|
|
28
|
+
/** `importState` restored an active step, but it was not entered yet (`resume`). */
|
|
29
|
+
pendingResume = false;
|
|
30
|
+
/** A transition (with a possibly async command) is running — a re-entrant `evaluate` waits it out. */
|
|
31
|
+
transitioning = false;
|
|
32
|
+
/** Validates the catalog against the capabilities; any finding throws `DYFM-ONBOARDING-CATALOG` listing them all. */
|
|
33
|
+
constructor(catalog, capabilities, now = () => Date.now()) {
|
|
34
|
+
this.catalog = catalog;
|
|
35
|
+
this.capabilities = capabilities;
|
|
36
|
+
this.now = now;
|
|
37
|
+
const findings = DyFM_GuidedOnboarding_ControlModel.validateCatalog(catalog, capabilities);
|
|
38
|
+
if (findings.length) {
|
|
39
|
+
throw new error_control_model_1.DyFM_Error({
|
|
40
|
+
message: `DyFM_GuidedOnboarding: invalid catalog — ${findings.map((f) => `[${f.code}] ${f.path}: ${f.message}`).join(' · ')}`,
|
|
41
|
+
errorCode: 'DYFM-ONBOARDING-CATALOG',
|
|
42
|
+
issuerService: ISSUER,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
catalog.chapters.forEach((chapter, chapterIndex) => {
|
|
46
|
+
chapter.steps.forEach((step) => {
|
|
47
|
+
this.steps.push({ chapterId: chapter.chapterId, chapterIndex: chapterIndex, step: step });
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
this.chapterCount = catalog.chapters.length;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Every problem of a catalog, as data (never throws). With `capabilities`, each ref must name a registered command /
|
|
54
|
+
* predicate — a typo is caught when the game boots, not when a player reaches that step.
|
|
55
|
+
*/
|
|
56
|
+
static validateCatalog(catalog, capabilities) {
|
|
57
|
+
const findings = [];
|
|
58
|
+
const add = (code, path, message) => findings.push({ code: code, path: path, message: message });
|
|
59
|
+
if (!catalog || !Array.isArray(catalog.chapters) || !catalog.chapters.length) {
|
|
60
|
+
add('ONB-EMPTY', 'chapters', 'a catalog needs at least one chapter');
|
|
61
|
+
return findings;
|
|
62
|
+
}
|
|
63
|
+
if (catalog.catalogVersion === undefined || catalog.catalogVersion === null || catalog.catalogVersion === '') {
|
|
64
|
+
add('ONB-VERSION', 'catalogVersion', 'required — saves are migrated by it');
|
|
65
|
+
}
|
|
66
|
+
const chapterIds = new Set();
|
|
67
|
+
const stepIds = new Set();
|
|
68
|
+
catalog.chapters.forEach((chapter, c) => {
|
|
69
|
+
if (!chapter?.chapterId || chapterIds.has(chapter.chapterId)) {
|
|
70
|
+
add('ONB-CHAPTER-ID', `chapters[${c}]`, `chapter id must be non-empty and unique (${chapter?.chapterId})`);
|
|
71
|
+
}
|
|
72
|
+
chapterIds.add(chapter?.chapterId);
|
|
73
|
+
if (!Array.isArray(chapter?.steps) || !chapter.steps.length) {
|
|
74
|
+
add('ONB-CHAPTER-EMPTY', `chapters[${c}]`, `chapter '${chapter?.chapterId}' has no steps`);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
chapter.steps.forEach((step, s) => {
|
|
78
|
+
if (!step?.stepId || stepIds.has(step.stepId)) {
|
|
79
|
+
add('ONB-STEP-ID', `chapters[${c}].steps[${s}]`, `step id must be non-empty and unique across the catalog (${step?.stepId})`);
|
|
80
|
+
}
|
|
81
|
+
stepIds.add(step?.stepId);
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
const checkRef = (ref, kind, path) => {
|
|
85
|
+
if (ref === undefined) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (!ref || typeof ref.name !== 'string' || !ref.name) {
|
|
89
|
+
add('ONB-REF', path, 'a ref needs a non-empty name');
|
|
90
|
+
}
|
|
91
|
+
else if (capabilities && typeof capabilities[kind]?.[ref.name] !== 'function') {
|
|
92
|
+
add('ONB-REF-UNKNOWN', path, `'${ref.name}' is not a registered ${kind === 'commands' ? 'command' : 'predicate'}`);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
catalog.chapters.forEach((chapter, c) => {
|
|
96
|
+
(chapter?.steps ?? []).forEach((step, s) => {
|
|
97
|
+
const path = `chapters[${c}].steps[${s}]`;
|
|
98
|
+
checkRef(step?.command, 'commands', `${path}.command`);
|
|
99
|
+
checkRef(step?.completion, 'predicates', `${path}.completion`);
|
|
100
|
+
checkRef(step?.stateValidator, 'predicates', `${path}.stateValidator`);
|
|
101
|
+
(step?.fallbackStepIds ?? []).forEach((fallback) => {
|
|
102
|
+
if (fallback === step.stepId || !stepIds.has(fallback)) {
|
|
103
|
+
add('ONB-FALLBACK', `${path}.fallbackStepIds`, `'${fallback}' is not another step of the catalog`);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
if (step?.timeoutMs !== undefined && !(Number.isFinite(step.timeoutMs) && step.timeoutMs > 0)) {
|
|
107
|
+
add('ONB-TIMEOUT', `${path}.timeoutMs`, `must be a positive number (${step.timeoutMs})`);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
for (const source of Object.keys(catalog.migrations ?? {})) {
|
|
112
|
+
if (stepIds.has(source)) {
|
|
113
|
+
add('ONB-MIGRATION-SOURCE-LIVE', `migrations.${source}`, 'the source id still exists — a rule for a live step would hijack it');
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
const seen = new Set([source]);
|
|
117
|
+
let target = (catalog.migrations)[source];
|
|
118
|
+
while (target !== undefined && !stepIds.has(target) && (catalog.migrations)[target] !== undefined) {
|
|
119
|
+
if (seen.has(target)) {
|
|
120
|
+
add('ONB-MIGRATION-CYCLE', `migrations.${source}`, `cycle through '${target}'`);
|
|
121
|
+
target = undefined;
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
seen.add(target);
|
|
125
|
+
target = (catalog.migrations)[target];
|
|
126
|
+
}
|
|
127
|
+
if (target !== undefined && !stepIds.has(target)) {
|
|
128
|
+
add('ONB-MIGRATION-TARGET', `migrations.${source}`, `resolves to '${target}', which is not a step of the catalog`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return findings;
|
|
132
|
+
}
|
|
133
|
+
/** Subscribe; returns the unsubscribe. A throwing listener is logged and isolated — it never breaks the runtime. */
|
|
134
|
+
onEvent(listener) {
|
|
135
|
+
this.listeners.push(listener);
|
|
136
|
+
return () => {
|
|
137
|
+
const index = this.listeners.indexOf(listener);
|
|
138
|
+
if (index >= 0) {
|
|
139
|
+
this.listeners.splice(index, 1);
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
getStatus() {
|
|
144
|
+
return this.status;
|
|
145
|
+
}
|
|
146
|
+
/** Where the player is; `null` unless active. */
|
|
147
|
+
position() {
|
|
148
|
+
if (this.status !== 'active' || this.currentIndex < 0) {
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
const current = this.steps[this.currentIndex];
|
|
152
|
+
const chapterSteps = this.steps
|
|
153
|
+
.filter((s) => s.chapterIndex === current.chapterIndex);
|
|
154
|
+
return {
|
|
155
|
+
chapterId: current.chapterId,
|
|
156
|
+
chapterIndex: current.chapterIndex,
|
|
157
|
+
chapterCount: this.chapterCount,
|
|
158
|
+
step: current.step,
|
|
159
|
+
stepIndexInChapter: chapterSteps.indexOf(current),
|
|
160
|
+
chapterStepCount: chapterSteps.length,
|
|
161
|
+
doneCount: this.completed.size + this.skipped.size,
|
|
162
|
+
totalCount: this.steps.length,
|
|
163
|
+
manual: !current.step.completion,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
/** Starts a not-yet-started onboarding at its first step (no-op otherwise — a finished one is `restart`ed). */
|
|
167
|
+
async start(context) {
|
|
168
|
+
if (this.status !== 'not-started') {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
this.status = 'active';
|
|
172
|
+
await this.transition(async () => this.enter(0, context, true, false));
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* One check of the active step: state regression → fallback · completion → next step · timeout → recorded and left.
|
|
176
|
+
* Call it from whatever drives the game (tick, state event); it never waits by itself.
|
|
177
|
+
*/
|
|
178
|
+
async evaluate(context) {
|
|
179
|
+
if (this.status !== 'active' || this.transitioning) {
|
|
180
|
+
return this.status === 'active' ? 'waiting' : 'inactive';
|
|
181
|
+
}
|
|
182
|
+
this.assertResumed();
|
|
183
|
+
const step = this.steps[this.currentIndex].step;
|
|
184
|
+
if (step.stateValidator && !this.predicate(step.stateValidator, context, step.stepId)) {
|
|
185
|
+
const visited = new Set([step.stepId]);
|
|
186
|
+
for (const fallbackId of step.fallbackStepIds ?? []) {
|
|
187
|
+
if (visited.has(fallbackId)) {
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
visited.add(fallbackId);
|
|
191
|
+
const index = this.indexOf(fallbackId);
|
|
192
|
+
const fallback = this.steps[index].step;
|
|
193
|
+
if (fallback.stateValidator && !this.predicate(fallback.stateValidator, context, fallback.stepId)) {
|
|
194
|
+
continue;
|
|
195
|
+
}
|
|
196
|
+
// Everything from the fallback on has to be done again.
|
|
197
|
+
for (let i = index; i <= Math.max(index, this.currentIndex); i++) {
|
|
198
|
+
this.completed.delete(this.steps[i].step.stepId);
|
|
199
|
+
this.skipped.delete(this.steps[i].step.stepId);
|
|
200
|
+
}
|
|
201
|
+
this.emit({ type: 'regressed', stepId: fallbackId, fromStepId: step.stepId, chapterId: this.steps[index].chapterId });
|
|
202
|
+
await this.transition(async () => this.enter(index, context, true, false));
|
|
203
|
+
return 'regressed';
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
if (step.completion && this.predicate(step.completion, context, step.stepId)) {
|
|
207
|
+
await this.transition(async () => this.leave('completed', context));
|
|
208
|
+
return 'advanced';
|
|
209
|
+
}
|
|
210
|
+
if (step.timeoutMs !== undefined && this.now() - this.enteredAtMs >= step.timeoutMs) {
|
|
211
|
+
await this.transition(async () => this.leave('timed-out', context));
|
|
212
|
+
return 'timed-out';
|
|
213
|
+
}
|
|
214
|
+
return 'waiting';
|
|
215
|
+
}
|
|
216
|
+
/** The player acknowledges a MANUAL step (no completion predicate); a gameplay step throws `DYFM-ONBOARDING-NOT-MANUAL`. */
|
|
217
|
+
async next(context) {
|
|
218
|
+
const step = this.activeStep('next');
|
|
219
|
+
if (step.completion) {
|
|
220
|
+
throw new error_control_model_1.DyFM_Error({
|
|
221
|
+
message: `DyFM_GuidedOnboarding: step '${step.stepId}' completes by '${step.completion.name}', not by "Next" — use skip('step') to leave it`,
|
|
222
|
+
errorCode: 'DYFM-ONBOARDING-NOT-MANUAL',
|
|
223
|
+
issuerService: ISSUER,
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
await this.transition(async () => this.leave('completed', context));
|
|
227
|
+
}
|
|
228
|
+
/** Skip the active step, the rest of its chapter, or the whole onboarding. */
|
|
229
|
+
async skip(context, scope) {
|
|
230
|
+
const step = this.activeStep('skip');
|
|
231
|
+
if (scope === 'all') {
|
|
232
|
+
this.status = 'skipped';
|
|
233
|
+
this.currentIndex = -1;
|
|
234
|
+
this.emit({ type: 'skipped', stepId: step.stepId });
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
if (scope === 'chapter') {
|
|
238
|
+
const chapterIndex = this.steps[this.currentIndex].chapterIndex;
|
|
239
|
+
for (let i = this.currentIndex + 1; i < this.steps.length && this.steps[i].chapterIndex === chapterIndex; i++) {
|
|
240
|
+
const id = this.steps[i].step.stepId;
|
|
241
|
+
if (!this.completed.has(id) && !this.skipped.has(id)) {
|
|
242
|
+
this.skipped.add(id);
|
|
243
|
+
this.emit({ type: 'step-skipped', stepId: id, chapterId: this.steps[i].chapterId });
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
await this.transition(async () => this.leave('skipped', context));
|
|
248
|
+
}
|
|
249
|
+
/** Start over — all of it, or from a chapter on (earlier chapters keep their progress). */
|
|
250
|
+
async restart(context, fromChapterId) {
|
|
251
|
+
const from = fromChapterId === undefined
|
|
252
|
+
? 0
|
|
253
|
+
: this.steps.findIndex((s) => s.chapterId === fromChapterId);
|
|
254
|
+
if (from < 0) {
|
|
255
|
+
throw new error_control_model_1.DyFM_Error({
|
|
256
|
+
message: `DyFM_GuidedOnboarding: restart from unknown chapter '${fromChapterId}'`,
|
|
257
|
+
errorCode: 'DYFM-ONBOARDING-UNKNOWN-CHAPTER',
|
|
258
|
+
issuerService: ISSUER,
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
for (let i = from; i < this.steps.length; i++) {
|
|
262
|
+
this.completed.delete(this.steps[i].step.stepId);
|
|
263
|
+
this.skipped.delete(this.steps[i].step.stepId);
|
|
264
|
+
}
|
|
265
|
+
this.status = 'active';
|
|
266
|
+
this.pendingResume = false;
|
|
267
|
+
this.emit({ type: 'restarted', chapterId: this.steps[from].chapterId });
|
|
268
|
+
await this.transition(async () => this.enter(from, context, true, false));
|
|
269
|
+
}
|
|
270
|
+
/** The progress as data (`dyfm-onboarding/1`); ids in catalog order, so two equal states serialise identically. */
|
|
271
|
+
exportState() {
|
|
272
|
+
const inOrder = (set) => this.steps
|
|
273
|
+
.map((s) => s.step.stepId).filter((id) => set.has(id));
|
|
274
|
+
const state = {
|
|
275
|
+
schema: 'dyfm-onboarding/1',
|
|
276
|
+
catalogVersion: this.catalog.catalogVersion,
|
|
277
|
+
status: this.status,
|
|
278
|
+
completedStepIds: inOrder(this.completed),
|
|
279
|
+
skippedStepIds: inOrder(this.skipped),
|
|
280
|
+
};
|
|
281
|
+
if (this.status === 'active' && this.currentIndex >= 0) {
|
|
282
|
+
state.stepId = this.steps[this.currentIndex].step.stepId;
|
|
283
|
+
}
|
|
284
|
+
return state;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Restores a save onto THIS catalog: ids are rewritten by the migration rules, vanished ids are dropped, and an
|
|
288
|
+
* active step that no longer exists (or is already done) continues at the first unfinished step. No command runs —
|
|
289
|
+
* an active onboarding must be `resume`d, and until then `evaluate` / `next` / `skip` throw
|
|
290
|
+
* `DYFM-ONBOARDING-NOT-RESUMED` (a forgotten resume would otherwise leave the player stuck, silently).
|
|
291
|
+
*/
|
|
292
|
+
importState(state) {
|
|
293
|
+
if (!state || state.schema !== 'dyfm-onboarding/1'
|
|
294
|
+
|| !['not-started', 'active', 'completed', 'skipped'].includes(state.status)
|
|
295
|
+
|| !Array.isArray(state.completedStepIds) || !Array.isArray(state.skippedStepIds)) {
|
|
296
|
+
throw new error_control_model_1.DyFM_Error({
|
|
297
|
+
message: `DyFM_GuidedOnboarding: not a 'dyfm-onboarding/1' state (schema: ${String(state?.schema)}, status: ${String(state?.status)})`,
|
|
298
|
+
errorCode: 'DYFM-ONBOARDING-STATE',
|
|
299
|
+
issuerService: ISSUER,
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
const report = { migrated: state.catalogVersion !== this.catalog.catalogVersion, renamed: {}, dropped: [] };
|
|
303
|
+
const resolve = (id) => {
|
|
304
|
+
let current = id;
|
|
305
|
+
for (let hops = 0; this.indexOf(current, false) < 0; hops++) {
|
|
306
|
+
const next = this.catalog.migrations?.[current];
|
|
307
|
+
if (next === undefined || hops > this.steps.length) {
|
|
308
|
+
if (!report.dropped.includes(id)) {
|
|
309
|
+
report.dropped.push(id);
|
|
310
|
+
}
|
|
311
|
+
return undefined;
|
|
312
|
+
}
|
|
313
|
+
current = next;
|
|
314
|
+
}
|
|
315
|
+
if (current !== id) {
|
|
316
|
+
report.renamed[id] = current;
|
|
317
|
+
}
|
|
318
|
+
return current;
|
|
319
|
+
};
|
|
320
|
+
this.completed.clear();
|
|
321
|
+
this.skipped.clear();
|
|
322
|
+
state.completedStepIds.forEach((id) => {
|
|
323
|
+
const resolved = resolve(id);
|
|
324
|
+
if (resolved) {
|
|
325
|
+
this.completed.add(resolved);
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
state.skippedStepIds.forEach((id) => {
|
|
329
|
+
const resolved = resolve(id);
|
|
330
|
+
if (resolved && !this.completed.has(resolved)) {
|
|
331
|
+
this.skipped.add(resolved);
|
|
332
|
+
}
|
|
333
|
+
});
|
|
334
|
+
this.status = state.status;
|
|
335
|
+
this.currentIndex = -1;
|
|
336
|
+
this.pendingResume = false;
|
|
337
|
+
if (state.status === 'active') {
|
|
338
|
+
const resolved = state.stepId === undefined ? undefined : resolve(state.stepId);
|
|
339
|
+
let index = resolved === undefined ? -1 : this.indexOf(resolved);
|
|
340
|
+
if (index < 0 || this.isDone(index)) {
|
|
341
|
+
index = this.steps.findIndex((s, i) => !this.isDone(i));
|
|
342
|
+
if (index >= 0) {
|
|
343
|
+
report.resumedAt = this.steps[index].step.stepId;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
if (index < 0) {
|
|
347
|
+
this.status = 'completed';
|
|
348
|
+
}
|
|
349
|
+
else {
|
|
350
|
+
this.currentIndex = index;
|
|
351
|
+
this.pendingResume = true;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
report.migrated = report.migrated || Object.keys(report.renamed).length > 0 || report.dropped.length > 0
|
|
355
|
+
|| report.resumedAt !== undefined;
|
|
356
|
+
return report;
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Enters the restored step after `importState`. Its command is NOT run again by default (it already ran before the
|
|
360
|
+
* save — e.g. placing a building twice would corrupt the game); pass `rerunCommand` for idempotent commands.
|
|
361
|
+
*/
|
|
362
|
+
async resume(context, options = {}) {
|
|
363
|
+
if (!this.pendingResume) {
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
this.pendingResume = false;
|
|
367
|
+
await this.transition(async () => this.enter(this.currentIndex, context, options.rerunCommand === true, true));
|
|
368
|
+
}
|
|
369
|
+
/** Leaves the active step (completed / skipped / timed out) and enters the next unfinished one — or finishes. */
|
|
370
|
+
async leave(how, context) {
|
|
371
|
+
const from = this.steps[this.currentIndex];
|
|
372
|
+
if (how === 'completed') {
|
|
373
|
+
this.completed.add(from.step.stepId);
|
|
374
|
+
this.emit({ type: 'step-completed', stepId: from.step.stepId, chapterId: from.chapterId });
|
|
375
|
+
}
|
|
376
|
+
else {
|
|
377
|
+
// A timed-out step is recorded as skipped: the player is not sent back into it on resume.
|
|
378
|
+
this.skipped.add(from.step.stepId);
|
|
379
|
+
this.emit({ type: how === 'skipped' ? 'step-skipped' : 'step-timed-out', stepId: from.step.stepId, chapterId: from.chapterId });
|
|
380
|
+
}
|
|
381
|
+
let next = -1;
|
|
382
|
+
for (let i = this.currentIndex + 1; i < this.steps.length; i++) {
|
|
383
|
+
if (!this.isDone(i)) {
|
|
384
|
+
next = i;
|
|
385
|
+
break;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
if (next < 0 || this.steps[next].chapterIndex !== from.chapterIndex) {
|
|
389
|
+
const chapterDone = this.steps
|
|
390
|
+
.filter((s) => s.chapterIndex === from.chapterIndex)
|
|
391
|
+
.every((s) => this.completed.has(s.step.stepId));
|
|
392
|
+
if (chapterDone) {
|
|
393
|
+
this.emit({ type: 'chapter-completed', chapterId: from.chapterId });
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
if (next < 0) {
|
|
397
|
+
this.status = 'completed';
|
|
398
|
+
this.currentIndex = -1;
|
|
399
|
+
this.emit({ type: 'completed' });
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
await this.enter(next, context, true, false);
|
|
403
|
+
}
|
|
404
|
+
/** Makes `index` the active step; runs its command (a failing command is reported and the step stays active). */
|
|
405
|
+
async enter(index, context, runCommand, resumed) {
|
|
406
|
+
const entry = this.steps[index];
|
|
407
|
+
this.currentIndex = index;
|
|
408
|
+
this.enteredAtMs = this.now();
|
|
409
|
+
this.emit(resumed
|
|
410
|
+
? { type: 'step-entered', stepId: entry.step.stepId, chapterId: entry.chapterId, resumed: true }
|
|
411
|
+
: { type: 'step-entered', stepId: entry.step.stepId, chapterId: entry.chapterId });
|
|
412
|
+
if (runCommand && entry.step.command) {
|
|
413
|
+
try {
|
|
414
|
+
await this.capabilities.commands[entry.step.command.name](context, entry.step.command.args);
|
|
415
|
+
}
|
|
416
|
+
catch (error) {
|
|
417
|
+
this.emit({ type: 'command-failed', stepId: entry.step.stepId, chapterId: entry.chapterId, error: error });
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
/** Evaluates a predicate; a throwing one becomes a debuggable `DYFM-ONBOARDING-PREDICATE` (step + predicate named). */
|
|
422
|
+
predicate(ref, context, stepId) {
|
|
423
|
+
try {
|
|
424
|
+
return this.capabilities.predicates[ref.name](context, ref.args) === true;
|
|
425
|
+
}
|
|
426
|
+
catch (error) {
|
|
427
|
+
throw new error_control_model_1.DyFM_Error({
|
|
428
|
+
message: `DyFM_GuidedOnboarding: predicate '${ref.name}' of step '${stepId}' threw`,
|
|
429
|
+
errorCode: 'DYFM-ONBOARDING-PREDICATE',
|
|
430
|
+
issuerService: ISSUER,
|
|
431
|
+
error: error,
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
async transition(run) {
|
|
436
|
+
this.transitioning = true;
|
|
437
|
+
try {
|
|
438
|
+
await run();
|
|
439
|
+
}
|
|
440
|
+
finally {
|
|
441
|
+
this.transitioning = false;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
activeStep(operation) {
|
|
445
|
+
if (this.status !== 'active' || this.currentIndex < 0) {
|
|
446
|
+
throw new error_control_model_1.DyFM_Error({
|
|
447
|
+
message: `DyFM_GuidedOnboarding: '${operation}' needs an active onboarding (status: ${this.status})`,
|
|
448
|
+
errorCode: 'DYFM-ONBOARDING-INACTIVE',
|
|
449
|
+
issuerService: ISSUER,
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
this.assertResumed();
|
|
453
|
+
return this.steps[this.currentIndex].step;
|
|
454
|
+
}
|
|
455
|
+
assertResumed() {
|
|
456
|
+
if (this.pendingResume) {
|
|
457
|
+
throw new error_control_model_1.DyFM_Error({
|
|
458
|
+
message: 'DyFM_GuidedOnboarding: the imported onboarding is active but not resumed — call resume(context) first',
|
|
459
|
+
errorCode: 'DYFM-ONBOARDING-NOT-RESUMED',
|
|
460
|
+
issuerService: ISSUER,
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
isDone(index) {
|
|
465
|
+
const id = this.steps[index].step.stepId;
|
|
466
|
+
return this.completed.has(id) || this.skipped.has(id);
|
|
467
|
+
}
|
|
468
|
+
indexOf(stepId, required = true) {
|
|
469
|
+
const index = this.steps.findIndex((s) => s.step.stepId === stepId);
|
|
470
|
+
if (index < 0 && required) {
|
|
471
|
+
throw new error_control_model_1.DyFM_Error({
|
|
472
|
+
message: `DyFM_GuidedOnboarding: unknown step '${stepId}'`,
|
|
473
|
+
errorCode: 'DYFM-ONBOARDING-UNKNOWN-STEP',
|
|
474
|
+
issuerService: ISSUER,
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
return index;
|
|
478
|
+
}
|
|
479
|
+
emit(event) {
|
|
480
|
+
for (const listener of [...this.listeners]) {
|
|
481
|
+
try {
|
|
482
|
+
listener(event);
|
|
483
|
+
}
|
|
484
|
+
catch (error) {
|
|
485
|
+
log_util_1.DyFM_Log.error(`${ISSUER}: an onEvent listener threw on '${event.type}'`, error);
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
exports.DyFM_GuidedOnboarding_ControlModel = DyFM_GuidedOnboarding_ControlModel;
|
|
491
|
+
//# sourceMappingURL=guided-onboarding.control-model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guided-onboarding.control-model.js","sourceRoot":"","sources":["../../../../src/_modules/game/_models/guided-onboarding.control-model.ts"],"names":[],"mappings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