{"_id":"@a2hmarket/expert-cli","_rev":"3-0482445c6618a9b756574931c0732704","name":"@a2hmarket/expert-cli","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@a2hmarket/expert-cli","version":"0.1.0","license":"MIT","_id":"@a2hmarket/expert-cli@0.1.0","maintainers":[{"name":"huanghaibin","email":"xemoaya@hotmail.com"},{"name":"huanghaibin-dev","email":"huanghaibin@a2hmarket.ai"}],"bin":{"expert":"bin/expert.js","expert-login":"bin/expert-login.js"},"dist":{"shasum":"fb4595b09e7be0dd5532cb2d422127a6eec2da3e","tarball":"https://registry.npmjs.org/@a2hmarket/expert-cli/-/expert-cli-0.1.0.tgz","fileCount":17,"integrity":"sha512-gwbITn/ZbYrn45m4r7YzPWk8teoGWMIbN2m9twZNE2GIxDLRVg9RyjWOAONBc7V3x3JSz/6Oga/tJRbPys4tWQ==","signatures":[{"sig":"MEYCIQC0iLQUOQwktdZO+lLvRd/dnPmzSqkZIxIlg/YkilbygwIhAOZAKvIEhyOm+qGBdpJCUlGy/iKpSIayYM4UeawmsEkP","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":71767},"type":"module","engines":{"node":">=18"},"gitHead":"d749ac9515a6bf9e624224c8eda93eca83ec729e","scripts":{"build":"tsc","clean":"rm -rf dist"},"_npmUser":{"name":"huanghaibin-dev","email":"huanghaibin@a2hmarket.ai"},"_npmVersion":"10.8.2","description":"Local CLI to call any Expert (AgentHub) agent and pull generated assets (image/audio/video/3d/slides) into the working dir. Multi-turn; designed to be run in the background by Claude Code.","directories":{},"_nodeVersion":"20.20.2","dependencies":{"ws":"^8.18.0","open":"^10.1.0","undici":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/ws":"^8.5.0","typescript":"^5.6.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/expert-cli_0.1.0_1780459579955_0.5184695325833331","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@a2hmarket/expert-cli","version":"0.1.1","license":"MIT","_id":"@a2hmarket/expert-cli@0.1.1","maintainers":[{"name":"huanghaibin","email":"xemoaya@hotmail.com"},{"name":"huanghaibin-dev","email":"huanghaibin@a2hmarket.ai"}],"bin":{"expert":"bin/expert.js","expert-login":"bin/expert-login.js"},"dist":{"shasum":"a60d830d637c0ced2b9e0db65cf9ce723c4c3d51","tarball":"https://registry.npmjs.org/@a2hmarket/expert-cli/-/expert-cli-0.1.1.tgz","fileCount":17,"integrity":"sha512-iWS+pulz18jGJo3oa3bTVvMI+3XA8oo0UEM2h5u0ZF50JLVG3D8a/3Nx25GB0smhmSxTl3JQguzygpH2i3N5xg==","signatures":[{"sig":"MEUCIQCnVA8iuyhHHLi6czGcZ6RHqwNZG/aGYqtUSzB/UNyW3wIge+/+gmUBp9pPbhIn0ujaNX5dgQBMWvw5KiIRoocOdQ4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":72405},"type":"module","engines":{"node":">=18"},"gitHead":"c581a2fbbaf5df6195022f86115b2019b236369a","scripts":{"build":"tsc","clean":"rm -rf dist"},"_npmUser":{"name":"huanghaibin-dev","email":"huanghaibin@a2hmarket.ai"},"_npmVersion":"10.8.2","description":"Local CLI to call any Expert (AgentHub) agent and pull generated assets (image/audio/video/3d/slides) into the working dir. Multi-turn; designed to be run in the background by Claude Code.","directories":{},"_nodeVersion":"20.20.2","dependencies":{"ws":"^8.18.0","open":"^10.1.0","undici":"^6.0.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/ws":"^8.5.0","typescript":"^5.6.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/expert-cli_0.1.1_1780461577135_0.21255313857277036","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@a2hmarket/expert-cli","version":"0.1.2","description":"Local CLI to call any Expert (AgentHub) agent and pull generated assets (image/audio/video/3d/slides) into the working dir. Multi-turn; designed to be run in the background by Claude Code.","type":"module","bin":{"expert":"bin/expert.js","expert-login":"bin/expert-login.js"},"engines":{"node":">=18"},"dependencies":{"open":"^10.1.0","undici":"^6.0.0","ws":"^8.18.0"},"devDependencies":{"typescript":"^5.6.0","@types/node":"^22.0.0","@types/ws":"^8.5.0"},"scripts":{"build":"tsc","clean":"rm -rf dist"},"license":"MIT","_id":"@a2hmarket/expert-cli@0.1.2","gitHead":"3b9cccd2987a618eeaad43f355e9f174c086fda1","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-ppjOA3WrY9ZeRO0MzCsXwLiXNFm6IiNWnDQ8KFLQsYjUGmdpOtKzCvtuUC394qTf+7YxYH+qY/uBOCvyE+7WdA==","shasum":"e7aefad9502469d9e696a6634155017d71dce329","tarball":"https://registry.npmjs.org/@a2hmarket/expert-cli/-/expert-cli-0.1.2.tgz","fileCount":17,"unpackedSize":72497,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCXMy6WU7b88Op1gNcY1EwfAUXi21nCafFVXFTexz7CPgIhAOZLM9n/2/BfWlXAD5Wq4n3SE3xEaTyBF6jV4eCD3uGO"}]},"_npmUser":{"name":"huanghaibin-dev","email":"huanghaibin@a2hmarket.ai"},"directories":{},"maintainers":[{"name":"huanghaibin","email":"xemoaya@hotmail.com"},{"name":"huanghaibin-dev","email":"huanghaibin@a2hmarket.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/expert-cli_0.1.2_1780503121115_0.04188866809131797"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-03T04:06:19.697Z","modified":"2026-06-03T16:12:01.413Z","0.1.0":"2026-06-03T04:06:20.121Z","0.1.1":"2026-06-03T04:39:37.282Z","0.1.2":"2026-06-03T16:12:01.295Z"},"license":"MIT","description":"Local CLI to call any Expert (AgentHub) agent and pull generated assets (image/audio/video/3d/slides) into the working dir. Multi-turn; designed to be run in the background by Claude Code.","maintainers":[{"name":"huanghaibin","email":"xemoaya@hotmail.com"},{"name":"huanghaibin-dev","email":"huanghaibin@a2hmarket.ai"}],"readme":"# expert-cli\n\n本地 CLI，让 Claude Code 调远端 **Expert**（AgentHub）平台的专业 agent 异步生成资产（图 / 音乐 / 视频 / 3D / 幻灯片），产出落到本地工作目录。配套 `SKILL.md` 教 Claude Code 何时、怎么用。\n\n## 一键安装（用户）\n\n```bash\nnpm i -g @a2hmarket/expert-cli && expert install && expert-login\n```\n`expert install` 把 `SKILL.md` 拷到 `~/.claude/skills/expert/`（CC 自动发现）；`expert-login` 浏览器点确认拿 PAT。之后对 Claude 说「用 expert 生成…」即触发。\n\n## 命令\n\n```bash\nexpert install [--project]                   # 装 SKILL.md 到 CC skills 目录（无需登录）\nexpert list                                  # 列可调 agent\nexpert <serviceId> \"<message>\"               # 起会话发首条（后台跑）\nexpert --reply <sessionId> \"<message>\"       # 续同一会话（多轮，后台跑）\nexpert-login                                 # authcode 设备流授权（弹浏览器点确认）\n```\n\n每次 `expert <…>` / `--reply` = **跟某 agent 的一轮对话**：连沙箱 → 发一条 → 等这轮结束 → 返回\n`{sessionId, assistantText, artifacts(已下载 localPath)}` → 进程退出。专为 Claude Code 的\n`run_in_background` 设计：进程退出时 CC 被自动唤醒读结果。生成耗时几分钟，**务必后台跑**。\n\n## 设计要点\n\n- **纯 CLI，无 MCP server**：CC 的\"后台进程退出自动唤醒\"只在它自己 Bash 跑的进程上触发，MCP tool 给不了；\n  长生成 / 多轮必须靠这个，所以是 CLI 不是 MCP。\n- **鉴权 = PAT**：`expert-login` 复用平台 authcode 设备流，签发 PAT 落 `~/.expert/credentials.json`，\n  之后所有调用带 `Authorization: Bearer <pat>`。零 dev-tools。\n- **多轮 = 往同一沙箱 session 顺序发消息**：沙箱保留对话上下文；agent 的澄清走纯文字，CC 读懂用 `--reply` 答。\n- **抗断线**：心跳 25s + 断线自动重连同 session（最多 6 次）+ 结束时从 `/deliverables` truth-sync\n  本轮新增产出（补 WS 漏帧 + 拿正确可下载 id）。\n\n## 环境变量\n\n| 变量 | 默认 | 说明 |\n|---|---|---|\n| `EXPERT_API_BASE` | prod edge | edge API base（acquire / list / 下载） |\n| `EXPERT_USER_BASE` | prod findu-user | authcode claim 轮询 |\n| `EXPERT_FRONT_BASE` | prod 前端 | authcode 确认页 |\n| `EXPERT_TOKEN` | — | 直接给 token（跳过 credentials 文件） |\n| `EXPERT_HOME` | `~/.expert` | 凭证 + 产出目录 |\n| `EXPERT_QUIET` | — | `=1` 关进度日志 |\n| `--staging` flag | — | 切 staging 全套域名 |\n\n## 开发\n\n```bash\nnpm install && npm run build\nexpert list --staging\n```\n","readmeFilename":"README.md"}