@gobing-ai/knowledge-kit 0.1.29 → 0.1.30

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 (114) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/board/api.js +8724 -3861
  3. package/dist/board/collect/index.js +69 -1
  4. package/dist/board/daily-voice/index.js +474 -265
  5. package/dist/board/itc/index.js +69 -1
  6. package/dist/board/wiki/index.css +1305 -0
  7. package/dist/board/wiki/index.js +1621 -0
  8. package/dist/index.js +34689 -28532
  9. package/package.json +1 -1
  10. package/plugins/generations/content-gen/dist/index.js +14 -1
  11. package/plugins/generations/core-facts-gen/dist/index.js +14 -1
  12. package/plugins/generations/daily-article-gen/dist/index.js +14 -1
  13. package/plugins/generations/dailynews-gen/dist/index.js +14 -1
  14. package/plugins/generations/episode-plan-gen/dist/index.js +32 -2
  15. package/plugins/generations/episode-plan-gen/src/index.ts +19 -1
  16. package/plugins/generations/gemini-tts/dist/index.js +14 -1
  17. package/plugins/generations/image-gen/dist/index.js +14 -1
  18. package/plugins/generations/music-gen/dist/index.js +15 -2
  19. package/plugins/generations/news-report-gen/dist/index.js +14 -1
  20. package/plugins/generations/vibe-voice-tts/dist/index.js +14 -1
  21. package/plugins/generations/video-gen/README.md +245 -8
  22. package/plugins/generations/video-gen/dist/index.js +22447 -4763
  23. package/plugins/generations/video-gen/package.json +1 -0
  24. package/plugins/generations/video-gen/presets/formats/avatar.yaml +5 -0
  25. package/plugins/generations/video-gen/presets/formats/editorial.yaml +6 -0
  26. package/plugins/generations/video-gen/presets/formats/hybrid-pip.yaml +5 -0
  27. package/plugins/generations/video-gen/presets/styles/daily-ai.yaml +5 -0
  28. package/plugins/generations/video-gen/presets/styles/neutral.yaml +3 -0
  29. package/plugins/generations/video-gen/python/colab_comfyui_h3.py +322 -0
  30. package/plugins/generations/video-gen/python/comfyui-h3-i2v-api.json +47 -0
  31. package/plugins/generations/video-gen/python/comfyui-h3-models.json +32 -0
  32. package/plugins/generations/video-gen/python/comfyui_model_cache.py +388 -0
  33. package/plugins/generations/video-gen/python/drive_client.py +187 -0
  34. package/plugins/generations/video-gen/src/brief-cli.ts +65 -0
  35. package/plugins/generations/video-gen/src/brief.ts +464 -0
  36. package/plugins/generations/video-gen/src/ccu-ledger.ts +206 -3
  37. package/plugins/generations/video-gen/src/colab-runner.ts +346 -35
  38. package/plugins/generations/video-gen/src/index.ts +141 -109
  39. package/plugins/generations/video-gen/src/inputs.ts +162 -4
  40. package/plugins/generations/video-gen/src/layout.ts +33 -0
  41. package/plugins/generations/video-gen/src/props.ts +27 -3
  42. package/plugins/generations/video-gen/src/remotion/AvatarReel.tsx +17 -1
  43. package/plugins/generations/video-gen/src/remotion/EditorialReel.tsx +17 -1
  44. package/plugins/generations/video-gen/src/remotion/Root.tsx +2 -0
  45. package/plugins/generations/video-gen/src/remotion/engine.ts +3 -7
  46. package/plugins/generations/video-gen/src/render.ts +25 -0
  47. package/plugins/generations/video-gen/src/request.ts +150 -20
  48. package/plugins/generations/video-gen/src/visual-provider.ts +116 -3
  49. package/plugins/generations/voice-gen/dist/index.js +14 -1
  50. package/plugins/generations/voxcpm-tts/dist/index.js +14 -1
  51. package/plugins/ingestions/aihot-ingest/dist/index.js +14 -1
  52. package/plugins/ingestions/horizon-ingest/dist/index.js +14 -1
  53. package/plugins/ingestions/last30days-ingest/dist/index.js +14 -1
  54. package/plugins/ingestions/web-search/dist/index.js +14 -1
  55. package/plugins/kk/config.example.yaml +1 -1
  56. package/plugins/kk/mcp-tools.yaml +47 -0
  57. package/plugins/kk/plugin.json +1 -1
  58. package/plugins/kk/publish-presets/itc-surfdash-locales.json +42 -0
  59. package/plugins/kk/scripts/daily-stages.ts +87 -6
  60. package/plugins/kk/scripts/kk-workflow-stages.ts +64 -9
  61. package/plugins/kk/scripts/video-stages.ts +332 -0
  62. package/plugins/kk/scripts/wiki-normalize-audio.ts +354 -0
  63. package/plugins/kk/scripts/wiki-normalize-document.ts +495 -0
  64. package/plugins/kk/scripts/wiki-normalize-stages.ts +96 -0
  65. package/plugins/kk/scripts/wiki-stage-runtime.ts +39 -0
  66. package/plugins/kk/skills/news-editorial/SKILL.md +2 -1
  67. package/plugins/kk/workflows/kk-collect.yaml +10 -0
  68. package/plugins/kk/workflows/kk-news-generate.yaml +70 -8
  69. package/plugins/kk/workflows/kk-smart-seo.yaml +8 -0
  70. package/plugins/kk/workflows/kk-storm-research.yaml +10 -0
  71. package/plugins/kk/workflows/kk-video-generate.yaml +169 -0
  72. package/plugins/kk/workflows/kk-wiki-digest.yaml +49 -0
  73. package/plugins/publishings/bilibili-pub/dist/index.js +281 -268
  74. package/plugins/publishings/bilibili-pub/dist/profile-check.js +202 -0
  75. package/plugins/publishings/cnblogs-pub/dist/index.js +281 -268
  76. package/plugins/publishings/cnblogs-pub/dist/profile-check.js +202 -0
  77. package/plugins/publishings/csdn-pub/dist/index.js +281 -268
  78. package/plugins/publishings/csdn-pub/dist/profile-check.js +216 -1
  79. package/plugins/publishings/emdash-pub/dist/index.js +33 -3
  80. package/plugins/publishings/infoq-pub/dist/index.js +281 -268
  81. package/plugins/publishings/infoq-pub/dist/profile-check.js +216 -1
  82. package/plugins/publishings/jike-pub/dist/index.js +281 -268
  83. package/plugins/publishings/jike-pub/dist/profile-check.js +216 -1
  84. package/plugins/publishings/juejin-pub/dist/index.js +281 -268
  85. package/plugins/publishings/juejin-pub/dist/profile-check.js +216 -1
  86. package/plugins/publishings/linkedin-pub/dist/index.js +281 -268
  87. package/plugins/publishings/linkedin-pub/dist/profile-check.js +216 -1
  88. package/plugins/publishings/medium-pub/dist/index.js +281 -268
  89. package/plugins/publishings/medium-pub/dist/profile-check.js +216 -1
  90. package/plugins/publishings/podcast-pub/dist/index.js +39 -9
  91. package/plugins/publishings/qiita-pub/dist/index.js +33 -3
  92. package/plugins/publishings/shipinhao-pub/dist/index.js +281 -268
  93. package/plugins/publishings/shipinhao-pub/dist/profile-check.js +175 -0
  94. package/plugins/publishings/sspai-pub/dist/index.js +281 -268
  95. package/plugins/publishings/sspai-pub/dist/profile-check.js +202 -0
  96. package/plugins/publishings/substack-pub/dist/index.js +281 -268
  97. package/plugins/publishings/substack-pub/dist/profile-check.js +216 -1
  98. package/plugins/publishings/surfdash-pub/dist/index.js +99 -39
  99. package/plugins/publishings/surfdash-pub/plugin.json +54 -0
  100. package/plugins/publishings/surfdash-pub/src/index.ts +36 -5
  101. package/plugins/publishings/threads-pub/dist/index.js +281 -268
  102. package/plugins/publishings/threads-pub/dist/profile-check.js +216 -1
  103. package/plugins/publishings/wechatmp-pub/dist/index.js +665 -451
  104. package/plugins/publishings/wechatmp-pub/dist/profile-check.js +215 -3
  105. package/plugins/publishings/weibo-pub/dist/index.js +281 -268
  106. package/plugins/publishings/weibo-pub/dist/profile-check.js +189 -1
  107. package/plugins/publishings/x-pub/dist/index.js +281 -268
  108. package/plugins/publishings/x-pub/dist/profile-check.js +216 -1
  109. package/plugins/publishings/xhs-pub/dist/index.js +281 -268
  110. package/plugins/publishings/xhs-pub/dist/profile-check.js +119 -1
  111. package/plugins/publishings/xiaoyuzhou-pub/dist/index.js +281 -268
  112. package/plugins/publishings/xiaoyuzhou-pub/dist/profile-check.js +202 -0
  113. package/plugins/publishings/youtube-pub/dist/index.js +14 -1
  114. package/plugins/publishings/zenn-pub/dist/index.js +37 -7
