@8btc/finance-assistant-mcp 0.0.40 → 0.0.41

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 +61 -3
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -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.40";
48
+ const version = "0.0.41";
49
49
  const pkgJSON = {
50
50
  version
51
51
  };
@@ -1901,6 +1901,59 @@ const generate_financial_news_pdf = {
1901
1901
  toolHandler: toolHandler$5,
1902
1902
  initHandler: initHandler$5
1903
1903
  };
1904
+ const renderInstitutionPie = (rawData) => {
1905
+ const chart = echarts__namespace.init(null, null, {
1906
+ renderer: "svg",
1907
+ // must use SVG mode
1908
+ ssr: true,
1909
+ // enable SSR
1910
+ width: 651,
1911
+ // need to specify height and width
1912
+ height: 284
1913
+ });
1914
+ const option = {
1915
+ color: colors,
1916
+ animation: false,
1917
+ tooltip: {
1918
+ trigger: "item"
1919
+ },
1920
+ legend: {
1921
+ orient: "vertical",
1922
+ left: "right",
1923
+ top: "top"
1924
+ },
1925
+ series: [
1926
+ {
1927
+ name: "Access From",
1928
+ type: "pie",
1929
+ radius: "70%",
1930
+ label: {
1931
+ formatter: (v) => {
1932
+ return `${v.name} ${formatNumberToUnit(
1933
+ Number(v.value || 0) * 100
1934
+ )}%`;
1935
+ }
1936
+ },
1937
+ data: rawData.map((it) => {
1938
+ return {
1939
+ value: it.ratio,
1940
+ name: it.type
1941
+ };
1942
+ }),
1943
+ emphasis: {
1944
+ itemStyle: {
1945
+ shadowBlur: 10,
1946
+ shadowOffsetX: 0,
1947
+ shadowColor: "rgba(0, 0, 0, 0.5)"
1948
+ }
1949
+ }
1950
+ }
1951
+ ]
1952
+ };
1953
+ chart.setOption(option);
1954
+ const svgStr = chart.renderToSVGString();
1955
+ return svgStr;
1956
+ };
1904
1957
  const generateData$j = (rawData) => {
1905
1958
  const categoryData = [];
1906
1959
  const roe = [];
@@ -2689,7 +2742,12 @@ const renderChapter2$4 = (data) => {
2689
2742
  return renderFullHtml(seg);
2690
2743
  };
2691
2744
  const renderChapter3$4 = (data) => {
2692
- const seg = ReactDOMServer.renderToString(/* @__PURE__ */ jsxRuntime.jsx(Chapter3$4, { data }));
2745
+ const institutionPie = renderInstitutionPie(
2746
+ data.institutional_holdings_structure
2747
+ );
2748
+ const seg = ReactDOMServer.renderToString(
2749
+ /* @__PURE__ */ jsxRuntime.jsx(Chapter3$4, { data, institutionalSvg: institutionPie })
2750
+ );
2693
2751
  return renderFullHtml(seg);
2694
2752
  };
2695
2753
  const renderChapter4$4 = (data) => {
@@ -2781,7 +2839,7 @@ const fundamentalSchema = {
2781
2839
  institutional_holdings_structure: zod.z.array(
2782
2840
  zod.z.object({
2783
2841
  type: zod.z.string().describe("机构类型"),
2784
- ratio: zod.z.string().describe("占比")
2842
+ ratio: zod.z.number().describe("占比")
2785
2843
  })
2786
2844
  )
2787
2845
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@8btc/finance-assistant-mcp",
3
- "version": "0.0.40",
3
+ "version": "0.0.41",
4
4
  "description": "财经agent辅助mcp工具",
5
5
  "main": "dist/index.cjs",
6
6
  "type": "module",