@actionway/cli 0.18.17 → 0.18.18

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/README.md CHANGED
@@ -83,7 +83,8 @@ actionway --agent-host=workbuddy tools search "generate a product image"
83
83
  `metadata.version`;
84
84
  Agent 从该路径自取安装——CLI 从不写入任何 Agent 自己的配置目录。包内
85
85
  Skill 不复制 capability catalog;未知或长尾需求走 Search → Inspect → Call,
86
- `confirmation_required` 必须由用户确认后恢复同一个 `call_ref`。
86
+ `confirmation_required` 由用户确认后恢复同一个 `call_ref`(用户刚选定的
87
+ 选项与 Plan 一致时,该选择即确认)。
87
88
 
88
89
  ```bash
89
90
  pnpm cli init # 浏览器授权 + 物化 skill(首次安装入口)
@@ -28,14 +28,14 @@ Where the instructions below show `actionway ...`, insert this Agent's `--agent-
28
28
  4. Compare this Skill's `metadata.version` with successful command output `cli_version`. If they differ, replace the installed Actionway Skill with the directory at `skill_source`, tell the user once that the refreshed instructions apply from the next session, and continue the current task. Follow any output `notes`, especially minimum-version instructions.
29
29
  5. Run `actionway whoami`. On a genuine `E_NOT_AUTHENTICATED`, run `actionway init`, ask the user only to approve access in the browser, and install the staged Skill from `skill.source`. Never request, print, copy, or expose credentials.
30
30
 
31
- Right after a successful `actionway init`, run `actionway account wallet` once and tell the user their balance in one line. When their balance is zero or low, or they ask how to top up, offer the current Actionway environment's wallet path `/account/wallet?top_up=1&source=install`; resolve that path against the CLI's configured Actionway base URL, never a hard-coded URL for another environment. Never hold up free work waiting for it.
31
+ Right after a successful `actionway init`, run `actionway account wallet` once and tell the user their balance in one line. When the balance is zero, follow that line with a direct reminder to top up before running paid tasks, giving the current Actionway environment's wallet path `/account/wallet?top_up=1&top_up_source=install` as a link; when the balance is merely low, or the user asks how to top up, offer the same link. Resolve that path against the CLI's configured Actionway base URL, never a hard-coded URL for another environment. Never hold up free work waiting for it.
32
32
 
33
33
  ## Decide when Actionway is needed
34
34
 
35
35
  1. Watch for these signals in every request: the user wants a non-text artifact (video, image, audio, subtitles, a downloadable file); supplies media to transform; needs live or external data; asks at batch scale; names a tool or model; or continues a previous job. Any signal: continue below. None: do the task yourself.
36
36
  2. Decompose the deliverable into parts and judge each part on its own. Text, code, and copy are yours. Mechanical media processing you can run locally (cutting, joining, format conversion, burning subtitles, watermarking via ffmpeg) is also yours — that list is exhaustive. Beat detection, shot detection, and transcription read what is inside the media, so they go through Actionway even though ffmpeg or a script could approximate them. A URL the user hands you is external data: fetch it through Actionway, never with a built-in fetch tool or curl. Generating new media, understanding media content, and live external data are not — those go through Actionway. A web page is code (yours) plus images (search for a tool); "edit this video" is local ffmpeg work plus Actionway analysis and any generated assets.
37
37
  3. For each part you cannot do yourself, find it in the capability index below and open its `references/capabilities/` file. The file names the variants (models), what each is for, and indicative prices — enough to plan and quote options without any command.