@@ -20954,6 +20954,9 @@ function rename(from, to) {
20954
20954
  function chmod(path, mode) {
20955
20955
  chmodSync(path, mode);
20956
20956
  }
20957
+ function createExclusiveFile(path) {
20958
+ closeSync(openSync(path, "wx", 384));
20959
+ }
20957
20960
 
20958
20961
  // ../../packages/publish-harness/src/bot-transaction.ts
20959
20962
  import { homedir } from "os";
@@ -21284,6 +21287,12 @@ function parseBotMetadata(raw, source = "bot metadata") {
21284
21287
  }
21285
21288
  metadata.lastLoginAt = record.lastLoginAt;
21286
21289
  }
21290
+ if (record.lastRefreshedAt !== undefined) {
21291
+ if (!isSessionFactDate(record.lastRefreshedAt)) {
21292
+ throw new BotError("persistence", `${source}: lastRefreshedAt must be an ISO 8601 date-time`);
21293
+ }
21294
+ metadata.lastRefreshedAt = record.lastRefreshedAt;
21295
+ }
21287
21296
  if (record.expiresAt !== undefined) {
21288
21297
  if (!isSessionFactDate(record.expiresAt)) {
21289
21298
  throw new BotError("persistence", `${source}: expiresAt must be an ISO 8601 date-time`);
@@ -21316,6 +21325,31 @@ async function readBotMetadata(fileSystem, metadataPath) {
21316
21325
  }
21317
21326
  return parseBotMetadata(raw, metadataPath);
21318
21327
  }
21328
+
21329
+ // ../../packages/publish-harness/src/session-state.ts
21330
+ import { randomUUID } from "crypto";
21331
+ function channelStorageStatePath(profileDir) {
21332
+ return `${profileDir}/storage-state.json`;
21333
+ }
21334
+ async function persistChannelSessionState(context, profileDir) {
21335
+ const target = channelStorageStatePath(profileDir);
21336
+ const temporary = `${target}.${process.pid}.${randomUUID()}.tmp`;
21337
+ const fs = createNodeFileSystem();
21338
+ let reserved = false;
21339
+ try {
21340
+ createExclusiveFile(temporary);
21341
+ reserved = true;
21342
+ await context.storageState({ path: temporary });
21343
+ chmod(temporary, 384);
21344
+ await fs.rename(temporary, target);
21345
+ } finally {
21346
+ if (reserved) {
21347
+ await Promise.resolve().then(() => fs.deleteFile(temporary)).catch(() => {
21348
+ return;
21349
+ });
21350
+ }
21351
+ }
21352
+ }
21319
21353
  // ../../packages/publish-harness/src/index.ts
21320
21354
  import { homedir as homedir4 } from "os";
21321
21355
  import { join as join4, resolve as resolve4 } from "path";
@@ -21375,6 +21409,7 @@ var VERDICT_PRINT_MARGIN_MS = 2000;
21375
21409
  var MIN_PASS_BUDGET_MS = 5000;
21376
21410
  var PASS_LAUNCH_RESERVE_MS = 20000;
21377
21411
  var DEFAULT_POLL_MS = 500;
21412
+ var OPEN_SESSION_SAVE_DEBOUNCE_MS = 1500;
21378
21413
  function isInstantBrowserDeath(message) {
21379
21414
  return /target page, context or browser has been closed|browser has been closed|target closed/i.test(message);
21380
21415
  }
@@ -21562,9 +21597,17 @@ async function openChannelSession(config, request, deps = {}, stdout = echo) {
21562
21597
  } catch (error) {
21563
21598
  stdout(`${config.channel} profile open navigation failed: ${errorMessage2(error)}`);
21564
21599
  }
21600
+ const capture = createOpenSessionCapture({
21601
+ context,
21602
+ profileDir: request.profileDir,
21603
+ fileSystem: createNodeFileSystem(),
21604
+ persistStorageState: true
21605
+ });
21606
+ capture.attach(page);
21565
21607
  await new Promise((resolveClose) => {
21566
21608
  context.once("close", () => resolveClose());
21567
21609
  });
21610
+ await capture.flush();
21568
21611
  stdout(`${config.channel} profile open closed: ${request.profileDir}`);
21569
21612
  return 0;
21570
21613
  }
