@gobing-ai/knowledge-kit 0.0.11 → 0.0.13
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/dist/index.js +451 -152
- package/package.json +1 -1
- package/plugins/generations/content-gen/dist/index.js +22167 -0
- package/plugins/generations/content-gen/plugin.json +1 -1
- package/plugins/generations/content-gen/src/storm.ts +99 -50
- package/plugins/generations/core-facts-gen/dist/index.js +22048 -0
- package/plugins/generations/core-facts-gen/package.json +17 -0
- package/plugins/generations/core-facts-gen/plugin.json +7 -0
- package/plugins/generations/core-facts-gen/src/index.ts +116 -0
- package/plugins/generations/core-facts-gen/tsconfig.json +4 -0
- package/plugins/generations/daily-article-gen/dist/index.js +22022 -0
- package/plugins/generations/daily-article-gen/package.json +17 -0
- package/plugins/generations/daily-article-gen/plugin.json +7 -0
- package/plugins/generations/daily-article-gen/src/index.ts +91 -0
- package/plugins/generations/daily-article-gen/tsconfig.json +4 -0
- package/plugins/generations/dailynews-gen/dist/index.js +22324 -0
- package/plugins/generations/dailynews-gen/plugin.json +1 -1
- package/plugins/generations/dailynews-gen/src/index.ts +11 -0
- package/plugins/generations/dailynews-gen/src/script-builder.ts +1 -1
- package/plugins/generations/episode-plan-gen/dist/index.js +22479 -0
- package/plugins/generations/episode-plan-gen/package.json +17 -0
- package/plugins/generations/episode-plan-gen/plugin.json +7 -0
- package/plugins/generations/episode-plan-gen/src/index.ts +726 -0
- package/plugins/generations/episode-plan-gen/tsconfig.json +4 -0
- package/plugins/generations/image-gen/config.example.yaml +75 -0
- package/plugins/generations/image-gen/dist/index.js +22619 -0
- package/plugins/generations/image-gen/package.json +17 -0
- package/plugins/generations/image-gen/plugin.json +7 -0
- package/plugins/generations/image-gen/presets/formats/cover.yaml +57 -0
- package/plugins/generations/image-gen/presets/formats/free.yaml +46 -0
- package/plugins/generations/image-gen/presets/formats/illustration.yaml +48 -0
- package/plugins/generations/image-gen/presets/styles/clean-webapp-ui.yaml +28 -0
- package/plugins/generations/image-gen/presets/styles/cute.yaml +3 -0
- package/plugins/generations/image-gen/presets/styles/editorial.yaml +3 -0
- package/plugins/generations/image-gen/presets/styles/fresh.yaml +3 -0
- package/plugins/generations/image-gen/presets/styles/minimalist.yaml +3 -0
- package/plugins/generations/image-gen/presets/styles/photorealistic.yaml +3 -0
- package/plugins/generations/image-gen/presets/styles/sketch.yaml +3 -0
- package/plugins/generations/image-gen/presets/styles/technical-diagram.yaml +3 -0
- package/plugins/generations/image-gen/presets/styles/vibrant.yaml +3 -0
- package/plugins/generations/image-gen/presets/styles/warm.yaml +3 -0
- package/plugins/generations/image-gen/src/bytes.ts +19 -0
- package/plugins/generations/image-gen/src/index.ts +319 -0
- package/plugins/generations/image-gen/src/job.ts +143 -0
- package/plugins/generations/image-gen/src/paths.ts +31 -0
- package/plugins/generations/image-gen/src/presets.ts +344 -0
- package/plugins/generations/image-gen/src/providers/seedream.ts +128 -0
- package/plugins/generations/image-gen/src/providers/types.ts +285 -0
- package/plugins/generations/image-gen/tsconfig.json +8 -0
- package/plugins/generations/voice-gen/dist/index.js +23027 -0
- package/plugins/generations/voice-gen/plugin.json +1 -1
- package/plugins/generations/voice-gen/src/index.ts +102 -11
- package/plugins/generations/voice-gen/src/qc.ts +154 -9
- package/plugins/ingestions/aihot-ingest/dist/index.js +22358 -0
- package/plugins/ingestions/aihot-ingest/plugin.json +2 -2
- package/plugins/ingestions/aihot-ingest/src/index.ts +72 -13
- package/plugins/ingestions/aihot-ingest/src/mapper.ts +1 -0
- package/plugins/ingestions/aihot-ingest/src/rss.ts +151 -0
- package/plugins/ingestions/horizon-ingest/dist/index.js +22105 -0
- package/plugins/ingestions/horizon-ingest/package.json +17 -0
- package/plugins/ingestions/horizon-ingest/plugin.json +7 -0
- package/plugins/ingestions/horizon-ingest/src/index.ts +205 -0
- package/plugins/ingestions/horizon-ingest/tsconfig.json +4 -0
- package/plugins/ingestions/karakeep-local/dist/index.js +24204 -0
- package/plugins/ingestions/karakeep-local/plugin.json +1 -1
- package/plugins/ingestions/last30days-ingest/dist/index.js +22050 -0
- package/plugins/ingestions/last30days-ingest/package.json +17 -0
- package/plugins/ingestions/last30days-ingest/plugin.json +7 -0
- package/plugins/ingestions/last30days-ingest/src/index.ts +148 -0
- package/plugins/ingestions/last30days-ingest/tsconfig.json +4 -0
- package/plugins/ingestions/web-search/dist/index.js +24379 -0
- package/plugins/ingestions/web-search/plugin.json +1 -1
- package/plugins/kk/commands/image-generate.md +15 -0
- package/plugins/kk/config.example.yaml +80 -0
- package/plugins/kk/skills/image-authoring/SKILL.md +250 -0
- package/plugins/kk/skills/image-authoring/references/illustration-positions.md +87 -0
- package/plugins/kk/skills/image-authoring/references/migrating-from-wt.md +31 -0
- package/plugins/kk/skills/image-authoring/references/providers.md +52 -0
- package/plugins/kk/skills/image-authoring/references/style-extraction.md +134 -0
- package/plugins/kk/skills/taste-unslop/SKILL.md +12 -6
- package/plugins/kk/skills/taste-unslop/references/pattern-guide.md +128 -48
- package/plugins/kk/workflows/kk-daily-ai-voice.yaml +432 -19
- package/plugins/publishings/emdash-pub/dist/index.js +22243 -0
- package/plugins/publishings/emdash-pub/plugin.json +1 -1
- package/plugins/publishings/podcast-pub/dist/index.js +22596 -0
- package/plugins/publishings/podcast-pub/package.json +17 -0
- package/plugins/publishings/podcast-pub/plugin.json +13 -0
- package/plugins/publishings/podcast-pub/src/index.ts +538 -0
- package/plugins/publishings/podcast-pub/src/map.ts +165 -0
- package/plugins/publishings/podcast-pub/src/microfeed-client.ts +196 -0
- package/plugins/publishings/podcast-pub/src/show-notes.ts +132 -0
- package/plugins/publishings/podcast-pub/tsconfig.json +4 -0
- package/plugins/publishings/qiita-pub/dist/index.js +22081 -0
- package/plugins/publishings/qiita-pub/plugin.json +1 -1
- package/plugins/publishings/surfdash-pub/dist/index.js +22233 -0
- package/plugins/publishings/surfdash-pub/plugin.json +1 -1
- package/plugins/publishings/surfdash-pub/src/index.ts +328 -62
- package/plugins/publishings/zenn-pub/dist/index.js +22122 -0
- package/plugins/publishings/zenn-pub/plugin.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@gobing-ai/core-facts-gen",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"typecheck": "tsc --noEmit"
|
|
7
|
+
},
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"@gobing-ai/kk-core": "workspace:*",
|
|
10
|
+
"@gobing-ai/ts-runtime": "catalog:",
|
|
11
|
+
"@gobing-ai/ts-utils": "catalog:",
|
|
12
|
+
"zod": "4.4.3"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@types/bun": "1.3.14"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { basename, dirname } from 'node:path';
|
|
2
|
+
import { parseArgs } from 'node:util';
|
|
3
|
+
import { type Content, ContentSchema, type Doc, DocListSchema } from '@gobing-ai/kk-core';
|
|
4
|
+
import { atomicWriteJson, createNodeFileSystem, readJsonFile } from '@gobing-ai/ts-runtime';
|
|
5
|
+
import { echoError } from '@gobing-ai/ts-utils';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* core-facts-gen (task 0090 contract, docs/design/core-facts-template.md):
|
|
9
|
+
* render a merged `Doc[]` (from `kk executor fan-in`) into one dated core-facts
|
|
10
|
+
* markdown `Content`. Mechanical template fill — no LLM.
|
|
11
|
+
*
|
|
12
|
+
* Run date: `CORE_FACTS_DATE` env var, else today (UTC).
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/** Narrow a metadata.sources[] entry to its `file` string (provenance shape written by fan-in). */
|
|
16
|
+
function sourceFileOf(entry: unknown): string | null {
|
|
17
|
+
if (entry && typeof entry === 'object' && 'file' in entry) {
|
|
18
|
+
const file = entry.file;
|
|
19
|
+
return typeof file === 'string' ? file : null;
|
|
20
|
+
}
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Render the facts markdown for a merged Doc[] (pure — exported for tests). */
|
|
25
|
+
export function renderCoreFacts(docs: Doc[], date: string): string {
|
|
26
|
+
const sources = new Set<string>();
|
|
27
|
+
for (const doc of docs) {
|
|
28
|
+
const entries = doc.metadata?.sources;
|
|
29
|
+
if (Array.isArray(entries)) {
|
|
30
|
+
for (const entry of entries) {
|
|
31
|
+
const file = sourceFileOf(entry);
|
|
32
|
+
if (file) sources.add(file);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const roster = [...sources].map((file) => ` - ${basename(file)} (${file})`).join('\n');
|
|
37
|
+
|
|
38
|
+
const labelOf = (d: Doc): string => {
|
|
39
|
+
const source = d.metadata?.source;
|
|
40
|
+
if (typeof source === 'string' && source) return source;
|
|
41
|
+
const entries = d.metadata?.sources;
|
|
42
|
+
if (Array.isArray(entries)) {
|
|
43
|
+
const file = entries.length > 0 ? sourceFileOf(entries[0]) : null;
|
|
44
|
+
if (file) return basename(file);
|
|
45
|
+
}
|
|
46
|
+
return '';
|
|
47
|
+
};
|
|
48
|
+
const scoreOf = (d: Doc): unknown => d.metadata?.score ?? d.metadata?.relevance_score ?? '';
|
|
49
|
+
const dateOf = (d: Doc): string => {
|
|
50
|
+
const published = d.metadata?.published_at;
|
|
51
|
+
return typeof published === 'string' ? published : '';
|
|
52
|
+
};
|
|
53
|
+
const headlines = docs
|
|
54
|
+
.map(
|
|
55
|
+
(d) =>
|
|
56
|
+
`### ${d.title ?? ''}\n` +
|
|
57
|
+
`**Source:** ${labelOf(d)} · **URI:** ${d.sourceUri ?? ''} · **ID:** \`${d.id}\`\n` +
|
|
58
|
+
`**Date:** ${dateOf(d)} · **Score:** ${String(scoreOf(d))}\n` +
|
|
59
|
+
`${d.body}`,
|
|
60
|
+
)
|
|
61
|
+
.join('\n\n');
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
`---\ndate: ${date}\nsources:\n${roster}\ndedup_rule: id\ndoc_count: ${docs.length}\n---\n\n` +
|
|
65
|
+
`# Core Facts — ${date}\n\n` +
|
|
66
|
+
'> Daily AI news core-facts digest. Merge: `kk executor fan-in` (id dedupe, first-seen wins).\n' +
|
|
67
|
+
'> Render: core-facts-gen generator (mechanical; no LLM).\n\n' +
|
|
68
|
+
`## Headlines\n\n${headlines}\n`
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function docsToContent(docs: Doc[], date: string): Content {
|
|
73
|
+
return ContentSchema.parse({
|
|
74
|
+
title: `Core Facts — ${date}`,
|
|
75
|
+
body: renderCoreFacts(docs, date),
|
|
76
|
+
format: 'markdown',
|
|
77
|
+
references: docs.filter((d) => d.sourceUri).map((d) => ({ url: d.sourceUri, title: d.title, cite: d.id })),
|
|
78
|
+
metadata: { generator: 'kk:core-facts', date, doc_count: docs.length },
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export async function processGeneratorIO(inputPath: string, outputPath: string): Promise<Content> {
|
|
83
|
+
const docs = DocListSchema.parse(await readJsonFile(inputPath));
|
|
84
|
+
const date = process.env.CORE_FACTS_DATE ?? new Date().toISOString().slice(0, 10);
|
|
85
|
+
const content = docsToContent(docs, date);
|
|
86
|
+
const fs = createNodeFileSystem();
|
|
87
|
+
const outDir = dirname(outputPath);
|
|
88
|
+
if (outDir && outDir !== '.') await fs.ensureDir(outDir);
|
|
89
|
+
await atomicWriteJson(outputPath, content, fs);
|
|
90
|
+
return content;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export async function main(): Promise<number> {
|
|
94
|
+
let values: { in?: string; out?: string };
|
|
95
|
+
try {
|
|
96
|
+
({ values } = parseArgs({ options: { in: { type: 'string' }, out: { type: 'string' } } }));
|
|
97
|
+
} catch (err: unknown) {
|
|
98
|
+
echoError(`core-facts-gen failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
99
|
+
return 1;
|
|
100
|
+
}
|
|
101
|
+
if (!values.in || !values.out) {
|
|
102
|
+
echoError('core-facts-gen failed: Missing required arguments: --in <docs.json> --out <content.json>');
|
|
103
|
+
return 1;
|
|
104
|
+
}
|
|
105
|
+
try {
|
|
106
|
+
await processGeneratorIO(values.in, values.out);
|
|
107
|
+
return 0;
|
|
108
|
+
} catch (err: unknown) {
|
|
109
|
+
echoError(`core-facts-gen failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
110
|
+
return 1;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (import.meta.main) {
|
|
115
|
+
process.exit(await main());
|
|
116
|
+
}
|