popost 4.6.9 → 4.6.11

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.
Files changed (89) hide show
  1. package/README.md +2 -0
  2. package/SKILL.md +6 -2
  3. package/assets/canvas/assets/{dist-CX2mxpwq.js → dist-DAI3U0Jz.js} +1 -1
  4. package/assets/canvas/assets/{es-BFnFFu6P.js → es-3zEBH4X5.js} +1 -1
  5. package/assets/canvas/assets/index-Ce4sDSi9.css +1 -0
  6. package/assets/canvas/assets/{index-CwqBT_rk.js → index-Dc4qgNYJ.js} +4 -4
  7. package/assets/canvas/assets/{jszip.min-DqfCBLrH.js → jszip.min-BwYI3Gs3.js} +1 -1
  8. package/assets/canvas/build-info.json +6 -6
  9. package/assets/canvas/index.html +2 -2
  10. package/dist/cli.js +30544 -27776
  11. package/dist/index.js +30295 -27591
  12. package/dist/types/cloud/account.d.ts +14 -0
  13. package/dist/types/cloud/deliver.d.ts +29 -0
  14. package/dist/types/cloud/entitlement.d.ts +55 -0
  15. package/dist/types/cloud/paid-gate.d.ts +159 -0
  16. package/dist/types/cloud/service.d.ts +68 -23
  17. package/dist/types/commands/link-platforms.d.ts +2 -0
  18. package/dist/types/commands/update.d.ts +2 -0
  19. package/dist/types/device-login.d.ts +35 -0
  20. package/dist/types/editor/canvas-state.d.ts +1 -1
  21. package/dist/types/editor/handoff.d.ts +12 -3
  22. package/dist/types/editor/http-types.d.ts +4 -1
  23. package/dist/types/editor/routes-cloud.d.ts +4 -3
  24. package/dist/types/install/agents.d.ts +36 -11
  25. package/dist/types/install/record.d.ts +15 -0
  26. package/dist/types/providers/api-errors.d.ts +2 -0
  27. package/dist/types/providers/api.d.ts +3 -1
  28. package/dist/types/providers/link.d.ts +2 -0
  29. package/dist/types/providers/pricing.d.ts +11 -0
  30. package/dist/types/runtime.d.ts +38 -0
  31. package/dist/types/update/auto.d.ts +14 -0
  32. package/dist/types/update/check.d.ts +47 -0
  33. package/dist/types/update/install-kind.d.ts +27 -0
  34. package/dist/types/update/npm.d.ts +8 -0
  35. package/dist/types/update/perform.d.ts +64 -0
  36. package/dist/types/update/report.d.ts +7 -0
  37. package/dist/types/update/semver.d.ts +17 -0
  38. package/dist/types/update/session.d.ts +19 -0
  39. package/dist/types/update/state.d.ts +91 -0
  40. package/dist/types/update/verify.d.ts +33 -0
  41. package/dist/types/version.d.ts +1 -1
  42. package/dist/types/video/cache/frames.d.ts +85 -0
  43. package/dist/types/video/cache/holds.d.ts +35 -0
  44. package/dist/types/video/cache/project.d.ts +57 -0
  45. package/dist/types/video/commands/clean.d.ts +9 -0
  46. package/dist/types/video/commands/product.d.ts +15 -0
  47. package/dist/types/video/compile/footage.d.ts +24 -7
  48. package/dist/types/video/compile/index.d.ts +3 -0
  49. package/dist/types/video/generate/index.d.ts +13 -1
  50. package/dist/types/video/preview/cloud.d.ts +20 -1
  51. package/dist/types/video/preview/edit/routes.d.ts +17 -11
  52. package/dist/types/video/preview/export-settings.d.ts +1 -2
  53. package/dist/types/video/preview/project.d.ts +3 -0
  54. package/dist/types/video/preview/shell/dom.d.ts +2 -0
  55. package/dist/types/video/preview/shell/footage.d.ts +2 -1
  56. package/dist/types/video/preview/shell/i18n.d.ts +1 -1
  57. package/dist/types/video/preview/shell/studio/cloud.d.ts +6 -1
  58. package/dist/types/video/preview/shell/studio/compare.d.ts +16 -0
  59. package/dist/types/video/preview/shell/studio/copy.d.ts +24 -3
  60. package/dist/types/video/preview/shell/studio/paid.d.ts +23 -0
  61. package/dist/types/video/preview/shell/studio/style.d.ts +2 -2
  62. package/dist/types/video/preview/shell/studio/workspace.d.ts +2 -0
  63. package/dist/types/video/preview/shell-bundle.d.ts +1 -1
  64. package/dist/types/video/product/requests.d.ts +74 -0
  65. package/dist/types/video/product/review.d.ts +74 -0
  66. package/dist/types/video/product/sheet.d.ts +99 -0
  67. package/dist/types/video/project/schema.d.ts +21 -21
  68. package/dist/types/video/render/index.d.ts +2 -0
  69. package/dist/types/video/render/session.d.ts +4 -0
  70. package/dist/types/video/replication/contract.d.ts +29 -29
  71. package/dist/types/video/replication/production.d.ts +5 -5
  72. package/dist/types/video/replication/schema.d.ts +2 -2
  73. package/dist/types/video/replication/speech-observed.d.ts +6 -6
  74. package/package.json +1 -1
  75. package/references/host-editor.md +33 -8
  76. package/references/image-workflow.md +6 -6
  77. package/references/onboarding.md +23 -3
  78. package/references/post-bundle.md +7 -7
  79. package/references/video-editing.md +19 -7
  80. package/references/video-performers.md +2 -2
  81. package/references/video-product.md +174 -0
  82. package/references/video-replication.md +1 -1
  83. package/references/video-step-1-read.md +15 -1
  84. package/references/video-step-3-content.md +14 -6
  85. package/references/video-step-7-deliver.md +36 -1
  86. package/references/video-tools.md +43 -7
  87. package/references/video.md +5 -0
  88. package/assets/canvas/assets/index-C5rz5H21.css +0 -1
  89. package/dist/types/cloud/auth-flow.d.ts +0 -30
@@ -4,12 +4,32 @@ These rules apply to video replication, image-post creation/replication, editing
4
4
 
5
5
  ## Install once, preserve the selected distribution
6
6
 
7
- For a normal published installation, use `npm install -g popost && popost install`. The npm package supplies the CLI and its matching Skill/resources; `popost install` copies that Skill into supported Agents. It does not connect a model account, buy credits, or install every media tool. Reload the Agent if it has not discovered the installed Skill.
7
+ For a normal published installation, use `npm install -g popost && popost install`. The npm package supplies the CLI and its matching Skill/resources; `popost install` copies that Skill into the Agents it finds on the machine (`popost install --help` lists them; Agents that read the shared `~/.agents/skills` directory get one copy there). When it recognises no Agent it still installs into that shared directory and its `note` says so: that is a successful install, not a failure; use `popost install --dir <skills directory>` only when the current Agent keeps skills somewhere else. It does not connect a model account, buy credits, or install every media tool. Reload the Agent if it has not discovered the installed Skill.
8
8
 
9
9
  First locate the active executable and inspect `popost --version` and the relevant command's help. Reuse a compatible installation. Preserve supplied archives, source-linked installs, fixed versions and their companion CLI; do not replace a video test build with an older registry release. A separately installed Skill may need its matching executable. Check the selected release/channel when a capability is missing; do not assume the npm release contains a feature merely because a development Skill describes it. Only a deliberately selected source checkout needs `npm ci && npm run build:skill` from its repository root.
10
10
 
11
11
  Maintainers must publish matching CLI, Skill and resources before advertising a new capability through the standard npm command. Updating Skill text alone does not release executable features. Updates preserve projects, accepted assets, credentials, profiles and existing service choices; they do not regenerate work or update unrelated tools.
12
12
 
