@dsh-ft/dsh-fft-paper-trading 0.4.1 → 0.5.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.
Files changed (187) hide show
  1. package/README.md +10 -1
  2. package/lib/client.js +29 -0
  3. package/package.json +3 -9
  4. package/src/client/index.js +29 -0
  5. package/node_modules/@dsh-ft/dsh-fft-ftshare/README.md +0 -73
  6. package/node_modules/@dsh-ft/dsh-fft-ftshare/catalog.json +0 -9762
  7. package/node_modules/@dsh-ft/dsh-fft-ftshare/catalog.meta.json +0 -7
  8. package/node_modules/@dsh-ft/dsh-fft-ftshare/catalog.txt +0 -250
  9. package/node_modules/@dsh-ft/dsh-fft-ftshare/cordis.patch.yml +0 -27
  10. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/capabilities.d.ts +0 -47
  11. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/capabilities.d.ts.map +0 -1
  12. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/capabilities.js +0 -145
  13. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/capabilities.js.map +0 -1
  14. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/catalog-host.d.ts +0 -19
  15. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/catalog-host.d.ts.map +0 -1
  16. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/catalog-host.js +0 -31
  17. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/catalog-host.js.map +0 -1
  18. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/catalog.d.ts +0 -51
  19. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/catalog.d.ts.map +0 -1
  20. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/catalog.js +0 -60
  21. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/catalog.js.map +0 -1
  22. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/client.d.ts +0 -52
  23. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/client.d.ts.map +0 -1
  24. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/client.js +0 -149
  25. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/client.js.map +0 -1
  26. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/contract.d.ts +0 -122
  27. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/contract.d.ts.map +0 -1
  28. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/contract.js +0 -24
  29. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/contract.js.map +0 -1
  30. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/errors.d.ts +0 -93
  31. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/errors.d.ts.map +0 -1
  32. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/errors.js +0 -261
  33. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/errors.js.map +0 -1
  34. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/index.d.ts +0 -64
  35. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/index.d.ts.map +0 -1
  36. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/index.js +0 -160
  37. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/index.js.map +0 -1
  38. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/mask.d.ts +0 -66
  39. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/mask.d.ts.map +0 -1
  40. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/mask.js +0 -106
  41. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/mask.js.map +0 -1
  42. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/project.d.ts +0 -98
  43. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/project.d.ts.map +0 -1
  44. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/project.js +0 -326
  45. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/project.js.map +0 -1
  46. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/route.d.ts +0 -48
  47. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/route.d.ts.map +0 -1
  48. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/route.js +0 -90
  49. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/route.js.map +0 -1
  50. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/tools.d.ts +0 -31
  51. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/tools.d.ts.map +0 -1
  52. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/tools.js +0 -132
  53. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/tools.js.map +0 -1
  54. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/transport.d.ts +0 -53
  55. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/transport.d.ts.map +0 -1
  56. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/transport.js +0 -147
  57. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/transport.js.map +0 -1
  58. package/node_modules/@dsh-ft/dsh-fft-ftshare/package.json +0 -82
  59. package/node_modules/@dsh-ft/dsh-fft-settings/README.md +0 -385
  60. package/node_modules/@dsh-ft/dsh-fft-settings/cordis.patch.yml +0 -18
  61. package/node_modules/@dsh-ft/dsh-fft-settings/docs/compatibility-dsh-0.1.6-alpha.1.md +0 -58
  62. package/node_modules/@dsh-ft/dsh-fft-settings/docs/extension-service-design.md +0 -351
  63. package/node_modules/@dsh-ft/dsh-fft-settings/docs/extension-service-sequences.html +0 -545
  64. package/node_modules/@dsh-ft/dsh-fft-settings/docs/ftshare-settings-er.html +0 -139
  65. package/node_modules/@dsh-ft/dsh-fft-settings/docs/ftshare-settings-er.svg +0 -113
  66. package/node_modules/@dsh-ft/dsh-fft-settings/docs/ftshare-settings-results-er.html +0 -148
  67. package/node_modules/@dsh-ft/dsh-fft-settings/docs/ftshare-settings-results-er.svg +0 -122
  68. package/node_modules/@dsh-ft/dsh-fft-settings/docs/kline-integration.md +0 -258
  69. package/node_modules/@dsh-ft/dsh-fft-settings/lib/agent.d.ts +0 -24
  70. package/node_modules/@dsh-ft/dsh-fft-settings/lib/agent.js +0 -26
  71. package/node_modules/@dsh-ft/dsh-fft-settings/lib/brand.d.ts +0 -53
  72. package/node_modules/@dsh-ft/dsh-fft-settings/lib/brand.js +0 -50
  73. package/node_modules/@dsh-ft/dsh-fft-settings/lib/client.d.ts +0 -8
  74. package/node_modules/@dsh-ft/dsh-fft-settings/lib/client.js +0 -822
  75. package/node_modules/@dsh-ft/dsh-fft-settings/lib/client.js.map +0 -1
  76. package/node_modules/@dsh-ft/dsh-fft-settings/lib/contract.d.ts +0 -14
  77. package/node_modules/@dsh-ft/dsh-fft-settings/lib/contract.js +0 -14
  78. package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/client-transport.d.ts +0 -15
  79. package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/client-transport.js +0 -31
  80. package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/contract.d.ts +0 -62
  81. package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/contract.js +0 -28
  82. package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/module-registry.d.ts +0 -54
  83. package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/module-registry.js +0 -68
  84. package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/rpc-core.d.ts +0 -69
  85. package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/rpc-core.js +0 -88
  86. package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/shell.d.ts +0 -59
  87. package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/shell.js +0 -28
  88. package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/styles.d.ts +0 -31
  89. package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/styles.js +0 -43
  90. package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/transport.d.ts +0 -19
  91. package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/transport.js +0 -80
  92. package/node_modules/@dsh-ft/dsh-fft-settings/lib/default-preset.d.ts +0 -52
  93. package/node_modules/@dsh-ft/dsh-fft-settings/lib/default-preset.js +0 -121
  94. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/card.d.ts +0 -24
  95. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/card.js +0 -39
  96. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/client-api.d.ts +0 -4
  97. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/client-api.js +0 -11
  98. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/contract.d.ts +0 -69
  99. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/contract.js +0 -24
  100. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/host.d.ts +0 -17
  101. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/host.js +0 -32
  102. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/index.d.ts +0 -13
  103. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/index.js +0 -12
  104. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/logging.d.ts +0 -15
  105. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/logging.js +0 -1
  106. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/model.d.ts +0 -24
  107. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/model.js +0 -105
  108. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/probe.d.ts +0 -11
  109. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/probe.js +0 -142
  110. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/rpc.d.ts +0 -4
  111. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/rpc.js +0 -17
  112. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/service.d.ts +0 -21
  113. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/service.js +0 -181
  114. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/styles.d.ts +0 -9
  115. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/styles.js +0 -24
  116. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/archive.d.ts +0 -87
  117. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/archive.js +0 -156
  118. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/card.d.ts +0 -22
  119. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/card.js +0 -107
  120. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/client-api.d.ts +0 -4
  121. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/client-api.js +0 -11
  122. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/collector.d.ts +0 -91
  123. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/collector.js +0 -258
  124. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/config.d.ts +0 -70
  125. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/config.js +0 -97
  126. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/contract.d.ts +0 -130
  127. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/contract.js +0 -67
  128. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/export.d.ts +0 -92
  129. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/export.js +0 -212
  130. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/format.d.ts +0 -42
  131. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/format.js +0 -172
  132. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/home.d.ts +0 -18
  133. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/home.js +0 -39
  134. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/host.d.ts +0 -19
  135. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/host.js +0 -139
  136. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/index.d.ts +0 -12
  137. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/index.js +0 -12
  138. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/rpc.d.ts +0 -6
  139. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/rpc.js +0 -27
  140. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/styles.d.ts +0 -9
  141. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/styles.js +0 -13
  142. package/node_modules/@dsh-ft/dsh-fft-settings/lib/guidance.d.ts +0 -41
  143. package/node_modules/@dsh-ft/dsh-fft-settings/lib/guidance.js +0 -88
  144. package/node_modules/@dsh-ft/dsh-fft-settings/lib/index.d.ts +0 -67
  145. package/node_modules/@dsh-ft/dsh-fft-settings/lib/index.js +0 -50
  146. package/node_modules/@dsh-ft/dsh-fft-settings/lib/rpc.d.ts +0 -10
  147. package/node_modules/@dsh-ft/dsh-fft-settings/lib/rpc.js +0 -10
  148. package/node_modules/@dsh-ft/dsh-fft-settings/package.json +0 -80
  149. package/node_modules/@dsh-ft/dsh-fft-settings/src/agent.ts +0 -31
  150. package/node_modules/@dsh-ft/dsh-fft-settings/src/brand.ts +0 -79
  151. package/node_modules/@dsh-ft/dsh-fft-settings/src/client.tsx +0 -21
  152. package/node_modules/@dsh-ft/dsh-fft-settings/src/contract.ts +0 -14
  153. package/node_modules/@dsh-ft/dsh-fft-settings/src/core/client-transport.ts +0 -37
  154. package/node_modules/@dsh-ft/dsh-fft-settings/src/core/contract.ts +0 -57
  155. package/node_modules/@dsh-ft/dsh-fft-settings/src/core/module-registry.ts +0 -102
  156. package/node_modules/@dsh-ft/dsh-fft-settings/src/core/rpc-core.ts +0 -107
  157. package/node_modules/@dsh-ft/dsh-fft-settings/src/core/shell.tsx +0 -81
  158. package/node_modules/@dsh-ft/dsh-fft-settings/src/core/styles.ts +0 -43
  159. package/node_modules/@dsh-ft/dsh-fft-settings/src/core/transport.ts +0 -82
  160. package/node_modules/@dsh-ft/dsh-fft-settings/src/default-preset.ts +0 -151
  161. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/card.tsx +0 -77
  162. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/client-api.ts +0 -12
  163. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/contract.ts +0 -63
  164. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/host.ts +0 -36
  165. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/index.ts +0 -13
  166. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/logging.ts +0 -15
  167. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/model.ts +0 -63
  168. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/probe.ts +0 -116
  169. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/rpc.ts +0 -18
  170. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/service.ts +0 -157
  171. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/styles.ts +0 -24
  172. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/archive.ts +0 -230
  173. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/card.tsx +0 -169
  174. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/client-api.ts +0 -20
  175. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/collector.ts +0 -313
  176. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/config.ts +0 -115
  177. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/contract.ts +0 -149
  178. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/export.ts +0 -274
  179. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/format.ts +0 -188
  180. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/home.ts +0 -43
  181. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/host.ts +0 -153
  182. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/index.ts +0 -12
  183. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/rpc.ts +0 -29
  184. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/styles.ts +0 -13
  185. package/node_modules/@dsh-ft/dsh-fft-settings/src/guidance.ts +0 -114
  186. package/node_modules/@dsh-ft/dsh-fft-settings/src/index.ts +0 -59
  187. package/node_modules/@dsh-ft/dsh-fft-settings/src/rpc.ts +0 -10
