@v587d/capital-generation 2.17.0 → 2.19.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 +78 -0
- package/README.md +4 -4
- package/automation/board.js +18 -2
- package/automation/brief.js +3 -13
- package/automation/client.js +10 -11
- package/automation/client.src.cjs +128 -50
- package/automation/defaults.js +1 -0
- package/automation/package.json +1 -1
- package/automation/route.js +3 -0
- package/automation/runner.js +2 -2
- package/automation/schema.js +16 -0
- package/automation/service.js +15 -0
- package/automation/store.js +45 -0
- package/chart-ui/package.json +1 -1
- package/config/package.json +1 -1
- package/lib/agents/role-tool-policy.d.ts +5 -4
- package/lib/agents/role-tool-policy.js +9 -4
- package/lib/chart/delivery.d.ts +8 -7
- package/lib/chart/present-tool.d.ts +5 -4
- package/lib/present-entry.d.ts +5 -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 +10 -10
- package/preset/capital-generation/README.md +8 -6
- package/preset/capital-generation/agent.patch.yml +7 -6
- package/watchlist/package.json +1 -1
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
* present_charts: the root Agent's final-turn delivery step.
|
|
3
3
|
*
|
|
4
4
|
* render_chart only mints a chart_ref (the specialist row no longer auto-delivers). DSH's
|
|
5
|
-
* deliverable card replays
|
|
6
|
-
* the card has to be
|
|
7
|
-
*
|
|
8
|
-
* event type — the session-event
|
|
5
|
+
* deliverable card replays declarations from the whole closing turn (0.2.2 dropped the
|
|
6
|
+
* `file.seq < owner.seq` filter), but the card still has to be attributed to the turn that
|
|
7
|
+
* carries the final answer: the root Agent presents its collected refs/deliverables here
|
|
8
|
+
* immediately before writing that answer. Never a custom event type — the session-event
|
|
9
|
+
* vocabulary is closed (see events.ts).
|
|
9
10
|
*/
|
|
10
11
|
import type { Context } from '@deepseek-ai/cordis';
|
|
11
12
|
import type { ChartArtifactRegistry } from './artifact-ref.js';
|
package/lib/present-entry.d.ts
CHANGED
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
*
|
|
4
4
|
* The model only records which charts belong to the answer. The actual first-party
|
|
5
5
|
* `deliverables/presented` append happens in the terminal assistant-stream chunk, before the closing
|
|
6
|
-
* message commits, gated on an idle root (no actionable inbox input, no running direct children).
|
|
7
|
-
* point where "the final answer" is knowable, so early/no `present_charts` calls
|
|
8
|
-
* card in a folded process turn (rationale: docs/dev/chart-delivery-events.md §6.3).
|
|
6
|
+
* message commits, gated on an idle root (no actionable inbox input, no running direct children).
|
|
7
|
+
* That is the first point where "the final answer" is knowable, so early/no `present_charts` calls
|
|
8
|
+
* cannot strand the card in a folded process turn (rationale: docs/dev/chart-delivery-events.md §6.3).
|
|
9
|
+
* 0.2.2 made the client replay the whole turn, so this write point is about turn attribution and
|
|
10
|
+
* ordering, not about dodging a seq cutoff.
|
|
9
11
|
*/
|
|
10
12
|
import type { Context } from '@deepseek-ai/cordis';
|
|
11
13
|
import type { SessionLike } from './data-collector/store.js';
|
|
@@ -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.
|
|
6
|
+
export declare const LOCAL_FETCH_CLIENT_VERSION = "2.19.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.
|
|
7
|
+
export const LOCAL_FETCH_CLIENT_VERSION = '2.19.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.
|
|
38
|
+
export declare const WIND_CLIENT_VERSION = "2.19.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.
|
|
22
|
+
export const WIND_CLIENT_VERSION = '2.19.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.
|
|
3
|
+
"version": "2.19.0",
|
|
4
4
|
"description": "Capital Generation:面向中国散户的 AI 投资助手插件(自动模式 Agent Preset)",
|
|
5
5
|
"icon": "assets/cg-icon.png",
|
|
6
6
|
"author": "v587d",
|
|
@@ -161,23 +161,23 @@
|
|
|
161
161
|
"report:skill-usage": "node scripts/skill-usage-report.mjs"
|
|
162
162
|
},
|
|
163
163
|
"peerDependencies": {
|
|
164
|
-
"@deepseek-ai/cordis": "
|
|
165
|
-
"@deepseek-ai/dsh-skill": "0.2.
|
|
166
|
-
"@deepseek-ai/dsh-skill-filesystem": "0.2.
|
|
164
|
+
"@deepseek-ai/cordis": "~4.1.0",
|
|
165
|
+
"@deepseek-ai/dsh-skill": "0.2.2-rc.1",
|
|
166
|
+
"@deepseek-ai/dsh-skill-filesystem": "0.2.2-rc.1"
|
|
167
167
|
},
|
|
168
168
|
"devDependencies": {
|
|
169
|
-
"@deepseek-ai/cordis": "
|
|
170
|
-
"@deepseek-ai/dsh-skill": "^0.2.
|
|
171
|
-
"@deepseek-ai/dsh-skill-filesystem": "^0.2.
|
|
172
|
-
"@deepseek-ai/dsh-system-prompt": "^0.2.
|
|
173
|
-
"@deepseek-ai/schemastery": "^3.
|
|
169
|
+
"@deepseek-ai/cordis": "~4.1.0",
|
|
170
|
+
"@deepseek-ai/dsh-skill": "^0.2.2-rc.1",
|
|
171
|
+
"@deepseek-ai/dsh-skill-filesystem": "^0.2.2-rc.1",
|
|
172
|
+
"@deepseek-ai/dsh-system-prompt": "^0.2.2-rc.1",
|
|
173
|
+
"@deepseek-ai/schemastery": "^3.19.0",
|
|
174
174
|
"esbuild": "^0.28.2",
|
|
175
175
|
"js-yaml": "^5.4.1",
|
|
176
176
|
"lightweight-charts": "5.2.1",
|
|
177
177
|
"typescript": "^5.0.0"
|
|
178
178
|
},
|
|
179
179
|
"dependencies": {
|
|
180
|
-
"@deepseek-ai/schemastery": "^3.
|
|
180
|
+
"@deepseek-ai/schemastery": "^3.19.0",
|
|
181
181
|
"@joplin/turndown-plugin-gfm": "^1.0.68",
|
|
182
182
|
"turndown": "^7.2.4",
|
|
183
183
|
"zod": "^4.5.4"
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
|
|
24
24
|
## 2. 人设(persona)承载与官方语义
|
|
25
25
|
|
|
26
|
-
实测 `dsh 0.2.
|
|
26
|
+
实测 `dsh 0.2.2-rc.1`(`test/persona.test.mjs` 对着本机 dsh 核对字段名),两层载体注册的是
|
|
27
27
|
**同一个 system-prompt 节名**:
|
|
28
28
|
|
|
29
29
|
| 载体 | 位置 | 字段 | 生效范围 |
|
|
@@ -160,13 +160,15 @@
|
|
|
160
160
|
|
|
161
161
|
### 5.1.1 PTC:只给 data_junior,主 Agent 仍是 native
|
|
162
162
|
|
|
163
|
-
- **一行怎么落**:junior preset 挂
|
|
164
|
-
|
|
165
|
-
`
|
|
163
|
+
- **一行怎么落**:junior preset 挂 `tool-presentation` 行,0.2.2 起行里直接是
|
|
164
|
+
`@deepseek-ai/dsh-tool-executor-ptc`(`maxParallelSubCalls: 10`;旧的
|
|
165
|
+
`dsh-agent-tool-presentation` + `mode: ptc` 只剩兼容壳),同时删掉 `tool-bash` / `tool-pwsh`。
|
|
166
|
+
宿主 `ptc-runtime` 由 `dsh-base` 提供,preset 写不进去;`smoke:boot` 同时断言 executor 行
|
|
167
|
+
`fiberState=2` 与 `ctx.get('ptcRuntime')` 在场。
|
|
166
168
|
- **为什么删 shell 而不是并存**:PTC SDK 在可见 `bash` 时会主动塞一条 `tools.bash({command:'pwd'})`
|
|
167
169
|
示例,并存等于官方提示词把模型往 shell 引;junior 只需要一个执行面。主 Agent 仍是 native,
|
|
168
|
-
|
|
169
|
-
|
|
170
|
+
继承部署级宿主 `dsh-tool-executor-native`,拿到的是原生 shell;根侧 `restrict()` 不能点名保留名
|
|
171
|
+
`run_code`(只有 PTC executor 才会把它放进模型面,本仓只挂在 junior 的 preset 行)。
|
|
170
172
|
- **省的是回合与抄写,不是安全升级**:`run_code` 里的 Node 仍能 `import('node:fs/promises')` /
|
|
171
173
|
`fetch` / `child_process`;宿主沙箱只拦写。`# PROGRAM DISCIPLINE` 与
|
|
172
174
|
`capital-data-query` §3.3 是纪律,不是边界;要硬隔离只能换容器 / VM / 远端 runtime。
|
|
@@ -189,11 +189,13 @@
|
|
|
189
189
|
config:
|
|
190
190
|
role: data_junior
|
|
191
191
|
|
|
192
|
-
# PTC
|
|
192
|
+
# PTC executor is preset-scoped; the host runtime (dsh-base) stays per-call. 0.2.2 replaced
|
|
193
|
+
# the presentation selector with the executor row itself; `maxParallelSubCalls` is pinned
|
|
194
|
+
# to the documented 10 instead of inheriting the executor default.
|
|
193
195
|
- id: tool-presentation
|
|
194
|
-
name: '@deepseek-ai/dsh-
|
|
196
|
+
name: '@deepseek-ai/dsh-tool-executor-ptc'
|
|
195
197
|
config:
|
|
196
|
-
|
|
198
|
+
maxParallelSubCalls: 10
|
|
197
199
|
|
|
198
200
|
# ── compaction: both rows must live in one realm; thresholdChars 8192 is the instance-wide single value ──
|
|
199
201
|
- id: compaction
|
|
@@ -664,12 +666,11 @@
|
|
|
664
666
|
toolName: subagent_data_analyst
|
|
665
667
|
agentPreset: capital-data-analyst
|
|
666
668
|
# If this row is ever enabled, `query_dataset` stays aggregate-only: it must not reopen raw rows.
|
|
669
|
+
# 0.2.2 registers send_message / interrupt_agent / list_agents from the main entry; the
|
|
670
|
+
# old `list-agents` subpath is gone and a row naming it keeps the whole preset broken.
|
|
667
671
|
- id: tool-subagent-control
|
|
668
672
|
name: '@deepseek-ai/dsh-tool-subagent-control'
|
|
669
673
|
|
|
670
|
-
- id: tool-subagent-list-agents
|
|
671
|
-
name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
|
|
672
|
-
|
|
673
674
|
- id: tool-ask-user
|
|
674
675
|
name: '@deepseek-ai/dsh-tool-ask-user'
|
|
675
676
|
|
package/watchlist/package.json
CHANGED