@v587d/capital-generation 2.29.0 → 2.30.1

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 (305) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/README.md +3 -3
  3. package/THIRD_PARTY_NOTICES.md +16 -0
  4. package/automation/package.json +1 -1
  5. package/chart-ui/package.json +1 -1
  6. package/config/package.json +1 -1
  7. package/lib/collector-runtime.js +56 -1
  8. package/lib/data-collector/catalog-taxonomy.d.ts +1 -1
  9. package/lib/data-collector/catalog-taxonomy.js +33 -0
  10. package/lib/data-collector/dataset-tools.js +4 -2
  11. package/lib/data-collector/describe.d.ts +2 -0
  12. package/lib/data-collector/describe.js +2 -0
  13. package/lib/data-collector/store.d.ts +11 -0
  14. package/lib/data-collector/store.js +80 -1
  15. package/lib/data-collector/tools.d.ts +1 -1
  16. package/lib/data-collector/tools.js +10 -9
  17. package/lib/python-runtime/errors.d.ts +1 -1
  18. package/lib/python-runtime/errors.js +2 -0
  19. package/lib/python-runtime/manager.d.ts +28 -1
  20. package/lib/python-runtime/manager.js +141 -5
  21. package/lib/python-runtime/probe.d.ts +24 -0
  22. package/lib/python-runtime/probe.js +66 -50
  23. package/lib/sources/csindex-http.d.ts +4 -0
  24. package/lib/sources/csindex-http.js +233 -0
  25. package/lib/sources/eastmoney-http.js +1504 -1
  26. package/lib/sources/fuyao-rest.js +168 -8
  27. package/lib/sources/official-http.d.ts +4 -0
  28. package/lib/sources/official-http.js +477 -0
  29. package/lib/sources/python-remote.d.ts +25 -0
  30. package/lib/sources/python-remote.js +461 -0
  31. package/lib/sources/sina-http.d.ts +2 -0
  32. package/lib/sources/sina-http.js +484 -0
  33. package/lib/sources/tencent-http.js +23 -8
  34. package/lib/sources/ths-http.d.ts +2 -0
  35. package/lib/sources/ths-http.js +517 -0
  36. package/lib/time/tools.js +19 -0
  37. package/lib/web-retriever/local-fetch.d.ts +1 -1
  38. package/lib/web-retriever/local-fetch.js +1 -1
  39. package/lib/web-retriever/sources.d.ts +7 -0
  40. package/lib/web-retriever/sources.js +46 -21
  41. package/lib/web-retriever/throttle.d.ts +8 -0
  42. package/lib/web-retriever/throttle.js +13 -0
  43. package/lib/web-retriever/tools.js +1 -1
  44. package/lib/web-retriever/wind-client.d.ts +1 -1
  45. package/lib/web-retriever/wind-client.js +1 -1
  46. package/package.json +1 -1
  47. package/preset/capital-generation/agent.patch.yml +7 -5
  48. package/preset/capital-generation/skills/capital-data-protocol/SKILL.md +16 -16
  49. package/python/scripts/baostock_stock_basic.py +129 -0
  50. package/python/scripts/baostock_valuation_history.py +141 -0
  51. package/python/scripts/pbc_social_financing.py +291 -0
  52. package/python/vendor/baostock/LICENSE +19 -0
  53. package/python/vendor/baostock/__init__.py +42 -0
  54. package/python/vendor/baostock/common/__init__.py +0 -0
  55. package/python/vendor/baostock/common/contants.py +189 -0
  56. package/python/vendor/baostock/common/context.py +4 -0
  57. package/python/vendor/baostock/corpreport/__init__.py +0 -0
  58. package/python/vendor/baostock/corpreport/corp_performance.py +202 -0
  59. package/python/vendor/baostock/data/__init__.py +0 -0
  60. package/python/vendor/baostock/data/messageheader.py +17 -0
  61. package/python/vendor/baostock/data/msg.py +21 -0
  62. package/python/vendor/baostock/data/resultset.py +200 -0
  63. package/python/vendor/baostock/demo/__init__.py +0 -0
  64. package/python/vendor/baostock/demo/demo_A_stock_5mk-data.py +34 -0
  65. package/python/vendor/baostock/demo/demo_A_stock_k_data.py +36 -0
  66. package/python/vendor/baostock/demo/demo_AllStock.py +27 -0
  67. package/python/vendor/baostock/demo/demo_Balance_data.py +22 -0
  68. package/python/vendor/baostock/demo/demo_CashFlow_data.py +22 -0
  69. package/python/vendor/baostock/demo/demo_Dividend_data.py +35 -0
  70. package/python/vendor/baostock/demo/demo_Dupont_data.py +25 -0
  71. package/python/vendor/baostock/demo/demo_Forecast_report.py +24 -0
  72. package/python/vendor/baostock/demo/demo_Growth_data.py +22 -0
  73. package/python/vendor/baostock/demo/demo_Index_k_data.py +39 -0
  74. package/python/vendor/baostock/demo/demo_Operation_data.py +22 -0
  75. package/python/vendor/baostock/demo/demo_PerformanceExpress_report.py +25 -0
  76. package/python/vendor/baostock/demo/demo_Profit_data.py +22 -0
  77. package/python/vendor/baostock/demo/demo_TradeDates.py +27 -0
  78. package/python/vendor/baostock/demo/demo_adjust_factor_data.py +23 -0
  79. package/python/vendor/baostock/demo/demo_assignDayData.py +23 -0
  80. package/python/vendor/baostock/demo/demo_daily_adjust_factor_data.py +28 -0
  81. package/python/vendor/baostock/demo/demo_daily_k_4_AStock.py +28 -0
  82. package/python/vendor/baostock/demo/demo_daily_k_4_ETF.py +28 -0
  83. package/python/vendor/baostock/demo/demo_depositRate_data.py +26 -0
  84. package/python/vendor/baostock/demo/demo_hs300_stocks.py +26 -0
  85. package/python/vendor/baostock/demo/demo_loanRate_data.py +26 -0
  86. package/python/vendor/baostock/demo/demo_moneySupplyDataMonth_data.py +26 -0
  87. package/python/vendor/baostock/demo/demo_moneySupplyDataYear_data.py +26 -0
  88. package/python/vendor/baostock/demo/demo_requiredReserveRatio_data.py +26 -0
  89. package/python/vendor/baostock/demo/demo_set_API_key.py +37 -0
  90. package/python/vendor/baostock/demo/demo_stockBasic_data.py +27 -0
  91. package/python/vendor/baostock/demo/demo_stock_Valuation_indicator_data.py +34 -0
  92. package/python/vendor/baostock/demo/demo_stock_industry.py +26 -0
  93. package/python/vendor/baostock/demo/demo_sz50stocks.py +26 -0
  94. package/python/vendor/baostock/demo/demo_zz500_stock.py +26 -0
  95. package/python/vendor/baostock/evaluation/__init__.py +0 -0
  96. package/python/vendor/baostock/evaluation/season_index.py +758 -0
  97. package/python/vendor/baostock/login/__init__.py +0 -0
  98. package/python/vendor/baostock/login/loginout.py +230 -0
  99. package/python/vendor/baostock/macroscopic/__init__.py +0 -0
  100. package/python/vendor/baostock/macroscopic/economic_data.py +723 -0
  101. package/python/vendor/baostock/metadata/__init__.py +0 -0
  102. package/python/vendor/baostock/metadata/stock_metadata.py +207 -0
  103. package/python/vendor/baostock/security/__init__.py +0 -0
  104. package/python/vendor/baostock/security/history.py +265 -0
  105. package/python/vendor/baostock/security/sectorinfo.py +1024 -0
  106. package/python/vendor/baostock/util/__init__.py +0 -0
  107. package/python/vendor/baostock/util/socketutil.py +97 -0
  108. package/python/vendor/baostock/util/stringutil.py +83 -0
  109. package/python/vendor/et_xmlfile/LICENSE +23 -0
  110. package/python/vendor/et_xmlfile/LICENSE.python +298 -0
  111. package/python/vendor/et_xmlfile/__init__.py +8 -0
  112. package/python/vendor/et_xmlfile/incremental_tree.py +917 -0
  113. package/python/vendor/et_xmlfile/xmlfile.py +158 -0
  114. package/python/vendor/openpyxl/LICENSE +23 -0
  115. package/python/vendor/openpyxl/__init__.py +19 -0
  116. package/python/vendor/openpyxl/_constants.py +13 -0
  117. package/python/vendor/openpyxl/cell/__init__.py +4 -0
  118. package/python/vendor/openpyxl/cell/_writer.py +136 -0
  119. package/python/vendor/openpyxl/cell/cell.py +332 -0
  120. package/python/vendor/openpyxl/cell/read_only.py +136 -0
  121. package/python/vendor/openpyxl/cell/rich_text.py +202 -0
  122. package/python/vendor/openpyxl/cell/text.py +184 -0
  123. package/python/vendor/openpyxl/chart/_3d.py +105 -0
  124. package/python/vendor/openpyxl/chart/__init__.py +19 -0
  125. package/python/vendor/openpyxl/chart/_chart.py +199 -0
  126. package/python/vendor/openpyxl/chart/area_chart.py +106 -0
  127. package/python/vendor/openpyxl/chart/axis.py +401 -0
  128. package/python/vendor/openpyxl/chart/bar_chart.py +144 -0
  129. package/python/vendor/openpyxl/chart/bubble_chart.py +67 -0
  130. package/python/vendor/openpyxl/chart/chartspace.py +195 -0
  131. package/python/vendor/openpyxl/chart/data_source.py +246 -0
  132. package/python/vendor/openpyxl/chart/descriptors.py +43 -0
  133. package/python/vendor/openpyxl/chart/error_bar.py +62 -0
  134. package/python/vendor/openpyxl/chart/label.py +127 -0
  135. package/python/vendor/openpyxl/chart/layout.py +74 -0
  136. package/python/vendor/openpyxl/chart/legend.py +75 -0
  137. package/python/vendor/openpyxl/chart/line_chart.py +129 -0
  138. package/python/vendor/openpyxl/chart/marker.py +90 -0
  139. package/python/vendor/openpyxl/chart/picture.py +35 -0
  140. package/python/vendor/openpyxl/chart/pie_chart.py +177 -0
  141. package/python/vendor/openpyxl/chart/pivot.py +65 -0
  142. package/python/vendor/openpyxl/chart/plotarea.py +162 -0
  143. package/python/vendor/openpyxl/chart/print_settings.py +57 -0
  144. package/python/vendor/openpyxl/chart/radar_chart.py +55 -0
  145. package/python/vendor/openpyxl/chart/reader.py +32 -0
  146. package/python/vendor/openpyxl/chart/reference.py +124 -0
  147. package/python/vendor/openpyxl/chart/scatter_chart.py +53 -0
  148. package/python/vendor/openpyxl/chart/series.py +197 -0
  149. package/python/vendor/openpyxl/chart/series_factory.py +41 -0
  150. package/python/vendor/openpyxl/chart/shapes.py +89 -0
  151. package/python/vendor/openpyxl/chart/stock_chart.py +54 -0
  152. package/python/vendor/openpyxl/chart/surface_chart.py +119 -0
  153. package/python/vendor/openpyxl/chart/text.py +78 -0
  154. package/python/vendor/openpyxl/chart/title.py +76 -0
  155. package/python/vendor/openpyxl/chart/trendline.py +98 -0
  156. package/python/vendor/openpyxl/chart/updown_bars.py +31 -0
  157. package/python/vendor/openpyxl/chartsheet/__init__.py +3 -0
  158. package/python/vendor/openpyxl/chartsheet/chartsheet.py +107 -0
  159. package/python/vendor/openpyxl/chartsheet/custom.py +61 -0
  160. package/python/vendor/openpyxl/chartsheet/properties.py +28 -0
  161. package/python/vendor/openpyxl/chartsheet/protection.py +41 -0
  162. package/python/vendor/openpyxl/chartsheet/publish.py +58 -0
  163. package/python/vendor/openpyxl/chartsheet/relation.py +97 -0
  164. package/python/vendor/openpyxl/chartsheet/views.py +51 -0
  165. package/python/vendor/openpyxl/comments/__init__.py +4 -0
  166. package/python/vendor/openpyxl/comments/author.py +21 -0
  167. package/python/vendor/openpyxl/comments/comment_sheet.py +211 -0
  168. package/python/vendor/openpyxl/comments/comments.py +62 -0
  169. package/python/vendor/openpyxl/comments/shape_writer.py +112 -0
  170. package/python/vendor/openpyxl/compat/__init__.py +54 -0
  171. package/python/vendor/openpyxl/compat/abc.py +8 -0
  172. package/python/vendor/openpyxl/compat/numbers.py +43 -0
  173. package/python/vendor/openpyxl/compat/product.py +17 -0
  174. package/python/vendor/openpyxl/compat/singleton.py +40 -0
  175. package/python/vendor/openpyxl/compat/strings.py +25 -0
  176. package/python/vendor/openpyxl/descriptors/__init__.py +58 -0
  177. package/python/vendor/openpyxl/descriptors/base.py +272 -0
  178. package/python/vendor/openpyxl/descriptors/container.py +41 -0
  179. package/python/vendor/openpyxl/descriptors/excel.py +112 -0
  180. package/python/vendor/openpyxl/descriptors/namespace.py +12 -0
  181. package/python/vendor/openpyxl/descriptors/nested.py +129 -0
  182. package/python/vendor/openpyxl/descriptors/sequence.py +136 -0
  183. package/python/vendor/openpyxl/descriptors/serialisable.py +240 -0
  184. package/python/vendor/openpyxl/descriptors/slots.py +18 -0
  185. package/python/vendor/openpyxl/drawing/__init__.py +4 -0
  186. package/python/vendor/openpyxl/drawing/colors.py +435 -0
  187. package/python/vendor/openpyxl/drawing/connector.py +144 -0
  188. package/python/vendor/openpyxl/drawing/drawing.py +92 -0
  189. package/python/vendor/openpyxl/drawing/effect.py +407 -0
  190. package/python/vendor/openpyxl/drawing/fill.py +425 -0
  191. package/python/vendor/openpyxl/drawing/geometry.py +584 -0
  192. package/python/vendor/openpyxl/drawing/graphic.py +177 -0
  193. package/python/vendor/openpyxl/drawing/image.py +65 -0
  194. package/python/vendor/openpyxl/drawing/line.py +144 -0
  195. package/python/vendor/openpyxl/drawing/picture.py +144 -0
  196. package/python/vendor/openpyxl/drawing/properties.py +174 -0
  197. package/python/vendor/openpyxl/drawing/relation.py +17 -0
  198. package/python/vendor/openpyxl/drawing/spreadsheet_drawing.py +382 -0
  199. package/python/vendor/openpyxl/drawing/text.py +717 -0
  200. package/python/vendor/openpyxl/drawing/xdr.py +33 -0
  201. package/python/vendor/openpyxl/formatting/__init__.py +3 -0
  202. package/python/vendor/openpyxl/formatting/formatting.py +114 -0
  203. package/python/vendor/openpyxl/formatting/rule.py +291 -0
  204. package/python/vendor/openpyxl/formula/__init__.py +3 -0
  205. package/python/vendor/openpyxl/formula/tokenizer.py +446 -0
  206. package/python/vendor/openpyxl/formula/translate.py +166 -0
  207. package/python/vendor/openpyxl/packaging/__init__.py +3 -0
  208. package/python/vendor/openpyxl/packaging/core.py +115 -0
  209. package/python/vendor/openpyxl/packaging/custom.py +289 -0
  210. package/python/vendor/openpyxl/packaging/extended.py +137 -0
  211. package/python/vendor/openpyxl/packaging/interface.py +56 -0
  212. package/python/vendor/openpyxl/packaging/manifest.py +194 -0
  213. package/python/vendor/openpyxl/packaging/relationship.py +158 -0
  214. package/python/vendor/openpyxl/packaging/workbook.py +185 -0
  215. package/python/vendor/openpyxl/pivot/__init__.py +1 -0
  216. package/python/vendor/openpyxl/pivot/cache.py +965 -0
  217. package/python/vendor/openpyxl/pivot/fields.py +326 -0
  218. package/python/vendor/openpyxl/pivot/record.py +111 -0
  219. package/python/vendor/openpyxl/pivot/table.py +1261 -0
  220. package/python/vendor/openpyxl/reader/__init__.py +1 -0
  221. package/python/vendor/openpyxl/reader/drawings.py +71 -0
  222. package/python/vendor/openpyxl/reader/excel.py +349 -0
  223. package/python/vendor/openpyxl/reader/strings.py +44 -0
  224. package/python/vendor/openpyxl/reader/workbook.py +133 -0
  225. package/python/vendor/openpyxl/styles/__init__.py +11 -0
  226. package/python/vendor/openpyxl/styles/alignment.py +62 -0
  227. package/python/vendor/openpyxl/styles/borders.py +103 -0
  228. package/python/vendor/openpyxl/styles/builtins.py +1397 -0
  229. package/python/vendor/openpyxl/styles/cell_style.py +206 -0
  230. package/python/vendor/openpyxl/styles/colors.py +172 -0
  231. package/python/vendor/openpyxl/styles/differential.py +95 -0
  232. package/python/vendor/openpyxl/styles/fills.py +224 -0
  233. package/python/vendor/openpyxl/styles/fonts.py +113 -0
  234. package/python/vendor/openpyxl/styles/named_styles.py +282 -0
  235. package/python/vendor/openpyxl/styles/numbers.py +200 -0
  236. package/python/vendor/openpyxl/styles/protection.py +17 -0
  237. package/python/vendor/openpyxl/styles/proxy.py +62 -0
  238. package/python/vendor/openpyxl/styles/styleable.py +151 -0
  239. package/python/vendor/openpyxl/styles/stylesheet.py +274 -0
  240. package/python/vendor/openpyxl/styles/table.py +94 -0
  241. package/python/vendor/openpyxl/utils/__init__.py +17 -0
  242. package/python/vendor/openpyxl/utils/bound_dictionary.py +26 -0
  243. package/python/vendor/openpyxl/utils/cell.py +240 -0
  244. package/python/vendor/openpyxl/utils/dataframe.py +87 -0
  245. package/python/vendor/openpyxl/utils/datetime.py +140 -0
  246. package/python/vendor/openpyxl/utils/escape.py +43 -0
  247. package/python/vendor/openpyxl/utils/exceptions.py +34 -0
  248. package/python/vendor/openpyxl/utils/formulas.py +24 -0
  249. package/python/vendor/openpyxl/utils/indexed_list.py +49 -0
  250. package/python/vendor/openpyxl/utils/inference.py +60 -0
  251. package/python/vendor/openpyxl/utils/protection.py +22 -0
  252. package/python/vendor/openpyxl/utils/units.py +108 -0
  253. package/python/vendor/openpyxl/workbook/__init__.py +4 -0
  254. package/python/vendor/openpyxl/workbook/_writer.py +197 -0
  255. package/python/vendor/openpyxl/workbook/child.py +166 -0
  256. package/python/vendor/openpyxl/workbook/defined_name.py +189 -0
  257. package/python/vendor/openpyxl/workbook/external_link/__init__.py +3 -0
  258. package/python/vendor/openpyxl/workbook/external_link/external.py +190 -0
  259. package/python/vendor/openpyxl/workbook/external_reference.py +18 -0
  260. package/python/vendor/openpyxl/workbook/function_group.py +36 -0
  261. package/python/vendor/openpyxl/workbook/properties.py +151 -0
  262. package/python/vendor/openpyxl/workbook/protection.py +163 -0
  263. package/python/vendor/openpyxl/workbook/smart_tags.py +56 -0
  264. package/python/vendor/openpyxl/workbook/views.py +155 -0
  265. package/python/vendor/openpyxl/workbook/web.py +98 -0
  266. package/python/vendor/openpyxl/workbook/workbook.py +438 -0
  267. package/python/vendor/openpyxl/worksheet/__init__.py +1 -0
  268. package/python/vendor/openpyxl/worksheet/_read_only.py +190 -0
  269. package/python/vendor/openpyxl/worksheet/_reader.py +472 -0
  270. package/python/vendor/openpyxl/worksheet/_write_only.py +160 -0
  271. package/python/vendor/openpyxl/worksheet/_writer.py +390 -0
  272. package/python/vendor/openpyxl/worksheet/cell_range.py +512 -0
  273. package/python/vendor/openpyxl/worksheet/cell_watch.py +34 -0
  274. package/python/vendor/openpyxl/worksheet/controls.py +107 -0
  275. package/python/vendor/openpyxl/worksheet/copier.py +70 -0
  276. package/python/vendor/openpyxl/worksheet/custom.py +35 -0
  277. package/python/vendor/openpyxl/worksheet/datavalidation.py +202 -0
  278. package/python/vendor/openpyxl/worksheet/dimensions.py +306 -0
  279. package/python/vendor/openpyxl/worksheet/drawing.py +14 -0
  280. package/python/vendor/openpyxl/worksheet/errors.py +93 -0
  281. package/python/vendor/openpyxl/worksheet/filters.py +486 -0
  282. package/python/vendor/openpyxl/worksheet/formula.py +51 -0
  283. package/python/vendor/openpyxl/worksheet/header_footer.py +270 -0
  284. package/python/vendor/openpyxl/worksheet/hyperlink.py +46 -0
  285. package/python/vendor/openpyxl/worksheet/merge.py +141 -0
  286. package/python/vendor/openpyxl/worksheet/ole.py +133 -0
  287. package/python/vendor/openpyxl/worksheet/page.py +174 -0
  288. package/python/vendor/openpyxl/worksheet/pagebreak.py +94 -0
  289. package/python/vendor/openpyxl/worksheet/picture.py +8 -0
  290. package/python/vendor/openpyxl/worksheet/print_settings.py +184 -0
  291. package/python/vendor/openpyxl/worksheet/properties.py +97 -0
  292. package/python/vendor/openpyxl/worksheet/protection.py +120 -0
  293. package/python/vendor/openpyxl/worksheet/related.py +17 -0
  294. package/python/vendor/openpyxl/worksheet/scenario.py +105 -0
  295. package/python/vendor/openpyxl/worksheet/smart_tag.py +78 -0
  296. package/python/vendor/openpyxl/worksheet/table.py +385 -0
  297. package/python/vendor/openpyxl/worksheet/views.py +155 -0
  298. package/python/vendor/openpyxl/worksheet/worksheet.py +907 -0
  299. package/python/vendor/openpyxl/writer/__init__.py +1 -0
  300. package/python/vendor/openpyxl/writer/excel.py +295 -0
  301. package/python/vendor/openpyxl/writer/theme.py +291 -0
  302. package/python/vendor/openpyxl/xml/__init__.py +42 -0
  303. package/python/vendor/openpyxl/xml/constants.py +129 -0
  304. package/python/vendor/openpyxl/xml/functions.py +87 -0
  305. package/watchlist/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,64 @@
