@dsh-ft/dsh-fft-paper-trading 0.7.0 → 0.7.2

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 (122) hide show
  1. package/lib/client.js +9 -1
  2. package/package.json +2 -5
  3. package/src/client/index.js +8 -0
  4. package/node_modules/@ftshare-lab/dsh-kline/CHANGELOG.md +0 -564
  5. package/node_modules/@ftshare-lab/dsh-kline/LICENSE +0 -21
  6. package/node_modules/@ftshare-lab/dsh-kline/PROVENANCE.md +0 -13
  7. package/node_modules/@ftshare-lab/dsh-kline/README.en.md +0 -265
  8. package/node_modules/@ftshare-lab/dsh-kline/README.md +0 -281
  9. package/node_modules/@ftshare-lab/dsh-kline/chart_service.py +0 -686
  10. package/node_modules/@ftshare-lab/dsh-kline/config/basic-symbols.json +0 -570
  11. package/node_modules/@ftshare-lab/dsh-kline/config/dsh-kline.patch.yml +0 -4
  12. package/node_modules/@ftshare-lab/dsh-kline/config/dsh-tool-catalog.json +0 -3783
  13. package/node_modules/@ftshare-lab/dsh-kline/cordis.patch.yml +0 -33
  14. package/node_modules/@ftshare-lab/dsh-kline/core/__init__.py +0 -0
  15. package/node_modules/@ftshare-lab/dsh-kline/core/adjustment.py +0 -16
  16. package/node_modules/@ftshare-lab/dsh-kline/core/calc.py +0 -683
  17. package/node_modules/@ftshare-lab/dsh-kline/core/rows.py +0 -228
  18. package/node_modules/@ftshare-lab/dsh-kline/core/ta_engine.py +0 -99
  19. package/node_modules/@ftshare-lab/dsh-kline/lib/candle-sequence.js +0 -15
  20. package/node_modules/@ftshare-lab/dsh-kline/lib/chart-adjustment.js +0 -7
  21. package/node_modules/@ftshare-lab/dsh-kline/lib/chart-annotations.js +0 -33
  22. package/node_modules/@ftshare-lab/dsh-kline/lib/chart-applications.js +0 -171
  23. package/node_modules/@ftshare-lab/dsh-kline/lib/chart-context.js +0 -164
  24. package/node_modules/@ftshare-lab/dsh-kline/lib/chart-observation.js +0 -241
  25. package/node_modules/@ftshare-lab/dsh-kline/lib/chart-service-status.js +0 -82
  26. package/node_modules/@ftshare-lab/dsh-kline/lib/chart-source-status.js +0 -39
  27. package/node_modules/@ftshare-lab/dsh-kline/lib/chart-sources.js +0 -349
  28. package/node_modules/@ftshare-lab/dsh-kline/lib/client.js +0 -15445
  29. package/node_modules/@ftshare-lab/dsh-kline/lib/drawing-feedback.js +0 -252
  30. package/node_modules/@ftshare-lab/dsh-kline/lib/fibonacci.js +0 -18
  31. package/node_modules/@ftshare-lab/dsh-kline/lib/ftshare-settings-bridge.js +0 -159
  32. package/node_modules/@ftshare-lab/dsh-kline/lib/index.js +0 -279
  33. package/node_modules/@ftshare-lab/dsh-kline/lib/labeled-polyline.js +0 -17
  34. package/node_modules/@ftshare-lab/dsh-kline/lib/price-bands.js +0 -55
  35. package/node_modules/@ftshare-lab/dsh-kline/lib/price-series.js +0 -47
  36. package/node_modules/@ftshare-lab/dsh-kline/lib/price-sticks.js +0 -32
  37. package/node_modules/@ftshare-lab/dsh-kline/lib/types/candle-sequence.d.ts +0 -2
  38. package/node_modules/@ftshare-lab/dsh-kline/lib/types/chart-adjustment.d.ts +0 -2
  39. package/node_modules/@ftshare-lab/dsh-kline/lib/types/chart-annotations.d.ts +0 -4
  40. package/node_modules/@ftshare-lab/dsh-kline/lib/types/chart-applications.d.ts +0 -26
  41. package/node_modules/@ftshare-lab/dsh-kline/lib/types/chart-context.d.ts +0 -14
  42. package/node_modules/@ftshare-lab/dsh-kline/lib/types/chart-observation.d.ts +0 -8
  43. package/node_modules/@ftshare-lab/dsh-kline/lib/types/chart-service-status.d.ts +0 -22
  44. package/node_modules/@ftshare-lab/dsh-kline/lib/types/chart-source-status.d.ts +0 -47
  45. package/node_modules/@ftshare-lab/dsh-kline/lib/types/chart-sources.d.ts +0 -25
  46. package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/BetterSidebarTab.d.ts +0 -12
  47. package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/ClassicShell.d.ts +0 -4
  48. package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/KlineContent.d.ts +0 -37
  49. package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/PaperKlinePanel.d.ts +0 -15
  50. package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/canvas-panel.d.ts +0 -33
  51. package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/chart-apply.d.ts +0 -13
  52. package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/chart-context.d.ts +0 -23
  53. package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/chart-session-resolver.d.ts +0 -2
  54. package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/client-context.d.ts +0 -14
  55. package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/conversation.d.ts +0 -39
  56. package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/default-tab.d.ts +0 -3
  57. package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/embed.d.ts +0 -37
  58. package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/generated-view.d.ts +0 -2
  59. package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/horizontal-lines.d.ts +0 -1
  60. package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/host-services.d.ts +0 -55
  61. package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/index.d.ts +0 -4
  62. package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/mode-preferences.d.ts +0 -13
  63. package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/native-sidebar-contract.d.ts +0 -52
  64. package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/native-sidebar-register.d.ts +0 -46
  65. package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/native-sidebar-services.d.ts +0 -45
  66. package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/native-sidebar.d.ts +0 -47
  67. package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/sidebar-integration.d.ts +0 -12
  68. package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/ui-onboarding.d.ts +0 -13
  69. package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/version.d.ts +0 -1
  70. package/node_modules/@ftshare-lab/dsh-kline/lib/types/drawing-feedback.d.ts +0 -5
  71. package/node_modules/@ftshare-lab/dsh-kline/lib/types/fibonacci.d.ts +0 -5
  72. package/node_modules/@ftshare-lab/dsh-kline/lib/types/ftshare-settings-bridge.d.ts +0 -50
  73. package/node_modules/@ftshare-lab/dsh-kline/lib/types/index.d.ts +0 -26
  74. package/node_modules/@ftshare-lab/dsh-kline/lib/types/labeled-polyline.d.ts +0 -11
  75. package/node_modules/@ftshare-lab/dsh-kline/lib/types/price-bands.d.ts +0 -3
  76. package/node_modules/@ftshare-lab/dsh-kline/lib/types/price-series.d.ts +0 -5
  77. package/node_modules/@ftshare-lab/dsh-kline/lib/types/price-sticks.d.ts +0 -3
  78. package/node_modules/@ftshare-lab/dsh-kline/package.json +0 -136
  79. package/node_modules/@ftshare-lab/dsh-kline/requirements.txt +0 -6
  80. package/node_modules/@ftshare-lab/dsh-kline/scripts/bootstrap.sh +0 -5
  81. package/node_modules/@ftshare-lab/dsh-kline/scripts/dsh-bootstrap.mjs +0 -179
  82. package/node_modules/@ftshare-lab/dsh-kline/scripts/dsh-mcp-plugin.mjs +0 -27
  83. package/node_modules/@ftshare-lab/dsh-kline/scripts/run-dsh-kline.mjs +0 -655
  84. package/node_modules/@ftshare-lab/dsh-kline/scripts/run-dsh-kline.sh +0 -5
  85. package/node_modules/@ftshare-lab/dsh-kline/server.py +0 -1734
  86. package/node_modules/@ftshare-lab/dsh-kline/tools/__init__.py +0 -0
  87. package/node_modules/@ftshare-lab/dsh-kline/tools/annotations.py +0 -119
  88. package/node_modules/@ftshare-lab/dsh-kline/tools/baostock_source.py +0 -176
  89. package/node_modules/@ftshare-lab/dsh-kline/tools/calc.py +0 -39
  90. package/node_modules/@ftshare-lab/dsh-kline/tools/channel_candidates.py +0 -260
  91. package/node_modules/@ftshare-lab/dsh-kline/tools/channel_preview.py +0 -82
  92. package/node_modules/@ftshare-lab/dsh-kline/tools/channels.py +0 -104
  93. package/node_modules/@ftshare-lab/dsh-kline/tools/chart_applications.py +0 -204
  94. package/node_modules/@ftshare-lab/dsh-kline/tools/chart_context.py +0 -186
  95. package/node_modules/@ftshare-lab/dsh-kline/tools/chart_edits.py +0 -345
  96. package/node_modules/@ftshare-lab/dsh-kline/tools/chart_functions.py +0 -466
  97. package/node_modules/@ftshare-lab/dsh-kline/tools/chart_indicators.py +0 -63
  98. package/node_modules/@ftshare-lab/dsh-kline/tools/chart_measurements.py +0 -84
  99. package/node_modules/@ftshare-lab/dsh-kline/tools/chart_source_status.py +0 -32
  100. package/node_modules/@ftshare-lab/dsh-kline/tools/chart_sources.py +0 -31
  101. package/node_modules/@ftshare-lab/dsh-kline/tools/draw.py +0 -394
  102. package/node_modules/@ftshare-lab/dsh-kline/tools/drawing_feedback.py +0 -45
  103. package/node_modules/@ftshare-lab/dsh-kline/tools/drawing_interaction.py +0 -117
  104. package/node_modules/@ftshare-lab/dsh-kline/tools/drawing_verification.py +0 -141
  105. package/node_modules/@ftshare-lab/dsh-kline/tools/fetch.py +0 -4681
  106. package/node_modules/@ftshare-lab/dsh-kline/tools/fibonacci.py +0 -83
  107. package/node_modules/@ftshare-lab/dsh-kline/tools/foreign_daily.py +0 -185
  108. package/node_modules/@ftshare-lab/dsh-kline/tools/free_sources.py +0 -483
  109. package/node_modules/@ftshare-lab/dsh-kline/tools/lines.py +0 -91
  110. package/node_modules/@ftshare-lab/dsh-kline/tools/pivots.py +0 -60
  111. package/node_modules/@ftshare-lab/dsh-kline/tools/polylines.py +0 -125
  112. package/node_modules/@ftshare-lab/dsh-kline/tools/price_bands.py +0 -165
  113. package/node_modules/@ftshare-lab/dsh-kline/tools/price_series.py +0 -162
  114. package/node_modules/@ftshare-lab/dsh-kline/tools/price_sticks.py +0 -114
  115. package/node_modules/@ftshare-lab/dsh-kline/tools/range_candidates.py +0 -170
  116. package/node_modules/@ftshare-lab/dsh-kline/tools/rectangles.py +0 -76
  117. package/node_modules/@ftshare-lab/dsh-kline/tools/regression_channels.py +0 -87
  118. package/node_modules/@ftshare-lab/dsh-kline/tools/ta_functions.py +0 -228
  119. package/node_modules/@ftshare-lab/dsh-kline/tools/trend_lines.py +0 -106
  120. package/node_modules/@ftshare-lab/dsh-kline/tools/watchlist.py +0 -149
  121. package/node_modules/@ftshare-lab/dsh-kline/view/ft-logo.jpg +0 -0
  122. package/node_modules/@ftshare-lab/dsh-kline/view/vendor/klinecharts.min.js +0 -7
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 FTShare-Lab
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,13 +0,0 @@
1
- # Provenance
2
-
3
- The standalone MCP server includes adapted OHLCV normalization, FTShare provider,
4
- and deterministic indicator code originally developed in the MIT-licensed
5
- `ft-kline-view` project. The code is maintained in this repository so users do
6
- not need another MCP server or checkout at runtime.
7
-
8
- The copied modules were imported from the local `ft-kline-view` release line at
9
- version `0.1.55` and then adapted for the smaller dsh-specific tool surface.
10
- The interactive frontend, vendored `klinecharts` bundle, and logo are copied
11
- under `view/` and compiled into the native DSH sidebar. The browser code was
12
- adapted to same-origin session APIs; its MCP Apps handshake and original host
13
- runtime dependency were removed.
@@ -1,265 +0,0 @@
1
- # Nonconvex K-Line Assistant / FT K-Line
2
-
3
- [简体中文](README.md) | English
4
-
5
- [![Cross-platform tests](https://github.com/FTShare-Lab/dsh_kline/actions/workflows/install.yml/badge.svg?branch=main)](https://github.com/FTShare-Lab/dsh_kline/actions/workflows/install.yml) [![Latest release](https://img.shields.io/github/v/release/FTShare-Lab/dsh_kline?label=Release)](https://github.com/FTShare-Lab/dsh_kline/releases) [![Python 3.11+](https://img.shields.io/badge/Python-3.11%2B-3776AB?logo=python&logoColor=white)](#get-started-with-dsh) [![MIT License](https://img.shields.io/github/license/FTShare-Lab/dsh_kline)](LICENSE)
6
-
7
- **Supports DeepSeek Harness and Codex.** The DSH plugin is `dsh_kline`; the Codex plugin is `ft-kline`. Both support natural-language K-line analysis and guarded drawing in their desktop chart. Codex in the desktop app has an interactive chart; Codex CLI returns market data, indicators, and structured analysis without an interactive chart.
8
-
9
- > Quotes and technical analysis are for research and education only, not investment advice.
10
-
11
- [Features](#what-it-helps-you-do) · [Use with Codex](#use-with-codex) · [Install DSH](#get-started-with-dsh) · [Drawing preview](#preview) · [Drawing tools](#drawing-through-chat-and-the-workbench) · [Data sources](#quotes-and-data-sources)
12
-
13
- | Environment | Chart and manual drawing | Natural-language drawing | Market data, indicators, analysis |
14
- | --- | --- | --- | --- |
15
- | DeepSeek Harness Web | Yes | Yes | Yes |
16
- | Codex desktop | Yes, in an app card | Yes, after opening the current chart session | Yes |
17
- | Codex CLI | No interactive chart | No chart drawing | Yes, as structured results |
18
-
19
- The Codex plugin is currently **v0.6.7**, available through this repository's public **FTShare GitHub marketplace**. It is not listed in the official public plugin directory. DSH retains its existing installation path. The DSH screenshots and persistent-watchlist description below apply to DSH Web; see [Codex setup and differences](#use-with-codex) for the separate plugin.
20
-
21
- ## What it helps you do
22
-
23
- - **Start with a sentence**: ask for a chart, a trend read, or an indicator analysis in natural language.
24
- - **Explore on your own**: open the K-line workspace, search a name or ticker, and switch among daily, weekly, monthly, quarterly, yearly, and available intraday views.
25
- - **Read trend and momentum**: use MA, volume, MACD, KDJ, RSI, BOLL, ATR, and VWAP.
26
- - **Put your analysis on the chart**: create horizontal/trend lines, parallel channels, range boxes, Fibonacci retracements, and ABC polylines by chat or point selection. Preview first; save only when the result looks right.
27
- - **Explore TA-Lib**: search and run all 201 TA-Lib 0.8.2 functions read-only on the loaded chart. Only selected SMA, EMA, and BBANDS results are directly drawable in this release; the other functions are not advertised as chart objects.
28
- - **Find price areas**: identify support and resistance, or draw and save your own levels and notes.
29
- - **Compare and review**: overlay indices or symbols, then select a period to inspect return, range, drawdown, and activity.
30
- - **Add context**: use Market, Sectors, News, Company, and Dragon & Tiger List views for indices, sector rankings, capital-flow events, news, company profiles, fundamentals, and ownership data.
31
- - **Build a watchlist**: save symbols, create or rename groups, sort, import, and open several at once. Watchlists stay in your current browser.
32
-
33
- ## Preview
34
-
35
- Live natural-language example: DeepSeek screened the watchlist for an ABC **candidate** in Wolong Electric, checked the four 0/A/B/C anchors against candles, and used the plugin to draw them. This unedited full-page capture shows the conversation, application result, and visible chart together. The host interprets the pattern; a rules-based candidate is not a verified Elliott-wave conclusion.
36
-
37
- ![Full DSH Web page: DeepSeek checks four ABC candidate anchors for Wolong Electric while the daily chart displays the corresponding polyline and labels](docs/images/natural-language-abc-wolong-2026-10-27.png)
38
-
39
- In the same chart, a follow-up natural-language request adds a descending channel. DeepSeek checks its three-anchor geometry and price deviations; the plugin applies it as a separate object while preserving the ABC labels. The lines are visible, but their trading relevance still requires independent judgment.
40
-
41
- ![Full DSH Web page: DeepSeek explains the descending channel's anchors and deviations while the daily chart shows both the channel and ABC labels](docs/images/natural-language-descending-channel-wolong-2026-10-27.png)
42
-
43
- ## Use with Codex
44
-
45
- The Codex plugin is `ft-kline`, available from the **FTShare** marketplace (`ftshare`). Add the GitHub source once, install the plugin, and use the same source for updates. No ZIP download or source build is required. This is a project-maintained marketplace, not a listing in OpenAI's official public plugin directory.
46
-
47
- ### Install and verify
48
-
49
- 1. Install Git, Node.js **22.19+**, Python **3.11+**, and a Codex client supporting plugins. Enable Python Launcher on Windows; Git Bash and WSL are unnecessary.
50
- 2. Run these commands. The first adds the source and follows CI-validated `main`; the second installs and enables the plugin:
51
-
52
- ```bash
53
- codex plugin marketplace add FTShare-Lab/dsh_kline --ref main
54
- codex plugin add ft-kline@ftshare
55
- ```
56
-
57
- 3. Reopen Codex and ask for a daily chart and its data source. During first-time preparation, ask to check FT K-Line runtime status. Desktop users can expand the chart card, search symbols and use the drawing workbench; CLI returns data and analysis.
58
-
59
- After adding the source, you can also reopen the desktop app and select **FTShare → FT K-Line** in the Plugins page. Inspect the source and available plugins with:
60
-
61
- ```bash
62
- codex plugin marketplace list
63
- codex plugin list --marketplace ftshare --available --json
64
- ```
65
-
66
- ### Updates and migration
67
-
68
- Refresh the existing source, install its current plugin version, then reopen Codex:
69
-
70
- ```bash
71
- codex plugin marketplace upgrade ftshare
72
- codex plugin add ft-kline@ftshare
73
- ```
74
-
75
- If you previously installed `ft-kline@ftshare-local` from a ZIP, disable that old installation in the Plugins page before enabling `ft-kline@ftshare`, so two sources do not expose duplicate tools. The GitHub source needs access to GitHub; first launch also downloads Python dependencies.
76
-
77
- ### Install a fixed release ZIP
78
-
79
- To stay on a fixed release, download `ft-kline-v0.6.7.zip` and its SHA-256 from the [v0.6.7 release](https://github.com/FTShare-Lab/dsh_kline/releases/tag/v0.6.7), verify the hash, and extract to a permanent folder. Replace the quoted path below with that absolute folder path:
80
-
81
- ```bash
82
- codex plugin marketplace add "/absolute/path/ft-kline-v0.6.7"
83
- codex plugin add ft-kline@ftshare-local
84
- ```
85
-
86
- Reopen Codex to use it. The ZIP source is `ftshare-local`, separate from the public GitHub source `ftshare`. DSH retains its `dsh-kline-v0.6.7.tgz` package and the installation method below.
87
-
88
- ### First launch and runtime modes
89
-
90
- First use finds Python and installs dependencies automatically, which can take several minutes. The Node entry completes the handshake and exposes the **complete catalog on the first tools/list**, plus preloadable chart resources. It does not depend on catalog-change notifications. Check `ft_kline_runtime_status` while preparing. Ordinary calls wait briefly, then return `runtime_preparing` if necessary; rejected edits never execute later. Once ready, retry the original request without refreshing tools or reopening the chat. Logs are in `~/.cache/ft-kline/bootstrap.log` or `%LOCALAPPDATA%\ft-kline\bootstrap.log` on Windows.
91
-
92
- Restart Codex once after upgrading from v0.6.1 to replace its previous status-only startup snapshot. Then request a daily chart directly. Runtime readiness, data delivery and a visibly rendered native chart are separate acceptance checks; a fallback visualization does not satisfy native-plugin acceptance.
93
-
94
- Default `auto` mode checks the host's declared MCP Apps HTML capability. Supporting hosts get interactive charts and guarded edits; other hosts, including CLI, get structured data and analysis without chart resources or drawing writes. Advanced integrations can explicitly set `FT_KLINE_CLIENT=desktop` or `cli`.
95
-
96
- Chart edits follow `get_chart_context → prepare_chart_edit → apply_chart_edit → get_chart_edit_status`. Server commits, UI receipts and visual verification remain separate.
97
-
98
- ### Reuse an FTShare key
99
-
100
- Symbol discovery and quote access are separate. v0.6.7 adds a keyless Tencent HK/US daily fallback: HK supports unadjusted, forward and backward adjustment; US supports unadjusted and forward adjustment. Volumes remain historical session shares. Public-source coverage is bounded; see the [data contract](docs/free-foreign-daily.md). See the [key-less capability and evaluation notes](docs/anonymous-market-support.md); fixed release archives retain their release's behavior.
101
-
102
- Credential priority is: **plugin-process `FTSHARE_API_KEY` → explicitly configured `FTSHARE_API_KEY_FILE` → temporary App-session key**. An export in an unrelated terminal is not automatically visible to the desktop app.
103
-
104
- The selected file is reread before provider requests and is never modified or deleted by the plugin. Use JSON `{"version":1,"api_key":"your key"}`. macOS/Linux require owner-only permissions (`chmod 600`); symbolic links are rejected. Status reports only `environment`, `external_file`, `session` or `none`, never the key or path. Codex does not discover DSH credentials or scan `.env`, shell profiles, keychains or other apps; sharing a file requires explicitly configuring its path.
105
-
106
- Without a key, supported A-share, HK and US daily-history and index fallbacks remain available. Chart state, results, watchlists and App-entered keys stay in connection memory until the last view closes, disconnect, or 30 idle minutes. User-managed environment/file credentials are not deleted when a chart closes. DSH persistent watchlists are not inherited.
107
-
108
- See the [v0.6.7 release notes](docs/release-notes-v0.6.7.md) and [acceptance checklist](docs/release-acceptance-v0.6.7.md) for verification and remaining manual desktop checks.
109
-
110
- ## Get started with DSH
111
-
112
- v0.6.5 adds an optional chart-panel mounting interface for host developers, with external symbol and theme updates. Canvas and paper-trading panels require host integration; see the [embedding contract](docs/embedding.md).
113
-
114
- ### 1. Install and enable
115
-
116
- Find `dsh_kline` in the DeepSeek Harness plugin marketplace. If the catalog has not refreshed yet, install directly from GitHub:
117
-
118
- ```bash
119
- dsh plugin --profile web add github:FTShare-Lab/dsh_kline
120
- ```
121
-
122
- The first launch prepares its runtime automatically. Later, update from the marketplace or Settings when a new version is available.
123
-
124
- The plugin supports macOS, Linux, and native Windows. Install a working DSH Web host and Python 3.11 or newer first. On Windows, use the [python.org installer](https://www.python.org/downloads/windows/) with the Python Launcher enabled. Git Bash and WSL are not required. First-launch details are stored in `dsh_kline/bootstrap.log` under the user cache directory; the Windows default is `%LOCALAPPDATA%\dsh_kline\bootstrap.log`.
125
-
126
- ![Install and update dsh_kline from the plugin marketplace](docs/images/dsh-market.png)
127
-
128
- ### 2. Choose either entry point
129
-
130
- **Ask AI** in a conversation, for example:
131
-
132
- - `Show the K-line chart for Zijin Mining and its trend over the last month`
133
- - `Show Tencent's daily chart and mark support and resistance`
134
- - `Analyze NVIDIA's volume, MACD, and RSI over the past month`
135
- - `What recent news and fundamentals should I know about this company?`
136
- - `Draw a blue level at 1300 on the current chart, then change that object to green`
137
- - `Propose three anchors for a descending channel; explain the deviation and wait for my confirmation`
138
- - `Screen my watchlist for ABC candidates; verify one symbol's 0/A/B/C pivots on its daily chart before drawing, and tell me whether C is confirmed`
139
-
140
- **Open the workspace directly**: click the K button on the right, or choose **非凸 K 线助手 / dsh_kline** from the `+` menu where workspace Tabs are available. Search by name or ticker; exchange suffixes are not required.
141
-
142
- Both entry points can operate on the same new drawing objects in the active chart. In the chart toolbar, **Draw** opens the drawing workbench: choose a tool, click candles or enter parameters, preview, then confirm. Conversations retain separate chart states; watchlists remain user-level data.
143
-
144
- ## Using the chart
145
-
146
- 1. Search for a company or ticker at the top.
147
- 2. Pick a time range and candle timeframe. Intraday availability depends on the market and data entitlement.
148
- 3. Enable the indicators you need, then pan, zoom, or use the crosshair for detail.
149
- 4. Select **Key levels** for support and resistance, or **Draw** to choose a drawing tool, pick anchors or enter parameters, and save the preview. Manage your own price lines under **Levels**.
150
- 5. Click two candles in sequence to review return, range, drawdown, and trading activity for that interval.
151
- 6. Select the star beside a symbol to add it to a watchlist.
152
-
153
- Where a **UI** menu is available, choose Automatic, Classic sidebar, or workspace Tab. Automatic uses the best interface your current Harness supports; when Tabs are unavailable, the regular K-line sidebar continues to work.
154
-
155
- ### Sidebar compatibility
156
-
157
- DeepSeek Harness provides its own right sidebar, so **Better Sidebar is not required** to open the K-line sidebar. When a compatible Better Sidebar is installed, the plugin can also open the chart as a workspace Tab. This is an optional UI integration, not a requirement for quotes, indicators, or drawing. Use **UI** to choose Automatic, sidebar, or Tab; Automatic selects from the interface capabilities exposed by the current host. Installing Better Sidebar alone does not mean every version and layout has been validated.
158
-
159
- ## Quotes and data sources
160
-
161
- FTShare is the default optional source. After you configure an API key, the plugin exposes the quote, intraday, news, and company-data capabilities available to your account. Availability differs by market and plan.
162
-
163
- Only unadjusted (`none`) single-session one-minute requests for regular A-share stocks prefer FTShare's raw realtime feed. Forward/backward requests (including qfq/hfq) use history with the matching `adjust_kind`; failure never silently falls back to raw realtime rows. Indices, ETFs and multi-session history retain their applicable endpoints. Full-session returns and adjustment-isolated caching are unchanged; routing is not independent verification of vendor-adjusted prices.
164
- Explicit source minute size survives ingestion, local redraw and workspace state. Missing/invalid metadata stays unknown; it is not inferred from timestamp spacing, UI labels or the previous symbol. Unconfirmed sources still cannot authorize guarded drawing.
165
-
166
- The plugin reuses FTShare credentials in this order: an `FTSHARE_API_KEY` already injected into the current DSH service, an explicitly configured `FTSHARE_API_KEY_FILE`, a Key saved in the DSH FTShare settings, and a local credential previously saved by this plugin. If the key is already available to the process that starts DSH, it is used automatically. Installing the FTShare SDK alone, or storing a key in another app's private configuration, is not enough for the plugin to read it.
167
-
168
- When the DSH FTShare settings plugin is installed, the host publishes its Key to the MCP server, which re-reads it before every request — so adding, rotating, or clearing the Key in the settings page needs no dsh restart. That Key belongs to the settings page; this plugin never displays or clears it.
169
-
170
- For safety, the plugin never scans `.env` files, shell configuration, keychains, or other apps' configuration files, and never displays a key or path. **Settings → Data source** identifies the active source; use **Manage FTShare configuration** to paste and test a replacement key, either for the current session or saved locally for future launches.
171
-
172
- Theme and language follow the DSH host by default. **Settings → Theme/Language** also offers manual choices and a way back to **Follow host (default)**.
173
-
174
- [FTShare's free-plan endpoints](https://market.ft.tech/gateway/doc/p/pb8eizu3) still require a registered API key. Without a key, some historical daily A-share bars can use BaoStock, HK/US daily bars can use Tencent, and selected broad-market indices have separate free fallbacks. Intraday bars, news and other capabilities still depend on source coverage and permissions. Existing valid OHLCV data, including rows supplied by the host, can still drive local indicators and drawing. The UI reports the applicable source or error when data is rate-limited, unavailable, or outside the account's entitlement.
175
-
176
- ## Frequently asked questions
177
-
178
- **Why is an intraday chart unavailable?**
179
- Intraday access depends on the symbol's market, your account plan, and the source's currently supported coverage. Test the connection in Data source first. Daily, weekly, and monthly views do not require the intraday entitlement, but individual-stock candles still need a working data source; FTShare's free plan requires an API key too.
180
-
181
- **What if the first launch fails on Windows?**
182
-
183
- Inspect `%LOCALAPPDATA%\dsh_kline\bootstrap.log`. From v0.6.4, dependency upgrades reuse a working venv; rebuilding also tries its recorded base interpreter and Desktop's bundled standard Python. Trimmed distributions lacking venv/ensurepip still need a standard Python 3.11+ installation. Check `py -3.11 --version` (newer versions work), or set `DSH_KLINE_PYTHON` to the full `python.exe` path before starting DSH. Correcting the configuration invalidates the old retry delay. Nested bundles no longer need a profile-root K-line package, but bundles pinning an older plugin must update it. DSH installation and Windows sandbox issues remain host-level concerns.
184
-
185
- **Why do two conversations show different charts?**
186
- This is intentional: each chart belongs to its conversation, so an analysis in one conversation cannot replace another's chart. Search or start a new analysis in the other conversation when needed.
187
-
188
- **Why can data differ slightly from another platform?**
189
- Quotes can be delayed and may differ with adjustment policy, exchange conventions, market-close state, and upstream services. Use appropriately licensed feeds for commercial, high-frequency, or latency-sensitive work.
190
-
191
- ## For AI and developers
192
-
193
- ### Drawing through chat and the workbench
194
-
195
- On a source-checked current chart, the host can interpret a request and use the plugin's calculate → prepare → apply → verify flow. The workbench exposes the same protected objects for manual selection, preview, and editing. Selected families are horizontal levels, two-anchor trend segments, three-anchor finite parallel channels, rectangular ranges, two-anchor Fibonacci retracements, manually supplied or host-proposed-and-checked ABC anchors, and standalone SMA/EMA lines or BOLL three-line bands. Names, four colors, channel midlines, and rectangle fills are supported. The plugin draws ABC labels; **it does not automatically recognize Elliott waves**, and candidates are not definitive conclusions.
196
-
197
- Try “draw a blue level at 31.2 called support”, “move support to 30.8; leave everything else”,
198
- or “propose a descending channel with three anchors and explain deviations; wait for approval”.
199
-
200
- The host interprets language, analyzes candles and selects anchors. The plugin observes,
201
- measures, executes and reports; it does not embed another AI or replay predefined drawing skills.
202
- Explicit parameters may execute directly; proposal-first requests must wait for approval.
203
- Host explanations and professional anchor selection can be wrong and require user judgement.
204
-
205
- Foundation scope and limitations:
206
-
207
- - Daily/weekly paths are the main acceptance scope. Anchors must match actual loaded bars.
208
- The plugin does not guess missing dates, snap anchors or fetch extra candles to repair edits.
209
- - Trend segments and channels are finite, with no automatic extension or logarithmic geometry.
210
- Channels and rectangles retain their creation interval.
211
- - Guarded edits target stable IDs without resetting candles, indicators or the viewport.
212
- Manual drawings, automatic annotations and AI objects remain separate.
213
- - Confirmed drawings can restore and be edited after browser refresh within the same host run.
214
- Conversations are isolated. Returning to a conversation restores its last confirmed drawing
215
- checkpoint, **not necessarily its last manually selected interval, range or viewport**.
216
- - Workbench point selection and form editing are supported; AI mouse dragging, undo, cross-process old-chart editing and complete automatic failure
217
- recovery are not supported. Unknown outcomes stop automatic retries.
218
- - **Clear drawings and annotations** asks for confirmation, then removes AI objects,
219
- analysis annotations, manual drawings, and custom levels for the current symbol and interval.
220
- Indicators and alerts remain. Request an exact AI target when you want to delete only one object.
221
- - An object may be outside the visible time/price range. Object state and application receipts
222
- do not prove screen pixels, professional pattern quality or vendor quote correctness.
223
- - Minute availability depends on source/permissions; not all markets, minute sizes or operation combinations are accepted. Channels, boxes and ABC labels are not automatically recognized professional patterns. Chan analysis is not included. The 201 TA-Lib functions are primarily read-only; only the selected SMA/EMA/BBANDS outputs have a guarded drawing conversion.
224
-
225
- Host integration uses `get_chart_context → prepare_chart_edit → apply_chart_edit → get_chart_edit_status`.
226
- Read fresh context after approval and verify against independently retained approved parameters.
227
- A `context_ref` is not a `chart_session`. Read-only `preview_chart_channel` and `verify_chart_drawings`
228
- measure geometry/check parameters; neither selects patterns or grants drawing permission.
229
- Legacy per-family tools manipulate explicit snapshots, not the guarded live-chart workflow.
230
-
231
- Run `pnpm build:sidebar` and `pnpm test` for the build and complete Node/Python regression suite.
232
- See the [v0.5.0 candidate acceptance notes](docs/release-acceptance-v0.5.0.md) for scope, evidence, and remaining release gates. The full [function guide](docs/chart-functions.md) separates read-only calculations from drawable results.
233
- First-time automatic dependency preparation needs network access and may take several minutes.
234
-
235
- ### Host-provided Python runtime
236
-
237
- Ordinary installs default to `DSH_KLINE_RUNTIME_MODE=auto`, preserving existing Python/venv selection and dependency preparation. Desktop applications, containers, and other hosts can set these variables before starting DSH:
238
-
239
- | Environment variable | Meaning |
240
- | --- | --- |
241
- | `DSH_KLINE_PACKAGE_ROOT` | Optional absolute plugin package directory; otherwise resolved beside the plugin module, including nested installs. |
242
- | `DSH_KLINE_PYTHON` | Path to the Python interpreter provided by the host. |
243
- | `DSH_KLINE_RUNTIME_MODE` | `auto` (default) or `external`. |
244
-
245
- `external` requires Python 3.11+ with the required dependencies already available. It only validates and launches the service: no venv creation, dependency installation, or interpreter fallback. The host must repair failures. This mode rejects `DSH_KLINE_VENV`, `--prepare-project`, and `--bootstrap-runtime`. `DSH_KLINE_DEFER_BOOTSTRAP` does not trigger background installation in this mode.
246
-
247
- `DSH_KLINE_PYTHON` must identify the executable file (`python.exe` on Windows), not its directory. Automatic preparation distinguishes `PYTHON_NOT_FOUND`, `PYTHON_VERSION_TOO_OLD`, `PYTHON_EXECUTION_FAILED`, `PYTHON_VENV_UNAVAILABLE`, `PYTHON_DEPENDENCY_INSTALL_FAILED`, and `PYTHON_IMPORT_CHECK_FAILED`; an unusable Windows Store redirector is `PYTHON_STORE_ALIAS`. Candidate paths and outcomes are logged locally, without keys or a dump of the parent environment.
248
-
249
- In `external` mode, the host owns the interpreter, dependency search paths, and isolation settings (such as `PYTHONPATH`, `PYTHONNOUSERSITE`, or Windows embedded Python's `._pth`); no other interpreter is discovered. `auto` mode uses the bounded discovery and repair described above. Set `DSH_KLINE_CHART_PORT=0` for a dynamic port. The MCP patch explicitly forwards runtime variables without changes to DSH core.
250
-
251
- ## Updates and license
252
-
253
- See [Releases](https://github.com/FTShare-Lab/dsh_kline/releases) for version history. This project is released under the [MIT License](LICENSE); frontend provenance is in [PROVENANCE.md](PROVENANCE.md).
254
-
255
- Maintainers changing tools, annotations, resources or the App bridge must regenerate the packaged catalog with `python scripts/generate-codex-catalog.py`; `--check` and regression tests detect stale catalogs.
256
-
257
- The public `marketplace/ft-kline/` snapshot is generated from the same Codex package allowlist. After editing source, plugin manifests or README files, run `pnpm sync:codex-marketplace` and commit the generated files. CI runs `pnpm verify:codex-marketplace` and independently starts the directory in Desktop and CLI modes. Do not edit generated files directly; see [marketplace maintenance](marketplace/README.md).
258
-
259
- ### DSH startup diagnostics
260
-
261
- MCP discovery remains connected while Python is prepared; `dsh_kline_runtime_status` reports `preparing`, `recovering`, or `ready`. Backend restarts never replay operations with unknown outcomes. Chart registration retries without terminating other MCP tools.
262
-
263
- Request `/dsh-kline/healthz` on the current DSH Web origin: 200 confirms the locator and HTTP backend instance agree; 503 identifies the failure. It does not check provider permissions or MCP tool execution. Historical `/dsh-kline/session?session=…` snapshots are not a health check. Use the locator's actual service port rather than assuming 8765.
264
-
265
- Dependency logs remain in `bootstrap.log`; backend stderr is persisted to `logs/backend-<host_pid>.log` with one `.previous` rotation at approximately 1 MiB. The default cache is `~/.cache/dsh_kline` on macOS/Linux (honoring `XDG_CACHE_HOME`) or `%LOCALAPPDATA%\dsh_kline` on Windows. `DSH_KLINE_CACHE_DIR` overrides it; `DSH_KLINE_RUNTIME_DIR` independently overrides runtime files. Health responses never expose the service token.
@@ -1,281 +0,0 @@
1
- # 非凸 K 线助手 / FT K-Line
2
-
3
- 简体中文 | [English](README.en.md)
4
-
5
- [![跨平台测试](https://github.com/FTShare-Lab/dsh_kline/actions/workflows/install.yml/badge.svg?branch=main)](https://github.com/FTShare-Lab/dsh_kline/actions/workflows/install.yml) [![最新发布](https://img.shields.io/github/v/release/FTShare-Lab/dsh_kline?label=Release)](https://github.com/FTShare-Lab/dsh_kline/releases) [![Python 3.11+](https://img.shields.io/badge/Python-3.11%2B-3776AB?logo=python&logoColor=white)](#开始使用-dsh-版) [![MIT License](https://img.shields.io/github/license/FTShare-Lab/dsh_kline)](LICENSE)
6
-
7
- **支持 DeepSeek Harness 和 Codex。** DSH 插件名为 `dsh_kline`;Codex 插件名为 `ft-kline`。两者都能用自然语言分析 K 线,并在桌面图表中创建和修改受控绘图。Codex 桌面版提供交互图表;Codex CLI 提供行情、指标和结构化分析,不显示交互图表。
8
-
9
- > 行情与技术分析用于研究和学习,不构成投资建议。
10
-
11
- [功能](#它能帮你做什么) · [Codex 使用与安装](#在-codex-中使用) · [DSH 安装与入口](#开始使用-dsh-版) · [自然语言绘图演示](#预览) · [绘图能力](#绘图对话与工作台共用一个对象流程) · [数据源](#行情与数据源)
12
-
13
- | 运行环境 | 图表与手动绘图 | 自然语言绘图 | 行情、指标与分析 |
14
- | --- | --- | --- | --- |
15
- | DeepSeek Harness Web | 支持 | 支持 | 支持 |
16
- | Codex 桌面版 | 支持,图表在应用卡片中打开 | 支持,需先取得当前图表会话 | 支持 |
17
- | Codex CLI | 无交互图表 | 无图表落图 | 支持,返回结构化结果 |
18
-
19
- Codex 版目前为 **v0.6.7**,可添加本仓库的公开 **FTShare GitHub 插件源**后安装;尚未上架官方公共插件目录。DSH 版沿用原有安装方式。下面的 DSH 截图和持久化自选说明只针对 DSH Web,Codex 的会话与安装差异见[下文](#在-codex-中使用)。
20
-
21
- ## 它能帮你做什么
22
-
23
- - **一句话开始分析**:直接说“看看紫金矿业最近一个月趋势”或“分析英伟达的 MACD 和 RSI”。
24
- - **自己动手看图**:打开 K 线工作台,搜索名称或代码,随时切换日、周、月、季、年和可用的分钟周期。
25
- - **看清趋势与信号**:支持 MA、成交量、MACD、KDJ、RSI、BOLL、ATR、VWAP 等常用指标。
26
- - **把分析画在图上**:用对话或图上选点创建水平线、趋势线、平行通道、平台框、斐波那契和 ABC 折线标注;先预览,再决定是否保存。
27
- - **让 AI 继续修改**:宿主可按自然语言调用同一绘图链,按稳定 ID 改价、改色、修改锚点或删除;绘图计算和应用结果分开核对。
28
- - **查询标准技术函数**:TA-Lib 0.8.2 的 201 个函数可在当前图只读查询和计算;并非 201 个都能绘图。第一期只有 SMA、EMA、BBANDS 的受控结果可直接落图。详见[函数说明](docs/chart-functions.md)。
29
- - **寻找价格区域**:一键分析支撑位和压力位;也可以自己画水平价位线、添加备注,并在本机保存。
30
- - **比较与复盘**:叠加指数或标的、框选两个时间点查看涨跌、振幅、回撤和成交统计。
31
- - **补充研究信息**:在“市场、板块、资讯、公司、龙虎榜”中浏览指数、板块排行、资金异动、新闻、公司画像、财务与股东信息。
32
- - **建立自己的关注列表**:收藏标的、建立或重命名分组、排序、导入或批量打开;自选会作为你的用户级数据跨对话保留。
33
-
34
- ## 预览
35
-
36
- 自然语言实测:DeepSeek 从自选中筛出卧龙电驱的 ABC **候选**,逐根核对 0、A、B、C 四个锚点,再通过插件落图。同一张完整网页截图展示了对话、应用回执和右侧画布;画布上的折线与标签已实际可见。形态判断由宿主完成,规则筛查不等于专业波浪结论。
37
-
38
- ![完整 DSH Web 页面:左侧 DeepSeek 核对卧龙电驱 ABC 候选及四个锚点,右侧日 K 图显示对应折线和标签](docs/images/natural-language-abc-wolong-2026-10-27.png)
39
-
40
- 继续用自然语言在同一张图上添加下降通道:DeepSeek 核对三点几何与区间内的价格偏离,插件将通道作为独立对象落图;原有 ABC 标注仍保留。图上的线条可见,但通道是否具有交易参考价值仍需自行判断。
41
-
42
- ![完整 DSH Web 页面:左侧 DeepSeek 说明卧龙电驱下降通道的锚点和偏离,右侧日 K 图同时显示下降通道与 ABC 标注](docs/images/natural-language-descending-channel-wolong-2026-10-27.png)
43
-
44
- ## 在 Codex 中使用
45
-
46
- Codex 插件名为 `ft-kline`,公开源名称为 **FTShare**(标识 `ftshare`)。添加一次 GitHub 源后即可安装,后续从同一个源更新,无需下载 ZIP 或构建源码。该源由本项目维护,尚未上架 OpenAI 官方公共插件目录。
47
-
48
- ### 安装、启动与验证
49
-
50
- 1. 先安装 Git、Node.js **22.19+**、Python **3.11+** 和支持插件的 Codex。Windows 推荐启用 Python Launcher;不要求 Git Bash 或 WSL。
51
- 2. 在终端执行下面两条命令。第一条添加公开源并跟随经过 CI 验证的 `main`;第二条安装并启用插件:
52
-
53
- ```bash
54
- codex plugin marketplace add FTShare-Lab/dsh_kline --ref main
55
- codex plugin add ft-kline@ftshare
56
- ```
57
-
58
- 3. 重新打开 Codex,然后说“打开招商银行日 K,显示数据来源”。首次准备期间可先查询“检查 FT K-Line 运行状态”。桌面端可展开图表卡片,搜索、切换标的并使用绘图工作台;CLI 只返回数据和分析。
59
-
60
- 添加源后,也可以重新打开桌面应用,在插件页面选择 **FTShare → FT K-Line** 安装。可用下面的命令检查源和插件列表:
61
-
62
- ```bash
63
- codex plugin marketplace list
64
- codex plugin list --marketplace ftshare --available --json
65
- ```
66
-
67
- ### 更新与旧安装迁移
68
-
69
- 以后更新时刷新已添加的源,再安装该源的当前版本,最后重新打开 Codex:
70
-
71
- ```bash
72
- codex plugin marketplace upgrade ftshare
73
- codex plugin add ft-kline@ftshare
74
- ```
75
-
76
- 如果此前从 ZIP 安装了 `ft-kline@ftshare-local`,请在插件页面停用旧安装,再启用 `ft-kline@ftshare`,避免同时加载两个来源的同名工具。GitHub 源需要访问 GitHub;首次启动还需要联网下载 Python 依赖。
77
-
78
- ### 固定版本 ZIP 安装
79
-
80
- 如需固定在发布版本,也可从 [v0.6.7 发布页](https://github.com/FTShare-Lab/dsh_kline/releases/tag/v0.6.7) 下载 `ft-kline-v0.6.7.zip` 和同名 SHA-256 文件,核对后解压到长期保留的目录。将下面路径换成实际解压目录;含空格时保留引号:
81
-
82
- ```bash
83
- codex plugin marketplace add "/absolute/path/ft-kline-v0.6.7"
84
- codex plugin add ft-kline@ftshare-local
85
- ```
86
-
87
- 重新打开 Codex 后即可使用。ZIP 源标识为 `ftshare-local`,与公开 GitHub 源 `ftshare` 分开维护。DSH 沿用 `dsh-kline-v0.6.7.tgz` 安装包及下文的 DSH 安装方式。
88
-
89
- ### 首次准备与运行模式
90
-
91
- 首次连接会自动寻找可用 Python 并准备依赖,可能需要数分钟。Node 入口先完成握手,并从**第一次工具查询**就提供该宿主模式的完整工具目录和图表资源,不依赖工具列表变更通知。准备期间可查询 `ft_kline_runtime_status`;普通调用会短暂等待,仍未就绪则明确返回 `runtime_preparing`,不会延迟执行已退回的绘图操作。准备完成后直接重试原请求,无需刷新目录或重开对话。失败详情见 `~/.cache/ft-kline/bootstrap.log`,Windows 为 `%LOCALAPPDATA%\ft-kline\bootstrap.log`。
92
-
93
- 从 v0.6.1 升级后重启一次 Codex,以替换此前只包含状态工具的启动快照;然后直接请求“打开招商银行日 K”。已就绪、数据返回和原生画布实际可见分别验证,备用绘图不计为插件原生验收。
94
-
95
- Codex 入口默认按宿主声明的 MCP Apps HTML 能力选择模式:具备图表能力时提供交互图表和受控绘图;其他宿主(包括 CLI)只提供行情、指标与结构化分析。未声明图表能力的宿主不会收到无法使用的绘图工具。高级接入可显式设置 `FT_KLINE_CLIENT=desktop` 或 `cli`;普通安装保持默认 `auto` 即可。
96
-
97
- 自然语言修改当前图使用 `get_chart_context → prepare_chart_edit → apply_chart_edit → get_chart_edit_status`;服务端提交、应用界面回执和实际画布观察分别核对。CLI 不提供交互图表。
98
-
99
- ### 已有 FTShare Key 如何复用
100
-
101
- 无 Key 不等于所有市场都不可用,搜索目录与行情权限也相互独立。v0.6.7 新增腾讯港美股免费日 K 备用源:港股支持三种复权,美股支持不复权和前复权;成交量为历史当日股数。仅接入日 K,历史覆盖受公开源限制,详见[数据口径](docs/free-foreign-daily.md)。搜索与其他能力见[无 Key 说明](docs/anonymous-market-support.md)。固定版本安装包以对应发行版为准。
102
-
103
- Codex 依次使用:
104
-
105
- 1. **启动插件的进程环境**中的 `FTSHARE_API_KEY`;仅在另一个终端执行过 `export`,不代表桌面应用也能继承。
106
- 2. 用户明确指定的 `FTSHARE_API_KEY_FILE`,每次取数前重新读取;文件由用户管理,插件不修改、不清除。JSON 格式为 `{"version":1,"api_key":"你的 Key"}`;macOS/Linux 必须限制为仅当前用户可读写(`chmod 600`),不接受符号链接。
107
- 3. 图表“设置 → 数据源”输入的临时 Key,仅当前 App 会话使用。
108
-
109
- 没有 Key 仍可尝试 A 股、港股、美股历史日 K 和免费指数备用源;公开源失败不代表 Key 无效。Codex **不自动扫描** DSH、`.env`、shell、钥匙串或其他应用的配置;如需共享已有文件,必须明确设置上述文件路径。状态只显示 `environment`、`external_file`、`session` 或 `none`,不回显 Key 或路径。
110
-
111
- 图表、函数结果、自选和应用内临时 Key 保存在当前连接内存中;最后一个图表视图关闭、连接结束或空闲 30 分钟后清除。Codex 不继承 DSH 的持久化自选。环境变量和显式文件由用户管理,不会随图表关闭而被插件删除。
112
-
113
- 发布内容、自动化验证和仍待完成的桌面人工验收见 [v0.6.7 发布说明](docs/release-notes-v0.6.7.md) 与 [验收说明](docs/release-acceptance-v0.6.7.md)。
114
-
115
- ## 开始使用 DSH 版
116
-
117
- v0.6.5 为宿主开发者提供可选的图表面板挂载接口,支持外部标的与主题联动。画布、模拟盘等场景需要宿主接入;接口与布局约定见[嵌入说明](docs/embedding.md)。
118
-
119
- ### 1. 安装并启用
120
-
121
- 在 DeepSeek Harness 的插件市场搜索 `dsh_kline`。如果市场目录还没有刷新,可以直接从 GitHub 安装:
122
-
123
- ```bash
124
- dsh plugin --profile web add github:FTShare-Lab/dsh_kline
125
- ```
126
-
127
- 首次启动会自动准备所需运行环境。以后有新版本时,在插件市场或设置页更新即可。
128
-
129
- 插件支持 macOS、Linux 和原生 Windows。用户需要先安装可运行的 DSH Web,以及 Python 3.11 或更高版本;Windows 推荐使用 [python.org](https://www.python.org/downloads/windows/) 安装包并启用 Python Launcher。插件不要求 Git Bash 或 WSL。首次启动的依赖安装日志位于用户缓存目录下的 `dsh_kline/bootstrap.log`;Windows 默认为 `%LOCALAPPDATA%\dsh_kline\bootstrap.log`。
130
-
131
- ![在插件市场安装和更新 dsh_kline](docs/images/dsh-market.png)
132
-
133
- ### 2. 任选一种入口
134
-
135
- **和 AI 对话**:在对话中提出需求,例如:
136
-
137
- - `调取紫金矿业的 K 线,看看最近一个月走势`
138
- - `分析腾讯控股日 K,标注支撑位和压力位`
139
- - `查看英伟达最近一个月的成交量、MACD 和 RSI`
140
- - `这只股票最近有什么新闻和基本面变化?`
141
- - `在当前图画1300元的蓝色支撑线,叫关键支撑;之后把它改成绿色`
142
- - `请先给出下降通道的三个锚点和偏离,再等我确认是否落图`
143
- - `从我的自选中筛选 ABC 候选;选一只核对 0、A、B、C 四个拐点后画到日 K 图上,并说明 C 点是否已经确认`
144
-
145
- **直接打开工作台**:点击右侧 K 按钮,或在支持工作台 Tab 的界面从 `+` 菜单选择 **非凸 K 线助手 / dsh_kline**。输入股票名称或代码即可开始,不需要记住交易所后缀。
146
-
147
- 两种入口可操作同一张当前图中的新绘图对象;也可以在图表工具栏打开 **绘图**,从精选工具中点选 K 线锚点、预览、确认。每个对话各自保存图表状态,避免串图;自选与分组属于用户级数据,跨对话保留。
148
-
149
- ## 图表怎么用
150
-
151
- 1. 用顶部搜索框输入标的名称或代码。
152
- 2. 选择时间范围和 K 线周期;分钟线是否可用取决于数据权限和市场。
153
- 3. 开启需要的指标,拖动、缩放或使用十字线查看细节。
154
- 4. 点击 **关键点位** 查看支撑和压力;点击 **绘图** 选择工具,在图上点选锚点或输入参数,核对预览后保存。自己的价位线可在 **点位** 管理。
155
- 5. 依次点击两根 K 线,查看这段区间的涨跌、振幅、回撤与成交统计。
156
- 6. 点击名称旁的星标,把标的放进自选。
157
-
158
- 如果界面提供 **UI** 入口,可按习惯选择自动、独立侧栏或工作台 Tab。自动模式会使用当前 Harness 能提供的最佳界面;没有工作台 Tab 框架时,仍可正常使用右侧 K 线侧栏。
159
-
160
- ### 界面兼容
161
-
162
- DeepSeek Harness 自带右侧栏,**不安装 Better Sidebar 也能打开 K 线侧栏**。如果安装了可用的 Better Sidebar,插件还可以把 K 线作为工作台 Tab 打开;它是可选的界面增强,不是行情、指标或绘图的前提。右上角 **UI** 可在自动、侧栏与 Tab 模式间切换;自动模式会按当前宿主提供的界面能力选择。不同 Better Sidebar 版本的适配情况可能不同,不能仅凭安装了它就保证所有布局都已验收。
163
-
164
- ## 绘图:对话与工作台共用一个对象流程
165
-
166
- 在当前已核对来源的图表中,宿主可根据自然语言调用插件的计算、准备、应用和状态核对;工作台则提供可见的手动选择和预览。精选范围包括:
167
-
168
- - 水平线:指定价位、名称、颜色。
169
- - 两点趋势线:连接已有 K 线的两个时间 / 价格锚点。
170
- - 平行通道:三点确定上升、下降或水平通道,可开关中线。
171
- - 平台矩形框:指定时间和上下价格边界,可开关淡色填充。
172
- - 斐波那契回撤:两点及比例作为一个对象管理;价位由插件按价格公式计算。
173
- - ABC 折线标注:连接用户指定、或由宿主基于行情提议并核对的 0/A/B/C 锚点,可按点名续改;**插件不自动识浪,候选并非定论**。
174
- - SMA、EMA 单线与 BOLL 三轨:TA-Lib 结果可在明确要求后作为独立主图对象落图,不等于切换现有指标开关。
175
-
176
- 例如:
177
-
178
- - `在31.2元画蓝色水平线,叫基础支撑`
179
- - `把基础支撑移到30.8元,其他图形不动`
180
- - `把这两天的最低价连成绿色趋势线`
181
- - `找一段下降通道,先告诉我三个锚点和明显偏离,确认后再画`
182
- - `框出这段整理区间;把框的上沿改到31.2;只删除这个框`
183
-
184
- 宿主 AI 负责理解、分析和选点;插件负责读取当前图、确定性测量、执行与反馈,
185
- 不内置另一套 AI,也不靠预置绘图 skill 回放。明确参数可直接执行;要求先提方案时,
186
- 确认前不绘制。宿主分析和解释可能出错,专业画线质量仍需使用者核对。
187
-
188
- ### 当前范围与限制
189
-
190
- - 重点验收日线 / 周线。锚点必须对应当前已加载的真实 K 线,不会猜日期、吸附端点或自动取新行情补点。
191
- - 支持蓝、绿、橙、红四种颜色。两点线和通道为有限区间,不自动延伸,不支持对数通道。
192
- - 修改按稳定对象 ID 定位,绘图不重置行情、指标或可见范围;通道和平台框按创建周期隔离。
193
- - 当前宿主运行期间,同一对话已确认图形可在网页刷新后恢复并继续修改;不同对话不共用绘图对象。
194
- 返回对话恢复最后确认的绘图检查点,**不保证恢复离开前最后一次手动选择的周期、范围或视口**。
195
- - 工作台支持表单与图上点选,已确认的新对象可由对话或工作台按 ID 续改;鼠标拖拽和撤销暂不支持。旧手动画线、自动标注与受保护对象分开管理。
196
- - **清除图形与标注** 会先确认,再清除当前标的、当前周期的 AI 图形、分析标注、手动画线和自定义点位;指标与预警保留。只想删除一个 AI 图形时,可在对话中指定目标。
197
- - 图形可能超出当前时间 / 价格可见区。对象核对和应用回执不等于屏幕像素核验,也不证明供应商行情真值。
198
- - 来源过期、周期 / 复权不明、多个活动视图或结果未知时停止修改;不要自动重做未知操作。
199
- 完整服务重启后的旧图编辑和完整异常自动恢复尚不支持。
200
- - 分钟功能取决于来源与权限,本版不承诺全部分钟 / 市场 / 操作组合。通道、平台、ABC 均不代表自动专业形态识别;缠论未接入。201 个 TA-Lib 函数大多只读,不承诺全部可绘制。
201
-
202
- ### 给宿主与开发者
203
-
204
- 当前图修改使用 `get_chart_context → prepare_chart_edit → apply_chart_edit → get_chart_edit_status`。
205
- 确认后重新读取当前观察,以原批准参数核对;`context_ref` 不是 `chart_session`。
206
- 只读 `preview_chart_channel` 提供几何 / 偏差核对,`verify_chart_drawings` 核对指定对象参数;
207
- 二者不选点、不评判专业形态、不代替绘图授权。旧的分类型工具是快照接口,不应绕过当前图应用协议。
208
-
209
- 运行 `pnpm build:sidebar` 和 `pnpm test` 验证构建与全部 Node / Python 回归。
210
- DSH 绘图范围见[v0.5.0 验收说明](docs/release-acceptance-v0.5.0.md),本版安装与 Codex 验证见[v0.6.7 验收说明](docs/release-acceptance-v0.6.7.md)。
211
- 首次自动准备依赖需要网络,耗时取决于网络和本机环境。
212
-
213
- ## 行情与数据源
214
-
215
- 默认可接入 FTShare。配置 API Key 后,插件会根据你的账户权限提供相应的行情、分钟线、新闻和公司资料能力;不同市场和套餐的可用范围可能不同。
216
-
217
- 普通 A 股当日1分钟、none不复权请求优先使用 FTShare 的实时一分钟数据;前 / 后复权请求(含qfq / hfq)使用携带匹配adjust_kind的历史接口,失败时不混入原始实时数据。指数、ETF 与多日分钟历史继续使用各自适用的历史接口;完整交易时段与缓存复权隔离规则不变。此分流不等于对供应商复权价格正确性的独立验证。
218
- 分钟粒度随明确来源、重绘及工作区状态保留;元数据缺失或非法时仍为未知,不按K线时间间隔 / 界面标签猜测,也不继承上一标的粒度。来源未确认时继续禁止受保护绘图。
219
-
220
- DSH 版会按以下顺序复用 FTShare 凭据:当前 DSH 服务已注入的 `FTSHARE_API_KEY`、用户显式指定的 `FTSHARE_API_KEY_FILE`、DSH 的 FTShare 设置所保存的 Key,以及此前由本插件保存的本机凭据。也就是说,若你已把 Key 配给启动 DSH 的环境,插件会直接使用;仅安装 FTShare SDK、或把 Key 留在其他应用的私有配置中,并不会被自动读取。
221
-
222
- DSH 中安装了 FTShare 设置插件时,宿主会把设置里的 Key 发布给 MCP 服务,插件在每次取数前重新读取,因此在设置页新增、更换或清除 Key 后无需重启 dsh;该 Key 由设置页管理,插件不会显示或清除它。
223
-
224
- 出于安全考虑,插件不会扫描 `.env`、shell 配置、钥匙串或其他应用的配置文件,也不会显示 Key 或文件路径。**设置 → 数据源** 会清楚标出当前来源;需要更换时,在“管理 FTShare 配置”中粘贴 Key 并测试连接,DSH 版可选择仅本次使用,或保存到本机供下次启动加载;Codex 版仅提供会话临时输入,或读取用户明确指定的外部文件。
225
-
226
- 主题和语言默认跟随 dsh 宿主,可在 **设置 → 主题/语言** 中改为手动选择;随时可切回“跟随宿主(默认)”。
227
-
228
- [FTShare 的“免费版”接口](https://market.ft.tech/gateway/doc/p/pb8eizu3)仍需注册并配置 API Key。完全不配置 Key 时,部分 A 股历史日 K 可尝试 BaoStock 备用源,港美股日 K 可尝试腾讯,部分大盘指数也有独立免费备用行情;分钟线、新闻等能力仍取决于来源与权限。已有的合规 K 线数据(包括宿主提供的标准 OHLCV)仍可用于本地指标计算与绘图。遇到限流、权限不足或上游暂不可用,界面会说明实际原因和数据来源。
229
-
230
- ## 常见问题
231
-
232
- **为什么找不到分钟线?**
233
- 分钟行情是否可用取决于标的市场、账户套餐和数据源当前支持范围。请先在“数据源”中测试连接;日、周、月等周期不受分钟权限限制,但个股 K 线仍需可用的数据源,FTShare 免费套餐也需要 API Key。
234
-
235
- **Windows 首次启动失败怎么办?**
236
-
237
- 先查看 `%LOCALAPPDATA%\dsh_kline\bootstrap.log`。v0.6.4 起,依赖更新优先复用现有 venv;重建时会尝试已记录的基础解释器和 Desktop 随附的标准 Python。裁剪版 Python 缺少 venv/ensurepip 时仍需另装 Python 3.11+。可执行 `py -3.11 --version`(更高版本也可以),或在启动 DSH 前将 `DSH_KLINE_PYTHON` 设为 `python.exe` 的完整路径;修正后无需等旧失败记录冷却。嵌套 bundle 安装不再要求 profile 根存在 K 线包,但固定旧版依赖的 bundle 仍需更新。DSH 自身安装或 Windows sandbox 问题请参考 DSH 文档。
238
-
239
- **为什么两个对话显示不同的图?**
240
- 这是刻意设计:图表会绑定各自对话,避免 A 对话的分析覆盖 B 对话。需要在另一个对话查看时,直接搜索或重新发起分析即可。
241
-
242
- **为什么同一标的的数据与其他平台略有不同?**
243
- 行情可能延迟,也会受复权方式、交易所口径、收盘状态和上游服务影响。商业、高频或对时效有严格要求的场景,请使用有相应授权与服务等级的数据源。
244
-
245
- ## 给 AI 与开发者
246
-
247
- 大多数场景只需调用 `analyze_kline`。插件还提供 `fetch_candles`、`search_symbols`、`calc_metrics`、`analyze_kline_rows`、`data_source_status`、`configure_ftshare`、`test_ftshare_connection` 和 `health`,用于原始数据、外部 OHLCV、配置与诊断;`market_pulse`、`market_board_detail` 和 `security_intelligence` 提供市场与标的情报;`get_watchlist`、`save_watchlist` 用于读取和保存自选分组。
248
-
249
- FTShare 只是默认适配器,不是分析引擎的前提。调用方可以把自己的标准 OHLCV 数据交给 `analyze_kline_rows`,继续使用指标、关键点位、图表和工作台。接入说明见 [数据源适配指南](docs/provider-adaptation.md)。
250
-
251
- ### 由宿主提供 Python 运行环境
252
-
253
- 普通安装默认使用 `DSH_KLINE_RUNTIME_MODE=auto`,沿用现有的 Python/venv 选择和依赖准备流程。桌面应用、容器等宿主可在启动 DSH 前设置:
254
-
255
- | 环境变量 | 含义 |
256
- | --- | --- |
257
- | `DSH_KLINE_PACKAGE_ROOT` | 可选的插件包根目录绝对路径;未设置时从插件模块自身定位,支持嵌套安装。 |
258
- | `DSH_KLINE_PYTHON` | 宿主提供的 Python 解释器路径。 |
259
- | `DSH_KLINE_RUNTIME_MODE` | `auto`(默认)或 `external`。 |
260
-
261
- `external` 模式要求 Python 3.11+ 和所需依赖已经可用,只校验并启动服务,不创建 venv、不安装依赖、不回退到其他解释器;失败应由宿主修复。该模式不能与 `DSH_KLINE_VENV`、`--prepare-project` 或 `--bootstrap-runtime` 同时使用。`DSH_KLINE_DEFER_BOOTSTRAP` 在该模式下不触发后台安装。
262
-
263
- `DSH_KLINE_PYTHON` 必须指向解释器文件本身(Windows 为 `python.exe`),不能填目录。自动准备失败时,日志会区分 `PYTHON_NOT_FOUND`、`PYTHON_VERSION_TOO_OLD`、`PYTHON_EXECUTION_FAILED`、`PYTHON_VENV_UNAVAILABLE`、`PYTHON_DEPENDENCY_INSTALL_FAILED` 和 `PYTHON_IMPORT_CHECK_FAILED`;不可用的 Windows Store 重定向入口标为 `PYTHON_STORE_ALIAS`。候选路径与结果仅用于本机诊断,不记录密钥或完整环境变量。
264
-
265
- `external` 模式由宿主负责解释器、依赖搜索路径及隔离配置(例如 `PYTHONPATH`、`PYTHONNOUSERSITE` 或 Windows 嵌入式 Python 的 `._pth`),不自动探测其他解释器。`auto` 模式的补装和有限解释器探测如上所述。需要动态端口时设置 `DSH_KLINE_CHART_PORT=0`。环境变量在 MCP patch 中显式转交,无需修改 DSH 核心。
266
-
267
- ## 更新与许可
268
-
269
- 更新记录见 [Releases](https://github.com/FTShare-Lab/dsh_kline/releases)。本项目采用 [MIT License](LICENSE),前端来源说明见 [PROVENANCE.md](PROVENANCE.md)。
270
-
271
- 维护者修改工具参数、注解、资源或 App 桥接代码后,运行 `python scripts/generate-codex-catalog.py` 更新随包目录;`--check` 与回归测试会阻止过期目录进入发布包。
272
-
273
- 公开 GitHub 源中的 `marketplace/ft-kline/` 由同一 Codex 打包清单生成。修改源码、插件声明或 README 后,运行 `pnpm sync:codex-marketplace` 并提交生成结果;CI 通过 `pnpm verify:codex-marketplace` 检查文件一致性,并独立验证该目录的桌面及 CLI 启动。不要直接修改生成目录,维护说明见 [marketplace/README.md](marketplace/README.md)。
274
-
275
- ### DSH 启动诊断
276
-
277
- 首次启动时,MCP 工具目录会立即注册,Python 环境在同一连接内准备。`dsh_kline_runtime_status` 返回 `preparing` / `recovering` / `ready`;未就绪的调用会明确说明是否已经发送。结果未知的操作必须先核对状态,不能自动重放。图表定位文件写失败时其他 MCP 工具仍可用,目录恢复后自动注册。
278
-
279
- 在当前 DSH Web 地址请求 `/dsh-kline/healthz`:200 表示定位记录与实际 HTTP 后端实例一致;503 返回故障原因。这个检查不验证行情供应商权限或 MCP 工具调用。`/dsh-kline/session?session=…` 读取历史快照,不能代替健康检查。后端实际端口由定位文件决定,不能假定固定为 8765。
280
-
281
- 安装日志为缓存目录下的 `bootstrap.log`,后端 stderr 为 `logs/backend-<宿主PID>.log`,超过约 1 MiB 时保留一份 `.previous`。默认缓存目录为 macOS/Linux 的 `~/.cache/dsh_kline`(支持 `XDG_CACHE_HOME`)或 Windows 的 `%LOCALAPPDATA%\dsh_kline`,可用 `DSH_KLINE_CACHE_DIR` 覆盖;`DSH_KLINE_RUNTIME_DIR` 可独立覆盖运行目录。健康响应不会返回服务令牌。