@gobing-ai/knowledge-kit 0.0.28 → 0.0.30

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 (97) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/index.js +114 -38
  3. package/package.json +1 -1
  4. package/plugins/generations/daily-article-gen/dist/index.js +45 -5
  5. package/plugins/generations/daily-article-gen/src/index.ts +59 -4
  6. package/plugins/generations/dailynews-gen/dist/index.js +46 -9
  7. package/plugins/generations/dailynews-gen/src/index.ts +36 -1
  8. package/plugins/generations/dailynews-gen/src/script-builder.ts +15 -12
  9. package/plugins/generations/dailynews-gen/src/script-plan.ts +21 -3
  10. package/plugins/generations/episode-plan-gen/dist/index.js +55 -4
  11. package/plugins/generations/episode-plan-gen/src/index.ts +80 -2
  12. package/plugins/generations/image-gen/assets/fonts/NotoSansSC-Bold.otf +0 -0
  13. package/plugins/generations/image-gen/assets/fonts/NotoSansSC-Regular.otf +0 -0
  14. package/plugins/generations/image-gen/assets/fonts/OFL.txt +92 -0
  15. package/plugins/generations/image-gen/assets/fonts/SOURCE.md +15 -0
  16. package/plugins/generations/image-gen/dist/index.js +700 -22
  17. package/plugins/generations/image-gen/package.json +1 -0
  18. package/plugins/generations/image-gen/presets/formats/daily-news-cover.yaml +2 -2
  19. package/plugins/generations/image-gen/presets/formats/xhs-card.yaml +19 -11
  20. package/plugins/generations/image-gen/presets/styles/xhs-knowledge.yaml +2 -1
  21. package/plugins/generations/image-gen/scripts/compose-e2e-artifact.ts +135 -0
  22. package/plugins/generations/image-gen/src/bytes.ts +116 -0
  23. package/plugins/generations/image-gen/src/compose/card.ts +294 -0
  24. package/plugins/generations/image-gen/src/compose/chromium.ts +147 -0
  25. package/plugins/generations/image-gen/src/compose/cmap.ts +177 -0
  26. package/plugins/generations/image-gen/src/index.ts +211 -13
  27. package/plugins/generations/image-gen/src/job.ts +12 -0
  28. package/plugins/generations/image-gen/src/presets.ts +53 -13
  29. package/plugins/generations/image-gen/src/providers/minimax.ts +12 -4
  30. package/plugins/generations/image-gen/src/providers/types.ts +12 -1
  31. package/plugins/kk/plugin.json +1 -1
  32. package/plugins/kk/scripts/daily-voice-style.zh.md +27 -14
  33. package/plugins/kk/scripts/itc-stages.ts +21 -3
  34. package/plugins/kk/scripts/kk-workflow-stages.ts +461 -10
  35. package/plugins/kk/scripts/topic-boundary.json +96 -0
  36. package/plugins/kk/scripts/validate-voicescript.ts +15 -0
  37. package/plugins/kk/skills/content-judge/SKILL.md +30 -0
  38. package/plugins/kk/skills/content-judge/references/workflow-integration.md +9 -2
  39. package/plugins/kk/skills/content-safety/SKILL.md +163 -0
  40. package/plugins/kk/skills/content-safety/references/platforms/apple-podcasts.md +36 -0
  41. package/plugins/kk/skills/content-safety/references/platforms/netease-music.md +31 -0
  42. package/plugins/kk/skills/content-safety/references/platforms/wechatmp.md +32 -0
  43. package/plugins/kk/skills/content-safety/references/platforms/xiaoyuzhou.md +35 -0
  44. package/plugins/kk/skills/publish/SKILL.md +1 -1
  45. package/plugins/kk/skills/xhs-images/SKILL.md +11 -7
  46. package/plugins/kk/skills/xhs-images/references/card-layouts.md +4 -4
  47. package/plugins/kk/workflows/judge-gated-publish-example.yaml +18 -10
  48. package/plugins/kk/workflows/kk-daily-ai-voice.yaml +139 -24
  49. package/plugins/kk/workflows/kk-itc.yaml +21 -8
  50. package/plugins/publishings/podcast-pub/dist/index.js +4 -0
  51. package/plugins/publishings/podcast-pub/src/index.ts +2 -0
  52. package/plugins/publishings/podcast-pub/src/show-notes.ts +6 -0
  53. package/plugins/publishings/xhs-pub/dist/index.js +1 -1
  54. package/plugins/publishings/xhs-pub/src/automation-guard.ts +2 -2
  55. package/plugins/publishings/xhs-pub/src/index.ts +1 -1
  56. package/plugins/publishings/xhs-pub/src/profile-check.ts +2 -2
  57. package/plugins/sp/lib/env.ts +0 -46
  58. package/plugins/sp/lib/inline-run.generated.mjs +0 -1489
  59. package/plugins/sp/scripts/batch-preflight.mjs +0 -346
  60. package/plugins/sp/scripts/batch-preflight.ts +0 -459
  61. package/plugins/sp/scripts/daily-summary/daily-summary.mjs +0 -615
  62. package/plugins/sp/scripts/daily-summary/daily-summary.ts +0 -846
  63. package/plugins/sp/scripts/daily-summary/logger.ts +0 -28
  64. package/plugins/sp/scripts/dogfood-testing/detect-pipeline-driving.mjs +0 -223
  65. package/plugins/sp/scripts/dogfood-testing/detect-pipeline-driving.ts +0 -367
  66. package/plugins/sp/scripts/dogfood-testing/validate-report.mjs +0 -132
  67. package/plugins/sp/scripts/dogfood-testing/validate-report.ts +0 -169
  68. package/plugins/sp/scripts/feature-dev-precheck.mjs +0 -171
  69. package/plugins/sp/scripts/feature-dev-precheck.ts +0 -238
  70. package/plugins/sp/scripts/feature-sync-bounded.mjs +0 -285
  71. package/plugins/sp/scripts/feature-sync-bounded.ts +0 -478
  72. package/plugins/sp/scripts/feature-verification-steps.ts +0 -275
  73. package/plugins/sp/scripts/history-anatomy-cache.mjs +0 -902
  74. package/plugins/sp/scripts/history-anatomy-cache.ts +0 -1028
  75. package/plugins/sp/scripts/idea-handoff.mjs +0 -22
  76. package/plugins/sp/scripts/idea-handoff.ts +0 -44
  77. package/plugins/sp/scripts/inline-pipeline-parity-check.ts +0 -185
  78. package/plugins/sp/scripts/inline-run-setup.ts +0 -722
  79. package/plugins/sp/scripts/pr-reviewing.mjs +0 -769
  80. package/plugins/sp/scripts/pr-reviewing.ts +0 -925
  81. package/plugins/sp/scripts/quality-gate.mjs +0 -179
  82. package/plugins/sp/scripts/quality-gate.ts +0 -217
  83. package/plugins/sp/scripts/script-contract-check.ts +0 -319
  84. package/plugins/sp/scripts/stage-registry-adapter.ts +0 -1533
  85. package/plugins/sp/scripts/surface-drift-inventory.ts +0 -929
  86. package/plugins/sp/scripts/task-evidence-precheck.ts +0 -181
  87. package/plugins/sp/scripts/task-size-precheck.ts +0 -175
  88. package/plugins/sp/scripts/transition-shim-check.ts +0 -238
  89. package/plugins/sp/scripts/validate-commands.ts +0 -689
  90. package/plugins/sp/scripts/validate-flag-contracts.ts +0 -878
  91. package/plugins/sp/scripts/verify-answer-lint.ts +0 -530
  92. package/plugins/sp/scripts/workflow-step-profile.mjs +0 -316
  93. package/plugins/sp/scripts/workflow-step-profile.ts +0 -456
  94. package/plugins/sp/scripts/wrapup-drift-probe.mjs +0 -190
  95. package/plugins/sp/scripts/wrapup-drift-probe.ts +0 -258
  96. package/plugins/sp/scripts/wrapup-steps.mjs +0 -444
  97. package/plugins/sp/scripts/wrapup-steps.ts +0 -552
