@gobing-ai/knowledge-kit 0.0.37 → 0.1.0
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.css +654 -16
- package/dist/board/collect/index.js +191 -64
- package/dist/board/daily-voice/index.css +679 -12
- package/dist/board/daily-voice/index.js +185 -66
- package/dist/board/itc/index.css +679 -13
- package/dist/board/itc/index.js +188 -66
- package/dist/index.js +2864 -139
- package/package.json +3 -2
- package/plugins/generations/content-gen/dist/index.js +158 -12
- package/plugins/generations/core-facts-gen/dist/index.js +158 -12
- package/plugins/generations/daily-article-gen/dist/index.js +158 -12
- package/plugins/generations/dailynews-gen/dist/index.js +158 -12
- package/plugins/generations/episode-plan-gen/dist/index.js +158 -12
- package/plugins/generations/gemini-tts/README.md +4 -3
- package/plugins/generations/gemini-tts/dist/index.js +158 -12
- package/plugins/generations/image-gen/dist/index.js +158 -12
- package/plugins/generations/news-report-gen/dist/index.js +158 -12
- package/plugins/generations/omni-voice-gen/README.md +15 -4
- package/plugins/generations/omni-voice-gen/profiles.json +1 -2
- package/plugins/generations/voice-gen/dist/index.js +158 -12
- package/plugins/generations/voxcpm-tts/README.md +21 -1
- package/plugins/generations/voxcpm-tts/dist/index.js +173 -13
- package/plugins/generations/voxcpm-tts/scripts/audit-speaker-consistency.py +109 -0
- package/plugins/generations/voxcpm-tts/src/voxcpm-client.ts +28 -1
- package/plugins/ingestions/aihot-ingest/dist/index.js +158 -12
- package/plugins/ingestions/horizon-ingest/dist/index.js +158 -12
- package/plugins/ingestions/last30days-ingest/dist/index.js +158 -12
- package/plugins/ingestions/web-search/dist/index.js +158 -12
- package/plugins/kk/commands/workflow-run.md +56 -18
- package/plugins/kk/decisions/kk-itc.yaml +46 -0
- package/plugins/kk/decisions/kk-seo-keyword.yaml +57 -0
- package/plugins/kk/decisions/kk-seo-page.yaml +230 -0
- package/plugins/kk/decisions/kk-seo-pair.yaml +21 -0
- package/plugins/kk/decisions/kk-seo-site.yaml +90 -0
- package/plugins/kk/plugin.json +1 -1
- package/plugins/kk/publish-presets/chinese-article.json +14 -0
- package/plugins/kk/publish-presets/technical-article.json +14 -0
- package/plugins/kk/references/smart-seo-attribution.md +85 -0
- package/plugins/kk/scripts/daily-stages.ts +42 -2
- package/plugins/kk/scripts/itc-stages.ts +25 -118
- package/plugins/kk/scripts/kk-workflow-stages.ts +38 -1
- package/plugins/kk/scripts/seo-decisions.ts +477 -0
- package/plugins/kk/scripts/seo-enrich.ts +728 -0
- package/plugins/kk/scripts/seo-facts.ts +610 -0
- package/plugins/kk/scripts/seo-fetch.ts +766 -0
- package/plugins/kk/scripts/seo-report.ts +460 -0
- package/plugins/kk/scripts/seo-rules.ts +1882 -0
- package/plugins/kk/scripts/seo-stages.ts +1044 -0
- package/plugins/kk/skills/article-adapt/SKILL.md +2 -2
- package/plugins/kk/skills/smart-seo/SKILL.md +183 -0
- package/plugins/kk/skills/smart-seo/references/method.md +126 -0
- package/plugins/kk/skills/smart-seo/references/narrative.md +125 -0
- package/plugins/kk/skills/smart-seo/references/operations.md +202 -0
- package/plugins/kk/skills/smart-seo/references/seo-geo-sources.md +90 -0
- package/plugins/kk/workflows/feature-verification.yaml +28 -24
- package/plugins/kk/workflows/kk-daily-ai-voice2.yaml +85 -17
- package/plugins/kk/workflows/kk-itc-author.yaml +406 -0
- package/plugins/kk/workflows/kk-itc.yaml +208 -682
- package/plugins/kk/workflows/kk-smart-seo.yaml +251 -0
- package/plugins/publishings/bilibili-pub/dist/index.js +21782 -0
- package/plugins/publishings/bilibili-pub/dist/profile-check.js +20410 -0
- package/plugins/publishings/bilibili-pub/package.json +20 -0
- package/plugins/publishings/bilibili-pub/plugin.json +12 -0
- package/plugins/publishings/bilibili-pub/src/flow.ts +1296 -0
- package/plugins/publishings/bilibili-pub/src/index.ts +139 -0
- package/plugins/publishings/bilibili-pub/src/profile-check.ts +19 -0
- package/plugins/publishings/bilibili-pub/src/selectors.ts +222 -0
- package/plugins/publishings/bilibili-pub/tsconfig.json +4 -0
- package/plugins/publishings/cnblogs-pub/dist/index.js +21383 -0
- package/plugins/publishings/cnblogs-pub/dist/profile-check.js +20412 -0
- package/plugins/publishings/cnblogs-pub/package.json +19 -0
- package/plugins/publishings/cnblogs-pub/plugin.json +12 -0
- package/plugins/publishings/cnblogs-pub/src/flow.ts +708 -0
- package/plugins/publishings/cnblogs-pub/src/index.ts +172 -0
- package/plugins/publishings/cnblogs-pub/src/profile-check.ts +24 -0
- package/plugins/publishings/cnblogs-pub/src/selectors.ts +104 -0
- package/plugins/publishings/cnblogs-pub/tsconfig.json +4 -0
- package/plugins/publishings/csdn-pub/dist/index.js +21552 -0
- package/plugins/publishings/csdn-pub/dist/profile-check.js +20963 -0
- package/plugins/publishings/csdn-pub/package.json +19 -0
- package/plugins/publishings/csdn-pub/plugin.json +12 -0
- package/plugins/publishings/csdn-pub/src/index.ts +1178 -0
- package/plugins/publishings/csdn-pub/src/profile-check.ts +23 -0
- package/plugins/publishings/csdn-pub/tsconfig.json +4 -0
- package/plugins/publishings/emdash-pub/dist/index.js +158 -12
- package/plugins/publishings/emdash-pub/plugin.json +22 -1
- package/plugins/publishings/infoq-pub/dist/index.js +160 -12
- package/plugins/publishings/infoq-pub/dist/profile-check.js +160 -12
- package/plugins/publishings/infoq-pub/plugin.json +21 -0
- package/plugins/publishings/jike-pub/dist/index.js +21379 -0
- package/plugins/publishings/jike-pub/dist/profile-check.js +20951 -0
- package/plugins/publishings/jike-pub/package.json +19 -0
- package/plugins/publishings/jike-pub/plugin.json +12 -0
- package/plugins/publishings/jike-pub/src/index.ts +800 -0
- package/plugins/publishings/jike-pub/src/profile-check.ts +21 -0
- package/plugins/publishings/jike-pub/tsconfig.json +4 -0
- package/plugins/publishings/juejin-pub/dist/index.js +160 -12
- package/plugins/publishings/juejin-pub/dist/profile-check.js +160 -12
- package/plugins/publishings/juejin-pub/plugin.json +21 -0
- package/plugins/publishings/medium-pub/dist/index.js +158 -12
- package/plugins/publishings/medium-pub/plugin.json +22 -1
- package/plugins/publishings/podcast-pub/dist/index.js +158 -12
- package/plugins/publishings/qiita-pub/dist/index.js +158 -12
- package/plugins/publishings/qiita-pub/plugin.json +24 -1
- package/plugins/publishings/shipinhao-pub/dist/index.js +21715 -0
- package/plugins/publishings/shipinhao-pub/dist/profile-check.js +20431 -0
- package/plugins/publishings/shipinhao-pub/package.json +19 -0
- package/plugins/publishings/shipinhao-pub/plugin.json +12 -0
- package/plugins/publishings/shipinhao-pub/src/flow.ts +1323 -0
- package/plugins/publishings/shipinhao-pub/src/index.ts +173 -0
- package/plugins/publishings/shipinhao-pub/src/profile-check.ts +25 -0
- package/plugins/publishings/shipinhao-pub/src/selectors.ts +241 -0
- package/plugins/publishings/shipinhao-pub/tsconfig.json +4 -0
- package/plugins/publishings/sspai-pub/dist/index.js +21371 -0
- package/plugins/publishings/sspai-pub/dist/profile-check.js +20414 -0
- package/plugins/publishings/sspai-pub/package.json +19 -0
- package/plugins/publishings/sspai-pub/plugin.json +12 -0
- package/plugins/publishings/sspai-pub/src/flow.ts +624 -0
- package/plugins/publishings/sspai-pub/src/index.ts +167 -0
- package/plugins/publishings/sspai-pub/src/profile-check.ts +25 -0
- package/plugins/publishings/sspai-pub/src/selectors.ts +122 -0
- package/plugins/publishings/sspai-pub/tsconfig.json +4 -0
- package/plugins/publishings/substack-pub/dist/index.js +160 -12
- package/plugins/publishings/substack-pub/dist/profile-check.js +160 -12
- package/plugins/publishings/substack-pub/plugin.json +21 -0
- package/plugins/publishings/surfdash-pub/dist/index.js +158 -12
- package/plugins/publishings/surfdash-pub/plugin.json +22 -1
- package/plugins/publishings/threads-pub/dist/index.js +158 -12
- package/plugins/publishings/wechatmp-pub/dist/index.js +1669 -502
- package/plugins/publishings/wechatmp-pub/dist/profile-check.js +204 -21
- package/plugins/publishings/wechatmp-pub/plugin.json +32 -0
- package/plugins/publishings/wechatmp-pub/src/cgi-draft.ts +540 -0
- package/plugins/publishings/wechatmp-pub/src/cgi-media.ts +380 -0
- package/plugins/publishings/wechatmp-pub/src/cgi.ts +485 -0
- package/plugins/publishings/wechatmp-pub/src/flow.ts +104 -0
- package/plugins/publishings/weibo-pub/dist/index.js +160 -12
- package/plugins/publishings/weibo-pub/dist/profile-check.js +160 -12
- package/plugins/publishings/weibo-pub/plugin.json +35 -0
- package/plugins/publishings/x-pub/dist/index.js +160 -12
- package/plugins/publishings/x-pub/dist/profile-check.js +160 -12
- package/plugins/publishings/x-pub/plugin.json +40 -0
- package/plugins/publishings/xhs-pub/dist/index.js +160 -12
- package/plugins/publishings/xhs-pub/dist/profile-check.js +160 -12
- package/plugins/publishings/xhs-pub/plugin.json +37 -0
- package/plugins/publishings/xiaoyuzhou-pub/dist/index.js +21491 -0
- package/plugins/publishings/xiaoyuzhou-pub/dist/profile-check.js +20417 -0
- package/plugins/publishings/xiaoyuzhou-pub/package.json +19 -0
- package/plugins/publishings/xiaoyuzhou-pub/plugin.json +12 -0
- package/plugins/publishings/xiaoyuzhou-pub/src/flow.ts +826 -0
- package/plugins/publishings/xiaoyuzhou-pub/src/index.ts +174 -0
- package/plugins/publishings/xiaoyuzhou-pub/src/profile-check.ts +26 -0
- package/plugins/publishings/xiaoyuzhou-pub/src/selectors.ts +125 -0
- package/plugins/publishings/xiaoyuzhou-pub/tsconfig.json +4 -0
- package/plugins/publishings/zenn-pub/dist/index.js +158 -12
- package/plugins/publishings/zenn-pub/plugin.json +22 -1
- package/plugins/generations/omni-voice-gen/voices/robin-news.wav +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CSDN profile-session capability (task 0292, Chunk A).
|
|
3
|
+
*
|
|
4
|
+
* `login` opens the CSDN Markdown editor entry (https://editor.csdn.net/md/, grounded 2026-10-14,
|
|
5
|
+
* task 0292 Design) in a headed browser and resolves only once the site readiness predicate passes;
|
|
6
|
+
* `check` reopens the profile (headlessly, unless the operator passes `--headed` or the config sets
|
|
7
|
+
* `checkHeadedOnly`) and reports `verified` or `refused`. Arg parsing, profile precedence
|
|
8
|
+
* (`--profile` > `CSDN_PROFILE_DIR` > `KK_BROWSER_PROFILE_DIR` >
|
|
9
|
+
* `~/.config/kk/browser-profiles/csdn`) and the exit codes (0 verified, 1 refused, 2 usage error)
|
|
10
|
+
* all live in the shared `runProfileCli`, so the publish preflight and this CLI apply one gate.
|
|
11
|
+
*
|
|
12
|
+
* The readiness predicate observes the site-owned Markdown editor (the grounded
|
|
13
|
+
* `input.article-bar__title--input`, see `src/index.ts`); the login-redirect regex is provisional
|
|
14
|
+
* (see `src/index.ts`). A selector that never attaches is a refusal
|
|
15
|
+
* (`bun plugins/publishings/csdn-pub/src/profile-check.ts login` is the recovery), never silent
|
|
16
|
+
* success.
|
|
17
|
+
*/
|
|
18
|
+
import { runProfileCli } from '@gobing-ai/publish-harness/browser';
|
|
19
|
+
import { CSDN_CONFIG } from './index';
|
|
20
|
+
|
|
21
|
+
if (import.meta.main) {
|
|
22
|
+
process.exit(await runProfileCli(CSDN_CONFIG, Bun.argv.slice(2)));
|
|
23
|
+
}
|
|
@@ -11984,6 +11984,83 @@ var init_file_system_node = () => {};
|
|
|
11984
11984
|
import { dirname as dirname2 } from "path";
|
|
11985
11985
|
import { parseArgs } from "util";
|
|
11986
11986
|
|
|
11987
|
+
// ../../packages/kk-core/src/content-limits.ts
|
|
11988
|
+
var PLATFORM_CONTENT_LIMITS = Object.freeze({
|
|
11989
|
+
schemaVersion: 5,
|
|
11990
|
+
tagLimits: Object.freeze({
|
|
11991
|
+
default: 7,
|
|
11992
|
+
imageText: Object.freeze({
|
|
11993
|
+
instagram: 5,
|
|
11994
|
+
douyin: 5,
|
|
11995
|
+
kuaishou: 4,
|
|
11996
|
+
weixin: 1,
|
|
11997
|
+
xiaohongshu: 10
|
|
11998
|
+
}),
|
|
11999
|
+
shortVideo: Object.freeze({
|
|
12000
|
+
douyin: 5,
|
|
12001
|
+
kuaishou: 4,
|
|
12002
|
+
xiaohongshu: 10,
|
|
12003
|
+
bilibili: 10,
|
|
12004
|
+
zhihu: 5,
|
|
12005
|
+
tiktok: 20,
|
|
12006
|
+
youtube: 60
|
|
12007
|
+
})
|
|
12008
|
+
}),
|
|
12009
|
+
titleCapabilities: Object.freeze({
|
|
12010
|
+
dynamic: Object.freeze({
|
|
12011
|
+
bilibili: Object.freeze({ max: 20, unit: "utf16_code_units" }),
|
|
12012
|
+
zhihu: Object.freeze({ max: 50, unit: "utf16_code_units" }),
|
|
12013
|
+
douban: Object.freeze({ max: 70, unit: "utf16_code_units" }),
|
|
12014
|
+
x: null,
|
|
12015
|
+
threads: null,
|
|
12016
|
+
weibo: null,
|
|
12017
|
+
jike: null,
|
|
12018
|
+
zsxq: null,
|
|
12019
|
+
toutiao: null,
|
|
12020
|
+
juejin: null
|
|
12021
|
+
}),
|
|
12022
|
+
imageText: Object.freeze({
|
|
12023
|
+
xiaohongshu: Object.freeze({ max: 20, unit: "xiaohongshu_title_weighted" }),
|
|
12024
|
+
weixin: Object.freeze({ max: 20, unit: "utf16_code_units" }),
|
|
12025
|
+
douyin: Object.freeze({ max: 20, unit: "utf16_code_units" }),
|
|
12026
|
+
shipinhao: Object.freeze({ max: 22, unit: "utf16_code_units" }),
|
|
12027
|
+
reddit: Object.freeze({ max: 300, unit: "utf16_code_units" })
|
|
12028
|
+
}),
|
|
12029
|
+
article: Object.freeze({
|
|
12030
|
+
juejin: Object.freeze({ max: 100, unit: "utf16_code_units" }),
|
|
12031
|
+
csdn: Object.freeze({ max: 100, unit: "utf16_code_units" }),
|
|
12032
|
+
cnblogs: Object.freeze({ max: 128, unit: "utf16_code_units" }),
|
|
12033
|
+
weibo: Object.freeze({ max: 30, unit: "utf16_code_units" }),
|
|
12034
|
+
sspai: Object.freeze({ max: 80, unit: "utf16_code_units" })
|
|
12035
|
+
}),
|
|
12036
|
+
shortVideo: Object.freeze({
|
|
12037
|
+
shipinhao: Object.freeze({ max: 16, unit: "utf16_code_units" }),
|
|
12038
|
+
douyin: Object.freeze({ max: 30, unit: "utf16_code_units" }),
|
|
12039
|
+
bilibili: Object.freeze({ max: 80, unit: "utf16_code_units" })
|
|
12040
|
+
})
|
|
12041
|
+
}),
|
|
12042
|
+
bodyCapabilities: Object.freeze({
|
|
12043
|
+
dynamic: Object.freeze({
|
|
12044
|
+
threads: Object.freeze({ max: 500, unit: "unicode_code_points", behavior: "split_thread" }),
|
|
12045
|
+
x: Object.freeze({ max: 280, unit: "weighted", behavior: "split_thread" }),
|
|
12046
|
+
weibo: Object.freeze({ max: 2000, unit: "unicode_code_points" }),
|
|
12047
|
+
jike: Object.freeze({ max: 1000, unit: "unicode_code_points" })
|
|
12048
|
+
}),
|
|
12049
|
+
imageText: Object.freeze({
|
|
12050
|
+
xiaohongshu: Object.freeze({ max: 1000, unit: "unicode_code_points" }),
|
|
12051
|
+
douyin: Object.freeze({ max: 1000, unit: "unicode_code_points" })
|
|
12052
|
+
}),
|
|
12053
|
+
article: Object.freeze({
|
|
12054
|
+
wechatmp: Object.freeze({ max: 50000, unit: "unicode_code_points" }),
|
|
12055
|
+
juejin: Object.freeze({ max: 50000, unit: "unicode_code_points" })
|
|
12056
|
+
}),
|
|
12057
|
+
shortVideo: Object.freeze({
|
|
12058
|
+
douyin: Object.freeze({ max: 1000, unit: "unicode_code_points" }),
|
|
12059
|
+
kuaishou: Object.freeze({ max: 1000, unit: "unicode_code_points" }),
|
|
12060
|
+
shipinhao: Object.freeze({ max: 1000, unit: "unicode_code_points" })
|
|
12061
|
+
})
|
|
12062
|
+
})
|
|
12063
|
+
});
|
|
11987
12064
|
// ../../packages/kk-core/src/kinds.ts
|
|
11988
12065
|
init_zod();
|
|
11989
12066
|
|
|
@@ -12074,6 +12151,67 @@ var BrowserSessionDescriptorSchema = object({
|
|
|
12074
12151
|
}
|
|
12075
12152
|
}).optional()
|
|
12076
12153
|
}).strict();
|
|
12154
|
+
var ContentCountUnitSchema = _enum([
|
|
12155
|
+
"utf16_code_units",
|
|
12156
|
+
"unicode_code_points",
|
|
12157
|
+
"weighted",
|
|
12158
|
+
"xiaohongshu_title_weighted"
|
|
12159
|
+
]);
|
|
12160
|
+
var LimitEntrySchema = object({
|
|
12161
|
+
max: number2().int().positive(),
|
|
12162
|
+
unit: ContentCountUnitSchema
|
|
12163
|
+
}).strict();
|
|
12164
|
+
var PublishingProfileLimitsSchema = object({
|
|
12165
|
+
title: LimitEntrySchema.optional(),
|
|
12166
|
+
body: LimitEntrySchema.optional()
|
|
12167
|
+
}).strict();
|
|
12168
|
+
var PublishingProfileRequiresSchema = object({
|
|
12169
|
+
cover: boolean2().optional(),
|
|
12170
|
+
orderedImages: boolean2().optional()
|
|
12171
|
+
}).strict();
|
|
12172
|
+
var PublishingProfileModeBindingSchema = object({
|
|
12173
|
+
metadata: record(string2(), unknown())
|
|
12174
|
+
}).strict();
|
|
12175
|
+
var PublishingProfileModesSchema = object({
|
|
12176
|
+
draft: PublishingProfileModeBindingSchema.optional(),
|
|
12177
|
+
live: PublishingProfileModeBindingSchema.optional()
|
|
12178
|
+
}).strict().superRefine((modes, ctx) => {
|
|
12179
|
+
if (modes.draft === undefined && modes.live === undefined) {
|
|
12180
|
+
ctx.addIssue({
|
|
12181
|
+
code: "custom",
|
|
12182
|
+
message: 'modes must define at least one of "draft" or "live"'
|
|
12183
|
+
});
|
|
12184
|
+
}
|
|
12185
|
+
});
|
|
12186
|
+
var PublishingProfileSchema = object({
|
|
12187
|
+
format: string2().min(1),
|
|
12188
|
+
locale: string2().regex(/^(source|[a-z]{2,3}(-[A-Za-z0-9]+)*)$/, {
|
|
12189
|
+
message: 'locale must be "source" or a valid language tag'
|
|
12190
|
+
}),
|
|
12191
|
+
limits: PublishingProfileLimitsSchema.optional(),
|
|
12192
|
+
requires: PublishingProfileRequiresSchema.optional(),
|
|
12193
|
+
modes: PublishingProfileModesSchema
|
|
12194
|
+
}).strict();
|
|
12195
|
+
var PublishingCapabilitiesSchema = object({
|
|
12196
|
+
defaultProfile: string2().min(1),
|
|
12197
|
+
profiles: record(string2().regex(/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/), PublishingProfileSchema)
|
|
12198
|
+
}).strict().superRefine((data, ctx) => {
|
|
12199
|
+
const keys = Object.keys(data.profiles);
|
|
12200
|
+
if (keys.length === 0) {
|
|
12201
|
+
ctx.addIssue({
|
|
12202
|
+
code: "custom",
|
|
12203
|
+
path: ["profiles"],
|
|
12204
|
+
message: "profiles record must be nonempty"
|
|
12205
|
+
});
|
|
12206
|
+
}
|
|
12207
|
+
if (!(data.defaultProfile in data.profiles)) {
|
|
12208
|
+
ctx.addIssue({
|
|
12209
|
+
code: "custom",
|
|
12210
|
+
path: ["defaultProfile"],
|
|
12211
|
+
message: `defaultProfile "${data.defaultProfile}" must reference a declared profile`
|
|
12212
|
+
});
|
|
12213
|
+
}
|
|
12214
|
+
});
|
|
12077
12215
|
var PluginManifestSchemaBase = looseObject({
|
|
12078
12216
|
name: string2().min(1),
|
|
12079
12217
|
kind: PluginKindSchema,
|
|
@@ -12082,23 +12220,31 @@ var PluginManifestSchemaBase = looseObject({
|
|
|
12082
12220
|
version: string2().optional(),
|
|
12083
12221
|
description: string2().optional(),
|
|
12084
12222
|
operations: record(string2(), PluginOperationSchema).optional(),
|
|
12085
|
-
browserSession: BrowserSessionDescriptorSchema.optional()
|
|
12223
|
+
browserSession: BrowserSessionDescriptorSchema.optional(),
|
|
12224
|
+
publishing: PublishingCapabilitiesSchema.optional()
|
|
12086
12225
|
});
|
|
12087
12226
|
var PluginManifestSchema = PluginManifestSchemaBase.superRefine((manifest, ctx) => {
|
|
12088
|
-
if (manifest.browserSession
|
|
12089
|
-
|
|
12090
|
-
|
|
12091
|
-
|
|
12092
|
-
|
|
12093
|
-
|
|
12094
|
-
|
|
12095
|
-
}
|
|
12227
|
+
if (manifest.browserSession !== undefined) {
|
|
12228
|
+
if (manifest.kind !== "publish") {
|
|
12229
|
+
ctx.addIssue({
|
|
12230
|
+
code: "custom",
|
|
12231
|
+
path: ["browserSession"],
|
|
12232
|
+
message: `browserSession requires kind "publish", not "${manifest.kind}"`
|
|
12233
|
+
});
|
|
12234
|
+
}
|
|
12235
|
+
if (manifest.check === undefined) {
|
|
12236
|
+
ctx.addIssue({
|
|
12237
|
+
code: "custom",
|
|
12238
|
+
path: ["browserSession"],
|
|
12239
|
+
message: "browserSession requires a check probe entry that owns the session routines"
|
|
12240
|
+
});
|
|
12241
|
+
}
|
|
12096
12242
|
}
|
|
12097
|
-
if (manifest.
|
|
12243
|
+
if (manifest.publishing !== undefined && manifest.kind !== "publish") {
|
|
12098
12244
|
ctx.addIssue({
|
|
12099
12245
|
code: "custom",
|
|
12100
|
-
path: ["
|
|
12101
|
-
message:
|
|
12246
|
+
path: ["publishing"],
|
|
12247
|
+
message: `publishing requires kind "publish", not "${manifest.kind}"`
|
|
12102
12248
|
});
|
|
12103
12249
|
}
|
|
12104
12250
|
});
|
|
@@ -3,5 +3,26 @@
|
|
|
3
3
|
"kind": "publish",
|
|
4
4
|
"entry": "./dist/index.js",
|
|
5
5
|
"version": "1.0.0",
|
|
6
|
-
"description": "Publish plugin for EmDash CMS creating posts via the REST token transport"
|
|
6
|
+
"description": "Publish plugin for EmDash CMS creating posts via the REST token transport",
|
|
7
|
+
"publishing": {
|
|
8
|
+
"defaultProfile": "article",
|
|
9
|
+
"profiles": {
|
|
10
|
+
"article": {
|
|
11
|
+
"format": "article",
|
|
12
|
+
"locale": "source",
|
|
13
|
+
"modes": {
|
|
14
|
+
"draft": {
|
|
15
|
+
"metadata": {
|
|
16
|
+
"published": false
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"live": {
|
|
20
|
+
"metadata": {
|
|
21
|
+
"published": true
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
7
28
|
}
|
|
@@ -19832,6 +19832,83 @@ var init_runtime_node_bun = __esm(() => {
|
|
|
19832
19832
|
import { dirname as dirname4 } from "path";
|
|
19833
19833
|
import { parseArgs } from "util";
|
|
19834
19834
|
|
|
19835
|
+
// ../../packages/kk-core/src/content-limits.ts
|
|
19836
|
+
var PLATFORM_CONTENT_LIMITS = Object.freeze({
|
|
19837
|
+
schemaVersion: 5,
|
|
19838
|
+
tagLimits: Object.freeze({
|
|
19839
|
+
default: 7,
|
|
19840
|
+
imageText: Object.freeze({
|
|
19841
|
+
instagram: 5,
|
|
19842
|
+
douyin: 5,
|
|
19843
|
+
kuaishou: 4,
|
|
19844
|
+
weixin: 1,
|
|
19845
|
+
xiaohongshu: 10
|
|
19846
|
+
}),
|
|
19847
|
+
shortVideo: Object.freeze({
|
|
19848
|
+
douyin: 5,
|
|
19849
|
+
kuaishou: 4,
|
|
19850
|
+
xiaohongshu: 10,
|
|
19851
|
+
bilibili: 10,
|
|
19852
|
+
zhihu: 5,
|
|
19853
|
+
tiktok: 20,
|
|
19854
|
+
youtube: 60
|
|
19855
|
+
})
|
|
19856
|
+
}),
|
|
19857
|
+
titleCapabilities: Object.freeze({
|
|
19858
|
+
dynamic: Object.freeze({
|
|
19859
|
+
bilibili: Object.freeze({ max: 20, unit: "utf16_code_units" }),
|
|
19860
|
+
zhihu: Object.freeze({ max: 50, unit: "utf16_code_units" }),
|
|
19861
|
+
douban: Object.freeze({ max: 70, unit: "utf16_code_units" }),
|
|
19862
|
+
x: null,
|
|
19863
|
+
threads: null,
|
|
19864
|
+
weibo: null,
|
|
19865
|
+
jike: null,
|
|
19866
|
+
zsxq: null,
|
|
19867
|
+
toutiao: null,
|
|
19868
|
+
juejin: null
|
|
19869
|
+
}),
|
|
19870
|
+
imageText: Object.freeze({
|
|
19871
|
+
xiaohongshu: Object.freeze({ max: 20, unit: "xiaohongshu_title_weighted" }),
|
|
19872
|
+
weixin: Object.freeze({ max: 20, unit: "utf16_code_units" }),
|
|
19873
|
+
douyin: Object.freeze({ max: 20, unit: "utf16_code_units" }),
|
|
19874
|
+
shipinhao: Object.freeze({ max: 22, unit: "utf16_code_units" }),
|
|
19875
|
+
reddit: Object.freeze({ max: 300, unit: "utf16_code_units" })
|
|
19876
|
+
}),
|
|
19877
|
+
article: Object.freeze({
|
|
19878
|
+
juejin: Object.freeze({ max: 100, unit: "utf16_code_units" }),
|
|
19879
|
+
csdn: Object.freeze({ max: 100, unit: "utf16_code_units" }),
|
|
19880
|
+
cnblogs: Object.freeze({ max: 128, unit: "utf16_code_units" }),
|
|
19881
|
+
weibo: Object.freeze({ max: 30, unit: "utf16_code_units" }),
|
|
19882
|
+
sspai: Object.freeze({ max: 80, unit: "utf16_code_units" })
|
|
19883
|
+
}),
|
|
19884
|
+
shortVideo: Object.freeze({
|
|
19885
|
+
shipinhao: Object.freeze({ max: 16, unit: "utf16_code_units" }),
|
|
19886
|
+
douyin: Object.freeze({ max: 30, unit: "utf16_code_units" }),
|
|
19887
|
+
bilibili: Object.freeze({ max: 80, unit: "utf16_code_units" })
|
|
19888
|
+
})
|
|
19889
|
+
}),
|
|
19890
|
+
bodyCapabilities: Object.freeze({
|
|
19891
|
+
dynamic: Object.freeze({
|
|
19892
|
+
threads: Object.freeze({ max: 500, unit: "unicode_code_points", behavior: "split_thread" }),
|
|
19893
|
+
x: Object.freeze({ max: 280, unit: "weighted", behavior: "split_thread" }),
|
|
19894
|
+
weibo: Object.freeze({ max: 2000, unit: "unicode_code_points" }),
|
|
19895
|
+
jike: Object.freeze({ max: 1000, unit: "unicode_code_points" })
|
|
19896
|
+
}),
|
|
19897
|
+
imageText: Object.freeze({
|
|
19898
|
+
xiaohongshu: Object.freeze({ max: 1000, unit: "unicode_code_points" }),
|
|
19899
|
+
douyin: Object.freeze({ max: 1000, unit: "unicode_code_points" })
|
|
19900
|
+
}),
|
|
19901
|
+
article: Object.freeze({
|
|
19902
|
+
wechatmp: Object.freeze({ max: 50000, unit: "unicode_code_points" }),
|
|
19903
|
+
juejin: Object.freeze({ max: 50000, unit: "unicode_code_points" })
|
|
19904
|
+
}),
|
|
19905
|
+
shortVideo: Object.freeze({
|
|
19906
|
+
douyin: Object.freeze({ max: 1000, unit: "unicode_code_points" }),
|
|
19907
|
+
kuaishou: Object.freeze({ max: 1000, unit: "unicode_code_points" }),
|
|
19908
|
+
shipinhao: Object.freeze({ max: 1000, unit: "unicode_code_points" })
|
|
19909
|
+
})
|
|
19910
|
+
})
|
|
19911
|
+
});
|
|
19835
19912
|
// ../../packages/kk-core/src/kinds.ts
|
|
19836
19913
|
init_zod();
|
|
19837
19914
|
|
|
@@ -19922,6 +19999,67 @@ var BrowserSessionDescriptorSchema = object({
|
|
|
19922
19999
|
}
|
|
19923
20000
|
}).optional()
|
|
19924
20001
|
}).strict();
|
|
20002
|
+
var ContentCountUnitSchema = _enum([
|
|
20003
|
+
"utf16_code_units",
|
|
20004
|
+
"unicode_code_points",
|
|
20005
|
+
"weighted",
|
|
20006
|
+
"xiaohongshu_title_weighted"
|
|
20007
|
+
]);
|
|
20008
|
+
var LimitEntrySchema = object({
|
|
20009
|
+
max: number2().int().positive(),
|
|
20010
|
+
unit: ContentCountUnitSchema
|
|
20011
|
+
}).strict();
|
|
20012
|
+
var PublishingProfileLimitsSchema = object({
|
|
20013
|
+
title: LimitEntrySchema.optional(),
|
|
20014
|
+
body: LimitEntrySchema.optional()
|
|
20015
|
+
}).strict();
|
|
20016
|
+
var PublishingProfileRequiresSchema = object({
|
|
20017
|
+
cover: boolean2().optional(),
|
|
20018
|
+
orderedImages: boolean2().optional()
|
|
20019
|
+
}).strict();
|
|
20020
|
+
var PublishingProfileModeBindingSchema = object({
|
|
20021
|
+
metadata: record(string2(), unknown())
|
|
20022
|
+
}).strict();
|
|
20023
|
+
var PublishingProfileModesSchema = object({
|
|
20024
|
+
draft: PublishingProfileModeBindingSchema.optional(),
|
|
20025
|
+
live: PublishingProfileModeBindingSchema.optional()
|
|
20026
|
+
}).strict().superRefine((modes, ctx) => {
|
|
20027
|
+
if (modes.draft === undefined && modes.live === undefined) {
|
|
20028
|
+
ctx.addIssue({
|
|
20029
|
+
code: "custom",
|
|
20030
|
+
message: 'modes must define at least one of "draft" or "live"'
|
|
20031
|
+
});
|
|
20032
|
+
}
|
|
20033
|
+
});
|
|
20034
|
+
var PublishingProfileSchema = object({
|
|
20035
|
+
format: string2().min(1),
|
|
20036
|
+
locale: string2().regex(/^(source|[a-z]{2,3}(-[A-Za-z0-9]+)*)$/, {
|
|
20037
|
+
message: 'locale must be "source" or a valid language tag'
|
|
20038
|
+
}),
|
|
20039
|
+
limits: PublishingProfileLimitsSchema.optional(),
|
|
20040
|
+
requires: PublishingProfileRequiresSchema.optional(),
|
|
20041
|
+
modes: PublishingProfileModesSchema
|
|
20042
|
+
}).strict();
|
|
20043
|
+
var PublishingCapabilitiesSchema = object({
|
|
20044
|
+
defaultProfile: string2().min(1),
|
|
20045
|
+
profiles: record(string2().regex(/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/), PublishingProfileSchema)
|
|
20046
|
+
}).strict().superRefine((data, ctx) => {
|
|
20047
|
+
const keys = Object.keys(data.profiles);
|
|
20048
|
+
if (keys.length === 0) {
|
|
20049
|
+
ctx.addIssue({
|
|
20050
|
+
code: "custom",
|
|
20051
|
+
path: ["profiles"],
|
|
20052
|
+
message: "profiles record must be nonempty"
|
|
20053
|
+
});
|
|
20054
|
+
}
|
|
20055
|
+
if (!(data.defaultProfile in data.profiles)) {
|
|
20056
|
+
ctx.addIssue({
|
|
20057
|
+
code: "custom",
|
|
20058
|
+
path: ["defaultProfile"],
|
|
20059
|
+
message: `defaultProfile "${data.defaultProfile}" must reference a declared profile`
|
|
20060
|
+
});
|
|
20061
|
+
}
|
|
20062
|
+
});
|
|
19925
20063
|
var PluginManifestSchemaBase = looseObject({
|
|
19926
20064
|
name: string2().min(1),
|
|
19927
20065
|
kind: PluginKindSchema,
|
|
@@ -19930,23 +20068,31 @@ var PluginManifestSchemaBase = looseObject({
|
|
|
19930
20068
|
version: string2().optional(),
|
|
19931
20069
|
description: string2().optional(),
|
|
19932
20070
|
operations: record(string2(), PluginOperationSchema).optional(),
|
|
19933
|
-
browserSession: BrowserSessionDescriptorSchema.optional()
|
|
20071
|
+
browserSession: BrowserSessionDescriptorSchema.optional(),
|
|
20072
|
+
publishing: PublishingCapabilitiesSchema.optional()
|
|
19934
20073
|
});
|
|
19935
20074
|
var PluginManifestSchema = PluginManifestSchemaBase.superRefine((manifest, ctx) => {
|
|
19936
|
-
if (manifest.browserSession
|
|
19937
|
-
|
|
19938
|
-
|
|
19939
|
-
|
|
19940
|
-
|
|
19941
|
-
|
|
19942
|
-
|
|
19943
|
-
}
|
|
20075
|
+
if (manifest.browserSession !== undefined) {
|
|
20076
|
+
if (manifest.kind !== "publish") {
|
|
20077
|
+
ctx.addIssue({
|
|
20078
|
+
code: "custom",
|
|
20079
|
+
path: ["browserSession"],
|
|
20080
|
+
message: `browserSession requires kind "publish", not "${manifest.kind}"`
|
|
20081
|
+
});
|
|
20082
|
+
}
|
|
20083
|
+
if (manifest.check === undefined) {
|
|
20084
|
+
ctx.addIssue({
|
|
20085
|
+
code: "custom",
|
|
20086
|
+
path: ["browserSession"],
|
|
20087
|
+
message: "browserSession requires a check probe entry that owns the session routines"
|
|
20088
|
+
});
|
|
20089
|
+
}
|
|
19944
20090
|
}
|
|
19945
|
-
if (manifest.
|
|
20091
|
+
if (manifest.publishing !== undefined && manifest.kind !== "publish") {
|
|
19946
20092
|
ctx.addIssue({
|
|
19947
20093
|
code: "custom",
|
|
19948
|
-
path: ["
|
|
19949
|
-
message:
|
|
20094
|
+
path: ["publishing"],
|
|
20095
|
+
message: `publishing requires kind "publish", not "${manifest.kind}"`
|
|
19950
20096
|
});
|
|
19951
20097
|
}
|
|
19952
20098
|
});
|
|
@@ -20569,6 +20715,8 @@ async function ensureProfileDir2(profileDir, headless) {
|
|
|
20569
20715
|
throw new BrowserProfileMissingError(profileDir);
|
|
20570
20716
|
await mkdir2(profileDir, { recursive: true, mode: 448 });
|
|
20571
20717
|
}
|
|
20718
|
+
// ../../packages/publish-harness/src/browser-anti-detection.ts
|
|
20719
|
+
var MAX_QUEUED_BYTES = 8 * 1024 * 1024;
|
|
20572
20720
|
// ../../packages/publish-harness/src/browser.ts
|
|
20573
20721
|
var DEFAULT_CHECK_TIMEOUT_MS = 30000;
|
|
20574
20722
|
var DEFAULT_STEP_TIMEOUT_MS = 30000;
|
|
@@ -20415,6 +20415,8 @@ async function ensureProfileDir2(profileDir, headless) {
|
|
|
20415
20415
|
throw new BrowserProfileMissingError(profileDir);
|
|
20416
20416
|
await mkdir2(profileDir, { recursive: true, mode: 448 });
|
|
20417
20417
|
}
|
|
20418
|
+
// ../../packages/publish-harness/src/browser-anti-detection.ts
|
|
20419
|
+
var MAX_QUEUED_BYTES = 8 * 1024 * 1024;
|
|
20418
20420
|
|
|
20419
20421
|
// ../../packages/publish-harness/src/browser.ts
|
|
20420
20422
|
var DEFAULT_LOGIN_TIMEOUT_MS = 180000;
|
|
@@ -20656,6 +20658,83 @@ function errorMessage2(error) {
|
|
|
20656
20658
|
return error instanceof Error ? error.message : String(error);
|
|
20657
20659
|
}
|
|
20658
20660
|
|
|
20661
|
+
// ../../packages/kk-core/src/content-limits.ts
|
|
20662
|
+
var PLATFORM_CONTENT_LIMITS = Object.freeze({
|
|
20663
|
+
schemaVersion: 5,
|
|
20664
|
+
tagLimits: Object.freeze({
|
|
20665
|
+
default: 7,
|
|
20666
|
+
imageText: Object.freeze({
|
|
20667
|
+
instagram: 5,
|
|
20668
|
+
douyin: 5,
|
|
20669
|
+
kuaishou: 4,
|
|
20670
|
+
weixin: 1,
|
|
20671
|
+
xiaohongshu: 10
|
|
20672
|
+
}),
|
|
20673
|
+
shortVideo: Object.freeze({
|
|
20674
|
+
douyin: 5,
|
|
20675
|
+
kuaishou: 4,
|
|
20676
|
+
xiaohongshu: 10,
|
|
20677
|
+
bilibili: 10,
|
|
20678
|
+
zhihu: 5,
|
|
20679
|
+
tiktok: 20,
|
|
20680
|
+
youtube: 60
|
|
20681
|
+
})
|
|
20682
|
+
}),
|
|
20683
|
+
titleCapabilities: Object.freeze({
|
|
20684
|
+
dynamic: Object.freeze({
|
|
20685
|
+
bilibili: Object.freeze({ max: 20, unit: "utf16_code_units" }),
|
|
20686
|
+
zhihu: Object.freeze({ max: 50, unit: "utf16_code_units" }),
|
|
20687
|
+
douban: Object.freeze({ max: 70, unit: "utf16_code_units" }),
|
|
20688
|
+
x: null,
|
|
20689
|
+
threads: null,
|
|
20690
|
+
weibo: null,
|
|
20691
|
+
jike: null,
|
|
20692
|
+
zsxq: null,
|
|
20693
|
+
toutiao: null,
|
|
20694
|
+
juejin: null
|
|
20695
|
+
}),
|
|
20696
|
+
imageText: Object.freeze({
|
|
20697
|
+
xiaohongshu: Object.freeze({ max: 20, unit: "xiaohongshu_title_weighted" }),
|
|
20698
|
+
weixin: Object.freeze({ max: 20, unit: "utf16_code_units" }),
|
|
20699
|
+
douyin: Object.freeze({ max: 20, unit: "utf16_code_units" }),
|
|
20700
|
+
shipinhao: Object.freeze({ max: 22, unit: "utf16_code_units" }),
|
|
20701
|
+
reddit: Object.freeze({ max: 300, unit: "utf16_code_units" })
|
|
20702
|
+
}),
|
|
20703
|
+
article: Object.freeze({
|
|
20704
|
+
juejin: Object.freeze({ max: 100, unit: "utf16_code_units" }),
|
|
20705
|
+
csdn: Object.freeze({ max: 100, unit: "utf16_code_units" }),
|
|
20706
|
+
cnblogs: Object.freeze({ max: 128, unit: "utf16_code_units" }),
|
|
20707
|
+
weibo: Object.freeze({ max: 30, unit: "utf16_code_units" }),
|
|
20708
|
+
sspai: Object.freeze({ max: 80, unit: "utf16_code_units" })
|
|
20709
|
+
}),
|
|
20710
|
+
shortVideo: Object.freeze({
|
|
20711
|
+
shipinhao: Object.freeze({ max: 16, unit: "utf16_code_units" }),
|
|
20712
|
+
douyin: Object.freeze({ max: 30, unit: "utf16_code_units" }),
|
|
20713
|
+
bilibili: Object.freeze({ max: 80, unit: "utf16_code_units" })
|
|
20714
|
+
})
|
|
20715
|
+
}),
|
|
20716
|
+
bodyCapabilities: Object.freeze({
|
|
20717
|
+
dynamic: Object.freeze({
|
|
20718
|
+
threads: Object.freeze({ max: 500, unit: "unicode_code_points", behavior: "split_thread" }),
|
|
20719
|
+
x: Object.freeze({ max: 280, unit: "weighted", behavior: "split_thread" }),
|
|
20720
|
+
weibo: Object.freeze({ max: 2000, unit: "unicode_code_points" }),
|
|
20721
|
+
jike: Object.freeze({ max: 1000, unit: "unicode_code_points" })
|
|
20722
|
+
}),
|
|
20723
|
+
imageText: Object.freeze({
|
|
20724
|
+
xiaohongshu: Object.freeze({ max: 1000, unit: "unicode_code_points" }),
|
|
20725
|
+
douyin: Object.freeze({ max: 1000, unit: "unicode_code_points" })
|
|
20726
|
+
}),
|
|
20727
|
+
article: Object.freeze({
|
|
20728
|
+
wechatmp: Object.freeze({ max: 50000, unit: "unicode_code_points" }),
|
|
20729
|
+
juejin: Object.freeze({ max: 50000, unit: "unicode_code_points" })
|
|
20730
|
+
}),
|
|
20731
|
+
shortVideo: Object.freeze({
|
|
20732
|
+
douyin: Object.freeze({ max: 1000, unit: "unicode_code_points" }),
|
|
20733
|
+
kuaishou: Object.freeze({ max: 1000, unit: "unicode_code_points" }),
|
|
20734
|
+
shipinhao: Object.freeze({ max: 1000, unit: "unicode_code_points" })
|
|
20735
|
+
})
|
|
20736
|
+
})
|
|
20737
|
+
});
|
|
20659
20738
|
// ../../packages/kk-core/src/kinds.ts
|
|
20660
20739
|
init_zod();
|
|
20661
20740
|
|
|
@@ -20746,6 +20825,67 @@ var BrowserSessionDescriptorSchema = object2({
|
|
|
20746
20825
|
}
|
|
20747
20826
|
}).optional()
|
|
20748
20827
|
}).strict();
|
|
20828
|
+
var ContentCountUnitSchema = _enum([
|
|
20829
|
+
"utf16_code_units",
|
|
20830
|
+
"unicode_code_points",
|
|
20831
|
+
"weighted",
|
|
20832
|
+
"xiaohongshu_title_weighted"
|
|
20833
|
+
]);
|
|
20834
|
+
var LimitEntrySchema = object2({
|
|
20835
|
+
max: number2().int().positive(),
|
|
20836
|
+
unit: ContentCountUnitSchema
|
|
20837
|
+
}).strict();
|
|
20838
|
+
var PublishingProfileLimitsSchema = object2({
|
|
20839
|
+
title: LimitEntrySchema.optional(),
|
|
20840
|
+
body: LimitEntrySchema.optional()
|
|
20841
|
+
}).strict();
|
|
20842
|
+
var PublishingProfileRequiresSchema = object2({
|
|
20843
|
+
cover: boolean2().optional(),
|
|
20844
|
+
orderedImages: boolean2().optional()
|
|
20845
|
+
}).strict();
|
|
20846
|
+
var PublishingProfileModeBindingSchema = object2({
|
|
20847
|
+
metadata: record(string2(), unknown())
|
|
20848
|
+
}).strict();
|
|
20849
|
+
var PublishingProfileModesSchema = object2({
|
|
20850
|
+
draft: PublishingProfileModeBindingSchema.optional(),
|
|
20851
|
+
live: PublishingProfileModeBindingSchema.optional()
|
|
20852
|
+
}).strict().superRefine((modes, ctx) => {
|
|
20853
|
+
if (modes.draft === undefined && modes.live === undefined) {
|
|
20854
|
+
ctx.addIssue({
|
|
20855
|
+
code: "custom",
|
|
20856
|
+
message: 'modes must define at least one of "draft" or "live"'
|
|
20857
|
+
});
|
|
20858
|
+
}
|
|
20859
|
+
});
|
|
20860
|
+
var PublishingProfileSchema = object2({
|
|
20861
|
+
format: string2().min(1),
|
|
20862
|
+
locale: string2().regex(/^(source|[a-z]{2,3}(-[A-Za-z0-9]+)*)$/, {
|
|
20863
|
+
message: 'locale must be "source" or a valid language tag'
|
|
20864
|
+
}),
|
|
20865
|
+
limits: PublishingProfileLimitsSchema.optional(),
|
|
20866
|
+
requires: PublishingProfileRequiresSchema.optional(),
|
|
20867
|
+
modes: PublishingProfileModesSchema
|
|
20868
|
+
}).strict();
|
|
20869
|
+
var PublishingCapabilitiesSchema = object2({
|
|
20870
|
+
defaultProfile: string2().min(1),
|
|
20871
|
+
profiles: record(string2().regex(/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/), PublishingProfileSchema)
|
|
20872
|
+
}).strict().superRefine((data, ctx) => {
|
|
20873
|
+
const keys = Object.keys(data.profiles);
|
|
20874
|
+
if (keys.length === 0) {
|
|
20875
|
+
ctx.addIssue({
|
|
20876
|
+
code: "custom",
|
|
20877
|
+
path: ["profiles"],
|
|
20878
|
+
message: "profiles record must be nonempty"
|
|
20879
|
+
});
|
|
20880
|
+
}
|
|
20881
|
+
if (!(data.defaultProfile in data.profiles)) {
|
|
20882
|
+
ctx.addIssue({
|
|
20883
|
+
code: "custom",
|
|
20884
|
+
path: ["defaultProfile"],
|
|
20885
|
+
message: `defaultProfile "${data.defaultProfile}" must reference a declared profile`
|
|
20886
|
+
});
|
|
20887
|
+
}
|
|
20888
|
+
});
|
|
20749
20889
|
var PluginManifestSchemaBase = looseObject({
|
|
20750
20890
|
name: string2().min(1),
|
|
20751
20891
|
kind: PluginKindSchema,
|
|
@@ -20754,23 +20894,31 @@ var PluginManifestSchemaBase = looseObject({
|
|
|
20754
20894
|
version: string2().optional(),
|
|
20755
20895
|
description: string2().optional(),
|
|
20756
20896
|
operations: record(string2(), PluginOperationSchema).optional(),
|
|
20757
|
-
browserSession: BrowserSessionDescriptorSchema.optional()
|
|
20897
|
+
browserSession: BrowserSessionDescriptorSchema.optional(),
|
|
20898
|
+
publishing: PublishingCapabilitiesSchema.optional()
|
|
20758
20899
|
});
|
|
20759
20900
|
var PluginManifestSchema = PluginManifestSchemaBase.superRefine((manifest, ctx) => {
|
|
20760
|
-
if (manifest.browserSession
|
|
20761
|
-
|
|
20762
|
-
|
|
20763
|
-
|
|
20764
|
-
|
|
20765
|
-
|
|
20766
|
-
|
|
20767
|
-
}
|
|
20901
|
+
if (manifest.browserSession !== undefined) {
|
|
20902
|
+
if (manifest.kind !== "publish") {
|
|
20903
|
+
ctx.addIssue({
|
|
20904
|
+
code: "custom",
|
|
20905
|
+
path: ["browserSession"],
|
|
20906
|
+
message: `browserSession requires kind "publish", not "${manifest.kind}"`
|
|
20907
|
+
});
|
|
20908
|
+
}
|
|
20909
|
+
if (manifest.check === undefined) {
|
|
20910
|
+
ctx.addIssue({
|
|
20911
|
+
code: "custom",
|
|
20912
|
+
path: ["browserSession"],
|
|
20913
|
+
message: "browserSession requires a check probe entry that owns the session routines"
|
|
20914
|
+
});
|
|
20915
|
+
}
|
|
20768
20916
|
}
|
|
20769
|
-
if (manifest.
|
|
20917
|
+
if (manifest.publishing !== undefined && manifest.kind !== "publish") {
|
|
20770
20918
|
ctx.addIssue({
|
|
20771
20919
|
code: "custom",
|
|
20772
|
-
path: ["
|
|
20773
|
-
message:
|
|
20920
|
+
path: ["publishing"],
|
|
20921
|
+
message: `publishing requires kind "publish", not "${manifest.kind}"`
|
|
20774
20922
|
});
|
|
20775
20923
|
}
|
|
20776
20924
|
});
|