@gobing-ai/knowledge-kit 0.0.32 → 0.0.34
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/dist/index.js +43047 -24724
- package/package.json +4 -4
- package/plugins/generations/content-gen/dist/index.js +10 -9
- package/plugins/generations/core-facts-gen/dist/index.js +13 -12
- package/plugins/generations/daily-article-gen/dist/index.js +16 -21
- package/plugins/generations/daily-article-gen/src/index.ts +8 -12
- package/plugins/generations/dailynews-gen/dist/index.js +23 -21
- package/plugins/generations/dailynews-gen/src/script-builder.ts +25 -26
- package/plugins/generations/episode-plan-gen/dist/index.js +58 -15
- package/plugins/generations/episode-plan-gen/src/index.ts +76 -6
- package/plugins/generations/gemini-tts/README.md +11 -0
- package/plugins/generations/gemini-tts/dist/index.js +10 -9
- package/plugins/generations/image-gen/dist/index.js +171 -153
- package/plugins/generations/image-gen/presets/formats/xhs-card.yaml +16 -14
- package/plugins/generations/image-gen/presets/styles/xhs-knowledge.yaml +2 -2
- package/plugins/generations/image-gen/src/compose/card.ts +17 -2
- package/plugins/generations/image-gen/src/compose/chromium.ts +60 -42
- package/plugins/generations/news-report-gen/dist/index.js +13 -12
- package/plugins/generations/voice-gen/dist/index.js +10 -9
- package/plugins/ingestions/aihot-ingest/dist/index.js +13 -12
- package/plugins/ingestions/horizon-ingest/dist/index.js +13 -12
- package/plugins/ingestions/karakeep-local/dist/index.js +13 -13
- package/plugins/ingestions/last30days-ingest/dist/index.js +13 -12
- package/plugins/ingestions/web-search/dist/index.js +11 -10
- package/plugins/kk/README.md +38 -0
- package/plugins/kk/decisions/extract/ai-news.yaml +27 -0
- package/plugins/kk/decisions/kk-items.yaml +179 -0
- package/plugins/kk/plugin.json +1 -1
- package/plugins/kk/schedules/cron.tmpl +15 -0
- package/plugins/kk/schedules/launchd.plist.tmpl +77 -0
- package/plugins/kk/scripts/daily-stages.ts +2023 -0
- package/plugins/kk/scripts/daily-voice-style.zh.md +15 -10
- package/plugins/kk/scripts/kk-workflow-stages.ts +253 -1368
- package/plugins/kk/skills/content-safety/SKILL.md +39 -8
- package/plugins/kk/skills/content-safety/references/platforms/apple-podcasts.md +2 -2
- package/plugins/kk/skills/web-automation/SKILL.md +100 -0
- package/plugins/kk/skills/web-automation/references/browser-launch.md +86 -0
- package/plugins/kk/workflows/kk-collect.yaml +256 -0
- package/plugins/kk/workflows/kk-daily-ai-voice.yaml +9 -3
- package/plugins/kk/workflows/kk-daily-ai-voice2.yaml +774 -0
- package/plugins/kk/workflows/kk-daily-safety.yaml +167 -0
- package/plugins/publishings/emdash-pub/dist/index.js +10 -9
- package/plugins/publishings/infoq-pub/dist/index.js +152 -59
- package/plugins/publishings/infoq-pub/plugin.json +1 -0
- package/plugins/publishings/infoq-pub/src/index.ts +167 -55
- package/plugins/publishings/infoq-pub/src/profile-check.ts +4 -2
- package/plugins/publishings/juejin-pub/dist/index.js +111 -30
- package/plugins/publishings/juejin-pub/plugin.json +1 -0
- package/plugins/publishings/juejin-pub/src/index.ts +49 -9
- package/plugins/publishings/medium-pub/dist/index.js +10 -9
- package/plugins/publishings/podcast-pub/dist/index.js +10 -9
- package/plugins/publishings/qiita-pub/dist/index.js +10 -9
- package/plugins/publishings/substack-pub/dist/index.js +105 -28
- package/plugins/publishings/substack-pub/plugin.json +1 -0
- package/plugins/publishings/substack-pub/src/index.ts +39 -8
- package/plugins/publishings/substack-pub/src/profile-check.ts +2 -0
- package/plugins/publishings/surfdash-pub/dist/index.js +10 -9
- package/plugins/publishings/wechatmp-pub/dist/index.js +115 -31
- package/plugins/publishings/wechatmp-pub/plugin.json +1 -0
- package/plugins/publishings/wechatmp-pub/src/index.ts +42 -9
- package/plugins/publishings/wechatmp-pub/src/profile-check.ts +84 -40
- package/plugins/publishings/x-pub/dist/index.js +114 -35
- package/plugins/publishings/x-pub/plugin.json +1 -0
- package/plugins/publishings/x-pub/src/index.ts +68 -14
- package/plugins/publishings/xhs-pub/dist/index.js +154 -59
- package/plugins/publishings/xhs-pub/plugin.json +1 -0
- package/plugins/publishings/xhs-pub/src/flow.ts +9 -3
- package/plugins/publishings/xhs-pub/src/index.ts +119 -9
- package/plugins/publishings/xhs-pub/src/page.ts +4 -17
- package/plugins/publishings/xhs-pub/src/profile-check.ts +28 -15
- package/plugins/publishings/zenn-pub/dist/index.js +10 -9
|
@@ -14642,7 +14642,7 @@ var init_zod = __esm(() => {
|
|
|
14642
14642
|
init_external();
|
|
14643
14643
|
});
|
|
14644
14644
|
|
|
14645
|
-
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.
|
|
14645
|
+
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.21/node_modules/@gobing-ai/ts-utils/dist/errors.js
|
|
14646
14646
|
var ErrorCode;
|
|
14647
14647
|
var init_errors3 = __esm(() => {
|
|
14648
14648
|
ErrorCode = {
|
|
@@ -14653,7 +14653,7 @@ var init_errors3 = __esm(() => {
|
|
|
14653
14653
|
};
|
|
14654
14654
|
});
|
|
14655
14655
|
|
|
14656
|
-
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.
|
|
14656
|
+
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.21/node_modules/@gobing-ai/ts-utils/dist/api-response.js
|
|
14657
14657
|
var API_ERROR_CODES, ERROR_CODE_TO_HTTP, CLIENT_SAFE_CODES;
|
|
14658
14658
|
var init_api_response = __esm(() => {
|
|
14659
14659
|
init_errors3();
|
|
@@ -14676,13 +14676,13 @@ var init_api_response = __esm(() => {
|
|
|
14676
14676
|
CLIENT_SAFE_CODES = new Set([ErrorCode.NotFound, ErrorCode.Validation, ErrorCode.Conflict]);
|
|
14677
14677
|
});
|
|
14678
14678
|
|
|
14679
|
-
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.
|
|
14679
|
+
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.21/node_modules/@gobing-ai/ts-utils/dist/cursor.js
|
|
14680
14680
|
var init_cursor = () => {};
|
|
14681
14681
|
|
|
14682
|
-
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.
|
|
14682
|
+
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.21/node_modules/@gobing-ai/ts-utils/dist/event-severity.js
|
|
14683
14683
|
var init_event_severity = () => {};
|
|
14684
14684
|
|
|
14685
|
-
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.
|
|
14685
|
+
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.21/node_modules/@gobing-ai/ts-utils/dist/output.js
|
|
14686
14686
|
function processStream(name) {
|
|
14687
14687
|
const proc = globalThis.process;
|
|
14688
14688
|
const stream = proc?.[name];
|
|
@@ -14700,7 +14700,7 @@ function echoError(message, target = defaultStderrTarget ?? processStream("stder
|
|
|
14700
14700
|
}
|
|
14701
14701
|
var defaultStderrTarget;
|
|
14702
14702
|
|
|
14703
|
-
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.
|
|
14703
|
+
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.21/node_modules/@gobing-ai/ts-utils/dist/index.js
|
|
14704
14704
|
var init_dist = __esm(() => {
|
|
14705
14705
|
init_api_response();
|
|
14706
14706
|
init_cursor();
|
|
@@ -21698,7 +21698,7 @@ var init_dist2 = __esm(() => {
|
|
|
21698
21698
|
$visitAsync = visit.visitAsync;
|
|
21699
21699
|
});
|
|
21700
21700
|
|
|
21701
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
21701
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.21+44edd5c4d6372504/node_modules/@gobing-ai/ts-runtime/dist/config.js
|
|
21702
21702
|
var configSchema;
|
|
21703
21703
|
var init_config = __esm(() => {
|
|
21704
21704
|
init_dist2();
|
|
@@ -21722,7 +21722,7 @@ var init_config = __esm(() => {
|
|
|
21722
21722
|
});
|
|
21723
21723
|
});
|
|
21724
21724
|
|
|
21725
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
21725
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.21+44edd5c4d6372504/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
|
|
21726
21726
|
import { appendFileSync, cpSync, createReadStream, createWriteStream, existsSync, mkdirSync, readdirSync, readFileSync, realpathSync, renameSync, rmSync, statSync, writeFileSync } from "fs";
|
|
21727
21727
|
import { dirname, resolve as resolvePath } from "path";
|
|
21728
21728
|
function createNodeFileSystem(root, paths) {
|
|
@@ -21896,18 +21896,19 @@ var PluginManifestSchema = exports_external.looseObject({
|
|
|
21896
21896
|
name: exports_external.string().min(1),
|
|
21897
21897
|
kind: PluginKindSchema,
|
|
21898
21898
|
entry: exports_external.string().min(1),
|
|
21899
|
+
check: exports_external.string().min(1).optional(),
|
|
21899
21900
|
version: exports_external.string().optional(),
|
|
21900
21901
|
description: exports_external.string().optional(),
|
|
21901
21902
|
operations: exports_external.record(exports_external.string(), PluginOperationSchema).optional()
|
|
21902
21903
|
});
|
|
21903
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
21904
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.21+44edd5c4d6372504/node_modules/@gobing-ai/ts-runtime/dist/index.js
|
|
21904
21905
|
init_file_system_node();
|
|
21905
21906
|
init_config();
|
|
21906
21907
|
|
|
21907
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
21908
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.21+44edd5c4d6372504/node_modules/@gobing-ai/ts-runtime/dist/fs.js
|
|
21908
21909
|
init_file_system_node();
|
|
21909
21910
|
|
|
21910
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
21911
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.21+44edd5c4d6372504/node_modules/@gobing-ai/ts-runtime/dist/path.js
|
|
21911
21912
|
function normalizeSeparators(path) {
|
|
21912
21913
|
return path.replaceAll("\\", "/");
|
|
21913
21914
|
}
|
|
@@ -21941,7 +21942,7 @@ function dirnamePath(path) {
|
|
|
21941
21942
|
return normalized.slice(0, index);
|
|
21942
21943
|
}
|
|
21943
21944
|
|
|
21944
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
21945
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.21+44edd5c4d6372504/node_modules/@gobing-ai/ts-runtime/dist/fs.js
|
|
21945
21946
|
async function ensureDirForFile(path, fs = createNodeFileSystem()) {
|
|
21946
21947
|
await fs.ensureDir(dirnamePath(path));
|
|
21947
21948
|
}
|
|
@@ -22243,6 +22244,24 @@ function scoreDimensions(doc2, planDate) {
|
|
|
22243
22244
|
const impact = max > 1000 ? 5 : max > 100 ? 4 : max > 10 ? 3 : max > 1 ? 2 : 1;
|
|
22244
22245
|
return { quality, importance, urgency, impact };
|
|
22245
22246
|
}
|
|
22247
|
+
function needsModelLabel(doc2) {
|
|
22248
|
+
return classifyCategory(doc2) === "non-ai" && hasAiSignal(doc2);
|
|
22249
|
+
}
|
|
22250
|
+
function hasAiSignal(doc2) {
|
|
22251
|
+
const meta3 = asRecord(doc2.metadata);
|
|
22252
|
+
const tags = Array.isArray(meta3.tags) ? meta3.tags.filter((t) => typeof t === "string") : [];
|
|
22253
|
+
for (const tag of tags) {
|
|
22254
|
+
const hit = TAG_CATEGORY[tag.toLowerCase()];
|
|
22255
|
+
if (hit !== undefined && hit !== "non-ai")
|
|
22256
|
+
return true;
|
|
22257
|
+
}
|
|
22258
|
+
const source = typeof meta3.source === "string" ? meta3.source : "";
|
|
22259
|
+
if (AI_DEFAULT_SOURCES.has(source))
|
|
22260
|
+
return true;
|
|
22261
|
+
const title = (doc2.title ?? "").toLowerCase();
|
|
22262
|
+
const bodyHead = (doc2.body ?? "").slice(0, 200).toLowerCase();
|
|
22263
|
+
return CATEGORY_KEYWORDS.some((row) => row.words.some((w) => matchesKeyword(title, w) || matchesKeyword(bodyHead, w)));
|
|
22264
|
+
}
|
|
22246
22265
|
function planScore(doc2) {
|
|
22247
22266
|
const meta3 = asRecord(doc2.metadata);
|
|
22248
22267
|
const source = typeof meta3.source === "string" ? meta3.source : "";
|
|
@@ -22572,7 +22591,29 @@ async function atomicWrite(path2, value) {
|
|
|
22572
22591
|
await atomicWriteJson(path2, value, fs);
|
|
22573
22592
|
}
|
|
22574
22593
|
async function processGeneratorIO(inputPath, outputPath, mode = "plan") {
|
|
22575
|
-
|
|
22594
|
+
if (mode === "filter")
|
|
22595
|
+
return processFilterIO(inputPath, outputPath);
|
|
22596
|
+
if (mode === "label")
|
|
22597
|
+
return processLabelIO(inputPath, outputPath);
|
|
22598
|
+
return processPlanIO(inputPath, outputPath);
|
|
22599
|
+
}
|
|
22600
|
+
function labelDocs(docs, planDate) {
|
|
22601
|
+
return docs.map((doc2) => ({
|
|
22602
|
+
...doc2,
|
|
22603
|
+
metadata: {
|
|
22604
|
+
...asRecord(doc2.metadata),
|
|
22605
|
+
category: classifyCategory(doc2),
|
|
22606
|
+
scores: scoreDimensions(doc2, planDate),
|
|
22607
|
+
needs_model: needsModelLabel(doc2)
|
|
22608
|
+
}
|
|
22609
|
+
}));
|
|
22610
|
+
}
|
|
22611
|
+
async function processLabelIO(inputPath, outputPath) {
|
|
22612
|
+
const docs = DocListSchema.parse(await readJsonFile(inputPath));
|
|
22613
|
+
const planDate = resolvePlanDate();
|
|
22614
|
+
const content = planContent(labelDocs(docs, planDate), planDate);
|
|
22615
|
+
await atomicWrite(outputPath, content);
|
|
22616
|
+
return content;
|
|
22576
22617
|
}
|
|
22577
22618
|
async function processPlanIO(inputPath, outputPath) {
|
|
22578
22619
|
const docs = DocListSchema.parse(await readJsonFile(inputPath));
|
|
@@ -22610,8 +22651,8 @@ async function main2() {
|
|
|
22610
22651
|
return 1;
|
|
22611
22652
|
}
|
|
22612
22653
|
const mode = values.mode ?? process.env.EPISODE_PLAN_MODE ?? "plan";
|
|
22613
|
-
if (mode !== "plan" && mode !== "filter") {
|
|
22614
|
-
echoError(`episode-plan-gen failed: unknown mode '${mode}' (from --mode flag or EPISODE_PLAN_MODE env; valid: plan, filter)`);
|
|
22654
|
+
if (mode !== "plan" && mode !== "filter" && mode !== "label") {
|
|
22655
|
+
echoError(`episode-plan-gen failed: unknown mode '${mode}' (from --mode flag or EPISODE_PLAN_MODE env; valid: plan, filter, label)`);
|
|
22615
22656
|
return 1;
|
|
22616
22657
|
}
|
|
22617
22658
|
try {
|
|
@@ -22635,7 +22676,9 @@ export {
|
|
|
22635
22676
|
planEpisode,
|
|
22636
22677
|
planAuditOutPath,
|
|
22637
22678
|
normalizeUrl,
|
|
22679
|
+
needsModelLabel,
|
|
22638
22680
|
main2 as main,
|
|
22681
|
+
labelDocs,
|
|
22639
22682
|
filterConfigFromEnv,
|
|
22640
22683
|
filterAnnotated,
|
|
22641
22684
|
docsToContent,
|
|
@@ -19,7 +19,10 @@ import { echoError } from '@gobing-ai/ts-utils';
|
|
|
19
19
|
* out — survivors to `--out`, rejection audit to `<out>.rejected.json`; env
|
|
20
20
|
* `QC_CATEGORIES` (default 'ai-news,ai-industry'),
|
|
21
21
|
* `QC_MIN_QUALITY/IMPORTANCE/URGENCY/IMPACT` (defaults 2/3/2/1 — 0099 recalibration);
|
|
22
|
-
* invalid values exit 1 (fail loud, no clamping).
|
|
22
|
+
* invalid values exit 1 (fail loud, no clamping). `--mode label` (0209) is the
|
|
23
|
+
* labelling contract for `kk store label`: every input doc annotated
|
|
24
|
+
* (`metadata.category`, `metadata.scores`, `metadata.needs_model`), no cap, dedup or
|
|
25
|
+
* filter, written to `--out` with no audit sidecar.
|
|
23
26
|
*/
|
|
24
27
|
|
|
25
28
|
/** Tunable scoring knobs (kept here so the shape is greppable, not config-filed). */
|
|
@@ -415,6 +418,41 @@ export function scoreDimensions(doc: Doc, planDate: string): DimensionScores {
|
|
|
415
418
|
return { quality, importance, urgency, impact };
|
|
416
419
|
}
|
|
417
420
|
|
|
421
|
+
/**
|
|
422
|
+
* Does the keyword heuristic want a model second opinion on this doc?
|
|
423
|
+
*
|
|
424
|
+
* True exactly when the deterministic scan proves an AI signal (an AI-mapped tag, a
|
|
425
|
+
* curated AI source, or an AI keyword in the title/body head) but
|
|
426
|
+
* {@link classifyCategory} still files the doc `non-ai` — a deny rule (non-AI tag, junk
|
|
427
|
+
* phrase, non-AI source) outvoted the signal. Everything else is either confidently
|
|
428
|
+
* categorized or confidently non-AI, so `kk store label` keeps its heuristic rows and
|
|
429
|
+
* spends no model call (0209 R5).
|
|
430
|
+
*/
|
|
431
|
+
export function needsModelLabel(doc: Doc): boolean {
|
|
432
|
+
return classifyCategory(doc) === 'non-ai' && hasAiSignal(doc);
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* Any AI-side signal matches — the mirror of `classifyCategory`'s positive proof, so the
|
|
437
|
+
* two never disagree about what counts as evidence. `CATEGORY_KEYWORDS` holds AI
|
|
438
|
+
* categories only; the tag map and the curated-source set are filtered to non-`non-ai`.
|
|
439
|
+
*/
|
|
440
|
+
function hasAiSignal(doc: Doc): boolean {
|
|
441
|
+
const meta = asRecord(doc.metadata);
|
|
442
|
+
const tags = Array.isArray(meta.tags) ? meta.tags.filter((t): t is string => typeof t === 'string') : [];
|
|
443
|
+
for (const tag of tags) {
|
|
444
|
+
const hit = TAG_CATEGORY[tag.toLowerCase()];
|
|
445
|
+
if (hit !== undefined && hit !== 'non-ai') return true;
|
|
446
|
+
}
|
|
447
|
+
const source = typeof meta.source === 'string' ? meta.source : '';
|
|
448
|
+
if (AI_DEFAULT_SOURCES.has(source)) return true;
|
|
449
|
+
const title = (doc.title ?? '').toLowerCase();
|
|
450
|
+
const bodyHead = (doc.body ?? '').slice(0, 200).toLowerCase();
|
|
451
|
+
return CATEGORY_KEYWORDS.some((row) =>
|
|
452
|
+
row.words.some((w) => matchesKeyword(title, w) || matchesKeyword(bodyHead, w)),
|
|
453
|
+
);
|
|
454
|
+
}
|
|
455
|
+
|
|
418
456
|
/** Composite 0..100-ish score; ordering matters more than absolute value. */
|
|
419
457
|
export function planScore(doc: Doc): number {
|
|
420
458
|
const meta = asRecord(doc.metadata);
|
|
@@ -638,8 +676,8 @@ function resolvePlanDate(): string {
|
|
|
638
676
|
// kept/rejected split out (ADR-019 D3: QC is a visible, threshold-driven node).
|
|
639
677
|
// ---------------------------------------------------------------------------
|
|
640
678
|
|
|
641
|
-
/** Run modes: `plan` (default — the gated selection pipeline, unchanged)
|
|
642
|
-
export type GeneratorMode = 'plan' | 'filter';
|
|
679
|
+
/** Run modes: `plan` (default — the gated selection pipeline, unchanged), `filter` (the QC gate) or `label` (annotation only, 0209). */
|
|
680
|
+
export type GeneratorMode = 'plan' | 'filter' | 'label';
|
|
643
681
|
|
|
644
682
|
/** The closed MECE taxonomy (the values `classifyCategory` emits) — filter allowlists validate against it. */
|
|
645
683
|
const MECE_CATEGORIES: readonly Category[] = ['ai-news', 'ai-technical', 'ai-research', 'ai-industry', 'non-ai'];
|
|
@@ -862,7 +900,39 @@ export async function processGeneratorIO(
|
|
|
862
900
|
outputPath: string,
|
|
863
901
|
mode: GeneratorMode = 'plan',
|
|
864
902
|
): Promise<Content> {
|
|
865
|
-
|
|
903
|
+
if (mode === 'filter') return processFilterIO(inputPath, outputPath);
|
|
904
|
+
if (mode === 'label') return processLabelIO(inputPath, outputPath);
|
|
905
|
+
return processPlanIO(inputPath, outputPath);
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
/**
|
|
909
|
+
* Label mode (0209 R3): annotate EVERY input doc — `metadata.category` and
|
|
910
|
+
* `metadata.scores` exactly as `planEpisode` writes them, plus `metadata.needs_model`
|
|
911
|
+
* ({@link needsModelLabel}) — with no cap, dedup, category gate or top-N selection.
|
|
912
|
+
*
|
|
913
|
+
* `kk store label` reads `metadata.docs` back and writes one `labels` row per decision,
|
|
914
|
+
* so this array IS the labelling contract; `planContent` is reused only as the Content
|
|
915
|
+
* wrapper (no audit sidecar — nothing was selected or rejected).
|
|
916
|
+
*/
|
|
917
|
+
export function labelDocs(docs: Doc[], planDate: string): Doc[] {
|
|
918
|
+
return docs.map((doc) => ({
|
|
919
|
+
...doc,
|
|
920
|
+
metadata: {
|
|
921
|
+
...asRecord(doc.metadata),
|
|
922
|
+
category: classifyCategory(doc),
|
|
923
|
+
scores: scoreDimensions(doc, planDate),
|
|
924
|
+
needs_model: needsModelLabel(doc),
|
|
925
|
+
},
|
|
926
|
+
}));
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
/** Label mode (0209): every input doc annotated, input order preserved → Content at `--out`. */
|
|
930
|
+
async function processLabelIO(inputPath: string, outputPath: string): Promise<Content> {
|
|
931
|
+
const docs = DocListSchema.parse(await readJsonFile(inputPath));
|
|
932
|
+
const planDate = resolvePlanDate();
|
|
933
|
+
const content = planContent(labelDocs(docs, planDate), planDate);
|
|
934
|
+
await atomicWrite(outputPath, content);
|
|
935
|
+
return content;
|
|
866
936
|
}
|
|
867
937
|
|
|
868
938
|
/** Plan mode (default, behavior unchanged): blended `Doc[]` → gated/annotated plan Content + `<out>.audit.json` selection trail. */
|
|
@@ -915,9 +985,9 @@ export async function main(): Promise<number> {
|
|
|
915
985
|
// The env rung exists because `kk executor run` spawns plugin entries with --in/--out only
|
|
916
986
|
// (ADR-006, apps/cli/src/invoke.ts) and cannot forward extra CLI args.
|
|
917
987
|
const mode = values.mode ?? process.env.EPISODE_PLAN_MODE ?? 'plan';
|
|
918
|
-
if (mode !== 'plan' && mode !== 'filter') {
|
|
988
|
+
if (mode !== 'plan' && mode !== 'filter' && mode !== 'label') {
|
|
919
989
|
echoError(
|
|
920
|
-
`episode-plan-gen failed: unknown mode '${mode}' (from --mode flag or EPISODE_PLAN_MODE env; valid: plan, filter)`,
|
|
990
|
+
`episode-plan-gen failed: unknown mode '${mode}' (from --mode flag or EPISODE_PLAN_MODE env; valid: plan, filter, label)`,
|
|
921
991
|
);
|
|
922
992
|
return 1;
|
|
923
993
|
}
|
|
@@ -123,3 +123,14 @@ exceeds that (it used to sleep out the ~19h horizon, which looked like a wedged
|
|
|
123
123
|
A stored voice lasts 1 year (200 stored voices per project, shared with prompted voices). Before
|
|
124
124
|
`expire_time`, repeat export → create → replace the id in the operator map. Delete the scratch
|
|
125
125
|
clips when the new id is wired. Do not commit the wavs or the voice id.
|
|
126
|
+
|
|
127
|
+
> **2026-10-07 observed:** that 1-year figure did not hold — the 2026-09-24 voice
|
|
128
|
+
> (`voice_e6zevk798ecg`) started returning HTTP 404 "The voice was not found or the caller does not
|
|
129
|
+
> have access/permission to access it" on 10-06/10-07, 13 days after creation (built-in voices kept
|
|
130
|
+
> working, so key/model/request shape were fine). Treat a mid-life 404 as **voice death, not a bug**:
|
|
131
|
+
> re-create via the en-pair path above (zh pair still 500s on 2026-10-07), swap the id in the
|
|
132
|
+
> operator map, and smoke-test one zh segment before the next daily run. Symptom in the daily log:
|
|
133
|
+
> `kk stage daily-generate` exit 1 with the 404 on segment 1 of ~23 queued.
|
|
134
|
+
>
|
|
135
|
+
> Renewal log: 2026-09-24 created → 2026-10-07 re-created (en pair, `voice_gl10j67aaj7j`). Consider
|
|
136
|
+
> a weekly one-segment probe if this recurs; no automated probe today.
|
|
@@ -17,7 +17,7 @@ var __export = (target, all) => {
|
|
|
17
17
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
18
18
|
var __require = import.meta.require;
|
|
19
19
|
|
|
20
|
-
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.
|
|
20
|
+
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.21/node_modules/@gobing-ai/ts-utils/dist/errors.js
|
|
21
21
|
var ErrorCode;
|
|
22
22
|
var init_errors = __esm(() => {
|
|
23
23
|
ErrorCode = {
|
|
@@ -28,7 +28,7 @@ var init_errors = __esm(() => {
|
|
|
28
28
|
};
|
|
29
29
|
});
|
|
30
30
|
|
|
31
|
-
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.
|
|
31
|
+
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.21/node_modules/@gobing-ai/ts-utils/dist/api-response.js
|
|
32
32
|
var API_ERROR_CODES, ERROR_CODE_TO_HTTP, CLIENT_SAFE_CODES;
|
|
33
33
|
var init_api_response = __esm(() => {
|
|
34
34
|
init_errors();
|
|
@@ -51,13 +51,13 @@ var init_api_response = __esm(() => {
|
|
|
51
51
|
CLIENT_SAFE_CODES = new Set([ErrorCode.NotFound, ErrorCode.Validation, ErrorCode.Conflict]);
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
-
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.
|
|
54
|
+
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.21/node_modules/@gobing-ai/ts-utils/dist/cursor.js
|
|
55
55
|
var init_cursor = () => {};
|
|
56
56
|
|
|
57
|
-
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.
|
|
57
|
+
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.21/node_modules/@gobing-ai/ts-utils/dist/event-severity.js
|
|
58
58
|
var init_event_severity = () => {};
|
|
59
59
|
|
|
60
|
-
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.
|
|
60
|
+
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.21/node_modules/@gobing-ai/ts-utils/dist/output.js
|
|
61
61
|
function processStream(name) {
|
|
62
62
|
const proc = globalThis.process;
|
|
63
63
|
const stream = proc?.[name];
|
|
@@ -75,7 +75,7 @@ function echoError(message, target = defaultStderrTarget ?? processStream("stder
|
|
|
75
75
|
}
|
|
76
76
|
var defaultStderrTarget;
|
|
77
77
|
|
|
78
|
-
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.
|
|
78
|
+
// ../../node_modules/.bun/@gobing-ai+ts-utils@0.5.21/node_modules/@gobing-ai/ts-utils/dist/index.js
|
|
79
79
|
var init_dist = __esm(() => {
|
|
80
80
|
init_api_response();
|
|
81
81
|
init_cursor();
|
|
@@ -21698,7 +21698,7 @@ var init_dist2 = __esm(() => {
|
|
|
21698
21698
|
$visitAsync = visit.visitAsync;
|
|
21699
21699
|
});
|
|
21700
21700
|
|
|
21701
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
21701
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.21+44edd5c4d6372504/node_modules/@gobing-ai/ts-runtime/dist/config.js
|
|
21702
21702
|
var configSchema;
|
|
21703
21703
|
var init_config = __esm(() => {
|
|
21704
21704
|
init_dist2();
|
|
@@ -21722,7 +21722,7 @@ var init_config = __esm(() => {
|
|
|
21722
21722
|
});
|
|
21723
21723
|
});
|
|
21724
21724
|
|
|
21725
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
21725
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.21+44edd5c4d6372504/node_modules/@gobing-ai/ts-runtime/dist/file-system-node.js
|
|
21726
21726
|
import { appendFileSync, cpSync, createReadStream, createWriteStream, existsSync, mkdirSync, readdirSync, readFileSync, realpathSync, renameSync, rmSync, statSync, writeFileSync } from "fs";
|
|
21727
21727
|
import { dirname, resolve as resolvePath } from "path";
|
|
21728
21728
|
function createNodeFileSystem(root, paths) {
|
|
@@ -21899,11 +21899,12 @@ var PluginManifestSchema = exports_external.looseObject({
|
|
|
21899
21899
|
name: exports_external.string().min(1),
|
|
21900
21900
|
kind: PluginKindSchema,
|
|
21901
21901
|
entry: exports_external.string().min(1),
|
|
21902
|
+
check: exports_external.string().min(1).optional(),
|
|
21902
21903
|
version: exports_external.string().optional(),
|
|
21903
21904
|
description: exports_external.string().optional(),
|
|
21904
21905
|
operations: exports_external.record(exports_external.string(), PluginOperationSchema).optional()
|
|
21905
21906
|
});
|
|
21906
|
-
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.
|
|
21907
|
+
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.5.21+44edd5c4d6372504/node_modules/@gobing-ai/ts-runtime/dist/index.js
|
|
21907
21908
|
init_file_system_node();
|
|
21908
21909
|
init_config();
|
|
21909
21910
|
|