@gobing-ai/knowledge-kit 0.0.14 → 0.0.16

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 (26) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/package.json +1 -1
  3. package/plugins/generations/omni-voice-gen/README.md +9 -3
  4. package/plugins/generations/omni-voice-gen/profiles.json +5 -1
  5. package/plugins/generations/omni-voice-gen/src/omni_voice_gen/backend.py +12 -1
  6. package/plugins/generations/omni-voice-gen/src/omni_voice_gen/pipeline.py +18 -2
  7. package/plugins/generations/omni-voice-gen/src/omni_voice_gen/profiles.py +8 -0
  8. package/plugins/generations/omni-voice-gen/src/omni_voice_gen/voicescript.py +0 -12
  9. package/plugins/generations/omni-voice-gen/voices/robin-news.wav +0 -0
  10. package/plugins/kk/commands/workflow-run.md +54 -22
  11. package/plugins/kk/config.example.yaml +5 -0
  12. package/plugins/kk/plugin.json +1 -1
  13. package/plugins/kk/scripts/kk-workflow-stages.ts +1226 -0
  14. package/plugins/kk/{workflows → scripts}/validate-voicescript.ts +4 -4
  15. package/plugins/kk/{workflows → scripts}/wrap-voicescript-doc.ts +7 -6
  16. package/plugins/kk/skills/audio-authoring/SKILL.md +11 -12
  17. package/plugins/kk/skills/itc-generating/SKILL.md +2 -2
  18. package/plugins/kk/skills/itc-generating/references/generic-craft.md +1 -1
  19. package/plugins/kk/skills/itc-generating/references/platform-english.md +1 -1
  20. package/plugins/kk/skills/itc-generating/references/platform-wechat.md +1 -1
  21. package/plugins/kk/skills/storm-research/SKILL.md +5 -5
  22. package/plugins/kk/skills/topic/SKILL.md +7 -7
  23. package/plugins/kk/workflows/kk-daily-ai-voice.yaml +149 -163
  24. package/plugins/kk/workflows/kk-itc.yaml +12 -29
  25. package/plugins/kk/workflows/kk-solo-podcast.yaml +72 -131
  26. package/plugins/kk/workflows/kk-storm-research.yaml +12 -62
@@ -2,10 +2,10 @@
2
2
  /**
3
3
  * Runtime VoiceScript checker for kk-solo-podcast.
4
4
  *
5
- * Copied with the workflow YAML into $KK_WORKFLOWS_DIR (default
6
- * ~/.config/kk/workflows). Node/Bun builtins only — no @gobing-ai/* and no
7
- * relative imports into generations/voice-gen (those paths do not exist next
8
- * to the runtime copy).
5
+ * Resolved from the kk package (`plugins/kk/scripts/`) by `kk-workflow-stages.ts`,
6
+ * or from an explicit runtime override ($KK_WORKFLOWS_DIR / ~/.config/kk/workflows)
7
+ * when one exists. Node/Bun builtins only — no @gobing-ai/* and no relative imports
8
+ * into generations/voice-gen (those paths do not exist outside the package).
9
9
  *
10
10
  * SYNC: plugins/generations/voice-gen/src/voicescript.ts (validateVoiceScript
11
11
  * + engine/language enums + text/instruct/chunk/crossfade caps). Keep error
@@ -2,13 +2,14 @@
2
2
  /**
3
3
  * Runtime VoiceScript→Doc[] wrapper for kk-solo-podcast.
4
4
  *
5
- * Copied with the workflow YAML into $KK_WORKFLOWS_DIR (default
6
- * ~/.config/kk/workflows). Node/Bun builtins only — no @gobing-ai/* and no
7
- * relative imports (those paths do not exist next to the runtime copy).
5
+ * Resolved from the kk package (`plugins/kk/scripts/`) by `kk-workflow-stages.ts`,
6
+ * or from an explicit runtime override ($KK_WORKFLOWS_DIR / ~/.config/kk/workflows)
7
+ * when one exists. Node/Bun builtins only — no @gobing-ai/* and no relative imports
8
+ * (those paths do not exist outside the package).
8
9
  *
9
- * SYNC: plugins/kk/workflows/kk-solo-podcast.yaml (wrap-docs state shells this
10
- * script with scriptPath, outPath, voiceProfile argv). The wrap shape must stay
11
- * a single-Doc array with sha256(file://scriptPath)[0:16] id — voice-gen and
10
+ * SYNC: plugins/kk/scripts/kk-workflow-stages.ts (its `wrap` verb delegates here with the
11
+ * scriptPath, outPath, voiceProfile argv the kk-solo-podcast wrap-docs state passes). The wrap
12
+ * shape must stay a single-Doc array with sha256(file://scriptPath)[0:16] id — voice-gen and
12
13
  * tests depend on it.
13
14
  */
