@geoly-ai/social-hub-cli 0.0.12 → 0.0.14

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.
Files changed (55) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/admin-index-gates.test.d.ts +2 -0
  3. package/dist/admin-index-gates.test.d.ts.map +1 -0
  4. package/dist/admin-index-gates.test.js +33 -0
  5. package/dist/admin-index-gates.test.js.map +1 -0
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +810 -63
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.test.js +87 -5
  10. package/dist/index.test.js.map +1 -1
  11. package/dist/permission-runner.d.ts +11 -0
  12. package/dist/permission-runner.d.ts.map +1 -0
  13. package/dist/permission-runner.js +30 -0
  14. package/dist/permission-runner.js.map +1 -0
  15. package/dist/permission-runner.test.d.ts +2 -0
  16. package/dist/permission-runner.test.d.ts.map +1 -0
  17. package/dist/permission-runner.test.js +69 -0
  18. package/dist/permission-runner.test.js.map +1 -0
  19. package/dist/permissions-gates-admin.d.ts +4 -0
  20. package/dist/permissions-gates-admin.d.ts.map +1 -0
  21. package/dist/permissions-gates-admin.js +80 -0
  22. package/dist/permissions-gates-admin.js.map +1 -0
  23. package/dist/permissions-gates-admin.test.d.ts +2 -0
  24. package/dist/permissions-gates-admin.test.d.ts.map +1 -0
  25. package/dist/permissions-gates-admin.test.js +25 -0
  26. package/dist/permissions-gates-admin.test.js.map +1 -0
  27. package/dist/permissions.d.ts.map +1 -1
  28. package/dist/permissions.js +2 -3
  29. package/dist/permissions.js.map +1 -1
  30. package/dist/register-admin.d.ts.map +1 -1
  31. package/dist/register-admin.js +343 -29
  32. package/dist/register-admin.js.map +1 -1
  33. package/dist/register-extensions.d.ts.map +1 -1
  34. package/dist/register-extensions.js +26 -19
  35. package/dist/register-extensions.js.map +1 -1
  36. package/dist/register-shared.js +1 -1
  37. package/dist/register-shared.js.map +1 -1
  38. package/package.json +2 -2
  39. package/skills/README.md +7 -5
  40. package/skills/manifest.json +17 -7
  41. package/skills/social-hub-accounts/SKILL.md +46 -13
  42. package/skills/social-hub-admin/SKILL.md +76 -10
  43. package/skills/social-hub-calendar-jobs/SKILL.md +26 -10
  44. package/skills/social-hub-cli/SKILL.md +35 -191
  45. package/skills/social-hub-cli/evals/evals.json +4 -4
  46. package/skills/social-hub-events-observability/SKILL.md +50 -0
  47. package/skills/social-hub-graph-compliance/SKILL.md +60 -0
  48. package/skills/social-hub-intelligence/SKILL.md +72 -7
  49. package/skills/social-hub-migration/SKILL.md +18 -5
  50. package/skills/social-hub-openclaw-context/SKILL.md +23 -8
  51. package/skills/social-hub-ops-runtime/SKILL.md +10 -5
  52. package/skills/social-hub-posts/SKILL.md +56 -23
  53. package/skills/social-hub-posts/evals/evals.json +23 -0
  54. package/skills/social-hub-publishing/SKILL.md +75 -11
  55. package/skills/social-hub-shared/SKILL.md +8 -4
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  name: social-hub-cli
3
3
  description: >-
4
- Social Ops Hub 命令行 social-hub:账号、事件、日历、调度任务、Reddit 帖、报告、OpenClaw 回填等。
5
- 只要用户提到 social-hub、Social Ops Hub、Hub 写数据、查账号、发帖计划、permalink 回填、openclaw、
6
- 调度任务、互动事件,或要在 Hub 里查/改运营数据,就应使用本 skill(即使用户没说 CLI)。
7
- 先读本 skill 做路由;执行任何命令前必须先读 social-hub-shared 完成 auth login 与 context。
4
+ Social Ops Hub 命令行总路由:social-hub 安装、健康检查、领域 skill 索引。
5
+ 只要用户提到 social-hub、Social Ops Hub、Hub 写数据、查账号、发帖计划、permalink 回填、
6
+ openclaw、调度任务、互动事件,或要在 Hub 里查/改运营数据,就应使用本 skill 做路由。
7
+ 执行任何命令前必须先读 social-hub-shared 完成 auth login 与 context。
8
8
  metadata:
9
- cliVersion: ">=0.0.6"
9
+ cliVersion: ">=0.0.12"
10
10
  homepage: https://github.com/geoly-ai/geoly-reddit/tree/main/social-ops-hub/skills
11
11
  ---
12
12
 
@@ -16,9 +16,8 @@ metadata:
16
16
 
17
17
  > **前置条件:** 执行 Hub 命令前 MUST 先读 [`../social-hub-shared/SKILL.md`](../social-hub-shared/SKILL.md),
18
18
  > 完成 `social-hub auth login`(Device Code)并 `social-hub context use <team-id>`。
19
- > 日常**不要**使用 `SOCIAL_HUB_API_KEY` / `SOCIAL_HUB_API_URL` 环境变量。
20
19
 
