@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,22 +0,0 @@
1
- #!/usr/bin/env node
2
- // @bun
3
-
4
- // plugins/sp/scripts/idea-handoff.ts
5
- var libUrl = new URL('../lib/idea-handoff.generated.mjs', import.meta.url).href;
6
- async function loadHandoffLib() {
7
- return await import(libUrl);
8
- }
9
- var IDEA_HANDOFF_USAGE = 'usage: idea-handoff.ts (env: __runId, featureId, optional spurBin) \u2014 no subcommands';
10
- async function main(argv, env = process.env) {
11
- if (argv.length > 0) {
12
- process.stderr.write(`${IDEA_HANDOFF_USAGE}
13
- `);
14
- return 2;
15
- }
16
- const { runIdeaHandoffCli } = await loadHandoffLib();
17
- const outcome = await runIdeaHandoffCli(env);
18
- return outcome.exitCode;
19
- }
20
- process.exit(await main(process.argv.slice(2)));
21
-
22
- export { IDEA_HANDOFF_USAGE, loadHandoffLib, main };
@@ -1,44 +0,0 @@
1
- #!/usr/bin/env bun
2
- /**
3
- * idea-handoff — portable entrypoint for the idea-pipeline finalization (task 0824, feature I21).
4
- *
5
- * ADR-065 standard plugin script: the workflow wrapper prefers the monorepo writer
6
- * (`bun packages/app/src/workflow/idea-handoff-cli.ts`) and falls back to this script's
7
- * registered `.mjs` twin under bare `node`, so a seeded project with no monorepo checkout
8
- * still finalizes the handoff (run-scoped report + task-deps ordering + roster refresh) and
9
- * fails closed (exit 1) when neither writer resolves.
10
- *
11
- * The behavior lives in the generated bundle `../lib/idea-handoff.generated.mjs`, produced by
12
- * `bun run build:plugin-lib` from `packages/app/src/workflow/idea-handoff-cli.ts` — the same
13
- * source the monorepo branch executes, so both branches share one contract (0604/0824).
14
- * Declarations: `../lib/idea-handoff.generated.d.mts`. The bundle is imported by computed URL
15
- * on purpose: `superskill script convert` must NOT inline it (its tree carries one
16
- * `Bun.spawn` site in a ts-runtime streaming path this workflow never exercises), so the
17
- * twin stays a thin node-runnable loader over the committed runtime asset.
18
- *
19
- * Environment: `__runId`, `featureId`, optional `spurBin`. Missing required vars exit 1
20
- * (mis-invocation is failed-closed, never a silent skip).
21
- */
22
-
23
- const libUrl = new URL('../lib/idea-handoff.generated.mjs', import.meta.url).href;
24
-
25
- export async function loadHandoffLib(): Promise<typeof import('../lib/idea-handoff.generated.mjs')> {
26
- return (await import(libUrl)) as typeof import('../lib/idea-handoff.generated.mjs');
27
- }
28
-
29
- export const IDEA_HANDOFF_USAGE =
30
- 'usage: idea-handoff.ts (env: __runId, featureId, optional spurBin) — no subcommands';
31
-
32
- export async function main(argv: string[], env: NodeJS.ProcessEnv = process.env): Promise<number> {
33
- if (argv.length > 0) {
34
- process.stderr.write(`${IDEA_HANDOFF_USAGE}\n`);
35
- return 2;
36
- }
37
- const { runIdeaHandoffCli } = await loadHandoffLib();
38
- const outcome = await runIdeaHandoffCli(env as { __runId?: string; featureId?: string; spurBin?: string });
39
- return outcome.exitCode;
40
- }
41
-
42
- if (import.meta.main) {
43
- process.exit(await main(process.argv.slice(2)));
44
- }
@@ -1,185 +0,0 @@
1
- #!/usr/bin/env bun
2
- /**
3
- * inline-pipeline-parity-check — two-sided gate between the inline pipeline
4
- * driver's documented action/guard set and the resolved action/guard sets in
5
- * `.spur/workflows/task-pipeline.yaml` and `.spur/workflows/idea-pipeline.yaml`
6
- * (task 0755 R2/R3).
7
- *
8
- * The driver reference at `plugins/sp/skills/spur-dev/references/inline-pipeline-driver.md`
9
- * documents the set of action and guard kinds it implements. The two runtime
10
- * pipelines are the only consumers the driver needs to keep in step with. The
11
- * check is a symmetric set diff: an element present in one and absent in the
12
- * other fails the check and names the element.
13
- *
14
- * The set is defined in {@link DOCUMENTED} below; the driver's markdown list is
15
- * the human mirror. Update both when the driver adds or drops a kind.
16
- *
17
- * Usage:
18
- * bun plugins/sp/scripts/inline-pipeline-parity-check.ts
19
- * [--root <path>] default: repo root
20
- *
21
- * Exit code: 0 when the sets agree; 1 on any divergence. Violations are printed
22
- * to stderr; a summary to stdout.
23
- */
24
-
25
- import { readdirSync, readFileSync, statSync } from 'node:fs';
26
- import { join, resolve } from 'node:path';
27
- import { parse as parseYaml } from 'yaml';
28
-
29
- /** Documented action and guard set. Must stay in lockstep with the
30
- * "Supported action and guard set (0755 R2 parity contract)" section in
31
- * `plugins/sp/skills/spur-dev/references/inline-pipeline-driver.md`. The
32
- * driver supports a kind if ANY workflow in `.spur/workflows/*.yaml` uses
33
- * it (the driver applies to any selected pipeline per its reference doc). */
34
- const DOCUMENTED = {
35
- actions: new Set([
36
- 'shell',
37
- 'note',
38
- 'doctor.probe',
39
- 'file.read.into-var',
40
- 'hitl.confirm',
41
- 'agent.run',
42
- 'proof.fingerprint',
43
- 'run.artifact',
44
- 'command.gate',
45
- ]),
46
- guards: new Set(['always', 'shell']),
47
- } as const;
48
-
49
- /** Directory of workflow definitions the driver is responsible for. */
50
- const WORKFLOW_DIR = join('config', 'workflows');
51
-
52
- /** Walk a state list and yield every `kind:` value found in `onEnter` action
53
- * lists. Skips the top-level workflow `kind:` (e.g. `state-machine`). */
54
- function collectActionKinds(states: unknown): Set<string> {
55
- const out = new Set<string>();
56
- if (!Array.isArray(states)) return out;
57
- for (const state of states) {
58
- if (typeof state !== 'object' || state === null) continue;
59
- const onEnter = (state as { onEnter?: unknown }).onEnter;
60
- if (!Array.isArray(onEnter)) continue;
61
- for (const action of onEnter) {
62
- if (typeof action !== 'object' || action === null) continue;
63
- const kind = (action as { kind?: unknown }).kind;
64
- if (typeof kind === 'string') out.add(kind);
65
- }
66
- }
67
- return out;
68
- }
69
-
70
- /** Walk a transition list and yield every `guard.kind` value. */
71
- function collectGuardKinds(transitions: unknown): Set<string> {
72
- const out = new Set<string>();
73
- if (!Array.isArray(transitions)) return out;
74
- for (const transition of transitions) {
75
- if (typeof transition !== 'object' || transition === null) continue;
76
- const guard = (transition as { guard?: { kind?: unknown } }).guard;
77
- const kind = guard?.kind;
78
- if (typeof kind === 'string') out.add(kind);
79
- }
80
- return out;
81
- }
82
-
83
- /** Symmetric set diff. Returns elements in `a` but not in `b`, and vice versa. */
84
- function diff<T>(a: Set<T>, b: Set<T>): { onlyInA: T[]; onlyInB: T[] } {
85
- const onlyInA: T[] = [];
86
- const onlyInB: T[] = [];
87
- for (const x of a) if (!b.has(x)) onlyInA.push(x);
88
- for (const x of b) if (!a.has(x)) onlyInB.push(x);
89
- return { onlyInA, onlyInB };
90
- }
91
-
92
- function parseArgs(argv: string[]): { root: string } {
93
- let root = resolve('.');
94
- for (let i = 0; i < argv.length; i += 1) {
95
- const arg = argv[i];
96
- if (arg === '--root' && i + 1 < argv.length) {
97
- root = resolve(argv[++i] ?? '.');
98
- } else if (arg === '--help' || arg === '-h') {
99
- process.stdout.write('Usage: bun inline-pipeline-parity-check.ts [--root <path>]\n');
100
- process.exit(0);
101
- }
102
- }
103
- return { root };
104
- }
105
-
106
- function listWorkflowFiles(dir: string): string[] {
107
- let entries: string[];
108
- try {
109
- entries = readdirSync(dir);
110
- } catch {
111
- return [];
112
- }
113
- return entries.filter((e) => e.endsWith('.yaml')).map((e) => join(dir, e));
114
- }
115
-
116
- async function main(): Promise<number> {
117
- const { root } = parseArgs(process.argv.slice(2));
118
- const errors: string[] = [];
119
-
120
- const workflowDir = join(root, WORKFLOW_DIR);
121
- if (!statSync(workflowDir, { throwIfNoEntry: false })) {
122
- process.stderr.write(`inline-pipeline-parity-check: workflow directory not found: ${workflowDir}\n`);
123
- return 1;
124
- }
125
-
126
- const files = listWorkflowFiles(workflowDir);
127
- if (files.length === 0) {
128
- process.stderr.write(`inline-pipeline-parity-check: no .yaml workflows found in ${workflowDir}\n`);
129
- return 1;
130
- }
131
-
132
- const unionActions = new Set<string>();
133
- const unionGuards = new Set<string>();
134
- const perFileKinds: { path: string; actions: Set<string>; guards: Set<string> }[] = [];
135
-
136
- for (const path of files) {
137
- let parsed: unknown;
138
- try {
139
- parsed = parseYaml(readFileSync(path, 'utf8'));
140
- } catch (err) {
141
- errors.push(`${path}: failed to parse (${err instanceof Error ? err.message : String(err)})`);
142
- continue;
143
- }
144
- if (typeof parsed !== 'object' || parsed === null) {
145
- continue;
146
- }
147
- const def = parsed as { states?: unknown; transitions?: unknown };
148
- const actions = collectActionKinds(def.states);
149
- const guards = collectGuardKinds(def.transitions);
150
- perFileKinds.push({ path, actions, guards });
151
- for (const a of actions) unionActions.add(a);
152
- for (const g of guards) unionGuards.add(g);
153
- }
154
-
155
- const actionDiff = diff(unionActions, DOCUMENTED.actions);
156
- const guardDiff = diff(unionGuards, DOCUMENTED.guards);
157
-
158
- for (const x of actionDiff.onlyInA) {
159
- const usedIn = perFileKinds.filter((f) => f.actions.has(x)).map((f) => f.path);
160
- errors.push(`action kind "${x}" used in YAML (${usedIn.join(', ')}) but absent from inline-pipeline-driver.md`);
161
- }
162
- for (const x of actionDiff.onlyInB) {
163
- errors.push(`action kind "${x}" documented in inline-pipeline-driver.md but never used in any workflow`);
164
- }
165
- for (const x of guardDiff.onlyInA) {
166
- const usedIn = perFileKinds.filter((f) => f.guards.has(x)).map((f) => f.path);
167
- errors.push(`guard kind "${x}" used in YAML (${usedIn.join(', ')}) but absent from inline-pipeline-driver.md`);
168
- }
169
- for (const x of guardDiff.onlyInB) {
170
- errors.push(`guard kind "${x}" documented in inline-pipeline-driver.md but never used in any workflow`);
171
- }
172
-
173
- if (errors.length > 0) {
174
- process.stderr.write(`inline-pipeline-parity-check: ${errors.length} divergence(s)\n`);
175
- for (const e of errors) process.stderr.write(` - ${e}\n`);
176
- return 1;
177
- }
178
-
179
- process.stdout.write(
180
- `inline-pipeline-parity-check: ok (${unionActions.size} actions, ${unionGuards.size} guards agree across ${files.length} workflows)\n`,
181
- );
182
- return 0;
183
- }
184
-
185
- process.exit(await main());