@v587d/capital-generation 2.27.2 → 2.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,54 @@
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.29.0] - 2026-11-20
11
+
12
+ 宿主升级不再按 rc 打断插件:支持窗口从「精确 pin 一个 rc」改成「同一 minor」,跑在未验证宿主上时留一条可见记录(issue #20)。
13
+
14
+ ### Changed
15
+
16
+ - **支持窗口改成同一 minor**:根 `package.json` 新增 `engines.dsh = ">=0.2.2-rc.5 <0.2.3-0"`——宿主有它时**只认它、忽略 peer**;两个 dsh peer 写同一区间,只为安装期解析。宿主 rc.6 / 0.2.2 正式版这类补丁级更新不再拒载插件;0.2.3 及以上仍然拒载,逼我们适配后再放开。2.28.0 及更早的版本仍按各自的精确 pin 判定。
17
+ - **未验证宿主留痕**:`capital-runtime` 行挂载时检测宿主版本(CLI/Web 读入口脚本上方的 `@deepseek-ai/dsh`,其余载体回落到 peer),不等于本版验证基线(`0.2.2-rc.5`)就往 **stderr** 打一条 warn,报 issue 可直接粘贴。检测不到时静默——未知不等于不兼容。(不走 `ctx.logger`:宿主给它的 exporter 只把 warn/error 收进启动诊断,终端里看不见。)
18
+ - **闸门进账本**:新增探针 **L40**,钉住 `engines.dsh` 单独决定、`includePrerelease` 生效、窗口外拒载;并用宿主真实的 `evaluatePluginCompatibility` 跑判定表(`0.2.2-rc.5` / `rc.6` / `0.2.2` 放行,`0.2.3-rc.1` / `0.3.0-rc.1` 拒绝),外加两条反向对照:声明 engines 后 peer 不再参与、没有 engines 时 peer 仍然会拦。
19
+
20
+ ### Migration
21
+
22
+ - 用户侧无动作:0.2.2-rc.5 起(含 rc.6、0.2.2 正式版)继续可用,配置与数据不动。
23
+ - 0.2.3 及以后的宿主需要插件发新版放开窗口;在那之前插件页会显示「异常」,这是预期行为(同 minor 之外不做兼容承诺)。
24
+
25
+ ### Notes
26
+
27
+ - 五个包版本抬到 `2.29.0`;`LOCAL_FETCH_CLIENT_VERSION` 与 `WIND_CLIENT_VERSION` 同步。
28
+ - 为什么只放到同一 minor:历史断点(0.1.7 的 settings/preset 换代、0.2.2-rc.1→rc.2 的多 Agent 控制面换代)都在 minor/功能换代上,rc 小步反而多是加法(rc.2→rc.5 对 39 条账本零变化)。放宽后若某个 rc 改了消费面,症状会从「整块拒载」变成「某一功能报错或静默退化」,这是取舍不是纯收益——判据见 `docs/reference/host-upgrade-analysis-0.2.2-rc.2-to-rc.5.md` §4.4。
29
+ - 回归:`check:dsh` **40** 条(新增 L40)、`test/host-version.test.mjs` 4 条(窗口一致性、告警语义、两条版本检测路径)。
30
+
31
+ ## [2.28.0] - 2026-11-20
32
+
33
+ 适配 DSH `0.2.2-rc.5`:宿主换了网页搜索的默认提供方、新增一个拒答错误码,本插件的工具、数据契约与会话行为都不变。
34
+
35
+ ### Changed
36
+
37
+ - **基线抬到 `0.2.2-rc.5`**:两个 dsh peer 精确 pin 到 rc.5,三颗开发依赖与 lockfile 里的 16 颗 `@deepseek-ai/dsh*` 同步;兼容预检对 rc.5 判定无问题。
38
+ - **依赖面逐包核对**:rc.5 的 325 颗上游包全部抬版本,其中只有 28 颗有 manifest 之外的变化——两条官方升级指南(rc.3 的拒答错误码、rc.4 的搜索默认提供方)都不消费;其余是新增 `deepseek-chat-import` 官方 bundle、新的 `sidebar.session.action` 座位、工作区选择器重构与构建戳。本仓消费的 host 包除版本号外零 diff,`check:dsh` 39 条对 rc.5 全绿(29 条实测 + 10 条按设计 n/a)。
39
+ - **宿主默认搜索变了,Capital 会话不受影响**:rc.4 起 DeepSeek 模型会话的宿主 `web_search` 改走旧版 Messages 搜索(按 token 计费)。本插件自带检索面(AnySearch / Wind / 具名来源 / 本机直连),宿主搜索工具不在 Capital 的 preset 行组合里(`web_fetch` 另在根侧按名 deny,`web_search` 由人设禁用),因此不需要配置 `searchProvider`。
40
+ - **拒答错误码更名为 `CONTENT_REFUSED`**:自动化运行记录里的 `turn/end` 错误码跟着上游变,展示层照旧原样透传(不在码上分支),无需迁移。
41
+
42
+ ### Fixed
43
+
44
+ - **`npm test` 在 DSH 会话里跑会误红 6 条**:`PythonRuntimeManager` 让 `$DSH_HOME` 优先于夹具传的 `dshHome`,而在 DSH 会话里该变量指向真实 `~/.dsh`——六条夹具把 Python 运行时缓存建到了用户目录,然后找不到自己造的文件。测试文件顶部改为清掉继承来的 `DSH_HOME`,夹具回到临时 home;断言一条未动,CI 行为不变。
45
+
46
+ ### Migration
47
+
48
+ - **先升宿主再更新插件**:`0.2.2-rc.5` 是必需版本(peer 精确 pin),rc.2 上启动会被预检 `disabled`,界面上三个模式一起消失。更新后**重启宿主**——运行中的进程仍是旧版内存镜像。
49
+ - 配置、自选股、数据集、图表与历史会话都不迁移;`CONTENT_REFUSED` 只影响新产生的失败记录。
50
+
51
+ ### Notes
52
+
53
+ - 五个包版本抬到 `2.28.0`;`LOCAL_FETCH_CLIENT_VERSION` 与 `WIND_CLIENT_VERSION` 同步。
54
+ - 回归:`check:dsh` 39 条全绿(对 rc.5:29 条实测 + 10 条按设计 n/a)、`npm test` 1598/1598、`smoke:boot` 真启动(预设 `broken=null`、13 行 bundle 组件、20/20 族行、4 颗身份闸门、三条自注册路由的 401/200 围栏、settings 条目、反向对照)。判据见 `docs/reference/host-upgrade-analysis-0.2.2-rc.2-to-rc.5.md`。
55
+ - 顺带把 2.22.0 漏入库的 `docs/reference/host-upgrade-analysis-0.2.2-rc.1-to-rc.2.md` 补进 `.gitignore` 白名单(其余升级分析都在库里)。
56
+ - 浏览器侧手工点选(配置卡片、自选股面板、图表卡片)留待重启 rc.5 宿主后按 README 清单过一遍,DOM 与槽位契约已由上述自动化覆盖。
57
+
10
58
  ## [2.27.2] - 2026-11-19
11
59
 
12
60
  「自选股」行情工作台的详情头瘦身:标题行只留标题与一个信息键,重复的事实删掉、参考读数收起来。
package/README.md CHANGED
@@ -2,8 +2,8 @@
2
2
  <p align="left">
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
- <a href="https://github.com/deepseek-ai"><img src="https://img.shields.io/badge/DSH%20Baseline-0.2.2--rc.2-blue" alt="DSH@0.2.2-rc.2"></a>
6
- <a href="https://github.com/v587d/capital-generation/releases"><img src="https://img.shields.io/badge/version-2.27.2-9cf" alt="Version"></a>
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>
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
 
@@ -21,7 +21,7 @@ Capital Generation 是运行在 [DeepSeek Harness(DSH)](https://github.com/d
21
21
  ## 快速上手
22
22
 
23
23
  > [!NOTE]
24
- > 最新版本已适配 DSH`@0.2.2-rc.2`(支持具名子 Agent,单轮编排不变)。
24
+ > 最新版本已适配 DSH`@0.2.2-rc.5`,支持窗口是**同一 minor**(`>=0.2.2-rc.5 <0.2.3-0`):宿主补丁级更新(rc.6、0.2.2 正式版)不再需要跟发插件,0.2.3 起仍需插件适配。
25
25
 
26
26
 
27
27
  0. **前置**
@@ -191,7 +191,8 @@ Capital Generation 是运行在 [DeepSeek Harness(DSH)](https://github.com/d
191
191
  - **安装后找不到模式?** 确认插件出现在「插件」→ 已安装列表;Web / CLI profile 安装后要重启该 profile,并在新会话选择模式。选择器里应看到自动模式、行情专家、资讯专员;分析师和绘图专员是自动模式的内部角色,不会出现在这里。
192
192
  - **配置在哪?** 打开「插件」→ 已安装的 **Capital Generation**,插件介绍下方就是「数据源 / 投研自动化 / 精选 Skills / 包含的组件 / 分析环境」五格,五把密钥都在第一格;第二格可指定任务统一使用的默认工作区,也能改自动检查间隔与最长运行时间等上限;第五格准备 Python 分析环境;不在 DSH 的普通「设置」页面,也不用点进任何一行组件。保存密钥后新建会话再试。
193
193
  - **升级到 2.9.0 后,分析师和绘图专员去哪了?** 这一版把它们收进自动模式内部,不再出现在选择器与预设管理里,避免误开一个没有取数入口的空会话。旧会话仍能按原身份恢复;新任务直接用自动模式提出即可。
194
- - **桌面端升级后仍是旧版?** 桌面端安装时会固定所解析的版本,不会自动升级。卸载后重新安装,再到插件详情查看版本号;如需指定版本,可在地址末尾加 `#v2.27.2` 或 `@2.27.2`。
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
196
  - **刚发布的新版本装不到?** 桌面端取包时会跳过**刚发布不久**的版本(宿主侧包管理器的发布冷却策略,实测会静默装成上一个版本),国内镜像的同步也可能滞后一段时间。急着用最新代码,改用仓库地址安装最直接;但仓库地址安装的是 git 依赖,插件页不显示「版本」检查。
196
197
  - **插件页的「版本」段怎么用?** 只有用包名从 npm 安装的版本才有;它只列比当前新的版本。回旧版要先卸载,再安装 `@v587d/capital-generation@版本号`(桌面端地址末尾加 `#v版本号`);旧版必须匹配当前 DSH 基线,对应关系见 [CHANGELOG 的 Migration](CHANGELOG.md)。
197
198
  - **网页抓取失败?** 配置卡片中的「允许启动本地提取网页内容」默认开启:AnySearch 提取失败时可尝试本机直连。关闭后,本机直连的具名来源查询也不可用;请检查该开关和网络连接。
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@v587d/capital-automation",
3
- "version": "2.27.2",
3
+ "version": "2.29.0",
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.27.2",
3
+ "version": "2.29.0",
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.27.2",
3
+ "version": "2.29.0",
4
4
  "description": "自动模式的取数凭据与偏好配置行:卡片坐在 @v587d/capital-generation 插件主页的「配置」段,点这一行本身没有表单。",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -0,0 +1,9 @@
1
+ /** The release every surface in this package was last verified against (see the ledger). */
2
+ export declare const VERIFIED_DSH_VERSION = "0.2.2-rc.5";
3
+ /**
4
+ * Two carriers: the CLI/web process runs `<dsh>/lib/bin.js`, while a Desktop bundle wraps the host
5
+ * elsewhere and leaves the peer link beside this package as the only local evidence.
6
+ */
7
+ export declare function detectDshVersion(): string | undefined;
8
+ /** `undefined` means "either verified or undetectable": an unknown host must stay silent. */
9
+ export declare function unverifiedHostWarning(detected: string | undefined, verified?: string): string | undefined;
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Host-version awareness for the mount-time warning. The compatibility gate itself lives in the
3
+ * host (`engines.dsh` in package.json): a host outside that window never imports this package, so
4
+ * anything seen here is "same minor, not the release we tested" — worth one warn line, not a refusal.
5
+ */
6
+ import { readFileSync } from 'node:fs';
7
+ import { createRequire } from 'node:module';
8
+ import { dirname, join, resolve } from 'node:path';
9
+ /** The release every surface in this package was last verified against (see the ledger). */
10
+ export const VERIFIED_DSH_VERSION = '0.2.2-rc.5';
11
+ function manifestVersion(path) {
12
+ try {
13
+ const manifest = JSON.parse(readFileSync(path, 'utf8'));
14
+ return typeof manifest.version === 'string' ? manifest.version : undefined;
15
+ }
16
+ catch {
17
+ return undefined;
18
+ }
19
+ }
20
+ /**
21
+ * Two carriers: the CLI/web process runs `<dsh>/lib/bin.js`, while a Desktop bundle wraps the host
22
+ * elsewhere and leaves the peer link beside this package as the only local evidence.
23
+ */
24
+ export function detectDshVersion() {
25
+ const entry = process.argv[1];
26
+ if (entry !== undefined) {
27
+ let dir = dirname(resolve(entry));
28
+ for (let depth = 0; depth < 4; depth += 1) {
29
+ const manifestPath = join(dir, 'package.json');
30
+ try {
31
+ const manifest = JSON.parse(readFileSync(manifestPath, 'utf8'));
32
+ if (manifest.name === '@deepseek-ai/dsh' && typeof manifest.version === 'string')
33
+ return manifest.version;
34
+ }
35
+ catch {
36
+ // Not a package root here; keep walking.
37
+ }
38
+ const parent = dirname(dir);
39
+ if (parent === dir)
40
+ break;
41
+ dir = parent;
42
+ }
43
+ }
44
+ try {
45
+ return manifestVersion(createRequire(import.meta.url).resolve('@deepseek-ai/dsh-skill/package.json'));
46
+ }
47
+ catch {
48
+ return undefined;
49
+ }
50
+ }
51
+ /** `undefined` means "either verified or undetectable": an unknown host must stay silent. */
52
+ export function unverifiedHostWarning(detected, verified = VERIFIED_DSH_VERSION) {
53
+ if (detected === undefined || detected === verified)
54
+ return undefined;
55
+ return `capital-generation: 宿主 dsh ${detected} 未逐项验证(本版验证基线 ${verified},支持窗口见 package.json 的 engines.dsh)`
56
+ + ';如遇异常请先升级插件,报 issue 时请附这一行';
57
+ }
@@ -1,5 +1,13 @@
1
+ import { detectDshVersion, unverifiedHostWarning } from './host-version.js';
1
2
  import { capitalSharedRuntime } from './runtime.js';
2
3
  export const name = 'capital-runtime';
3
4
  export function apply(ctx) {
5
+ // `engines.dsh` already keeps an out-of-window host from importing this package; reaching here on
6
+ // an unverified version means "same minor, untested patch" and users need one line to paste into an
7
+ // issue. `ctx.logger` is buffered into boot diagnostics only (no terminal exporter), so this goes
8
+ // to stderr directly.
9
+ const hostWarning = unverifiedHostWarning(detectDshVersion());
10
+ if (hostWarning !== undefined)
11
+ console.warn(hostWarning);
4
12
  ctx.provide('capitalChartRuntime', capitalSharedRuntime(ctx));
5
13
  }
@@ -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.27.2";
6
+ export declare const LOCAL_FETCH_CLIENT_VERSION = "2.29.0";
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.27.2';
7
+ export const LOCAL_FETCH_CLIENT_VERSION = '2.29.0';
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.27.2";
38
+ export declare const WIND_CLIENT_VERSION = "2.29.0";
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.27.2';
22
+ export const WIND_CLIENT_VERSION = '2.29.0';
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.27.2",
3
+ "version": "2.29.0",
4
4
  "description": "Capital Generation:面向中国散户的 AI 投资助手插件",
5
5
  "icon": "assets/cg-icon.png",
6
6
  "author": "v587d",
@@ -173,16 +173,19 @@
173
173
  "ptc:report": "node scripts/ptc-session-report.mjs",
174
174
  "report:skill-usage": "node scripts/skill-usage-report.mjs"
175
175
  },
176
+ "engines": {
177
+ "dsh": ">=0.2.2-rc.5 <0.2.3-0"
178
+ },
176
179
  "peerDependencies": {
177
180
  "@deepseek-ai/cordis": "~4.1.0",
178
- "@deepseek-ai/dsh-skill": "0.2.2-rc.2",
179
- "@deepseek-ai/dsh-skill-filesystem": "0.2.2-rc.2"
181
+ "@deepseek-ai/dsh-skill": ">=0.2.2-rc.5 <0.2.3-0",
182
+ "@deepseek-ai/dsh-skill-filesystem": ">=0.2.2-rc.5 <0.2.3-0"
180
183
  },
181
184
  "devDependencies": {
182
185
  "@deepseek-ai/cordis": "~4.1.0",
183
- "@deepseek-ai/dsh-skill": "^0.2.2-rc.2",
184
- "@deepseek-ai/dsh-skill-filesystem": "^0.2.2-rc.2",
185
- "@deepseek-ai/dsh-system-prompt": "^0.2.2-rc.2",
186
+ "@deepseek-ai/dsh-skill": "^0.2.2-rc.5",
187
+ "@deepseek-ai/dsh-skill-filesystem": "^0.2.2-rc.5",
188
+ "@deepseek-ai/dsh-system-prompt": "^0.2.2-rc.5",
186
189
  "@deepseek-ai/schemastery": "^3.19.0",
187
190
  "@types/node": "^24.19.2",
188
191
  "esbuild": "^0.28.2",
@@ -23,7 +23,7 @@
23
23
 
24
24
  ## 2. 人设(persona)承载与官方语义
25
25
 
26
- 实测 `dsh 0.2.2-rc.1`(`test/persona.test.mjs` 对着本机 dsh 核对字段名),两层载体注册的是
26
+ 实测 `dsh 0.2.2-rc.5`(`test/persona.test.mjs` 对着本机 dsh 核对字段名),两层载体注册的是
27
27
  **同一个 system-prompt 节名**:
28
28
 
29
29
  | 载体 | 位置 | 字段 | 生效范围 |
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@v587d/watchlist",
3
- "version": "2.27.2",
3
+ "version": "2.29.0",
4
4
  "description": "自动模式的用户自选股(宿主级清单 + Fuyao 报价快照 + /capital-watchlist 路由 + 输入框菜单弹窗):由 @v587d/capital-generation 随包携带并作为 host 平面行挂载。",
5
5
  "license": "MIT",
6
6
  "type": "module",