@gobing-ai/knowledge-kit 0.0.35 → 0.0.36

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 (122) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/README.md +1 -1
  3. package/dist/board/collect/index.css +42 -0
  4. package/dist/board/collect/index.js +787 -0
  5. package/dist/board/daily-voice/index.css +13 -0
  6. package/dist/board/daily-voice/index.js +902 -0
  7. package/dist/board/itc/index.css +14 -0
  8. package/dist/board/itc/index.js +1026 -0
  9. package/dist/index.js +11768 -9249
  10. package/package.json +10 -9
  11. package/plugins/generations/content-gen/dist/index.js +1015 -10814
  12. package/plugins/generations/content-gen/package.json +1 -1
  13. package/plugins/generations/core-facts-gen/dist/index.js +1002 -10801
  14. package/plugins/generations/core-facts-gen/package.json +1 -1
  15. package/plugins/generations/daily-article-gen/dist/index.js +1004 -10803
  16. package/plugins/generations/daily-article-gen/package.json +1 -1
  17. package/plugins/generations/dailynews-gen/dist/index.js +1092 -10891
  18. package/plugins/generations/dailynews-gen/package.json +1 -1
  19. package/plugins/generations/episode-plan-gen/dist/index.js +1124 -10923
  20. package/plugins/generations/episode-plan-gen/package.json +1 -1
  21. package/plugins/generations/gemini-tts/dist/index.js +1104 -10903
  22. package/plugins/generations/gemini-tts/package.json +1 -1
  23. package/plugins/generations/image-gen/dist/index.js +1239 -11035
  24. package/plugins/generations/image-gen/package.json +1 -1
  25. package/plugins/generations/news-report-gen/dist/index.js +1048 -10847
  26. package/plugins/generations/news-report-gen/package.json +1 -1
  27. package/plugins/generations/voice-gen/dist/index.js +1062 -10861
  28. package/plugins/generations/voice-gen/package.json +1 -1
  29. package/plugins/generations/voxcpm-tts/README.md +72 -0
  30. package/plugins/generations/voxcpm-tts/dist/index.js +14006 -0
  31. package/plugins/generations/voxcpm-tts/package.json +16 -0
  32. package/plugins/generations/voxcpm-tts/plugin.json +6 -0
  33. package/plugins/generations/voxcpm-tts/profiles.json +10 -0
  34. package/plugins/generations/voxcpm-tts/pyproject.toml +9 -0
  35. package/plugins/generations/voxcpm-tts/python/worker.py +353 -0
  36. package/plugins/generations/voxcpm-tts/src/index.ts +42 -0
  37. package/plugins/generations/voxcpm-tts/src/voxcpm-client.ts +765 -0
  38. package/plugins/generations/voxcpm-tts/tsconfig.json +8 -0
  39. package/plugins/generations/voxcpm-tts/uv.lock +2571 -0
  40. package/plugins/ingestions/aihot-ingest/dist/index.js +1081 -10628
  41. package/plugins/ingestions/aihot-ingest/package.json +1 -1
  42. package/plugins/ingestions/horizon-ingest/dist/index.js +1013 -10812
  43. package/plugins/ingestions/horizon-ingest/package.json +1 -1
  44. package/plugins/ingestions/karakeep-local/dist/index.js +689 -10774
  45. package/plugins/ingestions/karakeep-local/package.json +1 -1
  46. package/plugins/ingestions/last30days-ingest/dist/index.js +1011 -10810
  47. package/plugins/ingestions/last30days-ingest/package.json +1 -1
  48. package/plugins/ingestions/web-search/dist/index.js +1250 -11033
  49. package/plugins/ingestions/web-search/package.json +1 -1
  50. package/plugins/kk/README.md +29 -2
  51. package/plugins/kk/plugin.json +1 -1
  52. package/plugins/kk/schedules/cron.tmpl +9 -1
  53. package/plugins/kk/schedules/kk-serve.launchd.plist.tmpl +79 -0
  54. package/plugins/kk/schedules/launchd.plist.tmpl +11 -1
  55. package/plugins/kk/scripts/daily-stages.ts +428 -46
  56. package/plugins/kk/scripts/kk-workflow-stages.ts +76 -146
  57. package/plugins/kk/skills/publish/SKILL.md +8 -4
  58. package/plugins/kk/workflows/feature-verification.yaml +93 -0
  59. package/plugins/kk/workflows/judge-gated-publish-example.yaml +1 -0
  60. package/plugins/kk/workflows/kk-collect.yaml +43 -11
  61. package/plugins/kk/workflows/kk-daily-ai-voice.yaml +4 -2
  62. package/plugins/kk/workflows/kk-daily-ai-voice2.yaml +86 -15
  63. package/plugins/kk/workflows/kk-daily-safety.yaml +15 -2
  64. package/plugins/kk/workflows/kk-itc.yaml +8 -1
  65. package/plugins/kk/workflows/kk-solo-podcast.yaml +2 -0
  66. package/plugins/publishings/emdash-pub/dist/index.js +987 -10814
  67. package/plugins/publishings/emdash-pub/package.json +1 -1
  68. package/plugins/publishings/infoq-pub/dist/index.js +1928 -11444
  69. package/plugins/publishings/infoq-pub/dist/profile-check.js +1677 -11199
  70. package/plugins/publishings/infoq-pub/package.json +1 -1
  71. package/plugins/publishings/infoq-pub/plugin.json +5 -1
  72. package/plugins/publishings/juejin-pub/dist/index.js +1940 -11456
  73. package/plugins/publishings/juejin-pub/dist/profile-check.js +1677 -11199
  74. package/plugins/publishings/juejin-pub/package.json +1 -1
  75. package/plugins/publishings/juejin-pub/plugin.json +5 -1
  76. package/plugins/publishings/medium-pub/dist/index.js +978 -10805
  77. package/plugins/publishings/medium-pub/package.json +1 -1
  78. package/plugins/publishings/podcast-pub/dist/index.js +1016 -10843
  79. package/plugins/publishings/podcast-pub/package.json +1 -1
  80. package/plugins/publishings/qiita-pub/dist/index.js +976 -10803
  81. package/plugins/publishings/qiita-pub/package.json +1 -1
  82. package/plugins/publishings/substack-pub/dist/index.js +1932 -11448
  83. package/plugins/publishings/substack-pub/dist/profile-check.js +1698 -11200
  84. package/plugins/publishings/substack-pub/package.json +1 -1
  85. package/plugins/publishings/substack-pub/plugin.json +4 -1
  86. package/plugins/publishings/substack-pub/src/profile-check.ts +36 -3
  87. package/plugins/publishings/surfdash-pub/dist/index.js +1151 -10834
  88. package/plugins/publishings/surfdash-pub/package.json +1 -1
  89. package/plugins/publishings/surfdash-pub/src/index.ts +137 -15
  90. package/plugins/publishings/surfdash-pub/src/patch.ts +144 -0
  91. package/plugins/publishings/threads-pub/dist/index.js +12394 -0
  92. package/plugins/publishings/threads-pub/package.json +17 -0
  93. package/plugins/publishings/threads-pub/plugin.json +7 -0
  94. package/plugins/publishings/threads-pub/src/index.ts +340 -0
  95. package/plugins/publishings/threads-pub/tsconfig.json +4 -0
  96. package/plugins/publishings/wechatmp-pub/dist/index.js +2508 -11695
  97. package/plugins/publishings/wechatmp-pub/dist/profile-check.js +1656 -11188
  98. package/plugins/publishings/wechatmp-pub/package.json +1 -1
  99. package/plugins/publishings/wechatmp-pub/plugin.json +5 -1
  100. package/plugins/publishings/wechatmp-pub/src/enrich.ts +244 -71
  101. package/plugins/publishings/wechatmp-pub/src/flow.ts +412 -96
  102. package/plugins/publishings/wechatmp-pub/src/index.ts +24 -3
  103. package/plugins/publishings/wechatmp-pub/src/page.ts +16 -0
  104. package/plugins/publishings/wechatmp-pub/src/profile-check.ts +40 -4
  105. package/plugins/publishings/weibo-pub/dist/index.js +21345 -0
  106. package/plugins/publishings/weibo-pub/dist/profile-check.js +20817 -0
  107. package/plugins/publishings/weibo-pub/package.json +19 -0
  108. package/plugins/publishings/weibo-pub/plugin.json +12 -0
  109. package/plugins/publishings/weibo-pub/src/index.ts +868 -0
  110. package/plugins/publishings/weibo-pub/src/profile-check.ts +20 -0
  111. package/plugins/publishings/weibo-pub/tsconfig.json +4 -0
  112. package/plugins/publishings/x-pub/dist/index.js +1948 -11440
  113. package/plugins/publishings/x-pub/dist/profile-check.js +1677 -11199
  114. package/plugins/publishings/x-pub/package.json +1 -1
  115. package/plugins/publishings/x-pub/plugin.json +5 -1
  116. package/plugins/publishings/xhs-pub/dist/index.js +1993 -11509
  117. package/plugins/publishings/xhs-pub/dist/profile-check.js +1697 -11212
  118. package/plugins/publishings/xhs-pub/package.json +1 -1
  119. package/plugins/publishings/xhs-pub/plugin.json +5 -1
  120. package/plugins/publishings/xhs-pub/src/profile-check.ts +72 -2
  121. package/plugins/publishings/zenn-pub/dist/index.js +988 -10815
  122. package/plugins/publishings/zenn-pub/package.json +1 -1
