jianzi-content-workbench 0.2.30 → 1.0.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/README.md +5 -4
- package/dsh/index.mjs +6 -1
- package/lib/client.js +28 -6
- package/package.json +7 -3
- package/shared/tools.mjs +49 -2
package/README.md
CHANGED
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
- `cordis.patch.yml`:用官方 `@deepseek-ai/dsh-mcp-client` 以 stdio 启动包内 `mcp-server.mjs`,DSH 暴露 `mcp__jianzi_workbench__jianzi_*` 工具。
|
|
44
44
|
- `mcp-server.mjs` + `shared/`:复用 `scripts/agent-integration/` 的工具定义、执行器与本机 API 客户端,默认 `http://127.0.0.1:4317`(`JIANZI_WORKBENCH_URL` 可覆盖)。
|
|
45
45
|
- DSH 中调用 `jianzi_workbench_start` 可启动已停止的本机项目并等待健康检查;通过 `projectRoot` 参数或 MCP 进程环境变量 `JIANZI_PROJECT_ROOT` 指定源码项目绝对路径。启动器复用项目内官方启动脚本,不会打开浏览器,并并行轮询就绪接口;服务有效响应后立即核对健康信息与项目指纹,避免启动器进程未退出造成误报。启动最多等待 90 秒,DSH MCP 单次调用上限为 120 秒。
|
|
46
|
+
- DSH 插件/MCP 版本高于本地项目时,工具会停止业务调用并提示在项目根目录 `git pull`,按项目升级说明更新依赖并重建,再重启工作台和 MCP;工作台状态卡也会展示本地版本、所需版本和修复步骤。
|
|
46
47
|
- 面板文案不硬编码 MCP 工具名,也不复述流程细节;流程以项目技能为准,改流程只改技能。
|
|
47
48
|
|
|
48
49
|
## 面板读取的数据
|
|
@@ -73,17 +74,17 @@ Host 插件(`dsh/index.mjs`)通过官方 `ctx.webServer.register` 注册读
|
|
|
73
74
|
从仓库根目录运行:
|
|
74
75
|
|
|
75
76
|
```sh
|
|
76
|
-
|
|
77
|
-
cd agent-integrations/dsh-workbench
|
|
78
|
-
pnpm pack
|
|
77
|
+
npm run release
|
|
79
78
|
```
|
|
80
79
|
|
|
80
|
+
统一发布目录 `dist/` 会包含源码 ZIP、单独的 DSH 插件 `.tgz` 和校验和;Release workflow 会将 tag 作为版本号,同时戳记项目与插件包。只调试插件包时,可运行 `npm run build --prefix agent-integrations/dsh-workbench`,再从仓库根目录执行 `node scripts/release/pack-dsh-plugin.mjs ./dist`。
|
|
81
|
+
|
|
81
82
|
本地 `.tgz` 安装适用于开发和调试;普通用户直接在插件管理器中输入 npm 包名即可。DSH 插件索引是另一种分发方式,目前未单独发布。详见官方[插件打包与发布说明](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/user/develop/basic/publish.md)及[插件索引说明](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/user/guide/plugin-market.md)。
|
|
82
83
|
|
|
83
84
|
MCP 服务入口路径在 patch 中按 profile 写死(当前 `profiles/desktop`);在其他 profile 安装时需要同步修改。
|
|
84
85
|
|
|
85
86
|
## npm 正式发布
|
|
86
87
|
|
|
87
|
-
|
|
88
|
+
推送数字版本 tag(如 `1.0.7`)会同时触发 GitHub Release 打包和 DSH npm 发布。npm 工作流从 tag 提取版本,在临时工作区戳记项目与插件包版本,并查询 npm registry;如果该版本已发布,CI 会失败。旧式 `dsh-plugin-v<版本>` 标签仍可单独触发插件发布。无需手动修改项目或插件 `package.json` 的版本,也不要用普通 CI 提交触发发布。
|
|
88
89
|
|
|
89
90
|
首次版本已发布到 npm Registry,GitHub Actions 已配置 **Trusted Publisher**:用户 `shiker1996`、仓库 `wechat-editroom`、工作流文件名 `publish-dsh-plugin.yml`,并允许直接发布。后续推送匹配包版本的标签时,工作流会通过 OIDC 发布,无需长期 npm 发布令牌。
|
package/dsh/index.mjs
CHANGED
|
@@ -14,9 +14,14 @@ const json = (payload, status = 200) => new Response(JSON.stringify(payload), {
|
|
|
14
14
|
|
|
15
15
|
const failed = (error) => {
|
|
16
16
|
console.error('Jianzi workbench route failure', error);
|
|
17
|
+
const compatibilityError = error?.code === 'WORKBENCH_VERSION_MISMATCH';
|
|
17
18
|
return {
|
|
18
19
|
ok: false,
|
|
19
|
-
error: {
|
|
20
|
+
error: {
|
|
21
|
+
code: error?.code || 'JIANZI_READ_FAILED',
|
|
22
|
+
message: compatibilityError ? error.message : 'Request failed',
|
|
23
|
+
...(compatibilityError && error.details ? { details: error.details } : {}),
|
|
24
|
+
},
|
|
20
25
|
};
|
|
21
26
|
};
|
|
22
27
|
|
package/lib/client.js
CHANGED
|
@@ -20,6 +20,8 @@ window.__ModuleLoader__.load({
|
|
|
20
20
|
statusLoading: 'Checking…',
|
|
21
21
|
statusOnline: 'Online',
|
|
22
22
|
statusOffline: 'Unavailable',
|
|
23
|
+
statusUpdateRequired: 'Project update required',
|
|
24
|
+
statusUpgradeRequired: 'Installed MCP/plugin requires project version {required}; this project is {current}. Run git pull in the project root, update/rebuild as instructed, then restart the workbench and MCP connection.',
|
|
23
25
|
statusRsshub: 'RSSHub',
|
|
24
26
|
statusGithub: 'GitHub',
|
|
25
27
|
statusOk: 'ok',
|
|
@@ -138,7 +140,7 @@ window.__ModuleLoader__.load({
|
|
|
138
140
|
hotspotIdLabel: 'Hotspot ID: ',
|
|
139
141
|
yes: 'yes',
|
|
140
142
|
no: 'no',
|
|
141
|
-
promptSetup: 'Load the jianzi-workbench-setup skill if available; otherwise follow these instructions. Call jianzi_doctor first and use this DSH session’s workspace as projectRoot; never use the DSH profile/plugin directory. If offline and the project contains server.mjs plus scripts/runtime/start-workbench.ps1 or .sh, call jianzi_workbench_start and wait for ready plus a matching fingerprint. If no project exists, stop and ask whether to clone https://github.com/shiker1996/wechat-editroom.git into an empty directory; clone only after confirmation, never overwrite files, then run setup-workbench.cmd or ./setup-workbench.sh with my choices. Do not use --yes or install RSSHub unless I choose it. Once ready, verify RSSHub, sources, account profile, and collectors. Never read or output .env/secrets. If workspace or terminal tools are unavailable, give manual steps. Report each check in one line.',
|
|
143
|
+
promptSetup: 'Load the jianzi-workbench-setup skill if available; otherwise follow these instructions. Call jianzi_doctor first and use this DSH session’s workspace as projectRoot; never use the DSH profile/plugin directory. If it returns WORKBENCH_VERSION_MISMATCH, stop business tool calls and tell me to git pull in the project root, update/rebuild as instructed, then restart the workbench and MCP before retrying doctor. If offline and the project contains server.mjs plus scripts/runtime/start-workbench.ps1 or .sh, call jianzi_workbench_start and wait for ready plus a matching fingerprint. If no project exists, stop and ask whether to clone https://github.com/shiker1996/wechat-editroom.git into an empty directory; clone only after confirmation, never overwrite files, then run setup-workbench.cmd or ./setup-workbench.sh with my choices. Do not use --yes or install RSSHub unless I choose it. Once ready, verify RSSHub, sources, account profile, and collectors. Never read or output .env/secrets. If workspace or terminal tools are unavailable, give manual steps. Report each check in one line.',
|
|
142
144
|
promptTopics: 'Load the jianzi-topic-to-article skill and run its topic-discovery stage. Follow the skill order strictly: create or reuse a batch, collect and wait for the job, submit tags, build events and fact cards, run the research stages, then read the rankings. Do not call any Jianzi internal-model tool. Finish with a ranked shortlist that includes batch ID, candidate/hotspot IDs, rationale, risks, and source links. Stop for my topic choice before adding a candidate or drafting an article.',
|
|
143
145
|
promptArticle: 'Load the jianzi-topic-to-article skill and run its article stage. Fetch the candidate source first, read the candidate, account profile, and article-length settings, and show me the editorial angle for confirmation. Then save a draft and read it back. Do not save a final and do not start typesetting until I confirm the generated article.',
|
|
144
146
|
promptTypeset: 'Load the jianzi-typeset-cover skill and run typesetting and cover generation. Read the article documents first: continue only when a user-confirmed final exists. If only a draft exists, stop and explain. Generate the WeChat HTML, submit it for typesetting, generate the cover, and return both preview links. Do not publish to WeChat and do not call Jianzi internal-model typesetting tools.',
|
|
@@ -156,6 +158,8 @@ window.__ModuleLoader__.load({
|
|
|
156
158
|
statusLoading: '检查中…',
|
|
157
159
|
statusOnline: '已连接',
|
|
158
160
|
statusOffline: '未连接',
|
|
161
|
+
statusUpdateRequired: '需要更新项目',
|
|
162
|
+
statusUpgradeRequired: '当前 MCP/插件需要项目版本 {required},本地项目为 {current}。请在项目根目录执行 git pull,按升级说明更新依赖并重新构建,然后重启工作台和 MCP 连接。',
|
|
159
163
|
statusRsshub: 'RSSHub',
|
|
160
164
|
statusGithub: 'GitHub',
|
|
161
165
|
statusOk: '正常',
|
|
@@ -274,7 +278,7 @@ window.__ModuleLoader__.load({
|
|
|
274
278
|
hotspotIdLabel: '热点 ID:',
|
|
275
279
|
yes: '是',
|
|
276
280
|
no: '否',
|
|
277
|
-
promptSetup: '如可用,加载 jianzi-workbench-setup 技能;否则按本提示执行。先调用 jianzi_doctor,并使用当前 DSH 会话工作空间作为 projectRoot;不要用 DSH profile
|
|
281
|
+
promptSetup: '如可用,加载 jianzi-workbench-setup 技能;否则按本提示执行。先调用 jianzi_doctor,并使用当前 DSH 会话工作空间作为 projectRoot;不要用 DSH profile/插件目录。若返回 WORKBENCH_VERSION_MISMATCH,停止业务工具调用,说明本地项目版本与插件/MCP 所需版本,并让我在项目根目录执行 git pull,按升级说明更新依赖并重建,再重启工作台和 MCP;完成后重调 doctor。服务未连接且目录含 server.mjs 与 scripts/runtime/start-workbench.ps1 或 .sh 时,调用 jianzi_workbench_start,等待 ready 和 workspaceId 指纹匹配。若没有项目,停止启动并询问是否克隆 https://github.com/shiker1996/wechat-editroom.git 到空目录;确认后才克隆,不覆盖文件,再运行 setup-workbench.cmd 或 ./setup-workbench.sh 并逐项让我选择。不要用 --yes;未经我选择不要安装 RSSHub。就绪后检查 RSSHub、采集源、账号画像和采集器。不要读取或输出 .env/密钥。若无工作区或终端工具,提供手动步骤。每项检查用一句话汇报。',
|
|
278
282
|
promptTopics: '加载 jianzi-topic-to-article 技能,执行选题阶段。严格按技能顺序:创建或复用批次 → 采集并等待任务完成 → 提交打标 → 生成事件与事实卡 → 运行研判阶段 → 读取榜单。不要调用见字内部模型工具。最后给我一份排序清单,包含批次 ID、候选/热点 ID、理由、风险和来源链接;等我选题后再加入候选或写文章。',
|
|
279
283
|
promptArticle: '加载 jianzi-topic-to-article 技能,执行文章阶段。先抓取候选原文,读取候选、账号画像和文章字数设置,把编辑角度给我确认;确认后保存 draft 并回读。未经我确认不要保存 final,也不要开始排版。',
|
|
280
284
|
promptTypeset: '加载 jianzi-typeset-cover 技能,执行排版与封面。先读取文章文档,只有存在我确认过的 final 才继续;只有 draft 就停下来说明。生成公众号 HTML 并提交排版,再生成封面,返回两个预览入口。不要发布到公众号,也不要调用见字内部模型排版工具。',
|
|
@@ -500,6 +504,7 @@ window.__ModuleLoader__.load({
|
|
|
500
504
|
const [pending, setPending] = React.useState('');
|
|
501
505
|
const [status, setStatus] = React.useState(null);
|
|
502
506
|
const [health, setHealth] = React.useState(null);
|
|
507
|
+
const [healthError, setHealthError] = React.useState(null);
|
|
503
508
|
const [batches, setBatches] = React.useState([]);
|
|
504
509
|
const [candidates, setCandidates] = React.useState([]);
|
|
505
510
|
const [social, setSocial] = React.useState([]);
|
|
@@ -537,13 +542,23 @@ window.__ModuleLoader__.load({
|
|
|
537
542
|
}
|
|
538
543
|
};
|
|
539
544
|
|
|
545
|
+
const readEnvelope = async (url) => {
|
|
546
|
+
try {
|
|
547
|
+
const response = await fetch(url, { headers: { accept: 'application/json' } });
|
|
548
|
+
return await response.json();
|
|
549
|
+
} catch {
|
|
550
|
+
return null;
|
|
551
|
+
}
|
|
552
|
+
};
|
|
553
|
+
|
|
540
554
|
const loadStatus = async () => {
|
|
541
555
|
setLoadingStatus(true);
|
|
542
556
|
const [doctor, list] = await Promise.all([
|
|
543
|
-
|
|
557
|
+
readEnvelope('/jianzi/status'),
|
|
544
558
|
readJson('/jianzi/batches?limit=8'),
|
|
545
559
|
]);
|
|
546
|
-
setHealth(doctor
|
|
560
|
+
setHealth(doctor?.ok ? doctor.data : null);
|
|
561
|
+
setHealthError(doctor?.ok ? null : doctor?.error || null);
|
|
547
562
|
setBatches(Array.isArray(list) ? list : []);
|
|
548
563
|
setLoadingStatus(false);
|
|
549
564
|
};
|
|
@@ -763,6 +778,12 @@ window.__ModuleLoader__.load({
|
|
|
763
778
|
`${tr('hotspotsLabel')} ${currentBatch.hotspot_count ?? 0}`,
|
|
764
779
|
`${tr('artifactsLabel')} ${currentBatch.artifact_count ?? 0}`,
|
|
765
780
|
].filter(Boolean).join(' · ') : '';
|
|
781
|
+
const statusUpdateRequired = healthError?.code === 'WORKBENCH_VERSION_MISMATCH';
|
|
782
|
+
const versionHint = statusUpdateRequired
|
|
783
|
+
? tr('statusUpgradeRequired')
|
|
784
|
+
.replace('{required}', String(healthError?.details?.requiredVersion || '未知'))
|
|
785
|
+
.replace('{current}', String(healthError?.details?.currentVersion || '未知'))
|
|
786
|
+
: '';
|
|
766
787
|
|
|
767
788
|
return h(React.Fragment, null,
|
|
768
789
|
h('style', null, styles),
|
|
@@ -786,12 +807,13 @@ window.__ModuleLoader__.load({
|
|
|
786
807
|
),
|
|
787
808
|
h('div', { className: 'jianzi-desk__status-line' },
|
|
788
809
|
h('span', { className: health ? 'jianzi-desk__status-dot jianzi-desk__status-dot--online' : 'jianzi-desk__status-dot', 'aria-hidden': true }),
|
|
789
|
-
h('span', null, health ? tr('statusOnline') : tr('statusOffline')),
|
|
810
|
+
h('span', null, statusUpdateRequired ? tr('statusUpdateRequired') : health ? tr('statusOnline') : tr('statusOffline')),
|
|
790
811
|
),
|
|
791
812
|
h('div', { className: 'jianzi-desk__status-details' },
|
|
792
813
|
[['RSSHub', Boolean(health && health.health && health.health.rsshub && health.health.rsshub.ok)], ['GitHub', Boolean(health && health.health && health.health.github && health.health.github.authenticated)]].map(([name, ready]) => h('span', { className: 'jianzi-desk__status-pill', key: name }, name, h('b', null, health ? (ready ? tr('statusOk') : tr('statusBad')) : '—'))),
|
|
793
814
|
),
|
|
794
|
-
|
|
815
|
+
statusUpdateRequired ? h('p', { className: 'jianzi-desk__start-message jianzi-desk__start-message--error', role: 'alert' }, versionHint) : null,
|
|
816
|
+
!health && !loadingStatus && !statusUpdateRequired ? h('div', { className: 'jianzi-desk__start' },
|
|
795
817
|
h('button', { type: 'button', onClick: () => void startProject(), disabled: startingProject }, startingProject ? tr('startingProject') : tr('startProject')),
|
|
796
818
|
startupMessage ? h('p', { className: `jianzi-desk__start-message jianzi-desk__start-message--${startupMessage.kind}`, role: 'status' }, startupMessage.text) : null,
|
|
797
819
|
) : null,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jianzi-content-workbench",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"icon": "./icon.svg",
|
|
5
5
|
"description": "DSH content workbench panel that starts native Agent sessions backed by Jianzi MCP tools.",
|
|
6
6
|
"repository": {
|
|
@@ -29,7 +29,9 @@
|
|
|
29
29
|
"icon.svg"
|
|
30
30
|
],
|
|
31
31
|
"dsh": {
|
|
32
|
-
"bundle": {
|
|
32
|
+
"bundle": {
|
|
33
|
+
"patch": "./cordis.patch.yml"
|
|
34
|
+
},
|
|
33
35
|
"client": {
|
|
34
36
|
"platform": "web",
|
|
35
37
|
"immediately": true
|
|
@@ -39,5 +41,7 @@
|
|
|
39
41
|
"@deepseek-ai/dsh-mcp-client": "0.2.2-rc.1",
|
|
40
42
|
"@deepseek-ai/schemastery": "*"
|
|
41
43
|
},
|
|
42
|
-
"scripts": {
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "node ./build.mjs"
|
|
46
|
+
}
|
|
43
47
|
}
|
package/shared/tools.mjs
CHANGED
|
@@ -11,6 +11,15 @@ const positiveId = (value, field) => {
|
|
|
11
11
|
return parsed;
|
|
12
12
|
};
|
|
13
13
|
const sensitiveField = /^(?:api[_-]?key|token|secret|password|authorization|cookie|credential|credentials)$/i;
|
|
14
|
+
const MCP_PACKAGE_VERSION = (() => {
|
|
15
|
+
const candidates = [new URL('../../package.json', import.meta.url), new URL('../package.json', import.meta.url)];
|
|
16
|
+
for (const url of candidates) {
|
|
17
|
+
if (!fs.existsSync(url)) continue;
|
|
18
|
+
const version = JSON.parse(fs.readFileSync(url, 'utf8')).version;
|
|
19
|
+
if (typeof version === 'string' && version.trim()) return version.trim();
|
|
20
|
+
}
|
|
21
|
+
throw new Error('无法读取 MCP 所属 package.json 版本');
|
|
22
|
+
})();
|
|
14
23
|
|
|
15
24
|
function redactSensitive(value, key = '') {
|
|
16
25
|
if (Array.isArray(value)) return value.map((item) => redactSensitive(item));
|
|
@@ -49,7 +58,7 @@ function safeImageResult(result) {
|
|
|
49
58
|
}
|
|
50
59
|
|
|
51
60
|
export const JIANZI_TOOLS = [
|
|
52
|
-
{ name: 'jianzi_doctor', description: '
|
|
61
|
+
{ name: 'jianzi_doctor', description: '检查见字工作台连接、项目版本与 MCP/插件兼容性、Node 运行时和核心功能是否可用。若版本不兼容,先按返回提示更新项目并重启,再继续业务工具。', inputSchema: { type: 'object', properties: {} }, readOnlyHint: true },
|
|
53
62
|
{ name: 'jianzi_workbench_start', description: '当用户要求启动已停止的本机见字工作台,或 jianzi_doctor 报告服务未运行时,调用项目官方启动脚本并等待服务 ready,再执行健康检查。不会打开浏览器或修改业务数据。源码 MCP 默认使用当前项目根目录;打包/独立 MCP 可传项目绝对路径 projectRoot,或设置 JIANZI_PROJECT_ROOT。', inputSchema: { type: 'object', properties: { projectRoot: string('见字项目的本机绝对路径。源码集成可省略;DSH/npm 包未配置 JIANZI_PROJECT_ROOT 时必须提供。') } }, readOnlyHint: false },
|
|
54
63
|
{ name: 'jianzi_account_profile', description: '读取账号画像,用于选题定位、语气和受众判断。', inputSchema: { type: 'object', properties: {} }, readOnlyHint: true },
|
|
55
64
|
{ name: 'jianzi_account_profile_update', description: '保存用户确认过的账号画像。至少包含公众号名称、简介、核心读者和一个内容支柱。', inputSchema: { type: 'object', properties: { context: { type: 'object', description: '符合 account-context.json 格式的账号画像字段。' } }, required: ['context'] }, readOnlyHint: false },
|
|
@@ -247,6 +256,42 @@ function unavailableWorkbenchError(error, address) {
|
|
|
247
256
|
return unavailable;
|
|
248
257
|
}
|
|
249
258
|
|
|
259
|
+
function versionParts(value) {
|
|
260
|
+
const match = String(value || '').trim().match(/^(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/);
|
|
261
|
+
return match ? match.slice(1, 4).map(Number) : null;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
function isVersionBelow(current, required) {
|
|
265
|
+
const actualParts = versionParts(current);
|
|
266
|
+
const requiredParts = versionParts(required);
|
|
267
|
+
if (!actualParts || !requiredParts) return true;
|
|
268
|
+
for (let index = 0; index < 3; index += 1) {
|
|
269
|
+
if (actualParts[index] < requiredParts[index]) return true;
|
|
270
|
+
if (actualParts[index] > requiredParts[index]) return false;
|
|
271
|
+
}
|
|
272
|
+
return false;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
function outdatedWorkbenchError(currentVersion) {
|
|
276
|
+
const current = String(currentVersion || '').trim() || '未知';
|
|
277
|
+
const error = new Error(`本地见字项目版本为 ${current},当前 MCP/插件需要 ${MCP_PACKAGE_VERSION} 或更高版本。请在项目根目录执行 git pull,按项目升级说明更新依赖并重新构建,然后重启工作台和 MCP 连接,再重试。`);
|
|
278
|
+
error.code = 'WORKBENCH_VERSION_MISMATCH';
|
|
279
|
+
error.details = { currentVersion: currentVersion || null, requiredVersion: MCP_PACKAGE_VERSION, action: 'git pull, update dependencies/build if required, restart workbench and MCP' };
|
|
280
|
+
return error;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
async function assertWorkbenchVersion(client) {
|
|
284
|
+
let result;
|
|
285
|
+
try {
|
|
286
|
+
result = await client.get('/api/system/health?target=version');
|
|
287
|
+
} catch (error) {
|
|
288
|
+
if (['HTTP_400', 'HTTP_404'].includes(error?.code)) throw outdatedWorkbenchError(null);
|
|
289
|
+
throw unavailableWorkbenchError(error, client.baseUrl);
|
|
290
|
+
}
|
|
291
|
+
if (isVersionBelow(result?.appVersion, MCP_PACKAGE_VERSION)) throw outdatedWorkbenchError(result?.appVersion);
|
|
292
|
+
return result;
|
|
293
|
+
}
|
|
294
|
+
|
|
250
295
|
async function withArtifactEntry(client, result, type, candidateId = null) {
|
|
251
296
|
const entries = {
|
|
252
297
|
articlePreview: { label: '文章预览', path: '/#preview' },
|
|
@@ -279,11 +324,13 @@ function artifactTypeForJob(job) {
|
|
|
279
324
|
export async function executeJianziTool(client, name, input = {}, context = {}) {
|
|
280
325
|
const batch = encodeURIComponent(String(input.batchId || ''));
|
|
281
326
|
const candidate = encodeURIComponent(String(input.candidateId || ''));
|
|
327
|
+
if (!['jianzi_doctor', 'jianzi_workbench_start'].includes(name)) await assertWorkbenchVersion(client);
|
|
282
328
|
switch (name) {
|
|
283
329
|
case 'jianzi_doctor': {
|
|
284
330
|
try {
|
|
285
331
|
const [health, batches] = await Promise.all([client.get('/api/system/health'), client.get('/api/batches?limit=1')]);
|
|
286
|
-
|
|
332
|
+
if (isVersionBelow(health?.appVersion, MCP_PACKAGE_VERSION)) throw outdatedWorkbenchError(health?.appVersion);
|
|
333
|
+
return { connected: true, node: health.node, integrationVersion: MCP_PACKAGE_VERSION, health, sampleBatchCount: Array.isArray(batches) ? batches.length : 0 };
|
|
287
334
|
} catch (error) {
|
|
288
335
|
throw unavailableWorkbenchError(error, client.baseUrl);
|
|
289
336
|
}
|