@geoly-ai/social-hub-cli 0.3.23 → 0.3.25

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.
@@ -176,6 +176,9 @@ social-hub comment-drafts get -t <team-id> --draft <uuid>
176
176
  # 排期前 threadPermalink 必填(可 create 就带,或后续 update 补):
177
177
  social-hub comment-drafts create -t <team-id> \
178
178
  -j '{ "brandId":"<uuid>", "body":"<评论>", "subreddit":"buildapc", "threadPermalink":"https://reddit.com/r/buildapc/comments/xxx" }'
179
+ # 无品牌评论:省略 brandId 必须配显式 brandMention("忘了传" ≠ "明确没有品牌意图")
180
+ social-hub comment-drafts create -t <team-id> \
181
+ -j '{ "brandMention":"none", "body":"<评论>", "subreddit":"buildapc" }'
179
182
  social-hub comment-drafts update -t <team-id> --draft <uuid> -j '{ "body":"...", "expectedVersion": 2 }'
180
183
  social-hub comment-drafts delete -t <team-id> --draft <uuid>
181
184
  social-hub comment-drafts schedule -t <team-id> --draft <uuid> \
@@ -190,6 +193,13 @@ social-hub comment-drafts schedule -t <team-id> --draft <uuid> \
190
193
  complete 系统驱动,不可客户端直设(直设会撞 DB CHECK 或与真实 job 漂移)。
191
194
  - **排期前 `threadPermalink` 必填**:草稿没选帖(无 threadPermalink)直接 `schedule` 会被拒——
192
195
  先在 `create` 带上或用 `update` 补 `threadPermalink` 再排期。
196
+ - **无品牌评论草稿**(与帖子侧同一套语义):省略 `brandId` **必须**同时传 `brandMention: "none"`,
197
+ 两者同现(或与 `campaignId` 同现)一律 400 ——「忘了传」不等于「明确没有品牌意图」。
198
+ 服务端据此落 `brand_intent = 'declared_none'`,把它与**存量 / 历史 bug 落成的 NULL** 区分开;
199
+ **存量 `brand_intent IS NULL` 的行对品牌受限主体一律不可见**。品牌受限主体读/建/改/排期
200
+ 这类草稿分别要 `noBrandContent.read/create/update` 与 `noBrandContentSchedule.create`
201
+ 四格(删除**没有**对应格子,照旧 404);不受限主体行为不变。声明了无品牌的正文还会在
202
+ **创建、改 body、排期**三处过一次「正文里不得出现已登记品牌」的确定性核验。
193
203
  - **`comment-drafts update` 的 `expectedVersion`** 开乐观并发:版本不匹配 → 409;version 只在
194
204
  内容字段编辑时 +1——`body/subreddit/threadPermalink/parentCommentId/threadContext` 任一变更都
195
205
  bump,**只有纯 `status` 更新不 bump**。
@@ -57,6 +57,22 @@ social-hub drafts update -t <team-id> --draft <uuid> -j '{"body":"..."}'
57
57
  # 乐观并发:带 expectedVersion(get 返回的 version)防覆盖他人改动,版本不匹配返回 409
58
58
  social-hub drafts update -t <team-id> --draft <uuid> -j '{"body":"...","expectedVersion":3}'
59
59
  social-hub drafts delete -t <team-id> --draft <uuid> # 先确认 id,再执行
60
+
61
+ # 幂等创建(sourceRef):会重试的创建都该带上它——cron 重跑、超时重发、回执丢失后补发。
62
+ # 同一个 (team, sourceRef) 第二次创建不会再造一篇,而是返回第一次那篇 + reused:true(HTTP 200)。
63
+ social-hub drafts create -t <team-id> -j '{"brandId":"<uuid>","title":"Launch","body":"...","sourceRef":"agent:moss/2026-08-19.md"}'
64
+ # 按 key 反查(迁移期把本地 legacy key 映射到 Hub 草稿,不必靠标题去猜)
65
+ social-hub drafts list -t <team-id> --source-ref 'agent:moss/2026-08-19.md'
66
+ #
67
+ # ⚠️ 同 key 换内容 = 409 CONTENT_DRAFT_SOURCE_REF_CONFLICT(details.existingDraftId 指向既有草稿),
68
+ # 不是静默覆盖。改稿走 drafts update,或换一个新 key——别拿同一个 key 去发不同的内容。
69
+ # key 由你拥有、服务端不限制字符集(NFKC+trim、1..200、不含控制字符即可),
70
+ # `agent:reports/2026-08.json#3` 这种带 # 的键是合法的。
71
+ # 🔴 唯一的例外:`openclaw:` 前缀是 **OpenClaw 导入器专用的保留命名空间**,写入面直接 400。
72
+ # 因为导入器有权用源文件内容覆盖同 key 的草稿;你若占用该前缀,你的草稿会在下一次
73
+ # ingest 时被它当成"自己的"而覆盖掉。自己的 key 换个前缀(如 `agent:`)即可。
74
+ # (反查不受限制——按 `openclaw:<path>` 查导入器建的草稿是允许的。)
75
+ # 删除会释放 key:同 key 之后可以再建一篇**新**草稿(新 id)。
60
76
  # 一稿一投:日历条目 succeeded 时系统自动把关联草稿置为 published(终态);
61
77
  # published/已在活跃排期中/同计划重复引用的草稿都不能再排入新计划(400)。
62
78
  # 误标可手动改回状态(escape hatch):drafts update -j '{"status":"draft"}'