@dsh-ft/dsh-fft-paper-trading 0.6.0 → 0.6.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.
- package/README.md +4 -4
- package/README.zh.md +4 -4
- package/lib/agent/format.d.ts.map +1 -1
- package/lib/agent/format.js +4 -0
- package/lib/agent/format.js.map +1 -1
- package/lib/agent/tools.d.ts.map +1 -1
- package/lib/agent/tools.js +5 -3
- package/lib/agent/tools.js.map +1 -1
- package/lib/client.js +76 -13
- package/lib/contract.d.ts.map +1 -1
- package/lib/contract.js +3 -1
- package/lib/contract.js.map +1 -1
- package/lib/core/risk.d.ts.map +1 -1
- package/lib/core/risk.js +10 -2
- package/lib/core/risk.js.map +1 -1
- package/lib/core/views.js +2 -2
- package/lib/core/views.js.map +1 -1
- package/lib/data/ftshare-trading-calendar.d.ts +47 -12
- package/lib/data/ftshare-trading-calendar.d.ts.map +1 -1
- package/lib/data/ftshare-trading-calendar.js +156 -44
- package/lib/data/ftshare-trading-calendar.js.map +1 -1
- package/lib/service/paper-service.d.ts +1 -1
- package/lib/service/paper-service.d.ts.map +1 -1
- package/lib/service/paper-service.js +24 -12
- package/lib/service/paper-service.js.map +1 -1
- package/lib/service/rpc.d.ts.map +1 -1
- package/lib/service/rpc.js +12 -1
- package/lib/service/rpc.js.map +1 -1
- package/node_modules/@ftshare-lab/dsh-kline/CHANGELOG.md +98 -0
- package/node_modules/@ftshare-lab/dsh-kline/README.en.md +116 -26
- package/node_modules/@ftshare-lab/dsh-kline/README.md +125 -25
- package/node_modules/@ftshare-lab/dsh-kline/chart_service.py +38 -0
- package/node_modules/@ftshare-lab/dsh-kline/cordis.patch.yml +3 -9
- package/node_modules/@ftshare-lab/dsh-kline/core/calc.py +63 -269
- package/node_modules/@ftshare-lab/dsh-kline/core/rows.py +15 -3
- package/node_modules/@ftshare-lab/dsh-kline/core/ta_engine.py +99 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/candle-sequence.js +15 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/chart-annotations.js +33 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/chart-applications.js +1 -1
- package/node_modules/@ftshare-lab/dsh-kline/lib/chart-context.js +12 -3
- package/node_modules/@ftshare-lab/dsh-kline/lib/chart-observation.js +91 -2
- package/node_modules/@ftshare-lab/dsh-kline/lib/chart-sources.js +64 -13
- package/node_modules/@ftshare-lab/dsh-kline/lib/client.js +3356 -787
- package/node_modules/@ftshare-lab/dsh-kline/lib/drawing-feedback.js +96 -19
- package/node_modules/@ftshare-lab/dsh-kline/lib/fibonacci.js +18 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/index.js +19 -2
- package/node_modules/@ftshare-lab/dsh-kline/lib/labeled-polyline.js +17 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/price-bands.js +55 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/price-series.js +47 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/price-sticks.js +32 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/candle-sequence.d.ts +2 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/chart-annotations.d.ts +4 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/chart-context.d.ts +1 -1
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/chart-observation.d.ts +2 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/BetterSidebarTab.d.ts +3 -2
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/ClassicShell.d.ts +1 -1
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/chart-context.d.ts +1 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/client-context.d.ts +14 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/conversation.d.ts +11 -3
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/embed.d.ts +2 -2
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/generated-view.d.ts +1 -1
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/host-services.d.ts +0 -36
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/index.d.ts +2 -1
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/native-sidebar-contract.d.ts +35 -4
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/native-sidebar-register.d.ts +46 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/native-sidebar-services.d.ts +45 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/client/native-sidebar.d.ts +21 -36
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/fibonacci.d.ts +5 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/labeled-polyline.d.ts +11 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/price-bands.d.ts +3 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/price-series.d.ts +5 -0
- package/node_modules/@ftshare-lab/dsh-kline/lib/types/price-sticks.d.ts +3 -0
- package/node_modules/@ftshare-lab/dsh-kline/package.json +27 -5
- package/node_modules/@ftshare-lab/dsh-kline/requirements.txt +2 -0
- package/node_modules/@ftshare-lab/dsh-kline/scripts/dsh-mcp-plugin.mjs +27 -0
- package/node_modules/@ftshare-lab/dsh-kline/scripts/run-dsh-kline.mjs +180 -49
- package/node_modules/@ftshare-lab/dsh-kline/server.py +300 -34
- package/node_modules/@ftshare-lab/dsh-kline/tools/annotations.py +119 -0
- package/node_modules/@ftshare-lab/dsh-kline/tools/baostock_source.py +176 -0
- package/node_modules/@ftshare-lab/dsh-kline/tools/channel_candidates.py +260 -0
- package/node_modules/@ftshare-lab/dsh-kline/tools/chart_applications.py +1 -1
- package/node_modules/@ftshare-lab/dsh-kline/tools/chart_context.py +22 -3
- package/node_modules/@ftshare-lab/dsh-kline/tools/chart_edits.py +141 -16
- package/node_modules/@ftshare-lab/dsh-kline/tools/chart_functions.py +466 -0
- package/node_modules/@ftshare-lab/dsh-kline/tools/chart_indicators.py +63 -0
- package/node_modules/@ftshare-lab/dsh-kline/tools/draw.py +3 -0
- package/node_modules/@ftshare-lab/dsh-kline/tools/drawing_feedback.py +13 -7
- package/node_modules/@ftshare-lab/dsh-kline/tools/drawing_interaction.py +117 -0
- package/node_modules/@ftshare-lab/dsh-kline/tools/drawing_verification.py +58 -3
- package/node_modules/@ftshare-lab/dsh-kline/tools/fetch.py +164 -40
- package/node_modules/@ftshare-lab/dsh-kline/tools/fibonacci.py +83 -0
- package/node_modules/@ftshare-lab/dsh-kline/tools/free_sources.py +78 -21
- package/node_modules/@ftshare-lab/dsh-kline/tools/pivots.py +60 -0
- package/node_modules/@ftshare-lab/dsh-kline/tools/polylines.py +125 -0
- package/node_modules/@ftshare-lab/dsh-kline/tools/price_bands.py +165 -0
- package/node_modules/@ftshare-lab/dsh-kline/tools/price_series.py +162 -0
- package/node_modules/@ftshare-lab/dsh-kline/tools/price_sticks.py +114 -0
- package/node_modules/@ftshare-lab/dsh-kline/tools/range_candidates.py +170 -0
- package/node_modules/@ftshare-lab/dsh-kline/tools/regression_channels.py +87 -0
- package/node_modules/@ftshare-lab/dsh-kline/tools/ta_functions.py +228 -0
- package/package.json +3 -3
- package/src/agent/format.ts +3 -0
- package/src/agent/tools.ts +5 -3
- package/src/client/index.js +75 -12
- package/src/contract.ts +3 -1
- package/src/core/risk.ts +10 -2
- package/src/core/views.ts +2 -2
- package/src/data/ftshare-trading-calendar.ts +184 -45
- package/src/service/paper-service.ts +22 -19
- package/src/service/rpc.ts +12 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { NativeSidebarTabDefinition } from './host-services.ts';
|
|
2
1
|
/**
|
|
3
2
|
* The static half of the native right-Sidebar integration.
|
|
4
3
|
*
|
|
@@ -6,15 +5,47 @@ import type { NativeSidebarTabDefinition } from './host-services.ts';
|
|
|
6
5
|
* needs a host context, but what this plugin contributes — the tab kind, the
|
|
7
6
|
* band it registers in, the chip title and the guide entry — is plain data.
|
|
8
7
|
*/
|
|
9
|
-
/**
|
|
10
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Implementation identity of the tab type; also the key its body registers
|
|
10
|
+
* under. The host only requires it to be unique across every registration, and
|
|
11
|
+
* a package name is the natural value for a type shipped from another package.
|
|
12
|
+
*/
|
|
13
|
+
export declare const NATIVE_TAB_ID = "@ftshare-lab/dsh-kline";
|
|
14
|
+
/** One tab type as DSH's own right-Sidebar registry takes it (the members this plugin sets). */
|
|
15
|
+
export interface NativeSidebarTabDefinition {
|
|
16
|
+
/** Implementation identity, unique across registrations; the body seat dispatches by it. */
|
|
17
|
+
id: string;
|
|
18
|
+
/** Type discriminator — what `openTab` names and what every tab of this type is. */
|
|
19
|
+
kind: string;
|
|
20
|
+
/** Every opening of this type is one page per pane: the chart is a singleton. */
|
|
21
|
+
multiple?: boolean;
|
|
22
|
+
/** Keep a visited body mounted through hiding, Session changes and docking. */
|
|
23
|
+
keepMounted?: boolean;
|
|
24
|
+
/** `extension` is the band for a type shipped outside the product, which is this one. */
|
|
25
|
+
priority?: 'extension' | 'builtin' | 'fallback';
|
|
26
|
+
/** The chip text captured when a tab of this type opens. */
|
|
27
|
+
title: (address: string) => string;
|
|
28
|
+
/** Entry boxes the host's guide page offers for opening this type. */
|
|
29
|
+
guide?: readonly NativeSidebarGuideEntry[];
|
|
30
|
+
}
|
|
31
|
+
/** One guide entry: a capsule that opens this tab type when picked. */
|
|
32
|
+
export interface NativeSidebarGuideEntry {
|
|
33
|
+
id: string;
|
|
34
|
+
order: number;
|
|
35
|
+
title: () => string;
|
|
36
|
+
description?: () => string;
|
|
37
|
+
}
|
|
11
38
|
/**
|
|
12
39
|
* The type definition this plugin contributes.
|
|
13
40
|
*
|
|
14
41
|
* A page type (no address `patterns`) is opened by kind, which is what the
|
|
15
42
|
* auto-open path does; the guide entry is how a person reaches the chart from
|
|
16
|
-
* the host's own
|
|
43
|
+
* the host's own add-tab page. Both keep the product label separate from the
|
|
17
44
|
* internal kind, exactly like the Better Sidebar title does.
|
|
45
|
+
*
|
|
46
|
+
* `keepMounted` matters for the chart: collapsing the right column or
|
|
47
|
+
* switching tabs must not tear the chart down, because the view keeps its
|
|
48
|
+
* own state (last instrument reference, zoom, drawings) that a remount loses.
|
|
18
49
|
*/
|
|
19
50
|
export declare function nativeTabDefinition(): NativeSidebarTabDefinition;
|
|
20
51
|
/** One line under the guide capsule: what picking it opens, in the host language. */
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { SidebarRightService, SidebarRightTabsService, SlotsService } from './native-sidebar-services';
|
|
2
|
+
/**
|
|
3
|
+
* The native right-Sidebar registration, without React and without a host
|
|
4
|
+
* context: a pure function over the three host services, so the bootstrap
|
|
5
|
+
* policy (both stages, their teardown order, the deferred body seat) is
|
|
6
|
+
* testable with fakes.
|
|
7
|
+
*
|
|
8
|
+
* A DSH host that owns its right column publishes `sidebarRightTabs` (stage
|
|
9
|
+
* one — what the tab type is) and a keyed `sidebar.right.pane.tab` seat
|
|
10
|
+
* (stage two — the body), navigated by `sidebarRight`. A type without a body
|
|
11
|
+
* makes the host draw "nothing can view this", so the two stages are one unit
|
|
12
|
+
* and any failure backs the type out again.
|
|
13
|
+
*/
|
|
14
|
+
/** The seat a tab type's body registers under. */
|
|
15
|
+
export declare const BODY_SEAT = "sidebar.right.pane.tab";
|
|
16
|
+
/** The host services registration needs, all of them already resolved. */
|
|
17
|
+
export interface NativeTabHost {
|
|
18
|
+
readonly tabs: SidebarRightTabsService;
|
|
19
|
+
readonly navigation: SidebarRightService;
|
|
20
|
+
readonly slots: SlotsService;
|
|
21
|
+
}
|
|
22
|
+
/** What to register, and how the caller wants to hear about it. */
|
|
23
|
+
export interface NativeTabOptions {
|
|
24
|
+
/** The body component registered into the keyed seat. */
|
|
25
|
+
readonly body: unknown;
|
|
26
|
+
/** Business props the body receives; the framework adds its own standard share. */
|
|
27
|
+
readonly bodyProps?: (sessionId: string) => Record<string, unknown>;
|
|
28
|
+
/** Called whenever `available()` changes. */
|
|
29
|
+
readonly onChange?: () => void;
|
|
30
|
+
}
|
|
31
|
+
/** A live native tab: what the router asks, and how the auto-open path opens it. */
|
|
32
|
+
export interface NativeTabRegistration {
|
|
33
|
+
/** Both stages are in place: the tab can actually draw. */
|
|
34
|
+
available(): boolean;
|
|
35
|
+
/** Open (or reveal) the chart tab of the session on screen. */
|
|
36
|
+
open(): void;
|
|
37
|
+
/** Back both stages out. Idempotent, and every teardown is failure-isolated. */
|
|
38
|
+
dispose(): void;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Register the chart as a tab type of the host's right column.
|
|
42
|
+
* @param host - the resolved host services.
|
|
43
|
+
* @param options - the body, its props, and the availability callback.
|
|
44
|
+
* @returns the registration, live until `dispose()`.
|
|
45
|
+
*/
|
|
46
|
+
export declare function registerNativeTab(host: NativeTabHost, options: NativeTabOptions): NativeTabRegistration;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Sessions } from './conversation';
|
|
2
|
+
import type { NativeSidebarTabDefinition } from './native-sidebar-contract';
|
|
3
|
+
/**
|
|
4
|
+
* The slices of the host services this plugin reaches for.
|
|
5
|
+
*
|
|
6
|
+
* Each slice names only the members used here, so a host that ships a
|
|
7
|
+
* compatible implementation works without this package depending on the
|
|
8
|
+
* host's client packages. The shapes follow DSH 0.2.1's public faces:
|
|
9
|
+
* `@deepseek-ai/dsh-client-ui-sidebar-right/client` (tab registry and
|
|
10
|
+
* navigation), and `@deepseek-ai/dsh-client-ui-slots` (the keyed seat).
|
|
11
|
+
*/
|
|
12
|
+
/** The right-Sidebar tab registry: stage one of a tab type's registration. */
|
|
13
|
+
export interface SidebarRightTabsService {
|
|
14
|
+
register(definition: NativeSidebarTabDefinition): () => void;
|
|
15
|
+
}
|
|
16
|
+
/** The right-Sidebar navigation face: how a page type is opened. */
|
|
17
|
+
export interface SidebarRightService {
|
|
18
|
+
openTab(kind: string, options?: {
|
|
19
|
+
params?: unknown;
|
|
20
|
+
}): void;
|
|
21
|
+
}
|
|
22
|
+
/** The host `slots` service, limited to the keyed body seat. */
|
|
23
|
+
export interface SlotsService {
|
|
24
|
+
inject(name: string, factory: () => unknown): unknown;
|
|
25
|
+
register(options: SlotsRegistration, component: unknown): () => void;
|
|
26
|
+
}
|
|
27
|
+
/** One keyed seat registration: the body that draws the tabs of `key`'s type. */
|
|
28
|
+
export interface SlotsRegistration {
|
|
29
|
+
name: string;
|
|
30
|
+
key?: string;
|
|
31
|
+
/** Business props for the body; the framework adds the standard share. */
|
|
32
|
+
inject?: (sessionId: string) => Record<string, unknown>;
|
|
33
|
+
}
|
|
34
|
+
/** The metadata hook the host seat binds into every tab body. */
|
|
35
|
+
export interface NativeTabInfo {
|
|
36
|
+
tab: {
|
|
37
|
+
readonly visible: boolean;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/** What the body seat hands a registered body: its session and the props it needs. */
|
|
41
|
+
export interface NativeTabBodyProps {
|
|
42
|
+
readonly sessionId: string;
|
|
43
|
+
readonly sessions: Sessions;
|
|
44
|
+
readonly useTabInfo: () => NativeTabInfo;
|
|
45
|
+
}
|
|
@@ -1,50 +1,35 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type
|
|
3
|
-
|
|
1
|
+
import type { ClientContext } from './client-context';
|
|
2
|
+
import { type Sessions } from './conversation';
|
|
3
|
+
import type { NativeTabBodyProps } from './native-sidebar-services';
|
|
4
4
|
/**
|
|
5
5
|
* The chart as a tab of the host's own right column.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
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.
|
|
7
|
+
* The registration policy lives in `native-sidebar-register.ts`; this module
|
|
8
|
+
* owns the two things that need React or the client context: the tab body and
|
|
9
|
+
* the auto-open trigger. The body is the same chart the Better Sidebar tab
|
|
10
|
+
* draws, mounted against the tab's own conversation.
|
|
18
11
|
*/
|
|
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
12
|
/**
|
|
32
|
-
* One tab body: the
|
|
33
|
-
* panel draw, mounted against the tab's own conversation.
|
|
13
|
+
* One tab body: the chart of the tab's session.
|
|
34
14
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
15
|
+
* A registered tab can still be opened while the user chose Classic mode, or
|
|
16
|
+
* remain mounted while the host changes Sessions. Only the active conversation
|
|
17
|
+
* in Tab mode may publish a chart; otherwise show a harmless explanation.
|
|
18
|
+
* When that conversation owns the tab, visibility is passed through so a
|
|
19
|
+
* collapsed column does not discard the chart's viewport.
|
|
38
20
|
*/
|
|
39
21
|
export declare function NativeKlineTabBody({ sessionId, sessions, useTabInfo }: NativeTabBodyProps): import("react").JSX.Element;
|
|
40
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* Auto-open lives in the tab's own session, exactly like the Better Sidebar
|
|
24
|
+
* path; the router decides whether this path is the active interface.
|
|
25
|
+
*/
|
|
41
26
|
export declare function NativeSidebarBridgeView({ bridge, sessions }: {
|
|
42
27
|
bridge: NativeSidebarBridge;
|
|
43
28
|
sessions: Sessions;
|
|
44
29
|
}): import("react").JSX.Element | null;
|
|
45
30
|
/** The host-facing handle the router polls to decide which interface to draw. */
|
|
46
31
|
export interface NativeSidebarBridge {
|
|
47
|
-
/**
|
|
32
|
+
/** Both stages registered: the host can draw the chart tab. */
|
|
48
33
|
available(): boolean;
|
|
49
34
|
/** Open (or reveal) the chart tab of the session on screen. */
|
|
50
35
|
open(): void;
|
|
@@ -52,9 +37,9 @@ export interface NativeSidebarBridge {
|
|
|
52
37
|
/**
|
|
53
38
|
* Register the chart tab into the host's native right Sidebar.
|
|
54
39
|
*
|
|
55
|
-
* Every host service is optional: a host without `sidebarRightTabs`,
|
|
56
|
-
* or `slots`
|
|
57
|
-
*
|
|
40
|
+
* Every host service is optional: a host without `sidebarRightTabs`,
|
|
41
|
+
* `sidebarRight` or `slots` keeps `available() === false` and the plugin's
|
|
42
|
+
* existing interfaces untouched.
|
|
58
43
|
* @param ctx - the client context to register on.
|
|
59
44
|
* @param onChange - called whenever availability changes, so the router repaints.
|
|
60
45
|
* @returns the handle the router and the auto-open path share.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Canonical explicit labeled paths: no sorting, snapping or automatic waves. */
|
|
2
|
+
export interface LabeledPolylinePoint {
|
|
3
|
+
label: string;
|
|
4
|
+
time: number;
|
|
5
|
+
price: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function sanitizePolylinePoints(raw: any): LabeledPolylinePoint[];
|
|
8
|
+
export declare function polylineOverlayPoints(command: any): {
|
|
9
|
+
timestamp: number;
|
|
10
|
+
value: number;
|
|
11
|
+
}[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
declare function source(raw: any): any;
|
|
2
|
+
declare function condition(raw: any): any;
|
|
3
|
+
export { source as sanitizePriceSource, condition as sanitizePriceCondition };
|
|
4
|
+
export declare function sanitizePriceSeriesCommand(raw: any, expectedBars: number, interval: string): any;
|
|
5
|
+
export declare function seriesObservation(raw: any): any;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ftshare-lab/dsh-kline",
|
|
3
|
-
"version": "0.4
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"private": true,
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "DeepSeek Harness K-line plugin for conversational and manual chart drawing, TA-Lib indicators, and FTShare market data.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"files": [
|
|
@@ -17,6 +17,12 @@
|
|
|
17
17
|
"core",
|
|
18
18
|
"docs/images",
|
|
19
19
|
"docs/release-acceptance-v0.4.0.md",
|
|
20
|
+
"docs/release-acceptance-v0.4.1.md",
|
|
21
|
+
"docs/release-acceptance-v0.5.0.md",
|
|
22
|
+
"docs/release-notes-v0.5.0.md",
|
|
23
|
+
"docs/release-acceptance-v0.6.0.md",
|
|
24
|
+
"docs/release-notes-v0.6.0.md",
|
|
25
|
+
"docs/chart-functions.md",
|
|
20
26
|
"!core/**/__pycache__/**",
|
|
21
27
|
"!core/**/*.py[cod]",
|
|
22
28
|
"lib",
|
|
@@ -29,7 +35,16 @@
|
|
|
29
35
|
"tools",
|
|
30
36
|
"!tools/**/__pycache__/**",
|
|
31
37
|
"!tools/**/*.py[cod]",
|
|
32
|
-
"view"
|
|
38
|
+
"view",
|
|
39
|
+
"docs/release-notes-v0.6.1.md",
|
|
40
|
+
"docs/release-acceptance-v0.6.1.md",
|
|
41
|
+
"docs/release-notes-v0.6.2.md",
|
|
42
|
+
"docs/release-acceptance-v0.6.2.md",
|
|
43
|
+
"docs/release-notes-v0.6.3.md",
|
|
44
|
+
"docs/release-acceptance-v0.6.3.md",
|
|
45
|
+
"scripts/dsh-mcp-plugin.mjs",
|
|
46
|
+
"docs/release-notes-v0.6.4.md",
|
|
47
|
+
"docs/release-acceptance-v0.6.4.md"
|
|
33
48
|
],
|
|
34
49
|
"main": "lib/index.js",
|
|
35
50
|
"types": "lib/types/index.d.ts",
|
|
@@ -77,15 +92,22 @@
|
|
|
77
92
|
},
|
|
78
93
|
"scripts": {
|
|
79
94
|
"bootstrap": "node ./scripts/run-dsh-kline.mjs --prepare-project",
|
|
80
|
-
"pack:release": "node ./scripts/build-release-package.mjs ./release/dsh-kline.tgz",
|
|
95
|
+
"pack:release": "node ./scripts/build-release-package.mjs ./release/dsh-kline-v0.6.4.tgz",
|
|
96
|
+
"pack:codex": "node ./scripts/build-codex-package.mjs ./release/ft-kline-v0.6.4.zip && node ./scripts/verify-codex-package.mjs ./release/ft-kline-v0.6.4.zip",
|
|
97
|
+
"smoke:codex-package": "python ./scripts/smoke-codex-package.py ./release/ft-kline-v0.6.4.zip",
|
|
81
98
|
"generate:client-view": "node ./scripts/generate-client-view.mjs",
|
|
82
99
|
"build:sidebar": "pnpm generate:client-view && tsc -p tsconfig.json && tsdown --config tsdown.config.ts && pnpm verify:package",
|
|
83
100
|
"verify:package": "node ./scripts/verify-package.mjs",
|
|
101
|
+
"verify:packages": "pnpm verify:package && pnpm pack:release && pnpm pack:codex",
|
|
84
102
|
"dsh:web": "bash ./scripts/run-dsh-web.sh",
|
|
85
103
|
"test": "node ./scripts/run-tests.mjs",
|
|
86
104
|
"test:node": "node ./scripts/run-tests.mjs --node",
|
|
87
105
|
"test:python": "node ./scripts/run-tests.mjs --python",
|
|
88
|
-
"test:launcher": "node --test tests/launcher-paths.test.mjs"
|
|
106
|
+
"test:launcher": "node --test tests/launcher-paths.test.mjs",
|
|
107
|
+
"generate:codex-catalog": "python scripts/generate-codex-catalog.py",
|
|
108
|
+
"verify:codex-catalog": "python scripts/generate-codex-catalog.py --check",
|
|
109
|
+
"sync:codex-marketplace": "node scripts/sync-codex-marketplace.mjs",
|
|
110
|
+
"verify:codex-marketplace": "node scripts/sync-codex-marketplace.mjs --check"
|
|
89
111
|
},
|
|
90
112
|
"devDependencies": {
|
|
91
113
|
"@deepseek-ai/dsh": "0.1.5-rc.2",
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// A relative Cordis plugin name is anchored beside its bundle patch by DSH.
|
|
2
|
+
// Resolve the Python launcher from this module, including nested/pnpm installs.
|
|
3
|
+
import { existsSync, readFileSync, realpathSync } from 'node:fs'
|
|
4
|
+
import { isAbsolute, join, resolve } from 'node:path'
|
|
5
|
+
import { fileURLToPath } from 'node:url'
|
|
6
|
+
|
|
7
|
+
export const name = 'dsh-kline-mcp-launcher'
|
|
8
|
+
export const inject = ['loader']
|
|
9
|
+
|
|
10
|
+
export function mcpConfiguration(config = {}, env = process.env, packageRoot = fileURLToPath(new URL('..', import.meta.url))) {
|
|
11
|
+
const override = String(env.DSH_KLINE_PACKAGE_ROOT || '').trim()
|
|
12
|
+
if (override && !isAbsolute(override)) throw new Error('DSH_KLINE_PACKAGE_ROOT must be an absolute package directory')
|
|
13
|
+
let root = resolve(override || packageRoot)
|
|
14
|
+
let manifest
|
|
15
|
+
try { root = realpathSync(root); manifest = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8')) } catch {}
|
|
16
|
+
if (manifest?.name !== '@ftshare-lab/dsh-kline' || !existsSync(join(root, 'scripts', 'run-dsh-kline.mjs'))) {
|
|
17
|
+
throw new Error('dsh_kline package directory is incomplete; reinstall the plugin or correct DSH_KLINE_PACKAGE_ROOT')
|
|
18
|
+
}
|
|
19
|
+
return { ...config, command: config.command || process.execPath, transport: 'stdio',
|
|
20
|
+
cwd: root, args: [join(root, 'scripts', 'run-dsh-kline.mjs')] }
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export async function apply(ctx, config) {
|
|
24
|
+
const resolved = mcpConfiguration(config)
|
|
25
|
+
const client = await ctx.loader.import('@deepseek-ai/dsh-mcp-client')
|
|
26
|
+
ctx.plugin(client.default || client, resolved)
|
|
27
|
+
}
|