21
- ## 快速开始(生产)
20
+ ## 快速开始
22
21
 
23
22
  ```bash
24
23
  social-hub auth login --api-url https://reddit.eclick-geo.com/api
@@ -26,212 +25,57 @@ social-hub auth whoami
26
25
  social-hub context use <team-uuid>
27
26
  social-hub doctor
28
27
  social-hub health
28
+ social-hub version --json
29
29
  ```
30
30
 
31
- 生产 API 基址:**`https://reddit.eclick-geo.com/api`**。下文示例中 `<team-id>` 指当前 context 的 team UUID。
32
-
33
- ## 安装 CLI 与 Skill
34
-
35
- ```bash
36
- npm install -g @geoly-ai/social-hub-cli@latest
37
- social-hub version
38
- ```
39
-
40
- 安装 Agent Skills:
41
-
42
- - **交互式(推荐,默认)**:`social-hub skills install` 或 `social-hub skills install <skillId>`(TTY 下打开 TUI,CLI 参数会预填 agent/skill/scope)
43
- - **Cursor 全局(脚本)**:`social-hub skills install --agent cursor --global --yes`
44
- - **单 skill 脚本化**:`social-hub skills install social-hub-cli --agent cursor --global --yes`
45
- - **更新已装 skills**:`social-hub skills update --agent cursor --global --yes`
46
- - **所有已检测 agent 目录(显式 opt-in)**:`social-hub skills install --agent '*' --global --yes`
47
- - **免全局安装**:`npx @geoly-ai/social-hub-cli skills bootstrap`
48
- - **GitHub 最新**:`social-hub skills install --source github --repo geoly-ai/geoly-reddit --agent cursor --global --yes`
49
- - **检查状态**:`social-hub skills doctor`
50
-
51
31
  ## 领域 Skill 路由
52
32
 
53
33
  | 场景 | Skill |
54
34
  |------|--------|
55
- | 鉴权 / config / doctor / context | **`social-hub-shared`**(必读) |
35
+ | 鉴权 / config / doctor / context list·use·current | **`social-hub-shared`**(必读) |
56
36
  | OpenClaw 领任务 / 回填 | `social-hub-ops-runtime` |
57
37
  | 账号/任务上下文(DB) | `social-hub-openclaw-context` |
58
- | 账号 CRUD | `social-hub-accounts` |
59
- | Reddit | `social-hub-posts` |
60
- | 日历 / jobs | `social-hub-calendar-jobs` |
61
- | 发布闭环 | `social-hub-publishing` |
62
- | settings / invites / 成员 | `social-hub-admin` |
63
- | 情报 | `social-hub-intelligence` |
64
- | 导入导出 replay | `social-hub-migration` |
38
+ | 社交账号 CRUD / browser-envs / personas | `social-hub-accounts` |
39
+ | Reddit 帖快照 CRUD / batch-upsert | `social-hub-posts` |
40
+ | 日历 / scheduled jobs | `social-hub-calendar-jobs` |
41
+ | 发布闭环(brand→report) | `social-hub-publishing` |
42
+ | 事件 / dashboard / audit / reports | `social-hub-events-observability` |
43
+ | 图谱 / 合规 / 风控 | `social-hub-graph-compliance` |
44
+ | settings / invites / members / api-keys | `social-hub-admin` |
45
+ | 板块情报 / KOL / insights | `social-hub-intelligence` |
46
+ | 导入导出 / runbook / openclaw-ingest | `social-hub-migration` |
47
+
48
+ 命中上表场景时,**打开对应领域 skill**;不要在总路由里重复展开领域命令细节。
65
49
 
66
- 命中上表场景时,打开对应领域 skill,**不要**只在总览里硬写命令而跳过子 skill。
50
+ ## 安装 CLI 与 Skill
67
51
 
68
- ## 同仓开发 Build
52
+ ```bash
53
+ npm install -g @geoly-ai/social-hub-cli@latest
54
+ social-hub skills install --agent cursor --global --yes
55
+ social-hub skills update --agent cursor --global --yes
56
+ social-hub skills doctor
57
+ ```
69
58
 
70
- **social-ops-hub monorepo** 内改 CLI/SDK 后:
59
+ ## 同仓开发 Build
71
60
 
72
61
  ```bash
73
62
  pnpm --filter @geoly-ai/social-hub-sdk run build
74
63
  pnpm --filter @geoly-ai/social-hub-cli run build
64
+ pnpm --filter @geoly-ai/social-hub-cli test
75
65
  ```
76
66
 
77
- ## 本地 API 冷启动(仅开发)
78
-
79
- 部署/seed 细节见仓库文档;CLI 侧只需改 API 地址并重新 login:
67
+ ## 本地 API(仅开发)
80
68
 
