@lingjingai/scriptctl
v0.5.0
Published
剧本阶段统一 CLI:直转外部素材到 script.json,以及当前最终剧本的读取、校验、原子编辑与批量 patch 精修。
Readme
@lingjingai/scriptctl
剧本阶段统一 CLI:把外部素材(txt/md/docx/xlsx/pdf/json)直转为结构化 script.json,以及对当前最终剧本做读取、校验、原子编辑与批量 patch 精修。
安装
pnpm add -g @lingjingai/scriptctlE2B agent-sandbox 镜像在 template_bundle.py 的 NPM_GLOBAL_PACKAGES 中已声明,无需手动安装。
用法
scriptctl --help # 顶层帮助
scriptctl doctor # 环境自检
scriptctl direct init --source-path <file>
scriptctl direct inspect --target review --episode 1,15,30
scriptctl direct validate
scriptctl direct export
scriptctl script patch --patch <patch.json>详细子命令、参数与退出码以 scriptctl <cmd> --help 为准,agent 行为约定见
agent-sandbox-runtime 中的 SKILL.md。
退出码
| 码 | 含义 | |---|---| | 0 | success | | 64 | usage / 参数错误 | | 66 | input file unavailable | | 70 | provider / runtime failure | | 78 | validation failed; agent repair needed |
环境变量
| 变量 | 作用 |
|---|---|
| SCRIPTCTL_ANTHROPIC_API_KEY | Anthropic key(仅 --provider anthropic 时需要) |
| SCRIPTCTL_ANTHROPIC_BASE_URL | 自定义 Anthropic gateway |
| SCRIPTCTL_ANTHROPIC_MODEL | 覆盖默认 model |
| AWB_BASE_URL | script-output gateway URL |
| LINGJING_AWB_ACCESS_KEY | gateway 访问凭证 |
| SANDBOX_PROJECT_GROUP_NO | 项目组号(也可用 --project-group-no) |
| SCRIPTCTL_NO_DOTENV | 设为 1 跳过 .env 加载 |
| SCRIPTCTL_PROVIDER_ATTEMPTS | provider 重试次数(默认 3,clamped 到 [1,6]) |
开发
pnpm install
pnpm run build # tsc → dist/
pnpm test # vitest run,含端到端 mock-flow(pretest 自动跑 build)
pnpm run test:coverage # 全量 + 输出 coverage/index.html
pnpm run typecheck # tsc --noEmit发布
# 改版本
pnpm version patch # 或 minor / major
pnpm publish # access=public,会自动跑 prepublishOnly
# 同步更新 agent-sandbox-runtime/template_bundle.py 里的 @lingjingai/scriptctl@<新版本>License
MIT
