@tradejs/node 3.1.29-beta.262 → 3.1.29-beta.263
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/dist/chunk-JQOLTLEY.mjs +0 -0
- package/dist/chunk-ZUMUI37V.mjs +0 -0
- package/dist/connectors.mjs +1 -0
- package/dist/diagnostics.d.mts +182 -0
- package/dist/diagnostics.d.ts +182 -0
- package/dist/diagnostics.js +9060 -0
- package/dist/diagnostics.mjs +867 -0
- package/dist/mcp.d.mts +203 -0
- package/dist/mcp.d.ts +203 -0
- package/dist/mcp.js +9257 -0
- package/dist/mcp.mjs +584 -0
- package/dist/registry.mjs +1 -0
- package/dist/runtimeDashboard.mjs +4 -4
- package/package.json +15 -5
package/dist/mcp.d.mts
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import * as _tradejs_types from '@tradejs/types';
|
|
2
|
+
import { McpPrincipal, McpJob, MarketUniverse, Interval } from '@tradejs/types';
|
|
3
|
+
|
|
4
|
+
declare const MCP_JOB_TTL: number;
|
|
5
|
+
declare const mcpJobStorageId: (userName: string, id: string) => string;
|
|
6
|
+
declare const mcpJobDirectory: (job: Pick<McpJob, "userName" | "id">) => string;
|
|
7
|
+
declare const mcpPackageManifestHash: () => Promise<string>;
|
|
8
|
+
declare const enqueueMcpJob: (principal: McpPrincipal, kind: McpJob["kind"], request: Record<string, unknown>, idempotencyKey: string) => Promise<McpJob>;
|
|
9
|
+
declare const readMcpJob: (userName: string, id: string) => Promise<McpJob>;
|
|
10
|
+
declare const cancelMcpJob: (principal: McpPrincipal, id: string) => Promise<McpJob>;
|
|
11
|
+
declare const publicMcpJob: (job: McpJob) => {
|
|
12
|
+
request: {
|
|
13
|
+
[k: string]: unknown;
|
|
14
|
+
};
|
|
15
|
+
logLines: number;
|
|
16
|
+
id: string;
|
|
17
|
+
userName: string;
|
|
18
|
+
clientId: string;
|
|
19
|
+
kind: "backtest" | "runtime-evidence" | "runtime-feedback-replay";
|
|
20
|
+
status: "queued" | "running" | "completed" | "failed" | "cancelled";
|
|
21
|
+
createdAt: number;
|
|
22
|
+
updatedAt: number;
|
|
23
|
+
startedAt?: number;
|
|
24
|
+
finishedAt?: number;
|
|
25
|
+
cancelRequested?: boolean;
|
|
26
|
+
error?: string;
|
|
27
|
+
exitCode?: number | null;
|
|
28
|
+
outputId: string;
|
|
29
|
+
packageManifestSha256: string;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
declare const mcpProjectRoot: () => string;
|
|
33
|
+
declare const isMcpRecord: (value: unknown) => value is Record<string, unknown>;
|
|
34
|
+
declare const mcpId: (value: string) => string;
|
|
35
|
+
/** Defence in depth for user/config/report payloads. Credentials are never MCP data. */
|
|
36
|
+
declare const redactMcpData: (value: unknown) => unknown;
|
|
37
|
+
declare const readMcpMarket: (userName: string, provider: string, universe: MarketUniverse, offset: number, limit: number, symbol?: string) => Promise<{
|
|
38
|
+
provider: string;
|
|
39
|
+
universe: MarketUniverse;
|
|
40
|
+
items: _tradejs_types.Ticker[];
|
|
41
|
+
total: number;
|
|
42
|
+
nextOffset: number | null;
|
|
43
|
+
observedAt: number;
|
|
44
|
+
source: string;
|
|
45
|
+
}>;
|
|
46
|
+
declare const readMcpChart: (userName: string, request: {
|
|
47
|
+
provider: string;
|
|
48
|
+
universe: MarketUniverse;
|
|
49
|
+
symbol: string;
|
|
50
|
+
interval: Interval;
|
|
51
|
+
endTime: number;
|
|
52
|
+
bars: number;
|
|
53
|
+
cacheOnly: boolean;
|
|
54
|
+
indicatorNames?: string[];
|
|
55
|
+
}) => Promise<{
|
|
56
|
+
startTime: number;
|
|
57
|
+
historyStartTime: number;
|
|
58
|
+
warmupBars: number;
|
|
59
|
+
endTime: number;
|
|
60
|
+
candles: _tradejs_types.KlineChartItem[];
|
|
61
|
+
indicators: {
|
|
62
|
+
[k: string]: number[] | _tradejs_types.Candle[];
|
|
63
|
+
};
|
|
64
|
+
availableIndicators: string[];
|
|
65
|
+
observedAt: number;
|
|
66
|
+
source: string;
|
|
67
|
+
closedCandlesOnly: boolean;
|
|
68
|
+
coverage: {
|
|
69
|
+
requestedBars: number;
|
|
70
|
+
availableBars: number;
|
|
71
|
+
complete: boolean;
|
|
72
|
+
};
|
|
73
|
+
provider: string;
|
|
74
|
+
universe: MarketUniverse;
|
|
75
|
+
symbol: string;
|
|
76
|
+
interval: Interval;
|
|
77
|
+
bars: number;
|
|
78
|
+
cacheOnly: boolean;
|
|
79
|
+
indicatorNames?: string[];
|
|
80
|
+
}>;
|
|
81
|
+
declare const readMcpDeployments: (userName: string) => Promise<{
|
|
82
|
+
deployments: {
|
|
83
|
+
heartbeat: _tradejs_types.RuntimeDeploymentHeartbeat | null;
|
|
84
|
+
id: string;
|
|
85
|
+
deploymentCompositionId: string;
|
|
86
|
+
label: string;
|
|
87
|
+
connectorName: string;
|
|
88
|
+
provider: string;
|
|
89
|
+
accountId: string;
|
|
90
|
+
enabled: boolean;
|
|
91
|
+
strategies: _tradejs_types.RuntimeDeploymentStrategy[];
|
|
92
|
+
assetClasses?: _tradejs_types.AssetClass[];
|
|
93
|
+
tickers?: string[];
|
|
94
|
+
}[];
|
|
95
|
+
observedAt: number;
|
|
96
|
+
source: string;
|
|
97
|
+
}>;
|
|
98
|
+
declare const requireMcpDeployment: (userName: string, deploymentId: string) => Promise<{
|
|
99
|
+
heartbeat: _tradejs_types.RuntimeDeploymentHeartbeat | null;
|
|
100
|
+
id: string;
|
|
101
|
+
deploymentCompositionId: string;
|
|
102
|
+
label: string;
|
|
103
|
+
connectorName: string;
|
|
104
|
+
provider: string;
|
|
105
|
+
accountId: string;
|
|
106
|
+
enabled: boolean;
|
|
107
|
+
strategies: _tradejs_types.RuntimeDeploymentStrategy[];
|
|
108
|
+
assetClasses?: _tradejs_types.AssetClass[];
|
|
109
|
+
tickers?: string[];
|
|
110
|
+
}>;
|
|
111
|
+
declare const readMcpStrategies: (userName: string, deploymentId: string) => Promise<{
|
|
112
|
+
deploymentId: string;
|
|
113
|
+
accountId: string;
|
|
114
|
+
strategies: {
|
|
115
|
+
strategyName: string;
|
|
116
|
+
strategyModule: string;
|
|
117
|
+
strategyRevision: string;
|
|
118
|
+
deploymentCompositionId: string;
|
|
119
|
+
generation?: string;
|
|
120
|
+
enabled: boolean;
|
|
121
|
+
controlState: _tradejs_types.RuntimeStrategyControlState;
|
|
122
|
+
interval: Interval;
|
|
123
|
+
universe: MarketUniverse;
|
|
124
|
+
accountId?: string;
|
|
125
|
+
strategyPackage: string;
|
|
126
|
+
strategyPackageVersion: string;
|
|
127
|
+
strategyDependencyVersions: Record<string, string>;
|
|
128
|
+
runtimePackageVersion: string;
|
|
129
|
+
sourceStrategyConfig: _tradejs_types.StrategyConfig;
|
|
130
|
+
strategyConfig: _tradejs_types.StrategyConfig;
|
|
131
|
+
selection?: _tradejs_types.RuntimeStrategySelection;
|
|
132
|
+
}[];
|
|
133
|
+
observedAt: number;
|
|
134
|
+
}>;
|
|
135
|
+
declare const readMcpRuntimePage: (userName: string, kind: "signals" | "evaluations" | "orders", request: {
|
|
136
|
+
deploymentId: string;
|
|
137
|
+
cursor: string;
|
|
138
|
+
startTime: number;
|
|
139
|
+
endTime: number;
|
|
140
|
+
strategy?: string;
|
|
141
|
+
symbol?: string;
|
|
142
|
+
}) => Promise<{
|
|
143
|
+
items: Record<string, unknown>[];
|
|
144
|
+
cursor: string;
|
|
145
|
+
deploymentId: string;
|
|
146
|
+
observedAt: number;
|
|
147
|
+
source: string;
|
|
148
|
+
window: {
|
|
149
|
+
startTime: number;
|
|
150
|
+
endTime: number;
|
|
151
|
+
};
|
|
152
|
+
coverage: string;
|
|
153
|
+
note: string;
|
|
154
|
+
}>;
|
|
155
|
+
declare const readMcpSignal: (userName: string, signalId: string, deploymentId: string, timestamp: number, strategy: string) => Promise<{
|
|
156
|
+
signal: Record<string, unknown>;
|
|
157
|
+
observedAt: number;
|
|
158
|
+
source: string;
|
|
159
|
+
}>;
|
|
160
|
+
declare const readMcpEvaluationStats: (userName: string, deploymentId: string, cursor: string) => Promise<{
|
|
161
|
+
buckets: {
|
|
162
|
+
bucket: string;
|
|
163
|
+
counters: Record<string, string>;
|
|
164
|
+
}[];
|
|
165
|
+
cursor: string;
|
|
166
|
+
observedAt: number;
|
|
167
|
+
source: string;
|
|
168
|
+
immutableEvidence: boolean;
|
|
169
|
+
note: string;
|
|
170
|
+
}>;
|
|
171
|
+
declare const readMcpBacktestPage: (userName: string, kind: "configs" | "results", cursor: string) => Promise<{
|
|
172
|
+
items: {
|
|
173
|
+
id: string;
|
|
174
|
+
value: unknown;
|
|
175
|
+
}[];
|
|
176
|
+
cursor: string;
|
|
177
|
+
observedAt: number;
|
|
178
|
+
source: string;
|
|
179
|
+
}>;
|
|
180
|
+
declare const readMcpBacktestResult: (userName: string, id: string, offset?: number, limit?: number) => Promise<{
|
|
181
|
+
id: string;
|
|
182
|
+
result: {
|
|
183
|
+
results: unknown;
|
|
184
|
+
resultsByTickers: unknown;
|
|
185
|
+
resultsByStrategies: unknown;
|
|
186
|
+
config: unknown;
|
|
187
|
+
mode: unknown;
|
|
188
|
+
startedAt: unknown;
|
|
189
|
+
finishedAt: unknown;
|
|
190
|
+
successTests: unknown;
|
|
191
|
+
errorTests: unknown;
|
|
192
|
+
bestConfig: unknown;
|
|
193
|
+
mergedConfig: unknown;
|
|
194
|
+
runtimeComparison: unknown;
|
|
195
|
+
};
|
|
196
|
+
offset: number;
|
|
197
|
+
total: number;
|
|
198
|
+
nextOffset: number | null;
|
|
199
|
+
observedAt: number;
|
|
200
|
+
source: string;
|
|
201
|
+
}>;
|
|
202
|
+
|
|
203
|
+
export { MCP_JOB_TTL, cancelMcpJob, enqueueMcpJob, isMcpRecord, mcpId, mcpJobDirectory, mcpJobStorageId, mcpPackageManifestHash, mcpProjectRoot, publicMcpJob, readMcpBacktestPage, readMcpBacktestResult, readMcpChart, readMcpDeployments, readMcpEvaluationStats, readMcpJob, readMcpMarket, readMcpRuntimePage, readMcpSignal, readMcpStrategies, redactMcpData, requireMcpDeployment };
|
package/dist/mcp.d.ts
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import * as _tradejs_types from '@tradejs/types';
|
|
2
|
+
import { McpPrincipal, McpJob, MarketUniverse, Interval } from '@tradejs/types';
|
|
3
|
+
|
|
4
|
+
declare const MCP_JOB_TTL: number;
|
|
5
|
+
declare const mcpJobStorageId: (userName: string, id: string) => string;
|
|
6
|
+
declare const mcpJobDirectory: (job: Pick<McpJob, "userName" | "id">) => string;
|
|
7
|
+
declare const mcpPackageManifestHash: () => Promise<string>;
|
|
8
|
+
declare const enqueueMcpJob: (principal: McpPrincipal, kind: McpJob["kind"], request: Record<string, unknown>, idempotencyKey: string) => Promise<McpJob>;
|
|
9
|
+
declare const readMcpJob: (userName: string, id: string) => Promise<McpJob>;
|
|
10
|
+
declare const cancelMcpJob: (principal: McpPrincipal, id: string) => Promise<McpJob>;
|
|
11
|
+
declare const publicMcpJob: (job: McpJob) => {
|
|
12
|
+
request: {
|
|
13
|
+
[k: string]: unknown;
|
|
14
|
+
};
|
|
15
|
+
logLines: number;
|
|
16
|
+
id: string;
|
|
17
|
+
userName: string;
|
|
18
|
+
clientId: string;
|
|
19
|
+
kind: "backtest" | "runtime-evidence" | "runtime-feedback-replay";
|
|
20
|
+
status: "queued" | "running" | "completed" | "failed" | "cancelled";
|
|
21
|
+
createdAt: number;
|
|
22
|
+
updatedAt: number;
|
|
23
|
+
startedAt?: number;
|
|
24
|
+
finishedAt?: number;
|
|
25
|
+
cancelRequested?: boolean;
|
|
26
|
+
error?: string;
|
|
27
|
+
exitCode?: number | null;
|
|
28
|
+
outputId: string;
|
|
29
|
+
packageManifestSha256: string;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
declare const mcpProjectRoot: () => string;
|
|
33
|
+
declare const isMcpRecord: (value: unknown) => value is Record<string, unknown>;
|
|
34
|
+
declare const mcpId: (value: string) => string;
|
|
35
|
+
/** Defence in depth for user/config/report payloads. Credentials are never MCP data. */
|
|
36
|
+
declare const redactMcpData: (value: unknown) => unknown;
|
|
37
|
+
declare const readMcpMarket: (userName: string, provider: string, universe: MarketUniverse, offset: number, limit: number, symbol?: string) => Promise<{
|
|
38
|
+
provider: string;
|
|
39
|
+
universe: MarketUniverse;
|
|
40
|
+
items: _tradejs_types.Ticker[];
|
|
41
|
+
total: number;
|
|
42
|
+
nextOffset: number | null;
|
|
43
|
+
observedAt: number;
|
|
44
|
+
source: string;
|
|
45
|
+
}>;
|
|
46
|
+
declare const readMcpChart: (userName: string, request: {
|
|
47
|
+
provider: string;
|
|
48
|
+
universe: MarketUniverse;
|
|
49
|
+
symbol: string;
|
|
50
|
+
interval: Interval;
|
|
51
|
+
endTime: number;
|
|
52
|
+
bars: number;
|
|
53
|
+
cacheOnly: boolean;
|
|
54
|
+
indicatorNames?: string[];
|
|
55
|
+
}) => Promise<{
|
|
56
|
+
startTime: number;
|
|
57
|
+
historyStartTime: number;
|
|
58
|
+
warmupBars: number;
|
|
59
|
+
endTime: number;
|
|
60
|
+
candles: _tradejs_types.KlineChartItem[];
|
|
61
|
+
indicators: {
|
|
62
|
+
[k: string]: number[] | _tradejs_types.Candle[];
|
|
63
|
+
};
|
|
64
|
+
availableIndicators: string[];
|
|
65
|
+
observedAt: number;
|
|
66
|
+
source: string;
|
|
67
|
+
closedCandlesOnly: boolean;
|
|
68
|
+
coverage: {
|
|
69
|
+
requestedBars: number;
|
|
70
|
+
availableBars: number;
|
|
71
|
+
complete: boolean;
|
|
72
|
+
};
|
|
73
|
+
provider: string;
|
|
74
|
+
universe: MarketUniverse;
|
|
75
|
+
symbol: string;
|
|
76
|
+
interval: Interval;
|
|
77
|
+
bars: number;
|
|
78
|
+
cacheOnly: boolean;
|
|
79
|
+
indicatorNames?: string[];
|
|
80
|
+
}>;
|
|
81
|
+
declare const readMcpDeployments: (userName: string) => Promise<{
|
|
82
|
+
deployments: {
|
|
83
|
+
heartbeat: _tradejs_types.RuntimeDeploymentHeartbeat | null;
|
|
84
|
+
id: string;
|
|
85
|
+
deploymentCompositionId: string;
|
|
86
|
+
label: string;
|
|
87
|
+
connectorName: string;
|
|
88
|
+
provider: string;
|
|
89
|
+
accountId: string;
|
|
90
|
+
enabled: boolean;
|
|
91
|
+
strategies: _tradejs_types.RuntimeDeploymentStrategy[];
|
|
92
|
+
assetClasses?: _tradejs_types.AssetClass[];
|
|
93
|
+
tickers?: string[];
|
|
94
|
+
}[];
|
|
95
|
+
observedAt: number;
|
|
96
|
+
source: string;
|
|
97
|
+
}>;
|
|
98
|
+
declare const requireMcpDeployment: (userName: string, deploymentId: string) => Promise<{
|
|
99
|
+
heartbeat: _tradejs_types.RuntimeDeploymentHeartbeat | null;
|
|
100
|
+
id: string;
|
|
101
|
+
deploymentCompositionId: string;
|
|
102
|
+
label: string;
|
|
103
|
+
connectorName: string;
|
|
104
|
+
provider: string;
|
|
105
|
+
accountId: string;
|
|
106
|
+
enabled: boolean;
|
|
107
|
+
strategies: _tradejs_types.RuntimeDeploymentStrategy[];
|
|
108
|
+
assetClasses?: _tradejs_types.AssetClass[];
|
|
109
|
+
tickers?: string[];
|
|
110
|
+
}>;
|
|
111
|
+
declare const readMcpStrategies: (userName: string, deploymentId: string) => Promise<{
|
|
112
|
+
deploymentId: string;
|
|
113
|
+
accountId: string;
|
|
114
|
+
strategies: {
|
|
115
|
+
strategyName: string;
|
|
116
|
+
strategyModule: string;
|
|
117
|
+
strategyRevision: string;
|
|
118
|
+
deploymentCompositionId: string;
|
|
119
|
+
generation?: string;
|
|
120
|
+
enabled: boolean;
|
|
121
|
+
controlState: _tradejs_types.RuntimeStrategyControlState;
|
|
122
|
+
interval: Interval;
|
|
123
|
+
universe: MarketUniverse;
|
|
124
|
+
accountId?: string;
|
|
125
|
+
strategyPackage: string;
|
|
126
|
+
strategyPackageVersion: string;
|
|
127
|
+
strategyDependencyVersions: Record<string, string>;
|
|
128
|
+
runtimePackageVersion: string;
|
|
129
|
+
sourceStrategyConfig: _tradejs_types.StrategyConfig;
|
|
130
|
+
strategyConfig: _tradejs_types.StrategyConfig;
|
|
131
|
+
selection?: _tradejs_types.RuntimeStrategySelection;
|
|
132
|
+
}[];
|
|
133
|
+
observedAt: number;
|
|
134
|
+
}>;
|
|
135
|
+
declare const readMcpRuntimePage: (userName: string, kind: "signals" | "evaluations" | "orders", request: {
|
|
136
|
+
deploymentId: string;
|
|
137
|
+
cursor: string;
|
|
138
|
+
startTime: number;
|
|
139
|
+
endTime: number;
|
|
140
|
+
strategy?: string;
|
|
141
|
+
symbol?: string;
|
|
142
|
+
}) => Promise<{
|
|
143
|
+
items: Record<string, unknown>[];
|
|
144
|
+
cursor: string;
|
|
145
|
+
deploymentId: string;
|
|
146
|
+
observedAt: number;
|
|
147
|
+
source: string;
|
|
148
|
+
window: {
|
|
149
|
+
startTime: number;
|
|
150
|
+
endTime: number;
|
|
151
|
+
};
|
|
152
|
+
coverage: string;
|
|
153
|
+
note: string;
|
|
154
|
+
}>;
|
|
155
|
+
declare const readMcpSignal: (userName: string, signalId: string, deploymentId: string, timestamp: number, strategy: string) => Promise<{
|
|
156
|
+
signal: Record<string, unknown>;
|
|
157
|
+
observedAt: number;
|
|
158
|
+
source: string;
|
|
159
|
+
}>;
|
|
160
|
+
declare const readMcpEvaluationStats: (userName: string, deploymentId: string, cursor: string) => Promise<{
|
|
161
|
+
buckets: {
|
|
162
|
+
bucket: string;
|
|
163
|
+
counters: Record<string, string>;
|
|
164
|
+
}[];
|
|
165
|
+
cursor: string;
|
|
166
|
+
observedAt: number;
|
|
167
|
+
source: string;
|
|
168
|
+
immutableEvidence: boolean;
|
|
169
|
+
note: string;
|
|
170
|
+
}>;
|
|
171
|
+
declare const readMcpBacktestPage: (userName: string, kind: "configs" | "results", cursor: string) => Promise<{
|
|
172
|
+
items: {
|
|
173
|
+
id: string;
|
|
174
|
+
value: unknown;
|
|
175
|
+
}[];
|
|
176
|
+
cursor: string;
|
|
177
|
+
observedAt: number;
|
|
178
|
+
source: string;
|
|
179
|
+
}>;
|
|
180
|
+
declare const readMcpBacktestResult: (userName: string, id: string, offset?: number, limit?: number) => Promise<{
|
|
181
|
+
id: string;
|
|
182
|
+
result: {
|
|
183
|
+
results: unknown;
|
|
184
|
+
resultsByTickers: unknown;
|
|
185
|
+
resultsByStrategies: unknown;
|
|
186
|
+
config: unknown;
|
|
187
|
+
mode: unknown;
|
|
188
|
+
startedAt: unknown;
|
|
189
|
+
finishedAt: unknown;
|
|
190
|
+
successTests: unknown;
|
|
191
|
+
errorTests: unknown;
|
|
192
|
+
bestConfig: unknown;
|
|
193
|
+
mergedConfig: unknown;
|
|
194
|
+
runtimeComparison: unknown;
|
|
195
|
+
};
|
|
196
|
+
offset: number;
|
|
197
|
+
total: number;
|
|
198
|
+
nextOffset: number | null;
|
|
199
|
+
observedAt: number;
|
|
200
|
+
source: string;
|
|
201
|
+
}>;
|
|
202
|
+
|
|
203
|
+
export { MCP_JOB_TTL, cancelMcpJob, enqueueMcpJob, isMcpRecord, mcpId, mcpJobDirectory, mcpJobStorageId, mcpPackageManifestHash, mcpProjectRoot, publicMcpJob, readMcpBacktestPage, readMcpBacktestResult, readMcpChart, readMcpDeployments, readMcpEvaluationStats, readMcpJob, readMcpMarket, readMcpRuntimePage, readMcpSignal, readMcpStrategies, redactMcpData, requireMcpDeployment };
|