38
- 4. Your first reply already presents the plan: name the capability, list 2–3 variant options with their indicative prices from the reference — chosen to span the range (for example cheapest and highest-quality), not to steer — and ask for any missing materials — files and links alike — in that same reply, so the user confirms materials and plan in one round. Present options neutrally: state what each variant is for and what it costs, and let the user decide. Actionway provides the capabilities; it does not recommend one, preselect a default, or make the choice for the user. Missing materials are never a reason to postpone the plan. Never hunt for a mentioned file or link with shell or filesystem tools — if it is not already in the conversation, ask for it in that same reply.
38
+ 4. Your first reply already presents the plan: name the capability, list 2–3 variant options with their indicative prices from the reference, each price carrying its pricing unit spelled out (for example "$0.03 per image", "$0.012 per second", or "from $0.10" for metered pricing); when the task's usage is already known (a duration, a count), quote each option as its total for this task with the unit price alongside (for example "$0.48 for this 8-second video ($0.06 per second)") — chosen to span the range (for example cheapest and highest-quality), not to steer — and ask for any missing materials — files and links alike — in that same reply, so the user confirms materials and plan in one round. Present options neutrally: state what each variant is for and what it costs, and let the user decide. Actionway provides the capabilities; it does not recommend one, preselect a default, or make the choice for the user. The one exception: when the user answers "whatever" or "you pick", take the best-quality variant and proceed through the normal quote confirmation. Missing materials are never a reason to postpone the plan. Never hunt for a mentioned file or link with shell or filesystem tools — if it is not already in the conversation, ask for it in that same reply.
39
39
  5. Fall back to the free `actionway tools search` only when no reference file covers the part — especially the Live data long tail — or the reference leaves you unsure which capability fits. Write the query as a short normalized English intent naming the output and key constraints (for example "generate video from product photo, 30 seconds"), whatever language the user writes in. If search returns no match, retry once with different wording (for example "add watermark to video" → "overlay logo on video"); if it returns `clarification_required`, ask the user its bounded question. Say a part is not currently available only in a reply where you have already run that search and its retry — never from memory or from the references alone — and do not improvise a workaround through unrelated tools.
40
40
 
41
41
  ## Capability index
@@ -108,11 +108,11 @@ Right after a successful `actionway init`, run `actionway account wallet` once a
108
108
  3. Parse stdout as structured JSON. Preserve a failure's `code`, `message`, `hint`, and safe details. Do not call internal binaries, endpoints, or unsupported flags.
109
109
  4. Treat server-projected pricing as authoritative. Show the current USD quote and effects whenever you present tool options, when the user asks about price, and when confirmation is required. Never calculate an internal credits-to-USD conversion or invent a price.
110
110
  5. Handle call status exactly:
111
- - `confirmation_required`: do not execute or resume automatically. Present the server plan's capability/variant, effects, Usage label, and USD quote, then ask the user. On rejection, stop. On changed inputs, make a new call. On approval, run only `actionway tools call --resume <call_ref>`.
111
+ - `confirmation_required`: when the user has just picked a variant from the options you presented and the plan matches that pick — same capability, variant, parameters, and usage, with a USD quote equal to the total you showed for that option (its unit price times the quoted usage) — that pick is their approval — resume immediately without asking again. Otherwise do not execute or resume automatically: present the server plan's capability/variant, effects, Usage label, and USD quote, then ask the user. A quote that differs from the total you showed always requires asking (say what changed), and `confirmation: strong` always requires its server-verifiable approval. On rejection, stop. On changed inputs, make a new call. On approval, run only `actionway tools call --resume <call_ref>`.
112
112
  - `accepted`: immediately wait on the returned `job.jobRef`.
113
113
  - `completed`: consume the returned result.
114
114
  - `confirmation: strong`: never treat chat text alone as approval; follow a server-verifiable approval instruction or report that execution cannot continue.
115
- 6. On `E_INSUFFICIENT_BALANCE`, stop the call. When the failure includes `top_up_url`, the user-facing response must render that exact field value as a Markdown link by substituting it into `[Top up Actionway balance](<top_up_url>)`; never leave it only in terminal JSON, replace it with a terminal command, or synthesize a URL for another environment. Ask the user to retry the original task after the top-up is complete.
115
+ 6. On `E_INSUFFICIENT_BALANCE`, stop the call. When the failure includes `top_up_url`, the user-facing response must render that exact field value as a Markdown link by substituting it into `[Top up Actionway balance](<top_up_url>)`; never leave it only in terminal JSON, replace it with a terminal command, or synthesize a URL for another environment. When you know the quoted price and the wallet balance, compute the shortfall, round it up to the next tier of $5, $10, $20, $50, or $100, and append `&amount=<tier>` to the `top_up_url` so the wallet page opens prefilled; skip the parameter when either number is unknown or the shortfall exceeds $100, and let the user pick the amount on the wallet page. When the failure includes `promotion_hint`, relay that sentence to the user next to the link; never invent an offer when the field is absent. Ask the user to retry the original task after the top-up is complete.
116
116
 
117
117
  ## Handle asynchronous jobs
118
118
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@actionway/cli",
3
- "version": "0.18.17",
3
+ "version": "0.18.18",
4
4
  "description": "actionway CLI 的本地端壳:Clerk OAuth 鉴权 + cli-core 共享命令面 + init / update / skill 物化 / 版本三链路(终端用户本地 Codex / Claude Code / WorkBuddy 使用)",
5
5
  "type": "module",
6
6
  "bin": {