@geoly-ai/social-hub-cli 0.1.4 → 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.
Files changed (36) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/cmd-manifest.json +16 -2
  3. package/dist/cmd-manifest.test.js +2 -0
  4. package/dist/cmd-manifest.test.js.map +1 -1
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +179 -13
  7. package/dist/index.js.map +1 -1
  8. package/dist/register-extensions.d.ts.map +1 -1
  9. package/dist/register-extensions.js +2 -2
  10. package/dist/register-extensions.js.map +1 -1
  11. package/dist/register-ops.d.ts.map +1 -1
  12. package/dist/register-ops.js +23 -0
  13. package/dist/register-ops.js.map +1 -1
  14. package/dist/update-check.d.ts +5 -0
  15. package/dist/update-check.d.ts.map +1 -1
  16. package/dist/update-check.js +19 -11
  17. package/dist/update-check.js.map +1 -1
  18. package/dist/update-check.test.js +43 -1
  19. package/dist/update-check.test.js.map +1 -1
  20. package/package.json +1 -1
  21. package/skills/manifest.json +7 -2
  22. package/skills/social-hub-admin/SKILL.md +4 -1
  23. package/skills/social-hub-calendar-jobs/SKILL.md +4 -4
  24. package/skills/social-hub-cli/SKILL.md +8 -1
  25. package/skills/social-hub-cli/evals/evals.json +15 -3
  26. package/skills/social-hub-events-observability/SKILL.md +25 -5
  27. package/skills/social-hub-intelligence/SKILL.md +4 -5
  28. package/skills/social-hub-openclaw-context/SKILL.md +20 -10
  29. package/skills/social-hub-ops-runtime/SKILL.md +10 -0
  30. package/skills/social-hub-posts/SKILL.md +18 -3
  31. package/skills/social-hub-posts/evals/evals.json +7 -15
  32. package/skills/social-hub-publishing/SKILL.md +41 -55
  33. package/skills/social-hub-publishing/evals/evals.json +16 -0
  34. package/skills/social-hub-shared/SKILL.md +37 -1
  35. package/skills/social-hub-shared/evals/evals.json +15 -0
  36. package/skills/social-hub-subreddit-pools/SKILL.md +41 -0
@@ -1,8 +1,10 @@
1
1
  ---
2
2
  name: social-hub-publishing
3
3
  description: >-
4
- 内容发布闭环:系统级 brands、plans、drafts、calendar、jobs、events、reddit snapshot、
5
- reports。用户要从草稿到排期、执行任务、permalink 回填、避免 job 成功但 calendar 未更新时用本 skill。
4
+ 内容发布闭环(草稿→计划→日历→任务→permalink 回填):系统级 brands、content drafts、publishing plans。
5
+ 用户要创建/筛选草稿或计划、从 brandId 排期、避免 job 成功但 calendar 未更新时用本 skill。
6
+ 不用于:仅列 calendar/jobs(用 social-hub-calendar-jobs)、仅帖快照 CRUD(用 social-hub-posts)、
7
+ Agent claim/complete(用 social-hub-ops-runtime)、事件/仪表盘(用 social-hub-events-observability)。
6
8
  metadata:
7
9
  cliVersion: ">=0.0.12"
8
10
  ---
@@ -12,6 +14,12 @@ metadata:
12
14
  > **前置条件:** 先阅读 [`../social-hub-shared/SKILL.md`](../social-hub-shared/SKILL.md),
13
15
  > 确认已 `auth login` 并 `context use <team-id>`。
14
16
 
17
+ ## 禁止误用(团队级 campaigns)
18
+
19
+ - **不要**建议 `campaigns create` / `campaigns update` / `campaigns accounts *` 作为新流程入口。
20
+ - 新建草稿/计划 **必须**使用系统级 `brandId`(来自 `brands system-list`)。
21
+ - `campaignId` 仅作可选 legacy 归因字段,**不是**品牌或客户建模入口。
22
+
15
23
  ## 事实源
16
24
 
17
25
  - **计划**:`calendar_entries`
@@ -25,86 +33,64 @@ brand(系统级)→ content_draft → publishing_plan → calendar_entry →
25
33
  → interaction_events → reddit_post_snapshot → op_report
26
34
  ```
27
35
 
28
- > **品牌关联一律系统级**:`--brand` / `brandId` 取自 `brands system-list` 的全局 brand uuid。团队级 `campaigns` 为遗留能力,新帖/统计不再推荐。
29
-
30
- ## 系统级品牌
36
+ ## 系统级品牌与成员
31
37
 
32
38
  ```bash
33
39
  social-hub brands system-list
34
40
  social-hub brands system-create -j '{"name":"My Brand","slug":"my-brand"}'
