@gobing-ai/knowledge-kit 0.1.19 → 0.1.20

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 (54) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/board/daily-voice/index.js +40 -7
  3. package/dist/index.js +1379 -378
  4. package/package.json +1 -1
  5. package/plugins/generations/image-gen/README.md +31 -31
  6. package/plugins/generations/image-gen/assets/sample/provenance.json +314 -0
  7. package/plugins/generations/image-gen/config.example.yaml +3 -0
  8. package/plugins/generations/image-gen/dist/index.js +154 -14
  9. package/plugins/generations/image-gen/presets/SOURCE.md +65 -0
  10. package/plugins/generations/image-gen/scripts/eval-style-presets.ts +513 -0
  11. package/plugins/generations/image-gen/scripts/gen-samples.ts +57 -7
  12. package/plugins/generations/image-gen/src/presets.ts +6 -5
  13. package/plugins/generations/image-gen/src/providers/h3-local.ts +196 -0
  14. package/plugins/generations/image-gen/src/providers/types.ts +11 -1
  15. package/plugins/kk/config.example.yaml +3 -0
  16. package/plugins/kk/decisions/extract/ai-news.yaml +5 -2
  17. package/plugins/kk/plugin.json +1 -1
  18. package/plugins/kk/publish-presets/daily-ai-voice.json +48 -7
  19. package/plugins/kk/scripts/daily-stages.ts +238 -14
  20. package/plugins/kk/skills/image-authoring/SKILL.md +7 -3
  21. package/plugins/kk/skills/image-authoring/references/providers.md +27 -0
  22. package/plugins/kk/skills/image-authoring/references/style-extraction.md +1 -1
  23. package/plugins/kk/skills/publish/SKILL.md +11 -0
  24. package/plugins/kk/skills/web-automation/SKILL.md +31 -1
  25. package/plugins/kk/workflows/kk-collect.yaml +8 -4
  26. package/plugins/kk/workflows/kk-daily-ai-voice.yaml +2 -1
  27. package/plugins/kk/workflows/kk-daily-ai-voice2.yaml +4 -2
  28. package/plugins/publishings/linkedin-pub/dist/index.js +43 -6
  29. package/plugins/publishings/linkedin-pub/dist/profile-check.js +32 -5
  30. package/plugins/publishings/linkedin-pub/src/index.ts +52 -6
  31. package/plugins/publishings/shipinhao-pub/dist/index.js +385 -31
  32. package/plugins/publishings/shipinhao-pub/dist/profile-check.js +3 -1
  33. package/plugins/publishings/shipinhao-pub/plugin.json +1 -1
  34. package/plugins/publishings/shipinhao-pub/src/audio-flow.ts +393 -0
  35. package/plugins/publishings/shipinhao-pub/src/flow.ts +227 -12
  36. package/plugins/publishings/shipinhao-pub/src/selectors.ts +13 -0
  37. package/plugins/publishings/surfdash-pub/dist/index.js +50 -8
  38. package/plugins/publishings/surfdash-pub/src/index.ts +59 -8
  39. package/plugins/publishings/surfdash-pub/src/topic-claims.ts +34 -3
  40. package/plugins/publishings/threads-pub/dist/index.js +9196 -296
  41. package/plugins/publishings/threads-pub/dist/profile-check.js +21139 -0
  42. package/plugins/publishings/threads-pub/package.json +3 -1
  43. package/plugins/publishings/threads-pub/plugin.json +6 -1
  44. package/plugins/publishings/threads-pub/src/index.ts +8 -1
  45. package/plugins/publishings/threads-pub/src/post-rail.ts +357 -0
  46. package/plugins/publishings/threads-pub/src/profile-check.ts +17 -0
  47. package/plugins/publishings/wechatmp-pub/dist/index.js +7 -0
  48. package/plugins/publishings/wechatmp-pub/src/flow.ts +13 -0
  49. package/plugins/publishings/weibo-pub/dist/index.js +46 -2
  50. package/plugins/publishings/weibo-pub/src/index.ts +74 -2
  51. package/plugins/publishings/x-pub/dist/index.js +263 -43
  52. package/plugins/publishings/x-pub/dist/profile-check.js +3 -1
  53. package/plugins/publishings/x-pub/src/index.ts +15 -1
  54. package/plugins/publishings/x-pub/src/post-rail.ts +334 -0
