@joplo-app/core 0.5.0 → 0.6.1
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/dist/agent-skill.d.ts +7 -7
- package/dist/agent-skill.js +29 -25
- package/dist/authoring-works.d.ts +8 -0
- package/dist/authoring-works.js +46 -0
- package/dist/catalog.d.ts +2 -0
- package/dist/compile.d.ts +6 -3
- package/dist/compile.js +415 -340
- package/dist/content-i18n.js +9 -9
- package/dist/embed.d.ts +5 -5
- package/dist/embed.js +7 -7
- package/dist/entries.d.ts +63 -0
- package/dist/entries.js +78 -0
- package/dist/feature-diff.d.ts +7 -7
- package/dist/feature-diff.js +18 -17
- package/dist/features.d.ts +3 -3
- package/dist/features.js +3 -3
- package/dist/focus-check.js +2 -2
- package/dist/focus.d.ts +1 -5
- package/dist/focus.js +13 -35
- package/dist/guide.js +157 -67
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/load.js +42 -11
- package/dist/local-review-files.js +17 -4
- package/dist/local-review.d.ts +8 -7
- package/dist/local-review.js +7 -6
- package/dist/outline.d.ts +21 -13
- package/dist/outline.js +27 -32
- package/dist/pace.d.ts +3 -4
- package/dist/pace.js +3 -4
- package/dist/playback.d.ts +57 -0
- package/dist/playback.js +317 -0
- package/dist/player.d.ts +9 -195
- package/dist/player.js +8 -633
- package/dist/playground.d.ts +1 -1
- package/dist/playground.js +4 -4
- package/dist/plugins/compiler.d.ts +16 -0
- package/dist/plugins/compiler.js +48 -9
- package/dist/presentation.d.ts +73 -0
- package/dist/presentation.js +163 -0
- package/dist/publication.d.ts +8 -0
- package/dist/publication.js +45 -0
- package/dist/result.d.ts +1 -1
- package/dist/review.d.ts +18 -10
- package/dist/review.js +62 -23
- package/dist/runtime.d.ts +2 -0
- package/dist/runtime.js +2 -0
- package/dist/scene-query.d.ts +77 -0
- package/dist/scene-query.js +246 -0
- package/dist/schema-issues.js +1 -1
- package/dist/schema.d.ts +108 -76
- package/dist/schema.js +48 -36
- package/dist/scope.d.ts +9 -9
- package/dist/scope.js +82 -49
- package/dist/selection.d.ts +1 -1
- package/dist/sequencing.d.ts +6 -0
- package/dist/sequencing.js +21 -0
- package/dist/step-plan.d.ts +55 -0
- package/dist/step-plan.js +90 -0
- package/dist/traits.d.ts +10 -0
- package/dist/traits.js +3 -0
- package/dist/validate.d.ts +1 -1
- package/dist/validate.js +75 -65
- package/dist/voice.js +2 -1
- package/package.json +15 -3
package/dist/validate.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { pluginSpec } from "./catalog.js";
|
|
2
|
-
import {
|
|
2
|
+
import { entryOf, playSequence, scenariosOf } from "./entries.js";
|
|
3
|
+
import { featuresOf } from "./features.js";
|
|
3
4
|
import { Project } from "./schema.js";
|
|
4
5
|
import { CAPTION_MAX, CARD_POINTS_MAX, DESCRIPTION_MAX, EXPLAIN_MAX, SAY_MAX, isInteractiveType, SCENARIO_MS_MAX, captionLength } from "./catalog.js";
|
|
5
6
|
import { scenarioEstimateMs } from "./outline.js";
|
|
@@ -36,48 +37,56 @@ export function validate(project, opts = { mode: 'all' }) {
|
|
|
36
37
|
return report();
|
|
37
38
|
}
|
|
38
39
|
const p = parsed.data;
|
|
39
|
-
if (opts.
|
|
40
|
-
throw new JoploError('USAGE', `
|
|
41
|
-
const
|
|
42
|
-
const included = (
|
|
43
|
-
const scenarios = Object.values(p.scenarios).filter(s => included(s.
|
|
40
|
+
if (opts.workId && !Object.hasOwn(p.works, opts.workId))
|
|
41
|
+
throw new JoploError('USAGE', `Work does not exist: ${opts.workId}`);
|
|
42
|
+
const works = Object.values(p.works).filter(o => !opts.workId || o.id === opts.workId);
|
|
43
|
+
const included = (workId) => !opts.workId || !workId || workId === opts.workId;
|
|
44
|
+
const scenarios = Object.values(p.scenarios).filter(s => included(s.workId));
|
|
45
|
+
const chapterLabels = new Map();
|
|
46
|
+
for (const o of Object.values(p.works))
|
|
47
|
+
if (o.sequencing === 'linear') {
|
|
48
|
+
const sequence = playSequence(p, o.id);
|
|
49
|
+
const ids = new Set(sequence.map(s => s.id));
|
|
50
|
+
[...sequence, ...scenariosOf(p, o.id).filter(s => !ids.has(s.id))].forEach((s, i) => chapterLabels.set(s.id, `Chapter ${String(i + 1).padStart(2, '0')}`));
|
|
51
|
+
}
|
|
44
52
|
const ref = (ok, message, value, kind) => {
|
|
45
53
|
if (!ok)
|
|
46
|
-
emit('error', 'INVALID_REFERENCE', message, value.source, { kind, id: value.id,
|
|
54
|
+
emit('error', 'INVALID_REFERENCE', message, value.source, { kind, id: value.id, workId: value.workId }, 'reference');
|
|
47
55
|
};
|
|
48
|
-
for (const o of
|
|
56
|
+
for (const o of works)
|
|
49
57
|
verification[o.id] = 'unchecked';
|
|
50
58
|
if (opts.mode !== 'replay') {
|
|
51
|
-
for (const [kind, table] of Object.entries({ feature: p.features, case: p.cases,
|
|
59
|
+
for (const [kind, table] of Object.entries({ feature: p.features, case: p.cases, work: p.works, rule: p.rules, scenario: p.scenarios, issue: p.issues })) {
|
|
52
60
|
for (const [id, value] of Object.entries(table)) {
|
|
53
|
-
const
|
|
54
|
-
if (included(
|
|
55
|
-
ref(id === value.id, `Record key ${id} does not match object ID ${value.id}`, { ...value,
|
|
61
|
+
const workId = 'workId' in value ? value.workId : kind === 'work' ? id : undefined;
|
|
62
|
+
if (included(workId))
|
|
63
|
+
ref(id === value.id, `Record key ${id} does not match object ID ${value.id}`, { ...value, workId }, kind);
|
|
56
64
|
}
|
|
57
65
|
}
|
|
58
|
-
for (const c of Object.values(p.cases).filter(c => !opts.
|
|
66
|
+
for (const c of Object.values(p.cases).filter(c => !opts.workId || c.featureId === p.works[opts.workId]?.featureId)) {
|
|
59
67
|
ref(p.features[c.featureId]?.caseIds.includes(c.id), `Case feature does not exist or does not list the case: ${c.featureId}`, c, 'case');
|
|
60
68
|
}
|
|
61
|
-
for (const f of
|
|
69
|
+
for (const f of featuresOf(p).filter(f => !opts.workId || f.workIds.includes(opts.workId))) {
|
|
62
70
|
for (const id of f.caseIds)
|
|
63
71
|
ref(p.cases[id]?.featureId === f.id, `Feature case is missing or belongs to another feature: ${id}`, f, 'feature');
|
|
64
|
-
for (const id of f.
|
|
65
|
-
ref(p.
|
|
72
|
+
for (const id of f.workIds)
|
|
73
|
+
ref(p.works[id]?.featureId === f.id, `Feature work is missing or belongs to another feature: ${id}`, f, 'feature');
|
|
66
74
|
if (f.pick)
|
|
67
|
-
ref(p.
|
|
75
|
+
ref(p.works[f.pick]?.featureId === f.id, `Picked work is missing or belongs to another feature: ${f.pick}`, f, 'feature');
|
|
68
76
|
}
|
|
69
|
-
for (const o of
|
|
70
|
-
const value = { ...o,
|
|
71
|
-
|
|
77
|
+
for (const o of works) {
|
|
78
|
+
const value = { ...o, workId: o.id };
|
|
79
|
+
if (o.featureId)
|
|
80
|
+
ref(p.features[o.featureId]?.workIds.includes(o.id), `Work feature does not exist or does not list the work: ${o.featureId}`, value, 'work');
|
|
72
81
|
const cases = Object.values(p.cases).filter(c => c.featureId === o.featureId);
|
|
73
82
|
for (const c of cases)
|
|
74
|
-
if (!o.coverage[c.id])
|
|
75
|
-
emit('warning', 'CASE_NOT_COVERED', `Case has no coverage: ${c.id} ${c.title}`, o.source, { kind: 'case', id: c.id,
|
|
76
|
-
for (const [id, c] of Object.entries(o.coverage)) {
|
|
77
|
-
const r = { kind: 'case', id,
|
|
78
|
-
ref(p.cases[id]?.featureId === o.featureId, `coverage case is missing or belongs to another feature: ${id}`, value, '
|
|
83
|
+
if (!(o.featureId ? p.features[o.featureId]?.alternatives[o.id]?.coverage ?? {} : {})[c.id])
|
|
84
|
+
emit('warning', 'CASE_NOT_COVERED', `Case has no coverage: ${c.id} ${c.title}`, o.source, { kind: 'case', id: c.id, workId: o.id });
|
|
85
|
+
for (const [id, c] of Object.entries((o.featureId ? p.features[o.featureId]?.alternatives[o.id]?.coverage ?? {} : {}))) {
|
|
86
|
+
const r = { kind: 'case', id, workId: o.id };
|
|
87
|
+
ref(p.cases[id]?.featureId === o.featureId, `coverage case is missing or belongs to another feature: ${id}`, value, 'work');
|
|
79
88
|
for (const sid of c.scenarioIds)
|
|
80
|
-
ref(p.scenarios[sid]?.
|
|
89
|
+
ref(p.scenarios[sid]?.workId === o.id, `coverage scenario is missing or belongs to another work: ${sid}`, value, 'work');
|
|
81
90
|
if (c.status === 'expressed' && !c.scenarioIds.length)
|
|
82
91
|
emit('warning', 'EXPRESSED_WITHOUT_SCENARIO', `Covered case has no scenario: ${id}`, o.source, r);
|
|
83
92
|
if (['not_applicable', 'excluded'].includes(c.status) && !c.reason?.trim())
|
|
@@ -87,26 +96,26 @@ export function validate(project, opts = { mode: 'all' }) {
|
|
|
87
96
|
}
|
|
88
97
|
}
|
|
89
98
|
// 只有顺利路径(D67,Joplo 要解决的“看不全”):功能只声明了 main 情况,而且参与的方案里每个场景都成功
|
|
90
|
-
for (const f of
|
|
91
|
-
const own = scenarios.filter(s => p.
|
|
99
|
+
for (const f of featuresOf(p).filter(f => !opts.workId || f.workIds.includes(opts.workId))) {
|
|
100
|
+
const own = scenarios.filter(s => p.works[s.workId]?.featureId === f.id);
|
|
92
101
|
const edge = f.caseIds.some(id => p.cases[id] && p.cases[id].dimension !== 'main');
|
|
93
|
-
if (p.mode === 'dev' && own.length && !edge && own.every(s => s.mock.outcome === 'success'))
|
|
102
|
+
if (entryOf(p, f.id)?.featureId !== null && p.mode === 'dev' && own.length && !edge && own.every(s => s.mock.outcome === 'success'))
|
|
94
103
|
emit('info', 'HAPPY_PATH_ONLY', `Feature "${f.name}" only shows the happy path: every case is a main-flow case and every scenario succeeds. Ask the user about input, permission, async, and lifecycle cases (npx joplo skill cases), then add at least one error-and-recovery scenario`, f.source, { kind: 'feature', id: f.id });
|
|
95
104
|
}
|
|
96
|
-
for (const r of Object.values(p.rules).filter(r => included(r.
|
|
105
|
+
for (const r of Object.values(p.rules).filter(r => included(r.workId) && (!opts.workId || r.featureId === p.works[opts.workId]?.featureId))) {
|
|
97
106
|
ref(p.features[r.featureId], `Rule feature does not exist: ${r.featureId}`, r, 'rule');
|
|
98
|
-
if (r.
|
|
99
|
-
ref(p.
|
|
107
|
+
if (r.workId)
|
|
108
|
+
ref(p.works[r.workId]?.featureId === r.featureId, `Rule work is missing or belongs to another feature: ${r.workId}`, r, 'rule');
|
|
100
109
|
for (const id of r.caseIds)
|
|
101
110
|
ref(p.cases[id]?.featureId === r.featureId, `Rule case is missing or belongs to another feature: ${id}`, r, 'rule');
|
|
102
|
-
const scenes = Object.values(p.scenes).filter(s => s.
|
|
111
|
+
const scenes = Object.values(p.scenes).filter(s => s.workId && (r.workId ? s.workId === r.workId : p.works[s.workId]?.featureId === r.featureId));
|
|
103
112
|
for (const id of r.elementIds)
|
|
104
113
|
if (!scenes.some(s => findNode(s, id)))
|
|
105
|
-
emit('warning', 'RULE_ELEMENT_NOT_FOUND', `Rule element is absent from every stage in the related
|
|
114
|
+
emit('warning', 'RULE_ELEMENT_NOT_FOUND', `Rule element is absent from every stage in the related works: ${id}`, r.source, { kind: 'rule', id: r.id, workId: r.workId });
|
|
106
115
|
if (r.origin === 'ai_assumption' && r.confirmation === 'pending')
|
|
107
|
-
emit('info', 'PENDING_AI_ASSUMPTION', r.text, r.source, { kind: 'rule', id: r.id,
|
|
116
|
+
emit('info', 'PENDING_AI_ASSUMPTION', r.text, r.source, { kind: 'rule', id: r.id, workId: r.workId });
|
|
108
117
|
if (r.origin === 'ai_assumption' && r.confirmation === 'confirmed')
|
|
109
|
-
emit('error', 'ASSUMPTION_CONFIRMED', 'An AI assumption cannot be Confirmed', r.source, { kind: 'rule', id: r.id,
|
|
118
|
+
emit('error', 'ASSUMPTION_CONFIRMED', 'An AI assumption cannot be Confirmed', r.source, { kind: 'rule', id: r.id, workId: r.workId });
|
|
110
119
|
}
|
|
111
120
|
// 从每个场景的路径和跳转追踪步骤目标;只按 id 全局匹配会误认其他页面的同名元素。
|
|
112
121
|
const identity = (n) => JSON.stringify([n.source ?? '', n.from ?? '', n.id]);
|
|
@@ -115,11 +124,11 @@ export function validate(project, opts = { mode: 'all' }) {
|
|
|
115
124
|
let sceneId = sc.initial.sceneId;
|
|
116
125
|
const stack = [];
|
|
117
126
|
// 有层级的方案(T-layers):步骤目标在各层自己的画面里(多层有同一个元素时都算绑定)
|
|
118
|
-
const layerScenes = Object.values(p.
|
|
127
|
+
const layerScenes = Object.values(p.works[sc.workId]?.layers ?? {}).map((l) => p.scenes[l.sceneId]).filter((x) => !!x);
|
|
119
128
|
for (const step of sc.steps) {
|
|
120
129
|
const s = p.scenes[sceneId];
|
|
121
130
|
const hit = s && 'target' in step.action ? findNode(s, step.action.target)?.node : undefined;
|
|
122
|
-
if (hit && (!hit.from || hit.from === sc.
|
|
131
|
+
if (hit && (!hit.from || hit.from === sc.workId))
|
|
123
132
|
bound.add(identity(hit));
|
|
124
133
|
if ('target' in step.action)
|
|
125
134
|
for (const ls of layerScenes) {
|
|
@@ -136,27 +145,27 @@ export function validate(project, opts = { mode: 'all' }) {
|
|
|
136
145
|
}
|
|
137
146
|
}
|
|
138
147
|
}
|
|
139
|
-
for (const
|
|
140
|
-
for (const reaction of Object.values(
|
|
148
|
+
for (const work of Object.values(p.works))
|
|
149
|
+
for (const reaction of Object.values(work.free ?? {})) {
|
|
141
150
|
if (!('target' in reaction.action))
|
|
142
151
|
continue;
|
|
143
|
-
for (const scene of Object.values(p.scenes).filter(s => s.
|
|
152
|
+
for (const scene of Object.values(p.scenes).filter(s => s.workId === work.id || s.workId === null)) {
|
|
144
153
|
const hit = findNode(scene, reaction.action.target)?.node;
|
|
145
|
-
if (hit && (!hit.from || hit.from ===
|
|
154
|
+
if (hit && (!hit.from || hit.from === work.id))
|
|
146
155
|
bound.add(identity(hit));
|
|
147
156
|
}
|
|
148
157
|
}
|
|
149
|
-
for (const s of Object.values(p.scenes).filter(s => included(s.
|
|
150
|
-
const value = { id: s.id,
|
|
158
|
+
for (const s of Object.values(p.scenes).filter(s => included(s.workId))) {
|
|
159
|
+
const value = { id: s.id, workId: s.workId ?? undefined, source: s.root.source ?? (s.workId ? p.works[s.workId]?.source : undefined) };
|
|
151
160
|
ref(p.scenes[s.id] === s, `Stage key does not match ID: ${s.id}`, value, 'scene');
|
|
152
|
-
if (s.
|
|
153
|
-
ref(p.
|
|
161
|
+
if (s.workId)
|
|
162
|
+
ref(p.works[s.workId], `Stage work does not exist: ${s.workId}`, value, 'scene');
|
|
154
163
|
ref(p.routes[s.route], `Stage route does not exist: ${s.route}`, value, 'scene');
|
|
155
164
|
const ids = new Set();
|
|
156
165
|
walkNodes(s.root, n => {
|
|
157
166
|
if (pluginSpec(p.plugins, n.type)?.needsId && n.id.startsWith('_'))
|
|
158
167
|
emit('error', 'MISSING_ID', `<${n.type}> requires an author id; recompile after adding id`, n.source, { kind: 'element', id: n.id });
|
|
159
|
-
const r = { kind: 'element', id: n.id,
|
|
168
|
+
const r = { kind: 'element', id: n.id, workId: n.from ?? s.workId ?? undefined };
|
|
160
169
|
if (ids.has(n.id))
|
|
161
170
|
emit('error', 'DUPLICATE_ELEMENT', `Duplicate element ID in stage: ${n.id}`, n.source, r, 'reference');
|
|
162
171
|
ids.add(n.id);
|
|
@@ -169,34 +178,35 @@ export function validate(project, opts = { mode: 'all' }) {
|
|
|
169
178
|
}
|
|
170
179
|
const stepIds = new Set();
|
|
171
180
|
for (const sc of scenarios) {
|
|
172
|
-
const o = p.
|
|
173
|
-
ref(o, `Scenario
|
|
174
|
-
ref(p.scenes[sc.initial.sceneId]?.
|
|
181
|
+
const o = p.works[sc.workId];
|
|
182
|
+
ref(o, `Scenario work does not exist: ${sc.workId}`, sc, 'scenario');
|
|
183
|
+
ref(p.scenes[sc.initial.sceneId]?.workId === sc.workId, `Scenario initial stage is missing or belongs to another work: ${sc.initial.sceneId}`, sc, 'scenario');
|
|
175
184
|
for (const id of sc.caseIds)
|
|
176
185
|
ref(p.cases[id]?.featureId === o?.featureId, `Scenario case is missing or belongs to another feature: ${id}`, sc, 'scenario');
|
|
177
|
-
const
|
|
186
|
+
const chapter = chapterLabels.get(sc.id);
|
|
187
|
+
const sr = { kind: 'scenario', id: sc.id, workId: sc.workId };
|
|
178
188
|
if (!sc.steps.length)
|
|
179
|
-
emit('info', 'EMPTY_SCENARIO', `Scenario has no steps: ${sc.name}`, sc.source, sr);
|
|
189
|
+
emit('info', 'EMPTY_SCENARIO', chapter ? `${chapter} has no steps: ${sc.name}` : `Scenario has no steps: ${sc.name}`, sc.source, sr);
|
|
180
190
|
// 叙事(D67):封面说明 30 字以内(D61);一个场景讲一件事,太长时拆开
|
|
181
191
|
const dl = captionLength(sc.description);
|
|
182
192
|
if (dl > DESCRIPTION_MAX)
|
|
183
|
-
emit('warning', 'DESCRIPTION_TOO_LONG', `flow description (the scenario cover text) is ${dl} units (recommended maximum: ${DESCRIPTION_MAX}; CJK characters count as 1 each, all others as 0.5): "${sc.description}". Say in one sentence what this scenario shows; the cover clips longer text`, sc.source, sr);
|
|
184
|
-
const ms = scenarioEstimateMs(sc);
|
|
193
|
+
emit('warning', 'DESCRIPTION_TOO_LONG', `${chapter ? `${chapter} description (the chapter cover text)` : 'flow description (the scenario cover text)'} is ${dl} units (recommended maximum: ${DESCRIPTION_MAX}; CJK characters count as 1 each, all others as 0.5): "${sc.description}". Say in one sentence what this ${chapter ? 'chapter' : 'scenario'} shows; the cover clips longer text`, sc.source, sr);
|
|
194
|
+
const ms = scenarioEstimateMs(p, sc);
|
|
185
195
|
if (ms > SCENARIO_MS_MAX)
|
|
186
|
-
emit('info', 'SCENARIO_TOO_LONG',
|
|
196
|
+
emit('info', 'SCENARIO_TOO_LONG', `${chapter ?? 'Scenario'} "${sc.name}" plays about ${Math.round(ms / 1000)} s at 1× (${sc.steps.length} steps; recommended maximum: ${SCENARIO_MS_MAX / 1000} s). ${chapter ? 'One chapter tells one thing: split it into chapters' : 'One scenario tells one thing: split it into scenarios (for example the happy path and each recovery)'}, or branch with fork(); run npx joplo outline to see the pacing`, sc.source, sr);
|
|
187
197
|
for (const st of sc.steps) {
|
|
188
|
-
const value = { ...st,
|
|
198
|
+
const value = { ...st, workId: sc.workId };
|
|
189
199
|
ref(!stepIds.has(st.id), `Duplicate step ID: ${st.id}`, value, 'step');
|
|
190
200
|
stepIds.add(st.id);
|
|
191
201
|
for (const id of st.ruleIds) {
|
|
192
202
|
const rule = p.rules[id];
|
|
193
|
-
ref(rule && rule.featureId === o?.featureId && (!rule.
|
|
203
|
+
ref(rule && rule.featureId === o?.featureId && (!rule.workId || rule.workId === sc.workId), `Step rule is missing or outside its scope: ${id}`, value, 'step');
|
|
194
204
|
}
|
|
195
205
|
for (const e of st.effects)
|
|
196
206
|
if (e.type === 'navigate')
|
|
197
|
-
ref(p.scenes[e.sceneId]?.
|
|
207
|
+
ref(p.scenes[e.sceneId]?.workId === sc.workId, `Navigation stage is missing or belongs to another work: ${e.sceneId}`, value, 'step');
|
|
198
208
|
// 字幕只用来点一句(只提示,不截断、不改写作者的文字);长内容放进单独的说明层,由导演切过去讲
|
|
199
|
-
const r = { kind: 'step', id: st.id,
|
|
209
|
+
const r = { kind: 'step', id: st.id, workId: sc.workId, stepId: st.id };
|
|
200
210
|
const at = st.source ?? sc.source;
|
|
201
211
|
const cl = captionLength(st.caption);
|
|
202
212
|
if (cl > CAPTION_MAX)
|
|
@@ -227,8 +237,8 @@ export function validate(project, opts = { mode: 'all' }) {
|
|
|
227
237
|
}
|
|
228
238
|
}
|
|
229
239
|
focusStructureDiagnostics(p, scenarios, emit); // 焦点提示(D70)
|
|
230
|
-
for (const o of
|
|
231
|
-
if (!diagnostics.some(d => d.severity === 'error' && (!d.ref?.
|
|
240
|
+
for (const o of works)
|
|
241
|
+
if (!diagnostics.some(d => d.severity === 'error' && (!d.ref?.workId || d.ref.workId === o.id)))
|
|
232
242
|
verification[o.id] = 'structure_ok';
|
|
233
243
|
}
|
|
234
244
|
if (opts.mode !== 'structure') {
|
|
@@ -238,13 +248,13 @@ export function validate(project, opts = { mode: 'all' }) {
|
|
|
238
248
|
if (!result.diagnostics.length)
|
|
239
249
|
focusReplayDiagnostics(p, sc, emit); // 焦点提示(D70)
|
|
240
250
|
for (const d of result.diagnostics) {
|
|
241
|
-
failed.add(sc.
|
|
251
|
+
failed.add(sc.workId);
|
|
242
252
|
const step = sc.steps.find(st => st.id === (d.ref?.stepId ?? d.ref?.id)) ?? (result.finalState ? sc.steps[result.reached] : undefined);
|
|
243
|
-
emit(d.severity, d.code, d.message, step?.source ?? sc.source ?? p.
|
|
253
|
+
emit(d.severity, d.code, d.message, step?.source ?? sc.source ?? p.works[sc.workId]?.source, { ...d.ref, kind: d.ref?.kind ?? 'scenario', id: d.ref?.id ?? sc.id, workId: sc.workId }, 'replay');
|
|
244
254
|
}
|
|
245
255
|
}
|
|
246
|
-
for (const o of
|
|
247
|
-
if (!failed.has(o.id) && scenarios.some(s => s.
|
|
256
|
+
for (const o of works)
|
|
257
|
+
if (!failed.has(o.id) && scenarios.some(s => s.workId === o.id) && (opts.mode === 'replay' || verification[o.id] === 'structure_ok'))
|
|
248
258
|
verification[o.id] = 'replay_ok';
|
|
249
259
|
}
|
|
250
260
|
return report();
|
package/dist/voice.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { rolesOf } from "./entries.js";
|
|
1
2
|
/**
|
|
2
3
|
* 朗读(D74)的纯函数:看板、发布站、服务端(生成与 build)共用。
|
|
3
4
|
*
|
|
@@ -51,7 +52,7 @@ export function speakerRoleAt(project, scenarioId, index) {
|
|
|
51
52
|
const step = project.scenarios[scenarioId]?.steps[index - 1];
|
|
52
53
|
// say(…, { role }) 写明了是谁(D100):任何步骤都以它为准(系统步骤没有“操作的人”)
|
|
53
54
|
if (step?.say && step.sayRole)
|
|
54
|
-
return step.sayRole;
|
|
55
|
+
return rolesOf(project, project.scenarios[scenarioId]?.workId).find(r => r.id === step.sayRole)?.id ?? null;
|
|
55
56
|
if (!step || step.kind !== 'user')
|
|
56
57
|
return null;
|
|
57
58
|
const layer = cameraAt(project, scenarioId, index).directorLayer;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@joplo-app/core",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Joplo
|
|
3
|
+
"version": "0.6.1",
|
|
4
|
+
"description": "Joplo 作品引擎:编译、校验与确定性播放,支持独立作品和功能方案评审",
|
|
5
5
|
"license": "PolyForm-Shield-1.0.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -17,13 +17,25 @@
|
|
|
17
17
|
"./runtime": {
|
|
18
18
|
"types": "./dist/runtime.d.ts",
|
|
19
19
|
"default": "./dist/runtime.js"
|
|
20
|
+
},
|
|
21
|
+
"./schema": {
|
|
22
|
+
"types": "./dist/schema.d.ts",
|
|
23
|
+
"default": "./dist/schema.js"
|
|
24
|
+
},
|
|
25
|
+
"./features": {
|
|
26
|
+
"types": "./dist/features.d.ts",
|
|
27
|
+
"default": "./dist/features.js"
|
|
28
|
+
},
|
|
29
|
+
"./catalog": {
|
|
30
|
+
"types": "./dist/catalog.d.ts",
|
|
31
|
+
"default": "./dist/catalog.js"
|
|
20
32
|
}
|
|
21
33
|
},
|
|
22
34
|
"files": [
|
|
23
35
|
"dist"
|
|
24
36
|
],
|
|
25
37
|
"dependencies": {
|
|
26
|
-
"@joplo-app/kit": "0.
|
|
38
|
+
"@joplo-app/kit": "0.6.1",
|
|
27
39
|
"zod": "4.6.7"
|
|
28
40
|
},
|
|
29
41
|
"engines": {
|