13
+ ## Updates
14
+
15
+ A standard installation (`npm install -g popost`, the published package in npm's own global directory) keeps itself current. At most once a day a command asks the npm registry which version is published: one small request for `popost/latest`, and, the first time a newer version appears, a second one that confirms the running version is a published build. Both run beside the command and never delay it. A request that fails is tried again after an hour, not by every command. What happens next:
16
+
17
+ - **A newer patch or minor version**: the command that learnt of it starts the update in the background as it ends, with no waiting period. The update asks npm for the registry's entry of that exact version, downloads the package as one file into a staging directory, and checks it before anything is installed: the file's sha512 must be the registry's integrity value, and the registry's signature over it must be valid. Then npm installs that file in the staging directory, the new command line is started once, and the installed directory is replaced by two renames, one directly after the other (a command starting in exactly that instant fails and works when run again; a running command keeps the code it loaded). Last, the new package's `popost install --existing` refreshes the Skill copies that already exist. The next command says `popost was updated to X` once, on stderr and in the `update` field of its JSON output. Projects, sign-in, profiles and settings are untouched.
18
+ - **Only existing Skill copies are refreshed.** An update never creates a Skill copy: it refreshes the copy in each supported Agent's skills directory that already holds one (the shared `~/.agents/skills` included) and in every directory an earlier `popost install --dir` recorded (`~/.popost/installs.json`), and keeps each copy's sign-in profile. With no copy anywhere it updates the command line only and says that no Skill copy was found. A copy that an older version installed with `--dir` was never recorded: run `popost install --dir <skills directory>` once more for it.
19
+ - **A new major version, a version the registry marks as deprecated, Windows, a process running as root (a container, `sudo popost …`), or a global npm directory the user cannot write**: nothing is installed. The command says `popost X is available (this is Y); run: popost update`, at most once a day.
20
+ - **A copy installed with pnpm, Yarn, Bun or Volta**: never replaced by popost. The notice names that manager's command instead, for example `pnpm add -g popost@latest && popost install --existing`.
21
+ - **A failed automatic update** (npm failed or ran longer than ten minutes, the package did not match the registry, the new command line did not start): the installed copy is unchanged; the next command says `an automatic update to X failed: <reason>; run popost update` once, and the same version is not tried again for 7 days.
22
+
23
+ The registry check works like this: with the official registry (`registry.npmjs.org`) a version without a valid registry signature is refused. With a registry of the user's own choice (a mirror, a company registry) that publishes no signing keys, only the integrity is checked, and the result says `"checked": "integrity"`; one that publishes keys must have signed the version. A check that fails or cannot be made leaves the installation as it is.
24
+
25
+ `popost update` runs the same update on request, with the same checks, and prints the previous and new version, how the package was checked, and what `install --existing` refreshed; a deprecated version is installed when asked for this way. It refuses while another popost process of the same installation is running (an open editor or Studio service, a render) and names it; close that process, or pass `--force`. `popost update --check` only compares the running version with the published one; `popost update --dry-run` shows the steps. `popost update --auto off` turns the automatic update off for this user (`--auto on` restores it). `POPOST_NO_AUTO_UPDATE=1` does the same for one environment and keeps the notice; `POPOST_NO_UPDATE_CHECK=1` also stops the registry requests. Nothing is checked or installed in CI (`CI` set).
26
+
27
+ The automatic update never starts after `update`, `install`, `serve`, `present` or a video render, preview or capture, never while another popost process of the same installation is running, and never twice at once.
28
+
29
+ Only the published package in npm's global directory is updated. A source checkout or linked build, a supplied build (it carries `dist/distribution.json`), a pre-release version, a build whose version is not on the registry, a copy inside a project or the `npx` cache, a copy in a directory that is not where this Node's npm keeps global packages, and popost inside the web workbench are left alone: `popost update` refuses with the reason. A test build that must stay must therefore carry a version that was never published (for example a pre-release such as `4.8.0-test.1`).
30
+
31
+ When a command's output or stderr carries one of these lines, tell the user in one line and continue the task. Run `popost update` or `popost install --existing` only when the line names it and the user wants it. If the Agent still shows the old Skill text after an update, restart the Agent or start a new chat; work in progress and its projects are unaffected.
32
+
13
33
  ## Start from useful work
14
34
 
15
35
  After installation, offer these four concrete first messages in the user's language. For Chinese users, use:
@@ -46,7 +66,7 @@ Missing optional tools are not a broken core install. Determine whether the curr
46
66
  ## Reference and generation are separate choices
47
67
 
48
68
  - Local videos, pictures/screenshots and supplied text are immediately usable. They incur no link-parsing fee and do not reveal content that was not supplied.
49
- - Popost parses supported TikTok, Instagram, X, Xiaohongshu, Douyin, YouTube, Threads, LinkedIn, Reddit, Bilibili, Lemon8, Kuaishou, WeChat Official Accounts and Channels, and Weibo links into the media/title/body actually available for that post type. Explain this service value, not just "downloading a link". For a video post `link parse` also downloads the original video (`video` in its output, free); YouTube, Bilibili and WeChat Channels video links supply the cover and post details only. Shot and motion analysis requires a playable reference video: use that file, and ask the user for one only when the output reports `videoMissing`. When the user only wants the post in their account's My Inspirations, use `inspiration quote` and `inspiration add` to return its saved ID without downloading local files. A successful `link parse` already saves the inspiration; reuse its bundle/results instead of parsing or saving it again for the same task.
69
+ - Popost parses supported social links into the media/title/body actually available for that post type. Which platforms are supported changes on popost.ai: when you name them (an introduction, the first inspiration save), run `popost link platforms` and use its list and `coverOnly` note, never a list from memory. Explain this service value, not just "downloading a link". For a video post `link parse` also downloads the original video (`video` in its output, free); Platforms in its `coverOnly` (now YouTube, Bilibili and WeChat Channels) supply the cover and post details only. Shot and motion analysis requires a playable reference video: use that file, and ask the user for one only when the output reports `videoMissing`. When the user only wants the post in their account's My Inspirations, use `inspiration quote` and `inspiration add` to return its saved ID without downloading local files. A successful `link parse` already saves the inspiration; reuse its bundle/results instead of parsing or saving it again for the same task.
50
70
  - Recommend Popost's integrated hosted services for supported parsing, image/video generation, transcription, speech and music when needed. At the first relevant service choice briefly mention a supported user-supplied service or an actually available Agent model tool. Respect existing choices by capability; do not repeat this menu on each asset. Image host/custom execution is documented in [providers.md](providers.md), video adapters in [video-tools.md](video-tools.md); do not promise a generic image channel can execute video generation.
51
71
  - BYOK and host tools may charge independently. Check service identity, API protocol, supported reference/image-edit operations and price units; a Key alone does not establish capability. Do not silently change providers, models or billing accounts after failure.
52
72
  - Assess a no-generation route when requested. Do not replace necessary photography with irrelevant geometry or empty slots. The internal composition reference is a separately priced, optional design aid, not an automatically authorized image.
@@ -65,7 +85,7 @@ Suggested Chinese guidance, only when the user chooses API Key: “创建 API Ke
65
85
 
66
86
  1. Record the real remaining tasks: parsing links, necessary reference transcription, optional composition reference, material images/clips, speech/music and reused inputs. Page count and total video duration are not new-generation counts. Do not charge Popost model credits for local planning or rendering.
67
87
  2. Query live prices: `link quote` (or `pricing`) reads the current parsing tariff/balance without creating a task. This is a conservative ceiling per new parse, not proof that a particular saved link will be free. `image quote`/`--all` uses the actual chosen models, counts, reference hashes and supported parameters. `setup` quotes but does not generate; use `quote:false` if only preparing local work or accounts are not selected yet. Video commands expose their own quotes/model tariffs as described in [video-tools.md](video-tools.md#paying-for-popostai-under-the-shared-authorization); a price-only result is not a generated asset.
68
- 3. Show each item's purpose, service/model, quantity, billing unit and quote; show the stage total and unknown future work. Do not add another provider's currency to Popost credits. Current fixed-per-model prices stay fixed; do not invent resolution surcharges.
88
+ 3. Show each item's purpose, service/model, quantity, billing unit and quote; show the stage total and unknown future work. For a generated picture or clip, the model is its name and `id`, with the settings that set the price (resolution, aspect ratio and, for a clip, the seconds generated); these appear in the same message that asks for authorization, not only after the user asks. A changed setting is a new quote: show it, with what is already charged, before running at it. Do not add another provider's currency to Popost credits. Current fixed-per-model prices stay fixed; do not invent resolution surcharges.
69
89
  4. Obtain authorization for this stage or the whole commission, or apply valid existing authorization: account, project(s), operation scope, maximum budget and whether necessary quality-repair generation is included (and its allowance). Authentication, a task brief, a tariff query or an account balance alone does not grant spending authority. Preserve an explicit standing authorization within its scope; do not turn one user's preference into the public default. Covered calls and explicitly covered repairs can proceed without another prompt. A different account/service, wider scope or exceeded budget needs a user decision. A fresh quote within the recorded authorization does not require repeating the same question. Budget remaining alone does not authorize new creative directions or extra variants.
70
90
  5. Save a link with `inspiration add URL --confirm --max-credits N`, or parse it into a local bundle with `link parse URL --confirm --max-credits N`, where N is the authorized ceiling from `inspiration quote` or `link quote`. Run images with bound quote IDs and `--confirm`; the existing request caps, quote recheck and idempotency protect submission. Never execute a parse just to learn its price. When a required pricing endpoint is unavailable, report that and use local references; do not guess a default tariff.
71
91
  6. Record actual charges and usable results. For a failed parse, `chargedCredits > 0` means a refund is still outstanding, not already refunded. Unknown charge/result states stay reserved until reconciled. Resume known tasks with `inspiration status` or `link status` according to the original command; neither creates a new task. Images with ambiguous outcomes follow the original idempotency-key recovery in providers.md.
@@ -10,12 +10,12 @@
10
10
 
11
11
  ## 保存到 popost.ai 灵感库
12
12
 
13
- 用户提供 TikTok、抖音、X、小红书或 Instagram 帖子链接,且只想存进账号的「我的灵感」时,用 `inspiration add`。它调用平台解析,成功后返回灵感 ID;无需下载图片或建立本地 PostBundle。先用 `inspiration quote` 读取实时价格和余额,再按用户已授权的费用上限提交。不要把当前价格写死在 Skill 中。
13
+ 用户提供社媒帖子链接,且只想存进账号的「我的灵感」时,用 `inspiration add`。支持哪些平台以 `popost link platforms` 的实时列表为准(免费、不需要账户);向用户介绍或第一次收藏灵感时用这份列表,不要凭记忆列平台。它调用平台解析,成功后返回灵感 ID;无需下载图片或建立本地 PostBundle。先用 `inspiration quote` 读取实时价格和余额,再按用户已授权的费用上限提交。不要把当前价格写死在 Skill 中。
14
14
 
15
15
  ```text
16
16
  inspiration quote [--config PRIVATE_CONFIG]
17
- inspiration add <URL> --confirm --max-credits N [--note "为什么收藏"] [--timeout 600] [--dry-run] [--config PRIVATE_CONFIG]
18
- inspiration status <task id> [--timeout 600] [--config PRIVATE_CONFIG]
17
+ inspiration add <URL> --confirm --max-credits N [--note "为什么收藏"] [--timeout 900] [--dry-run] [--config PRIVATE_CONFIG]
18
+ inspiration status <task id> [--timeout 900] [--config PRIVATE_CONFIG]
19
19
  ```
20
20
 
21
21
  `--dry-run` 不联网、不查询价格、不扣费。正式提交需要当前账号的 API Key;服务端按 `maxCredits` 再次检查费用。成功输出 `inspiration{id,platform,title,sourceUrl,imageCount}` 和 `task{created,chargedCredits}`;到 Key 所属账号的「我的灵感」查看。已保存或正在解析的同一链接会复用,实际扣费以 `task.chargedCredits` 为准。若等待超时,用输出中的 `inspiration status <task id>` 查询;它不会新建任务或再次扣费。解析失败时平台尝试退款,失败任务上的正数扣费可能尚在退款中。不要把 `--dry-run` 或本地模拟测试当作真实保存成功。
@@ -36,12 +36,12 @@ inspiration import --file bundle.json [--note "为什么收藏"] [--dry-run] [--
36
36
 
37
37
  ## 解析帖子链接(link parse)
38
38
 
39
- `popost link parse <URL>` 让 popost.ai 把 X、Instagram、TikTok、抖音、小红书、YouTube、Threads、LinkedIn、Reddit、哔哩哔哩、Lemon8、快手、微信公众号文章、微信视频号、微博之一的帖子链接解析成图片和文字,等到结果,把图片下载到本地,并写出 PostBundle;视频帖还会取回原视频文件(`video.mp4`,不另扣积分),用于分镜、字幕和声音分析(YouTube、哔哩哔哩和微信视频号只有封面和帖子信息)。需要先连接账户(运行 `popost auth login`;开发者也可使用环境变量 `POPOST_API_KEY` 或 `popost auth set` 保存的 Key;凭据与地址同官方通道,见 [providers.md](providers.md));没有 Key 时仍走上面的 `ticket` 和本地参考。Before submission run `link quote` for the current tariff and show the stage ceiling. Obtain fee authorization, then pass `--confirm --max-credits N`. The server rechecks the actual deduction against N; saved/active results may cost less. `task.chargedCredits` is the current net actual charge, not an advance quote. If the pricing service is unavailable, do not guess a price or parse to find it; use local reference images.
39
+ `popost link parse <URL>` 让 popost.ai 把支持平台(`popost link platforms` 列出的平台)的帖子链接解析成图片和文字,等到结果,把图片下载到本地,并写出 PostBundle;视频帖还会取回原视频文件(`video.mp4`,不另扣积分),用于分镜、字幕和声音分析(YouTube、哔哩哔哩和微信视频号只有封面和帖子信息)。需要先连接账户(运行 `popost auth login`;开发者也可使用环境变量 `POPOST_API_KEY` 或 `popost auth set` 保存的 Key;凭据与地址同官方通道,见 [providers.md](providers.md));没有 Key 时仍走上面的 `ticket` 和本地参考。Before submission run `link quote` for the current tariff and show the stage ceiling. Obtain fee authorization, then pass `--confirm --max-credits N`. The server rechecks the actual deduction against N; saved/active results may cost less. `task.chargedCredits` is the current net actual charge, not an advance quote. If the pricing service is unavailable, do not guess a price or parse to find it; use local reference images.
40
40
 
41
41
  ```text
42
42
  link quote [--config PRIVATE_CONFIG]
43
- link parse <URL> --confirm --max-credits N [--note "备注"] [--out DIR] [--timeout 600] [--no-download] [--no-video] [--dry-run] [--config PRIVATE_CONFIG]
44
- link status <task id> [--out DIR] [--timeout 600] [--no-download] [--no-video] [--config PRIVATE_CONFIG]
43
+ link parse <URL> --confirm --max-credits N [--note "备注"] [--out DIR] [--timeout 900] [--no-download] [--no-video] [--dry-run] [--config PRIVATE_CONFIG]
44
+ link status <task id> [--out DIR] [--timeout 900] [--no-download] [--no-video] [--config PRIVATE_CONFIG]
45
45
  ```
46
46
 
47
47
  1. Run `link quote` (free read-only platform tariff/balance query), show the parsing charge separately from image fees and obtain authorization. `--dry-run` only describes the request locally; it does not query a price. Then submit with `--confirm --max-credits N`.
@@ -49,7 +49,7 @@ link status <task id> [--out DIR] [--timeout 600] [--no-download] [--no-video] [
49
49
  视频帖(`post.kind=video`)的图片只有封面;原视频另存为 `video.mp4`(`.mov`、`.webm`,类型取自文件头),输出里是 `video`,bundle 里是 `resources` 中 `kind=video` 的一项(不进 `pageOrder`)。这一步不另扣积分;`--no-video` 跳过。平台给不出视频(YouTube、哔哩哔哩、微信视频号,或平台已不再提供这条视频)、或下载失败时解析照样成功,输出带 `videoMissing{code,error}`(如 `LINK_VIDEO_UNAVAILABLE`):bundle 只有封面和文字,要做视频分析时再请用户提供视频文件或录屏;下载失败可重跑 `link status` 再取。
50
50
  3. 链接已在用户的灵感库里时直接复用:`task.created=false`、`chargedCredits=0`。平台解析时已把这条帖子存入「我的灵感」,不要再对这个 bundle 跑 `inspiration import`,那会重复保存。
51
51
  4. 任务失败输出 `{ok:false, code, error, task}`,退出码 1,The platform attempts a refund; `chargedCredits` is the current net charge. A positive value on a failed task means refund pending, not refunded. Query status to reconcile.常见 code:`LINK_UNSUPPORTED`(不是五平台的帖子链接)、`LINK_POST_NOT_FOUND`(帖子不存在或不公开)、`LINK_PARSE_FAILED`、`LINK_IMAGES_FAILED`、`LINK_PARSE_UNAVAILABLE`。`LINK_UNSUPPORTED`、`INSUFFICIENT_CREDITS`、`RATE_LIMITED` 在建任务前就拒绝,没有任务,也没扣积分。
52
- 5. 等待:每 2 秒查询一次,最长 `--timeout` 秒(平台约 10 分钟仍未完成的任务会判失败);个别查询失败(网络、5xx)会容忍,连续 5 次失败才停;被限流时按平台给的时间等待后再查,不算失败。超时、停止等待或命令被打断时,解析可能仍在平台进行:用输出里的 `popost link status <task id>` 继续等待并下载,它不会新建任务、也不会再扣积分。图片下载失败时已下载的保留,同样重跑 `link status`(图片地址每次查询都会重新签发)。`--no-download` 不下载,只打印帖子和图片地址,地址是短期签名链接。
52
+ 5. 等待:每 2 秒查询一次,最长 `--timeout` 秒(默认 900 秒;平台约 15 分钟仍未完成的任务会判失败);个别查询失败(网络、5xx)会容忍,连续 5 次失败才停;被限流时按平台给的时间等待后再查,不算失败。超时、停止等待或命令被打断时,解析可能仍在平台进行:用输出里的 `popost link status <task id>` 继续等待并下载,它不会新建任务、也不会再扣积分。图片下载失败时已下载的保留,同样重跑 `link status`(图片地址每次查询都会重新签发)。`--no-download` 不下载,只打印帖子和图片地址,地址是短期签名链接。
53
53
  6. 建任务的请求超时或断连,结果不确定(`UNCERTAIN`):不自动重试,先告诉用户。重新运行同一条命令是安全的:同一链接的任务仍在进行时会并入同一个任务、不重复扣;已保存的链接直接返回、也不再扣。
54
54
 
55
55
  退出码:0 成功;1 平台拒绝、任务失败、结果不确定或等待未完成;2 本地参数或环境问题(缺 Key、链接格式、`--out` 是文件)。
@@ -27,10 +27,14 @@ span. Incoming transitions and ordered caption cues are adjusted when shots chan
27
27
  cross-shot spans retain their intent. Splitting a scene preserves its animation clock through `base.offset` (seconds).
28
28
  Ordinary audio uses `in` in project frames; video-backed audio beds use source frames.
29
29
 
30
- Cloud saving uses the same authorization service as image projects: a configured key syncs at startup and after a three
31
- second quiet period; without a key, Save to cloud opens the project-scoped browser authorization flow. A browser ticket
32
- permits one successful sync. Later anonymous edits stay local until another authorization. Conflicts never overwrite a
33
- newer cloud revision automatically. The controls mirror the image editor: waiting and uploading states, a copyable login link when popups are blocked, retained-credential retries, keyed conflict overwrite and an Open link after saving. Cloud actions first flush focused fields and pending JSON edits; an invalid local draft prevents upload. The editor's `.studio/cloud.json` stores the stable project id, file upload receipts
30
+ Cloud saving works as in image projects: with a connected account (API Key or device connection) the project syncs at
31
+ startup and after a three second quiet period, and `popost video render` syncs it too. Without an account, Save to Cloud
32
+ starts the full account connection (the device authorization of `popost auth login`): the control shows the device code
33
+ and a copyable link while it waits for the approval on popost.ai, then the account is connected, syncing starts and the
34
+ control reads "Cloud sync is on" (hover: to turn it off, go to Connections & API Key on the platform). The account's
35
+ cloud-sync switch lives on that page of popost.ai; while it is off nothing is synced and the control reads "Cloud sync
36
+ is off", a link to the page. Conflicts never overwrite a newer cloud revision automatically. The controls mirror the
37
+ image editor: waiting and uploading states, retries, conflict overwrite and an Open link after saving. Cloud actions first flush focused fields and pending JSON edits; an invalid local draft prevents upload. The editor's `.studio/cloud.json` stores the stable project id, file upload receipts
34
38
  and sync revision; it never stores credentials.
35
39
 
36
40
  Video sync preserves the source document, scene HTML/CSS/scripts and referenced media. Files upload directly to signed
@@ -38,10 +42,18 @@ storage URLs and are reused by content hash. The web asset retains the complete
38
42
  a ZIP; extract it and reopen its folder with the local Studio. This is source-project preservation; it does not regenerate
39
43
  a flattened MP4 for every local text edit.
40
44
 
41
- Export is a compact settings dialog for MP4 or an editable desktop draft. Selecting 4K shows the paid-resolution guidance
42
- and pricing link when the account has no entitlement; the server verifies the entitlement before rendering. Completed
45
+ Export is a compact settings dialog for MP4 or an editable desktop draft. Selecting 4K while it is locked keeps the current resolution and shows a prompt in place (connect the account, or see the plans; both pages are opened by the local service in the system browser, never in the Agent's side panel; see `host-editor.md`, 「付费导出项」), and 4K selects itself once the account is paid. The local service verifies the entitlement again before rendering. Completed
43
46
  exports remain in the project folder.
44
47
 
48
+ ## Narrow windows (an agent's side panel)
49
+
50
+ Below 820 px of width the Studio has no column for the side panel: a rail button (Media, Elements, Subtitles, Code)
51
+ opens its panel as a drawer over the stage, and the close button, Escape, a click outside or the same rail button
52
+ closes it. Below 640 px the properties are a drawer too, opened with the Properties button above the stage once
53
+ something is selected, so a selection never takes the stage away. The top bar, the stage, the transport and the
54
+ timeline stay inside the window from 360 px up; the timeline's tools scroll sideways. At 820 px and wider the layout
55
+ is the three-column one.
56
+
45
57
  ## Reference comparison and account synchronization
46
58
 
47
- Open a remake with `popost video preview P --edit --reference <original-video>`. The Studio preserves this reference inside the project and includes it in cloud synchronization, so reopening locally or in hosted Studio retains the side-by-side comparison. The reference appears on the left and the current editable video on the right, driven by the same timeline. A project without reference footage shows a clear message when Compare is clicked; a cover image is not reference footage. Keep default cloud synchronization enabled. Authorized accounts sync automatically at startup and after edits, including when authorization completes after Studio opened. Without an account, Save to Cloud opens the same browser authorization flow as the image canvas.
59
+ Open a remake with `popost video preview P --edit --reference <original-video>`. The Studio preserves this reference inside the project and includes it in cloud synchronization, so reopening locally or in hosted Studio retains the side-by-side comparison. The reference appears on the left and the current editable video on the right, driven by the same timeline. A project that has a reference is a replication of it, so the Studio opens with the comparison on; a project without one opens with it off. The Compare button switches it, and the Studio keeps that choice for the project (in the browser) and opens it that way the next time. Where the two pictures are larger above each other than side by side (a landscape video in a narrow, tall panel), they are stacked, the reference on top. A project without reference footage shows a clear message when Compare is clicked; a cover image is not reference footage. Keep default cloud synchronization enabled. Authorized accounts sync automatically at startup and after edits, including when authorization completes after Studio opened. Without an account, Save to Cloud opens the same browser authorization flow as the image canvas.
@@ -22,9 +22,9 @@ Write `project/cast.json`:
22
22
 
23
23
  `popost video cast prepare project --requests materials.json` counts independent generation requests and prints the necessary host image jobs. Without a request list, `shots` is a conservative estimate of recurrence. For recurring roles, actually use the host image generator without the original person's portrait, inspect its output and import it with `popost video cast complete project --role host --file generated.png --tool image_gen`. User/library identities require their actual selected picture. A new role in one generated clip can leave `image` absent. The materials command also counts role uses across its request list.
24
24
 
25
- Each video material lists `"cast":["host"]`; `[]` explicitly means no visible person. Send the generated identity pictures, product assets and measured motion descriptions to the video model. Do not send the raw original creator's video as a generation reference: a model may copy its face despite a text instruction. The engine refuses this combination. Keep role ids stable; a different identity or voice uses a new output filename rather than silently reusing a previous clip.
25
+ Each video material lists `"cast":["host"]`; `[]` explicitly means no visible person. Send the generated identity pictures and measured motion descriptions to the video model. A product the person holds, opens, wears or applies is never left to the prompt's words or to the identity picture: the request also lists `"products":["<id>"]`, and the user's own pictures of it and the product block of the sheet go with it ([video-product.md](video-product.md)). The product's pictures come before the cast's when a model takes few reference pictures; when both do not fit, show the person and the product in separate clips, or carry the product with its real picture. Write into the prompt how the hand holds it and what it does with it, as the sheet's `use` says; ask for one product action per clip, and keep label and packshot moments for the real picture. A user's product picture may show a person: only the product is taken from it, never that person's face. Do not send the raw original creator's video as a generation reference: a model may copy its face despite a text instruction. The engine refuses this combination. Keep role ids stable; a different identity or voice uses a new output filename rather than silently reusing a previous clip.
26
26
 
27
- Before delivery, inspect the opening, later appearances and each new clip boundary. Check both requirements separately: the person is visibly different from the reference and is consistent with the new cast image throughout the result. Record any drift honestly; a valid manifest or image hash does not prove visual identity quality.
27
+ Before delivery, inspect the opening, later appearances and each new clip boundary. Check both requirements separately: the person is visibly different from the reference and is consistent with the new cast image throughout the result. A person who stayed the same proves nothing about what they hold: the product has its own check against the user's picture (`popost video product sheet`). Record any drift honestly; a valid manifest or image hash does not prove visual identity quality.
28
28
 
29
29
  ## Photographic people should feel alive
30
30
 
@@ -0,0 +1,174 @@
1
+ # The user's product
2
+
3
+ Use these rules for every video that shows a product the user supplied: a selling video, a demonstration, an
4
+ unboxing, one clip or many. The product in the video is the product in the user's picture: the same shape,
5
+ proportions, size against the hand, printed text, colours, parts and count, in every frame of every shot. Words in a
6
+ prompt do not hold that: "the serum tube" gives another tube in every clip, and a clip that was not shown the
7
+ picture draws a product of its own. A viewer who is sold one thing and shown another has been misled.
8
+
9
+ Product first. Before any clip or picture is generated:
10
+
11
+ 1. Write the product sheet from the user's pictures and words.
12
+ 2. Show the user what you inferred, in one line, with the plan and its cost.
13
+ 3. Plan each shot by how the product's identity is carried in it.
14
+ 4. Mark every request that shows the product; the pictures and the product block go with it by themselves.
15
+ 5. After generation, check the product in every clip and in the finished video, by eye.
16
+
17
+ ## 1. The product sheet
18
+
19
+ ```bash
20
+ popost video product init project --picture <file the user gave> [--picture <another>] [--id flask]
21
+ ```
22
+
23
+ It copies every picture into `project/assets/product/` byte for byte and writes the skeleton of
24
+ `project/production/product.json`. The pictures are the user's files as they sent them, **all of them**: never a
25
+ crop, a cut-out, a redraw, a re-compressed copy or a choice among them. A crop made to read a label is for your own
26
+ looking and stays out of the sheet. One product per `--id`; a video with two products runs `init` twice.
27
+
28
+ Open each picture, then fill in every fact. Each fact says where it comes from:
29
+
30
+ | `from` | Meaning | Needs |
31
+ |---|---|---|
32
+ | `user` | the user said it (their message, their product page) | `quote`: their words. These always win |
33
+ | `picture` | you read it from the product picture | nothing; it is inferred |
34
+ | `usage` | you derived it from how such a product is normally used | nothing; it is inferred |
35
+
36
+ ```json
37
+ { "version": 1, "products": [{
38
+ "id": "flask",
39
+ "names": ["Northwind", "flask", "bottle"],
40
+ "pictures": [{ "file": "assets/product/flask-01.png", "sha256": "..." }],
41
+ "constant": ["the screw cap with its steel loop stays on unless it is being opened", "the wordmark runs down the front"],
42
+ "what": { "value": "a Northwind 500 ml insulated steel flask", "from": "user", "quote": "my Northwind 500 ml flask" },
43
+ "label": { "value": "NORTHWIND 500", "from": "picture" },
44
+ "shape": { "value": "a straight cylinder with a short shoulder and a flat screw cap, about 3.5 times as tall as wide", "from": "picture" },
45
+ "size": { "value": "about 24 cm tall and 7 cm wide", "from": "picture" },
46
+ "sizeAnchor": { "value": "a little longer than an adult hand, held in one hand with the fingers closing round it", "from": "picture" },
47
+ "colour": { "value": "matte dark blue body, brushed steel cap and base ring", "from": "picture" },
48
+ "material": { "value": "powder-coated steel, matte", "from": "picture" },
49
+ "parts": { "value": "the cap unscrews anticlockwise and comes off whole", "from": "picture" },
50
+ "use": { "value": "unscrew the cap, drink from the open neck, screw the cap back on", "from": "usage" },
51
+ "quantity": { "value": "1 flask", "from": "picture" }
52
+ }] }
53
+ ```
54
+
55
+ - `what`: what it is, with brand and name as the user or the label gives them. `label`: the printed text exactly,
56
+ letter for letter, in reading order (`"none"` when nothing is printed). Never complete or translate a label you
57
+ cannot read: write what is legible and say so to the user.
58
+ - `shape`: outline and proportions (body, shoulder, neck, tip or cap, base; height to width). `size`: the real size
59
+ with a number and a unit; the user's or the label's number, else an estimate against the hand in the picture.
60
+ `sizeAnchor`: how large it looks against a hand, a face, a body or a common object.
61
+ - `colour`, `material`: which colour is where; matte, glossy, metallic, transparent. `parts`: each part and how it
62
+ moves or opens (cap, lid, pump, tip, zipper, strap). Leave `material` or `parts` out when there is none.
63
+ - `use`: how it is held, opened, worn or applied, step by step. `quantity`: how many are in a shot, number first.
64
+ - `names`: the words a prompt calls it by (its name and its kind). `constant`: what must be the same in every
65
+ frame, each line said as what is there ("the tip is a long bare cone"), not as what to avoid ("no pump"): a model
66
+ draws what a prompt names.
67
+ - Invent nothing: no variant, flavour, size, accessory, packaging or label text the user's pictures and words do not
68
+ show. When a fact cannot be read and the user did not say it, ask.
69
+
70
+ `popost video product check project` validates the sheet (every picture is the recorded file, every fact filled,
71
+ nothing shared between two products) and prints each product's `block`: the text every request that shows it is sent
72
+ with. It is built from the sheet alone, so it is the same in every clip. Whether two free-text facts contradict each
73
+ other the program cannot tell: read the block once as a whole before showing it.
74
+
75
+ ## 2. The user confirms what was inferred
76
+
77
+ `product check` prints `confirm`: one line with every fact that is not the user's. Put that line into the message
78
+ that shows the plan and its cost (step 1), so the user corrects or agrees in the same answer. A correction goes into
79
+ the sheet as `"from": "user"` with their words. Then:
80
+
81
+ ```bash
82
+ popost video product confirm project --quote "<the user's answer>"
83
+ ```
84
+
85
+ Paid generation of anything that shows the product waits for it (`materials` prices the list before, and stops
86
+ with an error after). The answer is bound to the facts: a fact edited later is asked about again. When nobody can be
87
+ asked (a batch the user commissioned to run without questions), `--unattended "<who authorised that, in their words>"`
88
+ records it, and the delivery notes list the inferred facts as unconfirmed. Never write an answer the user did not give.
89
+
90
+ ## 3. Plan the shots: real picture first
91
+
92
+ | The shot | How the product is carried |
93
+ |---|---|
94
+ | packshot, close-up, label or detail shot, the product alone on a ground, a price or offer card | the user's real picture in a scene (an `"image"` item or `<img>`), moved with the scene's own motion: push-in, drift, a light sweep, a reveal. Not generated: no model redraws the label |
95
+ | the product must be seen from the exact picture and then move | a clip whose `"firstFrame"` is the user's picture, or a still composed from it (the picture on a ground or in a scene, product pixels unchanged) and listed under `"stills"` of the product with its `sha256` and how it was `made` |
96
+ | a person holds, opens, wears or applies it; it is used in a place | a generated clip with the product's pictures as references and the product block (section 4) |
97
+
98
+ - One clip per product action when a long clip would let the product drift: holding it up, opening or dispensing,
99
+ turning it, applying it are separate requests with the same block. `materials --check` warns about a clip of 10 s
100
+ or more that handles the product in several actions. A speaking clip that needs its lines in one piece may stay
101
+ long; check the product at every action then.
102
+ - A clip that `"continues"` another starts from a generated frame, which the pictures cannot go with: continue only
103
+ a clip whose product check passed, else make the part as its own clip.
104
+ - Text on the product is the hardest thing for a model to keep. A shot whose point is the label is a real-picture shot.
105
+
106
+ ## 4. Requests that show the product
107
+
108
+ In a project with a product sheet every material request says `"products"`: the ids it shows, or `[]` for none.
109
+
110
+ ```json
111
+ [{ "file": "assets/hold.mp4", "prompt": "a hand lifts the flask from a desk and turns it to the camera", "seconds": 5,
112
+ "aspect": "9:16", "cast": [], "products": ["flask"] },
113
+ { "file": "assets/street.mp4", "prompt": "a wet street at dusk", "seconds": 5, "aspect": "9:16", "cast": [], "products": [] }]
114
+ ```
115
+
116
+ Write the action and the framing into `prompt` and leave the product to the sheet: do not describe it again in your
117
+ own words, and do not list its pictures in `"images"`. For each product of the request `materials` adds every picture
118
+ of it to the reference pictures (after the request's own `"images"`, whose `@image` numbers stay) and the product block
119
+ to the prompt, and keeps what was sent in `<clip>.product.json`. A clip from a frame gets the block alone.
120
+
121
+ `materials --check` (and every run) refuses, before anything is paid:
122
+
123
+ - a request without `"products"`; when its prompt says one of the product's `names`, the message says so;
124
+ - a product request whose model takes no reference pictures, or fewer than the product has: choose a model that
125
+ takes them (`popost video generate --models`, `maxReferenceImages`), or make the shot from the real picture
126
+ (section 3). A picture is never left out to make a request fit;
127
+ - a product clip whose `"firstFrame"` is not one of the user's pictures or a listed still;
128
+ - a sheet with errors; and, once the list is to be paid for, inferred facts the user has not confirmed.
129
+
130
+ Reference pictures have an order when a model takes few: the product's pictures, then the cast's identity pictures,
131
+ then the request's own `"images"`, then the shared anchor frame. The anchor is left out with a note when there is no
132
+ room. A list whose product, cast and own pictures do not fit is refused with what to remove: its own pictures first,
133
+ then fewer people with identity pictures in that clip, or two clips. The product's pictures always go, and the
134
+ anchor never speaks for the product: its sentence says the product follows its own pictures. With a product sheet,
135
+ do not pass the product's picture as `--anchor-image`.
136
+
137
+ An existing file made before the sheet, or before the sheet changed, is reported and not reused under the same
138
+ name: give the request a new file name (a new clip is an unplanned clip under the money rule).
139
+
140
+ ## 5. The product check
141
+
142
+ Attaching the pictures is necessary and not enough: a model may still redraw the product. A valid list, a receipt,
143
+ a passed `replication check` or a `compare` score says nothing about it. Only looking does. For every clip that
144
+ shows a product, right after it is made, and for the finished video:
145
+
146
+ ```bash
147
+ popost video product sheet project --file assets/hold.mp4 # opening, middle and end of the clip
148
+ popost video product sheet project --file final.mp4 --product flask --at 3.2,4.5,5.8,21,22.4,23.6
149
+ popost video product review project --file assets/hold.mp4 --passed --note "<what was compared>"
150
+ popost video product check project --deliver --final final.mp4 # before delivery: exit code 0
151
+ ```
152
+
153
+ `sheet` writes `review/product/*.jpg`: the user's picture(s) in an orange frame on the left, frames of the file to
154
+ the right (four a sheet; `seconds` in the output says which). For the finished video give `--at` the opening, middle
155
+ and end of every shot that shows the product. Open every sheet and compare each frame with the picture on every
156
+ point of `compare`: shape and outline; proportions; size against the hand, face or body; printed text letter by
157
+ letter; colours and where each is; parts and how they move; count; how it is held and used. Look also where a clip
158
+ changes action and at each clip boundary: drift shows there first.
159
+
160
+ - All agree: `--passed`, with what you compared.
161
+ - Anything differs (another cap, a shorter body, a wrong or blurred wordmark, another colour, two where one was,
162
+ another size in the hand): `--failed --note "<what differs, at which second>"`. A failed clip is made again within
163
+ the agreed repair allowance, as a changed request under a new file name (one product action, a simpler move or a
164
+ closer framing; the identical request would return the same clip; it is an unplanned clip, `--approve-unplanned`
165
+ once covered), and after a second failure its shot is replaced by one composed from the real picture (section 3). It is
166
+ **never delivered with a note**: `product check --deliver` refuses a project that still uses it.
167
+ - You cannot look at pictures: you cannot pass this check. Record `--unseen --note "<why>"`, tell the user in plain
168
+ words that the product was not checked by eye, give them the sheets and ask; their answer is recorded with
169
+ `--passed|--failed --by user --note "<their words>"`. Never present such a video as checked.
170
+
171
+ A verdict belongs to the bytes that were looked at: a clip made again, or a new render, is unchecked until its own
172
+ sheet is built and judged. The delivery notes say, for the product: how many pictures the user gave and that all
173
+ went with every product clip, which shots use the real picture and which are generated, the verdict of each check,
174
+ what was regenerated or replaced, and any inferred fact the user did not confirm.
@@ -1,6 +1,6 @@
1
1
  # Strict video replication
2
2
 
3
- Use this workflow when a reference supplies the video's format and the user replaces its subject, product, characters, or text. The user's brief can remain short. The agent must do the reference reading, event inventory, production mapping, and evidence review internally before spending on new media. A request to preserve the reference is not satisfied by matching its duration and broad layout alone.
3
+ Use this workflow when a reference supplies the video's format and the user replaces its subject, product, characters, or text. A replaced product follows [the user's product](video-product.md): the contract's events say what happens to a product, the product sheet says which product it is, and neither a passed inventory nor a review of events is a product check. The user's brief can remain short. The agent must do the reference reading, event inventory, production mapping, and evidence review internally before spending on new media. A request to preserve the reference is not satisfied by matching its duration and broad layout alone.
4
4
 
5
5
  This workflow extends [video.md](video.md), [video-elements.md](video-elements.md), [video-templates.md](video-templates.md), and [video-scenes.md](video-scenes.md). It does not replace their editable-project, generation, audio, budget, or delivery rules.
6
6
 
@@ -139,6 +139,11 @@ The cost overview and the one budget, now that the reference is read (leave out
139
139
  unless the user asks for one in their own words.
140
140
  - Generated clips and pictures: their price per second or per picture (`popost video generate --models`) times what
141
141
  you plan. Every on-camera stretch is a clip in which a person speaks, as long as the stretch (`video-performers.md`).
142
+ - The user's product, when they supplied one: write the product sheet now (`popost video product init`, then its
143
+ facts; [video-product.md](video-product.md)) and put the `confirm` line of `popost video product check project`
144
+ into this overview: what you read from their picture and from how such a product is used, for them to correct or
145
+ agree to in the same answer. Say which shots use their real picture and which are generated with it as reference.
146
+ Record the answer with `popost video product confirm`; paid generation of product shots waits for it.
142
147
  - The transcription already paid (`chargedCredits` of `describe`).
143
148
  - The music plan: `popost video music plan --project project --reading ref` proposes it from the reading of the
144
149
  reference's sound (one bed: the user's file first; else the reference's own music, kept as it is, when nobody speaks
@@ -148,7 +153,16 @@ The cost overview and the one budget, now that the reference is read (leave out
148
153
  its music, ask for their own file first. When it says generated music is not available, say that one line and plan
149
154
  without a generated bed.
150
155
 
151
- Show the remaining items, estimated total and balance, including any proposed quality-repair allowance. Apply the
156
+ Show the remaining items, estimated total and balance, including any proposed quality-repair allowance, in the one
157
+ message that asks for the budget. The user must not have to ask which model or settings the money buys: for every
158
+ generated clip or picture that message names the model (its name and its `id` from `popost video generate --models`),
159
+ the resolution, the length of each generated clip (the seconds the model makes, which can differ from the finished
160
+ cut: say "an 8 s clip for a 7.5 s video" when they differ), the aspect ratio, how many, how it is billed (per second
161
+ or per picture) and its credits; then every other paid item with its credits, and the total that becomes the cap. For
162
+ example: "<model name> (`<model id>`), 1 clip of 8 s, 9:16, 720p, billed per second: 72 credits; reference sound
163
+ analysis: 7 credits; total at most 79 credits, balance 88." When the user changes a setting (resolution, model,
164
+ length, count), quote again before running anything at the old price: show the new price, what has already been
165
+ charged and what is still to come, and use the new total as the cap from then on. Apply the
152
166
  existing commission/batch allocation when it covers them; agree a new scope/budget only where coverage is missing
153
167
  (the shared money rule above). Do not make every video in an already authorized batch repeat the same fee interview.
154
168
  The user agrees once; do not ask per command after that. When speaking people cost more than the user wants to spend,
@@ -2,7 +2,10 @@
2
2
 
3
3
  Step 3 of [making a video](video.md), whose rules for every step hold here; before it: [step 2, Keep its structure](video-step-2-structure.md); after it: [step 4, Write the lines and the fill](video-step-4-lines.md).
4
4
 
5
- The user's topic decides what the video shows. Before designing any scene, collect every source the request names (a
5
+ The user's topic decides what the video shows. A product the user supplied comes first: its sheet is written and its
6
+ inferred facts confirmed before any clip or picture is generated, and every shot is planned by how the product is
7
+ carried in it ([video-product.md](video-product.md): the real picture in a scene for packshots, close-ups and label
8
+ shots; generated clips only where it is held or used). Before designing any scene, collect every source the request names (a
6
9
  page, a README, a file), each with:
7
10
 
8
11
  ```bash
@@ -101,10 +104,14 @@ its clips the agreed clips; any other paid clip later is "unplanned" (the money
101
104
  - A clip is never slowed down to fill a shot (the checks warn about a `"speed"` under 0.9): ask for a clip as long as
102
105
  the shot needs (`footage.seconds` in `template show`), make a second clip, or start earlier. A clip that moves less
103
106
  than its shot may be sped up with a `"speed"` above 1 when it is long enough.
104
- - The clips of one video keep the same person, product and place through one anchor picture, which `materials`
107
+ - The user's product is not carried by the anchor or by words: in a project with a product sheet every request says
108
+ `"products": ["<id>"]` (or `[]`), and `materials` sends each product request with all the user's pictures of it and
109
+ the same product block, or refuses the list (`video-product.md`). One request per product action; look at each
110
+ product clip beside the user's picture as soon as it is made (`popost video product sheet`, then `product review`).
111
+ - The clips of one video keep the same person and place through one anchor picture, which `materials`
105
112
  takes care of by itself. When the request names a character of the user's popost.ai library, pass it with
106
- `--character <id>`; when it gives a photo of the person or the product, with `--anchor-image <file>`. A clip that
107
- shares nothing with the others says `"anchor": false` (`video-tools.md`).
113
+ `--character <id>`; when it gives a photo of the person, with `--anchor-image <file>` (the product's picture goes
114
+ through the product sheet, not here). A clip that shares nothing with the others says `"anchor": false` (`video-tools.md`).
108
115
  - A shot longer than the longest clip the model makes: `template save --max-shot <seconds>` cuts it into parts, and
109
116
  the clip of each later part says `"continues"` with the file of the part before it, so it starts from that clip's
110
117
  last frame. Reference pictures stay the default; frames are for that and for a clip
@@ -113,5 +120,6 @@ its clips the agreed clips; any other paid clip later is "unplanned" (the money
113
120
  Then write `project/materials.json`, one entry per file, saying what it shows:
114
121
  `{ "assets/page-01.mp4": "the pricing page: zooms to the Pro plan, boxes its price, the pointer clicks Buy" }`.
115
122
 
116
- Done when: every footage or picture shot you plan has its file in `project/assets/`, listed in `materials.json`, and
117
- you have looked at two frames of every recording.
123
+ Done when: every footage or picture shot you plan has its file in `project/assets/`, listed in `materials.json`,
124
+ you have looked at two frames of every recording, and every generated file that shows the user's product has a
125
+ passed product check (`popost video product check project` lists them under `review`).
@@ -21,6 +21,24 @@ popost video render project --out final.mp4
21
21
  popost video compare reference.mp4 final.mp4
22
22
  ```
23
23
 
24
+ **The product check comes before any other review** when the user supplied a product
25
+ ([video-product.md](video-product.md), "The product check"). None of `compare`, `replication check` or a valid
26
+ materials list looks at it. Build the sheet of the finished video at the opening, middle and end of every shot that
27
+ shows the product, open each sheet, and compare every frame with the user's picture (orange frame): shape,
28
+ proportions, size against the hand or body, printed text, colours, parts, count, use.
29
+
30
+ ```bash
31
+ popost video product sheet project --file final.mp4 --product <id> --at <seconds>
32
+ popost video product review project --file final.mp4 --passed|--failed --note "<what was compared and found>"
33
+ popost video product check project --deliver --final final.mp4
34
+ ```
35
+
36
+ `product check --deliver` must exit with 0: every clip the video uses that shows the product, and the video itself,
37
+ passed for the bytes as they are. A mismatch is a failed clip: make it again within the agreed repair allowance or
38
+ replace the shot with one composed from the real picture, render again and check again; it is never delivered with a
39
+ note. An agent that cannot look at pictures cannot pass this check: it records `--unseen`, tells the user so and
40
+ gives them the sheets; only the user's own verdict passes it then.
41
+
24
42
  `compare` scores the whole video per dimension from 0 to 1 (1 is the same), then prints `shots` (each shot of the
25
43
  reference against the matching part of yours), `motionAmount` (how much the picture moves in both videos; `less` and
26
44
  `more` list the shots that move less than half or more than twice as much as the reference's, and its `note` says what
@@ -70,6 +88,14 @@ With effects, run the `look` command `sfx place` printed, on the render, and ope
70
88
  effect meets its picture something moves or lands, or the effect goes (a sound ahead of its picture is worse than one a
71
89
  frame late). Effects are not in `compare`'s scores.
72
90
 
91
+ With a connected account (API Key or device connection) whose cloud-sync switch is on, `render` also syncs the
92
+ project (video.json and the files it names) to the user's popost.ai projects once the MP4 is written, whether or not
93
+ the Studio is open: `cloud` in its output is `{"state":"saved","webUrl":…}`, `{"state":"failed","error":…}` (the MP4
94
+ stands; deliver it and say what failed) or `{"state":"paused","manageUrl":…}` (the user turned cloud sync off on
95
+ popost.ai, Connections & API Key: nothing was sent; say so once, with the address). Without an account there is no
96
+ `cloud` field and nothing is sent. `--cloud off` renders without syncing; use it only when the user asked for no cloud
97
+ saving.
98
+
73
99
  Open the editable Studio with the existing preview editor (selection, timeline operations and cloud saving: [video-editing.md](video-editing.md)):
74
100
 
75
101
  ```bash
@@ -82,9 +108,18 @@ output and use its `url`; do not guess a port. Fetch `api/state` under that URL
82
108
  text edit saves, undo restores it, a reload keeps the saved state, and the editor can render. Use the same project
83
109
  that produced the delivered video. The URL is a local editor on this computer while that service runs.
84
110
 
111
+ The project's caches clean themselves: `render` removes the video frames it extracted once the MP4 is written
112
+ (`framesFreedBytes`), and a later render or Studio extracts them again. Never copy, archive or hand over `.cache/`
113
+ with a project, and when the user is short of disk space run `popost video clean project` (or
114
+ `popost video clean --all <dir> --dry-run` to size every project below a directory; video-tools.md, "What a project
115
+ keeps on disk").
116
+
85
117
  When a template deliberately drops trailing platform shots, `compare` reports the retained reference interval and `omittedShots` after checking its sampled visual fingerprint. An unrelated reference or an older project without that provenance is compared in full; do not read the omitted endcard as a failure of the new closing.
86
118
 
87
- Deliver `final.mp4`, its editable Studio URL, the `project/` directory and the delivery notes (`NOTES.md`): what is as in
119
+ Deliver `final.mp4`, its editable Studio URL, the `project/` directory and the delivery notes (`NOTES.md`): for the
120
+ user's product, how many pictures they gave and that all went with every product clip, which shots use the real
121
+ picture and which are generated, each product check's verdict, what was made again or replaced, and any inferred
122
+ fact they did not confirm; what is as in
88
123
  the reference, what differs and why (no voice, a missing tool, a source that did not have something), each shot of
89
124
  the last `worst` that was not fixed, with its reason, and under "Not recovered" every entry of `compare`'s
90
125
  `notRecovered` (the reading's list and what you added to `elements.json`): what was not recovered and what the video
@@ -56,6 +56,35 @@ terminated through that owned process handle. Screenshot capture waits for the b
56
56
  | `POPOST_RENDER_PAGES` | how many browser pages draw frames side by side | by the size of the job |
57
57
  | `POPOST_VIDEO_WORK` | where caches and scratch files go (a voice's measured pace, test renders) | `.popost/video` under the working directory |
58
58
  | `TMPDIR` | temporary files (frames, audio); point it at a disk when `/tmp` is small | the system's |
59
+ | `POPOST_VIDEO_CACHE_MAX_MB` | the size cap of one project's frame cache (`.cache/video`), in MB | `2048` |
60
+
61
+ ## What a project keeps on disk, and what cleans it
62
+
63
+ A project keeps three things only to save work. Each is made again when a command needs it, so none of them is part
64
+ of the project: leave `.cache/` out when you copy, archive or hand over a project.
65
+
66
+ | Where | What | How it is bounded |
67
+ |---|---|---|
68
+ | `.cache/video/<key>/` | the frames of each video material the timeline shows, as pictures (a long clip at full size takes gigabytes) | every build removes the frames of clips the project no longer has (another file, size or date); a whole `render` removes what it extracted once the MP4 is written; above the cap the least recently used directories go; anything unused for a day goes |
69
+ | `.cache/render-chunks/<set>/` | the shots of the last render with each size and setting | each render keeps only the shots it used; a set no render used for a day goes |
70
+ | `.studio/drafts/<hash>/` | the media of a draft made for a desktop editor | removed by `popost video clean` |
71
+
72
+ Nothing is removed that an open Studio or a running render shows, and after a render the next `render`, `frame` or
73
+ Studio extracts what it needs again by itself (the kept shots are still reused). When the frames one timeline shows
74
+ are alone larger than the cap they stay, and the command says so once as a `warning` in `problems`: nothing is to
75
+ correct. `popost video doctor`, run in a project, prints what its caches take (`cache`).
76
+
77
+ ```bash
78
+ popost video clean project # remove this project's caches now
79
+ popost video clean --all ~/videos --dry-run # every project below a directory: what would go, and its size
80
+ popost video clean --all ~/videos # the same, removed
81
+ ```
82
+
83
+ `clean` prints one JSON document with the bytes freed per project. It removes only the three caches above (each
84
+ directory only when it holds nothing but what the engine wrote there): never a video, a material, `ref/`, a receipt
85
+ or `.studio/cloud.json`. `--all` looks up to six levels below the directory, passes over `node_modules` and `.git`
86
+ and follows no link. Projects made with a version before the automatic clean-up may hold many gigabytes of old
87
+ frames: run `clean --all` on the directory that holds them once.
59
88
 
60
89
  ## Paying for popost.ai under the shared authorization
61
90
 
@@ -293,9 +322,14 @@ built-in generator").
293
322
 
294
323
  ```json
295
324
  [{ "file": "assets/walk.mp4", "prompt": "a woman walks briskly through a market, handheld, the camera follows",
296
- "seconds": 5, "aspect": "9:16", "images": ["assets/product.png"], "note": "the walk through the market" }]
325
+ "seconds": 5, "aspect": "9:16", "images": ["assets/market.png"], "note": "the walk through the market" }]
297
326
  ```
298
327
 
328
+ - `products`: in a project with a product sheet (`production/product.json`), the ids of the user's products the file
329
+ shows, or `[]` for none; required on every request. Each product's pictures (all the user gave) are added to the
330
+ reference pictures and its product block to the prompt, and `--check` refuses a list that names the product
331
+ without it, a model that cannot take the pictures, or a first frame that is not the real product
332
+ ([video-product.md](video-product.md)).
299
333
  - `file`: where it goes in the project; `.mp4` is a clip, `.png`, `.jpg` or `.webp` a picture. `seconds`: whole
300
334
  seconds of a clip. `aspect`: the canvas's ratio. `images`, `videos`, `audios`: reference files of the project, which
301
335
  the prompt names in order as `@image1`, `@video1`, `@audio1`. `note`: what it shows, for `materials.json`
@@ -343,7 +377,7 @@ picture does not change the price.
343
377
 
344
378
  | Option | What it does |
345
379
  |---|---|
346
- | `--anchor-image <file>` | a picture of the user's (the person, the product) is the anchor of every clip; no clip is made first |
380
+ | `--anchor-image <file>` | a picture of the user's (the person, the place) is the anchor of every clip; no clip is made first. The user's product goes through the product sheet and `"products"`, not through the anchor: an anchor is one picture among the references of clips without a cast, with a sentence that asks for likeness; it does not carry the product's facts and is the first picture left out when a model takes few |
347
381
  | `--character <id>` | a character of the user's popost.ai character library is the anchor: its picture is downloaded to `assets/character-<id>.png` and every clip that shows a person shows that one. Needs the account (`popost auth login`) |
348
382
  | `"anchor": false` in a request | this clip neither gives nor takes the picture. For a clip that shares nothing with the others (another place and subject, a cutaway, an abstract ground): a reference picture pulls a clip towards what it shows |
349
383
  | `--no-anchor` | no anchor at all: unrelated clips, or a generator that takes no reference pictures |
@@ -374,11 +408,13 @@ one piece under those shots instead of being cut and re-timed with each (`video-
374
408
 
375
409
  **Reference pictures or frames.** A clip is steered in one of two ways, never both in one request:
376
410
 
377
- - Reference pictures (`"images"`, the anchor): who or what is in the clip. The model composes the shot itself and
378
- keeps the person or the product of the pictures. This is the default, and the way to keep identity across clips.
411
+ - Reference pictures (`"images"`, the anchor, the cast's identity pictures, the product's pictures): who or what is
412
+ in the clip. The model composes the shot itself and keeps the person or the product of the pictures. This is the
413
+ default, and the way to keep identity across clips. Their order when a model takes few (`maxReferenceImages` in
414
+ `--models`): the product's, the cast's, the request's own, the anchor.
379
415
  - Frames: `"firstFrame"` is the exact picture the clip starts from, `"lastFrame"` (only with it) the one it ends on.
380
- Use them for an exact composition (the clip must begin on this still: a product photo, the last picture of the
381
- scene before it), and for a shot longer than one clip: `"continues": "assets/part-1.mp4"` makes a clip start from
416
+ Use them for an exact composition (the clip must begin on this still: the user's product picture or a still
417
+ composed from it, the last picture of the scene before it), and for a shot longer than one clip: `"continues": "assets/part-1.mp4"` makes a clip start from
382
418
  the last frame of that clip (of the list, or already in the project), made after it. `template save --max-shot
383
419
  <seconds>` cuts such a shot into parts, and each later part takes the clip that continues the part before it. A
384
420
  clip with frames takes no `"images"`, `"videos"` or `"audios"` and no anchor: what it shows is
@@ -559,4 +595,4 @@ under the band). Pointer, boxes and zoom are drawn into the recording, the same
559
595
  | `capture` notes: `does not enlarge` or `the zoom stops at 3` | Zoom to a smaller element (a card, not its section) or a larger one (a card, not one word). |
560
596
  | `capture`: `nothing on ... matches` | Copy the selector from `--outline` exactly, or record the page that has the element. |
561
597
  | `render` is slow or runs out of memory | `--scale 0.5` for a draft, or `POPOST_RENDER_PAGES=1`. |
562
- | `No space left on device` | Set `TMPDIR` to a directory on a disk with room. |
598
+ | `No space left on device` | `popost video clean --all <the directory with your video projects> --dry-run` says what the caches take; without `--dry-run` it removes them. For temporary files, set `TMPDIR` to a directory on a disk with room. |