@@ -14,6 +14,6 @@
14
14
  "playwright": "catalog:"
15
15
  },
16
16
  "devDependencies": {
17
- "@types/bun": "1.3.14"
17
+ "@types/bun": "1.4.3"
18
18
  }
19
19
  }
@@ -4,5 +4,9 @@
4
4
  "entry": "./dist/index.js",
5
5
  "check": "./dist/profile-check.js",
6
6
  "version": "1.0.0",
7
- "description": "Publish plugin for Xiaohongshu (xhs): one creator console, four validated operations (上传图文 ≤18 images | 上传视频 | 写长文 | 发播客 audio+cover) saved as a draft via 暂存离开 or published live via 发布, over the Playwright script transport"
7
+ "description": "Publish plugin for Xiaohongshu (xhs): one creator console, four validated operations (上传图文 ≤18 images | 上传视频 | 写长文 | 发播客 audio+cover) saved as a draft via 暂存离开 or published live via 发布, over the Playwright script transport",
8
+ "browserSession": {
9
+ "profileName": "xhs",
10
+ "homeUrl": "https://creator.xiaohongshu.com/publish/publish"
11
+ }
8
12
  }
@@ -21,9 +21,11 @@
21
21
  * `bun plugins/publishings/xhs-pub/src/profile-check.ts check` on the same profile;
