@zltquant/zlt-mcp 0.1.0 → 0.2.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/config.json CHANGED
@@ -928,7 +928,7 @@
928
928
  "includeSeries": {
929
929
  "type": "boolean",
930
930
  "default": false,
931
- "description": "返回逐日序列(date / totalAsset / benchmarkPrice / positionRatePct / turnoverRatePct)。超过 250 行只返回最后 250 行并标 seriesTruncated。"
931
+ "description": "返回逐日序列(date / totalAsset / benchmarkPrice / positionRatePct / turnoverRatePct)。超过 250 行会**等距抽样**到 250 点并标 seriesTruncated:首尾保留、跨度完整、逐点数值真实,只是变稀——多年回测画净值曲线够用,不会只拿到末段。要每一行时 notes 会给出该次产物 CSV 的列号,照它读。"
932
932
  }
933
933
  },
934
934
  "required": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zltquant/zlt-mcp",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "智量通 ZLT Quant MCP server(Windows x64;量化策略创建与本地回测)",
5
5
  "bin": {
6
6
  "zlt-mcp": "./zlt-mcp-proxy.bundle.cjs"
@@ -10496,7 +10496,74 @@ var DEFAULT_BACKTEST_MODULE_INDICES = [TY_MODULE_INDEX];
10496
10496
  var DEBUG_ASSISTANT_INSTALLER_URL = "https://beta.zltquant.com/download/setup-ZLTStudio-Dbg-mini-20260714.4.exe";
10497
10497
  var PUBLIC_PYTHON_SDK_INDEX_URL = "https://pypip.zltquant.com/";
10498
10498
  var ZLTAF_CONFIG_FILE_DEFAULT = "application-local.properties";
10499
- var ZLTAF_CONFIG_FILE_DAY = "application-local-day.properties";
10499
+ var OFFICIAL_MIRROR_ROOTS = {
10500
+ public: "https://zlt-data-house.oss-cn-wuhan-lr.aliyuncs.com/zltkj.site/down/v1/up/Zlt.Std.Official",
10501
+ internal: "http://192.168.1.243:9000/zlt-data-house/zltkj.site/down/v1/up/Zlt.Std.Official"
10502
+ };
10503
+ var OFFICIAL_INSTALLERS = {
10504
+ public: {
10505
+ // 公网 full 仍停在 2026.06.18.11:2026.08.26.2 / 2026.08.14.5 / 2026.08.12.3 在
10506
+ // 公网 OSS 一律 404(2026-08-27 实测 HEAD)。这个版本低于我们自己发布的
10507
+ // zlt_quant_version_index.json 里的 Client.min = 2026.08.12.3,所以公网通道上
10508
+ // 一台 full 装机会以 blockedByPlugin 收场 —— 解法是运维把件传上 OSS,之后
10509
+ // 只改本条的 version 与 sha256 两个字段,不是在代码里绕。
10510
+ full: {
10511
+ artifact: "zlt_client",
10512
+ version: "2026.06.18.11",
10513
+ sha256: "376D9C60A4BA7FF4745DF67A789BA252025EA72BB74DB6A963513FE1EFC10AE2"
10514
+ },
10515
+ // 2026-08-15 抬到 2026.08.14.5:公网 OSS 与内网镜像是同一份字节(ETag 113b3cff…、
10516
+ // 75,075,160 字节两边一致),本机下载实测 SHA256=9D40AE9A…D551,与 2026-08-14 覆盖
10517
+ // 安装时校验过的摘要一致,两条独立路径互证。这一版是投研模块下限(≥2026.08.11.2)
10518
+ // 之上的第一个已发布 mini:低于它,投研模块 upgrade/check 直接以「客户端版本过低」
10519
+ // 拒绝,且该下限只在模块服务端。version 取安装包自身 FileVersion 的点分四段(不是
10520
+ // 构建目录名的紧凑形 20260814.5):升级判定拿它和 InstallInfo.xml 的
10521
+ // InstallAppReleaseVer 比,写成紧凑形会让「有可用更新」永远消不掉。
10522
+ mini: {
10523
+ artifact: "zlt_plugin",
10524
+ version: "2026.08.14.5",
10525
+ sha256: "9D40AE9ABCA459CF60CD5377A24013FA4B14BF96DE2D82E04CDD268AE1FDD551"
10526
+ }
10527
+ },
10528
+ internal: {
10529
+ // 2026-08-28 抬到 2026.08.28.8,接替 2026.08.26.2。内网镜像下载核验:
10530
+ // 168,535,424 字节,SHA256=EF1F270A…B638,安装包 FileVersion 自报 2026.08.28.8
10531
+ // (版本取它,不取文件名)。它仍高于 Client.min = 2026.08.12.3,所以内测通道上
10532
+ // 一台 full 装机不会以 blockedByPlugin 收场。公网 OSS 无此件,public.full 不动。
10533
+ full: {
10534
+ artifact: "zlt_client",
10535
+ version: "2026.08.28.8",
10536
+ sha256: "EF1F270A9F2FEBEE6B3B101FA2FC7E23927FE64B340383DDAB66C0C79682B638"
10537
+ },
10538
+ // 2026-08-28 抬到 2026.08.28.7,接替同日的 2026.08.28.3。下载核验:79,587,656 字节,
10539
+ // SHA256=9A38670A…A943,FileVersion 自报 2026.08.28.7。
10540
+ // **换件理由只到「交付方给了新件」为止**:2026.08.28.3 的 ZLTHome 启动即崩
10541
+ // (TTaskFunc 持栈上 lambda 的悬垂引用,100% 复现),这一版是否修好了它,本次
10542
+ // 未活体验证 —— 装机跑一次再下结论,别拿版本号当证据。
10543
+ // .3 起把 zltaf 从投研模块的子模块集里去掉,修的是首装必炸的另一条权限死路:此前
10544
+ // 安装器与模块各发一份 zltaf,模块解压必须覆盖安装器以管理员身份写下的文件,而
10545
+ // ZLTBackService 跑在登录账户的 UAC 过滤令牌上。卷根 ACL 缺 Authenticated Users:(M)
10546
+ // 时(非系统盘的老式默认)覆盖必被拒,2 毫秒失败在第一个文件上,100% 复现。
10547
+ // 见 docs/reports/2026-08-28-zltaf-submodule-extract-access-denied.md。
10548
+ // 公网 OSS 尚无此件,所以 public.mini 仍停在 2026.08.14.5 —— 两张表自此不再同版本,
10549
+ // 这正是按镜像分表的理由。
10550
+ mini: {
10551
+ artifact: "zlt_plugin",
10552
+ version: "2026.08.28.7",
10553
+ sha256: "9A38670A83BDAAE2D9AF3178F05CECDFE95796F05BE9227F674A0DD232C6A943"
10554
+ }
10555
+ }
10556
+ };
10557
+ function resolveInstallerMirror() {
10558
+ return false ? "internal" : "public";
10559
+ }
10560
+ function officialInstallerUrl(slot, mirror = "public") {
10561
+ const spec = OFFICIAL_INSTALLERS[mirror][slot];
10562
+ return `${OFFICIAL_MIRROR_ROOTS[mirror]}/pkg/${spec.artifact}_${spec.version}.exe`;
10563
+ }
10564
+ function officialVersionIndexUrl(mirror = "public") {
10565
+ return `${OFFICIAL_MIRROR_ROOTS[mirror]}/VscodeMarketPlugin/zlt_quant_version_index.json`;
10566
+ }
10500
10567
  var INTERNAL_PYTHON_SDK_INDEX_URL = "https://192.168.1.32:9100/pypi/simple/";
10501
10568
  var INTERNAL_PYTHON_SDK_TRUSTED_HOST = "192.168.1.32";
10502
10569
  var PYTHON_SDK_PACKAGES = ["zltquant", "zltsdk-plugin"];
@@ -10517,8 +10584,8 @@ var defaultAssistantRuntimeConfig = {
10517
10584
  envMode: "OFFICIAL",
10518
10585
  backserviceDownload: {
10519
10586
  OFFICIAL: {
10520
- full: "https://zlt-data-house.oss-cn-wuhan-lr.aliyuncs.com/zltkj.site/down/v1/up/Zlt.Std.Official/pkg/zlt_client_2026.06.18.11.exe",
10521
- mini: "https://zlt-data-house.oss-cn-wuhan-lr.aliyuncs.com/zltkj.site/down/v1/up/Zlt.Std.Official/pkg/zlt_plugin_2026.08.14.5.exe"
10587
+ full: officialInstallerUrl("full"),
10588
+ mini: officialInstallerUrl("mini")
10522
10589
  },
10523
10590
  REL: {
10524
10591
  full: "",
@@ -10531,10 +10598,13 @@ var defaultAssistantRuntimeConfig = {
10531
10598
  },
10532
10599
  // Exact artifact digests. A URL update requires a matching digest update in the
10533
10600
  // same reviewed change; downloadRuntimeInstaller fails closed when it is absent.
10601
+ // OFFICIAL 的取值来自 OFFICIAL_INSTALLERS.public —— URL/版本/摘要三者同源,只有那一处可改。
10602
+ // 这里恒取公网表:模块级默认必须公网可达(runtime.test.ts 的 LAN 守卫钉的就是它),
10603
+ // 内网镜像那档由 applyEnvOverrides 按镜像轴整行换掉。
10534
10604
  backserviceDownloadSha256: {
10535
10605
  OFFICIAL: {
10536
- full: "376D9C60A4BA7FF4745DF67A789BA252025EA72BB74DB6A963513FE1EFC10AE2",
10537
- mini: "9D40AE9ABCA459CF60CD5377A24013FA4B14BF96DE2D82E04CDD268AE1FDD551"
10606
+ full: OFFICIAL_INSTALLERS.public.full.sha256,
10607
+ mini: OFFICIAL_INSTALLERS.public.mini.sha256
10538
10608
  },
10539
10609
  REL: { full: "", mini: "" },
10540
10610
  DEBUG: {
@@ -10542,15 +10612,12 @@ var defaultAssistantRuntimeConfig = {
10542
10612
  mini: "05C57A5D212684A801665774E9F0813EFC1AA4762D1540EC353BB41173712B07"
10543
10613
  }
10544
10614
  },
10545
- // 与上面的 URL/摘要同属一次评审:本体升级判定拿它当「我们能立刻交付的版本下限」。
10546
- // 只改 URL 不改这里,判定就会用别的版本号去比对已装本体。
10615
+ // 本体升级判定拿它当「我们能立刻交付的版本下限」。OFFICIAL 与 URL 同源自
10616
+ // OFFICIAL_INSTALLERS,结构上不可能只改 URL 不改这里。
10547
10617
  backserviceDownloadVersion: {
10548
10618
  OFFICIAL: {
10549
- full: "2026.06.18.11",
10550
- // 取安装包自身的 FileVersion,不是构建目录名里的紧凑形(20260814.5):判定拿它和
10551
- // InstallInfo.xml 的 InstallAppReleaseVer 比,那边是点分四段。写成紧凑形会让
10552
- // 20260814 > 2026 恒成立,「有可用更新」永远消不掉。
10553
- mini: "2026.08.14.5"
10619
+ full: OFFICIAL_INSTALLERS.public.full.version,
10620
+ mini: OFFICIAL_INSTALLERS.public.mini.version
10554
10621
  },
10555
10622
  REL: { full: "", mini: "" },
10556
10623
  DEBUG: {
@@ -10567,8 +10634,10 @@ var defaultAssistantRuntimeConfig = {
10567
10634
  //
10568
10635
  // REL/DEBUG 没有对应发布面,留空即跳过远程判定。地址不可达或文件不存在同样 fail-open,
10569
10636
  // 所以这条链路默认是关的,直到有人把文件传上去 —— 见 deploy/README.md。
10637
+ // 与安装包同源自 OFFICIAL_MIRROR_ROOTS:内测构建把安装包指到内网时,这条也必须跟着走,
10638
+ // 否则一个 -internal 产物会拿公网索引判闸门 —— 而索引取不到时闸门是 fail-open。
10570
10639
  baseRequirementUrl: {
10571
- OFFICIAL: "https://zlt-data-house.oss-cn-wuhan-lr.aliyuncs.com/zltkj.site/down/v1/up/Zlt.Std.Official/VscodeMarketPlugin/zlt_quant_version_index.json",
10640
+ OFFICIAL: officialVersionIndexUrl("public"),
10572
10641
  REL: "",
10573
10642
  DEBUG: ""
10574
10643
  },
@@ -10771,13 +10840,16 @@ function applyEnvOverrides(config2) {
10771
10840
  const sdkTrustedHostOverride = process.env.ZLT_PYTHON_SDK_TRUSTED_HOST;
10772
10841
  const baseRequirementUrlOverride = process.env.ZLT_BASE_REQUIREMENT_URL?.trim();
10773
10842
  const installer = parseInstallerOverride(process.env.ZLT_ASSISTANT_INSTALLER_OVERRIDE);
10843
+ const mirror = resolveInstallerMirror();
10844
+ const mirrored = applyInstallerMirror(config2, mirror);
10845
+ const mirroredIndex = mirror === "public" ? config2.baseRequirementUrl : { ...config2.baseRequirementUrl, OFFICIAL: officialVersionIndexUrl(mirror) };
10774
10846
  return {
10775
10847
  ...config2,
10776
10848
  envMode,
10777
- baseRequirementUrl: baseRequirementUrlOverride ? { ...config2.baseRequirementUrl, [envMode]: baseRequirementUrlOverride } : config2.baseRequirementUrl,
10778
- backserviceDownload: applyInstallerOverride(config2.backserviceDownload, envMode, installer, "url"),
10779
- backserviceDownloadSha256: applyInstallerOverride(config2.backserviceDownloadSha256, envMode, installer, "sha256"),
10780
- backserviceDownloadVersion: applyInstallerOverride(config2.backserviceDownloadVersion, envMode, installer, "version"),
10849
+ baseRequirementUrl: baseRequirementUrlOverride ? { ...mirroredIndex, [envMode]: baseRequirementUrlOverride } : mirroredIndex,
10850
+ backserviceDownload: applyInstallerOverride(mirrored.backserviceDownload, envMode, installer, "url"),
10851
+ backserviceDownloadSha256: applyInstallerOverride(mirrored.backserviceDownloadSha256, envMode, installer, "sha256"),
10852
+ backserviceDownloadVersion: applyInstallerOverride(mirrored.backserviceDownloadVersion, envMode, installer, "version"),
10781
10853
  pythonRuntimePackages: runtimePackages.length > 0 ? runtimePackages : config2.pythonRuntimePackages,
10782
10854
  pythonRuntimeIndexUrl: process.env.ZLT_PYTHON_RUNTIME_INDEX_URL?.trim() || config2.pythonRuntimeIndexUrl,
10783
10855
  pythonSdkPackages: packages.length > 0 ? packages : envModeChanged ? config2.pythonSdkPackagesByMode[envMode] : config2.pythonSdkPackages,
@@ -10787,6 +10859,25 @@ function applyEnvOverrides(config2) {
10787
10859
  pythonPipWheelSha256: process.env.ZLT_PYTHON_PIP_WHEEL_SHA256?.trim() || config2.pythonPipWheelSha256
10788
10860
  };
10789
10861
  }
10862
+ function applyInstallerMirror(config2, mirror) {
10863
+ if (mirror === "public")
10864
+ return config2;
10865
+ const pins = OFFICIAL_INSTALLERS[mirror];
10866
+ return {
10867
+ backserviceDownload: {
10868
+ ...config2.backserviceDownload,
10869
+ OFFICIAL: { full: officialInstallerUrl("full", mirror), mini: officialInstallerUrl("mini", mirror) }
10870
+ },
10871
+ backserviceDownloadSha256: {
10872
+ ...config2.backserviceDownloadSha256,
10873
+ OFFICIAL: { full: pins.full.sha256, mini: pins.mini.sha256 }
10874
+ },
10875
+ backserviceDownloadVersion: {
10876
+ ...config2.backserviceDownloadVersion,
10877
+ OFFICIAL: { full: pins.full.version, mini: pins.mini.version }
10878
+ }
10879
+ };
10880
+ }
10790
10881
  function parseInstallerOverride(raw) {
10791
10882
  const text = raw?.trim();
10792
10883
  if (!text)
@@ -11038,7 +11129,34 @@ var AssistantMasterIpcClient = class {
11038
11129
  }
11039
11130
  }
11040
11131
  }
11041
- async startDefaultServices(config2) {
11132
+ /**
11133
+ * 安装/启动通道动手前,先把 VSCode PID 注册进智能管家的监控表。
11134
+ *
11135
+ * 智能管家侧(xzs)每 ~10 秒查一次 monitor/check_reg_empty,注册表持续为空约 30 秒
11136
+ * 就把整族进程自退回收 —— 2026-08-25 全新装机实测:TY 模块 202MB 下载到 88% 时
11137
+ * ZLTBackService 被回收,ZLTHome 随后退出,下载轮询以管道断开告终
11138
+ * (FAILURE-PATTERNS #77)。常规注册挂在 ZLTAF connected 边沿(vscode-ext 的
11139
+ * assistant-monitor),而首次安装期间 ZLTAF 尚不存在,那条边沿永远等不到;
11140
+ * claw-host 的安装通道在每次 IPC 连接后都上报 PID
11141
+ * (assistant-installer.ts:1132/:1442),此处对齐。重复注册幂等。
11142
+ * 仅检测通道(checkBacktestModuleUpdates)刻意不注册 —— 后台检查若注册会阻止
11143
+ * 空闲自退,把「已装但未运行」这个合法状态挡掉。
11144
+ *
11145
+ * 注册失败绝不拦安装:旧本体可能没有 monitor API,失败只降级为一行进度日志。
11146
+ *
11147
+ * @param config 运行时配置,取其 ipcConnectTimeout 作为请求超时
11148
+ * @param onProgress 可选进度回调,仅在注册失败时收到一行说明
11149
+ */
11150
+ async reportInstallLanePid(config2, onProgress) {
11151
+ try {
11152
+ await this.reportVSCodePid(process.pid, config2);
11153
+ } catch (error2) {
11154
+ const message = error2 instanceof Error ? error2.message : String(error2);
11155
+ onProgress?.(`VSCode \u8FDB\u7A0B\u6CE8\u518C\u5931\u8D25\uFF08\u4E0D\u5F71\u54CD\u5B89\u88C5\u7EE7\u7EED\uFF09: ${message}`);
11156
+ }
11157
+ }
11158
+ async startDefaultServices(config2, onProgress) {
11159
+ await this.reportInstallLanePid(config2, onProgress);
11042
11160
  for (const serviceIndex of config2.manualServiceIndices) {
11043
11161
  await this.sendRequest("zltMClient", "CallInnerRpc", {
11044
11162
  modeType: 0,
@@ -11092,6 +11210,7 @@ var AssistantMasterIpcClient = class {
11092
11210
  }
11093
11211
  }
11094
11212
  async installBacktestModules(workRoot, config2, onProgress, hooks = {}) {
11213
+ await this.reportInstallLanePid(config2, onProgress);
11095
11214
  const moduleIndices = [
11096
11215
  CLIENT_PLUGIN_MODULE_INDEX,
11097
11216
  ...config2.backtestModuleIndices.filter((moduleIndex) => moduleIndex !== CLIENT_PLUGIN_MODULE_INDEX)
@@ -11514,17 +11633,26 @@ var AssistantMasterIpcClient = class {
11514
11633
  throw new Error(formatModuleInstallError("\u6295\u7814\u6A21\u5757\u5305\u8986\u76D6\u5B89\u88C5\u72B6\u6001\u8F6E\u8BE2\u8D85\u65F6", moduleIndex, lastProgress ?? { status: 0, process: 0, phase: 0, response: null }));
11515
11634
  }
11516
11635
  };
11517
- async function startManualServices(workRoot, zltContent, config2) {
11636
+ async function startManualServices(workRoot, zltContent, config2, onProgress) {
11518
11637
  const client = new AssistantMasterIpcClient();
11519
11638
  try {
11520
11639
  await client.connect(zltContent, config2);
11521
- await client.startDefaultServices(config2);
11640
+ await client.startDefaultServices(config2, onProgress);
11522
11641
  await client.pollStartupServices(config2);
11523
11642
  await waitForPipe(workRoot, "ZLTAF", config2.zltafPipeWait);
11524
11643
  } finally {
11525
11644
  await client.disconnect();
11526
11645
  }
11527
11646
  }
11647
+ async function unregisterRuntimeConsumerPid(zltContent, config2) {
11648
+ const client = new AssistantMasterIpcClient();
11649
+ try {
11650
+ await client.connect(zltContent, config2);
11651
+ await client.logoutVSCodePid(process.pid, config2);
11652
+ } finally {
11653
+ await client.disconnect();
11654
+ }
11655
+ }
11528
11656
  async function installBacktestModules(workRoot, zltContent, config2, onProgress, hooks = {}) {
11529
11657
  const client = new AssistantMasterIpcClient();
11530
11658
  try {
@@ -12224,25 +12352,11 @@ async function acquireMcpRuntime(config2, explicitWorkRoot) {
12224
12352
  const workRoot = explicitWorkRoot ?? await locateInstalledRuntime(config2);
12225
12353
  return acquireRuntimeLease(workRoot, "starter", {
12226
12354
  ensureRuntime: async () => {
12227
- const launchedPid = await startRuntimeAndServices(workRoot, config2);
12228
- if (!launchedPid)
12229
- return null;
12230
- const identity = await waitForProcessIdentity(launchedPid, config2.serviceStartupWait);
12231
- if (!identity)
12232
- throw new Error(`\u65E0\u6CD5\u786E\u8BA4 MCP \u542F\u52A8\u7684 ZLTAF \u8FDB\u7A0B\u8EAB\u4EFD: pid=${launchedPid}`);
12233
- return identity;
12355
+ await startAssistantManagedRuntime(workRoot, config2);
12356
+ return null;
12234
12357
  }
12235
12358
  });
12236
12359
  }
12237
- async function startRuntimeAndServices(workRoot, config2) {
12238
- ensureUsersProjectsDirectory(workRoot);
12239
- const launchReady = validateRuntimeLaunchReady(workRoot, config2);
12240
- if (!launchReady.complete) {
12241
- throw new Error(launchReady.reason || "ZLTAF runtime \u542F\u52A8\u4F9D\u8D56\u4E0D\u5B8C\u6574");
12242
- }
12243
- await startAssistantBackServices(workRoot, config2);
12244
- return waitForZltafPipe(workRoot, config2, { startIfMissing: true });
12245
- }
12246
12360
  var AssistantNotRunningError = class extends Error {
12247
12361
  code = "ASSISTANT_NOT_RUNNING";
12248
12362
  constructor(message = "\u667A\u80FD\u7BA1\u5BB6\u5F53\u524D\u672A\u8FD0\u884C\uFF1B\u5F53\u524D\u64CD\u4F5C\u4EC5\u68C0\u6D4B runtime\uFF0C\u4E0D\u4F1A\u542F\u52A8\u667A\u80FD\u7BA1\u5BB6") {
@@ -12267,7 +12381,7 @@ async function startAssistantBackServices(workRoot, config2, onProgress, options
12267
12381
  return;
12268
12382
  const zltContent = await ensureAssistantHostRunning(workRoot, config2, onProgress, options);
12269
12383
  onProgress?.("\u542F\u52A8\u667A\u80FD\u7BA1\u5BB6\u540E\u53F0\u670D\u52A1");
12270
- await startManualServices(workRoot, zltContent, config2);
12384
+ await startManualServices(workRoot, zltContent, config2, onProgress);
12271
12385
  }
12272
12386
  async function ensureAssistantHostRunning(workRoot, config2, onProgress, options = {}) {
12273
12387
  const masterPipeExists = (suffix) => pipeExists(workRoot, `${config2.masterPipePrefix}_${suffix}`);
@@ -12291,11 +12405,13 @@ var ASSISTANT_UPGRADE_FINISH_LOCK = path6.join("Temporary", "upgradeFinsh.lock")
12291
12405
  function launchAssistantHost(workRoot, config2, onProgress) {
12292
12406
  const hostPath = path6.join(workRoot, config2.hostPath);
12293
12407
  onProgress?.("\u542F\u52A8\u667A\u80FD\u7BA1\u5BB6");
12408
+ const { ELECTRON_RUN_AS_NODE: _dropped, ...env } = process.env;
12294
12409
  const child = (0, import_child_process3.spawn)(hostPath, ["startwithplugin", "selfstart"], {
12295
12410
  cwd: path6.dirname(hostPath),
12296
12411
  detached: true,
12297
12412
  stdio: "ignore",
12298
- windowsHide: true
12413
+ windowsHide: true,
12414
+ env
12299
12415
  });
12300
12416
  if (!child.pid)
12301
12417
  throw new Error(`\u667A\u80FD\u7BA1\u5BB6\u542F\u52A8\u540E\u672A\u8FD4\u56DE PID: ${hostPath}`);
@@ -12379,15 +12495,18 @@ async function installRuntime(options) {
12379
12495
  const installDir = options.installDir || getDefaultInstallPath();
12380
12496
  const installerPath = options.installerPath || await downloadRuntimeInstaller(options.config, options.onProgress, options.installType || "full");
12381
12497
  fs6.mkdirSync(installDir, { recursive: true });
12498
+ const installerLogPath = path6.join(installDir, "Temporary", "logs", "install.log");
12499
+ fs6.mkdirSync(path6.dirname(installerLogPath), { recursive: true });
12382
12500
  options.onProgress?.(`\u6267\u884C\u5B89\u88C5\u7A0B\u5E8F: ${installerPath}`);
12383
- const exitCode = await executeInstallerProcess(installerPath, installDir);
12501
+ const exitCode = await executeInstallerProcess(installerPath, installDir, installerLogPath);
12384
12502
  options.onProgress?.(`\u5B89\u88C5\u8FDB\u7A0B\u9000\u51FA\u7801: ${exitCode}`);
12385
12503
  if (exitCode !== 0) {
12386
12504
  const validateInstalled = options.installModules === false ? validateAssistantBaseComplete : validateWorkRootComplete;
12387
12505
  const directValidation = validateInstalled(installDir, options.config);
12388
12506
  const registryWorkRoot = options.installModules === false ? await readRegistryInstallLocationRaw(options.config) : await readRegistryInstallLocation(options.config);
12389
12507
  if (!directValidation.complete && !registryWorkRoot) {
12390
- throw new Error(`\u5B89\u88C5\u7A0B\u5E8F\u6267\u884C\u5931\u8D25\uFF0C\u9000\u51FA\u7801: ${exitCode}; ${directValidation.reason || "\u672A\u53D1\u73B0\u5B8C\u6574 ZLTAF runtime"}`);
12508
+ const cause = describeInstallerExitCode(exitCode);
12509
+ throw new Error(`\u5B89\u88C5\u7A0B\u5E8F\u6267\u884C\u5931\u8D25\uFF08\u9000\u51FA\u7801 ${exitCode}\uFF09` + (cause ? `\uFF1A${cause}` : "") + (directValidation.reason ? `\uFF08${directValidation.reason}\uFF09` : "") + `\u3002\u5B89\u88C5\u65E5\u5FD7: ${installerLogPath}`);
12391
12510
  }
12392
12511
  options.onProgress?.(`\u5B89\u88C5\u7A0B\u5E8F\u9000\u51FA\u7801\u975E 0\uFF0C\u4F46\u57FA\u7840 runtime \u6587\u4EF6\u5DF2\u5B58\u5728\uFF0C\u7EE7\u7EED\u521D\u59CB\u5316: ${exitCode}`);
12393
12512
  }
@@ -12956,7 +13075,28 @@ async function downloadRuntimeInstaller(config2, onProgress, installType = "full
12956
13075
  onProgress?.(`\u5B89\u88C5\u5305 SHA256 \u6821\u9A8C\u901A\u8FC7: ${sha256}`);
12957
13076
  return destination;
12958
13077
  }
12959
- function executeInstallerProcess(installerPath, installDir) {
13078
+ function describeInstallerExitCode(exitCode) {
13079
+ switch (exitCode) {
13080
+ case 1:
13081
+ return "\u5B89\u88C5\u7A0B\u5E8F\u672A\u80FD\u5F00\u59CB\u5B89\u88C5\uFF0C\u6700\u5E38\u89C1\u539F\u56E0\u662F\u53E6\u4E00\u4E2A\u667A\u80FD\u7BA1\u5BB6\u5B89\u88C5\u6216\u5378\u8F7D\u7A0B\u5E8F\u6B63\u5728\u8FD0\u884C\uFF08\u7A97\u53E3\u53EF\u80FD\u88AB\u906E\u6321\uFF0C\u6216\u505C\u5728\u63D0\u6743\u786E\u8BA4\u4E0A\uFF09\u3002\u8BF7\u5173\u95ED\u6240\u6709\u5B89\u88C5/\u5378\u8F7D\u7A97\u53E3\u540E\u91CD\u8BD5";
13082
+ case 2:
13083
+ return "\u5B89\u88C5\u5728\u5F00\u59CB\u524D\u88AB\u7528\u6237\u53D6\u6D88";
13084
+ case 3:
13085
+ case 4:
13086
+ return "\u5B89\u88C5\u8FC7\u7A0B\u4E2D\u53D1\u751F\u81F4\u547D\u9519\u8BEF\uFF08\u5E38\u89C1\u539F\u56E0\uFF1A\u78C1\u76D8\u7A7A\u95F4\u4E0D\u8DB3\u3001\u76EE\u6807\u6587\u4EF6\u88AB\u5176\u4ED6\u7A0B\u5E8F\u5360\u7528\u3001\u6216\u88AB\u5B89\u5168\u8F6F\u4EF6\u62E6\u622A\uFF09";
13087
+ case 5:
13088
+ return "\u5B89\u88C5\u8FC7\u7A0B\u4E2D\u88AB\u7528\u6237\u53D6\u6D88";
13089
+ case 7:
13090
+ return "\u5B89\u88C5\u524D\u68C0\u67E5\u5224\u5B9A\u5F53\u524D\u73AF\u5883\u65E0\u6CD5\u7EE7\u7EED\u5B89\u88C5";
13091
+ case 8:
13092
+ return "\u4E0A\u4E00\u6B21\u5B89\u88C5\u5C1A\u672A\u5B8C\u6210\uFF0C\u9700\u8981\u91CD\u542F\u7CFB\u7EDF\u540E\u624D\u80FD\u7EE7\u7EED\u5B89\u88C5";
13093
+ case 1223:
13094
+ return "\u5B89\u88C5\u7A0B\u5E8F\u8BF7\u6C42\u7BA1\u7406\u5458\u6743\u9650\u65F6\u88AB\u62D2\u7EDD\uFF08UAC\uFF09";
13095
+ default:
13096
+ return void 0;
13097
+ }
13098
+ }
13099
+ function executeInstallerProcess(installerPath, installDir, logPath) {
12960
13100
  return new Promise((resolve5, reject) => {
12961
13101
  const child = (0, import_child_process3.spawn)(installerPath, [
12962
13102
  "/VERYSILENT",
@@ -12966,7 +13106,7 @@ function executeInstallerProcess(installerPath, installDir) {
12966
13106
  "/NO_ICONS",
12967
13107
  "/MERGETASKS=!desktopicon",
12968
13108
  `/DIR=${installDir}`,
12969
- `/LOG=${path6.join(installDir, "install.log")}`,
13109
+ `/LOG=${logPath}`,
12970
13110
  "/m"
12971
13111
  ], {
12972
13112
  shell: false,
@@ -12975,7 +13115,7 @@ function executeInstallerProcess(installerPath, installDir) {
12975
13115
  });
12976
13116
  child.on("close", (code) => {
12977
13117
  if (code === 2) {
12978
- reject(new Error("\u5B89\u88C5\u88AB\u7528\u6237\u53D6\u6D88\u6216 UAC \u6743\u9650\u88AB\u62D2\u7EDD\uFF0C\u9000\u51FA\u7801: 2"));
13118
+ reject(new Error(`\u5B89\u88C5\u7A0B\u5E8F\u6267\u884C\u5931\u8D25\uFF08\u9000\u51FA\u7801 2\uFF09\uFF1A${describeInstallerExitCode(2)}`));
12979
13119
  } else if (code === null) {
12980
13120
  reject(new Error("\u5B89\u88C5\u7A0B\u5E8F\u6267\u884C\u5931\u8D25\uFF0C\u672A\u8FD4\u56DE\u9000\u51FA\u7801"));
12981
13121
  } else {
@@ -13257,16 +13397,6 @@ async function waitForZltafPipe(workRoot, config2, options) {
13257
13397
  }
13258
13398
  throw new Error(`\u7B49\u5F85 ZLTAF \u7BA1\u9053\u8D85\u65F6: ${discoverPipePath(workRoot, "ZLTAF")}`);
13259
13399
  }
13260
- async function waitForProcessIdentity(pid, timeoutMs) {
13261
- const deadline = Date.now() + Math.max(1e3, timeoutMs);
13262
- while (Date.now() <= deadline) {
13263
- const identity = inspectRuntimeProcess(pid);
13264
- if (identity)
13265
- return identity;
13266
- await delay(100);
13267
- }
13268
- return null;
13269
- }
13270
13400
 
13271
13401
  // ../zlt-runtime-core/dist/auth.js
13272
13402
  var fs7 = __toESM(require("fs"), 1);
@@ -20885,6 +21015,15 @@ var NPM_PACKAGE_CONFIG_TOOL_NAMES = Object.freeze([
20885
21015
  // src/tool-pipeline.ts
20886
21016
  var fs11 = __toESM(require("node:fs"), 1);
20887
21017
  var path11 = __toESM(require("node:path"), 1);
21018
+
21019
+ // src/feature-set.ts
21020
+ function resolveFeatureSet() {
21021
+ return false ? "core" : "full";
21022
+ }
21023
+ var MASKED_FACTOR_MESSAGE = "\u56E0\u5B50\u7814\u7A76\u529F\u80FD\u5728\u5F53\u524D\u7248\u672C\u672A\u5F00\u653E\u3002";
21024
+ var MASKED_FUTURES_MESSAGE = "\u671F\u8D27\u56DE\u6D4B\u5728\u5F53\u524D\u7248\u672C\u672A\u5F00\u653E\uFF1ArunParams.marketIds \u542B\u671F\u8D27\u4EA4\u6613\u6240\uFF08zj/zs/ds/sq/gq\uFF09\u6216 account_list \u7684 account_type \u4E3A\u671F\u8D27\u3002\u8BF7\u4F7F\u7528\u80A1\u7968\u5E02\u573A\uFF08sh/sz\uFF09\u4E0E account_type=1\u3002";
21025
+
21026
+ // src/tool-pipeline.ts
20888
21027
  var FUTURES_MARKET_IDS = /* @__PURE__ */ new Set(["zj", "zs", "ds", "sq", "gq"]);
20889
21028
  function isFuturesRun(marketIds) {
20890
21029
  if (!marketIds) return false;
@@ -20895,7 +21034,26 @@ function prepareToolArgs(tool, args, contexts) {
20895
21034
  const inherited = inheritReBacktestRunParams(tool, args, contexts);
20896
21035
  const dated = applyBacktestDateDefaults(tool, inherited);
20897
21036
  const named = normalizeBacktestRunName(tool, dated);
20898
- return stripEmptyLegacyUserId(tool, named);
21037
+ const prepared = stripEmptyLegacyUserId(tool, named);
21038
+ return refuseMaskedFuturesBacktest(tool, prepared) ?? prepared;
21039
+ }
21040
+ var FUTURES_GATED_TOOLS = /* @__PURE__ */ new Set(["mcp-create-and-run-backtest", "mcp-re-backtest"]);
21041
+ var FUTURES_ACCOUNT_TYPES = /* @__PURE__ */ new Set([2, 6]);
21042
+ function refuseMaskedFuturesBacktest(tool, args) {
21043
+ if (!FUTURES_GATED_TOOLS.has(tool.name) || resolveFeatureSet() !== "core") return null;
21044
+ const runParams = args.runParams ?? {};
21045
+ const marketIds = Array.isArray(runParams.marketIds) ? runParams.marketIds : [];
21046
+ const accounts = Array.isArray(runParams.account_list) ? runParams.account_list : [];
21047
+ const futuresAccount = accounts.some(
21048
+ (account) => !!account && typeof account === "object" && FUTURES_ACCOUNT_TYPES.has(Number(account.account_type))
21049
+ );
21050
+ if (!isFuturesRun(marketIds) && !futuresAccount) return null;
21051
+ return jsonToolResult(10057, MASKED_FUTURES_MESSAGE, {
21052
+ retryableByAgent: false,
21053
+ tool: tool.name,
21054
+ marketIds,
21055
+ userAction: "\u5F53\u524D\u7248\u672C\u4EC5\u652F\u6301\u80A1\u7968\u56DE\u6D4B\uFF08sh/sz\uFF09\uFF1B\u671F\u8D27\u56DE\u6D4B\u8BF7\u7B49\u5F85\u540E\u7EED\u7248\u672C\u5F00\u653E\u3002"
21056
+ }, true);
20899
21057
  }
20900
21058
  async function dispatchSpecialTool(tool, args, client, timeout, session, waitControl) {
20901
21059
  if (tool.name === "mcp-factor-task-status") {
@@ -22098,6 +22256,12 @@ async function runWait(_tool, args, client, timeout, session, control) {
22098
22256
  { action: 'Pass kind="factor" with the executionId from a factor start tool, kind="backtest" with the runId from mcp-create-and-run-backtest, or kind="download" with the uuid from mcp-download-data.' }
22099
22257
  );
22100
22258
  }
22259
+ if (kind === "factor" && resolveFeatureSet() === "core") {
22260
+ return waitError(10057, MASKED_FACTOR_MESSAGE, {
22261
+ action: "Factor research is not available in this build; do not retry with other factor tools.",
22262
+ userAction: MASKED_FACTOR_MESSAGE
22263
+ });
22264
+ }
22101
22265
  if (!id) {
22102
22266
  if (kind === "factor") {
22103
22267
  return waitError(
@@ -23793,7 +23957,7 @@ function summarizeBacktestProfit(runDir, options = {}) {
23793
23957
  function handleBacktestProfitTool(args, contexts) {
23794
23958
  const backtestId = typeof args.backtestId === "string" ? args.backtestId.trim() : "";
23795
23959
  if (!backtestId) {
23796
- return toolText({ ErrNo: 10057, ErrMsg: "\u7F3A\u5C11 backtestId\uFF0C\u65E0\u6CD5\u5B9A\u4F4D\u56DE\u6D4B\u4EA7\u7269\u76EE\u5F55\u3002", Data: null }, true);
23960
+ return toolText({ ErrNo: 10060, ErrMsg: "\u7F3A\u5C11 backtestId\uFF0C\u65E0\u6CD5\u5B9A\u4F4D\u56DE\u6D4B\u4EA7\u7269\u76EE\u5F55\u3002", Data: { retryableByAgent: true } }, true);
23797
23961
  }
23798
23962
  const explicit = typeof args.codePath === "string" ? args.codePath.trim() : "";
23799
23963
  const runDir = explicit || contexts.get(backtestId)?.codePath || "";
@@ -23848,7 +24012,7 @@ var RUNTIME_TOOLS = [
23848
24012
  },
23849
24013
  {
23850
24014
  name: "zlt-runtime-start",
23851
- description: "\u4EE5 ZLTAF direct mode \u542F\u52A8\u5DF2\u5B89\u88C5\u7684\u667A\u91CF\u901A\u672C\u5730\u56DE\u6D4B runtime\uFF1A\u76F4\u63A5\u542F\u52A8 zltaf/zltaf.exe \u5E76\u7B49\u5F85 ZLTAF \u7BA1\u9053\u53EF\u7528\u3002\u672C\u5DE5\u5177\u4E0D\u4F1A\u542F\u52A8 ZLTHome\u3001ZLTBackService\u3001Code.exe \u6216 jsservice\uFF0C\u4E5F\u4E0D\u8BFB\u53D6 backServiceRun.json\u3002\u5B89\u88C5\u5B8C\u6210\u540E\u5982\u679C backtestReady=false\uFF0C\u5E94\u8C03\u7528 zlt-runtime-install \u4FEE\u590D zltaf\u3001Python/Git \u6216 SDK\uFF1B\u4E0D\u8981\u624B\u52A8\u521B\u5EFA zltaf \u76EE\u5F55\u3002",
24015
+ description: "\u542F\u52A8\u5DF2\u5B89\u88C5\u7684\u667A\u91CF\u901A\u672C\u5730\u56DE\u6D4B runtime\uFF1A\u7ECF\u667A\u80FD\u7BA1\u5BB6\uFF08ZLTHome selfstart\uFF09\u6258\u7BA1\u62C9\u8D77\u5E76\u7B49\u5F85\u5176\u521B\u5EFA\u7684 ZLTAF \u7BA1\u9053\uFF0C\u7EDD\u4E0D\u76F4\u63A5\u542F\u52A8 zltaf.exe\u3002\u672C\u5DE5\u5177\u4E0D\u4F1A\u542F\u52A8 Code.exe \u6216 jsservice\uFF0C\u4E5F\u4E0D\u8BFB\u53D6 backServiceRun.json\u3002\u5B89\u88C5\u5B8C\u6210\u540E\u5982\u679C backtestReady=false\uFF0C\u5E94\u8C03\u7528 zlt-runtime-install \u4FEE\u590D zltaf\u3001Python/Git \u6216 SDK\uFF1B\u4E0D\u8981\u624B\u52A8\u521B\u5EFA zltaf \u76EE\u5F55\u3002",
23852
24016
  inputSchema: {
23853
24017
  type: "object",
23854
24018
  properties: {},
@@ -23858,7 +24022,7 @@ var RUNTIME_TOOLS = [
23858
24022
  },
23859
24023
  {
23860
24024
  name: "zlt-runtime-install",
23861
- description: "\u4E0B\u8F7D\u5E76\u5B89\u88C5\u667A\u91CF\u901A\u672C\u5730 ZLTAF runtime\uFF0C\u6821\u9A8C\u6295\u7814\u6A21\u5757\u4E0B\u53D1\u7684 Python/MinGit \u5DE5\u5177\u94FE\u4E0E zltquant/zltsdk\uFF0C\u5E76\u4EE5 ZLTAF direct mode \u542F\u52A8\u56DE\u6D4B\u670D\u52A1\u3002Python \u4E0E MinGit \u5F52\u6295\u7814\u6A21\u5757\u4E0B\u53D1\uFF0C\u672C\u5DE5\u5177\u53EA\u6821\u9A8C\u3001\u4E0D\u518D\u81EA\u884C\u4E0B\u8F7D\u6216\u4FEE\u590D\u5B83\u4EEC\uFF1A\u7F3A\u5931\u65F6\u4F1A\u660E\u786E\u62A5\u51FA\u300C\u8BF7\u5728\u667A\u80FD\u7BA1\u5BB6\u4E2D\u5B89\u88C5\u6216\u4FEE\u590D\u6295\u7814\u6A21\u5757\u300D\u3002\u8BE5\u64CD\u4F5C\u4F1A\u5199\u5165\u672C\u673A\u78C1\u76D8\u5E76\u53EF\u80FD\u89E6\u53D1 Windows \u5B89\u88C5/UAC\uFF0C\u8C03\u7528\u524D\u5FC5\u987B\u53D6\u5F97\u7528\u6237\u786E\u8BA4\uFF0C\u5E76\u4F20\u5165 confirm=true\u3002\u5B89\u88C5\u5305\u5FC5\u987B\u81EA\u5E26 zltaf\uFF1B\u672C\u5DE5\u5177\u4E0D\u4F1A\u901A\u8FC7 Assistant IPC\u3001ZLTHome \u6216 ZLTBackService \u8865\u88C5\u6A21\u5757\uFF0C\u4E5F\u4E0D\u4F1A\u542F\u52A8 Code.exe/jsservice\u3002",
24025
+ description: "\u4E0B\u8F7D\u5E76\u5B89\u88C5\u667A\u91CF\u901A\u672C\u5730 ZLTAF runtime\uFF0C\u6821\u9A8C\u6295\u7814\u6A21\u5757\u4E0B\u53D1\u7684 Python/MinGit \u5DE5\u5177\u94FE\u4E0E zltquant/zltsdk\uFF0C\u5E76\u7ECF\u667A\u80FD\u7BA1\u5BB6\u6258\u7BA1\u542F\u52A8\u56DE\u6D4B\u670D\u52A1\u3002Python \u4E0E MinGit \u5F52\u6295\u7814\u6A21\u5757\u4E0B\u53D1\uFF0C\u672C\u5DE5\u5177\u53EA\u6821\u9A8C\u3001\u4E0D\u518D\u81EA\u884C\u4E0B\u8F7D\u6216\u4FEE\u590D\u5B83\u4EEC\uFF1A\u7F3A\u5931\u65F6\u4F1A\u660E\u786E\u62A5\u51FA\u300C\u8BF7\u5728\u667A\u80FD\u7BA1\u5BB6\u4E2D\u5B89\u88C5\u6216\u4FEE\u590D\u6295\u7814\u6A21\u5757\u300D\u3002\u8BE5\u64CD\u4F5C\u4F1A\u5199\u5165\u672C\u673A\u78C1\u76D8\u5E76\u53EF\u80FD\u89E6\u53D1 Windows \u5B89\u88C5/UAC\uFF0C\u8C03\u7528\u524D\u5FC5\u987B\u53D6\u5F97\u7528\u6237\u786E\u8BA4\uFF0C\u5E76\u4F20\u5165 confirm=true\u3002\u5B89\u88C5\u5305\u5FC5\u987B\u81EA\u5E26 zltaf\uFF1B\u672C\u5DE5\u5177\u4E0D\u4F1A\u901A\u8FC7 Assistant IPC\u3001ZLTHome \u6216 ZLTBackService \u8865\u88C5\u6A21\u5757\uFF0C\u4E5F\u4E0D\u4F1A\u542F\u52A8 Code.exe/jsservice\u3002",
23862
24026
  inputSchema: {
23863
24027
  type: "object",
23864
24028
  properties: {
@@ -23892,14 +24056,7 @@ async function startMcpServer() {
23892
24056
  ...resolveListedRuntimeTools(RUNTIME_TOOLS, toolProfile),
23893
24057
  ...resolveListedIpcTools(config2.tools, toolProfile)
23894
24058
  ];
23895
- const runtimeConfig = {
23896
- ...loadAssistantRuntimeConfig(resolveDefaultRuntimeConfigPath()),
23897
- zltafConfigFile: ZLTAF_CONFIG_FILE_DAY,
23898
- // Trae/WorkBuddy owns a standalone direct-ZLTAF lane. 智能管家 and its
23899
- // Assistant-managed services belong to the zlt-quant VSCode runtime.
23900
- manualServiceIndices: [],
23901
- startupCheckIndices: []
23902
- };
24059
+ const runtimeConfig = loadAssistantRuntimeConfig(resolveDefaultRuntimeConfigPath());
23903
24060
  let runtimeStartAttempted = false;
23904
24061
  let runtimeLease;
23905
24062
  let leaseStateUpdate = Promise.resolve();
@@ -24118,6 +24275,14 @@ async function startMcpServer() {
24118
24275
  if (runtimeLease) {
24119
24276
  const lease = runtimeLease;
24120
24277
  runtimeLease = void 0;
24278
+ try {
24279
+ const zltContent = await readZltContent(lease.workRoot, runtimeConfig.temporaryZltFile);
24280
+ if (zltContent) await unregisterRuntimeConsumerPid(zltContent, runtimeConfig);
24281
+ process.stderr.write("[zlt-mcp-proxy] runtime PID \u5DF2\u6CE8\u9500\n");
24282
+ } catch (error2) {
24283
+ process.stderr.write(`[zlt-mcp-proxy] runtime PID \u6CE8\u9500\u5931\u8D25\uFF08\u5FFD\u7565\uFF09: ${error2 instanceof Error ? error2.message : String(error2)}
24284
+ `);
24285
+ }
24121
24286
  try {
24122
24287
  const released = await releaseRuntimeLease(lease);
24123
24288
  process.stderr.write(`[zlt-mcp-proxy] runtime lease released: ${released.reason}
@@ -24473,7 +24638,7 @@ function getRuntimeRecommendedAction(runtimeReady, backtestReady) {
24473
24638
  return "call zlt-runtime-install with confirm=true to install the local backtest runtime";
24474
24639
  }
24475
24640
  if (!backtestReady) {
24476
- return "if zltaf is missing, call zlt-runtime-install with confirm=true. Python/Git toolchain and SDK packages come from the \u6295\u7814 module: ask the user to install or repair it in \u667A\u80FD\u7BA1\u5BB6. Then start ZLTAF direct mode.";
24641
+ return "if zltaf is missing, call zlt-runtime-install with confirm=true. Python/Git toolchain and SDK packages come from the \u6295\u7814 module: ask the user to install or repair it in \u667A\u80FD\u7BA1\u5BB6. Then start the managed runtime.";
24477
24642
  }
24478
24643
  return "call zlt-runtime-start before backtest if the ZLTAF pipe is not running";
24479
24644
  }
@@ -24485,10 +24650,10 @@ function getRuntimeStartUserAction(message) {
24485
24650
  return "\u667A\u91CF\u901A\u672C\u5730 ZLTAF runtime \u4E0D\u5B8C\u6574\uFF0C\u672A\u627E\u5230 C:\\ZLTClient\\zltaf\\zltaf.exe\u3002\u8BF7\u53D6\u5F97\u7528\u6237\u786E\u8BA4\u540E\u8C03\u7528 zlt-runtime-install\uFF0C\u4F7F\u7528\u5305\u542B zltaf \u7684\u5B89\u88C5\u5305\u4FEE\u590D\uFF1B\u4E0D\u8981\u624B\u52A8\u521B\u5EFA zltaf \u76EE\u5F55\u3002";
24486
24651
  }
24487
24652
  if (/handshake/i.test(message)) {
24488
- return "\u667A\u91CF\u901A ZLTAF direct mode \u542F\u52A8\u63E1\u624B\u5931\u8D25\u3002\u8BF7\u628A ErrMsg \u548C doctor \u7ED3\u679C\u53CD\u9988\u7ED9\u5F00\u53D1\u8005\u6392\u67E5 ZLTAF \u7BA1\u9053\u534F\u8BAE\uFF1B\u4E0D\u8981\u624B\u52A8\u521B\u5EFA zltaf \u76EE\u5F55\uFF0C\u4E5F\u4E0D\u8981\u542F\u52A8 ZLTHome\u3001ZLTBackService\u3001Code.exe \u6216 jsservice\u3002";
24653
+ return "\u667A\u91CF\u901A\u6258\u7BA1\u542F\u52A8\uFF08ZLTHome selfstart\uFF09\u63E1\u624B\u5931\u8D25\u3002\u8BF7\u628A ErrMsg \u548C doctor \u7ED3\u679C\u53CD\u9988\u7ED9\u5F00\u53D1\u8005\u6392\u67E5 ZLTAF \u7BA1\u9053\u534F\u8BAE\uFF1B\u4E0D\u8981\u624B\u52A8\u521B\u5EFA zltaf \u76EE\u5F55\uFF0C\u4E5F\u4E0D\u8981\u542F\u52A8 ZLTHome\u3001ZLTBackService\u3001Code.exe \u6216 jsservice\u3002";
24489
24654
  }
24490
24655
  if (/pipe|管道|ZLTAF/i.test(message)) {
24491
- return "\u667A\u91CF\u901A ZLTAF \u7BA1\u9053\u4ECD\u4E0D\u53EF\u7528\u3002\u8BF7\u628A ErrMsg\u3001doctor \u7ED3\u679C\u548C zltaf \u65E5\u5FD7\u53CD\u9988\u7ED9\u5F00\u53D1\u8005\u6392\u67E5 ZLTAF direct mode\uFF1B\u4E0D\u8981\u624B\u52A8\u521B\u5EFA zltaf \u76EE\u5F55\uFF0C\u4E5F\u4E0D\u8981\u542F\u52A8 ZLTHome\u3001ZLTBackService\u3001Code.exe \u6216 jsservice\u3002";
24656
+ return "\u667A\u91CF\u901A ZLTAF \u7BA1\u9053\u4ECD\u4E0D\u53EF\u7528\u3002\u8BF7\u628A ErrMsg\u3001doctor \u7ED3\u679C\u548C zltaf \u65E5\u5FD7\u53CD\u9988\u7ED9\u5F00\u53D1\u8005\u6392\u67E5\u6258\u7BA1\u542F\u52A8\u94FE\u8DEF\uFF1B\u4E0D\u8981\u624B\u52A8\u521B\u5EFA zltaf \u76EE\u5F55\uFF0C\u4E5F\u4E0D\u8981\u542F\u52A8 ZLTHome\u3001ZLTBackService\u3001Code.exe \u6216 jsservice\u3002";
24492
24657
  }
24493
24658
  return "\u667A\u91CF\u901A ZLTAF runtime \u542F\u52A8\u5931\u8D25\u3002\u8BF7\u628A ErrMsg \u548C doctor \u7ED3\u679C\u53CD\u9988\u7ED9\u7528\u6237\u6216\u5F00\u53D1\u8005\u6392\u67E5\uFF1B\u4E0D\u8981\u624B\u52A8\u521B\u5EFA zltaf \u76EE\u5F55\u3001\u6740\u8FDB\u7A0B\u3001\u542F\u52A8 ZLTHome/ZLTBackService/Code.exe/jsservice \u6216\u91CD\u590D\u5B89\u88C5 runtime\u3002";
24494
24659
  }
@@ -24502,7 +24667,7 @@ function getRuntimeInstallUserAction(message) {
24502
24667
  if (/handshake|pipe|管道|ZLTAF/i.test(message)) {
24503
24668
  return getRuntimeStartUserAction(message);
24504
24669
  }
24505
- return "\u667A\u91CF\u901A ZLTAF runtime \u5B89\u88C5/\u4FEE\u590D\u5931\u8D25\u3002\u8BF7\u628A ErrMsg \u548C doctor \u7ED3\u679C\u53CD\u9988\u7ED9\u5F00\u53D1\u8005\u6392\u67E5\u5B89\u88C5\u5668\u6216 ZLTAF direct mode\uFF1B\u4E0D\u8981\u624B\u52A8\u521B\u5EFA zltaf \u76EE\u5F55\u3001\u6740\u8FDB\u7A0B\u3001\u542F\u52A8 ZLTHome/ZLTBackService/Code.exe/jsservice \u6216\u91CD\u590D\u5B89\u88C5 runtime\u3002";
24670
+ return "\u667A\u91CF\u901A ZLTAF runtime \u5B89\u88C5/\u4FEE\u590D\u5931\u8D25\u3002\u8BF7\u628A ErrMsg \u548C doctor \u7ED3\u679C\u53CD\u9988\u7ED9\u5F00\u53D1\u8005\u6392\u67E5\u5B89\u88C5\u5668\u6216\u6258\u7BA1\u542F\u52A8\u94FE\u8DEF\uFF1B\u4E0D\u8981\u624B\u52A8\u521B\u5EFA zltaf \u76EE\u5F55\u3001\u6740\u8FDB\u7A0B\u3001\u542F\u52A8 ZLTHome/ZLTBackService/Code.exe/jsservice \u6216\u91CD\u590D\u5B89\u88C5 runtime\u3002";
24506
24671
  }
24507
24672
  function runtimeRecoveryStopData(message, extra = {}, handler = "runtimeStart") {
24508
24673
  return {