@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;
@@ -20653,6 +20655,83 @@ function errorMessage2(error) {
20653
20655
  // ../../plugins/publishings/substack-pub/src/profile-check.ts
20654
20656
  init_dist();
20655
20657
 
20658
+ // ../../packages/kk-core/src/content-limits.ts
20659
+ var PLATFORM_CONTENT_LIMITS = Object.freeze({
20660
+ schemaVersion: 5,
20661
+ tagLimits: Object.freeze({
20662
+ default: 7,
20663
+ imageText: Object.freeze({
20664
+ instagram: 5,
20665
+ douyin: 5,
20666
+ kuaishou: 4,
20667
+ weixin: 1,
20668
+ xiaohongshu: 10
20669
+ }),
20670
+ shortVideo: Object.freeze({
20671
+ douyin: 5,
20672
+ kuaishou: 4,
20673
+ xiaohongshu: 10,
20674
+ bilibili: 10,
20675
+ zhihu: 5,
20676
+ tiktok: 20,
20677
+ youtube: 60
20678
+ })
20679
+ }),
20680
+ titleCapabilities: Object.freeze({
20681
+ dynamic: Object.freeze({
20682
+ bilibili: Object.freeze({ max: 20, unit: "utf16_code_units" }),
20683
+ zhihu: Object.freeze({ max: 50, unit: "utf16_code_units" }),
20684
+ douban: Object.freeze({ max: 70, unit: "utf16_code_units" }),
20685
+ x: null,
20686
+ threads: null,
20687
+ weibo: null,
20688
+ jike: null,
20689
+ zsxq: null,
20690
+ toutiao: null,
20691
+ juejin: null
20692
+ }),
20693
+ imageText: Object.freeze({
20694
+ xiaohongshu: Object.freeze({ max: 20, unit: "xiaohongshu_title_weighted" }),
20695
+ weixin: Object.freeze({ max: 20, unit: "utf16_code_units" }),
20696
+ douyin: Object.freeze({ max: 20, unit: "utf16_code_units" }),
20697
+ shipinhao: Object.freeze({ max: 22, unit: "utf16_code_units" }),
20698
+ reddit: Object.freeze({ max: 300, unit: "utf16_code_units" })
20699
+ }),
20700
+ article: Object.freeze({
20701
+ juejin: Object.freeze({ max: 100, unit: "utf16_code_units" }),
20702
+ csdn: Object.freeze({ max: 100, unit: "utf16_code_units" }),
20703
+ cnblogs: Object.freeze({ max: 128, unit: "utf16_code_units" }),
20704
+ weibo: Object.freeze({ max: 30, unit: "utf16_code_units" }),
20705
+ sspai: Object.freeze({ max: 80, unit: "utf16_code_units" })
20706
+ }),
20707
+ shortVideo: Object.freeze({
20708
+ shipinhao: Object.freeze({ max: 16, unit: "utf16_code_units" }),
20709
+ douyin: Object.freeze({ max: 30, unit: "utf16_code_units" }),
20710
+ bilibili: Object.freeze({ max: 80, unit: "utf16_code_units" })
20711
+ })
20712
+ }),
20713
+ bodyCapabilities: Object.freeze({
20714
+ dynamic: Object.freeze({
20715
+ threads: Object.freeze({ max: 500, unit: "unicode_code_points", behavior: "split_thread" }),
20716
+ x: Object.freeze({ max: 280, unit: "weighted", behavior: "split_thread" }),
20717
+ weibo: Object.freeze({ max: 2000, unit: "unicode_code_points" }),
20718
+ jike: Object.freeze({ max: 1000, unit: "unicode_code_points" })
20719
+ }),
20720
+ imageText: Object.freeze({
20721
+ xiaohongshu: Object.freeze({ max: 1000, unit: "unicode_code_points" }),
20722
+ douyin: Object.freeze({ max: 1000, unit: "unicode_code_points" })
20723
+ }),
20724
+ article: Object.freeze({
20725
+ wechatmp: Object.freeze({ max: 50000, unit: "unicode_code_points" }),
20726
+ juejin: Object.freeze({ max: 50000, unit: "unicode_code_points" })
20727
+ }),
20728
+ shortVideo: Object.freeze({
20729
+ douyin: Object.freeze({ max: 1000, unit: "unicode_code_points" }),
20730
+ kuaishou: Object.freeze({ max: 1000, unit: "unicode_code_points" }),
20731
+ shipinhao: Object.freeze({ max: 1000, unit: "unicode_code_points" })
20732
+ })
20733
+ })
20734
+ });
20656
20735
  // ../../packages/kk-core/src/kinds.ts
20657
20736
  init_zod();
20658
20737
 
@@ -20743,6 +20822,67 @@ var BrowserSessionDescriptorSchema = object2({
20743
20822
  }
20744
20823
  }).optional()
