@dsh-ft/dsh-fft-paper-trading 0.4.1 → 0.6.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 (306) hide show
  1. package/README.md +59 -45
  2. package/README.zh.md +90 -0
  3. package/lib/agent/format.d.ts +1 -2
  4. package/lib/agent/format.d.ts.map +1 -1
  5. package/lib/agent/format.js +1 -8
  6. package/lib/agent/format.js.map +1 -1
  7. package/lib/agent/futures-tools.d.ts +9 -8
  8. package/lib/agent/futures-tools.d.ts.map +1 -1
  9. package/lib/agent/futures-tools.js +62 -43
  10. package/lib/agent/futures-tools.js.map +1 -1
  11. package/lib/agent/ledger-tools.d.ts +9 -0
  12. package/lib/agent/ledger-tools.d.ts.map +1 -0
  13. package/lib/agent/ledger-tools.js +117 -0
  14. package/lib/agent/ledger-tools.js.map +1 -0
  15. package/lib/agent/tools.d.ts +13 -1
  16. package/lib/agent/tools.d.ts.map +1 -1
  17. package/lib/agent/tools.js +74 -103
  18. package/lib/agent/tools.js.map +1 -1
  19. package/lib/client.js +34 -5
  20. package/lib/contract.d.ts +26 -1
  21. package/lib/contract.d.ts.map +1 -1
  22. package/lib/contract.js.map +1 -1
  23. package/lib/core/futures/engine.js +1 -1
  24. package/lib/core/futures/engine.js.map +1 -1
  25. package/lib/core/futures/ledger.d.ts.map +1 -1
  26. package/lib/core/futures/ledger.js +8 -1
  27. package/lib/core/futures/ledger.js.map +1 -1
  28. package/lib/core/ledger.d.ts.map +1 -1
  29. package/lib/core/ledger.js +10 -4
  30. package/lib/core/ledger.js.map +1 -1
  31. package/lib/core/migrations.d.ts +36 -0
  32. package/lib/core/migrations.d.ts.map +1 -0
  33. package/lib/core/migrations.js +141 -0
  34. package/lib/core/migrations.js.map +1 -0
  35. package/lib/core/types.d.ts +9 -0
  36. package/lib/core/types.d.ts.map +1 -1
  37. package/lib/index.d.ts.map +1 -1
  38. package/lib/index.js +2 -0
  39. package/lib/index.js.map +1 -1
  40. package/lib/service/futures-rpc.d.ts.map +1 -1
  41. package/lib/service/futures-rpc.js +8 -0
  42. package/lib/service/futures-rpc.js.map +1 -1
  43. package/lib/service/futures-service.d.ts +21 -2
  44. package/lib/service/futures-service.d.ts.map +1 -1
  45. package/lib/service/futures-service.js +81 -3
  46. package/lib/service/futures-service.js.map +1 -1
  47. package/lib/service/paper-service.d.ts +18 -1
  48. package/lib/service/paper-service.d.ts.map +1 -1
  49. package/lib/service/paper-service.js +55 -1
  50. package/lib/service/paper-service.js.map +1 -1
  51. package/lib/service/rpc.d.ts.map +1 -1
  52. package/lib/service/rpc.js +8 -0
  53. package/lib/service/rpc.js.map +1 -1
  54. package/lib/store/event-store.d.ts +10 -0
  55. package/lib/store/event-store.d.ts.map +1 -1
  56. package/lib/store/event-store.js +45 -25
  57. package/lib/store/event-store.js.map +1 -1
  58. package/lib/store/futures-repo.d.ts +19 -1
  59. package/lib/store/futures-repo.d.ts.map +1 -1
  60. package/lib/store/futures-repo.js +108 -13
  61. package/lib/store/futures-repo.js.map +1 -1
  62. package/lib/store/port.d.ts +31 -0
  63. package/lib/store/port.d.ts.map +1 -1
  64. package/lib/store/repo.d.ts +26 -1
  65. package/lib/store/repo.d.ts.map +1 -1
  66. package/lib/store/repo.js +190 -12
  67. package/lib/store/repo.js.map +1 -1
  68. package/lib/store/snapshots.d.ts +56 -0
  69. package/lib/store/snapshots.d.ts.map +1 -0
  70. package/lib/store/snapshots.js +115 -0
  71. package/lib/store/snapshots.js.map +1 -0
  72. package/package.json +4 -9
  73. package/src/agent/format.ts +2 -9
  74. package/src/agent/futures-tools.ts +64 -46
  75. package/src/agent/ledger-tools.ts +125 -0
  76. package/src/agent/tools.ts +77 -105
  77. package/src/client/index.js +34 -5
  78. package/src/contract.ts +28 -0
  79. package/src/core/futures/engine.ts +1 -1
  80. package/src/core/futures/ledger.ts +8 -1
  81. package/src/core/ledger.ts +10 -4
  82. package/src/core/migrations.ts +152 -0
  83. package/src/core/types.ts +1 -0
  84. package/src/index.ts +2 -0
  85. package/src/service/futures-rpc.ts +8 -0
  86. package/src/service/futures-service.ts +87 -4
  87. package/src/service/paper-service.ts +60 -2
  88. package/src/service/rpc.ts +8 -0
  89. package/src/store/event-store.ts +41 -20
  90. package/src/store/futures-repo.ts +115 -13
  91. package/src/store/port.ts +32 -0
  92. package/src/store/repo.ts +190 -13
  93. package/src/store/snapshots.ts +141 -0
  94. package/node_modules/@dsh-ft/dsh-fft-ftshare/README.md +0 -73
  95. package/node_modules/@dsh-ft/dsh-fft-ftshare/catalog.json +0 -9762
  96. package/node_modules/@dsh-ft/dsh-fft-ftshare/catalog.meta.json +0 -7
  97. package/node_modules/@dsh-ft/dsh-fft-ftshare/catalog.txt +0 -250
  98. package/node_modules/@dsh-ft/dsh-fft-ftshare/cordis.patch.yml +0 -27
  99. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/capabilities.d.ts +0 -47
  100. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/capabilities.d.ts.map +0 -1
  101. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/capabilities.js +0 -145
  102. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/capabilities.js.map +0 -1
  103. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/catalog-host.d.ts +0 -19
  104. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/catalog-host.d.ts.map +0 -1
  105. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/catalog-host.js +0 -31
  106. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/catalog-host.js.map +0 -1
  107. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/catalog.d.ts +0 -51
  108. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/catalog.d.ts.map +0 -1
  109. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/catalog.js +0 -60
  110. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/catalog.js.map +0 -1
  111. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/client.d.ts +0 -52
  112. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/client.d.ts.map +0 -1
  113. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/client.js +0 -149
  114. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/client.js.map +0 -1
  115. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/contract.d.ts +0 -122
  116. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/contract.d.ts.map +0 -1
  117. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/contract.js +0 -24
  118. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/contract.js.map +0 -1
  119. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/errors.d.ts +0 -93
  120. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/errors.d.ts.map +0 -1
  121. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/errors.js +0 -261
  122. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/errors.js.map +0 -1
  123. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/index.d.ts +0 -64
  124. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/index.d.ts.map +0 -1
  125. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/index.js +0 -160
  126. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/index.js.map +0 -1
  127. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/mask.d.ts +0 -66
  128. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/mask.d.ts.map +0 -1
  129. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/mask.js +0 -106
  130. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/mask.js.map +0 -1
  131. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/project.d.ts +0 -98
  132. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/project.d.ts.map +0 -1
  133. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/project.js +0 -326
  134. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/project.js.map +0 -1
  135. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/route.d.ts +0 -48
  136. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/route.d.ts.map +0 -1
  137. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/route.js +0 -90
  138. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/route.js.map +0 -1
  139. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/tools.d.ts +0 -31
  140. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/tools.d.ts.map +0 -1
  141. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/tools.js +0 -132
  142. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/tools.js.map +0 -1
  143. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/transport.d.ts +0 -53
  144. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/transport.d.ts.map +0 -1
  145. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/transport.js +0 -147
  146. package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/transport.js.map +0 -1
  147. package/node_modules/@dsh-ft/dsh-fft-ftshare/package.json +0 -82
  148. package/node_modules/@dsh-ft/dsh-fft-settings/README.md +0 -385
  149. package/node_modules/@dsh-ft/dsh-fft-settings/cordis.patch.yml +0 -18
  150. package/node_modules/@dsh-ft/dsh-fft-settings/docs/compatibility-dsh-0.1.6-alpha.1.md +0 -58
  151. package/node_modules/@dsh-ft/dsh-fft-settings/docs/extension-service-design.md +0 -351
  152. package/node_modules/@dsh-ft/dsh-fft-settings/docs/extension-service-sequences.html +0 -545
  153. package/node_modules/@dsh-ft/dsh-fft-settings/docs/ftshare-settings-er.html +0 -139
  154. package/node_modules/@dsh-ft/dsh-fft-settings/docs/ftshare-settings-er.svg +0 -113
  155. package/node_modules/@dsh-ft/dsh-fft-settings/docs/ftshare-settings-results-er.html +0 -148
  156. package/node_modules/@dsh-ft/dsh-fft-settings/docs/ftshare-settings-results-er.svg +0 -122
  157. package/node_modules/@dsh-ft/dsh-fft-settings/docs/kline-integration.md +0 -258
  158. package/node_modules/@dsh-ft/dsh-fft-settings/lib/agent.d.ts +0 -24
  159. package/node_modules/@dsh-ft/dsh-fft-settings/lib/agent.js +0 -26
  160. package/node_modules/@dsh-ft/dsh-fft-settings/lib/brand.d.ts +0 -53
  161. package/node_modules/@dsh-ft/dsh-fft-settings/lib/brand.js +0 -50
  162. package/node_modules/@dsh-ft/dsh-fft-settings/lib/client.d.ts +0 -8
  163. package/node_modules/@dsh-ft/dsh-fft-settings/lib/client.js +0 -822
  164. package/node_modules/@dsh-ft/dsh-fft-settings/lib/client.js.map +0 -1
  165. package/node_modules/@dsh-ft/dsh-fft-settings/lib/contract.d.ts +0 -14
  166. package/node_modules/@dsh-ft/dsh-fft-settings/lib/contract.js +0 -14
  167. package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/client-transport.d.ts +0 -15
  168. package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/client-transport.js +0 -31
  169. package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/contract.d.ts +0 -62
  170. package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/contract.js +0 -28
  171. package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/module-registry.d.ts +0 -54
  172. package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/module-registry.js +0 -68
  173. package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/rpc-core.d.ts +0 -69
  174. package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/rpc-core.js +0 -88
  175. package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/shell.d.ts +0 -59
  176. package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/shell.js +0 -28
  177. package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/styles.d.ts +0 -31
  178. package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/styles.js +0 -43
  179. package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/transport.d.ts +0 -19
  180. package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/transport.js +0 -80
  181. package/node_modules/@dsh-ft/dsh-fft-settings/lib/default-preset.d.ts +0 -52
  182. package/node_modules/@dsh-ft/dsh-fft-settings/lib/default-preset.js +0 -121
  183. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/card.d.ts +0 -24
  184. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/card.js +0 -39
  185. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/client-api.d.ts +0 -4
  186. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/client-api.js +0 -11
  187. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/contract.d.ts +0 -69
  188. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/contract.js +0 -24
  189. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/host.d.ts +0 -17
  190. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/host.js +0 -32
  191. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/index.d.ts +0 -13
  192. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/index.js +0 -12
  193. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/logging.d.ts +0 -15
  194. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/logging.js +0 -1
  195. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/model.d.ts +0 -24
  196. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/model.js +0 -105
  197. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/probe.d.ts +0 -11
  198. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/probe.js +0 -142
  199. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/rpc.d.ts +0 -4
  200. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/rpc.js +0 -17
  201. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/service.d.ts +0 -21
  202. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/service.js +0 -181
  203. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/styles.d.ts +0 -9
  204. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/styles.js +0 -24
  205. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/archive.d.ts +0 -87
  206. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/archive.js +0 -156
  207. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/card.d.ts +0 -22
  208. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/card.js +0 -107
  209. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/client-api.d.ts +0 -4
  210. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/client-api.js +0 -11
  211. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/collector.d.ts +0 -91
  212. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/collector.js +0 -258
  213. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/config.d.ts +0 -70
  214. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/config.js +0 -97
  215. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/contract.d.ts +0 -130
  216. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/contract.js +0 -67
  217. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/export.d.ts +0 -92
  218. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/export.js +0 -212
  219. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/format.d.ts +0 -42
  220. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/format.js +0 -172
  221. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/home.d.ts +0 -18
  222. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/home.js +0 -39
  223. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/host.d.ts +0 -19
  224. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/host.js +0 -139
  225. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/index.d.ts +0 -12
  226. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/index.js +0 -12
  227. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/rpc.d.ts +0 -6
  228. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/rpc.js +0 -27
  229. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/styles.d.ts +0 -9
  230. package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/styles.js +0 -13
  231. package/node_modules/@dsh-ft/dsh-fft-settings/lib/guidance.d.ts +0 -41
  232. package/node_modules/@dsh-ft/dsh-fft-settings/lib/guidance.js +0 -88
  233. package/node_modules/@dsh-ft/dsh-fft-settings/lib/index.d.ts +0 -67
  234. package/node_modules/@dsh-ft/dsh-fft-settings/lib/index.js +0 -50
  235. package/node_modules/@dsh-ft/dsh-fft-settings/lib/rpc.d.ts +0 -10
  236. package/node_modules/@dsh-ft/dsh-fft-settings/lib/rpc.js +0 -10
  237. package/node_modules/@dsh-ft/dsh-fft-settings/package.json +0 -80
  238. package/node_modules/@dsh-ft/dsh-fft-settings/src/agent.ts +0 -31
  239. package/node_modules/@dsh-ft/dsh-fft-settings/src/brand.ts +0 -79
  240. package/node_modules/@dsh-ft/dsh-fft-settings/src/client.tsx +0 -21
  241. package/node_modules/@dsh-ft/dsh-fft-settings/src/contract.ts +0 -14
  242. package/node_modules/@dsh-ft/dsh-fft-settings/src/core/client-transport.ts +0 -37
  243. package/node_modules/@dsh-ft/dsh-fft-settings/src/core/contract.ts +0 -57
  244. package/node_modules/@dsh-ft/dsh-fft-settings/src/core/module-registry.ts +0 -102
  245. package/node_modules/@dsh-ft/dsh-fft-settings/src/core/rpc-core.ts +0 -107
  246. package/node_modules/@dsh-ft/dsh-fft-settings/src/core/shell.tsx +0 -81
  247. package/node_modules/@dsh-ft/dsh-fft-settings/src/core/styles.ts +0 -43
  248. package/node_modules/@dsh-ft/dsh-fft-settings/src/core/transport.ts +0 -82
  249. package/node_modules/@dsh-ft/dsh-fft-settings/src/default-preset.ts +0 -151
  250. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/card.tsx +0 -77
  251. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/client-api.ts +0 -12
  252. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/contract.ts +0 -63
  253. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/host.ts +0 -36
  254. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/index.ts +0 -13
  255. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/logging.ts +0 -15
  256. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/model.ts +0 -63
  257. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/probe.ts +0 -116
  258. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/rpc.ts +0 -18
  259. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/service.ts +0 -157
  260. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/styles.ts +0 -24
  261. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/archive.ts +0 -230
  262. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/card.tsx +0 -169
  263. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/client-api.ts +0 -20
  264. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/collector.ts +0 -313
  265. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/config.ts +0 -115
  266. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/contract.ts +0 -149
  267. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/export.ts +0 -274
  268. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/format.ts +0 -188
  269. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/home.ts +0 -43
  270. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/host.ts +0 -153
  271. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/index.ts +0 -12
  272. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/rpc.ts +0 -29
  273. package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/styles.ts +0 -13
  274. package/node_modules/@dsh-ft/dsh-fft-settings/src/guidance.ts +0 -114
  275. package/node_modules/@dsh-ft/dsh-fft-settings/src/index.ts +0 -59
  276. package/node_modules/@dsh-ft/dsh-fft-settings/src/rpc.ts +0 -10
  277. package/node_modules/@ftshare-lab/dsh-kline/docs/images/dsh-kline-tab-workspace.png +0 -0
  278. package/node_modules/@ftshare-lab/dsh-kline/docs/images/dsh-market.png +0 -0
  279. package/node_modules/@ftshare-lab/dsh-kline/docs/images/kline-news.png +0 -0
  280. package/node_modules/@ftshare-lab/dsh-kline/docs/images/kline-range-stats.png +0 -0
  281. package/node_modules/@ftshare-lab/dsh-kline/docs/images/kline-support.png +0 -0
  282. package/node_modules/@ftshare-lab/dsh-kline/docs/release-acceptance-v0.4.0.md +0 -46
  283. package/node_modules/@ftshare-lab/dsh-kline/lib/client/BetterSidebarTab.js +0 -65
  284. package/node_modules/@ftshare-lab/dsh-kline/lib/client/ClassicShell.js +0 -250
  285. package/node_modules/@ftshare-lab/dsh-kline/lib/client/KlineContent.js +0 -155
  286. package/node_modules/@ftshare-lab/dsh-kline/lib/client/PaperKlinePanel.js +0 -35
  287. package/node_modules/@ftshare-lab/dsh-kline/lib/client/canvas-panel.js +0 -58
  288. package/node_modules/@ftshare-lab/dsh-kline/lib/client/chart-apply.js +0 -73
  289. package/node_modules/@ftshare-lab/dsh-kline/lib/client/chart-context.js +0 -184
  290. package/node_modules/@ftshare-lab/dsh-kline/lib/client/chart-session-resolver.js +0 -61
  291. package/node_modules/@ftshare-lab/dsh-kline/lib/client/conversation.js +0 -66
  292. package/node_modules/@ftshare-lab/dsh-kline/lib/client/default-tab.js +0 -83
  293. package/node_modules/@ftshare-lab/dsh-kline/lib/client/embed.js +0 -29
  294. package/node_modules/@ftshare-lab/dsh-kline/lib/client/generated-view.js +0 -9673
  295. package/node_modules/@ftshare-lab/dsh-kline/lib/client/horizontal-lines.js +0 -19
  296. package/node_modules/@ftshare-lab/dsh-kline/lib/client/host-services.js +0 -1
  297. package/node_modules/@ftshare-lab/dsh-kline/lib/client/index.js +0 -50
  298. package/node_modules/@ftshare-lab/dsh-kline/lib/client/mode-preferences.js +0 -31
  299. package/node_modules/@ftshare-lab/dsh-kline/lib/client/native-sidebar-contract.js +0 -36
  300. package/node_modules/@ftshare-lab/dsh-kline/lib/client/native-sidebar.js +0 -99
  301. package/node_modules/@ftshare-lab/dsh-kline/lib/client/sidebar-integration.js +0 -93
  302. package/node_modules/@ftshare-lab/dsh-kline/lib/client/ui-onboarding.js +0 -51
  303. package/node_modules/@ftshare-lab/dsh-kline/lib/client/version.js +0 -14
  304. package/node_modules/@ftshare-lab/dsh-kline/lib/client.js.map +0 -1
  305. package/node_modules/@ftshare-lab/dsh-kline/screenshots.json +0 -7
  306. package/node_modules/@ftshare-lab/dsh-kline/view/kline.html +0 -9584
