@tcb-sandbox/cli 0.3.7
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/CHANGELOG.md +19 -0
- package/README.md +67 -0
- package/dist/bundled-docs.d.ts +769 -0
- package/dist/bundled-docs.js +528 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +1234 -0
- package/dist/sdk-client.js +50 -0
- package/dist/serve.d.ts +13 -0
- package/dist/serve.js +197 -0
- package/dist/trw-embedded.js +2719 -0
- package/dist/trw-version.json +1 -0
- package/docs/README.md +13 -0
- package/docs/local-mode.md +76 -0
- package/docs/quick-start.md +82 -0
- package/docs/thin-client.md +100 -0
- package/package.json +49 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
版本变更只记在此文件,不写进 README。
|
|
4
|
+
|
|
5
|
+
## 0.3.7
|
|
6
|
+
|
|
7
|
+
- `serve` 增加别名 **`local`**。
|
|
8
|
+
- 用户文档拆成 **`docs/thin-client.md`**(薄客户端)与 **`docs/local-mode.md`**(本地 serve);README 只做入口与维护说明。
|
|
9
|
+
|
|
10
|
+
## 0.3.6
|
|
11
|
+
|
|
12
|
+
- 内置 TRW(`dist/trw-embedded.js` + `dist/trw-version.json`);`serve` 不再要求 `--trw-entry`。
|
|
13
|
+
- 运行时依赖 **`node-pty`**、**`@mongodb-js/zstd`**。
|
|
14
|
+
|
|
15
|
+
## 0.3.0
|
|
16
|
+
|
|
17
|
+
- 离线工具文档快照;MCP 工具名为 `add_mcp_servers`、`remove_mcp_servers`、`list_mcp_servers`。
|
|
18
|
+
|
|
19
|
+
**升级提示:** 服务端需暴露上述 `*_mcp_servers`;否则可暂时固定 **`@tcb-sandbox/cli@0.2.1`** 直到服务端升级。
|
package/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# @tcb-sandbox/cli
|
|
2
|
+
|
|
3
|
+
面向 **TRW(tcb-remote-workspace)** 的命令行工具:**一种安装,两种用法**。
|
|
4
|
+
|
|
5
|
+
> **目录位置:** `clis/sandbox-cli/`
|
|
6
|
+
|
|
7
|
+
| 用法 | 说明 |
|
|
8
|
+
|------|------|
|
|
9
|
+
| **本机起服务** | `tcb-sandbox serve`(或 `local`)在本地跑内置 TRW,默认 `http://127.0.0.1:9000`。 |
|
|
10
|
+
| **只当客户端** | 其它子命令都是 **HTTP 薄客户端**,用 `--endpoint` / `--session-id` 连已有 TRW(远端或本机均可)。 |
|
|
11
|
+
|
|
12
|
+
**文档(建议按顺序看):** [快速上手](./docs/quick-start.md) → [薄客户端](./docs/thin-client.md) → [本地 serve](./docs/local-mode.md) → [文档索引](./docs/README.md) → [变更记录](./CHANGELOG.md)
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 安装
|
|
17
|
+
|
|
18
|
+
任选一种全局安装方式:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install -g @tcb-sandbox/cli
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pnpm add -g @tcb-sandbox/cli
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
安装后可用命令名:**`tcb-sandbox`**(主名)、**`tcb-sandbox`**(别名)。
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 最短路径
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
tcb-sandbox serve
|
|
36
|
+
# 另开终端
|
|
37
|
+
tcb-sandbox --endpoint http://127.0.0.1:9000 --session-id my-session health
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
serve 之后 TRW **六大门面**(HTTP API、`/mcp`、`/mcp_user_define`、CLI、Skills、E2B)及探活/文档/预览,见 **[docs/quick-start.md](./docs/quick-start.md)**。
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## 使用前提(读一遍即可)
|
|
45
|
+
|
|
46
|
+
- **TRW 没有单独发 npm 包**;本地模式用的是本包自带的 **`dist/trw-embedded.js`**(esbuild 打好的服务)。
|
|
47
|
+
- 需要 **node-pty**、**@mongodb-js/zstd**:已写在包的 `dependencies` 里,给内置 bundle 动态加载用。
|
|
48
|
+
- 想用**自己编出来的 TRW** 替代内置文件:设环境变量 **`TCB_SANDBOX_TRW_ENTRY`** 指向你的 `dist/index.js` 等入口(见 [local-mode.md](./docs/local-mode.md))。
|
|
49
|
+
- 公开展示的相关仓库还有 **@tcb-sandbox/e2b-sandbox-adapter** 等;**npm 上搜不到名叫 TRW 的包**是正常的。
|
|
50
|
+
- 连远端 TRW 时**不会**在 CLI 里写死密钥;工具列表优先走 **`GET /api/docs`**(离线时 CLI 可能用内置文档快照)。
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## 仓库内维护 / 发布
|
|
55
|
+
|
|
56
|
+
以下在 **tcb-remote-workspace** monorepo **根目录**执行(发布前请再跑一遍 test):
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
pnpm --filter @tcb-sandbox/cli run build
|
|
60
|
+
pnpm --filter @tcb-sandbox/cli run test
|
|
61
|
+
pnpm --filter @tcb-sandbox/cli run pack:dry-run
|
|
62
|
+
pnpm --filter @tcb-sandbox/cli run pack:safety # 拒绝把 .env、src、tests、*.map 打进包
|
|
63
|
+
pnpm --filter @tcb-sandbox/cli version patch # 或 minor / major
|
|
64
|
+
pnpm --filter @tcb-sandbox/cli publish
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
可选:包内 **live 测试** 读 `cli/.env`(参考 `.env.example`)。
|