@gobing-ai/knowledge-kit 0.1.7 → 0.1.9
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/board/collect/index.js +744 -1107
- package/dist/board/daily-voice/index.js +741 -107
- package/dist/board/itc/index.js +32 -6
- package/dist/index.js +1793 -103
- package/package.json +1 -1
- package/plugins/ingestions/horizon-ingest/dist/index.js +24 -1
- package/plugins/ingestions/horizon-ingest/src/index.ts +34 -0
- package/plugins/kk/config.example.yaml +8 -0
- package/plugins/kk/decisions/extract/ai-news.yaml +7 -1
- package/plugins/kk/plugin.json +1 -1
- package/plugins/kk/publish-presets/daily-ai-voice.json +123 -0
- package/plugins/kk/schedules/kk-daily-publish3-cn-peak.cron.tmpl +20 -0
- package/plugins/kk/schedules/kk-daily-publish3-overseas.cron.tmpl +17 -0
- package/plugins/kk/scripts/daily-stages.ts +664 -83
- package/plugins/kk/scripts/kk-workflow-stages.ts +11 -1
- package/plugins/kk/scripts/topic-boundary.json +18 -83
- package/plugins/kk/workflows/kk-collect.yaml +2 -0
- package/plugins/kk/workflows/kk-daily-ai-voice2.yaml +82 -8
- package/plugins/kk/workflows/kk-daily-ai-voice3.yaml +842 -0
- package/plugins/kk/workflows/kk-daily-publish3.yaml +282 -0
- package/plugins/publishings/podcast-pub/README.md +65 -0
- package/plugins/publishings/podcast-pub/dist/index.js +1709 -274
- package/plugins/publishings/podcast-pub/plugin.json +1 -1
- package/plugins/publishings/podcast-pub/src/backfill.ts +465 -0
- package/plugins/publishings/podcast-pub/src/index.ts +211 -34
- package/plugins/publishings/podcast-pub/src/microfeed-client.ts +32 -3
- package/plugins/publishings/podcast-pub/src/seo.ts +1081 -0
- package/plugins/publishings/podcast-pub/src/show-notes.ts +71 -6
- package/plugins/publishings/surfdash-pub/dist/index.js +66 -5
- package/plugins/publishings/surfdash-pub/src/index.ts +94 -10
- package/plugins/publishings/wechatmp-pub/dist/index.js +54 -30
- package/plugins/publishings/wechatmp-pub/dist/profile-check.js +8 -3
- package/plugins/publishings/wechatmp-pub/src/enrich.ts +58 -38
- package/plugins/publishings/wechatmp-pub/src/flow.ts +18 -1
- package/plugins/publishings/wechatmp-pub/src/profile-check.ts +7 -1
package/dist/board/itc/index.js
CHANGED
|
@@ -37,6 +37,14 @@ function storeSelectionsQueryString(query) {
|
|
|
37
37
|
}
|
|
38
38
|
return params.toString();
|
|
39
39
|
}
|
|
40
|
+
function storeChannelsQueryString(query) {
|
|
41
|
+
const params = new URLSearchParams({
|
|
42
|
+
from: String(query.fromMs),
|
|
43
|
+
until: String(query.untilMs),
|
|
44
|
+
page: String(query.page)
|
|
45
|
+
});
|
|
46
|
+
return params.toString();
|
|
47
|
+
}
|
|
40
48
|
var DEFAULT_READER_ORIGIN = "http://127.0.0.1:4340";
|
|
41
49
|
function readerOriginFrom(search, defaultOrigin = DEFAULT_READER_ORIGIN) {
|
|
42
50
|
const override = new URLSearchParams(search).get("kkApi");
|
|
@@ -67,6 +75,19 @@ function isLoopbackHttpOrigin(origin) {
|
|
|
67
75
|
return false;
|
|
68
76
|
return url.hostname === "127.0.0.1" || url.hostname === "localhost" || url.hostname === "[::1]";
|
|
69
77
|
}
|
|
78
|
+
function isHttpOrigin(origin) {
|
|
79
|
+
let url;
|
|
80
|
+
try {
|
|
81
|
+
url = new URL(origin);
|
|
82
|
+
} catch {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
if (url.protocol !== "http:" && url.protocol !== "https:")
|
|
86
|
+
return false;
|
|
87
|
+
if (url.username !== "" || url.password !== "")
|
|
88
|
+
return false;
|
|
89
|
+
return url.pathname === "/" && url.search === "" && url.hash === "";
|
|
90
|
+
}
|
|
70
91
|
function origin(base) {
|
|
71
92
|
return base.replace(/\/+$/, "");
|
|
72
93
|
}
|
|
@@ -90,16 +111,20 @@ function parseSpurDbRows(pageData) {
|
|
|
90
111
|
});
|
|
91
112
|
}
|
|
92
113
|
function createBoardClient(options) {
|
|
93
|
-
|
|
114
|
+
const reader = origin(options.readerOrigin);
|
|
115
|
+
const board = origin(options.boardOrigin);
|
|
116
|
+
const isNativeSpur = reader === board;
|
|
117
|
+
if (!isHttpOrigin(options.boardOrigin)) {
|
|
118
|
+
throw new Error(`board origin must be an http origin, got '${options.boardOrigin}'`);
|
|
119
|
+
}
|
|
120
|
+
if (!isNativeSpur && !isLoopbackHttpOrigin(options.readerOrigin)) {
|
|
94
121
|
throw new Error(`reader origin must be loopback http, got '${options.readerOrigin}'`);
|
|
95
122
|
}
|
|
96
|
-
|
|
97
|
-
|
|
123
|
+
const aggregateReader = origin(options.aggregateReaderOrigin ?? DEFAULT_READER_ORIGIN);
|
|
124
|
+
if (!isLoopbackHttpOrigin(options.aggregateReaderOrigin ?? DEFAULT_READER_ORIGIN)) {
|
|
125
|
+
throw new Error(`aggregate reader origin must be loopback http, got '${options.aggregateReaderOrigin}'`);
|
|
98
126
|
}
|
|
99
|
-
const reader = origin(options.readerOrigin);
|
|
100
|
-
const board = origin(options.boardOrigin);
|
|
101
127
|
const doFetch = options.fetchImpl ?? fetch;
|
|
102
|
-
const isNativeSpur = reader === board;
|
|
103
128
|
async function getJson(url) {
|
|
104
129
|
const response = await doFetch(url, { headers: { accept: "application/json" } });
|
|
105
130
|
if (!response.ok) {
|
|
@@ -493,6 +518,7 @@ function createBoardClient(options) {
|
|
|
493
518
|
return getJson(path);
|
|
494
519
|
},
|
|
495
520
|
storeSelections: (query = {}) => isNativeSpur ? nativeStoreSelections(query) : getJson(`${reader}/api/workflows/kk-collect/store/selections?${storeSelectionsQueryString(query)}`),
|
|
521
|
+
storeChannels: (query) => getJson(`${aggregateReader}/api/workflows/kk-collect/store/channels?${storeChannelsQueryString(query)}`),
|
|
496
522
|
runDetail: (runId) => getJson(`${board}/api/runs/${encodeURIComponent(runId)}`),
|
|
497
523
|
progress: (runId) => getJson(`${board}/api/runs/${encodeURIComponent(runId)}/progress`)
|
|
498
524
|
};
|