@geoly-ai/social-hub-cli 0.0.13 → 0.0.15

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.
@@ -15,11 +15,12 @@ metadata:
15
15
  ## 互动事件
16
16
 
17
17
  ```bash
18
- social-hub events append -t <team-id> --type comment --payload '{"permalink":"https://..."}'
18
+ social-hub events append -t <team-id> --type comment \
19
+ --external-ref evt_123 --account <uuid> --subreddit test --result succeeded \
20
+ --payload '{"schemaVersion":"v1","runId":"a4-cron-202605231030"}'
19
21
  social-hub events list -t <team-id> -n 20
20
22
  social-hub events list-full -t <team-id> --account <uuid> --type post.published -n 100
21
- social-hub events batch -t <team-id> -j '{"items":[{"type":"comment","payload":{...}}]}'
22
- social-hub events export-csv -t <team-id> > events.csv
23
+ social-hub events batch -t <team-id> -j '{"events":[{"type":"comment","externalRef":"evt_1","payload":{}}]}'
23
24
  ```
24
25
 
25
26
  ## 运营总览
@@ -38,7 +39,7 @@ social-hub audit list -t <team-id> -n 50 [--type <prefix>] [--actor agent] [--ac
38
39
 
39
40
  ```bash
40
41
  social-hub reports list -t <team-id> -n 20
41
- social-hub reports create -t <team-id> -j '{"title":"Weekly","bodyMarkdown":"..."}'
42
+ social-hub reports create -t <team-id> -j '{"reportType":"content-weekly","title":"Weekly","source":"openclaw","contentMarkdown":"..."}'
42
43
  social-hub reports ingest -t <team-id> -j '{"source":"external","payload":{...}}'
43
44
  ```
44
45
 
@@ -26,10 +26,10 @@ metadata:
26
26
 
27
27
  ```bash
28
28
  social-hub context account -t <team-id> --account A1 \
29
- --expand pools,jobs,persona,risk,env,guardrails
29
+ --expand pools,events,jobs,persona,risk,env,guardrails,style,quota
30
30
  ```
31
31
 
32
- `--account` 可为 UUID handle(如 `A1`)。
32
+ `--expand pools` 返回 team 级板块池;`--expand events` 返回该账号最近 20 条互动事件摘要。
33
33
 
34
34
  ## 任务上下文
35
35
 
@@ -90,3 +90,5 @@ social-hub reddit batch-upsert -t <team-id> -j '{
90
90
 
91
91
  发帖任务成功后,优先通过 `social-hub ops complete --permalink ...` 回填(见 `social-hub-ops-runtime`)。
92
92
  需要手动补快照时用 `create-snapshot` 或 `batch-upsert`。
93
+
94
+ **维护 CRON / 手动维护**:OpenClaw `reddit-post-reply-maintenance` Step 4.7 在 profile 扫描后应 `batch-upsert` 更新 `score` / `commentsCount` / `viewCount`(曝光);见 OpenClaw `hub-adapter.md` §5d 与 `references/cron-message-skeleton.md`。
@@ -121,9 +121,22 @@ CLI 仍兼容 `social-hub auth login --api-key sk_live_…` 与 `SOCIAL_HUB_API_
121
121
  2. `social-hub auth whoami` — 确认 `role` 与 `teamId`
122
122
  3. `social-hub context current` — 确认 `-t` 与授权 team 一致
123
123
  4. `social-hub auth explain` — 当前 role 是否允许该命令(基于 CLI 本地 gate 表)
124
- 5. 403 / permission denied换有权限的 Web 账号重新 `auth login`,或请 admin 调整成员角色
124
+ 5. `social-hub authz evaluate -t <team-id>` 在线核对 role、visible campaigns、allowed/denied CLI 命令(优先于本地 registry)
125
+ 6. 403 / permission denied — 换有权限的 Web 账号重新 `auth login`,或请 admin 调整成员角色
125
126
 
126
- CLI 对部分命令(含 admin settings/invites/members、reddit/accounts 写操作)会**先本地 RBAC 预检**再调 API;`auth explain` 展示的是本地 gate 映射,**后端 `assertRuntimePermission` 仍是最终裁决**。
127
+ ### OpenClaw Agent 推荐 role(运行时写操作)
128
+
129
+ Device Code 授权后,**`internal` 不足以**完成互动 CRON / ip-check / onboard 的常见 Hub 主写(例如 `events append`、`accounts update`、`accounts browser-envs update`)。部署 OpenClaw 执行 Agent 时,请为对应 Web 用户分配:
130
+
131
+ | 最低 role | 典型 runtime 能力 |
132
+ |-----------|-------------------|
133
+ | **supervisor** | 推荐默认:`events append`、`accounts update`、`status-snapshots create`、`browser-envs create/update`、`ops *` |
134
+ | **senior** | 只读 + `events append` / `ops *`(**不能** `accounts update` 或 browser-env telemetry) |
135
+ | **internal** | 只读 + `ops` 状态更新;**不能** `events append` 或账号/browser-env 写 |
136
+
137
+ 若不能升 role,请 admin 在 Hub 为成员配置 **permission overrides**(覆盖 `task:create`、`socialAccount:update`、`browserEnvironment:update` 等)。`auth explain` 与 `authz evaluate` 均应在上线前跑一遍。
138
+
139
+ CLI 对部分命令(含 admin 域 settings/invites/members、reddit/accounts 写操作、ops runtime、events append)会**先本地 RBAC 预检**再调 API;`auth explain` 展示的是本地 gate 映射,**后端 `assertRuntimePermission` 仍是最终裁决**。
127
140
 
128
141
  admin 专属操作(如 `agent-teams create`)需要 **admin** role 的 CLI token,不是「随便创建一个 API Key」就能替代。
129
142