@zltquant/zlt-mcp 0.7.0-beta.0 → 0.7.0-beta.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zltquant/zlt-mcp",
3
- "version": "0.7.0-beta.0",
3
+ "version": "0.7.0-beta.1",
4
4
  "description": "智量通 ZLT Quant MCP server(Windows x64;量化策略创建与本地回测)",
5
5
  "bin": {
6
6
  "zlt-mcp": "./zlt-mcp-proxy.bundle.cjs"
@@ -27224,8 +27224,15 @@ async function startMcpServer() {
27224
27224
  const text = result.content?.map((item) => item.type === "text" ? item.text : "").join("\n") ?? "";
27225
27225
  const match = text.match(/"uuid"\s*:\s*"([^"]+)"/);
27226
27226
  if (!match) return;
27227
- leaseStateUpdate = leaseStateUpdate.then(() => updateRuntimeLeaseActiveJob(runtimeLease, `download:${match[1]}`, true)).catch((error2) => {
27227
+ leaseStateUpdate = leaseStateUpdate.then(() => updateRuntimeLeaseActiveJob(runtimeLease, "runtime:explicit-start", false)).then(() => updateRuntimeLeaseActiveJob(runtimeLease, `download:${match[1]}`, true)).catch((error2) => {
27228
27228
  process.stderr.write(`[zlt-mcp-proxy] runtime download lease update failed: ${error2 instanceof Error ? error2.message : String(error2)}
27229
+ `);
27230
+ });
27231
+ };
27232
+ const recordRuntimeKeepalive = (active2) => {
27233
+ if (!runtimeLease) return;
27234
+ leaseStateUpdate = leaseStateUpdate.then(() => updateRuntimeLeaseActiveJob(runtimeLease, "runtime:explicit-start", active2)).catch((error2) => {
27235
+ process.stderr.write(`[zlt-mcp-proxy] runtime keepalive update failed: ${error2 instanceof Error ? error2.message : String(error2)}
27229
27236
  `);
27230
27237
  });
27231
27238
  };
@@ -27341,7 +27348,9 @@ async function startMcpServer() {
27341
27348
  return handleBacktestProfitTool(toolArgs, backtestRunContexts);
27342
27349
  }
27343
27350
  if (tool.localHandler) {
27344
- return handleRuntimeTool(tool.localHandler, toolArgs, runtimeConfig, ensureRuntimeLease, runRuntimeDoctor);
27351
+ const result = await handleRuntimeTool(tool.localHandler, toolArgs, runtimeConfig, ensureRuntimeLease, runRuntimeDoctor);
27352
+ if (tool.localHandler === "runtimeStart" && !result.isError) recordRuntimeKeepalive(true);
27353
+ return result;
27345
27354
  }
27346
27355
  const dangerousToolGuard = guardDangerousTool(tool, toolArgs);
27347
27356
  if (dangerousToolGuard) {