popost 4.6.9 → 4.6.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/SKILL.md +4 -2
- package/assets/canvas/assets/{dist-CX2mxpwq.js → dist-C40jmU-w.js} +1 -1
- package/assets/canvas/assets/{es-BFnFFu6P.js → es-aF1SvUMY.js} +1 -1
- package/assets/canvas/assets/{index-CwqBT_rk.js → index-CxUXSxcb.js} +2 -2
- package/assets/canvas/assets/{jszip.min-DqfCBLrH.js → jszip.min-Bf2BQwaC.js} +1 -1
- package/assets/canvas/build-info.json +5 -5
- package/assets/canvas/index.html +1 -1
- package/dist/cli.js +426 -250
- package/dist/index.js +411 -235
- package/dist/types/commands/link-platforms.d.ts +2 -0
- package/dist/types/editor/handoff.d.ts +2 -0
- package/dist/types/install/agents.d.ts +36 -11
- package/dist/types/providers/api.d.ts +2 -0
- package/dist/types/providers/pricing.d.ts +11 -0
- package/dist/types/version.d.ts +1 -1
- package/dist/types/video/preview/shell/footage.d.ts +2 -1
- package/dist/types/video/preview/shell/i18n.d.ts +1 -1
- package/dist/types/video/preview/shell-bundle.d.ts +1 -1
- package/package.json +1 -1
- package/references/host-editor.md +12 -2
- package/references/image-workflow.md +2 -2
- package/references/onboarding.md +3 -3
- package/references/post-bundle.md +2 -2
- package/references/video-step-1-read.md +10 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "popost",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.10",
|
|
4
4
|
"description": "popost Skill and CLI: reproduce videos, create and reproduce image posts, edit canvas and Studio projects, and save social inspiration links in coding agents such as Codex and Claude Code.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "CLIPCAT AI LTD",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 在当前 Agent 的侧栏交付画布
|
|
2
2
|
|
|
3
|
-
`present --dir P --host codex|claude-code|workbuddy|doubao|generic` 输出 `popost-editor-handoff.v1` 并保存 `editor-handoff.json
|
|
3
|
+
`present --dir P --host codex|claude-code|workbuddy|doubao|generic` 输出 `popost-editor-handoff.v1` 并保存 `editor-handoff.json`。图文交付必须包含画布:由 Agent 主动打开,确认加载,并在最终回复里写出 `open.url` 链接。同步成功时地址指向 Popost 网页工作台(`transport: web-http`)。使用本地画布时,命令启动或复用本机服务并返回回环地址(`transport: loopback-http`)。宿主拿到 `open.url` 后打开侧栏。宿主运行在远端时,访问回环地址需要使用该宿主的端口转发能力。
|
|
4
4
|
|
|
5
5
|
## Codex
|
|
6
6
|
|
|
@@ -12,7 +12,17 @@
|
|
|
12
12
|
|
|
13
13
|
工具名若在宿主中带不同命名空间,按描述发现对应工具。随后用内嵌浏览器读取当前页,确认六类证据中适用者:当前作品文字/图片、画布、图层或文本入口、保存入口、页序、无持续加载遮罩。工具返回成功仅证明侧栏打开,不能替代画布已加载的核实。
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## WorkBuddy
|
|
16
|
+
|
|
17
|
+
WorkBuddy 会在一次普通命令调用结束后切断它启动的进程对工程的访问:进程仍在监听,但页面返回 `{"ok":false,"error":"execution attempt 不存在或已关闭"}`。因此编辑器服务必须是 WorkBuddy 的后台任务(调用结束后继续运行的那种):
|
|
18
|
+
|
|
19
|
+
1. 运行 `popost present --dir P --host workbuddy`。还没有可用服务时,它返回 `ok:false`、`code: START_SERVICE` 和 `startService.command`,不会自己启动一个随后失效的服务。
|
|
20
|
+
2. 用 WorkBuddy 的后台任务能力运行 `startService.command`(`popost serve --dir P --port 0 …`),等它输出 `{"ok":true,"listening":…}`。
|
|
21
|
+
3. 再运行同一条 `present`:它找到这个服务(`reusedService: true`)并给出 `open.url`。
|
|
22
|
+
4. 单独调用一次预览工具,只传 `open.url`,把画布打开在侧栏;PNG、ZIP 等文件放在另一次调用里,先交文件、最后打开画布,侧栏停在画布上。同一次调用混合网址和文件时,侧栏会停在文件卡片上。
|
|
23
|
+
5. 读取侧栏页面,确认画布、作品文字/图片和编辑入口已加载;看到上面的报错说明服务不是后台任务,回到第 1 步。
|
|
24
|
+
|
|
25
|
+
## Claude Code、豆包工作及其他宿主
|
|
16
26
|
|
|
17
27
|
交付前必须先搜索当前宿主的可用工具(按 browser、preview、panel、artifact、open URL 等能力描述发现),不能因工具名字与 Codex 不同就直接交付浏览器链接。发现工具后实际调用并读取页面确认加载;若工具是延迟加载的,先完成工具发现。它们共用同一套交付协议;不为每家复制编辑器,也不猜测不存在的私有 API。查找当前环境提供的“打开 URL 到预览/侧栏/内嵌浏览器”工具并传 `open.url`,优先 `open.preferredPlacement`。接入方可以只读取以下字段:
|
|
18
28
|
|
|
@@ -16,7 +16,7 @@ Read this for image-post creation, replication and editing, after selecting the
|
|
|
16
16
|
6. **制作并导入素材。** 需要摄影、插画、材质时使用真实模型能力;文字、表格、图表与简单结构由 HTML/CSS/可控矢量承担。生成前读 [imagery.md](imagery.md) 与 [providers.md](providers.md)。正式素材的生成不计入“一次内部构图参考”额度,仍需相应费用授权。互不依赖的素材全部 prepare 后一起报价、一起运行(`image quote --all`、`image run --all-quoted --confirm`,同时生成),不要逐个来;`setup` 已经替你 prepare 并报价。计划与费用已有有效授权后用 `image run ... --no-wait` 发出(几张图一起:`--quote-id q1,q2` 或 `--all-quoted`),它立即返回(退出码 4,`pending`,已扣费),随即去写页面 HTML:图在生成,页面同时在写;第一次 `render` 之前再运行同一条 `image run`(不带 `--no-wait` 时等图到)或 `image status --id ID`(看一眼)取图,不会重复发送或扣费。只有手上就这一张图要等、没有别的事可做时,才不带 `--no-wait` 直接等。图的扩展名要等图到了才知道(不透明图是 `.jpg`,带透明通道的是 `.png`,其他 provider 可能不同):等任务结束后 `ls assets/` 核对文件名,把猜错扩展名的页面改对,再做第一次 `render`。用户给的商品照带着不合设计的背景时,先读 [imagery.md](imagery.md) 的商品照规则,不要用 CSS 去遮背景。
|
|
17
17
|
7. **完成活字 HTML。** 每页的 HTML 一次写完整,不先写骨架再逐块补。每页一个 `.post`/`.page`,固定画幅;每个独立可移动语义单元有唯一 `data-layer-id`,文字叶子用 `data-slot`。坐标以页面 HTML 为权威,工程 JSON 不复制运行时布局。图片与字体用工程内相对路径;已装字体由每页 `<head>` 里的 `<link rel="stylesheet" href="../css/<角色>.css">` 引入,这些 link 由 CLI 维护(`setup`、`font install`、`render` 都会补上,输出里的 `fontLinks.linked` / `fontLinksRestored` 列出补了哪几页):不要自己写或改字体 `<link>`,整页重写后漏了也会在下一次 `render` 或 `font install` 时补回。字体规则见 [fonts.md](fonts.md)。改页面时整页重写(用写文件工具,保留 `<head>`),不要对压成一行的 HTML 连环 `sed -i`,一处 `sed` 写错就破坏整页;想知道页面哪里错了,运行 `popost page check --dir P`(或直接看 `render` 输出里的 `problems`),不要用 `sed -n`、`tail`、`od`、`cat -A` 去一段段读文件,每一次读都是一整轮模型调用;要读多个文件,合成一条命令。公共字库与两端编辑器菜单都由 `<skill>/assets/fonts/palette.json` 驱动,必须从库中选用并安装实际字体;按内容检查字形覆盖。
|
|
18
18
|
8. **看图和检查。** `render` 之后用 `sheet --dir P --compare` 一张图看完整篇:每页一格并标页 id,多页即整组缩略图,复刻时参考排在上一行、成品在下一行。只有要核对细节(小字、商品还原、手机阅读尺度)时,才单独打开某一页 PNG。打开的每张图都会留在对话里,让之后的每一步更慢,所以先看总览,再按需看单页。按 [quality-review.md](quality-review.md) 修正并记录逐页与整组审核。技术检查证明工程可运行,实际看图判断信息、审美与还原效果。
|
|
19
|
-
9. **交付编辑器。** 运行 `present --dir P --host <当前宿主>`,实际调用宿主工具把返回的 `open.url` 打开在聊天旁的侧栏。Codex 使用返回的 `open_in_codex` 操作,其他 Agent 见 [宿主侧栏与交付协议](host-editor.md)。`transport=web-http` 时,作品已同步到 Key 所属账号的「我的资产 → 我的项目」,直接打开网页版画布。遇到登录页时,请用户使用 Key 对应的 Popost 账号登录,登录后继续进入作品。`transport=loopback-http` 时,打开本地画布,并告诉用户可以用右上角的「保存到云端」登录后上传(`cloud.mode=anonymous`)。有 `cloud.error` 时说明为什么打开了本地画布;遇到网页版本冲突,保留各自的改动,等待用户选择。不要在聊天里索要 Key。确认作品、文字/图片和编辑入口已加载,再告诉用户画布已打开,并交付 PNG
|
|
19
|
+
9. **交付编辑器。** 运行 `present --dir P --host <当前宿主>`,实际调用宿主工具把返回的 `open.url` 打开在聊天旁的侧栏。Codex 使用返回的 `open_in_codex` 操作,其他 Agent 见 [宿主侧栏与交付协议](host-editor.md)。`transport=web-http` 时,作品已同步到 Key 所属账号的「我的资产 → 我的项目」,直接打开网页版画布。遇到登录页时,请用户使用 Key 对应的 Popost 账号登录,登录后继续进入作品。`transport=loopback-http` 时,打开本地画布,并告诉用户可以用右上角的「保存到云端」登录后上传(`cloud.mode=anonymous`)。有 `cloud.error` 时说明为什么打开了本地画布;遇到网页版本冲突,保留各自的改动,等待用户选择。不要在聊天里索要 Key。确认作品、文字/图片和编辑入口已加载,再告诉用户画布已打开,并交付 PNG 与完整工程。画布是图文交付的一部分,不是可选项:由你主动在侧栏打开(不要让用户自己去找),最终回复里必须写出画布的可点击链接(`open.url`),和 PNG、工程 ZIP 一起交付;页面显示报错或 JSON(如 `{"ok":false,…}`)不算画布已打开,先按 [host-editor.md](host-editor.md) 排查再交付。编辑器升级或集成变更时验证编辑、保存、重开、下载与 ZIP 恢复。内部参考、提示、审核资料留在制作工程,不额外交付 Replay、图层展开展示或 PPTX。
|
|
20
20
|
|
|
21
21
|
## 保持效果的提速方式
|
|
22
22
|
|
|
@@ -25,7 +25,7 @@ Read this for image-post creation, replication and editing, after selecting the
|
|
|
25
25
|
- 多页用 `render --page all`:变化页共用一个浏览器,输出的 `rendered` 是这次渲染的页,`unchanged` 是沿用回执的页。只要渲染其中几页就写列表 `--page p1,p3,p5`(同样一个浏览器);不要用 shell 循环逐页 `render --page pN`,那是每页一次浏览器启动。未变化页按 HTML、尺寸、CSS、字体、图片和 PNG 哈希复用;任何依赖变化都会失效。`--force` 仅在明确需要刷新渲染时使用,刷新后重新看图。
|
|
26
26
|
- 审核后把每页的修改收齐,一页只重写或编辑一次,再用一次 `render --page all` 渲染全部改过的页、一次 `sheet` 复看;改一处渲染一次,每次都多一轮模型调用。互不依赖的命令(几个 `image` 任务、几次渲染)并成一条命令或一个批次,不要一个个来。
|
|
27
27
|
- 审核后直接 `export --page all --final` 与 `package`;最终导出复用已审核的原始 PNG 字节,不为打包再次截图。不要重复 build/render/review,除非内容、素材或布局发生变化或检查失败。
|
|
28
|
-
- 用 `present`
|
|
28
|
+
- 用 `present` 一次完成服务启动、可达性校验和宿主交付信息,不轮询猜端口。`present` 返回 `code: START_SERVICE`(WorkBuddy)时,按 `next` 把 `startService.command` 作为宿主后台任务启动,再运行同一条 `present`。侧栏加载失败先检查 `/api/editor-info` 与明确报错,不反复重开空白页。
|
|
29
29
|
|
|
30
30
|
## 一张内部参考的具体边界
|
|
31
31
|
|
package/references/onboarding.md
CHANGED
|
@@ -4,7 +4,7 @@ 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
|
|
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
|
|
|
@@ -46,7 +46,7 @@ Missing optional tools are not a broken core install. Determine whether the curr
|
|
|
46
46
|
## Reference and generation are separate choices
|
|
47
47
|
|
|
48
48
|
- 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
|
|
49
|
+
- 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
50
|
- 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
51
|
- 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
52
|
- 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 +65,7 @@ Suggested Chinese guidance, only when the user chooses API Key: “创建 API Ke
|
|
|
65
65
|
|
|
66
66
|
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
67
|
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.
|
|
68
|
+
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
69
|
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
70
|
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
71
|
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,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
## 保存到 popost.ai 灵感库
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
用户提供社媒帖子链接,且只想存进账号的「我的灵感」时,用 `inspiration add`。支持哪些平台以 `popost link platforms` 的实时列表为准(免费、不需要账户);向用户介绍或第一次收藏灵感时用这份列表,不要凭记忆列平台。它调用平台解析,成功后返回灵感 ID;无需下载图片或建立本地 PostBundle。先用 `inspiration quote` 读取实时价格和余额,再按用户已授权的费用上限提交。不要把当前价格写死在 Skill 中。
|
|
14
14
|
|
|
15
15
|
```text
|
|
16
16
|
inspiration quote [--config PRIVATE_CONFIG]
|
|
@@ -36,7 +36,7 @@ inspiration import --file bundle.json [--note "为什么收藏"] [--dry-run] [--
|
|
|
36
36
|
|
|
37
37
|
## 解析帖子链接(link parse)
|
|
38
38
|
|
|
39
|
-
`popost link parse <URL>` 让 popost.ai
|
|
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]
|
|
@@ -148,7 +148,16 @@ The cost overview and the one budget, now that the reference is read (leave out
|
|
|
148
148
|
its music, ask for their own file first. When it says generated music is not available, say that one line and plan
|
|
149
149
|
without a generated bed.
|
|
150
150
|
|
|
151
|
-
Show the remaining items, estimated total and balance, including any proposed quality-repair allowance
|
|
151
|
+
Show the remaining items, estimated total and balance, including any proposed quality-repair allowance, in the one
|
|
152
|
+
message that asks for the budget. The user must not have to ask which model or settings the money buys: for every
|
|
153
|
+
generated clip or picture that message names the model (its name and its `id` from `popost video generate --models`),
|
|
154
|
+
the resolution, the length of each generated clip (the seconds the model makes, which can differ from the finished
|
|
155
|
+
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
|
|
156
|
+
or per picture) and its credits; then every other paid item with its credits, and the total that becomes the cap. For
|
|
157
|
+
example: "<model name> (`<model id>`), 1 clip of 8 s, 9:16, 720p, billed per second: 72 credits; reference sound
|
|
158
|
+
analysis: 7 credits; total at most 79 credits, balance 88." When the user changes a setting (resolution, model,
|
|
159
|
+
length, count), quote again before running anything at the old price: show the new price, what has already been
|
|
160
|
+
charged and what is still to come, and use the new total as the cap from then on. Apply the
|
|
152
161
|
existing commission/batch allocation when it covers them; agree a new scope/budget only where coverage is missing
|
|
153
162
|
(the shared money rule above). Do not make every video in an already authorized batch repeat the same fee interview.
|
|
154
163
|
The user agrees once; do not ask per command after that. When speaking people cost more than the user wants to spend,
|