@v587d/capital-generation 2.21.1 → 2.21.2
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 +12 -0
- package/README.md +2 -2
- package/automation/board.js +48 -2
- package/automation/builtins.js +1 -1
- package/automation/package.json +1 -1
- package/automation/watch.js +4 -3
- package/chart-ui/package.json +1 -1
- package/config/package.json +1 -1
- 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,18 @@
|
|
|
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.21.2] - 2026-11-12
|
|
11
|
+
|
|
12
|
+
TODO 核验依据改为用户可读文案;旧记录里残留的数据集 ID、工具名与采集时间不再出现在看板。
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- **核验依据与来源只写用户可读的信息**:核验 prompt 把 `evidence` 从「工具结果中的原文片段」改成「结论 + 关键数字,≤120 字」,`source` 从「来源 + as-of」改成「人类可读的来源与口径,≤60 字(如 Wind 日线,截至 11-12 收盘)」;明确禁止数据集 ID(`data_ds_` / `ds_` / `art_code`)、工具或能力名、`captured_at` / `quote_time` / `as-of` / `sourceId`、Markdown 与反引号,`brief` 同样适用;内置「TODO 核验」任务说明同步。
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- **旧核验记录的内部标识不再展示**:看板读侧会剥掉存量 `evidence` / `source` 里的数据集 ID、采集时间与 `art_code`,`as-of` 统一写成「截至」;截断留下的半个括号(如「(1」)会修掉;只剩 ID 与采集时间的来源行直接不显示。存量数据不改写,只影响展示。
|
|
21
|
+
|
|
10
22
|
## [2.21.1] - 2026-11-12
|
|
11
23
|
|
|
12
24
|
历史 TODO 单日视图与核验简报落地;核验 JSON 解析容忍尾逗号,避免整批结论被丢。
|
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.1-blue" alt="DSH@0.2.2-rc.1"></a>
|
|
6
|
-
<a href="https://github.com/v587d/capital-generation/releases"><img src="https://img.shields.io/badge/version-2.21.
|
|
6
|
+
<a href="https://github.com/v587d/capital-generation/releases"><img src="https://img.shields.io/badge/version-2.21.2-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
|
|
|
@@ -184,7 +184,7 @@ Capital Generation 是运行在 [DeepSeek Harness(DSH)](https://github.com/d
|
|
|
184
184
|
- **安装后找不到模式?** 确认插件出现在「插件」→ 已安装列表;Web / CLI profile 安装后要重启该 profile,并在新会话选择模式。选择器里应看到自动模式、行情专家、资讯专员;分析师和绘图专员是自动模式的内部角色,不会出现在这里。
|
|
185
185
|
- **配置在哪?** 打开「插件」→ 已安装的 **Capital Generation**,插件介绍下方就是「数据源 / 投研自动化 / 精选 Skills / 包含的组件」四格,五把密钥都在第一格;第二格可指定任务统一使用的默认工作区,也能改自动检查间隔与最长运行时间等上限;不在 DSH 的普通「设置」页面,也不用点进任何一行组件。保存密钥后新建会话再试。
|
|
186
186
|
- **升级到 2.9.0 后,分析师和绘图专员去哪了?** 这一版把它们收进自动模式内部,不再出现在选择器与预设管理里,避免误开一个没有取数入口的空会话。旧会话仍能按原身份恢复;新任务直接用自动模式提出即可。
|
|
187
|
-
- **桌面端升级后仍是旧版?** 桌面端安装时会固定所解析的版本,不会自动升级。卸载后重新安装,再到插件详情查看版本号;如需指定版本,可在地址末尾加 `#v2.21.
|
|
187
|
+
- **桌面端升级后仍是旧版?** 桌面端安装时会固定所解析的版本,不会自动升级。卸载后重新安装,再到插件详情查看版本号;如需指定版本,可在地址末尾加 `#v2.21.2` 或 `@2.21.2`。
|
|
188
188
|
- **刚发布的新版本装不到?** 桌面端取包时会跳过**刚发布不久**的版本(宿主侧包管理器的发布冷却策略,实测会静默装成上一个版本),国内镜像的同步也可能滞后一段时间。急着用最新代码,改用仓库地址安装最直接;但仓库地址安装的是 git 依赖,插件页不显示「版本」检查。
|
|
189
189
|
- **插件页的「版本」段怎么用?** 只有用包名从 npm 安装的版本才有;它只列比当前新的版本。回旧版要先卸载,再安装 `@v587d/capital-generation@版本号`(桌面端地址末尾加 `#v版本号`);旧版必须匹配当前 DSH 基线,对应关系见 [CHANGELOG 的 Migration](CHANGELOG.md)。
|
|
190
190
|
- **网页抓取失败?** 配置卡片中的「允许启动本地提取网页内容」默认开启:AnySearch 提取失败时可尝试本机直连。关闭后,本机直连的具名来源查询也不可用;请检查该开关和网络连接。
|
package/automation/board.js
CHANGED
|
@@ -192,6 +192,52 @@ function sourceOf(run, item) {
|
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
+
// The verifier occasionally pastes dataset ids, tool names and capture timestamps into the
|
|
196
|
+
// user-facing evidence/source fields. Strip that plumbing at the read boundary so old records
|
|
197
|
+
// render as cleanly as new ones; the stored value stays untouched for audit.
|
|
198
|
+
const TODO_INTERNAL_MARK = /(?:data_)?ds_[0-9a-z]+|capital-data|captured_at|quote_time|art_code|dataset_id|sourceId/i
|
|
199
|
+
const TODO_ID_RUN = /(?:capital-data[\s_]*)?(?:data_)?ds_[0-9a-z]+(?:\s*[/、,,+]\s*(?:data_)?ds_[0-9a-z]+)*(?:\s*[((][^))]*[))])?/gi
|
|
200
|
+
|
|
201
|
+
/** Drop a trailing unclosed parenthetical left by the 160-char evidence cap. */
|
|
202
|
+
function trimDanglingTail(text) {
|
|
203
|
+
let result = text
|
|
204
|
+
for (;;) {
|
|
205
|
+
const open = Math.max(result.lastIndexOf('('), result.lastIndexOf('('))
|
|
206
|
+
const close = Math.max(result.lastIndexOf(')'), result.lastIndexOf(')'))
|
|
207
|
+
if (open < 0 || open < close) break
|
|
208
|
+
const tail = result.slice(open + 1)
|
|
209
|
+
if (/[。;;]/.test(tail) || tail.length > 40) break
|
|
210
|
+
result = result.slice(0, open)
|
|
211
|
+
}
|
|
212
|
+
return result.replace(/[\s;;,,、+·/]+$/u, '').trim()
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export function todoEvidenceText(value) {
|
|
216
|
+
if (typeof value !== 'string') return null
|
|
217
|
+
const text = trimDanglingTail(value
|
|
218
|
+
.replace(/\*\*/g, '')
|
|
219
|
+
.replace(/`/g, '')
|
|
220
|
+
.replace(/\bas-of\b/gi, '截至')
|
|
221
|
+
.replace(/\b(?:captured_at|quote_time)\b\s*[::]?\s*[0-9][0-9T:.\-–—\s]*(?:Asia\/Shanghai|HKT)?/gi, '')
|
|
222
|
+
.replace(/\bart_code\s+[A-Za-z0-9]+/gi, '')
|
|
223
|
+
.replace(TODO_ID_RUN, '')
|
|
224
|
+
.replace(/\s{2,}/g, ' ')
|
|
225
|
+
.trim())
|
|
226
|
+
return text.length > 0 ? text : null
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/** A source that only carries dataset ids or capture metadata is noise, not provenance. */
|
|
230
|
+
export function todoSourceText(value) {
|
|
231
|
+
if (typeof value !== 'string' || TODO_INTERNAL_MARK.test(value)) return null
|
|
232
|
+
const text = value
|
|
233
|
+
.replace(/\*\*/g, '')
|
|
234
|
+
.replace(/`/g, '')
|
|
235
|
+
.replace(/\bas-of\b/gi, '截至')
|
|
236
|
+
.replace(/\s{2,}/g, ' ')
|
|
237
|
+
.trim()
|
|
238
|
+
return text.length > 0 ? text : null
|
|
239
|
+
}
|
|
240
|
+
|
|
195
241
|
/** Only the tracking facts belong on the wire; profileKey and storage ids stay server-side. */
|
|
196
242
|
function watchSummary(watch, today) {
|
|
197
243
|
if (watch === undefined) return null
|
|
@@ -200,8 +246,8 @@ function watchSummary(watch, today) {
|
|
|
200
246
|
status: watch.status,
|
|
201
247
|
resolvedFrom: watch.resolvedFrom ?? null,
|
|
202
248
|
checkedAt: watch.checkedAt ?? null,
|
|
203
|
-
evidence: watch.evidence
|
|
204
|
-
source: watch.source
|
|
249
|
+
evidence: todoEvidenceText(watch.evidence),
|
|
250
|
+
source: todoSourceText(watch.source),
|
|
205
251
|
handoffReason: watch.handoffReason ?? null,
|
|
206
252
|
dueAt: watch.dueAt ?? null,
|
|
207
253
|
autoRequestedAt: watch.autoRequestedAt ?? null,
|
package/automation/builtins.js
CHANGED
|
@@ -176,7 +176,7 @@ export const BUILTIN_DEFINITIONS = [
|
|
|
176
176
|
title: 'TODO 核验',
|
|
177
177
|
description: '交易日 A/H 收盘后主动核验看板中的待验证 TODO:自选股与跨市场条件、公告和资金数据,触发或数据不足时通知。',
|
|
178
178
|
trigger: { ...SCHEDULE_COMMON, time: '17:00' },
|
|
179
|
-
instruction: '
|
|
179
|
+
instruction: '逐条核验候选 TODO:A 股用当日收盘、港股用 16:00 收盘,公告以运行前已披露为准;同标的、同口径、同时点,缺数据、只见到转述或条件有歧义一律判 insufficient。每条候选都必须返回结果;evidence 必须能在工具结果中找到依据,evidence 与 source 只写用户可读的结论、关键数字与来源/时间口径,不写数据集 ID、工具名、captured_at 或 as-of。最终按约定 JSON 输出 `brief` 与逐条 `results`;没有触发就直说,不要编造。',
|
|
180
180
|
cwdKind: 'profile',
|
|
181
181
|
limits: { ...DEFAULT_LIMITS },
|
|
182
182
|
notifications: { ...DEFAULT_NOTIFICATIONS },
|
package/automation/package.json
CHANGED
package/automation/watch.js
CHANGED
|
@@ -477,10 +477,11 @@ export function createTodoWatchService(options) {
|
|
|
477
477
|
`候选 TODO(共 ${candidates.length} 条,必须逐条返回):`,
|
|
478
478
|
JSON.stringify(candidates.map(candidatePayload), null, 2),
|
|
479
479
|
'输出要求:先写一句本次核验摘要,再输出一个 ```json 代码块:',
|
|
480
|
-
'{"brief":{"headline":"≤24 字","plain":"40–200
|
|
481
|
-
'triggered / not_triggered
|
|
480
|
+
'{"brief":{"headline":"≤24 字","plain":"40–200 字:先写触发了什么,再写核实线索(数据/公告、关键数值、截至时间)"},"results":[{"id":"候选 id","verdict":"triggered|not_triggered|insufficient","confidence":"high|medium|low","evidence":"给用户看的核验依据:结论 + 关键数字,≤120 字","source":"人类可读的来源与口径,如「Wind 日线,截至 11-12 收盘」,≤60 字"}]}',
|
|
481
|
+
'triggered / not_triggered 必须能在工具结果中找到依据;缺数据、只见到媒体转述、口径不一致或条件有歧义一律 insufficient。',
|
|
482
|
+
'evidence 与 source 会原样展示在 TODO 卡片:不要出现内部 ID(data_ds_…、ds_…、art_code)、工具或能力名(wind_stock_kline、fuyao_history、index_quote 等)、采集字段(captured_at、quote_time、as-of、sourceId)、Markdown 或反引号;不要贴工具原文或「来源:」引用块。数据口径用中文写,如「截至 11-12 收盘」;source 没有可读来源就留空。',
|
|
482
483
|
'JSON 必须严格合法:不要尾逗号、注释或省略引号;每条候选都要用候选 id 返回一次。',
|
|
483
|
-
'brief 只写已触发的条目与线索,没有触发就直说;不要写 Markdown
|
|
484
|
+
'brief 只写已触发的条目与线索,没有触发就直说;不要写 Markdown、链接或表情,也不要给买卖建议;同样不要写工具名、ID 或 as-of。',
|
|
484
485
|
].join('\n'),
|
|
485
486
|
candidates: candidates.map(candidatePayload),
|
|
486
487
|
empty: false,
|
package/chart-ui/package.json
CHANGED
package/config/package.json
CHANGED
|
@@ -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.21.
|
|
6
|
+
export declare const LOCAL_FETCH_CLIENT_VERSION = "2.21.2";
|
|
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.21.
|
|
7
|
+
export const LOCAL_FETCH_CLIENT_VERSION = '2.21.2';
|
|
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.21.
|
|
38
|
+
export declare const WIND_CLIENT_VERSION = "2.21.2";
|
|
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.21.
|
|
22
|
+
export const WIND_CLIENT_VERSION = '2.21.2';
|
|
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