@dshtrading/global 0.4.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/LICENSE +75 -0
- package/assets/preset/global-trader/agent.cordis.yml +46 -0
- package/assets/preset/global-trader/preset.yml +3 -0
- package/cordis.patch.yml +22 -0
- package/lib/index.d.ts +14 -0
- package/lib/index.js +18 -0
- package/package.json +41 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
Copyright (c) 2026 zhu1090093659 (dsh-trading)
|
|
2
|
+
|
|
3
|
+
# PolyForm Noncommercial License 1.0.0
|
|
4
|
+
|
|
5
|
+
<https://polyformproject.org/licenses/noncommercial/1.0.0>
|
|
6
|
+
|
|
7
|
+
## Acceptance
|
|
8
|
+
|
|
9
|
+
In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
|
|
10
|
+
|
|
11
|
+
## Copyright License
|
|
12
|
+
|
|
13
|
+
The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose. However, you may only distribute the software according to [Distribution License](#distribution-license) and make changes or new works based on the software according to [Changes and New Works License](#changes-and-new-works-license).
|
|
14
|
+
|
|
15
|
+
## Distribution License
|
|
16
|
+
|
|
17
|
+
The licensor grants you an additional copyright license to distribute copies of the software. Your license to distribute covers distributing the software with changes and new works permitted by [Changes and New Works License](#changes-and-new-works-license).
|
|
18
|
+
|
|
19
|
+
## Notices
|
|
20
|
+
|
|
21
|
+
You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms or the URL for them above, as well as copies of any plain-text lines beginning with `Required Notice:` that the licensor provided with the software. For example:
|
|
22
|
+
|
|
23
|
+
> Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
|
|
24
|
+
|
|
25
|
+
## Changes and New Works License
|
|
26
|
+
|
|
27
|
+
The licensor grants you an additional copyright license to make changes and new works based on the software for any permitted purpose.
|
|
28
|
+
|
|
29
|
+
## Patent License
|
|
30
|
+
|
|
31
|
+
The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
|
|
32
|
+
|
|
33
|
+
## Noncommercial Purposes
|
|
34
|
+
|
|
35
|
+
Any noncommercial purpose is a permitted purpose.
|
|
36
|
+
|
|
37
|
+
## Personal Uses
|
|
38
|
+
|
|
39
|
+
Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observance, without any anticipated commercial application, is use for a permitted purpose.
|
|
40
|
+
|
|
41
|
+
## Noncommercial Organizations
|
|
42
|
+
|
|
43
|
+
Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution is use for a permitted purpose regardless of the source of funding or obligations resulting from the funding.
|
|
44
|
+
|
|
45
|
+
## Fair Use
|
|
46
|
+
|
|
47
|
+
You may have "fair use" rights for the software under the law. These terms do not limit them.
|
|
48
|
+
|
|
49
|
+
## No Other Rights
|
|
50
|
+
|
|
51
|
+
These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses.
|
|
52
|
+
|
|
53
|
+
## Patent Defense
|
|
54
|
+
|
|
55
|
+
If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
|
|
56
|
+
|
|
57
|
+
## Violations
|
|
58
|
+
|
|
59
|
+
The first time you are notified in writing that you have violated any of these terms, or done anything with the software not covered by your licenses, your licenses can nonetheless continue if you come into full compliance with these terms, and take practical steps to correct past violations, within 32 days of receiving notice. Otherwise, all your licenses end immediately.
|
|
60
|
+
|
|
61
|
+
## No Liability
|
|
62
|
+
|
|
63
|
+
***As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.***
|
|
64
|
+
|
|
65
|
+
## Definitions
|
|
66
|
+
|
|
67
|
+
The **licensor** is the individual or entity offering these terms, and the **software** is the software the licensor makes available under these terms.
|
|
68
|
+
|
|
69
|
+
**You** refers to the individual or entity agreeing to these terms.
|
|
70
|
+
|
|
71
|
+
**Your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. **Control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
|
|
72
|
+
|
|
73
|
+
**Your licenses** are all the licenses granted to you for the software under these terms.
|
|
74
|
+
|
|
75
|
+
**Use** means anything you do with the software requiring one of your licenses.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# global-trader agent preset —— dsh-trading global 切片(实装形态抄 futures-trader)。
|
|
2
|
+
#
|
|
3
|
+
# 本文件由 @dshtrading/global 的 dsh-trading-global-installer 插件(bundle host 面
|
|
4
|
+
# 常驻行)经 @dshtrading/base/presets 幂等装配到 trader/master 角色组合(统一 preset
|
|
5
|
+
# root 归 @dshtrading/base,见 packages/base/src/presets.ts)。
|
|
6
|
+
#
|
|
7
|
+
# 全球切片:connector 行 provide tradingGlobalMarketData(金十数据服务:现货贵金属/
|
|
8
|
+
# 原油/外汇/全球指数的报价与分钟K线),无实盘交易面(铁律 #3 统一闸门;本切片为
|
|
9
|
+
# 数据面)。kit 行只注册 skill provider(global-risk-checklist),不 provide 服务。
|
|
10
|
+
#
|
|
11
|
+
# 组合形态对照官方 standard preset:AGENT-PLANE 组合,不持有审批/沙箱/模型路由。
|
|
12
|
+
- id: persona
|
|
13
|
+
name: '@deepseek-ai/dsh-persona'
|
|
14
|
+
config:
|
|
15
|
+
text: >-
|
|
16
|
+
你是一名严谨的全球品种交易员,由 {{model}} 模型驱动,工作目录为 {{cwd}}。分析对象是
|
|
17
|
+
现货贵金属(XAUUSD)、能源(WTI)、外汇主流货币对与全球股指(SPX),基于金十数据
|
|
18
|
+
(报价与分钟K线)做客观、量化的分析;上游只有分钟K线且单窗口 100 根(只支持
|
|
19
|
+
1m/5m/15m,日线及以上显式报错),闭市返回空序列是真实语义不是故障,不得用分钟数据
|
|
20
|
+
冒充日线历史;涉及杠杆、隔夜利息、休市跳空、数据行情与美元计价时逐项核对
|
|
21
|
+
global-risk-checklist 风控清单;本切片为纯数据面,无下单/账户工具,真实交易走券商侧
|
|
22
|
+
人工流程,你输出的是计划与提醒,不构成投资建议。每次会话开始时,先检查工作目录下
|
|
23
|
+
是否已有交易日志目录 .trading-journal/:没有则提醒用户本工作区尚未建立交易日志,并
|
|
24
|
+
调用 trading-notes-setup 技能创建骨架;已有则把本会话的重要操作按规范记入日志。
|
|
25
|
+
|
|
26
|
+
# connector 行 provide 服务(tradingGlobalMarketData),必须包进 cordis:group + isolate,
|
|
27
|
+
# isolate 键 = 服务名(官方 standard preset 挂载硬规则)。preset 面走直接 provide 入口
|
|
28
|
+
# (@dshtrading/connector-jin10/global-plugin);host 面(本 bundle cordis.patch.yml 的
|
|
29
|
+
# dataplane 行)负责 GUI 行情桥注册,两面同挂若都用 dataplane 会触发注册表
|
|
30
|
+
# (global, jin10) 重复注册的响亮失败。
|
|
31
|
+
- id: dsh-trading-global-connector-group
|
|
32
|
+
name: cordis:group
|
|
33
|
+
group: true
|
|
34
|
+
isolate:
|
|
35
|
+
tradingGlobalMarketData: true
|
|
36
|
+
config:
|
|
37
|
+
- id: dsh-trading-global-connector
|
|
38
|
+
name: '@dshtrading/connector-jin10/global-plugin'
|
|
39
|
+
config:
|
|
40
|
+
enabled: true
|
|
41
|
+
|
|
42
|
+
- id: dsh-trading-global-kit
|
|
43
|
+
name: '@dshtrading/kit-global'
|
|
44
|
+
config:
|
|
45
|
+
dryRun: true
|
|
46
|
+
liveTrading: false
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# @dshtrading/global —— 全球市场 bundle 的 patch 层(insert-only,README 设计铁律 #1)。
|
|
2
|
+
#
|
|
3
|
+
# 实装形态抄 @dshtrading/futures:connector/kit 的插件行在 preset 的 agent.cordis.yml
|
|
4
|
+
# (preset 级会话隔离)。本 bundle 的职责:
|
|
5
|
+
# 1. dsh-trading-global-installer —— host 面常驻安装器插件(src/index.ts):boot 时
|
|
6
|
+
# 幂等贡献 global-trader 切片(经 base/presets 统一装配);
|
|
7
|
+
# 2. host 面数据行:@dshtrading/connector-jin10/dataplane 注册 (market=global,
|
|
8
|
+
# provider=jin10) 到 tradingMarketDataRegistry(GUI 行情桥)+ provide
|
|
9
|
+
# tradingGlobalMarketData。该行 2026-09-13 起曾在 base(当时 global 无 bundle
|
|
10
|
+
# 没有认领者);market-group 平权后由本 bundle 认领,base 不再持有。
|
|
11
|
+
#
|
|
12
|
+
# 注意:patch 文件必须保持「顶层 YAML 数组」形状(loadProfile → parsePatchList 对非数组
|
|
13
|
+
# 直接抛错);只允许 insert(按 id 打已存在行 = 整行替换,多市场并存会互相覆盖)。
|
|
14
|
+
- insert:
|
|
15
|
+
- id: dsh-trading-global-installer
|
|
16
|
+
name: '@dshtrading/global'
|
|
17
|
+
|
|
18
|
+
# host 面数据行:注册 global 市场行情服务(金十源)。
|
|
19
|
+
- id: dsh-trading-global-dataplane-jin10
|
|
20
|
+
name: '@dshtrading/connector-jin10/dataplane'
|
|
21
|
+
config:
|
|
22
|
+
enabled: true
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Schema from "@deepseek-ai/schemastery";
|
|
2
|
+
//#region src/index.d.ts
|
|
3
|
+
declare const name = "dsh-trading-global-installer";
|
|
4
|
+
interface Config {
|
|
5
|
+
presetRoot?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const Config: Schema<Config>;
|
|
8
|
+
declare function getPresetContribution(): Promise<{
|
|
9
|
+
market: "global";
|
|
10
|
+
traderRows: string;
|
|
11
|
+
}>;
|
|
12
|
+
declare function apply(): void;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Config, apply, getPresetContribution, name };
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import Schema from "@deepseek-ai/schemastery";
|
|
3
|
+
//#region src/index.ts
|
|
4
|
+
/** Market bundle capability source. @dshtrading/base/presets is the sole preset writer. */
|
|
5
|
+
const name = "dsh-trading-global-installer";
|
|
6
|
+
const Config = Schema.object({ presetRoot: Schema.string() });
|
|
7
|
+
async function getPresetContribution() {
|
|
8
|
+
const asset = (await readFile(new URL("../assets/preset/global-trader/agent.cordis.yml", import.meta.url), "utf8")).replace(/\r\n/g, "\n");
|
|
9
|
+
const start = asset.indexOf("- id: dsh-trading-global-connector-group\n");
|
|
10
|
+
if (start < 0) throw new Error("Missing global capability rows");
|
|
11
|
+
return {
|
|
12
|
+
market: "global",
|
|
13
|
+
traderRows: asset.slice(start)
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function apply() {}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { Config, apply, getPresetContribution, name };
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dshtrading/global",
|
|
3
|
+
"description": "Global market bundle for dsh-trading: host-plane global-trader preset installer + insert-only aggregation of the Jin10 global connector dataplane row and global kit row (design rule #1)",
|
|
4
|
+
"version": "0.4.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"types": "./lib/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./lib/index.d.ts",
|
|
11
|
+
"default": "./lib/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
14
|
+
"./package.json": "./package.json"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"lib",
|
|
18
|
+
"assets",
|
|
19
|
+
"cordis.patch.yml"
|
|
20
|
+
],
|
|
21
|
+
"license": "PolyForm-Noncommercial-1.0.0",
|
|
22
|
+
"dsh": {
|
|
23
|
+
"bundle": {
|
|
24
|
+
"patch": "./cordis.patch.yml"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@dshtrading/connector-jin10": "0.4.0",
|
|
29
|
+
"@dshtrading/kit-global": "0.4.0"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"@deepseek-ai/cordis": ">=4.0.0",
|
|
33
|
+
"@deepseek-ai/schemastery": ">=3.18.0"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"tsdown": "^0.22.0"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "tsdown"
|
|
40
|
+
}
|
|
41
|
+
}
|