@crabcloud/skills 0.1.5 → 0.1.6
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.
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: crabcloud-agent
|
|
3
|
+
description: Check the status of the user's personal cloud Agent in Crab Cloud through the `crab agent` CLI — running sessions and tasks, and the outbound-action approval queue (pending / expired). Use this skill whenever the user asks about their in-cloud agent ("我的 agent 在干嘛", "agent 跑完了吗", "有没有待审批的操作", "看看 agent 审批队列"), wants a quick health check of their Agent workbench, or asks what the agent has been doing — even if they never say "crab" or "Crab Cloud" explicitly. This skill is read-only; approving or rejecting happens in the Agent workbench web UI (agent.crabcloud.cc), not from the CLI.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 个人云 Agent(查看域)
|
|
7
|
+
|
|
8
|
+
Crab Cloud 的个人云 Agent 是一个用户一个固定 agent:长记忆、权限三档、
|
|
9
|
+
能读平台数据(邮箱/云盘/协作)、写动作过审批全留痕。本 skill 覆盖**只读
|
|
10
|
+
查看**(`crab agent …`,需 `agent.read` scope);审批的批准/拒绝在网页
|
|
11
|
+
工作台完成(流内卡片),CLI 不做决策。
|
|
12
|
+
|
|
13
|
+
## 第一步:确认可用
|
|
14
|
+
|
|
15
|
+
先确认 `crab` 命令存在:`crab --help`。若命令缺失,引导安装:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
npx @crabcloud/cli init
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
已安装但命令缺失时升级:`npx @crabcloud/cli@latest init`。所有
|
|
22
|
+
`crab <cmd>` 都可用 `npx @crabcloud/cli <cmd>` 等价执行。
|
|
23
|
+
|
|
24
|
+
## 命令
|
|
25
|
+
|
|
26
|
+
### 状态总览
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
crab agent status
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
输出:会话总数、运行中数量、待审批数量。`--json` 输出机器可读 JSON。
|
|
33
|
+
|
|
34
|
+
### 会话列表
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
crab agent sessions
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
列出对话与任务(标题 / 状态 / 定时 cron / 最近更新时间)。`--json` 可用。
|
|
41
|
+
|
|
42
|
+
### 审批队列
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
crab agent approvals
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
列出待处理与已超时的出站审批(工具名 / 参数摘要 / 来源会话)。
|
|
49
|
+
**这里只看,不批**——告诉用户:打开 Agent 工作台(agent.crabcloud.cc)→
|
|
50
|
+
对应会话的流内审批卡上点「批准执行 / 拒绝」;24 小时未处理的会自动失效,
|
|
51
|
+
且失效后即使补批也不会执行(agent 需重新发起)。
|
|
52
|
+
|
|
53
|
+
## 边界
|
|
54
|
+
|
|
55
|
+
- 只读:本 skill 的命令都不会改变 agent 状态;决策一律引导到工作台网页。
|
|
56
|
+
- BYOK 配置(API 端点 / Key)不在 CLI 视野——在「模型」管理页维护。
|
|
57
|
+
- 需要写操作走平台时,外部 agent 用既有域命令:`crab mail …` /
|
|
58
|
+
`crab storage …` / `crab collab …`(各自 skill),与本 skill 互补。
|
|
@@ -94,6 +94,8 @@ skill 覆盖协作域的 agent 通道;账号/令牌管理见 `crabcloud` skill
|
|
|
94
94
|
系人,不要换名字硬试。
|
|
95
95
|
- **附件引用不复制**:`--attach` 的 fileId 是云盘/空间已有文件的引用(≤10 个),
|
|
96
96
|
只能引用空间成员的云盘文件或本空间直传文件;跨空间文件会被 403 拒绝。
|
|
97
|
+
**只接受明文 / 平台加密(p1)对象,保险箱(u1) 文件引用会被拒**——见
|
|
98
|
+
`crabcloud-storage` skill。
|
|
97
99
|
- 单任务记录流上限 500 条(状态变更也占位):任务粒度别太粗,做完就 `done`,
|
|
98
100
|
新工作开新任务。
|
|
99
101
|
- 读记录流对 Agent 是一等审计事件(thread.read 入活动流)——正常读即可,但
|
|
@@ -76,5 +76,6 @@ description: Read, search and send the user's Crab Cloud platform email (usernam
|
|
|
76
76
|
- 附件:`mail read` 输出附件清单(id/文件名/类型/体积);附件内容归云盘管
|
|
77
77
|
——下载用 `crab storage download <id>`(见 `crabcloud-storage` skill,跨来
|
|
78
78
|
源通用),发送引用云盘对象用 `mail send --attach`(对象须未被其他邮件绑
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
定;若报错说明已被引用,改走正文链接)。**附件只接受明文 / 平台加密(p1)
|
|
80
|
+
对象,保险箱(u1) 文件不能作附件**——CLI 会明确拒绝,需要分享时改走正文
|
|
81
|
+
链接。邮件详情附件显示「已在云盘删除」表示对象已被软删,如实转述。
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: crabcloud-storage
|
|
3
|
-
description: Manage the user's Crab Cloud
|
|
3
|
+
description: Manage the user's Crab Cloud storage (云盘 — one base file service carrying drive uploads, media assets, mail attachments, collab files and agent files on one quota; vault-grade end-to-end encryption is optional) through the `crab` CLI — list and filter objects, upload and download files (including decrypting share links), rename, tag, categorize, publish/unpublish public links, create expiring share links with passcodes, manage the locally remembered encryption key, trash/restore/purge, and check the storage quota. Use this skill when the user asks to upload, find, organize, share or clean up files on Crab Cloud ("上传这个文件", "云盘里有什么", "把这个文件公开分享", "看看存储用了多少", "crab storage"), or wants files moved in or out of their drive — even if they never say "crab" or "Crab Cloud" explicitly.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Crab Cloud 云盘(crab storage)
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
云盘是用户的统一存储基础服务:云盘上传 / 素材库 / 邮件附件 / 协作文件 /
|
|
9
|
+
Agent 产物五来源共用一本容量账(按档位,Free 1GB / Plus 10GB);属性优先、
|
|
10
|
+
位置无关——分类(至多一个)+ 标签(AND 检索)代替文件夹。**上传缺省明文**
|
|
11
|
+
(2026-10 基础服务化:其他应用可直接引用);提供口令时才端到端加密(保险箱
|
|
12
|
+
文件,服务器只有包裹态密钥,明文密钥只在本机)。加密三态以 `wrappedDataKey`
|
|
13
|
+
前缀区分:无前缀 = 明文、`p1.` = 平台加密(如邮件附件,服务端可透明解密)、
|
|
14
|
+
`u1.` = 保险箱(用户持钥)。本 skill 覆盖存储域的 agent 通道;账号/令牌管理见
|
|
15
|
+
`crabcloud` skill,邮箱见 `crabcloud-mail` skill。
|
|
13
16
|
|
|
14
17
|
## 第一步:确认可用
|
|
15
18
|
|
|
@@ -24,7 +27,7 @@ skill。
|
|
|
24
27
|
`storage.write`,移回收站/恢复/彻底删除 `storage.delete`。退出码 4 = scope
|
|
25
28
|
不足:如实转述缺哪个,引导 `crab login --scopes storage`(组名 = 三项整组)
|
|
26
29
|
重新授权(你只发起,不代批)。
|
|
27
|
-
- 退出码 7 = `storage.quotaExceeded
|
|
30
|
+
- 退出码 7 = `storage.quotaExceeded`(统一容量账满):告知用户,可建议
|
|
28
31
|
清理回收站或大文件(`storage quota` 看分项),不要自动重试。
|
|
29
32
|
|
|
30
33
|
## 意图 → 命令映射
|
|
@@ -32,9 +35,9 @@ skill。
|
|
|
32
35
|
| 用户意图 | 命令 |
|
|
33
36
|
|---|---|
|
|
34
37
|
| 云盘里有什么 | `crab storage ls`(按时间倒序,默认 30 条;`--limit` / `--offset` 翻页) |
|
|
35
|
-
| 找文件 | `crab storage ls --q 关键字`(文件名匹配;可叠 `--source files\|media\|mail`、`--type doc\|image\|video\|archive\|code`、`--category 分类id\|none`、`--tag a,b`、`--shared`、`--recent`、`--message-id <id
|
|
38
|
+
| 找文件 | `crab storage ls --q 关键字`(文件名匹配;可叠 `--source files\|media\|mail\|collab\|agent`、`--type doc\|image\|video\|archive\|code`、`--category 分类id\|none`、`--tag a,b`、`--shared`、`--recent`、`--encrypted only\|plain`、`--message-id <id>`;`--encrypted only` = 仅保险箱、`plain` = 排除保险箱) |
|
|
36
39
|
| 看回收站 | `crab storage ls --trash` |
|
|
37
|
-
| 上传文件 | `crab storage upload
|
|
40
|
+
| 上传文件 | `crab storage upload <路径...>`(多文件串行;直传优先,自动回退中转;**缺省明文直传**,其他应用可直接引用;`--passphrase` 或 `CRAB_PASSPHRASE` 提供时端到端加密为保险箱文件——口令三来源见下节,首次使用自动初始化并打印一次性恢复码) |
|
|
38
41
|
| 下载文件 | `crab storage download <id\|文件名\|分享链接> [-o 输出路径] [--passcode 提取码]`(默认按原文件名存当前目录;**凭完整分享链接可免登录下载并本地解密**——`#` 后是密钥片段,这是 agent→agent 的主通道;带提取码的分享加 `--passcode`) |
|
|
39
42
|
| 改名 | `crab storage rename <id\|文件名> <新名称>` |
|
|
40
43
|
| 加/删标签 | `crab storage tag <id\|文件名> --add a,b [--remove c,d]` |
|
|
@@ -46,7 +49,7 @@ skill。
|
|
|
46
49
|
| 可控分享(有效期/提取码/撤销) | `crab storage share <id\|文件名> [--expires 7\|30\|90\|forever] [--passcode 提取码]`(打印完整分享链接;加密对象链接自带 `#` 密钥片段);列表 `crab storage shares <id\|文件名>`、撤销 `crab storage unshare <shareId>` |
|
|
47
50
|
| 云盘钥匙管理 | `crab storage key`(查状态)/ `--remember`(解锁一次并记住,之后免口令)/ `--forget`(清除)——见下节 |
|
|
48
51
|
| 删除 | `crab storage rm <id\|文件名>`(进回收站,7 天后自动清理)→ `restore` 恢复 / `purge` 彻底删除 |
|
|
49
|
-
| 看水位 | `crab storage quota
|
|
52
|
+
| 看水位 | `crab storage quota`(五来源分项 + 保险箱计数 + 回收站占用 + 对象计数) |
|
|
50
53
|
| 看云盘操作流 | `crab storage activity`(读取/上传/删除/建分享,最近 50 条) |
|
|
51
54
|
|
|
52
55
|
`<id|文件名>`:文件名全库精确唯一命中时自动解析为 id(回收站内同样可解析,
|
|
@@ -59,17 +62,20 @@ restore/purge 直接用文件名即可);命中多个或查不到时按字面
|
|
|
59
62
|
程序化消费**始终加 `--json`**:
|
|
60
63
|
|
|
61
64
|
- `storage ls --json` → `{ objects: [...], nextOffset, total }`,条目含
|
|
62
|
-
`id / source / filename / mimeType / sizeBytes / categoryId / tags / isPublic / createdAt
|
|
63
|
-
|
|
65
|
+
`id / source / filename / mimeType / sizeBytes / categoryId / tags / isEncrypted / wrappedDataKey / isPublic / createdAt`
|
|
66
|
+
(`source` = `files|media|mail|collab|agent`;u1 判定 = `isEncrypted && wrappedDataKey` 以 `u1.` 开头);
|
|
67
|
+
- `storage quota --json` → `{ usedBytes, quotaBytes, bySource: { files, media, mail, collab, agent }, trashBytes, counts: { all, files, media, mail, collab, agent, shared, vault, trash } }`
|
|
68
|
+
(素材库条数 = `counts.all - counts.vault`);
|
|
64
69
|
- `storage activity --json` → 条目含 `action(object.read/object.uploaded/object.deleted/share.created)/ actorType / actorLabel / objectId / objectName / createdAt`;
|
|
65
70
|
- `upload` / `categories` / `tags` / `shares` 的 `--json` 同构(单对象 / 分类数组 /
|
|
66
71
|
标签数组 / 分享数组)。
|
|
67
72
|
|
|
68
|
-
##
|
|
73
|
+
## 保险箱口令与本机钥匙
|
|
69
74
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
75
|
+
保险箱(u1)是端到端加密:服务器只有口令包裹态的主密钥,**明文密钥只存在于
|
|
76
|
+
用户本机**——CLI 不可能也不允许向服务器索取。**只有涉及保险箱文件的命令才
|
|
77
|
+
需要口令**(带口令 upload / download 或 share u1 对象;明文与 p1 平台加密对象
|
|
78
|
+
全程免口令)。口令来源优先级:
|
|
73
79
|
|
|
74
80
|
1. `--passphrase <口令>`(flag)
|
|
75
81
|
2. 环境变量 `CRAB_PASSPHRASE`(**Agent/脚本推荐**——非交互终端不会弹提问,
|
|
@@ -96,6 +102,9 @@ download / share 加密文件)需要云盘口令,来源优先级:
|
|
|
96
102
|
等待即可;凭链接下载时提取码用 `--passcode` 正确携带。
|
|
97
103
|
- **purge 是彻底删除**,不可恢复;用户没明说「彻底删除」时一律用 `rm`
|
|
98
104
|
(回收站保留 7 天可找回)。
|
|
105
|
+
- **保险箱(u1)不能被其他应用引用**:邮件附件(`mail send --attach`)与协作
|
|
106
|
+
记录引用都只接受明文 / p1 平台加密对象,u1 对象会被明确拒绝——需要跨应用
|
|
107
|
+
使用时用分享链接(u1 链接自带密钥片段),或等互转功能;不要尝试绕过。
|
|
99
108
|
- 邮件附件与用户上传同账:水位告急时用 `quota` 分项定位来源再建议清理。
|
|
100
109
|
- 公开直链的呈现方式由服务端策略决定(图片/视频/音频/PDF/纯文本内联,SVG 与
|
|
101
110
|
其他类型强制下载),CLI 侧没有、也不需要有开关。
|
package/package.json
CHANGED