@dsh-ft/dsh-fft-paper-trading 0.4.0 → 0.4.1

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.
@@ -1,5 +1,10 @@
1
1
  import type { BetterSidebarService } from 'dsh-better-sidebar';
2
2
  import type { Sessions } from './conversation';
3
+ /** The chart itself, shared by every host tab: Better Sidebar and the native one. */
4
+ export declare function KlineTabContent({ sessions, conversationId }: {
5
+ sessions: Sessions;
6
+ conversationId?: string;
7
+ }): import("react").JSX.Element;
3
8
  export declare function BetterSidebarBridge({ service, sessions }: {
4
9
  service: BetterSidebarService;
5
10
  sessions: Sessions;
@@ -18,6 +18,10 @@ export interface HostServices {
18
18
  slots?: SlotsService;
19
19
  /** The free-canvas service, present only when the canvas plugin is loaded. */
20
20
  canvas?: CanvasService;
21
+ /** DSH's own right-Sidebar tab registry, present on hosts that own that column. */
22
+ sidebarRightTabs?: SidebarRightTabsService;
23
+ /** DSH's own right-Sidebar navigation face, the way a page type is opened. */
24
+ sidebarRight?: SidebarRightService;
21
25
  }
22
26
  /** The slice of the host `slots` service this plugin registers into. */
23
27
  export interface SlotsService {
@@ -28,8 +32,40 @@ export interface SlotsService {
28
32
  id?: string;
29
33
  order?: number;
30
34
  label?: string;
35
+ /** Business props for the body; the framework adds its own standard share. */
36
+ inject?: (...args: any[]) => Record<string, unknown>;
31
37
  }, component: unknown): () => void;
32
38
  }
39
+ /** One tab type as DSH's native right Sidebar registry takes it (the members this plugin sets). */
40
+ export interface NativeSidebarTabDefinition {
41
+ /** Implementation identity, unique across registrations; the body seat dispatches by it. */
42
+ id: string;
43
+ /** Type discriminator — what `openTab` names and what every tab of this type is. */
44
+ kind: string;
45
+ /** `extension` is the band for a type shipped outside the product, which is this one. */
46
+ priority?: 'extension' | 'builtin' | 'fallback';
47
+ /** The chip text captured when a tab of this type opens. */
48
+ title: (address: string) => string;
49
+ /** Entry boxes the host's guide page offers for opening this type. */
50
+ guide?: readonly NativeSidebarGuideEntry[];
51
+ }
52
+ /** One guide entry: a capsule that opens this tab type when picked. */
53
+ export interface NativeSidebarGuideEntry {
54
+ id: string;
55
+ order: number;
56
+ title: () => string;
57
+ description?: () => string;
58
+ }
59
+ /** The slice of the host right-Sidebar tab registry this plugin registers into. */
60
+ export interface SidebarRightTabsService {
61
+ register(definition: NativeSidebarTabDefinition): () => void;
62
+ }
63
+ /** The slice of the host right-Sidebar navigation face this plugin uses. */
64
+ export interface SidebarRightService {
65
+ openTab(kind: string, options?: {
66
+ params?: unknown;
67
+ }): void;
68
+ }
33
69
  /** The slice of the host free-canvas service this plugin registers into. */
34
70
  export interface CanvasService {
35
71
  registerType(descriptor: CanvasPanelType): () => void;
@@ -9,5 +9,5 @@ export interface InterfaceState {
9
9
  }
10
10
  export declare const InterfaceContext: import("react").Context<InterfaceState>;
11
11
  export declare function readDisplayMode(storage?: Storage): DisplayMode;
12
- export declare function resolveDisplayMode(preference: DisplayMode, available: boolean): InterfaceState['mode'];
12
+ export declare function resolveDisplayMode(_preference: DisplayMode, available: boolean): InterfaceState['mode'];
13
13
  export declare function readAutoOpen(storage?: Storage): boolean;
@@ -0,0 +1,21 @@
1
+ import type { NativeSidebarTabDefinition } from './host-services.ts';
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 declare 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 declare function nativeTabDefinition(): NativeSidebarTabDefinition;
20
+ /** One line under the guide capsule: what picking it opens, in the host language. */
21
+ export declare function nativeTabDescription(locale?: string): string;
@@ -0,0 +1,62 @@
1
+ import type { Sessions } from './conversation';
2
+ import type { ClientContext } from './host-services';
3
+ export { NATIVE_TAB_ID, nativeTabDefinition, nativeTabDescription } from './native-sidebar-contract';
4
+ /**
5
+ * The chart as a tab of the host's own right column.
6
+ *
7
+ * A DSH host that owns its right Sidebar publishes two faces: `ctx.sidebarRightTabs`
8
+ * (stage one — what the tab type is, and its guide entry) and the keyed
9
+ * `sidebar.right.pane.tab` seat (stage two — the body), navigated by
10
+ * `ctx.sidebarRight.openTab`. Registering there means the chart needs no
11
+ * third-party sidebar to get a tab, so this bridge is tried before the
12
+ * Better Sidebar one in index.tsx.
13
+ *
14
+ * The two stages are deliberately registered as one unit: a type without a body
15
+ * would show the host's "nothing can view this" notice, so a failed body
16
+ * registration rolls the type back and leaves `available()` false, which makes
17
+ * the router fall back to the next interface it knows.
18
+ */
19
+ /** The metadata hook the host seat binds into every tab body. */
20
+ export interface NativeTabInfo {
21
+ tab: {
22
+ readonly visible: boolean;
23
+ };
24
+ }
25
+ /** What the body seat hands a registered body: its session and the host services it needs. */
26
+ export interface NativeTabBodyProps {
27
+ readonly sessionId: string;
28
+ readonly sessions: Sessions;
29
+ readonly useTabInfo: () => NativeTabInfo;
30
+ }
31
+ /**
32
+ * One tab body: the same chart the Better Sidebar tab and the paper-trading
33
+ * panel draw, mounted against the tab's own conversation.
34
+ *
35
+ * The interface state is the native-tab one: the chart view uses it only to
36
+ * know which shell it lives in, so the tab reports `better-sidebar` (the
37
+ * existing "native tab" value) and stays independent of the user's preference.
38
+ */
39
+ export declare function NativeKlineTabBody({ sessionId, sessions, useTabInfo }: NativeTabBodyProps): import("react").JSX.Element;
40
+ /** Auto-open lives in the tab's own session, exactly like the Better Sidebar path. */
41
+ export declare function NativeSidebarBridgeView({ bridge, sessions }: {
42
+ bridge: NativeSidebarBridge;
43
+ sessions: Sessions;
44
+ }): import("react").JSX.Element | null;
45
+ /** The host-facing handle the router polls to decide which interface to draw. */
46
+ export interface NativeSidebarBridge {
47
+ /** Whether the host registered both stages; false falls back to the next interface. */
48
+ available(): boolean;
49
+ /** Open (or reveal) the chart tab of the session on screen. */
50
+ open(): void;
51
+ }
52
+ /**
53
+ * Register the chart tab into the host's native right Sidebar.
54
+ *
55
+ * Every host service is optional: a host without `sidebarRightTabs`, `sidebarRight`
56
+ * or `slots` simply gets `available() === false` and the plugin keeps working
57
+ * through the interfaces it does have.
58
+ * @param ctx - the client context to register on.
59
+ * @param onChange - called whenever availability changes, so the router repaints.
60
+ * @returns the handle the router and the auto-open path share.
61
+ */
62
+ export declare function registerNativeSidebar(ctx: ClientContext, onChange: () => void): NativeSidebarBridge;
@@ -1,6 +1,13 @@
1
1
  export declare const ONBOARDING_KEY = "dsh-kline:onboarding-version:v2";
2
2
  export declare function hasPreviousUsage(storage: Storage): boolean;
3
3
  export declare function captureOnboarding(storage?: Storage): void;
4
- export declare function onboardingKind(storage?: Storage): 'upgrade' | 'first' | 'none';
5
- export declare function classifyOnboarding(storage: Storage, previousUsage: boolean): 'upgrade' | 'first' | 'none';
4
+ export declare function onboardingKind(storage?: Storage): 'upgrade' | 'none';
5
+ /**
6
+ * Only a returning user gets a one-time notice.
7
+ *
8
+ * A fresh install gets no dialog at all: the chart opens straight into its
9
+ * workspace, because the first-run welcome that used to pitch the FTShare key
10
+ * is gone.
11
+ */
12
+ export declare function classifyOnboarding(storage: Storage, previousUsage: boolean): 'upgrade' | 'none';
6
13
  export declare function acknowledgeOnboarding(storage?: Storage): void;
@@ -786,11 +786,6 @@
786
786
  .welcome-dialog { position: relative; width: min(410px, 100%); padding: 20px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); box-shadow: var(--shadow); color: var(--text-soft); font-size: 12px; line-height: 1.65; }
787
787
  .welcome-close { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--text-soft); cursor: pointer; font-size: 18px; line-height: 1; }