22
22
  * the full recipe lives in docs/design/xhs-image-cards.md.
23
23
  */
24
+
24
25
  import { parseArgs } from 'node:util';
25
26
  import { kkBrowserLauncher, resolveChannelProfileDir } from '@gobing-ai/publish-harness/browser';
26
- import { type BrowserLauncher, loginWithProfile } from '@gobing-ai/ts-browser-automation';
27
+ import { type BrowserLauncher, loginWithProfile, openPersistentBrowser } from '@gobing-ai/ts-browser-automation';
28
+ import { createNodeFileSystem } from '@gobing-ai/ts-runtime';
27
29
  import { echo, echoError } from '@gobing-ai/ts-utils';
28
30
  import { type AutomationGuard, createAutomationGuard } from './automation-guard';
29
31
  import {
@@ -68,12 +70,50 @@ export async function loginProfile(opts: ProfileLoginOptions): Promise<void> {
68
70
  /** Exit 2 with the human usage on stderr and the ADR-032 `error` verdict as the last stdout line. */
69
71
  function usageError(message: string): number {
70
72
  echoError(
71
- `profile-check: ${message} — usage: profile-check.ts [login|check] [--profile <dir>] [--timeout <ms>] [--headed]`,
73
+ `profile-check: ${message} — usage: profile-check.ts [login|check|open] [--profile <dir>] [--url <url>] [--timeout <ms>] [--headed]`,
72
74
  );
73
75
  echo(JSON.stringify({ status: 'error', detail: message }));
74
76
  return 2;
75
77
  }
76
78
 
79
+ /**
80
+ * Bot-mode open (0277): headed, operator-interactive reopen of an existing profile — no readiness
81
+ * assertion and no automation-guard record (an open is neither a publish nor a check visit, so it
82
+ * draws no 2h budget, ADR-025). A missing profile is refused: nothing is fabricated.
83
+ */
84
+ export async function openXhsSession(opts: {
85
+ profileDir: string;
86
+ url?: string;
87
+ launcher?: BrowserLauncher;
88
+ }): Promise<void> {
89
+ if (!(await createNodeFileSystem().exists(opts.profileDir))) {
90
+ throw new Error(`no profile at ${opts.profileDir} — run the login command first`);
91
+ }
92
+ const raw = await openPersistentBrowser({
93
+ profileDir: opts.profileDir,
94
+ headless: false,
95
+ launcher: opts.launcher ?? kkBrowserLauncher,
96
+ });
97
+ // Structural seam (same pattern as makeDefaultOpenPage): this plugin's tsconfig has no DOM lib
98
+ // and its playwright resolution differs from the harness', so only the touched surface is named.
99
+ const context = raw as unknown as {
100
+ pages(): unknown[];
101
+ newPage(): Promise<unknown>;
102
+ once(event: 'close', listener: () => void): unknown;
103
+ };
104
+ const page = (context.pages()[0] ?? (await context.newPage())) as {
105
+ goto(url: string, options?: { waitUntil: 'commit'; timeout: number }): Promise<unknown>;
106
+ };
107
+ try {
108
+ await page.goto(opts.url ?? PUBLISH_URL, { waitUntil: 'commit', timeout: 30_000 });
109
+ } catch {
110
+ // The operator is watching the window; keep it open even if the target is slow.
111
+ }
112
+ await new Promise<void>((resolveClose) => {
113
+ context.once('close', resolveClose);
114
+ });
115
+ }
116
+
77
117
  /** `login|check [--profile <dir>] [--timeout <ms>] [--headed]`; profile precedence matches the publish flow. */
78
118
  export async function main(
79
119
  argv: string[] = process.argv.slice(2),
@@ -84,6 +124,7 @@ export async function main(
84
124
  let profileDir: string;
85
125
  let timeoutMs: number | undefined;
86
126
  let headed = false;
127
+ let sessionUrl: string | undefined;
87
128
  try {
88
129
  const { positionals, values } = parseArgs({
89
130
  args: argv,
@@ -92,10 +133,15 @@ export async function main(
92
133
  profile: { type: 'string' },
93
134
  timeout: { type: 'string' },
94
135
  headed: { type: 'boolean' },
136
+ url: { type: 'string' },
95
137
  },
96
138
  });
97
139
  command = positionals[0] ?? 'check';
98
140
  headed = values.headed === true;
141
+ if (command === 'open' && values.profile === undefined) {
142
+ throw new Error('open requires an explicit --profile <dir>');
143
+ }
144
+ sessionUrl = values.url;
99
145
  if (values.timeout !== undefined) {
100
146
  timeoutMs = Number(values.timeout);
101
147
  if (!Number.isFinite(timeoutMs) || timeoutMs < 0) {
@@ -110,12 +156,36 @@ export async function main(
110
156
  try {
111
157
  await loginProfile({ profileDir, timeoutMs, launcher });
112
158
  echo(`xhs profile login verified: ${profileDir}`);
159
+ // Bot mode (`kk bot login` supplies --url): the parent persists a default URL only from
160
+ // this LAST-line verdict, and only the plugin-owned creator console is canonical — never
161
+ // the operator's URL. Without --url the operator-mode output stands unchanged.
162
+ if (sessionUrl !== undefined) {
163
+ echo(JSON.stringify({ status: 'verified', profileDir, defaultUrl: PUBLISH_URL }));
164
+ }
113
165
  return 0;
114
166
  } catch (error) {
115
167
  echoError(`xhs profile login failed: ${error instanceof Error ? error.message : String(error)}`);
116
168
  return 1;
117
169
  }
118
170
  }
171
+ if (command === 'open') {
172
+ try {
173
+ await openXhsSession({ profileDir, url: sessionUrl, launcher });
174
+ } catch (error) {
175
+ const detail = `xhs profile open refused: ${error instanceof Error ? error.message : String(error)}`;
176
+ echoError(detail);
177
+ echo(JSON.stringify({ status: 'refused', profileDir, detail }));
178
+ return 1;
179
+ }
180
+ echo(
181
+ JSON.stringify({
182
+ status: 'verified',
183
+ profileDir,
184
+ detail: `xhs profile session closed by the operator: ${profileDir}`,
185
+ }),
186
+ );
187
+ return 0;
188
+ }
119
189
  if (command !== 'check') {
120
190
  return usageError(`unknown command '${command}'`);
121
191
  }