@joplo-app/core 0.7.3 → 0.8.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 +1 -1
- package/dist/agent-skill.js +6 -3
- package/dist/entries.js +53 -4
- package/dist/guide.js +9 -4
- package/dist/step-plan.js +15 -1
- package/package.json +2 -2
package/dist/agent-skill.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ export declare const MENTAL_MODEL: readonly ["Joplo shows are playable, interact
|
|
|
46
46
|
/** 推荐的起步顺序(X2:先做最小的一条正常流程 + 一条错误恢复流程,在看板里确认交互模型后再扩展)。 */
|
|
47
47
|
export declare const START_ORDER: readonly ["Choose the starting template: compare feature options with npx joplo init <dir> (or --template starter); make one show people can play, pause and try with npx joplo init <dir> --template work. Bare names select built-ins, never a same-named local directory; use --template ./work for a local folder. Names matching [a-z0-9][a-z0-9-]* select directories in the template repository default branch, without version tags. Init installs engine skills and AGENTS.md, preserving any bundled plugin guides; after installing dependencies run skill install.", "Read npx joplo skill authoring and choose the capabilities; for feature review read cases before asking the user about edge cases; demo and installed plugin skills as needed.", "Plan before coding (npx joplo skill story): audience, one to three points, one line per scenario (Given → When → Then, how it opens and ends; a case's expected is its Then); show the plan to the user. A demo is a story, not a feature tour.", "With minimal code, write one chapter for a standalone work, or one happy path and one error-and-recovery scenario for feature review.", "Run npx joplo check, then npx joplo dev; confirm typing, clicks, and layers really behave as intended in the board.", "Extend to every option and every case agreed with the user for feature review, or to the agreed chapters for a standalone work; run check until 0 errors.", "Required after every round of development: before handing off, read npx joplo skill review and start npx joplo feedback watch [dir] --local --follow --json in its own shell (joplo dev prints this exact command); only then give the user the board URL dev printed. Never hand off with only a URL, and never end your response without a running watcher (use --once below). While they test, read its output with short waits (about 1–5s) and acknowledge each feedback right away; do not wait for approval or process exit. If you end your response while they test, add --once so the watcher exits (and wakes a host that resumes on background exit) on the first event, then resume with --since. Receive and apply review results with the joplo-feedback skill."];
|
|
48
48
|
/** 最常见的坑:一句话 + 详细主题。 */
|
|
49
|
-
export declare const PITFALLS: readonly [readonly ["Finishing development is not the end: always start npx joplo feedback watch [dir] --local --follow --json (add --once if you will end your response) before you give the user the board URL, and keep receiving their feedback", "review"], readonly ["when takes a condition, not a boolean: when={eq($.ui.mode, 'code')}, never when={mode === 'code'}; for values known while writing use {flag && <X/>}", "authoring"], readonly ["Every interactive element needs a flow step, disabled={true} with disabledReason, or unmodeled; otherwise check warns UNBOUND_INTERACTIVE", "check"], readonly ["No onClick or other function props: behavior lives in flow steps (.click/.type/.select) and effects (set, push, go, done)", "authoring"], readonly ["Full-height layouts squeeze tables and forms: rows exist in the DOM but are cut off on screen; show 5–8 rows or move the table to its own layer", "demo"], readonly ["Deep links use short params ?o=&c=&s=&step=&l= (l is the layer key and pins that layer, so later steps stop switching layers; layer= is ignored); wait for rendering before screenshots", "demo"], readonly ["Rules you assume stay origin ai_assumption, status pending; never mark them confirmed for the user", "cases"], readonly ["CHOICE_REQUIRED (exit 2): ask both publishing questions; never fix it by silently adding --private --no-review, and do not reuse the previous invocation", "publish"], readonly ["Public portfolio work and the always-private review version are two separate links: give reviewers data.review.url, the audience data.url", "publish"], readonly ["Required: before every share, ask the user public or private AND whether to also publish a review version. Never choose for them or reuse a previous choice; CI must pin both flags in its workflow", "publish"], readonly ["Public shares enter the portfolio and search engines: write the project name, description, and feature goals and work summaries as search-result content; exclude unpublished information", "publish"], readonly ["Never invent or set an access password for the user: ask them to type it in their own terminal or set JOPLO_SHARE_PASSWORD; never put passwords in command history, files, or conversation summaries. Private Pro shares accept --password; omit both password flags to preserve protection", "publish"], readonly ["Never share or deploy without the user's go-ahead. Free links no longer expire, but every live share counts toward
|
|
49
|
+
export declare const PITFALLS: readonly [readonly ["Finishing development is not the end: always start npx joplo feedback watch [dir] --local --follow --json (add --once if you will end your response) before you give the user the board URL, and keep receiving their feedback", "review"], readonly ["when takes a condition, not a boolean: when={eq($.ui.mode, 'code')}, never when={mode === 'code'}; for values known while writing use {flag && <X/>}", "authoring"], readonly ["Every interactive element needs a flow step, disabled={true} with disabledReason, or unmodeled; otherwise check warns UNBOUND_INTERACTIVE", "check"], readonly ["No onClick or other function props: behavior lives in flow steps (.click/.type/.select) and effects (set, push, go, done)", "authoring"], readonly ["Full-height layouts squeeze tables and forms: rows exist in the DOM but are cut off on screen; show 5–8 rows or move the table to its own layer", "demo"], readonly ["Deep links use short params ?o=&c=&s=&step=&l= (l is the layer key and pins that layer, so later steps stop switching layers; layer= is ignored); wait for rendering before screenshots", "demo"], readonly ["Rules you assume stay origin ai_assumption, status pending; never mark them confirmed for the user", "cases"], readonly ["CHOICE_REQUIRED (exit 2): ask both publishing questions; never fix it by silently adding --private --no-review, and do not reuse the previous invocation", "publish"], readonly ["Public portfolio work and the always-private review version are two separate links: give reviewers data.review.url, the audience data.url", "publish"], readonly ["Required: before every share, ask the user public or private AND whether to also publish a review version. Never choose for them or reuse a previous choice; CI must pin both flags in its workflow", "publish"], readonly ["Public shares enter the portfolio and search engines: write the project name, description, and feature goals and work summaries as search-result content; exclude unpublished information", "publish"], readonly ["Never invent or set an access password for the user: ask them to type it in their own terminal or set JOPLO_SHARE_PASSWORD; never put passwords in command history, files, or conversation summaries. Private Pro shares accept --password; omit both password flags to preserve protection", "publish"], readonly ["Never share or deploy without the user's go-ahead. Free links no longer expire, but every live share counts toward account storage; on QUOTA_EXCEEDED (exit 6), report error.details and never auto-clean. share delete is only for an explicitly requested deletion: confirm interactively or require --yes in automation", "publish"], readonly ["Local board/voice management uses the running board's real API, not fake playback. Keep full provider keys out of output: voice key set reads hidden input or JOPLO_VOICE_KEY; key test may call the provider, and key delete/share delete/board remove need confirmation or --yes", "publish"], readonly ["Prepared narration/dialogue uses narrate(text, { audio: asset(...) }) or say(text, { role, audio: localResource(...) }); explicit audio never calls TTS or counts generation characters. Use hold('voice', { pad: 0.4 }) / hold('audio', ref) for measured-or-estimated audio dwell; check and outline identify the source; see demo before lining up tracks", "demo"], readonly ["Joplo Cloud narration spends the user's characters: run npx joplo voice --work <work-id> --dry-run (omit --work for all; --scenario follows continuing predecessors), inspect per-step details, use narrate(false) for silent steps, and tell them the estimate before a large batch; on TTS_QUOTA_EXCEEDED (exit 7) keep what was made, pass on error.details.usageUrl, and never retry in a loop or buy for them", "publish"], readonly ["AiHubMix, OpenAI-compatible gateways and custom HTTP voice providers are gone: VOICE_UNSUPPORTED means ask the user to switch to Joplo Cloud narration, OpenAI or ElevenLabs (old audio still plays and ships); never hand-edit ~/.joplo/voice/profiles.json", "publish"], readonly ["Playing a demo never generates Joplo Cloud narration (it would spend characters): steps without audio use the browser voice until the user clicks Generate missing audio or you run npx joplo voice with their go-ahead", "publish"], readonly ["Re-sharing with the default voice keeps valid local clips plus reusable published clips, even when their voices differ (automatic captions must still match current text in the clip language; stale audio is excluded); an old custom provider named cloud stays unsupported until the user explicitly chooses official Joplo Cloud (use voice.profile: 'Joplo Cloud' when config owns the selection)", "publish"], readonly ["HAPPY_PATH_ONLY applies only to feature review: for a standalone explainer use work() + chapter(), with no cases or uses(); do not invent failure scenarios", "check"], readonly ["Required for short films and explainers: static storyboards cannot show hard cuts or frozen pictures. Run npx joplo render <dir> --scenario-id <first chapter> --film --chain, fix every CUT and STILL it reports, and watch --video once before handing over (render supports --viewport/--no-frame, --crop and public --frames-out/--timeline; --video takes --width/--height, --voice, --clean and --srt for publishing; see joplo skill demo)", "demo"], readonly ["For multimodal stories, list assets and licenses first, prove one real asset in a playable chapter, then extend the batch within the agreed spending limit. Keep source claims separate from interpretations", "story"], readonly ["For generated binary assets, first look for CC0/public-domain material; use an enabled generation plugin for gaps. Run resources --dry-run before spending; check/build/render never generate paid artifacts. Commit outputs and metadata, keep keys local", "plugins"], readonly ["For background audio use a media plugin: enable it explicitly, read its skill, place play/stop in steps, and verify sound after a viewer gesture; local resource failures are warnings", "plugins"], readonly ["Collect reusable assets before drawing complex visuals; keep source URLs, authors, licenses and changes in assets/SOURCES.md, and verify bundled fonts and samples separately", "story"], readonly ["For audience exploration, use native UI controls or work.free; keep deterministic results in flow steps. Read demo before using drag, hover, scroll or plugin actions", "demo"], readonly ["Components outside the catalog may exist as plugins: install the npm package, add it to config({ plugins }), then read npx joplo skill <plugin id> before writing its components", "plugins"]];
|
|
50
50
|
export type AgentSkill = {
|
|
51
51
|
name: string;
|
|
52
52
|
description: string;
|
package/dist/agent-skill.js
CHANGED
|
@@ -52,7 +52,8 @@ export const PITFALLS = [
|
|
|
52
52
|
["Required: before every share, ask the user public or private AND whether to also publish a review version. Never choose for them or reuse a previous choice; CI must pin both flags in its workflow", "publish"],
|
|
53
53
|
["Public shares enter the portfolio and search engines: write the project name, description, and feature goals and work summaries as search-result content; exclude unpublished information", "publish"],
|
|
54
54
|
["Never invent or set an access password for the user: ask them to type it in their own terminal or set JOPLO_SHARE_PASSWORD; never put passwords in command history, files, or conversation summaries. Private Pro shares accept --password; omit both password flags to preserve protection", "publish"],
|
|
55
|
-
["Never share or deploy without the user's go-ahead. Free links no longer expire, but every live share counts toward
|
|
55
|
+
["Never share or deploy without the user's go-ahead. Free links no longer expire, but every live share counts toward account storage; on QUOTA_EXCEEDED (exit 6), report error.details and never auto-clean. share delete is only for an explicitly requested deletion: confirm interactively or require --yes in automation", "publish"],
|
|
56
|
+
["Local board/voice management uses the running board's real API, not fake playback. Keep full provider keys out of output: voice key set reads hidden input or JOPLO_VOICE_KEY; key test may call the provider, and key delete/share delete/board remove need confirmation or --yes", "publish"],
|
|
56
57
|
["Prepared narration/dialogue uses narrate(text, { audio: asset(...) }) or say(text, { role, audio: localResource(...) }); explicit audio never calls TTS or counts generation characters. Use hold('voice', { pad: 0.4 }) / hold('audio', ref) for measured-or-estimated audio dwell; check and outline identify the source; see demo before lining up tracks", "demo"],
|
|
57
58
|
["Joplo Cloud narration spends the user's characters: run npx joplo voice --work <work-id> --dry-run (omit --work for all; --scenario follows continuing predecessors), inspect per-step details, use narrate(false) for silent steps, and tell them the estimate before a large batch; on TTS_QUOTA_EXCEEDED (exit 7) keep what was made, pass on error.details.usageUrl, and never retry in a loop or buy for them", "publish"],
|
|
58
59
|
["AiHubMix, OpenAI-compatible gateways and custom HTTP voice providers are gone: VOICE_UNSUPPORTED means ask the user to switch to Joplo Cloud narration, OpenAI or ElevenLabs (old audio still plays and ships); never hand-edit ~/.joplo/voice/profiles.json", "publish"],
|
|
@@ -179,14 +180,16 @@ function feedbackBody() {
|
|
|
179
180
|
'```',
|
|
180
181
|
'- Use it to wait for one option version\'s approval (exit 0 only on approval, 1 if the round closes) or to resume a round from a cursor. Match projectDir, workId, instanceId and revision from list; if several match, choose explicitly instead of taking the newest.',
|
|
181
182
|
'- Source edits close that round: list again and attach to the new one with its own cursor. Never reuse an old cursor on a new session or delete review records to reset a round.',
|
|
183
|
+
'- For an explicitly requested scripted review action, feedback submit --local requires an exact work/scenario/position/body and feedback approve --local confirms that revision through the board API. The CLI does not pretend to know or control the reviewer\'s current browser position; approval never publishes.',
|
|
182
184
|
'',
|
|
183
|
-
'## Share review: poll
|
|
185
|
+
'## Share review: poll with a recoverable cursor',
|
|
184
186
|
'```sh',
|
|
185
187
|
'npx joplo feedback watch --share <share-id> --work <feature.option> --interval 15 --json',
|
|
186
188
|
'```',
|
|
187
189
|
'- Polling defaults to 15 seconds; --interval accepts 10–30. Pin --version <n> when the version is known; otherwise the first response sets it.',
|
|
188
190
|
'- Only the target version\'s owner pick ends this watcher. Votes, rule confirmations, other options, and older versions do not. A replaced share version emits closed and exits 1.',
|
|
189
|
-
'- Cloud returns
|
|
191
|
+
'- Cursor-capable Cloud returns persistent event pages. The CLI drains them before judging approval, so resolved comments and applied decisions are recovered and retracted picks do not approve. Each event carries cursor; resume with --cursor <last fully handled cursor> and deduplicate by eventId. Older Cloud falls back to snapshots and warns that resolved/applied records may be missed. Cloud never confirms a local session.',
|
|
192
|
+
'- Cloud writes need feedback:write: feedback comment/resolve, decide/retract, and vote (not approval). Always preserve expectedVersion; comments/votes also need the /review/<id> link id. On 409 reread instead of replaying blindly.',
|
|
190
193
|
'- To apply existing Cloud conclusions without watching, use npx joplo feedback --format json. It selects the review share from .joplo/cloud.json, else the main share; --share <id> selects another, including scoped shares. data.decisions and data.comments are separate.',
|
|
191
194
|
'',
|
|
192
195
|
'## Apply conclusions when requested',
|
package/dist/entries.js
CHANGED
|
@@ -1,7 +1,26 @@
|
|
|
1
1
|
/** 首页条目:外部只读此投影,作品可独立存在或挂在功能下面。 */
|
|
2
2
|
import { scenarioPlanMs } from "./step-plan.js";
|
|
3
|
+
const scenariosByWorkCache = new WeakMap();
|
|
4
|
+
function scenariosIndex(scenarios) {
|
|
5
|
+
const keys = Object.keys(scenarios);
|
|
6
|
+
const cached = scenariosByWorkCache.get(scenarios);
|
|
7
|
+
if (cached && cached.count === keys.length)
|
|
8
|
+
return cached.map;
|
|
9
|
+
const map = new Map();
|
|
10
|
+
for (const k of keys) {
|
|
11
|
+
const s = scenarios[k];
|
|
12
|
+
let list = map.get(s.workId);
|
|
13
|
+
if (!list) {
|
|
14
|
+
list = [];
|
|
15
|
+
map.set(s.workId, list);
|
|
16
|
+
}
|
|
17
|
+
list.push(s);
|
|
18
|
+
}
|
|
19
|
+
scenariosByWorkCache.set(scenarios, { count: keys.length, map });
|
|
20
|
+
return map;
|
|
21
|
+
}
|
|
3
22
|
/** 某个方案的场景,按声明顺序。 */
|
|
4
|
-
export const scenariosOf = (project, workId) => workId ?
|
|
23
|
+
export const scenariosOf = (project, workId) => workId ? (scenariosIndex(project.scenarios).get(workId) ?? []).slice() : [];
|
|
5
24
|
/**
|
|
6
25
|
* 连续播放的顺序(D92 U2 / R9;看板、发布站、嵌入与录制 --chain 共用):按声明顺序取不接力的场景(根),每个根之后
|
|
7
26
|
* 深度优先接上 from 接力它的章(多章接同一章时按声明顺序)。autoplay: false 的场景连同接在它后面的章都不进顺序。
|
|
@@ -35,6 +54,7 @@ export function rolesOf(project, workId) {
|
|
|
35
54
|
}
|
|
36
55
|
/** 切片键只在此处由已知 workId 的长度计算;不拆 ID 推断归属。 */
|
|
37
56
|
export const sliceKey = (scenario) => scenario.id.slice(scenario.workId.length + 1);
|
|
57
|
+
const entryCache = new WeakMap();
|
|
38
58
|
/** 一个首页条目的投影。 */
|
|
39
59
|
export function entryOf(project, id) {
|
|
40
60
|
if (!id)
|
|
@@ -44,10 +64,20 @@ export function entryOf(project, id) {
|
|
|
44
64
|
if (!f && (!w || w.featureId))
|
|
45
65
|
return null;
|
|
46
66
|
const workId = f ? (f.pick && project.works[f.pick] ? f.pick : f.workIds.find(id => project.works[id])) ?? null : id;
|
|
67
|
+
const workScenarios = workId ? (scenariosIndex(project.scenarios).get(workId) ?? []) : [];
|
|
68
|
+
let byId = entryCache.get(project);
|
|
69
|
+
if (!byId) {
|
|
70
|
+
byId = new Map();
|
|
71
|
+
entryCache.set(project, byId);
|
|
72
|
+
}
|
|
73
|
+
const hit = byId.get(id);
|
|
74
|
+
if (hit && hit.pick === f?.pick && hit.workId === workId && hit.scenarioCount === workScenarios.length) {
|
|
75
|
+
return hit.entry;
|
|
76
|
+
}
|
|
47
77
|
const active = workId ? project.works[workId] : undefined;
|
|
48
78
|
const sequence = playSequence(project, workId);
|
|
49
79
|
const inSequence = new Set(sequence.map((s) => s.id));
|
|
50
|
-
const ordered = [...sequence, ...
|
|
80
|
+
const ordered = [...sequence, ...workScenarios.filter((s) => !inSequence.has(s.id))];
|
|
51
81
|
const slices = ordered.map((s) => ({
|
|
52
82
|
id: s.id,
|
|
53
83
|
key: sliceKey(s),
|
|
@@ -58,7 +88,7 @@ export function entryOf(project, id) {
|
|
|
58
88
|
inSequence: inSequence.has(s.id),
|
|
59
89
|
}));
|
|
60
90
|
const roles = (f ? f.roles : rolesOf(project, workId)).map((r) => r.name.trim()).filter(Boolean);
|
|
61
|
-
|
|
91
|
+
const entry = {
|
|
62
92
|
id,
|
|
63
93
|
featureId: f?.id ?? null,
|
|
64
94
|
sequencing: active?.sequencing ?? 'independent',
|
|
@@ -71,8 +101,27 @@ export function entryOf(project, id) {
|
|
|
71
101
|
slices,
|
|
72
102
|
ms: slices.reduce((sum, s) => sum + (s.inSequence ? s.ms : 0), 0),
|
|
73
103
|
};
|
|
104
|
+
byId.set(id, { pick: f?.pick, workId, scenarioCount: workScenarios.length, entry });
|
|
105
|
+
return entry;
|
|
74
106
|
}
|
|
107
|
+
const entriesListCache = new WeakMap();
|
|
75
108
|
/** 项目里的全部作品,按演示顺序(entryIds)。首页的卡片、看板顶栏的下拉、outline 都从这里取。 */
|
|
76
109
|
export function entriesOf(project) {
|
|
77
|
-
|
|
110
|
+
const cached = entriesListCache.get(project);
|
|
111
|
+
if (cached && cached.count === project.entryIds.length) {
|
|
112
|
+
let valid = true;
|
|
113
|
+
for (let i = 0; i < project.entryIds.length; i++) {
|
|
114
|
+
const id = project.entryIds[i];
|
|
115
|
+
const cur = entryOf(project, id);
|
|
116
|
+
if (cur !== cached.items[i]) {
|
|
117
|
+
valid = false;
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if (valid)
|
|
122
|
+
return cached.items;
|
|
123
|
+
}
|
|
124
|
+
const items = project.entryIds.map(id => entryOf(project, id)).filter(Boolean);
|
|
125
|
+
entriesListCache.set(project, { count: project.entryIds.length, items });
|
|
126
|
+
return items;
|
|
78
127
|
}
|
package/dist/guide.js
CHANGED
|
@@ -798,6 +798,8 @@ A successful initial compilation registers local review rounds before dev return
|
|
|
798
798
|
- approved is a confirmation for that exact option version. An exact-session watch prints it and exits 0; the follower prints it and keeps going. This records the user's review decision, not that feedback has been implemented. Update pick/source only as authorized by the user's task; approval does not authorize publishing.
|
|
799
799
|
- Source changes close the old round (closed, source_changed) and start a new one after compilation. The follower moves on by itself; an exact-session watch exits 1, never 0, and you list again to select the new session. A stopped process without an approval also fails.
|
|
800
800
|
- Records live under the real project path in .joplo/reviews/ and remain local. Distinct instances and worktrees never share session identities. Local feedback is never uploaded automatically.
|
|
801
|
+
- Scripted writes use the same running-board API and revision checks: npx joplo feedback submit [dir] --local --work <qualified-id> --scenario <id> --position <n> --body <text>, and npx joplo feedback approve [dir] --local [--session <id>]. Supply an explicit reviewed position; the CLI does not know or pretend to control the reviewer's browser. --scene is optional, --request-id <uuid> makes retries idempotent, and approval never edits pick or publishes.
|
|
802
|
+
- Manage the board without simulating playback: board projects/add/remove, board appearance [dir], and board open [dir] --at <file:line[:column]>. Remove deletes only the registry entry, never project files; non-interactive removal requires --yes. Fullscreen, playback, clicks and drags remain native browser interactions.
|
|
801
803
|
|
|
802
804
|
## Before a video-like piece goes to reviewers
|
|
803
805
|
Required: run the film strip check from npx joplo skill demo ("Make it play like a film, not slides") — npx joplo render <dir> --scenario-id <first chapter> --film --chain — and fix every unexplained CUT and STILL first. Reviewers judge motion; a storyboard that looks fine can still play like a slide deck. Report the remaining cuts/stills you kept on purpose and what you could not verify (sound, real devices).
|
|
@@ -830,9 +832,10 @@ Never carry an old seq to a new session, delete review records to reset one, or
|
|
|
830
832
|
- npx joplo feedback watch --share <id> --work <feature.option> --json [--interval 15] [--version <n>] [--server <url>]. Requires the owner's login or an API key with feedback:read. The target option is required; public viewing does not make the owner's feedback API anonymous.
|
|
831
833
|
- Poll immediately, then every 15 seconds by default; --interval accepts integer seconds from 10 to 30. Requests are sequential; transient network errors back off up to 30 seconds, and Ctrl+C cancels requests as well as waits.
|
|
832
834
|
- Pin the first returned share version unless --version is given. A replacement version emits closed and exits 1; it never silently switches versions. Only a matching current-version owner pick becomes approved and exits 0; votes, rule confirmations, other options, and older decisions cannot end this watch.
|
|
833
|
-
- source=cloud events share the feedback/approved/decision/closed vocabulary. Deduplicate by eventId (stable across restarts); Cloud has no local seq
|
|
834
|
-
-
|
|
835
|
-
- The existing npx joplo feedback [dir] and --applied commands keep their pull/write-back behavior. Watching never marks decisions applied or copies remote confirmation into local source/session state.
|
|
835
|
+
- source=cloud events share the feedback/approved/decision/closed vocabulary. Deduplicate by eventId (stable across restarts); Cloud has no local seq. Missing route/source data stays null rather than being guessed.
|
|
836
|
+
- Cursor-capable Cloud uses GET /api/v1/shares/{id}/feedback?cursor=<cursor>&limit=200. The CLI drains every page before emitting and judging approval, so resolved comments and applied decisions are still recovered, while a retracted pick never approves. Each event carries cursor and stderr reports Cloud cursor; resume with --cursor <last fully handled cursor>. A failed multi-page batch restarts from its uncommitted cursor. Older Cloud falls back to lossy snapshots and warns that resolved/applied records can disappear between polls.
|
|
837
|
+
- The existing npx joplo feedback [dir] and --applied commands keep their pull/write-back behavior; --applied also accepts --expected-version. Watching never marks decisions applied or copies remote confirmation into local source/session state.
|
|
838
|
+
- Explicit Cloud writes: feedback comment requires share/review-id/version/work/scenario/position/body (step-id after position 0); feedback resolve <comment-id> [--reopen]; feedback decide requires kind/target/expected-version (answer/reject_rule also need note); feedback retract <decision-id>; feedback vote is not approval. These need feedback:write. Comments/votes need the review link id from /review/<id>, not the share id. Decisions/comments carry expectedVersion; on 409 reread rather than blindly replaying.
|
|
836
839
|
|
|
837
840
|
Example, scoped to one known option:
|
|
838
841
|
|
|
@@ -955,11 +958,13 @@ Deploy only dist output, not author source files. MCP, comments, and collaborati
|
|
|
955
958
|
- share also uploads a 1200x630 preview image of the default scenario when the export component is installed (npx joplo setup export, or Playwright already in the project); without it, share still succeeds, prints one "Skipped the preview image" line, and never downloads anything.
|
|
956
959
|
- Re-sharing updates the same-server link in .joplo/cloud.json, for free and Pro accounts alike; --new creates another link and --title sets its title.
|
|
957
960
|
- The review version is a separate share (review: { shareId, url } in .joplo/cloud.json); it never replaces the main link. If the cloud rejects the review manifest, plain share retries once without it and still publishes.
|
|
961
|
+
- Existing-share reads do not publish or change visibility: share list and share show <id> (share embed <id> is the embed-focused alias) use shares:read and return metadata plus the same iframe/Markdown/badge/preview snippets. share delete <id> uses shares:write and permanently deletes that share. It asks by default; non-interactive/JSON requires --yes before any request. Never delete shares just to make room without the user's explicit instruction.
|
|
958
962
|
|
|
959
963
|
## Narration (Joplo Cloud and your own keys)
|
|
960
964
|
- Limit narration generation before spending characters: npx joplo voice . --work short --dry-run --format json (standalone entry key or qualified feature work id). --scenario <exact scenario id> (alias --scenario-id) selects one chapter and follows its from predecessors; combining it with --work requires the chapter to belong to that work. Inspect data.locales[].details: workId, scenarioId, stepId, text, chars, missing and estimatedBillableChars. These are upper-bound estimates from the local cache, not a promise of actual charges: a remote Cloud cache hit is free. Shared text/voice is estimated once; silent steps show zero and valid cached clips show no billable characters. Then run the same command without --dry-run. Generation uses the existing cache and voice pins and never deletes clips outside this scope. Unknown/draft scopes fail before speech requests; omitted scope keeps all non-draft standalone works and picked feature works. Generate each required scope before build/share; scoping generation does not change what the later build selects.
|
|
961
965
|
- Declare the source language even for a single-language project: config({ locales: ['zh-CN'], ... }). The interface language is not the content language. Without config locales the clip metadata uses und (undetermined), and speech follows the text naturally; the tool does not infer a language from Chinese characters or label it English. Declared languages use their content locale in metadata and speech requests; existing clip keys remain text/voice based and do not require regeneration just to correct metadata.
|
|
962
966
|
- Voice sources are only: browser voice (free, local), Joplo Cloud narration (signed in, no key, billed in characters), and official OpenAI / ElevenLabs (the user's own key; the API address is fixed). AiHubMix, OpenAI-compatible gateways with a custom Base URL and custom HTTP providers were removed: an old one shows "No longer supported" in the board. Audio it already generated still plays and is still bundled by build and share; it cannot make new audio. Ask the user to switch sources; do not edit ~/.joplo/voice/profiles.json yourself. An old OpenAI / ElevenLabs entry pointed at another address (a proxy), headers or response format is also "No longer supported": its key was for that proxy and is never sent to the official API; deleting it in Manage keys restores the official provider.
|
|
967
|
+
- With the board running, voice profiles lists sources/narrators and non-secret key status; voice select [dir] --profile <id> (or --browser) chooses the project source, and voice narrator <profile> <voice-id> changes its default narrator. voice key set <openai|elevenlabs> reads hidden input or JOPLO_VOICE_KEY; voice key test uses the saved key or that environment value without saving; voice key delete resets the preset and requires confirmation/--yes. Full keys and test audio are never printed. These commands do not bypass a config voice.profile and do not generate narration or spend characters (except the explicitly requested key test's provider sample).
|
|
963
968
|
- Default: a project that never chose a source and has no config voice.profile uses Joplo Cloud narration when the user is signed in, otherwise the browser voice. Choosing Browser voice in the board sticks. Re-sharing a project that never chose a source prefers valid audio already generated for the current default, then reuses matching text from the previous share. Different voices can coexist per language, role and text; the published playback index preserves their real fingerprints, including on a later update from another machine. Do not regenerate everything or explicitly change sources just to make an update include new clips; an explicit source change deliberately stops inheriting the old source.
|
|
964
969
|
- After changing an automatic caption's label, input/selected value or keys, rebuild before sharing: audio is eligible only if its text matches the current caption in that clip's language. Valid local audio takes priority over reusable published audio only after this check. Stale text, unknown languages or mismatched cache keys are excluded from the site files and playback index; a step with no valid clip counts as missing and uses the browser voice. Do not treat matching step IDs or a previous successful generation as proof that a clip is current; preserve valid clips in the other interface languages instead of deleting the whole cache.
|
|
965
970
|
- Roles need their own voice: a feature role without config({ voice: { roles: { key: '<voice id>' } } }) speaks in the narrator's voice, so a person talking and the presenter sound identical. Pick a contrasting voice (another gender or register) from the board's voice panel; with Joplo Cloud the ids are multilingual and apply to every content language unless voice.locales overrides them. Set this before generating, because changing a voice regenerates its clips.
|
|
@@ -1057,7 +1062,7 @@ The engine supplies authoring, compilation, state, scheduling and host services.
|
|
|
1057
1062
|
6. joplo components inspects only the enabled manifests; a named query gives that component's declarations and example. For full recipes/behavior read its plugin skill.
|
|
1058
1063
|
|
|
1059
1064
|
## Optional 3D
|
|
1060
|
-
The starter does not include 3D or its large browser dependency. To add it: npm install @joplo-app/plugin-3d@0.
|
|
1065
|
+
The starter does not include 3D or its large browser dependency. To add it: npm install @joplo-app/plugin-3d@0.8.1; default-import scene3d from that package in joplo.config.ts, add scene3d to config.plugins, then run npx joplo skill install. Read npx joplo skill scene3d, scene3d/models and scene3d/generation for rendering, existing assets and optional local generation. A key is unnecessary for existing assets; dry-run before approving any generation.
|
|
1061
1066
|
|
|
1062
1067
|
## Errors and trust
|
|
1063
1068
|
- UNKNOWN_PLUGIN: the element's author package is not enabled. Use its package provenance in the diagnostic to install/import it and add it to config.plugins. UNKNOWN_COMPONENT: no enabled manifest declares that element or intrinsic tag; read the installed catalogs.
|
package/dist/step-plan.js
CHANGED
|
@@ -89,9 +89,23 @@ export function stepPlan(project, step, o = {}) {
|
|
|
89
89
|
const leadMs = cursorMs + rippleMs + gestureMs;
|
|
90
90
|
return { cursorMs, rippleMs, gestureMs, leadMs, settleMs, dwellMs, voiceMs: voice, totalMs: leadMs + Math.max(dwellMs, voice), ...(timingSource ? { timingSource, audioMs } : {}) };
|
|
91
91
|
}
|
|
92
|
+
const defaultPlanMsCache = new WeakMap();
|
|
92
93
|
/** 一个场景按 1× 自动播放大约多久(毫秒):每一步 stepPlan 的合计之和。 */
|
|
93
94
|
export function scenarioPlanMs(project, steps, texts) {
|
|
94
|
-
|
|
95
|
+
if (!texts) {
|
|
96
|
+
let bySteps = defaultPlanMsCache.get(project);
|
|
97
|
+
if (!bySteps) {
|
|
98
|
+
bySteps = new WeakMap();
|
|
99
|
+
defaultPlanMsCache.set(project, bySteps);
|
|
100
|
+
}
|
|
101
|
+
const hit = bySteps.get(steps);
|
|
102
|
+
if (hit !== undefined)
|
|
103
|
+
return hit;
|
|
104
|
+
const total = steps.reduce((sum, step) => sum + stepPlan(project, step, {}).totalMs, 0);
|
|
105
|
+
bySteps.set(steps, total);
|
|
106
|
+
return total;
|
|
107
|
+
}
|
|
108
|
+
return steps.reduce((sum, step) => sum + stepPlan(project, step, { texts: texts(step) }).totalMs, 0);
|
|
95
109
|
}
|
|
96
110
|
/**
|
|
97
111
|
* 两次提交之间的时间(引擎毫秒,1×):第 index 步(0 起;-1 = 场景开始)提交之后,到下一步提交(最后一步之后 = 到场景播完)。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@joplo-app/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Joplo 作品引擎:编译、校验与确定性播放,支持独立作品和功能方案评审",
|
|
5
5
|
"license": "PolyForm-Shield-1.0.0",
|
|
6
6
|
"type": "module",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"dist"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@joplo-app/kit": "0.
|
|
38
|
+
"@joplo-app/kit": "0.8.1",
|
|
39
39
|
"zod": "4.6.7"
|
|
40
40
|
},
|
|
41
41
|
"engines": {
|