@gobing-ai/knowledge-kit 0.1.13 → 0.1.15

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 (77) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/index.js +796 -176
  3. package/package.json +1 -1
  4. package/plugins/generations/content-gen/dist/index.js +2 -2
  5. package/plugins/generations/core-facts-gen/dist/index.js +2 -2
  6. package/plugins/generations/daily-article-gen/dist/index.js +2 -2
  7. package/plugins/generations/dailynews-gen/dist/index.js +72 -9
  8. package/plugins/generations/dailynews-gen/src/index.ts +23 -1
  9. package/plugins/generations/dailynews-gen/src/script-plan.ts +103 -5
  10. package/plugins/generations/episode-plan-gen/dist/index.js +2 -2
  11. package/plugins/generations/gemini-tts/dist/index.js +2 -2
  12. package/plugins/generations/image-gen/dist/index.js +2 -2
  13. package/plugins/generations/news-report-gen/dist/index.js +2 -2
  14. package/plugins/generations/voice-gen/dist/index.js +2 -2
  15. package/plugins/generations/voxcpm-tts/dist/index.js +2 -2
  16. package/plugins/ingestions/aihot-ingest/dist/index.js +2 -2
  17. package/plugins/ingestions/horizon-ingest/dist/index.js +2 -2
  18. package/plugins/ingestions/last30days-ingest/dist/index.js +2 -2
  19. package/plugins/ingestions/web-search/dist/index.js +2 -2
  20. package/plugins/kk/plugin.json +1 -1
  21. package/plugins/kk/scripts/daily-scheduled-run.ts +53 -5
  22. package/plugins/kk/scripts/daily-stages.ts +476 -12
  23. package/plugins/kk/scripts/kk-workflow-stages.ts +20 -4
  24. package/plugins/kk/skills/content-judge/SKILL.md +5 -4
  25. package/plugins/kk/skills/content-judge/references/rubrics.md +14 -0
  26. package/plugins/kk/skills/news-editorial/SKILL.md +122 -0
  27. package/plugins/kk/skills/news-editorial/references/selection.md +47 -0
  28. package/plugins/kk/skills/news-editorial/references/style-contract.zh.md +99 -0
  29. package/plugins/kk/skills/publish/SKILL.md +3 -3
  30. package/plugins/kk/skills/web-automation/SKILL.md +229 -77
  31. package/plugins/kk/skills/web-automation/references/browser-launch.md +127 -36
  32. package/plugins/kk/workflows/kk-daily-ai-voice2.yaml +4 -6
  33. package/plugins/kk/workflows/kk-daily-ai-voice3.yaml +183 -222
  34. package/plugins/kk/workflows/kk-daily-publish3.yaml +16 -8
  35. package/plugins/publishings/bilibili-pub/dist/index.js +5 -3
  36. package/plugins/publishings/bilibili-pub/dist/profile-check.js +3 -1
  37. package/plugins/publishings/cnblogs-pub/dist/index.js +5 -3
  38. package/plugins/publishings/cnblogs-pub/dist/profile-check.js +3 -1
  39. package/plugins/publishings/csdn-pub/dist/index.js +5 -3
  40. package/plugins/publishings/csdn-pub/dist/profile-check.js +5 -3
  41. package/plugins/publishings/emdash-pub/dist/index.js +2 -2
  42. package/plugins/publishings/infoq-pub/dist/index.js +5 -3
  43. package/plugins/publishings/infoq-pub/dist/profile-check.js +5 -3
  44. package/plugins/publishings/jike-pub/dist/index.js +5 -3
  45. package/plugins/publishings/jike-pub/dist/profile-check.js +5 -3
  46. package/plugins/publishings/juejin-pub/dist/index.js +5 -3
  47. package/plugins/publishings/juejin-pub/dist/profile-check.js +5 -3
  48. package/plugins/publishings/linkedin-pub/dist/index.js +5 -3
  49. package/plugins/publishings/linkedin-pub/dist/profile-check.js +5 -3
  50. package/plugins/publishings/medium-pub/dist/index.js +2 -2
  51. package/plugins/publishings/podcast-pub/dist/index.js +147 -4
  52. package/plugins/publishings/podcast-pub/src/index.ts +71 -2
  53. package/plugins/publishings/podcast-pub/src/map.ts +3 -0
  54. package/plugins/publishings/podcast-pub/src/transcript.ts +195 -0
  55. package/plugins/publishings/qiita-pub/dist/index.js +2 -2
  56. package/plugins/publishings/shipinhao-pub/dist/index.js +5 -3
  57. package/plugins/publishings/shipinhao-pub/dist/profile-check.js +3 -1
  58. package/plugins/publishings/sspai-pub/dist/index.js +5 -3
  59. package/plugins/publishings/sspai-pub/dist/profile-check.js +3 -1
  60. package/plugins/publishings/substack-pub/dist/index.js +5 -3
  61. package/plugins/publishings/substack-pub/dist/profile-check.js +5 -3
  62. package/plugins/publishings/surfdash-pub/dist/index.js +2 -2
  63. package/plugins/publishings/threads-pub/dist/index.js +2 -2
  64. package/plugins/publishings/wechatmp-pub/dist/index.js +52 -33
  65. package/plugins/publishings/wechatmp-pub/dist/profile-check.js +5 -3
  66. package/plugins/publishings/wechatmp-pub/src/flow.ts +70 -33
  67. package/plugins/publishings/weibo-pub/dist/index.js +21 -6
  68. package/plugins/publishings/weibo-pub/dist/profile-check.js +5 -3
  69. package/plugins/publishings/weibo-pub/src/index.ts +31 -7
  70. package/plugins/publishings/x-pub/dist/index.js +5 -3
  71. package/plugins/publishings/x-pub/dist/profile-check.js +5 -3
  72. package/plugins/publishings/xhs-pub/dist/index.js +5 -3
  73. package/plugins/publishings/xhs-pub/dist/profile-check.js +5 -3
  74. package/plugins/publishings/xiaoyuzhou-pub/dist/index.js +5 -3
  75. package/plugins/publishings/xiaoyuzhou-pub/dist/profile-check.js +3 -1
  76. package/plugins/publishings/zenn-pub/dist/index.js +2 -2
  77. package/plugins/kk/scripts/daily-voice-style.zh.md +0 -70
