@gobing-ai/knowledge-kit 0.0.37 → 0.1.0

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 (157) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/board/collect/index.css +654 -16
  3. package/dist/board/collect/index.js +191 -64
  4. package/dist/board/daily-voice/index.css +679 -12
  5. package/dist/board/daily-voice/index.js +185 -66
  6. package/dist/board/itc/index.css +679 -13
  7. package/dist/board/itc/index.js +188 -66
  8. package/dist/index.js +2864 -139
  9. package/package.json +3 -2
  10. package/plugins/generations/content-gen/dist/index.js +158 -12
  11. package/plugins/generations/core-facts-gen/dist/index.js +158 -12
  12. package/plugins/generations/daily-article-gen/dist/index.js +158 -12
  13. package/plugins/generations/dailynews-gen/dist/index.js +158 -12
  14. package/plugins/generations/episode-plan-gen/dist/index.js +158 -12
  15. package/plugins/generations/gemini-tts/README.md +4 -3
  16. package/plugins/generations/gemini-tts/dist/index.js +158 -12
  17. package/plugins/generations/image-gen/dist/index.js +158 -12
  18. package/plugins/generations/news-report-gen/dist/index.js +158 -12
  19. package/plugins/generations/omni-voice-gen/README.md +15 -4
  20. package/plugins/generations/omni-voice-gen/profiles.json +1 -2
  21. package/plugins/generations/voice-gen/dist/index.js +158 -12
  22. package/plugins/generations/voxcpm-tts/README.md +21 -1
  23. package/plugins/generations/voxcpm-tts/dist/index.js +173 -13
  24. package/plugins/generations/voxcpm-tts/scripts/audit-speaker-consistency.py +109 -0
  25. package/plugins/generations/voxcpm-tts/src/voxcpm-client.ts +28 -1
  26. package/plugins/ingestions/aihot-ingest/dist/index.js +158 -12
  27. package/plugins/ingestions/horizon-ingest/dist/index.js +158 -12
  28. package/plugins/ingestions/last30days-ingest/dist/index.js +158 -12
  29. package/plugins/ingestions/web-search/dist/index.js +158 -12
  30. package/plugins/kk/commands/workflow-run.md +56 -18
  31. package/plugins/kk/decisions/kk-itc.yaml +46 -0
  32. package/plugins/kk/decisions/kk-seo-keyword.yaml +57 -0
  33. package/plugins/kk/decisions/kk-seo-page.yaml +230 -0
  34. package/plugins/kk/decisions/kk-seo-pair.yaml +21 -0
  35. package/plugins/kk/decisions/kk-seo-site.yaml +90 -0
  36. package/plugins/kk/plugin.json +1 -1
  37. package/plugins/kk/publish-presets/chinese-article.json +14 -0
  38. package/plugins/kk/publish-presets/technical-article.json +14 -0
  39. package/plugins/kk/references/smart-seo-attribution.md +85 -0
  40. package/plugins/kk/scripts/daily-stages.ts +42 -2
  41. package/plugins/kk/scripts/itc-stages.ts +25 -118
  42. package/plugins/kk/scripts/kk-workflow-stages.ts +38 -1
  43. package/plugins/kk/scripts/seo-decisions.ts +477 -0
  44. package/plugins/kk/scripts/seo-enrich.ts +728 -0
  45. package/plugins/kk/scripts/seo-facts.ts +610 -0
  46. package/plugins/kk/scripts/seo-fetch.ts +766 -0
  47. package/plugins/kk/scripts/seo-report.ts +460 -0
  48. package/plugins/kk/scripts/seo-rules.ts +1882 -0
  49. package/plugins/kk/scripts/seo-stages.ts +1044 -0
  50. package/plugins/kk/skills/article-adapt/SKILL.md +2 -2
  51. package/plugins/kk/skills/smart-seo/SKILL.md +183 -0
  52. package/plugins/kk/skills/smart-seo/references/method.md +126 -0
  53. package/plugins/kk/skills/smart-seo/references/narrative.md +125 -0
  54. package/plugins/kk/skills/smart-seo/references/operations.md +202 -0
  55. package/plugins/kk/skills/smart-seo/references/seo-geo-sources.md +90 -0
  56. package/plugins/kk/workflows/feature-verification.yaml +28 -24
  57. package/plugins/kk/workflows/kk-daily-ai-voice2.yaml +85 -17
  58. package/plugins/kk/workflows/kk-itc-author.yaml +406 -0
  59. package/plugins/kk/workflows/kk-itc.yaml +208 -682
  60. package/plugins/kk/workflows/kk-smart-seo.yaml +251 -0
  61. package/plugins/publishings/bilibili-pub/dist/index.js +21782 -0
  62. package/plugins/publishings/bilibili-pub/dist/profile-check.js +20410 -0
  63. package/plugins/publishings/bilibili-pub/package.json +20 -0
  64. package/plugins/publishings/bilibili-pub/plugin.json +12 -0
  65. package/plugins/publishings/bilibili-pub/src/flow.ts +1296 -0
  66. package/plugins/publishings/bilibili-pub/src/index.ts +139 -0
  67. package/plugins/publishings/bilibili-pub/src/profile-check.ts +19 -0
  68. package/plugins/publishings/bilibili-pub/src/selectors.ts +222 -0
  69. package/plugins/publishings/bilibili-pub/tsconfig.json +4 -0
  70. package/plugins/publishings/cnblogs-pub/dist/index.js +21383 -0
  71. package/plugins/publishings/cnblogs-pub/dist/profile-check.js +20412 -0
  72. package/plugins/publishings/cnblogs-pub/package.json +19 -0
  73. package/plugins/publishings/cnblogs-pub/plugin.json +12 -0
  74. package/plugins/publishings/cnblogs-pub/src/flow.ts +708 -0
  75. package/plugins/publishings/cnblogs-pub/src/index.ts +172 -0
  76. package/plugins/publishings/cnblogs-pub/src/profile-check.ts +24 -0
  77. package/plugins/publishings/cnblogs-pub/src/selectors.ts +104 -0
  78. package/plugins/publishings/cnblogs-pub/tsconfig.json +4 -0
  79. package/plugins/publishings/csdn-pub/dist/index.js +21552 -0
  80. package/plugins/publishings/csdn-pub/dist/profile-check.js +20963 -0
  81. package/plugins/publishings/csdn-pub/package.json +19 -0
  82. package/plugins/publishings/csdn-pub/plugin.json +12 -0
  83. package/plugins/publishings/csdn-pub/src/index.ts +1178 -0
  84. package/plugins/publishings/csdn-pub/src/profile-check.ts +23 -0
  85. package/plugins/publishings/csdn-pub/tsconfig.json +4 -0
  86. package/plugins/publishings/emdash-pub/dist/index.js +158 -12
  87. package/plugins/publishings/emdash-pub/plugin.json +22 -1
  88. package/plugins/publishings/infoq-pub/dist/index.js +160 -12
  89. package/plugins/publishings/infoq-pub/dist/profile-check.js +160 -12
  90. package/plugins/publishings/infoq-pub/plugin.json +21 -0
  91. package/plugins/publishings/jike-pub/dist/index.js +21379 -0
  92. package/plugins/publishings/jike-pub/dist/profile-check.js +20951 -0
  93. package/plugins/publishings/jike-pub/package.json +19 -0
  94. package/plugins/publishings/jike-pub/plugin.json +12 -0
  95. package/plugins/publishings/jike-pub/src/index.ts +800 -0
  96. package/plugins/publishings/jike-pub/src/profile-check.ts +21 -0
  97. package/plugins/publishings/jike-pub/tsconfig.json +4 -0
  98. package/plugins/publishings/juejin-pub/dist/index.js +160 -12
  99. package/plugins/publishings/juejin-pub/dist/profile-check.js +160 -12
  100. package/plugins/publishings/juejin-pub/plugin.json +21 -0
  101. package/plugins/publishings/medium-pub/dist/index.js +158 -12
  102. package/plugins/publishings/medium-pub/plugin.json +22 -1
  103. package/plugins/publishings/podcast-pub/dist/index.js +158 -12
  104. package/plugins/publishings/qiita-pub/dist/index.js +158 -12
  105. package/plugins/publishings/qiita-pub/plugin.json +24 -1
  106. package/plugins/publishings/shipinhao-pub/dist/index.js +21715 -0
  107. package/plugins/publishings/shipinhao-pub/dist/profile-check.js +20431 -0
  108. package/plugins/publishings/shipinhao-pub/package.json +19 -0
  109. package/plugins/publishings/shipinhao-pub/plugin.json +12 -0
  110. package/plugins/publishings/shipinhao-pub/src/flow.ts +1323 -0
  111. package/plugins/publishings/shipinhao-pub/src/index.ts +173 -0
  112. package/plugins/publishings/shipinhao-pub/src/profile-check.ts +25 -0
  113. package/plugins/publishings/shipinhao-pub/src/selectors.ts +241 -0
  114. package/plugins/publishings/shipinhao-pub/tsconfig.json +4 -0
  115. package/plugins/publishings/sspai-pub/dist/index.js +21371 -0
  116. package/plugins/publishings/sspai-pub/dist/profile-check.js +20414 -0
  117. package/plugins/publishings/sspai-pub/package.json +19 -0
  118. package/plugins/publishings/sspai-pub/plugin.json +12 -0
  119. package/plugins/publishings/sspai-pub/src/flow.ts +624 -0
  120. package/plugins/publishings/sspai-pub/src/index.ts +167 -0
  121. package/plugins/publishings/sspai-pub/src/profile-check.ts +25 -0
  122. package/plugins/publishings/sspai-pub/src/selectors.ts +122 -0
  123. package/plugins/publishings/sspai-pub/tsconfig.json +4 -0
  124. package/plugins/publishings/substack-pub/dist/index.js +160 -12
  125. package/plugins/publishings/substack-pub/dist/profile-check.js +160 -12
  126. package/plugins/publishings/substack-pub/plugin.json +21 -0
  127. package/plugins/publishings/surfdash-pub/dist/index.js +158 -12
  128. package/plugins/publishings/surfdash-pub/plugin.json +22 -1
  129. package/plugins/publishings/threads-pub/dist/index.js +158 -12
  130. package/plugins/publishings/wechatmp-pub/dist/index.js +1669 -502
  131. package/plugins/publishings/wechatmp-pub/dist/profile-check.js +204 -21
  132. package/plugins/publishings/wechatmp-pub/plugin.json +32 -0
  133. package/plugins/publishings/wechatmp-pub/src/cgi-draft.ts +540 -0
  134. package/plugins/publishings/wechatmp-pub/src/cgi-media.ts +380 -0
  135. package/plugins/publishings/wechatmp-pub/src/cgi.ts +485 -0
  136. package/plugins/publishings/wechatmp-pub/src/flow.ts +104 -0
  137. package/plugins/publishings/weibo-pub/dist/index.js +160 -12
  138. package/plugins/publishings/weibo-pub/dist/profile-check.js +160 -12
  139. package/plugins/publishings/weibo-pub/plugin.json +35 -0
  140. package/plugins/publishings/x-pub/dist/index.js +160 -12
  141. package/plugins/publishings/x-pub/dist/profile-check.js +160 -12
  142. package/plugins/publishings/x-pub/plugin.json +40 -0
  143. package/plugins/publishings/xhs-pub/dist/index.js +160 -12
  144. package/plugins/publishings/xhs-pub/dist/profile-check.js +160 -12
  145. package/plugins/publishings/xhs-pub/plugin.json +37 -0
  146. package/plugins/publishings/xiaoyuzhou-pub/dist/index.js +21491 -0
  147. package/plugins/publishings/xiaoyuzhou-pub/dist/profile-check.js +20417 -0
  148. package/plugins/publishings/xiaoyuzhou-pub/package.json +19 -0
  149. package/plugins/publishings/xiaoyuzhou-pub/plugin.json +12 -0
  150. package/plugins/publishings/xiaoyuzhou-pub/src/flow.ts +826 -0
  151. package/plugins/publishings/xiaoyuzhou-pub/src/index.ts +174 -0
  152. package/plugins/publishings/xiaoyuzhou-pub/src/profile-check.ts +26 -0
  153. package/plugins/publishings/xiaoyuzhou-pub/src/selectors.ts +125 -0
  154. package/plugins/publishings/xiaoyuzhou-pub/tsconfig.json +4 -0
  155. package/plugins/publishings/zenn-pub/dist/index.js +158 -12
  156. package/plugins/publishings/zenn-pub/plugin.json +22 -1
  157. package/plugins/generations/omni-voice-gen/voices/robin-news.wav +0 -0
