@8btc/finance-assistant-mcp 0.0.57 → 0.0.59

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.
Files changed (2) hide show
  1. package/dist/index.cjs +637 -594
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -9,6 +9,7 @@ const sse_js = require("@modelcontextprotocol/sdk/server/sse.js");
9
9
  const express = require("express");
10
10
  const streamableHttp_js = require("@modelcontextprotocol/sdk/server/streamableHttp.js");
11
11
  const cors = require("cors");
12
+ const z = require("zod");
12
13
  const jsxRuntime = require("react/jsx-runtime");
13
14
  const ReactDOMServer = require("react-dom/server");
14
15
  const echarts = require("echarts");
@@ -17,7 +18,6 @@ const tailwindMerge = require("tailwind-merge");
17
18
  const dayjs = require("dayjs");
18
19
  const react = require("react");
19
20
  const qrcode_react = require("qrcode.react");
20
- const zod = require("zod");
21
21
  const winston = require("winston");
22
22
  const zodToJsonSchema$1 = require("zod-to-json-schema");
23
23
  const fs = require("fs");
@@ -45,7 +45,7 @@ function _interopNamespaceDefault(e) {
45
45
  }
46
46
  const echarts__namespace = /* @__PURE__ */ _interopNamespaceDefault(echarts);
47
47
  const d3__namespace = /* @__PURE__ */ _interopNamespaceDefault(d3);
48
- const version = "0.0.57";
48
+ const version = "0.0.59";
49
49
  const pkgJSON = {
50
50
  version
51
51
  };
@@ -1017,6 +1017,7 @@ function Chapter7$2({ data }) {
1017
1017
  ] })
1018
1018
  ] });
1019
1019
  }