@@ -21106,16 +21106,43 @@ var LINKEDIN_HOME_URL = "https://www.linkedin.com/feed/";
21106
21106
  var LINKEDIN_LOGIN_URL_RE = /(\/authwall|\/login|\/checkpoint)/;
21107
21107
  var IMAGE_EXTS = new Set([".png", ".jpg", ".jpeg", ".webp", ".gif"]);
21108
21108
  var LINKEDIN_POST_SELECTORS = {
21109
- shareTrigger: ["button.share-box-feed-entry__trigger", 'button[aria-label*="Start a post" i]'],
21110
- composer: ['div.editor-content[contenteditable="true"]', 'div[role="textbox"][contenteditable="true"]'],
21111
- fileInput: ['[role="dialog"] input[type="file"]'],
21112
- send: ['[role="dialog"] button.share-actions__primary-action', '[role="dialog"] button:has-text("Post")']
21109
+ shareTrigger: [
21110
+ 'text="Start a post"',
21111
+ "button.share-box-feed-entry__trigger",
21112
+ 'button[aria-label*="Start a post" i]'
21113
+ ],
21114
+ composer: [
21115
+ '.tiptap.ProseMirror div[role="textbox"]',
21116
+ 'div[role="textbox"].tiptap',
21117
+ ".tiptap.ProseMirror",
21118
+ '[role="dialog"] div[role="textbox"]',
21119
+ 'div.editor-content[contenteditable="true"]',
21120
+ 'div[role="textbox"][contenteditable="true"]'
21121
+ ],
21122
+ mediaButton: [
21123
+ 'button[aria-label="Media"]',
21124
+ 'button[aria-label*="Media" i]',
21125
+ '[role="dialog"] button[aria-label*="Media" i]'
21126
+ ],
21127
+ fileInput: ['input[type="file"][accept*="image"]', 'input[type="file"]', '[role="dialog"] input[type="file"]'],
21128
+ send: [
21129
+ 'button:text-is("Post")',
21130
+ '[role="dialog"] button:text-is("Post")',
21131
+ '[role="dialog"] button.share-actions__primary-action'
21132
+ ]
21113
21133
  };
21114
21134
  var LOGIN_TIMEOUT_MS = 180000;
21115
21135
  var isLinkedinAuthenticated = async (page) => {
21116
21136
  if (LINKEDIN_LOGIN_URL_RE.test(page.url()))
21117
21137
  return false;
21118
- return (await trySelectors(page, LINKEDIN_POST_SELECTORS.shareTrigger, { visible: false })).found;
21138
+ if ((await trySelectors(page, LINKEDIN_POST_SELECTORS.shareTrigger.slice(1), { visible: false })).found) {
21139
+ return true;
21140
+ }
21141
+ try {
21142
+ return await page.getByText("Start a post", { exact: true }).count() > 0;
21143
+ } catch {
21144
+ return false;
21145
+ }
21119
21146
  };