@@ -20415,6 +20415,8 @@ async function ensureProfileDir2(profileDir, headless) {
20415
20415
  throw new BrowserProfileMissingError(profileDir);
20416
20416
  await mkdir2(profileDir, { recursive: true, mode: 448 });
20417
20417
  }
20418
+ // ../../packages/publish-harness/src/browser-anti-detection.ts
20419
+ var MAX_QUEUED_BYTES = 8 * 1024 * 1024;
20418
20420
 
20419
20421
  // ../../packages/publish-harness/src/browser.ts
20420
20422
  var DEFAULT_LOGIN_TIMEOUT_MS = 180000;
@@ -20650,6 +20652,83 @@ function errorMessage2(error) {
20650
20652
  return error instanceof Error ? error.message : String(error);
20651
20653
  }
20652
20654
 
20655
+ // ../../packages/kk-core/src/content-limits.ts
20656
+ var PLATFORM_CONTENT_LIMITS = Object.freeze({
20657
+ schemaVersion: 5,
20658
+ tagLimits: Object.freeze({
20659
+ default: 7,
20660
+ imageText: Object.freeze({
20661
+ instagram: 5,
20662
+ douyin: 5,
20663
+ kuaishou: 4,
20664
+ weixin: 1,
20665
+ xiaohongshu: 10
20666
+ }),
20667
+ shortVideo: Object.freeze({
20668
+ douyin: 5,
20669
+ kuaishou: 4,
20670
+ xiaohongshu: 10,
20671
+ bilibili: 10,
20672
+ zhihu: 5,
20673
+ tiktok: 20,
20674
+ youtube: 60
20675
+ })
20676
+ }),
20677
+ titleCapabilities: Object.freeze({
20678
+ dynamic: Object.freeze({
20679
+ bilibili: Object.freeze({ max: 20, unit: "utf16_code_units" }),
20680
+ zhihu: Object.freeze({ max: 50, unit: "utf16_code_units" }),
20681
+ douban: Object.freeze({ max: 70, unit: "utf16_code_units" }),
20682
+ x: null,
20683
+ threads: null,
20684
+ weibo: null,
20685
+ jike: null,
20686
+ zsxq: null,
20687
+ toutiao: null,
20688
+ juejin: null
20689
+ }),
20690
+ imageText: Object.freeze({
20691
+ xiaohongshu: Object.freeze({ max: 20, unit: "xiaohongshu_title_weighted" }),
20692
+ weixin: Object.freeze({ max: 20, unit: "utf16_code_units" }),
20693
+ douyin: Object.freeze({ max: 20, unit: "utf16_code_units" }),
20694
+ shipinhao: Object.freeze({ max: 22, unit: "utf16_code_units" }),
20695
+ reddit: Object.freeze({ max: 300, unit: "utf16_code_units" })
20696
+ }),
20697
+ article: Object.freeze({
20698
+ juejin: Object.freeze({ max: 100, unit: "utf16_code_units" }),
20699
+ csdn: Object.freeze({ max: 100, unit: "utf16_code_units" }),
20700
+ cnblogs: Object.freeze({ max: 128, unit: "utf16_code_units" }),
20701
+ weibo: Object.freeze({ max: 30, unit: "utf16_code_units" }),
20702
+ sspai: Object.freeze({ max: 80, unit: "utf16_code_units" })
20703
+ }),
20704
+ shortVideo: Object.freeze({
20705
+ shipinhao: Object.freeze({ max: 16, unit: "utf16_code_units" }),
20706
+ douyin: Object.freeze({ max: 30, unit: "utf16_code_units" }),
20707
+ bilibili: Object.freeze({ max: 80, unit: "utf16_code_units" })
20708
+ })
20709
+ }),
20710
+ bodyCapabilities: Object.freeze({
20711
+ dynamic: Object.freeze({
20712
+ threads: Object.freeze({ max: 500, unit: "unicode_code_points", behavior: "split_thread" }),
20713
+ x: Object.freeze({ max: 280, unit: "weighted", behavior: "split_thread" }),
20714
+ weibo: Object.freeze({ max: 2000, unit: "unicode_code_points" }),
20715
+ jike: Object.freeze({ max: 1000, unit: "unicode_code_points" })
20716
+ }),
20717
+ imageText: Object.freeze({
20718
+ xiaohongshu: Object.freeze({ max: 1000, unit: "unicode_code_points" }),
20719
+ douyin: Object.freeze({ max: 1000, unit: "unicode_code_points" })
20720
+ }),
20721
+ article: Object.freeze({
20722
+ wechatmp: Object.freeze({ max: 50000, unit: "unicode_code_points" }),
20723
+ juejin: Object.freeze({ max: 50000, unit: "unicode_code_points" })
20724
+ }),
20725
+ shortVideo: Object.freeze({
20726
+ douyin: Object.freeze({ max: 1000, unit: "unicode_code_points" }),
20727
+ kuaishou: Object.freeze({ max: 1000, unit: "unicode_code_points" }),
20728
+ shipinhao: Object.freeze({ max: 1000, unit: "unicode_code_points" })
20729
+ })
20730
+ })
20731
+ });
20653
20732
  // ../../packages/kk-core/src/kinds.ts