@@ -21770,6 +21813,68 @@ async function readIdentityOrUndefined(readIdentity, page) {
21770
21813
  return;
21771
21814
  }
21772
21815
  }
21816
+ function createOpenSessionCapture(options) {
21817
+ const metadataPath = join5(options.profileDir, BOT_METADATA_FILE);
21818
+ let closing = false;
21819
+ let timer;
21820
+ let chain = Promise.resolve();
21821
+ options.context.once("close", () => {
21822
+ closing = true;
21823
+ });
21824
+ const snapshot = async () => {
21825
+ if (closing)
21826
+ return;
21827
+ try {
21828
+ if (options.persistStorageState) {
21829
+ await persistChannelSessionState(options.context, options.profileDir);
21830
+ }
21831
+ if (lstat(metadataPath) === null)
21832
+ return;
21833
+ const metadata = await readBotMetadata(options.fileSystem, metadataPath);
21834
+ if (metadata === null)
21835
+ return;
21836
+ const facts = await captureSessionFacts(options.context, metadata.defaultUrl);
21837
+ await writeBotMetadata(options.fileSystem, metadataPath, {
21838
+ ...metadata,
21839
+ lastRefreshedAt: new Date().toISOString(),
21840
+ ...facts.expiresAt === undefined ? {} : { expiresAt: facts.expiresAt }
21841
+ });
21842
+ } catch {}
21843
+ };
21844
+ const schedule = () => {
21845
+ if (closing)
21846
+ return;
21847
+ if (timer !== undefined)
21848
+ clearTimeout(timer);
21849
+ timer = setTimeout(() => {
21850
+ timer = undefined;
21851
+ chain = chain.then(snapshot);
21852
+ }, OPEN_SESSION_SAVE_DEBOUNCE_MS);
21853
+ timer.unref?.();
21854
+ };
21855
+ const attachPage = (target) => {
21856
+ target.on?.("load", schedule);
21857
+ };
21858
+ return {
21859
+ attach: (page) => {
21860
+ attachPage(page);
21861
+ options.context.on?.("page", attachPage);
21862
+ },
21863
+ flush: async () => {
21864
+ if (timer !== undefined) {
21865
+ clearTimeout(timer);
21866
+ timer = undefined;
21867
+ }
21868
+ closing = true;
21869
+ await chain;
21870
+ }
21871
+ };
21872
+ }
21873
+ async function writeBotMetadata(fileSystem, path, metadata) {
21874
+ await fileSystem.writeFile(path, `${JSON.stringify(metadata, null, 2)}
21875
+ `);
21876
+ chmod(path, 384);
21877
+ }
21773
21878
  function errorMessage2(error) {
21774
21879
  return error instanceof Error ? error.message : String(error);
21775
21880
  }