14
15
  import { createHash } from 'node:crypto';
@@ -65,13 +65,12 @@ directly.
65
65
  | Artifact | Path | Written by |
66
66
  | --- | --- | --- |
67
67
  | Brief (input) | `brief.md` | supplied before invocation — topic phrase or Markdown brief |
68
- | Briefing | `1-briefing/briefing.md` | `briefing` — thesis, takeaways, audience, duration, tone |
68
+ | Briefing | `1-briefing-briefing.md` | `briefing` — thesis, takeaways, audience, duration, tone |
69
69
  | Outline options | `2-outline/outline-option-a.md`, `outline-option-b.md`, `outline-option-c.md` | `outline` — always two or three (a and b required; c optional) |
70
70
  | Approved outline | `2-outline/outline-approved.md` | `outline` — after explicit operator selection |
71
- | VoiceScript | `3-script/voicescript.yaml` | `script` — from the approved outline only |
71
+ | VoiceScript | `3-script-voicescript.yaml` | `script` — from the approved outline only |
72
72
 
73
- Each operation creates the directory it writes into (`1-briefing/`, `2-outline/`,
74
- `3-script/`) when absent. No other files are created — no metadata, no JSON
73
+ Each operation creates the directory it writes into (`2-outline/`) when absent; single-file stages write `<step>-<name>` at the workspace root. No other files are created — no metadata, no JSON
75
74
  manifests, no templates, no placeholders.
76
75
 
77
76
  ## Modes
@@ -101,7 +100,7 @@ from any existing approved artifact:
101
100
  2. **Outline** — if `2-outline/outline-approved.md` is missing, run the `outline`
102
101
  semantics (write options, selection gate). If it exists, reuse it — do not
103
102
  regenerate.
104
- 3. **Script** — if `3-script/voicescript.yaml` is missing, run the `script` semantics
103
+ 3. **Script** — if `3-script-voicescript.yaml` is missing, run the `script` semantics
105
104
  (write + review gate). If it exists and is approved, report it as final — do not
106
105
  rewrite.
107
106
  4. **Report** the final artifact paths and stop. Never re-run a completed step; never
@@ -110,15 +109,15 @@ from any existing approved artifact:
110
109
  ### briefing
111
110
 
