@v587d/capital-generation 2.30.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.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,26 @@
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
+
10
30
  ## [2.30.0] - 2026-11-22
11
31
 
12
32
  数据能力扩容:按上游 `a-stock-data` v3.10.4 的 15 层 87 端点复核补齐 **27 条能力**(135 → 162),并修两条口径缺陷。新增 ETF 期权、A50 期指、东财打板四池与日内异动、个股概念命中、同花顺热榜 / 涨停揭秘、沪深 ETF 份额、回购定盘、中证指数估值,以及一条受控的私有 Python 数据通道(BaoStock + 人民银行社融)。全部新能力都有真报文验收、巡检条目与回归。
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.30.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
 
@@ -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.30.0` 或 `@2.30.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 提取失败时可尝试本机直连。关闭后,本机直连的具名来源查询也不可用;请检查该开关和网络连接。
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@v587d/capital-automation",
3
- "version": "2.30.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.30.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.30.0",
3
+ "version": "2.30.1",
4
4
  "description": "自动模式的取数凭据与偏好配置行:卡片坐在 @v587d/capital-generation 插件主页的「配置」段,点这一行本身没有表单。",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -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"];
@@ -44,6 +44,7 @@ const datasetRefSchema = () => jsonObject({
44
44
  captured_at: { type: 'integer' },
45
45
  retention_until: { type: 'integer' },
46
46
  params_digest: { type: 'string' },
47
+ envelope: { type: 'object', additionalProperties: true },
47
48
  time_coverage: {
48
49
  type: 'object',
49
50
  properties: {
@@ -145,7 +146,7 @@ export function registerDataCollectorTools(ctx, hub, diagnostics) {
145
146
  return;
146
147
  const retryBudget = new UpstreamRetryBudget();
147
148
  const registrations = [
148
- tool('request_data', '向数据管道请求数据:宿主先按 capability+params 校验当前 session 的已验证 manifest;force_refresh=false 或省略且命中未过期、满足该来源缓存新鲜度的 Dataset 时直接返回已有 DatasetRef,不访问上游;force_refresh=true 才重新取数并生成新的不可变 Dataset(默认保留 7 天),绝不覆盖旧 Dataset。明确要现在/最新的行情快照时请用 force_refresh=true,7 天是保留期而非实时新鲜度。本工具只返回 DatasetRef(dataset_id / artifact_ref / schema / row_count / captured_at / retention_until 等元数据),绝不返回原始数据行。capability 必须是 list_capabilities 返回的短能力名(如 ticker_search / quote / history / trading_calendar),params 必须按 describe_capability({ capability }) 返回的 input_schema 填写。若返回 request_params_invalid,先重新调用 describe_capability({ capability: "<当前能力名>" }),再按 schema 修正并重试一次;不要凭记忆猜参数。可重试上游失败(限流、网络、超时、5xx)对同一 capability 最多 3 次尝试;返回 upstream_retry_exhausted 后停止重试,改用等价能力或回告主 Agent,不要用 wait_agent 等上游恢复。task_id 必须由主 Agent 在本轮委派前确定,并在所有子 Agent 与最终报告中原样复用;不要由 data_collector 自行生成。相同 capability+params 的并发请求合并为同一次执行。当前 workspace 只读或落盘失败时抛错 workspace_not_writable(绝不退化为内存假成功)。请求归属自动记为当前 delegated child session,不接收 requester_agent_id 参数。', jsonObject({
149
+ tool('request_data', '向数据管道请求数据:宿主先按 capability+params 校验当前 session 的已验证 manifest;force_refresh=false 或省略且命中未过期、满足该来源缓存新鲜度的 Dataset 时直接返回已有 DatasetRef,不访问上游;force_refresh=true 才重新取数并生成新的不可变 Dataset(默认保留 7 天),绝不覆盖旧 Dataset。明确要现在/最新的行情快照时请用 force_refresh=true,7 天是保留期而非实时新鲜度。本工具只返回 DatasetRef(dataset_id / artifact_ref / schema / row_count / captured_at / retention_until 等元数据,以及 envelope——响应根级的日期/钳制标记/计算时间等标量,若有),绝不返回原始数据行。envelope 是核对口径用的(例如 requested_date_clamped=true 表示上游把请求日夹到了最近交易日),不是行数据、不能 query。capability 必须是 list_capabilities 返回的短能力名(如 ticker_search / quote / history / trading_calendar),params 必须按 describe_capability({ capability }) 返回的 input_schema 填写。若返回 request_params_invalid,先重新调用 describe_capability({ capability: "<当前能力名>" }),再按 schema 修正并重试一次;不要凭记忆猜参数。可重试上游失败(限流、网络、超时、5xx)对同一 capability 最多 3 次尝试;返回 upstream_retry_exhausted 后停止重试,改用等价能力或回告主 Agent,不要用 wait_agent 等上游恢复。task_id 必须由主 Agent 在本轮委派前确定,并在所有子 Agent 与最终报告中原样复用;不要由 data_collector 自行生成。相同 capability+params 的并发请求合并为同一次执行。当前 workspace 只读或落盘失败时抛错 workspace_not_writable(绝不退化为内存假成功)。请求归属自动记为当前 delegated child session,不接收 requester_agent_id 参数。', jsonObject({
149
150
  capability: { type: 'string' },
150
151
  params: freeObject,
151
152
  force_refresh: { type: 'boolean' },
@@ -292,5 +293,5 @@ export function registerDataCollectorTools(ctx, hub, diagnostics) {
292
293
  export const DATASET_REF_FIELDS = [
293
294
  'dataset_id', 'task_id', 'session_id', 'artifact_ref', 'format',
294
295
  'capability', 'source_label', 'schema', 'row_count', 'captured_at',
295
- 'retention_until', 'params_digest', 'time_coverage',
296
+ 'retention_until', 'params_digest', 'time_coverage', 'envelope',
296
297
  ];
@@ -978,7 +978,7 @@ export function createTencentSources() {
978
978
  cacheMaxAgeMs: 60_000,
979
979
  name: 'get_tencent_kline',
980
980
  summary: '腾讯日周月复权和分钟 K 线',
981
- description: '获取单只 SH/SZ 股票、指数或 ETF 的腾讯 K 线。period 为 day/week/month 或 m1/m5/m15/m30/m60;日周月可用 qfq/hfq/none,分钟线只能 none;start/end 仅日周月支持 YYYY-MM-DD,count 日周月最多 640、分钟最多 320。⛔ **成交量的单位分两套,行里用 `volume_unit` 显式标明**:科创板(688/689)是**股**(`share`),其余——沪深主板、创业板、B 股、ETF(含科创板 ETF 588xxx)、LOF、REITs、指数——是**手**(`lot`,1 手 = 100 股/份;本能力不覆盖可转债的 1 手 = 10 张)。日周月线、分钟线、复权与否都是同一规则;按「手」统一换算科创板会差 100 倍(上游 V3.10.1 用通达信盘后包逐股对账后确认,此前文档一律写「手」)。另:非科创板**最近一个交易日**的分钟量是整手、到下一个交易日才回填成精确股数(回填时点上游未测出),科创板分钟量当天就是精确股数——所以隔日的分钟合计与日线成交量会对不上一点点,那不是丢数据。腾讯 K 线不提供成交额;分钟返回 turnover_rate_pct,腾讯原始字段为基点后除以 100。内部会按参考 skill 的三个腾讯入口轮换,但不把入口拆成 capability。BJ 代码明确拒绝。',
981
+ description: '获取单只 SH/SZ 股票、指数或 ETF 的腾讯 K 线。period 为 day/week/month 或 m1/m5/m15/m30/m60;日周月可用 qfq/hfq/none,分钟线只能 none;start/end 仅日周月支持 YYYY-MM-DD,count 日周月最多 640、分钟最多 320。⛔ **成交量的单位分两套,行里用 `volume_unit` 显式标明**:科创板(688/689)是**股**(`share`),其余——沪深主板、创业板、B 股、ETF(含科创板 ETF 588xxx)、LOF、REITs、指数——是**手**(`lot`,1 手 = 100 股/份;本能力不覆盖可转债的 1 手 = 10 张)。日周月线、分钟线、复权与否都是同一规则;按「手」统一换算科创板会差 100 倍(上游 V3.10.1 用通达信盘后包逐股对账后确认,此前文档一律写「手」)。另:非科创板**最近一个交易日**的分钟量是整手、到下一个交易日才回填成精确股数(回填时点上游未测出),科创板分钟量当天就是精确股数——所以隔日的分钟合计与日线成交量会对不上一点点,那不是丢数据。⛔ **qfq/hfq 日线在盘后可能还没回填当日那根**(实测 2026-11-23 17:35:600519 的 qfqday 只到 11-20,同票 adjust=none 已有 11-23;688981 正常返回当日)——要当日收盘价请用 adjust:"none" 或 tencent_quote 快照,少一根是上游复权序列未回填,不是数据损坏。腾讯 K 线不提供成交额;分钟返回 turnover_rate_pct,腾讯原始字段为基点后除以 100。内部会按参考 skill 的三个腾讯入口轮换,但不把入口拆成 capability。BJ 代码明确拒绝。',
982
982
  inputSchema: { type: 'object', properties: { code: { type: 'string', description: '单只完整证券代码,如 600519.SH' }, period: { type: 'string', enum: ['day', 'week', 'month', 'm1', 'm5', 'm15', 'm30', 'm60'] }, adjust: { type: 'string', enum: ['qfq', 'hfq', 'none'] }, start: { type: 'string', description: '日/周/月起始日期 YYYY-MM-DD' }, end: { type: 'string', description: '日/周/月结束日期 YYYY-MM-DD' }, count: { type: 'integer', minimum: 1, maximum: 640 } }, required: ['code'], additionalProperties: false },
983
983
  outputSchema: klineOutput,
984
984
  paginated: false,
@@ -169,7 +169,7 @@ function sealClock(value, upstreamDate, field, label) {
169
169
  }
170
170
  const HOT_KEYS = ['rank', 'code', 'name', 'rank_change', 'heat', 'change_pct', 'concepts', 'popularity_tag'];
171
171
  const LIMIT_UP_KEYS = [
172
- 'code', 'name', 'price', 'change_pct', 'reason', 'board_type', 'seal_rate', 'break_times',
172
+ 'trade_date', 'code', 'name', 'price', 'change_pct', 'reason', 'board_type', 'seal_rate', 'break_times',
173
173
  'seal_amount', 'seal_volume', 'high_days', 'first_seal', 'last_seal', 'is_again', 'turnover_rate_pct',
174
174
  ];
175
175
  // Nullable shapes carry a description: hub.ts turns output_schema properties into the catalog
@@ -202,6 +202,7 @@ const hotListOutput = {
202
202
  const limitUpOutput = {
203
203
  type: 'array',
204
204
  items: rowSchema({
205
+ trade_date: { type: 'string', description: '交易日 YYYY-MM-DD,取自上游 data.date(省略 date 参数时是上游最近交易日);行内可核验的业务日期' },
205
206
  code: { type: 'string', description: '6 位 A 股代码,不带市场后缀(不含北交所)' },
206
207
  name: { type: 'string', description: '证券简称' },
207
208
  price: { type: 'number', description: '最新价,元' },
@@ -326,6 +327,7 @@ function mapLimitUpRow(item, upstreamDate, label) {
326
327
  throw thsError(`${label} has an unreadable is_again_limit: ${JSON.stringify(item.is_again_limit)}`, 'ths_invalid_response');
327
328
  const turnoverPct = requiredNumber(item.turnover_rate, 'turnover_rate', label);
328
329
  return {
330
+ trade_date: isoDateFromCompact(upstreamDate),
329
331
  code,
330
332
  name,
331
333
  price,
@@ -434,6 +436,7 @@ function isHotRow(row) {
434
436
  function isLimitUpRow(row) {
435
437
  return isRecord(row)
436
438
  && Object.keys(row).length === LIMIT_UP_KEYS.length
439
+ && typeof row.trade_date === 'string' && DATE_PATTERN.test(row.trade_date) && isCalendarDate(row.trade_date)
437
440
  && typeof row.code === 'string' && /^\d{6}$/.test(row.code)
438
441
  && typeof row.name === 'string' && row.name.length > 0
439
442
  && typeof row.price === 'number' && Number.isFinite(row.price) && row.price > 0
@@ -500,7 +503,7 @@ export function createThsSources() {
500
503
  capability: 'ths_limit_up_detail',
501
504
  name: 'get_ths_limit_up_detail',
502
505
  summary: '同花顺涨停揭秘(板型/封板成功率/是否回封)',
503
- description: '同花顺涨停揭秘(data.10jqka.com.cn 网页 JSON,零 key):按交易日取涨停个股,补上 Fuyao `limit_up_pool` 没有的三列——**board_type(板型:实测 换手板 / 一字板 / T字板)、seal_rate(封板成功率 0~1 小数)、is_again(是否回封 0/1)**;另有 reason(涨停原因题材)/ price / change_pct / turnover_rate_pct / seal_amount / seal_volume / break_times / high_days / first_seal / last_seal。⛔ 与 Fuyao `limit_up_pool` 是两家口径、必须并存:Fuyao 有连板数(continue_day_cnt)/ 封板资金(seal_money)/ 涨停原因,但**没有板型 / 封板成功率 / 是否回封**;本能力**不含北交所**(上游 filter=HS,GEM2STAR 只覆盖沪深主板 + 创业板 + 科创板;实测 2026-11-20 的 28 行 market_type 只有 HS/GEM、无 8/4/92 开头代码,2026-01-05 的 107 行出现 HS/GEM/STAR),也**不含 ST 涨停**(实测与 Fuyao 三个交易日对账:2026-11-20 28 vs 30 差 2 行、2025-11-20 41 vs 49 差 8 行、2026-01-05 107 vs 126 差 19 行,差额**全部**是 ST 股)——北交所与 ST 涨停请用 Fuyao `limit_up_pool`。⛔ 单位 / 口径(全部实测):price 是最新价(元);change_pct 是**百分数原值**(10.0228 = +10.0228%,与 Fuyao price_change_ratio_pct、tencent_quote pct、ftshare_ashare_quote change_rate×100 三方一致);turnover_rate_pct 是**百分数原值**(27.7729 = 27.7729%,同 tencent_quote turnover 27.77);seal_rate 是**0~1 小数比例**(0.8 = 80%,1 = 100%;**null = 上游未给**(实测 2026-01-05 的 107 行里 14 行 null),不是 0;2026-11-20 国光股份 0 是真实值);seal_amount 单位**元**(实测 2026-11-20 全 28 行 = seal_volume × price,偏差 ≤5 元为上游取整、最大实测 4.25 元);seal_volume 单位**股**;break_times 是开板(炸板)次数,**null 不是 0**(实测连 LIMIT_BACK 的行也有 null,不能用它反推开板次数);high_days 是**字符串**(首板 / 3天2板 / 7天4板 / 15天13板),⛔ **不是连板数**(实测 2026-11-20 好当家 THS「7天4板」而 Fuyao continue_day_cnt=1「首板」);is_again 是上游 is_again_limit 的 0/1 原值;first_seal / last_seal 由上游 **Unix 秒**(字符串,如 "1795144339")转北京时间 HH:MM:SS(1795144339 → 11:12:19;实测与 Fuyao limit_up_time 的 HH:MM 逐行一致:2026-11-20 28/28、2026-01-05 107/107),⛔ **不是东财四池的 HHMMSS 整数**;时间戳换算出的北京日期必须等于响应 data.date,否则按结构异常失败。参数:date 省略 = 上游最近交易日(实测 2026-11-22 周日省略 → data.date=20261120;行内不带日期列,要确定业务日期请显式传),YYYY-MM-DD(也收 YYYYMMDD,归一成 YYYY-MM-DD);实测支持窗口起点 2025-11-07(2025-11-06 及更早回 status_code=-1「date参数不合法」,是**响亮失败不是空**;起点是固定日还是滚动窗未核出);非交易日 / 未来日期回 status_code=0 + info=[](合法空)。page / size:page 从 1 开始、size 1~200(实测 size=201 → status_code=-1「limitmust be less than or equal to 200」,上游原文如此),默认 1 / 200,单次只取一页(上游 page 元数据 {limit,total,count=总页数,page};输出只有本页行,行数 = size 时可能还有下一页);⛔ 超界 page 上游**回落到最后一页且该页返回 0 行**(实测 page=99&size=10 → 回显 page 3、info=[];size=200 时只有 1 页 → 回显 page 1),本层核对回显 page,不一致即失败,不静默把别的页当请求页返回。合法空 vs 失败:status_code=0 且 info=[] 才是合法空(非交易日 / 未来日期 / 当日无涨停);status_code 或 HTTP 非 0、非 JSON、data 结构不对一律响亮失败(同花顺有反爬史,401/403 不要循环重试)。⛔ 响应里的 trade_status 是**查询时刻**的会话状态、不是请求日期的状态(实测周日查 2026-11-20 时 trade_status=non_trading_day 却有 28 行),不要用它判空或判失败。未收录上游字段:market_type / market_id / currency_value(流通市值)/ is_new / change_tag / high_days_value / time_preview,以及 data.limit_up_count / limit_down_count / trade_status。',
506
+ description: '同花顺涨停揭秘(data.10jqka.com.cn 网页 JSON,零 key):按交易日取涨停个股,补上 Fuyao `limit_up_pool` 没有的三列——**board_type(板型:实测 换手板 / 一字板 / T字板)、seal_rate(封板成功率 0~1 小数)、is_again(是否回封 0/1)**;另有 reason(涨停原因题材)/ price / change_pct / turnover_rate_pct / seal_amount / seal_volume / break_times / high_days / first_seal / last_seal。⛔ 与 Fuyao `limit_up_pool` 是两家口径、必须并存:Fuyao 有连板数(continue_day_cnt)/ 封板资金(seal_money)/ 涨停原因,但**没有板型 / 封板成功率 / 是否回封**;本能力**不含北交所**(上游 filter=HS,GEM2STAR 只覆盖沪深主板 + 创业板 + 科创板;实测 2026-11-20 的 28 行 market_type 只有 HS/GEM、无 8/4/92 开头代码,2026-01-05 的 107 行出现 HS/GEM/STAR),也**不含 ST 涨停**(实测与 Fuyao 三个交易日对账:2026-11-20 28 vs 30 差 2 行、2025-11-20 41 vs 49 差 8 行、2026-01-05 107 vs 126 差 19 行,差额**全部**是 ST 股)——北交所与 ST 涨停请用 Fuyao `limit_up_pool`。⛔ 单位 / 口径(全部实测):price 是最新价(元);change_pct 是**百分数原值**(10.0228 = +10.0228%,与 Fuyao price_change_ratio_pct、tencent_quote pct、ftshare_ashare_quote change_rate×100 三方一致);turnover_rate_pct 是**百分数原值**(27.7729 = 27.7729%,同 tencent_quote turnover 27.77);seal_rate 是**0~1 小数比例**(0.8 = 80%,1 = 100%;**null = 上游未给**(实测 2026-01-05 的 107 行里 14 行 null),不是 0;2026-11-20 国光股份 0 是真实值);seal_amount 单位**元**(实测 2026-11-20 全 28 行 = seal_volume × price,偏差 ≤5 元为上游取整、最大实测 4.25 元);seal_volume 单位**股**;break_times 是开板(炸板)次数,**null 不是 0**(实测连 LIMIT_BACK 的行也有 null,不能用它反推开板次数);high_days 是**字符串**(首板 / 3天2板 / 7天4板 / 15天13板),⛔ **不是连板数**(实测 2026-11-20 好当家 THS「7天4板」而 Fuyao continue_day_cnt=1「首板」);is_again 是上游 is_again_limit 的 0/1 原值;first_seal / last_seal 由上游 **Unix 秒**(字符串,如 "1795144339")转北京时间 HH:MM:SS(1795144339 → 11:12:19;实测与 Fuyao limit_up_time 的 HH:MM 逐行一致:2026-11-20 28/28、2026-01-05 107/107),⛔ **不是东财四池的 HHMMSS 整数**;时间戳换算出的北京日期必须等于响应 data.date,否则按结构异常失败。参数:date 省略 = 上游最近交易日(实测 2026-11-22 周日省略 → data.date=20261120;⛔ 行内 `trade_date` 就是上游 data.date,省略参数时同样给出,回答「今天/哪个交易日」用它,不要用 captured_at 推断),YYYY-MM-DD(也收 YYYYMMDD,归一成 YYYY-MM-DD);实测支持窗口起点 2025-11-07(2025-11-06 及更早回 status_code=-1「date参数不合法」,是**响亮失败不是空**;起点是固定日还是滚动窗未核出);非交易日 / 未来日期回 status_code=0 + info=[](合法空)。page / size:page 从 1 开始、size 1~200(实测 size=201 → status_code=-1「limitmust be less than or equal to 200」,上游原文如此),默认 1 / 200,单次只取一页(上游 page 元数据 {limit,total,count=总页数,page};输出只有本页行,行数 = size 时可能还有下一页);⛔ 超界 page 上游**回落到最后一页且该页返回 0 行**(实测 page=99&size=10 → 回显 page 3、info=[];size=200 时只有 1 页 → 回显 page 1),本层核对回显 page,不一致即失败,不静默把别的页当请求页返回。合法空 vs 失败:status_code=0 且 info=[] 才是合法空(非交易日 / 未来日期 / 当日无涨停);status_code 或 HTTP 非 0、非 JSON、data 结构不对一律响亮失败(同花顺有反爬史,401/403 不要循环重试)。⛔ 响应里的 trade_status 是**查询时刻**的会话状态、不是请求日期的状态(实测周日查 2026-11-20 时 trade_status=non_trading_day 却有 28 行),不要用它判空或判失败。未收录上游字段:market_type / market_id / currency_value(流通市值)/ is_new / change_tag / high_days_value / time_preview,以及 data.limit_up_count / limit_down_count / trade_status。',
504
507
  inputSchema: limitUpInput,
505
508
  outputSchema: limitUpOutput,
506
509
  paginated: true,
package/lib/time/tools.js CHANGED
@@ -64,7 +64,7 @@ const DATA_TIME_CONTRACTS = {
64
64
  sse_etf_shares: { kind: 'date', fields: ['trade_date'], warning: '省略 trade_date 取最近已发布交易日(默认不是今天);非交易日/尚未发布返回空结果,不是取数失败' },
65
65
  chinamoney_repo_fixing: { kind: 'date_range', fields: ['start_date', 'end_date'], warning: '上游只给整份 CSV,区间是本地裁剪;落在中国周末/节假的区间返回空,不是取数失败' },
66
66
  csindex_index_valuation: { kind: 'date_range', fields: ['start_date', 'end_date'], maxDays: TEN_YEAR_DAYS, warning: '日期轴是上游工作日序列(节假日也有行);各指数更新不同步,最新值可能差一个工作日' },
67
- ths_limit_up_detail: { kind: 'date', fields: ['date'], warning: '省略 date 取上游最近交易日;不含北交所(上游 filter=HS,GEM2STAR)' },
67
+ ths_limit_up_detail: { kind: 'date', fields: ['date'], warning: '省略 date 取上游最近交易日;行内 trade_date 即业务日;不含北交所(上游 filter=HS,GEM2STAR)' },
68
68
  // 东财 push2ex four pools: the upstream keeps only ~15 trading days and silently clamps future/today dates.
69
69
  eastmoney_limit_up_pool: { kind: 'date', fields: ['trade_date'], warning: '上游只保留最近约 15 个交易日;非交易日/超窗口返回空池,今天及更晚会被夹到最近交易日(行内 requested_date_clamped 标出)' },
70
70
  eastmoney_limit_break_pool: { kind: 'date', fields: ['trade_date'], warning: '同 eastmoney_limit_up_pool:约 15 个交易日窗口,今天及更晚会夹到最近交易日' },
@@ -3,7 +3,7 @@
3
3
  * Known limit: DNS resolves per request but the IP is not pinned to the connection,
4
4
  * so a rebinding window remains (same trade-off as dsh-search-first).
5
5
  */
6
- export declare const LOCAL_FETCH_CLIENT_VERSION = "2.30.0";
6
+ export declare const LOCAL_FETCH_CLIENT_VERSION = "2.30.1";
7
7
  export declare const LOCAL_FETCH_MAX_URL_LENGTH = 2048;
8
8
  export type LocalFetchErrorCode = 'ABORTED' | 'TIMEOUT' | 'INVALID_URL' | 'BLOCKED_URL' | 'DNS' | 'REDIRECT' | 'HTTP' | 'TOO_LARGE' | 'UNSUPPORTED_CONTENT_TYPE';
9
9
  export declare class LocalFetchError extends Error {
@@ -4,7 +4,7 @@
4
4
  * so a rebinding window remains (same trade-off as dsh-search-first).
5
5
  */
6
6
  import { htmlToMarkdown, stripInvisibleText } from './html-markdown.js';
7
- export const LOCAL_FETCH_CLIENT_VERSION = '2.30.0';
7
+ export const LOCAL_FETCH_CLIENT_VERSION = '2.30.1';
8
8
  export const LOCAL_FETCH_MAX_URL_LENGTH = 2048;
9
9
  export class LocalFetchError extends Error {
10
10
  code;
@@ -35,7 +35,7 @@ export interface WindCallResult {
35
35
  code?: WindErrorCode;
36
36
  }
37
37
  /** Must match `package.json` version; a test pins the two together. */
38
- export declare const WIND_CLIENT_VERSION = "2.30.0";
38
+ export declare const WIND_CLIENT_VERSION = "2.30.1";
39
39
  export interface WindClient {
40
40
  callTool(toolName: string, args: Record<string, unknown>, signal?: AbortSignal): Promise<WindCallResult>;
41
41
  }
@@ -19,7 +19,7 @@ export const WIND_SERVER_ENDPOINTS = {
19
19
  analytics_data: 'https://mcp.wind.com.cn/vserver_analytics_data/mcp/',
20
20
  };
21
21
  /** Must match `package.json` version; a test pins the two together. */
22
- export const WIND_CLIENT_VERSION = '2.30.0';
22
+ export const WIND_CLIENT_VERSION = '2.30.1';
23
23
  function errorText(error) {
24
24
  return error instanceof Error ? error.message : String(error);
25
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@v587d/capital-generation",
3
- "version": "2.30.0",
3
+ "version": "2.30.1",
4
4
  "description": "Capital Generation:面向中国散户的 AI 投资助手插件",
5
5
  "icon": "assets/cg-icon.png",
6
6
  "author": "v587d",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@v587d/watchlist",
3
- "version": "2.30.0",
3
+ "version": "2.30.1",
4
4
  "description": "自动模式的用户自选股(宿主级清单 + Fuyao 报价快照 + /capital-watchlist 路由 + 输入框菜单弹窗):由 @v587d/capital-generation 随包携带并作为 host 平面行挂载。",
5
5
  "license": "MIT",
6
6
  "type": "module",