20654
20733
  init_zod();
20655
20734
 
@@ -20740,6 +20819,67 @@ var BrowserSessionDescriptorSchema = object2({
20740
20819
  }
20741
20820
  }).optional()
20742
20821
  }).strict();
20822
+ var ContentCountUnitSchema = _enum([
20823
+ "utf16_code_units",
20824
+ "unicode_code_points",
20825
+ "weighted",
20826
+ "xiaohongshu_title_weighted"
20827
+ ]);
20828
+ var LimitEntrySchema = object2({
20829
+ max: number2().int().positive(),
20830
+ unit: ContentCountUnitSchema
20831
+ }).strict();
20832
+ var PublishingProfileLimitsSchema = object2({
20833
+ title: LimitEntrySchema.optional(),
20834
+ body: LimitEntrySchema.optional()
20835
+ }).strict();
20836
+ var PublishingProfileRequiresSchema = object2({
20837
+ cover: boolean2().optional(),
20838
+ orderedImages: boolean2().optional()
20839
+ }).strict();
20840
+ var PublishingProfileModeBindingSchema = object2({
20841
+ metadata: record(string2(), unknown())
20842
+ }).strict();
20843
+ var PublishingProfileModesSchema = object2({
20844
+ draft: PublishingProfileModeBindingSchema.optional(),
20845
+ live: PublishingProfileModeBindingSchema.optional()
20846
+ }).strict().superRefine((modes, ctx) => {
20847
+ if (modes.draft === undefined && modes.live === undefined) {
20848
+ ctx.addIssue({
20849
+ code: "custom",
20850
+ message: 'modes must define at least one of "draft" or "live"'
20851
+ });
20852
+ }
20853
+ });
20854
+ var PublishingProfileSchema = object2({
20855
+ format: string2().min(1),
20856
+ locale: string2().regex(/^(source|[a-z]{2,3}(-[A-Za-z0-9]+)*)$/, {
20857
+ message: 'locale must be "source" or a valid language tag'
20858
+ }),
20859
+ limits: PublishingProfileLimitsSchema.optional(),
20860
+ requires: PublishingProfileRequiresSchema.optional(),
20861
+ modes: PublishingProfileModesSchema
20862
+ }).strict();
20863
+ var PublishingCapabilitiesSchema = object2({
20864
+ defaultProfile: string2().min(1),
20865
+ profiles: record(string2().regex(/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/), PublishingProfileSchema)
20866
+ }).strict().superRefine((data, ctx) => {
20867
+ const keys = Object.keys(data.profiles);
20868
+ if (keys.length === 0) {
20869
+ ctx.addIssue({
20870
+ code: "custom",
20871
+ path: ["profiles"],
20872
+ message: "profiles record must be nonempty"
20873
+ });
20874
+ }
20875
+ if (!(data.defaultProfile in data.profiles)) {
20876
+ ctx.addIssue({
20877
+ code: "custom",
20878
+ path: ["defaultProfile"],
20879
+ message: `defaultProfile "${data.defaultProfile}" must reference a declared profile`
20880
+ });
20881
+ }
20882
+ });
20743
20883
  var PluginManifestSchemaBase = looseObject({
20744
20884
  name: string2().min(1),
20745
20885
  kind: PluginKindSchema,
@@ -20748,23 +20888,31 @@ var PluginManifestSchemaBase = looseObject({
20748
20888
  version: string2().optional(),
20749
20889
  description: string2().optional(),
20750
20890
  operations: record(string2(), PluginOperationSchema).optional(),
20751
- browserSession: BrowserSessionDescriptorSchema.optional()
20891
+ browserSession: BrowserSessionDescriptorSchema.optional(),
20892
+ publishing: PublishingCapabilitiesSchema.optional()
20752
20893
  });
20753
20894
  var PluginManifestSchema = PluginManifestSchemaBase.superRefine((manifest, ctx) => {
20754
- if (manifest.browserSession === undefined)
20755
- return;
20756
- if (manifest.kind !== "publish") {
20757
- ctx.addIssue({
20758
- code: "custom",
20759
- path: ["browserSession"],
20760
- message: `browserSession requires kind "publish", not "${manifest.kind}"`
20761
- });
20895
+ if (manifest.browserSession !== undefined) {
20896
+ if (manifest.kind !== "publish") {
20897
+ ctx.addIssue({
20898
+ code: "custom",
20899
+ path: ["browserSession"],
20900
+ message: `browserSession requires kind "publish", not "${manifest.kind}"`
20901
+ });
20902
+ }
20903
+ if (manifest.check === undefined) {
20904
+ ctx.addIssue({
20905
+ code: "custom",
20906
+ path: ["browserSession"],
20907
+ message: "browserSession requires a check probe entry that owns the session routines"
20908
+ });
20909
+ }
20762
20910
  }
20763
- if (manifest.check === undefined) {
20911
+ if (manifest.publishing !== undefined && manifest.kind !== "publish") {
20764
20912
  ctx.addIssue({
20765
20913
  code: "custom",
20766
- path: ["browserSession"],
20767
- message: "browserSession requires a check probe entry that owns the session routines"
20914
+ path: ["publishing"],
20915
+ message: `publishing requires kind "publish", not "${manifest.kind}"`
20768
20916
  });
20769
20917
  }
20770
20918
  });
@@ -8,5 +8,45 @@
8
8
  "browserSession": {
9
9
  "profileName": "x",
10
10
  "homeUrl": "https://x.com/compose/articles"
11
+ },
12
+ "publishing": {
13
+ "defaultProfile": "post",
14
+ "profiles": {
15
+ "post": {
16
+ "format": "short-post",
17
+ "locale": "en",
18
+ "limits": {
19
+ "body": {
20
+ "max": 280,
21
+ "unit": "weighted"
22
+ }
23
+ },
24
+ "modes": {
25
+ "live": {
26
+ "metadata": {
27
+ "operation": "post"
28
+ }
29
+ }
30
+ }
31
+ },
32
+ "article": {
33
+ "format": "article",
34
+ "locale": "en",
35
+ "modes": {
36
+ "draft": {
37
+ "metadata": {
38
+ "operation": "article",
39
+ "publishStatus": "draft"
40
+ }
41
+ },
42
+ "live": {
43
+ "metadata": {
44
+ "operation": "article",
45
+ "publishStatus": "public"
46
+ }
47
+ }
48
+ }
49
+ }
50
+ }
11
51
  }
12
52
  }
@@ -19832,6 +19832,83 @@ var init_runtime_node_bun = __esm(() => {
19832
19832
  import { dirname as dirname4 } from "path";
19833
19833
  import { parseArgs } from "util";
19834
19834
 
19835
+ // ../../packages/kk-core/src/content-limits.ts
19836
+ var PLATFORM_CONTENT_LIMITS = Object.freeze({
19837
+ schemaVersion: 5,
19838
+ tagLimits: Object.freeze({
19839
+ default: 7,
19840
+ imageText: Object.freeze({
19841
+ instagram: 5,
19842
+ douyin: 5,
19843
+ kuaishou: 4,
19844
+ weixin: 1,
19845
+ xiaohongshu: 10
19846
+ }),
19847
+ shortVideo: Object.freeze({
19848
+ douyin: 5,
19849
+ kuaishou: 4,
19850
+ xiaohongshu: 10,
19851
+ bilibili: 10,
19852
+ zhihu: 5,
19853
+ tiktok: 20,
19854
+ youtube: 60
19855
+ })
19856
+ }),
19857
+ titleCapabilities: Object.freeze({
19858
+ dynamic: Object.freeze({
19859
+ bilibili: Object.freeze({ max: 20, unit: "utf16_code_units" }),
19860
+ zhihu: Object.freeze({ max: 50, unit: "utf16_code_units" }),
19861
+ douban: Object.freeze({ max: 70, unit: "utf16_code_units" }),
19862
+ x: null,
19863
+ threads: null,
19864
+ weibo: null,
19865
+ jike: null,
19866
+ zsxq: null,
19867
+ toutiao: null,
19868
+ juejin: null
19869
+ }),
19870
+ imageText: Object.freeze({
19871
+ xiaohongshu: Object.freeze({ max: 20, unit: "xiaohongshu_title_weighted" }),
19872
+ weixin: Object.freeze({ max: 20, unit: "utf16_code_units" }),
19873
+ douyin: Object.freeze({ max: 20, unit: "utf16_code_units" }),
19874
+ shipinhao: Object.freeze({ max: 22, unit: "utf16_code_units" }),
19875
+ reddit: Object.freeze({ max: 300, unit: "utf16_code_units" })
19876
+ }),
19877
+ article: Object.freeze({
19878
+ juejin: Object.freeze({ max: 100, unit: "utf16_code_units" }),
19879
+ csdn: Object.freeze({ max: 100, unit: "utf16_code_units" }),
19880
+ cnblogs: Object.freeze({ max: 128, unit: "utf16_code_units" }),
19881
+ weibo: Object.freeze({ max: 30, unit: "utf16_code_units" }),
19882
+ sspai: Object.freeze({ max: 80, unit: "utf16_code_units" })
19883
+ }),
19884
+ shortVideo: Object.freeze({
19885
+ shipinhao: Object.freeze({ max: 16, unit: "utf16_code_units" }),
19886
+ douyin: Object.freeze({ max: 30, unit: "utf16_code_units" }),
19887
+ bilibili: Object.freeze({ max: 80, unit: "utf16_code_units" })
19888
+ })
19889
+ }),
19890
+ bodyCapabilities: Object.freeze({
19891
+ dynamic: Object.freeze({
19892
+ threads: Object.freeze({ max: 500, unit: "unicode_code_points", behavior: "split_thread" }),
19893
+ x: Object.freeze({ max: 280, unit: "weighted", behavior: "split_thread" }),
19894
+ weibo: Object.freeze({ max: 2000, unit: "unicode_code_points" }),
19895
+ jike: Object.freeze({ max: 1000, unit: "unicode_code_points" })
19896
+ }),
19897
+ imageText: Object.freeze({
19898
+ xiaohongshu: Object.freeze({ max: 1000, unit: "unicode_code_points" }),
19899
+ douyin: Object.freeze({ max: 1000, unit: "unicode_code_points" })
19900
+ }),
19901
+ article: Object.freeze({
19902
+ wechatmp: Object.freeze({ max: 50000, unit: "unicode_code_points" }),
19903
+ juejin: Object.freeze({ max: 50000, unit: "unicode_code_points" })
19904
+ }),
19905
+ shortVideo: Object.freeze({
19906
+ douyin: Object.freeze({ max: 1000, unit: "unicode_code_points" }),
19907
+ kuaishou: Object.freeze({ max: 1000, unit: "unicode_code_points" }),
19908
+ shipinhao: Object.freeze({ max: 1000, unit: "unicode_code_points" })
19909
+ })
19910
+ })
19911
+ });
19835
19912
  // ../../packages/kk-core/src/kinds.ts
19836
19913
  init_zod();
19837
19914
 
@@ -19922,6 +19999,67 @@ var BrowserSessionDescriptorSchema = object({
19922
19999
  }
19923
20000
  }).optional()
19924
20001
  }).strict();
20002
+ var ContentCountUnitSchema = _enum([
20003
+ "utf16_code_units",
20004
+ "unicode_code_points",
20005
+ "weighted",
20006
+ "xiaohongshu_title_weighted"
20007
+ ]);
20008
+ var LimitEntrySchema = object({
20009
+ max: number2().int().positive(),
20010
+ unit: ContentCountUnitSchema
20011
+ }).strict();
20012
+ var PublishingProfileLimitsSchema = object({
20013
+ title: LimitEntrySchema.optional(),
20014
+ body: LimitEntrySchema.optional()
20015
+ }).strict();
20016
+ var PublishingProfileRequiresSchema = object({
20017
+ cover: boolean2().optional(),
20018
+ orderedImages: boolean2().optional()
20019
+ }).strict();
20020
+ var PublishingProfileModeBindingSchema = object({
20021
+ metadata: record(string2(), unknown())
20022
+ }).strict();
20023
+ var PublishingProfileModesSchema = object({
20024
+ draft: PublishingProfileModeBindingSchema.optional(),
20025
+ live: PublishingProfileModeBindingSchema.optional()
20026
+ }).strict().superRefine((modes, ctx) => {
20027
+ if (modes.draft === undefined && modes.live === undefined) {
20028
+ ctx.addIssue({
20029
+ code: "custom",
20030
+ message: 'modes must define at least one of "draft" or "live"'
20031
+ });
20032
+ }
20033
+ });
20034
+ var PublishingProfileSchema = object({
20035
+ format: string2().min(1),
20036
+ locale: string2().regex(/^(source|[a-z]{2,3}(-[A-Za-z0-9]+)*)$/, {
20037
+ message: 'locale must be "source" or a valid language tag'
20038
+ }),
20039
+ limits: PublishingProfileLimitsSchema.optional(),
20040
+ requires: PublishingProfileRequiresSchema.optional(),
20041
+ modes: PublishingProfileModesSchema
20042
+ }).strict();
20043
+ var PublishingCapabilitiesSchema = object({
20044
+ defaultProfile: string2().min(1),
20045
+ profiles: record(string2().regex(/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/), PublishingProfileSchema)
20046
+ }).strict().superRefine((data, ctx) => {
20047
+ const keys = Object.keys(data.profiles);
20048
+ if (keys.length === 0) {
20049
+ ctx.addIssue({
20050
+ code: "custom",
20051
+ path: ["profiles"],
20052
+ message: "profiles record must be nonempty"
20053
+ });
20054
+ }
20055
+ if (!(data.defaultProfile in data.profiles)) {
20056
+ ctx.addIssue({
20057
+ code: "custom",
20058
+ path: ["defaultProfile"],
20059
+ message: `defaultProfile "${data.defaultProfile}" must reference a declared profile`
20060
+ });
20061
+ }
20062
+ });
19925
20063
  var PluginManifestSchemaBase = looseObject({
19926
20064
  name: string2().min(1),
19927
20065
  kind: PluginKindSchema,
@@ -19930,23 +20068,31 @@ var PluginManifestSchemaBase = looseObject({
19930
20068
  version: string2().optional(),
19931
20069
  description: string2().optional(),
19932
20070
  operations: record(string2(), PluginOperationSchema).optional(),
19933
- browserSession: BrowserSessionDescriptorSchema.optional()
20071
+ browserSession: BrowserSessionDescriptorSchema.optional(),
20072
+ publishing: PublishingCapabilitiesSchema.optional()
19934
20073
  });
19935
20074
  var PluginManifestSchema = PluginManifestSchemaBase.superRefine((manifest, ctx) => {
19936
- if (manifest.browserSession === undefined)
19937
- return;
19938
- if (manifest.kind !== "publish") {
19939
- ctx.addIssue({
19940
- code: "custom",
19941
- path: ["browserSession"],
19942
- message: `browserSession requires kind "publish", not "${manifest.kind}"`
19943
- });
20075
+ if (manifest.browserSession !== undefined) {
20076
+ if (manifest.kind !== "publish") {
20077
+ ctx.addIssue({
20078
+ code: "custom",
20079
+ path: ["browserSession"],
20080
+ message: `browserSession requires kind "publish", not "${manifest.kind}"`
20081
+ });
20082
+ }
20083
+ if (manifest.check === undefined) {
20084
+ ctx.addIssue({
20085
+ code: "custom",
20086
+ path: ["browserSession"],
20087
+ message: "browserSession requires a check probe entry that owns the session routines"
20088
+ });
20089
+ }
19944
20090
  }
19945
- if (manifest.check === undefined) {
20091
+ if (manifest.publishing !== undefined && manifest.kind !== "publish") {
19946
20092
  ctx.addIssue({
19947
20093
  code: "custom",
19948
- path: ["browserSession"],
19949
- message: "browserSession requires a check probe entry that owns the session routines"
20094
+ path: ["publishing"],
20095
+ message: `publishing requires kind "publish", not "${manifest.kind}"`
19950
20096
  });
19951
20097
  }
19952
20098
  });
@@ -20569,6 +20715,8 @@ async function ensureProfileDir2(profileDir, headless) {
20569
20715
  throw new BrowserProfileMissingError(profileDir);
20570
20716
  await mkdir2(profileDir, { recursive: true, mode: 448 });
20571
20717
  }
20718
+ // ../../packages/publish-harness/src/browser-anti-detection.ts
20719
+ var MAX_QUEUED_BYTES = 8 * 1024 * 1024;
20572
20720
  // ../../packages/publish-harness/src/browser.ts
20573
20721
  var DEFAULT_CHECK_TIMEOUT_MS = 30000;
20574
20722
  var DEFAULT_STEP_TIMEOUT_MS = 30000;
@@ -20423,6 +20423,8 @@ async function ensureProfileDir2(profileDir, headless) {
20423
20423
  throw new BrowserProfileMissingError(profileDir);
20424
20424
  await mkdir2(profileDir, { recursive: true, mode: 448 });
20425
20425
  }
20426
+ // ../../packages/publish-harness/src/browser-anti-detection.ts
20427
+ var MAX_QUEUED_BYTES = 8 * 1024 * 1024;
20426
20428
  // ../../packages/publish-harness/src/browser.ts
20427
20429
  var DEFAULT_CHECK_TIMEOUT_MS = 30000;
20428
20430
  function createKkBrowserLauncher(loadPlaywright = () => import("playwright"), ownership, leaseOptions = {}) {
@@ -20675,6 +20677,83 @@ function createAutomationGuard(options) {
20675
20677
  };
20676
20678
  }
20677
20679
 
20680
+ // ../../packages/kk-core/src/content-limits.ts
20681
+ var PLATFORM_CONTENT_LIMITS = Object.freeze({
20682
+ schemaVersion: 5,
20683
+ tagLimits: Object.freeze({
20684
+ default: 7,
20685
+ imageText: Object.freeze({
20686
+ instagram: 5,
20687
+ douyin: 5,
20688
+ kuaishou: 4,
20689
+ weixin: 1,
20690
+ xiaohongshu: 10
20691
+ }),
20692
+ shortVideo: Object.freeze({
20693
+ douyin: 5,
20694
+ kuaishou: 4,
20695
+ xiaohongshu: 10,
20696
+ bilibili: 10,
20697
+ zhihu: 5,
20698
+ tiktok: 20,
20699
+ youtube: 60
20700
+ })
20701
+ }),
20702
+ titleCapabilities: Object.freeze({
20703
+ dynamic: Object.freeze({
20704
+ bilibili: Object.freeze({ max: 20, unit: "utf16_code_units" }),
20705
+ zhihu: Object.freeze({ max: 50, unit: "utf16_code_units" }),
20706
+ douban: Object.freeze({ max: 70, unit: "utf16_code_units" }),
20707
+ x: null,
20708
+ threads: null,
20709
+ weibo: null,
20710
+ jike: null,
20711
+ zsxq: null,
20712
+ toutiao: null,
20713
+ juejin: null
20714
+ }),
20715
+ imageText: Object.freeze({
20716
+ xiaohongshu: Object.freeze({ max: 20, unit: "xiaohongshu_title_weighted" }),
20717
+ weixin: Object.freeze({ max: 20, unit: "utf16_code_units" }),
20718
+ douyin: Object.freeze({ max: 20, unit: "utf16_code_units" }),
20719
+ shipinhao: Object.freeze({ max: 22, unit: "utf16_code_units" }),
20720
+ reddit: Object.freeze({ max: 300, unit: "utf16_code_units" })
20721
+ }),
20722
+ article: Object.freeze({
20723
+ juejin: Object.freeze({ max: 100, unit: "utf16_code_units" }),
20724
+ csdn: Object.freeze({ max: 100, unit: "utf16_code_units" }),
20725
+ cnblogs: Object.freeze({ max: 128, unit: "utf16_code_units" }),
20726
+ weibo: Object.freeze({ max: 30, unit: "utf16_code_units" }),
20727
+ sspai: Object.freeze({ max: 80, unit: "utf16_code_units" })
20728
+ }),
20729
+ shortVideo: Object.freeze({
20730
+ shipinhao: Object.freeze({ max: 16, unit: "utf16_code_units" }),
20731
+ douyin: Object.freeze({ max: 30, unit: "utf16_code_units" }),
20732
+ bilibili: Object.freeze({ max: 80, unit: "utf16_code_units" })
20733
+ })
20734
+ }),
20735
+ bodyCapabilities: Object.freeze({
20736
+ dynamic: Object.freeze({
20737
+ threads: Object.freeze({ max: 500, unit: "unicode_code_points", behavior: "split_thread" }),
20738
+ x: Object.freeze({ max: 280, unit: "weighted", behavior: "split_thread" }),
20739
+ weibo: Object.freeze({ max: 2000, unit: "unicode_code_points" }),
20740
+ jike: Object.freeze({ max: 1000, unit: "unicode_code_points" })
20741
+ }),
20742
+ imageText: Object.freeze({
20743
+ xiaohongshu: Object.freeze({ max: 1000, unit: "unicode_code_points" }),
20744
+ douyin: Object.freeze({ max: 1000, unit: "unicode_code_points" })
20745
+ }),
20746
+ article: Object.freeze({
20747
+ wechatmp: Object.freeze({ max: 50000, unit: "unicode_code_points" }),
20748
+ juejin: Object.freeze({ max: 50000, unit: "unicode_code_points" })
20749
+ }),
20750
+ shortVideo: Object.freeze({
20751
+ douyin: Object.freeze({ max: 1000, unit: "unicode_code_points" }),
20752
+ kuaishou: Object.freeze({ max: 1000, unit: "unicode_code_points" }),
20753
+ shipinhao: Object.freeze({ max: 1000, unit: "unicode_code_points" })
20754
+ })
20755
+ })
20756
+ });
20678
20757
  // ../../packages/kk-core/src/kinds.ts
20679
20758
  init_zod();
20680
20759
 
@@ -20765,6 +20844,67 @@ var BrowserSessionDescriptorSchema = object2({
20765
20844
  }
20766
20845
  }).optional()
20767
20846
  }).strict();
20847
+ var ContentCountUnitSchema = _enum([
20848
+ "utf16_code_units",
20849
+ "unicode_code_points",
20850
+ "weighted",
20851
+ "xiaohongshu_title_weighted"
20852
+ ]);
20853
+ var LimitEntrySchema = object2({
20854
+ max: number2().int().positive(),
20855
+ unit: ContentCountUnitSchema
20856
+ }).strict();
20857
+ var PublishingProfileLimitsSchema = object2({
20858
+ title: LimitEntrySchema.optional(),
20859
+ body: LimitEntrySchema.optional()
20860
+ }).strict();
20861
+ var PublishingProfileRequiresSchema = object2({
20862
+ cover: boolean2().optional(),
20863
+ orderedImages: boolean2().optional()
20864
+ }).strict();
20865
+ var PublishingProfileModeBindingSchema = object2({
20866
+ metadata: record(string2(), unknown())
20867
+ }).strict();
20868
+ var PublishingProfileModesSchema = object2({
20869
+ draft: PublishingProfileModeBindingSchema.optional(),
20870
+ live: PublishingProfileModeBindingSchema.optional()
20871
+ }).strict().superRefine((modes, ctx) => {
20872
+ if (modes.draft === undefined && modes.live === undefined) {
20873
+ ctx.addIssue({
20874
+ code: "custom",
20875
+ message: 'modes must define at least one of "draft" or "live"'
20876
+ });
20877
+ }
20878
+ });
20879
+ var PublishingProfileSchema = object2({
20880
+ format: string2().min(1),
20881
+ locale: string2().regex(/^(source|[a-z]{2,3}(-[A-Za-z0-9]+)*)$/, {
20882
+ message: 'locale must be "source" or a valid language tag'
20883
+ }),
20884
+ limits: PublishingProfileLimitsSchema.optional(),
20885
+ requires: PublishingProfileRequiresSchema.optional(),
20886
+ modes: PublishingProfileModesSchema
20887
+ }).strict();
20888
+ var PublishingCapabilitiesSchema = object2({
20889
+ defaultProfile: string2().min(1),
20890
+ profiles: record(string2().regex(/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/), PublishingProfileSchema)
20891
+ }).strict().superRefine((data, ctx) => {
20892
+ const keys = Object.keys(data.profiles);
20893
+ if (keys.length === 0) {
20894
+ ctx.addIssue({
20895
+ code: "custom",
20896
+ path: ["profiles"],
20897
+ message: "profiles record must be nonempty"
20898
+ });
20899
+ }
20900
+ if (!(data.defaultProfile in data.profiles)) {
20901
+ ctx.addIssue({
20902
+ code: "custom",
20903
+ path: ["defaultProfile"],
20904
+ message: `defaultProfile "${data.defaultProfile}" must reference a declared profile`
20905
+ });
20906
+ }
20907
+ });
20768
20908
  var PluginManifestSchemaBase = looseObject({
20769
20909
  name: string2().min(1),
20770
20910
  kind: PluginKindSchema,
@@ -20773,23 +20913,31 @@ var PluginManifestSchemaBase = looseObject({
20773
20913
  version: string2().optional(),
20774
20914
  description: string2().optional(),
20775
20915
  operations: record(string2(), PluginOperationSchema).optional(),
20776
- browserSession: BrowserSessionDescriptorSchema.optional()
20916
+ browserSession: BrowserSessionDescriptorSchema.optional(),
20917
+ publishing: PublishingCapabilitiesSchema.optional()
20777
20918
  });
20778
20919
  var PluginManifestSchema = PluginManifestSchemaBase.superRefine((manifest, ctx) => {
20779
- if (manifest.browserSession === undefined)
20780
- return;
20781
- if (manifest.kind !== "publish") {
20782
- ctx.addIssue({
20783
- code: "custom",
20784
- path: ["browserSession"],
20785
- message: `browserSession requires kind "publish", not "${manifest.kind}"`
20786
- });
20920
+ if (manifest.browserSession !== undefined) {
20921
+ if (manifest.kind !== "publish") {
20922
+ ctx.addIssue({
20923
+ code: "custom",
20924
+ path: ["browserSession"],
20925
+ message: `browserSession requires kind "publish", not "${manifest.kind}"`
20926
+ });
20927
+ }
20928
+ if (manifest.check === undefined) {
20929
+ ctx.addIssue({
20930
+ code: "custom",
20931
+ path: ["browserSession"],
20932
+ message: "browserSession requires a check probe entry that owns the session routines"
20933
+ });
20934
+ }
20787
20935
  }
20788
- if (manifest.check === undefined) {
20936
+ if (manifest.publishing !== undefined && manifest.kind !== "publish") {
20789
20937
  ctx.addIssue({
20790
20938
  code: "custom",
20791
- path: ["browserSession"],
20792
- message: "browserSession requires a check probe entry that owns the session routines"
20939
+ path: ["publishing"],
20940
+ message: `publishing requires kind "publish", not "${manifest.kind}"`
20793
20941
  });
20794
20942
  }
20795
20943
  });