7
7
  - **第三位(patch)**:不破坏既有工具 / 配置 / 会话的新增与修复(如 2.1.1、2.1.2)。
8
8
  - **第二位(minor)**:有需要用户知晓的行为变更,且段内附迁移说明(如 2.1.0 的图表呈现通道重做、2.2.0 的数据源与检索来源扩容、2.4.0 的**必须换宿主版本**、2.9.0 的选择器收敛与质检前置——本插件自己的工具与数据契约没变,所以只抬第二位)。
9
9
 
10
+ ## [2.30.1] - 2026-11-23
11
+
12
+ 修三条实机验收发现的口径可见性问题:envelope 根级字段现在能随 DatasetRef 与读面出来,同花顺涨停揭秘补交易日列,腾讯前复权日线的盘后滞后写进契约。数据能力本身无失败,本轮只补「看得见」。
13
+
14
+ ### Fixed
15
+
16
+ - **envelope 根级字段对消费者不可见**:`eastmoney_limit_up_pool` / `_break` / `_down` / `yesterday_limit_up_pool` / `price_anomaly_*` / `stock_hot_concepts` 这类能力的响应把 `trade_date`、`server_latest_trade_date`、`requested_date_clamped`、`available`、`note`、`upstream_total`、`calculated_at` 放在根级,`raw.json` 里有值,但 `request_data` 回执与 `describe_dataset` / `inspect_dataset` 都拿不到——日期钳制护栏与快照计算时间等于对使用者不存在。现在 **DatasetRef 与读面新增 `envelope`**:只带根级标量(以及一层扁平对象,如上游 `pagination`),行数组与嵌套结构一律不带;总长 ≤ 4KB、长文本按 512 字符截断、非有限数丢弃;数组型 Dataset 没有该字段。升级前落盘的 Dataset 在读面会从 `raw.json` 现算,7 天保留期内旧数据同样能核对口径。`request_data` / `inspect_dataset` / `describe_dataset` 的 `output.schema` 与 description 同步。
17
+ - **`ths_limit_up_detail` 行内补 `trade_date`**:此前行内没有任何日期列,问「今天涨停股」只能靠 `captured_at` 推断业务日。现在每行带交易日(上游 `data.date`,省略 `date` 参数时也给出上游最近交易日),时间轴(`time_coverage`)自动识别该列,`resolve_data_time_range` 的提示同步;行 schema、`validateOutput` 护栏与 description 一并更新。
18
+
19
+ ### Changed
20
+
21
+ - **`tencent_kline` 描述补「前复权盘后滞后」**:实测 2026-11-23 17:35,600519 的 `qfqday` 只到 11-20、同票 `adjust:"none"` 已有 11-23,而 688981 正常返回当日。要当日收盘价请用 `adjust:"none"` 或 `tencent_quote` 快照;少一根是上游复权序列尚未回填,不是数据损坏。代码行为不变,只补契约提示。
22
+
23
+ ### Notes
24
+
25
+ - 修复依据:2026-11-23 实机验收——11 个真实「自动模式」session(3 条私有 Python 通道必测 + 8 条抽检)全部通过,测试树内 39 次 `request_data` 零失败;三条发现与证据记录见 `docs/design/a-stock-data-upstream-review-2026-11.md` §9.5。
26
+ - 回归:`npm test` **1735 pass / 0 fail**(新增 `test/data-collector-store.test.mjs` 4 例 envelope、`test/describe-dataset.test.mjs` 1 例读面;THS 行断言随列更新)。
27
+ - 版本:根包与四个随包嵌套包(chart-ui / config / watchlist / automation)+ `LOCAL_FETCH_CLIENT_VERSION` / `WIND_CLIENT_VERSION` 同步 2.30.1;无配置、数据或会话迁移。
28
+ - 升级后需重启 dsh 进程(`lib/` 已重建)。
29
+
30
+ ## [2.30.0] - 2026-11-22
31
+
32
+ 数据能力扩容:按上游 `a-stock-data` v3.10.4 的 15 层 87 端点复核补齐 **27 条能力**(135 → 162),并修两条口径缺陷。新增 ETF 期权、A50 期指、东财打板四池与日内异动、个股概念命中、同花顺热榜 / 涨停揭秘、沪深 ETF 份额、回购定盘、中证指数估值,以及一条受控的私有 Python 数据通道(BaoStock + 人民银行社融)。全部新能力都有真报文验收、巡检条目与回归。
33
+
34
+ ### Added
35
+
36
+ - **新浪公开 HTTP(4 条,零 key)**:`sina_etf_option_contracts` / `sina_etf_option_tquote` / `sina_etf_option_greeks`(ETF 期权合约清单、T 型报价、希腊字母与 IV;GBK + Referer;希腊字母 `raw[1:4]` 三个空串必须跳过)与 `sina_a50_futures`(富时中国 A50 连续报价,时间轴与单位按实测写清;不含 CME 期货)。
37
+ - **交易所与货币网官方(3 条,零 key)**:`sse_etf_shares`(上交所 ETF 份额按日归档,可查历史)、`szse_etf_shares`(深交所仅最新一天)、`chinamoney_repo_fixing`(银行间回购定盘 FR / FDR,`%` 原值、FDR 早期为 null)。
38
+ - **中证指数(1 条)**:`csindex_index_valuation`(官网 JSON 的 PE(TTM) 日序列,全历史);官网 JSON 不含 PB / 静态 PE / 股息率,description 已明确声明。
39
+ - **东方财富(14 条)**:个股基本面 `eastmoney_security_profile`、`eastmoney_st_stock_list`、事件包(机构调研 / 增减持 / 回购 / 质押 / 新股)、东财口径打板四池(涨停 / 炸板 / 跌停 / 昨日涨停,含炸板次数、末封板时间、行业、振幅 / 涨速、封单资金、连续跌停天数、开板次数)、`eastmoney_price_anomaly_list` / `_count`(严重异常波动明细与按标的聚合)、`eastmoney_stock_hot_concepts`(个股动态概念命中热度)。
40
+ - **同花顺网页直连(2 条,新家族,零 key)**:`ths_hot_list`(热榜 100 行,补 Fuyao 没有的概念标签 / 人气标签)、`ths_limit_up_detail`(涨停揭秘:板型 / 封板成功率 / 是否回封;与 Fuyao 涨停池 28/28 对账,差额全为 ST)。
41
+ - **私有 Python 数据通道(3 条)**:`baostock_valuation_history`(PE/PB/PS/PCF + 换手率 + 停牌 + 逐日 ST)、`baostock_stock_basic`(上市日 / 退市日 / 状态)、`pbc_social_financing`(社融增量 12 列,亿元)。运行时新增 `runDataScript()`:固定脚本白名单 + 独立 run dir + 结果回 TS 逐字段校验后才落 Dataset;vendored 纯 Python 包(BaoStock BSD / openpyxl MIT / et_xmlfile MIT,约 1.8MB,LICENSE 随包,`THIRD_PARTY_NOTICES.md` 已登记)。
42
+ - **Fuyao 补列**:`limit_up_pool.open_times`(炸板次数)、`limit_break_pool.first_seal_time` / `last_seal_time`(上游一直在返回、此前未声明)。四条池子与热榜的 description 互相点名缺列的替代能力,并写明两家口径不可混算。
43
+
44
+ ### Fixed
45
+
46
+ - **`tencent_kline` 成交量单位**:科创板(688 / 689)是**股**、其余(含 588 ETF 与指数)是**手**——此前 description 一律写「手」,按手换算科创板会差 100 倍。现在每行带 `volume_unit`(`share` / `lot`),日线、分钟线、复权与否同一规则。
47
+ - **`sina_reports` 假空页**:上游 1 秒内连打第二次起返回 HTTP 200 的假「没有找到相关内容」,与「确实没有研报」字节同形;现在所有请求走进程级 ≥6 秒节流链,空页按同一间隔重试一次,只有重试仍空才当「确实没有研报」,note 会写明已重试。
48
+
49
+ ### Changed
50
+
51
+ - 能力总数 **135 → 162**;目录主题 **9 → 10**(新增 `options`)。
52
+ - 巡检注册表新增 4 个家族:`sina` / `official` / `csindex` / `ths`;私有 Python 3 条标记 `excluded`(CI 不安装私有运行时,需本地手跑)。
53
+ - `docs/data-collector-capabilities.md`、`docs/agent-roles.md` 与 README 的计数同步;复核结论与两轮落地记录见 `docs/design/a-stock-data-upstream-review-2026-11.md`(§8 / §9)。
54
+
55
+ ### Migration
56
+
57
+ - 无破坏性变更:既有工具、能力名、参数与 Dataset 契约不变,新增能力均为增量。
58
+ - 私有 Python 那 3 条是**可选**能力:需在「插件设置 → 分析环境」安装 base pack(约 60MB/平台)。未安装时调用会明确报 `data-runtime-not-ready`,不影响其它能力。
59
+ - 升级后需重启 dsh 进程(`lib/` 已重建)。
60
+
61
+ ### Notes
62
+
63
+ - 回归:`npm test` **1728 pass / 0 fail**;`npm run check:dsh` 40/40;`npm run smoke:boot` 预设 `broken=null`;`npm run contract:probe` 真打通过(新浪 3/3、官方 3/3、中证 1/1、同花顺直连 2/2、东财新增 7/7;push2 两条仍按 shadow 挂到 2026-12-20)。
64
+ - 版本:根包与四个随包嵌套包(chart-ui / config / watchlist / automation)+ 两个客户端常量(`LOCAL_FETCH_CLIENT_VERSION` / `WIND_CLIENT_VERSION`)同步 2.30.0。
65
+ - 口径提醒:东财打板四池只保留约最近 15 个交易日,且会把今天 / 未来日期夹到最近交易日;跌停池 `board_amount` 口径不可靠(禁止当成交额);同花顺涨停揭秘不含 ST 与北交所;东财人气榜因名称价格依赖 push2 仍未接。
66
+ - 明确未做:东财人气榜、筹码分布 CYQ、申万行业历史(源站 TLS / 508)、120 日东财资金流、iwencai、百度 MA、mootdx、北向分钟、央视批量。
67
+
10
68
  ## [2.29.0] - 2026-11-20
