@crabcloud/skills 0.1.1 → 0.1.2
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.
|
@@ -30,6 +30,9 @@ Crab Cloud 是用户的个人云底座:账号、订阅与积分是平台层,
|
|
|
30
30
|
|---|---|
|
|
31
31
|
| 看账号身份 / 订阅 / 积分 | `crab whoami` |
|
|
32
32
|
| 程序化读取身份 | `crab whoami --json` |
|
|
33
|
+
| 积分余额(月送/充值/合计) | `crab credits`(需 `credits.read`,脚本消费加 `--json`) |
|
|
34
|
+
| 积分流水(花了多少、花在哪) | `crab credits history [--limit N] [--offset N]`(变动 ±:消耗为负;`--json` 含 total) |
|
|
35
|
+
| 查动作计价(如发一封外域邮件扣多少) | `crab credits pricing`(公开端点,无需登录) |
|
|
33
36
|
| 列出已授权的 Agent 令牌 | `crab tokens list`(脚本消费加 `--json`) |
|
|
34
37
|
| 撤销某个令牌(高危,先确认) | `crab tokens revoke <id>` |
|
|
35
38
|
| 重新授权 / 调整 scope | `crab login --scopes mail`(组名整组授权;也可单 scope 如 `mail.read`。浏览器确认,你只发起) |
|
|
@@ -39,6 +42,10 @@ Crab Cloud 是用户的个人云底座:账号、订阅与积分是平台层,
|
|
|
39
42
|
| 我的邀请码、邀请链接与受邀名单 | `crab contacts invite [--reset]` / `crab contacts invitees` |
|
|
40
43
|
| 管理登录设备 / 会话、修改密码 | 网页个人中心(crabcloud.cc/account)——CLI 有意不开放 |
|
|
41
44
|
|
|
45
|
+
积分命令需 `credits.read` scope(`account` 组含它):退出码 4 报缺该 scope 时,
|
|
46
|
+
引导 `crab login --scopes account` 重新授权。积分额度一律以**积分数**表述
|
|
47
|
+
(100 积分 = $1.00,仅价格类口径用美元);充值/下单是 Web 会话能力,CLI/Agent
|
|
48
|
+
令牌不动账——用户要充值时引导网页账单页(crabcloud.cc/account/billing)。
|
|
42
49
|
拿不准令牌 id 时先 `crab tokens list` 核对;`revoke` 只接受列表里的 id。
|
|
43
50
|
|
|
44
51
|
## 机器可读输出
|
|
@@ -12,7 +12,12 @@ description: Read, search and send the user's Crab Cloud platform email (usernam
|
|
|
12
12
|
|
|
13
13
|
## 第一步:确认可用
|
|
14
14
|
|
|
15
|
-
- `crab --version`
|
|
15
|
+
- 运行 `crab --version` 确认已安装。命令不存在时让用户运行
|
|
16
|
+
`npx @crabcloud/cli init`(登录 + 安装本 skill 一步完成);已装过但命令缺失
|
|
17
|
+
时运行 `npx @crabcloud/cli@latest init` 升级。
|
|
18
|
+
- CLI 基于 npx 分发,**本机没有 `crab` 命令时,下文所有 `crab <命令>` 都可以
|
|
19
|
+
`npx @crabcloud/cli <命令>` 等价执行**(例如 `npx @crabcloud/cli mail list`)。
|
|
20
|
+
- 未登录(退出码 3)引导用户 `crab login`。
|
|
16
21
|
- 邮箱动作需要对应 scope:读 `mail.read`、搜索 `mail.search`、发信 `mail.send`、
|
|
17
22
|
删除 `mail.delete`。退出码 4 = scope 不足:如实转述缺哪个,引导用户
|
|
18
23
|
`crab login --scopes mail`(组名 = 四项整组)或单列所需 scope 按需最小化
|
|
@@ -28,6 +33,8 @@ description: Read, search and send the user's Crab Cloud platform email (usernam
|
|
|
28
33
|
| 读某封邮件 | `crab mail read <id>`(自动置已读;正文 + 操作记录) |
|
|
29
34
|
| 找邮件 | `crab mail search <关键词>`(主题/发件人/收件人/正文,不含废纸篓) |
|
|
30
35
|
| 发邮件 | `crab mail send --to a@x.cc --subject "..." --body "..."`(长正文用 `--body-file`) |
|
|
36
|
+
| 发邮件带附件 | `crab mail send … --attach <云盘id\|文件名>[,…]`(引用云盘已有对象,不复制,≤10 个;先 `crab storage ls` 核对对象,文件名需精确唯一命中) |
|
|
37
|
+
| 按名字/备注发邮件 | `--to`/`--cc` 可直接写联系人名(不含 `@`):CLI 查联系人簿解析成地址,唯一命中即用;多候选会报错列出,改用完整地址重试。也可先 `crab contacts list <名字>`(`crabcloud` skill)查地址再发 |
|
|
31
38
|
| 回信(带线程锚点) | 先 `crab mail read <id>` 取 Message-ID,再 `crab mail send --to … --in-reply-to <message-id> …` |
|
|
32
39
|
| 整理邮箱 | `crab mail archive <id>` / `crab mail trash <id>` / `crab mail delete <id>` |
|
|
33
40
|
|
|
@@ -47,15 +54,21 @@ description: Read, search and send the user's Crab Cloud platform email (usernam
|
|
|
47
54
|
|
|
48
55
|
- `mail list --json` → `{ items: [...], nextCursor }`,条目含
|
|
49
56
|
`id/folder/fromAddr/to/subject/snippet/isUnread/hasAttachments/createdAt`;
|
|
50
|
-
- `mail read --json` → 完整正文 + `
|
|
57
|
+
- `mail read --json` → 完整正文 + `attachments`(id/filename/mimeType/sizeBytes)
|
|
58
|
+
+ `actors`(谁读过/谁代发,审计源);
|
|
51
59
|
- `mail send --json` → `{ message, chargedCredits, failedExternal }`。
|
|
52
60
|
|
|
53
61
|
## 纪律
|
|
54
62
|
|
|
55
63
|
- **发邮件是外发动作**:发送前向用户复述收件人、主题与计费口径,确认后再执行;
|
|
56
|
-
|
|
64
|
+
不确定收件人身份时优先查联系人簿(`crab contacts list <名字>`,见 `crabcloud`
|
|
65
|
+
skill),其次搜索历史邮件核对,不要猜测地址。
|
|
57
66
|
- **`mail delete` 是彻底删除**,不可恢复;用户没明说「彻底删除」时用
|
|
58
67
|
`mail trash`(可找回,废纸篓 30 天后自动清除)。
|
|
59
68
|
- 草稿流程:先 `mail list --folder drafts` 查看草稿;本阶段 CLI 不直接改草稿,
|
|
60
69
|
确认发送请把草稿内容转述给用户后用 `mail send` 发出。
|
|
61
|
-
-
|
|
70
|
+
- 附件:`mail read` 输出附件清单(id/文件名/类型/体积);附件内容归云盘管
|
|
71
|
+
——下载用 `crab storage download <id>`(见 `crabcloud-storage` skill,跨来
|
|
72
|
+
源通用),发送引用云盘对象用 `mail send --attach`(对象须未被其他邮件绑
|
|
73
|
+
定;若报错说明已被引用,改走正文链接)。邮件详情附件显示「已在云盘删除」
|
|
74
|
+
表示对象已被软删,如实转述。
|
|
@@ -12,7 +12,12 @@ description: Manage the user's Crab Cloud Drive (云盘 — unified storage for
|
|
|
12
12
|
|
|
13
13
|
## 第一步:确认可用
|
|
14
14
|
|
|
15
|
-
- `crab --version`
|
|
15
|
+
- 运行 `crab --version` 确认已安装。命令不存在时让用户运行
|
|
16
|
+
`npx @crabcloud/cli init`(登录 + 安装本 skill 一步完成);已装过但命令缺失
|
|
17
|
+
时运行 `npx @crabcloud/cli@latest init` 升级。
|
|
18
|
+
- CLI 基于 npx 分发,**本机没有 `crab` 命令时,下文所有 `crab <命令>` 都可以
|
|
19
|
+
`npx @crabcloud/cli <命令>` 等价执行**(例如 `npx @crabcloud/cli storage ls`)。
|
|
20
|
+
- 未登录(退出码 3)引导用户 `crab login`。
|
|
16
21
|
- 动作需要对应 scope:列取/下载 `storage.read`,上传/改名/标签/分类/公开
|
|
17
22
|
`storage.write`,移回收站/恢复/彻底删除 `storage.delete`。退出码 4 = scope
|
|
18
23
|
不足:如实转述缺哪个,引导 `crab login --scopes storage`(组名 = 三项整组)
|
|
@@ -33,6 +38,7 @@ description: Manage the user's Crab Cloud Drive (云盘 — unified storage for
|
|
|
33
38
|
| 加/删标签 | `crab storage tag <id\|文件名> --add a,b [--remove c,d]` |
|
|
34
39
|
| 归类 / 建分类 | `crab storage category <id\|文件名> <categoryId\|none>`;`crab storage mkcat <名称>`;分类 id 见 `crab storage categories` |
|
|
35
40
|
| 公开分享 | `crab storage publish <id\|文件名>`(打印公开直链;收回用 `unpublish`) |
|
|
41
|
+
| 可控分享(有效期/提取码/撤销) | `crab storage share <id\|文件名> [--expires 7\|30\|90\|forever] [--passcode 提取码]`(打印完整分享链接;加密对象链接自带 `#` 密钥片段);列表 `crab storage shares <id\|文件名>`、撤销 `crab storage unshare <shareId>` |
|
|
36
42
|
| 删除 | `crab storage rm <id\|文件名>`(进回收站,7 天后自动清理)→ `restore` 恢复 / `purge` 彻底删除 |
|
|
37
43
|
| 看水位 | `crab storage quota`(三来源分项 + 回收站占用 + 对象计数) |
|
|
38
44
|
|
|
@@ -44,7 +50,7 @@ restore/purge 直接用文件名即可);命中多个或查不到时按字面
|
|
|
44
50
|
|
|
45
51
|
程序化消费**始终加 `--json`**:
|
|
46
52
|
|
|
47
|
-
- `storage ls --json` → `{ objects: [...], nextOffset }`,条目含
|
|
53
|
+
- `storage ls --json` → `{ objects: [...], nextOffset, total }`,条目含
|
|
48
54
|
`id / source / filename / mimeType / sizeBytes / categoryId / tags / isPublic / createdAt`;
|
|
49
55
|
- `storage quota --json` → `{ usedBytes, quotaBytes, bySource: { files, media, mail }, trashBytes, counts }`;
|
|
50
56
|
- `upload` / `categories` / `tags` 的 `--json` 同构(单对象 / 分类数组 / 标签数组)。
|
|
@@ -53,6 +59,9 @@ restore/purge 直接用文件名即可);命中多个或查不到时按字面
|
|
|
53
59
|
|
|
54
60
|
- **publish 是对外公开**:公开后任何持链接者可访问,先向用户复述对象与后果,
|
|
55
61
|
确认后再执行;收回用 `unpublish`(已缓存浏览器至多 5 分钟内失效)。
|
|
62
|
+
- **share 是可控分享**:默认 7 天有效、可选提取码、随时 `unshare` 撤销;加密
|
|
63
|
+
对象的分享链接自带解密钥匙(`#` 后缀)——泄露链接即泄露文件,外发前向
|
|
64
|
+
用户复述有效期与提取码设置,确认后再执行。
|
|
56
65
|
- **purge 是彻底删除**,不可恢复;用户没明说「彻底删除」时一律用 `rm`
|
|
57
66
|
(回收站保留 7 天可找回)。
|
|
58
67
|
- 邮件附件与用户上传同账:水位告急时用 `quota` 分项定位来源再建议清理。
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crabcloud/skills",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "Crab Cloud agent skills (SKILL.md) with a standalone installer
|
|
5
|
+
"description": "Crab Cloud agent skills (SKILL.md) with a standalone installer \u2014 teach coding agents to operate the user's personal cloud via the crab CLI.",
|
|
6
6
|
"bin": {
|
|
7
7
|
"crab-skills": "dist/crab-skills.js"
|
|
8
8
|
},
|