@zltquant/zlt-mcp 0.6.0-beta.2 → 0.6.0-beta.3
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 +1 -7
- package/package.json +1 -1
- package/zlt-mcp-proxy.bundle.cjs +42 -1
package/README.md
CHANGED
|
@@ -59,11 +59,5 @@ npm i @zltquant/zlt-mcp --prefix "$env:USERPROFILE\.zlt-quant" --registry https:
|
|
|
59
59
|
|
|
60
60
|
## 配套技能
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
配套技能统一从 SkillHub 安装 [zlt-quant Skill](https://skillhub.cn/skills/org-gir79457/zlt-quant),用于策略生成、回测执行与验收、结果分析和环境准备。
|
|
63
63
|
|
|
64
|
-
量化技能(策略生成、回测执行与验收、结果分析、装机引导)见 gitee 组合仓,
|
|
65
|
-
克隆后运行 `install.ps1`:
|
|
66
|
-
|
|
67
|
-
```text
|
|
68
|
-
git clone https://gitee.com/shenzhen-zhiliang-tong/zlt-quant
|
|
69
|
-
```
|
package/package.json
CHANGED
package/zlt-mcp-proxy.bundle.cjs
CHANGED
|
@@ -23342,6 +23342,10 @@ function isFuturesRun(marketIds) {
|
|
|
23342
23342
|
}
|
|
23343
23343
|
var identityRepairHint = (data) => data;
|
|
23344
23344
|
function prepareToolCallArgs(tool, args, contexts) {
|
|
23345
|
+
if (tool.name === "mcp-get-data-range") {
|
|
23346
|
+
const invalid = validateDataRangeArguments(args);
|
|
23347
|
+
if (invalid) return invalid;
|
|
23348
|
+
}
|
|
23345
23349
|
const clean = { ...args };
|
|
23346
23350
|
delete clean.__configBaseline;
|
|
23347
23351
|
delete clean.__storedRunParams;
|
|
@@ -23379,6 +23383,36 @@ function prepareToolCallArgs(tool, args, contexts) {
|
|
|
23379
23383
|
}, true);
|
|
23380
23384
|
}
|
|
23381
23385
|
}
|
|
23386
|
+
function validateDataRangeArguments(args) {
|
|
23387
|
+
const errors = [];
|
|
23388
|
+
const error2 = (path16, message) => errors.push({ path: path16, message });
|
|
23389
|
+
const input = stripControlParams(args);
|
|
23390
|
+
for (const key of Object.keys(input)) {
|
|
23391
|
+
if (key !== "params") error2(`$.${key}`, "Unsupported top-level field; query combinations belong in params[]. Date filters are not accepted.");
|
|
23392
|
+
}
|
|
23393
|
+
if (input.params !== void 0) {
|
|
23394
|
+
if (!Array.isArray(input.params)) error2("$.params", "Expected an array of query objects; omit params to use default queries.");
|
|
23395
|
+
else input.params.forEach((item, index) => {
|
|
23396
|
+
const location = `$.params[${index}]`;
|
|
23397
|
+
if (!isRecord2(item)) {
|
|
23398
|
+
error2(location, "Expected a query object.");
|
|
23399
|
+
return;
|
|
23400
|
+
}
|
|
23401
|
+
for (const key of Object.keys(item)) {
|
|
23402
|
+
if (key !== "data_type" && key !== "exchange_id") error2(`${location}.${key}`, "Unsupported query field; use data_type and optional exchange_id.");
|
|
23403
|
+
}
|
|
23404
|
+
if (typeof item.data_type !== "string") error2(`${location}.data_type`, "Required string data_type is missing or has the wrong type.");
|
|
23405
|
+
if (item.exchange_id !== void 0 && typeof item.exchange_id !== "string") error2(`${location}.exchange_id`, "Expected a string exchange_id.");
|
|
23406
|
+
});
|
|
23407
|
+
}
|
|
23408
|
+
return errors.length ? jsonToolResult(10064, "\u6570\u636E\u8303\u56F4\u67E5\u8BE2\u53C2\u6570\u7ED3\u6784\u9519\u8BEF\uFF0C\u5C1A\u672A\u8C03\u7528\u6570\u636E\u670D\u52A1", {
|
|
23409
|
+
reasonCode: "invalid-tool-arguments",
|
|
23410
|
+
toolExecution: "not_started",
|
|
23411
|
+
errors,
|
|
23412
|
+
example: { params: [{ exchange_id: "sz", data_type: "dk1" }] },
|
|
23413
|
+
action: "Correct the argument object using the field paths above. CLI: pass the object with --args-json or --args-file; use list --tool mcp-get-data-range --json for the schema."
|
|
23414
|
+
}, true) : null;
|
|
23415
|
+
}
|
|
23382
23416
|
function prepareToolArgs(tool, args, contexts) {
|
|
23383
23417
|
const inherited = inheritReBacktestRunParams(tool, args, contexts);
|
|
23384
23418
|
const dated = applyBacktestDateDefaults(tool, inherited);
|
|
@@ -27710,7 +27744,14 @@ if (process.argv.length <= 2) {
|
|
|
27710
27744
|
if (kind !== "backtest") throw new Error(`Unsupported keepalive kind: ${kind}`);
|
|
27711
27745
|
await keepMcpBacktestAlive(id, codePath);
|
|
27712
27746
|
});
|
|
27713
|
-
program2.command("call <tool>").description("Call any MCP tool through the bundled MCP server").
|
|
27747
|
+
program2.command("call <tool>").description("Call any MCP tool through the bundled MCP server").configureOutput({
|
|
27748
|
+
outputError: (message, write) => {
|
|
27749
|
+
write(message);
|
|
27750
|
+
if (message.includes("unknown option")) {
|
|
27751
|
+
write("CLI argument error: toolExecution=not_started; no tool was called. Tool fields belong inside one JSON object passed to --args-json (or --args-file), not --flags or key=value arguments. Use call --help and list --tool <tool-name> --json, correct the arguments, then retry.\n");
|
|
27752
|
+
}
|
|
27753
|
+
}
|
|
27754
|
+
}).option("--args-json <json>", "JSON object containing tool arguments").option("--args-file <path>", "Read the JSON argument object from a file").option("--output-json <path>", "Save the complete result to a new JSON file and print a compact receipt").option("--timeout-ms <ms>", "MCP request inactivity timeout in milliseconds").option("--max-total-timeout-ms <ms>", "Optional hard upper bound for the request").option("--no-progress", "Suppress progress diagnostics on stderr").addHelpText("after", `
|
|
27714
27755
|
Input: omitted arguments mean {}; use --args-json for small objects and --args-file
|
|
27715
27756
|
for nested configuration or shell-sensitive text. Follow the selected tool schema
|
|
27716
27757
|
from list --tool <name> --json. Windows paths must be native paths (C:/...), not /c/....
|