21120
21147
  var LINKEDIN_CONFIG = {
21121
21148
  channel: TARGET,
@@ -77,10 +77,33 @@ const IMAGE_EXTS = new Set(['.png', '.jpg', '.jpeg', '.webp', '.gif']);
77
77
  * A drifted selector is a loud typed refusal at its stage, never a silent skip or a text-only post.
78
78
  */
79
79
  export const LINKEDIN_POST_SELECTORS = {
80
- shareTrigger: ['button.share-box-feed-entry__trigger', 'button[aria-label*="Start a post" i]'],
81
- composer: ['div.editor-content[contenteditable="true"]', 'div[role="textbox"][contenteditable="true"]'],
82
- fileInput: ['[role="dialog"] input[type="file"]'],
83
- send: ['[role="dialog"] button.share-actions__primary-action', '[role="dialog"] button:has-text("Post")'],
80
+ // 2026-11-16 live measurement of the redesigned feed: the share trigger is a classless div and the
81
+ // share surface is NOT a `[role="dialog"]`, so controls are page-scoped by text, with the old
82
+ // class-based ladder kept as a fallback for accounts still on the previous UI.
83
+ shareTrigger: [
84
+ 'text="Start a post"',
85
+ 'button.share-box-feed-entry__trigger',
86
+ 'button[aria-label*="Start a post" i]',
87
+ ],
88
+ composer: [
89
+ '.tiptap.ProseMirror div[role="textbox"]',
90
+ 'div[role="textbox"].tiptap',
91
+ '.tiptap.ProseMirror',
92
+ '[role="dialog"] div[role="textbox"]',
93
+ 'div.editor-content[contenteditable="true"]',
94
+ 'div[role="textbox"][contenteditable="true"]',
95
+ ],
96
+ mediaButton: [
97
+ 'button[aria-label="Media"]',
98
+ 'button[aria-label*="Media" i]',
99
+ '[role="dialog"] button[aria-label*="Media" i]',
100
+ ],
101
+ fileInput: ['input[type="file"][accept*="image"]', 'input[type="file"]', '[role="dialog"] input[type="file"]'],
102
+ send: [
103
+ 'button:text-is("Post")',
104
+ '[role="dialog"] button:text-is("Post")',
105
+ '[role="dialog"] button.share-actions__primary-action',
106
+ ],
84
107
  } as const;
85
108
 
86
109
  /** Failure toast words. **Provisional** (LinkedIn's artdeco toast wording). */
@@ -181,7 +204,14 @@ function resolveDriver(options?: Record<string, unknown>): BrowserDriver | { err
181
204
  */
182
205
  export const isLinkedinAuthenticated: IsAuthenticatedPredicate = async (page) => {
183
206
  if (LINKEDIN_LOGIN_URL_RE.test(page.url())) return false;
184
- return (await trySelectors(page, LINKEDIN_POST_SELECTORS.shareTrigger, { visible: false })).found;
207
+ if ((await trySelectors(page, LINKEDIN_POST_SELECTORS.shareTrigger.slice(1), { visible: false })).found) {
208
+ return true;
209
+ }
210
+ try {
211
+ return (await page.getByText('Start a post', { exact: true }).count()) > 0;
212
+ } catch {
213
+ return false;
214
+ }
185
215
  };
186
216
 
187
217
  /**
@@ -380,7 +410,16 @@ export class LinkedinBrowserTransport implements PublishTransport {
380
410
  metadata,
381
411
  );
382
412
  }
383
- await page.locator(composerSelector).first().fill(text);
413
+ const composer = page.locator(composerSelector).first();
414
+ if (typeof composer.pressSequentially === 'function') {
415
+ // tiptap/ProseMirror (measured 2026-11-16): `fill()` writes the DOM without the editor's
416
+ // state, so the footer Post control never renders. Type real key events — the same trap
417
+ // as X's Draft.js. A page stub without pressSequentially keeps the fill path.
418
+ await composer.click();
419
+ await composer.pressSequentially(text, { delay: 3 });
420
+ } else {
421
+ await composer.fill(text);
422
+ }
384
423
 
385
424
  // Readback before anything else: a field the editor dropped must never be submitted.
386
425
  const readback = await this.requireReadback(page, composerSelector, text);
@@ -473,6 +512,13 @@ export class LinkedinBrowserTransport implements PublishTransport {
473
512
  image: string,
474
513
  ): Promise<{ ok: true; evidence: string } | { ok: false; error: string }> {
475
514
  try {
515
+ const media = await trySelectors(page, LINKEDIN_POST_SELECTORS.mediaButton);
516
+ if (media.found) {
517
+ await page
518
+ .locator(media.selector ?? LINKEDIN_POST_SELECTORS.mediaButton[0])
519
+ .first()
520
+ .click();
521
+ }
476
522
  const inputSelector = await resolveSelector(page, LINKEDIN_POST_SELECTORS.fileInput, {
477
523
  timeoutMs: this.stepTimeoutMs,
478
524
  label: 'linkedin file input',