@gobing-ai/knowledge-kit 0.1.27 → 0.1.28

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 (53) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/board/collect/index.js +10 -0
  3. package/dist/board/daily-voice/index.js +1327 -2168
  4. package/dist/board/itc/index.js +10 -0
  5. package/dist/index.js +5980 -4651
  6. package/package.json +1 -1
  7. package/plugins/ingestions/aihot-ingest/dist/index.js +4 -1
  8. package/plugins/ingestions/aihot-ingest/src/rss.ts +22 -11
  9. package/plugins/kk/plugin.json +1 -1
  10. package/plugins/kk/scripts/daily-stages.ts +7 -7
  11. package/plugins/kk/workflows/kk-news-generate.yaml +1 -1
  12. package/plugins/publishings/bilibili-pub/dist/index.js +81 -80
  13. package/plugins/publishings/bilibili-pub/dist/profile-check.js +1 -1
  14. package/plugins/publishings/cnblogs-pub/dist/index.js +81 -80
  15. package/plugins/publishings/cnblogs-pub/dist/profile-check.js +1 -1
  16. package/plugins/publishings/csdn-pub/dist/index.js +81 -80
  17. package/plugins/publishings/csdn-pub/dist/profile-check.js +1 -1
  18. package/plugins/publishings/infoq-pub/dist/index.js +81 -80
  19. package/plugins/publishings/infoq-pub/dist/profile-check.js +1 -1
  20. package/plugins/publishings/jike-pub/dist/index.js +81 -80
  21. package/plugins/publishings/jike-pub/dist/profile-check.js +1 -1
  22. package/plugins/publishings/juejin-pub/dist/index.js +81 -80
  23. package/plugins/publishings/juejin-pub/dist/profile-check.js +1 -1
  24. package/plugins/publishings/linkedin-pub/dist/index.js +81 -80
  25. package/plugins/publishings/linkedin-pub/dist/profile-check.js +1 -1
  26. package/plugins/publishings/medium-pub/dist/index.js +81 -80
  27. package/plugins/publishings/medium-pub/dist/profile-check.js +1 -1
  28. package/plugins/publishings/shipinhao-pub/dist/index.js +272 -85
  29. package/plugins/publishings/shipinhao-pub/dist/profile-check.js +112 -3
  30. package/plugins/publishings/shipinhao-pub/src/cover-crop.ts +60 -0
  31. package/plugins/publishings/shipinhao-pub/src/flow.ts +15 -2
  32. package/plugins/publishings/shipinhao-pub/src/profile-check.ts +15 -12
  33. package/plugins/publishings/shipinhao-pub/src/selectors.ts +22 -1
  34. package/plugins/publishings/sspai-pub/dist/index.js +81 -80
  35. package/plugins/publishings/sspai-pub/dist/profile-check.js +1 -1
  36. package/plugins/publishings/substack-pub/dist/index.js +81 -80
  37. package/plugins/publishings/substack-pub/dist/profile-check.js +1 -1
  38. package/plugins/publishings/surfdash-pub/dist/index.js +43 -5
  39. package/plugins/publishings/threads-pub/dist/index.js +86 -81
  40. package/plugins/publishings/threads-pub/dist/profile-check.js +1 -1
  41. package/plugins/publishings/threads-pub/src/index.ts +10 -0
  42. package/plugins/publishings/wechatmp-pub/dist/index.js +84 -83
  43. package/plugins/publishings/wechatmp-pub/dist/profile-check.js +1 -1
  44. package/plugins/publishings/weibo-pub/dist/index.js +217 -83
  45. package/plugins/publishings/weibo-pub/dist/profile-check.js +123 -3
  46. package/plugins/publishings/weibo-pub/src/index.ts +60 -2
  47. package/plugins/publishings/weibo-pub/src/profile-check.ts +4 -2
  48. package/plugins/publishings/x-pub/dist/index.js +81 -80
  49. package/plugins/publishings/x-pub/dist/profile-check.js +1 -1
  50. package/plugins/publishings/xhs-pub/dist/index.js +81 -80
  51. package/plugins/publishings/xhs-pub/dist/profile-check.js +1 -1
  52. package/plugins/publishings/xiaoyuzhou-pub/dist/index.js +81 -80
  53. package/plugins/publishings/xiaoyuzhou-pub/dist/profile-check.js +1 -1
