@gobing-ai/knowledge-kit 0.0.21 → 0.0.22
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 +161 -142
- package/package.json +1 -1
- package/plugins/generations/content-gen/dist/index.js +20 -3
- package/plugins/generations/core-facts-gen/dist/index.js +20 -3
- package/plugins/generations/daily-article-gen/dist/index.js +20 -3
- package/plugins/generations/dailynews-gen/dist/index.js +20 -3
- package/plugins/generations/episode-plan-gen/dist/index.js +20 -3
- package/plugins/generations/image-gen/dist/index.js +147 -69
- package/plugins/generations/image-gen/src/presets.ts +2 -2
- package/plugins/generations/image-gen/src/providers/agnes.ts +6 -2
- package/plugins/generations/image-gen/src/providers/azure.ts +6 -2
- package/plugins/generations/image-gen/src/providers/dashscope.ts +10 -3
- package/plugins/generations/image-gen/src/providers/google.ts +70 -29
- package/plugins/generations/image-gen/src/providers/huggingface.ts +3 -0
- package/plugins/generations/image-gen/src/providers/jimeng.ts +9 -2
- package/plugins/generations/image-gen/src/providers/minimax.ts +10 -2
- package/plugins/generations/image-gen/src/providers/openai.ts +9 -3
- package/plugins/generations/image-gen/src/providers/openrouter.ts +16 -4
- package/plugins/generations/image-gen/src/providers/replicate.ts +13 -3
- package/plugins/generations/image-gen/src/providers/seedream.ts +4 -1
- package/plugins/generations/image-gen/src/providers/timeouts.ts +14 -0
- package/plugins/generations/image-gen/src/providers/types.ts +10 -0
- package/plugins/generations/image-gen/src/providers/zai.ts +4 -1
- package/plugins/generations/news-report-gen/dist/index.js +20 -3
- package/plugins/generations/voice-gen/dist/index.js +36 -10
- package/plugins/generations/voice-gen/src/voicebox-client.ts +18 -4
- package/plugins/generations/voice-gen/src/voicebox-server.ts +2 -1
- package/plugins/ingestions/aihot-ingest/dist/index.js +25 -5
- package/plugins/ingestions/aihot-ingest/src/client.ts +5 -0
- package/plugins/ingestions/horizon-ingest/dist/index.js +20 -3
- package/plugins/ingestions/last30days-ingest/dist/index.js +20 -3
- package/plugins/ingestions/web-search/dist/index.js +22 -3
- package/plugins/ingestions/web-search/src/index.ts +4 -0
- package/plugins/kk/plugin.json +1 -1
- package/plugins/kk/scripts/kk-workflow-stages.ts +35 -7
- package/plugins/kk/scripts/render-md.ts +7 -1
- package/plugins/publishings/emdash-pub/dist/index.js +76 -19
- package/plugins/publishings/emdash-pub/src/index.ts +4 -0
- package/plugins/publishings/infoq-pub/dist/index.js +74 -21
- package/plugins/publishings/juejin-pub/dist/index.js +74 -21
- package/plugins/publishings/medium-pub/dist/index.js +77 -19
- package/plugins/publishings/medium-pub/src/index.ts +5 -0
- package/plugins/publishings/podcast-pub/dist/index.js +130 -34
- package/plugins/publishings/podcast-pub/src/index.ts +20 -5
- package/plugins/publishings/podcast-pub/src/map.ts +11 -0
- package/plugins/publishings/podcast-pub/src/show-notes.ts +66 -13
- package/plugins/publishings/qiita-pub/dist/index.js +75 -18
- package/plugins/publishings/qiita-pub/src/index.ts +4 -0
- package/plugins/publishings/substack-pub/dist/index.js +74 -21
- package/plugins/publishings/surfdash-pub/dist/index.js +99 -62
- package/plugins/publishings/surfdash-pub/src/index.ts +60 -19
- package/plugins/publishings/wechatmp-pub/dist/index.js +79 -22
- package/plugins/publishings/wechatmp-pub/src/index.ts +12 -3
- package/plugins/publishings/x-pub/dist/index.js +56 -37
- package/plugins/publishings/x-pub/src/index.ts +4 -0
- package/plugins/publishings/xhs-pub/dist/index.js +74 -21
- package/plugins/publishings/zenn-pub/dist/index.js +103 -25
- package/plugins/publishings/zenn-pub/src/index.ts +43 -9
|
@@ -21781,6 +21781,22 @@ var ResultSchema = exports_external.object({
|
|
|
21781
21781
|
error: exports_external.string().optional(),
|
|
21782
21782
|
metadata: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
|
|
21783
21783
|
});
|
|
21784
|
+
var TargetOutcomeSchema = exports_external.object({
|
|
21785
|
+
target: exports_external.string(),
|
|
21786
|
+
ok: exports_external.boolean(),
|
|
21787
|
+
status: exports_external.enum(["published", "failed", "skipped"]),
|
|
21788
|
+
url: exports_external.string().optional(),
|
|
21789
|
+
id: exports_external.string().optional(),
|
|
21790
|
+
error: exports_external.string().optional(),
|
|
21791
|
+
durationMs: exports_external.number().optional(),
|
|
21792
|
+
metadata: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
|
|
21793
|
+
});
|
|
21794
|
+
var AggregateResultSchema = exports_external.object({
|
|
21795
|
+
ok: exports_external.boolean(),
|
|
21796
|
+
summary: exports_external.object({ total: exports_external.number(), succeeded: exports_external.number(), failed: exports_external.number(), skipped: exports_external.number() }),
|
|
21797
|
+
targets: exports_external.array(TargetOutcomeSchema),
|
|
21798
|
+
metadata: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
|
|
21799
|
+
});
|
|
21784
21800
|
var DocListSchema = exports_external.array(DocSchema);
|
|
21785
21801
|
var omniVoiceGenContentSchema = ContentSchema.extend({
|
|
21786
21802
|
format: exports_external.literal("audio"),
|
|
@@ -21809,14 +21825,15 @@ var PluginKindSchema = exports_external.enum(PLUGIN_KINDS);
|
|
|
21809
21825
|
// ../../packages/kk-core/src/manifest.ts
|
|
21810
21826
|
init_zod();
|
|
21811
21827
|
var OperationIOSchema = exports_external.enum(["doc-list", "markdown"]);
|
|
21812
|
-
var
|
|
21828
|
+
var PluginOperationSchema = exports_external.object({ input: OperationIOSchema, output: OperationIOSchema });
|
|
21829
|
+
var PluginManifestSchema = exports_external.looseObject({
|
|
21813
21830
|
name: exports_external.string().min(1),
|
|
21814
21831
|
kind: PluginKindSchema,
|
|
21815
21832
|
entry: exports_external.string().min(1),
|
|
21816
21833
|
version: exports_external.string().optional(),
|
|
21817
21834
|
description: exports_external.string().optional(),
|
|
21818
|
-
operations: exports_external.record(exports_external.string(),
|
|
21819
|
-
})
|
|
21835
|
+
operations: exports_external.record(exports_external.string(), PluginOperationSchema).optional()
|
|
21836
|
+
});
|
|
21820
21837
|
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.39/node_modules/@gobing-ai/ts-runtime/dist/index.js
|
|
21821
21838
|
init_file_system_node();
|
|
21822
21839
|
init_config();
|
|
@@ -21842,42 +21859,81 @@ function echoError(message, target = defaultStderrTarget ?? processStream("stder
|
|
|
21842
21859
|
// ../../packages/kk-core/src/render-md.ts
|
|
21843
21860
|
if (false) {}
|
|
21844
21861
|
// ../../packages/publish-harness/src/index.ts
|
|
21845
|
-
class
|
|
21846
|
-
|
|
21847
|
-
callLogs;
|
|
21862
|
+
class FakeTransportCore {
|
|
21863
|
+
callLogs = [];
|
|
21848
21864
|
nextResult;
|
|
21849
|
-
constructor() {
|
|
21850
|
-
this.callLogs = [];
|
|
21851
|
-
}
|
|
21852
21865
|
setNextResult(result) {
|
|
21853
21866
|
this.nextResult = result;
|
|
21854
21867
|
}
|
|
21855
|
-
async publish(payload) {
|
|
21868
|
+
async publish(payload, defaultResult) {
|
|
21856
21869
|
this.callLogs.push({
|
|
21857
21870
|
timestamp: new Date().toISOString(),
|
|
21858
21871
|
payload
|
|
21859
21872
|
});
|
|
21860
|
-
|
|
21861
|
-
|
|
21862
|
-
|
|
21863
|
-
return
|
|
21873
|
+
return this.nextResult ?? defaultResult;
|
|
21874
|
+
}
|
|
21875
|
+
getCallLogs() {
|
|
21876
|
+
return this.callLogs;
|
|
21877
|
+
}
|
|
21878
|
+
reset() {
|
|
21879
|
+
this.callLogs = [];
|
|
21880
|
+
this.nextResult = undefined;
|
|
21881
|
+
}
|
|
21882
|
+
}
|
|
21883
|
+
|
|
21884
|
+
class FakeFileCliTransport {
|
|
21885
|
+
kind = "file-cli";
|
|
21886
|
+
core = new FakeTransportCore;
|
|
21887
|
+
setNextResult(result) {
|
|
21888
|
+
this.core.setNextResult(result);
|
|
21889
|
+
}
|
|
21890
|
+
async publish(payload) {
|
|
21891
|
+
return this.core.publish(payload, {
|
|
21864
21892
|
ok: true,
|
|
21865
21893
|
target: "fake-file-cli",
|
|
21866
21894
|
url: "https://example.com/published-post",
|
|
21867
21895
|
id: "fake-id-123",
|
|
21868
21896
|
message: "Published offline via FakeFileCliTransport"
|
|
21869
|
-
};
|
|
21897
|
+
});
|
|
21870
21898
|
}
|
|
21871
21899
|
getCallLogs() {
|
|
21872
|
-
return this.
|
|
21900
|
+
return this.core.getCallLogs();
|
|
21873
21901
|
}
|
|
21874
21902
|
reset() {
|
|
21875
|
-
this.
|
|
21876
|
-
|
|
21903
|
+
this.core.reset();
|
|
21904
|
+
}
|
|
21905
|
+
}
|
|
21906
|
+
|
|
21907
|
+
class FakeBrowserTransport {
|
|
21908
|
+
kind = "browser";
|
|
21909
|
+
driver;
|
|
21910
|
+
core = new FakeTransportCore;
|
|
21911
|
+
constructor(driver = "agent") {
|
|
21912
|
+
this.driver = driver;
|
|
21913
|
+
}
|
|
21914
|
+
setNextResult(result) {
|
|
21915
|
+
this.core.setNextResult(result);
|
|
21916
|
+
}
|
|
21917
|
+
async publish(payload) {
|
|
21918
|
+
return this.core.publish(payload, {
|
|
21919
|
+
ok: true,
|
|
21920
|
+
target: "fake-browser",
|
|
21921
|
+
url: "https://example.com/browser-draft",
|
|
21922
|
+
id: "fake-browser-id-123",
|
|
21923
|
+
message: "Published offline via FakeBrowserTransport",
|
|
21924
|
+
metadata: { driver: this.driver }
|
|
21925
|
+
});
|
|
21926
|
+
}
|
|
21927
|
+
getCallLogs() {
|
|
21928
|
+
return this.core.getCallLogs();
|
|
21929
|
+
}
|
|
21930
|
+
reset() {
|
|
21931
|
+
this.core.reset();
|
|
21877
21932
|
}
|
|
21878
21933
|
}
|
|
21879
21934
|
|
|
21880
21935
|
// ../../plugins/publishings/emdash-pub/src/index.ts
|
|
21936
|
+
var REQUEST_TIMEOUT_MS = 120000;
|
|
21881
21937
|
function slugify2(str) {
|
|
21882
21938
|
return str.toLowerCase().replace(/[^\w\s-]/g, "").trim().replace(/[\s_]+/g, "-");
|
|
21883
21939
|
}
|
|
@@ -22098,7 +22154,8 @@ class EmDashApiTransport {
|
|
|
22098
22154
|
Authorization: `Bearer ${token}`,
|
|
22099
22155
|
"Content-Type": "application/json"
|
|
22100
22156
|
},
|
|
22101
|
-
body: JSON.stringify(envelope)
|
|
22157
|
+
body: JSON.stringify(envelope),
|
|
22158
|
+
signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS)
|
|
22102
22159
|
});
|
|
22103
22160
|
let body;
|
|
22104
22161
|
try {
|
|
@@ -5,6 +5,9 @@ import { FakeFileCliTransport, type PublishTransport, type PublishTransportPaylo
|
|
|
5
5
|
import { createNodeFileSystem } from '@gobing-ai/ts-runtime';
|
|
6
6
|
import { echoError } from '@gobing-ai/ts-utils';
|
|
7
7
|
|
|
8
|
+
/** Per-request timeout (ms) for the EmDash REST call — Bun's `fetch` has no default deadline (R5). */
|
|
9
|
+
const REQUEST_TIMEOUT_MS = 120_000;
|
|
10
|
+
|
|
8
11
|
/** EmDash create envelope per docs/design/emdash-pub.md §3 (REST create). */
|
|
9
12
|
export interface EmDashCreateEnvelope {
|
|
10
13
|
data: {
|
|
@@ -313,6 +316,7 @@ export class EmDashApiTransport implements PublishTransport {
|
|
|
313
316
|
'Content-Type': 'application/json',
|
|
314
317
|
},
|
|
315
318
|
body: JSON.stringify(envelope),
|
|
319
|
+
signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),
|
|
316
320
|
});
|
|
317
321
|
|
|
318
322
|
let body: { success?: unknown; error?: { code?: unknown }; data?: { item?: { id?: unknown } } } | undefined;
|
|
@@ -21781,6 +21781,22 @@ var ResultSchema = exports_external.object({
|
|
|
21781
21781
|
error: exports_external.string().optional(),
|
|
21782
21782
|
metadata: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
|
|
21783
21783
|
});
|
|
21784
|
+
var TargetOutcomeSchema = exports_external.object({
|
|
21785
|
+
target: exports_external.string(),
|
|
21786
|
+
ok: exports_external.boolean(),
|
|
21787
|
+
status: exports_external.enum(["published", "failed", "skipped"]),
|
|
21788
|
+
url: exports_external.string().optional(),
|
|
21789
|
+
id: exports_external.string().optional(),
|
|
21790
|
+
error: exports_external.string().optional(),
|
|
21791
|
+
durationMs: exports_external.number().optional(),
|
|
21792
|
+
metadata: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
|
|
21793
|
+
});
|
|
21794
|
+
var AggregateResultSchema = exports_external.object({
|
|
21795
|
+
ok: exports_external.boolean(),
|
|
21796
|
+
summary: exports_external.object({ total: exports_external.number(), succeeded: exports_external.number(), failed: exports_external.number(), skipped: exports_external.number() }),
|
|
21797
|
+
targets: exports_external.array(TargetOutcomeSchema),
|
|
21798
|
+
metadata: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
|
|
21799
|
+
});
|
|
21784
21800
|
var DocListSchema = exports_external.array(DocSchema);
|
|
21785
21801
|
var omniVoiceGenContentSchema = ContentSchema.extend({
|
|
21786
21802
|
format: exports_external.literal("audio"),
|
|
@@ -21809,14 +21825,15 @@ var PluginKindSchema = exports_external.enum(PLUGIN_KINDS);
|
|
|
21809
21825
|
// ../../packages/kk-core/src/manifest.ts
|
|
21810
21826
|
init_zod();
|
|
21811
21827
|
var OperationIOSchema = exports_external.enum(["doc-list", "markdown"]);
|
|
21812
|
-
var
|
|
21828
|
+
var PluginOperationSchema = exports_external.object({ input: OperationIOSchema, output: OperationIOSchema });
|
|
21829
|
+
var PluginManifestSchema = exports_external.looseObject({
|
|
21813
21830
|
name: exports_external.string().min(1),
|
|
21814
21831
|
kind: PluginKindSchema,
|
|
21815
21832
|
entry: exports_external.string().min(1),
|
|
21816
21833
|
version: exports_external.string().optional(),
|
|
21817
21834
|
description: exports_external.string().optional(),
|
|
21818
|
-
operations: exports_external.record(exports_external.string(),
|
|
21819
|
-
})
|
|
21835
|
+
operations: exports_external.record(exports_external.string(), PluginOperationSchema).optional()
|
|
21836
|
+
});
|
|
21820
21837
|
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.39/node_modules/@gobing-ai/ts-runtime/dist/index.js
|
|
21821
21838
|
init_file_system_node();
|
|
21822
21839
|
init_config();
|
|
@@ -21843,42 +21860,78 @@ function echoError(message, target = defaultStderrTarget ?? processStream("stder
|
|
|
21843
21860
|
if (false) {}
|
|
21844
21861
|
// ../../packages/publish-harness/src/index.ts
|
|
21845
21862
|
import { homedir } from "os";
|
|
21846
|
-
import { join } from "path";
|
|
21863
|
+
import { join, resolve } from "path";
|
|
21864
|
+
|
|
21865
|
+
class FakeTransportCore {
|
|
21866
|
+
callLogs = [];
|
|
21867
|
+
nextResult;
|
|
21868
|
+
setNextResult(result) {
|
|
21869
|
+
this.nextResult = result;
|
|
21870
|
+
}
|
|
21871
|
+
async publish(payload, defaultResult) {
|
|
21872
|
+
this.callLogs.push({
|
|
21873
|
+
timestamp: new Date().toISOString(),
|
|
21874
|
+
payload
|
|
21875
|
+
});
|
|
21876
|
+
return this.nextResult ?? defaultResult;
|
|
21877
|
+
}
|
|
21878
|
+
getCallLogs() {
|
|
21879
|
+
return this.callLogs;
|
|
21880
|
+
}
|
|
21881
|
+
reset() {
|
|
21882
|
+
this.callLogs = [];
|
|
21883
|
+
this.nextResult = undefined;
|
|
21884
|
+
}
|
|
21885
|
+
}
|
|
21886
|
+
|
|
21887
|
+
class FakeFileCliTransport {
|
|
21888
|
+
kind = "file-cli";
|
|
21889
|
+
core = new FakeTransportCore;
|
|
21890
|
+
setNextResult(result) {
|
|
21891
|
+
this.core.setNextResult(result);
|
|
21892
|
+
}
|
|
21893
|
+
async publish(payload) {
|
|
21894
|
+
return this.core.publish(payload, {
|
|
21895
|
+
ok: true,
|
|
21896
|
+
target: "fake-file-cli",
|
|
21897
|
+
url: "https://example.com/published-post",
|
|
21898
|
+
id: "fake-id-123",
|
|
21899
|
+
message: "Published offline via FakeFileCliTransport"
|
|
21900
|
+
});
|
|
21901
|
+
}
|
|
21902
|
+
getCallLogs() {
|
|
21903
|
+
return this.core.getCallLogs();
|
|
21904
|
+
}
|
|
21905
|
+
reset() {
|
|
21906
|
+
this.core.reset();
|
|
21907
|
+
}
|
|
21908
|
+
}
|
|
21909
|
+
|
|
21847
21910
|
class FakeBrowserTransport {
|
|
21848
21911
|
kind = "browser";
|
|
21849
21912
|
driver;
|
|
21850
|
-
|
|
21851
|
-
nextResult;
|
|
21913
|
+
core = new FakeTransportCore;
|
|
21852
21914
|
constructor(driver = "agent") {
|
|
21853
21915
|
this.driver = driver;
|
|
21854
|
-
this.callLogs = [];
|
|
21855
21916
|
}
|
|
21856
21917
|
setNextResult(result) {
|
|
21857
|
-
this.
|
|
21918
|
+
this.core.setNextResult(result);
|
|
21858
21919
|
}
|
|
21859
21920
|
async publish(payload) {
|
|
21860
|
-
this.
|
|
21861
|
-
timestamp: new Date().toISOString(),
|
|
21862
|
-
payload
|
|
21863
|
-
});
|
|
21864
|
-
if (this.nextResult) {
|
|
21865
|
-
return this.nextResult;
|
|
21866
|
-
}
|
|
21867
|
-
return {
|
|
21921
|
+
return this.core.publish(payload, {
|
|
21868
21922
|
ok: true,
|
|
21869
21923
|
target: "fake-browser",
|
|
21870
21924
|
url: "https://example.com/browser-draft",
|
|
21871
21925
|
id: "fake-browser-id-123",
|
|
21872
21926
|
message: "Published offline via FakeBrowserTransport",
|
|
21873
21927
|
metadata: { driver: this.driver }
|
|
21874
|
-
};
|
|
21928
|
+
});
|
|
21875
21929
|
}
|
|
21876
21930
|
getCallLogs() {
|
|
21877
|
-
return this.
|
|
21931
|
+
return this.core.getCallLogs();
|
|
21878
21932
|
}
|
|
21879
21933
|
reset() {
|
|
21880
|
-
this.
|
|
21881
|
-
this.nextResult = undefined;
|
|
21934
|
+
this.core.reset();
|
|
21882
21935
|
}
|
|
21883
21936
|
}
|
|
21884
21937
|
function resolveBrowserProfileDir(channel, override) {
|
|
@@ -21887,7 +21940,7 @@ function resolveBrowserProfileDir(channel, override) {
|
|
|
21887
21940
|
if (trimmed.startsWith("~/")) {
|
|
21888
21941
|
return join(homedir(), trimmed.slice(2));
|
|
21889
21942
|
}
|
|
21890
|
-
return trimmed;
|
|
21943
|
+
return resolve(trimmed);
|
|
21891
21944
|
}
|
|
21892
21945
|
return join(homedir(), ".config", "kk", "browser-profiles", channel);
|
|
21893
21946
|
}
|
|
@@ -21781,6 +21781,22 @@ var ResultSchema = exports_external.object({
|
|
|
21781
21781
|
error: exports_external.string().optional(),
|
|
21782
21782
|
metadata: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
|
|
21783
21783
|
});
|
|
21784
|
+
var TargetOutcomeSchema = exports_external.object({
|
|
21785
|
+
target: exports_external.string(),
|
|
21786
|
+
ok: exports_external.boolean(),
|
|
21787
|
+
status: exports_external.enum(["published", "failed", "skipped"]),
|
|
21788
|
+
url: exports_external.string().optional(),
|
|
21789
|
+
id: exports_external.string().optional(),
|
|
21790
|
+
error: exports_external.string().optional(),
|
|
21791
|
+
durationMs: exports_external.number().optional(),
|
|
21792
|
+
metadata: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
|
|
21793
|
+
});
|
|
21794
|
+
var AggregateResultSchema = exports_external.object({
|
|
21795
|
+
ok: exports_external.boolean(),
|
|
21796
|
+
summary: exports_external.object({ total: exports_external.number(), succeeded: exports_external.number(), failed: exports_external.number(), skipped: exports_external.number() }),
|
|
21797
|
+
targets: exports_external.array(TargetOutcomeSchema),
|
|
21798
|
+
metadata: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
|
|
21799
|
+
});
|
|
21784
21800
|
var DocListSchema = exports_external.array(DocSchema);
|
|
21785
21801
|
var omniVoiceGenContentSchema = ContentSchema.extend({
|
|
21786
21802
|
format: exports_external.literal("audio"),
|
|
@@ -21809,14 +21825,15 @@ var PluginKindSchema = exports_external.enum(PLUGIN_KINDS);
|
|
|
21809
21825
|
// ../../packages/kk-core/src/manifest.ts
|
|
21810
21826
|
init_zod();
|
|
21811
21827
|
var OperationIOSchema = exports_external.enum(["doc-list", "markdown"]);
|
|
21812
|
-
var
|
|
21828
|
+
var PluginOperationSchema = exports_external.object({ input: OperationIOSchema, output: OperationIOSchema });
|
|
21829
|
+
var PluginManifestSchema = exports_external.looseObject({
|
|
21813
21830
|
name: exports_external.string().min(1),
|
|
21814
21831
|
kind: PluginKindSchema,
|
|
21815
21832
|
entry: exports_external.string().min(1),
|
|
21816
21833
|
version: exports_external.string().optional(),
|
|
21817
21834
|
description: exports_external.string().optional(),
|
|
21818
|
-
operations: exports_external.record(exports_external.string(),
|
|
21819
|
-
})
|
|
21835
|
+
operations: exports_external.record(exports_external.string(), PluginOperationSchema).optional()
|
|
21836
|
+
});
|
|
21820
21837
|
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.39/node_modules/@gobing-ai/ts-runtime/dist/index.js
|
|
21821
21838
|
init_file_system_node();
|
|
21822
21839
|
init_config();
|
|
@@ -21843,42 +21860,78 @@ function echoError(message, target = defaultStderrTarget ?? processStream("stder
|
|
|
21843
21860
|
if (false) {}
|
|
21844
21861
|
// ../../packages/publish-harness/src/index.ts
|
|
21845
21862
|
import { homedir } from "os";
|
|
21846
|
-
import { join } from "path";
|
|
21863
|
+
import { join, resolve } from "path";
|
|
21864
|
+
|
|
21865
|
+
class FakeTransportCore {
|
|
21866
|
+
callLogs = [];
|
|
21867
|
+
nextResult;
|
|
21868
|
+
setNextResult(result) {
|
|
21869
|
+
this.nextResult = result;
|
|
21870
|
+
}
|
|
21871
|
+
async publish(payload, defaultResult) {
|
|
21872
|
+
this.callLogs.push({
|
|
21873
|
+
timestamp: new Date().toISOString(),
|
|
21874
|
+
payload
|
|
21875
|
+
});
|
|
21876
|
+
return this.nextResult ?? defaultResult;
|
|
21877
|
+
}
|
|
21878
|
+
getCallLogs() {
|
|
21879
|
+
return this.callLogs;
|
|
21880
|
+
}
|
|
21881
|
+
reset() {
|
|
21882
|
+
this.callLogs = [];
|
|
21883
|
+
this.nextResult = undefined;
|
|
21884
|
+
}
|
|
21885
|
+
}
|
|
21886
|
+
|
|
21887
|
+
class FakeFileCliTransport {
|
|
21888
|
+
kind = "file-cli";
|
|
21889
|
+
core = new FakeTransportCore;
|
|
21890
|
+
setNextResult(result) {
|
|
21891
|
+
this.core.setNextResult(result);
|
|
21892
|
+
}
|
|
21893
|
+
async publish(payload) {
|
|
21894
|
+
return this.core.publish(payload, {
|
|
21895
|
+
ok: true,
|
|
21896
|
+
target: "fake-file-cli",
|
|
21897
|
+
url: "https://example.com/published-post",
|
|
21898
|
+
id: "fake-id-123",
|
|
21899
|
+
message: "Published offline via FakeFileCliTransport"
|
|
21900
|
+
});
|
|
21901
|
+
}
|
|
21902
|
+
getCallLogs() {
|
|
21903
|
+
return this.core.getCallLogs();
|
|
21904
|
+
}
|
|
21905
|
+
reset() {
|
|
21906
|
+
this.core.reset();
|
|
21907
|
+
}
|
|
21908
|
+
}
|
|
21909
|
+
|
|
21847
21910
|
class FakeBrowserTransport {
|
|
21848
21911
|
kind = "browser";
|
|
21849
21912
|
driver;
|
|
21850
|
-
|
|
21851
|
-
nextResult;
|
|
21913
|
+
core = new FakeTransportCore;
|
|
21852
21914
|
constructor(driver = "agent") {
|
|
21853
21915
|
this.driver = driver;
|
|
21854
|
-
this.callLogs = [];
|
|
21855
21916
|
}
|
|
21856
21917
|
setNextResult(result) {
|
|
21857
|
-
this.
|
|
21918
|
+
this.core.setNextResult(result);
|
|
21858
21919
|
}
|
|
21859
21920
|
async publish(payload) {
|
|
21860
|
-
this.
|
|
21861
|
-
timestamp: new Date().toISOString(),
|
|
21862
|
-
payload
|
|
21863
|
-
});
|
|
21864
|
-
if (this.nextResult) {
|
|
21865
|
-
return this.nextResult;
|
|
21866
|
-
}
|
|
21867
|
-
return {
|
|
21921
|
+
return this.core.publish(payload, {
|
|
21868
21922
|
ok: true,
|
|
21869
21923
|
target: "fake-browser",
|
|
21870
21924
|
url: "https://example.com/browser-draft",
|
|
21871
21925
|
id: "fake-browser-id-123",
|
|
21872
21926
|
message: "Published offline via FakeBrowserTransport",
|
|
21873
21927
|
metadata: { driver: this.driver }
|
|
21874
|
-
};
|
|
21928
|
+
});
|
|
21875
21929
|
}
|
|
21876
21930
|
getCallLogs() {
|
|
21877
|
-
return this.
|
|
21931
|
+
return this.core.getCallLogs();
|
|
21878
21932
|
}
|
|
21879
21933
|
reset() {
|
|
21880
|
-
this.
|
|
21881
|
-
this.nextResult = undefined;
|
|
21934
|
+
this.core.reset();
|
|
21882
21935
|
}
|
|
21883
21936
|
}
|
|
21884
21937
|
function resolveBrowserProfileDir(channel, override) {
|
|
@@ -21887,7 +21940,7 @@ function resolveBrowserProfileDir(channel, override) {
|
|
|
21887
21940
|
if (trimmed.startsWith("~/")) {
|
|
21888
21941
|
return join(homedir(), trimmed.slice(2));
|
|
21889
21942
|
}
|
|
21890
|
-
return trimmed;
|
|
21943
|
+
return resolve(trimmed);
|
|
21891
21944
|
}
|
|
21892
21945
|
return join(homedir(), ".config", "kk", "browser-profiles", channel);
|
|
21893
21946
|
}
|
|
@@ -21781,6 +21781,22 @@ var ResultSchema = exports_external.object({
|
|
|
21781
21781
|
error: exports_external.string().optional(),
|
|
21782
21782
|
metadata: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
|
|
21783
21783
|
});
|
|
21784
|
+
var TargetOutcomeSchema = exports_external.object({
|
|
21785
|
+
target: exports_external.string(),
|
|
21786
|
+
ok: exports_external.boolean(),
|
|
21787
|
+
status: exports_external.enum(["published", "failed", "skipped"]),
|
|
21788
|
+
url: exports_external.string().optional(),
|
|
21789
|
+
id: exports_external.string().optional(),
|
|
21790
|
+
error: exports_external.string().optional(),
|
|
21791
|
+
durationMs: exports_external.number().optional(),
|
|
21792
|
+
metadata: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
|
|
21793
|
+
});
|
|
21794
|
+
var AggregateResultSchema = exports_external.object({
|
|
21795
|
+
ok: exports_external.boolean(),
|
|
21796
|
+
summary: exports_external.object({ total: exports_external.number(), succeeded: exports_external.number(), failed: exports_external.number(), skipped: exports_external.number() }),
|
|
21797
|
+
targets: exports_external.array(TargetOutcomeSchema),
|
|
21798
|
+
metadata: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
|
|
21799
|
+
});
|
|
21784
21800
|
var DocListSchema = exports_external.array(DocSchema);
|
|
21785
21801
|
var omniVoiceGenContentSchema = ContentSchema.extend({
|
|
21786
21802
|
format: exports_external.literal("audio"),
|
|
@@ -21809,14 +21825,15 @@ var PluginKindSchema = exports_external.enum(PLUGIN_KINDS);
|
|
|
21809
21825
|
// ../../packages/kk-core/src/manifest.ts
|
|
21810
21826
|
init_zod();
|
|
21811
21827
|
var OperationIOSchema = exports_external.enum(["doc-list", "markdown"]);
|
|
21812
|
-
var
|
|
21828
|
+
var PluginOperationSchema = exports_external.object({ input: OperationIOSchema, output: OperationIOSchema });
|
|
21829
|
+
var PluginManifestSchema = exports_external.looseObject({
|
|
21813
21830
|
name: exports_external.string().min(1),
|
|
21814
21831
|
kind: PluginKindSchema,
|
|
21815
21832
|
entry: exports_external.string().min(1),
|
|
21816
21833
|
version: exports_external.string().optional(),
|
|
21817
21834
|
description: exports_external.string().optional(),
|
|
21818
|
-
operations: exports_external.record(exports_external.string(),
|
|
21819
|
-
})
|
|
21835
|
+
operations: exports_external.record(exports_external.string(), PluginOperationSchema).optional()
|
|
21836
|
+
});
|
|
21820
21837
|
// ../../node_modules/.bun/@gobing-ai+ts-runtime@0.4.39/node_modules/@gobing-ai/ts-runtime/dist/index.js
|
|
21821
21838
|
init_file_system_node();
|
|
21822
21839
|
init_config();
|
|
@@ -21842,43 +21859,82 @@ function echoError(message, target = defaultStderrTarget ?? processStream("stder
|
|
|
21842
21859
|
// ../../packages/kk-core/src/render-md.ts
|
|
21843
21860
|
if (false) {}
|
|
21844
21861
|
// ../../packages/publish-harness/src/index.ts
|
|
21845
|
-
class
|
|
21846
|
-
|
|
21847
|
-
callLogs;
|
|
21862
|
+
class FakeTransportCore {
|
|
21863
|
+
callLogs = [];
|
|
21848
21864
|
nextResult;
|
|
21849
|
-
constructor() {
|
|
21850
|
-
this.callLogs = [];
|
|
21851
|
-
}
|
|
21852
21865
|
setNextResult(result) {
|
|
21853
21866
|
this.nextResult = result;
|
|
21854
21867
|
}
|
|
21855
|
-
async publish(payload) {
|
|
21868
|
+
async publish(payload, defaultResult) {
|
|
21856
21869
|
this.callLogs.push({
|
|
21857
21870
|
timestamp: new Date().toISOString(),
|
|
21858
21871
|
payload
|
|
21859
21872
|
});
|
|
21860
|
-
|
|
21861
|
-
|
|
21862
|
-
|
|
21863
|
-
return
|
|
21873
|
+
return this.nextResult ?? defaultResult;
|
|
21874
|
+
}
|
|
21875
|
+
getCallLogs() {
|
|
21876
|
+
return this.callLogs;
|
|
21877
|
+
}
|
|
21878
|
+
reset() {
|
|
21879
|
+
this.callLogs = [];
|
|
21880
|
+
this.nextResult = undefined;
|
|
21881
|
+
}
|
|
21882
|
+
}
|
|
21883
|
+
|
|
21884
|
+
class FakeFileCliTransport {
|
|
21885
|
+
kind = "file-cli";
|
|
21886
|
+
core = new FakeTransportCore;
|
|
21887
|
+
setNextResult(result) {
|
|
21888
|
+
this.core.setNextResult(result);
|
|
21889
|
+
}
|
|
21890
|
+
async publish(payload) {
|
|
21891
|
+
return this.core.publish(payload, {
|
|
21864
21892
|
ok: true,
|
|
21865
21893
|
target: "fake-file-cli",
|
|
21866
21894
|
url: "https://example.com/published-post",
|
|
21867
21895
|
id: "fake-id-123",
|
|
21868
21896
|
message: "Published offline via FakeFileCliTransport"
|
|
21869
|
-
};
|
|
21897
|
+
});
|
|
21870
21898
|
}
|
|
21871
21899
|
getCallLogs() {
|
|
21872
|
-
return this.
|
|
21900
|
+
return this.core.getCallLogs();
|
|
21873
21901
|
}
|
|
21874
21902
|
reset() {
|
|
21875
|
-
this.
|
|
21876
|
-
|
|
21903
|
+
this.core.reset();
|
|
21904
|
+
}
|
|
21905
|
+
}
|
|
21906
|
+
|
|
21907
|
+
class FakeBrowserTransport {
|
|
21908
|
+
kind = "browser";
|
|
21909
|
+
driver;
|
|
21910
|
+
core = new FakeTransportCore;
|
|
21911
|
+
constructor(driver = "agent") {
|
|
21912
|
+
this.driver = driver;
|
|
21913
|
+
}
|
|
21914
|
+
setNextResult(result) {
|
|
21915
|
+
this.core.setNextResult(result);
|
|
21916
|
+
}
|
|
21917
|
+
async publish(payload) {
|
|
21918
|
+
return this.core.publish(payload, {
|
|
21919
|
+
ok: true,
|
|
21920
|
+
target: "fake-browser",
|
|
21921
|
+
url: "https://example.com/browser-draft",
|
|
21922
|
+
id: "fake-browser-id-123",
|
|
21923
|
+
message: "Published offline via FakeBrowserTransport",
|
|
21924
|
+
metadata: { driver: this.driver }
|
|
21925
|
+
});
|
|
21926
|
+
}
|
|
21927
|
+
getCallLogs() {
|
|
21928
|
+
return this.core.getCallLogs();
|
|
21929
|
+
}
|
|
21930
|
+
reset() {
|
|
21931
|
+
this.core.reset();
|
|
21877
21932
|
}
|
|
21878
21933
|
}
|
|
21879
21934
|
|
|
21880
21935
|
// ../../plugins/publishings/medium-pub/src/index.ts
|
|
21881
21936
|
var MEDIUM_API_BASE = "https://api.medium.com/v1";
|
|
21937
|
+
var REQUEST_TIMEOUT_MS = 120000;
|
|
21882
21938
|
var TARGET = "medium";
|
|
21883
21939
|
var TOKEN_ENV = "MEDIUM_INTEGRATION_TOKEN";
|
|
21884
21940
|
var STATUS_ENV = "MEDIUM_PUBLISH_STATUS";
|
|
@@ -21927,7 +21983,8 @@ class MediumApiTransport {
|
|
|
21927
21983
|
const body = mapContentToMediumPost(payload.content, payload.options);
|
|
21928
21984
|
try {
|
|
21929
21985
|
const meResponse = await fetch(`${MEDIUM_API_BASE}/me`, {
|
|
21930
|
-
headers: { Authorization: `Bearer ${token}`, Accept: "application/json" }
|
|
21986
|
+
headers: { Authorization: `Bearer ${token}`, Accept: "application/json" },
|
|
21987
|
+
signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS)
|
|
21931
21988
|
});
|
|
21932
21989
|
if (!meResponse.ok) {
|
|
21933
21990
|
const errorText = (await meResponse.text()).slice(0, 1000);
|
|
@@ -21944,6 +22001,7 @@ class MediumApiTransport {
|
|
|
21944
22001
|
"Content-Type": "application/json",
|
|
21945
22002
|
Accept: "application/json"
|
|
21946
22003
|
},
|
|
22004
|
+
signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),
|
|
21947
22005
|
body: JSON.stringify(body)
|
|
21948
22006
|
});
|
|
21949
22007
|
if (!postResponse.ok) {
|
|
@@ -7,6 +7,9 @@ import { echoError } from '@gobing-ai/ts-utils';
|
|
|
7
7
|
|
|
8
8
|
/** Medium REST API v1 (integration tokens still post; official docs archived 2023). */
|
|
9
9
|
const MEDIUM_API_BASE = 'https://api.medium.com/v1';
|
|
10
|
+
|
|
11
|
+
/** Per-request timeout (ms) for Medium HTTP calls — Bun's `fetch` has no default deadline (R5). */
|
|
12
|
+
const REQUEST_TIMEOUT_MS = 120_000;
|
|
10
13
|
const TARGET = 'medium';
|
|
11
14
|
const TOKEN_ENV = 'MEDIUM_INTEGRATION_TOKEN';
|
|
12
15
|
const STATUS_ENV = 'MEDIUM_PUBLISH_STATUS';
|
|
@@ -91,6 +94,7 @@ export class MediumApiTransport implements PublishTransport {
|
|
|
91
94
|
try {
|
|
92
95
|
const meResponse = await fetch(`${MEDIUM_API_BASE}/me`, {
|
|
93
96
|
headers: { Authorization: `Bearer ${token}`, Accept: 'application/json' },
|
|
97
|
+
signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),
|
|
94
98
|
});
|
|
95
99
|
if (!meResponse.ok) {
|
|
96
100
|
const errorText = (await meResponse.text()).slice(0, 1000);
|
|
@@ -110,6 +114,7 @@ export class MediumApiTransport implements PublishTransport {
|
|
|
110
114
|
'Content-Type': 'application/json',
|
|
111
115
|
Accept: 'application/json',
|
|
112
116
|
},
|
|
117
|
+
signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),
|
|
113
118
|
body: JSON.stringify(body),
|
|
114
119
|
});
|
|
115
120
|
if (!postResponse.ok) {
|