@gobing-ai/knowledge-kit 0.0.29 → 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 (72) 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 +24 -7
  5. package/plugins/generations/daily-article-gen/src/index.ts +36 -12
  6. package/plugins/generations/dailynews-gen/dist/index.js +19 -2
  7. package/plugins/generations/dailynews-gen/src/index.ts +7 -0
  8. package/plugins/generations/dailynews-gen/src/script-plan.ts +21 -3
  9. package/plugins/generations/episode-plan-gen/dist/index.js +55 -4
  10. package/plugins/generations/episode-plan-gen/src/index.ts +80 -2
  11. package/plugins/generations/image-gen/dist/index.js +122 -20
  12. package/plugins/generations/image-gen/src/bytes.ts +106 -18
  13. package/plugins/generations/image-gen/src/index.ts +46 -6
  14. package/plugins/generations/image-gen/src/job.ts +6 -0
  15. package/plugins/generations/image-gen/src/providers/minimax.ts +12 -4
  16. package/plugins/generations/image-gen/src/providers/types.ts +12 -1
  17. package/plugins/kk/plugin.json +1 -1
  18. package/plugins/kk/scripts/daily-voice-style.zh.md +5 -5
  19. package/plugins/kk/scripts/itc-stages.ts +21 -3
  20. package/plugins/kk/scripts/kk-workflow-stages.ts +199 -7
  21. package/plugins/kk/scripts/topic-boundary.json +3 -12
  22. package/plugins/kk/skills/content-judge/SKILL.md +30 -0
  23. package/plugins/kk/skills/content-judge/references/workflow-integration.md +9 -2
  24. package/plugins/kk/skills/publish/SKILL.md +1 -1
  25. package/plugins/kk/workflows/judge-gated-publish-example.yaml +18 -10
  26. package/plugins/kk/workflows/kk-daily-ai-voice.yaml +39 -14
  27. package/plugins/kk/workflows/kk-itc.yaml +21 -8
  28. package/plugins/publishings/xhs-pub/dist/index.js +1 -1
  29. package/plugins/publishings/xhs-pub/src/automation-guard.ts +2 -2
  30. package/plugins/publishings/xhs-pub/src/index.ts +1 -1
  31. package/plugins/publishings/xhs-pub/src/profile-check.ts +2 -2
  32. package/plugins/sp/lib/env.ts +0 -46
  33. package/plugins/sp/lib/inline-run.generated.mjs +0 -1489
  34. package/plugins/sp/scripts/batch-preflight.mjs +0 -346
  35. package/plugins/sp/scripts/batch-preflight.ts +0 -459
  36. package/plugins/sp/scripts/daily-summary/daily-summary.mjs +0 -615
  37. package/plugins/sp/scripts/daily-summary/daily-summary.ts +0 -846
  38. package/plugins/sp/scripts/daily-summary/logger.ts +0 -28
  39. package/plugins/sp/scripts/dogfood-testing/detect-pipeline-driving.mjs +0 -223
  40. package/plugins/sp/scripts/dogfood-testing/detect-pipeline-driving.ts +0 -367
  41. package/plugins/sp/scripts/dogfood-testing/validate-report.mjs +0 -132
  42. package/plugins/sp/scripts/dogfood-testing/validate-report.ts +0 -169
  43. package/plugins/sp/scripts/feature-dev-precheck.mjs +0 -171
  44. package/plugins/sp/scripts/feature-dev-precheck.ts +0 -238
  45. package/plugins/sp/scripts/feature-sync-bounded.mjs +0 -285
  46. package/plugins/sp/scripts/feature-sync-bounded.ts +0 -478
  47. package/plugins/sp/scripts/feature-verification-steps.ts +0 -275
  48. package/plugins/sp/scripts/history-anatomy-cache.mjs +0 -902
  49. package/plugins/sp/scripts/history-anatomy-cache.ts +0 -1028
  50. package/plugins/sp/scripts/idea-handoff.mjs +0 -22
  51. package/plugins/sp/scripts/idea-handoff.ts +0 -44
  52. package/plugins/sp/scripts/inline-pipeline-parity-check.ts +0 -185
  53. package/plugins/sp/scripts/inline-run-setup.ts +0 -722
  54. package/plugins/sp/scripts/pr-reviewing.mjs +0 -769
  55. package/plugins/sp/scripts/pr-reviewing.ts +0 -925
  56. package/plugins/sp/scripts/quality-gate.mjs +0 -179
  57. package/plugins/sp/scripts/quality-gate.ts +0 -217
  58. package/plugins/sp/scripts/script-contract-check.ts +0 -319
  59. package/plugins/sp/scripts/stage-registry-adapter.ts +0 -1533
  60. package/plugins/sp/scripts/surface-drift-inventory.ts +0 -929
  61. package/plugins/sp/scripts/task-evidence-precheck.ts +0 -181
  62. package/plugins/sp/scripts/task-size-precheck.ts +0 -175
  63. package/plugins/sp/scripts/transition-shim-check.ts +0 -238
  64. package/plugins/sp/scripts/validate-commands.ts +0 -689
  65. package/plugins/sp/scripts/validate-flag-contracts.ts +0 -878
  66. package/plugins/sp/scripts/verify-answer-lint.ts +0 -530
  67. package/plugins/sp/scripts/workflow-step-profile.mjs +0 -316
  68. package/plugins/sp/scripts/workflow-step-profile.ts +0 -456
  69. package/plugins/sp/scripts/wrapup-drift-probe.mjs +0 -190
  70. package/plugins/sp/scripts/wrapup-drift-probe.ts +0 -258
  71. package/plugins/sp/scripts/wrapup-steps.mjs +0 -444
  72. 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 };