81
69
  ```bash
82
- cp .env.example .env # 填写 DATABASE_URL、REDIS_URL 等
83
- pnpm run db:migrate
84
- SOCIAL_OPS_SEED_MODE=minimal-admin pnpm run db:seed
85
- pnpm dev
86
70
  social-hub auth login --api-url http://localhost:3000
87
- social-hub context use <seed 输出的 team uuid>
88
- social-hub health
89
- ```
90
-
91
- 创建新 team、用户等业务初始化:在 **已 auth login 且 role 足够** 的前提下执行下方「团队与用户管理」命令;**不要**再 export API Key。
92
-
93
- ### 业务数据初始化示例
94
-
95
- ```bash
96
- # 创建品牌 → campaign → 账号 → 计划(<team-id> 来自 context current)
97
- BRAND_ID=$(social-hub brands create -t <team-id> -j '{"name":"My Brand","slug":"my-brand"}' | jq -r '.id')
98
- CAMP_ID=$(social-hub campaigns create -t <team-id> -j "{\"brandId\":\"$BRAND_ID\",\"name\":\"2026 Q3 Launch\"}" | jq -r '.id')
99
- ACCOUNT_ID=$(social-hub accounts create -t <team-id> -j '{"platform":"reddit","handle":"u/my_ops_account","credentialsRef":"vault:javis/main"}' | jq -r '.id')
100
- DRAFT_ID=$(social-hub drafts create -t <team-id> -j "{\"campaignId\":\"$CAMP_ID\",\"title\":\"Launch Post\",\"body\":\"...\"}" | jq -r '.id')
101
- social-hub plans create -t <team-id> -j "{\"campaignId\":\"$CAMP_ID\",\"name\":\"Q3 Week 1\",\"entries\":[{\"socialAccountId\":\"$ACCOUNT_ID\",\"subreddit\":\"LocalLLaMA\",\"plannedAt\":\"2026-07-01T09:00:00Z\",\"contentDraftId\":\"$DRAFT_ID\"}]}"
102
- social-hub calendar list -t <team-id> --status scheduled
103
- social-hub jobs list -t <team-id> --status scheduled
104
- ```
105
-
106
- ---
107
-
108
- ## 命令速查表
109
-
110
- 以下 `-t <team-id>` 可换为 `social-hub context current` 中的 `currentTeamId`。
111
-
112
- ### health & dashboard
113
-
114
- ```bash
115
- social-hub health
116
- social-hub dashboard summary -t <team-id>
117
- ```
118
-
119
- ### 互动事件
120
-
121
- ```bash
122
- social-hub events append -t <team-id> --type comment --payload '{"permalink":"https://..."}'
123
- social-hub events list -t <team-id> -n 20
124
- social-hub events list-full -t <team-id> --account <uuid>
125
- social-hub events export-csv -t <team-id> > events.csv
126
- ```
127
-
128
- ### 发布日历
129
-
130
- ```bash
131
- social-hub calendar list -t <team-id> --status scheduled
132
- social-hub calendar list-full -t <team-id> --account <accountId> --status scheduled
133
- social-hub calendar patch -t <team-id> -e <entryId> --body '{"status":"succeeded","permalink":"https://..."}'
134
- ```
135
-
136
- ### 调度任务
137
-
138
- ```bash
139
- social-hub jobs list -t <team-id> --status scheduled
140
- social-hub jobs create -t <team-id> -j '{"socialAccountId":"<uuid>","action":"engage","subreddit":"LocalLLaMA","runAt":"2026-05-07T09:00:00Z"}'
141
- social-hub jobs retry -t <team-id> -i <jobId>
142
- social-hub jobs cancel -t <team-id> -i <jobId>
71
+ social-hub context use <seed-team-uuid>
143
72
  ```
144
73
 