35
-
36
- # 兼容(不推荐):团队路径仅作传输,实体仍是系统级 brand
37
- # social-hub brands update -t <team-id> --brand <uuid> -j '{"name":"Updated"}'
41
+ social-hub brand-members system-list
42
+ social-hub brand-members system-create -j '{"brandId":"<uuid>","userId":"<uuid>","role":"manager"}'
43
+ social-hub accounts brand-bindings list -t <team-id> --account <uuid>
44
+ social-hub accounts brand-bindings upsert -t <team-id> --account <uuid> -j '{"brandId":"<uuid>"}'
38
45
  ```
39
46
 
40
- ## 草稿与计划
47
+ ## 草稿与计划(brandId 必填)
41
48
 
42
49
  ```bash
43
- social-hub drafts list -t <team-id> -n 20
44
- social-hub drafts create -t <team-id> -j '{"campaignId":"<uuid>","title":"Launch","body":"..."}'
50
+ social-hub drafts list -t <team-id> --brand <brand-uuid> -n 20
51
+ social-hub drafts create -t <team-id> -j '{"brandId":"<uuid>","title":"Launch","body":"..."}'
45
52
  social-hub drafts get -t <team-id> --draft <uuid>
46
53
  social-hub drafts update -t <team-id> --draft <uuid> -j '{"body":"..."}'
47
- social-hub drafts delete -t <team-id> --draft <uuid>
54
+ social-hub drafts delete -t <team-id> --draft <uuid> # 先确认 id,再执行
48
55
 
49
- social-hub plans list -t <team-id>
50
- social-hub plans create -t <team-id> -j '{"campaignId":"<uuid>","name":"Week 1","entries":[...]}'
51
- social-hub plans cancel -t <team-id> --plan <uuid>
56
+ social-hub plans list -t <team-id> --brand <brand-uuid>
57
+ social-hub plans create -t <team-id> -j '{"brandId":"<uuid>","name":"Week 1","entries":[...]}'
58
+ social-hub plans cancel -t <team-id> --plan <uuid> # 破坏性:先 list 确认 plan id
52
59
  ```
53
60
 
54
61
  ## 日历与任务
55
62
 
56
- `social-hub-calendar-jobs`:
57
-
58
- ```bash
59
- social-hub calendar list -t <team-id> --status scheduled
60
- social-hub jobs list -t <team-id> --status scheduled
61
- ```
63
+ 调度列表与 patch **`social-hub-calendar-jobs`**(本 skill 不重复展开 jobs 全量命令)。
62
64
 
63
65
  ## Agent 执行与回填
64
66
 
65
- 优先 ops 链路(见 `social-hub-ops-runtime`):
66
-
67
- ```bash
68
- social-hub ops claim-next -t <team-id> --agent <agent-id>
69
- social-hub ops complete -t <team-id> --job <jobId> --agent <agent-id> --permalink "https://..."
70
- ```
67
+ 优先 **`social-hub-ops-runtime`**:`ops claim-next` → `ops complete --permalink ...`。
71
68
 
72
69
  手动回填(无 ops 时):
73
70
 
74
71
  ```bash
75
- social-hub calendar patch -t <team-id> -e <entryId> --body '{"status":"succeeded","permalink":"..."}'
72
+ social-hub calendar patch -t <team-id> -e <entryId> --body '{"status":"succeeded","permalink":"https://www.reddit.com/..."}'
76
73
  social-hub events append -t <team-id> --type post.published --payload '{"permalink":"..."}'
