echopai 2.0.0 → 2.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.
@@ -165,72 +165,6 @@ export const OPERATIONS = {
165
165
  "additionalProperties": false
166
166
  }
167
167
  },
168
- "backtest.excess-distribution": {
169
- "cliKey": "backtest.excess-distribution",
170
- "cliName": "backtest excess-distribution",
171
- "method": "GET",
172
- "path": "/v1/backtest/excess-distribution",
173
- "description": "信号相对基准(沪深 300 / 中证 1000 等)持有期超额收益的直方分布。",
174
- "summary": "Excess-return distribution over a benchmark",
175
- "positional": [],
176
- "outputDefault": "json",
177
- "pagination": "none",
178
- "stream": false,
179
- "billable": false,
180
- "idempotencyRequired": false,
181
- "scopesAny": [],
182
- "sideEffect": "read",
183
- "dryRunSupported": false,
184
- "inputSchema": {
185
- "type": "object",
186
- "properties": {},
187
- "additionalProperties": false
188
- }
189
- },
190
- "backtest.rolling-win-rate": {
191
- "cliKey": "backtest.rolling-win-rate",
192
- "cliName": "backtest rolling-win-rate",
193
- "method": "GET",
194
- "path": "/v1/backtest/rolling-win-rate",
195
- "description": "信号在滚动窗口(默认 60 个交易日)内的胜率时间序列。",
196
- "summary": "Rolling win rate of a signal series",
197
- "positional": [],
198
- "outputDefault": "json",
199
- "pagination": "none",
200
- "stream": false,
201
- "billable": false,
202
- "idempotencyRequired": false,
203
- "scopesAny": [],
204
- "sideEffect": "read",
205
- "dryRunSupported": false,
206
- "inputSchema": {
207
- "type": "object",
208
- "properties": {},
209
- "additionalProperties": false
210
- }
211
- },
212
- "backtest.summary": {
213
- "cliKey": "backtest.summary",
214
- "cliName": "backtest summary",
215
- "method": "GET",
216
- "path": "/v1/backtest/summary",
217
- "description": "信号回测汇总:胜率、平均超额收益、Sharpe-like 评分、最大回撤等。",
218
- "summary": "Backtest summary metrics for a signal series",
219
- "positional": [],
220
- "outputDefault": "json",
221
- "pagination": "none",
222
- "stream": false,
223
- "billable": false,
224
- "idempotencyRequired": false,
225
- "scopesAny": [],
226
- "sideEffect": "read",
227
- "dryRunSupported": false,
228
- "inputSchema": {
229
- "type": "object",
230
- "properties": {},
231
- "additionalProperties": false
232
- }
233
- },
234
168
  "bars.daily": {
235
169
  "cliKey": "bars.daily",
236
170
  "cliName": "bars daily",
@@ -437,7 +371,7 @@ export const OPERATIONS = {
437
371
  "cliName": "digest get",
438
372
  "method": "GET",
439
373
  "path": "/v1/digest/{code}",
440
- "description": "Composite endpoint: in one HTTP call returns views (PRIMARY research),\nresearch-entity performance (quality layer), real-time quote, market\nsentiment context, and supplementary news. Partial-failure tolerant:\neach bucket is independently fetched and per-bucket failures surface\nin `meta.partial_failures[]` rather than poisoning the response. If\nevery sub-bucket fails the endpoint returns 502.\n\nBucket scopes are checked *per bucket* (not at gateway level): a\ntoken with only `views:read` gets the views bucket populated and the\nrest reported as `scope_insufficient` partial failures. This mirrors\nthe CLI fan-out contract exactly so `echopai digest` can either call\nthis endpoint (preferred, single round-trip) or fall back to local\nfan-out without behavior drift.\n\nSee `docs/PLAN_CLI_V2_AGENT_SURFACE.md` §3.3 (digest spec) and §11\nPhase 5.2 (server endpoint).\n",
374
+ "description": "Composite endpoint: in one HTTP call returns views (PRIMARY research),\nreal-time quote, valuation snapshot (PE/PB/PS/换手率/股息率/量比 14 字段),\nmarket sentiment context, and supplementary news.\nPartial-failure tolerant:\neach bucket is independently fetched and per-bucket failures surface\nin `meta.partial_failures[]` rather than poisoning the response. If\nevery sub-bucket fails the endpoint returns 502.\n\nBucket scopes are checked *per bucket* (not at gateway level): a\ntoken with only `views:read` gets the views bucket populated and the\nrest reported as `scope_insufficient` partial failures. This mirrors\nthe CLI fan-out contract exactly so `echopai digest` can either call\nthis endpoint (preferred, single round-trip) or fall back to local\nfan-out without behavior drift.\n\nSee `docs/PLAN_CLI_V2_AGENT_SURFACE.md` §3.3 (digest spec) and §11\nPhase 5.2 (server endpoint).\n",
441
375
  "summary": "One-shot research digest for a single security (composite)",
442
376
  "positional": [
443
377
  "code"
@@ -486,6 +420,325 @@ export const OPERATIONS = {
486
420
  ]
487
421
  }
488
422
  },
423
+ "financials.pit": {
424
+ "cliKey": "financials.pit",
425
+ "cliName": "financials pit",
426
+ "method": "GET",
427
+ "path": "/v1/financials/pit",
428
+ "description": "基于 TDX 财务数据的 Point-in-time 查询。给定 `code` 和 `date`,返回该\n`trade_date` 当时市场上可见的最新一期财务报告(`announce_date <= date`,\n无公告日时保守延迟 90 天)。专为回测、AI agent、量化策略防未来函数泄漏。\n\n返回字段包括:EPS(基本/扣非/稀释)、BPS、ROE、毛利率、营收/净利润/总资产/\n归母权益等核心 ~25 字段。\n",
429
+ "summary": "Point-in-time financial indicators for one A-share at a given date",
430
+ "positional": [],
431
+ "outputDefault": "json",
432
+ "pagination": "none",
433
+ "stream": false,
434
+ "billable": true,
435
+ "idempotencyRequired": false,
436
+ "scopesAny": [
437
+ "financials:read"
438
+ ],
439
+ "sideEffect": "read",
440
+ "dryRunSupported": false,
441
+ "inputSchema": {
442
+ "type": "object",
443
+ "properties": {
444
+ "code": {
445
+ "type": "string",
446
+ "pattern": "^(SSE|SZSE|BSE|SH|SZ|BJ):[0-9]{6}$",
447
+ "description": "Canonical A-share code.",
448
+ "example": "SSE:600519"
449
+ },
450
+ "date": {
451
+ "type": "string",
452
+ "format": "date",
453
+ "description": "Trade date in YYYY-MM-DD; defaults to today.",
454
+ "example": "2024-11-01"
455
+ }
456
+ },
457
+ "additionalProperties": false,
458
+ "required": [
459
+ "code"
460
+ ]
461
+ }
462
+ },
463
+ "financials.quote-snapshot": {
464
+ "cliKey": "financials.quote-snapshot",
465
+ "cliName": "financials quote-snapshot",
466
+ "method": "GET",
467
+ "path": "/v1/financials/quote-snapshot",
468
+ "description": "一站式估值快照 —— 一次返回 14 个字段,**全部基于 TDX 原始数据 + Sina 实时\n价自算,不依赖 Tushare**:\n\n- 估值: `pe` / `pe_ttm` / `pb` / `ps` / `ps_ttm`\n- 股本(万股): `total_share` / `float_share` / `free_share`\n- 市值(万元): `total_mv` / `circ_mv`\n- 流动性: `turnover_rate` / `turnover_rate_f`(%)/ `volume_ratio`(倍)\n- 分红: `dv_ratio` / `dv_ttm`(%)\n\n计算口径:\n- PE-TTM = 当前总市值 / 近 4 季度滚动净利润(PIT 表 `ni_parent_ttm`)\n- PE = 当前总市值 / 上年报净利润(`ni_parent_last1y`)\n- PB = 当前总市值 / 归母净资产(`equity_parent`,PIT 防穿越)\n- 换手率 = 当日累计成交量 / 流通股本 × 100\n- 量比 = 当日累计 / 近 5 日同时段累计平均(实时模式)\n / 近 5 日全日成交量平均(指定历史日期模式)\n- 股息率 = Σ(去年 / 近12月内派息事件 派现/10) / 现价 × 100\n\n默认 `date` 留空 → 实时(Sina 5s 快照价 + 当日累计成交量);\n给 `date=YYYY-MM-DD` 则按当日 close 取值(用于历史回测 / 校验)。\n\n财报数据走 `security_financial_indicators_pit` PIT 视图:保证 `visible_date`\n≤ trade_date,避免未来函数。\n\n准确性已对照 Tushare `daily_basic` 校验(见 `scripts/validation/validate_quote_snapshot_vs_tushare.py`)。\n",
469
+ "summary": "Real-time valuation / share / turnover snapshot for one A-share",
470
+ "positional": [],
471
+ "outputDefault": "json",
472
+ "pagination": "none",
473
+ "stream": false,
474
+ "billable": true,
475
+ "idempotencyRequired": false,
476
+ "scopesAny": [
477
+ "financials:read"
478
+ ],
479
+ "sideEffect": "read",
480
+ "dryRunSupported": false,
481
+ "inputSchema": {
482
+ "type": "object",
483
+ "properties": {
484
+ "code": {
485
+ "type": "string",
486
+ "pattern": "^(SSE|SZSE|BSE|SH|SZ|BJ):[0-9]{6}$",
487
+ "description": "Canonical A-share code.",
488
+ "example": "SSE:600519"
489
+ },
490
+ "date": {
491
+ "type": "string",
492
+ "format": "date",
493
+ "description": "Trade date YYYY-MM-DD; omit for real-time (Redis snapshot price).\n",
494
+ "example": "2026-05-13"
495
+ }
496
+ },
497
+ "additionalProperties": false,
498
+ "required": [
499
+ "code"
500
+ ]
501
+ }
502
+ },
503
+ "financials.reports": {
504
+ "cliKey": "financials.reports",
505
+ "cliName": "financials reports",
506
+ "method": "GET",
507
+ "path": "/v1/financials/reports",
508
+ "description": "返回该股票最近 N 期财务报告的核心指标(EPS/BPS/ROE/毛利率/营收/净利润/总\n资产/归母权益/经营现金流/总股本 等 ~25 字段)。可按 `kind` 过滤季报/半年报/\n年报。每期 `announce_date` 字段告知何时市场可见,建议结合回测时使用。\n",
509
+ "summary": "Recent financial reports for one A-share security",
510
+ "positional": [],
511
+ "outputDefault": "json",
512
+ "pagination": "none",
513
+ "stream": false,
514
+ "billable": true,
515
+ "idempotencyRequired": false,
516
+ "scopesAny": [
517
+ "financials:read"
518
+ ],
519
+ "sideEffect": "read",
520
+ "dryRunSupported": false,
521
+ "inputSchema": {
522
+ "type": "object",
523
+ "properties": {
524
+ "code": {
525
+ "type": "string",
526
+ "pattern": "^(SSE|SZSE|BSE|SH|SZ|BJ):[0-9]{6}$",
527
+ "description": "Canonical A-share code.",
528
+ "example": "SSE:600519"
529
+ },
530
+ "limit": {
531
+ "type": "integer",
532
+ "minimum": 1,
533
+ "maximum": 100,
534
+ "default": 12,
535
+ "description": "Max periods to return (1-100, default 12)."
536
+ },
537
+ "kind": {
538
+ "type": "string",
539
+ "enum": [
540
+ "Q1",
541
+ "H1",
542
+ "Q3",
543
+ "annual",
544
+ "preliminary"
545
+ ],
546
+ "description": "Filter by report kind."
547
+ }
548
+ },
549
+ "additionalProperties": false,
550
+ "required": [
551
+ "code"
552
+ ]
553
+ }
554
+ },
555
+ "financials.series": {
556
+ "cliKey": "financials.series",
557
+ "cliName": "financials series",
558
+ "method": "GET",
559
+ "path": "/v1/financials/series",
560
+ "description": "返回某只股票某个财务指标的历史时间序列(按报告期排列)。`metric` 是\nindicators 表中的字段名(如 `roe_simple` / `revenue` / `ni_parent` /\n`debt_asset_ratio` / `gross_margin` / `eps_basic` 等共 150 个)。\n\n典型用法:画茅台 10 年 ROE 走势、对比 5 只白酒股 net_margin。\n",
561
+ "summary": "Time series of a single financial metric for one security",
562
+ "positional": [],
563
+ "outputDefault": "json",
564
+ "pagination": "none",
565
+ "stream": false,
566
+ "billable": true,
567
+ "idempotencyRequired": false,
568
+ "scopesAny": [
569
+ "financials:read"
570
+ ],
571
+ "sideEffect": "read",
572
+ "dryRunSupported": false,
573
+ "inputSchema": {
574
+ "type": "object",
575
+ "properties": {
576
+ "code": {
577
+ "type": "string",
578
+ "pattern": "^(SSE|SZSE|BSE|SH|SZ|BJ):[0-9]{6}$",
579
+ "description": "Canonical A-share code.",
580
+ "example": "SSE:600519"
581
+ },
582
+ "metric": {
583
+ "type": "string",
584
+ "minLength": 1,
585
+ "maxLength": 64,
586
+ "description": "Indicator field name (e.g. roe_simple, revenue, ni_parent).",
587
+ "example": "roe_simple"
588
+ },
589
+ "from": {
590
+ "type": "string",
591
+ "format": "date",
592
+ "description": "Inclusive earliest report_date."
593
+ },
594
+ "to": {
595
+ "type": "string",
596
+ "format": "date",
597
+ "description": "Inclusive latest report_date."
598
+ },
599
+ "limit": {
600
+ "type": "integer",
601
+ "minimum": 1,
602
+ "maximum": 200,
603
+ "default": 40,
604
+ "description": "Max points (1-200, default 40)."
605
+ }
606
+ },
607
+ "additionalProperties": false,
608
+ "required": [
609
+ "code",
610
+ "metric"
611
+ ]
612
+ }
613
+ },
614
+ "index.daily-bars": {
615
+ "cliKey": "index.daily-bars",
616
+ "cliName": "index daily-bars",
617
+ "method": "GET",
618
+ "path": "/v1/index/bars/daily",
619
+ "description": "指数日线 OHLC。覆盖 v2 表中的指数(上证综指 `SSE:000001` / 深证成指\n`SZSE:399001` / 沪深300 `SSE:000300` / 北证50 `BSE:899050` / 中证系列 `CSI:000922` 等)。\n与 `/v1/bars/daily` 同语义,但 index 没有 `turnover_rate` / `paused` 等股票特有字段。\n",
620
+ "summary": "Daily OHLC bars for one A-share index",
621
+ "positional": [],
622
+ "outputDefault": "json",
623
+ "pagination": "none",
624
+ "stream": false,
625
+ "billable": true,
626
+ "idempotencyRequired": false,
627
+ "scopesAny": [
628
+ "quote:l1",
629
+ "quote:l2",
630
+ "quote:delayed"
631
+ ],
632
+ "sideEffect": "read",
633
+ "dryRunSupported": false,
634
+ "inputSchema": {
635
+ "type": "object",
636
+ "properties": {
637
+ "code": {
638
+ "type": "string",
639
+ "description": "Canonical index code.",
640
+ "example": "SSE:000001"
641
+ },
642
+ "from": {
643
+ "type": "string",
644
+ "format": "date",
645
+ "description": "Inclusive start date (YYYY-MM-DD).",
646
+ "example": "2024-01-01"
647
+ },
648
+ "to": {
649
+ "type": "string",
650
+ "format": "date",
651
+ "description": "Inclusive end date.",
652
+ "example": "2024-12-31"
653
+ }
654
+ },
655
+ "additionalProperties": false,
656
+ "required": [
657
+ "code",
658
+ "from",
659
+ "to"
660
+ ]
661
+ }
662
+ },
663
+ "index.minute-bars": {
664
+ "cliKey": "index.minute-bars",
665
+ "cliName": "index minute-bars",
666
+ "method": "GET",
667
+ "path": "/v1/index/bars/minute",
668
+ "description": "指数 1min OHLC。日期范围 ≤ 7 天(与 `/v1/bars/minute-batch` 对齐)。\n返回 `bar_time` / `trade_date` / OHLC / volume / amount / pct_change。\n",
669
+ "summary": "Minute OHLC bars for one A-share index",
670
+ "positional": [],
671
+ "outputDefault": "json",
672
+ "pagination": "none",
673
+ "stream": false,
674
+ "billable": true,
675
+ "idempotencyRequired": false,
676
+ "scopesAny": [
677
+ "quote:l1",
678
+ "quote:l2",
679
+ "quote:delayed"
680
+ ],
681
+ "sideEffect": "read",
682
+ "dryRunSupported": false,
683
+ "inputSchema": {
684
+ "type": "object",
685
+ "properties": {
686
+ "code": {
687
+ "type": "string",
688
+ "description": "Canonical index code.",
689
+ "example": "SSE:000001"
690
+ },
691
+ "from": {
692
+ "type": "string",
693
+ "format": "date",
694
+ "description": "Inclusive start date (YYYY-MM-DD)."
695
+ },
696
+ "to": {
697
+ "type": "string",
698
+ "format": "date",
699
+ "description": "Inclusive end date. Range ≤ 7 calendar days."
700
+ }
701
+ },
702
+ "additionalProperties": false,
703
+ "required": [
704
+ "code",
705
+ "from",
706
+ "to"
707
+ ]
708
+ }
709
+ },
710
+ "index.snapshot": {
711
+ "cliKey": "index.snapshot",
712
+ "cliName": "index snapshot",
713
+ "method": "GET",
714
+ "path": "/v1/index/snapshot",
715
+ "description": "Returns the latest real-time snapshot for the 172 indices that Sina\nexposes a quote for (SSE / SZSE / BSE — includes 北证50 `BSE:899050`\nand 专精特新 `899601.BJ`). Source is the Redis hash\n`stockpulse:index_snapshots:latest` which the Rust collector refreshes\nevery ~15 seconds during market hours; outside trading hours the last\nintraday snapshot is returned.\n\nUse `codes` to narrow to a subset (canonical format `SSE:000001` (exchange-prefix; legacy `000001.SH` is also accepted but discouraged)).\nOmit to receive all 172.\n\nNote: CSI-series indices (e.g. `CSI:000922`) are not available here —\nSina has no quote feed for them. Daily/minute history for those still\nlives behind `/api/internal/index/{daily-bars,minute-bars-range}`.\n\nRequires `quote:l1`, `quote:l2`, or `quote:delayed` scope.\n",
716
+ "summary": "Real-time snapshot of all Sina-OK A-share indices (172 indices)",
717
+ "positional": [],
718
+ "outputDefault": "json",
719
+ "pagination": "none",
720
+ "stream": false,
721
+ "billable": true,
722
+ "idempotencyRequired": false,
723
+ "scopesAny": [
724
+ "quote:l1",
725
+ "quote:l2",
726
+ "quote:delayed"
727
+ ],
728
+ "sideEffect": "read",
729
+ "dryRunSupported": false,
730
+ "inputSchema": {
731
+ "type": "object",
732
+ "properties": {
733
+ "codes": {
734
+ "type": "string",
735
+ "description": "Comma-separated canonical index codes (e.g. `SSE:000001,SZSE:399001,BSE:899050`).\nOmit to return all 172.\n",
736
+ "example": "SSE:000001,SZSE:399001,BSE:899050"
737
+ }
738
+ },
739
+ "additionalProperties": false
740
+ }
741
+ },
489
742
  "market.status": {
490
743
  "cliKey": "market.status",
491
744
  "cliName": "market status",
@@ -540,7 +793,7 @@ export const OPERATIONS = {
540
793
  "cliName": "news get",
541
794
  "method": "GET",
542
795
  "path": "/v1/news/{news_id}",
543
- "description": "返回新闻完整内容:title、content snippet、source URL、tagged securities。",
796
+ "description": "返回新闻完整内容:title、content snippet、tagged securities。(采集端字段 source / source_id / source_url 对外不暴露,admin 路径 /v1/admin/news/{id} 可见。)",
544
797
  "summary": "Fetch a single news item by id",
545
798
  "positional": [
546
799
  "news_id"
@@ -620,7 +873,7 @@ export const OPERATIONS = {
620
873
  "cliName": "news search",
621
874
  "method": "GET",
622
875
  "path": "/v1/news/search",
623
- "description": "Full-text search recent news / market briefs. Returns title, source, published_at, snippet, tagged securities. Requires `news:read` scope. Note: news fields are user-generated; meta.untrusted_text_fields lists fields that need sanitization before passing to an LLM.",
876
+ "description": "Full-text search recent news / market briefs. Returns title, published_at, snippet, tagged securities. (Internal collector identifiers — `source`/`source_id`/`source_url` — are NOT exposed publicly; admin tools see them via /v1/admin/*.) Requires `news:read` scope. Note: news fields are user-generated; meta.untrusted_text_fields lists fields that need sanitization before passing to an LLM.",
624
877
  "summary": "Full-text search recent news",
625
878
  "positional": [],
626
879
  "outputDefault": "json",
@@ -664,28 +917,6 @@ export const OPERATIONS = {
664
917
  ]
665
918
  }
666
919
  },
667
- "news.sources": {
668
- "cliKey": "news.sources",
669
- "cliName": "news sources",
670
- "method": "GET",
671
- "path": "/v1/news/sources",
672
- "description": "返回新闻 source 标识列表(如 `cls`、`jin10`、`twitter`、`wallstreetcn`),可用于 list/search 的 source 过滤。",
673
- "summary": "List canonical news source identifiers",
674
- "positional": [],
675
- "outputDefault": "json",
676
- "pagination": "none",
677
- "stream": false,
678
- "billable": false,
679
- "idempotencyRequired": false,
680
- "scopesAny": [],
681
- "sideEffect": "read",
682
- "dryRunSupported": false,
683
- "inputSchema": {
684
- "type": "object",
685
- "properties": {},
686
- "additionalProperties": false
687
- }
688
- },
689
920
  "payment.plans": {
690
921
  "cliKey": "payment.plans",
691
922
  "cliName": "payment plans",
@@ -796,45 +1027,81 @@ export const OPERATIONS = {
796
1027
  "additionalProperties": false
797
1028
  }
798
1029
  },
799
- "research.entity-performance": {
800
- "cliKey": "research.entity-performance",
801
- "cliName": "research entity-performance",
1030
+ "search.semantic": {
1031
+ "cliKey": "search.semantic",
1032
+ "cliName": "search semantic",
802
1033
  "method": "GET",
803
- "path": "/v1/research-entities/{entity_id}/performance",
804
- "description": "单个研究实体的细化绩效指标,对照 `/v1/research-entities/performance`。",
805
- "summary": "Performance of one research entity",
806
- "positional": [
807
- "entity_id"
808
- ],
1034
+ "path": "/v1/search",
1035
+ "description": "语义 + 模糊泛化搜索。结合 entity 精确匹配(公司代码/分析师)、向量召回(pgvector\n+ DashScope embedding)、trigram 模糊、ILIKE 精确四路召回,RRF 融合后用 reranker\n精排,叠时间衰减 + views 加权(views 主源优先)。\n\n- 搜\"锂电池\"会带出新能源产业链(正极/负极/碳酸锂/宁德时代…)\n- 搜\"芯片\"会带出存储芯片/洁净室/晶圆代工…\n- mode=exact 兼容老 ILIKE 行为,仅在精确关键词命中时返回。\n",
1036
+ "summary": "Hybrid semantic search across news + analyst views",
1037
+ "positional": [],
809
1038
  "outputDefault": "json",
810
1039
  "pagination": "none",
811
1040
  "stream": false,
812
- "billable": false,
1041
+ "billable": true,
813
1042
  "idempotencyRequired": false,
814
- "scopesAny": [],
1043
+ "scopesAny": [
1044
+ "news:read",
1045
+ "views:read"
1046
+ ],
815
1047
  "sideEffect": "read",
816
1048
  "dryRunSupported": false,
817
1049
  "inputSchema": {
818
1050
  "type": "object",
819
1051
  "properties": {
820
- "entity_id": {
1052
+ "q": {
1053
+ "type": "string",
1054
+ "minLength": 1,
1055
+ "maxLength": 200,
1056
+ "description": "Free-text query (Chinese or English).",
1057
+ "example": "锂电池"
1058
+ },
1059
+ "type": {
1060
+ "type": "string",
1061
+ "enum": [
1062
+ "news",
1063
+ "views",
1064
+ "all"
1065
+ ],
1066
+ "default": "all",
1067
+ "description": "Search scope: news | views | all"
1068
+ },
1069
+ "mode": {
821
1070
  "type": "string",
822
- "description": "Research-entity id (returned by research-entities.list / matcher)."
1071
+ "enum": [
1072
+ "hybrid",
1073
+ "exact"
1074
+ ],
1075
+ "default": "hybrid",
1076
+ "description": "hybrid = 语义 + 精确融合 + rerank;exact = 仅 ILIKE 兼容老逻辑"
1077
+ },
1078
+ "hours": {
1079
+ "type": "integer",
1080
+ "minimum": 1,
1081
+ "maximum": 720,
1082
+ "description": "Lookback window in hours."
1083
+ },
1084
+ "limit": {
1085
+ "type": "integer",
1086
+ "minimum": 1,
1087
+ "maximum": 50,
1088
+ "default": 20,
1089
+ "description": "Max items returned."
823
1090
  }
824
1091
  },
825
1092
  "additionalProperties": false,
826
1093
  "required": [
827
- "entity_id"
1094
+ "q"
828
1095
  ]
829
1096
  }
830
1097
  },
831
- "research.entity-performance-list": {
832
- "cliKey": "research.entity-performance-list",
833
- "cliName": "research entity-performance-list",
1098
+ "securities.industry": {
1099
+ "cliKey": "securities.industry",
1100
+ "cliName": "securities industry",
834
1101
  "method": "GET",
835
- "path": "/v1/research-entities/performance",
836
- "description": "全体研究实体(analyst / team / institution)的命中率、平均目标价达成率、覆盖股票数等汇总。需要 `research:read` scope。",
837
- "summary": "Aggregate performance of research entities",
1102
+ "path": "/v1/securities/industry",
1103
+ "description": "返回该股票的 TDX 自定义行业代码(T1001 食品饮料等)与申万行业三级代码\nL1/L2/L3(X5001 食品饮料 / X500102 白酒 等)。\n\n用法:\n- 股票详情页\"申万行业:白酒 / 食品饮料\"标签\n- 筛选器交叉过滤:行业 + ROE/营收增长率\n- AI agent `find_peers(code)` 用申万二级行业找同业\n",
1104
+ "summary": "TDX + 申万 industry classification for one A-share security",
838
1105
  "positional": [],
839
1106
  "outputDefault": "json",
840
1107
  "pagination": "none",
@@ -846,8 +1113,18 @@ export const OPERATIONS = {
846
1113
  "dryRunSupported": false,
847
1114
  "inputSchema": {
848
1115
  "type": "object",
849
- "properties": {},
850
- "additionalProperties": false
1116
+ "properties": {
1117
+ "code": {
1118
+ "type": "string",
1119
+ "pattern": "^(SSE|SZSE|BSE|SH|SZ|BJ):[0-9]{6}$",
1120
+ "description": "Canonical A-share code.",
1121
+ "example": "SSE:600519"
1122
+ }
1123
+ },
1124
+ "additionalProperties": false,
1125
+ "required": [
1126
+ "code"
1127
+ ]
851
1128
  }
852
1129
  },
853
1130
  "semantic.find": {
@@ -1029,60 +1306,6 @@ export const OPERATIONS = {
1029
1306
  "additionalProperties": false
1030
1307
  }
1031
1308
  },
1032
- "signals.outcome": {
1033
- "cliKey": "signals.outcome",
1034
- "cliName": "signals outcome",
1035
- "method": "GET",
1036
- "path": "/v1/signals/{signal_id}/outcome",
1037
- "description": "单条 signal 的细化结果追踪。",
1038
- "summary": "Outcome trace for a single signal",
1039
- "positional": [
1040
- "signal_id"
1041
- ],
1042
- "outputDefault": "json",
1043
- "pagination": "none",
1044
- "stream": false,
1045
- "billable": false,
1046
- "idempotencyRequired": false,
1047
- "scopesAny": [],
1048
- "sideEffect": "read",
1049
- "dryRunSupported": false,
1050
- "inputSchema": {
1051
- "type": "object",
1052
- "properties": {
1053
- "signal_id": {
1054
- "type": "string",
1055
- "description": "Signal id (returned by signals/outcomes items[].signal_id)."
1056
- }
1057
- },
1058
- "additionalProperties": false,
1059
- "required": [
1060
- "signal_id"
1061
- ]
1062
- }
1063
- },
1064
- "signals.outcomes": {
1065
- "cliKey": "signals.outcomes",
1066
- "cliName": "signals outcomes",
1067
- "method": "GET",
1068
- "path": "/v1/signals/outcomes",
1069
- "description": "返回分析师 views 派生信号的实际结果(目标价命中 / 止损 / 到期),含命中时长、最大回撤等。",
1070
- "summary": "Outcomes of analyst-view-derived signals",
1071
- "positional": [],
1072
- "outputDefault": "json",
1073
- "pagination": "offset",
1074
- "stream": false,
1075
- "billable": false,
1076
- "idempotencyRequired": false,
1077
- "scopesAny": [],
1078
- "sideEffect": "read",
1079
- "dryRunSupported": false,
1080
- "inputSchema": {
1081
- "type": "object",
1082
- "properties": {},
1083
- "additionalProperties": false
1084
- }
1085
- },
1086
1309
  "squawk.audio": {
1087
1310
  "cliKey": "squawk.audio",
1088
1311
  "cliName": "squawk audio",