145
- OpenClaw 执行态优先 `social-hub ops *`(见 `social-hub-ops-runtime`);`jobs agent-status` 为遗留路径。
146
-
147
- ### 发布计划 / 草稿 / 报告
148
-
149
- ```bash
150
- social-hub plans list -t <team-id>
151
- social-hub plans create -t <team-id> -j '{"campaignId":"<uuid>","name":"Q3 Week1","entries":[...]}'
152
- social-hub drafts list -t <team-id> -n 20
153
- social-hub reports list -t <team-id> -n 20
154
- ```
155
-
156
- ### 账号 / 品牌 / Campaign
157
-
158
- ```bash
159
- social-hub accounts list -t <team-id> --status active
160
- social-hub accounts get -t <team-id> --account <uuid>
161
- social-hub brands list -t <team-id>
162
- social-hub campaigns list -t <team-id> --brand <brandId>
163
- ```
164
-
165
- ### 板块情报
166
-
167
- ```bash
168
- social-hub intelligence hot-posts -t <team-id> --subreddit LocalLLaMA --sort score -n 50
169
- social-hub intelligence dispatch -t <team-id> -j '{"hotPostId":"<uuid>","socialAccountId":"<uuid>","action":"engage"}'
170
- social-hub intelligence watchlists-list -t <team-id>
171
- ```
172
-
173
- ### 团队与用户管理
174
-
175
- ```bash
176
- social-hub agent-teams list
177
- social-hub agent-teams create --slug javis --name "Javis Agent Team" # admin only
178
- social-hub users list -t <team-id>
179
- social-hub users create -t <team-id> -j '{"email":"ops@example.com","password":"...","role":"manager"}'
180
- ```
181
-
182
- ### 通知渠道
183
-
184
- ```bash
185
- social-hub notification-channels list -t <team-id>
186
- social-hub notification-channels create -t <team-id> -j '{"provider":"feishu","externalId":"https://..."}'
187
- ```
188
-
189
- ### API Key 管理(管理员资源,非 CLI 登录方式)
190
-
191
- ```bash
192
- social-hub api-keys list -t <team-id>
193
- social-hub api-keys create -t <team-id> -j '{"name":"integration","role":"manager"}'
194
- ```
195
-
196
- ---
197
-
198
- ## 典型工作流
199
-
200
- ### Agent 执行完成后回填
201
-
202
- 优先 `social-hub ops complete --permalink ...`(见 `social-hub-ops-runtime`)。手动 patch 示例:
203
-
204
- ```bash
205
- social-hub calendar patch -t <team-id> -e <entryId> \
206
- --body '{"status":"succeeded","permalink":"https://www.reddit.com/r/.../..."}'
207
- social-hub events append -t <team-id> --type post.published \
208
- --payload '{"permalink":"...","calendarEntryId":"<entryId>"}'
209
- ```
210
-
211
- ### 查看账号运营数据
212
-
213
- ```bash
214
- social-hub accounts get -t <team-id> --account <accountId>
215
- social-hub events list-full -t <team-id> --account <accountId> -n 20
216
- social-hub jobs list-full -t <team-id> --account <accountId> --status scheduled
217
- social-hub compliance risk-get -t <team-id> -a <accountId>
218
- ```
219
-
220
- ### 情报热帖派发
221
-
222
- ```bash
223
- social-hub intelligence hot-posts -t <team-id> --sort score -n 10
224
- social-hub accounts list -t <team-id> --status active
225
- social-hub intelligence dispatch -t <team-id> -j '{"hotPostId":"...","socialAccountId":"...","action":"engage","runAt":"..."}'
226
- social-hub jobs list -t <team-id> --status scheduled -n 5
227
- ```
228
-
229
- ---
74
+ 业务初始化(创建 brand/campaign/account)见 `social-hub-publishing` `social-hub-admin`。
230
75
 
231
76
  ## 注意事项
232
77
 