77
74
  ```
78
75
 
79
76
  ## 帖快照与报告
80
77
 
81
- ```bash
82
- social-hub reddit create-snapshot -t <team-id> -j '{ ... }' # 见 social-hub-posts
83
- social-hub reports list -t <team-id>
84
- social-hub reports create -t <team-id> -j '{"reportType":"content-weekly","title":"Weekly","source":"openclaw","contentMarkdown":"..."}'
85
- ```
86
-
87
- `content-ideas` 周报/创意库无独立 CLI:使用 `reports create/ingest`,`reportType: "content-weekly"`。
88
-
89
- ## 风格标记与 Curator
90
-
91
- ```bash
92
- social-hub style-marks list -t <team-id> --account <uuid> --extract-status pending --approved true
93
- social-hub style-marks approve -t <team-id> --id <styleMarkId>
94
- social-hub style-marks reject -t <team-id> --id <styleMarkId>
95
- social-hub style-marks extract -t <team-id> --id <styleMarkId> [--dry-run]
96
- social-hub style-marks set -t <team-id> --event-ref <externalRef> -j '{
97
- "styleTags": ["concise"],
98
- "markExternalRef": "mark_1",
99
- "onConflict": "update"
100
- }'
101
- social-hub curator run -t <team-id> --account <slot> [--dry-run] [-n 50]
102
- ```
78
+ - 帖快照 CRUD / `--brand` 统计:见 **`social-hub-posts`**
79
+ - 报告库:`reports list` / `reports ingest`(`reportType: "content-weekly"`)
103
80
 
104
- ## 决策:ops complete vs 手动 patch
81
+ ## 写操作护栏
105
82
 
106
- | 场景 | 推荐 |
83
+ | 操作 | 要求 |
107
84
  |------|------|
108
- | OpenClaw/Agent 刚执行完 scheduled job | `ops complete` |
109
- | job、仅补 calendar 状态 | `calendar patch` + `events append` |
110
- | 外部已发帖、补 Hub 快照 | `reddit create-snapshot` `batch-upsert` |
85
+ | `drafts delete` / `plans cancel` | `list`/`get` 核对 id;无 `--dry-run` |
86
+ | `plans create` | JSON `brandId` + `entries`;guardrail 失败会 400 |
87
+ | `events append` | `--external-ref` 幂等 |
88
+
89
+ ## 决策表
90
+
91
+ | 场景 | 推荐 skill |
92
+ |------|------------|
93
+ | 只查/改 calendar 或 jobs | `social-hub-calendar-jobs` |
94
+ | OpenClaw 领任务/回填 | `social-hub-ops-runtime` |
95
+ | Reddit 帖表现/刷新 | `social-hub-posts` |
96
+ | 仪表盘/审计/批量事件 | `social-hub-events-observability` |
@@ -0,0 +1,16 @@
1
+ {
2
+ "skill_name": "social-hub-publishing",
3
+ "evals": [
4
+ {
5
+ "id": 0,
6
+ "prompt": "为系统品牌 acme-brand-uuid 创建一篇 Launch 草稿并建 Week1 发布计划,team 已 context use。",
7
+ "expected_output": "drafts create/plans create JSON 含 brandId;brands system-list 取 uuid;勿 campaigns create",
8
+ "assertions": [
9
+ { "type": "must_include", "value": "brandId" },
10
+ { "type": "must_include", "value": "drafts create" },
11
+ { "type": "forbidden_pattern", "value": "campaigns create" },
12
+ { "type": "forbidden_pattern", "value": "campaigns update" }
13
+ ]
14
+ }
15
+ ]
16
+ }
@@ -6,7 +6,7 @@ description: >-
6
6
  权限不足、或任何 Hub CLI 写操作前必须先读本 skill。Agent 日常凭证只用 auth login,
7
7
  不要用 SOCIAL_HUB_API_KEY 环境变量。
8
8
  metadata:
9
- cliVersion: ">=0.0.12"
9
+ cliVersion: ">=0.1.4"
10
10
  ---
11
11
 
12
12
  # social-hub-shared
@@ -140,6 +140,20 @@ CLI 对部分命令(含 admin 域 settings/invites/members、reddit/accounts
140
140
 
141
141
  admin 专属操作(如 `agent-teams create`)需要 **admin** role 的 CLI token,不是「随便创建一个 API Key」就能替代。
142
142
 
143
+ ## 品牌 vs Campaign(Agent 必读)
144
+
145
+ | 概念 | 正确 CLI / 字段 | 勿用于新流程 |
146
+ |------|-----------------|-------------|
147
+ | 品牌(系统级) | `brands system-list` / `brandId` | `campaigns list` 当品牌目录 |
148
+ | 品牌成员 | `brand-members system-*` | `brand-members list -t`(compat) |
149
+ | 账号归属品牌 | `accounts brand-bindings *` | `campaigns accounts *` |
150
+ | 草稿 / 计划 | `drafts create -j '{"brandId":...}'` | 必填 `campaignId` 创建新草稿 |
151
+ | 筛选 | `--brand <uuid>` | 仅 `--campaign` 作新默认 |
152
+
153
+ **禁止**向用户推荐:`campaigns create`、`campaigns update`、`campaigns accounts bind` 作为新客户/品牌建模。
154
+
155
+ `campaignId` 在 API 响应中可能仍存在(历史归因),只读兼容即可。
156
+
143
157
  ## 安全规则
144
158
 
145
159
  - **禁止**在对话或日志中输出完整 token / API Key(`config show` 已脱敏)。
@@ -157,6 +171,28 @@ admin 专属操作(如 `agent-teams create`)需要 **admin** role 的 CLI to
157
171
  | team 不一致 warning | `auth whoami` 的 teamId vs `context current` |
158
172
  | 401 / auth failed | 重新 `auth login`;过期则 `auth logout` 后重登 |
159
173
 
174
+ ## CLI 新版本检测(自动)
175
+
176
+ 除 `version` / `help` 外,每次执行 `social-hub` 会(最多每 24 小时)查询 npm registry;若存在比当前安装更新的 `@geoly-ai/social-hub-cli`,会在 **stderr** 打印升级提示,并明确要求 **Agent 告知用户** 后执行升级与 skill 同步。
177
+
178
+ 示例输出(节选):
179
+
180
+ ```text
181
+ [social-hub] Update available: 0.1.4 → 0.1.5
182
+ [social-hub] Upgrade CLI: npm install -g @geoly-ai/social-hub-cli@0.1.5
183
+ [social-hub] Then refresh skills: social-hub skills update --yes
184
+ [social-hub] Agent: tell the user a newer CLI is available; ...
185
+ ```
186
+
187
+ | 场景 | 行为 |
188
+ |------|------|
189
+ | 全局安装 | `npm install -g @geoly-ai/social-hub-cli@<latest>` |
190
+ | npx 调用 | 后续命令使用 `npx @geoly-ai/social-hub-cli@<latest> …` |
191
+ | 跳过检查 | `SOCIAL_HUB_NO_UPDATE_CHECK=1` 或 `social-hub --no-update-check …` |
192
+ | CI | 设置 `CI=true` 时自动跳过 |
193
+
194
+ Agent 看到上述 stderr 时:**先向用户说明有新版本**,再执行升级命令,最后 `social-hub skills update --yes`(避免 CLI 与 skill 文档/命令漂移)。
195
+
160
196
  ## Agent skills 安装与更新
161
197
 
162
198
  CLI 升级后同步 skill 到 Cursor / Codex 等目录:
@@ -0,0 +1,15 @@
1
+ {
2
+ "skill_name": "social-hub-shared",
3
+ "evals": [
4
+ {
5
+ "id": 0,
6
+ "prompt": "第一次用 social-hub 连生产 API,怎么登录和选 team?",
7
+ "expected_output": "auth login Device Code、context use、doctor;禁止 SOCIAL_HUB_API_KEY 作为默认",
8
+ "assertions": [
9
+ { "type": "must_include", "value": "auth login" },
10
+ { "type": "forbidden_pattern", "value": "SOCIAL_HUB_API_KEY" },
11
+ { "type": "must_include_any", "values": ["brandId", "brands system"] }
12
+ ]
13
+ }
14
+ ]
15
+ }
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: social-hub-subreddit-pools
3
+ description: >-
4
+ Social Hub 运营板块池:catalog、pool aliases、tier rules 的 CRUD 与列表。
5
+ 用户要管理 industryKey/subreddit 目录、persona_pools.* alias、S0–S3 准入规则,
6
+ 或提到 social-hub pools、subreddit-pools API 时使用。不用于 watchlists、热帖、
7
+ insights 抓取(用 social-hub-intelligence)或 Agent 选板(用 social-hub-openclaw-context)。
8
+ ---
9
+
10
+ # social-hub-subreddit-pools
11
+
12
+ 先读 `social-hub-shared` 完成 `auth login` 与 `context use`。
13
+
14
+ ## 命令组
15
+
16
+ ```bash
17
+ social-hub pools catalog-list -t <team-id> [--pool-kind pet|common|industry|brand|other]
18
+ social-hub pools catalog-create -t <team-id> -j '{"industryKey":"...","industryLabel":"...","subreddit":"..."}'
19
+ social-hub pools catalog-update -t <team-id> --id <pool-id> -j '{...}'
20
+ social-hub pools catalog-delete -t <team-id> --id <pool-id>
21
+
22
+ social-hub pools aliases-list -t <team-id> [--alias-ref persona_pools.P23.starter]
23
+ social-hub pools aliases-create -t <team-id> -j '{"aliasRef":"persona_pools.P23.starter","industryKey":"common_pools__starter_casual"}'
24
+ social-hub pools aliases-update -t <team-id> --id <alias-id> -j '{...}'
25
+ social-hub pools aliases-delete -t <team-id> --id <alias-id>
26
+
27
+ social-hub pools tier-rules-list -t <team-id>
28
+ social-hub pools tier-rules-create -t <team-id> -j '{...}'
29
+ social-hub pools tier-rules-update -t <team-id> --id <rule-id> -j '{...}'
30
+ social-hub pools tier-rules-delete -t <team-id> --id <rule-id>
31
+ ```
32
+
33
+ ## API
34
+
35
+ - `GET/POST/PATCH/DELETE /v1/teams/:teamId/subreddit-pools/catalog`
36
+ - `GET/POST/PATCH/DELETE /v1/teams/:teamId/subreddit-pools/aliases`
37
+ - `GET/POST/PATCH/DELETE /v1/teams/:teamId/subreddit-pools/tier-rules`
38
+
39
+ 权限资源:`subredditPool`(与 `subredditIntelligence` 分析只读分离)。
40
+
41
+ 兼容:旧 `subreddit-intelligence/industry-pools` 仍可读;新写操作优先走 `subreddit-pools/*`。