788
788
  .welcome-close:hover { background: var(--bg-soft); color: var(--text); }
789
- .welcome-title { margin: 0 28px 7px 0; color: var(--text); font-size: 17px; font-weight: 750; }
790
- .welcome-lead { margin: 0 0 12px; }
791
- .welcome-list { display: grid; gap: 6px; margin: 0 0 13px; padding-left: 18px; }
792
- .welcome-ftshare { margin-top: 10px; padding: 10px 11px; border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border)); border-radius: 6px; background: color-mix(in srgb, var(--accent) 6%, var(--bg)); }
793
- .welcome-ftshare-title { color: var(--text); font-weight: 700; }
794
789
  .welcome-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 16px; }
795
790
  .welcome-actions .btn { min-height: 29px; }
796
791
  /* Embedded hosts (a free-canvas panel, the paper-trading rail) ask for less
@@ -1256,25 +1251,6 @@
1256
1251
  <div class="welcome-actions"><button class="btn" id="uiUpgradeKeep" type="button" data-i18n="interfaceKeep">保持当前界面</button><button class="btn primary" id="uiUpgradeChoose" type="button" data-i18n="interfaceChoose">查看并选择界面</button></div>
1257
1252
  </section>
1258
1253
  </div>
1259
- <div class="welcome-backdrop" id="welcomeDialog" hidden>
1260
- <section class="welcome-dialog" role="dialog" aria-modal="true" aria-labelledby="welcomeTitle">
1261
- <button class="welcome-close" id="welcomeCloseBtn" type="button" aria-label="关闭">&times;</button>
1262
- <h2 class="welcome-title" id="welcomeTitle" data-i18n="welcomeTitle">欢迎使用非凸 K 线助手</h2>
1263
- <p class="welcome-lead" data-i18n="welcomeLead">用自然语言查看行情、K 线、指标和标的信息。</p>
1264
- <p id="interfaceWelcomeCurrent" hidden></p>
1265
- <ul class="welcome-list">
1266
- <li data-i18n="welcomeItemChart">先选择标的,再按需加载数据和分析图表。</li>
1267
- <li data-i18n="welcomeItemLevels">需要时点击“关键点位”,查看支撑位和压力位分析。</li>
1268
- <li data-i18n="welcomeItemSource">支持 FTShare,也支持其他数据源提供标准化 OHLCV 数据。</li>
1269
- <li data-i18n="welcomeItemWatchlist">自选和分组保存在当前浏览器中。</li>
1270
- </ul>
1271
- <div class="welcome-ftshare">
1272
- <div class="welcome-ftshare-title" data-i18n="welcomeFtshareTitle">想使用更多数据?</div>
1273
- <div data-i18n="welcomeFtshareDetail">FTShare 按套餐提供不同数据权限,具体可用能力以当前套餐和接口为准。</div>
1274
- </div>
1275
- <div class="welcome-actions"><button class="btn" id="welcomeLaterBtn" type="button" data-i18n="welcomeLater">稍后设置</button><button class="btn primary" id="welcomeConfigureBtn" type="button" data-i18n="welcomeConfigure">配置 FTShare</button></div>
1276
- </section>
1277
- </div>
1278
1254
  <div class="market-ticker" id="marketTicker" aria-live="polite"><div class="market-ticker-flow"><div class="market-ticker-track" id="marketTickerTrack"></div></div><div class="market-ticker-meta" id="marketTickerMeta"></div></div>
1279
1255
  <div class="activity-notice" id="activityNotice" role="status" aria-live="polite" hidden><span class="activity-notice-spinner" aria-hidden="true"></span><span id="activityNoticeText"></span></div>
1280
1256
  <div id="viewScrollbar" role="scrollbar" aria-controls="viewScroll" aria-orientation="vertical" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0" tabindex="0">
@@ -1560,7 +1536,6 @@ const UI_COPY = {
1560
1536
  capDaily: "日 K", capIndicators: "技术指标", capMinute: "分钟 K", capNews: "新闻", capMarket: "大盘", capCompany: "公司资料", capAvailable: "当前可用", capSourceDependent: "取决于数据源", capLocked: "当前套餐未提供", capNotTested: "尚未测试",
1561
1537
  range1d: "1D", range5d: "5D", range10d: "10日", range30d: "30日", rangeYtd: "今年", range1y: "1年", range5y: "5年",
1562
1538
  keyLevels: "关键点位", keyLevelsLoading: "正在分析关键点位…", keyLevelsNeedData: "请先加载有效的 K 线数据,再分析关键点位。", keyLevelsFailed: "温馨提示:当前数据暂时无法完成关键点位分析,请稍后重试。", keyLevelPlanTitle: "关键点位参考", keyLevelPlanNote: "仅供研究参考,不构成交易建议", keyPlanSupport: "支撑参考", keyPlanResistance: "压力参考", keyPlanBreakout: "突破参考", keyPlanStop: "风险参考", keyPlanTarget: "目标参考", keyPlanSupportDetail: "价格回落时的观察区域", keyPlanResistanceDetail: "上方需要关注的阻力区域", keyPlanBreakoutDetail: "站稳后再观察确认", keyPlanStopDetail: "跌破支撑后重新评估", keyPlanTargetDetail: "下一阻力区域参考", keyPlanSave: "保存为我的点位", keyPlanSaved: "已保存为我的点位", helpExamplesTitle: "可以这样提问", helpExampleOne: "查看紫金矿业的 K 线", helpExampleTwo: "分析最近一个月的支撑位和压力位", helpExampleThree: "比较紫金矿业和沪深 300", helpExampleFour: "查看这只股票最近的新闻和公司资料",
1563
- welcomeItemLevels: "需要时点击“关键点位”,查看支撑位和压力位分析。",
1564
1539
  clear: "清标注", search: "搜索", searchSubmit: "提交搜索", searchPlaceholder: "搜索代码或名称", searchLabel: "搜索股票", versionUpdates: "版本与更新", currentSource: "当前数据源", sourceCapabilities: "可用能力", sourceCapabilityDaily: "日 K 与常用技术指标", sourceCapabilityOptional: "分钟 K / 新闻 / 大盘 / 简况:按数据源与套餐提供", externalSourceTitle: "其他数据源", externalSourceDetail: "接入其他行情数据后,也可以继续使用 K 线和指标。", externalSourceHint: "请先在 dsh 中完成接入;当前设置页暂不支持直接切换。", sourceFreeMode: "FTShare 按套餐提供不同数据权限:免费版可用基础股票 K 线;分钟 K、新闻等能力以具体接口和套餐为准。保存 Key 后可查看当前能力状态。", themeCurrent: "当前主题", languageCurrent: "当前语言", followHost: "跟随宿主(默认)", themeLight: "浅色", themeDark: "深色", overviewRoleTitle: "插件如何工作", overviewIntro: "非凸 K 线助手是 dsh 的行情分析插件。dsh 负责理解你的需求,插件负责取数、计算和展示;分析结果会回到对话中。", overviewStepOne: "在 dsh 对话中提出需求,例如“查看某标的 K 线并分析关键点位”。", overviewStepTwo: "插件加载数据,完成 K 线、技术指标和支撑位/压力位分析。", overviewStepThree: "图表在右侧展示,分析结论在对话中返回;你可以继续切换周期和指标。", overviewCapabilitiesTitle: "可以做什么", overviewCapabilityOne: "查看行情与日线、周线、月线等不同周期的 K 线。", overviewCapabilityTwo: "使用 MA、MACD、KDJ、BOLL、RSI、ATR、VWAP 和成交量等指标。", overviewCapabilityThree: "识别并标注支撑位、压力位等关键点位,辅助观察趋势和价格区间。", overviewCapabilityFour: "进行区间统计、标的对比、自选、预警和画线。", overviewCapabilityFive: "默认使用 FTShare,也支持其他数据源提供行情数据。", overviewStartTitle: "开始使用", overviewStart: "在 dsh 对话中直接提出需求,或在顶部搜索栏检索标的;选中后即可查看图表。", feedbackDescription: "遇到问题或有改进建议?欢迎提交反馈。", feedbackOpen: "提交反馈 / Send feedback", feedbackPrivacy: "反馈会打开 GitHub,提交内容由你主动填写。", helpWorkflow: "使用流程", helpStepOne: "在顶部搜索栏输入代码或名称,按回车检索标的。", helpStepTwo: "点击标的后加载行情和分析数据。", helpStepThree: "1D/5D 需要分钟 K;不支持时可切换到 30日,或按套餐配置 FTShare。", helpStepFour: "自选和分组会保存在当前用户的 dsh_kline 中;换设备仍可通过导出与导入迁移。", updateDescription: "查看当前版本、更新记录和发布说明。",
1565
1540
  indicators: "指标", indicatorHeading: "显示指标", apply: "应用",
1566
1541
  maNote: "均线", vwapNote: "成交量加权", volNote: "万股", macdNote: "动能", kdjNote: "随机指标", bollNote: "布林带", rsiNote: "强弱", atrNote: "波动率",
@@ -1568,7 +1543,7 @@ const UI_COPY = {
1568
1543
  volume: "量", volumeUnit: "成交量单位", switchVolume: "切换成交量单位", noResults: "未找到标的", searching: "搜索中…", loading: "加载 K 线…", fetchingData: "正在拉取数据…", renderingChart: "正在更新图表…", dataReady: "数据拉取完成", dataFailed: "数据拉取失败", retry: "重试", sessionOpen: "开盘", sessionClose: "收盘", intradayRangeFallback: "{range} 历史分钟数据暂未返回,已切换为 1D",
1569
1544
  switchToLight: "切换至日间模式", switchToDark: "切换至夜间模式", percentAxis: "涨跌幅", resizeCanvas: "调整画布高度",
1570
1545
  closeTab: "关闭标签页", chartTabs: "图表标签页", level: "价位", securityTabs: "标的内容", chart: "图表", news: "新闻", company: "简况", overview: "概览", financials: "财务", holders: "股东", latestFinancials: "核心财务", majorHolders: "主要股东", noWorkspaceData: "该页等待数据源提供标准化信息", workspaceLoading: "正在从当前数据源加载新闻与简况…", workspaceReady: "新闻与简况已更新", workspaceUnavailable: "温馨提示:当前数据源暂未提供新闻与简况数据", workspaceDataHint: "温馨提示:当前数据源暂未提供这部分信息", externalDataHint: "支持接入其他数据源,具体能力取决于数据源提供的内容", marketTickerUnavailable: "大盘行情将在数据源接入后展示", sourceEastmoneyFree: "东方财富免费行情", sourceTencentFree: "腾讯免费行情", openIndexChart: "查看 {name} K 线图", friendlyNotice: "温馨提示", ftshareMinuteKeyRequired: "FTShare 免费数据暂不支持分钟 K,请配置 FTSHARE_API_KEY 后重试。", help: "使用帮助", helpTitle: "使用帮助", helpVersion: "当前版本", helpRelease: "查看版本与更新", localPreview: "本地预览",
1571
- newsUnavailable: "温馨提示:当前数据源暂未提供新闻数据", newsUnavailableHint: "接入支持新闻的数据源后,即可在这里查看资讯。", newsEmpty: "当前标的暂无新闻数据", newsEmptyHint: "可以稍后重试,或切换到支持新闻的数据源。", companyUnavailable: "温馨提示:当前数据源暂未提供简况数据", companyUnavailableHint: "接入支持公司资料的数据源后,即可在这里查看。", companyEmpty: "当前标的暂无简况数据", companyEmptyHint: "可以稍后重试,或切换到支持公司资料的数据源。", settingsTitle: "设置", closeSettings: "关闭设置", language: "语言", theme: "主题", dataSource: "数据源", settingsSourceHint: "能力取决于当前数据源。", sourceConnected: "已连接", sourceUnavailable: "等待数据源", localDataTitle: "本机数据", localDataDescription: "自选和分组会保存在当前用户的 dsh_kline 中;画线和价格标记保存在当前浏览器。你可以导出备份,或在另一台设备导入。", exportLocalData: "导出本机数据", importLocalData: "导入本机数据", localDataExported: "本机数据已导出", localDataImported: "本机数据已导入", localDataInvalid: "文件格式不正确,未导入任何数据。", ftshareConfigTitle: "FTShare 连接", ftshareManage: "管理 FTShare 配置", testCurrentConnection: "测试当前连接", configureAndTest: "配置并测试", clearConfig: "清除", ftshareApiKeyPlaceholder: "粘贴 FTSHARE_API_KEY(可选)", ftshareApiKeyLabel: "FTShare API Key", ftsharePersist: "保存到本机(推荐)", ftshareConfigNote: "仅复用当前 DSH 服务可读取的配置;不会扫描其他应用、.env、shell 配置或钥匙串。", ftshareConfigured: "FTShare API Key 已配置并连接成功", ftshareConfiguredSaved: "已配置并保存,下次启动自动使用", ftshareCleared: "已清除插件保存的 FTShare 配置", ftshareStatusConfigured: "已安装 · API Key 已配置", ftshareStatusConfiguredSaved: "已安装 · 已保存,下次启动自动使用", ftshareStatusEnvironment: "已自动连接 · 使用宿主环境配置", ftshareStatusExternalFile: "已自动连接 · 使用指定凭据文件", ftshareStatusSettingsBridge: "已自动连接 · 使用 DSH FTShare 设置", ftshareStatusSession: "已连接 · 仅当前进程", ftshareStatusAnonymous: "已安装 · 使用免费数据", ftshareStatusMissing: "未安装 FTShare SDK", ftshareHintEnvironment: "当前 DSH 服务已读取 FTSHARE_API_KEY。Key 不会显示、保存或被插件清除。", ftshareHintExternalFile: "当前 DSH 服务从指定凭据文件读取 Key;请在宿主侧管理它。", ftshareHintSettingsBridge: "当前 Key 来自 DSH 的 FTShare 设置页;插件不会显示或清除它,请在设置中管理。", ftshareHintPluginStore: "此 Key 由插件安全保存到本机;可在这里清除。", ftshareHintSession: "此 Key 只在当前 DSH 进程有效,重启后失效。", ftshareHintAnonymous: "未检测到可由当前 DSH 服务读取的 FTShare Key;基础免费能力仍可使用。", ftshareConfigTesting: "正在测试 FTShare 连接…", ftshareConfigFailed: "FTShare 连接失败,请检查 API Key 或稍后重试。", ftshareConfigInvalid: "请输入 API Key,或点击清除恢复免费模式。", ftshareConfigProcessOnly: "配置仅对当前 dsh 进程生效", ftshareWebsite: "打开 FTShare 官网", ftshareDocs: "查看 API 文档", welcomeTitle: "欢迎使用非凸 K 线助手", welcomeLead: "用自然语言查看行情、K 线、指标和标的信息。", welcomeItemChart: "先选择标的,再按需加载数据和分析图表。", welcomeItemSource: "支持 FTShare,也支持其他数据源提供标准化 OHLCV 数据。", welcomeItemWatchlist: "自选和分组会跨对话保留。", welcomeFtshareTitle: "想使用更多数据?", welcomeFtshareDetail: "FTShare 按套餐提供不同数据权限,具体可用能力以当前套餐和接口为准。", welcomeConfigure: "配置 FTShare", welcomeLater: "稍后设置",
1546
+ newsUnavailable: "温馨提示:当前数据源暂未提供新闻数据", newsUnavailableHint: "接入支持新闻的数据源后,即可在这里查看资讯。", newsEmpty: "当前标的暂无新闻数据", newsEmptyHint: "可以稍后重试,或切换到支持新闻的数据源。", companyUnavailable: "温馨提示:当前数据源暂未提供简况数据", companyUnavailableHint: "接入支持公司资料的数据源后,即可在这里查看。", companyEmpty: "当前标的暂无简况数据", companyEmptyHint: "可以稍后重试,或切换到支持公司资料的数据源。", settingsTitle: "设置", closeSettings: "关闭设置", language: "语言", theme: "主题", dataSource: "数据源", settingsSourceHint: "能力取决于当前数据源。", sourceConnected: "已连接", sourceUnavailable: "等待数据源", localDataTitle: "本机数据", localDataDescription: "自选和分组会保存在当前用户的 dsh_kline 中;画线和价格标记保存在当前浏览器。你可以导出备份,或在另一台设备导入。", exportLocalData: "导出本机数据", importLocalData: "导入本机数据", localDataExported: "本机数据已导出", localDataImported: "本机数据已导入", localDataInvalid: "文件格式不正确,未导入任何数据。", ftshareConfigTitle: "FTShare 连接", ftshareManage: "管理 FTShare 配置", testCurrentConnection: "测试当前连接", configureAndTest: "配置并测试", clearConfig: "清除", ftshareApiKeyPlaceholder: "粘贴 FTSHARE_API_KEY(可选)", ftshareApiKeyLabel: "FTShare API Key", ftsharePersist: "保存到本机(推荐)", ftshareConfigNote: "仅复用当前 DSH 服务可读取的配置;不会扫描其他应用、.env、shell 配置或钥匙串。", ftshareConfigured: "FTShare API Key 已配置并连接成功", ftshareConfiguredSaved: "已配置并保存,下次启动自动使用", ftshareCleared: "已清除插件保存的 FTShare 配置", ftshareStatusConfigured: "已安装 · API Key 已配置", ftshareStatusConfiguredSaved: "已安装 · 已保存,下次启动自动使用", ftshareStatusEnvironment: "已自动连接 · 使用宿主环境配置", ftshareStatusExternalFile: "已自动连接 · 使用指定凭据文件", ftshareStatusSettingsBridge: "已自动连接 · 使用 DSH FTShare 设置", ftshareStatusSession: "已连接 · 仅当前进程", ftshareStatusAnonymous: "已安装 · 使用免费数据", ftshareStatusMissing: "未安装 FTShare SDK", ftshareHintEnvironment: "当前 DSH 服务已读取 FTSHARE_API_KEY。Key 不会显示、保存或被插件清除。", ftshareHintExternalFile: "当前 DSH 服务从指定凭据文件读取 Key;请在宿主侧管理它。", ftshareHintSettingsBridge: "当前 Key 来自 DSH 的 FTShare 设置页;插件不会显示或清除它,请在设置中管理。", ftshareHintPluginStore: "此 Key 由插件安全保存到本机;可在这里清除。", ftshareHintSession: "此 Key 只在当前 DSH 进程有效,重启后失效。", ftshareHintAnonymous: "未检测到可由当前 DSH 服务读取的 FTShare Key;基础免费能力仍可使用。", ftshareConfigTesting: "正在测试 FTShare 连接…", ftshareConfigFailed: "FTShare 连接失败,请检查 API Key 或稍后重试。", ftshareConfigInvalid: "请输入 API Key,或点击清除恢复免费模式。", ftshareConfigProcessOnly: "配置仅对当前 dsh 进程生效", ftshareWebsite: "打开 FTShare 官网", ftshareDocs: "查看 API 文档",
1572
1547
  watchlist: "自选", watchlistEmpty: "尚未添加自选标的", addWatch: "加入自选", removeWatch: "移出自选", defaultGroup: "默认分组", newGroup: "新建分组", renameGroup: "重命名分组", save: "保存", groupName: "分组名称", groupNameRequired: "请输入分组名称", groupNameExists: "该分组已存在", create: "创建", cancel: "取消", deleteGroup: "删除分组", deleteGroupConfirm: "删除此分组及其中全部标的?", openWatchlistRail: "展开自选侧栏", closeWatchlistRail: "收起自选侧栏",
1573
1548
  rangeLabel: "时间范围", intervalLabel: "K 线周期", custom: "自定义", apply: "应用", resetZoom: "重置缩放", alert: "预警", alertPrice: "价格", alertNote: "备注(可选)", alertScopeNote: "仅在当前页面打开时检查,不提供后台推送。", alertEmpty: "当前标的暂无预警", alertAdded: "已添加价格预警", alertRemoved: "已移除价格预警", addWatchAtCandle: "加入自选", analyzeCandle: "分析此 K 线", marketUpdated: "更新", beijingTime: "北京时间", delayed: "延迟", closed: "收盘", stale: "过期", open: "开市", source: "数据源", refresh: "刷新", refreshing: "正在刷新", retrying: "刷新失败,保留上一份有效数据并自动重试", compare: "对比", comparePlaceholder: "代码或名称", compareEmpty: "暂无对比标的", compareLimit: "最多叠加 3 个标的", compareIndexUnavailable: "当前数据源暂不支持指数 K 线对比", compareReturn: "相对收益", compareAbsolute: "绝对价格", relativeStrength: "相对强弱", excessReturn: "超额收益", correlation: "收益相关性", lastPrice: "最新价", comparisonPerformance: "区间涨跌", comparisonPerformanceHint: "以首个共同交易点为 0%", comparisonAbsoluteHint: "各标的独立归一化至 0-100", intraday: "分时", intradayUnavailable: "分时范围内仅支持分钟 K", ftshareIntradayUnavailable: "当前接入的 FTShare 接口不支持此标的的分钟 K,并非 Key 无效。请切换到 30日或更长范围。", drawing: "画线", drawingName: "名称(可选)", drawingEmpty: "暂无保存的画线", drawingTrend: "趋势线", drawingHorizontal: "水平线", drawingRect: "矩形", drawingFibonacci: "斐波那契", drawingHintOne: "点击一根 K 线设置价位", drawingHintTwo: "再点击一根 K 线完成绘制", drawingSaved: "画线已保存", drawingCleared: "已清除画线", sortManual: "手动排序", sortChangeDesc: "涨幅从高到低", sortChangeAsc: "涨幅从低到高", batchOpen: "打开所选", batchSelectAll: "全选", batchDelete: "删除所选", batchMoveTo: "移动到…", batchRemoved: "已删除 {count} 只", batchMoved: "已移动 {count} 只", importDone: "已导入 {count} 只", groupSummary: "分组总览", noQuote: "暂无行情",
1574
1549
  sourceIntroTitle: "数据源简介", sourceIntro: "FTShare 是默认数据源;日 K 与常用指标可直接使用,分钟 K、新闻和其他内容取决于接口与套餐。", sourceAutoloadTitle: "自动使用已有的 FTShare Key", sourceAutoload: "dsh_kline 会先复用当前 DSH 可读取的 Key(宿主环境、指定凭据文件或 DSH 的 FTShare 设置);若没有,再使用本插件此前保存到本机的 Key。Key 不会显示或上传。", ftshareConfigTitle: "当前连接", checkAvailability: "检测接口可用性", changeConfig: "更改配置", ftshareConfigDialogTitle: "更改 FTShare 配置", ftshareConfigMenuTitle: "FTShare 配置", sourceCapabilities: "接口可用性检测",
@@ -1580,7 +1555,6 @@ const UI_COPY = {
1580
1555
  capDaily: "Daily K-lines", capIndicators: "Technical indicators", capMinute: "Minute K-lines", capNews: "News", capMarket: "Market data", capCompany: "Company data", capAvailable: "Available now", capSourceDependent: "Source dependent", capLocked: "Not included in current plan", capNotTested: "Not tested",
1581
1556
  range1d: "1D", range5d: "5D", range10d: "10D", range30d: "30D", rangeYtd: "YTD", range1y: "1Y", range5y: "5Y",
1582
1557
  keyLevels: "Key levels", keyLevelsLoading: "Analyzing key levels…", keyLevelsNeedData: "Load valid K-line data before analyzing key levels.", keyLevelsFailed: "Notice: key-level analysis is temporarily unavailable. Try again later.", keyLevelPlanTitle: "Key-level reference", keyLevelPlanNote: "For research only, not trading advice", keyPlanSupport: "Support", keyPlanResistance: "Resistance", keyPlanBreakout: "Breakout", keyPlanStop: "Risk reference", keyPlanTarget: "Target reference", keyPlanSupportDetail: "A zone to watch on a pullback", keyPlanResistanceDetail: "An overhead resistance zone", keyPlanBreakoutDetail: "Watch for a confirmed close above", keyPlanStopDetail: "Reassess if support is lost", keyPlanTargetDetail: "The next resistance reference", keyPlanSave: "Save as my level", keyPlanSaved: "Saved as my level", helpExamplesTitle: "Try asking", helpExampleOne: "Show the K-line for Zijin Mining", helpExampleTwo: "Analyze support and resistance for the past month", helpExampleThree: "Compare Zijin Mining with the CSI 300", helpExampleFour: "Show recent news and company information for this symbol",
1583
- welcomeItemLevels: "Click “Key levels” when you want support and resistance analysis.",
1584
1558
  clear: "Clear", search: "Search", searchSubmit: "Submit search", searchPlaceholder: "Search symbol or name", searchLabel: "Search symbols", versionUpdates: "Version & updates", currentSource: "Active data source", sourceCapabilities: "Available capabilities", sourceCapabilityDaily: "Daily bars and common indicators", sourceCapabilityOptional: "Minute bars / news / market data / company data: source and plan dependent", externalSourceTitle: "Other sources", externalSourceDetail: "Connect another market-data source and keep using charts and indicators.", externalSourceHint: "Connect it through dsh first; direct switching here is not available yet.", sourceFreeMode: "FTShare access is tiered: free plans include basic stock K-lines; minute bars, news, and other capabilities depend on the specific API and plan.", themeCurrent: "Current theme", languageCurrent: "Current language", followHost: "Follow host (default)", themeLight: "Light", themeDark: "Dark", overviewRoleTitle: "How the plugin works", overviewIntro: "dsh_kline is a market-analysis plugin for dsh. dsh understands your request; the plugin loads data, performs the analysis, and presents the chart. Results are returned to the conversation.", overviewStepOne: "Ask in the dsh conversation, for example: “Show a symbol’s K-line and analyze its key levels.”", overviewStepTwo: "The plugin loads the data and analyzes K-lines, technical indicators, and support/resistance levels.", overviewStepThree: "The chart opens on the right and the conclusion appears in the conversation; you can continue with other ranges and indicators.", overviewCapabilitiesTitle: "What it can do", overviewCapabilityOne: "View quotes and K-lines across daily, weekly, monthly, and other intervals.", overviewCapabilityTwo: "Use MA, MACD, KDJ, BOLL, RSI, ATR, VWAP, and volume indicators.", overviewCapabilityThree: "Identify and mark support, resistance, and other key price levels to help review trends and ranges.", overviewCapabilityFour: "Explore range statistics, symbol comparisons, watchlists, alerts, and drawings.", overviewCapabilityFive: "FTShare is the default source, while other sources can provide market data too.", overviewStartTitle: "Get started", overviewStart: "Ask for an analysis in dsh, or find a symbol in the top search bar; select it to open the chart.", feedbackDescription: "Found a problem or have an idea? Send us feedback.", feedbackOpen: "Submit feedback / 提交反馈", feedbackPrivacy: "This opens GitHub; you choose what information to submit.", helpWorkflow: "How to use", helpStepOne: "Enter a symbol or name in the top search bar and press Enter to find it.", helpStepTwo: "Click a symbol to load market data and analysis.", helpStepThree: "1D/5D require minute bars; switch to 30-day or check the FTShare plan when they are unavailable.", helpStepFour: "Watchlists and groups are stored in this browser and are not synced automatically across devices.", updateDescription: "View the current version, change history, and release notes.",
1585
1559
  indicators: "Indicators", indicatorHeading: "Indicators", apply: "Apply",
1586
1560
  maNote: "moving avg", vwapNote: "volume weighted", volNote: "volume", macdNote: "momentum", kdjNote: "stochastic", bollNote: "bands", rsiNote: "strength", atrNote: "volatility",
@@ -1588,7 +1562,7 @@ const UI_COPY = {
1588
1562
  volume: "Vol", volumeUnit: "Volume unit", switchVolume: "Switch volume unit", noResults: "No matching symbols", searching: "Searching…", loading: "Loading candles…", fetchingData: "Fetching market data…", renderingChart: "Updating chart…", dataReady: "Market data ready", dataFailed: "Market data unavailable", retry: "Retry", sessionOpen: "Open", sessionClose: "Close", intradayRangeFallback: "{range} minute history is unavailable; switched to 1D",
1589
1563
  switchToLight: "Switch to light mode", switchToDark: "Switch to dark mode", percentAxis: "Change %", resizeCanvas: "Resize chart height",
1590
1564
  closeTab: "Close tab", chartTabs: "Chart tabs", level: "Level", securityTabs: "Security content", chart: "Chart", news: "News", company: "Company", overview: "Overview", financials: "Financials", holders: "Holders", latestFinancials: "Key financials", majorHolders: "Major holders", noWorkspaceData: "This view is waiting for normalized data from the source", workspaceLoading: "Loading news and company information from the current source…", workspaceReady: "News and company information updated", workspaceUnavailable: "Notice: the current source has not provided news or company data", workspaceDataHint: "Notice: the current source has not provided this information", externalDataHint: "Other sources can be connected; available features depend on what they provide", marketTickerUnavailable: "Market data will appear when a source is connected", sourceEastmoneyFree: "Eastmoney free quotes", sourceTencentFree: "Tencent free quotes", openIndexChart: "Open {name} chart", friendlyNotice: "Notice", ftshareMinuteKeyRequired: "FTShare free data does not include minute bars. Set FTSHARE_API_KEY and retry.", help: "Help", helpTitle: "How to use", helpVersion: "Current version", helpRelease: "View releases and updates", localPreview: "Local preview",
1591
- newsUnavailable: "Notice: the current source has not provided news data", newsUnavailableHint: "Connect a source that supports news to view updates here.", newsEmpty: "No news is available for this symbol", newsEmptyHint: "Try again later or switch to a source that supports news.", companyUnavailable: "Notice: the current source has not provided company data", companyUnavailableHint: "Connect a source that supports company information to view it here.", companyEmpty: "No company information is available for this symbol", companyEmptyHint: "Try again later or switch to a source that supports company information.", settingsTitle: "Settings", closeSettings: "Close settings", language: "Language", theme: "Theme", dataSource: "Data source", settingsSourceHint: "Capabilities depend on the active source.", sourceConnected: "Connected", sourceUnavailable: "Waiting for source", localDataTitle: "Local data", localDataDescription: "Watchlists, groups, drawings, and price markers are saved in this browser. Export a backup or import it on another device.", exportLocalData: "Export local data", importLocalData: "Import local data", localDataExported: "Local data exported", localDataImported: "Local data imported", localDataInvalid: "The file format is invalid; nothing was imported.", ftshareConfigTitle: "FTShare connection", ftshareManage: "Manage FTShare configuration", testCurrentConnection: "Test current connection", configureAndTest: "Configure & test", clearConfig: "Clear", ftshareApiKeyPlaceholder: "Paste FTSHARE_API_KEY (optional)", ftshareApiKeyLabel: "FTShare API Key", ftsharePersist: "Save on this device (recommended)", ftshareConfigNote: "Only configurations readable by the current DSH service are reused. The plugin does not scan other apps, .env files, shell configuration, or keychains.", ftshareConfigured: "FTShare API Key configured and connection succeeded", ftshareConfiguredSaved: "Configured and saved; it will be reused after restart", ftshareCleared: "The FTShare configuration saved by this plugin was cleared", ftshareStatusConfigured: "Installed · API Key configured", ftshareStatusConfiguredSaved: "Installed · Saved for reuse after restart", ftshareStatusEnvironment: "Connected automatically · Host environment", ftshareStatusExternalFile: "Connected automatically · Specified credential file", ftshareStatusSettingsBridge: "Connected automatically · DSH FTShare settings", ftshareStatusSession: "Connected · Current process only", ftshareStatusAnonymous: "Installed · Free data mode", ftshareStatusMissing: "FTShare SDK not installed", ftshareHintEnvironment: "The current DSH service already has FTSHARE_API_KEY. It is never shown, saved, or cleared by the plugin.", ftshareHintExternalFile: "The current DSH service reads the key from a specified credential file; manage it in the host.", ftshareHintSettingsBridge: "The key comes from the DSH FTShare settings page; the plugin never shows or clears it.", ftshareHintPluginStore: "This key was securely saved locally by the plugin and can be cleared here.", ftshareHintSession: "This key works only for the current DSH process and is lost after restart.", ftshareHintAnonymous: "No FTShare key readable by the current DSH service was detected; basic free capability remains available.", ftshareConfigTesting: "Testing FTShare connection…", ftshareConfigFailed: "FTShare connection failed. Check the API Key or try again later.", ftshareConfigInvalid: "Enter an API Key, or click Clear to restore free mode.", ftshareConfigProcessOnly: "This configuration applies only to the current dsh process", ftshareWebsite: "Open FTShare website", ftshareDocs: "View API docs", welcomeTitle: "Welcome to dsh_kline", welcomeLead: "Use natural language to explore quotes, K-lines, indicators, and symbol information.", welcomeItemChart: "Choose a symbol first, then load data and chart analysis when needed.", welcomeItemSource: "FTShare is supported, and other sources can provide normalized OHLCV rows.", welcomeItemWatchlist: "Watchlists and groups are saved in this browser.", welcomeFtshareTitle: "Need more data?", welcomeFtshareDetail: "FTShare access is tiered; minute bars, news, market data, and fundamentals depend on the specific API and plan.", welcomeConfigure: "Configure FTShare", welcomeLater: "Later",
1565
+ newsUnavailable: "Notice: the current source has not provided news data", newsUnavailableHint: "Connect a source that supports news to view updates here.", newsEmpty: "No news is available for this symbol", newsEmptyHint: "Try again later or switch to a source that supports news.", companyUnavailable: "Notice: the current source has not provided company data", companyUnavailableHint: "Connect a source that supports company information to view it here.", companyEmpty: "No company information is available for this symbol", companyEmptyHint: "Try again later or switch to a source that supports company information.", settingsTitle: "Settings", closeSettings: "Close settings", language: "Language", theme: "Theme", dataSource: "Data source", settingsSourceHint: "Capabilities depend on the active source.", sourceConnected: "Connected", sourceUnavailable: "Waiting for source", localDataTitle: "Local data", localDataDescription: "Watchlists, groups, drawings, and price markers are saved in this browser. Export a backup or import it on another device.", exportLocalData: "Export local data", importLocalData: "Import local data", localDataExported: "Local data exported", localDataImported: "Local data imported", localDataInvalid: "The file format is invalid; nothing was imported.", ftshareConfigTitle: "FTShare connection", ftshareManage: "Manage FTShare configuration", testCurrentConnection: "Test current connection", configureAndTest: "Configure & test", clearConfig: "Clear", ftshareApiKeyPlaceholder: "Paste FTSHARE_API_KEY (optional)", ftshareApiKeyLabel: "FTShare API Key", ftsharePersist: "Save on this device (recommended)", ftshareConfigNote: "Only configurations readable by the current DSH service are reused. The plugin does not scan other apps, .env files, shell configuration, or keychains.", ftshareConfigured: "FTShare API Key configured and connection succeeded", ftshareConfiguredSaved: "Configured and saved; it will be reused after restart", ftshareCleared: "The FTShare configuration saved by this plugin was cleared", ftshareStatusConfigured: "Installed · API Key configured", ftshareStatusConfiguredSaved: "Installed · Saved for reuse after restart", ftshareStatusEnvironment: "Connected automatically · Host environment", ftshareStatusExternalFile: "Connected automatically · Specified credential file", ftshareStatusSettingsBridge: "Connected automatically · DSH FTShare settings", ftshareStatusSession: "Connected · Current process only", ftshareStatusAnonymous: "Installed · Free data mode", ftshareStatusMissing: "FTShare SDK not installed", ftshareHintEnvironment: "The current DSH service already has FTSHARE_API_KEY. It is never shown, saved, or cleared by the plugin.", ftshareHintExternalFile: "The current DSH service reads the key from a specified credential file; manage it in the host.", ftshareHintSettingsBridge: "The key comes from the DSH FTShare settings page; the plugin never shows or clears it.", ftshareHintPluginStore: "This key was securely saved locally by the plugin and can be cleared here.", ftshareHintSession: "This key works only for the current DSH process and is lost after restart.", ftshareHintAnonymous: "No FTShare key readable by the current DSH service was detected; basic free capability remains available.", ftshareConfigTesting: "Testing FTShare connection…", ftshareConfigFailed: "FTShare connection failed. Check the API Key or try again later.", ftshareConfigInvalid: "Enter an API Key, or click Clear to restore free mode.", ftshareConfigProcessOnly: "This configuration applies only to the current dsh process", ftshareWebsite: "Open FTShare website", ftshareDocs: "View API docs",
1592
1566
  watchlist: "Watchlist", watchlistEmpty: "No symbols in watchlist", addWatch: "Add to watchlist", removeWatch: "Remove from watchlist", defaultGroup: "Default", newGroup: "New group", renameGroup: "Rename group", save: "Save", groupName: "Group name", groupNameRequired: "Enter a group name", groupNameExists: "That group already exists", create: "Create", cancel: "Cancel", deleteGroup: "Delete group", deleteGroupConfirm: "Delete this group and all of its symbols?", openWatchlistRail: "Open watchlist sidebar", closeWatchlistRail: "Close watchlist sidebar",
1593
1567
  rangeLabel: "Range", intervalLabel: "Interval", custom: "Custom", apply: "Apply", resetZoom: "Reset zoom", alert: "Alerts", alertPrice: "Price", alertNote: "Note (optional)", alertScopeNote: "Checked only while this page is open; no background notifications.", alertEmpty: "No alerts for this symbol", alertAdded: "Price alert added", alertRemoved: "Price alert removed", addWatchAtCandle: "Add to watchlist", analyzeCandle: "Analyze this candle", marketUpdated: "Updated", beijingTime: "Beijing time", delayed: "Delayed", closed: "Closed", stale: "Stale", open: "Open", source: "Source", refresh: "Refresh", refreshing: "Refreshing", retrying: "Refresh failed; keeping the last valid data and retrying", compare: "Compare", comparePlaceholder: "Symbol or name", compareEmpty: "No comparison symbols", compareLimit: "Up to 3 comparison symbols", compareIndexUnavailable: "Index comparison is unavailable with the current data source", compareReturn: "Relative return", compareAbsolute: "Absolute price", relativeStrength: "Relative strength", excessReturn: "Excess return", correlation: "Return correlation", lastPrice: "Last price", comparisonPerformance: "Period return", comparisonPerformanceHint: "First shared point = 0%", comparisonAbsoluteHint: "Each symbol normalized to 0-100", intraday: "Intraday", intradayUnavailable: "Minute candles only for this range", ftshareIntradayUnavailable: "The connected FTShare endpoint does not support minute bars for this symbol; this does not mean the key is invalid. Choose 30-day or longer.", drawing: "Draw", drawingName: "Name (optional)", drawingEmpty: "No saved drawings", drawingTrend: "Trend line", drawingHorizontal: "Horizontal line", drawingRect: "Rectangle", drawingFibonacci: "Fibonacci", drawingHintOne: "Click a candle to set the level", drawingHintTwo: "Click another candle to finish", drawingSaved: "Drawing saved", drawingCleared: "Drawings cleared", sortManual: "Manual order", sortChangeDesc: "Change: high to low", sortChangeAsc: "Change: low to high", batchOpen: "Open selected", batchSelectAll: "Select all", batchDelete: "Delete selected", batchMoveTo: "Move to…", batchRemoved: "Removed {count}", batchMoved: "Moved {count}", importDone: "Imported {count}", groupSummary: "Group overview", noQuote: "No quote",
1594
1568
  sourceIntroTitle: "Data source", sourceIntro: "FTShare is the default source. Daily bars and common indicators are available; minute bars, news, and other data depend on the endpoint and plan.", sourceAutoloadTitle: "Automatically reuse an existing FTShare key", sourceAutoload: "At startup, dsh_kline first reuses a key readable by the current DSH service (host environment, a specified credential file, or the DSH FTShare settings); if none is available, it uses a key previously saved by this plugin. Keys are never shown or uploaded.", ftshareConfigTitle: "Current connection", checkAvailability: "Check API availability", changeConfig: "Change configuration", ftshareConfigDialogTitle: "Change FTShare configuration", ftshareConfigMenuTitle: "FTShare configuration", sourceCapabilities: "API availability checks",
@@ -7639,7 +7613,6 @@ const FTSHARE_MCP_URL = "https://github.com/FTShare-Lab/FTShare-MCP";
7639
7613
  const FTSHARE_WEBSITE_URL = "https://ftai.chat/?tab=ft-share";
7640
7614
  const FTSHARE_DOCS_URL = "https://market.ft.tech/gateway/doc/p/pb8eizu3";
7641
7615
  const DSH_KLINE_VERSION = "__DSH_KLINE_VERSION__";
7642
- const WELCOME_STORAGE_KEY = "dsh_kline_welcome_seen_v1";
7643
7616
  function setSettingsOpen(open) {
7644
7617
  const popover = document.getElementById("settingsPopover");
7645
7618
  const button = document.getElementById("settingsBtn");
@@ -7651,43 +7624,12 @@ function setSettingsOpen(open) {
7651
7624
  button.setAttribute("aria-expanded", String(nextOpen));
7652
7625
  if (nextOpen) showSettingsSection();
7653
7626
  }
7654
- function closeWelcome() {
7655
- const dialog = document.getElementById("welcomeDialog");
7656
- if (dialog) dialog.hidden = true;
7657
- try { window.localStorage?.setItem(WELCOME_STORAGE_KEY, "1"); } catch {}
7658
- acknowledgeInterface();
7659
- document.getElementById("interfaceBtn")?.focus();
7660
- }
7661
- function showWelcomeIfFirstRun() {
7627
+ function showInterfaceUpgradeIfNeeded() {
7662
7628
  const bridge = window.__DSH_KLINE_INTERFACE__;
7663
- if (bridge) {
7664
- const kind = bridge.onboardingKind();
7665
- if (kind === "none") return;
7666
- if (kind === "upgrade") {
7667
- document.getElementById("uiUpgradeCurrent").textContent = interfaceCurrentText();
7668
- document.getElementById("uiUpgradeDialog").hidden = false;
7669
- document.getElementById("uiUpgradeKeep").focus();
7670
- return;
7671
- }
7672
- const hint = document.getElementById("interfaceWelcomeCurrent");
7673
- hint.hidden = false;
7674
- hint.textContent = interfaceCurrentText() + ". " + t("interfaceWelcomeHint");
7675
- }
7676
- let seen = false;
7677
- try { seen = window.localStorage?.getItem(WELCOME_STORAGE_KEY) === "1"; } catch {}
7678
- if (seen) return;
7679
- const dialog = document.getElementById("welcomeDialog");
7680
- if (!dialog) return;
7681
- dialog.hidden = false;
7682
- document.getElementById("welcomeLaterBtn")?.focus();
7683
- }
7684
- function openSettingsFromWelcome() {
7685
- closeWelcome();
7686
- const popover = document.getElementById("settingsPopover");
7687
- const button = document.getElementById("settingsBtn");
7688
- if (!popover || !button) return;
7689
- setSettingsOpen(true);
7690
- showSettingsSection("source");
7629
+ if (!bridge || bridge.onboardingKind() !== "upgrade") return;
7630
+ document.getElementById("uiUpgradeCurrent").textContent = interfaceCurrentText();
7631
+ document.getElementById("uiUpgradeDialog").hidden = false;
7632
+ document.getElementById("uiUpgradeKeep").focus();
7691
7633
  }
7692
7634
  function interfaceCurrentText() {
7693
7635
  const state = window.__DSH_KLINE_INTERFACE__ || { preference: "auto", mode: "classic" };
@@ -7755,13 +7697,12 @@ function initInterfaceControls() {
7755
7697
  // Modal keyboard handling runs before chart shortcuts, and returns focus to
7756
7698
  // the persistent trigger when the user dismisses either surface.
7757
7699
  document.addEventListener("keydown", event => {
7758
- const panel = ["interfacePopover", "uiUpgradeDialog", "welcomeDialog"].map(id => document.getElementById(id)).find(node => node && !node.hidden);
7700
+ const panel = ["interfacePopover", "uiUpgradeDialog"].map(id => document.getElementById(id)).find(node => node && !node.hidden);
7759
7701
  if (!panel) return;
7760
7702
  if (event.key === "Escape") {
7761
7703
  event.preventDefault(); event.stopImmediatePropagation();
7762
7704
  if (panel.id === "interfacePopover") setInterfaceOpen(false);
7763
- else if (panel.id === "uiUpgradeDialog") closeInterfaceUpgrade();
7764
- else closeWelcome();
7705
+ else closeInterfaceUpgrade();
7765
7706
  } else if (event.key === "Tab") {
7766
7707
  const focusable = Array.from(panel.querySelectorAll('button, input, a[href], select, [tabindex="0"]')).filter(node => !node.disabled && node.getClientRects().length);
7767
7708
  const first = focusable[0], last = focusable[focusable.length - 1];
@@ -9176,12 +9117,6 @@ document.getElementById("ftshareClearBtn").addEventListener("click", () => clear
9176
9117
  document.getElementById("ftshareApiKeyInput").addEventListener("keydown", (event) => {
9177
9118
  if (event.key === "Enter") { event.preventDefault(); configureFtshareFromSettings().catch(console.warn); }
9178
9119
  });
9179
- document.getElementById("welcomeCloseBtn").addEventListener("click", closeWelcome);
9180
- document.getElementById("welcomeLaterBtn").addEventListener("click", closeWelcome);
9181
- document.getElementById("welcomeConfigureBtn").addEventListener("click", openSettingsFromWelcome);
9182
- document.getElementById("welcomeDialog").addEventListener("click", (event) => {
9183
- if (event.target === event.currentTarget) closeWelcome();
9184
- });
9185
9120
  document.getElementById("alertMenuBtn").addEventListener("click", (event) => {
9186
9121
  event.stopPropagation();
9187
9122
  const popover = document.getElementById("alertPopover");
@@ -9408,8 +9343,6 @@ document.addEventListener("keydown", (event) => {
9408
9343
  resetChartViewport();
9409
9344
  } else if (event.key === "Escape") {
9410
9345
  closeClearPopover();
9411
- const welcome = document.getElementById("welcomeDialog");
9412
- if (welcome && !welcome.hidden) { closeWelcome(); return; }
9413
9346
  hideChartContextMenu();
9414
9347
  document.getElementById("alertPopover")?.classList.remove("open");
9415
9348
  document.getElementById("alertMenuBtn")?.setAttribute("aria-expanded", "false");
@@ -9616,9 +9549,10 @@ async function init() {
9616
9549
  scheduleSymbolDirectoryRefresh();
9617
9550
  scheduleCommonIndexPrefetch();
9618
9551
  }, MARKET_BACKGROUND_DELAY_MS);
9619
- // The welcome tour belongs to the main entry, not to every panel a host
9620
- // mounts: an embedded view must not pop dialogs over someone's canvas.
9621
- if (!embedded) window.setTimeout(showWelcomeIfFirstRun, 300);
9552
+ // The one-time interface upgrade notice belongs to the main entry, not to
9553
+ // every panel a host mounts: an embedded view must not pop dialogs over
9554
+ // someone's canvas.
9555
+ if (!embedded) window.setTimeout(showInterfaceUpgradeIfNeeded, 300);
9622
9556
  reportSize();
9623
9557
  setChartStatus(isLauncher ? "搜索股票名称或代码开始查看 K 线" : "");
9624
9558
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsh-ft/dsh-fft-paper-trading",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "A-share and commodity futures paper trading for DeepSeek Harness: local ledger, batch orders, review, and FTShare quotes.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",