@@ -400,10 +400,16 @@ export class WeiboBrowserTransport implements PublishTransport {
400
400
  await page.evaluate(confirmCoverModalScript());
401
401
  }
402
402
  // A requested cover needs a fresh observed attachment, not a successful upload call.
403
- const attached = await expectOutcome(() => this.probeCoverAttached(page, bodySelector, baseline), {
404
- timeoutMs: this.stepTimeoutMs,
405
- label: 'weibo article cover attachment',
406
- });
403
+ const attached = await expectOutcome(
404
+ () =>
405
+ // Cover settles in the v5 publish-settings panel (.cover-preview) — outside the
406
+ // body editor scope the body-image count probes, so accept the panel preview too.
407
+ this.probeCoverAttached(page, bodySelector, baseline),
408
+ {
409
+ timeoutMs: this.stepTimeoutMs,
410
+ label: 'weibo article cover attachment',
411
+ },
412
+ );
407
413
  if (!attached.ok) return fail(attached.error);
408
414
  }
409
415
 
@@ -563,7 +569,15 @@ export class WeiboBrowserTransport implements PublishTransport {
563
569
 
564
570
  private async probeCoverAttached(page: Page, selector: string, baseline: number): Promise<string | null> {
565
571
  const count = await this.countImages(page, selector);
566
- return count > baseline ? `cover-attached (${count} images)` : null;
572
+ if (count > baseline) return `cover-attached (${count} images)`;
573
+ // The v5 editor routes a modal-picked cover into the publish-settings panel
574
+ // (.cover-preview / img.cover-img) — outside the body scope, so the body count never moves.
575
+ const preview = Number(
576
+ await page.evaluate(
577
+ `() => document.querySelectorAll('section:not(:has(.n-modal)) .cover-preview, .cover-preview, img.cover-img').length`,
578
+ ),
579
+ );
580
+ return Number.isFinite(preview) && preview > 0 ? `cover-attached (cover-preview x${preview})` : null;
567
581
  }
568
582
 
569
583
  /** Visible toast texts before a save, so an already-visible toast cannot satisfy the draft rail. */
@@ -812,7 +826,13 @@ function openCoverLibraryScript(): string {
812
826
  tab.click();
813
827
  }
814
828
  }