@@ -1,19 +0,0 @@
1
- /** Merge a drawing-only result into its owning view, preserving candles and toggles. */
2
- const AI_DRAWING_COMMANDS = new Set(['DRAW_HORIZONTAL_LINE', 'DRAW_AGENT_TREND_LINE', 'DRAW_AGENT_CHANNEL', 'DRAW_AGENT_RECTANGLE']);
3
- export function mergeHorizontalLineSnapshot(payload, saved) {
4
- if (payload?.drawing_guard || payload?.view_source_guard || !payload?.drawing_only || saved?.session !== payload.drawing_parent_session
5
- || saved?.payload?.symbol !== payload.symbol || saved?.payload?.interval !== payload.interval
6
- || !Array.isArray(saved?.payload?.chartCommands))
7
- return undefined;
8
- const { _live_chart_session, _live_application_pending, ...savedPayload } = saved.payload;
9
- return {
10
- ...savedPayload,
11
- drawing_only: true,
12
- drawing_parent_session: payload.drawing_parent_session,
13
- indicators_explicit: false,
14
- chartCommands: [
15
- ...saved.payload.chartCommands.filter((command) => !AI_DRAWING_COMMANDS.has(command.type)),
16
- ...payload.chartCommands.filter((command) => AI_DRAWING_COMMANDS.has(command.type)),
17
- ],
18
- };
19
- }
@@ -1,50 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useSyncExternalStore } from 'react';
3
- import { createRoot } from 'react-dom/client';
4
- import { ClassicShell } from './ClassicShell';
5
- import { BetterSidebarBridge } from './BetterSidebarTab';
6
- import { NativeSidebarBridgeView, registerNativeSidebar } from './native-sidebar';
7
- import { isSidebarUsable } from './sidebar-integration';
8
- import { InterfaceContext, readDisplayMode, resolveDisplayMode } from './mode-preferences';
9
- import { captureOnboarding } from './ui-onboarding';
10
- import { registerCanvasHost } from './canvas-panel';
11
- import { registerPaperTradingHost } from './PaperKlinePanel';
12
- export const inject = ['sessions'];
13
- export function apply(ctx) {
14
- let service;
15
- const listeners = new Set();
16
- const emit = () => listeners.forEach(listener => listener());
17
- const subscribe = (listener) => { listeners.add(listener); return () => { listeners.delete(listener); }; };
18
- const preference = readDisplayMode();
19
- captureOnboarding();
20
- // Registered before the router paints, so the first frame already knows
21
- // whether the host owns a right column this plugin can tab into.
22
- const native = registerNativeSidebar(ctx, emit);
23
- function Router() {
24
- const sidebar = useSyncExternalStore(subscribe, () => service);
25
- const nativeTab = useSyncExternalStore(subscribe, () => native.available());
26
- const available = nativeTab || isSidebarUsable(sidebar);
27
- const mode = resolveDisplayMode(preference, available);
28
- return _jsxs(InterfaceContext.Provider, { value: { preference, mode, available }, children: [nativeTab && _jsx(NativeSidebarBridgeView, { bridge: native, sessions: ctx.sessions }), !nativeTab && sidebar && _jsx(BetterSidebarBridge, { service: sidebar, sessions: ctx.sessions }), mode === 'classic' && _jsx(ClassicShell, { sessions: ctx.sessions })] });
29
- }
30
- ctx.effect(() => {
31
- const host = document.createElement('div');
32
- host.dataset.dshKlineRouter = '';
33
- document.body.appendChild(host);
34
- const root = createRoot(host);
35
- root.render(_jsx(Router, {}));
36
- return () => { root.unmount(); host.remove(); listeners.clear(); };
37
- }, 'dsh-kline: interface router');
38
- // A separate dependency scope does not block the parent when absent.
39
- ctx.inject(['betterSidebar'], scoped => {
40
- scoped.effect(() => {
41
- service = scoped.get('betterSidebar');
42
- emit();
43
- return () => { service = undefined; emit(); };
44
- }, 'dsh-kline: optional sidebar');
45
- });
46
- // Optional host panels. Each registers through its own optional scope, so a
47
- // host without the canvas or the paper-trading slot keeps today's plugin.
48
- registerCanvasHost(ctx);
49
- registerPaperTradingHost(ctx);
50
- }
@@ -1,31 +0,0 @@
1
- import { createContext } from 'react';
2
- export const DISPLAY_MODE_KEY = 'dsh-kline:display-mode:v1';
3
- export const AUTO_OPEN_KEY = 'dsh-kline:auto-open-after-analysis:v1';
4
- export const UI_SEEN_KEY = 'dsh-kline:ui-change-seen:v0.2.0';
5
- export const InterfaceContext = createContext({ preference: 'classic', mode: 'classic', available: false });
6
- export function readDisplayMode(storage = globalThis.localStorage) {
7
- try {
8
- const value = storage.getItem(DISPLAY_MODE_KEY);
9
- // The right-column tab is the default now that the classic K launcher is
10
- // gone; a stored preference is kept only so an older profile keeps reading.
11
- return value === 'classic' || value === 'better-sidebar' ? value : 'auto';
12
- }
13
- catch {
14
- return 'auto';
15
- }
16
- }
17
- export function resolveDisplayMode(_preference, available) {
18
- // A host with a right column always gets the tab: there is no floating
19
- // launcher left to fall back to, so a stored "classic" must not strand the
20
- // chart. The classic value survives only for a host that offers no right
21
- // column at all (see index.tsx, which then draws the classic shell).
22
- return available ? 'better-sidebar' : 'classic';
23
- }
24
- export function readAutoOpen(storage = globalThis.localStorage) {
25
- try {
26
- return storage.getItem(AUTO_OPEN_KEY) !== 'false';
27
- }
28
- catch {
29
- return true;
30
- }
31
- }
@@ -1,36 +0,0 @@
1
- import { KLINE_TAB_ID, klineTabTitle } from "./sidebar-integration.js";
2
- /**
3
- * The static half of the native right-Sidebar integration.
4
- *
5
- * Kept free of JSX so the tests can import it directly: the registration itself
6
- * needs a host context, but what this plugin contributes — the tab kind, the
7
- * band it registers in, the chip title and the guide entry — is plain data.
8
- */
9
- /** Implementation identity of the tab type; also the key its body registers under. */
10
- export const NATIVE_TAB_ID = 'ftshare-kline';
11
- /**
12
- * The type definition this plugin contributes.
13
- *
14
- * A page type (no address `patterns`) is opened by kind, which is what the
15
- * auto-open path does; the guide entry is how a person reaches the chart from
16
- * the host's own "add tab" page. Both keep the product label separate from the
17
- * internal kind, exactly like the Better Sidebar title does.
18
- */
19
- export function nativeTabDefinition() {
20
- return {
21
- id: NATIVE_TAB_ID,
22
- kind: KLINE_TAB_ID,
23
- priority: 'extension',
24
- title: () => klineTabTitle(),
25
- guide: [{
26
- id: NATIVE_TAB_ID,
27
- order: 120,
28
- title: () => klineTabTitle(),
29
- description: nativeTabDescription,
30
- }],
31
- };
32
- }
33
- /** One line under the guide capsule: what picking it opens, in the host language. */
34
- export function nativeTabDescription(locale = globalThis.navigator?.language ?? '') {
35
- return /^zh(?:-|$)/i.test(locale) ? '行情图表与关键点位分析' : 'Market chart and key-level analysis';
36
- }
@@ -1,99 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useSyncExternalStore } from 'react';
3
- import { useChartReference } from './chart-session-resolver';
4
- import { KlineTabContent } from './BetterSidebarTab';
5
- import { InterfaceContext, readAutoOpen, readDisplayMode } from './mode-preferences';
6
- import { KLINE_TAB_ID } from './sidebar-integration';
7
- import { NATIVE_TAB_ID, nativeTabDefinition } from './native-sidebar-contract';
8
- export { NATIVE_TAB_ID, nativeTabDefinition, nativeTabDescription } from './native-sidebar-contract';
9
- /**
10
- * One tab body: the same chart the Better Sidebar tab and the paper-trading
11
- * panel draw, mounted against the tab's own conversation.
12
- *
13
- * The interface state is the native-tab one: the chart view uses it only to
14
- * know which shell it lives in, so the tab reports `better-sidebar` (the
15
- * existing "native tab" value) and stays independent of the user's preference.
16
- */
17
- export function NativeKlineTabBody({ sessionId, sessions, useTabInfo }) {
18
- const visible = useTabInfo().tab.visible;
19
- return (_jsx(InterfaceContext.Provider, { value: { preference: readDisplayMode(), mode: 'better-sidebar', available: true }, children: _jsx("div", { "data-dsh-kline-tab": "", style: { width: '100%', height: '100%', minHeight: 0, overflow: 'hidden' }, children: visible && _jsx(KlineTabContent, { sessions: sessions, conversationId: sessionId }, sessionId) }) }));
20
- }
21
- /** Reveal the chart tab when an analysis result lands in the conversation on screen. */
22
- function NativeAutoOpen({ sessions, conversationId, bridge }) {
23
- useChartReference(sessions, conversationId, () => { if (readAutoOpen())
24
- bridge.open(); });
25
- return null;
26
- }
27
- /** Auto-open lives in the tab's own session, exactly like the Better Sidebar path. */
28
- export function NativeSidebarBridgeView({ bridge, sessions }) {
29
- const list = useSyncExternalStore(listener => sessions.list.subscribe(listener), () => sessions.list.getSnapshot());
30
- return list.current
31
- ? _jsx(NativeAutoOpen, { bridge: bridge, sessions: sessions, conversationId: list.current }, list.current)
32
- : null;
33
- }
34
- /**
35
- * Register the chart tab into the host's native right Sidebar.
36
- *
37
- * Every host service is optional: a host without `sidebarRightTabs`, `sidebarRight`
38
- * or `slots` simply gets `available() === false` and the plugin keeps working
39
- * through the interfaces it does have.
40
- * @param ctx - the client context to register on.
41
- * @param onChange - called whenever availability changes, so the router repaints.
42
- * @returns the handle the router and the auto-open path share.
43
- */
44
- export function registerNativeSidebar(ctx, onChange) {
45
- let registry;
46
- let navigation;
47
- const bridge = {
48
- available: () => registry !== undefined,
49
- open: () => {
50
- try {
51
- navigation?.openTab(KLINE_TAB_ID);
52
- }
53
- catch {
54
- // A host with no Session on screen has nothing to open into; the next
55
- // analysis result or the guide entry opens it then.
56
- }
57
- },
58
- };
59
- ctx.inject(['sidebarRightTabs', 'sidebarRight', 'slots'], scope => {
60
- scope.effect(() => {
61
- const tabs = scope.get('sidebarRightTabs');
62
- const column = scope.get('sidebarRight');
63
- const slots = scope.slots;
64
- if (tabs === undefined || column === undefined || slots === undefined)
65
- return () => { };
66
- const disposers = [];
67
- let disposeType;
68
- try {
69
- disposeType = tabs.register(nativeTabDefinition());
70
- disposers.push(slots.inject('sidebar.right.pane.tab', () => slots.register({
71
- name: 'sidebar.right.pane.tab',
72
- key: NATIVE_TAB_ID,
73
- inject: (sessionId) => ({ sessions: ctx.sessions, sessionId }),
74
- }, NativeKlineTabBody)));
75
- }
76
- catch (error) {
77
- // A half-registered type would show the host's empty-pane notice: back
78
- // both stages out and let the router choose another interface.
79
- for (const dispose of disposers.reverse())
80
- dispose();
81
- disposeType?.();
82
- console.error('[dsh-kline] native right sidebar registration failed:', error);
83
- return () => { };
84
- }
85
- registry = tabs;
86
- navigation = column;
87
- onChange();
88
- return () => {
89
- registry = undefined;
90
- navigation = undefined;
91
- for (const dispose of disposers.reverse())
92
- dispose();
93
- disposeType?.();
94
- onChange();
95
- };
96
- }, 'dsh-kline: native right sidebar tab');
97
- });
98
- return bridge;
99
- }
@@ -1,93 +0,0 @@
1
- export const KLINE_TAB_ID = 'ftshare-kline:chart';
2
- export const KLINE_TAB_TITLE_ZH = '非凸 K 线助手';
3
- export const KLINE_TAB_TITLE_EN = 'FtAI K-Line';
4
- // The tab belongs to the host interface. Keep its product label separate from
5
- // the internal package id, and follow the host/browser language.
6
- export function klineTabTitle(locale = globalThis.navigator?.language ?? '') {
7
- return /^zh(?:-|$)/i.test(locale) ? KLINE_TAB_TITLE_ZH : KLINE_TAB_TITLE_EN;
8
- }
9
- export function migrateKlineTabTitle(service, tab, sessionId) {
10
- if (tab.type !== KLINE_TAB_ID || !['K线分析 / K-line', 'K线分析', '非凸K线助手 / dsh_kline', KLINE_TAB_TITLE_ZH, KLINE_TAB_TITLE_EN].includes(tab.title ?? '')
11
- || !service.features?.includes('updateTab') || !service.features?.includes('stateSubscription')
12
- || typeof service.updateTab !== 'function' || typeof service.getSnapshot !== 'function')
13
- return;
14
- try {
15
- // updateTab is current-session-only in the public API. Never mutate a
16
- // foreign floating tab or a user-customized title while migrating labels.
17
- if (sessionId && service.getSnapshot()?.sessionId === sessionId)
18
- service.updateTab(tab.id, { title: klineTabTitle() });
19
- }
20
- catch { /* Older/disposed integrations keep their saved title harmlessly. */ }
21
- }
22
- export function isSidebarUsable(service) {
23
- // Some DSH Desktop builds expose the stable public methods through a
24
- // compatibility proxy but omit (or stale-cache) Better Sidebar's optional
25
- // feature list. The tab itself can still be registered and opened, so use
26
- // the callable public contract as the availability test. Optional helpers
27
- // below remain individually feature-gated.
28
- return Boolean(service && typeof service.registerTab === 'function' && typeof service.openTab === 'function');
29
- }
30
- // The framework persists open tabs across reloads. In Classic mode remove only
31
- // our old tab shells, otherwise it displays a misleading "plugin unavailable"
32
- // placeholder. Chart/workspace storage is separate and is never deleted here.
33
- export function cleanClassicTabs(service) {
34
- if (!service.features?.includes('stateSubscription') || typeof service.closeTab !== 'function'
35
- || typeof service.getSnapshot !== 'function' || typeof service.subscribeState !== 'function')
36
- return () => { };
37
- let stopped = false, pending = false;
38
- const schedule = () => {
39
- if (stopped || pending)
40
- return;
41
- pending = true;
42
- queueMicrotask(() => {
43
- pending = false;
44
- if (stopped)
45
- return;
46
- try {
47
- const snapshot = service.getSnapshot();
48
- const { sessionId, state } = snapshot ?? {};
49
- if (typeof sessionId !== 'string' || !sessionId || !state)
50
- return;
51
- const ids = new Set();
52
- const record = (value) => typeof value === 'object' && value !== null;
53
- const collect = (tab) => {
54
- if (record(tab) && tab.type === KLINE_TAB_ID && typeof tab.id === 'string' && tab.id)
55
- ids.add(tab.id);
56
- };
57
- // Layouts belong to another plugin and may contain older/incomplete
58
- // nodes. Iterate defensively, including protection against cycles.
59
- // Since Better Sidebar 0.19, DSH owns the right-sidebar layout.
60
- // Our registered tab can only be in Better Sidebar's workbench.
61
- const pendingNodes = [state.bottomSplits];
62
- const seen = new Set();
63
- while (pendingNodes.length) {
64
- const node = pendingNodes.pop();
65
- if (!record(node) || seen.has(node))
66
- continue;
67
- seen.add(node);
68
- if (node.kind === 'split' && Array.isArray(node.children))
69
- pendingNodes.push(...[...node.children].reverse());
70
- else if (Array.isArray(node.tabs))
71
- node.tabs.forEach(collect);
72
- }
73
- for (const id of ids) {
74
- try {
75
- service.closeTab(id, { sessionId });
76
- }
77
- catch { /* A stale tab must not block the remaining cleanup. */ }
78
- }
79
- }
80
- catch { /* Optional layout cleanup must never break the classic shell. */ }
81
- });
82
- };
83
- let unsubscribe;
84
- try {
85
- unsubscribe = service.subscribeState(schedule);
86
- }
87
- catch { /* Still attempt one initial cleanup. */ }
88
- schedule();
89
- return () => { stopped = true; try {
90
- unsubscribe?.();
91
- }
92
- catch { /* Service may already have been disposed. */ } };
93
- }
@@ -1,51 +0,0 @@
1
- import { UI_SEEN_KEY } from "./mode-preferences.js";
2
- export const ONBOARDING_KEY = 'dsh-kline:onboarding-version:v2';
3
- let existingUser;
4
- export function hasPreviousUsage(storage) {
5
- try {
6
- if (storage.getItem('dsh_kline_welcome_seen_v1') === '1')
7
- return true;
8
- for (let i = 0; i < storage.length; i++) {
9
- const key = storage.key(i) || '';
10
- if (key.startsWith('dsh-kline:conversation:') || key === 'dsh-kline.workspace.v1')
11
- return true;
12
- }
13
- }
14
- catch { }
15
- return false;
16
- }
17
- // Capture before the launcher writes any new conversation data.
18
- export function captureOnboarding(storage = globalThis.localStorage) {
19
- existingUser ??= hasPreviousUsage(storage);
20
- }
21
- export function onboardingKind(storage = globalThis.localStorage) {
22
- captureOnboarding(storage);
23
- return classifyOnboarding(storage, existingUser === true);
24
- }
25
- /**
26
- * Only a returning user gets a one-time notice.
27
- *
28
- * A fresh install gets no dialog at all: the chart opens straight into its
29
- * workspace, because the first-run welcome that used to pitch the FTShare key
30
- * is gone.
31
- */
32
- export function classifyOnboarding(storage, previousUsage) {
33
- try {
34
- if (storage.getItem(UI_SEEN_KEY))
35
- return 'none';
36
- return previousUsage ? 'upgrade' : 'none';
37
- }
38
- catch {
39
- return 'none';
40
- }
41
- }
42
- export function acknowledgeOnboarding(storage = globalThis.localStorage) {
43
- try {
44
- storage.setItem(UI_SEEN_KEY, '1');
45
- storage.setItem(ONBOARDING_KEY, '0.2.0');
46
- // Legacy marker: older builds keyed their first-run welcome on it, and it
47
- // still tells `hasPreviousUsage` that this browser has been used before.
48
- storage.setItem('dsh_kline_welcome_seen_v1', '1');
49
- }
50
- catch { }
51
- }
@@ -1,14 +0,0 @@
1
- // The update channel offers stable releases only. A stable release of the same
2
- // base version must still be offered to users running its release candidate.
3
- export function isNewerStableVersion(candidate, current) {
4
- const next = /^(\d+)\.(\d+)\.(\d+)$/.exec(candidate);
5
- const installed = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/.exec(current);
6
- if (!next || !installed)
7
- return false;
8
- for (let index = 1; index <= 3; index++) {
9
- const difference = Number(next[index]) - Number(installed[index]);
10
- if (difference)
11
- return difference > 0;
12
- }
13
- return Boolean(installed[4]);
14
- }