@@ -26547,7 +26652,19 @@ var omniVoiceGenContentSchema = ContentSchema.extend({
26547
26652
  })
26548
26653
  });
26549
26654
  var VideoVisualModeSchema = _enum2(["editorial", "avatar", "hybrid-pip"]);
26550
- var VideoRenderProviderSchema = _enum2(["local-ken-burns", "wan21-i2v", "musetalk", "echomimic-v2"]);
26655
+ var VideoRenderProviderSchema = _enum2([
26656
+ "local-ken-burns",
26657
+ "wan21-i2v",
26658
+ "comfyui-minimax-h3",
26659
+ "musetalk",
26660
+ "echomimic-v2"
26661
+ ]);
26662
+ var RenderProvenanceSchema = object3({
26663
+ cache: _enum2(["drive", "local"]),
26664
+ comfyuiCommit: string4().min(1).optional(),
26665
+ comfyuiRuntimeCommit: string4().min(1).nullable().optional(),
26666
+ modelCache: object3({ verified: boolean4(), restored: number4().int().nonnegative() }).optional()
26667
+ });
26551
26668
  var videoGenContentSchema = ContentSchema.extend({
26552
26669
  format: literal("video"),
26553
26670
  metadata: looseObject({
@@ -26560,6 +26677,7 @@ var videoGenContentSchema = ContentSchema.extend({
26560
26677
  durationSec: number4().positive(),
26561
26678
  visualMode: VideoVisualModeSchema,
26562
26679
  renderProvider: VideoRenderProviderSchema,
26680
+ renderProvenance: RenderProvenanceSchema.optional(),
26563
26681
  fallbackUsed: boolean4().optional(),
26564
26682
  warnings: array2(string4()).optional(),
26565
26683
  ccuEstimated: number4().nonnegative().optional(),