@geoly-ai/social-hub-cli 0.1.28 → 0.1.29

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.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@ All notable changes to `@geoly-ai/social-hub-cli` are documented in this file.
4
4
 
5
5
  Release workflow: `pnpm release:cli` → `pnpm publish:cli`.
6
6
 
7
+ ## [0.1.29] - 2026-06-15
8
+
9
+ ### Added
10
+
11
+ - make primaryProducts writable + complete account-sync skill
12
+
7
13
  ## [0.1.28] - 2026-06-15
8
14
 
9
15
  ### Changed
@@ -1,6 +1,6 @@
1
1
  {
2
- "generatedAt": "2026-06-15T02:18:48.034Z",
3
- "cliVersion": "0.1.28",
2
+ "generatedAt": "2026-06-15T03:40:06.147Z",
3
+ "cliVersion": "0.1.29",
4
4
  "commands": [
5
5
  "accounts",
6
6
  "accounts brand-bindings",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geoly-ai/social-hub-cli",
3
- "version": "0.1.28",
3
+ "version": "0.1.29",
4
4
  "type": "module",
5
5
  "description": "social-hub CLI for Social Ops Hub",
6
6
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 1,
3
3
  "package": "social-ops-hub",
4
- "cliVersion": "0.1.28",
4
+ "cliVersion": "0.1.29",
5
5
  "repository": "social-ops-hub",
6
6
  "publish": {
7
7
  "registry": "https://skill.sh",
@@ -6,6 +6,9 @@ description: >-
6
6
  subreddit-affinities、personas。用户要查 Reddit 账号、
7
7
  改 handle、绑品牌、看账号状态快照、管理浏览器环境、记录 IP/健康检查 telemetry、
8
8
  管理账号 subreddit affinity/cooldown/risk 或人设时用本 skill。
9
+ 「同步/录入账号数据」时务必看「账号数据全量同步 checklist」——账号数据跨多个写入面
10
+ (核心字段、合规画像时区/安全时段、互动配额、品牌绑定、人设、affinity、浏览器环境),
11
+ 逐面写才不漏字段。
9
12
  metadata:
10
13
  cliVersion: ">=0.1.8"
11
14
  ---
@@ -29,12 +32,99 @@ OpenClaw 执行前优先 `social-hub context account`(见 `social-hub-openclaw
29
32
  ```bash
30
33
  social-hub accounts list -t <team-id> -n 50 [--status active] [--persona <persona-uuid>] [--category A]
31
34
  social-hub accounts get -t <team-id> --account <uuid>
32
- social-hub accounts create -t <team-id> -j '{"platform":"reddit","handle":"u/example","personaId":"<persona-uuid>","credentialsRef":"vault:team/main"}'
33
- social-hub accounts update -t <team-id> --account <uuid> -j '{"workflowStage":"active","karma":1200,"personaId":"<persona-uuid>","externalRef":"<external-ref>"}'
35
+ # create:platform 必填,其余可选。一次把已知字段都带上,别只传 handle
36
+ social-hub accounts create -t <team-id> -j '{
37
+ "platform": "reddit",
38
+ "handle": "u/example",
39
+ "profileUrl": "https://reddit.com/u/example",
40
+ "personaId": "<persona-uuid>",
41
+ "externalId": "t2_xxxx",
42
+ "externalRef": "A11",
43
+ "credentialsRef": "vault:team/main",
44
+ "status": "warming",
45
+ "karma": 1200,
46
+ "accountAgeDays": 365,
47
+ "workflowStage": "onboarded",
48
+ "metricsSource": "reddit_about",
49
+ "metricsUpdatedAt": "2026-06-15T00:00:00Z",
50
+ "primaryProducts": ["plaud-note", "plaud-notepin"]
51
+ }'
52
+ # update:所有核心字段都可改(PATCH,未传的键不动;可空字段传 null 清除)。
53
+ social-hub accounts update -t <team-id> --account <uuid> -j '{
54
+ "handle": "u/example",
55
+ "status": "active",
56
+ "karma": 1500,
57
+ "workflowStage": "active",
58
+ "personaId": "<persona-uuid>",
59
+ "externalRef": "A11",
60
+ "metricsSource": "reddit_about",
61
+ "metricsUpdatedAt": "2026-06-15T00:00:00Z",
62
+ "primaryProducts": ["plaud-note"]
63
+ }'
34
64
  social-hub accounts delete -t <team-id> --account <uuid> --dry-run
35
65
  social-hub accounts delete -t <team-id> --account <uuid> # 危险
36
66
  ```
37
67
 
68
+ ### 核心字段可写清单(`accounts create` / `update` 的 `-j` body)
69
+
70
+ | 字段 | create | update | 类型 / 取值 |
71
+ | ------------------ | :--------: | :----------: | ---------------------------------------------------------------------------------------- |
72
+ | `platform` | ✅(必填) | ❌(不可改) | string |
73
+ | `handle` | ✅ | ✅ | string(update 可 null) |
74
+ | `profileUrl` | ✅ | ✅ | URL(update 可 null/空串清除) |
75
+ | `externalId` | ✅ | ✅ | 平台 id,非 URL(可 null) |
76
+ | `externalRef` | ✅ | ✅ | 团队内唯一 slot,如 `A11`(可 null) |
77
+ | `personaId` | ✅ | ✅ | 系统级人设 uuid(可 null) |
78
+ | `credentialsRef` | ✅ | ✅ | vault 引用(可 null) |
79
+ | `status` | ✅ | ✅ | `warming\|active\|postable\|restricted\|banned` |
80
+ | `karma` | ✅ | ✅ | int ≥0(可 null) |
81
+ | `accountAgeDays` | ✅ | ✅ | int ≥0(可 null) |
82
+ | `workflowStage` | ✅ | ✅ | `prospect\|qualified\|warming\|onboarded\|active\|at_risk\|restricted\|paused\|archived` |
83
+ | `metricsSource` | ✅ | ✅ | string(可 null) |
84
+ | `metricsUpdatedAt` | ✅ | ✅ | ISO8601(可 null) |
85
+ | `primaryProducts` | ✅ | ✅ | string[](账号主推产品,≤50 项;可 null) |
86
+
87
+ > `postable` 状态要求 `karma > 20`,否则 400。
88
+
89
+ ## 账号数据全量同步 checklist
90
+
91
+ 「同步一个账号」≠ 只调 `accounts update`。账号数据分散在多个写入面,下面每一面都要按需写,否则字段会漏。建议按序执行:
92
+
93
+ 1. **核心字段** → `accounts create`/`update`(上表全部字段,含 `primaryProducts`)。
94
+ 2. **合规画像(时区 / 安全时段 / 风险等级)** → `compliance risk-put`(见下「合规画像」段;账号池列表的「当地时间」就读这里的 `timezone`)。
95
+ 3. **互动配额 / guardrails** → `accounts guardrails-set`(阶段晋升、配额)。
96
+ 4. **品牌绑定** → `accounts brand-bindings add`。
97
+ 5. **人设** → `personaId`(via `accounts update`,系统级)+ 版本化 markdown `accounts personas create`。
98
+ 6. **subreddit affinity / 冷却 / 风险** → `accounts subreddit-affinities upsert`。
99
+ 7. **浏览器环境**(含 env 时区、telemetry)→ `accounts browser-envs`。
100
+
101
+ > 完整同步后用 `accounts get` + `compliance risk-get` + `accounts guardrails-get` 回读核对,确认没漏面。
102
+
103
+ ## 合规画像(时区 / 安全时段 / 风险等级)
104
+
105
+ 账号的时区、安全发帖时段、风险等级存在**风险画像**里(`account_risk_profiles`,每账号一条),命令在 `compliance` 组——详见 [`../social-hub-graph-compliance/SKILL.md`](../social-hub-graph-compliance/SKILL.md)。这是账号数据的一部分,同步账号时不要漏:
106
+
107
+ ```bash
108
+ social-hub compliance risk-get -t <team-id> -a <uuid>
109
+ social-hub compliance risk-put -t <team-id> -a <uuid> -j '{
110
+ "timezone": "Asia/Shanghai",
111
+ "safeHoursStart": "08:00",
112
+ "safeHoursEnd": "22:00",
113
+ "riskLevel": "low",
114
+ "notes": "..."
115
+ }'
116
+ ```
117
+
118
+ `timezone` 缺省 `UTC`、`safeHoursStart/End` 缺省 `08:00`/`22:00`。账号池列表展示的「当地时间 + 安全时段标记」直接读 `timezone` 与 `safeHours*`——没配的账号列表里显示 `—`。
119
+
120
+ ## 不可写 / 系统管理字段
121
+
122
+ 下列字段**不能**通过 `accounts create/update` 写,别误以为同步了:
123
+
124
+ - `oauthExpiresAt` — 仅 OAuth 令牌刷新流程写。
125
+ - `feishuRecordId` / `feishuBrandRaw` / `feishuRawPayload` — 飞书 ETL 内部写(见职责边界)。
126
+ - `postingSummary` — 系统计算字段。
127
+
38
128
  ## 品牌绑定(账号归属团队,品牌 uuid 系统级)
39
129
 
40
130
  `--brand` 必须来自 `social-hub brands system-list` 的全局 brand uuid。