@weaxs/openclaw-stock-analysis 0.1.14 → 0.2.0

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 (63) hide show
  1. package/README.md +1 -1
  2. package/dist/index.js +178 -44
  3. package/index.ts +189 -42
  4. package/openclaw.plugin.json +7 -0
  5. package/package.json +1 -1
  6. package/skills/bottom-volume/SKILL.md +1 -4
  7. package/skills/bottom-volume/scripts/gather.py +1 -1
  8. package/skills/box-oscillation/SKILL.md +1 -4
  9. package/skills/box-oscillation/scripts/gather.py +1 -1
  10. package/skills/bull-trend/SKILL.md +1 -4
  11. package/skills/bull-trend/scripts/gather.py +1 -1
  12. package/skills/chan-theory/SKILL.md +1 -4
  13. package/skills/chan-theory/scripts/gather.py +1 -1
  14. package/skills/dragon-head/SKILL.md +24 -28
  15. package/skills/dragon-head/scripts/gather.py +1 -1
  16. package/skills/emotion-cycle/SKILL.md +19 -33
  17. package/skills/emotion-cycle/scripts/gather.py +4 -3
  18. package/skills/event-driven/SKILL.md +42 -26
  19. package/skills/event-driven/scripts/gather.py +1 -1
  20. package/skills/expectation-repricing/SKILL.md +11 -6
  21. package/skills/expectation-repricing/scripts/gather.py +1 -1
  22. package/skills/growth-quality/SKILL.md +11 -6
  23. package/skills/growth-quality/scripts/gather.py +1 -1
  24. package/skills/hot-theme/SKILL.md +27 -23
  25. package/skills/hot-theme/scripts/gather.py +1 -1
  26. package/skills/ma-crossover/SKILL.md +1 -4
  27. package/skills/ma-crossover/scripts/gather.py +1 -1
  28. package/skills/market-review/SKILL.md +11 -8
  29. package/skills/market-review/scripts/gather.py +1 -1
  30. package/skills/one-yang-three-yin/SKILL.md +1 -4
  31. package/skills/one-yang-three-yin/scripts/gather.py +1 -1
  32. package/skills/shrink-pullback/SKILL.md +1 -4
  33. package/skills/shrink-pullback/scripts/gather.py +1 -1
  34. package/skills/stock-analysis/SKILL.md +18 -77
  35. package/skills/stock-analysis/references/short-term-trading.md +78 -0
  36. package/skills/stock-analysis/scripts/gather.py +1 -1
  37. package/skills/stock-screener/SKILL.md +7 -6
  38. package/skills/stock-screener/scripts/gather.py +1 -1
  39. package/skills/strategy-backtest/SKILL.md +24 -20
  40. package/skills/strategy-backtest/scripts/gather.py +1 -1
  41. package/skills/volume-breakout/SKILL.md +21 -23
  42. package/skills/volume-breakout/scripts/gather.py +1 -1
  43. package/skills/wave-theory/SKILL.md +1 -4
  44. package/skills/wave-theory/scripts/gather.py +1 -1
  45. package/skills/wisburg-research/SKILL.md +2 -2
  46. package/tools/alert_rules.py +5 -18
  47. package/tools/backtest.py +4 -4
  48. package/tools/capabilities.py +11 -4
  49. package/tools/diagnostics.py +13 -2
  50. package/tools/gather.py +12 -31
  51. package/tools/market_regime.py +4 -1
  52. package/tools/market_review.py +1 -1
  53. package/tools/name_resolver.py +4 -10
  54. package/tools/pattern.py +3 -24
  55. package/tools/report_renderer.py +1 -2
  56. package/tools/screener.py +2 -16
  57. package/tools/search_intel.py +1 -24
  58. package/tools/signal_tracker.py +275 -0
  59. package/tools/stock_data.py +704 -167
  60. package/tools/trading_calendar.py +92 -7
  61. package/tools/volume_analysis.py +3 -23
  62. package/tools/watchlist_context.py +1 -10
  63. package/scripts/sync-version.sh +0 -56
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Stock Analysis — OpenClaw Plugin
2
2
 
3
- A股 / 港股 / 美股 / 日股 / 韩股 / 台股 行情、技术分析、筛选与回测。OpenClaw Gateway 加载后即可在对话中调用 41 个工具。
3
+ A股 / 港股 / 美股 / 日股 / 韩股 / 台股 行情、技术分析、筛选与回测。OpenClaw Gateway 加载后即可在对话中调用 48 个工具。
4
4
 
5
5
  ## 安装
6
6
 
