@delta-infra/cli 1.0.19 → 1.0.20

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@delta-infra/cli",
3
- "version": "1.0.19",
3
+ "version": "1.0.20",
4
4
  "description": "Delta Sandbox CLI",
5
5
  "bin": {
6
6
  "delta-cli": "scripts/run.js"
@@ -42,6 +42,7 @@ metadata:
42
42
  b) `finished=true` + `exit_code!=0` → 命令执行失败,查看 stderr
43
43
  c) `running=true` → 仍在运行,继续等待
44
44
  - 也可用 `delta-cli sandbox status bg <id> --execution-id <exec_id>` 直接查询后台命令的运行状态和退出码。
45
+ - **只消耗一次 tool call 的等待方式**:`delta-cli sandbox run-bg <id> --command "<命令>" --timeout <秒> --wait` — CLI 在内部轮询直到完成,一次性返回结果。适用于不想多次调用 `logs` 轮询的场景。
45
46
  - 故障诊断:连续 3 次 `running=true` 且 `content`/`cursor` 无变化且距离提交超过 60 秒 → 用 `sandbox status <id>` 检查 sandbox 是否存活。如果 sandbox 正常但 logs 无输出,用 `sandbox run <id> --command "ps aux" --timeout 15` 在容器内检查进程状态。
46
47
  - 后台任务成功后仍需按规则 2/3 销毁 sandbox。
47
48
 
@@ -67,7 +68,9 @@ metadata:
67
68
  | 查看后台日志 | `sandbox logs <id> --execution-id <exec_id>`(仅用于 `run-bg`) |
68
69
  | 查询命令状态 | `sandbox status bg <id> --execution-id <exec_id>` |
69
70
  | 读取文件 | `sandbox read <id> --path <path>` |
70
- | 写入文件 | `sandbox write <id> --path <path> --source <本地路径>`(推荐)|
71
+ | 写入文件 | `sandbox write <id> --path <path> --source <文件名>`(推荐)|
72
+ | 文件信息 | `sandbox stat <id> --path <path>` |
73
+ | 列出目录 | `sandbox ls <id> --path <路径>` |
71
74
  | 完成 sandbox | `sandbox finish <id> --results '{...}'` |
72
75
  | 销毁 sandbox | `sandbox kill <id>` |
73
76
 
@@ -22,6 +22,8 @@
22
22
  ```bash
23
23
  # 1. 启动后台命令(立即返回,不阻塞)
24
24
  # delta-cli sandbox run-bg <id> --command "<命令>" --timeout 7200
25
+ # 或用 `--wait` 让 CLI 内部等待完成(只消耗一次 tool call):
26
+ # delta-cli sandbox run-bg <id> --command "<命令>" --timeout 7200 --wait
25
27
 
26
28
  # ↑ 返回数据中包含 execution_id,请保存以便后续查询
27
29