20745
20824
  }).strict();
20825
+ var ContentCountUnitSchema = _enum([
20826
+ "utf16_code_units",
20827
+ "unicode_code_points",
20828
+ "weighted",
20829
+ "xiaohongshu_title_weighted"
20830
+ ]);
20831
+ var LimitEntrySchema = object2({
20832
+ max: number2().int().positive(),
20833
+ unit: ContentCountUnitSchema
20834
+ }).strict();
20835
+ var PublishingProfileLimitsSchema = object2({
20836
+ title: LimitEntrySchema.optional(),
20837
+ body: LimitEntrySchema.optional()
20838
+ }).strict();
20839
+ var PublishingProfileRequiresSchema = object2({
20840
+ cover: boolean2().optional(),
20841
+ orderedImages: boolean2().optional()
20842
+ }).strict();
20843
+ var PublishingProfileModeBindingSchema = object2({
20844
+ metadata: record(string2(), unknown())
20845
+ }).strict();
20846
+ var PublishingProfileModesSchema = object2({
20847
+ draft: PublishingProfileModeBindingSchema.optional(),
20848
+ live: PublishingProfileModeBindingSchema.optional()
20849
+ }).strict().superRefine((modes, ctx) => {
20850
+ if (modes.draft === undefined && modes.live === undefined) {
20851
+ ctx.addIssue({
20852
+ code: "custom",
20853
+ message: 'modes must define at least one of "draft" or "live"'
20854
+ });
20855
+ }
20856
+ });
20857
+ var PublishingProfileSchema = object2({
20858
+ format: string2().min(1),
20859
+ locale: string2().regex(/^(source|[a-z]{2,3}(-[A-Za-z0-9]+)*)$/, {
20860
+ message: 'locale must be "source" or a valid language tag'
20861
+ }),
20862
+ limits: PublishingProfileLimitsSchema.optional(),
20863
+ requires: PublishingProfileRequiresSchema.optional(),
20864
+ modes: PublishingProfileModesSchema
20865
+ }).strict();
20866
+ var PublishingCapabilitiesSchema = object2({
20867
+ defaultProfile: string2().min(1),
20868
+ profiles: record(string2().regex(/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/), PublishingProfileSchema)
20869
+ }).strict().superRefine((data, ctx) => {
20870
+ const keys = Object.keys(data.profiles);
20871
+ if (keys.length === 0) {
20872
+ ctx.addIssue({
20873
+ code: "custom",
20874
+ path: ["profiles"],
20875
+ message: "profiles record must be nonempty"
20876
+ });
20877
+ }
20878
+ if (!(data.defaultProfile in data.profiles)) {
20879
+ ctx.addIssue({
20880
+ code: "custom",
20881
+ path: ["defaultProfile"],
20882
+ message: `defaultProfile "${data.defaultProfile}" must reference a declared profile`
20883
+ });
20884
+ }
20885
+ });
20746
20886
  var PluginManifestSchemaBase = looseObject({
20747
20887
  name: string2().min(1),
20748
20888
  kind: PluginKindSchema,
@@ -20751,23 +20891,31 @@ var PluginManifestSchemaBase = looseObject({
20751
20891
  version: string2().optional(),
20752
20892
  description: string2().optional(),
20753
20893
  operations: record(string2(), PluginOperationSchema).optional(),
20754
- browserSession: BrowserSessionDescriptorSchema.optional()
20894
+ browserSession: BrowserSessionDescriptorSchema.optional(),
20895
+ publishing: PublishingCapabilitiesSchema.optional()
20755
20896
  });
20756
20897
  var PluginManifestSchema = PluginManifestSchemaBase.superRefine((manifest, ctx) => {
20757
- if (manifest.browserSession === undefined)
20758
- return;
20759
- if (manifest.kind !== "publish") {
20760
- ctx.addIssue({
20761
- code: "custom",
20762
- path: ["browserSession"],
20763
- message: `browserSession requires kind "publish", not "${manifest.kind}"`
20764
- });
20898
+ if (manifest.browserSession !== undefined) {
20899
+ if (manifest.kind !== "publish") {
20900
+ ctx.addIssue({
20901
+ code: "custom",
20902
+ path: ["browserSession"],
20903
+ message: `browserSession requires kind "publish", not "${manifest.kind}"`
20904
+ });
20905
+ }
20906
+ if (manifest.check === undefined) {
20907
+ ctx.addIssue({
20908
+ code: "custom",
20909
+ path: ["browserSession"],
20910
+ message: "browserSession requires a check probe entry that owns the session routines"
20911
+ });
20912
+ }
20765
20913
  }
20766
- if (manifest.check === undefined) {
20914
+ if (manifest.publishing !== undefined && manifest.kind !== "publish") {
20767
20915
  ctx.addIssue({
20768
20916
  code: "custom",
20769
- path: ["browserSession"],
20770
- message: "browserSession requires a check probe entry that owns the session routines"
20917
+ path: ["publishing"],
20918
+ message: `publishing requires kind "publish", not "${manifest.kind}"`
20771
20919
  });
20772
20920
  }
20773
20921
  });
@@ -7,5 +7,26 @@
7
7
  "description": "Publish plugin for Substack (substack.com): post drafts through the ProseMirror editor via script browser transport (ts-browser-automation)",
8
8
  "browserSession": {
9
9
  "profileName": "substack"
10
+ },
11
+ "publishing": {
12
+ "defaultProfile": "article",
13
+ "profiles": {
14
+ "article": {
15
+ "format": "article",
16
+ "locale": "en",
17
+ "modes": {
18
+ "draft": {
19
+ "metadata": {
20
+ "publishStatus": "draft"
21
+ }
22
+ },
23
+ "live": {
24
+ "metadata": {
25
+ "publishStatus": "public"
26
+ }
27
+ }
28
+ }
29
+ }
30
+ }
10
31
  }
11
32
  }
@@ -12075,6 +12075,83 @@ import { copyFile, cp, writeFile } from "fs/promises";
12075
12075
  import { dirname as dirname3, extname, isAbsolute, join as join2, relative, resolve, sep as sep2 } from "path";
12076
12076
  import { parseArgs } from "util";
12077
12077
 
12078
+ // ../../packages/kk-core/src/content-limits.ts
12079
+ var PLATFORM_CONTENT_LIMITS = Object.freeze({
12080
+ schemaVersion: 5,
12081
+ tagLimits: Object.freeze({
12082
+ default: 7,
12083
+ imageText: Object.freeze({
12084
+ instagram: 5,
12085
+ douyin: 5,
12086
+ kuaishou: 4,
12087
+ weixin: 1,
12088
+ xiaohongshu: 10
12089
+ }),
12090
+ shortVideo: Object.freeze({
12091
+ douyin: 5,
12092
+ kuaishou: 4,
12093
+ xiaohongshu: 10,
12094
+ bilibili: 10,
12095
+ zhihu: 5,
12096
+ tiktok: 20,
12097
+ youtube: 60
12098
+ })
12099
+ }),
12100
+ titleCapabilities: Object.freeze({
12101
+ dynamic: Object.freeze({
12102
+ bilibili: Object.freeze({ max: 20, unit: "utf16_code_units" }),
12103
+ zhihu: Object.freeze({ max: 50, unit: "utf16_code_units" }),
12104
+ douban: Object.freeze({ max: 70, unit: "utf16_code_units" }),
12105
+ x: null,
12106
+ threads: null,
12107
+ weibo: null,
12108
+ jike: null,
12109
+ zsxq: null,
12110
+ toutiao: null,
12111
+ juejin: null
12112
+ }),
12113
+ imageText: Object.freeze({
12114
+ xiaohongshu: Object.freeze({ max: 20, unit: "xiaohongshu_title_weighted" }),
12115
+ weixin: Object.freeze({ max: 20, unit: "utf16_code_units" }),
12116
+ douyin: Object.freeze({ max: 20, unit: "utf16_code_units" }),
12117
+ shipinhao: Object.freeze({ max: 22, unit: "utf16_code_units" }),
12118
+ reddit: Object.freeze({ max: 300, unit: "utf16_code_units" })
12119
+ }),
12120
+ article: Object.freeze({
12121
+ juejin: Object.freeze({ max: 100, unit: "utf16_code_units" }),
12122
+ csdn: Object.freeze({ max: 100, unit: "utf16_code_units" }),
12123
+ cnblogs: Object.freeze({ max: 128, unit: "utf16_code_units" }),
12124
+ weibo: Object.freeze({ max: 30, unit: "utf16_code_units" }),
12125
+ sspai: Object.freeze({ max: 80, unit: "utf16_code_units" })
12126
+ }),
12127
+ shortVideo: Object.freeze({
12128
+ shipinhao: Object.freeze({ max: 16, unit: "utf16_code_units" }),
12129
+ douyin: Object.freeze({ max: 30, unit: "utf16_code_units" }),
12130
+ bilibili: Object.freeze({ max: 80, unit: "utf16_code_units" })
12131
+ })
12132
+ }),
12133
+ bodyCapabilities: Object.freeze({
12134
+ dynamic: Object.freeze({
12135
+ threads: Object.freeze({ max: 500, unit: "unicode_code_points", behavior: "split_thread" }),
12136
+ x: Object.freeze({ max: 280, unit: "weighted", behavior: "split_thread" }),
12137
+ weibo: Object.freeze({ max: 2000, unit: "unicode_code_points" }),
12138
+ jike: Object.freeze({ max: 1000, unit: "unicode_code_points" })
12139
+ }),
12140
+ imageText: Object.freeze({
12141
+ xiaohongshu: Object.freeze({ max: 1000, unit: "unicode_code_points" }),
12142
+ douyin: Object.freeze({ max: 1000, unit: "unicode_code_points" })
12143
+ }),
12144
+ article: Object.freeze({
12145
+ wechatmp: Object.freeze({ max: 50000, unit: "unicode_code_points" }),
12146
+ juejin: Object.freeze({ max: 50000, unit: "unicode_code_points" })
12147
+ }),
12148
+ shortVideo: Object.freeze({
12149
+ douyin: Object.freeze({ max: 1000, unit: "unicode_code_points" }),
12150
+ kuaishou: Object.freeze({ max: 1000, unit: "unicode_code_points" }),
12151
+ shipinhao: Object.freeze({ max: 1000, unit: "unicode_code_points" })
12152
+ })
12153
+ })
12154
+ });
12078
12155
  // ../../packages/kk-core/src/kinds.ts
12079
12156
  init_zod();
12080
12157
 
@@ -12165,6 +12242,67 @@ var BrowserSessionDescriptorSchema = object({
12165
12242
  }
12166
12243
  }).optional()
12167
12244
  }).strict();