112
111
  1. **Prerequisite** (fail loud): `brief.md` missing → stop with recovery ("supply a
113
- brief at `<dir>/brief.md` first"). `1-briefing/briefing.md` exists without
112
+ brief at `<dir>/brief.md` first"). `1-briefing-briefing.md` exists without
114
113
  `--force` → stop before replacing.
115
- 2. **Read** `brief.md` and write `1-briefing/briefing.md`: core thesis, key listener
114
+ 2. **Read** `brief.md` and write `1-briefing-briefing.md`: core thesis, key listener
116
115
  takeaways, audience profile, target spoken duration (`--duration` minutes), tone,
117
116
  and what material from the brief to emphasize or cut.
118
117
 
119
118
  ### outline
120
119
 
121
- 1. **Prerequisite** (fail loud): `1-briefing/briefing.md` missing → stop with
120
+ 1. **Prerequisite** (fail loud): `1-briefing-briefing.md` missing → stop with
122
121
  recovery ("run `briefing` or `create` first").
123
122
  2. **Resume**: `2-outline/outline-approved.md` exists → reuse it; without `--force`,
124
123
  stop before replacing.
@@ -135,10 +134,10 @@ from any existing approved artifact:
135
134
  1. **Prerequisite** (fail loud): `2-outline/outline-approved.md` missing → stop with
136
135
  recovery ("run `outline` or `create` first — never script before outline
137
136
  approval").
138
- 2. **Resume**: `3-script/voicescript.yaml` exists → without `--force` or `--revise`,
137
+ 2. **Resume**: `3-script-voicescript.yaml` exists → without `--force` or `--revise`,
139
138
  stop before replacing ("script exists at `<path>`; to revise pass `--revise
140
139
  <feedback>`, to replace pass `--force`").
141
- 3. **Write** `3-script/voicescript.yaml` from the approved outline only, obeying the
140
+ 3. **Write** `3-script-voicescript.yaml` from the approved outline only, obeying the
142
141
  VoiceScript contract and the spoken-budget rule below. Solo mode shape: one
143
142
  speaker, **no** `speakers` map, per-segment `profile` omitted. Emit only valid
144
143
  YAML — no markdown fences, no repo or docs paths in the file body.
@@ -155,9 +154,9 @@ from any existing approved artifact:
155
154
  ## VoiceScript contract
156
155
 
157
156
  The authoring template lives at **`templates/voicescript.solo.yaml`** (relative to
158
- this skill file) — read it first when authoring `3-script/voicescript.yaml`; it is a
157
+ this skill file) — read it first when authoring `3-script-voicescript.yaml`; it is a
159
158
  valid-YAML skeleton with per-field constraint comments. The executable authority is
160
- `plugins/kk/workflows/validate-voicescript.ts` (canonical source
159
+ `plugins/kk/scripts/validate-voicescript.ts` (canonical source
161
160
  `plugins/generations/voice-gen/src/voicescript.ts`); the template is its
162
161
  authoring-time distillation. No other fields are valid authoring targets — do not
163
162
  invent fields (no `default_profile`, no required `title`).
@@ -82,7 +82,7 @@ workspace — it delegates to `topic`, which writes exactly these paths:
82
82
  | Brief | `brief.md` | `topic` `init` |
83
83
  | Outline options | `2-outline/outline-option-{a,b,c}.md` | `topic` `outline` |
84
84
  | Approved outline | `2-outline/outline-approved.md` | `topic` `outline` (after selection gate) |
85
- | Draft | `3-draft/draft-article.md` | `topic` `draft` (from approved outline, review gate) |
85
+ | Draft | `3-draft-draft-article.md` | `topic` `draft` (from approved outline, review gate) |
86
86
 
87
87
  ## create sequence
88
88
 
@@ -104,7 +104,7 @@ workspace — it delegates to `topic`, which writes exactly these paths:
104
104
  show-don't-tell with diagrams/examples, accessibility) plus the platform playbook's constraints
105
105
  (e.g. WeChat mobile formatting or English-platform framing). The draft is written by `topic`
106
106
  from the approved outline; the method shapes it.
107
- 6. **Optional judge gate** — if `--judge` and `3-draft/draft-article.md` is approved, invoke
107
+ 6. **Optional judge gate** — if `--judge` and `3-draft-draft-article.md` is approved, invoke
108
108
  `content-judge` with the `tech-accuracy` rubric. A non-`PASS` verdict is reported to the operator; it
109
109
  does **not** auto-publish and does not auto-revise past `topic`'s 3-round bound.
110
110
  7. **Print** the final artifact paths and stop.
@@ -74,7 +74,7 @@ all five disciplines while authoring the draft.
74
74
 
75
75
  ## Applying this in `create`
76
76
 
77
- While drafting `3-draft/draft-article.md` (after `topic`'s outline gate), apply: one goal per
77
+ While drafting `3-draft-draft-article.md` (after `topic`'s outline gate), apply: one goal per
78
78
  document enforced at the draft-review gate; the Value Proposition as a scope firewall; explicit
79
79
  prerequisites and POLA; show-don't-tell with diagrams/examples; and accessibility. The `--judge`
80
80
  gate then verifies technical accuracy against the rubric.
@@ -69,4 +69,4 @@ for the draft — never reimplements publishing.
69
69
 
70
70
  Load this reference when `--playbook english`. It informs the draft's framing (audience, voice,
71
71
  platform-native format) and the distribution plan, but the deliverable stays `topic`'s
72
- `3-draft/draft-article.md` — this playbook never publishes and never writes a parallel artifact.
72
+ `3-draft-draft-article.md` — this playbook never publishes and never writes a parallel artifact.
@@ -56,5 +56,5 @@ compliance constraints — never reimplements registration, publishing, or the A
56
56
 
57
57
  Load this reference when `--playbook wechat`. It informs the draft's structure (mobile-first
58
58
  formatting, Chinese-language expectations, title/abstract limits, review rigor) but the deliverable
59
- stays `topic`'s `3-draft/draft-article.md` — this playbook never registers an account, never
59
+ stays `topic`'s `3-draft-draft-article.md` — this playbook never registers an account, never
60
60
  publishes, and never touches the WeChat API.
@@ -68,7 +68,7 @@ skill is also callable directly as `Skill(skill="storm-research", args="<topic|-
68
68
  A question constrains the search and the report; a noun phrase invites scope creep.
69
69
  2. **Choose input**: topic sentence, or a markdown file via `--in` (XOR). File mode derives the
70
70
  query from the first ATX H1 (`/^#\s+(.+)$/m`), else the basename without extension.
71
- 3. **`work_dir` is the resolved topic directory** `$works_dir/<topic-id>`, computed by the
71
+ 3. **`work_dir` is the resolved topic directory** `$works_dir/kk-storm-research/<topic-id>`, computed by the
72
72
  invoker (the command or the operator) via the 0056 `topicId()` algorithm — never by the
73
73
  workflow. `prepare` only `mkdir` + materializes files into `${vars.work_dir}`.
74
74
  4. **Pick fixture vs live** (see below). Default is live (`fixture: "false"`); pass
@@ -95,7 +95,7 @@ skill is also callable directly as `Skill(skill="storm-research", args="<topic|-
95
95
 
96
96
  ## Works layout (0056, frozen; ADR-013 adds `references/`)
97
97
 
98
- Per-topic workspace at `$works_dir/<topic-id>/`:
98
+ Per-topic workspace at `$works_dir/kk-storm-research/<topic-id>/`:
99
99
 
100
100
  | File | Written by | Contents |
101
101
  | --- | --- | --- |
@@ -108,7 +108,7 @@ Per-topic workspace at `$works_dir/<topic-id>/`:
108
108
  | `references/<doc-id>.md` | ingest (live path only) | normalized full content per source (`/v2/scrape` → markitdown); file name = Doc id; audit trail and the citation-resolution target for the report tail (ADR-013) |
109
109
 
110
110
  Contrast: `topic`'s authoring workspace is `./<kebab-case(topic)>` with `brief.md` /
111
- `2-outline/` / `3-draft/` and explicitly excludes research. C4 works live under `$works_dir`,
111
+ `2-outline/` / `3-draft-draft-article.md` and explicitly excludes research. C4 works live under `$works_dir`,
112
112
  outside any repo.
113
113
 
114
114
  ## Live vs fixture
@@ -130,8 +130,8 @@ outside any repo.
130
130
  | Both `<topic>` and `--in` set, or neither | exit 1, stderr states the XOR rule; no writes | pass exactly one of `topic` / `--in` |
131
131
  | `--in` file unreadable (missing / I/O) | exit 1, stderr names the path | fix the path / permissions |
132
132
  | Derived query / topic-id empty (no H1 and empty basename) | exit 1, stderr shows the derived value | add an H1 or give the file a real name |
133
- | Dest `$workflows_dir/<name>.yaml` exists with different bytes | warning, **no overwrite**; run proceeds with the user's copy | re-run with `--force` to replace from the install source |
134
- | Workflow YAML cannot be resolved from any install source | exit 1, stderr lists the roots searched (`KK_WORKFLOWS_SOURCE`, `plugins/kk/workflows`) | reinstall the package / set `KK_WORKFLOWS_SOURCE` |
133
+ | Resolved YAML is the user override while an installed copy differs | run proceeds with the override (no drift warning) | re-run with `--force` to refresh the override from the install source |
134
+ | Workflow YAML cannot be resolved from any install source | exit 1, stderr lists the roots searched (user override, `KK_WORKFLOWS_SOURCE`, bun/npm global installs, kk package root, `plugins/kk/workflows`) | reinstall the package / set `KK_WORKFLOWS_SOURCE` |
135
135
  | `KK_CONFIG` set but unreadable, or config unparseable / invalid types | exit 1, stderr names the key + expected vs actual type | fix the file, or delete it (recreated with defaults next run) |
136
136
  | Missing config at `KK_CONFIG` | **not a failure** — create-on-first-run with compiled defaults; an existing file is never overwritten | — |
137
137
  | `markitdown` missing from `PATH` (live mode) | ingest exit 1, stderr `web-search failed: markitdown is not on PATH`; probed before any network call, so no `docs.json` write | install markitdown / put it on `PATH`, re-run ingest |
@@ -64,9 +64,9 @@ All paths are relative to the workspace `--dir`. Every operation uses these exac
64
64
  | Brief | `brief.md` | `init` — topic line, or verbatim copy of the supplied brief |
65
65
  | Outline options | `2-outline/outline-option-a.md`, `outline-option-b.md`, `outline-option-c.md` | `outline` — always two or three (a and b required; c optional) |
66
66
  | Approved outline | `2-outline/outline-approved.md` | `outline` — after explicit operator selection |
67
- | Draft | `3-draft/draft-article.md` | `draft` — from the approved outline only |
67
+ | Draft | `3-draft-draft-article.md` | `draft` — from the approved outline only |
68
68
 
69
- `init` creates `brief.md`, `2-outline/`, and `3-draft/`. No other files are created — no
69
+ `init` creates `brief.md` and `2-outline/`; `draft` writes `3-draft-draft-article.md` at the workspace root. No other files are created — no
70
70
  metadata, no JSON manifests, no templates, no placeholders.
71
71
 
72
72
  ## Operations
@@ -79,7 +79,7 @@ existing approved artifact (R3):
79
79
  1. **Resolve the brief** — topic phrase or `--brief` file; run the `init` semantics.
80
80
  2. **Outline** — if `2-outline/outline-approved.md` is missing, run the `outline`
81
81
  semantics (write options, selection gate). If it exists, reuse it — do not regenerate.
82
- 3. **Draft** — if `3-draft/draft-article.md` is missing, run the `draft` semantics (write
82
+ 3. **Draft** — if `3-draft-draft-article.md` is missing, run the `draft` semantics (write
83
83
  + review gate). If it exists and is approved, report it as final — do not rewrite.
84
84
  4. **Report** the final artifact paths and stop. Never re-run a completed step; never
85
85
  overwrite an existing approved artifact without `--force`.
@@ -94,7 +94,7 @@ existing approved artifact (R3):
94
94
  after explicit operator confirmation to replace, or choose a new `--dir`). Never delete
95
95
  or overwrite existing content without `--force`.
96
96
  3. **Create** `brief.md` (the topic line, or a verbatim copy of the supplied brief),
97
- `2-outline/`, and `3-draft/`.
97
+ `2-outline/`, and the flattened `3-draft-draft-article.md`.
98
98
  4. **Print** the workspace layout and the next step (`outline` or `create`).
99
99
 
100
100
  ### outline
@@ -117,16 +117,16 @@ existing approved artifact (R3):
117
117
 
118
118
  1. **Prerequisite** (fail loud, R5): `2-outline/outline-approved.md` missing → stop with
119
119
  recovery ("run `outline` or `create` first — never draft before outline approval").
120
- 2. **Resume** (R3): `3-draft/draft-article.md` exists → without `--force` or `--revise`,
120
+ 2. **Resume** (R3): `3-draft-draft-article.md` exists → without `--force` or `--revise`,
121
121
  stop before replacing ("draft exists at `<path>`; to revise pass `--revise <feedback>`,
122
122
  to replace pass `--force` after explicit operator approval").
123
- 3. **Write** `3-draft/draft-article.md` from the approved outline only.
123
+ 3. **Write** `3-draft-draft-article.md` from the approved outline only.
124
124
  4. **Review gate** (R1): present the draft; offer **approve** or **revision**. Bounded
125
125
  revision: at most **3 revision rounds**; each round takes `--revise <feedback>`,
126
126
  rewrites the draft from the approved outline plus the feedback, and re-presents it.
127
127
  After 3 rounds, stop and require an explicit operator decision (approve, restart from
128
128
  the outline, or abandon) — never loop past the bound.
129
- 5. **On approval**, the existing `3-draft/draft-article.md` is the approved artifact;
129
+ 5. **On approval**, the existing `3-draft-draft-article.md` is the approved artifact;
130
130
  record the approval and stop. Print the final draft path.
131
131
 
132
132
  ## Fail-loud table (R5)