@zltquant/zlt-mcp 0.8.0-dev.19544.1 → 0.8.0-dev.19544.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 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.1 runtime install
23
+ npx -y @zltquant/zlt-mcp@0.8.0-dev.19544.3 runtime install
24
24
  ```
25
25
 
26
26
  核对返回的版本、下载量和安装目录后,明确确认安装:
27
27
 
28
28
  ```powershell
29
- npx -y @zltquant/zlt-mcp@0.8.0-dev.19544.1 runtime install --confirm
29
+ npx -y @zltquant/zlt-mcp@0.8.0-dev.19544.3 runtime install --confirm
30
30
  ```
31
31
 
32
32
  确认命令返回安装任务 ID 和下一步等待命令。用返回的任务 ID 调用
33
- `npx -y @zltquant/zlt-mcp@0.8.0-dev.19544.1 call mcp-wait --args-json '{"kind":"install","id":"<返回的任务 ID>"}'`
34
- 直至任务完成;随后运行 `npx -y @zltquant/zlt-mcp@0.8.0-dev.19544.1 runtime list` 查看安装与工作区。
33
+ `npx -y @zltquant/zlt-mcp@0.8.0-dev.19544.3 call mcp-wait --args-json '{"kind":"install","id":"<返回的任务 ID>"}'`
34
+ 直至任务完成;随后运行 `npx -y @zltquant/zlt-mcp@0.8.0-dev.19544.3 runtime list` 查看安装与工作区。
35
35
  需要设为新进程的默认工作区时,从列表中选择正确的 ID,再运行
36
- `npx -y @zltquant/zlt-mcp@0.8.0-dev.19544.1 runtime select --workspace-id '<列表中的工作区 ID>'`。
36
+ `npx -y @zltquant/zlt-mcp@0.8.0-dev.19544.3 runtime select --workspace-id '<列表中的工作区 ID>'`。
37
37
 
38
38
  ## 接入
39
39
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zltquant/zlt-mcp",
3
- "version": "0.8.0-dev.19544.1",
3
+ "version": "0.8.0-dev.19544.3",
4
4
  "zltAgentContract": {
5
5
  "packageName": "@zltquant/zlt-mcp",
6
6
  "contractVersion": 1,
@@ -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 query = { type: "object", description: "FinORM query DSL object. Discover table query-spec first; arbitrary SQL is not supported." };
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") {
@@ -42559,7 +42592,7 @@ var RUNTIME_TOOLS = [
42559
42592
  },
42560
42593
  {
42561
42594
  name: "zlt-runtime-install",
42562
- description: "\u5B89\u88C5\u667A\u91CF\u901A\u672C\u5730 runtime\u3002\u9ED8\u8BA4 Assistant \u5B89\u88C5\u4F1A\u4E0B\u8F7D\u56FA\u5B9A\u5B89\u88C5\u5305\u5E76\u6821\u9A8C\u6295\u7814\u6A21\u5757\u4E0B\u53D1\u7684 Python/MinGit \u4E0E zltquant/zltsdk\uFF1BClientLite \u4EC5\u63A5\u53D7\u64CD\u4F5C\u5458\u9884\u914D\u7F6E\u7684\u672C\u5730\u79BB\u7EBF\u9A8C\u8BC1\u8F93\u5165\uFF0C\u5728\u5168\u65B0\u76EE\u5F55\u51C6\u5907\u72EC\u7ACB Python \u548C ZLTHost \u2192 ZLTAF\uFF0C\u4E0D\u5207\u6362\u5F53\u524D\u5B89\u88C5\u3002\u4EE5\u4E0B\u6295\u7814\u6A21\u5757\u7EA6\u675F\u4EC5\u9002\u7528\u4E8E Assistant\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",
42595
+ description: "\u5B89\u88C5\u667A\u91CF\u901A\u672C\u5730 runtime\u3002\u5148\u6309\u7528\u6237\u9009\u62E9\u533A\u5206\u5B89\u88C5\u7C7B\u578B\uFF1A\u7701\u7565 installType \u65F6\u9ED8\u8BA4 Assistant \u667A\u80FD\u7BA1\u5BB6\uFF1B\u72EC\u7ACB ClientLite \u5FC5\u987B\u4F20 installType=clientlite\uFF0C\u4ECE\u5F53\u524D CLI \u5185\u5D4C\u7684\u7CBE\u786E\u516C\u5F00\u53D1\u884C\u8BB0\u5F55\u4E0B\u8F7D\u5E76\u6821\u9A8C native\u3001SDK \u4E0E\u6240\u9700 Python/MinGit\uFF0C\u5728\u5168\u65B0\u76EE\u5F55\u51C6\u5907 ZLTHost \u2192 ZLTAF\uFF0C\u5B8C\u6210\u540E\u663E\u5F0F\u9009\u62E9\u5DE5\u4F5C\u533A\uFF0C\u4E0D\u5207\u6362\u5DF2\u6709\u8FDB\u7A0B\u3002\u53EA\u6709\u64CD\u4F5C\u5458\u663E\u5F0F\u914D\u7F6E\u79BB\u7EBF\u9A8C\u8BC1\u8F93\u5165\u65F6\u624D\u8D70\u672C\u5730\u8D44\u683C\u68C0\u67E5\u3002\u4EE5\u4E0B\u6295\u7814\u6A21\u5757\u7EA6\u675F\u4EC5\u9002\u7528\u4E8E Assistant\uFF1APython \u4E0E MinGit \u7531\u6295\u7814\u6A21\u5757\u4E0B\u53D1\uFF0C\u672C\u5DE5\u5177\u53EA\u6821\u9A8C\uFF0C\u7F3A\u5931\u65F6\u62A5\u300C\u8BF7\u5728\u667A\u80FD\u7BA1\u5BB6\u4E2D\u5B89\u88C5\u6216\u4FEE\u590D\u6295\u7814\u6A21\u5757\u300D\uFF1B\u5B89\u88C5\u5305\u5FC5\u987B\u81EA\u5E26 zltaf\uFF0C\u4E0D\u901A\u8FC7 Assistant IPC\u3001ZLTHome \u6216 ZLTBackService \u8865\u88C5\u6A21\u5757\uFF0C\u4E5F\u4E0D\u542F\u52A8 Code.exe/jsservice\u3002\u5B89\u88C5\u4F1A\u4E0B\u8F7D\u6587\u4EF6\u3001\u5199\u5165\u672C\u673A\u78C1\u76D8\uFF0CAssistant \u53EF\u80FD\u89E6\u53D1 Windows \u5B89\u88C5/UAC\uFF1B\u8C03\u7528\u524D\u987B\u53D6\u5F97\u7528\u6237\u786E\u8BA4\u5E76\u4F20 confirm=true\u3002",
42563
42596
  inputSchema: {
42564
42597
  type: "object",
42565
42598
  properties: {