@dshtrading/futures 0.3.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 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,45 @@
1
+ # futures-trader agent preset —— dsh-trading futures 切片(实装形态抄 cn-trader)。
2
+ #
3
+ # 本文件由 @dshtrading/futures 的 dsh-trading-futures-installer 插件(bundle host 面
4
+ # 常驻行)经 @dshtrading/base/presets 幂等装配到 trader/master 角色组合(统一 preset
5
+ # root 归 @dshtrading/base,见 packages/base/src/presets.ts)。
6
+ #
7
+ # 期货切片(issue #97):connector 行 provide tradingFuturesMarketData(同花顺期货
8
+ # 数据服务:日K + 当日分时 + 品种/代码表),无实盘交易面(A 股期货执行走本地
9
+ # MiniQMT 等账户侧,铁律 #3 统一闸门;本切片为数据面)。kit 行只注册 skill
10
+ # provider(futures-risk-checklist),不 provide 服务,无需 realm。
11
+ #
12
+ # 组合形态对照官方 standard preset:AGENT-PLANE 组合,不持有审批/沙箱/模型路由。
13
+ - id: persona
14
+ name: '@deepseek-ai/dsh-persona'
15
+ config:
16
+ text: >-
17
+ 你是一名严谨的国内期货交易员,由 {{model}} 模型驱动,工作目录为 {{cwd}}。基于
18
+ 同花顺期货数据(日K 与当日分时、品种目录)做客观、量化的分析;数据当前仅覆盖
19
+ 日K与当日分时,不得用当日分时冒充历史分钟数据;涉及保证金、强平价、移仓换月、
20
+ 夜盘与涨跌停板时逐项核对 futures-risk-checklist 风控清单;期货执行面本切片不
21
+ 提供,真实下单走账户侧人工流程,你输出的是计划与提醒,不构成投资建议。每次会话
22
+ 开始时,先检查工作目录下是否已有交易日志目录 .trading-journal/:没有则提醒用户
23
+ 本工作区尚未建立交易日志,并调用 trading-notes-setup 技能创建骨架;已有则把本
24
+ 会话的重要操作按规范记入日志。
25
+
26
+ # connector 行 provide 服务(tradingFuturesMarketData),必须包进 cordis:group + isolate,
27
+ # isolate 键 = 服务名(官方 standard preset 挂载硬规则)。preset 面走直接 provide 入口;
28
+ # host 面注册表行(cordis.patch.yml 的 futures-dataplane)负责 GUI 行情桥,两面同挂
29
+ # 若都用 dataplane 会触发注册表 (futures, hithink) 重复注册的响亮失败。
30
+ - id: dsh-trading-futures-connector-group
31
+ name: cordis:group
32
+ group: true
33
+ isolate:
34
+ tradingFuturesMarketData: true
35
+ config:
36
+ - id: dsh-trading-futures-connector
37
+ name: '@dshtrading/connector-hithink/futures-plugin'
38
+ config:
39
+ enabled: true
40
+
41
+ - id: dsh-trading-futures-kit
42
+ name: '@dshtrading/kit-futures'
43
+ config:
44
+ dryRun: true
45
+ liveTrading: false
@@ -0,0 +1,3 @@
1
+ name: 期货交易员
2
+ description: 国内期货市场会话:同花顺期货行情工具与交易员人设(由 @dshtrading/futures 自安装,普通会话不可见期货工具)。
3
+ order: 22
@@ -0,0 +1,20 @@
1
+ # @dshtrading/futures —— 期货市场 bundle 的 patch 层(insert-only,README 设计铁律 #1)。
2
+ #
3
+ # 实装形态抄 @dshtrading/cn:connector/kit 的插件行在 preset 的 agent.cordis.yml
4
+ # (preset 级会话隔离)。本 bundle 的职责:
5
+ # 1. dsh-trading-futures-installer —— host 面常驻安装器插件(src/index.ts):boot 时
6
+ # 幂等贡献 futures-trader 切片(经 base/presets 统一装配);
7
+ # 2. host 面数据行:@dshtrading/connector-hithink/futures-dataplane 注册
8
+ # (market=futures, provider=hithink) 到 tradingMarketDataRegistry(GUI 行情桥)。
9
+ #
10
+ # 注意:patch 文件必须保持「顶层 YAML 数组」形状(loadProfile → parsePatchList 对非数组
11
+ # 直接抛错);只允许 insert(按 id 打已存在行 = 整行替换,多市场并存会互相覆盖)。
12
+ - insert:
13
+ - id: dsh-trading-futures-installer
14
+ name: '@dshtrading/futures'
15
+
16
+ # host 面数据行(issue #97):注册 futures 市场行情服务(同花顺期货源)。
17
+ - id: dsh-trading-futures-dataplane
18
+ name: '@dshtrading/connector-hithink/futures-dataplane'
19
+ config:
20
+ 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-futures-installer";
4
+ interface Config {
5
+ presetRoot?: string;
6
+ }
7
+ declare const Config: Schema<Config>;
8
+ declare function getPresetContribution(): Promise<{
9
+ market: "futures";
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-futures-installer";
6
+ const Config = Schema.object({ presetRoot: Schema.string() });
7
+ async function getPresetContribution() {
8
+ const asset = (await readFile(new URL("../assets/preset/futures-trader/agent.cordis.yml", import.meta.url), "utf8")).replace(/\r\n/g, "\n");
9
+ const start = asset.indexOf("- id: dsh-trading-futures-connector-group\n");
10
+ if (start < 0) throw new Error("Missing futures capability rows");
11
+ return {
12
+ market: "futures",
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/futures",
3
+ "description": "Futures market bundle for dsh-trading: host-plane futures-trader preset installer + insert-only aggregation of the HiThink futures connector dataplane row and futures kit row (design rule #1)",
4
+ "version": "0.3.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-hithink": "0.3.0",
29
+ "@dshtrading/kit-futures": "0.3.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
+ }