@ftshare-lab/dsh-kline 0.6.10 → 0.6.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/README.en.md +110 -55
- package/README.md +107 -52
- package/config/dsh-tool-catalog.json +1 -1
- package/docs/embedding.md +34 -0
- package/docs/guide.en.md +1 -1
- package/docs/guide.md +2 -2
- package/docs/npm-release.md +6 -6
- package/docs/release-acceptance-v0.6.11.md +21 -0
- package/docs/release-notes-v0.6.11.md +16 -0
- package/lib/client/PanelHost.js +46 -0
- package/lib/client/generated-view.js +2 -2
- package/lib/client/host-options.js +41 -0
- package/lib/client/host-panels.js +111 -0
- package/lib/client/index.js +19 -4
- package/lib/client/mode-preferences.js +21 -1
- package/lib/client/native-sidebar.js +3 -1
- package/lib/client/ui-onboarding.js +7 -1
- package/lib/client.js +207 -8
- package/lib/client.js.map +1 -1
- package/lib/types/client/PanelHost.d.ts +25 -0
- package/lib/types/client/client-context.d.ts +2 -0
- package/lib/types/client/generated-view.d.ts +1 -1
- package/lib/types/client/host-options.d.ts +38 -0
- package/lib/types/client/host-panels.d.ts +55 -0
- package/lib/types/client/mode-preferences.d.ts +13 -1
- package/lib/types/client/ui-onboarding.d.ts +2 -1
- package/package.json +7 -5
- package/screenshots.json +4 -7
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ClientContext } from './client-context';
|
|
2
|
+
import type { KlineChrome } from './embed';
|
|
3
|
+
import { type KlinePanelProps } from './host-panels.ts';
|
|
4
|
+
/**
|
|
5
|
+
* The chart as a host panel body.
|
|
6
|
+
*
|
|
7
|
+
* The host declares a slot, renders it with `{ symbol, name, onIdentity }` and
|
|
8
|
+
* asks the chart to fill it through `klinePanels.mount(seat)`. The body is the
|
|
9
|
+
* same chart the sidebar and the tab draw, only bounded and without the
|
|
10
|
+
* workspace chrome that belongs to the sidebar.
|
|
11
|
+
*/
|
|
12
|
+
export declare function KlinePanelHost({ seat, chrome, symbol, name, onIdentity }: KlinePanelProps & {
|
|
13
|
+
seat: string;
|
|
14
|
+
chrome?: KlineChrome;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
/**
|
|
17
|
+
* Register the optional host panel contract.
|
|
18
|
+
*
|
|
19
|
+
* The `klinePanels` service exists for every host, but it registers nothing
|
|
20
|
+
* until a host mounts a seat: without a caller no slot is injected, so a host
|
|
21
|
+
* that does not know this contract sees the plugin exactly as before. Mounts
|
|
22
|
+
* requested before the `slots` service settles are applied once it does.
|
|
23
|
+
* @param ctx - the client context to register on.
|
|
24
|
+
*/
|
|
25
|
+
export declare function registerPanelHosts(ctx: ClientContext): void;
|
|
@@ -10,5 +10,7 @@ export interface ClientContext {
|
|
|
10
10
|
effect(callback: () => () => void, label?: string): void;
|
|
11
11
|
inject(deps: string[], callback: (ctx: ClientContext) => void): unknown;
|
|
12
12
|
get(name: string): unknown;
|
|
13
|
+
/** Publish an optional service another plugin may inject, such as a host contract. */
|
|
14
|
+
provide(name: string, value: unknown): void;
|
|
13
15
|
sessions: Sessions;
|
|
14
16
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const PACKAGE_VERSION = "0.6.
|
|
1
|
+
export declare const PACKAGE_VERSION = "0.6.11";
|
|
2
2
|
export declare function mountKlineView(root: any, payload: any, dependencies?: {}): () => void;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The optional host contract for the chrome the chart draws itself.
|
|
3
|
+
*
|
|
4
|
+
* A host client plugin provides the `klineHost` service; nothing else changes
|
|
5
|
+
* when it is absent, which is what keeps every upstream default intact. Only
|
|
6
|
+
* the members a host may switch are modelled here, and unknown values collapse
|
|
7
|
+
* to the default, so a newer host can never put the chart in a half-configured
|
|
8
|
+
* state.
|
|
9
|
+
*
|
|
10
|
+
* The store is deliberately framework-free: the router subscribes with
|
|
11
|
+
* `useSyncExternalStore`, and the onboarding classifier reads it once per open.
|
|
12
|
+
*/
|
|
13
|
+
/** What a host may change; every field omitted means the upstream behavior. */
|
|
14
|
+
export interface KlineHostOptions {
|
|
15
|
+
/**
|
|
16
|
+
* `'tab'` — the host owns the chart entry (its own right column), so the
|
|
17
|
+
* chart must not draw the floating classic launcher. Omitted: the user's
|
|
18
|
+
* stored interface preference decides, with the launcher as the fallback.
|
|
19
|
+
*/
|
|
20
|
+
entry?: 'tab';
|
|
21
|
+
/**
|
|
22
|
+
* `'off'` — the host suppresses the first-run welcome and the one-time
|
|
23
|
+
* interface notice. Omitted: upstream onboarding.
|
|
24
|
+
*/
|
|
25
|
+
onboarding?: 'off';
|
|
26
|
+
}
|
|
27
|
+
/** The options the active host provided, if it provided any. */
|
|
28
|
+
export declare function readHostOptions(): KlineHostOptions | undefined;
|
|
29
|
+
/** Subscribe to host option changes; the router repaints when they arrive. */
|
|
30
|
+
export declare function subscribeHostOptions(listener: () => void): () => void;
|
|
31
|
+
/**
|
|
32
|
+
* Take the options a host provided.
|
|
33
|
+
*
|
|
34
|
+
* Unknown or malformed values are dropped rather than trusted, so this stays a
|
|
35
|
+
* closed contract: only the switches this build understands ever take effect.
|
|
36
|
+
* @param value - the service value, or undefined when the host withdrew it.
|
|
37
|
+
*/
|
|
38
|
+
export declare function setHostOptions(value: unknown): void;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The optional host contract for panel mounts.
|
|
3
|
+
*
|
|
4
|
+
* A host that already owns a bounded panel declares a slot of its own and asks
|
|
5
|
+
* the chart to fill it through the `klinePanels` service. The chart therefore
|
|
6
|
+
* never learns a host's slot names, and a host that does not ask sees the
|
|
7
|
+
* plugin exactly as it was before this contract existed.
|
|
8
|
+
*
|
|
9
|
+
* Kept free of React, like `native-sidebar-register.ts`, so the registration
|
|
10
|
+
* policy is testable with fake slot services.
|
|
11
|
+
*/
|
|
12
|
+
import type { KlineChrome } from './embed.ts';
|
|
13
|
+
import type { SlotsService } from './native-sidebar-services.ts';
|
|
14
|
+
/** Props a host slot passes to the chart panel it mounts. */
|
|
15
|
+
export interface KlinePanelProps {
|
|
16
|
+
/** The instrument the host currently has selected. */
|
|
17
|
+
symbol?: string;
|
|
18
|
+
/** Display name of that instrument, when the host has one. */
|
|
19
|
+
name?: string;
|
|
20
|
+
/** The chart's own selection, published back so the host can update its ticket. */
|
|
21
|
+
onIdentity?: (symbol?: string, name?: string) => void;
|
|
22
|
+
}
|
|
23
|
+
/** The optional service a host calls to fill its own panel seat with the chart. */
|
|
24
|
+
export interface KlinePanelsService {
|
|
25
|
+
/**
|
|
26
|
+
* Fill `seat` with the chart panel.
|
|
27
|
+
* @param seat - a slot name the host itself declares and renders.
|
|
28
|
+
* @param options.chrome - chrome the panel keeps (default `chart-search`).
|
|
29
|
+
* Repeated mounts with the same chrome share one panel until all callers
|
|
30
|
+
* release it. Conflicting chrome is rejected while the seat is in use.
|
|
31
|
+
* @returns an idempotent disposer for this caller's mount.
|
|
32
|
+
*/
|
|
33
|
+
mount(seat: string, options?: {
|
|
34
|
+
chrome?: KlineChrome;
|
|
35
|
+
}): () => void;
|
|
36
|
+
}
|
|
37
|
+
/** The host slice a mount needs: only the slot registry. */
|
|
38
|
+
export interface PanelMountHost {
|
|
39
|
+
readonly slots: SlotsService;
|
|
40
|
+
}
|
|
41
|
+
/** Build the body for one seat; the component side supplies the React element. */
|
|
42
|
+
export type PanelBodyFactory = (seat: string, chrome: KlineChrome | undefined) => unknown;
|
|
43
|
+
/** Pending requests survive slot-service replacement; callers own separate leases. */
|
|
44
|
+
export interface PanelMountRegistry extends KlinePanelsService {
|
|
45
|
+
connect(service: KlinePanelsService): () => void;
|
|
46
|
+
}
|
|
47
|
+
/** Coordinate caller lifetimes independently of the current slot-service lifetime. */
|
|
48
|
+
export declare function createPanelMountRegistry(): PanelMountRegistry;
|
|
49
|
+
/**
|
|
50
|
+
* Turn slot services plus a body factory into the `klinePanels` service.
|
|
51
|
+
* @param host - the host services a mount registers into.
|
|
52
|
+
* @param body - the component body for one seat (one per mounted seat).
|
|
53
|
+
* @returns the service a host calls; nothing is registered until it calls.
|
|
54
|
+
*/
|
|
55
|
+
export declare function createPanelMounts(host: PanelMountHost, body: PanelBodyFactory): KlinePanelsService;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { KlineHostOptions } from './host-options.ts';
|
|
1
2
|
export type DisplayMode = 'auto' | 'classic' | 'better-sidebar';
|
|
2
3
|
export declare const DISPLAY_MODE_KEY = "dsh-kline:display-mode:v1";
|
|
3
4
|
export declare const AUTO_OPEN_KEY = "dsh-kline:auto-open-after-analysis:v1";
|
|
@@ -9,5 +10,16 @@ export interface InterfaceState {
|
|
|
9
10
|
}
|
|
10
11
|
export declare const InterfaceContext: import("react").Context<InterfaceState>;
|
|
11
12
|
export declare function readDisplayMode(storage?: Storage): DisplayMode;
|
|
12
|
-
export declare function resolveDisplayMode(preference: DisplayMode, available: boolean): InterfaceState['mode'];
|
|
13
|
+
export declare function resolveDisplayMode(preference: DisplayMode, available: boolean, host?: KlineHostOptions): InterfaceState['mode'];
|
|
14
|
+
/**
|
|
15
|
+
* Whether the floating classic launcher is drawn for this frame.
|
|
16
|
+
*
|
|
17
|
+
* Upstream keeps it for classic mode and for screens without a Session, where
|
|
18
|
+
* the tab body cannot live yet. A host that declared `entry: 'tab'` owns the
|
|
19
|
+
* chart entry instead, so it never draws the launcher.
|
|
20
|
+
* @param host - the host options, if the host provided any.
|
|
21
|
+
* @param mode - the interface mode this frame resolved to.
|
|
22
|
+
* @param hasConversation - whether a Session exists to host a tab body.
|
|
23
|
+
*/
|
|
24
|
+
export declare function shouldDrawClassicLauncher(host: KlineHostOptions | undefined, mode: InterfaceState['mode'], hasConversation: boolean): boolean;
|
|
13
25
|
export declare function readAutoOpen(storage?: Storage): boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { type KlineHostOptions } from './host-options.ts';
|
|
1
2
|
export declare const ONBOARDING_KEY = "dsh-kline:onboarding-version:v2";
|
|
2
3
|
export declare function hasPreviousUsage(storage: Storage): boolean;
|
|
3
4
|
export declare function captureOnboarding(storage?: Storage): void;
|
|
4
|
-
export declare function onboardingKind(storage?: Storage): 'upgrade' | 'first' | 'none';
|
|
5
|
+
export declare function onboardingKind(storage?: Storage, host?: KlineHostOptions | undefined): 'upgrade' | 'first' | 'none';
|
|
5
6
|
export declare function classifyOnboarding(storage: Storage, previousUsage: boolean): 'upgrade' | 'first' | 'none';
|
|
6
7
|
export declare function acknowledgeOnboarding(storage?: Storage): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ftshare-lab/dsh-kline",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.11",
|
|
4
4
|
"description": "DeepSeek Harness K-line plugin for conversational and manual chart drawing, TA-Lib indicators, and FTShare market data.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -69,7 +69,9 @@
|
|
|
69
69
|
"docs/drawing-examples.en.md",
|
|
70
70
|
"docs/provider-adaptation.md",
|
|
71
71
|
"docs/release-notes-v0.6.10.md",
|
|
72
|
-
"docs/release-acceptance-v0.6.10.md"
|
|
72
|
+
"docs/release-acceptance-v0.6.10.md",
|
|
73
|
+
"docs/release-notes-v0.6.11.md",
|
|
74
|
+
"docs/release-acceptance-v0.6.11.md"
|
|
73
75
|
],
|
|
74
76
|
"main": "lib/index.js",
|
|
75
77
|
"types": "lib/types/index.d.ts",
|
|
@@ -117,9 +119,9 @@
|
|
|
117
119
|
},
|
|
118
120
|
"scripts": {
|
|
119
121
|
"bootstrap": "node ./scripts/run-dsh-kline.mjs --prepare-project",
|
|
120
|
-
"pack:release": "node ./scripts/build-release-package.mjs ./release/dsh-kline-v0.6.
|
|
121
|
-
"pack:codex": "node ./scripts/build-codex-package.mjs ./release/ft-kline-v0.6.
|
|
122
|
-
"smoke:codex-package": "python ./scripts/smoke-codex-package.py ./release/ft-kline-v0.6.
|
|
122
|
+
"pack:release": "node ./scripts/build-release-package.mjs ./release/dsh-kline-v0.6.11.tgz",
|
|
123
|
+
"pack:codex": "node ./scripts/build-codex-package.mjs ./release/ft-kline-v0.6.11.zip && node ./scripts/verify-codex-package.mjs ./release/ft-kline-v0.6.11.zip",
|
|
124
|
+
"smoke:codex-package": "python ./scripts/smoke-codex-package.py ./release/ft-kline-v0.6.11.zip",
|
|
123
125
|
"generate:client-view": "node ./scripts/generate-client-view.mjs",
|
|
124
126
|
"build:sidebar": "pnpm generate:client-view && tsc -p tsconfig.json && tsdown --config tsdown.config.ts && pnpm verify:package",
|
|
125
127
|
"verify:package": "node ./scripts/verify-package.mjs",
|
package/screenshots.json
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
[
|
|
2
|
-
"docs/images/
|
|
3
|
-
"docs/images/
|
|
2
|
+
"docs/images/natural-language-abc-wolong-2026-10-27.png",
|
|
3
|
+
"docs/images/natural-language-descending-channel-wolong-2026-10-27.png",
|
|
4
4
|
"docs/images/platform-breakout-msft-v0.6.9.png",
|
|
5
|
-
"docs/images/
|
|
6
|
-
"docs/images/
|
|
7
|
-
"docs/images/kline-support.png",
|
|
8
|
-
"docs/images/kline-range-stats.png",
|
|
9
|
-
"docs/images/kline-news.png",
|
|
5
|
+
"docs/images/main-chart-comparison-v0.6.9.png",
|
|
6
|
+
"docs/images/market-overview-v0.6.9.png",
|
|
10
7
|
"docs/images/dsh-market.png"
|
|
11
8
|
]
|