@gobing-ai/knowledge-kit 0.0.22 → 0.0.24

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 (76) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/index.js +137 -59
  3. package/package.json +4 -4
  4. package/plugins/generations/content-gen/dist/index.js +97 -45
  5. package/plugins/generations/core-facts-gen/dist/index.js +106 -57
  6. package/plugins/generations/daily-article-gen/dist/index.js +105 -56
  7. package/plugins/generations/dailynews-gen/dist/index.js +235 -57
  8. package/plugins/generations/dailynews-gen/src/index.ts +67 -2
  9. package/plugins/generations/dailynews-gen/src/script-builder.ts +36 -15
  10. package/plugins/generations/dailynews-gen/src/script-plan.ts +142 -0
  11. package/plugins/generations/episode-plan-gen/dist/index.js +115 -66
  12. package/plugins/generations/gemini-tts/README.md +125 -0
  13. package/plugins/generations/gemini-tts/dist/index.js +23348 -0
  14. package/plugins/generations/gemini-tts/package.json +16 -0
  15. package/plugins/generations/gemini-tts/plugin.json +6 -0
  16. package/plugins/generations/gemini-tts/profiles.json +3 -0
  17. package/plugins/generations/gemini-tts/src/gemini-client.ts +220 -0
  18. package/plugins/generations/gemini-tts/src/index.ts +33 -0
  19. package/plugins/generations/gemini-tts/src/voice-create.ts +180 -0
  20. package/plugins/generations/gemini-tts/tsconfig.json +8 -0
  21. package/plugins/generations/image-gen/dist/index.js +338 -117
  22. package/plugins/generations/image-gen/presets/formats/daily-news-cover.yaml +19 -0
  23. package/plugins/generations/image-gen/presets/formats/xhs-card.yaml +55 -0
  24. package/plugins/generations/image-gen/presets/styles/daily-news.yaml +9 -0
  25. package/plugins/generations/image-gen/presets/styles/xhs-knowledge.yaml +7 -0
  26. package/plugins/generations/image-gen/src/index.ts +148 -14
  27. package/plugins/generations/image-gen/src/job.ts +30 -0
  28. package/plugins/generations/image-gen/src/providers/errors.ts +91 -0
  29. package/plugins/generations/image-gen/src/providers/types.ts +79 -0
  30. package/plugins/generations/news-report-gen/dist/index.js +136 -55
  31. package/plugins/generations/news-report-gen/src/index.ts +57 -1
  32. package/plugins/generations/voice-gen/dist/index.js +121 -69
  33. package/plugins/generations/voice-gen/package.json +3 -0
  34. package/plugins/generations/voice-gen/src/index.ts +2 -1
  35. package/plugins/generations/voice-gen/src/voicebox-client.ts +2 -1
  36. package/plugins/ingestions/aihot-ingest/dist/index.js +103 -53
  37. package/plugins/ingestions/horizon-ingest/dist/index.js +102 -53
  38. package/plugins/ingestions/karakeep-local/dist/index.js +273 -224
  39. package/plugins/ingestions/last30days-ingest/dist/index.js +97 -48
  40. package/plugins/ingestions/web-search/dist/index.js +121 -72
  41. package/plugins/kk/config.example.yaml +13 -0
  42. package/plugins/kk/plugin.json +1 -1
  43. package/plugins/kk/scripts/daily-voice-style.zh.md +52 -0
  44. package/plugins/kk/scripts/kk-workflow-stages.ts +438 -17
  45. package/plugins/kk/skills/publish/SKILL.md +24 -1
  46. package/plugins/kk/skills/xhs-images/SKILL.md +89 -0
  47. package/plugins/kk/skills/xhs-images/references/card-layouts.md +35 -0
  48. package/plugins/kk/workflows/kk-daily-ai-voice.yaml +164 -13
  49. package/plugins/publishings/emdash-pub/dist/index.js +94 -45
  50. package/plugins/publishings/infoq-pub/dist/index.js +94 -45
  51. package/plugins/publishings/juejin-pub/dist/index.js +94 -45
  52. package/plugins/publishings/medium-pub/dist/index.js +94 -45
  53. package/plugins/publishings/podcast-pub/dist/index.js +115 -55
  54. package/plugins/publishings/podcast-pub/src/map.ts +30 -10
  55. package/plugins/publishings/podcast-pub/src/show-notes.ts +6 -1
  56. package/plugins/publishings/qiita-pub/dist/index.js +94 -45
  57. package/plugins/publishings/substack-pub/dist/index.js +94 -45
  58. package/plugins/publishings/surfdash-pub/dist/index.js +99 -63
  59. package/plugins/publishings/surfdash-pub/src/index.ts +10 -1
  60. package/plugins/publishings/wechatmp-pub/dist/index.js +94 -45
  61. package/plugins/publishings/x-pub/dist/index.js +94 -45
  62. package/plugins/publishings/xhs-pub/dist/index.js +8908 -229
  63. package/plugins/publishings/xhs-pub/package.json +1 -0
  64. package/plugins/publishings/xhs-pub/plugin.json +1 -1
  65. package/plugins/publishings/xhs-pub/src/automation-guard.ts +128 -0
  66. package/plugins/publishings/xhs-pub/src/index.ts +753 -24
  67. package/plugins/publishings/xhs-pub/src/profile-check.ts +133 -0
  68. package/plugins/publishings/zenn-pub/dist/index.js +94 -45
  69. package/plugins/sp/lib/env.ts +46 -0
  70. package/plugins/sp/lib/inline-run.generated.mjs +1489 -0
  71. package/plugins/sp/scripts/feature-verification-steps.ts +275 -0
  72. package/plugins/sp/scripts/inline-run-setup.ts +571 -47
  73. package/plugins/sp/scripts/wrapup-drift-probe.mjs +190 -0
  74. package/plugins/sp/scripts/wrapup-drift-probe.ts +258 -0
  75. package/plugins/sp/scripts/wrapup-steps.mjs +77 -6
  76. package/plugins/sp/scripts/wrapup-steps.ts +91 -5