@@ -1,346 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire } from 'node:module';
3
-
4
- var __require = /* @__PURE__ */ createRequire(import.meta.url);
5
-
6
- // plugins/sp/scripts/batch-preflight.ts
7
- function quickReadiness(input) {
8
- const status = (input.status ?? '').toLowerCase();
9
- const operation = input.operation;
10
- if (operation !== 'run' && operation !== 'refine' && operation !== 'verify') {
11
- return {
12
- action: 'invalid',
13
- code: 'IV',
14
- reason: `quick-readiness: unknown operation '${operation}' (${input.wbs})`,
15
- };
16
- }
17
- if (input.filteredCount !== undefined) {
18
- if (input.filteredCount < 0) {
19
- return {
20
- action: 'invalid',
21
- code: 'IV',
22
- reason: `quick-readiness: invalid negative filtered count '${input.filteredCount}' (${input.wbs})`,
23
- };
24
- }
25
- if (input.filteredCount === 0) {
26
- return {
27
- action: 'skipped',
28
- code: 'EMPTY',
29
- reason: `quick-readiness: empty status-filtered set — nothing to ${operation} (${input.wbs})`,
30
- };
31
- }
32
- }
33
- if (status === 'cancelled' || status === 'done') {
34
- if (operation === 'verify' && input.force === true) {
35
- return {
36
- action: 'runnable',
37
- code: 'FORCE',
38
- reason: `quick-readiness: verify --force re-verification of ${status} task ${input.wbs}`,
39
- };
40
- }
41
- return {
42
- action: 'skipped',
43
- code: status === 'done' ? 'DONE' : 'CANCELLED',
44
- reason: `quick-readiness: already ${status} — no ${operation} hop (${input.wbs})`,
45
- };
46
- }
47
- if (status === 'blocked') {
48
- return {
49
- action: 'blocked',
50
- code: 'BLK',
51
- reason: `quick-readiness: blocked — human/handover first (${input.wbs})`,
52
- };
53
- }
54
- if (operation === 'run' && input.dependencies && input.dependencies.length > 0) {
55
- const unmet = input.dependencies.filter((d) => (input.depStatuses?.[d] ?? 'missing').toLowerCase() !== 'done');
56
- if (unmet.length > 0) {
57
- return {
58
- action: 'blocked',
59
- code: 'DEP',
60
- reason: `quick-readiness: unmet deps — ${unmet.join(', ')} (${input.wbs})`,
61
- unmetDeps: unmet,
62
- };
63
- }
64
- }
65
- const required = input.requiredSections ?? [];
66
- const present = input.presentSections ?? [];
67
- const gaps = required.filter((s) => {
68
- const finding = input.sectionFindings?.[s];
69
- return !present.includes(s) || (finding !== undefined && finding !== '');
70
- });
71
- if (operation === 'refine') {
72
- if (status !== 'backlog' && status !== 'todo') {
73
- return {
74
- action: 'skipped',
75
- code: 'NONPLAN',
76
- reason: `quick-readiness: refine targets backlog/todo only, not '${status}' (${input.wbs})`,
77
- };
78
- }
79
- return {
80
- action: 'runnable',
81
- code: 'OK',
82
- reason: `quick-readiness: refine ready for ${input.wbs} (${gaps.length} planning gap(s) to fill)`,
83
- };
84
- }
85
- if (operation === 'verify') {
86
- if (status !== 'testing' && status !== 'wip') {
87
- return {
88
- action: 'invalid',
89
- code: 'NOVERIFY',
90
- reason: `quick-readiness: verify needs testing/wip, not '${status}' (${input.wbs})`,
91
- };
92
- }
93
- return {
94
- action: 'runnable',
95
- code: 'OK',
96
- reason: `quick-readiness: verify ready for ${input.wbs}`,
97
- };
98
- }
99
- if (status !== 'todo' && status !== 'wip' && status !== 'testing') {
100
- return {
101
- action: 'invalid',
102
- code: 'NORUN',
103
- reason: `quick-readiness: run needs todo/wip/testing, not '${status}' (${input.wbs})`,
104
- };
105
- }
106
- if (gaps.length > 0) {
107
- return {
108
- action: 'needs-refinement',
109
- code: 'REFINE',
110
- reason: `quick-readiness: implementation sections incomplete (${input.wbs})`,
111
- gaps,
112
- };
113
- }
114
- return {
115
- action: 'runnable',
116
- code: 'OK',
117
- reason: `quick-readiness: run ready for ${input.wbs}`,
118
- };
119
- }
120
- function preflightTask(input) {
121
- const status = (input.status ?? '').toLowerCase();
122
- const deps = input.dependencies ?? [];
123
- const depStatuses = input.depStatuses ?? {};
124
- if (status === 'cancelled') {
125
- return {
126
- action: 'skip',
127
- code: 'A9',
128
- reason: `dev-next: cancelled — nothing to advance (${input.wbs})`,
129
- };
130
- }
131
- if (status === 'done') {
132
- return {
133
- action: 'skip',
134
- code: 'A8',
135
- reason: `dev-next: already done — batch does not auto-wrap (${input.wbs})`,
136
- };
137
- }
138
- if (status === 'blocked') {
139
- return {
140
- action: 'skip',
141
- code: 'A7',
142
- reason: `dev-next: blocked — do not launch pipeline; human/handover first (${input.wbs})`,
143
- };
144
- }
145
- if (status === 'todo' || status === 'backlog') {
146
- const unmet = deps.filter((d) => {
147
- const st = (depStatuses[d] ?? 'missing').toLowerCase();
148
- return st !== 'done';
149
- });
150
- if (unmet.length > 0) {
151
- return {
152
- action: 'skip',
153
- code: 'A2',
154
- reason: `dev-next: blocked by deps — unmet: ${unmet.join(', ')} (${input.wbs})`,
155
- unmetDeps: unmet,
156
- };
157
- }
158
- }
159
- return { action: 'run', code: 'OK', reason: `preflight clear — launch task-pipeline for ${input.wbs}` };
160
- }
161
- function recoveryHint(status, wbs) {
162
- const st = (status ?? '').toLowerCase();
163
- switch (st) {
164
- case 'backlog':
165
- return { code: 'A1', command: `/sp:dev-refine ${wbs} --auto --next` };
166
- case 'todo':
167
- return { code: 'A3', command: `/sp:dev-run ${wbs} --auto --next` };
168
- case 'wip':
169
- return { code: 'A5', command: `/sp:dev-run ${wbs} --mode implement --auto --next` };
170
- case 'testing':
171
- return { code: 'A6', command: `/sp:dev-verify ${wbs} --auto --next` };
172
- case 'blocked':
173
- return {
174
- code: 'A7',
175
- command: `/sp:dev-handover "blocked task ${wbs} — see Notes/History"`,
176
- };
177
- default:
178
- return null;
179
- }
180
- }
181
- function parsePreflightCliArgs(argv) {
182
- let status = null;
183
- let deps = [];
184
- const depStatuses = {};
185
- let wbs = '0000';
186
- let recovery = false;
187
- let help = false;
188
- let json = false;
189
- let operation = null;
190
- let force = false;
191
- let filteredCount = null;
192
- let requiredSections = [];
193
- let presentSections = [];
194
- for (let i = 0; i < argv.length; i++) {
195
- const a = argv[i];
196
- if (a === '--help' || a === '-h') help = true;
197
- else if (a === '--json') json = true;
198
- else if (a === '--recovery') recovery = true;
199
- else if (a === '--force') force = true;
200
- else if (a === '--operation') {
201
- const v = argv[++i] ?? '';
202
- operation = v === 'run' || v === 'refine' || v === 'verify' ? v : null;
203
- } else if (a === '--filtered-count') {
204
- const v = Number(argv[++i]);
205
- filteredCount = Number.isFinite(v) ? v : null;
206
- } else if (a === '--required-sections') {
207
- const raw = argv[++i] ?? '';
208
- requiredSections =
209
- raw.length === 0
210
- ? []
211
- : raw
212
- .split(',')
213
- .map((s) => s.trim())
214
- .filter(Boolean);
215
- } else if (a === '--present-sections') {
216
- const raw = argv[++i] ?? '';
217
- presentSections =
218
- raw.length === 0
219
- ? []
220
- : raw
221
- .split(',')
222
- .map((s) => s.trim())
223
- .filter(Boolean);
224
- } else if (a === '--wbs') wbs = argv[++i] ?? wbs;
225
- else if (a === '--status') status = argv[++i] ?? null;
226
- else if (a === '--deps') {
227
- const raw = argv[++i] ?? '';
228
- deps =
229
- raw.length === 0
230
- ? []
231
- : raw
232
- .split(',')
233
- .map((s) => s.trim())
234
- .filter(Boolean);
235
- } else if (a === '--dep-status') {
236
- const raw = argv[++i] ?? '';
237
- for (const part of raw.split(',')) {
238
- const [k, v] = part.split(':');
239
- if (k && v) depStatuses[k.trim()] = v.trim();
240
- }
241
- }
242
- }
243
- return {
244
- status,
245
- deps,
246
- depStatuses,
247
- wbs,
248
- recovery,
249
- help,
250
- json,
251
- operation,
252
- force,
253
- filteredCount,
254
- requiredSections,
255
- presentSections,
256
- };
257
- }
258
- var PREFLIGHT_CLI_USAGE = `Usage:
259
- bun plugins/sp/scripts/batch-preflight.ts --wbs <wbs> --status <status> \\
260
- [--deps 0275,0276] [--dep-status 0275:done,0276:todo] [--recovery] [--json]
261
- bun plugins/sp/scripts/batch-preflight.ts --operation <run|refine|verify> --wbs <wbs> --status <status> [--filtered-count <n>] [--required-sections A,B] [--present-sections A,B] [--force] [--json]
262
-
263
- Exit: 0 = run (or recovery hint printed); 2 = skip; 1 = usage.`;
264
- function runPreflightCli(argv) {
265
- const args = parsePreflightCliArgs(argv);
266
- if (args.help) return { exitCode: 0, stdout: '', stderr: PREFLIGHT_CLI_USAGE };
267
- if (!args.status) return { exitCode: 1, stdout: '', stderr: PREFLIGHT_CLI_USAGE };
268
- if (args.recovery) {
269
- const hint = recoveryHint(args.status, args.wbs);
270
- const body = args.json
271
- ? `${JSON.stringify({ recovery: hint }, null, 2)}
272
- `
273
- : hint
274
- ? `${hint.command}
275
- `
276
- : `no recovery hop
277
- `;
278
- return { exitCode: 0, stdout: body, stderr: '' };
279
- }
280
- if (args.operation !== null) {
281
- const result2 = quickReadiness({
282
- wbs: args.wbs,
283
- status: args.status,
284
- operation: args.operation,
285
- dependencies: args.deps,
286
- depStatuses: args.depStatuses,
287
- ...(args.filteredCount !== null ? { filteredCount: args.filteredCount } : {}),
288
- ...(args.requiredSections.length > 0 ? { requiredSections: args.requiredSections } : {}),
289
- ...(args.presentSections.length > 0 ? { presentSections: args.presentSections } : {}),
290
- ...(args.force ? { force: true } : {}),
291
- });
292
- const runnable = result2.action === 'runnable' || result2.action === 'needs-refinement';
293
- if (args.json) {
294
- return {
295
- exitCode: runnable ? 0 : 2,
296
- stdout: `${JSON.stringify(result2, null, 2)}
297
- `,
298
- stderr: '',
299
- };
300
- }
301
- return {
302
- exitCode: runnable ? 0 : 2,
303
- stdout: `${result2.action}${result2.code ? ` ${result2.code}` : ''}: ${result2.reason}
304
- `,
305
- stderr: '',
306
- };
307
- }
308
- const result = preflightTask({
309
- wbs: args.wbs,
310
- status: args.status,
311
- dependencies: args.deps,
312
- depStatuses: args.depStatuses,
313
- });
314
- if (args.json) {
315
- return {
316
- exitCode: result.action === 'run' ? 0 : 2,
317
- stdout: `${JSON.stringify(result, null, 2)}
318
- `,
319
- stderr: '',
320
- };
321
- }
322
- if (result.action === 'run') {
323
- return {
324
- exitCode: 0,
325
- stdout: `run: ${result.reason ?? 'ok'}
326
- `,
327
- stderr: '',
328
- };
329
- }
330
- return {
331
- exitCode: 2,
332
- stdout: `skip ${result.code}: ${result.reason}
333
- `,
334
- stderr: '',
335
- };
336
- }
337
- {
338
- const { exitCode, stdout, stderr } = runPreflightCli(process.argv.slice(2));
339
- if (stdout) process.stdout.write(stdout);
340
- if (stderr)
341
- process.stderr.write(`${stderr}
342
- `);
343
- process.exit(exitCode);
344
- }
345
-
346
- export { PREFLIGHT_CLI_USAGE, parsePreflightCliArgs, preflightTask, quickReadiness, recoveryHint, runPreflightCli };