@@ -20171,6 +20171,86 @@ var ATTACHED_CLOSERS = new Set(["\u201D", "\u2019", "\u300D", "\u300F", "\uFF09"
20171
20171
  import { homedir } from "os";
20172
20172
  import { join, resolve } from "path";
20173
20173
 
20174
+ // ../../packages/publish-harness/src/bot-fs.ts
20175
+ import {
20176
+ chmodSync,
20177
+ closeSync,
20178
+ copyFileSync,
20179
+ lstatSync,
20180
+ mkdirSync as mkdirSync2,
20181
+ openSync,
20182
+ readdirSync as readdirSync2,
20183
+ readlinkSync,
20184
+ realpathSync as realpathSync2,
20185
+ renameSync as renameSync2,
20186
+ rmdirSync,
20187
+ unlinkSync
20188
+ } from "fs";
20189
+ function lstat(path) {
20190
+ try {
20191
+ return lstatSync(path);
20192
+ } catch (error) {
20193
+ if (error.code === "ENOENT")
20194
+ return null;
20195
+ throw error;
20196
+ }
20197
+ }
20198
+ function realpath(path) {
20199
+ return realpathSync2(path);
20200
+ }
20201
+ function mkdirExclusive(path, mode = 448) {
20202
+ try {
20203
+ mkdirSync2(path, { mode });
20204
+ return true;
20205
+ } catch (error) {
20206
+ if (error.code === "EEXIST")
20207
+ return false;
20208
+ throw error;
20209
+ }
20210
+ }
20211
+ function rmdir(path) {
20212
+ try {
20213
+ rmdirSync(path);
20214
+ return true;
20215
+ } catch (error) {
20216
+ const code = error.code;
20217
+ if (code === "ENOENT" || code === "ENOTEMPTY" || code === "EEXIST")
20218
+ return false;
20219
+ throw error;
20220
+ }
20221
+ }
20222
+ function readlink(path) {
20223
+ try {
20224
+ return readlinkSync(path);
20225
+ } catch {
20226
+ return null;
20227
+ }
20228
+ }
20229
+ function unlink(path) {
20230
+ try {
20231
+ unlinkSync(path);
20232
+ return true;
20233
+ } catch (error) {
20234
+ if (error.code === "ENOENT")
20235
+ return false;
20236
+ throw error;
20237
+ }
20238
+ }
20239
+ function rename(from, to) {
20240
+ try {
20241
+ renameSync2(from, to);
20242
+ return true;
20243
+ } catch (error) {
20244
+ if (error.code === "ENOENT")
20245
+ return false;
20246
+ throw error;
20247
+ }
20248
+ }
20249
+ function chmod(path, mode) {
20250
+ chmodSync(path, mode);
20251
+ }
20252
+
20253
+ // ../../packages/publish-harness/src/index.ts
20174
20254
  class FakeTransportCore {
20175
20255
  callLogs = [];
20176
20256
  nextResult;
@@ -20457,85 +20537,6 @@ init_dist();
20457
20537
  import { homedir as homedir4 } from "os";
20458
20538
  import { isAbsolute, join as join4, relative, resolve as resolve4, sep } from "path";
20459
20539
 
20460
- // ../../packages/publish-harness/src/bot-fs.ts
20461
- import {
20462
- chmodSync,
20463
- closeSync,
20464
- copyFileSync,
20465
- lstatSync,
20466
- mkdirSync as mkdirSync2,
20467
- openSync,
20468
- readdirSync as readdirSync2,
20469
- readlinkSync,
20470
- realpathSync as realpathSync2,
20471
- renameSync as renameSync2,
20472
- rmdirSync,
20473
- unlinkSync
20474
- } from "fs";
20475
- function lstat(path) {
20476
- try {
20477
- return lstatSync(path);
20478
- } catch (error) {
20479
- if (error.code === "ENOENT")
20480
- return null;
20481
- throw error;
20482
- }
20483
- }
20484
- function realpath(path) {
20485
- return realpathSync2(path);
20486
- }
20487
- function mkdirExclusive(path, mode = 448) {
20488
- try {
20489
- mkdirSync2(path, { mode });
20490
- return true;
20491
- } catch (error) {
20492
- if (error.code === "EEXIST")
20493
- return false;
20494
- throw error;
20495
- }
20496
- }
20497
- function rmdir(path) {
20498
- try {
20499
- rmdirSync(path);
20500
- return true;
20501
- } catch (error) {
20502
- const code = error.code;
20503
- if (code === "ENOENT" || code === "ENOTEMPTY" || code === "EEXIST")
20504
- return false;
20505
- throw error;
20506
- }
20507
- }
20508
- function readlink(path) {
20509
- try {
20510
- return readlinkSync(path);
20511
- } catch {
20512
- return null;
20513
- }
20514
- }
20515
- function unlink(path) {
20516
- try {
20517
- unlinkSync(path);
20518
- return true;
20519
- } catch (error) {
20520
- if (error.code === "ENOENT")
20521
- return false;
20522
- throw error;
20523
- }
20524
- }
20525
- function rename(from, to) {
20526
- try {
20527
- renameSync2(from, to);
20528
- return true;
20529
- } catch (error) {
20530
- if (error.code === "ENOENT")
20531
- return false;
20532
- throw error;
20533
- }
20534
- }
20535
- function chmod(path, mode) {
20536
- chmodSync(path, mode);
20537
- }
20538
-
20539
20540
  // ../../packages/publish-harness/src/bot-transaction.ts
20540
20541
  import { homedir as homedir2 } from "os";
20541
20542
  import { dirname as dirname2, join as join2, resolve as resolve2 } from "path";
@@ -20835,7 +20836,7 @@ function quarantineProfileSyncData(profileDir) {
20835
20836
  const syncData = join5(profileDir, "Default", "Sync Data");
20836
20837
  if (lstat(syncData) === null)
20837
20838
  return false;
20838
- return rename(syncData, `${syncData}.broken-${new Date().toISOString().replace(/[:.]/g, "").slice(0, 15)}`);
20839
+ return rename(syncData, `${syncData}.broken-${new Date().toISOString().replace(/[:.]/g, "").slice(0, 17)}`);
20839
20840
  }
20840
20841
  function createKkBrowserLauncher(loadPlaywright = () => import("playwright"), ownership, leaseOptions = {}) {
20841
20842
  return {
@@ -21308,6 +21309,8 @@ var TARGET2 = "threads";
21308
21309
  var THREADS_API_BASE = "https://graph.threads.net/v1.0";
21309
21310
  var TOKEN_ENVS = ["THREADS_ACCESS_TOKEN", "THREADS_USER_ID"];
21310
21311
  var MAX_TEXT_CHARS = 500;
21312
+ var FIRST_URL_RE = /https?:\/\/[^\s<>"'`]+/;
21313
+ var TRAILING_PUNCT_RE = /[),.;:!?\uFF0C\u3002\uFF1B\uFF1A\uFF01\uFF1F\uFF09\u300B\u300D\u300F]+$/;
21311
21314
  var THREADS_OPERATIONS = ["post"];
21312
21315
  function redact(message) {
21313
21316
  let out = message;
@@ -21412,10 +21415,12 @@ class ThreadsPostApiTransport {
21412
21415
  }
21413
21416
  const token = process.env.THREADS_ACCESS_TOKEN ?? "";
21414
21417
  const userId = process.env.THREADS_USER_ID ?? "";
21418
+ const linkUrl = text.match(FIRST_URL_RE)?.[0]?.replace(TRAILING_PUNCT_RE, "");
21415
21419
  const container = await this.postForm("threads container", `${THREADS_API_BASE}/${userId}/threads`, {
21416
21420
  media_type: "TEXT",
21417
21421
  text,
21418
- access_token: token
21422
+ access_token: token,
21423
+ ...linkUrl === undefined || linkUrl.length === 0 ? {} : { link_attachment: linkUrl }
21419
21424
  });
21420
21425
  if ("error" in container)
21421
21426
  return fail2(container.error);
@@ -20537,7 +20537,7 @@ function quarantineProfileSyncData(profileDir) {
20537
20537
  const syncData = join5(profileDir, "Default", "Sync Data");
20538
20538
  if (lstat(syncData) === null)
20539
20539
  return false;
20540
- return rename(syncData, `${syncData}.broken-${new Date().toISOString().replace(/[:.]/g, "").slice(0, 15)}`);
20540
+ return rename(syncData, `${syncData}.broken-${new Date().toISOString().replace(/[:.]/g, "").slice(0, 17)}`);
20541
20541
  }
20542
20542
  function createKkBrowserLauncher(loadPlaywright = () => import("playwright"), ownership, leaseOptions = {}) {
20543
20543
  return {
@@ -22,6 +22,10 @@ const TOKEN_ENVS = ['THREADS_ACCESS_TOKEN', 'THREADS_USER_ID'] as const;
22
22
  */
23
23
  const MAX_TEXT_CHARS = 500;
24
24
 
25
+ /** The first http(s) URL in the copy, and the punctuation that ends a sentence rather than a link. */
26
+ const FIRST_URL_RE = /https?:\/\/[^\s<>"'`]+/;
27
+ const TRAILING_PUNCT_RE = /[),.;:!?,。;:!?)》」』]+$/;
28
+
25
29
  /** Declared operations (ADR-029 dispatch): threads-pub posts text only. */
26
30
  export const THREADS_OPERATIONS = ['post'] as const;
27
31
  export type ThreadsOperation = (typeof THREADS_OPERATIONS)[number];
@@ -184,10 +188,16 @@ export class ThreadsPostApiTransport implements PublishTransport {
184
188
 
185
189
  const token = process.env.THREADS_ACCESS_TOKEN ?? '';
186
190
  const userId = process.env.THREADS_USER_ID ?? '';
191
+ // Meta's opt-in card parameter. Passing it makes the preview deterministic: the implicit
192
+ // "first URL in the text becomes the card" rule did not fire for our `…完整节目:<url>` copy
193
+ // (measured 2026-11-25 — Threads stored `link_preview_attachment: null` and rendered a bare
194
+ // link, while the identical text carded on X and the page's og:* tags were crawler-clean).
195
+ const linkUrl = text.match(FIRST_URL_RE)?.[0]?.replace(TRAILING_PUNCT_RE, '');
187
196
  const container = await this.postForm('threads container', `${THREADS_API_BASE}/${userId}/threads`, {
188
197
  media_type: 'TEXT',
189
198
  text,
190
199
  access_token: token,
200
+ ...(linkUrl === undefined || linkUrl.length === 0 ? {} : { link_attachment: linkUrl }),
191
201
  });
192
202
  if ('error' in container) return fail(container.error);
193
203
 
@@ -20174,6 +20174,89 @@ var ATTACHED_CLOSERS = new Set(["\u201D", "\u2019", "\u300D", "\u300F", "\uFF09"
20174
20174
  import { homedir } from "os";
20175
20175
  import { join, resolve } from "path";
20176
20176
 
20177
+ // ../../packages/publish-harness/src/bot-fs.ts
20178
+ import {
20179
+ chmodSync,
20180
+ closeSync,
20181
+ copyFileSync,
20182
+ lstatSync,
20183
+ mkdirSync as mkdirSync2,
20184
+ openSync,
20185
+ readdirSync as readdirSync2,
20186
+ readlinkSync,
20187
+ realpathSync as realpathSync2,
20188
+ renameSync as renameSync2,
20189
+ rmdirSync,
20190
+ unlinkSync
20191
+ } from "fs";
20192
+ function lstat(path) {
20193
+ try {
20194
+ return lstatSync(path);
20195
+ } catch (error) {
20196
+ if (error.code === "ENOENT")
20197
+ return null;
20198
+ throw error;
20199
+ }
20200
+ }
20201
+ function realpath(path) {
20202
+ return realpathSync2(path);
20203
+ }
20204
+ function mkdirExclusive(path, mode = 448) {
20205
+ try {
20206
+ mkdirSync2(path, { mode });
20207
+ return true;
20208
+ } catch (error) {
20209
+ if (error.code === "EEXIST")
20210
+ return false;
20211
+ throw error;
20212
+ }
20213
+ }
20214
+ function rmdir(path) {
20215
+ try {
20216
+ rmdirSync(path);
20217
+ return true;
20218
+ } catch (error) {
20219
+ const code = error.code;
20220
+ if (code === "ENOENT" || code === "ENOTEMPTY" || code === "EEXIST")
20221
+ return false;
20222
+ throw error;
20223
+ }
20224
+ }
20225
+ function readlink(path) {
20226
+ try {
20227
+ return readlinkSync(path);
20228
+ } catch {
20229
+ return null;
20230
+ }
20231
+ }
20232
+ function unlink(path) {
20233
+ try {
20234
+ unlinkSync(path);
20235
+ return true;
20236
+ } catch (error) {
20237
+ if (error.code === "ENOENT")
20238
+ return false;
20239
+ throw error;
20240
+ }
20241
+ }
20242
+ function rename(from, to) {
20243
+ try {
20244
+ renameSync2(from, to);
20245
+ return true;
20246
+ } catch (error) {
20247
+ if (error.code === "ENOENT")
20248
+ return false;
20249
+ throw error;
20250
+ }
20251
+ }
20252
+ function chmod(path, mode) {
20253
+ chmodSync(path, mode);
20254
+ }
20255
+ function createExclusiveFile(path) {
20256
+ closeSync(openSync(path, "wx", 384));
20257
+ }
20258
+
20259
+ // ../../packages/publish-harness/src/index.ts
20177
20260
  class FakeTransportCore {
20178
20261
  callLogs = [];
20179
20262
  nextResult;
@@ -20476,88 +20559,6 @@ init_dist();
20476
20559
  import { homedir as homedir4 } from "os";
20477
20560
  import { isAbsolute, join as join4, relative, resolve as resolve4, sep } from "path";
20478
20561
 
20479
- // ../../packages/publish-harness/src/bot-fs.ts
20480
- import {
20481
- chmodSync,
20482
- closeSync,
20483
- copyFileSync,
20484
- lstatSync,
20485
- mkdirSync as mkdirSync2,
20486
- openSync,
20487
- readdirSync as readdirSync2,
20488
- readlinkSync,
20489
- realpathSync as realpathSync2,
20490
- renameSync as renameSync2,
20491
- rmdirSync,
20492
- unlinkSync
20493
- } from "fs";
20494
- function lstat(path) {
20495
- try {
20496
- return lstatSync(path);
20497
- } catch (error) {
20498
- if (error.code === "ENOENT")
20499
- return null;
20500
- throw error;
20501
- }
20502
- }
20503
- function realpath(path) {
20504
- return realpathSync2(path);
20505
- }
20506
- function mkdirExclusive(path, mode = 448) {
20507
- try {
20508
- mkdirSync2(path, { mode });
20509
- return true;
20510
- } catch (error) {
20511
- if (error.code === "EEXIST")
20512
- return false;
20513
- throw error;
20514
- }
20515
- }
20516
- function rmdir(path) {
20517
- try {
20518
- rmdirSync(path);
20519
- return true;
20520
- } catch (error) {
20521
- const code = error.code;
20522
- if (code === "ENOENT" || code === "ENOTEMPTY" || code === "EEXIST")
20523
- return false;
20524
- throw error;
20525
- }
20526
- }
20527
- function readlink(path) {
20528
- try {
20529
- return readlinkSync(path);
20530
- } catch {
20531
- return null;
20532
- }
20533
- }
20534
- function unlink(path) {
20535
- try {
20536
- unlinkSync(path);
20537
- return true;
20538
- } catch (error) {
20539
- if (error.code === "ENOENT")
20540
- return false;
20541
- throw error;
20542
- }
20543
- }
20544
- function rename(from, to) {
20545
- try {
20546
- renameSync2(from, to);
20547
- return true;
20548
- } catch (error) {
20549
- if (error.code === "ENOENT")
20550
- return false;
20551
- throw error;
20552
- }
20553
- }
20554
- function chmod(path, mode) {
20555
- chmodSync(path, mode);
20556
- }
20557
- function createExclusiveFile(path) {
20558
- closeSync(openSync(path, "wx", 384));
20559
- }
20560
-
20561
20562
  // ../../packages/publish-harness/src/bot-transaction.ts
20562
20563
  import { homedir as homedir2 } from "os";
20563
20564
  import { dirname as dirname2, join as join2, resolve as resolve2 } from "path";
@@ -20867,7 +20868,7 @@ function quarantineProfileSyncData(profileDir) {
20867
20868
  const syncData = join5(profileDir, "Default", "Sync Data");
20868
20869
  if (lstat(syncData) === null)
20869
20870
  return false;
20870
- return rename(syncData, `${syncData}.broken-${new Date().toISOString().replace(/[:.]/g, "").slice(0, 15)}`);
20871
+ return rename(syncData, `${syncData}.broken-${new Date().toISOString().replace(/[:.]/g, "").slice(0, 17)}`);
20871
20872
  }
20872
20873
  function createKkBrowserLauncher(loadPlaywright = () => import("playwright"), ownership, leaseOptions = {}) {
20873
20874
  return {
@@ -20528,7 +20528,7 @@ function quarantineProfileSyncData(profileDir) {
20528
20528
  const syncData = join5(profileDir, "Default", "Sync Data");
20529
20529
  if (lstat(syncData) === null)
20530
20530
  return false;
20531
- return rename(syncData, `${syncData}.broken-${new Date().toISOString().replace(/[:.]/g, "").slice(0, 15)}`);
20531
+ return rename(syncData, `${syncData}.broken-${new Date().toISOString().replace(/[:.]/g, "").slice(0, 17)}`);
20532
20532
  }
20533
20533
  function createKkBrowserLauncher(loadPlaywright = () => import("playwright"), ownership, leaseOptions = {}) {
20534
20534
  return {