233
- - 命令输出多为 **JSON**,可管道 `jq`。
234
- - `DELETE` / cancel 成功时可能返回 204,CLI 打印 `OK`。
235
- - `events export-csv`、`intelligence hot-posts-export` 输出 CSV stdout。
236
- - 团队管理(`agent-teams create` 等)需要 **admin** role 的 CLI token。
237
- - CLI 凭证来自 **Device Code**(`auth login`),不是 Web Session Cookie,也不是日常手动创建的 API Key。
78
+ - 命令输出多为 **JSON**,可管道 `jq`
79
+ - `events export-csv`、`intelligence hot-posts-export` 输出 CSV stdout
80
+ - CLI 凭证来自 **Device Code**,不是 Web Session Cookie,也不是日常手动创建的 API Key
81
+ - 覆盖矩阵见仓库 `docs/cli-api-coverage.md`
@@ -3,20 +3,20 @@
3
3
  "evals": [
4
4
  {
5
5
  "id": 0,
6
- "prompt": "我要连生产 Social Ops Hub(https://reddit.eclick-geo.com/api),用 social-hub 登录并确认当前身份和 team,然后在 Hub 里注册一个新团队 javis(slug 也是 javis),给这个团队添加管理员用户 ops@javis.local,密码 Javis2026!,最后确认团队列表里有 javis。不要用 SOCIAL_HUB_API_KEY 环境变量。",
7
- "expected_output": "先读 social-hub-shared:auth login --api-url 生产地址、auth whoami、context use;再读 social-hub-cli/admin:agent-teams create、users create、agent-teams list;全程 Device Code 凭证,不 export API key",
6
+ "prompt": "我要连生产 Social Ops Hub(https://reddit.eclick-geo.com/api),用 social-hub 登录并确认当前身份和 team,然后在 Hub 里注册一个新团队 my-ops-team(slug 也是 my-ops-team),给这个团队添加管理员用户 ops@example.com,最后确认团队列表里有 my-ops-team。不要用 SOCIAL_HUB_API_KEY 环境变量。",
7
+ "expected_output": "先读 social-hub-shared:auth loginauth whoami、context use;再读 social-hub-admin:agent-teams create、users system-create 或 agent-teams add-member、agent-teams list;全程 Device Code 凭证",
8
8
  "assertions": []
9
9
  },
10
10
  {
11
11
  "id": 1,
12
12
  "prompt": "Reddit 账号 u/example_user 刚在 r/LocalLLaMA 发帖,permalink 是 https://www.reddit.com/r/LocalLLaMA/comments/abc123/test_post/,日历条目 def456-uuid。我已在生产 Hub auth login 并 context use 了 team。帮我把日历标 succeeded、写 post.published 事件,并查该账号最近事件。优先 ops complete,若需手动则 calendar patch + events append。",
13
- "expected_output": "确认已 auth/context;执行 ops complete calendar patch + events append + events list-full;不要求设置 SOCIAL_HUB_API_KEY",
13
+ "expected_output": "路由 social-hub-ops-runtimesocial-hub-events-observability + social-hub-calendar-jobs;不要求 SOCIAL_HUB_API_KEY",
14
14
  "assertions": []
15
15
  },
16
16
  {
17
17
  "id": 2,
18
18
  "prompt": "查生产 Hub 里 r/Entrepreneur 按 score 前 5 热帖,给账号 ghi789-uuid 派发 engage 任务,runAt 2026-05-07T01:00:00Z,并确认 jobs 列表有新任务。我已 social-hub auth login 到 reddit.eclick-geo.com。",
19
- "expected_output": "路由 social-hub-intelligence:hot-posts、dispatch;social-hub-calendar-jobs:jobs list;使用 -t team-id 来自 context,不用 localhost 或 API key env",
19
+ "expected_output": "路由 social-hub-intelligence:hot-posts、dispatch;social-hub-calendar-jobs:jobs list",
20
20
  "assertions": []
21
21
  }
22
22
  ]
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: social-hub-events-observability
3
+ description: >-
4
+ 互动事件与可观测性:social-hub events append/list/batch/export-csv、dashboard summary、
5
+ audit list、reports list/create/ingest。用户要记事件、查运营总览、审计日志或报告库时用本 skill。
6
+ metadata:
7
+ cliVersion: ">=0.0.12"
8
+ ---
9
+
10
+ # social-hub-events-observability
11
+
12
+ > **前置条件:** 先阅读 [`../social-hub-shared/SKILL.md`](../social-hub-shared/SKILL.md),
13
+ > 确认已 `auth login` 并 `context use <team-id>`。
14
+
15
+ ## 互动事件
16
+
17
+ ```bash
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"}'
21
+ social-hub events list -t <team-id> -n 20
22
+ social-hub events list-full -t <team-id> --account <uuid> --type post.published -n 100
23
+ social-hub events batch -t <team-id> -j '{"events":[{"type":"comment","externalRef":"evt_1","payload":{}}]}'
24
+ ```
25
+
26
+ ## 运营总览
27
+
28
+ ```bash
29
+ social-hub dashboard summary -t <team-id>
30
+ ```
31
+
32
+ ## 审计日志
33
+
34
+ ```bash
35
+ social-hub audit list -t <team-id> -n 50 [--type <prefix>] [--actor agent] [--account <uuid>]
36
+ ```
37
+
38
+ ## 报告库
39
+
40
+ ```bash
41
+ social-hub reports list -t <team-id> -n 20
42
+ social-hub reports create -t <team-id> -j '{"title":"Weekly","bodyMarkdown":"..."}'
43
+ social-hub reports ingest -t <team-id> -j '{"source":"external","payload":{...}}'
44
+ ```
45
+
46
+ ## 相关 skill
47
+
48
+ - 发布闭环:`social-hub-publishing`
49
+ - 图谱追溯:`social-hub-graph-compliance`
50
+ - 批量导出/回放:`social-hub-migration`(`export events-jsonl`、`runbook replay`)
@@ -0,0 +1,60 @@
1
+ ---
2
+ name: social-hub-graph-compliance
3
+ description: >-
4
+ 账号图谱与合规风控:social-hub graph list/drilldown/v2-*、compliance sanctions-*、
5
+ risk-*、rule-caches-*。用户要查账号关联图谱、风险簇、制裁、风控配置或 subreddit
6
+ 规则缓存时用本 skill。
7
+ metadata:
8
+ cliVersion: ">=0.0.12"
9
+ ---
10
+
11
+ # social-hub-graph-compliance
12
+
13
+ > **前置条件:** 先阅读 [`../social-hub-shared/SKILL.md`](../social-hub-shared/SKILL.md),
14
+ > 确认已 `auth login` 并 `context use <team-id>`。
15
+
16
+ ## 账号图谱(v1)
17
+
18
+ ```bash
19
+ social-hub graph list -t <team-id> [--account <uuid>] [--edge <type>] -n 100
20
+ social-hub graph drilldown -t <team-id> --account <uuid> -n 20
21
+ ```
22
+
23
+ ## 账号图谱(v2)
24
+
25
+ ```bash
26
+ social-hub graph v2-ego -t <team-id> --node-ref <account-uuid> --node-type account -n 100
27
+ social-hub graph v2-timeline -t <team-id> --node-ref <account-uuid> --node-type account --from 2026-01-01T00:00:00Z
28
+ social-hub graph v2-explain -t <team-id> --edge-id <edge-uuid>
29
+ social-hub graph v2-path -t <team-id> --source-ref <uuid> --source-type account --target-ref <uuid> --target-type account
30
+ social-hub graph v2-clusters -t <team-id> --scope-ref <account-uuid> --min-risk 60
31
+ social-hub graph v2-impact -t <team-id> --campaign-ref <campaign-uuid> --min-reuse 2
32
+ ```
33
+
34
+ ## 合规:制裁与风控
35
+
36
+ ```bash
37
+ social-hub compliance sanctions-list -t <team-id> [--account <uuid>] [--sub <name>]
38
+ social-hub compliance sanctions-create -t <team-id> -j '{"socialAccountId":"<uuid>","subreddit":"example","status":"blocked","reason":"..."}'
39
+
40
+ social-hub compliance risk-list -t <team-id> -n 100
41
+ social-hub compliance risk-get -t <team-id> -a <account-uuid>
42
+ social-hub compliance risk-put -t <team-id> -a <account-uuid> -j '{"riskLevel":"medium","safeHoursStart":"08:00","safeHoursEnd":"22:00"}'
43
+ ```
44
+
45
+ ## Subreddit 规则缓存
46
+
47
+ ```bash
48
+ social-hub compliance rule-caches-list -t <team-id> [--include-expired]
49
+ social-hub compliance rule-caches-upsert -t <team-id> --sub example -j '{
50
+ "rulesMarkdown": "# Rules\n...",
51
+ "sourceUrl": "https://www.reddit.com/r/example/about/rules",
52
+ "expiresInDays": 30
53
+ }'
54
+ ```
55
+
56
+ ## 相关 skill
57
+
58
+ - 账号详情:`social-hub-accounts`
59
+ - 互动事件追溯:`social-hub-events-observability`
60
+ - Agent 上下文(含 risk/guardrails):`social-hub-openclaw-context`
@@ -1,26 +1,91 @@
1
1
  ---
