@lightcone-ai/daemon 0.15.53 → 0.15.55

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.
@@ -1,417 +1,24 @@
1
1
  #!/usr/bin/env node
2
+ // Thin-proxy. Real implementation runs on lightcone server.
3
+ // Source of truth: src/mcp-services/hook-pattern-library.js
2
4
  import { z } from 'zod';
3
- import { startFixtureServer } from '../../official-common/server.js';
5
+ import { startThinProxy } from '../../_thin-proxy/forward.js';
4
6
 
5
- const FIXTURE_META = Object.freeze({
6
- mode: 'fixture',
7
- as_of: '2026-04-29',
8
- capability: 'hook-pattern-library',
9
- disclaimer: 'Pattern seeds are curated from local fixture examples, not live platform telemetry.',
10
- });
11
-
12
- const HOOK_PATTERNS = Object.freeze([
13
- {
14
- id: 'hook-q-gap-001',
15
- name: 'Question Gap',
16
- hook_family: 'question',
17
- template: '你以为 {common_belief},其实最关键的是 {unexpected_factor}?',
18
- example: '你以为涨粉靠日更,其实最关键的是开头 3 秒?',
19
- best_for_platforms: ['all'],
20
- best_for_formats: ['graphic', 'short_video', 'long_video'],
21
- intent_tags: ['engagement', 'authority'],
22
- risk_notes: '问题必须可在正文给出明确回答,避免空钩子。',
23
- },
24
- {
25
- id: 'hook-number-002',
26
- name: 'Concrete Number',
27
- hook_family: 'number',
28
- template: '我用 {duration} 把 {metric} 从 {before_value} 提到 {after_value}。',
29
- example: '我用 14 天把完播率从 19% 提到 37%。',
30
- best_for_platforms: ['xhs', 'douyin', 'wechat-mp'],
31
- best_for_formats: ['graphic', 'short_video'],
32
- intent_tags: ['engagement', 'conversion'],
33
- risk_notes: '数字必须可追溯,无法证明时需标注来源不详。',
34
- },
35
- {
36
- id: 'hook-contrast-003',
37
- name: 'Before/After Contrast',
38
- hook_family: 'contrast',
39
- template: '同样是 {topic},改了 {one_change} 前后结果差了 {delta}。',
40
- example: '同样是探店脚本,改了第一句前后播放差了 3 倍。',
41
- best_for_platforms: ['all'],
42
- best_for_formats: ['graphic', 'short_video'],
43
- intent_tags: ['engagement', 'retention'],
44
- risk_notes: '对比样本要可比,避免制造伪因果。',
45
- },
46
- {
47
- id: 'hook-mistake-004',
48
- name: 'Common Mistake',
49
- hook_family: 'mistake',
50
- template: '90% 的人做 {topic} 都会踩这 3 个坑。',
51
- example: '90% 的账号做矩阵分发都会踩这 3 个坑。',
52
- best_for_platforms: ['xhs', 'douyin', 'wechat-mp'],
53
- best_for_formats: ['graphic', 'short_video', 'long_video'],
54
- intent_tags: ['engagement', 'authority'],
55
- risk_notes: '避免绝对化夸张,结尾要给可执行修正。',
56
- },
57
- {
58
- id: 'hook-myth-005',
59
- name: 'Myth Busting',
60
- hook_family: 'myth',
61
- template: '别再信“{myth_statement}”了,真实情况刚好相反。',
62
- example: '别再信“账号越多越好”了,真实情况刚好相反。',
63
- best_for_platforms: ['all'],
64
- best_for_formats: ['graphic', 'short_video'],
65
- intent_tags: ['engagement', 'authority'],
66
- risk_notes: '反驳观点需给证据,不可只靠情绪。',
67
- },
68
- {
69
- id: 'hook-urgency-006',
70
- name: 'Window Urgency',
71
- hook_family: 'urgency',
72
- template: '{time_window} 内不做 {action},你会错过 {opportunity}。',
73
- example: '这周内不做评论区复盘,你会错过一次自然流量窗口。',
74
- best_for_platforms: ['douyin', 'xhs'],
75
- best_for_formats: ['short_video', 'graphic'],
76
- intent_tags: ['conversion', 'engagement'],
77
- risk_notes: '避免虚假稀缺,不可制造恐慌式误导。',
78
- },
79
- {
80
- id: 'hook-checklist-007',
81
- name: 'Checklist Tease',
82
- hook_family: 'checklist',
83
- template: '发稿前先过这 {count} 项清单,不然很容易被限流。',
84
- example: '发稿前先过这 7 项清单,不然很容易被限流。',
85
- best_for_platforms: ['xhs', 'douyin', 'wechat-mp'],
86
- best_for_formats: ['graphic', 'long_video'],
87
- intent_tags: ['authority', 'retention'],
88
- risk_notes: '清单要具体且可执行,避免泛化口号。',
89
- },
90
- {
91
- id: 'hook-story-008',
92
- name: 'Micro Story',
93
- hook_family: 'story',
94
- template: '昨天一个 {persona} 找我:{problem_scene},我们只改了 {one_change}。',
95
- example: '昨天一个本地餐饮老板找我:发了 20 条没起量,我们只改了开头镜头。',
96
- best_for_platforms: ['all'],
97
- best_for_formats: ['short_video', 'long_video', 'graphic'],
98
- intent_tags: ['engagement', 'conversion'],
99
- risk_notes: '案例需脱敏,避免可识别个人信息。',
100
- },
101
- {
102
- id: 'hook-taboo-009',
103
- name: 'Taboo Truth',
104
- hook_family: 'taboo',
105
- template: '行业里很少人明说:{taboo_truth}。',
106
- example: '行业里很少人明说:很多爆款不是靠选题,而是靠重写开头。',
107
- best_for_platforms: ['xhs', 'wechat-mp', 'douyin'],
108
- best_for_formats: ['graphic', 'long_video'],
109
- intent_tags: ['authority', 'engagement'],
110
- risk_notes: '避免涉及违法违规内幕叙述。',
111
- },
112
- {
113
- id: 'hook-cost-010',
114
- name: 'Cost Reveal',
115
- hook_family: 'cost',
116
- template: '这件事看起来省时间,其实每周要多花 {cost_delta}。',
117
- example: '全平台同文直发看起来省时间,其实每周要多花 6 小时返工。',
118
- best_for_platforms: ['wechat-mp', 'xhs'],
119
- best_for_formats: ['graphic', 'long_video'],
120
- intent_tags: ['authority', 'conversion'],
121
- risk_notes: '成本估算需说明口径,避免伪精确。',
122
- },
123
- {
124
- id: 'hook-benchmark-011',
125
- name: 'Benchmark Frame',
126
- hook_family: 'benchmark',
127
- template: '如果你的 {metric} 还在 {value},先别急着投流。',
128
- example: '如果你的 3 秒停留率还在 22%,先别急着投流。',
129
- best_for_platforms: ['douyin', 'xhs'],
130
- best_for_formats: ['short_video', 'graphic'],
131
- intent_tags: ['conversion', 'authority'],
132
- risk_notes: '阈值需标注来源或样本范围。',
133
- },
134
- {
135
- id: 'hook-challenge-012',
136
- name: 'Challenge Format',
137
- hook_family: 'challenge',
138
- template: '给你一个挑战:按这套模板连做 {duration} 天,看数据会不会变。',
139
- example: '给你一个挑战:按这套模板连做 7 天,看完播率会不会变。',
140
- best_for_platforms: ['douyin', 'xhs'],
141
- best_for_formats: ['short_video', 'graphic'],
142
- intent_tags: ['engagement', 'retention'],
143
- risk_notes: '避免过度承诺“必涨”“必爆”。',
144
- },
145
- {
146
- id: 'hook-comparison-013',
147
- name: 'A/B Comparison',
148
- hook_family: 'comparison',
149
- template: 'A 方案和 B 方案我都试过,真正拉开差距的是 {key_difference}。',
150
- example: 'A 方案和 B 方案我都试过,真正拉开差距的是第一屏字幕密度。',
151
- best_for_platforms: ['all'],
152
- best_for_formats: ['graphic', 'short_video', 'long_video'],
153
- intent_tags: ['authority', 'engagement'],
154
- risk_notes: '明确样本量,避免单次实验过拟合。',
155
- },
156
- {
157
- id: 'hook-antiintuitive-014',
158
- name: 'Counter-intuitive',
159
- hook_family: 'anti_intuitive',
160
- template: '越想 {goal},越不能先做 {common_action}。',
161
- example: '越想提升转化,越不能先改 CTA。',
162
- best_for_platforms: ['all'],
163
- best_for_formats: ['graphic', 'long_video', 'short_video'],
164
- intent_tags: ['engagement', 'authority'],
165
- risk_notes: '后文需解释机制,否则容易变标题党。',
166
- },
167
- {
168
- id: 'hook-hot-topic-015',
169
- name: 'Trend Piggyback',
170
- hook_family: 'trend',
171
- template: '趁 {trend_topic} 还在窗口期,这个切角更容易被推荐。',
172
- example: '趁“同城探店”还在窗口期,这个反差切角更容易被推荐。',
173
- best_for_platforms: ['xhs', 'douyin'],
174
- best_for_formats: ['short_video', 'graphic'],
175
- intent_tags: ['engagement', 'conversion'],
176
- risk_notes: '热点需确认时效,过期热点会触发 stale 风险。',
177
- },
178
- {
179
- id: 'hook-proof-016',
180
- name: 'Proof First',
181
- hook_family: 'proof',
182
- template: '先给你看证据:{proof_line},再说方法。',
183
- example: '先给你看证据:同样预算下互动率提升了 42%,再说方法。',
184
- best_for_platforms: ['wechat-mp', 'xhs', 'douyin'],
185
- best_for_formats: ['graphic', 'long_video', 'short_video'],
186
- intent_tags: ['authority', 'conversion'],
187
- risk_notes: '证据必须可溯源,避免“截图式”伪证据。',
188
- },
189
- {
190
- id: 'hook-community-017',
191
- name: 'Community Voice',
192
- hook_family: 'community',
193
- template: '过去 30 天我们收到最多的问题是:{question}。',
194
- example: '过去 30 天我们收到最多的问题是:矩阵号会不会互相限流?',
195
- best_for_platforms: ['xhs', 'wechat-mp'],
196
- best_for_formats: ['graphic', 'long_video'],
197
- intent_tags: ['engagement', 'retention'],
198
- risk_notes: '用户问题需脱敏,避免暴露私信信息。',
199
- },
200
- {
201
- id: 'hook-framework-018',
202
- name: 'Framework Reveal',
203
- hook_family: 'framework',
204
- template: '我把 {topic} 拆成一个 {steps} 步框架,今天直接给你。',
205
- example: '我把账号复盘拆成一个 4 步框架,今天直接给你。',
206
- best_for_platforms: ['all'],
207
- best_for_formats: ['graphic', 'long_video'],
208
- intent_tags: ['authority', 'retention', 'conversion'],
209
- risk_notes: '框架类内容要避免过于抽象,最好配案例。',
210
- },
211
- {
212
- id: 'hook-roleplay-019',
213
- name: 'Role-play Scenario',
214
- hook_family: 'scenario',
215
- template: '如果你是 {persona},今天只能做一件事,就做 {single_action}。',
216
- example: '如果你是新账号运营,今天只能做一件事,就做首屏重写。',
217
- best_for_platforms: ['douyin', 'xhs', 'wechat-mp'],
218
- best_for_formats: ['short_video', 'graphic', 'long_video'],
219
- intent_tags: ['conversion', 'engagement'],
220
- risk_notes: '角色设定要明确,不同人群给不同动作。',
221
- },
222
- {
223
- id: 'hook-failure-020',
224
- name: 'Failure Debrief',
225
- hook_family: 'failure',
226
- template: '这条内容失败了,我只复盘 1 个真正致命的问题。',
227
- example: '这条内容失败了,我只复盘 1 个真正致命的问题:开头误导。',
228
- best_for_platforms: ['all'],
229
- best_for_formats: ['short_video', 'graphic', 'long_video'],
230
- intent_tags: ['authority', 'engagement'],
231
- risk_notes: '失败复盘要客观,避免甩锅平台。',
232
- },
233
- {
234
- id: 'hook-objection-021',
235
- name: 'Objection Handling',
236
- hook_family: 'objection',
237
- template: '你可能会说“{objection}”,这正是很多人卡住的原因。',
238
- example: '你可能会说“我没时间拍”,这正是很多人卡住的原因。',
239
- best_for_platforms: ['xhs', 'douyin', 'wechat-mp'],
240
- best_for_formats: ['short_video', 'graphic'],
241
- intent_tags: ['conversion', 'retention'],
242
- risk_notes: '反对意见要真实常见,避免自造稻草人。',
243
- },
244
- {
245
- id: 'hook-time-022',
246
- name: 'Time Box',
247
- hook_family: 'time_box',
248
- template: '给我 {minutes} 分钟,我帮你把 {goal} 做成可执行版本。',
249
- example: '给我 10 分钟,我帮你把选题会做成可执行版本。',
250
- best_for_platforms: ['douyin', 'xhs'],
251
- best_for_formats: ['short_video', 'graphic'],
252
- intent_tags: ['conversion', 'engagement'],
253
- risk_notes: '时间承诺要匹配内容复杂度。',
254
- },
255
- {
256
- id: 'hook-reverse-023',
257
- name: 'Reverse Sequence',
258
- hook_family: 'reverse',
259
- template: '先说结论:{conclusion}。为什么?因为 {reason_tease}。',
260
- example: '先说结论:发得更少反而更稳。为什么?因为推荐系统看质量稳定性。',
261
- best_for_platforms: ['all'],
262
- best_for_formats: ['graphic', 'short_video', 'long_video'],
263
- intent_tags: ['authority', 'engagement'],
264
- risk_notes: '结论必须在后文证明,避免断言式误导。',
265
- },
266
- {
267
- id: 'hook-angle-024',
268
- name: 'Angle Shift',
269
- hook_family: 'angle_shift',
270
- template: '同一个话题,换成 {angle} 视角,点击会完全不同。',
271
- example: '同一个话题,换成“老板视角”,点击会完全不同。',
272
- best_for_platforms: ['xhs', 'wechat-mp', 'douyin'],
273
- best_for_formats: ['graphic', 'short_video', 'long_video'],
274
- intent_tags: ['engagement', 'retention'],
275
- risk_notes: '视角变化不能偏离品牌定位。',
276
- },
277
- ]);
278
-
279
- function normalizePlatform(value) {
280
- const raw = String(value ?? '').trim().toLowerCase();
281
- if (!raw) return '';
282
- if (raw === 'xiaohongshu' || raw === 'redbook') return 'xhs';
283
- if (raw === 'wechat' || raw === 'wechat_mp' || raw === 'wechatmp' || raw === 'gzh' || raw === '公众号') {
284
- return 'wechat-mp';
285
- }
286
- if (raw === 'tiktok_cn') return 'douyin';
287
- return raw;
288
- }
289
-
290
- function normalizeFormat(value) {
291
- return String(value ?? '').trim().toLowerCase();
292
- }
293
-
294
- function includesKeyword(pattern, keyword) {
295
- if (!keyword) return true;
296
- const haystack = [
297
- pattern.name,
298
- pattern.hook_family,
299
- pattern.template,
300
- pattern.example,
301
- ...pattern.intent_tags,
302
- ].join(' ').toLowerCase();
303
- return haystack.includes(keyword);
304
- }
305
-
306
- function fitScore(pattern, { platform, contentFormat, intent, keyword }) {
307
- let score = 0;
308
-
309
- if (!platform) {
310
- score += 1;
311
- } else if (pattern.best_for_platforms.includes('all') || pattern.best_for_platforms.includes(platform)) {
312
- score += 3;
313
- } else {
314
- return -1;
315
- }
316
-
317
- if (!contentFormat) {
318
- score += 1;
319
- } else if (pattern.best_for_formats.includes(contentFormat)) {
320
- score += 3;
321
- } else {
322
- return -1;
323
- }
324
-
325
- if (!intent) {
326
- score += 1;
327
- } else if (pattern.intent_tags.includes(intent)) {
328
- score += 2;
329
- }
330
-
331
- if (keyword) {
332
- if (includesKeyword(pattern, keyword)) {
333
- score += 4;
334
- } else {
335
- return -1;
336
- }
337
- }
338
-
339
- return score;
340
- }
341
-
342
- await startFixtureServer({
7
+ await startThinProxy({
343
8
  serverId: 'hook-pattern-library',
344
9
  serverName: 'official-hook-pattern-library',
345
- toolName: 'hook_pattern_library',
346
- toolDescription: 'Return curated hook-pattern seeds and recommended templates by platform/format.',
347
- inputSchema: {
348
- platform: z.enum(['xhs', 'douyin', 'wechat-mp']).optional()
349
- .describe('Target platform: xhs, douyin, or wechat-mp.'),
350
- content_format: z.enum(['graphic', 'short_video', 'long_video']).optional()
351
- .describe('Content format to match hook structure.'),
352
- intent: z.enum(['engagement', 'conversion', 'authority', 'retention']).optional()
353
- .describe('Primary objective for the draft hook.'),
354
- keyword: z.string().optional()
355
- .describe('Optional keyword filter against pattern name/template/example.'),
356
- limit: z.number().int().min(1).max(20).optional()
357
- .describe('Max number of returned patterns (default 8).'),
358
- include_examples: z.boolean().optional()
359
- .describe('Whether to include example lines in returned payload (default true).'),
360
- },
361
- handler: ({
362
- platform,
363
- content_format,
364
- intent,
365
- keyword,
366
- limit = 8,
367
- include_examples = true,
368
- }) => {
369
- const normalizedPlatform = normalizePlatform(platform);
370
- const normalizedFormat = normalizeFormat(content_format);
371
- const normalizedIntent = String(intent ?? '').trim().toLowerCase();
372
- const normalizedKeyword = String(keyword ?? '').trim().toLowerCase();
373
-
374
- const ranked = HOOK_PATTERNS
375
- .map((pattern) => ({
376
- pattern,
377
- score: fitScore(pattern, {
378
- platform: normalizedPlatform,
379
- contentFormat: normalizedFormat,
380
- intent: normalizedIntent,
381
- keyword: normalizedKeyword,
382
- }),
383
- }))
384
- .filter((entry) => entry.score >= 0)
385
- .sort((a, b) => {
386
- if (b.score !== a.score) return b.score - a.score;
387
- return a.pattern.id.localeCompare(b.pattern.id);
388
- })
389
- .slice(0, limit)
390
- .map((entry) => ({
391
- id: entry.pattern.id,
392
- name: entry.pattern.name,
393
- hook_family: entry.pattern.hook_family,
394
- template: entry.pattern.template,
395
- example: include_examples ? entry.pattern.example : undefined,
396
- best_for_platforms: entry.pattern.best_for_platforms,
397
- best_for_formats: entry.pattern.best_for_formats,
398
- intent_tags: entry.pattern.intent_tags,
399
- risk_notes: entry.pattern.risk_notes,
400
- fit_score: entry.score,
401
- }));
402
-
403
- return {
404
- ...FIXTURE_META,
405
- query: {
406
- platform: normalizedPlatform || null,
407
- content_format: normalizedFormat || null,
408
- intent: normalizedIntent || null,
409
- keyword: normalizedKeyword || null,
410
- limit,
10
+ tools: [
11
+ {
12
+ name: 'hook_pattern_library',
13
+ description: 'Return curated hook-pattern seeds and recommended templates by platform/format.',
14
+ inputSchema: {
15
+ platform: z.enum(['xhs', 'douyin', 'wechat-mp']).optional(),
16
+ content_format: z.enum(['graphic', 'short_video', 'long_video']).optional(),
17
+ intent: z.enum(['engagement', 'conversion', 'authority', 'retention']).optional(),
18
+ keyword: z.string().optional(),
19
+ limit: z.number().int().min(1).max(20).optional(),
20
+ include_examples: z.boolean().optional(),
411
21
  },
412
- seed_count: HOOK_PATTERNS.length,
413
- count: ranked.length,
414
- patterns: ranked,
415
- };
416
- },
22
+ },
23
+ ],
417
24
  });