@v587d/capital-generation 0.0.0-stage → 2.6.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 +814 -0
- package/LICENSE +21 -0
- package/README.md +118 -2
- package/assets/cg-icon.png +0 -0
- package/capital-config/client.js +28 -0
- package/capital-config/client.src.cjs +388 -0
- package/capital-config/index.js +113 -0
- package/capital-config/package.json +36 -0
- package/capital-watchlist/client.js +182 -0
- package/capital-watchlist/client.src.cjs +1229 -0
- package/capital-watchlist/index.js +772 -0
- package/capital-watchlist/package.json +37 -0
- package/chart-ui/README.md +112 -0
- package/chart-ui/client.js +16 -0
- package/chart-ui/client.src.cjs +126 -0
- package/chart-ui/index.js +205 -0
- package/chart-ui/package.json +30 -0
- package/cordis.patch.yml +72 -0
- package/lib/agents/bash-guard.d.ts +55 -0
- package/lib/agents/bash-guard.js +162 -0
- package/lib/agents/root-tool-policy.d.ts +164 -0
- package/lib/agents/root-tool-policy.js +309 -0
- package/lib/chart/artifact-ref.d.ts +65 -0
- package/lib/chart/artifact-ref.js +107 -0
- package/lib/chart/downsample.d.ts +8 -0
- package/lib/chart/downsample.js +53 -0
- package/lib/chart/errors.d.ts +16 -0
- package/lib/chart/errors.js +15 -0
- package/lib/chart/events.d.ts +120 -0
- package/lib/chart/events.js +471 -0
- package/lib/chart/html.d.ts +21 -0
- package/lib/chart/html.js +154 -0
- package/lib/chart/runtime.d.ts +20 -0
- package/lib/chart/runtime.js +270 -0
- package/lib/chart/series.d.ts +102 -0
- package/lib/chart/series.js +424 -0
- package/lib/chart/source-token.d.ts +64 -0
- package/lib/chart/source-token.js +217 -0
- package/lib/chart/spec.d.ts +58 -0
- package/lib/chart/spec.js +265 -0
- package/lib/chart/tool.d.ts +86 -0
- package/lib/chart/tool.js +288 -0
- package/lib/chart/vendor/LICENSE +201 -0
- package/lib/chart/vendor/VERSION.json +8 -0
- package/lib/chart/vendor/lightweight-charts.standalone.production.js +7 -0
- package/lib/data-collector/args.d.ts +38 -0
- package/lib/data-collector/args.js +114 -0
- package/lib/data-collector/dataset-tools.d.ts +3 -0
- package/lib/data-collector/dataset-tools.js +421 -0
- package/lib/data-collector/describe.d.ts +99 -0
- package/lib/data-collector/describe.js +256 -0
- package/lib/data-collector/hub.d.ts +187 -0
- package/lib/data-collector/hub.js +469 -0
- package/lib/data-collector/query-time.d.ts +58 -0
- package/lib/data-collector/query-time.js +101 -0
- package/lib/data-collector/query.d.ts +57 -0
- package/lib/data-collector/query.js +473 -0
- package/lib/data-collector/store.d.ts +499 -0
- package/lib/data-collector/store.js +1486 -0
- package/lib/data-collector/time-axis.d.ts +169 -0
- package/lib/data-collector/time-axis.js +419 -0
- package/lib/data-collector/tools.d.ts +32 -0
- package/lib/data-collector/tools.js +216 -0
- package/lib/index.d.ts +275 -0
- package/lib/index.js +458 -0
- package/lib/net/eastmoney-client.d.ts +104 -0
- package/lib/net/eastmoney-client.js +118 -0
- package/lib/net/throttle.d.ts +16 -0
- package/lib/net/throttle.js +34 -0
- package/lib/ocr/client.d.ts +82 -0
- package/lib/ocr/client.js +281 -0
- package/lib/ocr/markdown.d.ts +75 -0
- package/lib/ocr/markdown.js +209 -0
- package/lib/ocr/store.d.ts +119 -0
- package/lib/ocr/store.js +226 -0
- package/lib/sources/eastmoney-http.d.ts +2 -0
- package/lib/sources/eastmoney-http.js +1253 -0
- package/lib/sources/fuyao-core.d.ts +52 -0
- package/lib/sources/fuyao-core.js +96 -0
- package/lib/sources/fuyao-rest.d.ts +14 -0
- package/lib/sources/fuyao-rest.js +2057 -0
- package/lib/sources/security-code.d.ts +27 -0
- package/lib/sources/security-code.js +104 -0
- package/lib/sources/security-identity.d.ts +24 -0
- package/lib/sources/security-identity.js +89 -0
- package/lib/sources/tencent-http.d.ts +2 -0
- package/lib/sources/tencent-http.js +1053 -0
- package/lib/sources/wind-mcp.d.ts +8 -0
- package/lib/sources/wind-mcp.js +593 -0
- package/lib/time/tools.d.ts +74 -0
- package/lib/time/tools.js +464 -0
- package/lib/tool-exec.d.ts +29 -0
- package/lib/tool-exec.js +17 -0
- package/lib/web-retriever/engines.d.ts +61 -0
- package/lib/web-retriever/engines.js +202 -0
- package/lib/web-retriever/html-markdown.d.ts +50 -0
- package/lib/web-retriever/html-markdown.js +321 -0
- package/lib/web-retriever/local-fetch.d.ts +121 -0
- package/lib/web-retriever/local-fetch.js +562 -0
- package/lib/web-retriever/retriever.d.ts +58 -0
- package/lib/web-retriever/retriever.js +94 -0
- package/lib/web-retriever/sources.d.ts +235 -0
- package/lib/web-retriever/sources.js +961 -0
- package/lib/web-retriever/tools.d.ts +50 -0
- package/lib/web-retriever/tools.js +1029 -0
- package/lib/web-retriever/wind-client.d.ts +69 -0
- package/lib/web-retriever/wind-client.js +311 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +84 -4
- package/preset/capital-generation/README.md +161 -0
- package/preset/capital-generation/agent.patch.yml +509 -0
- package/preset/capital-generation/skills/capital-chart-protocol/SKILL.md +137 -0
- package/preset/capital-generation/skills/capital-data-protocol/SKILL.md +416 -0
- package/preset/capital-generation/skills/capital-orchestration/SKILL.md +174 -0
- package/preset/capital-generation/skills/capital-visualization-protocol/SKILL.md +296 -0
- package/preset/capital-generation/skills/capital-web-protocol/SKILL.md +240 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import { WebRetriever } from './retriever.js';
|
|
3
|
+
import type { WindClient } from './wind-client.js';
|
|
4
|
+
import type { LocalFetchOptions } from './local-fetch.js';
|
|
5
|
+
import { type WorkspaceDatasetStore } from '../data-collector/store.js';
|
|
6
|
+
import { type PaddleOcrClient } from '../ocr/client.js';
|
|
7
|
+
/**
|
|
8
|
+
* 注册 web_retriever 的检索工具:anysearch(广度)两工具 + wind_docs(public_document
|
|
9
|
+
* 精准)两工具 + `ocr`(文档解析)一工具。wind 与 ocr 都**无条件注册**——Key 缺失/服务
|
|
10
|
+
* 不可用只影响调用结果(错误信封),不影响工具注册与子 Agent 创建。
|
|
11
|
+
*
|
|
12
|
+
* `ocr` 与 `datasetStore` 共用 workspace 落盘,而检索回声(`recent_retrievals` /
|
|
13
|
+
* `provider_tally`)**必须**与另外四个工具共享同一份闭包,所以它在这同一个 `definitions`
|
|
14
|
+
* 数组里注册,不另起一个注册函数。
|
|
15
|
+
*/
|
|
16
|
+
export declare function registerWebRetrieverTools(ctx: Context, retriever: WebRetriever, windClient: WindClient, ocr: OcrToolDependencies): void;
|
|
17
|
+
/** `ocr` 的两项依赖:上游客户端 + workspace 落盘(与 Dataset 共用同一份实现)。 */
|
|
18
|
+
export interface OcrToolDependencies {
|
|
19
|
+
store: WorkspaceDatasetStore;
|
|
20
|
+
client: PaddleOcrClient;
|
|
21
|
+
/** 注入以便测试钉住 `created_at`。 */
|
|
22
|
+
now?: () => number;
|
|
23
|
+
/**
|
|
24
|
+
* 注入以便测试:`url` 形态的公网性闸门默认走**真实 DNS**(与本机直连同一份实现,§9.7),
|
|
25
|
+
* 生产路径不传。生产代码里没有任何调用方给它赋值——它只是把 DNS 这一步挪出断言范围。
|
|
26
|
+
*/
|
|
27
|
+
resolveAddresses?: LocalFetchOptions['resolveAddresses'];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* 一次具名来源输出的字符预算:取宿主 tool-result 剪枝阈值的 75%。
|
|
31
|
+
* 阈值配在 `preset/capital-generation/agent.cordis.yml` 的 `thresholdChars: 8192`
|
|
32
|
+
* (由 `test/persona.test.mjs` 钉住与本常量同源)。超过阈值的工具结果在会话历史里会被
|
|
33
|
+
* `dsh-compaction-tool-result-pruner` 换成 head 4096 + `[... middle pruned ...]` + tail 1024,
|
|
34
|
+
* 也就是**中间条目被无声吃掉**,而留在头部的 `count` 还写着原来的条数。
|
|
35
|
+
* 留 25% 余量的做法与数据面能力目录的预算同一口径(`test/data-collector-hub.test.mjs`)。
|
|
36
|
+
*/
|
|
37
|
+
export declare const SOURCE_OUTPUT_BUDGET_CHARS = 6144;
|
|
38
|
+
/**
|
|
39
|
+
* 注册九个具名来源工具(provider + operation 命名)。
|
|
40
|
+
*
|
|
41
|
+
* 为什么单独一个注册函数:这九个工具只依赖 HTTP 传输(`local-fetch` 的出口校验),
|
|
42
|
+
* 不依赖 AnySearch / Wind;任何一路的配置缺失都不应连带影响另外几路的注册。
|
|
43
|
+
*
|
|
44
|
+
* `enabled`(设置卡片「允许启动本地提取网页内容」)**同时支配这九个工具的执行**:
|
|
45
|
+
* 关闭时工具仍在注册面(不静默消失),但每次调用响亮失败并说明开关位置——
|
|
46
|
+
* 卡片文案的字面语义对模型与用户都成立,用户同意不被旁路。
|
|
47
|
+
*/
|
|
48
|
+
export declare function registerSourceTools(ctx: Context, localFetchOptions: LocalFetchOptions & {
|
|
49
|
+
enabled?: boolean;
|
|
50
|
+
}): void;
|