package/dist/index.js CHANGED
@@ -4488,7 +4488,7 @@ var index_default = definePluginEntry({
4488
4488
  name: "get_quote",
4489
4489
  description: "\u83B7\u53D6\u80A1\u7968\u5B9E\u65F6\u884C\u60C5\u62A5\u4EF7\uFF08\u73B0\u4EF7\u3001\u6DA8\u8DCC\u5E45\u3001\u91CF\u6BD4\u7B49\uFF09\u3002\u652F\u6301A\u80A1\u3001\u6E2F\u80A1\u3001\u7F8E\u80A1\u3001\u65E5\u80A1\u3001\u97E9\u80A1\u3001\u53F0\u80A1",
4490
4490
  parameters: typebox_exports.Object({
4491
- symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801" })
4491
+ symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801\uFF08A\u80A1\u5982600519\uFF0C\u7F8E\u80A1\u5982AAPL\uFF0C\u6E2F\u80A1\u598200700.HK\uFF09" })
4492
4492
  }),
4493
4493
  async execute(_id, params) {
4494
4494
  const out = await runPy("stock_data.py", ["quote", params.symbol]);
@@ -4525,7 +4525,7 @@ var index_default = definePluginEntry({
4525
4525
  name: "get_news",
4526
4526
  description: "\u83B7\u53D6\u4E2A\u80A1\u6700\u8FD1N\u5929\u8D22\u7ECF\u65B0\u95FB\u5FEB\u8BAF\uFF08\u8F7B\u91CF\u3001\u65E0\u9700\u914D\u7F6E\uFF09\u3002\u9700\u8981\u6DF1\u5EA6\u5168\u7F51\u60C5\u62A5\u7528 search_comprehensive_intel\uFF0C\u6309\u4E3B\u9898\u641C\u7D22\u7528 search_stock_news\uFF0C\u8BFB\u6587\u7AE0\u5168\u6587\u7528 extract_article",
4527
4527
  parameters: typebox_exports.Object({
4528
- symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801" }),
4528
+ symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801\uFF08A\u80A1\u5982600519\uFF0C\u7F8E\u80A1\u5982AAPL\uFF0C\u6E2F\u80A1\u598200700.HK\uFF09" }),
4529
4529
  days: typebox_exports.Optional(
4530
4530
  typebox_exports.Number({ description: "\u83B7\u53D6\u6700\u8FD1\u51E0\u5929\u7684\u65B0\u95FB\uFF0C\u9ED8\u8BA4 3" })
4531
4531
  )
@@ -4542,9 +4542,9 @@ var index_default = definePluginEntry({
4542
4542
  });
4543
4543
  api.registerTool({
4544
4544
  name: "get_financials",
4545
- description: "\u83B7\u53D6\u80A1\u7968\u5173\u952E\u8D22\u52A1\u6307\u6807\uFF08PE/PB/\u5E02\u503C/\u8425\u6536/\u51C0\u5229\u6DA6/ROE\u7B49\uFF09\uFF0C\u9002\u5408\u5FEB\u901F\u4F30\u503C\u5FEB\u67E5\u3002A\u80A1\u6DF1\u5EA6\u57FA\u672C\u9762\uFF08\u6210\u957F\u6027/\u76C8\u5229\u80FD\u529B/\u5206\u7EA2\uFF09\u7528 get_fundamental_context",
4545
+ description: "\u83B7\u53D6\u80A1\u7968\u8D22\u52A1\u6458\u8981\u3002A\u80A1\u8FD4\u56DE\u6700\u65B0\u62A5\u544A\u671F ROE/\u6BDB\u5229\u7387/\u51C0\u5229\u7387/\u8D1F\u503A\u7387/\u6D41\u52A8\u6BD4\u7387\uFF1B\u5176\u4ED6\u5E02\u573A\u8FD4\u56DE PE/PB/\u5E02\u503C/\u8425\u6536/\u51C0\u5229\u6DA6\u7B49\u3002A\u80A1\u4F30\u503C\u3001\u6210\u957F\u548C\u5206\u7EA2\u7528 get_fundamental_context",
4546
4546
  parameters: typebox_exports.Object({
4547
- symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801" })
4547
+ symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801\uFF08A\u80A1\u5982600519\uFF0C\u7F8E\u80A1\u5982AAPL\uFF0C\u6E2F\u80A1\u598200700.HK\uFF09" })
4548
4548
  }),
4549
4549
  async execute(_id, params) {
4550
4550
  const out = await runPy("stock_data.py", ["financials", params.symbol]);
@@ -4555,7 +4555,7 @@ var index_default = definePluginEntry({
4555
4555
  name: "get_technical_analysis",
4556
4556
  description: "\u83B7\u53D6\u80A1\u7968\u6280\u672F\u9762\u5206\u6790\uFF08MA/MACD/RSI/BOLL/KDJ/\u6210\u4EA4\u91CF\u7B49\u6307\u6807 + 100\u5206\u7EFC\u5408\u8BC4\u5206 + 6\u7EA7\u4E70\u5356\u4FE1\u53F7 + \u8D8B\u52BF/\u504F\u79BB\u5EA6/\u652F\u6491\u538B\u529B\u4F4D\uFF09\u3002\u4E2A\u80A1\u6280\u672F\u9762\u7EFC\u5408\u5224\u65AD\u4E0E\u4E70\u5356\u65F6\u673A\u5206\u6790\u7684\u9996\u9009\uFF1B\u53EA\u8981\u5747\u7EBF\u6570\u503C\u6216\u81EA\u5B9A\u4E49\u5468\u671F\u7528 calculate_ma\uFF0C\u4E13\u95EE\u91CF\u4EF7\u7528 get_volume_analysis\uFF0C\u626B\u5F53\u65E5\u5F02\u52A8\u7528 detect_anomaly",
4557
4557
  parameters: typebox_exports.Object({
4558
- symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801" }),
4558
+ symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801\uFF08A\u80A1\u5982600519\uFF0C\u7F8E\u80A1\u5982AAPL\uFF0C\u6E2F\u80A1\u598200700.HK\uFF09" }),
4559
4559
  period: typebox_exports.Optional(
4560
4560
  typebox_exports.Union(
4561
4561
  [typebox_exports.Literal("daily"), typebox_exports.Literal("weekly"), typebox_exports.Literal("monthly")],
@@ -4582,7 +4582,7 @@ var index_default = definePluginEntry({
4582
4582
  name: "analyze_pattern",
4583
4583
  description: "K\u7EBF\u5F62\u6001\u8BC6\u522B \u2014 \u68C0\u6D4B\u5341\u5B57\u661F\u3001\u9524\u5B50\u7EBF\u3001\u541E\u6CA1\u3001\u542F\u660E\u661F\u3001\u9EC4\u660F\u661F\u3001\u53CC\u5E95\u300120\u65E5\u7A81\u7834\u7B4912+\u79CD\u7ECF\u5178\u5F62\u6001\u3002\u7EFC\u5408\u6280\u672F\u9762\u5224\u65AD\u7528 get_technical_analysis",
4584
4584
  parameters: typebox_exports.Object({
4585
- symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801" }),
4585
+ symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801\uFF08A\u80A1\u5982600519\uFF0C\u7F8E\u80A1\u5982AAPL\uFF0C\u6E2F\u80A1\u598200700.HK\uFF09" }),
4586
4586
  period: typebox_exports.Optional(
4587
4587
  typebox_exports.Union(
4588
4588
  [typebox_exports.Literal("daily"), typebox_exports.Literal("weekly"), typebox_exports.Literal("monthly")],
@@ -4627,7 +4627,7 @@ var index_default = definePluginEntry({
4627
4627
  });
4628
4628
  api.registerTool({
4629
4629
  name: "get_sector_rankings",
4630
- description: "\u83B7\u53D6A\u80A1\u884C\u4E1A\u677F\u5757\u6DA8\u8DCC\u5E45\u6392\u884C\uFF08\u542B\u9886\u6DA8\u80A1\u3001\u6DA8\u8DCC\u5BB6\u6570\u7B49\uFF09\u3002\u652F\u6301\u67E5\u770B\u6DA8\u5E45\u699C/\u8DCC\u5E45\u699C/\u53CC\u5411",
4630
+ description: "\u83B7\u53D6A\u80A1\u677F\u5757\u6DA8\u8DCC\u5E45\u6392\u884C\uFF08\u542B\u9886\u6DA8\u80A1\u3001\u6DA8\u8DCC\u5BB6\u6570\u7B49\uFF09\u3002board_type=industry\uFF08\u9ED8\u8BA4\uFF09\u4E3A\u884C\u4E1A\u677F\u5757\uFF0Cboard_type=concept \u65F6\u4E3A\u6982\u5FF5\u677F\u5757\u6392\u884C\u3002\u652F\u6301\u67E5\u770B\u6DA8\u5E45\u699C/\u8DCC\u5E45\u699C/\u53CC\u5411",
4631
4631
  parameters: typebox_exports.Object({
4632
4632
  top: typebox_exports.Optional(
4633
4633
  typebox_exports.Number({ description: "\u8FD4\u56DE\u6392\u540D\u524DN\u7684\u677F\u5757\uFF0C\u9ED8\u8BA4 10" })
@@ -4637,6 +4637,12 @@ var index_default = definePluginEntry({
4637
4637
  [typebox_exports.Literal("top"), typebox_exports.Literal("bottom"), typebox_exports.Literal("both")],
4638
4638
  { description: "top=\u6DA8\u5E45\u699C\uFF08\u9ED8\u8BA4\uFF09\uFF0Cbottom=\u8DCC\u5E45\u699C\uFF0Cboth=\u53CC\u5411" }
4639
4639
  )
4640
+ ),
4641
+ board_type: typebox_exports.Optional(
4642
+ typebox_exports.Union(
4643
+ [typebox_exports.Literal("industry"), typebox_exports.Literal("concept")],
4644
+ { description: "\u677F\u5757\u7C7B\u578B\uFF1Aindustry=\u884C\u4E1A\uFF08\u9ED8\u8BA4\uFF09\uFF0Cconcept=\u6982\u5FF5" }
4645
+ )
4640
4646
  )
4641
4647
  }),
4642
4648
  async execute(_id, params) {
@@ -4645,7 +4651,9 @@ var index_default = definePluginEntry({
4645
4651
  "--top",
4646
4652
  String(params.top ?? 10),
4647
4653
  "--direction",
4648
- params.direction ?? "top"
4654
+ params.direction ?? "top",
4655
+ "--board-type",
4656
+ params.board_type ?? "industry"
4649
4657
  ]);
4650
4658
  return asText(out);
4651
4659
  }
@@ -4690,7 +4698,7 @@ var index_default = definePluginEntry({
4690
4698
  name: "get_stock_info",
4691
4699
  description: "\u83B7\u53D6\u80A1\u7968\u57FA\u672C\u4FE1\u606F\uFF08\u884C\u4E1A\u3001\u677F\u5757\u3001\u4E0A\u5E02\u65E5\u671F\u3001\u603B\u80A1\u672C\u7B49\uFF09\u3002A\u80A1\u8FD4\u56DE\u677F\u5757/\u884C\u4E1A\uFF0C\u5176\u4ED6\u5E02\u573A\u8FD4\u56DE\u884C\u4E1A/\u516C\u53F8\u7B80\u4ECB",
4692
4700
  parameters: typebox_exports.Object({
4693
- symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801" })
4701
+ symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801\uFF08A\u80A1\u5982600519\uFF0C\u7F8E\u80A1\u5982AAPL\uFF0C\u6E2F\u80A1\u598200700.HK\uFF09" })
4694
4702
  }),
4695
4703
  async execute(_id, params) {
4696
4704
  const out = await runPy("stock_data.py", ["stock_info", params.symbol]);
@@ -4714,23 +4722,70 @@ var index_default = definePluginEntry({
4714
4722
  api.registerTool({
4715
4723
  name: "get_market_stats",
4716
4724
  description: "\u83B7\u53D6A\u80A1\u5E02\u573A\u6574\u4F53\u7EDF\u8BA1\uFF08\u6DA8\u8DCC\u5BB6\u6570\u3001\u6DA8\u505C\u8DCC\u505C\u6570\u3001\u5E73\u5747\u6DA8\u5E45\u3001\u6DA8\u8DCCTop5\u3001\u603B\u6210\u4EA4\u989D\uFF09\u3002\u7528\u4E8E\u8861\u91CF\u5E02\u573A\u6574\u4F53\u60C5\u7EEA\u4E0E\u6E29\u5EA6",
4725
+ parameters: typebox_exports.Object({}),
4726
+ async execute() {
4727
+ const out = await runPy("stock_data.py", ["market_stats"]);
4728
+ return asText(out);
4729
+ }
4730
+ });
4731
+ api.registerTool({
4732
+ name: "get_limit_up_pool",
4733
+ description: "\u83B7\u53D6A\u80A1\u6DA8\u505C\u6C60/\u6DA8\u505C\u677F\u590D\u76D8\u2014\u2014\u5F53\u65E5\u6DA8\u505C\u4E2A\u80A1\uFF0C\u542B\u8FDE\u677F\u6570\u3001\u5C01\u677F\u8D44\u91D1\u3001\u70B8\u677F\u6B21\u6570\u3001\u9996\u672B\u6B21\u5C01\u677F\u65F6\u95F4\u3001\u6240\u5C5E\u884C\u4E1A\u3002\u77ED\u7EBF\u60C5\u7EEA\u4E0E\u9F99\u5934\u6218\u6CD5\u6838\u5FC3\u6570\u636E",
4717
4734
  parameters: typebox_exports.Object({
4718
- market: typebox_exports.Optional(
4719
- typebox_exports.Union([typebox_exports.Literal("A")], { description: "\u5E02\u573A\uFF0C\u76EE\u524D\u4EC5\u652F\u6301 A" })
4735
+ date: typebox_exports.Optional(
4736
+ typebox_exports.String({ description: "\u65E5\u671F\uFF08YYYYMMDD\uFF09\uFF0C\u9ED8\u8BA4\u5F53\u65E5" })
4737
+ )
4738
+ }),
4739
+ async execute(_id, params) {
4740
+ const args = ["limit_up_pool"];
4741
+ if (params.date) args.push("--date", params.date);
4742
+ const out = await runPy("stock_data.py", args);
4743
+ return asText(out);
4744
+ }
4745
+ });
4746
+ api.registerTool({
4747
+ name: "get_dragon_tiger",
4748
+ description: "\u83B7\u53D6A\u80A1\u9F99\u864E\u699C\u2014\u2014\u4E0A\u699C\u4E2A\u80A1\u51C0\u4E70\u989D/\u4E70\u5165\u989D/\u5356\u51FA\u989D/\u4E0A\u699C\u539F\u56E0/\u89E3\u8BFB\uFF0C\u53EF\u6309\u4E2A\u80A1\u8FC7\u6EE4",
4749
+ parameters: typebox_exports.Object({
4750
+ date: typebox_exports.Optional(
4751
+ typebox_exports.String({ description: "\u65E5\u671F\uFF08YYYY-MM-DD\uFF09\uFF0C\u9ED8\u8BA4\u5F53\u65E5" })
4752
+ ),
4753
+ symbol: typebox_exports.Optional(
4754
+ typebox_exports.String({ description: "A\u80A1\u80A1\u7968\u4EE3\u7801\uFF08\u53EF\u9009\uFF0C\u6309\u4E2A\u80A1\u8FC7\u6EE4\uFF09\uFF0C\u5982 600519" })
4755
+ ),
4756
+ top: typebox_exports.Optional(
4757
+ typebox_exports.Number({ description: "\u8FD4\u56DE\u524DN\u6761\uFF0C\u9ED8\u8BA4 20" })
4758
+ )
4759
+ }),
4760
+ async execute(_id, params) {
4761
+ const args = ["dragon_tiger"];
4762
+ if (params.date) args.push("--date", params.date);
4763
+ if (params.symbol) args.push("--symbol", params.symbol);
4764
+ args.push("--top", String(params.top ?? 20));
4765
+ const out = await runPy("stock_data.py", args);
4766
+ return asText(out);
4767
+ }
4768
+ });
4769
+ api.registerTool({
4770
+ name: "get_hot_stocks",
4771
+ description: "\u83B7\u53D6A\u80A1\u5168\u5E02\u573A\u4EBA\u6C14\u70ED\u641C\u699C\uFF08\u4E1C\u65B9\u8D22\u5BCC\u4EBA\u6C14\u699C\uFF09",
4772
+ parameters: typebox_exports.Object({
4773
+ top: typebox_exports.Optional(
4774
+ typebox_exports.Number({ description: "\u8FD4\u56DE\u524DN\u53EA\uFF0C\u9ED8\u8BA4 20" })
4720
4775
  )
4721
4776
  }),
4722
4777
  async execute(_id, params) {
4723
4778
  const out = await runPy("stock_data.py", [
4724
- "market_stats",
4725
- "--market",
4726
- params.market ?? "A"
4779
+ "hot_stocks",
4780
+ "--top",
4781
+ String(params.top ?? 20)
4727
4782
  ]);
4728
4783
  return asText(out);
4729
4784
  }
4730
4785
  });
4731
4786
  api.registerTool({
4732
4787
  name: "get_fundamental_context",
4733
- description: "\u83B7\u53D6A\u80A1\u6DF1\u5EA6\u57FA\u672C\u9762\uFF08\u4F30\u503CPE/PB/PS + \u6210\u957F\u6027\u8425\u6536/\u51C0\u5229\u589E\u901F + \u76C8\u5229\u80FD\u529BROE/\u6BDB\u5229\u7387 + \u5206\u7EA2\u5386\u53F2\uFF09\u3002\u7528\u4E8E\u8BC4\u4F30\u516C\u53F8\u8D28\u5730\u4E0E\u957F\u671F\u6301\u6709\u4EF7\u503C\uFF1B\u5FEB\u901F\u67E5PE/PB\u7528 get_financials",
4788
+ description: "\u83B7\u53D6A\u80A1\u57FA\u672C\u9762\u4E0A\u4E0B\u6587\uFF08\u4F30\u503C PE/PB/\u5E02\u503C + \u8425\u6536/\u51C0\u5229\u589E\u901F + ROE/\u6BDB\u5229\u7387/\u51C0\u5229\u7387 + \u5206\u7EA2\u5386\u53F2\uFF09\u3002\u7528\u4E8E\u8BC4\u4F30\u516C\u53F8\u8D28\u5730\u4E0E\u957F\u671F\u6301\u6709\u4EF7\u503C",
4734
4789
  parameters: typebox_exports.Object({
4735
4790
  symbol: typebox_exports.String({ description: "A\u80A1\u80A1\u7968\u4EE3\u7801\uFF0C\u5982 600519" })
4736
4791
  }),
@@ -4756,7 +4811,7 @@ var index_default = definePluginEntry({
4756
4811
  typebox_exports.Number({ description: "\u8FD4\u56DE\u6392\u540D\u524DN\u7684\u80A1\u7968\uFF0C\u9ED8\u8BA4 20" })
4757
4812
  ),
4758
4813
  config: typebox_exports.Optional(
4759
- typebox_exports.String({ description: "\u81EA\u5B9A\u4E49\u7B5B\u9009\u914D\u7F6EYAML\u6587\u4EF6\u8DEF\u5F84\uFF08\u53EF\u9009\uFF09" })
4814
+ typebox_exports.String({ description: "\u81EA\u5B9A\u4E49\u7B5B\u9009\u914D\u7F6EYAML\u6587\u4EF6\u8DEF\u5F84\uFF0C\u4E0D\u586B\u7528\u9ED8\u8BA4\u914D\u7F6E" })
4760
4815
  ),
4761
4816
  l2: typebox_exports.Optional(
4762
4817
  typebox_exports.Boolean({ description: "\u5F00\u542FL2\u91CF\u5316\u589E\u5F3A\uFF08\u8D28\u91CF/\u6210\u957F/\u771F\u5B9E\u52A8\u91CF/\u6CE2\u52A8\u7387/\u8D44\u91D1\u6D41\u56E0\u5B50\uFF0C\u9010\u80A1\u6293\u53D6\u6570\u636E\u8F83\u6162\uFF09\uFF0C\u9ED8\u8BA4\u5173\u95ED" })
@@ -4781,7 +4836,7 @@ var index_default = definePluginEntry({
4781
4836
  description: "\u7B56\u7565\u56DE\u6D4B\uFF08AlphaEvo\uFF09\u3002\u8BFB\u53D6YAML\u7B56\u7565\u5B9A\u4E49\uFF0C\u5728\u5386\u53F2\u6570\u636E\u4E0A\u6A21\u62DF\u4EA4\u6613\uFF0C\u8F93\u51FA\u6536\u76CA\u7387/\u56DE\u64A4/\u80DC\u7387\u7B49\u6307\u6807\u3002\u53EA\u60F3\u77E5\u9053\u5355\u4E2A\u6280\u672F\u4FE1\u53F7\u7684\u5386\u53F2\u80DC\u7387\u7528\u66F4\u8F7B\u91CF\u7684 evaluate_signal",
4782
4837
  parameters: typebox_exports.Object({
4783
4838
  strategy: typebox_exports.String({ description: "\u7B56\u7565YAML\u6587\u4EF6\u8DEF\u5F84" }),
4784
- symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801" }),
4839
+ symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801\uFF08A\u80A1\u5982600519\uFF0C\u7F8E\u80A1\u5982AAPL\uFF0C\u6E2F\u80A1\u598200700.HK\uFF09" }),
4785
4840
  start: typebox_exports.Optional(
4786
4841
  typebox_exports.String({ description: "\u56DE\u6D4B\u8D77\u59CB\u65E5\u671F\uFF0C\u683C\u5F0F YYYY-MM-DD" })
4787
4842
  ),
@@ -4805,7 +4860,7 @@ var index_default = definePluginEntry({
4805
4860
  name: "evaluate_signal",
4806
4861
  description: "\u6280\u672F\u4FE1\u53F7\u5386\u53F2\u51C6\u786E\u7387\u8BC4\u4F30 \u2014 \u56DE\u6EAF\u5386\u53F2\u6570\u636E\uFF0C\u7EDF\u8BA1\u67D0\u4E2A\u6280\u672F\u4FE1\u53F7\u89E6\u53D1\u540EN\u65E5\u7684\u80DC\u7387\u548C\u5E73\u5747\u6536\u76CA\u3002\u652F\u63019\u79CD\u4FE1\u53F7\uFF1Amacd_golden_cross/macd_death_cross/rsi_oversold/rsi_overbought/breakout_20d/breakdown_20d/volume_surge/ma_golden_cross/ma_death_cross\u3002\u8981\u5B8C\u6574\u6A21\u62DF\u4EA4\u6613\u8FC7\u7A0B\u7528 run_backtest",
4807
4862
  parameters: typebox_exports.Object({
4808
- symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801" }),
4863
+ symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801\uFF08A\u80A1\u5982600519\uFF0C\u7F8E\u80A1\u5982AAPL\uFF0C\u6E2F\u80A1\u598200700.HK\uFF09" }),
4809
4864
  signal: typebox_exports.Union(
4810
4865
  [
4811
4866
  typebox_exports.Literal("macd_golden_cross"),
@@ -4912,11 +4967,25 @@ var index_default = definePluginEntry({
4912
4967
  return asText(out);
4913
4968
  }
4914
4969
  });
4970
+ api.registerTool({
4971
+ name: "get_trading_phase",
4972
+ description: "\u67E5\u8BE2\u67D0\u5E02\u573A\u5F53\u524D\u4EA4\u6613\u65F6\u6BB5\uFF08\u76D8\u524D/\u65E9\u76D8/\u5348\u95F4\u4F11\u5E02/\u5348\u76D8/\u4EA4\u6613\u4E2D/\u76D8\u540E/\u4F11\u5E02\uFF09\uFF0C\u7528\u4E8E\u6B63\u786E\u89E3\u8BFB\u5B9E\u65F6\u884C\u60C5\u7684\u76D8\u4E2D\u8BED\u4E49\u3002\u652F\u6301CN/HK/US/JP/KR/TW",
4973
+ parameters: typebox_exports.Object({
4974
+ market: typebox_exports.Union(
4975
+ [typebox_exports.Literal("CN"), typebox_exports.Literal("HK"), typebox_exports.Literal("US"), typebox_exports.Literal("JP"), typebox_exports.Literal("KR"), typebox_exports.Literal("TW")],
4976
+ { description: "\u5E02\u573A" }
4977
+ )
4978
+ }),
4979
+ async execute(_id, params) {
4980
+ const out = await runPy("trading_calendar.py", ["phase", params.market]);
4981
+ return asText(out);
4982
+ }
4983
+ });
4915
4984
  api.registerTool({
4916
4985
  name: "calculate_ma",
4917
4986
  description: "\u72EC\u7ACB\u5747\u7EBF\u8BA1\u7B97\u5668 \u2014 \u652F\u6301\u4EFB\u610F\u5468\u671FMA\uFF085/10/20/30/60/120/250\u6216\u81EA\u5B9A\u4E49\uFF09+ \u504F\u79BB\u5EA6 + \u5747\u7EBF\u6392\u5217 + \u91D1\u53C9\u6B7B\u53C9\u68C0\u6D4B\u3002\u53EA\u8981\u5747\u7EBF\u6570\u503C\u6216\u9700\u898130/120/250\u7B49\u975E\u9ED8\u8BA4\u5468\u671F\u65F6\u7528\u672C\u5DE5\u5177\uFF1B\u7EFC\u5408\u6280\u672F\u9762\u5206\u6790\u7528 get_technical_analysis",
4918
4987
  parameters: typebox_exports.Object({
4919
- symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801" }),
4988
+ symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801\uFF08A\u80A1\u5982600519\uFF0C\u7F8E\u80A1\u5982AAPL\uFF0C\u6E2F\u80A1\u598200700.HK\uFF09" }),
4920
4989
  periods: typebox_exports.Optional(
4921
4990
  typebox_exports.String({
4922
4991
  description: "\u9017\u53F7\u5206\u9694\u7684MA\u5468\u671F\u5217\u8868\uFF0C\u5982 5,10,20,60,120,250"
@@ -4947,7 +5016,7 @@ var index_default = definePluginEntry({
4947
5016
  name: "get_volume_analysis",
4948
5017
  description: "\u72EC\u7ACB\u91CF\u4EF7\u5206\u6790 \u2014 \u91CF\u4EF7\u76F8\u5173\u6027\u3001\u4E0A\u6DA8/\u4E0B\u8DCC\u65E5\u6210\u4EA4\u91CF\u5BF9\u6BD4\u3001\u91CF\u80FD\u8D8B\u52BF\u3001\u91CF\u4EF7\u6A21\u5F0F\u89E3\u8BFB\uFF08\u653E\u91CF\u4E0A\u6DA8/\u7F29\u91CF\u56DE\u8C03\u7B49\uFF09\u3002\u7EFC\u5408\u6280\u672F\u9762\u5224\u65AD\u7528 get_technical_analysis\uFF0C\u626B\u5F53\u65E5\u5F02\u52A8\u7528 detect_anomaly",
4949
5018
  parameters: typebox_exports.Object({
4950
- symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801" }),
5019
+ symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801\uFF08A\u80A1\u5982600519\uFF0C\u7F8E\u80A1\u5982AAPL\uFF0C\u6E2F\u80A1\u598200700.HK\uFF09" }),
4951
5020
  period: typebox_exports.Optional(
4952
5021
  typebox_exports.Union(
4953
5022
  [typebox_exports.Literal("daily"), typebox_exports.Literal("weekly"), typebox_exports.Literal("monthly")],
@@ -4972,7 +5041,7 @@ var index_default = definePluginEntry({
4972
5041
  });
4973
5042
  api.registerTool({
4974
5043
  name: "search_stock_news",
4975
- description: "\u591A\u5F15\u64CE\u80A1\u7968\u65B0\u95FB\u641C\u7D22\uFF08\u652F\u6301 Tavily/Brave/SerpAPI\uFF09\u3002\u9700\u914D\u7F6E\u5BF9\u5E94 API Key \u73AF\u5883\u53D8\u91CF\u3002get_news \u5FEB\u8BAF\u4E0D\u591F\u6216\u8981\u6309\u4E3B\u9898\u641C\u7D22\u65F6\u7528\u672C\u5DE5\u5177\uFF1B\u6DF1\u5EA66\u7EF4\u60C5\u62A5\u7528 search_comprehensive_intel",
5044
+ description: "\u591A\u5F15\u64CE\u80A1\u7968\u65B0\u95FB\u641C\u7D22\uFF08Tavily/Brave/SerpAPI/Bocha/SearXNG\uFF09\u3002\u9700\u914D\u7F6E\u81F3\u5C11\u4E00\u4E2A\u641C\u7D22\u6E90\u7684 Key \u6216 SearXNG URL\u3002get_news \u5FEB\u8BAF\u4E0D\u591F\u6216\u8981\u6309\u4E3B\u9898\u641C\u7D22\u65F6\u7528\uFF1B\u6DF1\u5EA66\u7EF4\u60C5\u62A5\u7528 search_comprehensive_intel",
4976
5045
  parameters: typebox_exports.Object({
4977
5046
  query: typebox_exports.String({ description: "\u641C\u7D22\u5173\u952E\u8BCD" }),
4978
5047
  count: typebox_exports.Optional(
@@ -4993,7 +5062,7 @@ var index_default = definePluginEntry({
4993
5062
  name: "search_comprehensive_intel",
4994
5063
  description: "\u80A1\u7968\u7EFC\u5408\u60C5\u62A5\u641C\u7D22 \u2014 \u4ECE6\u4E2A\u7EF4\u5EA6\uFF08\u65B0\u95FB/\u516C\u544A/\u884C\u60C5\u5206\u6790/\u98CE\u9669/\u4E1A\u7EE9/\u884C\u4E1A\uFF09\u641C\u7D22\u7EFC\u5408\u4FE1\u606F\u3002\u7528\u4E8E\u4E2A\u80A1\u7684\u6DF1\u5165\u7814\u7A76/\u5168\u9762\u8C03\u7814\uFF1B\u5FEB\u901F\u770B\u65B0\u95FB\u7528 get_news",
4995
5064
  parameters: typebox_exports.Object({
4996
- symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801" }),
5065
+ symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801\uFF08A\u80A1\u5982600519\uFF0C\u7F8E\u80A1\u5982AAPL\uFF0C\u6E2F\u80A1\u598200700.HK\uFF09" }),
4997
5066
  name: typebox_exports.Optional(
4998
5067
  typebox_exports.String({ description: "\u80A1\u7968\u540D\u79F0\uFF08\u53EF\u9009\uFF0C\u63D0\u5347\u641C\u7D22\u51C6\u786E\u5EA6\uFF09" })
4999
5068
  )
@@ -5009,7 +5078,7 @@ var index_default = definePluginEntry({
5009
5078
  name: "get_social_sentiment",
5010
5079
  description: "\u83B7\u53D6\u80A1\u7968\u793E\u4EA4\u5A92\u4F53\u60C5\u7EEA\u6570\u636E\u3002A\u80A1\uFF1A\u4E1C\u65B9\u8D22\u5BCC\u80A1\u5427\u70ED\u5EA6+\u96EA\u7403\u8BA8\u8BBA\u70ED\u5EA6\uFF08\u65E0\u9700\u914D\u7F6E\uFF09\uFF1B\u7F8E\u80A1/\u6E2F\u80A1\uFF1AReddit/X/Polymarket\u60C5\u7EEA\uFF08\u9700 SENTIMENT_API_KEY\uFF09\u3002\u81EA\u52A8\u6309\u5E02\u573A\u9009\u6570\u636E\u6E90\u3002\u9762\u5411\u4E2A\u80A1\u7EF4\u5EA6\uFF1B\u5168\u5E02\u573A\u70ED\u95E8\u8BA8\u8BBA\u7528 get_trending_sentiment",
5011
5080
  parameters: typebox_exports.Object({
5012
- symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801\uFF08\u5982 AAPL\uFF09" })
5081
+ symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801\uFF08A\u80A1\u5982600519\uFF0C\u7F8E\u80A1\u5982AAPL\uFF0C\u6E2F\u80A1\u598200700.HK\uFF09" })
5013
5082
  }),
5014
5083
  async execute(_id, params) {
5015
5084
  const out = await runPy("search_intel.py", ["sentiment", params.symbol]);
@@ -5018,7 +5087,7 @@ var index_default = definePluginEntry({
5018
5087
  });
5019
5088
  api.registerTool({
5020
5089
  name: "get_trending_sentiment",
5021
- description: "\u83B7\u53D6\u793E\u4EA4\u5A92\u4F53\u70ED\u95E8\u8D8B\u52BF\uFF08Reddit/X/Polymarket\u70ED\u95E8\u80A1\u7968\u8BA8\u8BBA\uFF09\u3002\u6570\u636E\u7F13\u5B5810\u5206\u949F\u3002\u9002\u7528\u4E8E\u53D1\u73B0\u5E02\u573A\u70ED\u70B9\uFF1B\u67E5\u4E2A\u80A1\u60C5\u7EEA\u7528 get_social_sentiment",
5090
+ description: "\u83B7\u53D6\u793E\u4EA4\u5A92\u4F53\u70ED\u95E8\u8D8B\u52BF\uFF08Reddit/X/Polymarket\u70ED\u95E8\u80A1\u7968\u8BA8\u8BBA\uFF09\u3002\u9002\u7528\u4E8E\u53D1\u73B0\u5E02\u573A\u70ED\u70B9\uFF1B\u67E5\u4E2A\u80A1\u60C5\u7EEA\u7528 get_social_sentiment",
5022
5091
  parameters: typebox_exports.Object({}),
5023
5092
  async execute() {
5024
5093
  const out = await runPy("search_intel.py", ["trending"]);
@@ -5038,9 +5107,9 @@ var index_default = definePluginEntry({
5038
5107
  });
5039
5108
  api.registerTool({
5040
5109
  name: "screen_risk",
5041
- description: "\u98CE\u9669\u4E13\u9879\u7B5B\u67E5 \u2014 7\u7EF4\u5EA6\u98CE\u9669\u68C0\u6D4B\uFF08\u4F30\u503C\u6781\u7AEF/\u6280\u672F\u9884\u8B66/\u89E3\u7981\u5230\u671F/\u5185\u90E8\u4EBA\u51CF\u6301/\u4E1A\u7EE9\u9884\u8B66/\u76D1\u7BA1\u5904\u7F5A/\u884C\u4E1A\u653F\u7B56\uFF09\uFF0C\u8FD4\u56DE\u98CE\u9669\u8BC4\u7EA7\u548C\u4E00\u7968\u5426\u51B3\u6807\u8BB0\u3002\u5165\u573A\u51B3\u7B56\u524D\u7684\u6392\u96F7\u5FC5\u8C03\u672C\u5DE5\u5177",
5110
+ description: "A\u80A1\u98CE\u9669\u4E13\u9879\u7B5B\u67E5 \u2014 \u68C0\u67E5\u4F30\u503C\u3001\u6280\u672F\u9884\u8B66\u3001\u89E3\u7981\u3001\u51CF\u6301\u3001\u4E1A\u7EE9\u9884\u8B66\u3001\u76D1\u7BA1\u548C\u884C\u4E1A\u653F\u7B56\uFF0C\u8FD4\u56DE\u98CE\u9669\u8BC4\u7EA7\u548C veto_buy\u3002\u65B0\u95FB\u641C\u7D22\u547D\u4E2D\u662F\u5F85\u6838\u5B9E\u7EBF\u7D22\uFF0C\u4E0D\u662F\u5DF2\u8BC1\u5B9E\u98CE\u9669",
5042
5111
  parameters: typebox_exports.Object({
5043
- symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801\uFF08\u5982 600519\uFF09" }),
5112
+ symbol: typebox_exports.String({ description: "A\u80A1\u80A1\u7968\u4EE3\u7801\uFF0C\u5982 600519" }),
5044
5113
  name: typebox_exports.Optional(
5045
5114
  typebox_exports.String({ description: "\u80A1\u7968\u540D\u79F0\uFF08\u53EF\u9009\uFF0C\u63D0\u5347\u65B0\u95FB\u641C\u7D22\u51C6\u786E\u5EA6\uFF09" })
5046
5115
  )
@@ -5124,7 +5193,7 @@ var index_default = definePluginEntry({
5124
5193
  description: "\u5F02\u5E38/\u4E8B\u4EF6\u68C0\u6D4B \u2014 \u4E00\u952E\u626B\u63CF\u80A1\u7968\u5F53\u524D\u6240\u6709\u5F02\u52A8\u4FE1\u53F7\uFF08MACD\u91D1\u53C9\u6B7B\u53C9\u3001RSI\u8D85\u4E70\u8D85\u5356\u300120\u65E5\u7A81\u7834\u3001\u653E\u91CF\u5F02\u52A8\u3001\u6DA8\u8DCC\u505C\u3001\u5E03\u6797\u7A81\u7834\u3001KDJ\u6781\u503C\u3001\u8D44\u91D1\u5F02\u52A8\u7B49\uFF09\uFF0C\u8FD4\u56DE\u7ED3\u6784\u5316\u5F02\u5E38\u5217\u8868\u3002\u5F53\u65E5\u5F02\u52A8\u5F52\u56E0\u7684\u9996\u9009\uFF1B\u7EFC\u5408\u6280\u672F\u9762\u5224\u65AD\u7528 get_technical_analysis",
5125
5194
  parameters: typebox_exports.Object({
5126
5195
  symbol: typebox_exports.String({
5127
- description: "\u80A1\u7968\u4EE3\u7801\uFF08\u5982 600519\u3001AAPL\u300100700.HK\uFF09"
5196
+ description: "\u80A1\u7968\u4EE3\u7801\uFF08A\u80A1\u5982600519\uFF0C\u7F8E\u80A1\u5982AAPL\uFF0C\u6E2F\u80A1\u598200700.HK\uFF09"
5128
5197
  })
5129
5198
  }),
5130
5199
  async execute(_id, params) {
@@ -5134,7 +5203,7 @@ var index_default = definePluginEntry({
5134
5203
  });
5135
5204
  api.registerTool({
5136
5205
  name: "diagnose_data_sources",
5137
- description: "\u6570\u636E\u6E90\u8BCA\u65AD \u2014 \u68C0\u67E5\u5F53\u524D\u73AF\u5883\u53EF\u7528\u7684\u6570\u636E provider\uFF08akshare/tushare/yfinance/finnhub/longbridge/alphavantage\uFF09\uFF0C\u8F93\u51FA\u6BCF\u4E2A\u5E02\u573A\u7684\u53EF\u7528\u94FE\u8DEF\u3001\u7F3A\u5931 env\u3001warnings\u3002\u5DE5\u5177\u62FF\u4E0D\u5230\u6570\u636E\u6216\u62A5\u9519\u65F6\u8C03\u7528\u6392\u67E5",
5206
+ description: "\u6570\u636E\u6E90\u8BCA\u65AD \u2014 \u68C0\u67E5\u5F53\u524D\u73AF\u5883\u5404\u6570\u636E provider \u7684\u5305\u4E0E\u51ED\u636E\u5C31\u7EEA\u60C5\u51B5\uFF08\u4E0D\u63A2\u6D4B\u7F51\u7EDC\u53EF\u8FBE\u6027\uFF09\uFF0C\u8F93\u51FA\u6BCF\u4E2A\u5E02\u573A\u7684\u53EF\u7528\u94FE\u8DEF\u3001\u7F3A\u5931 env\u3001warnings\u3002\u5DE5\u5177\u62FF\u4E0D\u5230\u6570\u636E\u6216\u62A5\u9519\u65F6\u8C03\u7528\u6392\u67E5",
5138
5207
  parameters: typebox_exports.Object({
5139
5208
  market: typebox_exports.Optional(
5140
5209
  typebox_exports.Union(
@@ -5182,9 +5251,9 @@ var index_default = definePluginEntry({
5182
5251
  });
5183
5252
  api.registerTool({
5184
5253
  name: "render_stock_report",
5185
- description: "\u80A1\u7968\u5206\u6790\u62A5\u544A\u6E32\u67D3 \u2014 \u5C06\u7ED3\u6784\u5316 JSON\uFF08\u7B26\u5408 schemas/report_schema.json\uFF09\u901A\u8FC7 j2 \u6A21\u677F\u6E32\u67D3\u4E3A Markdown\u3002template: brief|full\u3002\u5168\u90E8\u5206\u6790\u5B8C\u6210\u540E\u7684\u6700\u540E\u4E00\u6B65\u8C03\u7528\u3002\u4EC5\u6E32\u67D3\uFF0C\u4E0D\u4FDD\u5B58\u4E0D\u63A8\u9001",
5254
+ description: "\u80A1\u7968\u5206\u6790\u62A5\u544A\u6E32\u67D3 \u2014 \u5C06\u7ED3\u6784\u5316\u62A5\u544A JSON \u901A\u8FC7 j2 \u6A21\u677F\u6E32\u67D3\u4E3A Markdown\u3002report \u5B57\u6BB5\u4EE5 skill \u63D0\u4F9B\u7684 report_schema \u4E3A\u51C6\uFF0C\u4E0D\u8981\u81EA\u9020\u5B57\u6BB5\u3002template: brief|full\u3002\u5168\u90E8\u5206\u6790\u5B8C\u6210\u540E\u7684\u6700\u540E\u4E00\u6B65\u8C03\u7528\u3002\u4EC5\u6E32\u67D3\uFF0C\u4E0D\u4FDD\u5B58\u4E0D\u63A8\u9001",
5186
5255
  parameters: typebox_exports.Object({
5187
- report: typebox_exports.Object({}, { additionalProperties: true, description: "\u7ED3\u6784\u5316\u80A1\u7968\u62A5\u544A" }),
5256
+ report: typebox_exports.Object({}, { additionalProperties: true, description: "\u7ED3\u6784\u5316\u80A1\u7968\u62A5\u544A JSON" }),
5188
5257
  template: typebox_exports.Optional(
5189
5258
  typebox_exports.Union([typebox_exports.Literal("brief"), typebox_exports.Literal("full")], {
5190
5259
  description: "\u6A21\u677F\u7C7B\u578B\uFF0C\u9ED8\u8BA4 full"
@@ -5205,22 +5274,13 @@ var index_default = definePluginEntry({
5205
5274
  });
5206
5275
  api.registerTool({
5207
5276
  name: "render_market_report",
5208
- description: "\u5927\u76D8\u590D\u76D8\u62A5\u544A\u6E32\u67D3 \u2014 \u5C06\u7ED3\u6784\u5316 JSON\uFF08\u7B26\u5408 schemas/market_review_schema.json\uFF09\u901A\u8FC7 j2 \u6A21\u677F\u6E32\u67D3\u4E3A Markdown",
5277
+ description: "\u5927\u76D8\u590D\u76D8\u62A5\u544A\u6E32\u67D3 \u2014 \u5C06\u7ED3\u6784\u5316\u62A5\u544A JSON \u901A\u8FC7 j2 \u6A21\u677F\u6E32\u67D3\u4E3A Markdown\u3002report \u5B57\u6BB5\u4EE5 schemas/market_review_schema.json \u4E3A\u51C6\u3002\u4EC5\u6E32\u67D3\uFF0C\u4E0D\u4FDD\u5B58\u4E0D\u63A8\u9001",
5209
5278
  parameters: typebox_exports.Object({
5210
- report: typebox_exports.Object({}, { additionalProperties: true, description: "\u7ED3\u6784\u5316\u5E02\u573A\u590D\u76D8" }),
5211
- template: typebox_exports.Optional(
5212
- typebox_exports.Union([typebox_exports.Literal("full")], { description: "\u6A21\u677F\u7C7B\u578B\uFF0C\u9ED8\u8BA4 full" })
5213
- )
5279
+ report: typebox_exports.Object({}, { additionalProperties: true, description: "\u7ED3\u6784\u5316\u5E02\u573A\u590D\u76D8" })
5214
5280
  }),
5215
5281
  async execute(_id, params) {
5216
5282
  const b64 = Buffer.from(JSON.stringify(params.report), "utf-8").toString("base64");
5217
- const out = await runPy("report_renderer.py", [
5218
- "market",
5219
- "--template",
5220
- params.template ?? "full",
5221
- "--input-b64",
5222
- b64
5223
- ]);
5283
+ const out = await runPy("report_renderer.py", ["market", "--input-b64", b64]);
5224
5284
  return asText(out);
5225
5285
  }
5226
5286
  });
@@ -5250,7 +5310,7 @@ var index_default = definePluginEntry({
5250
5310
  name: "analyze_position_context",
5251
5311
  description: "\u6301\u4ED3\u4E0A\u4E0B\u6587\u5206\u6790 \u2014 \u8F93\u5165\u6210\u672C/\u4ED3\u4F4D/\u6B62\u635F\u6B62\u76C8\uFF0C\u7ED3\u5408\u73B0\u4EF7\u548C\u6280\u672F\u4F4D\u8F93\u51FA\u6D6E\u76C8\u4E8F\u3001\u79BB\u6B62\u635F\u8DDD\u79BB\u3001\u98CE\u9669\u7EA7\u522B\u3001\u64CD\u4F5C\u5EFA\u8BAE\u3002\u65E0\u72B6\u6001\u3001\u4E0D\u5B58\u8D26\u6237",
5252
5312
  parameters: typebox_exports.Object({
5253
- symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801" }),
5313
+ symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801\uFF08A\u80A1\u5982600519\uFF0C\u7F8E\u80A1\u5982AAPL\uFF0C\u6E2F\u80A1\u598200700.HK\uFF09" }),
5254
5314
  cost: typebox_exports.Number({ description: "\u6210\u672C\u4EF7" }),
5255
5315
  quantity: typebox_exports.Number({ description: "\u6301\u4ED3\u6570\u91CF" }),
5256
5316
  stop_loss: typebox_exports.Optional(typebox_exports.Number({ description: "\u6B62\u635F\u4EF7" })),
@@ -5279,7 +5339,7 @@ var index_default = definePluginEntry({
5279
5339
  name: "check_alert_rules",
5280
5340
  description: "\u65E0\u72B6\u6001\u544A\u8B66\u89C4\u5219\u68C0\u67E5 \u2014 \u4F20\u5165\u89C4\u5219\u6570\u7EC4\uFF0C\u8FD4\u56DE\u5F53\u524D\u662F\u5426\u89E6\u53D1\u3002\u89C4\u5219\u7C7B\u578B\uFF1Aprice_below/price_above/change_pct_above/change_pct_below/volume_ratio_above/anomaly/risk_veto/risk_level_at_least\u3002\u4E0D\u505A\u8C03\u5EA6\u4E0D\u5B58\u5386\u53F2",
5281
5341
  parameters: typebox_exports.Object({
5282
- symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801" }),
5342
+ symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801\uFF08A\u80A1\u5982600519\uFF0C\u7F8E\u80A1\u5982AAPL\uFF0C\u6E2F\u80A1\u598200700.HK\uFF09" }),
5283
5343
  rules: typebox_exports.Array(
5284
5344
  typebox_exports.Object({}, { additionalProperties: true }),
5285
5345
  { description: "\u89C4\u5219\u5217\u8868\uFF0C\u6BCF\u9879 { type, value }" }
@@ -5296,6 +5356,80 @@ var index_default = definePluginEntry({
5296
5356
  return asText(out);
5297
5357
  }
5298
5358
  });
5359
+ api.registerTool({
5360
+ name: "record_signal",
5361
+ description: "\u8BB0\u5F55\u4E00\u6761 AI \u5206\u6790\u5EFA\u8BAE\u4FE1\u53F7\uFF08\u65B9\u5411/\u5165\u573A\u4EF7/\u76EE\u6807\u4EF7/\u6B62\u635F\u4EF7/\u6301\u6709\u671F\u9650\uFF09\uFF0C\u4F9B\u540E\u7EED\u80DC\u7387\u8BC4\u4F30\u3002\u4FE1\u53F7\u6301\u4E45\u5316\u5728\u672C\u5730 JSONL\uFF08$STOCK_SIGNAL_STORE \u6216 ~/.stock-analysis/signals.jsonl\uFF09\uFF0C\u5BBF\u4E3B Agent \u81EA\u884C\u51B3\u5B9A\u4F55\u65F6 record/evaluate",
5362
+ parameters: typebox_exports.Object({
5363
+ symbol: typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801\uFF08A\u80A1\u5982600519\uFF0C\u7F8E\u80A1\u5982AAPL\uFF0C\u6E2F\u80A1\u598200700.HK\uFF09" }),
5364
+ direction: typebox_exports.Union([typebox_exports.Literal("buy"), typebox_exports.Literal("sell")], {
5365
+ description: "\u5EFA\u8BAE\u65B9\u5411"
5366
+ }),
5367
+ entry_price: typebox_exports.Optional(typebox_exports.Number({ description: "\u5165\u573A\u4EF7\uFF08\u53EF\u9009\uFF09" })),
5368
+ target_price: typebox_exports.Optional(typebox_exports.Number({ description: "\u76EE\u6807\u4EF7\uFF08\u53EF\u9009\uFF09" })),
5369
+ stop_price: typebox_exports.Optional(typebox_exports.Number({ description: "\u6B62\u635F\u4EF7\uFF08\u53EF\u9009\uFF09" })),
5370
+ horizon_days: typebox_exports.Optional(
5371
+ typebox_exports.Number({ description: "\u6301\u6709\u671F\u9650\uFF08\u4EA4\u6613\u65E5\uFF09\uFF0C\u9ED8\u8BA4 10" })
5372
+ ),
5373
+ source: typebox_exports.Optional(
5374
+ typebox_exports.String({ description: "\u4FE1\u53F7\u6765\u6E90\uFF08\u5982\u89E6\u53D1\u8BE5\u5EFA\u8BAE\u7684 skill \u540D\uFF09" })
5375
+ ),
5376
+ note: typebox_exports.Optional(typebox_exports.String({ description: "\u5907\u6CE8\uFF08\u53EF\u9009\uFF09" }))
5377
+ }),
5378
+ async execute(_id, params) {
5379
+ const args = [
5380
+ "record",
5381
+ params.symbol,
5382
+ "--direction",
5383
+ params.direction,
5384
+ "--horizon-days",
5385
+ String(params.horizon_days ?? 10)
5386
+ ];
5387
+ if (params.entry_price !== void 0) args.push("--entry-price", String(params.entry_price));
5388
+ if (params.target_price !== void 0) args.push("--target-price", String(params.target_price));
5389
+ if (params.stop_price !== void 0) args.push("--stop-price", String(params.stop_price));
5390
+ if (params.source) args.push("--source", params.source);
5391
+ if (params.note) args.push("--note", params.note);
5392
+ const out = await runPy("signal_tracker.py", args);
5393
+ return asText(out);
5394
+ }
5395
+ });
5396
+ api.registerTool({
5397
+ name: "evaluate_signals",
5398
+ description: "\u8BC4\u4F30\u5230\u671F\u4FE1\u53F7\uFF1A\u62C9\u53D6\u8BB0\u5F55\u65E5\u4E4B\u540E\u7684\u65E5K\uFF0C\u5224\u5B9A target_hit/stop_hit/timeout \u5E76\u8BA1\u7B97\u6536\u76CA\uFF0C\u56DE\u5199\u5B58\u50A8\u3002\u8BB0\u5F55\u5EFA\u8BAE\u7528 record_signal\uFF0C\u80DC\u7387\u590D\u76D8\u7528 get_signal_summary",
5399
+ parameters: typebox_exports.Object({
5400
+ symbol: typebox_exports.Optional(
5401
+ typebox_exports.String({ description: "\u80A1\u7968\u4EE3\u7801\uFF08\u53EF\u9009\uFF0C\u53EA\u8BC4\u4F30\u8BE5\u80A1\u7684\u4FE1\u53F7\uFF09" })
5402
+ )
5403
+ }),
5404
+ async execute(_id, params) {
5405
+ const args = ["evaluate"];
5406
+ if (params.symbol) args.push("--symbol", params.symbol);
5407
+ const out = await runPy("signal_tracker.py", args);
5408
+ return asText(out);
5409
+ }
5410
+ });
5411
+ api.registerTool({
5412
+ name: "get_signal_summary",
5413
+ description: "\u4FE1\u53F7\u80DC\u7387\u6C47\u603B\uFF08\u53EF\u6309 source/symbol/status \u8FC7\u6EE4\uFF09\uFF1A\u80DC\u7387\u3001\u5E73\u5747\u6536\u76CA\u3001\u7ED3\u679C\u5206\u5E03\u4E0E\u660E\u7EC6",
5414
+ parameters: typebox_exports.Object({
5415
+ source: typebox_exports.Optional(typebox_exports.String({ description: "\u6309\u4FE1\u53F7\u6765\u6E90\u8FC7\u6EE4\uFF08\u53EF\u9009\uFF09" })),
5416
+ symbol: typebox_exports.Optional(typebox_exports.String({ description: "\u6309\u80A1\u7968\u4EE3\u7801\u8FC7\u6EE4\uFF08\u53EF\u9009\uFF09" })),
5417
+ status: typebox_exports.Optional(
5418
+ typebox_exports.Union(
5419
+ [typebox_exports.Literal("open"), typebox_exports.Literal("closed"), typebox_exports.Literal("all")],
5420
+ { description: "open=\u672A\u7ED3\u7B97\uFF0Cclosed=\u5DF2\u7ED3\u7B97\uFF0Call=\u5168\u90E8\uFF08\u9ED8\u8BA4\uFF09" }
5421
+ )
5422
+ )
5423
+ }),
5424
+ async execute(_id, params) {
5425
+ const args = ["summary"];
5426
+ if (params.source) args.push("--source", params.source);
5427
+ if (params.symbol) args.push("--symbol", params.symbol);
5428
+ args.push("--status", params.status ?? "all");
5429
+ const out = await runPy("signal_tracker.py", args);
5430
+ return asText(out);
5431
+ }
5432
+ });
5299
5433
  api.registerTool({
5300
5434
  name: "parse_stock_list",
5301
5435
  description: "\u81EA\u9009\u80A1/\u6587\u672C\u5BFC\u5165\u89E3\u6790 \u2014 \u4ECE\u81EA\u7136\u8BED\u8A00\u3001CSV\u3001Markdown \u8868\u683C\u63D0\u53D6\u80A1\u7968\uFF0C\u81EA\u52A8\u8BC6\u522B A \u80A1 6 \u4F4D\u4EE3\u7801\u3001\u6E2F\u80A1 xxxxx.HK\u3001\u7F8E\u80A1 ticker\u3001\u65E5\u80A1 xxxx.T\u3001\u97E9\u80A1 xxxxxx.KS/KQ\u3001\u53F0\u80A1 xxxx.TW\uFF0C\u5E76\u8C03\u7528 name_resolver \u5904\u7406\u4E2D\u6587\u80A1\u7968\u540D",