@gobing-ai/knowledge-kit 0.0.14 → 0.0.15
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.
- package/.claude-plugin/marketplace.json +1 -1
- package/package.json +1 -1
- package/plugins/generations/omni-voice-gen/README.md +9 -3
- package/plugins/generations/omni-voice-gen/profiles.json +5 -1
- package/plugins/generations/omni-voice-gen/src/omni_voice_gen/backend.py +12 -1
- package/plugins/generations/omni-voice-gen/src/omni_voice_gen/pipeline.py +18 -2
- package/plugins/generations/omni-voice-gen/src/omni_voice_gen/profiles.py +8 -0
- package/plugins/generations/omni-voice-gen/src/omni_voice_gen/voicescript.py +0 -12
- package/plugins/generations/omni-voice-gen/voices/robin-news.wav +0 -0
- package/plugins/kk/commands/workflow-run.md +54 -22
- package/plugins/kk/config.example.yaml +5 -0
- package/plugins/kk/plugin.json +1 -1
- package/plugins/kk/scripts/kk-workflow-stages.ts +1226 -0
- package/plugins/kk/{workflows → scripts}/validate-voicescript.ts +4 -4
- package/plugins/kk/{workflows → scripts}/wrap-voicescript-doc.ts +7 -6
- package/plugins/kk/skills/audio-authoring/SKILL.md +11 -12
- package/plugins/kk/skills/itc-generating/SKILL.md +2 -2
- package/plugins/kk/skills/itc-generating/references/generic-craft.md +1 -1
- package/plugins/kk/skills/itc-generating/references/platform-english.md +1 -1
- package/plugins/kk/skills/itc-generating/references/platform-wechat.md +1 -1
- package/plugins/kk/skills/storm-research/SKILL.md +5 -5
- package/plugins/kk/skills/topic/SKILL.md +7 -7
- package/plugins/kk/workflows/kk-daily-ai-voice.yaml +149 -163
- package/plugins/kk/workflows/kk-itc.yaml +12 -29
- package/plugins/kk/workflows/kk-solo-podcast.yaml +72 -131
- package/plugins/kk/workflows/kk-storm-research.yaml +12 -62
|
@@ -19,7 +19,7 @@ vars:
|
|
|
19
19
|
limit: "10"
|
|
20
20
|
language: "zh"
|
|
21
21
|
voice_profile: "robin-news"
|
|
22
|
-
voice_generator: "voice-gen"
|
|
22
|
+
voice_generator: "omni-voice-gen"
|
|
23
23
|
title: ""
|
|
24
24
|
cursor: ""
|
|
25
25
|
state_file: ""
|
|
@@ -34,7 +34,7 @@ vars:
|
|
|
34
34
|
publish_enabled: "false"
|
|
35
35
|
last30days_enabled: "false"
|
|
36
36
|
run_date: ""
|
|
37
|
-
agent: "
|
|
37
|
+
agent: "inline"
|
|
38
38
|
surfdash_post_path: ""
|
|
39
39
|
surfdash_en_post_path: ""
|
|
40
40
|
surfdash_ja_post_path: ""
|
|
@@ -55,14 +55,12 @@ states:
|
|
|
55
55
|
- kind: shell
|
|
56
56
|
options:
|
|
57
57
|
command: >-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
bun -e 'await Bun.write(process.argv[1], JSON.stringify({ topic: process.argv[2] }, null, 2))' "${vars.work_dir}/1-ingest/last30days.json" "${vars.last30days_topic}" &&
|
|
65
|
-
bun -e 'await Bun.write(process.argv[1], JSON.stringify({ hours: Number(process.argv[2]) }, null, 2))' "${vars.work_dir}/1-ingest/horizon.json" "${vars.horizon_hours}"
|
|
58
|
+
kbin="$(command -v kk 2>/dev/null)";
|
|
59
|
+
pkg="$(dirname "$(dirname "$(realpath "$kbin" 2>/dev/null)")")";
|
|
60
|
+
st="$pkg/plugins/kk/scripts/kk-workflow-stages.ts";
|
|
61
|
+
[ -f "$st" ] || st="plugins/kk/scripts/kk-workflow-stages.ts";
|
|
62
|
+
[ -f "$st" ] || echo "kk-workflow-stages.ts not found at $st — install or refresh the kk package (bun link in a checkout)" >&2;
|
|
63
|
+
bun "$st" daily-prepare "${vars.work_dir}" "${vars.limit}" "${vars.cursor}" "${vars.state_file}" "${vars.last30days_enabled}" "${vars.last30days_topic}" "${vars.horizon_hours}"
|
|
66
64
|
- kind: file.read.into-var
|
|
67
65
|
options:
|
|
68
66
|
path: ${vars.work_dir}/run-date.txt
|
|
@@ -78,17 +76,17 @@ states:
|
|
|
78
76
|
# 45m leash; aihot/last30days keep the default.
|
|
79
77
|
command: >-
|
|
80
78
|
__STAMP_T0="$(date -u +%FT%TZ)"; trap '[ -n "${vars.work_dir}" ] && printf "{\"step\":\"collect\",\"startedAt\":\"%s\",\"endedAt\":\"%s\"}\n" "$__STAMP_T0" "$(date -u +%FT%TZ)" >> "${vars.work_dir}/step-timing.json"' EXIT;
|
|
81
|
-
if [ -f "${vars.work_dir}/1-ingest
|
|
82
|
-
kk executor fan-in --source "aihot-ingest:${vars.work_dir}/1-ingest/source.json" --source "last30days-ingest:${vars.work_dir}/1-ingest/last30days.json" --source "horizon-ingest:${vars.work_dir}/1-ingest/horizon.json" --source-timeout-override "horizon-ingest:2700000" --out "${vars.work_dir}/1-ingest
|
|
79
|
+
if [ -f "${vars.work_dir}/1-ingest/${vars.run_date}_02_collect_blended.json" ]; then echo "collect cached: ${vars.work_dir}/1-ingest/${vars.run_date}_02_collect_blended.json"; exit 0; fi;
|
|
80
|
+
kk executor fan-in --source "aihot-ingest:${vars.work_dir}/1-ingest/source.json" --source "last30days-ingest:${vars.work_dir}/1-ingest/last30days.json" --source "horizon-ingest:${vars.work_dir}/1-ingest/horizon.json" --source-timeout-override "horizon-ingest:2700000" --out "${vars.work_dir}/1-ingest/${vars.run_date}_02_collect_blended.json"
|
|
83
81
|
- kind: shell
|
|
84
82
|
options:
|
|
85
83
|
command: >-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
bun -
|
|
84
|
+
kbin="$(command -v kk 2>/dev/null)";
|
|
85
|
+
pkg="$(dirname "$(dirname "$(realpath "$kbin" 2>/dev/null)")")";
|
|
86
|
+
st="$pkg/plugins/kk/scripts/kk-workflow-stages.ts";
|
|
87
|
+
[ -f "$st" ] || st="plugins/kk/scripts/kk-workflow-stages.ts";
|
|
88
|
+
[ -f "$st" ] || echo "kk-workflow-stages.ts not found at $st — install or refresh the kk package (bun link in a checkout)" >&2;
|
|
89
|
+
bun "$st" daily-collect-facts "${vars.work_dir}" "${vars.run_date}" "${vars.plugins_path}"
|
|
92
90
|
|
|
93
91
|
- id: plan
|
|
94
92
|
description: "Score/dedup/select + annotate the blended Doc[] into the episode plan (episode-plan-gen; annotate rides inside planEpisode)"
|
|
@@ -96,14 +94,12 @@ states:
|
|
|
96
94
|
- kind: shell
|
|
97
95
|
options:
|
|
98
96
|
command: >-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
bun -e 'const content = JSON.parse(await Bun.file(process.argv[1]).text()); const docs = content.metadata?.docs; if (!Array.isArray(docs) || docs.length === 0) { console.error("plan: content.metadata.docs missing or empty"); process.exit(1); } await Bun.write(process.argv[2], JSON.stringify(docs, null, 2))' "$PLAN_CONTENT" "$PLAN_DOCS" &&
|
|
106
|
-
test -f "$PLAN_DOCS" || { echo "plan: $PLAN_DOCS not written after episode-plan-gen"; exit 1; }
|
|
97
|
+
kbin="$(command -v kk 2>/dev/null)";
|
|
98
|
+
pkg="$(dirname "$(dirname "$(realpath "$kbin" 2>/dev/null)")")";
|
|
99
|
+
st="$pkg/plugins/kk/scripts/kk-workflow-stages.ts";
|
|
100
|
+
[ -f "$st" ] || st="plugins/kk/scripts/kk-workflow-stages.ts";
|
|
101
|
+
[ -f "$st" ] || echo "kk-workflow-stages.ts not found at $st — install or refresh the kk package (bun link in a checkout)" >&2;
|
|
102
|
+
bun "$st" daily-plan "${vars.work_dir}" "${vars.run_date}" "${vars.plugins_path}" "${vars.plan_max_items}"
|
|
107
103
|
|
|
108
104
|
- id: quality-control-content
|
|
109
105
|
description: "Content QC: filter the plan's annotated candidates by category allowlist + score thresholds (episode-plan-gen --mode filter); zero candidates route to done-no-content"
|
|
@@ -111,12 +107,12 @@ states:
|
|
|
111
107
|
- kind: shell
|
|
112
108
|
options:
|
|
113
109
|
command: >-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
110
|
+
kbin="$(command -v kk 2>/dev/null)";
|
|
111
|
+
pkg="$(dirname "$(dirname "$(realpath "$kbin" 2>/dev/null)")")";
|
|
112
|
+
st="$pkg/plugins/kk/scripts/kk-workflow-stages.ts";
|
|
113
|
+
[ -f "$st" ] || st="plugins/kk/scripts/kk-workflow-stages.ts";
|
|
114
|
+
[ -f "$st" ] || echo "kk-workflow-stages.ts not found at $st — install or refresh the kk package (bun link in a checkout)" >&2;
|
|
115
|
+
bun "$st" daily-qc-content "${vars.work_dir}" "${vars.run_date}" "${vars.plugins_path}" "${vars.qc_categories}" "${vars.qc_min_quality}" "${vars.qc_min_importance}" "${vars.qc_min_urgency}" "${vars.qc_min_impact}"
|
|
120
116
|
|
|
121
117
|
- id: plan-translate
|
|
122
118
|
description: "Translate needsTranslation plan items into the output plan.json via agent.run"
|
|
@@ -126,14 +122,12 @@ states:
|
|
|
126
122
|
role: scribe
|
|
127
123
|
agent: ${vars.agent}
|
|
128
124
|
input: |
|
|
129
|
-
Read
|
|
130
|
-
For every item with needsTranslation
|
|
131
|
-
Titles must read as a news event
|
|
132
|
-
Keep
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
Write the translated array — a valid JSON array of the same length, same item order, same ids — to ${vars.work_dir}/2-plan/plan.json (create the file).
|
|
136
|
-
expectFile: ${vars.work_dir}/2-plan/plan.json
|
|
125
|
+
Read ${vars.work_dir}/2-plan/${vars.run_date}_04_quality-control-content_candidates.json — its metadata.docs (Doc[]) is the episode plan to translate. Do not edit candidates.json.
|
|
126
|
+
For every item with needsTranslation, translate "title" and "body" into natural, concise simplified Chinese.
|
|
127
|
+
Titles must read as a news event (subject + action + object), derived from the body — e.g. "OpenAI 发布 Sora 应用,集成 Sora 2 模型". Keep product/model/company names verbatim, preserve URLs inside the body, and use 「」 instead of raw ASCII double quotes inside Chinese text.
|
|
128
|
+
Keep every other field untouched (id, sourceUri, mediaType, metadata), keep technical terms in their original form where that is clearer, and produce no trailing commas or comments.
|
|
129
|
+
Output strictly valid JSON — a same-length, same-order array carrying the same ids — to ${vars.work_dir}/2-plan/${vars.run_date}_03_plan_plan.json.
|
|
130
|
+
expectFile: ${vars.work_dir}/2-plan/${vars.run_date}_03_plan_plan.json
|
|
137
131
|
allowAppend: false
|
|
138
132
|
|
|
139
133
|
- id: article
|
|
@@ -142,11 +136,12 @@ states:
|
|
|
142
136
|
- kind: shell
|
|
143
137
|
options:
|
|
144
138
|
command: >-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
139
|
+
kbin="$(command -v kk 2>/dev/null)";
|
|
140
|
+
pkg="$(dirname "$(dirname "$(realpath "$kbin" 2>/dev/null)")")";
|
|
141
|
+
st="$pkg/plugins/kk/scripts/kk-workflow-stages.ts";
|
|
142
|
+
[ -f "$st" ] || st="plugins/kk/scripts/kk-workflow-stages.ts";
|
|
143
|
+
[ -f "$st" ] || echo "kk-workflow-stages.ts not found at $st — install or refresh the kk package (bun link in a checkout)" >&2;
|
|
144
|
+
bun "$st" daily-article "${vars.work_dir}" "${vars.run_date}" "${vars.plugins_path}"
|
|
150
145
|
|
|
151
146
|
- id: cover
|
|
152
147
|
description: "Generate the article cover image via the kk:image-authoring skill (agent.run)"
|
|
@@ -157,15 +152,20 @@ states:
|
|
|
157
152
|
agent: ${vars.agent}
|
|
158
153
|
input: |
|
|
159
154
|
Invoke the kk:image-authoring skill (generate operation).
|
|
160
|
-
|
|
161
|
-
Command: --format cover --content ${vars.work_dir}/2-article
|
|
162
|
-
|
|
163
|
-
The plugin writes ${vars.work_dir}/2-cover/content.json plus
|
|
164
|
-
Run 20260911 context: only MINIMAX_API_KEY is credentialed (ARK out of token, google key unset), so the elected provider is minimax and the artifact lands as content-cover-01.jpg.
|
|
155
|
+
Non-interactive step: run every image command with KK_NONINTERACTIVE=1 and KK_IMAGE_AUTO_CONFIRM=1 — never prompt (cover_enabled is the spend approval).
|
|
156
|
+
Command: --format cover --content ${vars.work_dir}/2-article/${vars.run_date}_06_article_article.md --out ${vars.work_dir}/2-cover
|
|
157
|
+
Template variables (title, subtitle, topics) come from the article as the skill owns; do not pass --style.
|
|
158
|
+
The plugin writes ${vars.work_dir}/2-cover/content.json plus ${vars.work_dir}/2-cover/content-cover-01.<ext> (ext follows the elected provider: minimax → .jpg, google/ark → .png). On failure report the error verbatim and stop — no procedural fallback.
|
|
165
159
|
expectFile: ${vars.work_dir}/2-cover/content-cover-01.jpg
|
|
166
160
|
- kind: shell
|
|
167
161
|
options:
|
|
168
|
-
command:
|
|
162
|
+
command: >-
|
|
163
|
+
kbin="$(command -v kk 2>/dev/null)";
|
|
164
|
+
pkg="$(dirname "$(dirname "$(realpath "$kbin" 2>/dev/null)")")";
|
|
165
|
+
st="$pkg/plugins/kk/scripts/kk-workflow-stages.ts";
|
|
166
|
+
[ -f "$st" ] || st="plugins/kk/scripts/kk-workflow-stages.ts";
|
|
167
|
+
[ -f "$st" ] || echo "kk-workflow-stages.ts not found at $st — install or refresh the kk package (bun link in a checkout)" >&2;
|
|
168
|
+
bun "$st" daily-cover-normalize "${vars.work_dir}" "${vars.run_date}"
|
|
169
169
|
|
|
170
170
|
- id: script
|
|
171
171
|
description: "Compile the episode plan Doc[] into structured broadcast VoiceScript YAML Content"
|
|
@@ -173,11 +173,12 @@ states:
|
|
|
173
173
|
- kind: shell
|
|
174
174
|
options:
|
|
175
175
|
command: >-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
176
|
+
kbin="$(command -v kk 2>/dev/null)";
|
|
177
|
+
pkg="$(dirname "$(dirname "$(realpath "$kbin" 2>/dev/null)")")";
|
|
178
|
+
st="$pkg/plugins/kk/scripts/kk-workflow-stages.ts";
|
|
179
|
+
[ -f "$st" ] || st="plugins/kk/scripts/kk-workflow-stages.ts";
|
|
180
|
+
[ -f "$st" ] || echo "kk-workflow-stages.ts not found at $st — install or refresh the kk package (bun link in a checkout)" >&2;
|
|
181
|
+
bun "$st" daily-script "${vars.work_dir}" "${vars.run_date}" "${vars.plugins_path}" "${vars.language}" "${vars.title}" "${vars.voice_profile}"
|
|
181
182
|
|
|
182
183
|
- id: review
|
|
183
184
|
description: "Operator reviews the generated news script before speech synthesis"
|
|
@@ -185,17 +186,21 @@ states:
|
|
|
185
186
|
onEnter:
|
|
186
187
|
- kind: hitl.confirm
|
|
187
188
|
options:
|
|
188
|
-
prompt: "Review daily AI news VoiceScript at ${vars.work_dir}/2-script
|
|
189
|
+
prompt: "Review daily AI news VoiceScript at ${vars.work_dir}/2-script/${vars.run_date}_08_script_voicescript.yaml. Proceed to voice generation?"
|
|
189
190
|
var: __hitlAnswer
|
|
190
191
|
|
|
191
192
|
- id: wrap-docs
|
|
192
|
-
description: "Wrap VoiceScript into Doc[] input for voice
|
|
193
|
+
description: "Wrap VoiceScript into Doc[] input for the voice generator plugin"
|
|
193
194
|
onEnter:
|
|
194
195
|
- kind: shell
|
|
195
196
|
options:
|
|
196
197
|
command: >-
|
|
197
|
-
|
|
198
|
-
|
|
198
|
+
kbin="$(command -v kk 2>/dev/null)";
|
|
199
|
+
pkg="$(dirname "$(dirname "$(realpath "$kbin" 2>/dev/null)")")";
|
|
200
|
+
st="$pkg/plugins/kk/scripts/kk-workflow-stages.ts";
|
|
201
|
+
[ -f "$st" ] || st="plugins/kk/scripts/kk-workflow-stages.ts";
|
|
202
|
+
[ -f "$st" ] || echo "kk-workflow-stages.ts not found at $st — install or refresh the kk package (bun link in a checkout)" >&2;
|
|
203
|
+
bun "$st" daily-wrap-docs "${vars.work_dir}" "${vars.run_date}" "${vars.voice_profile}"
|
|
199
204
|
|
|
200
205
|
- id: generate
|
|
201
206
|
description: "Invoke voice generator plugin (voice_generator var) to generate audio"
|
|
@@ -203,11 +208,12 @@ states:
|
|
|
203
208
|
- kind: shell
|
|
204
209
|
options:
|
|
205
210
|
command: >-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
+
kbin="$(command -v kk 2>/dev/null)";
|
|
212
|
+
pkg="$(dirname "$(dirname "$(realpath "$kbin" 2>/dev/null)")")";
|
|
213
|
+
st="$pkg/plugins/kk/scripts/kk-workflow-stages.ts";
|
|
214
|
+
[ -f "$st" ] || st="plugins/kk/scripts/kk-workflow-stages.ts";
|
|
215
|
+
[ -f "$st" ] || echo "kk-workflow-stages.ts not found at $st — install or refresh the kk package (bun link in a checkout)" >&2;
|
|
216
|
+
bun "$st" daily-generate "${vars.work_dir}" "${vars.run_date}" "${vars.plugins_path}" "${vars.transcode_mp3}" "${vars.voice_generator}"
|
|
211
217
|
|
|
212
218
|
- id: quality-control
|
|
213
219
|
description: "Verify audio quality, speech rate, and silence/repetition QC metrics"
|
|
@@ -215,8 +221,12 @@ states:
|
|
|
215
221
|
- kind: shell
|
|
216
222
|
options:
|
|
217
223
|
command: >-
|
|
218
|
-
|
|
219
|
-
|
|
224
|
+
kbin="$(command -v kk 2>/dev/null)";
|
|
225
|
+
pkg="$(dirname "$(dirname "$(realpath "$kbin" 2>/dev/null)")")";
|
|
226
|
+
st="$pkg/plugins/kk/scripts/kk-workflow-stages.ts";
|
|
227
|
+
[ -f "$st" ] || st="plugins/kk/scripts/kk-workflow-stages.ts";
|
|
228
|
+
[ -f "$st" ] || echo "kk-workflow-stages.ts not found at $st — install or refresh the kk package (bun link in a checkout)" >&2;
|
|
229
|
+
bun "$st" daily-quality-report "${vars.work_dir}" "${vars.run_date}"
|
|
220
230
|
|
|
221
231
|
- id: publish-prep
|
|
222
232
|
description: "Merge article Content with audio (podcast assembly facts ride the content options channel for podcast-pub's absorbed assembly; runDate kept for surfdash slug)"
|
|
@@ -224,8 +234,12 @@ states:
|
|
|
224
234
|
- kind: shell
|
|
225
235
|
options:
|
|
226
236
|
command: >-
|
|
227
|
-
|
|
228
|
-
|
|
237
|
+
kbin="$(command -v kk 2>/dev/null)";
|
|
238
|
+
pkg="$(dirname "$(dirname "$(realpath "$kbin" 2>/dev/null)")")";
|
|
239
|
+
st="$pkg/plugins/kk/scripts/kk-workflow-stages.ts";
|
|
240
|
+
[ -f "$st" ] || st="plugins/kk/scripts/kk-workflow-stages.ts";
|
|
241
|
+
[ -f "$st" ] || echo "kk-workflow-stages.ts not found at $st — install or refresh the kk package (bun link in a checkout)" >&2;
|
|
242
|
+
bun "$st" daily-publish-prep "${vars.work_dir}" "${vars.run_date}"
|
|
229
243
|
|
|
230
244
|
- id: publish-surfdash
|
|
231
245
|
description: "Publish the merged Content to surfdash (single target); result lands in result.json — surfdash publishes first so show-notes can link the article (task 0118 seam reorder)"
|
|
@@ -233,13 +247,12 @@ states:
|
|
|
233
247
|
- kind: shell
|
|
234
248
|
options:
|
|
235
249
|
command: >-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
echo "publish-surfdash: surfdash target dispatched; classification happens after podcast publish"
|
|
250
|
+
kbin="$(command -v kk 2>/dev/null)";
|
|
251
|
+
pkg="$(dirname "$(dirname "$(realpath "$kbin" 2>/dev/null)")")";
|
|
252
|
+
st="$pkg/plugins/kk/scripts/kk-workflow-stages.ts";
|
|
253
|
+
[ -f "$st" ] || st="plugins/kk/scripts/kk-workflow-stages.ts";
|
|
254
|
+
[ -f "$st" ] || echo "kk-workflow-stages.ts not found at $st — install or refresh the kk package (bun link in a checkout)" >&2;
|
|
255
|
+
bun "$st" daily-publish-surfdash "${vars.work_dir}" "${vars.run_date}" "${vars.plugins_path}"
|
|
243
256
|
|
|
244
257
|
- id: show-notes
|
|
245
258
|
description: "Render timeline show notes from the episode plan (podcast-pub show-notes op, briefMode; article URL from the surfdash result postPath — surfdash failure degrades to legacy full-body layout)"
|
|
@@ -247,15 +260,12 @@ states:
|
|
|
247
260
|
- kind: shell
|
|
248
261
|
options:
|
|
249
262
|
command: >-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
RESULT="${vars.work_dir}/3-publish/result.json";
|
|
257
|
-
POST_PATH="$(jq -r '[(.targets // [])[] | select(.target == "surfdash-pub" and .ok == true) | .metadata.postPath // empty] | first // ""' "$RESULT" 2>/dev/null || true)";
|
|
258
|
-
PODCAST_PUB_TITLE="$TITLE_ARG" PODCAST_PUB_RUN_DATE="${vars.run_date}" PODCAST_PUB_BRIEF_MODE=true PODCAST_PUB_ARTICLE_POST_PATH="$POST_PATH" kk executor run podcast-pub --in "${vars.work_dir}/2-plan/plan.json" --out "${vars.work_dir}/3-publish/show-notes.md" "$@"
|
|
263
|
+
kbin="$(command -v kk 2>/dev/null)";
|
|
264
|
+
pkg="$(dirname "$(dirname "$(realpath "$kbin" 2>/dev/null)")")";
|
|
265
|
+
st="$pkg/plugins/kk/scripts/kk-workflow-stages.ts";
|
|
266
|
+
[ -f "$st" ] || st="plugins/kk/scripts/kk-workflow-stages.ts";
|
|
267
|
+
[ -f "$st" ] || echo "kk-workflow-stages.ts not found at $st — install or refresh the kk package (bun link in a checkout)" >&2;
|
|
268
|
+
bun "$st" daily-show-notes "${vars.work_dir}" "${vars.run_date}" "${vars.plugins_path}" "${vars.title}"
|
|
259
269
|
|
|
260
270
|
- id: publish-podcast
|
|
261
271
|
description: "Publish the episode to podcast-pub with the rendered show notes (metadata.showNotes carries the brief/timeline markdown; map.ts falls back to content.body when absent — task 0118 R3)"
|
|
@@ -263,14 +273,12 @@ states:
|
|
|
263
273
|
- kind: shell
|
|
264
274
|
options:
|
|
265
275
|
command: >-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
bun -
|
|
272
|
-
env -u SPUR_WORKFLOW_RUN_ACTIVE kk executor fan-out --content "${vars.work_dir}/3-publish/content.json" --target podcast-pub --out "$RESULT" "$@" || true;
|
|
273
|
-
echo "publish-podcast: podcast target dispatched"
|
|
276
|
+
kbin="$(command -v kk 2>/dev/null)";
|
|
277
|
+
pkg="$(dirname "$(dirname "$(realpath "$kbin" 2>/dev/null)")")";
|
|
278
|
+
st="$pkg/plugins/kk/scripts/kk-workflow-stages.ts";
|
|
279
|
+
[ -f "$st" ] || st="plugins/kk/scripts/kk-workflow-stages.ts";
|
|
280
|
+
[ -f "$st" ] || echo "kk-workflow-stages.ts not found at $st — install or refresh the kk package (bun link in a checkout)" >&2;
|
|
281
|
+
bun "$st" daily-publish-podcast "${vars.work_dir}" "${vars.run_date}" "${vars.plugins_path}"
|
|
274
282
|
|
|
275
283
|
- id: publish
|
|
276
284
|
description: "Classify the sequenced surfdash → podcast outcomes full|partial|none into publish-status.txt (exit 0 in all three — routing is transition-owned; task 0118: per-target classification over the merged result.json)"
|
|
@@ -278,15 +286,12 @@ states:
|
|
|
278
286
|
- kind: shell
|
|
279
287
|
options:
|
|
280
288
|
command: >-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
jq -n --argjson targets "$TARGETS" --argjson ok "$OK_COUNT" --argjson total "$TOTAL" '{ok: ($ok == $total and $total > 0), targets: $targets}' > "$RESULT";
|
|
288
|
-
printf '%s' "$STATUS" > "$STATUS_FILE";
|
|
289
|
-
echo "publish: status=$STATUS ($OK_COUNT/$TOTAL targets published); routing is transition-owned"
|
|
289
|
+
kbin="$(command -v kk 2>/dev/null)";
|
|
290
|
+
pkg="$(dirname "$(dirname "$(realpath "$kbin" 2>/dev/null)")")";
|
|
291
|
+
st="$pkg/plugins/kk/scripts/kk-workflow-stages.ts";
|
|
292
|
+
[ -f "$st" ] || st="plugins/kk/scripts/kk-workflow-stages.ts";
|
|
293
|
+
[ -f "$st" ] || echo "kk-workflow-stages.ts not found at $st — install or refresh the kk package (bun link in a checkout)" >&2;
|
|
294
|
+
bun "$st" daily-publish-classify "${vars.work_dir}" "${vars.run_date}"
|
|
290
295
|
|
|
291
296
|
- id: publish-partial
|
|
292
297
|
description: "Partial publish — at least one target published, at least one failed; echo warning, write a .spur/run marker, preserve result.json for --retry-from, continue to done (task 0118: surfdash failure = no-URL fallback notes; podcast failure = its own partial)"
|
|
@@ -294,12 +299,12 @@ states:
|
|
|
294
299
|
- kind: shell
|
|
295
300
|
options:
|
|
296
301
|
command: >-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
302
|
+
kbin="$(command -v kk 2>/dev/null)";
|
|
303
|
+
pkg="$(dirname "$(dirname "$(realpath "$kbin" 2>/dev/null)")")";
|
|
304
|
+
st="$pkg/plugins/kk/scripts/kk-workflow-stages.ts";
|
|
305
|
+
[ -f "$st" ] || st="plugins/kk/scripts/kk-workflow-stages.ts";
|
|
306
|
+
[ -f "$st" ] || echo "kk-workflow-stages.ts not found at $st — install or refresh the kk package (bun link in a checkout)" >&2;
|
|
307
|
+
bun "$st" daily-publish-partial "${vars.work_dir}" "${vars.run_date}"
|
|
303
308
|
|
|
304
309
|
- id: run-report
|
|
305
310
|
description: "Assemble the per-run report (scores+aggregates+rejected counts+step timing) from existing artifacts — news-report-gen; output-only, never throws; 0117"
|
|
@@ -307,17 +312,12 @@ states:
|
|
|
307
312
|
- kind: shell
|
|
308
313
|
options:
|
|
309
314
|
command: >-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
set --;
|
|
317
|
-
if [ -n "${vars.plugins_path}" ]; then set -- --plugins-path "${vars.plugins_path}"; fi;
|
|
318
|
-
QC_MIN_QUALITY="${vars.qc_min_quality}" QC_MIN_IMPORTANCE="${vars.qc_min_importance}" QC_MIN_URGENCY="${vars.qc_min_urgency}" QC_MIN_IMPACT="${vars.qc_min_impact}" NEWS_REPORT_REJECTED_FILE="${vars.work_dir}/2-plan/candidates.rejected.json" NEWS_REPORT_TIMING_FILE="${vars.work_dir}/step-timing.json" NEWS_REPORT_DATE="${vars.run_date}" kk executor run news-report-gen --in "$CANDS" --out "${vars.work_dir}/run-report.json" "$@" &&
|
|
319
|
-
bun -e 'await Bun.write(process.argv[2], (await Bun.file(process.argv[1]).json()).body)' "${vars.work_dir}/run-report.json" "$REPORT_MD" &&
|
|
320
|
-
echo "run report written: $REPORT_MD"
|
|
315
|
+
kbin="$(command -v kk 2>/dev/null)";
|
|
316
|
+
pkg="$(dirname "$(dirname "$(realpath "$kbin" 2>/dev/null)")")";
|
|
317
|
+
st="$pkg/plugins/kk/scripts/kk-workflow-stages.ts";
|
|
318
|
+
[ -f "$st" ] || st="plugins/kk/scripts/kk-workflow-stages.ts";
|
|
319
|
+
[ -f "$st" ] || echo "kk-workflow-stages.ts not found at $st — install or refresh the kk package (bun link in a checkout)" >&2;
|
|
320
|
+
bun "$st" daily-run-report "${vars.work_dir}" "${vars.run_date}" "${vars.plugins_path}" "${vars.qc_min_quality}" "${vars.qc_min_importance}" "${vars.qc_min_urgency}" "${vars.qc_min_impact}"
|
|
321
321
|
|
|
322
322
|
- id: translate-en
|
|
323
323
|
description: "Scaffold en draft from the zh article via surfdash-pub scaffold-locale (postPath from publish result; done-no-content/none-publish runs carry no zh path and skip)"
|
|
@@ -325,27 +325,19 @@ states:
|
|
|
325
325
|
- kind: shell
|
|
326
326
|
options:
|
|
327
327
|
command: >-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
printf '%s' "$EN" > "${vars.work_dir}/3-publish/en-post-path.txt";
|
|
335
|
-
test -n "$ZH" || { echo "no zh post path — skip translate-en"; exit 0; };
|
|
336
|
-
if [ -f "$EN" ]; then echo "en draft cached: $EN"; exit 0; fi;
|
|
337
|
-
set --;
|
|
338
|
-
if [ -n "${vars.plugins_path}" ]; then set -- --plugins-path "${vars.plugins_path}"; fi;
|
|
339
|
-
jq -n --arg postPath "$ZH" --arg target en '{body: "", options: {operation: "scaffold-locale", postPath: $postPath, target: $target}}' > "${vars.work_dir}/3-publish/scaffold-en.json" &&
|
|
340
|
-
kk executor run surfdash-pub --in "${vars.work_dir}/3-publish/scaffold-en.json" --out "${vars.work_dir}/3-publish/scaffold-en-result.json" "$@" &&
|
|
341
|
-
jq -r '.metadata.draftPath // ""' "${vars.work_dir}/3-publish/scaffold-en-result.json" > "${vars.work_dir}/3-publish/en-post-path.txt"
|
|
328
|
+
kbin="$(command -v kk 2>/dev/null)";
|
|
329
|
+
pkg="$(dirname "$(dirname "$(realpath "$kbin" 2>/dev/null)")")";
|
|
330
|
+
st="$pkg/plugins/kk/scripts/kk-workflow-stages.ts";
|
|
331
|
+
[ -f "$st" ] || st="plugins/kk/scripts/kk-workflow-stages.ts";
|
|
332
|
+
[ -f "$st" ] || echo "kk-workflow-stages.ts not found at $st — install or refresh the kk package (bun link in a checkout)" >&2;
|
|
333
|
+
bun "$st" daily-translate-en "${vars.work_dir}" "${vars.run_date}" "${vars.plugins_path}"
|
|
342
334
|
- kind: file.read.into-var
|
|
343
335
|
options:
|
|
344
|
-
path: ${vars.work_dir}/3-publish
|
|
336
|
+
path: ${vars.work_dir}/3-publish/${vars.run_date}_20_translate-en_zh-post-path.txt
|
|
345
337
|
var: surfdash_post_path
|
|
346
338
|
- kind: file.read.into-var
|
|
347
339
|
options:
|
|
348
|
-
path: ${vars.work_dir}/3-publish
|
|
340
|
+
path: ${vars.work_dir}/3-publish/${vars.run_date}_20_translate-en_en-post-path.txt
|
|
349
341
|
var: surfdash_en_post_path
|
|
350
342
|
|
|
351
343
|
- id: translate-en-agent
|
|
@@ -368,21 +360,15 @@ states:
|
|
|
368
360
|
- kind: shell
|
|
369
361
|
options:
|
|
370
362
|
command: >-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
set --;
|
|
378
|
-
if [ -n "${vars.plugins_path}" ]; then set -- --plugins-path "${vars.plugins_path}"; fi;
|
|
379
|
-
jq -n --arg postPath "$ZH" --arg target ja '{body: "", options: {operation: "scaffold-locale", postPath: $postPath, target: $target}}' > "${vars.work_dir}/3-publish/scaffold-ja.json" &&
|
|
380
|
-
kk executor run surfdash-pub --in "${vars.work_dir}/3-publish/scaffold-ja.json" --out "${vars.work_dir}/3-publish/scaffold-ja-result.json" "$@" &&
|
|
381
|
-
JA="$(jq -r '.metadata.draftPath // ""' "${vars.work_dir}/3-publish/scaffold-ja-result.json")" &&
|
|
382
|
-
printf '%s' "$JA" > "${vars.work_dir}/3-publish/ja-post-path.txt"
|
|
363
|
+
kbin="$(command -v kk 2>/dev/null)";
|
|
364
|
+
pkg="$(dirname "$(dirname "$(realpath "$kbin" 2>/dev/null)")")";
|
|
365
|
+
st="$pkg/plugins/kk/scripts/kk-workflow-stages.ts";
|
|
366
|
+
[ -f "$st" ] || st="plugins/kk/scripts/kk-workflow-stages.ts";
|
|
367
|
+
[ -f "$st" ] || echo "kk-workflow-stages.ts not found at $st — install or refresh the kk package (bun link in a checkout)" >&2;
|
|
368
|
+
bun "$st" daily-translate-ja "${vars.work_dir}" "${vars.run_date}" "${vars.plugins_path}"
|
|
383
369
|
- kind: file.read.into-var
|
|
384
370
|
options:
|
|
385
|
-
path: ${vars.work_dir}/3-publish
|
|
371
|
+
path: ${vars.work_dir}/3-publish/${vars.run_date}_22_translate-ja_ja-post-path.txt
|
|
386
372
|
var: surfdash_ja_post_path
|
|
387
373
|
|
|
388
374
|
- id: translate-ja-agent
|
|
@@ -405,12 +391,12 @@ states:
|
|
|
405
391
|
- kind: shell
|
|
406
392
|
options:
|
|
407
393
|
command: >-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
394
|
+
kbin="$(command -v kk 2>/dev/null)";
|
|
395
|
+
pkg="$(dirname "$(dirname "$(realpath "$kbin" 2>/dev/null)")")";
|
|
396
|
+
st="$pkg/plugins/kk/scripts/kk-workflow-stages.ts";
|
|
397
|
+
[ -f "$st" ] || st="plugins/kk/scripts/kk-workflow-stages.ts";
|
|
398
|
+
[ -f "$st" ] || echo "kk-workflow-stages.ts not found at $st — install or refresh the kk package (bun link in a checkout)" >&2;
|
|
399
|
+
bun "$st" daily-translate-sync "${vars.work_dir}" "${vars.run_date}" "${vars.plugins_path}" "${vars.surfdash_post_path}"
|
|
414
400
|
|
|
415
401
|
- id: done
|
|
416
402
|
description: "Terminal — Daily AI news pipeline completed (collect → QC'd plan → article/cover/script/voice → publish/locales)"
|
|
@@ -446,7 +432,7 @@ transitions:
|
|
|
446
432
|
guard:
|
|
447
433
|
kind: shell
|
|
448
434
|
options:
|
|
449
|
-
command: 'test "$(jq ''.metadata.docs | length == 0'' "${vars.work_dir}/2-plan
|
|
435
|
+
command: 'test "$(jq ''.metadata.docs | length == 0'' "${vars.work_dir}/2-plan/${vars.run_date}_04_quality-control-content_candidates.json")" = "true"'
|
|
450
436
|
|
|
451
437
|
- from: quality-control-content
|
|
452
438
|
to: plan-translate
|
|
@@ -476,7 +462,7 @@ transitions:
|
|
|
476
462
|
guard:
|
|
477
463
|
kind: shell
|
|
478
464
|
options:
|
|
479
|
-
command: 'test "${vars.cover_enabled}" = "true" && test ! -f "${vars.work_dir}/2-cover
|
|
465
|
+
command: 'test "${vars.cover_enabled}" = "true" && test ! -f "${vars.work_dir}/2-cover/${vars.run_date}_07_cover_cover.png"'
|
|
480
466
|
|
|
481
467
|
- from: article
|
|
482
468
|
to: script
|
|
@@ -538,7 +524,7 @@ transitions:
|
|
|
538
524
|
guard:
|
|
539
525
|
kind: shell
|
|
540
526
|
options:
|
|
541
|
-
command: 'test "${vars.publish_enabled}" = "true" && test "$(jq -r ''.metadata.qc.passed // true'' "${vars.work_dir}/3-audio
|
|
527
|
+
command: 'test "${vars.publish_enabled}" = "true" && test "$(jq -r ''.metadata.qc.passed // true'' "${vars.work_dir}/3-audio/${vars.run_date}_11_generate_content.json")" = "true"'
|
|
542
528
|
|
|
543
529
|
- from: quality-control
|
|
544
530
|
to: done
|
|
@@ -546,7 +532,7 @@ transitions:
|
|
|
546
532
|
guard:
|
|
547
533
|
kind: shell
|
|
548
534
|
options:
|
|
549
|
-
command: 'test "${vars.publish_enabled}" != "true" && test "$(jq -r ''.metadata.qc.passed // true'' "${vars.work_dir}/3-audio
|
|
535
|
+
command: 'test "${vars.publish_enabled}" != "true" && test "$(jq -r ''.metadata.qc.passed // true'' "${vars.work_dir}/3-audio/${vars.run_date}_11_generate_content.json")" = "true"'
|
|
550
536
|
|
|
551
537
|
- from: quality-control
|
|
552
538
|
to: failed
|
|
@@ -584,7 +570,7 @@ transitions:
|
|
|
584
570
|
guard:
|
|
585
571
|
kind: shell
|
|
586
572
|
options:
|
|
587
|
-
command: 'test "$(cat "${vars.work_dir}/3-publish
|
|
573
|
+
command: 'test "$(cat "${vars.work_dir}/3-publish/${vars.run_date}_17_publish_publish-status.txt")" = "full"'
|
|
588
574
|
|
|
589
575
|
- from: publish
|
|
590
576
|
to: publish-partial
|
|
@@ -592,7 +578,7 @@ transitions:
|
|
|
592
578
|
guard:
|
|
593
579
|
kind: shell
|
|
594
580
|
options:
|
|
595
|
-
command: 'test "$(cat "${vars.work_dir}/3-publish
|
|
581
|
+
command: 'test "$(cat "${vars.work_dir}/3-publish/${vars.run_date}_17_publish_publish-status.txt")" = "partial"'
|
|
596
582
|
|
|
597
583
|
- from: publish
|
|
598
584
|
to: failed
|
|
@@ -600,7 +586,7 @@ transitions:
|
|
|
600
586
|
guard:
|
|
601
587
|
kind: shell
|
|
602
588
|
options:
|
|
603
|
-
command: 'test "$(cat "${vars.work_dir}/3-publish
|
|
589
|
+
command: 'test "$(cat "${vars.work_dir}/3-publish/${vars.run_date}_17_publish_publish-status.txt")" = "none"'
|
|
604
590
|
|
|
605
591
|
- from: publish-partial
|
|
606
592
|
to: run-report
|
|
@@ -614,7 +600,7 @@ transitions:
|
|
|
614
600
|
guard:
|
|
615
601
|
kind: shell
|
|
616
602
|
options:
|
|
617
|
-
command: 'test "$(cat "${vars.work_dir}/3-publish
|
|
603
|
+
command: 'test "$(cat "${vars.work_dir}/3-publish/${vars.run_date}_17_publish_publish-status.txt")" = "full"'
|
|
618
604
|
|
|
619
605
|
- from: run-report
|
|
620
606
|
to: done
|
|
@@ -622,7 +608,7 @@ transitions:
|
|
|
622
608
|
guard:
|
|
623
609
|
kind: shell
|
|
624
610
|
options:
|
|
625
|
-
command: 'test "$(cat "${vars.work_dir}/3-publish
|
|
611
|
+
command: 'test "$(cat "${vars.work_dir}/3-publish/${vars.run_date}_17_publish_publish-status.txt")" = "partial"'
|
|
626
612
|
|
|
627
613
|
- from: translate-en
|
|
628
614
|
to: translate-en-agent
|