@gobing-ai/knowledge-kit 0.1.9 → 0.1.11
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 +132 -25
- package/package.json +1 -1
- package/plugins/generations/content-gen/dist/index.js +4 -0
- package/plugins/generations/core-facts-gen/dist/index.js +4 -0
- package/plugins/generations/daily-article-gen/dist/index.js +4 -0
- package/plugins/generations/dailynews-gen/dist/index.js +4 -0
- package/plugins/generations/episode-plan-gen/dist/index.js +102 -1
- package/plugins/generations/episode-plan-gen/src/index.ts +2 -4
- package/plugins/generations/gemini-tts/dist/index.js +4 -0
- package/plugins/generations/image-gen/dist/index.js +4 -0
- package/plugins/generations/news-report-gen/dist/index.js +4 -0
- package/plugins/generations/voice-gen/dist/index.js +4 -0
- package/plugins/generations/voxcpm-tts/dist/index.js +4 -0
- package/plugins/ingestions/aihot-ingest/dist/index.js +4 -0
- package/plugins/ingestions/horizon-ingest/dist/index.js +4 -0
- package/plugins/ingestions/last30days-ingest/dist/index.js +11 -3
- package/plugins/ingestions/last30days-ingest/src/index.ts +14 -3
- package/plugins/ingestions/web-search/dist/index.js +4 -0
- package/plugins/kk/plugin.json +1 -1
- package/plugins/kk/scripts/daily-scheduled-run.ts +298 -0
- package/plugins/kk/scripts/daily-stages.ts +1083 -49
- package/plugins/kk/scripts/kk-workflow-stages.ts +76 -10
- package/plugins/kk/scripts/safety-artifact-check.ts +235 -0
- package/plugins/kk/scripts/sentences.ts +134 -0
- package/plugins/kk/scripts/series-names.ts +124 -0
- package/plugins/kk/workflows/kk-daily-ai-voice2.yaml +194 -113
- package/plugins/kk/workflows/kk-daily-safety.yaml +160 -36
- package/plugins/publishings/bilibili-pub/dist/index.js +6 -1
- package/plugins/publishings/bilibili-pub/dist/profile-check.js +2 -1
- package/plugins/publishings/cnblogs-pub/dist/index.js +6 -1
- package/plugins/publishings/cnblogs-pub/dist/profile-check.js +2 -1
- package/plugins/publishings/csdn-pub/dist/index.js +6 -1
- package/plugins/publishings/csdn-pub/dist/profile-check.js +6 -1
- package/plugins/publishings/emdash-pub/dist/index.js +4 -0
- package/plugins/publishings/infoq-pub/dist/index.js +6 -1
- package/plugins/publishings/infoq-pub/dist/profile-check.js +6 -1
- package/plugins/publishings/jike-pub/dist/index.js +6 -1
- package/plugins/publishings/jike-pub/dist/profile-check.js +6 -1
- package/plugins/publishings/juejin-pub/dist/index.js +6 -1
- package/plugins/publishings/juejin-pub/dist/profile-check.js +6 -1
- package/plugins/publishings/medium-pub/dist/index.js +4 -0
- package/plugins/publishings/podcast-pub/dist/index.js +151 -16
- package/plugins/publishings/podcast-pub/src/index.ts +62 -5
- package/plugins/publishings/podcast-pub/src/seo.ts +2 -4
- package/plugins/publishings/podcast-pub/src/show-notes.ts +3 -8
- package/plugins/publishings/qiita-pub/dist/index.js +4 -0
- package/plugins/publishings/shipinhao-pub/dist/index.js +6 -1
- package/plugins/publishings/shipinhao-pub/dist/profile-check.js +2 -1
- package/plugins/publishings/sspai-pub/dist/index.js +6 -1
- package/plugins/publishings/sspai-pub/dist/profile-check.js +2 -1
- package/plugins/publishings/substack-pub/dist/index.js +6 -1
- package/plugins/publishings/substack-pub/dist/profile-check.js +6 -1
- package/plugins/publishings/surfdash-pub/dist/index.js +691 -63
- package/plugins/publishings/surfdash-pub/src/digest-check.ts +284 -0
- package/plugins/publishings/surfdash-pub/src/index.ts +656 -84
- package/plugins/publishings/surfdash-pub/src/patch.ts +44 -7
- package/plugins/publishings/threads-pub/dist/index.js +4 -0
- package/plugins/publishings/wechatmp-pub/dist/index.js +937 -98
- package/plugins/publishings/wechatmp-pub/dist/profile-check.js +64 -3
- package/plugins/publishings/wechatmp-pub/src/flow.ts +1125 -85
- package/plugins/publishings/wechatmp-pub/src/index.ts +112 -30
- package/plugins/publishings/wechatmp-pub/src/page.ts +105 -0
- package/plugins/publishings/weibo-pub/dist/index.js +6 -1
- package/plugins/publishings/weibo-pub/dist/profile-check.js +6 -1
- package/plugins/publishings/x-pub/dist/index.js +6 -1
- package/plugins/publishings/x-pub/dist/profile-check.js +6 -1
- package/plugins/publishings/xhs-pub/dist/index.js +6 -1
- package/plugins/publishings/xhs-pub/dist/profile-check.js +6 -1
- package/plugins/publishings/xiaoyuzhou-pub/dist/index.js +6 -1
- package/plugins/publishings/xiaoyuzhou-pub/dist/profile-check.js +2 -1
- package/plugins/publishings/zenn-pub/dist/index.js +4 -0
|
@@ -20026,9 +20026,11 @@ import { isAbsolute, join as join3, relative, resolve as resolve3, sep } from "p
|
|
|
20026
20026
|
// ../../packages/publish-harness/src/bot-fs.ts
|
|
20027
20027
|
import {
|
|
20028
20028
|
chmodSync,
|
|
20029
|
+
closeSync,
|
|
20029
20030
|
copyFileSync,
|
|
20030
20031
|
lstatSync,
|
|
20031
20032
|
mkdirSync as mkdirSync2,
|
|
20033
|
+
openSync,
|
|
20032
20034
|
readdirSync as readdirSync2,
|
|
20033
20035
|
realpathSync as realpathSync2,
|
|
20034
20036
|
rmdirSync
|
|
@@ -20069,6 +20071,9 @@ function rmdir(path) {
|
|
|
20069
20071
|
function chmod(path, mode) {
|
|
20070
20072
|
chmodSync(path, mode);
|
|
20071
20073
|
}
|
|
20074
|
+
function createExclusiveFile(path) {
|
|
20075
|
+
closeSync(openSync(path, "wx", 384));
|
|
20076
|
+
}
|
|
20072
20077
|
|
|
20073
20078
|
// ../../packages/publish-harness/src/bot-transaction.ts
|
|
20074
20079
|
import { homedir } from "os";
|
|
@@ -20273,7 +20278,6 @@ class BotError extends Error {
|
|
|
20273
20278
|
this.code = code;
|
|
20274
20279
|
}
|
|
20275
20280
|
}
|
|
20276
|
-
|
|
20277
20281
|
// ../../packages/publish-harness/src/index.ts
|
|
20278
20282
|
import { homedir as homedir4 } from "os";
|
|
20279
20283
|
import { join as join4, resolve as resolve4 } from "path";
|
|
@@ -20409,6 +20413,12 @@ async function waitUntil(predicate, timeoutMs, pollMs = DEFAULT_POLL_MS) {
|
|
|
20409
20413
|
}
|
|
20410
20414
|
return predicate();
|
|
20411
20415
|
}
|
|
20416
|
+
var DEFAULT_SIGNAL_CONTAINERS = [
|
|
20417
|
+
'[class*="toast" i]',
|
|
20418
|
+
'[class*="notification" i]',
|
|
20419
|
+
'[role="alert"]',
|
|
20420
|
+
'[class*="message" i]'
|
|
20421
|
+
];
|
|
20412
20422
|
function errorMessage2(error) {
|
|
20413
20423
|
return error instanceof Error ? error.message : String(error);
|
|
20414
20424
|
}
|
|
@@ -20416,6 +20426,9 @@ function errorMessage2(error) {
|
|
|
20416
20426
|
// ../../plugins/publishings/wechatmp-pub/src/profile-check.ts
|
|
20417
20427
|
init_dist();
|
|
20418
20428
|
|
|
20429
|
+
// ../../plugins/publishings/wechatmp-pub/src/index.ts
|
|
20430
|
+
import { randomUUID } from "crypto";
|
|
20431
|
+
|
|
20419
20432
|
// ../../packages/kk-core/src/content-limits.ts
|
|
20420
20433
|
var PLATFORM_CONTENT_LIMITS = Object.freeze({
|
|
20421
20434
|
schemaVersion: 5,
|
|
@@ -20682,6 +20695,13 @@ var PluginManifestSchema = PluginManifestSchemaBase.superRefine((manifest, ctx)
|
|
|
20682
20695
|
});
|
|
20683
20696
|
// ../../packages/kk-core/src/render-md.ts
|
|
20684
20697
|
if (false) {}
|
|
20698
|
+
// ../../packages/kk-core/src/sentences.ts
|
|
20699
|
+
var CJK_TERMINATORS = new Set(["\u3002", "\uFF01", "\uFF1F"]);
|
|
20700
|
+
var LATIN_TERMINATORS = new Set([".", "!", "?"]);
|
|
20701
|
+
var ATTACHED_CLOSERS = new Set(["\u201D", "\u2019", "\u300D", "\u300F", "\uFF09", ")", '"', "'"]);
|
|
20702
|
+
// ../../plugins/publishings/wechatmp-pub/src/index.ts
|
|
20703
|
+
init_dist();
|
|
20704
|
+
|
|
20685
20705
|
// ../../plugins/publishings/wechatmp-pub/src/cgi.ts
|
|
20686
20706
|
var MP_ORIGIN = "https://mp.weixin.qq.com";
|
|
20687
20707
|
var FILETRANSFER_URL = `${MP_ORIGIN}/cgi-bin/filetransfer`;
|
|
@@ -20743,6 +20763,13 @@ var URL_CANCEL = `${URL_POPOVER} a.jsPopoverBt:text-is("\u53D6\u6D88")`;
|
|
|
20743
20763
|
var ORIGINAL_DECLARATION = `${DIALOG} label:has(.js_original_type_radio):has-text("\u6587\u5B57\u539F\u521B")`;
|
|
20744
20764
|
var ORIGINAL_AGREEMENT = `${DIALOG} label.original_agreement:has(input[type="checkbox"]:not(:checked))`;
|
|
20745
20765
|
|
|
20766
|
+
// ../../plugins/publishings/wechatmp-pub/src/flow.ts
|
|
20767
|
+
var PUBLIC_SAVE_REFUSAL_CONTAINERS = [
|
|
20768
|
+
...DEFAULT_SIGNAL_CONTAINERS,
|
|
20769
|
+
"div.version_fail_dialog:visible",
|
|
20770
|
+
"div.weui-desktop-dialog:visible"
|
|
20771
|
+
];
|
|
20772
|
+
|
|
20746
20773
|
// ../../plugins/publishings/wechatmp-pub/src/index.ts
|
|
20747
20774
|
var CHANNEL = TARGET;
|
|
20748
20775
|
var CONSOLE_READY_TIMEOUT_MS = 30000;
|
|
@@ -20752,6 +20779,25 @@ function isConsoleReady(page) {
|
|
|
20752
20779
|
function storageStatePath(profileDir) {
|
|
20753
20780
|
return `${profileDir}/storage-state.json`;
|
|
20754
20781
|
}
|
|
20782
|
+
async function persistWechatSessionState(context, profileDir) {
|
|
20783
|
+
const target = storageStatePath(profileDir);
|
|
20784
|
+
const temporary = `${target}.${process.pid}.${randomUUID()}.tmp`;
|
|
20785
|
+
const fs = createNodeFileSystem();
|
|
20786
|
+
let reserved = false;
|
|
20787
|
+
try {
|
|
20788
|
+
createExclusiveFile(temporary);
|
|
20789
|
+
reserved = true;
|
|
20790
|
+
await context.storageState({ path: temporary });
|
|
20791
|
+
chmod(temporary, 384);
|
|
20792
|
+
await fs.rename(temporary, target);
|
|
20793
|
+
} finally {
|
|
20794
|
+
if (reserved) {
|
|
20795
|
+
await Promise.resolve().then(() => fs.deleteFile(temporary)).catch(() => {
|
|
20796
|
+
return;
|
|
20797
|
+
});
|
|
20798
|
+
}
|
|
20799
|
+
}
|
|
20800
|
+
}
|
|
20755
20801
|
async function checkWechatSession(profileDir, opts = {}) {
|
|
20756
20802
|
const { page, context } = await openWithState(profileDir, opts.headless ?? true);
|
|
20757
20803
|
try {
|
|
@@ -20774,6 +20820,8 @@ async function openWechatLogin(opts) {
|
|
|
20774
20820
|
headless: false,
|
|
20775
20821
|
launcher: kkBrowserLauncher
|
|
20776
20822
|
});
|
|
20823
|
+
let failed = false;
|
|
20824
|
+
let failure;
|
|
20777
20825
|
try {
|
|
20778
20826
|
const page = context.pages()[0] ?? await context.newPage();
|
|
20779
20827
|
await page.goto(CONSOLE_URL);
|
|
@@ -20781,10 +20829,23 @@ async function openWechatLogin(opts) {
|
|
|
20781
20829
|
if (!ready)
|
|
20782
20830
|
throw new Error(`QR scan not completed within ${timeoutMs / 1000}s`);
|
|
20783
20831
|
await page.waitForTimeout(1e4);
|
|
20784
|
-
|
|
20785
|
-
|
|
20832
|
+
try {
|
|
20833
|
+
await persistWechatSessionState(context, opts.profileDir);
|
|
20834
|
+
} catch {
|
|
20835
|
+
throw new Error("wechatmp authenticated session snapshot failed");
|
|
20836
|
+
}
|
|
20837
|
+
} catch (error) {
|
|
20838
|
+
failed = true;
|
|
20839
|
+
failure = error;
|
|
20840
|
+
}
|
|
20841
|
+
try {
|
|
20786
20842
|
await context.close();
|
|
20843
|
+
} catch {
|
|
20844
|
+
if (!failed)
|
|
20845
|
+
echoError("wechatmp browser context close failed after authenticated session snapshot; saved state preserved");
|
|
20787
20846
|
}
|
|
20847
|
+
if (failed)
|
|
20848
|
+
throw failure;
|
|
20788
20849
|
}
|
|
20789
20850
|
async function openWechatSession(profileDir, opts = {}) {
|
|
20790
20851
|
const { context } = await openWithState(profileDir, opts.headless ?? false, opts.url ?? CONSOLE_URL);
|