@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
@@ -6,7 +6,7 @@
6
6
  },
7
7
  "plugins": [
8
8
  {
9
- "version": "0.1.19",
9
+ "version": "0.1.20",
10
10
  "name": "kk",
11
11
  "source": "./plugins/kk",
12
12
  "description": "knowledge-kit — a set of toolkit for knowledge management"
@@ -1114,10 +1114,25 @@ function supplyContextOf(windowSetting, startedAt) {
1114
1114
  untilLabel: formatTimestamp(new Date(started).toISOString())
1115
1115
  };
1116
1116
  }
1117
+ var DAILY_WORKFLOW = "kk-news-generate";
1118
+ var RETIRED_DAILY_WORKFLOWS = ["kk-daily-ai-voice2", "kk-daily-ai-voice"];
1119
+ function pickDailyFamily(current, retired) {
1120
+ if (current.length > 0)
1121
+ return { family: DAILY_WORKFLOW, rows: current, retired: false };
1122
+ const hit = retired.find((source) => source.rows.length > 0);
1123
+ if (hit !== undefined)
1124
+ return { family: hit.family, rows: hit.rows, retired: true };
1125
+ return { family: DAILY_WORKFLOW, rows: current, retired: false };
1126
+ }
1127
+ function retiredLayoutNotice(choice) {
1128
+ if (!choice.retired)
1129
+ return null;
1130
+ const days = choice.rows.length === 1 ? "1 run" : `${choice.rows.length} runs`;
1131
+ return `Showing ${days} recorded under the retired ${choice.family} layout. New runs are recorded as ${DAILY_WORKFLOW}, so this list stops growing until that workflow runs.`;
1132
+ }
1117
1133
 
1118
1134
  // ../board/src/daily-voice/index.tsx
1119
1135
  import { jsx as jsx2, jsxs as jsxs2, Fragment } from "react/jsx-runtime";
1120
- var WORKFLOW = "kk-daily-ai-voice2";
1121
1136
  var MODULE_PATH = "/board/modules/kk-daily-ai-voice2";
1122
1137
  var TAB_LABELS = {
1123
1138
  summary: "Summary",
@@ -1183,15 +1198,27 @@ function DailyVoiceModule() {
1183
1198
  const readerBusy = useRef(false);
1184
1199
  const selectionRef = useRef(selection);
1185
1200
  selectionRef.current = selection;
1201
+ const [family, setFamily] = useState(DAILY_WORKFLOW);
1202
+ const familyRef = useRef(DAILY_WORKFLOW);
1186
1203
  const loadHistory = useCallback(async () => {
1187
1204
  if (historyBusy.current)
1188
1205
  return;
1189
1206
  historyBusy.current = true;
1190
1207
  setHistoryRefresh((state) => tick(state));
1191
1208
  try {
1192
- const page = await client.runs(WORKFLOW);
1193
- setRows((existing) => mergeRunPages(existing, page).runs);
1194
- setCursor(page.nextCursor);
1209
+ const current = await client.runs(DAILY_WORKFLOW);
1210
+ let chosen = { family: DAILY_WORKFLOW, page: current };
1211
+ if (current.runs.length === 0) {
1212
+ const retiredPages = await Promise.all(RETIRED_DAILY_WORKFLOWS.map(async (family) => ({ family, page: await client.runs(family) })));
1213
+ const choice = pickDailyFamily(current.runs, retiredPages.map((entry) => ({ family: entry.family, rows: entry.page.runs })));
1214
+ const hit = retiredPages.find((entry) => entry.family === choice.family);
1215
+ if (choice.retired && hit !== undefined)
1216
+ chosen = { family: hit.family, page: hit.page };
1217
+ }
1218
+ familyRef.current = chosen.family;
1219
+ setFamily(chosen.family);
1220
+ setRows((existing) => mergeRunPages(existing, chosen.page).runs);
1221
+ setCursor(chosen.page.nextCursor);
1195
1222
  setHistoryRefresh(() => succeeded(Date.now(), HISTORY_POLL_MS));
1196
1223
  } catch (error) {
1197
1224
  setDiagnostics((existing) => [
@@ -1214,8 +1241,8 @@ function DailyVoiceModule() {
1214
1241
  let stale = false;
1215
1242
  try {
1216
1243
  const [nextResults, nextConfig] = await Promise.all([
1217
- client.results(WORKFLOW, runId),
1218
- client.config(WORKFLOW, runId)
1244
+ client.results(familyRef.current, runId),
1245
+ client.config(familyRef.current, runId)
1219
1246
  ]);
1220
1247
  if (selectionRef.current.runId !== runId) {
1221
1248
  stale = true;
@@ -1398,10 +1425,16 @@ function DailyVoiceModule() {
1398
1425
  children: TAB_LABELS[candidate]
1399
1426
  }, candidate))
1400
1427
  }),
1428
+ family === DAILY_WORKFLOW ? null : /* @__PURE__ */ jsx2("p", {
1429
+ className: "kk-board-empty kk-board-retired-layout",
1430
+ children: retiredLayoutNotice({ family, rows, retired: true })
1431
+ }),
1401
1432
  rows.length === 0 ? /* @__PURE__ */ jsxs2("p", {
1402
1433
  className: "kk-board-empty",
1403
1434
  children: [
1404
- "No runs recorded for kk-daily-ai-voice2. Configure the workflow in",
1435
+ "No runs recorded for ",
1436
+ DAILY_WORKFLOW,
1437
+ ". Configure the workflow in",
1405
1438
  " ",
1406
1439
  /* @__PURE__ */ jsx2("a", {
1407
1440
  href: "/board/settings/workflows",