2
2
  name: social-hub-intelligence
3
3
  description: >-
4
- 板块情报:watchlists、hot posts、KOL intents、industry-pools、dispatch 等 social-hub intelligence 子命令。
5
- 用户要盯 subreddit、拉热帖、行业池、情报派发时用本 skill。
4
+ 板块情报:watchlists、hot-posts、kol-intents、industry-pools、tier-rules、runs、
5
+ kol-profiles、fetch-by-*、insights/*、dispatch social-hub intelligence 子命令。
6
+ 用户要盯 subreddit、拉热帖、行业池、情报派发、分层规则或洞察分析时用本 skill。
6
7
  metadata:
7
- cliVersion: ">=0.0.6"
8
+ cliVersion: ">=0.0.12"
8
9
  ---
9
10
 
10
11
  # social-hub-intelligence
11
12
 
12
13
  > **前置条件:** 先阅读 [`../social-hub-shared/SKILL.md`](../social-hub-shared/SKILL.md),
13
- > 确认已 auth login 并 `context use <team-id>`。
14
+ > 确认已 `auth login` 并 `context use <team-id>`。
15
+
16
+ ## Watchlists 与行业池
14
17
 
15
18
  ```bash
16
19
  social-hub intelligence industry-pools-list -t <team-id>
17
- social-hub intelligence watchlists-list -t <team-id>
20
+ social-hub intelligence watchlists-list -t <team-id> [--campaign <uuid>]
21
+ social-hub intelligence watchlists-create -t <team-id> -j '{"subreddit":"technology","tags":["core"]}'
22
+ social-hub intelligence watchlists-update -t <team-id> --id <uuid> -j '{"tags":["updated"]}'
23
+ social-hub intelligence watchlists-delete -t <team-id> --id <uuid>
24
+ ```
25
+
26
+ ## 热帖
27
+
28
+ ```bash
18
29
  social-hub intelligence hot-posts -t <team-id> --subreddit technology --sort score -n 50
30
+ social-hub intelligence hot-posts-create -t <team-id> -j '{ ... }'
31
+ social-hub intelligence hot-posts-export -t <team-id> --subreddit technology > hot-posts.csv
32
+ ```
33
+
34
+ ## KOL
35
+
36
+ ```bash
19
37
  social-hub intelligence kol-intents -t <team-id> -n 20
20
- social-hub intelligence dispatch -t <team-id> -j '{ ... }' # 写操作:确认 payload 与 --apply(若命令支持)
38
+ social-hub intelligence kol-intents-create -t <team-id> -j '{ ... }'
39
+ social-hub intelligence kol-profiles-list -t <team-id> [--platform reddit]
40
+ social-hub intelligence kol-profiles-get -t <team-id> --id <uuid>
21
41
  ```
22
42
 
23
- 账号可发帖板块优先用 Hub DB 查询,不要猜 subreddit:
43
+ ## Tier rules
44
+
45
+ ```bash
46
+ social-hub intelligence tier-rules-list -t <team-id> [--tier T1] [--enabled true]
47
+ social-hub intelligence tier-rules-create -t <team-id> -j '{"subreddit":"example","tier":"T1","entryMode":"organic","enabled":true}'
48
+ social-hub intelligence tier-rules-update -t <team-id> --id <uuid> -j '{"enabled":false}'
49
+ social-hub intelligence tier-rules-delete -t <team-id> --id <uuid>
50
+ ```
51
+
52
+ ## 抓取任务(异步 run)
53
+
54
+ ```bash
55
+ social-hub intelligence fetch-by-industry -t <team-id> -j '{"mode":"all","industryKeys":["tech"],"sort":"hot","limitPerSubreddit":25}'
56
+ social-hub intelligence fetch-by-tier -t <team-id> -j '{"mode":"all","tier":"T1","sort":"hot"}'
57
+ social-hub intelligence fetch-by-keywords -t <team-id> -j '{"mode":"all","brandKeywords":["brand"],"competitorKeywords":["rival"]}'
58
+ social-hub intelligence runs-list -t <team-id> [--dimension industry] [--status queued]
59
+ ```
60
+
61
+ ## Insights
62
+
63
+ ```bash
64
+ social-hub intelligence brand-mention-radar -t <team-id> -j '{"keywords":["brand"]}'
65
+ social-hub intelligence opportunity-map -t <team-id> -j '{"keywords":["topic"]}'
66
+ social-hub intelligence sov -t <team-id> -j '{"brandKeywords":["brand"],"competitorKeywords":["rival"]}'
67
+ social-hub intelligence sentiment-intent -t <team-id>
68
+ social-hub intelligence campaign-lift -t <team-id> -j '{"keywords":["brand"],"campaignStartAt":"2026-01-01T00:00:00Z","campaignEndAt":"2026-02-01T00:00:00Z"}'
69
+ social-hub intelligence snapshot-latest -t <team-id>
70
+ social-hub intelligence snapshot-save -t <team-id> -j '{"payload":{"note":"manual snapshot"}}'
71
+ ```
72
+
73
+ ## 派发到调度任务
74
+
75
+ ```bash
76
+ social-hub intelligence dispatch -t <team-id> -j '{
77
+ "hotPostId": "<uuid>",
78
+ "socialAccountId": "<uuid>",
79
+ "action": "engage",
80
+ "runAt": "2026-05-07T09:00:00Z"
81
+ }'
82
+ ```
83
+
84
+ `dispatch` 无 `--dry-run`/`--apply`;确认 payload 后再执行。
85
+
86
+ ## 板块候选(Hub DB)
87
+
88
+ 不要猜账号可发哪些 subreddit:
24
89
 
25
90
  ```bash
26
91
  social-hub query account-pools -t <team-id> --account <ref>
@@ -2,15 +2,15 @@
2
2
  name: social-hub-migration
3
3
  description: >-
4
4
  Hub 数据批量:export events-jsonl、export agent-context、runbook replay、openclaw-ingest。
5
- 用户要导出 JSONL、回放事件、迁移/对账时用本 skill;不包含工作区 shared 目录批量 sync(需人工决策)。
5
+ 用户要导出 JSONL、回放事件、迁移/对账时用本 skill;不包含 agent 工作区目录的自动批量 sync
6
6
  metadata:
7
- cliVersion: ">=0.0.6"
7
+ cliVersion: ">=0.0.12"
8
8
  ---
9
9
 
10
10
  # social-hub-migration
11
11
 
12
12
  > **前置条件:** 先阅读 [`../social-hub-shared/SKILL.md`](../social-hub-shared/SKILL.md),
13
- > 确认已 auth login;导出/回放目标 team 用 `-t <team-id>`。
13
+ > 确认已 `auth login`;导出/回放目标 team 用 `-t <team-id>`。
14
14
 
15
15
  ## 导出
16
16
 
@@ -19,6 +19,8 @@ social-hub export events-jsonl -t <team-id> -o events.jsonl -n 500
19
19
  social-hub export agent-context -t <team-id> --account <uuid> -o ctx.json
20
20
  ```
21
21
 
22
+ 事件 CSV 导出见 `social-hub-events-observability`(`events export-csv`)。
23
+
22
24
  ## Runbook 回放
23
25
 
24
26
  ```bash
@@ -30,6 +32,17 @@ JSONL 每行:`{"type":"comment","payload":{...}}`
30
32
 
31
33
  ## openclaw-ingest
32
34
 
33
- API 支持将工作区文档写入 `team_workspace_documents`;**不要**在本 skill 内自动化批量 sync 整个 `Javis-workspace/shared` 或 `Moss-workspace/shared`,除非用户明确要求并指定范围。
35
+ agent 工作区文档写入 `team_workspace_documents`(需用户明确范围):
36
+
37
+ ```bash
38
+ social-hub openclaw-ingest -t <team-id> -j '{"mode":"dry-run"}'
39
+ social-hub openclaw-ingest -t <team-id> -j '{
40
+ "mode": "apply",
41
+ "sourceRoot": "/path/to/agent-workspace",
42
+ "sourcePaths": { "guardrails": "shared/guardrails.md" }
43
+ }'
44
+ ```
45
+
46
+ **不要**在本 skill 内自动化批量 sync 整个 agent 工作区 `shared/`,除非用户明确要求并指定路径。
34
47
 
35
- 运行时查询请用 `social-hub-openclaw-context`,不是解析 Markdown。
48
+ 运行时查询请用 `social-hub-openclaw-context`(Hub DB 真源),不是解析 Markdown。
@@ -1,26 +1,35 @@
1
1
  ---
2
2
  name: social-hub-openclaw-context
3
3
  description: >-
4
- OpenClaw Agent 执行前上下文:social-hub context account/job、query account-pools、subreddit-candidates、
5
- export agent-context。用户问账号能发哪些版、任务上下文、板块池、guardrails、数据是否过期时,
6
- 必须用 Hub DB 聚合接口,不要解析 Javis/Moss/Panda 工作区里的 shared/*.md
4
+ OpenClaw Agent 执行前上下文:social-hub context account/job、query account-pools、
5
+ subreddit-candidates、export agent-context。用户问账号能发哪些版、任务上下文、板块池、
6
+ guardrails、数据是否过期时,必须用 Hub DB 聚合接口,不要解析 agent 工作区 Markdown
7
7
  metadata:
8
- cliVersion: ">=0.0.6"
8
+ cliVersion: ">=0.0.12"
9
9
  ---
10
10
 
11
11
  # social-hub-openclaw-context
12
12
 
13
13
  > **前置条件:** 先阅读 [`../social-hub-shared/SKILL.md`](../social-hub-shared/SKILL.md),
14
- > 确认已 auth login。所有 `-t <team-id>` 与授权 team 一致。
14
+ > 确认已 `auth login`。所有 `-t <team-id>` 与授权 team 一致。
15
+
16
+ ## 与 shared 的分工
17
+
18
+ | 命令 | 所在 skill |
19
+ |------|------------|
20
+ | `context list` / `use` / `current` | `social-hub-shared` |
21
+ | `context account` / `context job` | 本 skill |
22
+ | `query account-pools` / `subreddit-candidates` | 本 skill |
23
+ | `export agent-context` | 本 skill(亦见 `social-hub-migration`) |
15
24
 
16
25
  ## 账号上下文
17
26
 
18
27
  ```bash
19
28
  social-hub context account -t <team-id> --account A1 \
20
- --expand pools,jobs,persona,risk,env,guardrails
29
+ --expand pools,events,jobs,persona,risk,env,guardrails,style,quota
21
30
  ```
22
31
 
23
- `--account` 可为 UUID handle(如 `A1`)。
32
+ `--expand pools` 返回 team 级板块池;`--expand events` 返回该账号最近 20 条互动事件摘要。
24
33
 
25
34
  ## 任务上下文
26
35
 
@@ -43,6 +52,12 @@ social-hub export agent-context -t <team-id> --account <uuid> -o /tmp/ctx.json
43
52
 
44
53
  ## freshness
45
54
 
46
- 响应中 `freshness.needsRefresh === true` 时,应先刷新账号指标或情报,再执行发帖/评论。
55
+ 响应中 `freshness.needsRefresh === true` 时,应先刷新账号指标或情报,再执行发帖/评论:
56
+
57
+ ```bash
58
+ social-hub accounts update -t <team-id> --account <uuid> -j '{"metricsUpdatedAt":"..."}'
59
+ social-hub reddit refresh-all -t <team-id>
60
+ social-hub intelligence fetch-by-industry -t <team-id> -j '{ ... }'
61
+ ```
47
62
 
48
63
  执行任务前配合 `social-hub-ops-runtime`;执行后 `ops complete` 回填 permalink。
@@ -4,25 +4,28 @@ description: >-
4
4
  OpenClaw / Agent 任务运行时:social-hub ops claim-next、claim、heartbeat、complete、fail、skip。
5
5
  用户要领任务、续租、心跳、回填 permalink、任务失败/跳过、避免改本地 Markdown 状态时必须用本 skill。
6
6
  metadata:
7
- cliVersion: ">=0.0.6"
7
+ cliVersion: ">=0.0.12"
8
8
  ---
9
9
 
10
10
  # social-hub-ops-runtime
11
11
 
12
12
  > **前置条件:** 先阅读 [`../social-hub-shared/SKILL.md`](../social-hub-shared/SKILL.md),
13
- > 确认已 auth login 并 `context use <team-id>`。不要用环境变量传 team 或 API key。
13
+ > 确认已 `auth login` 并 `context use <team-id>`。
14
14
 
15
- Hub DB 是执行状态的真源;不要用 `shared/reddit-account-status.md` 等文件记录任务结果。
15
+ Hub DB 是执行状态的真源;不要用 agent 工作区 `shared/*.md` 记录任务结果。
16
16
 
17
17
  ## 推荐流程
18
18
 
19
19
  ```bash
20
- AGENT="javis" # 或 moss / 你的 agentId
20
+ AGENT="<agent-id>"
21
21
 
22
22
  social-hub ops claim-next -t <team-id> --agent "$AGENT"
23
+ # 或指定 job:
24
+ social-hub ops claim -t <team-id> --job <jobId> --agent "$AGENT"
25
+
23
26
  social-hub context job -t <team-id> --job <jobId>
24
27
  social-hub ops heartbeat -t <team-id> --job <jobId> --agent "$AGENT"
25
- # 执行 Reddit / 浏览器操作,并写 interaction events(见 social-hub-cli events)
28
+ # 执行 Reddit / 浏览器操作,并写 interaction events(见 social-hub-events-observability
26
29
  social-hub ops complete -t <team-id> --job <jobId> --agent "$AGENT" --permalink "https://reddit.com/..."
27
30
  ```
28
31
 
@@ -40,3 +43,5 @@ social-hub ops skip -t <team-id> --job <jobId> --agent "$AGENT" --reason manual_
40
43
  ## 并发
41
44
 
42
45
  同一账号同时只能有一个有效 lease;重复 claim 会被拒绝。`complete` 会原子更新 job 与关联 calendar(若 payload 含 calendarEntryId)。
46
+
47
+ 遗留路径 `jobs agent-status` 仅在未接 ops 链路时使用(见 `social-hub-calendar-jobs`)。