@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.
- package/README.md +59 -45
- package/README.zh.md +90 -0
- package/lib/agent/format.d.ts +1 -2
- package/lib/agent/format.d.ts.map +1 -1
- package/lib/agent/format.js +1 -8
- package/lib/agent/format.js.map +1 -1
- package/lib/agent/futures-tools.d.ts +9 -8
- package/lib/agent/futures-tools.d.ts.map +1 -1
- package/lib/agent/futures-tools.js +62 -43
- package/lib/agent/futures-tools.js.map +1 -1
- package/lib/agent/ledger-tools.d.ts +9 -0
- package/lib/agent/ledger-tools.d.ts.map +1 -0
- package/lib/agent/ledger-tools.js +117 -0
- package/lib/agent/ledger-tools.js.map +1 -0
- package/lib/agent/tools.d.ts +13 -1
- package/lib/agent/tools.d.ts.map +1 -1
- package/lib/agent/tools.js +74 -103
- package/lib/agent/tools.js.map +1 -1
- package/lib/client.js +34 -5
- package/lib/contract.d.ts +26 -1
- package/lib/contract.d.ts.map +1 -1
- package/lib/contract.js.map +1 -1
- package/lib/core/futures/engine.js +1 -1
- package/lib/core/futures/engine.js.map +1 -1
- package/lib/core/futures/ledger.d.ts.map +1 -1
- package/lib/core/futures/ledger.js +8 -1
- package/lib/core/futures/ledger.js.map +1 -1
- package/lib/core/ledger.d.ts.map +1 -1
- package/lib/core/ledger.js +10 -4
- package/lib/core/ledger.js.map +1 -1
- package/lib/core/migrations.d.ts +36 -0
- package/lib/core/migrations.d.ts.map +1 -0
- package/lib/core/migrations.js +141 -0
- package/lib/core/migrations.js.map +1 -0
- package/lib/core/types.d.ts +9 -0
- package/lib/core/types.d.ts.map +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/service/futures-rpc.d.ts.map +1 -1
- package/lib/service/futures-rpc.js +8 -0
- package/lib/service/futures-rpc.js.map +1 -1
- package/lib/service/futures-service.d.ts +21 -2
- package/lib/service/futures-service.d.ts.map +1 -1
- package/lib/service/futures-service.js +81 -3
- package/lib/service/futures-service.js.map +1 -1
- package/lib/service/paper-service.d.ts +18 -1
- package/lib/service/paper-service.d.ts.map +1 -1
- package/lib/service/paper-service.js +55 -1
- package/lib/service/paper-service.js.map +1 -1
- package/lib/service/rpc.d.ts.map +1 -1
- package/lib/service/rpc.js +8 -0
- package/lib/service/rpc.js.map +1 -1
- package/lib/store/event-store.d.ts +10 -0
- package/lib/store/event-store.d.ts.map +1 -1
- package/lib/store/event-store.js +45 -25
- package/lib/store/event-store.js.map +1 -1
- package/lib/store/futures-repo.d.ts +19 -1
- package/lib/store/futures-repo.d.ts.map +1 -1
- package/lib/store/futures-repo.js +108 -13
- package/lib/store/futures-repo.js.map +1 -1
- package/lib/store/port.d.ts +31 -0
- package/lib/store/port.d.ts.map +1 -1
- package/lib/store/repo.d.ts +26 -1
- package/lib/store/repo.d.ts.map +1 -1
- package/lib/store/repo.js +190 -12
- package/lib/store/repo.js.map +1 -1
- package/lib/store/snapshots.d.ts +56 -0
- package/lib/store/snapshots.d.ts.map +1 -0
- package/lib/store/snapshots.js +115 -0
- package/lib/store/snapshots.js.map +1 -0
- package/package.json +4 -9
- package/src/agent/format.ts +2 -9
- package/src/agent/futures-tools.ts +64 -46
- package/src/agent/ledger-tools.ts +125 -0
- package/src/agent/tools.ts +77 -105
- package/src/client/index.js +34 -5
- package/src/contract.ts +28 -0
- package/src/core/futures/engine.ts +1 -1
- package/src/core/futures/ledger.ts +8 -1
- package/src/core/ledger.ts +10 -4
- package/src/core/migrations.ts +152 -0
- package/src/core/types.ts +1 -0
- package/src/index.ts +2 -0
- package/src/service/futures-rpc.ts +8 -0
- package/src/service/futures-service.ts +87 -4
- package/src/service/paper-service.ts +60 -2
- package/src/service/rpc.ts +8 -0
- package/src/store/event-store.ts +41 -20
- package/src/store/futures-repo.ts +115 -13
- package/src/store/port.ts +32 -0
- package/src/store/repo.ts +190 -13
- package/src/store/snapshots.ts +141 -0
- package/node_modules/@dsh-ft/dsh-fft-ftshare/README.md +0 -73
- package/node_modules/@dsh-ft/dsh-fft-ftshare/catalog.json +0 -9762
- package/node_modules/@dsh-ft/dsh-fft-ftshare/catalog.meta.json +0 -7
- package/node_modules/@dsh-ft/dsh-fft-ftshare/catalog.txt +0 -250
- package/node_modules/@dsh-ft/dsh-fft-ftshare/cordis.patch.yml +0 -27
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/capabilities.d.ts +0 -47
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/capabilities.d.ts.map +0 -1
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/capabilities.js +0 -145
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/capabilities.js.map +0 -1
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/catalog-host.d.ts +0 -19
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/catalog-host.d.ts.map +0 -1
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/catalog-host.js +0 -31
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/catalog-host.js.map +0 -1
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/catalog.d.ts +0 -51
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/catalog.d.ts.map +0 -1
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/catalog.js +0 -60
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/catalog.js.map +0 -1
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/client.d.ts +0 -52
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/client.d.ts.map +0 -1
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/client.js +0 -149
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/client.js.map +0 -1
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/contract.d.ts +0 -122
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/contract.d.ts.map +0 -1
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/contract.js +0 -24
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/contract.js.map +0 -1
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/errors.d.ts +0 -93
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/errors.d.ts.map +0 -1
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/errors.js +0 -261
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/errors.js.map +0 -1
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/index.d.ts +0 -64
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/index.d.ts.map +0 -1
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/index.js +0 -160
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/index.js.map +0 -1
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/mask.d.ts +0 -66
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/mask.d.ts.map +0 -1
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/mask.js +0 -106
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/mask.js.map +0 -1
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/project.d.ts +0 -98
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/project.d.ts.map +0 -1
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/project.js +0 -326
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/project.js.map +0 -1
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/route.d.ts +0 -48
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/route.d.ts.map +0 -1
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/route.js +0 -90
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/route.js.map +0 -1
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/tools.d.ts +0 -31
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/tools.d.ts.map +0 -1
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/tools.js +0 -132
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/tools.js.map +0 -1
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/transport.d.ts +0 -53
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/transport.d.ts.map +0 -1
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/transport.js +0 -147
- package/node_modules/@dsh-ft/dsh-fft-ftshare/lib/transport.js.map +0 -1
- package/node_modules/@dsh-ft/dsh-fft-ftshare/package.json +0 -82
- package/node_modules/@dsh-ft/dsh-fft-settings/README.md +0 -385
- package/node_modules/@dsh-ft/dsh-fft-settings/cordis.patch.yml +0 -18
- package/node_modules/@dsh-ft/dsh-fft-settings/docs/compatibility-dsh-0.1.6-alpha.1.md +0 -58
- package/node_modules/@dsh-ft/dsh-fft-settings/docs/extension-service-design.md +0 -351
- package/node_modules/@dsh-ft/dsh-fft-settings/docs/extension-service-sequences.html +0 -545
- package/node_modules/@dsh-ft/dsh-fft-settings/docs/ftshare-settings-er.html +0 -139
- package/node_modules/@dsh-ft/dsh-fft-settings/docs/ftshare-settings-er.svg +0 -113
- package/node_modules/@dsh-ft/dsh-fft-settings/docs/ftshare-settings-results-er.html +0 -148
- package/node_modules/@dsh-ft/dsh-fft-settings/docs/ftshare-settings-results-er.svg +0 -122
- package/node_modules/@dsh-ft/dsh-fft-settings/docs/kline-integration.md +0 -258
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/agent.d.ts +0 -24
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/agent.js +0 -26
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/brand.d.ts +0 -53
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/brand.js +0 -50
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/client.d.ts +0 -8
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/client.js +0 -822
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/client.js.map +0 -1
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/contract.d.ts +0 -14
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/contract.js +0 -14
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/client-transport.d.ts +0 -15
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/client-transport.js +0 -31
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/contract.d.ts +0 -62
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/contract.js +0 -28
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/module-registry.d.ts +0 -54
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/module-registry.js +0 -68
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/rpc-core.d.ts +0 -69
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/rpc-core.js +0 -88
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/shell.d.ts +0 -59
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/shell.js +0 -28
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/styles.d.ts +0 -31
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/styles.js +0 -43
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/transport.d.ts +0 -19
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/core/transport.js +0 -80
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/default-preset.d.ts +0 -52
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/default-preset.js +0 -121
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/card.d.ts +0 -24
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/card.js +0 -39
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/client-api.d.ts +0 -4
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/client-api.js +0 -11
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/contract.d.ts +0 -69
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/contract.js +0 -24
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/host.d.ts +0 -17
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/host.js +0 -32
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/index.d.ts +0 -13
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/index.js +0 -12
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/logging.d.ts +0 -15
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/logging.js +0 -1
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/model.d.ts +0 -24
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/model.js +0 -105
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/probe.d.ts +0 -11
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/probe.js +0 -142
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/rpc.d.ts +0 -4
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/rpc.js +0 -17
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/service.d.ts +0 -21
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/service.js +0 -181
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/styles.d.ts +0 -9
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/api-key/styles.js +0 -24
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/archive.d.ts +0 -87
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/archive.js +0 -156
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/card.d.ts +0 -22
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/card.js +0 -107
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/client-api.d.ts +0 -4
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/client-api.js +0 -11
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/collector.d.ts +0 -91
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/collector.js +0 -258
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/config.d.ts +0 -70
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/config.js +0 -97
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/contract.d.ts +0 -130
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/contract.js +0 -67
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/export.d.ts +0 -92
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/export.js +0 -212
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/format.d.ts +0 -42
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/format.js +0 -172
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/home.d.ts +0 -18
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/home.js +0 -39
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/host.d.ts +0 -19
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/host.js +0 -139
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/index.d.ts +0 -12
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/index.js +0 -12
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/rpc.d.ts +0 -6
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/rpc.js +0 -27
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/styles.d.ts +0 -9
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/features/logs/styles.js +0 -13
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/guidance.d.ts +0 -41
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/guidance.js +0 -88
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/index.d.ts +0 -67
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/index.js +0 -50
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/rpc.d.ts +0 -10
- package/node_modules/@dsh-ft/dsh-fft-settings/lib/rpc.js +0 -10
- package/node_modules/@dsh-ft/dsh-fft-settings/package.json +0 -80
- package/node_modules/@dsh-ft/dsh-fft-settings/src/agent.ts +0 -31
- package/node_modules/@dsh-ft/dsh-fft-settings/src/brand.ts +0 -79
- package/node_modules/@dsh-ft/dsh-fft-settings/src/client.tsx +0 -21
- package/node_modules/@dsh-ft/dsh-fft-settings/src/contract.ts +0 -14
- package/node_modules/@dsh-ft/dsh-fft-settings/src/core/client-transport.ts +0 -37
- package/node_modules/@dsh-ft/dsh-fft-settings/src/core/contract.ts +0 -57
- package/node_modules/@dsh-ft/dsh-fft-settings/src/core/module-registry.ts +0 -102
- package/node_modules/@dsh-ft/dsh-fft-settings/src/core/rpc-core.ts +0 -107
- package/node_modules/@dsh-ft/dsh-fft-settings/src/core/shell.tsx +0 -81
- package/node_modules/@dsh-ft/dsh-fft-settings/src/core/styles.ts +0 -43
- package/node_modules/@dsh-ft/dsh-fft-settings/src/core/transport.ts +0 -82
- package/node_modules/@dsh-ft/dsh-fft-settings/src/default-preset.ts +0 -151
- package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/card.tsx +0 -77
- package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/client-api.ts +0 -12
- package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/contract.ts +0 -63
- package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/host.ts +0 -36
- package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/index.ts +0 -13
- package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/logging.ts +0 -15
- package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/model.ts +0 -63
- package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/probe.ts +0 -116
- package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/rpc.ts +0 -18
- package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/service.ts +0 -157
- package/node_modules/@dsh-ft/dsh-fft-settings/src/features/api-key/styles.ts +0 -24
- package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/archive.ts +0 -230
- package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/card.tsx +0 -169
- package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/client-api.ts +0 -20
- package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/collector.ts +0 -313
- package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/config.ts +0 -115
- package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/contract.ts +0 -149
- package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/export.ts +0 -274
- package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/format.ts +0 -188
- package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/home.ts +0 -43
- package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/host.ts +0 -153
- package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/index.ts +0 -12
- package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/rpc.ts +0 -29
- package/node_modules/@dsh-ft/dsh-fft-settings/src/features/logs/styles.ts +0 -13
- package/node_modules/@dsh-ft/dsh-fft-settings/src/guidance.ts +0 -114
- package/node_modules/@dsh-ft/dsh-fft-settings/src/index.ts +0 -59
- package/node_modules/@dsh-ft/dsh-fft-settings/src/rpc.ts +0 -10
- package/node_modules/@ftshare-lab/dsh-kline/docs/images/dsh-kline-tab-workspace.png +0 -0
- package/node_modules/@ftshare-lab/dsh-kline/docs/images/dsh-market.png +0 -0
- package/node_modules/@ftshare-lab/dsh-kline/docs/images/kline-news.png +0 -0
- package/node_modules/@ftshare-lab/dsh-kline/docs/images/kline-range-stats.png +0 -0
- package/node_modules/@ftshare-lab/dsh-kline/docs/images/kline-support.png +0 -0
- package/node_modules/@ftshare-lab/dsh-kline/docs/release-acceptance-v0.4.0.md +0 -46
- package/node_modules/@ftshare-lab/dsh-kline/lib/client/BetterSidebarTab.js +0 -65
- package/node_modules/@ftshare-lab/dsh-kline/lib/client/ClassicShell.js +0 -250
- package/node_modules/@ftshare-lab/dsh-kline/lib/client/KlineContent.js +0 -155
- package/node_modules/@ftshare-lab/dsh-kline/lib/client/PaperKlinePanel.js +0 -35
- package/node_modules/@ftshare-lab/dsh-kline/lib/client/canvas-panel.js +0 -58
- package/node_modules/@ftshare-lab/dsh-kline/lib/client/chart-apply.js +0 -73
- package/node_modules/@ftshare-lab/dsh-kline/lib/client/chart-context.js +0 -184
- package/node_modules/@ftshare-lab/dsh-kline/lib/client/chart-session-resolver.js +0 -61
- package/node_modules/@ftshare-lab/dsh-kline/lib/client/conversation.js +0 -66
- package/node_modules/@ftshare-lab/dsh-kline/lib/client/default-tab.js +0 -83
- package/node_modules/@ftshare-lab/dsh-kline/lib/client/embed.js +0 -29
- package/node_modules/@ftshare-lab/dsh-kline/lib/client/generated-view.js +0 -9673
- package/node_modules/@ftshare-lab/dsh-kline/lib/client/horizontal-lines.js +0 -19
- package/node_modules/@ftshare-lab/dsh-kline/lib/client/host-services.js +0 -1
- package/node_modules/@ftshare-lab/dsh-kline/lib/client/index.js +0 -50
- package/node_modules/@ftshare-lab/dsh-kline/lib/client/mode-preferences.js +0 -31
- package/node_modules/@ftshare-lab/dsh-kline/lib/client/native-sidebar-contract.js +0 -36
- package/node_modules/@ftshare-lab/dsh-kline/lib/client/native-sidebar.js +0 -99
- package/node_modules/@ftshare-lab/dsh-kline/lib/client/sidebar-integration.js +0 -93
- package/node_modules/@ftshare-lab/dsh-kline/lib/client/ui-onboarding.js +0 -51
- package/node_modules/@ftshare-lab/dsh-kline/lib/client/version.js +0 -14
- package/node_modules/@ftshare-lab/dsh-kline/lib/client.js.map +0 -1
- package/node_modules/@ftshare-lab/dsh-kline/screenshots.json +0 -7
- 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 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -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
|
-
}
|