12245
+ var ContentCountUnitSchema = _enum([
12246
+ "utf16_code_units",
12247
+ "unicode_code_points",
12248
+ "weighted",
12249
+ "xiaohongshu_title_weighted"
12250
+ ]);
12251
+ var LimitEntrySchema = object({
12252
+ max: number2().int().positive(),
12253
+ unit: ContentCountUnitSchema
12254
+ }).strict();
12255
+ var PublishingProfileLimitsSchema = object({
12256
+ title: LimitEntrySchema.optional(),
12257
+ body: LimitEntrySchema.optional()
12258
+ }).strict();
12259
+ var PublishingProfileRequiresSchema = object({
12260
+ cover: boolean2().optional(),
12261
+ orderedImages: boolean2().optional()
12262
+ }).strict();
12263
+ var PublishingProfileModeBindingSchema = object({
12264
+ metadata: record(string2(), unknown())
12265
+ }).strict();
12266
+ var PublishingProfileModesSchema = object({
12267
+ draft: PublishingProfileModeBindingSchema.optional(),
12268
+ live: PublishingProfileModeBindingSchema.optional()
12269
+ }).strict().superRefine((modes, ctx) => {
12270
+ if (modes.draft === undefined && modes.live === undefined) {
12271
+ ctx.addIssue({
12272
+ code: "custom",
12273
+ message: 'modes must define at least one of "draft" or "live"'
12274
+ });
12275
+ }
12276
+ });
12277
+ var PublishingProfileSchema = object({
12278
+ format: string2().min(1),
12279
+ locale: string2().regex(/^(source|[a-z]{2,3}(-[A-Za-z0-9]+)*)$/, {
12280
+ message: 'locale must be "source" or a valid language tag'
12281
+ }),
12282
+ limits: PublishingProfileLimitsSchema.optional(),
12283
+ requires: PublishingProfileRequiresSchema.optional(),
12284
+ modes: PublishingProfileModesSchema
12285
+ }).strict();
12286
+ var PublishingCapabilitiesSchema = object({
12287
+ defaultProfile: string2().min(1),
12288
+ profiles: record(string2().regex(/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/), PublishingProfileSchema)
12289
+ }).strict().superRefine((data, ctx) => {
12290
+ const keys = Object.keys(data.profiles);
12291
+ if (keys.length === 0) {
12292
+ ctx.addIssue({
12293
+ code: "custom",
12294
+ path: ["profiles"],
12295
+ message: "profiles record must be nonempty"
12296
+ });
12297
+ }
12298
+ if (!(data.defaultProfile in data.profiles)) {
12299
+ ctx.addIssue({
12300
+ code: "custom",
12301
+ path: ["defaultProfile"],
12302
+ message: `defaultProfile "${data.defaultProfile}" must reference a declared profile`
12303
+ });
12304
+ }
12305
+ });
12168
12306
  var PluginManifestSchemaBase = looseObject({
12169
12307
  name: string2().min(1),
12170
12308
  kind: PluginKindSchema,
@@ -12173,23 +12311,31 @@ var PluginManifestSchemaBase = looseObject({
12173
12311
  version: string2().optional(),
12174
12312
  description: string2().optional(),
12175
12313
  operations: record(string2(), PluginOperationSchema).optional(),
12176
- browserSession: BrowserSessionDescriptorSchema.optional()
12314
+ browserSession: BrowserSessionDescriptorSchema.optional(),
12315
+ publishing: PublishingCapabilitiesSchema.optional()
12177
12316
  });
12178
12317
  var PluginManifestSchema = PluginManifestSchemaBase.superRefine((manifest, ctx) => {
12179
- if (manifest.browserSession === undefined)
12180
- return;
12181
- if (manifest.kind !== "publish") {
12182
- ctx.addIssue({
12183
- code: "custom",
12184
- path: ["browserSession"],
12185
- message: `browserSession requires kind "publish", not "${manifest.kind}"`
12186
- });
12318
+ if (manifest.browserSession !== undefined) {
12319
+ if (manifest.kind !== "publish") {
12320
+ ctx.addIssue({
12321
+ code: "custom",
12322
+ path: ["browserSession"],
12323
+ message: `browserSession requires kind "publish", not "${manifest.kind}"`
12324
+ });
12325
+ }
12326
+ if (manifest.check === undefined) {
12327
+ ctx.addIssue({
12328
+ code: "custom",
12329
+ path: ["browserSession"],
12330
+ message: "browserSession requires a check probe entry that owns the session routines"
12331
+ });
12332
+ }
12187
12333
  }
12188
- if (manifest.check === undefined) {
12334
+ if (manifest.publishing !== undefined && manifest.kind !== "publish") {
12189
12335
  ctx.addIssue({
12190
12336
  code: "custom",
12191
- path: ["browserSession"],
12192
- message: "browserSession requires a check probe entry that owns the session routines"
12337
+ path: ["publishing"],
12338
+ message: `publishing requires kind "publish", not "${manifest.kind}"`
12193
12339
  });
12194
12340
  }
12195
12341
  });
@@ -3,5 +3,26 @@
3
3
  "kind": "publish",
4
4
  "entry": "./dist/index.js",
5
5
  "version": "1.0.0",
6
- "description": "Publish plugin for Surfdash (Surfing SSG) invoking postsurfing CLI via FileCli transport"
6
+ "description": "Publish plugin for Surfdash (Surfing SSG) invoking postsurfing CLI via FileCli transport",
7
+ "publishing": {
8
+ "defaultProfile": "article",
9
+ "profiles": {
10
+ "article": {
11
+ "format": "article",
12
+ "locale": "source",
13
+ "modes": {
14
+ "draft": {
15
+ "metadata": {
16
+ "published": false
17
+ }
18
+ },
19
+ "live": {
20
+ "metadata": {
21
+ "published": true
22
+ }
23
+ }
24
+ }
25
+ }
26
+ }
27
+ }
7
28
  }
@@ -11984,6 +11984,83 @@ var init_file_system_node = () => {};
11984
11984
  import { dirname as dirname2 } from "path";
11985
11985
  import { parseArgs } from "util";
11986
11986
 
11987
+ // ../../packages/kk-core/src/content-limits.ts
11988
+ var PLATFORM_CONTENT_LIMITS = Object.freeze({
11989
+ schemaVersion: 5,
11990
+ tagLimits: Object.freeze({
11991
+ default: 7,
11992
+ imageText: Object.freeze({
11993
+ instagram: 5,
11994
+ douyin: 5,
11995
+ kuaishou: 4,
11996
+ weixin: 1,
11997
+ xiaohongshu: 10
11998
+ }),
11999
+ shortVideo: Object.freeze({
12000
+ douyin: 5,
12001
+ kuaishou: 4,
12002
+ xiaohongshu: 10,
12003
+ bilibili: 10,
12004
+ zhihu: 5,
12005
+ tiktok: 20,
12006
+ youtube: 60
12007
+ })
12008
+ }),
12009
+ titleCapabilities: Object.freeze({
12010
+ dynamic: Object.freeze({
12011
+ bilibili: Object.freeze({ max: 20, unit: "utf16_code_units" }),
12012
+ zhihu: Object.freeze({ max: 50, unit: "utf16_code_units" }),
12013
+ douban: Object.freeze({ max: 70, unit: "utf16_code_units" }),
12014
+ x: null,
12015
+ threads: null,
12016
+ weibo: null,
12017
+ jike: null,
12018
+ zsxq: null,
12019
+ toutiao: null,
12020
+ juejin: null
12021
+ }),
12022
+ imageText: Object.freeze({
12023
+ xiaohongshu: Object.freeze({ max: 20, unit: "xiaohongshu_title_weighted" }),
12024
+ weixin: Object.freeze({ max: 20, unit: "utf16_code_units" }),
12025
+ douyin: Object.freeze({ max: 20, unit: "utf16_code_units" }),
12026
+ shipinhao: Object.freeze({ max: 22, unit: "utf16_code_units" }),
12027
+ reddit: Object.freeze({ max: 300, unit: "utf16_code_units" })
12028
+ }),
12029
+ article: Object.freeze({
12030
+ juejin: Object.freeze({ max: 100, unit: "utf16_code_units" }),
12031
+ csdn: Object.freeze({ max: 100, unit: "utf16_code_units" }),
12032
+ cnblogs: Object.freeze({ max: 128, unit: "utf16_code_units" }),
12033
+ weibo: Object.freeze({ max: 30, unit: "utf16_code_units" }),
12034
+ sspai: Object.freeze({ max: 80, unit: "utf16_code_units" })
12035
+ }),
12036
+ shortVideo: Object.freeze({
12037
+ shipinhao: Object.freeze({ max: 16, unit: "utf16_code_units" }),
12038
+ douyin: Object.freeze({ max: 30, unit: "utf16_code_units" }),
12039
+ bilibili: Object.freeze({ max: 80, unit: "utf16_code_units" })
12040
+ })
12041
+ }),
12042
+ bodyCapabilities: Object.freeze({
12043
+ dynamic: Object.freeze({
12044
+ threads: Object.freeze({ max: 500, unit: "unicode_code_points", behavior: "split_thread" }),
12045
+ x: Object.freeze({ max: 280, unit: "weighted", behavior: "split_thread" }),
12046
+ weibo: Object.freeze({ max: 2000, unit: "unicode_code_points" }),
12047
+ jike: Object.freeze({ max: 1000, unit: "unicode_code_points" })
12048
+ }),
12049
+ imageText: Object.freeze({
12050
+ xiaohongshu: Object.freeze({ max: 1000, unit: "unicode_code_points" }),
12051
+ douyin: Object.freeze({ max: 1000, unit: "unicode_code_points" })
12052
+ }),
12053
+ article: Object.freeze({
12054
+ wechatmp: Object.freeze({ max: 50000, unit: "unicode_code_points" }),
12055
+ juejin: Object.freeze({ max: 50000, unit: "unicode_code_points" })
12056
+ }),
12057
+ shortVideo: Object.freeze({
12058
+ douyin: Object.freeze({ max: 1000, unit: "unicode_code_points" }),
12059
+ kuaishou: Object.freeze({ max: 1000, unit: "unicode_code_points" }),
12060
+ shipinhao: Object.freeze({ max: 1000, unit: "unicode_code_points" })
12061
+ })
12062
+ })
12063
+ });
11987
12064
  // ../../packages/kk-core/src/kinds.ts
11988
12065
  init_zod();
11989
12066
 
@@ -12074,6 +12151,67 @@ var BrowserSessionDescriptorSchema = object({
12074
12151
  }
12075
12152
  }).optional()
12076
12153
  }).strict();