@@ -0,0 +1,125 @@
1
+ # gemini-tts operator runbook
2
+
3
+ One-time setup for the replicated `robin-news` voice, and the yearly renewal. The daily workflow
4
+ stays on `vdriver: voicebox` until you opt in with `vdriver: gemini`.
5
+
6
+ The API key stays in the environment or in `~/.config/kk/config.yaml`. This runbook never asks you
7
+ to paste it into the repo. Source and consent clips are biometric data: keep them out of git.
8
+ Operator-run copies belong in a scratch directory outside the checkout.
9
+
10
+ ## Consent statement
11
+
12
+ The same speaker as the source clip reads this verbatim, in zh-CN:
13
+
14
+ > 我是此声音的拥有者并授权谷歌使用此声音创建语音合成模型
15
+
16
+ Or in English (en-US):
17
+
18
+ > I am the owner of this voice and I consent to Google using it to create a synthetic voice model.
19
+
20
+ Note: Google's verification model penalizes cross-lingual acoustic drift (e.g. Chinese source clip paired with an English consent clip will fail with `Voice mismatch detected`). To replicate cleanly, ensure both source and consent are in the same language. A clean 10–30 s English recording containing the consent statement can be passed as both `--source` and `--consent`.
21
+
22
+ ## Export the Voicebox sample
23
+
24
+ The consent clip lives in Voicebox as a cloned-voice profile named `gemini-consent-clip`, not as a
25
+ history entry (`GET /history` 500s on the current build). Default origin: `http://127.0.0.1:17493`.
26
+
27
+ 1. `GET /profiles` and match `name == gemini-consent-clip`.
28
+ 2. `GET /profiles/{id}/samples` and take that profile's sample id.
29
+ 3. `GET /samples/{sample_id}` — the body is `audio/wav`.
30
+
31
+ Write that body to a scratch file, for example `$T/consent.wav`.
32
+
33
+ The source clip is already in the repo and already 24 kHz mono 16-bit PCM, about 28 s:
34
+
35
+ `plugins/generations/omni-voice-gen/voices/robin-news.wav`
36
+
37
+ ## Convert a clip that is not already 24 kHz mono s16
38
+
39
+ Skip this when `ffprobe` already reports `24000 Hz`, `1` channel, `pcm_s16le`.
40
+
41
+ ```sh
42
+ ffmpeg -i consent.m4a -ar 24000 -ac 1 -sample_fmt s16 consent.wav
43
+ ```
44
+
45
+ `voice-create` rejects anything else. A source clip must also be 10–30 seconds. The error names the
46
+ measured rate, channels, bit depth, and duration.
47
+
48
+ ## Create the stored voice
49
+
50
+ `--store` defaults to `true`. An unstored `voicekey_…` id expires in 7 days and is the wrong choice
51
+ for the daily workflow. Create with `gemini-3.8-flash-tts` (or omit `--model`). `gemini-3.8-flash-lite-tts`
52
+ does not replicate: the API returns HTTP 400 telling you to omit `voice.model`. A stored voice can
53
+ then be synthesized with either TTS model.
54
+
55
+ ```sh
56
+ T=$(mktemp -d)
57
+ # fetch the consent sample into "$T/consent.wav" (see above)
58
+ GEMINI_API_KEY="$GEMINI_API_KEY" bun plugins/generations/gemini-tts/src/voice-create.ts \
59
+ --source plugins/generations/omni-voice-gen/voices/robin-news.wav \
60
+ --consent "$T/consent.wav" \
61
+ --name robin-news
62
+ rm -rf "$T"
63
+ ```
64
+
65
+ Stdout is the `voice_…` id. A non-zero exit prints the HTTP status and API message and does not
66
+ print the key. Note on HTTP 500 / Voice mismatch errors:
67
+ - Upstream `POST /v1beta/voices` can return HTTP 500 when server-side validation serializes an invalid argument or consent mismatch.
68
+ - 2026-09-24: the zh pair that created the original voice (28 s zh source + 7 s zh consent) started returning HTTP 500 "Error translating server response to JSON" on both accounts. The en-pair path (below) succeeded first try — prefer it for renewals.
69
+ - A Chinese source paired with an English consent fails with `Voice mismatch detected`.
70
+ - Using a clean 10–30s English recording containing the verbatim consent statement as both `--source` and `--consent` succeeds reliably via the API, creating a stored voice that synthesizes both English and Chinese content.
71
+ - Google AI Studio's interactive voice replication UI is also available as a manual fallback.
72
+ Re-record the source and consent in one session and retry if needed; do not commit the clips.
73
+
74
+ ## Wire the id
75
+
76
+ Write the operator-private map `~/.config/kk/gemini-tts-profiles.json`:
77
+
78
+ ```json
79
+ { "robin-news": { "voice": "voice_…" } }
80
+ ```
81
+
82
+ Point the plugin at it. Under `plugins.generations.gemini-tts.env` in `~/.config/kk/config.yaml`:
83
+
84
+ ```yaml
85
+ GEMINI_TTS_PROFILES: /Users/<you>/.config/kk/gemini-tts-profiles.json
86
+ ```
87
+
88
+ The committed `profiles.json` stays on `voice_REPLACE_ME`. That placeholder fails closed with a
89
+ pointer back to this file.
90
+
91
+ Then render once per model (`gemini-3.8-flash-tts` and `gemini-3.8-flash-lite-tts`). If flash-lite
92
+ rejects the stored voice, keep `GEMINI_TTS_MODEL` on the creation model. Create a second voice only
93
+ when you explicitly want a lite-specific id.
94
+
95
+ Run the daily workflow with `--vars '{"vdriver":"gemini"}'`. The default `vdriver` remains
96
+ `voicebox`.
97
+
98
+ ### Stable persona across segments (`GEMINI_TTS_STYLE`)
99
+
100
+ Gemini re-interprets its short-clip custom voice per style annotation. A script that varies
101
+ `emotion` per segment (intro warm, news clear, commentary thoughtful, …) therefore drifts the
102
+ persona across segment boundaries — audible as voice-identity loss and mood swings (2026-09-24
103
+ episode review). Set one style for the whole episode to pin the persona:
104
+
105
+ ```yaml
106
+ GEMINI_TTS_STYLE: calm professional podcast host, steady pace, natural conversational tone
107
+ ```
108
+
109
+ When set it replaces every segment's own instruct; per-segment instructions still apply when
110
+ unset.
111
+
112
+ ### Daily quota (Tier 1: ~100 requests/day)
113
+
114
+ `gemini-3.8-flash-tts` on a Tier 1 key allows ~100 requests/day (UTC reset — quota 429s quote
115
+ a retry-in horizon into the next UTC midnight). A full episode (~31 segments + QC regens ≈
116
+ 35–45 calls) essentially spends the day's budget, and the daily workflow shares it with any
117
+ tuning run. The client caps transient 429 backoff at 120s and fails loudly when `retry-after`
118
+ exceeds that (it used to sleep out the ~19h horizon, which looked like a wedged run —
119
+ 2026-09-24). For style/voice tuning, synthesize 2–3 segments instead of the full episode.
120
+
121
+ ## Renewal
122
+
123
+ A stored voice lasts 1 year (200 stored voices per project, shared with prompted voices). Before
124
+ `expire_time`, repeat export → create → replace the id in the operator map. Delete the scratch
125
+ clips when the new id is wired. Do not commit the wavs or the voice id.