11
69
 
12
70
  宿主升级不再按 rc 打断插件:支持窗口从「精确 pin 一个 rc」改成「同一 minor」,跑在未验证宿主上时留一条可见记录(issue #20)。
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-green" alt="License"></a>
4
4
  <a href="https://github.com/v587d/capital-generation"><img src="https://img.shields.io/badge/Financial%20Market-CN%20%7C%20HK%20%7C%20US-orange" alt="Market·CN+HK+US"></a>
5
5
  <a href="https://github.com/deepseek-ai"><img src="https://img.shields.io/badge/DSH%20Baseline-0.2.2--rc.5-blue" alt="DSH@0.2.2-rc.5"></a>
6
- <a href="https://github.com/v587d/capital-generation/releases"><img src="https://img.shields.io/badge/version-2.29.0-9cf" alt="Version"></a>
6
+ <a href="https://github.com/v587d/capital-generation/releases"><img src="https://img.shields.io/badge/version-2.30.1-9cf" alt="Version"></a>
7
7
  <a href="https://www.npmjs.com/package/@v587d/capital-generation"><img src="https://img.shields.io/npm/v/%40v587d%2Fcapital-generation" alt="npm version"></a>
8
8
  </p>
9
9
 
@@ -136,7 +136,7 @@ Capital Generation 是运行在 [DeepSeek Harness(DSH)](https://github.com/d
136
136
 
137
137
  ## 还能做什么
138
138
 
139
- - **查数据和资料:** 覆盖 A 股、港股、美股与期货等品种,由专用角色按需获取行情、财务、指数、基金、宏观行业与期货数据,检索公告、新闻和研报。共计 **132** 个数据收集能力和 **17** 个网页检索能力,部分公开数据源无需额外密钥;具体覆盖范围见 [数据收集能力表](docs/data-collector-capabilities.md) 和 [网页检索能力表](docs/web-retriever-capabilities.md)。
139
+ - **查数据和资料:** 覆盖 A 股、港股、美股与期货等品种,由专用角色按需获取行情、财务、指数、基金、宏观行业与期货数据,检索公告、新闻和研报。共计 **162** 个数据收集能力和 **17** 个网页检索能力,部分公开数据源无需额外密钥;具体覆盖范围见 [数据收集能力表](docs/data-collector-capabilities.md) 和 [网页检索能力表](docs/web-retriever-capabilities.md)。
140
140
  - **数据质检:** 结构化数据不会直接进入模型上下文。每份数据先由分析师检查结构、时间轴、缺失与基础统计,再按受控方式汇总;原始数据行始终留在工具层。
141
141
  - **可视化:** 分析师判断数据适合图表,或你明确要图时,绘图专员会生成可交互图表;明确不要图时只完成质检。图表会登记为**最后一轮答复**的交付物,在答复末尾集中出现,可在侧栏查看或离线打开。了解处理流程可看 [Agent 角色说明](docs/agent-roles.md)。
142
142
 
@@ -192,7 +192,7 @@ Capital Generation 是运行在 [DeepSeek Harness(DSH)](https://github.com/d
192
192
  - **配置在哪?** 打开「插件」→ 已安装的 **Capital Generation**,插件介绍下方就是「数据源 / 投研自动化 / 精选 Skills / 包含的组件 / 分析环境」五格,五把密钥都在第一格;第二格可指定任务统一使用的默认工作区,也能改自动检查间隔与最长运行时间等上限;第五格准备 Python 分析环境;不在 DSH 的普通「设置」页面,也不用点进任何一行组件。保存密钥后新建会话再试。
193
193
  - **升级到 2.9.0 后,分析师和绘图专员去哪了?** 这一版把它们收进自动模式内部,不再出现在选择器与预设管理里,避免误开一个没有取数入口的空会话。旧会话仍能按原身份恢复;新任务直接用自动模式提出即可。
194
194
  - **宿主更新后插件显示异常、三个模式消失?** 插件只支持**同一 minor** 的宿主(本版是 `>=0.2.2-rc.5 <0.2.3-0`):宿主跨到 0.2.3 及以上时,旧插件会被启动拒载(插件页显示「异常」)。先把宿主升到与插件同一条 minor,再在插件页更新插件;应急可用版本豁免(有崩溃风险,见 CHANGELOG 的 Migration)。日志里出现「宿主 dsh … 未逐项验证」说明你跑在同一 minor 的未验证补丁版上——能跑,但遇异常请先升级插件并把那行日志附在 issue 里。
195
- - **桌面端升级后仍是旧版?** 桌面端安装时会固定所解析的版本,不会自动升级。卸载后重新安装,再到插件详情查看版本号;如需指定版本,可在地址末尾加 `#v2.29.0` 或 `@2.29.0`。
195
+ - **桌面端升级后仍是旧版?** 桌面端安装时会固定所解析的版本,不会自动升级。卸载后重新安装,再到插件详情查看版本号;如需指定版本,可在地址末尾加 `#v2.30.1` 或 `@2.30.1`。
196
196
  - **刚发布的新版本装不到?** 桌面端取包时会跳过**刚发布不久**的版本(宿主侧包管理器的发布冷却策略,实测会静默装成上一个版本),国内镜像的同步也可能滞后一段时间。急着用最新代码,改用仓库地址安装最直接;但仓库地址安装的是 git 依赖,插件页不显示「版本」检查。
197
197
  - **插件页的「版本」段怎么用?** 只有用包名从 npm 安装的版本才有;它只列比当前新的版本。回旧版要先卸载,再安装 `@v587d/capital-generation@版本号`(桌面端地址末尾加 `#v版本号`);旧版必须匹配当前 DSH 基线,对应关系见 [CHANGELOG 的 Migration](CHANGELOG.md)。
198
198
  - **网页抓取失败?** 配置卡片中的「允许启动本地提取网页内容」默认开启:AnySearch 提取失败时可尝试本机直连。关闭后,本机直连的具名来源查询也不可用;请检查该开关和网络连接。
@@ -83,6 +83,22 @@ git-only、不随包、任何角色都不执行,文件头写明来源与"不
83
83
  查原 skill 的索引。它们留在这里只为将来升级公式或移植到宿主的计算面;skill 正文只写"把算式写进答复、
84
84
  需要算力时委派 `data_junior`",不指向这些文件。
85
85
 
86
+ ## 随包分发的纯 Python 数据脚本依赖(随主包)
87
+
88
+ 私有 Python 运行时的 base pack 只带解释器与数值计算库;三条固定数据脚本还要两个纯 Python 包,
89
+ 它们以**源码原样**随主包发布到 python/vendor 目录(不新增平台运行时包、不走 pip/venv)。
90
+ `worker.py` 的 run 子命令把 python/vendor 作为一条 `--site-packages` 传给私有解释器,与 base pack 的
91
+ site-packages 并列;三个包都只有 `.py` 文件,无二进制。
92
+
93
+ | 组件 | 版本 | 许可证 | 原始仓库 | 许可文本 | 用在哪里 |
94
+ |---|---|---|---|---|---|
95
+ | BaoStock | 0.9.4 | BSD(wheel 元数据声明;上游 wheel **不带** LICENSE 文件,证据见许可文本内引用的 METADATA 原文) | <http://www.baostock.com> | `python/vendor/baostock/LICENSE` | `baostock_valuation_history` / `baostock_stock_basic` 两条固定数据脚本的 TCP 客户端;BaoStock 自有协议,无 HTTP 等价物 |
96
+ | openpyxl | 3.1.5 | MIT | <https://foss.heptapod.net/openpyxl/openpyxl> | `python/vendor/openpyxl/LICENSE` | `pbc_social_financing` 读取人民银行社融 `.xlsx` 附件 |
97
+ | et_xmlfile | 2.0.0 | MIT(含一段 Python 标准库来源代码,其许可全文见 `python/vendor/et_xmlfile/LICENSE.python`) | <https://foss.heptapod.net/openpyxl/et_xmlfile> | `python/vendor/et_xmlfile/LICENSE` | openpyxl 的 XML 读写底层依赖;不直接调用 |
98
+
99
+ 三条脚本本身是本仓代码(python/scripts 目录),不复制上游实现;BaoStock 服务条款、人民银行附件版权
100
+ 归各服务方,见下文「外部数据与检索服务」。
101
+
86
102
  ## 按需安装的 Python 运行时包(不随主包)
87
103
 
88
104
  主 npm 包不携带解释器。用户首次点「准备分析环境」时,插件从 npm 安装对应的平台运行时包到
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@v587d/capital-automation",
3
- "version": "2.29.0",
3
+ "version": "2.30.1",
4
4
  "description": "CapGen 投研自动化:独立 host bundle(固定 capital_automation 域、单 scheduler owner、/capital-automation 路由与浏览器页面)。",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@v587d/capital-charts",
3
- "version": "2.29.0",
3
+ "version": "2.30.1",
4
4
  "description": "自动模式的图表前端组件(浏览器半边 + 序列旁路路由):由 @v587d/capital-generation 随包携带并作为 host 平面行挂载。",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@v587d/config",
3
- "version": "2.29.0",
3
+ "version": "2.30.1",
4
4
  "description": "自动模式的取数凭据与偏好配置行:卡片坐在 @v587d/capital-generation 插件主页的「配置」段,点这一行本身没有表单。",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -4,6 +4,11 @@ import { rootPolicyProbes } from './agents/root-tool-policy.js';
4
4
  import { rolePolicyProbes } from './agents/role-tool-policy.js';
5
5
  import { createTencentSources } from './sources/tencent-http.js';
6
6
  import { createEastmoneySources } from './sources/eastmoney-http.js';
7
+ import { createSinaSources } from './sources/sina-http.js';
8
+ import { createOfficialSources } from './sources/official-http.js';
9
+ import { createCsindexSources } from './sources/csindex-http.js';
10
+ import { createThsSources } from './sources/ths-http.js';
11
+ import { createPythonSources } from './sources/python-remote.js';
7
12
  import { createFuyaoRestSources, resolveFuyaoApiKey } from './sources/fuyao-rest.js';
8
13
  import { createFtshareSources, resolveFtshareApiKey } from './sources/ftshare-rest.js';
9
14
  import { createWindSources } from './sources/wind-mcp.js';
@@ -46,7 +51,22 @@ function diagnosticsFor(ctx, config) {
46
51
  ],
47
52
  };
48
53
  }
49
- /** Registers all 128 sources; registration is structural, credentials resolve per call. */
54
+ /**
55
+ * Python data capabilities resolve the `pythonRuntime` service per call: the row is opt-in and the
56
+ * pack may be missing, so a boot-time lookup would either hide the capabilities or fail the plugin.
57
+ * A missing service is reported as the runtime's own "not ready" code so the six capabilities all
58
+ * carry the same install hint (§9.7: external state at call time, failures are never memoized).
59
+ */
60
+ function pythonRunnerFrom(ctx) {
61
+ return async (request) => {
62
+ const manager = ctx.get('pythonRuntime');
63
+ if (manager === undefined) {
64
+ throw Object.assign(new Error('私有 Python 运行时未加载(python-runtime 行未启用或尚未装配);请在插件设置 → 分析环境里安装 base pack'), { code: 'data-runtime-not-ready' });
65
+ }
66
+ return await manager.runDataScript(request);
67
+ };
68
+ }
69
+ /** Registers all sources; registration is structural, credentials and the python runtime resolve per call. */
50
70
  function registerSources(ctx, hub, config) {
51
71
  ctx.effect(() => {
52
72
  const sources = createTencentSources();
@@ -62,6 +82,41 @@ function registerSources(ctx, hub, config) {
62
82
  return () => { for (const dispose of disposers)
63
83
  dispose(); };
64
84
  }, 'capital-generation.eastmoney-sources()');
85
+ ctx.effect(() => {
86
+ const sources = createSinaSources();
87
+ const disposers = sources.map((dataSource) => hub.registerSource(dataSource));
88
+ ctx.logger.info(`capital-generation: 已注册 ${disposers.length} 个新浪数据源(sina_*:ETF 期权 + A50)`);
89
+ return () => { for (const dispose of disposers)
90
+ dispose(); };
91
+ }, 'capital-generation.sina-sources()');
92
+ ctx.effect(() => {
93
+ const sources = createOfficialSources();
94
+ const disposers = sources.map((dataSource) => hub.registerSource(dataSource));
95
+ ctx.logger.info(`capital-generation: 已注册 ${disposers.length} 个交易所/货币网官方数据源(official_*:ETF 份额 + 回购定盘)`);
96
+ return () => { for (const dispose of disposers)
97
+ dispose(); };
98
+ }, 'capital-generation.official-sources()');
99
+ ctx.effect(() => {
100
+ const sources = createThsSources();
101
+ const disposers = sources.map((dataSource) => hub.registerSource(dataSource));
102
+ ctx.logger.info(`capital-generation: 已注册 ${disposers.length} 个同花顺网页直连数据源(ths_*:热榜 + 涨停揭秘)`);
103
+ return () => { for (const dispose of disposers)
104
+ dispose(); };
105
+ }, 'capital-generation.ths-sources()');
106
+ ctx.effect(() => {
107
+ const sources = createCsindexSources();
108
+ const disposers = sources.map((dataSource) => hub.registerSource(dataSource));
109
+ ctx.logger.info(`capital-generation: 已注册 ${disposers.length} 个中证指数数据源(csindex_*:指数估值)`);
110
+ return () => { for (const dispose of disposers)
111
+ dispose(); };
112
+ }, 'capital-generation.csindex-sources()');
113
+ ctx.effect(() => {
114
+ const sources = createPythonSources(pythonRunnerFrom(ctx));
115
+ const disposers = sources.map((dataSource) => hub.registerSource(dataSource));
116
+ ctx.logger.info(`capital-generation: 已注册 ${disposers.length} 个私有 Python 数据源(baostock_* / pbc_*,运行时调用期现取)`);
117
+ return () => { for (const dispose of disposers)
118
+ dispose(); };
119
+ }, 'capital-generation.python-sources()');
65
120
  ctx.effect(() => {
66
121
  const sources = createFuyaoRestSources(() => resolveFuyaoApiKey(ctx, config.fuyaoCredentialRef || 'FUYAO_API_KEY'));
67
122
  const disposers = sources.map((dataSource) => hub.registerSource(dataSource));
@@ -3,7 +3,7 @@
3
3
  * source: the nine shards must be audited together, and a missing production entry is a
4
4
  * test failure rather than a capability that silently falls into `meta`.
5
5
  */
6
- export declare const CATALOG_TOPICS: readonly ["quote", "flow", "financials", "fund", "events", "macro", "futures", "cross", "meta"];
6
+ export declare const CATALOG_TOPICS: readonly ["quote", "flow", "financials", "fund", "events", "macro", "futures", "options", "cross", "meta"];
7
7
  export type CatalogTopic = (typeof CATALOG_TOPICS)[number];
8
8
  export declare const CATALOG_TOPIC_LABELS: Record<CatalogTopic, string>;
9
9
  /**
@@ -11,6 +11,7 @@ export const CATALOG_TOPICS = [
11
11
  'events',
12
12
  'macro',
13
13
  'futures',
14
+ 'options',
14
15
  'cross',
15
16
  'meta',
16
17
  ];
@@ -22,6 +23,7 @@ export const CATALOG_TOPIC_LABELS = {
22
23
  events: '公告与公司行为',
23
24
  macro: '宏观与利率',
24
25
  futures: '期货与商品',
26
+ options: '期权',
25
27
  cross: '跨境与全球',
26
28
  meta: '日历与元数据',
27
29
  };
@@ -33,6 +35,7 @@ export const CATALOG_TOPIC_LABELS = {
33
35
  export const CATALOG_TAXONOMY = {
34
36
  // quote
35
37
  'auction': 'quote',
38
+ 'csindex_index_valuation': 'quote',
36
39
  'eastmoney_global_kline': 'quote',
37
40
  'eastmoney_global_quote': 'quote',
38
41
  'eastmoney_sector_rotation': 'quote',
@@ -82,9 +85,16 @@ export const CATALOG_TAXONOMY = {
82
85
  'limit_down_pool': 'flow',
83
86
  'limit_up_ladder': 'flow',
84
87
  'limit_up_pool': 'flow',
88
+ 'limit_up_statistics': 'flow',
89
+ 'abnormal_monitor_list': 'flow',
85
90
  'skyrocket_list': 'flow',
91
+ 'ths_hot_list': 'flow',
92
+ 'ths_limit_up_detail': 'flow',
93
+ 'sse_etf_shares': 'flow',
94
+ 'szse_etf_shares': 'flow',
86
95
  // financials
87
96
  'balance_sheet': 'financials',
97
+ 'baostock_valuation_history': 'financials',
88
98
  'cash_flow': 'financials',
89
99
  'eastmoney_convertible_bond_list': 'financials',
90
100
  'financial_indicators': 'financials',
@@ -130,9 +140,16 @@ export const CATALOG_TAXONOMY = {
130
140
  'fund_top_holders': 'fund',
131
141
  // events
132
142
  'corporate_actions': 'events',
143
+ 'eastmoney_buyback': 'events',
133
144
  'eastmoney_dividend_plan': 'events',
145
+ 'eastmoney_holder_change': 'events',
146
+ 'eastmoney_institution_research': 'events',
134
147
  'eastmoney_lockup_expiry': 'events',
148
+ 'eastmoney_new_stock': 'events',
149
+ 'eastmoney_pledge': 'events',
135
150
  // macro
151
+ 'chinamoney_repo_fixing': 'macro',
152
+ 'pbc_social_financing': 'macro',
136
153
  'eastmoney_cpi': 'macro',
137
154
  'eastmoney_customs_trade': 'macro',
138
155
  'eastmoney_deposit_reserve': 'macro',
@@ -159,16 +176,32 @@ export const CATALOG_TAXONOMY = {
159
176
  'ftshare_futures_settle': 'futures',
160
177
  'ftshare_futures_warrant': 'futures',
161
178
  'ftshare_futures_weekly': 'futures',
179
+ 'sina_a50_futures': 'futures',
180
+ // options
181
+ 'sina_etf_option_contracts': 'options',
182
+ 'sina_etf_option_greeks': 'options',
183
+ 'sina_etf_option_tquote': 'options',
162
184
  // cross
185
+ 'eastmoney_limit_up_pool': 'flow',
186
+ 'eastmoney_limit_break_pool': 'flow',
187
+ 'eastmoney_limit_down_pool': 'flow',
188
+ 'eastmoney_yesterday_limit_up_pool': 'flow',
189
+ 'eastmoney_price_anomaly_list': 'flow',
190
+ 'eastmoney_price_anomaly_count': 'flow',
191
+ 'eastmoney_stock_hot_concepts': 'flow',
163
192
  'eastmoney_mutual_flow': 'cross',
164
193
  'eastmoney_mutual_quota': 'cross',
165
194
  'ftshare_financial_calendar': 'cross',
166
195
  'ftshare_trading_calendar': 'cross',
167
196
  'wind_stock_kline': 'cross',
168
197
  // meta
198
+ 'baostock_stock_basic': 'meta',
199
+ 'eastmoney_security_profile': 'meta',
200
+ 'eastmoney_st_stock_list': 'meta',
169
201
  'ftshare_index_weight': 'meta',
170
202
  'index_catalog': 'meta',
171
203
  'index_constituents': 'meta',
204
+ 'index_membership_by_stock': 'meta',
172
205
  'ticker_list': 'meta',
173
206
  'ticker_search': 'meta',
174
207
  'trading_calendar': 'meta',
@@ -144,6 +144,7 @@ const datasetRefProperties = { dataset_id: { type: 'string' },
144
144
  captured_at: { type: 'integer' },
145
145
  retention_until: { type: 'integer' },
146
146
  params_digest: { type: 'string' },
147
+ envelope: { type: 'object', additionalProperties: true },
147
148
  time_coverage: {
148
149
  type: 'object',
149
150
  properties: {
@@ -315,6 +316,7 @@ const describeResultSchema = jsonObject({
315
316
  shape: { type: 'string', enum: ['array', 'envelope_item', 'document', 'none'] },
316
317
  reason: { type: 'string' },
317
318
  }, ['readable', 'shape']),
319
+ envelope: { type: 'object', additionalProperties: true },
318
320
  profile_id: { type: 'string' },
319
321
  profile_ref: { type: 'string' },
320
322
  columns: { type: 'array', items: { type: 'string' } },
@@ -348,7 +350,7 @@ export function registerDatasetTools(ctx, store, options = {}) {
348
350
  if (!tools)
349
351
  return;
350
352
  const registrations = [
351
- tool('inspect_dataset', '读取当前 session 已授权 Dataset 的元数据和可读性。只返回 DatasetRef 与可读性信息,不返回原始 rows,也不接受任何文件路径。query_access.shape 取值:array / envelope_item = 行集合,可 profile 也可 query;document = 顶层是文档对象(财务指标、回测结果这类),可 profile(宿主给结构摘要与有界内容)但不能 query;none = 不可读,reason 说明原因。批量描述多份 Dataset 请用 describe_dataset(一次一份、可并发);本工具用于单点复核。', jsonObject({ dataset_id: datasetIdSchema }, ['dataset_id']), datasetRefWithAccessSchema, async (args, exec) => store.inspectDataset(readDatasetId(args.dataset_id), authorizedSession(ctx, exec, 'inspect_dataset', DATASET_READING_PRESET_IDS), exec.signal)),
353
+ tool('inspect_dataset', '读取当前 session 已授权 Dataset 的元数据和可读性。只返回 DatasetRef 与可读性信息,不返回原始 rows,也不接受任何文件路径。envelope(若有)是响应根级标量:交易日、requested_date_clamped、available、note、calculated_at 这类口径标记,用它核对「数据归属哪一天/是否被夹日期」;它不是列,不能 query,也不是行数据。query_access.shape 取值:array / envelope_item = 行集合,可 profile 也可 query;document = 顶层是文档对象(财务指标、回测结果这类),可 profile(宿主给结构摘要与有界内容)但不能 query;none = 不可读,reason 说明原因。批量描述多份 Dataset 请用 describe_dataset(一次一份、可并发);本工具用于单点复核。', jsonObject({ dataset_id: datasetIdSchema }, ['dataset_id']), datasetRefWithAccessSchema, async (args, exec) => store.inspectDataset(readDatasetId(args.dataset_id), authorizedSession(ctx, exec, 'inspect_dataset', DATASET_READING_PRESET_IDS), exec.signal)),
352
354
  tool('profile_dataset', `由宿主读取 Dataset 并返回基础质量检查与四类事实;原始 rows 不进入模型上下文。行集合返回:① schema/quality——字段 observed/contract 类型、missing/null/invalid 计数、重复行、时间顺序;② statistics——数值字段的 count/sum/min/max/mean/分位数;③ categories——字符串字段的 distinct_count 与最多 5 个高频取值(truncated=true 表示未列全);④ time_facts——时间列覆盖范围与首行/末行的数值取值(回答"最新值、区间涨跌"必须用它,不要用 min/max 代替首末值);⑤ structure——行内数组/对象的路径摘要(对象字段用 .name、数组元素用 [];未抽样时用 total_elements,超过 50 项时用 sampled_elements,后者明确表示只是抽样,不能据此回答完整数量)。文档型 Dataset(顶层是文档对象,没有行数组)返回 structure 结构摘要 + document 有界内容,不返回行列统计。time_column 可显式指定,省略时按列名候选并只在取值全为数字或日期样式时采用。不接受任何文件路径、脚本内容或额外 schema。批量描述请用 describe_dataset(一次一份、可并发);本工具用于单点复核或补取一份完整 profile。`, jsonObject({
353
355
  dataset_id: datasetIdSchema,
354
356
  task_id: { type: 'string' },
@@ -386,7 +388,7 @@ export function registerDatasetTools(ctx, store, options = {}) {
386
388
  withIsoTimeColumns(result, prepared.axis);
387
389
  return result;
388
390
  }),
389
- tool('describe_dataset', `读取一份 Dataset 的**默认入口**:一次调用完成 inspect(元数据与可读性/形状)、profile(宿主算基础质量与四类事实,写入 profile_ref)与受控 query(可选);原始 rows 不进入模型上下文。一次只处理一个 dataset_id——本轮有多份数据时请并发调用本工具(PTC 在同一个 run_code 程序里用 Promise.all,native 在同一条消息里一次发出多个调用),不要一份一份等。行集合返回:① 元数据 artifact_ref/capability/source_label/captured_at/retention_until 与 query_access.shape(array / envelope_item = 行集合;document = 顶层文档对象,只能 profile,queries 由宿主跳过);② profile 四类事实——statistics(count/sum/min/max/mean/分位数)、categories(distinct + 最多 5 个高频取值)、time_facts(覆盖范围与首行/末行取值;回答"最新值、区间涨跌"必须用它,不要用 min/max 代替)、structure(嵌套路径摘要);③ queries——每条的 QueryResult,或该条自己的 error(单条失败不影响其余)。columns_of_interest 只对这些列返回 statistics/categories/schema(并同样收窄 time_facts 的首末值投影,时间列永远保留),是收窄结果体积的唯一手段。结果超过 ${SAFE_RESULT_CHARS} 码点时宿主不返回超长载荷,而返回 {status:'too_large', profile_ref, columns, bytes, facts_bytes, queries_bytes, hint}:facts_bytes/queries_bytes 是体积归因(哪边大砍哪边),按 hint 重发一次即可——queries 大就先去掉 queries(聚合改单独走 query_dataset),facts 大就用 columns_of_interest 收窄列(或减少 queries,最多 ${MAX_DESCRIBE_QUERIES} 条)。单点复核仍可用 inspect_dataset / profile_dataset / query_dataset;不接受任何文件路径、脚本内容或自定义表达式。`, describeParametersSchema, describeResultSchema, async (args, exec) => describeDataset({
391
+ tool('describe_dataset', `读取一份 Dataset 的**默认入口**:一次调用完成 inspect(元数据与可读性/形状)、profile(宿主算基础质量与四类事实,写入 profile_ref)与受控 query(可选);原始 rows 不进入模型上下文。一次只处理一个 dataset_id——本轮有多份数据时请并发调用本工具(PTC 在同一个 run_code 程序里用 Promise.all,native 在同一条消息里一次发出多个调用),不要一份一份等。行集合返回:① 元数据 artifact_ref/capability/source_label/captured_at/retention_until 与 query_access.shape(array / envelope_item = 行集合;document = 顶层文档对象,只能 profile,queries 由宿主跳过),以及 envelope(若响应是 envelope 形态:根级交易日/请求日钳制标记/available/note/计算时间等标量,回答「数据属于哪一天、是否被夹到最近交易日」必须看它,它不是列、不能 query);② profile 四类事实——statistics(count/sum/min/max/mean/分位数)、categories(distinct + 最多 5 个高频取值)、time_facts(覆盖范围与首行/末行取值;回答"最新值、区间涨跌"必须用它,不要用 min/max 代替)、structure(嵌套路径摘要);③ queries——每条的 QueryResult,或该条自己的 error(单条失败不影响其余)。columns_of_interest 只对这些列返回 statistics/categories/schema(并同样收窄 time_facts 的首末值投影,时间列永远保留),是收窄结果体积的唯一手段。结果超过 ${SAFE_RESULT_CHARS} 码点时宿主不返回超长载荷,而返回 {status:'too_large', profile_ref, columns, bytes, facts_bytes, queries_bytes, hint}:facts_bytes/queries_bytes 是体积归因(哪边大砍哪边),按 hint 重发一次即可——queries 大就先去掉 queries(聚合改单独走 query_dataset),facts 大就用 columns_of_interest 收窄列(或减少 queries,最多 ${MAX_DESCRIBE_QUERIES} 条)。单点复核仍可用 inspect_dataset / profile_dataset / query_dataset;不接受任何文件路径、脚本内容或自定义表达式。`, describeParametersSchema, describeResultSchema, async (args, exec) => describeDataset({
390
392
  store,
391
393
  session: authorizedSession(ctx, exec, 'describe_dataset', DATASET_READING_PRESET_IDS),
392
394
  request: normalizeDescribeArgs(args),
@@ -39,6 +39,8 @@ export interface DescribeResult {
39
39
  retention_until: number;
40
40
  params_digest: string;
41
41
  query_access: DatasetInspection['query_access'];
42
+ /** Envelope root scalars (trade_date / requested_date_clamped / calculated_at …), never rows. */
43
+ envelope?: Record<string, unknown>;
42
44
  profile_id: string;
43
45
  profile_ref: string;
44
46
  columns: string[];
@@ -173,6 +173,7 @@ export async function describeDataset(input) {
173
173
  params_digest: inspection.params_digest,
174
174
  time_coverage: inspection.time_coverage,
175
175
  query_access: inspection.query_access,
176
+ envelope: inspection.envelope,
176
177
  profile_id: profile.profile_id,
177
178
  profile_ref: profile.artifact_ref,
178
179
  columns: profile.columns,
@@ -200,6 +201,7 @@ export async function describeDataset(input) {
200
201
  profile_ref: profile.artifact_ref,
201
202
  shape,
202
203
  columns: profile.columns,
204
+ envelope: inspection.envelope,
203
205
  bytes,
204
206
  facts_bytes: factsBytes,
205
207
  queries_bytes: queriesBytes,
@@ -25,6 +25,11 @@ export declare const MAX_STRUCTURE_ENTRIES = 24;
25
25
  export declare const MAX_DOCUMENT_CHARS = 6000;
26
26
  /** Presentation rows are capped: charts are bounded rendering, not a general analysis channel. */
27
27
  export declare const MAX_PRESENTATION_ROWS = 200000;
28
+ /**
29
+ * Envelope root scalars carried on DatasetRef (dates, clamp flags, notes). Rows never ride here;
30
+ * this is the only way a consumer can see `requested_date_clamped` / `calculated_at` at all.
31
+ */
32
+ export declare const MAX_ENVELOPE_BYTES = 4096;
28
33
  export declare const ARTIFACT_SCHEME = "workspace://";
29
34
  export interface DatasetRef {
30
35
  dataset_id: string;
@@ -41,6 +46,12 @@ export interface DatasetRef {
41
46
  params_digest: string;
42
47
  /** Host-computed from the stored rows; omitted only by manifests written before this field existed. */
43
48
  time_coverage?: DatasetTimeCoverage;
49
+ /**
50
+ * Bounded root-level scalars of an envelope-shaped response (trade_date / requested_date_clamped /
51
+ * available / note / calculated_at …). Never rows and never nested payloads; omitted for arrays,
52
+ * for documents, and by manifests written before this field existed.
53
+ */
54
+ envelope?: Record<string, unknown>;
44
55
  }
45
56
  export type DatasetShape = 'array' | 'envelope_item' | 'document' | 'none';
46
57
  export interface DatasetInspection extends DatasetRef {
@@ -34,6 +34,13 @@ const MAX_AXIS_PROBE_ROWS = 500;
34
34
  export const MAX_DOCUMENT_CHARS = 6_000;
35
35
  /** Presentation rows are capped: charts are bounded rendering, not a general analysis channel. */
36
36
  export const MAX_PRESENTATION_ROWS = 200_000;
37
+ /**
38
+ * Envelope root scalars carried on DatasetRef (dates, clamp flags, notes). Rows never ride here;
39
+ * this is the only way a consumer can see `requested_date_clamped` / `calculated_at` at all.
40
+ */
41
+ export const MAX_ENVELOPE_BYTES = 4_096;
42
+ const MAX_ENVELOPE_TEXT_CHARS = 512;
43
+ const MAX_ENVELOPE_OBJECT_BYTES = 1_024;
37
44
  const DOCUMENT_ARRAY_KEEP_STEPS = [8, 3, 1, 0];
38
45
  const DOCUMENT_MAX_DEPTH = 6;
39
46
  const DOCUMENT_MAX_OMISSIONS = 8;
@@ -104,6 +111,63 @@ function canonicalProfileRef(profileId) {
104
111
  function validNonNegativeInteger(value) {
105
112
  return typeof value === 'number' && Number.isSafeInteger(value) && value >= 0;
106
113
  }
114
+ /**
115
+ * Envelope root scalars are the only part of a response that otherwise reaches nobody: rows stay in
116
+ * raw.json, while `requested_date_clamped` / `calculated_at` / `available` live beside the row array.
117
+ * Arrays and nested objects are skipped on purpose — they are rows or payloads, not metadata.
118
+ */
119
+ function envelopeOf(data, rowKey) {
120
+ if (!isRecord(data))
121
+ return undefined;
122
+ const rowRoot = rowKey?.split('.')[0];
123
+ const envelope = {};
124
+ for (const [key, value] of Object.entries(data)) {
125
+ if (key === rowRoot)
126
+ continue;
127
+ const picked = envelopeValueOf(value);
128
+ if (picked === undefined)
129
+ continue;
130
+ if (JSON.stringify({ ...envelope, [key]: picked }).length > MAX_ENVELOPE_BYTES)
131
+ break;
132
+ envelope[key] = picked;
133
+ }
134
+ return Object.keys(envelope).length === 0 ? undefined : envelope;
135
+ }
136
+ /** Primitives, plus one shallow object of primitives (upstream wraps page totals this way). */
137
+ function envelopeValueOf(value) {
138
+ if (value === null || typeof value === 'boolean')
139
+ return value;
140
+ if (typeof value === 'number')
141
+ return Number.isFinite(value) ? value : undefined;
142
+ if (typeof value === 'string') {
143
+ return value.length > MAX_ENVELOPE_TEXT_CHARS ? `${value.slice(0, MAX_ENVELOPE_TEXT_CHARS)}…` : value;
144
+ }
145
+ if (!isRecord(value))
146
+ return undefined;
147
+ const flat = {};
148
+ for (const [key, entry] of Object.entries(value)) {
149
+ if (entry === null || typeof entry === 'boolean' || typeof entry === 'string') {
150
+ flat[key] = entry;
151
+ continue;
152
+ }
153
+ if (typeof entry === 'number' && Number.isFinite(entry)) {
154
+ flat[key] = entry;
155
+ continue;
156
+ }
157
+ return undefined;
158
+ }
159
+ return JSON.stringify(flat).length > MAX_ENVELOPE_OBJECT_BYTES ? undefined : flat;
160
+ }
161
+ function validEnvelope(value) {
162
+ if (!isRecord(value) || !Object.keys(value).every((key) => envelopeValueOf(value[key]) !== undefined))
163
+ return false;
164
+ try {
165
+ return JSON.stringify(value).length <= MAX_ENVELOPE_BYTES;
166
+ }
167
+ catch {
168
+ return false;
169
+ }
170
+ }
107
171
  export class WorkspaceDatasetStore {
108
172
  fs;
109
173
  sandboxPolicy;
@@ -127,6 +191,7 @@ export class WorkspaceDatasetStore {
127
191
  const dirPath = `${DATASETS_SUBDIR}/${datasetId}`;
128
192
  await this.assertContained(root, dirPath, signal);
129
193
  const capturedAt = this.now();
194
+ const envelope = input.format === 'json_rows' ? envelopeOf(input.data, input.row_key) : undefined;
130
195
  const manifest = {
131
196
  dataset_id: datasetId,
132
197
  task_id: input.task_id ?? null,
@@ -141,6 +206,7 @@ export class WorkspaceDatasetStore {
141
206
  retention_until: capturedAt + this.retentionMs,
142
207
  params_digest: input.params_digest,
143
208
  ...(input.time_coverage === undefined ? {} : { time_coverage: input.time_coverage }),
209
+ ...(envelope === undefined ? {} : { envelope }),
144
210
  };
145
211
  const storedManifest = {
146
212
  ...manifest,
@@ -211,7 +277,17 @@ export class WorkspaceDatasetStore {
211
277
  const { session_scope_id: _scope, row_key: rowKey, ...ref } = stored;
212
278
  try {
213
279
  const raw = await this.readRaw(ref, session, signal, rowKey);
214
- return { ...ref, query_access: { readable: true, shape: raw.kind === 'document' ? 'document' : raw.shape } };
280
+ // Manifests written before `envelope` existed still have the raw response: derive it on read
281
+ // so a Dataset taken minutes before the upgrade stays readable on the same terms.
282
+ const envelope = ref.envelope
283
+ ?? (raw.kind === 'rows' && raw.shape === 'envelope_item' && raw.envelope !== undefined
284
+ ? envelopeOf(raw.envelope, rowKey)
285
+ : undefined);
286
+ return {
287
+ ...ref,
288
+ ...(envelope === undefined ? {} : { envelope }),
289
+ query_access: { readable: true, shape: raw.kind === 'document' ? 'document' : raw.shape },
290
+ };
215
291
  }
216
292
  catch (error) {
217
293
  if (error instanceof DatasetStoreError && ['dataset_too_large', 'dataset_not_row_readable'].includes(error.code)) {
@@ -1146,6 +1222,8 @@ function validateStoredDatasetManifest(value, datasetId) {
1146
1222
  return undefined;
1147
1223
  if (value.time_coverage !== undefined && !validTimeCoverage(value.time_coverage))
1148
1224
  return undefined;
1225
+ if (value.envelope !== undefined && !validEnvelope(value.envelope))
1226
+ return undefined;
1149
1227
  const ref = {
1150
1228
  dataset_id: value.dataset_id,
1151
1229
  task_id: value.task_id,
@@ -1160,6 +1238,7 @@ function validateStoredDatasetManifest(value, datasetId) {
1160
1238
  retention_until: value.retention_until,
1161
1239
  params_digest: value.params_digest,
1162
1240
  ...(value.time_coverage === undefined ? {} : { time_coverage: value.time_coverage }),
1241
+ ...(value.envelope === undefined ? {} : { envelope: value.envelope }),
1163
1242
  };
1164
1243
  return {
1165
1244
  ...ref,
@@ -29,4 +29,4 @@ export interface DataCollectorDiagnostics {
29
29
  }
30
30
  export declare function registerDataCollectorTools(ctx: Context, hub: DataCollectorHub, diagnostics?: DataCollectorDiagnostics): void;
31
31
  /** Model-visible DatasetRef field whitelist (tests and host assertions). */
32
- export declare const DATASET_REF_FIELDS: readonly ["dataset_id", "task_id", "session_id", "artifact_ref", "format", "capability", "source_label", "schema", "row_count", "captured_at", "retention_until", "params_digest", "time_coverage"];
32
+ export declare const DATASET_REF_FIELDS: readonly ["dataset_id", "task_id", "session_id", "artifact_ref", "format", "capability", "source_label", "schema", "row_count", "captured_at", "retention_until", "params_digest", "time_coverage", "envelope"];