815
- for (let i = 0; i < 15 && !document.querySelector('input[type="file"]'); i += 1) await sleep(200);
829
+ for (let i = 0; i < 30 && !document.querySelector('input[type="file"]'); i += 1) await sleep(200);
830
+ // The 图片库 tab lazy-loads (upload button + items mount ~5-8s after the tab click; the fixed
831
+ // 3s window could race it, and a raced tab leaves fileInputs=0 → no cover attachment).
832
+ for (let i = 0; i < 40; i += 1) {
833
+ if (document.querySelector('.n-modal img, .n-modal input[type="file"]')) break;
834
+ await sleep(250);
835
+ }
816
836
  return true;
817
837
  })()`;
818
838
  }
@@ -842,7 +862,11 @@ function confirmCoverModalScript(): string {
842
862
  }
843
863
  await sleep(200);
844
864
  }
845
- await sleep(1800);
865
+ // The 下一步 opens the 图片裁剪 crop modal (上一步/确定), which takes several seconds to
866
+ // render — poll for it before clicking, then wait for the whole modal chain to close.
867
+ for (let i = 0; i < 40 && !Array.from(document.querySelectorAll('.n-modal button')).find((b) => (b.textContent || '').trim() === '确定'); i += 1) {
868
+ await sleep(250);
869
+ }
846
870
  for (let i = 0; i < 15; i += 1) {
847
871
  const okBtn = Array.from(document.querySelectorAll('.n-modal button')).find(
848
872
  (b) => (b.textContent || '').trim() === '确定' && !b.disabled,
@@ -20074,11 +20074,11 @@ var PluginManifestSchemaBase = looseObject({
20074
20074
  });
20075
20075
  var PluginManifestSchema = PluginManifestSchemaBase.superRefine((manifest, ctx) => {
20076
20076
  if (manifest.browserSession !== undefined) {
20077
- if (manifest.kind !== "publish") {
20077
+ if (manifest.kind !== "publish" && manifest.kind !== "ingestion") {
20078
20078
  ctx.addIssue({
20079
20079
  code: "custom",
20080
20080
  path: ["browserSession"],
20081
- message: `browserSession requires kind "publish", not "${manifest.kind}"`
20081
+ message: `browserSession requires kind "publish" or "ingestion", not "${manifest.kind}"`
20082
20082
  });
20083
20083
  }
20084
20084
  if (manifest.check === undefined) {
@@ -20726,10 +20726,12 @@ function sha256Hex(value) {
20726
20726
  var DEFAULT_BOT_PROFILE_ROOT = join4(homedir4(), ".config", "kk", "browser-profiles");
20727
20727
  class BotError extends Error {
20728
20728
  code;
20729
- constructor(code, message) {
20729
+ details;
20730
+ constructor(code, message, details = {}) {
20730
20731
  super(message);
20731
20732
  this.name = "BotError";
20732
20733
  this.code = code;
20734
+ this.details = details;
20733
20735
  }
20734
20736
  }
20735
20737
  // ../../packages/publish-harness/src/profile-dir.ts
@@ -20369,10 +20369,12 @@ function normalizeSessionIdentity(value) {
20369
20369
  }
20370
20370
  class BotError extends Error {
20371
20371
  code;
20372
- constructor(code, message) {
20372
+ details;
20373
+ constructor(code, message, details = {}) {
20373
20374
  super(message);
20374
20375
  this.name = "BotError";
20375
20376
  this.code = code;
20377
+ this.details = details;
20376
20378
  }
20377
20379
  }
20378
20380
  // ../../packages/publish-harness/src/index.ts
@@ -20945,11 +20947,11 @@ var PluginManifestSchemaBase = looseObject({
20945
20947
  });
20946
20948
  var PluginManifestSchema = PluginManifestSchemaBase.superRefine((manifest, ctx) => {
20947
20949
  if (manifest.browserSession !== undefined) {
20948
- if (manifest.kind !== "publish") {
20950
+ if (manifest.kind !== "publish" && manifest.kind !== "ingestion") {
20949
20951
  ctx.addIssue({
20950
20952
  code: "custom",
20951
20953
  path: ["browserSession"],
20952
- message: `browserSession requires kind "publish", not "${manifest.kind}"`
20954
+ message: `browserSession requires kind "publish" or "ingestion", not "${manifest.kind}"`
20953
20955
  });
20954
20956
  }
20955
20957
  if (manifest.check === undefined) {
@@ -20073,11 +20073,11 @@ var PluginManifestSchemaBase = looseObject({
20073
20073
  });
20074
20074
  var PluginManifestSchema = PluginManifestSchemaBase.superRefine((manifest, ctx) => {
20075
20075
  if (manifest.browserSession !== undefined) {
20076
- if (manifest.kind !== "publish") {
20076
+ if (manifest.kind !== "publish" && manifest.kind !== "ingestion") {
20077
20077
  ctx.addIssue({
20078
20078
  code: "custom",
20079
20079
  path: ["browserSession"],
20080
- message: `browserSession requires kind "publish", not "${manifest.kind}"`
20080
+ message: `browserSession requires kind "publish" or "ingestion", not "${manifest.kind}"`
20081
20081
  });
20082
20082
  }
20083
20083
  if (manifest.check === undefined) {
@@ -20701,10 +20701,12 @@ function sha256Hex(value) {
20701
20701
  var DEFAULT_BOT_PROFILE_ROOT = join4(homedir4(), ".config", "kk", "browser-profiles");
20702
20702
  class BotError extends Error {
20703
20703
  code;
20704
- constructor(code, message) {
20704
+ details;
20705
+ constructor(code, message, details = {}) {
20705
20706
  super(message);
20706
20707
  this.name = "BotError";
20707
20708
  this.code = code;
20709
+ this.details = details;
20708
20710
  }
20709
20711
  }
20710
20712
  // ../../packages/publish-harness/src/profile-dir.ts
@@ -20370,10 +20370,12 @@ function sha256Hex(value) {
20370
20370
  var DEFAULT_BOT_PROFILE_ROOT = join3(homedir3(), ".config", "kk", "browser-profiles");
20371
20371
  class BotError extends Error {
20372
20372
  code;
20373
- constructor(code, message) {
20373
+ details;
20374
+ constructor(code, message, details = {}) {
20374
20375
  super(message);
20375
20376
  this.name = "BotError";
20376
20377
  this.code = code;
20378
+ this.details = details;
20377
20379
  }
20378
20380
  }
20379
20381
  // ../../packages/publish-harness/src/index.ts
@@ -20919,11 +20921,11 @@ var PluginManifestSchemaBase = looseObject({
20919
20921
  });
20920
20922
  var PluginManifestSchema = PluginManifestSchemaBase.superRefine((manifest, ctx) => {
20921
20923
  if (manifest.browserSession !== undefined) {
20922
- if (manifest.kind !== "publish") {
20924
+ if (manifest.kind !== "publish" && manifest.kind !== "ingestion") {
20923
20925
  ctx.addIssue({
20924
20926
  code: "custom",
20925
20927
  path: ["browserSession"],
20926
- message: `browserSession requires kind "publish", not "${manifest.kind}"`
20928
+ message: `browserSession requires kind "publish" or "ingestion", not "${manifest.kind}"`
20927
20929
  });
20928
20930
  }
20929
20931
  if (manifest.check === undefined) {
@@ -20073,11 +20073,11 @@ var PluginManifestSchemaBase = looseObject({
20073
20073
  });
20074
20074
  var PluginManifestSchema = PluginManifestSchemaBase.superRefine((manifest, ctx) => {
20075
20075
  if (manifest.browserSession !== undefined) {
20076
- if (manifest.kind !== "publish") {
20076
+ if (manifest.kind !== "publish" && manifest.kind !== "ingestion") {
20077
20077
  ctx.addIssue({
20078
20078
  code: "custom",
20079
20079
  path: ["browserSession"],
20080
- message: `browserSession requires kind "publish", not "${manifest.kind}"`
20080
+ message: `browserSession requires kind "publish" or "ingestion", not "${manifest.kind}"`
20081
20081
  });
20082
20082
  }
20083
20083
  if (manifest.check === undefined) {
@@ -20707,10 +20707,12 @@ function sha256Hex(value) {
20707
20707
  var DEFAULT_BOT_PROFILE_ROOT = join4(homedir4(), ".config", "kk", "browser-profiles");
20708
20708
  class BotError extends Error {
20709
20709
  code;
20710
- constructor(code, message) {
20710
+ details;
20711
+ constructor(code, message, details = {}) {
20711
20712
  super(message);
20712
20713
  this.name = "BotError";
20713
20714
  this.code = code;
20715
+ this.details = details;
20714
20716
  }
20715
20717
  }
20716
20718
  // ../../packages/publish-harness/src/profile-dir.ts
@@ -20097,10 +20097,12 @@ function normalizeSessionIdentity(value) {
20097
20097
  }
20098
20098
  class BotError extends Error {
20099
20099
  code;
20100
- constructor(code, message) {
20100
+ details;
20101
+ constructor(code, message, details = {}) {
20101
20102
  super(message);
20102
20103
  this.name = "BotError";
20103
20104
  this.code = code;
20105
+ this.details = details;
20104
20106
  }
20105
20107
  }
20106
20108
  // ../../packages/publish-harness/src/index.ts
@@ -12226,11 +12226,11 @@ var PluginManifestSchemaBase = looseObject({
12226
12226
  });
12227
12227
  var PluginManifestSchema = PluginManifestSchemaBase.superRefine((manifest, ctx) => {
12228
12228
  if (manifest.browserSession !== undefined) {
12229
- if (manifest.kind !== "publish") {
12229
+ if (manifest.kind !== "publish" && manifest.kind !== "ingestion") {
12230
12230
  ctx.addIssue({
12231
12231
  code: "custom",
12232
12232
  path: ["browserSession"],
12233
- message: `browserSession requires kind "publish", not "${manifest.kind}"`
12233
+ message: `browserSession requires kind "publish" or "ingestion", not "${manifest.kind}"`
12234
12234
  });
12235
12235
  }
12236
12236
  if (manifest.check === undefined) {
@@ -1,70 +0,0 @@
1
- # 每日AI乱炖 · 主持风格契约(zh)
2
-
3
- `kk-daily-ai-voice` 的每一句口播都受这份契约约束(F613 R1;0189 R1 改定位;2026-10-08 改名)。
4
- `script-write` 提示词与 `dailynews-gen` 的校验器读取同一份机器可读块,因此提示词与校验永远一致。
5
-
6
- ## 栏目定位
7
-
8
- 「每日AI乱炖」是「咸话咸说」下的 AI 技术分享栏目,完整名称「咸话咸说之每日AI乱炖」,副题
9
- 「工具、论文与实践随聊」。栏目名突出当天,不是把节目名当成说话人。口播是开发者视角的技术
10
- 分享,不是新闻通报:不播报时事,不以任何代称、绰号或「闲聊」包装政治、外交、军事、公共
11
- 政策争议或社会公共事件主线的内容——这类条目在选题/QC 阶段就应被排除(0189 R2)。身份与
12
- 经历必须真实:只讲真实做过的实测与实践。制作方式由栏目设置说明,口播、正文和 show notes
13
- 不要再附「文字由 AI 辅助整理,音频为 AI 合成配音」或「本期音频为 AI 合成配音」。
14
-
15
- ## 人设与语域
16
-
17
- - 口语化普通话,第一人称「我」,像一位冷静、有依据的 AI 技术分享主播。
18
- - 平实、克制、不炒作:不夸大单一消息的意义,不使用惊叹式渲染或营销话术。
19
- - 面向普通听众说明「这件事为什么重要」或「怎么用得上」,而不是堆砌术语。
20
-
21
- ## 固定开场与收尾
22
-
23
- 开场问候与收尾致谢由 builder 固定输出,计划文本只填充两者之间的内容,节目身份永不漂移:
24
-
25
- - 开场:`大家好,今天是<日期>。这里是由<主持人>为你带来的咸话咸说之每日AI乱炖。`
26
- - 收尾:`感谢您的收听,我是<主持人>,祝您拥有充实高效的一天,我们下期节目不见不散!`
27
-
28
- ## 段落角色
29
-
30
- - `intro`:开场导语,串起今天几个主题,接在固定问候之后,不超过 150 字。
31
- - `lead`:一句话口语桥段,引出下一个主题的【标题】;只做铺垫,不得复述标题本身,不超过 80 字。
32
- - `insight`:只基于这一条自身可核事实的点评(3–6 句),展开这一条自身的机制→意义→实用角度;不得挪用其他条目的话题,不超过 380 字。听众刚听完这一条的事实叙述,insight 是点评不是复读:不得复述正文已讲过的事实、数字或成串措辞(最多点到一两个关键词),深度来自角度和判断,不是把事实再讲一遍。时长契约:全片按 15–20 分钟口播设计,insight 应写到接近上限——宁可深挖这一条的角度,也不要浅尝辄止。字数按配音驱动折算:gemini ≈3.3 字/秒(正文约 4300–5800 字);Voicebox robin-news ≈6.3 字/秒(正文约 5700–7600 字,或增加条目数)。
33
- - `outro`:简短收束语,接在固定致谢之前,不超过 150 字。
34
-
35
- ## 机器可读契约
36
-
37
- `caps` 是各字段的字数上限;`banned` 是任何计划字段都不得出现的短语——包括旧模板的全部罐头
38
- 点评、旧模板的 首先/接着/最后 开头、0133 的研究脚手架标签与对冲语(校验规则
39
- `banned:<短语>`),以及 0189 R4 退役的旧栏目名(「每日 AI 资讯」「AI科技漫谈」
40
- 「AI Daily Briefing」):任何路径都不得让旧新闻定位复活。
41
-
42
- ```json
43
- {
44
- "caps": { "intro": 150, "outro": 150, "lead": 80, "insight": 380 },
45
- "banned": [
46
- "在各种技术光环背后,正是这样专注而不知疲倦的底层攻坚者,为今天整个大模型生态奠定了最坚实的技术基石。",
47
- "这其实释放了一个非常明确的信号:AI竞争的下半场,已经不再只是单纯拼模型参数,更是电力、能源和全栈工业基础设施的硬核较量。",
48
- "真正被重新定义的,是硬件层承担的安全与算力责任:把能力做进硅片层更可靠、也更难绕过,但生态锁定的代价需要一起算进去。",
49
- "我个人觉得,这次最大的看点是内容创作门槛的再次降低。不过正如团队提到的,如何平衡创作自由与防止低质内容泛滥,会是整个行业接下来最值得观察的关键考题。",
50
- "这项进展反映出资本与产业界正在加速形成合力,后续实际业务场景的落地效果非常值得我们持续跟进。",
51
- "这项新动态反映出技术演进正在进一步提速,对相关领域的实际影响也非常值得我们持续关注。",
52
- "首先",
53
- "接着",
54
- "最后",
55
- "可做角度",
56
- "背景",
57
- "潜在影响",
58
- "读者宜另行核实",
59
- "仍待验证",
60
- "每日AI资讯",
61
- "每日 AI 资讯",
62
- "今日AI科技漫谈",
63
- "AI科技漫谈",
64
- "AI Daily Briefing",
65
- "我是咸话咸说",
66
- "音频为 AI 合成配音",
67
- "The audio in this episode is AI-synthesized"
68
- ]
69
- }
70
- ```