@v587d/capital-generation 2.31.7 → 2.31.8
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 +16 -0
- package/README.md +2 -2
- package/automation/package.json +1 -1
- package/chart-ui/package.json +1 -1
- package/config/package.json +1 -1
- package/lib/sources/tencent-http.js +9 -3
- package/lib/web-retriever/local-fetch.d.ts +1 -1
- package/lib/web-retriever/local-fetch.js +1 -1
- package/lib/web-retriever/wind-client.d.ts +1 -1
- package/lib/web-retriever/wind-client.js +1 -1
- package/package.json +1 -1
- package/watchlist/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,22 @@
|
|
|
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.31.8] - 2026-11-28
|
|
11
|
+
|
|
12
|
+
修复全量契约巡检新暴露的腾讯分笔时间回退与盘中成交额误核对。
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- `tencent_ticks` 以 `seq` 为权威顺序,容忍上游单笔时间戳向后修正;序号回退仍响亮失败。
|
|
17
|
+
- 成交额核对只在行情快照日期为上海当天且已收盘时执行,避免把上一交易日快照与当日/上一交易日分笔
|
|
18
|
+
错配比较;收盘后的真实缺量仍会失败。
|
|
19
|
+
|
|
20
|
+
### Notes
|
|
21
|
+
|
|
22
|
+
- 真实腾讯分笔复测:4,729 行、`missing_seq=0`,通过。
|
|
23
|
+
- 回归:`npm test` **1921 pass / 0 fail**。
|
|
24
|
+
- 版本:根包 + 四个随包嵌套包 + `LOCAL_FETCH_CLIENT_VERSION` / `WIND_CLIENT_VERSION` 同步 2.31.8。
|
|
25
|
+
|
|
10
26
|
## [2.31.7] - 2026-11-28
|
|
11
27
|
|
|
12
28
|
修复 GitHub Actions 全量契约巡检暴露的 5 条 Fuyao 契约不一致,并把腾讯已解析结构错误纳入 `GUARD`。
|
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.31.
|
|
6
|
+
<a href="https://github.com/v587d/capital-generation/releases"><img src="https://img.shields.io/badge/version-2.31.8-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
|
|
|
@@ -230,7 +230,7 @@ Capital Generation 是运行在 [DeepSeek Harness(DSH)](https://github.com/d
|
|
|
230
230
|
- **配置在哪?** 打开「插件」→ 已安装的 **Capital Generation**,插件介绍下方就是「数据源 / 投研自动化 / 精选 Skills / 包含的组件 / 分析环境」五格,五把密钥都在第一格;第二格可指定任务统一使用的默认工作区,也能改自动检查间隔与最长运行时间等上限;第五格准备 Python 分析环境;不在 DSH 的普通「设置」页面,也不用点进任何一行组件。保存密钥后新建会话再试。
|
|
231
231
|
- **升级到 2.9.0 后,分析师和绘图专员去哪了?** 这一版把它们收进自动模式内部,不再出现在选择器与预设管理里,避免误开一个没有取数入口的空会话。旧会话仍能按原身份恢复;新任务直接用自动模式提出即可。
|
|
232
232
|
- **宿主更新后插件显示异常、三个模式消失?** 插件只支持**同一 minor** 的宿主(本版是 `>=0.2.2-rc.5 <0.2.3-0`):宿主跨到 0.2.3 及以上时,旧插件会被启动拒载(插件页显示「异常」)。先把宿主升到与插件同一条 minor,再在插件页更新插件;应急可用版本豁免(有崩溃风险,见 CHANGELOG 的 Migration)。日志里出现「宿主 dsh … 未逐项验证」说明你跑在同一 minor 的未验证补丁版上——能跑,但遇异常请先升级插件并把那行日志附在 issue 里。
|
|
233
|
-
- **桌面端升级后仍是旧版?** 桌面端安装时会固定所解析的版本,不会自动升级。卸载后重新安装,再到插件详情查看版本号;如需指定版本,可在地址末尾加 `#v2.31.
|
|
233
|
+
- **桌面端升级后仍是旧版?** 桌面端安装时会固定所解析的版本,不会自动升级。卸载后重新安装,再到插件详情查看版本号;如需指定版本,可在地址末尾加 `#v2.31.8` 或 `@2.31.8`。
|
|
234
234
|
- **刚发布的新版本装不到?** 桌面端取包时会跳过**刚发布不久**的版本(宿主侧包管理器的发布冷却策略,实测会静默装成上一个版本),国内镜像的同步也可能滞后一段时间。急着用最新代码,改用仓库地址安装最直接;但仓库地址安装的是 git 依赖,插件页不显示「版本」检查。
|
|
235
235
|
- **插件页的「版本」段怎么用?** 只有用包名从 npm 安装的版本才有;它只列比当前新的版本。回旧版要先卸载,再安装 `@v587d/capital-generation@版本号`(桌面端地址末尾加 `#v版本号`);旧版必须匹配当前 DSH 基线,对应关系见 [CHANGELOG 的 Migration](CHANGELOG.md)。
|
|
236
236
|
- **网页抓取失败?** 配置卡片中的「允许启动本地提取网页内容」默认开启:AnySearch 提取失败时可尝试本机直连。关闭后,本机直连的具名来源查询也不可用;请检查该开关和网络连接。
|
package/automation/package.json
CHANGED
package/chart-ui/package.json
CHANGED
package/config/package.json
CHANGED
|
@@ -355,6 +355,11 @@ async function executeKline(params, signal) {
|
|
|
355
355
|
throw new Error(`Tencent K-line ${symbol} returned no rows`);
|
|
356
356
|
return { data: all, schema: klineOutput };
|
|
357
357
|
}
|
|
358
|
+
function todayShanghai() {
|
|
359
|
+
const parts = new Intl.DateTimeFormat('en-CA', { timeZone: 'Asia/Shanghai', year: 'numeric', month: '2-digit', day: '2-digit' }).formatToParts(new Date());
|
|
360
|
+
const of = (type) => parts.find((part) => part.type === type)?.value ?? '';
|
|
361
|
+
return `${of('year')}-${of('month')}-${of('day')}`;
|
|
362
|
+
}
|
|
358
363
|
function parseSnapshot(text, symbol) {
|
|
359
364
|
const match = new RegExp(`v_${symbol}="([^"]*)"`).exec(text);
|
|
360
365
|
if (!match)
|
|
@@ -406,8 +411,9 @@ async function executeTicks(params, signal) {
|
|
|
406
411
|
side: fields[6],
|
|
407
412
|
};
|
|
408
413
|
const expected = rows.length === 0 ? 0 : Number(rows[rows.length - 1].seq) + 1;
|
|
409
|
-
|
|
410
|
-
|
|
414
|
+
// Sequence is authoritative: upstream can correct one timestamp backwards without reordering ticks.
|
|
415
|
+
if (row.seq < expected)
|
|
416
|
+
throw sourceError(`Tencent ticks ${symbol} sequence moved backwards`, 'tencent_invalid_response');
|
|
411
417
|
if (row.seq > expected) {
|
|
412
418
|
if (row.time <= TICK_SESSION_END)
|
|
413
419
|
throw sourceError(`Tencent ticks ${symbol} has missing continuous-session sequence ${expected}-${row.seq - 1}`, 'tencent_incomplete');
|
|
@@ -423,7 +429,7 @@ async function executeTicks(params, signal) {
|
|
|
423
429
|
if (after.date !== before.date)
|
|
424
430
|
throw sourceError(`Tencent ticks crossed trading day ${before.date} -> ${after.date}`, 'tencent_incomplete');
|
|
425
431
|
const continuousAmount = rows.filter((row) => String(row.time) <= TICK_SESSION_END).reduce((sum, row) => sum + Number(row.amount), 0);
|
|
426
|
-
if (after.amount === before.amount && Math.abs(continuousAmount - before.amount) > before.amount * 0.001 + 1000)
|
|
432
|
+
if (after.date === todayShanghai() && after.clock >= '150000' && after.amount === before.amount && Math.abs(continuousAmount - before.amount) > before.amount * 0.001 + 1000)
|
|
427
433
|
throw sourceError(`Tencent ticks ${symbol} amount ${continuousAmount} does not match quote ${before.amount}`, 'tencent_incomplete');
|
|
428
434
|
return {
|
|
429
435
|
data: { date: before.date, code: code.canonical, tencent_symbol: symbol, rows, missing_seq: missingSeq },
|
|
@@ -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.31.
|
|
6
|
+
export declare const LOCAL_FETCH_CLIENT_VERSION = "2.31.8";
|
|
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.31.
|
|
7
|
+
export const LOCAL_FETCH_CLIENT_VERSION = '2.31.8';
|
|
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.31.
|
|
38
|
+
export declare const WIND_CLIENT_VERSION = "2.31.8";
|
|
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.31.
|
|
22
|
+
export const WIND_CLIENT_VERSION = '2.31.8';
|
|
23
23
|
function errorText(error) {
|
|
24
24
|
return error instanceof Error ? error.message : String(error);
|
|
25
25
|
}
|
package/package.json
CHANGED
package/watchlist/package.json
CHANGED