package/README.md CHANGED
@@ -73,4 +73,13 @@ API Key 在 DSH「设置 → 金融终端」中配置,申请地址:<https://
73
73
  - 重置账户会先备份到同目录的 `backups/`;账户异常锁定时面板会给出账本路径,可导出后排查。
74
74
  - 仅用于模拟与研究,不接实盘,不构成投资建议。
75
75
 
76
- 本项目以 [MIT](LICENSE) 许可开源。
76
+ ## 反馈
77
+
78
+ 遇到 bug 或想加功能,走 GitHub Issues(面板顶栏「反馈」是同一入口):
79
+
80
+ - [报告 bug](https://github.com/gigaflw/dsh-fft-paper-trading/issues/new?template=bug_report.yml)
81
+ - [功能建议](https://github.com/gigaflw/dsh-fft-paper-trading/issues/new?template=feature_request.yml)
82
+
83
+ 贴日志前先删掉 API Key、账户数据与账本路径。行情额度、Key 与交易日历这类使用问题,先看上面的「行情与 API Key」。
84
+
85
+ 本项目以 [MIT](LICENSE) 许可开源。变更记录见 [CHANGELOG.md](CHANGELOG.md)。
package/lib/client.js CHANGED
@@ -8,6 +8,17 @@ window.__ModuleLoader__.load({
8
8
  const h = React.createElement
9
9
 
10
10
  const ROUTE = '/api/ft-paper-trading'
11
+ /** Release number stamped into the Feedback link title at build time. */
12
+ const PAPER_VERSION = '0.5.0'
13
+ /** Public repository; the panel links out and collects nothing itself. */
14
+ const ISSUE_NEW = 'https://github.com/gigaflw/dsh-fft-paper-trading/issues/new'
15
+ /**
16
+ * Feedback opens the Bug form with the release already in the title: a
17
+ * report without a version costs triage a round trip. GitHub honours only
18
+ * `title`/`labels` on a form URL — a `body` param is ignored (and a blank
19
+ * issue can 400 on repos that disable it) — so the body stays user-written.
20
+ */
21
+ const FEEDBACK_URL = `${ISSUE_NEW}?template=bug_report.yml&title=${encodeURIComponent(`[Bug] v${PAPER_VERSION} `)}`
11
22
  const PERIODS = [
12
23
  ['7d', '7 天'],
13
24
  ['30d', '30 天'],
@@ -507,6 +518,10 @@ window.__ModuleLoader__.load({
507
518
  color:var(--pt-accent-ink); font-weight:500; }
508
519
  .pt-btn-primary:hover { background:var(--pt-accent-hover); border-color:var(--pt-accent-hover); }
509
520
  .pt-btn-danger { color:var(--dsw-alias-state-error-primary, #a33b2a); }
521
+ /* The only anchor styled as a button: a secondary utility, never an
522
+ action, so it sits last in the header row. A normal line-height matches
523
+ the UA default on button, keeping the two the same height. */
524
+ .pt-feedback { text-decoration:none; display:inline-flex; align-items:center; line-height:normal; }
510
525
  .pt-row { display:flex; gap:8px; flex-wrap:wrap; align-items:flex-end; }
511
526
  .pt-field { display:flex; flex-direction:column; gap:3px; min-width:0; }
512
527
  .pt-field span { font-size:11px; color:var(--dsw-alias-label-secondary, #49525f); }
@@ -709,6 +724,18 @@ window.__ModuleLoader__.load({
709
724
  ))
710
725
  }
711
726
 
727
+ /**
728
+ * Support entry: a plain link to the public issue form. It reads nothing
729
+ * from the ledger, so it is safe to show in every account state — including
730
+ * a blocked one, where a report is most likely needed.
731
+ */
732
+ function FeedbackLink() {
733
+ return h('a', {
734
+ className: 'pt-btn pt-feedback', href: FEEDBACK_URL, target: '_blank', rel: 'noreferrer',
735
+ title: '在 GitHub 报告问题',
736
+ }, '反馈')
737
+ }
738
+
712
739
  /** Wide tables scroll inside their own box instead of the page. */
713
740
  function Table({ children }) {
714
741
  return h('div', { className: 'pt-table-wrap' }, h('table', { className: 'pt-table' }, children))
@@ -2059,6 +2086,7 @@ window.__ModuleLoader__.load({
2059
2086
  },
2060
2087
  }, '资金'),
2061
2088
  h('button', { className: 'pt-btn pt-btn-danger', onClick: reset, disabled: busy }, '重置'),
2089
+ h(FeedbackLink),
2062
2090
  ),
2063
2091
  ),
2064
2092
  h(DataBanner, { status: dataSource, onRetry: refreshAll }),
@@ -3048,6 +3076,7 @@ window.__ModuleLoader__.load({
3048
3076
  },
3049
3077
  }, '资金'),
3050
3078
  h('button', { className: 'pt-btn pt-btn-danger', onClick: reset, disabled: busy }, '重置'),
3079
+ h(FeedbackLink),
3051
3080
  ),
3052
3081
  ),
3053
3082
  h(DataBanner, { status: dataSource, onRetry: refreshAll }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsh-ft/dsh-fft-paper-trading",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "description": "A-share and commodity futures paper trading for DeepSeek Harness: local ledger, batch orders, review, and FTShare quotes.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -48,17 +48,11 @@
48
48
  "package.json"
49
49
  ],
50
50
  "dependencies": {
51
- "@deepseek-ai/dsh-credentials": ">=0.2.0-rc.2",
52
- "@deepseek-ai/schemastery": ">=3.18.4",
53
- "fflate": ">=0.8.3",
54
- "@modelcontextprotocol/sdk": "^1.30.0",
55
- "@dsh-ft/dsh-fft-settings": "0.5.0",
56
- "@dsh-ft/dsh-fft-ftshare": "0.2.1",
51
+ "@dsh-ft/dsh-fft-settings": "^0.5.0",
52
+ "@dsh-ft/dsh-fft-ftshare": "^0.3.0",
57
53
  "@ftshare-lab/dsh-kline": "0.4.0"
58
54
  },
59
55
  "bundledDependencies": [
60
- "@dsh-ft/dsh-fft-settings",
61
- "@dsh-ft/dsh-fft-ftshare",
62
56
  "@ftshare-lab/dsh-kline"
63
57
  ],
64
58
  "peerDependencies": {
@@ -8,6 +8,17 @@ window.__ModuleLoader__.load({
8
8
  const h = React.createElement
9
9
 
10
10
  const ROUTE = '/api/ft-paper-trading'
11
+ /** Release number stamped into the Feedback link title at build time. */
12
+ const PAPER_VERSION = '__PAPER_VERSION__'
13
+ /** Public repository; the panel links out and collects nothing itself. */
14
+ const ISSUE_NEW = 'https://github.com/gigaflw/dsh-fft-paper-trading/issues/new'
15
+ /**
16
+ * Feedback opens the Bug form with the release already in the title: a
17
+ * report without a version costs triage a round trip. GitHub honours only
18
+ * `title`/`labels` on a form URL — a `body` param is ignored (and a blank
19
+ * issue can 400 on repos that disable it) — so the body stays user-written.
20
+ */
21
+ const FEEDBACK_URL = `${ISSUE_NEW}?template=bug_report.yml&title=${encodeURIComponent(`[Bug] v${PAPER_VERSION} `)}`
11
22
  const PERIODS = [
12
23
  ['7d', '7 天'],
13
24
  ['30d', '30 天'],
@@ -507,6 +518,10 @@ window.__ModuleLoader__.load({
507
518
  color:var(--pt-accent-ink); font-weight:500; }
508
519
  .pt-btn-primary:hover { background:var(--pt-accent-hover); border-color:var(--pt-accent-hover); }
509
520
  .pt-btn-danger { color:var(--dsw-alias-state-error-primary, #a33b2a); }
521
+ /* The only anchor styled as a button: a secondary utility, never an
522
+ action, so it sits last in the header row. A normal line-height matches
523
+ the UA default on button, keeping the two the same height. */
524
+ .pt-feedback { text-decoration:none; display:inline-flex; align-items:center; line-height:normal; }
510
525
  .pt-row { display:flex; gap:8px; flex-wrap:wrap; align-items:flex-end; }
511
526
  .pt-field { display:flex; flex-direction:column; gap:3px; min-width:0; }
512
527
  .pt-field span { font-size:11px; color:var(--dsw-alias-label-secondary, #49525f); }
@@ -709,6 +724,18 @@ window.__ModuleLoader__.load({
709
724
  ))
710
725
  }
711
726
 
727
+ /**
728
+ * Support entry: a plain link to the public issue form. It reads nothing
729
+ * from the ledger, so it is safe to show in every account state — including
730
+ * a blocked one, where a report is most likely needed.
731
+ */
732
+ function FeedbackLink() {
733
+ return h('a', {
734
+ className: 'pt-btn pt-feedback', href: FEEDBACK_URL, target: '_blank', rel: 'noreferrer',
735
+ title: '在 GitHub 报告问题',
736
+ }, '反馈')
737
+ }
738
+
712
739
  /** Wide tables scroll inside their own box instead of the page. */
713
740
  function Table({ children }) {
714
741
  return h('div', { className: 'pt-table-wrap' }, h('table', { className: 'pt-table' }, children))
@@ -2059,6 +2086,7 @@ window.__ModuleLoader__.load({
2059
2086
  },
2060
2087
  }, '资金'),
2061
2088
  h('button', { className: 'pt-btn pt-btn-danger', onClick: reset, disabled: busy }, '重置'),
2089
+ h(FeedbackLink),
2062
2090
  ),
2063
2091
  ),
2064
2092
  h(DataBanner, { status: dataSource, onRetry: refreshAll }),
@@ -3048,6 +3076,7 @@ window.__ModuleLoader__.load({
3048
3076
  },
3049
3077
  }, '资金'),
3050
3078
  h('button', { className: 'pt-btn pt-btn-danger', onClick: reset, disabled: busy }, '重置'),
3079
+ h(FeedbackLink),
3051
3080
  ),
3052
3081
  ),
3053
3082
  h(DataBanner, { status: dataSource, onRetry: refreshAll }),
@@ -1,73 +0,0 @@
1
- # @dsh-ft/dsh-fft-ftshare
2
-
3
- FTShare 数据底座:bundle 内所有 FTShare 取数都经过它。
4
-
5
- - **一处凭据**:只走 `ctx.ftshareSettings.apiKey.resolve()`,本包不读任何凭据文件。
6
- - **一处出站**:唯一的 StreamableHTTP MCP 会话,打到 `market.ft.tech/gateway/mcp`。
7
- - **一处结局语义**:`available / empty / denied / failed` 四态 + `notice`;只有 `empty`
8
- 才允许下游说「没有数据」。
9
- - **两处接口定义**:接口表(策展,决定下发哪些模型工具)与目录(上游全量快照,随包发布)。
10
- - **一条跨平面通路**:两个助手,由消费方自己挂。
11
-
12
- ## 入口
13
-
14
- | 入口 | 平面 | 职责 |
15
- |---|---|---|
16
- | 裸包名 `@dsh-ft/dsh-fft-ftshare` | **全局** | `provide('ftshareData')`,`inject: ['ftshareSettings']`。唯一出站、唯一四态。 |
17
- | `/tools` | preset | 接口表里带 `expose` 的条目 → `ftshare_*` 工具;外加长尾直调 `ftshare_call(interface, args)`。 |
18
- | `/mask` | preset | 按 agent 掩掉 `dsh_kline` 的三个 FTShare wrapper 工具(`market_pulse` / `market_board_detail` / `security_intelligence`)。 |
19
- | `/project` | preset | `tools/post-execute` 钩子:把保留的 kline 摘要式结果投影成模型可见文本,不输出裸计数。 |
20
- | `/route` · 助手 | 消费方自挂 | `registerFtshareRoute(ctx, data)`:注册精确路由 `/api/ftshare-data`,四态原样过桥。 |
21
- | `/client` · 助手 | 消费方自挂 | `createFtshareClient({ catalog, fetch })`:浏览器侧同名同形的实现 + 本地 `search()`。 |
22
-
23
- **服务行必须挂全局**:preset 内 `provide` 会抛 `Preset services require isolate realms`
24
- (`agent-preset-registry` 的 `mount.ts`),而加 `isolate` 之后服务变成 preset 私有,
25
- preset 之外的消费方再也 inject 不到。工具、掩码、投影三行都是 preset 作用域内的注册,
26
- 所以标准模式看不到它们。
27
-
28
- 本包**不声明 `dsh.client`**:它不是客户端面,只发布两个助手;谁需要面板取数谁自己挂。
29
-
30
- ## 消费方式
31
-
32
- 宿主侧:
33
-
34
- ```ts
35
- import type { FtshareCallResult } from '@dsh-ft/dsh-fft-ftshare/contract'
36
-
37
- export const inject = ['ftshareData']
38
-
39
- const result: FtshareCallResult = await ctx.ftshareData.call('ft_v1_finance_income', { stock_code })
40
- if (result.state === 'available') render(result.rows)
41
- else showNotice(result.notice) // denied 带 upgradeUrl,empty 才是「没有数据」
42
- ```
43
-
44
- 浏览器侧:
45
-
46
- ```ts
47
- // 宿主半:一行挂载路由
48
- ctx.inject(['connection', 'ftshareData'], scope =>
49
- scope.effect(() => registerFtshareRoute(scope.ctx, scope.ftshareData), 'ftshare: /api route'))
50
-
51
- // 客户端半:一行提供同名服务,此后面板与宿主消费方写法一致
52
- ctx.provide('ftshareData', createFtshareClient({ catalog, fetch: window.fetch.bind(window) }))
53
- ```
54
-
55
- 要暴露新接口就把条目加进 `src/capabilities.ts`,不要自己注册模型工具,也不要自己连网关。
56
-
57
- ## 目录产物
58
-
59
- `catalog.json`(完整,含 `description` 与 `inputSchema`)、`catalog.txt`(一线索引:
60
- `接口名 | 标题 | 入参名`,必填带 `*`)、`catalog.meta.json`(条目数与生成时间)都由
61
- `scripts/build-catalog.mjs` 从 `tools/list` 生成,随包发布:模型用 `grep` 查索引,
62
- 不需要为发现能力多花一个工具定义。
63
-
64
- ## 开发
65
-
66
- ```bash
67
- pnpm build # tsc,产物 lib/(git 安装只送达被跟踪文件,lib/ 必须入库)
68
- pnpm test # build + 投影/归一/目录/掩码/跨平面五组断言
69
- pnpm catalog # 匿名会话重新生成目录产物(联网)
70
- pnpm catalog:check # 重新生成并与盘上产物比对(联网;失败说明上游漂了)
71
- ```
72
-
73
- `scripts/` 下每个用例都只做断言、不发数据请求:假 transport、假服务、进程内路由。