1020
+ const END_COVER_LINK = "https://www.wujieai.com/";
1020
1021
  function End$5({ data }) {
1021
1022
  return /* @__PURE__ */ jsxRuntime.jsxs(
1022
1023
  "div",
@@ -1028,7 +1029,7 @@ function End$5({ data }) {
1028
1029
  children: [
1029
1030
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-0 left-0 right-0 bottom-0 z-0", children: /* @__PURE__ */ jsxRuntime.jsx("img", { className: "block w-full h-full object-cover", src: bg$4, alt: "" }) }),
1030
1031
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center w-[500px] mx-auto relative z-10", children: [
1031
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-white p-3 mb-[50px]", children: /* @__PURE__ */ jsxRuntime.jsx(qrcode_react.QRCodeSVG, { value: "https://reactjs.org/", size: 150 }) }),
1032
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-white p-3 mb-[50px]", children: /* @__PURE__ */ jsxRuntime.jsx(qrcode_react.QRCodeSVG, { value: END_COVER_LINK, size: 150 }) }),
1032
1033
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[18px] font-bold mb-3 fontsongti", children: "本报告由 Wujie Agent 生成" }),
1033
1034
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-[13px] tracking-[0.529px] leading-[1.5] mb-1 w-[456px]", children: [
1034
1035
  "本报告基于互联网公开信息及舆情大数据模型生成,旨在通过统计学维度量化",
@@ -1326,169 +1327,169 @@ const renderChapter7$2 = (data) => {
1326
1327
  const seg = ReactDOMServer.renderToString(/* @__PURE__ */ jsxRuntime.jsx(Chapter7$2, { data }));
1327
1328
  return renderFullHtml(seg);
1328
1329
  };
1329
- const top_news = zod.z.array(
1330
- zod.z.object({
1331
- title: zod.z.string().describe("新闻标题"),
1332
- link: zod.z.string().describe("新闻链接"),
1333
- content: zod.z.string().describe("新闻内容,大模型访问链接获得"),
1334
- summary: zod.z.string().describe("新闻总结,大模型总结"),
1335
- timestamp: zod.z.number().describe("时间戳"),
1336
- source: zod.z.string().describe("新闻源"),
1337
- tag: zod.z.array(zod.z.string()).describe("新闻标签"),
1338
- insight: zod.z.string().describe("详细解读。大模型总结")
1330
+ const top_news = z.z.array(
1331
+ z.z.object({
1332
+ title: z.z.string().describe("新闻标题"),
1333
+ link: z.z.string().describe("新闻链接"),
1334
+ content: z.z.string().describe("新闻内容,大模型访问链接获得"),
1335
+ summary: z.z.string().describe("新闻总结,大模型总结"),
1336
+ timestamp: z.z.number().describe("时间戳"),
1337
+ source: z.z.string().describe("新闻源"),
1338
+ tag: z.z.array(z.z.string()).describe("新闻标签"),
1339
+ insight: z.z.string().describe("详细解读。大模型总结")
1339
1340
  }).describe("最热新闻")
1340
1341
  );
1341
1342
  const newsSchema = {
1342
- report_type: zod.z.enum(["market", "industry", "stock"]),
1343
- report_time: zod.z.string().describe("报告时间"),
1344
- data_period_start: zod.z.string().describe("数据开始时间"),
1345
- data_period_end: zod.z.string().describe("数据结束时间}"),
1346
- overview: zod.z.string().describe("总体描述,大模型总结"),
1347
- opportunities_and_risks: zod.z.string().describe("机会与风险,大模型总结"),
1348
- focus_points: zod.z.string().describe("关注点,大模型总结"),
1349
- risk_factors: zod.z.string().describe("风险点,大模型总结"),
1343
+ report_type: z.z.enum(["market", "industry", "stock"]),
1344
+ report_time: z.z.string().describe("报告时间"),
1345
+ data_period_start: z.z.string().describe("数据开始时间"),
1346
+ data_period_end: z.z.string().describe("数据结束时间}"),
1347
+ overview: z.z.string().describe("总体描述,大模型总结"),
1348
+ opportunities_and_risks: z.z.string().describe("机会与风险,大模型总结"),
1349
+ focus_points: z.z.string().describe("关注点,大模型总结"),
1350
+ risk_factors: z.z.string().describe("风险点,大模型总结"),
1350
1351
  top_news,
1351
- news_statistics: zod.z.object({
1352
- summary: zod.z.string().describe("总结"),
1353
- news_count_12h: zod.z.number(),
1354
- news_count_24h: zod.z.number(),
1355
- total_news_count: zod.z.number(),
1356
- keywords: zod.z.array(zod.z.string()).describe("关键字"),
1357
- heat_index: zod.z.number(),
1358
- heat_comment: zod.z.string().describe("热度描述"),
1359
- social_media_summary: zod.z.string().describe("社交数据总结"),
1360
- sentiment_distribution: zod.z.object({
1361
- negative_pct: zod.z.object({
1362
- value: zod.z.number(),
1363
- comment: zod.z.string().describe("描述")
1352
+ news_statistics: z.z.object({
1353
+ summary: z.z.string().describe("总结"),
1354
+ news_count_12h: z.z.number(),
1355
+ news_count_24h: z.z.number(),
1356
+ total_news_count: z.z.number(),
1357
+ keywords: z.z.array(z.z.string()).describe("关键字"),
1358
+ heat_index: z.z.number(),
1359
+ heat_comment: z.z.string().describe("热度描述"),
1360
+ social_media_summary: z.z.string().describe("社交数据总结"),
1361
+ sentiment_distribution: z.z.object({
1362
+ negative_pct: z.z.object({
1363
+ value: z.z.number(),
1364
+ comment: z.z.string().describe("描述")
1364
1365
  }),
1365
- neutral_pct: zod.z.object({
1366
- value: zod.z.number(),
1367
- comment: zod.z.string().describe("描述")
1366
+ neutral_pct: z.z.object({
1367
+ value: z.z.number(),
1368
+ comment: z.z.string().describe("描述")
1368
1369
  }),
1369
- positive_pct: zod.z.object({
1370
- value: zod.z.number(),
1371
- comment: zod.z.string().describe("描述")
1370
+ positive_pct: z.z.object({
1371
+ value: z.z.number(),
1372
+ comment: z.z.string().describe("描述")
1372
1373
  })
1373
1374
  })
1374
1375
  }),
1375
- market_sentiment: zod.z.object({
1376
- value: zod.z.number(),
1377
- comment: zod.z.string()
1376
+ market_sentiment: z.z.object({
1377
+ value: z.z.number(),
1378
+ comment: z.z.string()
1378
1379
  }).optional(),
1379
- stock_sentiment: zod.z.object({
1380
- value: zod.z.number(),
1381
- comment: zod.z.string()
1380
+ stock_sentiment: z.z.object({
1381
+ value: z.z.number(),
1382
+ comment: z.z.string()
1382
1383
  }).optional(),
1383
- industry_sentiment: zod.z.object({
1384
- value: zod.z.number(),
1385
- comment: zod.z.string()
1384
+ industry_sentiment: z.z.object({
1385
+ value: z.z.number(),
1386
+ comment: z.z.string()
1386
1387
  }).optional(),
1387
- market: zod.z.object({
1388
- industry_impact: zod.z.object({
1389
- bullish_industries: zod.z.array(
1390
- zod.z.object({
1391
- sector: zod.z.string(),
1392
- score: zod.z.number(),
1393
- reason: zod.z.string()
1388
+ market: z.z.object({
1389
+ industry_impact: z.z.object({
1390
+ bullish_industries: z.z.array(
1391
+ z.z.object({
1392
+ sector: z.z.string(),
1393
+ score: z.z.number(),
1394
+ reason: z.z.string()
1394
1395
  })
1395
1396
  ),
1396
- bearish_industries: zod.z.array(
1397
- zod.z.object({
1398
- sector: zod.z.string(),
1399
- score: zod.z.number(),
1400
- reason: zod.z.string()
1397
+ bearish_industries: z.z.array(
1398
+ z.z.object({
1399
+ sector: z.z.string(),
1400
+ score: z.z.number(),
1401
+ reason: z.z.string()
1401
1402
  })
1402
1403
  )
1403
1404
  }),
1404
- asset_class_impact: zod.z.object({
1405
- a_share: zod.z.object({
1406
- impact: zod.z.string(),
1407
- performance: zod.z.string(),
1408
- reason: zod.z.string()
1405
+ asset_class_impact: z.z.object({
1406
+ a_share: z.z.object({
1407
+ impact: z.z.string(),
1408
+ performance: z.z.string(),
1409
+ reason: z.z.string()
1409
1410
  }),
1410
- hk_share: zod.z.object({
1411
- impact: zod.z.string(),
1412
- performance: zod.z.string(),
1413
- reason: zod.z.string()
1411
+ hk_share: z.z.object({
1412
+ impact: z.z.string(),
1413
+ performance: z.z.string(),
1414
+ reason: z.z.string()
1414
1415
  }),
1415
- us_share: zod.z.object({
1416
- impact: zod.z.string(),
1417
- performance: zod.z.string(),
1418
- reason: zod.z.string()
1416
+ us_share: z.z.object({
1417
+ impact: z.z.string(),
1418
+ performance: z.z.string(),
1419
+ reason: z.z.string()
1419
1420
  })
1420
1421
  })
1421
1422
  }),
1422
- industry: zod.z.object({
1423
- subsector_impact: zod.z.object({
1424
- bullish_subsectors: zod.z.array(
1425
- zod.z.object({
1426
- subsector: zod.z.string(),
1427
- score: zod.z.number(),
1428
- reason: zod.z.string()
1423
+ industry: z.z.object({
1424
+ subsector_impact: z.z.object({
1425
+ bullish_subsectors: z.z.array(
1426
+ z.z.object({
1427
+ subsector: z.z.string(),
1428
+ score: z.z.number(),
1429
+ reason: z.z.string()
1429
1430
  })
1430
1431
  ),
1431
- bearish_subsectors: zod.z.array(
1432
- zod.z.object({
1433
- subsector: zod.z.string(),
1434
- score: zod.z.number(),
1435
- reason: zod.z.string()
1432
+ bearish_subsectors: z.z.array(
1433
+ z.z.object({
1434
+ subsector: z.z.string(),
1435
+ score: z.z.number(),
1436
+ reason: z.z.string()
1436
1437
  })
1437
1438
  )
1438
1439
  }),
1439
- industry_asset_linkage: zod.z.object({
1440
- a_share: zod.z.object({
1441
- impact: zod.z.string(),
1442
- industry_performance: zod.z.string(),
1443
- reason: zod.z.string()
1440
+ industry_asset_linkage: z.z.object({
1441
+ a_share: z.z.object({
1442
+ impact: z.z.string(),
1443
+ industry_performance: z.z.string(),
1444
+ reason: z.z.string()
1444
1445
  }),
1445
- hk_share: zod.z.object({
1446
- impact: zod.z.string(),
1447
- industry_performance: zod.z.string(),
1448
- reason: zod.z.string()
1446
+ hk_share: z.z.object({
1447
+ impact: z.z.string(),
1448
+ industry_performance: z.z.string(),
1449
+ reason: z.z.string()
1449
1450
  }),
1450
- us_share: zod.z.object({
1451
- impact: zod.z.string(),
1452
- industry_performance: zod.z.string(),
1453
- reason: zod.z.string()
1451
+ us_share: z.z.object({
1452
+ impact: z.z.string(),
1453
+ industry_performance: z.z.string(),
1454
+ reason: z.z.string()
1454
1455
  })
1455
1456
  })
1456
1457
  }),
1457
- professional_insights: zod.z.array(
1458
- zod.z.object({
1459
- message: zod.z.string(),
1460
- weight: zod.z.string(),
1461
- comment: zod.z.string()
1458
+ professional_insights: z.z.array(
1459
+ z.z.object({
1460
+ message: z.z.string(),
1461
+ weight: z.z.string(),
1462
+ comment: z.z.string()
1462
1463
  })
1463
1464
  ),
1464
- capital_flows: zod.z.object({
1465
- northbound_comment: zod.z.string(),
1466
- southbound_comment: zod.z.string(),
1467
- industry_flow_comment: zod.z.string()
1465
+ capital_flows: z.z.object({
1466
+ northbound_comment: z.z.string(),
1467
+ southbound_comment: z.z.string(),
1468
+ industry_flow_comment: z.z.string()
1468
1469
  }),
1469
- expectation_analysis: zod.z.object({
1470
- historical_analogy: zod.z.string(),
1471
- domestic_expectation: zod.z.string(),
1472
- overseas_expectation: zod.z.string(),
1473
- global_market_linkage: zod.z.object({
1474
- usa: zod.z.string(),
1475
- europe: zod.z.string(),
1476
- asia: zod.z.string()
1470
+ expectation_analysis: z.z.object({
1471
+ historical_analogy: z.z.string(),
1472
+ domestic_expectation: z.z.string(),
1473
+ overseas_expectation: z.z.string(),
1474
+ global_market_linkage: z.z.object({
1475
+ usa: z.z.string(),
1476
+ europe: z.z.string(),
1477
+ asia: z.z.string()
1477
1478
  })
1478
1479
  }),
1479
- summary: zod.z.object({
1480
- general_comment: zod.z.string(),
1481
- policy_comment: zod.z.string(),
1482
- fundamental_comment: zod.z.string(),
1483
- strategy_suggestion: zod.z.string()
1480
+ summary: z.z.object({
1481
+ general_comment: z.z.string(),
1482
+ policy_comment: z.z.string(),
1483
+ fundamental_comment: z.z.string(),
1484
+ strategy_suggestion: z.z.string()
1484
1485
  }),
1485
- risk_summary: zod.z.object({
1486
- macro_risk: zod.z.string(),
1487
- policy_risk: zod.z.string(),
1488
- inflation_risk: zod.z.string()
1486
+ risk_summary: z.z.object({
1487
+ macro_risk: z.z.string(),
1488
+ policy_risk: z.z.string(),
1489
+ inflation_risk: z.z.string()
1489
1490
  })
1490
1491
  };
1491
- zod.z.object({
1492
+ z.z.object({
1492
1493
  ...newsSchema
1493
1494
  });
1494
1495
  const logger = winston.createLogger({
@@ -1512,7 +1513,7 @@ const logger = winston.createLogger({
1512
1513
  ]
1513
1514
  });
1514
1515
  const zodToJsonSchema = (schema) => {
1515
- return zodToJsonSchema$1.zodToJsonSchema(zod.z.object(schema), {
1516
+ return zodToJsonSchema$1.zodToJsonSchema(z.z.object(schema), {
1516
1517
  rejectedAdditionalProperties: void 0,
1517
1518
  $refStrategy: "none"
1518
1519
  });
@@ -1814,6 +1815,13 @@ const tool$5 = {
1814
1815
  };
1815
1816
  const toolHandler$5 = async (args) => {
1816
1817
  try {
1818
+ const result = z.object(newsSchema).safeParse(args);
1819
+ if (!result.success) {
1820
+ throw new types_js.McpError(
1821
+ types_js.ErrorCode.InvalidParams,
1822
+ `Invalid parameters: ${result.error.message}`
1823
+ );
1824
+ }
1817
1825
  logger.info(`start: ${(/* @__PURE__ */ new Date()).getTime()}`);
1818
1826
  logger.info(args);
1819
1827
  const resp = generateFinancialNewsHtml({
@@ -2554,7 +2562,7 @@ function End$4({ data }) {
2554
2562
  children: [
2555
2563
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-0 left-0 right-0 bottom-0 z-0", children: /* @__PURE__ */ jsxRuntime.jsx("img", { className: "block w-full h-full object-cover", src: bg$3, alt: "" }) }),
2556
2564
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center w-[414px] mx-auto relative z-10", children: [
2557
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-white p-3 mb-[50px]", children: /* @__PURE__ */ jsxRuntime.jsx(qrcode_react.QRCodeSVG, { value: "https://reactjs.org/", size: 150 }) }),
2565
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-white p-3 mb-[50px]", children: /* @__PURE__ */ jsxRuntime.jsx(qrcode_react.QRCodeSVG, { value: END_COVER_LINK, size: 150 }) }),
2558
2566
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[18px] font-bold mb-3 fontsongti", children: "本报告由 Wujie Agent 生成" }),
2559
2567
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-[13px] tracking-[0.529px] leading-[1.5] mb-1", children: [
2560
2568
  "本报告仅从公开市场价格与技术指标角度对",
@@ -2746,89 +2754,89 @@ const renderChapter5$4 = (data) => {
2746
2754
  return renderFullHtml(seg);
2747
2755
  };
2748
2756
  const fundamentalSchema = {
2749
- core_thesis: zod.z.string().describe("核心观点"),
2750
- core_thesis_desc: zod.z.string().describe("核心观点阐述"),
2751
- roe_takeaway: zod.z.string().describe("roe 指标解读核心要点"),
2752
- roe_takeaway_desc: zod.z.string().describe("roe 指标解读核心要点阐述"),
2753
- gp_margin_takeaway: zod.z.string().describe("毛利率 指标解读核心要点"),
2754
- gp_margin_takeaway_desc: zod.z.string().describe("毛利率 指标解读核心要点阐述"),
2755
- yoy_ni_takeaway: zod.z.string().describe("增长率 指标解读核心要点"),
2756
- yoy_ni_takeaway_desc: zod.z.string().describe("增长率 指标解读核心要点阐述"),
2757
- pe_takeaway: zod.z.string().describe("市盈率 指标解读核心要点"),
2758
- pe_takeaway_desc: zod.z.string().describe("市盈率 指标解读核心要点阐述"),
2759
- cfo_takeaway: zod.z.string().describe("经营性现金净流量 指标解读核心要点"),
2760
- cfo_takeaway_desc: zod.z.string().describe("经营性现金净流量 指标解读核心要点阐述"),
2761
- main_risks: zod.z.string().describe("主要风险"),
2762
- primary_stock_holder: zod.z.string().describe("主要股东"),
2763
- free_float_characteristics: zod.z.string().describe("流通盘特征"),
2764
- stock_holder_analyze: zod.z.string().describe("前十大股东分析"),
2765
- roe_review: zod.z.string(),
2766
- gp_margin_review: zod.z.string(),
2767
- revenue_review: zod.z.string(),
2768
- balance_review: zod.z.string().describe("财务结构点评"),
2769
- cash_flow_ratio: zod.z.number().describe("现金流点评"),
2770
- peg_review: zod.z.string().describe("peg 点评"),
2771
- industry_trends_commentary: zod.z.string().describe("行业趋势展望"),
2772
- pe_list: zod.z.array(
2773
- zod.z.object({
2774
- code: zod.z.string().describe("股票代码"),
2775
- name: zod.z.string().describe("股票简称"),
2776
- ttm: zod.z.number().describe("TTM市盈率"),
2777
- ttm_review: zod.z.string().describe("估值点评")
2757
+ core_thesis: z.z.string().describe("核心观点"),
2758
+ core_thesis_desc: z.z.string().describe("核心观点阐述"),
2759
+ roe_takeaway: z.z.string().describe("roe 指标解读核心要点"),
2760
+ roe_takeaway_desc: z.z.string().describe("roe 指标解读核心要点阐述"),
2761
+ gp_margin_takeaway: z.z.string().describe("毛利率 指标解读核心要点"),
2762
+ gp_margin_takeaway_desc: z.z.string().describe("毛利率 指标解读核心要点阐述"),
2763
+ yoy_ni_takeaway: z.z.string().describe("增长率 指标解读核心要点"),
2764
+ yoy_ni_takeaway_desc: z.z.string().describe("增长率 指标解读核心要点阐述"),
2765
+ pe_takeaway: z.z.string().describe("市盈率 指标解读核心要点"),
2766
+ pe_takeaway_desc: z.z.string().describe("市盈率 指标解读核心要点阐述"),
2767
+ cfo_takeaway: z.z.string().describe("经营性现金净流量 指标解读核心要点"),
2768
+ cfo_takeaway_desc: z.z.string().describe("经营性现金净流量 指标解读核心要点阐述"),
2769
+ main_risks: z.z.string().describe("主要风险"),
2770
+ primary_stock_holder: z.z.string().describe("主要股东"),
2771
+ free_float_characteristics: z.z.string().describe("流通盘特征"),
2772
+ stock_holder_analyze: z.z.string().describe("前十大股东分析"),
2773
+ roe_review: z.z.string(),
2774
+ gp_margin_review: z.z.string(),
2775
+ revenue_review: z.z.string(),
2776
+ balance_review: z.z.string().describe("财务结构点评"),
2777
+ cash_flow_ratio: z.z.number().describe("现金流点评"),
2778
+ peg_review: z.z.string().describe("peg 点评"),
2779
+ industry_trends_commentary: z.z.string().describe("行业趋势展望"),
2780
+ pe_list: z.z.array(
2781
+ z.z.object({
2782
+ code: z.z.string().describe("股票代码"),
2783
+ name: z.z.string().describe("股票简称"),
2784
+ ttm: z.z.number().describe("TTM市盈率"),
2785
+ ttm_review: z.z.string().describe("估值点评")
2778
2786
  })
2779
2787
  ).describe("市盈率列表"),
2780
- raw_data_path: zod.z.string().describe("数据存储地址,**这很重要**")
2788
+ raw_data_path: z.z.string().describe("数据存储地址,**这很重要**")
2781
2789
  };
2782
- zod.z.object({
2790
+ z.z.object({
2783
2791
  ...fundamentalSchema,
2784
2792
  // 本地json解析
2785
- title: zod.z.string().describe("报告名称"),
2786
- generation_time: zod.z.string().describe("生成时间"),
2787
- logo: zod.z.string().optional().describe("logo"),
2788
- code: zod.z.string().describe("股票代码"),
2789
- market: zod.z.string().describe("市场"),
2790
- name: zod.z.string().describe("上市公司名称"),
2791
- data_period_start: zod.z.string().describe("数据周期起始点"),
2792
- data_period_end: zod.z.string().describe("数据周期结束点}"),
2793
- industry: zod.z.string().describe("行业"),
2794
- curr_price: zod.z.number().describe("当前股价"),
2795
- curr_change: zod.z.number().describe("涨跌额"),
2796
- curr_pct_chg: zod.z.number().optional().describe("涨跌幅度"),
2797
- roe: zod.z.number().describe("ROE指标"),
2798
- gp_margin: zod.z.number().describe("毛利率指标"),
2799
- yoy_ni: zod.z.number().describe("增长率指标"),
2800
- pe: zod.z.number().describe("市盈率指标"),
2801
- cfo: zod.z.number().describe("经营性现金净流量"),
2802
- stock_holder_list: zod.z.array(
2803
- zod.z.object({
2804
- name: zod.z.string(),
2805
- type: zod.z.string(),
2806
- shares: zod.z.number(),
2807
- shares_ratio: zod.z.number(),
2808
- change: zod.z.union([zod.z.string(), zod.z.number()]),
2809
- change_ratio: zod.z.string()
2793
+ title: z.z.string().describe("报告名称"),
2794
+ generation_time: z.z.string().describe("生成时间"),
2795
+ logo: z.z.string().optional().describe("logo"),
2796
+ code: z.z.string().describe("股票代码"),
2797
+ market: z.z.string().describe("市场"),
2798
+ name: z.z.string().describe("上市公司名称"),
2799
+ data_period_start: z.z.string().describe("数据周期起始点"),
2800
+ data_period_end: z.z.string().describe("数据周期结束点}"),
2801
+ industry: z.z.string().describe("行业"),
2802
+ curr_price: z.z.number().describe("当前股价"),
2803
+ curr_change: z.z.number().describe("涨跌额"),
2804
+ curr_pct_chg: z.z.number().optional().describe("涨跌幅度"),
2805
+ roe: z.z.number().describe("ROE指标"),
2806
+ gp_margin: z.z.number().describe("毛利率指标"),
2807
+ yoy_ni: z.z.number().describe("增长率指标"),
2808
+ pe: z.z.number().describe("市盈率指标"),
2809
+ cfo: z.z.number().describe("经营性现金净流量"),
2810
+ stock_holder_list: z.z.array(
2811
+ z.z.object({
2812
+ name: z.z.string(),
2813
+ type: z.z.string(),
2814
+ shares: z.z.number(),
2815
+ shares_ratio: z.z.number(),
2816
+ change: z.z.union([z.z.string(), z.z.number()]),
2817
+ change_ratio: z.z.string()
2810
2818
  })
2811
2819
  ).describe("股东列表"),
2812
- financial_trend_indicators: zod.z.array(
2813
- zod.z.object({
2814
- date: zod.z.string(),
2815
- roe: zod.z.number(),
2816
- gp_margin: zod.z.number(),
2817
- revenue: zod.z.number()
2820
+ financial_trend_indicators: z.z.array(
2821
+ z.z.object({
2822
+ date: z.z.string(),
2823
+ roe: z.z.number(),
2824
+ gp_margin: z.z.number(),
2825
+ revenue: z.z.number()
2818
2826
  })
2819
2827
  ),
2820
- cagr_3y: zod.z.number().describe("三年复合增长率"),
2821
- liability_to_asset: zod.z.number().describe("资产负债率"),
2822
- current_ratio: zod.z.number().describe("流动比率"),
2823
- cash_ratio: zod.z.number().describe("现金比率"),
2824
- cfo_to_np: zod.z.number().describe("经营现金流/净利润"),
2825
- peg: zod.z.number().describe("PEG"),
2826
- major_holdings_review: zod.z.string().describe("重点持仓机构点评"),
2827
- institutional_holdings_structure_review: zod.z.string().describe("机构持仓点评"),
2828
- institutional_holdings_structure: zod.z.array(
2829
- zod.z.object({
2830
- type: zod.z.string().describe("机构类型"),
2831
- ratio: zod.z.number().describe("占比")
2828
+ cagr_3y: z.z.number().describe("三年复合增长率"),
2829
+ liability_to_asset: z.z.number().describe("资产负债率"),
2830
+ current_ratio: z.z.number().describe("流动比率"),
2831
+ cash_ratio: z.z.number().describe("现金比率"),
2832
+ cfo_to_np: z.z.number().describe("经营现金流/净利润"),
2833
+ peg: z.z.number().describe("PEG"),
2834
+ major_holdings_review: z.z.string().describe("重点持仓机构点评"),
2835
+ institutional_holdings_structure_review: z.z.string().describe("机构持仓点评"),
2836
+ institutional_holdings_structure: z.z.array(
2837
+ z.z.object({
2838
+ type: z.z.string().describe("机构类型"),
2839
+ ratio: z.z.number().describe("占比")
2832
2840
  })
2833
2841
  )
2834
2842
  });
@@ -2839,6 +2847,13 @@ const tool$4 = {
2839
2847
  };
2840
2848
  const toolHandler$4 = async (args) => {
2841
2849
  try {
2850
+ const result = z.object(fundamentalSchema).safeParse(args);
2851
+ if (!result.success) {
2852
+ throw new types_js.McpError(
2853
+ types_js.ErrorCode.InvalidParams,
2854
+ `Invalid parameters: ${result.error.message}`
2855
+ );
2856
+ }
2842
2857
  logger.info(`start: ${(/* @__PURE__ */ new Date()).getTime()}`);
2843
2858
  logger.info(args);
2844
2859
  const jsonData = await getJsonDataIfExists(args.raw_data_path, {});
@@ -3795,7 +3810,7 @@ function End$3({ data }) {
3795
3810
  children: [
3796
3811
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-0 left-0 right-0 bottom-0 z-0", children: /* @__PURE__ */ jsxRuntime.jsx("img", { className: "block w-full h-full object-cover", src: bg$2, alt: "" }) }),
3797
3812
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center w-[414px] mx-auto relative z-10", children: [
3798
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-white p-3 mb-[50px]", children: /* @__PURE__ */ jsxRuntime.jsx(qrcode_react.QRCodeSVG, { value: "https://reactjs.org/", size: 150 }) }),
3813
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-white p-3 mb-[50px]", children: /* @__PURE__ */ jsxRuntime.jsx(qrcode_react.QRCodeSVG, { value: END_COVER_LINK, size: 150 }) }),
3799
3814
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[18px] font-bold mb-3 fontsongti", children: "本报告由 Wujie Agent 生成" }),
3800
3815
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-[13px] tracking-[0.529px] leading-[1.5] mb-1", children: [
3801
3816
  "本报告基于历史量价数据及多因子AI预测模型生成,旨在通过统计学维度量化个股的涨跌概率与波动区间。",
@@ -4002,187 +4017,187 @@ const renderChapter7$1 = (data) => {
4002
4017
  const seg = ReactDOMServer.renderToString(/* @__PURE__ */ jsxRuntime.jsx(Chapter7$1, { data }));
4003
4018
  return renderFullHtml(seg);
4004
4019
  };
4005
- const kline_daily$1 = zod.z.array(
4006
- zod.z.object({
4007
- time: zod.z.string().describe("时间"),
4008
- open: zod.z.number().describe("开盘价"),
4009
- close: zod.z.number().describe("收盘价"),
4010
- high: zod.z.number().describe("最高价"),
4011
- low: zod.z.number().describe("最低价"),
4012
- pct_chg: zod.z.number().describe("涨跌幅"),
4013
- vol: zod.z.number().describe("成交量"),
4014
- amount: zod.z.number().describe("成交额")
4020
+ const kline_daily$1 = z.z.array(
4021
+ z.z.object({
4022
+ time: z.z.string().describe("时间"),
4023
+ open: z.z.number().describe("开盘价"),
4024
+ close: z.z.number().describe("收盘价"),
4025
+ high: z.z.number().describe("最高价"),
4026
+ low: z.z.number().describe("最低价"),
4027
+ pct_chg: z.z.number().describe("涨跌幅"),
4028
+ vol: z.z.number().describe("成交量"),
4029
+ amount: z.z.number().describe("成交额")
4015
4030
  })
4016
4031
  );
4017
4032
  const marketTrendSchema = {
4018
- report_time: zod.z.string().describe("报告时间"),
4019
- data_period_start: zod.z.string().describe("数据开始时间"),
4020
- data_period_end: zod.z.string().describe("数据结束时间"),
4021
- core_comment: zod.z.string().describe("核心综述"),
4022
- important_indices: zod.z.array(
4023
- zod.z.object({
4024
- name: zod.z.string().describe("指数名称"),
4025
- code: zod.z.string().describe("指数代码"),
4026
- open: zod.z.number().describe("开盘价"),
4027
- trade: zod.z.number().describe("最新价"),
4028
- high: zod.z.number().describe("最高价"),
4029
- low: zod.z.number().describe("最低价"),
4030
- change: zod.z.number().describe("涨跌额"),
4031
- pct_chg: zod.z.number().describe("涨跌幅"),
4032
- vol: zod.z.number().describe("成交量"),
4033
- amount: zod.z.number().describe("成交额"),
4034
- summary: zod.z.string().describe("具体描述")
4033
+ report_time: z.z.string().describe("报告时间"),
4034
+ data_period_start: z.z.string().describe("数据开始时间"),
4035
+ data_period_end: z.z.string().describe("数据结束时间"),
4036
+ core_comment: z.z.string().describe("核心综述"),
4037
+ important_indices: z.z.array(
4038
+ z.z.object({
4039
+ name: z.z.string().describe("指数名称"),
4040
+ code: z.z.string().describe("指数代码"),
4041
+ open: z.z.number().describe("开盘价"),
4042
+ trade: z.z.number().describe("最新价"),
4043
+ high: z.z.number().describe("最高价"),
4044
+ low: z.z.number().describe("最低价"),
4045
+ change: z.z.number().describe("涨跌额"),
4046
+ pct_chg: z.z.number().describe("涨跌幅"),
4047
+ vol: z.z.number().describe("成交量"),
4048
+ amount: z.z.number().describe("成交额"),
4049
+ summary: z.z.string().describe("具体描述")
4035
4050
  })
4036
4051
  ).describe("重要指数"),
4037
- depth_description: zod.z.object({
4038
- description: zod.z.string().describe("深入分析内容"),
4039
- bull_description: zod.z.string().describe("多头描述"),
4040
- bear_description: zod.z.string().describe("空头描述"),
4041
- summary: zod.z.string().describe("总结")
4052
+ depth_description: z.z.object({
4053
+ description: z.z.string().describe("深入分析内容"),
4054
+ bull_description: z.z.string().describe("多头描述"),
4055
+ bear_description: z.z.string().describe("空头描述"),
4056
+ summary: z.z.string().describe("总结")
4042
4057
  }).describe("深度描述"),
4043
- sentiment: zod.z.object({
4044
- up_stock_count: zod.z.number().describe("上涨数量"),
4045
- down_stock_count: zod.z.number().describe("下跌数量"),
4046
- up_down_summary: zod.z.string().describe("涨跌总结"),
4047
- limit_up_count: zod.z.number().describe("涨停数量"),
4048
- limit_down_count: zod.z.number().describe("跌停数量"),
4049
- up_down_limit_summary: zod.z.string().describe("涨跌停总结"),
4050
- summary: zod.z.string().describe("整体总结")
4058
+ sentiment: z.z.object({
4059
+ up_stock_count: z.z.number().describe("上涨数量"),
4060
+ down_stock_count: z.z.number().describe("下跌数量"),
4061
+ up_down_summary: z.z.string().describe("涨跌总结"),
4062
+ limit_up_count: z.z.number().describe("涨停数量"),
4063
+ limit_down_count: z.z.number().describe("跌停数量"),
4064
+ up_down_limit_summary: z.z.string().describe("涨跌停总结"),
4065
+ summary: z.z.string().describe("整体总结")
4051
4066
  }).describe("市场情绪"),
4052
- capital_flows: zod.z.object({
4053
- northbound: zod.z.number().describe("北向金额"),
4054
- northbound_summary: zod.z.string().describe("北向资金总结"),
4055
- southbound: zod.z.number().describe("南向金额"),
4056
- southbound_summary: zod.z.string().describe("南向资金总结"),
4057
- inflow_board_rank: zod.z.array(
4058
- zod.z.object({
4059
- name: zod.z.string().describe("板块名称"),
4060
- money: zod.z.number().describe("金额")
4067
+ capital_flows: z.z.object({
4068
+ northbound: z.z.number().describe("北向金额"),
4069
+ northbound_summary: z.z.string().describe("北向资金总结"),
4070
+ southbound: z.z.number().describe("南向金额"),
4071
+ southbound_summary: z.z.string().describe("南向资金总结"),
4072
+ inflow_board_rank: z.z.array(
4073
+ z.z.object({
4074
+ name: z.z.string().describe("板块名称"),
4075
+ money: z.z.number().describe("金额")
4061
4076
  })
4062
4077
  ).describe("流入板块排名"),
4063
- inflow_board_summary: zod.z.string().describe("流入板块总结"),
4064
- outflow_board_rank: zod.z.array(
4065
- zod.z.object({
4066
- name: zod.z.string().describe("板块名称"),
4067
- money: zod.z.number().describe("金额")
4078
+ inflow_board_summary: z.z.string().describe("流入板块总结"),
4079
+ outflow_board_rank: z.z.array(
4080
+ z.z.object({
4081
+ name: z.z.string().describe("板块名称"),
4082
+ money: z.z.number().describe("金额")
4068
4083
  })
4069
4084
  ).describe("流出板块排名"),
4070
- outflow_board_summary: zod.z.string().describe("流出板块总结")
4085
+ outflow_board_summary: z.z.string().describe("流出板块总结")
4071
4086
  }).describe("资金流向"),
4072
- market_valuation: zod.z.object({
4073
- PE: zod.z.number().describe("市盈率"),
4074
- PB: zod.z.number().describe("市净率"),
4075
- PE_PB_description: zod.z.string().describe("市盈率/市净率整体描述"),
4076
- volatility: zod.z.number().describe("波动率"),
4077
- volatility_description: zod.z.string().describe("波动率描述")
4087
+ market_valuation: z.z.object({
4088
+ PE: z.z.number().describe("市盈率"),
4089
+ PB: z.z.number().describe("市净率"),
4090
+ PE_PB_description: z.z.string().describe("市盈率/市净率整体描述"),
4091
+ volatility: z.z.number().describe("波动率"),
4092
+ volatility_description: z.z.string().describe("波动率描述")
4078
4093
  }).describe("市场估值"),
4079
- periods_analyze: zod.z.object({
4080
- daily_trend_summary: zod.z.string().describe("日线趋势总结"),
4081
- weekly_trend_summary: zod.z.string().describe("周线趋势总结"),
4082
- monthly_trend_summary: zod.z.string().describe("月线趋势总结"),
4083
- support: zod.z.number().describe("支撑位"),
4084
- support_description: zod.z.string().describe("支撑位描述"),
4085
- resistance: zod.z.number().describe("压力位"),
4086
- resistance_description: zod.z.string().describe("压力位描述"),
4087
- momentum_summary: zod.z.string().describe("动能总结"),
4088
- energy_summary: zod.z.string().describe("能量总结"),
4089
- volatility_summary: zod.z.string().describe("波动性总结"),
4090
- kline_daily_file: zod.z.string().describe("k线数据存储的地址,**这很重要**:不要workspace的地址")
4094
+ periods_analyze: z.z.object({
4095
+ daily_trend_summary: z.z.string().describe("日线趋势总结"),
4096
+ weekly_trend_summary: z.z.string().describe("周线趋势总结"),
4097
+ monthly_trend_summary: z.z.string().describe("月线趋势总结"),
4098
+ support: z.z.number().describe("支撑位"),
4099
+ support_description: z.z.string().describe("支撑位描述"),
4100
+ resistance: z.z.number().describe("压力位"),
4101
+ resistance_description: z.z.string().describe("压力位描述"),
4102
+ momentum_summary: z.z.string().describe("动能总结"),
4103
+ energy_summary: z.z.string().describe("能量总结"),
4104
+ volatility_summary: z.z.string().describe("波动性总结"),
4105
+ kline_daily_file: z.z.string().describe("k线数据存储的地址,**这很重要**:不要workspace的地址")
4091
4106
  }).describe("周期分析"),
4092
- industries_info: zod.z.object({
4093
- industries_rank: zod.z.array(
4094
- zod.z.object({
4095
- name: zod.z.string().describe("行业名称"),
4096
- pct_chg: zod.z.number().describe("涨跌幅")
4107
+ industries_info: z.z.object({
4108
+ industries_rank: z.z.array(
4109
+ z.z.object({
4110
+ name: z.z.string().describe("行业名称"),
4111
+ pct_chg: z.z.number().describe("涨跌幅")
4097
4112
  })
4098
4113
  ).describe("行业排名"),
4099
- strong_industries: zod.z.object({
4100
- classification_summary: zod.z.array(
4101
- zod.z.object({
4102
- industries: zod.z.string().describe("行业名词及涨跌幅"),
4103
- summary: zod.z.string().describe("总结")
4114
+ strong_industries: z.z.object({
4115
+ classification_summary: z.z.array(
4116
+ z.z.object({
4117
+ industries: z.z.string().describe("行业名词及涨跌幅"),
4118
+ summary: z.z.string().describe("总结")
4104
4119
  })
4105
4120
  ).describe("强势行业分类总结")
4106
4121
  }).describe("强势行业"),
4107
- weak_industries: zod.z.object({
4108
- classification_summary: zod.z.array(
4109
- zod.z.object({
4110
- industries: zod.z.string().describe("行业名词及涨跌幅"),
4111
- summary: zod.z.string().describe("总结")
4122
+ weak_industries: z.z.object({
4123
+ classification_summary: z.z.array(
4124
+ z.z.object({
4125
+ industries: z.z.string().describe("行业名词及涨跌幅"),
4126
+ summary: z.z.string().describe("总结")
4112
4127
  })
4113
4128
  ).describe("弱势行业分类总结")
4114
4129
  }).describe("弱势行业"),
4115
- main_theme: zod.z.string().describe("主线逻辑描述"),
4116
- growth_VS_value: zod.z.string().describe("成长vs价值"),
4117
- large_cap_VS_small_cap: zod.z.string().describe("大盘vs小盘")
4130
+ main_theme: z.z.string().describe("主线逻辑描述"),
4131
+ growth_VS_value: z.z.string().describe("成长vs价值"),
4132
+ large_cap_VS_small_cap: z.z.string().describe("大盘vs小盘")
4118
4133
  }).describe("行业信息"),
4119
- impact_factor: zod.z.array(
4120
- zod.z.object({
4121
- type: zod.z.string().describe("类型|宏观|政策"),
4122
- summary: zod.z.string().describe("描述"),
4123
- strength: zod.z.string().describe("强度"),
4124
- direction: zod.z.string().describe("方向")
4134
+ impact_factor: z.z.array(
4135
+ z.z.object({
4136
+ type: z.z.string().describe("类型|宏观|政策"),
4137
+ summary: z.z.string().describe("描述"),
4138
+ strength: z.z.string().describe("强度"),
4139
+ direction: z.z.string().describe("方向")
4125
4140
  })
4126
4141
  ).describe("影响因素"),
4127
- comprehensive_assessment: zod.z.object({
4128
- macro: zod.z.string().describe("宏观评估"),
4129
- external: zod.z.string().describe("外部评估"),
4130
- summary: zod.z.string().describe("总结")
4142
+ comprehensive_assessment: z.z.object({
4143
+ macro: z.z.string().describe("宏观评估"),
4144
+ external: z.z.string().describe("外部评估"),
4145
+ summary: z.z.string().describe("总结")
4131
4146
  }).describe("综合评估"),
4132
- risk_point: zod.z.array(
4133
- zod.z.object({
4134
- risk_category: zod.z.string().describe("风险类别"),
4135
- except_event: zod.z.array(zod.z.string()).describe("预期可能发生的事件"),
4136
- summary: zod.z.string().describe("发生概率和可能的影响总结")
4147
+ risk_point: z.z.array(
4148
+ z.z.object({
4149
+ risk_category: z.z.string().describe("风险类别"),
4150
+ except_event: z.z.array(z.z.string()).describe("预期可能发生的事件"),
4151
+ summary: z.z.string().describe("发生概率和可能的影响总结")
4137
4152
  })
4138
4153
  ).describe("风险点"),
4139
- scenarios: zod.z.object({
4140
- negative: zod.z.object({
4141
- probability: zod.z.string().describe("概率"),
4142
- prerequisites: zod.z.string().describe("发生的条件"),
4143
- signal: zod.z.string().describe("发生的信号"),
4144
- target: zod.z.string().describe("达成的目标")
4154
+ scenarios: z.z.object({
4155
+ negative: z.z.object({
4156
+ probability: z.z.string().describe("概率"),
4157
+ prerequisites: z.z.string().describe("发生的条件"),
4158
+ signal: z.z.string().describe("发生的信号"),
4159
+ target: z.z.string().describe("达成的目标")
4145
4160
  }).describe("负向情景"),
4146
- neutral: zod.z.object({
4147
- probability: zod.z.string().describe("概率"),
4148
- prerequisites: zod.z.string().describe("发生的条件"),
4149
- signal: zod.z.string().describe("发生的信号"),
4150
- target: zod.z.string().describe("达成的目标")
4161
+ neutral: z.z.object({
4162
+ probability: z.z.string().describe("概率"),
4163
+ prerequisites: z.z.string().describe("发生的条件"),
4164
+ signal: z.z.string().describe("发生的信号"),
4165
+ target: z.z.string().describe("达成的目标")
4151
4166
  }).describe("中性情景"),
4152
- positive: zod.z.object({
4153
- probability: zod.z.string().describe("概率"),
4154
- prerequisites: zod.z.string().describe("发生的条件"),
4155
- signal: zod.z.string().describe("发生的信号"),
4156
- target: zod.z.string().describe("达成的目标")
4167
+ positive: z.z.object({
4168
+ probability: z.z.string().describe("概率"),
4169
+ prerequisites: z.z.string().describe("发生的条件"),
4170
+ signal: z.z.string().describe("发生的信号"),
4171
+ target: z.z.string().describe("达成的目标")
4157
4172
  }).describe("正向情景")
4158
4173
  }).describe("情景分析"),
4159
- investment_strategy: zod.z.object({
4160
- market_positioning: zod.z.string().describe("当前市场定位"),
4161
- core_driving: zod.z.object({
4162
- summary: zod.z.string().describe("总结"),
4163
- detail: zod.z.array(zod.z.string()).describe("驱动项详情")
4174
+ investment_strategy: z.z.object({
4175
+ market_positioning: z.z.string().describe("当前市场定位"),
4176
+ core_driving: z.z.object({
4177
+ summary: z.z.string().describe("总结"),
4178
+ detail: z.z.array(z.z.string()).describe("驱动项详情")
4164
4179
  }).describe("核心驱动")
4165
4180
  }).describe("投资策略"),
4166
- outlook: zod.z.object({
4167
- up_outlook: zod.z.string().describe("上涨前景"),
4168
- up_outlook_description: zod.z.string().describe("上涨前景描述"),
4169
- down_outlook: zod.z.string().describe("下跌前景"),
4170
- down_outlook_description: zod.z.string().describe("下跌前景描述"),
4171
- overall_comment: zod.z.string().describe("总体判断")
4181
+ outlook: z.z.object({
4182
+ up_outlook: z.z.string().describe("上涨前景"),
4183
+ up_outlook_description: z.z.string().describe("上涨前景描述"),
4184
+ down_outlook: z.z.string().describe("下跌前景"),
4185
+ down_outlook_description: z.z.string().describe("下跌前景描述"),
4186
+ overall_comment: z.z.string().describe("总体判断")
4172
4187
  }).describe("市场展望"),
4173
- core_summary: zod.z.object({
4174
- strategy: zod.z.string().describe("建议策略"),
4175
- investment_direction: zod.z.string().describe("投资方向"),
4176
- underweight_board: zod.z.string().describe("回避板块"),
4177
- investment_style: zod.z.string().describe("投资风格"),
4178
- asset_allocation_rate: zod.z.object({
4179
- stock: zod.z.string().describe("股票占比"),
4180
- cash: zod.z.string().describe("现金占比"),
4181
- bond: zod.z.string().describe("债券占比")
4188
+ core_summary: z.z.object({
4189
+ strategy: z.z.string().describe("建议策略"),
4190
+ investment_direction: z.z.string().describe("投资方向"),
4191
+ underweight_board: z.z.string().describe("回避板块"),
4192
+ investment_style: z.z.string().describe("投资风格"),
4193
+ asset_allocation_rate: z.z.object({
4194
+ stock: z.z.string().describe("股票占比"),
4195
+ cash: z.z.string().describe("现金占比"),
4196
+ bond: z.z.string().describe("债券占比")
4182
4197
  }).describe("资产配置占比")
4183
4198
  }).describe("核心总结")
4184
4199
  };
4185
- zod.z.object({
4200
+ z.z.object({
4186
4201
  ...marketTrendSchema,
4187
4202
  periods_analyze: marketTrendSchema.periods_analyze.extend({
4188
4203
  kline_daily: kline_daily$1
@@ -4195,6 +4210,13 @@ const tool$3 = {
4195
4210
  };
4196
4211
  const toolHandler$3 = async (args) => {
4197
4212
  try {
4213
+ const result = z.object(marketTrendSchema).safeParse(args);
4214
+ if (!result.success) {
4215
+ throw new types_js.McpError(
4216
+ types_js.ErrorCode.InvalidParams,
4217
+ `Invalid parameters: ${result.error.message}`
4218
+ );
4219
+ }
4198
4220
  logger.info(`start: ${(/* @__PURE__ */ new Date()).getTime()}`);
4199
4221
  logger.info(args);
4200
4222
  const kline_daily2 = await getJsonDataIfExists(
@@ -5063,7 +5085,7 @@ function End$2({ data }) {
5063
5085
  children: [
5064
5086
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-0 left-0 right-0 bottom-0 z-0", children: /* @__PURE__ */ jsxRuntime.jsx("img", { className: "block w-full h-full object-cover", src: bg$1, alt: "" }) }),
5065
5087
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center w-[500px] mx-auto relative z-10", children: [
5066
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-white p-3 mb-[50px]", children: /* @__PURE__ */ jsxRuntime.jsx(qrcode_react.QRCodeSVG, { value: "https://reactjs.org/", size: 150 }) }),
5088
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-white p-3 mb-[50px]", children: /* @__PURE__ */ jsxRuntime.jsx(qrcode_react.QRCodeSVG, { value: END_COVER_LINK, size: 150 }) }),
5067
5089
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[18px] font-bold mb-3 fontsongti", children: "本报告由 Wujie Agent 生成" }),
5068
5090
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-[13px] tracking-[0.529px] leading-[1.5] mb-1", children: [
5069
5091
  "本报告基于历史市场数据、上市公司财务公开信息及AI量化模型生成,旨在",
@@ -5274,85 +5296,85 @@ const renderEnd$2 = (data) => {
5274
5296
  const seg = ReactDOMServer.renderToString(/* @__PURE__ */ jsxRuntime.jsx(End$2, { data }));
5275
5297
  return renderFullHtml(seg);
5276
5298
  };
5277
- const pick_list = zod.z.array(
5278
- zod.z.object({
5279
- stock_code: zod.z.string(),
5280
- market: zod.z.string(),
5281
- name: zod.z.string(),
5282
- total_score: zod.z.number(),
5283
- base_score: zod.z.number(),
5284
- technology_score: zod.z.number(),
5285
- trend_score: zod.z.number(),
5286
- news_score: zod.z.number(),
5287
- reason: zod.z.string(),
5288
- vol: zod.z.number(),
5289
- price: zod.z.number(),
5290
- total: zod.z.number(),
5291
- pct: zod.z.number()
5299
+ const pick_list = z.z.array(
5300
+ z.z.object({
5301
+ stock_code: z.z.string(),
5302
+ market: z.z.string(),
5303
+ name: z.z.string(),
5304
+ total_score: z.z.number(),
5305
+ base_score: z.z.number(),
5306
+ technology_score: z.z.number(),
5307
+ trend_score: z.z.number(),
5308
+ news_score: z.z.number(),
5309
+ reason: z.z.string(),
5310
+ vol: z.z.number(),
5311
+ price: z.z.number(),
5312
+ total: z.z.number(),
5313
+ pct: z.z.number()
5292
5314
  })
5293
5315
  );
5294
- const industry_list = zod.z.array(
5295
- zod.z.object({
5296
- industry_name: zod.z.string(),
5297
- industry_pct: zod.z.number()
5316
+ const industry_list = z.z.array(
5317
+ z.z.object({
5318
+ industry_name: z.z.string(),
5319
+ industry_pct: z.z.number()
5298
5320
  })
5299
5321
  );
5300
5322
  const portfolioSchema = {
5301
- generation_time: zod.z.string().describe("生成时间"),
5302
- data_period_start: zod.z.string().describe("数据周期起始点"),
5303
- data_period_end: zod.z.string().describe("数据周期结束点}"),
5304
- expected_cash: zod.z.number().describe("预期投资金额"),
5305
- fact_cash: zod.z.number().describe("实际投资金额"),
5323
+ generation_time: z.z.string().describe("生成时间"),
5324
+ data_period_start: z.z.string().describe("数据周期起始点"),
5325
+ data_period_end: z.z.string().describe("数据周期结束点}"),
5326
+ expected_cash: z.z.number().describe("预期投资金额"),
5327
+ fact_cash: z.z.number().describe("实际投资金额"),
5306
5328
  pick_list,
5307
- industry_review: zod.z.string().describe("行业分配点评"),
5329
+ industry_review: z.z.string().describe("行业分配点评"),
5308
5330
  industry_list,
5309
- backtest_period: zod.z.string().describe("回测时间跨度"),
5310
- base_index: zod.z.string().describe("回测基准指数"),
5311
- backtest_cash: zod.z.number(),
5312
- backtest_total_return: zod.z.number(),
5313
- backtest_total_return_review: zod.z.string(),
5314
- backtest_final_value: zod.z.number(),
5315
- backtest_final_value_review: zod.z.string(),
5316
- backtest_volatility: zod.z.number(),
5317
- backtest_volatility_review: zod.z.string(),
5318
- backtest_max_drawdown: zod.z.number(),
5319
- backtest_max_drawdown_review: zod.z.string(),
5320
- backtest_sharpe_ratio: zod.z.number(),
5321
- backtest_sharpe_ratio_review: zod.z.string(),
5322
- positive_return_months_review: zod.z.string(),
5323
- negative_return_months_review: zod.z.string(),
5324
- annualized_return: zod.z.number(),
5325
- annualized_return_review: zod.z.string(),
5326
- highest_month: zod.z.number(),
5327
- highest_month_review: zod.z.string(),
5328
- lowest_month: zod.z.number(),
5329
- lowest_month_review: zod.z.string(),
5330
- backtest_nav_per_share_daily_path: zod.z.string().describe("每日净值存储的地址,**这很重要**"),
5331
- backtest_income_per_monthly_path: zod.z.string().describe("月收益存储的地址,**这很重要**"),
5332
- hold_review: zod.z.string(),
5333
- summary: zod.z.string(),
5334
- backtest_nav_per_share_review: zod.z.string(),
5335
- investment_style: zod.z.string(),
5336
- risk_level: zod.z.enum([
5331
+ backtest_period: z.z.string().describe("回测时间跨度"),
5332
+ base_index: z.z.string().describe("回测基准指数"),
5333
+ backtest_cash: z.z.number(),
5334
+ backtest_total_return: z.z.number(),
5335
+ backtest_total_return_review: z.z.string(),
5336
+ backtest_final_value: z.z.number(),
5337
+ backtest_final_value_review: z.z.string(),
5338
+ backtest_volatility: z.z.number(),
5339
+ backtest_volatility_review: z.z.string(),
5340
+ backtest_max_drawdown: z.z.number(),
5341
+ backtest_max_drawdown_review: z.z.string(),
5342
+ backtest_sharpe_ratio: z.z.number(),
5343
+ backtest_sharpe_ratio_review: z.z.string(),
5344
+ positive_return_months_review: z.z.string(),
5345
+ negative_return_months_review: z.z.string(),
5346
+ annualized_return: z.z.number(),
5347
+ annualized_return_review: z.z.string(),
5348
+ highest_month: z.z.number(),
5349
+ highest_month_review: z.z.string(),
5350
+ lowest_month: z.z.number(),
5351
+ lowest_month_review: z.z.string(),
5352
+ backtest_nav_per_share_daily_path: z.z.string().describe("每日净值存储的地址,**这很重要**"),
5353
+ backtest_income_per_monthly_path: z.z.string().describe("月收益存储的地址,**这很重要**"),
5354
+ hold_review: z.z.string(),
5355
+ summary: z.z.string(),
5356
+ backtest_nav_per_share_review: z.z.string(),
5357
+ investment_style: z.z.string(),
5358
+ risk_level: z.z.enum([
5337
5359
  "保守型 / 防御型(Conservative / Defensive)",
5338
5360
  "均衡 / 稳健型(Balanced / Moderate)",
5339
5361
  "激进型 / 成长型(Aggressive / Growth)"
5340
5362
  ])
5341
5363
  };
5342
- zod.z.object({
5364
+ z.z.object({
5343
5365
  ...portfolioSchema,
5344
- backtest_nav_per_share_daily: zod.z.array(
5345
- zod.z.object({
5346
- time: zod.z.string(),
5347
- portfolio: zod.z.number(),
5348
- csi300: zod.z.number()
5366
+ backtest_nav_per_share_daily: z.z.array(
5367
+ z.z.object({
5368
+ time: z.z.string(),
5369
+ portfolio: z.z.number(),
5370
+ csi300: z.z.number()
5349
5371
  })
5350
5372
  ),
5351
- backtest_income_per_monthly: zod.z.array(
5352
- zod.z.object({
5353
- time: zod.z.string(),
5354
- portfolio: zod.z.number(),
5355
- csi300: zod.z.number()
5373
+ backtest_income_per_monthly: z.z.array(
5374
+ z.z.object({
5375
+ time: z.z.string(),
5376
+ portfolio: z.z.number(),
5377
+ csi300: z.z.number()
5356
5378
  })
5357
5379
  )
5358
5380
  });
@@ -5363,6 +5385,13 @@ const tool$2 = {
5363
5385
  };
5364
5386
  const toolHandler$2 = async (args) => {
5365
5387
  try {
5388
+ const result = z.object(portfolioSchema).safeParse(args);
5389
+ if (!result.success) {
5390
+ throw new types_js.McpError(
5391
+ types_js.ErrorCode.InvalidParams,
5392
+ `Invalid parameters: ${result.error.message}`
5393
+ );
5394
+ }
5366
5395
  logger.info(`start: ${(/* @__PURE__ */ new Date()).getTime()}`);
5367
5396
  logger.info(args);
5368
5397
  const backtest_nav_per_share_daily = await getJsonDataIfExists(
@@ -6076,7 +6105,7 @@ function End$1({ data }) {
6076
6105
  children: [
6077
6106
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-0 left-0 right-0 bottom-0 z-0", children: /* @__PURE__ */ jsxRuntime.jsx("img", { className: "block w-full h-full object-cover", src: bg, alt: "" }) }),
6078
6107
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center w-[500px] mx-auto relative z-10", children: [
6079
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-white p-3 mb-[50px]", children: /* @__PURE__ */ jsxRuntime.jsx(qrcode_react.QRCodeSVG, { value: "https://reactjs.org/", size: 150 }) }),
6108
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-white p-3 mb-[50px]", children: /* @__PURE__ */ jsxRuntime.jsx(qrcode_react.QRCodeSVG, { value: END_COVER_LINK, size: 150 }) }),
6080
6109
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[18px] font-bold mb-3 fontsongti", children: "本报告由 Wujie Agent 生成" }),
6081
6110
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-[13px] tracking-[0.529px] leading-[1.5] mb-1", children: [
6082
6111
  "本报告基于历史量价数据及多因子AI预测模型生成,旨在通过统计学维度量化个股的涨跌概率与波动区间。",
@@ -6241,93 +6270,93 @@ const renderEnd$1 = (data) => {
6241
6270
  return renderFullHtml(seg);
6242
6271
  };
6243
6272
  const stockForecastSchema = {
6244
- generation_time: zod.z.string().describe("生成时间"),
6245
- data_period_start: zod.z.string().describe("数据周期起始点"),
6246
- data_period_end: zod.z.string().describe("数据周期结束点}"),
6247
- code: zod.z.string().describe("股票代码"),
6248
- market: zod.z.string().describe("市场"),
6249
- name: zod.z.string().describe("上市公司名称"),
6250
- trend_forecasting_review: zod.z.string().describe("趋势预测综述"),
6251
- history_data_path: zod.z.string().optional().describe("历史数据路径"),
6252
- predict_data_path: zod.z.string().optional().describe("预测数据路径"),
6253
- backtest_data_path: zod.z.string().optional().describe("回测数据路径"),
6254
- predict_7d_pct_chg: zod.z.number().describe("未来7日预测涨跌幅"),
6255
- predict_7d_pct_chg_interpret: zod.z.string().describe("未来7日预测涨跌幅解读"),
6256
- model_confidence_pct: zod.z.number().describe("模型置信度"),
6257
- model_confidence_pct_interpret: zod.z.string().describe("模型置信度解读"),
6258
- volatility_forecast_pct: zod.z.number().describe("波动率预测"),
6259
- volatility_forecast_pct_interpret: zod.z.string().describe("波动率预测解读"),
6260
- turning_point_signal_date: zod.z.string().describe("拐点信号日期"),
6261
- turning_point_signal_regime: zod.z.string().describe("拐点信号市场制度"),
6262
- turning_point_signal_interpret: zod.z.string().describe("拐点信号解读"),
6263
- buy_interval_left: zod.z.number().describe("买入区间左端"),
6264
- buy_interval_right: zod.z.number().describe("买入区间右端"),
6265
- buy_interval_confidence_pct: zod.z.number().describe("买入区间置信度"),
6266
- buy_interval_reason: zod.z.string().describe("买入区间理由"),
6267
- buy_interval_reason_desc: zod.z.string().describe("买入区间描述"),
6268
- hold_interval_left: zod.z.number().describe("持有区间左端"),
6269
- hold_interval_right: zod.z.number().describe("持有区间右端"),
6270
- hold_interval_confidence_pct: zod.z.number().describe("持有区间置信度"),
6271
- hold_interval_reason: zod.z.string().describe("持有区间理由"),
6272
- hold_interval_reason_desc: zod.z.string().describe("持有区间描述"),
6273
- sell_interval_left: zod.z.number().describe("卖出区间左端"),
6274
- sell_interval_right: zod.z.number().describe("卖出区间右端"),
6275
- sell_interval_confidence_pct: zod.z.number().describe("卖出区间置信度"),
6276
- sell_interval_reason: zod.z.string().describe("卖出区间理由"),
6277
- sell_interval_reason_desc: zod.z.string().describe("卖出区间描述"),
6278
- backtest_review: zod.z.string().describe("回测表现综述"),
6279
- short_term_accuracy: zod.z.number().describe("短期预测准确度"),
6280
- short_term_mae: zod.z.number().describe("短期MAE"),
6281
- short_term_review: zod.z.string().describe("短期预测简述"),
6282
- middle_term_accuracy: zod.z.number().describe("中期预测准确度"),
6283
- middle_term_mae: zod.z.number().describe("中期MAE"),
6284
- middle_term_review: zod.z.string().describe("中期预测简述"),
6285
- high_freq_accuracy: zod.z.number().describe("高频预测准确度"),
6286
- high_freq_mae: zod.z.number().describe("高频MAE"),
6287
- high_freq_review: zod.z.string().describe("高频预测简述"),
6288
- bull_market_performance: zod.z.number().describe("牛市表现"),
6289
- bull_market_review: zod.z.string().describe("牛市期表现简述"),
6290
- bear_market_performance: zod.z.number().describe("熊市表现"),
6291
- bear_market_review: zod.z.string().describe("熊市期表现简述"),
6292
- env_adaptation_summary: zod.z.string().describe("环境适应性结论"),
6293
- risk: zod.z.string().describe("潜在风险与免责声明"),
6294
- ada: zod.z.number().describe("平均方向命中率"),
6295
- ada_interpret: zod.z.string().describe("平均方向命中率解读"),
6296
- rmse: zod.z.number().describe("均方根误差"),
6297
- rmse_interpret: zod.z.string().describe("均方根误差解读"),
6298
- mae: zod.z.number().describe("平均绝对误差"),
6299
- mae_interpret: zod.z.string().describe("平均绝对误差解读"),
6300
- maximum_single_error: zod.z.number().describe("最大单次误差"),
6301
- maximum_single_error_interpret: zod.z.string().describe("最大单次误差解读"),
6302
- backtest_sample_size: zod.z.number().describe("回测样本数量"),
6303
- backtest_sample_size_interpret: zod.z.string().describe("回测样本数量解读"),
6304
- mpiw: zod.z.number().describe("平均预测区间宽度"),
6305
- mpiw_interpret: zod.z.string().describe("平均预测区间宽度解读"),
6306
- pic: zod.z.number().describe("区间命中率"),
6307
- pic_interpret: zod.z.string().describe("区间命中率解读"),
6308
- comprehensive_analysis_and_assessment: zod.z.string().describe("综合研判"),
6309
- key_findings_and_conclusions: zod.z.string().describe("核心结论"),
6310
- final_recommendations: zod.z.string().describe("最终建议"),
6311
- data_path: zod.z.string().describe("数据存储的地址,**这很重要**:不要workspace的地址")
6312
- };
6313
- zod.z.object({
6273
+ generation_time: z.z.string().describe("生成时间"),
6274
+ data_period_start: z.z.string().describe("数据周期起始点"),
6275
+ data_period_end: z.z.string().describe("数据周期结束点}"),
6276
+ code: z.z.string().describe("股票代码"),
6277
+ market: z.z.string().describe("市场"),
6278
+ name: z.z.string().describe("上市公司名称"),
6279
+ trend_forecasting_review: z.z.string().describe("趋势预测综述"),
6280
+ history_data_path: z.z.string().optional().describe("历史数据路径"),
6281
+ predict_data_path: z.z.string().optional().describe("预测数据路径"),
6282
+ backtest_data_path: z.z.string().optional().describe("回测数据路径"),
6283
+ predict_7d_pct_chg: z.z.number().describe("未来7日预测涨跌幅"),
6284
+ predict_7d_pct_chg_interpret: z.z.string().describe("未来7日预测涨跌幅解读"),
6285
+ model_confidence_pct: z.z.number().describe("模型置信度"),
6286
+ model_confidence_pct_interpret: z.z.string().describe("模型置信度解读"),
6287
+ volatility_forecast_pct: z.z.number().describe("波动率预测"),
6288
+ volatility_forecast_pct_interpret: z.z.string().describe("波动率预测解读"),
6289
+ turning_point_signal_date: z.z.string().describe("拐点信号日期"),
6290
+ turning_point_signal_regime: z.z.string().describe("拐点信号市场制度"),
6291
+ turning_point_signal_interpret: z.z.string().describe("拐点信号解读"),
6292
+ buy_interval_left: z.z.number().describe("买入区间左端"),
6293
+ buy_interval_right: z.z.number().describe("买入区间右端"),
6294
+ buy_interval_confidence_pct: z.z.number().describe("买入区间置信度"),
6295
+ buy_interval_reason: z.z.string().describe("买入区间理由"),
6296
+ buy_interval_reason_desc: z.z.string().describe("买入区间描述"),
6297
+ hold_interval_left: z.z.number().describe("持有区间左端"),
6298
+ hold_interval_right: z.z.number().describe("持有区间右端"),
6299
+ hold_interval_confidence_pct: z.z.number().describe("持有区间置信度"),
6300
+ hold_interval_reason: z.z.string().describe("持有区间理由"),
6301
+ hold_interval_reason_desc: z.z.string().describe("持有区间描述"),
6302
+ sell_interval_left: z.z.number().describe("卖出区间左端"),
6303
+ sell_interval_right: z.z.number().describe("卖出区间右端"),
6304
+ sell_interval_confidence_pct: z.z.number().describe("卖出区间置信度"),
6305
+ sell_interval_reason: z.z.string().describe("卖出区间理由"),
6306
+ sell_interval_reason_desc: z.z.string().describe("卖出区间描述"),
6307
+ backtest_review: z.z.string().describe("回测表现综述"),
6308
+ short_term_accuracy: z.z.number().describe("短期预测准确度"),
6309
+ short_term_mae: z.z.number().describe("短期MAE"),
6310
+ short_term_review: z.z.string().describe("短期预测简述"),
6311
+ middle_term_accuracy: z.z.number().describe("中期预测准确度"),
6312
+ middle_term_mae: z.z.number().describe("中期MAE"),
6313
+ middle_term_review: z.z.string().describe("中期预测简述"),
6314
+ high_freq_accuracy: z.z.number().describe("高频预测准确度"),
6315
+ high_freq_mae: z.z.number().describe("高频MAE"),
6316
+ high_freq_review: z.z.string().describe("高频预测简述"),
6317
+ bull_market_performance: z.z.number().describe("牛市表现"),
6318
+ bull_market_review: z.z.string().describe("牛市期表现简述"),
6319
+ bear_market_performance: z.z.number().describe("熊市表现"),
6320
+ bear_market_review: z.z.string().describe("熊市期表现简述"),
6321
+ env_adaptation_summary: z.z.string().describe("环境适应性结论"),
6322
+ risk: z.z.string().describe("潜在风险与免责声明"),
6323
+ ada: z.z.number().describe("平均方向命中率"),
6324
+ ada_interpret: z.z.string().describe("平均方向命中率解读"),
6325
+ rmse: z.z.number().describe("均方根误差"),
6326
+ rmse_interpret: z.z.string().describe("均方根误差解读"),
6327
+ mae: z.z.number().describe("平均绝对误差"),
6328
+ mae_interpret: z.z.string().describe("平均绝对误差解读"),
6329
+ maximum_single_error: z.z.number().describe("最大单次误差"),
6330
+ maximum_single_error_interpret: z.z.string().describe("最大单次误差解读"),
6331
+ backtest_sample_size: z.z.number().describe("回测样本数量"),
6332
+ backtest_sample_size_interpret: z.z.string().describe("回测样本数量解读"),
6333
+ mpiw: z.z.number().describe("平均预测区间宽度"),
6334
+ mpiw_interpret: z.z.string().describe("平均预测区间宽度解读"),
6335
+ pic: z.z.number().describe("区间命中率"),
6336
+ pic_interpret: z.z.string().describe("区间命中率解读"),
6337
+ comprehensive_analysis_and_assessment: z.z.string().describe("综合研判"),
6338
+ key_findings_and_conclusions: z.z.string().describe("核心结论"),
6339
+ final_recommendations: z.z.string().describe("最终建议"),
6340
+ data_path: z.z.string().describe("数据存储的地址,**这很重要**:不要workspace的地址")
6341
+ };
6342
+ z.z.object({
6314
6343
  ...stockForecastSchema,
6315
- history: zod.z.array(
6316
- zod.z.object({
6317
- date: zod.z.string().describe("日期"),
6318
- close_price: zod.z.number().describe("收盘价")
6344
+ history: z.z.array(
6345
+ z.z.object({
6346
+ date: z.z.string().describe("日期"),
6347
+ close_price: z.z.number().describe("收盘价")
6319
6348
  })
6320
6349
  ).describe("历史数据"),
6321
- predict: zod.z.array(
6322
- zod.z.object({
6323
- date: zod.z.string().describe("日期"),
6324
- close_price: zod.z.number().describe("收盘价")
6350
+ predict: z.z.array(
6351
+ z.z.object({
6352
+ date: z.z.string().describe("日期"),
6353
+ close_price: z.z.number().describe("收盘价")
6325
6354
  })
6326
6355
  ).describe("预测数据"),
6327
- backtest: zod.z.array(
6328
- zod.z.object({
6329
- date: zod.z.string().describe("日期"),
6330
- close_price: zod.z.number().describe("收盘价")
6356
+ backtest: z.z.array(
6357
+ z.z.object({
6358
+ date: z.z.string().describe("日期"),
6359
+ close_price: z.z.number().describe("收盘价")
6331
6360
  })
6332
6361
  ).describe("回测数据")
6333
6362
  });
@@ -6338,6 +6367,13 @@ const tool$1 = {
6338
6367
  };
6339
6368
  const toolHandler$1 = async (args) => {
6340
6369
  try {
6370
+ const result = z.z.object(stockForecastSchema).safeParse(args);
6371
+ if (!result.success) {
6372
+ throw new types_js.McpError(
6373
+ types_js.ErrorCode.InvalidParams,
6374
+ `Invalid parameters: ${result.error.message}`
6375
+ );
6376
+ }
6341
6377
  logger.info(`start: ${(/* @__PURE__ */ new Date()).getTime()}`);
6342
6378
  logger.info(args);
6343
6379
  const data = await getJsonDataIfExists(args.data_path, {});
@@ -8629,7 +8665,7 @@ function End({ data }) {
8629
8665
  "w-[var(--a4-width)] h-[var(--a4-height)] mx-auto"
8630
8666
  ),
8631
8667
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center w-[414px] mx-auto", children: [
8632
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-white p-3 mb-[50px]", children: /* @__PURE__ */ jsxRuntime.jsx(qrcode_react.QRCodeSVG, { value: "https://reactjs.org/", size: 150 }) }),
8668
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-white p-3 mb-[50px]", children: /* @__PURE__ */ jsxRuntime.jsx(qrcode_react.QRCodeSVG, { value: END_COVER_LINK, size: 150 }) }),
8633
8669
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[18px] font-bold mb-3 fontsongti", children: "本报告由 Wujie Agent 生成" }),
8634
8670
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-[13px] tracking-[0.529px] leading-[1.5] mb-1", children: [
8635
8671
  "本报告仅从公开市场价格与技术指标角度对",
@@ -8895,122 +8931,122 @@ const generateTechIndicatorHtml = (data) => {
8895
8931
  }
8896
8932
  ];
8897
8933
  };
8898
- const reportNotes = zod.z.object({
8899
- basic_info: zod.z.string().describe("该股票的基本情况,需要 llm 分析"),
8900
- trend_indicator_summary: zod.z.string().describe("根据趋势指标数据,需要 llm 提供综合结论"),
8901
- momentum_indicator_summary: zod.z.string().describe("根据动能指标数据,需要 llm 提供综合结论"),
8902
- volatility_indicator_summary: zod.z.string().describe("根据波动率指标,需要 llm 提供综合结论"),
8903
- volume_indicator_summary: zod.z.string().describe("根据量能分析指标,需要 llm 提供综合结论"),
8904
- overall_assessment: zod.z.string().describe("根据所有数据,需要 llm 提供整体评价")
8934
+ const reportNotes = z.z.object({
8935
+ basic_info: z.z.string().describe("该股票的基本情况,需要 llm 分析"),
8936
+ trend_indicator_summary: z.z.string().describe("根据趋势指标数据,需要 llm 提供综合结论"),
8937
+ momentum_indicator_summary: z.z.string().describe("根据动能指标数据,需要 llm 提供综合结论"),
8938
+ volatility_indicator_summary: z.z.string().describe("根据波动率指标,需要 llm 提供综合结论"),
8939
+ volume_indicator_summary: z.z.string().describe("根据量能分析指标,需要 llm 提供综合结论"),
8940
+ overall_assessment: z.z.string().describe("根据所有数据,需要 llm 提供整体评价")
8905
8941
  });
8906
- const kline_daily = zod.z.array(
8907
- zod.z.object({
8908
- time: zod.z.string().describe("时间"),
8909
- open: zod.z.number().describe("开盘价"),
8910
- close: zod.z.number().describe("收盘价"),
8911
- high: zod.z.number().describe("最高价"),
8912
- low: zod.z.number().describe("最低价"),
8913
- change: zod.z.number().describe("涨跌额"),
8914
- pct_chg: zod.z.number().describe("涨跌幅"),
8915
- vol: zod.z.number().describe("成交量"),
8916
- amount: zod.z.number().describe("成交额"),
8917
- turn_over: zod.z.number().describe("换手率"),
8918
- obv_qfq: zod.z.number().describe("obv能量潮"),
8919
- net_amount: zod.z.number().describe("主力净流入"),
8920
- buy_lg_amount: zod.z.number().describe("大单净流入"),
8942
+ const kline_daily = z.z.array(
8943
+ z.z.object({
8944
+ time: z.z.string().describe("时间"),
8945
+ open: z.z.number().describe("开盘价"),
8946
+ close: z.z.number().describe("收盘价"),
8947
+ high: z.z.number().describe("最高价"),
8948
+ low: z.z.number().describe("最低价"),
8949
+ change: z.z.number().describe("涨跌额"),
8950
+ pct_chg: z.z.number().describe("涨跌幅"),
8951
+ vol: z.z.number().describe("成交量"),
8952
+ amount: z.z.number().describe("成交额"),
8953
+ turn_over: z.z.number().describe("换手率"),
8954
+ obv_qfq: z.z.number().describe("obv能量潮"),
8955
+ net_amount: z.z.number().describe("主力净流入"),
8956
+ buy_lg_amount: z.z.number().describe("大单净流入"),
8921
8957
  // 均线
8922
- ma5: zod.z.number().describe("5日均线"),
8923
- ma10: zod.z.number().describe("10日均线"),
8924
- ma20: zod.z.number().describe("20日均线"),
8925
- ma60: zod.z.number().describe("60日均线"),
8926
- ma250: zod.z.number().describe("250日均线"),
8958
+ ma5: z.z.number().describe("5日均线"),
8959
+ ma10: z.z.number().describe("10日均线"),
8960
+ ma20: z.z.number().describe("20日均线"),
8961
+ ma60: z.z.number().describe("60日均线"),
8962
+ ma250: z.z.number().describe("250日均线"),
8927
8963
  // macd
8928
- macd_dif: zod.z.number().describe("macd"),
8929
- macd_dea: zod.z.number().describe("macd"),
8930
- macd_histogram: zod.z.number().describe("macd 柱"),
8964
+ macd_dif: z.z.number().describe("macd"),
8965
+ macd_dea: z.z.number().describe("macd"),
8966
+ macd_histogram: z.z.number().describe("macd 柱"),
8931
8967
  // rsi
8932
- rsi_6: zod.z.number().describe("rsi6"),
8933
- rsi_12: zod.z.number().describe("rsi12"),
8934
- rsi_24: zod.z.number().describe("rsi24"),
8968
+ rsi_6: z.z.number().describe("rsi6"),
8969
+ rsi_12: z.z.number().describe("rsi12"),
8970
+ rsi_24: z.z.number().describe("rsi24"),
8935
8971
  // kdf
8936
- kdj_k: zod.z.number().describe("kdj_k"),
8937
- kdj_d: zod.z.number().describe("kdj_d"),
8938
- kdj_j: zod.z.number().describe("kdj_j"),
8972
+ kdj_k: z.z.number().describe("kdj_k"),
8973
+ kdj_d: z.z.number().describe("kdj_d"),
8974
+ kdj_j: z.z.number().describe("kdj_j"),
8939
8975
  // atr
8940
- atr14: zod.z.number().describe("atr14"),
8976
+ atr14: z.z.number().describe("atr14"),
8941
8977
  // boll
8942
- boll_upper: zod.z.number().describe("布林线上轨"),
8943
- boll_mid: zod.z.number().describe("布林线中轨"),
8944
- boll_lower: zod.z.number().describe("布林线下轨")
8978
+ boll_upper: z.z.number().describe("布林线上轨"),
8979
+ boll_mid: z.z.number().describe("布林线中轨"),
8980
+ boll_lower: z.z.number().describe("布林线下轨")
8945
8981
  })
8946
8982
  );
8947
- const kline_indicator = zod.z.object({
8948
- open: zod.z.number().describe("开盘价"),
8949
- high: zod.z.number().describe("最高价"),
8950
- swing: zod.z.number().describe("振幅"),
8951
- vol: zod.z.number().describe("成交量"),
8952
- pre_close: zod.z.number().describe("昨收价"),
8953
- low: zod.z.number().describe("最低价"),
8954
- turn_over: zod.z.number().describe("换手率"),
8955
- amount: zod.z.number().describe("成交额"),
8956
- selling: zod.z.number().optional().describe("内盘"),
8957
- buying: zod.z.number().optional().describe("外盘"),
8958
- week52_high: zod.z.number().describe("52周高"),
8959
- week52_low: zod.z.number().describe("52周低"),
8960
- kline_summary: zod.z.string().describe("根据 kline 数据,需要 llm 总结")
8983
+ const kline_indicator = z.z.object({
8984
+ open: z.z.number().describe("开盘价"),
8985
+ high: z.z.number().describe("最高价"),
8986
+ swing: z.z.number().describe("振幅"),
8987
+ vol: z.z.number().describe("成交量"),
8988
+ pre_close: z.z.number().describe("昨收价"),
8989
+ low: z.z.number().describe("最低价"),
8990
+ turn_over: z.z.number().describe("换手率"),
8991
+ amount: z.z.number().describe("成交额"),
8992
+ selling: z.z.number().optional().describe("内盘"),
8993
+ buying: z.z.number().optional().describe("外盘"),
8994
+ week52_high: z.z.number().describe("52周高"),
8995
+ week52_low: z.z.number().describe("52周低"),
8996
+ kline_summary: z.z.string().describe("根据 kline 数据,需要 llm 总结")
8961
8997
  });
8962
- const trend_indicator = zod.z.object({
8963
- ma_summary: zod.z.string().describe("根据ma数据,需要 llm 总结"),
8964
- macd_summary: zod.z.string().describe("根据 macd 数据,需要 llm 总结")
8998
+ const trend_indicator = z.z.object({
8999
+ ma_summary: z.z.string().describe("根据ma数据,需要 llm 总结"),
9000
+ macd_summary: z.z.string().describe("根据 macd 数据,需要 llm 总结")
8965
9001
  });
8966
- const momentum_indicator = zod.z.object({
8967
- rsi_summary: zod.z.string().describe("根据 rsi 数据,需要 llm 总结"),
8968
- kdj_summary: zod.z.string().describe("根据 kdj 数据,需要 llm 总结"),
8969
- momentum_indicator_summary: zod.z.string().describe("根据动能指标数据,需要 llm 提供综合结论")
9002
+ const momentum_indicator = z.z.object({
9003
+ rsi_summary: z.z.string().describe("根据 rsi 数据,需要 llm 总结"),
9004
+ kdj_summary: z.z.string().describe("根据 kdj 数据,需要 llm 总结"),
9005
+ momentum_indicator_summary: z.z.string().describe("根据动能指标数据,需要 llm 提供综合结论")
8970
9006
  });
8971
- const volatility_indicator = zod.z.object({
8972
- hv30: zod.z.number().describe("30日历史波动率"),
8973
- bb_summary: zod.z.string().describe("根据布林带数据, 需要 llm 总结"),
8974
- risk_tips: zod.z.string().describe("根据波动率指标,需要 llm 提供风险提示"),
8975
- volatility_indicator_summary: zod.z.string().describe("根据波动率指标,需要 llm 提供综合结论")
9007
+ const volatility_indicator = z.z.object({
9008
+ hv30: z.z.number().describe("30日历史波动率"),
9009
+ bb_summary: z.z.string().describe("根据布林带数据, 需要 llm 总结"),
9010
+ risk_tips: z.z.string().describe("根据波动率指标,需要 llm 提供风险提示"),
9011
+ volatility_indicator_summary: z.z.string().describe("根据波动率指标,需要 llm 提供综合结论")
8976
9012
  });
8977
- const volume_indicator = zod.z.object({
8978
- volume_ratio: zod.z.number().optional().describe("量比"),
8979
- volume_trend: zod.z.string().describe("根据相关成交量数据,需要 llm 提供成交量趋势"),
8980
- retail_sentiment: zod.z.string().describe("散户情绪"),
8981
- volume_indicator_summary: zod.z.string().describe("根据量能分析指标,需要 llm 提供综合结论")
9013
+ const volume_indicator = z.z.object({
9014
+ volume_ratio: z.z.number().optional().describe("量比"),
9015
+ volume_trend: z.z.string().describe("根据相关成交量数据,需要 llm 提供成交量趋势"),
9016
+ retail_sentiment: z.z.string().describe("散户情绪"),
9017
+ volume_indicator_summary: z.z.string().describe("根据量能分析指标,需要 llm 提供综合结论")
8982
9018
  });
8983
- const pattern_analysis = zod.z.object({
8984
- short_term: zod.z.object({
8985
- pattern_desc: zod.z.string().describe("短期形态简述,需要 llm 提供"),
8986
- short_resistance: zod.z.number().describe("短期压力位"),
8987
- short_support: zod.z.number().describe("短期支撑位")
9019
+ const pattern_analysis = z.z.object({
9020
+ short_term: z.z.object({
9021
+ pattern_desc: z.z.string().describe("短期形态简述,需要 llm 提供"),
9022
+ short_resistance: z.z.number().describe("短期压力位"),
9023
+ short_support: z.z.number().describe("短期支撑位")
8988
9024
  }),
8989
- intermediate_term: zod.z.object({
8990
- pattern_desc: zod.z.string().describe("中期形态简述,需要 llm 提供"),
8991
- resistance: zod.z.number().describe("中期压力位"),
8992
- support: zod.z.number().describe("中期支撑位")
9025
+ intermediate_term: z.z.object({
9026
+ pattern_desc: z.z.string().describe("中期形态简述,需要 llm 提供"),
9027
+ resistance: z.z.number().describe("中期压力位"),
9028
+ support: z.z.number().describe("中期支撑位")
8993
9029
  }),
8994
- long_term: zod.z.object({
8995
- pattern_desc: zod.z.string().describe("长期形态简述,需要 llm 提供"),
8996
- resistance: zod.z.number().describe("长期压力位"),
8997
- support: zod.z.number().describe("长期支撑位")
9030
+ long_term: z.z.object({
9031
+ pattern_desc: z.z.string().describe("长期形态简述,需要 llm 提供"),
9032
+ resistance: z.z.number().describe("长期压力位"),
9033
+ support: z.z.number().describe("长期支撑位")
8998
9034
  }),
8999
- pattern_analysis_summary: zod.string().describe("需要 llm 提供综合形态分析")
9035
+ pattern_analysis_summary: z.string().describe("需要 llm 提供综合形态分析")
9000
9036
  });
9001
9037
  const techIndicatorSchema = {
9002
- title: zod.z.string().describe("报告名称"),
9003
- generation_time: zod.z.string().describe("生成时间"),
9004
- logo: zod.z.string().optional().describe("logo"),
9005
- code: zod.z.string().describe("股票代码"),
9006
- market: zod.z.string().describe("市场"),
9007
- name: zod.z.string().describe("上市公司名称"),
9008
- industry: zod.z.string().describe("行业"),
9009
- curr_price: zod.z.number().describe("当前股价"),
9010
- curr_change: zod.z.number().describe("涨跌额"),
9011
- curr_pct_chg: zod.z.number().optional().describe("涨跌幅度"),
9012
- data_period_start: zod.z.string().describe("数据周期起始点"),
9013
- data_period_end: zod.z.string().describe("数据周期结束点}"),
9038
+ title: z.z.string().describe("报告名称"),
9039
+ generation_time: z.z.string().describe("生成时间"),
9040
+ logo: z.z.string().optional().describe("logo"),
9041
+ code: z.z.string().describe("股票代码"),
9042
+ market: z.z.string().describe("市场"),
9043
+ name: z.z.string().describe("上市公司名称"),
9044
+ industry: z.z.string().describe("行业"),
9045
+ curr_price: z.z.number().describe("当前股价"),
9046
+ curr_change: z.z.number().describe("涨跌额"),
9047
+ curr_pct_chg: z.z.number().optional().describe("涨跌幅度"),
9048
+ data_period_start: z.z.string().describe("数据周期起始点"),
9049
+ data_period_end: z.z.string().describe("数据周期结束点}"),
9014
9050
  report_notes: reportNotes,
9015
9051
  kline_indicator,
9016
9052
  trend_indicator,
@@ -9018,9 +9054,9 @@ const techIndicatorSchema = {
9018
9054
  volatility_indicator,
9019
9055
  volume_indicator,
9020
9056
  pattern_analysis,
9021
- kline_data_path: zod.z.string().describe("k线数据存储的地址,**这很重要**:不要workspace的地址")
9057
+ kline_data_path: z.z.string().describe("k线数据存储的地址,**这很重要**:不要workspace的地址")
9022
9058
  };
9023
- zod.z.object({
9059
+ z.z.object({
9024
9060
  ...techIndicatorSchema,
9025
9061
  kline_daily
9026
9062
  });
@@ -9031,6 +9067,13 @@ const tool = {
9031
9067
  };
9032
9068
  const toolHandler = async (args) => {
9033
9069
  try {
9070
+ const result = z.object(techIndicatorSchema).safeParse(args);
9071
+ if (!result.success) {
9072
+ throw new types_js.McpError(
9073
+ types_js.ErrorCode.InvalidParams,
9074
+ `Invalid parameters: ${result.error.message}`
9075
+ );
9076
+ }
9034
9077
  logger.info(`start: ${(/* @__PURE__ */ new Date()).getTime()}`);
9035
9078
  logger.info(args);
9036
9079
  const kline_daily2 = await getJsonDataIfExists(args.kline_data_path, []);