@joplo-app/core 0.6.0 → 0.6.2

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.
@@ -44,9 +44,9 @@ export declare const SKILL_TOPICS: readonly [{
44
44
  /** 心智模型:所有入口最先读到的几句话。 */
45
45
  export declare const MENTAL_MODEL: readonly ["Joplo shows are playable, interactive pieces your agent writes in code: compare feature options, explain how a system runs, or show what happened. Share them by link or embed their player. It is a player for pre-declared scenarios, not a free-form app prototype with persistent data or real backend logic, and not a slide or PPT tool: you write the screens and scripted scenarios in TSX, the local board plays them step by step, and reviewers compare options and leave feedback.", "Structure: a project is a portfolio of works; a work has slices (scenarios), and a slice has steps. Every work has a cover and enters the home page. Capabilities combine: feature review groups alternative works (options) with cases, coverage, rules and a pick; sequencing connects chapters; draft keeps a standalone work out of publication.", "A step is one user action (.click / .type / .select / .press / .drag / .hover / .scroll / .act) or system event plus its visible effects (set, toast, go, done). Results and errors come from these effects, not from real logic or a backend.", "During playback, the first picture-changing stage input pauses and applies that same input. Hover does not pause; blank clicks only pause without an exploration notice. Matching the next action advances the script and stays stopped; another reachable scenario asks to switch (default before the action; actionEntry: 'after' consumes it on confirmation); native controls and declared free reactions change only a local playground. Play, jump, scenario change and reset discard exploration. Screenshots, video and deep links always use scripted state.", "work() is the only work entry point. Use work() + chapter() in works/<key>.tsx for a standalone show; compare feature options with feature() + work() in features/<f>/works/<key>.tsx. The UI calls these alternative works options. Both can coexist. Standalone works need no pick; draft: true excludes them from build and share. Publish one entry with --work <key>; feature publication still uses pick."];
46
46
  /** 推荐的起步顺序(X2:先做最小的一条正常流程 + 一条错误恢复流程,在看板里确认交互模型后再扩展)。 */
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. Both use the CLI version tag and install engine skills, AGENTS.md and enabled plugin guides.", "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."];
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 the account storage; if share fails with QUOTA_EXCEEDED (exit 6), tell the user the numbers and the two links from error.details, never delete their shares yourself", "publish"], readonly ["Joplo Cloud narration spends the user's characters: run npx joplo voice --dry-run 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", "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"]];
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 the account storage; if share fails with QUOTA_EXCEEDED (exit 6), tell the user the numbers and the two links from error.details, never delete their shares yourself", "publish"], readonly ["Joplo Cloud narration spends the user's characters: run npx joplo voice --dry-run 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 --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;
@@ -30,7 +30,7 @@ export const MENTAL_MODEL = [
30
30
  ];
31
31
  /** 推荐的起步顺序(X2:先做最小的一条正常流程 + 一条错误恢复流程,在看板里确认交互模型后再扩展)。 */
32
32
  export const START_ORDER = [
33
- '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. Both use the CLI version tag and install engine skills, AGENTS.md and enabled plugin guides.',
33
+ '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.',
34
34
  '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.',
35
35
  '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.',
36
36
  'With minimal code, write one chapter for a standalone work, or one happy path and one error-and-recovery scenario for feature review.',
@@ -58,7 +58,7 @@ export const PITFALLS = [
58
58
  ["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"],
59
59
  ["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"],
60
60
  ["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"],
61
- ["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", "demo"],
61
+ ["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 --video takes --width/--height, --voice, --clean and --srt for publishing; see joplo skill demo)", "demo"],
62
62
  ["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"],
63
63
  ["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"],
64
64
  ["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"],
@@ -98,6 +98,7 @@ function joploBody() {
98
98
  'npx joplo dev # stdout: the board URL; stderr: the feedback command for agents',
99
99
  'npx joplo feedback watch . --local --follow --json # in its own long-running shell: reviewer feedback as NDJSON',
100
100
  '```',
101
+ 'Templates download from github:Joplo-app/joplo-templates/<name> (default branch, default name starter); new names need no CLI release. Missing names link to https://github.com/Joplo-app/joplo-templates. Templates are maintained manually, separately from releases, for the latest published CLI; older CLIs are not guaranteed. Init fills version placeholders with its own version; for offline recovery use --template <local path>. See npx joplo skill authoring for name priority and download checks.',
101
102
  'Run dev and the follower in separate long-running shells. dev keeps the board live: every saved edit recompiles and refreshes it.',
102
103
  '',
103
104
  '## Workflow',
package/dist/guide.js CHANGED
@@ -91,7 +91,7 @@ A project is a portfolio of works. A work combines its stage, initial state and
91
91
  ### Choose a starting template
92
92
  Use npx joplo init <dir> (or --template starter) to compare feature options. Use npx joplo init <dir> --template work for one show people can play, pause and try: it contains works/explainer.tsx with two continuing chapters, no feature or placeholder routes, and only the UI plugin. Edit a visible text literal and save to change the picture; pause and edit the bound input to explore locally, then Play or Reset to restore the script. No credentials or generated assets are required. You can also add works/<key>.tsx manually to an existing project.
93
93
 
94
- Bare --template values without / or a backslash, not starting with . or github:, select built-ins; only starter and work are accepted. Unknown names list both choices. Built-ins download templates/<name> from the CLI exact v<version> tag; a same-named local directory never overrides them (use --template ./work). Explicit local paths and github:owner/repo[/subdir][#ref] retain their meaning. Download/validation errors leave no partial project; use an explicit local template path offline.
94
+ Bare --template values without / or a backslash, not starting with . or github:, must match ^[a-z0-9][a-z0-9-]*$ and select same-named directories from github:Joplo-app/joplo-templates/<name> (default name starter). Ref is omitted to use HEAD, the repository default branch, without a version tag. New template names need no CLI release; a same-named local directory never overrides them (use --template ./work). Missing directories report that the template is absent and link to https://github.com/Joplo-app/joplo-templates; invalid names fail before downloading. Explicit local paths and github:owner/repo[/subdir][#ref] retain their meaning. Source and published CLIs use the same remote source. Templates are maintained manually, independently of releases, for the latest published CLI; older CLIs are not guaranteed. Init replaces version placeholders with its own exact version, installs engine skills and preserves any bundled plugin guides; missing guides are allowed. After installing dependencies, run npx joplo skill install and npx joplo check before npx joplo dev. Download/validation errors leave no partial project; check the repository/ref or use an explicit local template path offline. Downloads fail after 30 seconds without data, not after a fixed total duration; size and unsafe-path limits still apply.
95
95
 
96
96
  ### Minimal standalone work
97
97
  buildStage() is your local view tree made from explicitly enabled plugin elements; it displays the work state at $.ui.status. Read the installed plugin skill for its components. Keep package.json type: module and the starter's JSX tsconfig (jsx: react-jsxdev, jsxImportSource: @joplo-app/kit). stage/layers needs no routes/ directory. To reuse product pages, explicitly supply on or routes.
@@ -145,7 +145,7 @@ export default work({ title: 'A · Visible queue', summary: 'Explain the wait',
145
145
  Success: check reports 0 errors; outline --work explainer shows the intended slices and estimated duration, with automatic chapter numbers. Inspect each chapter with render --scenario-id <id-from-outline> --sheet --out board.png; review motion using --film --chain --out film.png and actual playback before claiming it looks right. Standalone slice ids have two segments (explainer.arrival); feature-attached slice ids have three (queue.a.waiting). Copy ids from outline --format json for rendering, deep links and feedback context. Outline JSON groups works under entries[].works; feedback events identify them with workId. Human-facing feature alternatives are still called options. For the standalone example: render --scenario-id explainer.arrival; the short scenario link is #/s/explainer.arrival; feedback list --local --work explainer --json filters by the work key, and feedback context.scenarioId uses explainer.arrival.
146
146
 
147
147
  ## Start from the project
148
- 1. Run npx joplo init <dir> for feature comparisons or npx joplo init <dir> --template work for a standalone show, then install dependencies. Both install the same engine skills and AGENTS.md block, plus guides for their enabled plugins even before dependencies exist; after installation, npx joplo skill install verifies them against config.plugins. Source-monorepo CLIs resolve built-ins to the current checkout’s templates/<name>; explicit --template ./templates/starter or ./templates/work works too. Inside the monorepo use workspace protocol for local dependencies; outside it, link local dependencies for development or keep pinned published versions. A custom project may choose different plugins.
148
+ 1. Run npx joplo init <dir> for feature comparisons or npx joplo init <dir> --template work for a standalone show, then install dependencies. Both download from the independent template repository default branch and install the same engine skills and AGENTS.md block. Any bundled plugin guides are preserved before dependencies exist; missing guides are allowed. After installation, npx joplo skill install generates/verifies them against config.plugins. Use --template ./local-source for offline input. Inside the monorepo use workspace protocol for local dependencies; outside it, link local dependencies for development or keep pinned published versions. A custom project may choose different plugins.
149
149
  2. Read the installed engine skill and .claude/skills/joplo-plugins/SKILL.md. Read each relevant plugin's entry and component/recipe topics. npx joplo skill lists what this config enables.
150
150
  3. Create one standalone work and chapter, or one feature, option and runnable scenario for design review. Run check, inspect the rendered frames, then test the real inputs. For a short film or explainer that should feel like a video, also run the motion review in npx joplo skill demo ("Make it play like a film") — static frames cannot show hard cuts or frozen pictures.
151
151
  4. Required before handing a development round to the user: read npx joplo skill review and start npx joplo feedback watch [dir] --local --follow --json. A running board alone does not receive feedback for the agent.
@@ -386,6 +386,7 @@ Viewers call a piece "a slide deck" when pictures swap in one frame and then sit
386
386
  - One main motion per beat; most beats 2–3 s. hold(seconds) is the author's pacing: a step with hold no longer gets the 3 s reading floor (caption reading time per character and narration still extend it). System steps show their event for about 0.9 s before committing; narration waits keep the engine clock (and therefore drift and transitions) running.
387
387
  - Anti-deck gate: before building, write one line per beat — the main moving object, its start → end state, and the verb (push, morph, rise, swap…). If most beats are only fades or panels appearing, redesign them. A contact sheet that reads like slide thumbnails fails.
388
388
  - Chapters: use chapter() default continuation; sequential playback of a continuing chapter continues in the same shot (no countdown, no reset, music keeps playing). Bring the next chapter's music in on the beat before the visual swap (play the next score with fadeMs; the old track fades out under it — a J-cut). Play the same score again to keep it going. Stop music only at the real ending.
389
+ - Film sampling freezes the browser clock before loading, advances on a fixed 16 ms loading grid and waits for DOM commits to settle before each sample. Loading time does not become playback time. Repeat the same command when checking timing; compare scenario/position timelines separately from pixel differences (fonts, browser and platform can still affect rasterization).
389
390
  - Required review: run npx joplo render <dir> --scenario-id <first chapter> --film --chain --out film.png and read every page (one per chapter; red = one-frame full-screen change, grey = nothing visible changed for ≥ 1.5 s). The CLI prints every CUT and STILL with time and step; film.json beside it has the largest adjacent-frame change around every step. Fix every CUT that is not a deliberate signature and every STILL, then film again. Also record --video (real time) and watch it once start to end. Cells are samples on the engine clock; check a suspicious moment with --frames <dir> at full size before changing code — fine textures (1-px checkers, hairlines) shimmer as moiré under zoom or drift and show up as cuts. The opposite also happens: in a product-recording piece the real change is a few characters, a caret or a timer, below the STILL threshold, so a typing sequence can be reported as one long STILL. Crop the changing area across consecutive --frames before adding motion only to satisfy the detector.
390
391
  - Review as a picky viewer, not the author: list issues with time code, evidence (frame/metric), impact, severity (blocker / major / minor / note) and verdict (APPROVE / APPROVE_WITH_NOTES / REVISE). Check mechanics first (cuts, stills, overlaps, cropped text), then meaning, then taste; "not cinematic enough" without evidence is not a finding. Do at least two rounds of film → issues → fix, and finish one chapter seam to delivery quality before copying the technique to the others.
391
392
  - Static frames (render, --sheet, thumbnails, deep links) show settled pictures: no drift, no half-finished transitions. That is deliberate and is why the film strip is the motion check.
@@ -404,6 +405,7 @@ The host can draw an input/keyboard record after a type/press step, and toasts c
404
405
  ## Frames, deep links and verification
405
406
  - outline lists scenario and step ids. Use those ids in render/export; a deep link chooses where viewing starts and is not an access boundary. render takes qualified ids: --scenario-id <feature>.<option>.<scenario> and --step-id '<feature>.<option>.<scenario>#<n>' (the NOT_FOUND message lists the available scenario ids).
406
407
  - joplo render --scenario-id <id> --step-id <id> --out frame.png renders timeline state. --sheet --columns 3 renders every step with captions/narration (settled frames only). --film [--chain] [--every 250] samples real playback on the engine clock for motion review; --video records a webm. Both need the export component (npx joplo setup).
408
+ - Exporting a video to publish elsewhere: render --video [--chain] starts at the cover fading out (loading and audio preparation are not recorded). --width 1920 --height 1080 (or --width 1080 --height 1920) sets the video resolution: the stage keeps its own aspect, is scaled sharply and centered on the theme background, so portrait output suits phone pages. The audio track is the media plugins' music plus generated narration: --voice real (default) mixes the clips npx joplo voice made for the current voice and holds each step for the real audio; lines without a clip use estimated timing silently and the CLI lists them, so generate voice first and record again (browser speech is never captured). --clean (or --hide cover,cursor,title,subtitles) leaves out player chrome; --srt <file> writes the subtitles timed to the video for the platform's own captions. Watch the result once; trust the listed missing lines, not the absence of an error.
407
409
  - A full-size render can pass while a shorter board clips the input area. Check the actual visible hitbox with real pointer input in the board and the built site; DOM text existing is not proof it can be used.
408
410
  - Fixed render dimensions are a capture size; viewport belongs to page/layer. In a browser wait for fonts and [data-jcamera][data-camera-settled="1"] plus two animation frames. Do not mistake DOM progress for painted pixels.
409
411
  - Test first input, drag, wheel, hover, keyboard, confirmation cancel/confirm, reset and resumed playback. Compare restored frames and direct jumps with pristine script frames. Explain unverified devices or audio behavior.
@@ -580,6 +582,7 @@ Example: features/invite/works/a.tsx:12:5 warning UNBOUND_INTERACTIVE Interac
580
582
  ## Common codes → fixes
581
583
  - WORK_INVALID (error): read the specific reason: default export must be work({...}); title and summary must each be nonempty; scenarios must be an object of flow()/chapter() entries; stage must be a JSX element; layers must be a layer-entry object; stage and layers cannot coexist. A project with no pages needs stage, layers, on or routes. Multiple invalid fields produce separate reasons. Standalone order must be finite; an invalid value has a work ref. Match the diagnostic code and ref, not an old full message.
582
584
  - PROJECT_MODULE_CONFIG (error): when loading a project without tsconfig.json fails, add jsx: "react-jsxdev" and jsxImportSource: "@joplo-app/kit" plus package.json type: module. The message ends with underlying error: inspect it for a missing dependency or an author-code exception as well as JSX/module setup; fix that cause and rerun. A bare project that loads successfully is accepted.
585
+ - LOAD_FAILED "was compiled without Joplo's JSX runtime": a TSX file outside the project directory (shared components above several projects in one repository) is compiled with the JSX settings of its own nearest tsconfig.json, not the project's. The diagnostic points at that file; give its folder (or the repository root) a tsconfig.json with jsx: "react-jsxdev" and jsxImportSource: "@joplo-app/kit", or add the /** @jsxRuntime automatic */ /** @jsxImportSource @joplo-app/kit */ pragmas. node_modules packages are never recompiled this way; ship plugin components as compiled packages instead. The board watches only the project directory, so after editing a shared file save any project file (or rerun check) to reload it.
583
586
  - WORK_ID_CONFLICT (error): rename the work file or feature folder so their entry keys differ.
584
587
  - WORK_SLICES_MIXED (error): use all chapter() for a linear work or all flow() for independent slices, including options under a feature.
585
588
  - WORK_FEATURE_ONLY (error): standalone works cannot declare focus/tradeoffs/coverage/rules/questions, slice cases or step uses(). Remove those fields or attach the work to a feature for design review.
@@ -965,14 +968,14 @@ The engine supplies authoring, compilation, state, scheduling and host services.
965
968
 
966
969
  ## Discover and use
967
970
  1. Read package.json and config.plugins. npx joplo skill lists engine topics plus enabled plugin entries/topics; .claude/skills/joplo-plugins/SKILL.md indexes installed files.
968
- 2. Install a trusted author package, import its default manifest/factory and explicitly add it to config.plugins. Use the package's exact version when version-coupled to this CLI.
971
+ 2. Install a trusted author package, import its default manifest/factory and explicitly add it to config.plugins. Use the package's exact version when version-coupled to this CLI. A default export is either a manifest (list it as-is) or a factory that takes options (list its call, as its plugin guide shows); do not copy one package's form to another. A forgotten call is reported as config.plugins[i] is a function by check (PLUGIN_INVALID) and skill install, which then changes no skills; that message is a config fix, not missing dependencies.
969
972
  3. Run npx joplo skill <plugin-id> or <plugin-id>/<topic>, then import components and effects directly from that package. For ids colliding with engine topics use plugin:<id>/<topic>. Do not invent component names or copy another plugin's conventions.
970
973
  4. Run npx joplo skill install after adding/removing plugins. It synchronizes per-plugin files and removes unchanged generated files for removed plugins; edited files are protected (inspect --diff before --force). Outside a project it installs only engine skills.
971
- 5. A new template carries its own generated plugin guides for reading before dependency installation. After install, rerun skill install to verify the live config; unresolved imports never mean a plugin was enabled successfully.
974
+ 5. A template may carry manually maintained plugin guides for reading before dependency installation; their absence does not prevent init. After install, rerun skill install to verify the live config; unresolved imports never mean a plugin was enabled successfully.
972
975
  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.
973
976
 
974
977
  ## Optional 3D
975
- The starter does not include 3D or its large browser dependency. To add it: npm install @joplo-app/plugin-3d@0.6.0; 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.
978
+ The starter does not include 3D or its large browser dependency. To add it: npm install @joplo-app/plugin-3d@0.6.2; 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.
976
979
 
977
980
  ## Errors and trust
978
981
  - 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.
@@ -999,6 +1002,7 @@ The starter does not include 3D or its large browser dependency. To add it: npm
999
1002
  - To draw something attached to other elements (connectors, annotation rings), find them by data-jid inside your own container and measure the offsetLeft/offsetTop chain up to that container. This is the final layout, independent of camera zoom and in-flight FLIP transforms, so getBoundingClientRect is wrong here. Re-measure with ResizeObserver, a subtree MutationObserver (targets appear/disappear through when) and document.fonts.ready; skip a target that is not rendered instead of drawing to a stale point.
1000
1003
  - For a canvas drag, report a named hit or stage CSS-pixel point through ctx.act. The host resolves points against declared drop-zone anchors, including ordinary DOM targets outside the canvas. Keep anchors current after camera/scale changes; do not report canvas-local pixels as stage pixels.
1001
1004
  - frame contains resolved state, drawing snapshot, animate, clock/gesture, local playground and reset epoch. animate=false renders final layout; use ctx.hold while required assets load. Stop handled gesture propagation where ownership requires it.
1005
+ - Author-side helper functions can import isNode, isBind and bindPath from @joplo-app/kit. Use isNode(value) before traversing a JNode; use isBind(value) before bindPath(value) to distinguish bindings from plain objects. These are authoring values, not compiled IR or rendered DOM nodes; never infer a binding by coercing the proxy to a string.
1002
1006
  - The engine clock has one frame driver, owned by the player: it samples once per display frame while playing and stops when paused or idle. A plugin only reads the clock (frame.clock, useEngineFrame()); it never advances it, and never runs its own requestAnimationFrame or timer loop to move timeline animation, which would drift from pause, speed, video export and film strips.
1003
1007
  - frame.clock (and useCtx().clock) is a coarse frame: its object changes only when running, paused or speed changes, while timeMs/elapsedMs/rawMs read the live engine time whenever you read them. The stage does not re-render every frame, so a large scene stays smooth during playback. A React presenter that must redraw every frame (a camera, a dot moving along a path, typed text) calls useEngineFrame() from @joplo-app/kit/renderer, and should memoize the children it renders so its subtree does not re-render with it. Imperative mount/update components already get update() every frame. Reading clock.timeMs in render or as an effect dependency without useEngineFrame() freezes the animation.
1004
1008
  - Testing an engine or plugin change from your own checkout: npx joplo dev joins any board already running under the same JOPLO_HOME, and that board serves its own build, so your change will not appear. Start a separate board with JOPLO_HOME=<empty dir> npx joplo dev <dir> --port <free port>, and run feedback watch with the same JOPLO_HOME.
@@ -5,7 +5,7 @@ import { commitGapMs } from "../step-plan.js";
5
5
  import { jsonData, snapshot, object, strings, syncResult, authoringData, materialize, errorMessage } from "./data.js";
6
6
  /** Node-side plugin host. Callbacks never enter IR or the player. */
7
7
  import { isNode } from '@joplo-app/kit/node';
8
- import { PLUGIN_API_VERSION } from '@joplo-app/kit/plugin';
8
+ import { pluginEntryProblem } from '@joplo-app/kit/plugin';
9
9
  import { initialState, applyStep, resolveProps } from "../player.js";
10
10
  export function enabledPlugins(configured) {
11
11
  return Array.isArray(configured) ? configured : [];
@@ -61,18 +61,23 @@ export class PluginCompiler {
61
61
  this.options = options;
62
62
  if (configured !== undefined && !Array.isArray(configured))
63
63
  report('PLUGIN_INVALID', 'config({ plugins }) must be a list of plugins', source);
64
- for (const raw of enabledPlugins(configured)) {
64
+ for (const [index, raw] of enabledPlugins(configured).entries()) {
65
65
  const p = raw;
66
- if (!p || typeof p !== 'object' || p.kind !== 'plugin' || typeof p.id !== 'string' || !p.components || typeof p.components !== 'object' || Array.isArray(p.components)) {
67
- report('PLUGIN_INVALID', 'config({ plugins }) entries must be made with definePlugin', source);
66
+ const problem = pluginEntryProblem(raw, index);
67
+ if (problem && (!p || typeof p !== 'object' || p.kind !== 'plugin' || typeof p.id !== 'string')) {
68
+ report('PLUGIN_INVALID', problem, source);
69
+ continue;
70
+ }
71
+ if (!p || !p.components || typeof p.components !== 'object' || Array.isArray(p.components)) {
72
+ report('PLUGIN_INVALID', `config.plugins[${index}]${p && typeof p.id === 'string' ? ` (${p.id})` : ''} has no components map; plugin manifests must be made with definePlugin`, source);
68
73
  continue;
69
74
  }
70
75
  if (this.defs.has(p.id)) {
71
76
  report('PLUGIN_DUPLICATE', `Plugin ${p.id} is enabled twice in config({ plugins })`, source);
72
77
  continue;
73
78
  }
74
- if (p.apiVersion !== PLUGIN_API_VERSION) {
75
- report('PLUGIN_INVALID', `Plugin ${p.id} targets API ${p.apiVersion}; supported: ${PLUGIN_API_VERSION}`, source);
79
+ if (problem) {
80
+ report('PLUGIN_INVALID', problem, source);
76
81
  continue;
77
82
  }
78
83
  this.defs.set(p.id, p);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joplo-app/core",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
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.6.0",
38
+ "@joplo-app/kit": "0.6.2",
39
39
  "zod": "4.6.7"
40
40
  },
41
41
  "engines": {