@zltquant/zlt-mcp 0.8.0-dev.19544.1 → 0.8.0-dev.19544.2
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 -5
- package/package.json +1 -1
- package/zlt-mcp-proxy.bundle.cjs +37 -4
package/README.md
CHANGED
|
@@ -20,20 +20,20 @@ Python SDK 从 Python 包源下载,固定版本和 SHA-256,安装在独立
|
|
|
20
20
|
在 PowerShell 中使用本版 CLI 预览安装内容。预览不下载或安装:
|
|
21
21
|
|
|
22
22
|
```powershell
|
|
23
|
-
npx -y @zltquant/zlt-mcp@0.8.0-dev.19544.
|
|
23
|
+
npx -y @zltquant/zlt-mcp@0.8.0-dev.19544.2 runtime install
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
核对返回的版本、下载量和安装目录后,明确确认安装:
|
|
27
27
|
|
|
28
28
|
```powershell
|
|
29
|
-
npx -y @zltquant/zlt-mcp@0.8.0-dev.19544.
|
|
29
|
+
npx -y @zltquant/zlt-mcp@0.8.0-dev.19544.2 runtime install --confirm
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
确认命令返回安装任务 ID 和下一步等待命令。用返回的任务 ID 调用
|
|
33
|
-
`npx -y @zltquant/zlt-mcp@0.8.0-dev.19544.
|
|
34
|
-
直至任务完成;随后运行 `npx -y @zltquant/zlt-mcp@0.8.0-dev.19544.
|
|
33
|
+
`npx -y @zltquant/zlt-mcp@0.8.0-dev.19544.2 call mcp-wait --args-json '{"kind":"install","id":"<返回的任务 ID>"}'`
|
|
34
|
+
直至任务完成;随后运行 `npx -y @zltquant/zlt-mcp@0.8.0-dev.19544.2 runtime list` 查看安装与工作区。
|
|
35
35
|
需要设为新进程的默认工作区时,从列表中选择正确的 ID,再运行
|
|
36
|
-
`npx -y @zltquant/zlt-mcp@0.8.0-dev.19544.
|
|
36
|
+
`npx -y @zltquant/zlt-mcp@0.8.0-dev.19544.2 runtime select --workspace-id '<列表中的工作区 ID>'`。
|
|
37
37
|
|
|
38
38
|
## 接入
|
|
39
39
|
|
package/package.json
CHANGED
package/zlt-mcp-proxy.bundle.cjs
CHANGED
|
@@ -41687,7 +41687,37 @@ function redactResponse(result, key) {
|
|
|
41687
41687
|
}
|
|
41688
41688
|
var schema = (properties2, required2 = []) => ({ type: "object", properties: properties2, required: required2, additionalProperties: false });
|
|
41689
41689
|
var text2 = { type: "string", minLength: 1 };
|
|
41690
|
-
var
|
|
41690
|
+
var queryText = { ...text2, pattern: "\\S" };
|
|
41691
|
+
var query = {
|
|
41692
|
+
...schema({
|
|
41693
|
+
table: queryText,
|
|
41694
|
+
alias: queryText,
|
|
41695
|
+
symbols: { type: "array", items: queryText },
|
|
41696
|
+
start_date: queryText,
|
|
41697
|
+
end_date: queryText,
|
|
41698
|
+
fields: { type: "array", items: {}, description: "Select actual fields or structured expressions supported by the table metadata." },
|
|
41699
|
+
filters: {
|
|
41700
|
+
type: "object",
|
|
41701
|
+
additionalProperties: true,
|
|
41702
|
+
description: "Simple equality: an object mapping actual field names to values. Not an array of conditions."
|
|
41703
|
+
},
|
|
41704
|
+
filter_expr: {
|
|
41705
|
+
type: "object",
|
|
41706
|
+
additionalProperties: true,
|
|
41707
|
+
description: "Structured condition object: field, op, value. For example op=eq with one value or op=in with an array value. This is distinct from the filters field-to-value map."
|
|
41708
|
+
},
|
|
41709
|
+
joins: { type: "array", items: { type: "object" }, description: "Structured joins supported by catalog relationships; preserve the upstream join contract." },
|
|
41710
|
+
order_by: { type: "array", items: {}, description: "Sort fields or structured ordering supported by the table query-spec." },
|
|
41711
|
+
limit: { type: "integer", minimum: 1, maximum: 1e5 },
|
|
41712
|
+
format: { type: "string", const: "json" }
|
|
41713
|
+
}, ["table"]),
|
|
41714
|
+
description: "FinORM query DSL. Read describe_table and query-spec for actual fields, entities, time-axis semantics and constraints. Only these envelope keys are supported; SQL, where, conditions and filter are not accepted."
|
|
41715
|
+
};
|
|
41716
|
+
var validateQuery = new AjvJsonSchemaValidator().getValidator(query);
|
|
41717
|
+
var invalidQueryContext = {
|
|
41718
|
+
valid: false,
|
|
41719
|
+
errors: [{ code: "INVALID_QUERY_DSL", message: "Use query.table and only the advertised DSL properties. filters must be a field-to-value object; filter_expr must be a structured condition object. Read this tool inputSchema and the table query-spec before retrying." }]
|
|
41720
|
+
};
|
|
41691
41721
|
var FINORM_TOOLS = [
|
|
41692
41722
|
{ name: "finorm_list_categories", description: "List FinORM data categories.", inputSchema: schema({}) },
|
|
41693
41723
|
{ name: "finorm_list_tables", description: "Discover FinORM tables by category or keyword.", inputSchema: schema({ category: text2, keyword: text2 }) },
|
|
@@ -41740,6 +41770,12 @@ var FinormClient = class {
|
|
|
41740
41770
|
if (key !== "query" && (typeof value !== "string" || !value.trim() || value.length > 512)) throw new FinormError("invalid-arguments");
|
|
41741
41771
|
}
|
|
41742
41772
|
if (args.table === "." || args.table === "..") throw new FinormError("invalid-arguments");
|
|
41773
|
+
if (name === "finorm_validate_query" || name === "finorm_run_query") {
|
|
41774
|
+
if (!object4(args.query)) throw new FinormError("invalid-query", void 0, void 0, void 0, invalidQueryContext);
|
|
41775
|
+
if ("format" in args.query && args.query.format !== "json") throw new FinormError("unsupported-format");
|
|
41776
|
+
if ("limit" in args.query && (!Number.isSafeInteger(args.query.limit) || args.query.limit < 1 || args.query.limit > 1e5)) throw new FinormError("invalid-limit");
|
|
41777
|
+
if (!validateQuery(args.query).valid) throw new FinormError("invalid-query", void 0, void 0, void 0, invalidQueryContext);
|
|
41778
|
+
}
|
|
41743
41779
|
const controller = new AbortController();
|
|
41744
41780
|
const timer = setTimeout(() => controller.abort(), TIMEOUT_MS);
|
|
41745
41781
|
const combined = signal ? AbortSignal.any([signal, controller.signal]) : controller.signal;
|
|
@@ -41782,13 +41818,10 @@ var FinormClient = class {
|
|
|
41782
41818
|
result = await request3("/tables/" + encodeURIComponent(args.table) + "/query-spec", void 0, combined);
|
|
41783
41819
|
break;
|
|
41784
41820
|
default: {
|
|
41785
|
-
if (!object4(args.query) || "sql" in args.query) throw new FinormError("invalid-query");
|
|
41786
41821
|
const body = { ...args.query };
|
|
41787
41822
|
if (body.format === void 0) body.format = "json";
|
|
41788
|
-
if (body.format !== "json") throw new FinormError("unsupported-format");
|
|
41789
41823
|
if (name === "finorm_run_query") {
|
|
41790
41824
|
if (body.limit === void 0) body.limit = 100;
|
|
41791
|
-
if (!Number.isSafeInteger(body.limit) || body.limit < 1 || body.limit > 1e5) throw new FinormError("invalid-limit");
|
|
41792
41825
|
}
|
|
41793
41826
|
result = await request3("/query/validate", body, combined);
|
|
41794
41827
|
if (name === "finorm_run_query") {
|