12154
+ var ContentCountUnitSchema = _enum([
12155
+ "utf16_code_units",
12156
+ "unicode_code_points",
12157
+ "weighted",
12158
+ "xiaohongshu_title_weighted"
12159
+ ]);
12160
+ var LimitEntrySchema = object({
12161
+ max: number2().int().positive(),
12162
+ unit: ContentCountUnitSchema
12163
+ }).strict();
12164
+ var PublishingProfileLimitsSchema = object({
12165
+ title: LimitEntrySchema.optional(),
12166
+ body: LimitEntrySchema.optional()
12167
+ }).strict();
12168
+ var PublishingProfileRequiresSchema = object({
12169
+ cover: boolean2().optional(),
12170
+ orderedImages: boolean2().optional()
12171
+ }).strict();
12172
+ var PublishingProfileModeBindingSchema = object({
12173
+ metadata: record(string2(), unknown())
12174
+ }).strict();
12175
+ var PublishingProfileModesSchema = object({
12176
+ draft: PublishingProfileModeBindingSchema.optional(),
12177
+ live: PublishingProfileModeBindingSchema.optional()
12178
+ }).strict().superRefine((modes, ctx) => {
12179
+ if (modes.draft === undefined && modes.live === undefined) {
12180
+ ctx.addIssue({
12181
+ code: "custom",
12182
+ message: 'modes must define at least one of "draft" or "live"'
12183
+ });
12184
+ }
12185
+ });
12186
+ var PublishingProfileSchema = object({
12187
+ format: string2().min(1),
12188
+ locale: string2().regex(/^(source|[a-z]{2,3}(-[A-Za-z0-9]+)*)$/, {
12189
+ message: 'locale must be "source" or a valid language tag'
12190
+ }),
12191
+ limits: PublishingProfileLimitsSchema.optional(),
12192
+ requires: PublishingProfileRequiresSchema.optional(),
12193
+ modes: PublishingProfileModesSchema
12194
+ }).strict();
12195
+ var PublishingCapabilitiesSchema = object({
12196
+ defaultProfile: string2().min(1),
12197
+ profiles: record(string2().regex(/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/), PublishingProfileSchema)
12198
+ }).strict().superRefine((data, ctx) => {
12199
+ const keys = Object.keys(data.profiles);
12200
+ if (keys.length === 0) {
12201
+ ctx.addIssue({
12202
+ code: "custom",
12203
+ path: ["profiles"],
12204
+ message: "profiles record must be nonempty"
12205
+ });
12206
+ }
12207
+ if (!(data.defaultProfile in data.profiles)) {
12208
+ ctx.addIssue({
12209
+ code: "custom",
12210
+ path: ["defaultProfile"],
12211
+ message: `defaultProfile "${data.defaultProfile}" must reference a declared profile`
12212
+ });
12213
+ }
12214
+ });
12077
12215
  var PluginManifestSchemaBase = looseObject({
12078
12216
  name: string2().min(1),
12079
12217
  kind: PluginKindSchema,
@@ -12082,23 +12220,31 @@ var PluginManifestSchemaBase = looseObject({
12082
12220
  version: string2().optional(),
12083
12221
  description: string2().optional(),
12084
12222
  operations: record(string2(), PluginOperationSchema).optional(),
12085
- browserSession: BrowserSessionDescriptorSchema.optional()
12223
+ browserSession: BrowserSessionDescriptorSchema.optional(),
12224
+ publishing: PublishingCapabilitiesSchema.optional()
12086
12225
  });
12087
12226
  var PluginManifestSchema = PluginManifestSchemaBase.superRefine((manifest, ctx) => {
12088
- if (manifest.browserSession === undefined)
12089
- return;
12090
- if (manifest.kind !== "publish") {
12091
- ctx.addIssue({
12092
- code: "custom",
12093
- path: ["browserSession"],
12094
- message: `browserSession requires kind "publish", not "${manifest.kind}"`
12095
- });
12227
+ if (manifest.browserSession !== undefined) {
12228
+ if (manifest.kind !== "publish") {
12229
+ ctx.addIssue({
12230
+ code: "custom",
12231
+ path: ["browserSession"],
12232
+ message: `browserSession requires kind "publish", not "${manifest.kind}"`
12233
+ });
12234
+ }
12235
+ if (manifest.check === undefined) {
12236
+ ctx.addIssue({
12237
+ code: "custom",
12238
+ path: ["browserSession"],
12239
+ message: "browserSession requires a check probe entry that owns the session routines"
12240
+ });
12241
+ }
12096
12242
  }
12097
- if (manifest.check === undefined) {
12243
+ if (manifest.publishing !== undefined && manifest.kind !== "publish") {
12098
12244
  ctx.addIssue({
12099
12245
  code: "custom",
12100
- path: ["browserSession"],
12101
- message: "browserSession requires a check probe entry that owns the session routines"
12246
+ path: ["publishing"],
12247
+ message: `publishing requires kind "publish", not "${manifest.kind}"`
12102
12248
  });
12103
12249
  }
12104
12250
  });