@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.
File without changes
File without changes
@@ -1,3 +1,4 @@
1
+ import "./chunk-ZUMUI37V.mjs";
1
2
  import {
2
3
  BUILTIN_CONNECTOR_NAMES,
3
4
  DEFAULT_CONNECTOR_NAME,
@@ -0,0 +1,182 @@
1
+ import { AssetClass, RuntimeStrategyControlState, Interval, MarketUniverse, StrategyConfig, RuntimeStrategySelection, RuntimeLineage, RuntimeDeployment } from '@tradejs/types';
2
+
3
+ declare const RUNTIME_EVIDENCE_MANIFEST_FILE = "manifest.json";
4
+ declare const RUNTIME_EVIDENCE_PAYLOAD_FILE = "runtime-evidence.json";
5
+ declare const RUNTIME_EVIDENCE_COMPLETE_FILE = ".complete";
6
+ type RuntimeEvidenceArtifactManifest = {
7
+ schemaVersion: 1;
8
+ artifactId: string;
9
+ reportType: 'runtime-evidence';
10
+ deploymentId: string;
11
+ userName: string;
12
+ createdAt: number;
13
+ window: {
14
+ startTime: number;
15
+ endTime: number;
16
+ };
17
+ payload: {
18
+ file: typeof RUNTIME_EVIDENCE_PAYLOAD_FILE;
19
+ sha256: string;
20
+ bytes: number;
21
+ };
22
+ counts: Record<string, number>;
23
+ lineageKeys: string[];
24
+ };
25
+ type VerifiedRuntimeEvidenceBundle = {
26
+ bundleDir: string;
27
+ manifestPath: string;
28
+ payloadPath: string;
29
+ manifest: RuntimeEvidenceArtifactManifest;
30
+ artifact: Record<string, unknown>;
31
+ };
32
+ declare const publishRuntimeEvidenceBundle: ({ publishRoot, deploymentId, userName, startTime, endTime, artifact, counts, lineageKeys, }: {
33
+ publishRoot: string;
34
+ deploymentId: string;
35
+ userName: string;
36
+ startTime: number;
37
+ endTime: number;
38
+ artifact: Record<string, unknown>;
39
+ counts: Record<string, number>;
40
+ lineageKeys: string[];
41
+ }) => Promise<VerifiedRuntimeEvidenceBundle>;
42
+ declare const verifyRuntimeEvidenceBundle: (bundleDir: string) => Promise<VerifiedRuntimeEvidenceBundle>;
43
+ declare const discoverRuntimeEvidenceBundles: (rootDir: string) => Promise<string[]>;
44
+
45
+ type RuntimeEvidenceStrategySnapshot = {
46
+ strategyName: string;
47
+ strategyRevision: string;
48
+ enabled: boolean;
49
+ controlState: RuntimeStrategyControlState;
50
+ interval: Interval;
51
+ universe: MarketUniverse;
52
+ accountId?: string;
53
+ strategyPackage: string;
54
+ strategyPackageVersion: string;
55
+ strategyDependencyVersions: Record<string, string>;
56
+ runtimePackageVersion: string;
57
+ strategyConfig: StrategyConfig;
58
+ selection?: RuntimeStrategySelection;
59
+ };
60
+ type RuntimeEvidenceDeploymentSnapshot = {
61
+ schemaVersion: 2;
62
+ id: string;
63
+ deploymentCompositionId: string;
64
+ label: string;
65
+ connectorName: string;
66
+ provider: string;
67
+ accountId: string;
68
+ enabled: boolean;
69
+ assetClasses?: AssetClass[];
70
+ tickers?: string[];
71
+ strategies: RuntimeEvidenceStrategySnapshot[];
72
+ };
73
+ type RuntimeEvidenceLineageScope = {
74
+ strategy: string;
75
+ symbol: string;
76
+ deploymentId?: string;
77
+ accountId?: string;
78
+ lineage?: RuntimeLineage;
79
+ };
80
+ declare const runtimeLineageMatchesStrategySnapshot: ({ lineage, deployment, strategy, }: {
81
+ lineage: RuntimeLineage | undefined;
82
+ deployment: RuntimeEvidenceDeploymentSnapshot;
83
+ strategy: RuntimeEvidenceStrategySnapshot;
84
+ }) => boolean;
85
+ declare const parseRuntimeEvidenceDeploymentSnapshot: (value: unknown) => RuntimeEvidenceDeploymentSnapshot;
86
+ declare const activeRuntimeEvidenceStrategies: (deployment: RuntimeEvidenceDeploymentSnapshot) => RuntimeEvidenceStrategySnapshot[];
87
+ declare const assertCurrentRuntimeEvidenceArtifact: (artifact: unknown) => RuntimeEvidenceDeploymentSnapshot;
88
+ declare const resolveRuntimeEvidenceTickerUniverse: ({ deployment, lineageScopes, fallbackTickers, }: {
89
+ deployment: RuntimeEvidenceDeploymentSnapshot;
90
+ lineageScopes: RuntimeEvidenceLineageScope[];
91
+ fallbackTickers?: string[];
92
+ }) => RuntimeEvidenceDeploymentSnapshot;
93
+ declare const runtimeDeploymentFromEvidence: (deployment: RuntimeEvidenceDeploymentSnapshot) => RuntimeDeployment;
94
+ declare const resolveRuntimeEvidenceDeploymentSnapshot: ({ userName, projectRoot, deploymentId, }: {
95
+ userName: string;
96
+ projectRoot: string;
97
+ deploymentId: string;
98
+ }) => Promise<RuntimeEvidenceDeploymentSnapshot>;
99
+
100
+ type RuntimeEvidenceProducer = {
101
+ schemaVersion: 1;
102
+ projectSha: string;
103
+ imageDigest: string;
104
+ runtimePackageManifest: {
105
+ file: 'runtime-package-manifest.json';
106
+ sha256: string;
107
+ };
108
+ };
109
+ declare const parseRuntimeEvidenceProducer: (value: unknown) => RuntimeEvidenceProducer;
110
+ declare const resolveRuntimeEvidenceProducer: ({ projectRoot, required, }: {
111
+ projectRoot: string;
112
+ required: boolean;
113
+ }) => Promise<RuntimeEvidenceProducer | null>;
114
+
115
+ declare const RUNTIME_FEEDBACK_MANIFEST_FILE = "manifest.json";
116
+ declare const RUNTIME_FEEDBACK_REPLAY_FILE = "replay-runtime-evidence.json";
117
+ declare const RUNTIME_FEEDBACK_LOG_FILE = "replay.log";
118
+ declare const RUNTIME_FEEDBACK_COMPLETE_FILE = ".complete";
119
+ type PayloadDescriptor = {
120
+ file: string;
121
+ sha256: string;
122
+ bytes: number;
123
+ };
124
+ type RuntimeFeedbackReplayManifest = {
125
+ schemaVersion: 1;
126
+ reportType: 'runtime-feedback-replay';
127
+ artifactId: string;
128
+ runId: string;
129
+ deploymentId: string;
130
+ deploymentCompositionId: string;
131
+ userName: string;
132
+ createdAt: number;
133
+ window: {
134
+ startTime: number;
135
+ endTime: number;
136
+ };
137
+ runtimeEvidence: {
138
+ artifactId: string;
139
+ payloadSha256: string;
140
+ };
141
+ producer: RuntimeEvidenceProducer;
142
+ activeStrategies: string[];
143
+ cycleCount: number;
144
+ safety: {
145
+ cacheOnly: true;
146
+ externalOrderPlacement: false;
147
+ redis: 'isolated';
148
+ timescale: 'read_only';
149
+ };
150
+ payloads: {
151
+ replayEvidence: PayloadDescriptor & {
152
+ file: typeof RUNTIME_FEEDBACK_REPLAY_FILE;
153
+ };
154
+ log: PayloadDescriptor & {
155
+ file: typeof RUNTIME_FEEDBACK_LOG_FILE;
156
+ };
157
+ };
158
+ };
159
+ type VerifiedRuntimeFeedbackReplayBundle = {
160
+ bundleDir: string;
161
+ manifestPath: string;
162
+ replayEvidencePath: string;
163
+ logPath: string;
164
+ manifest: RuntimeFeedbackReplayManifest;
165
+ replayEvidence: Record<string, unknown>;
166
+ };
167
+ declare const sealRuntimeFeedbackReplayBundle: ({ bundleDir, runId, runtimeEvidenceBundle, }: {
168
+ bundleDir: string;
169
+ runId: string;
170
+ runtimeEvidenceBundle: VerifiedRuntimeEvidenceBundle;
171
+ }) => Promise<VerifiedRuntimeFeedbackReplayBundle>;
172
+ declare const verifyRuntimeFeedbackReplayBundle: (bundleDir: string) => Promise<VerifiedRuntimeFeedbackReplayBundle>;
173
+ declare const discoverRuntimeFeedbackReplayBundles: (rootDir: string) => Promise<string[]>;
174
+ declare const verifyRuntimeFeedbackReplaySource: ({ bundleDir, runtimeEvidenceBundleDir, }: {
175
+ bundleDir: string;
176
+ runtimeEvidenceBundleDir: string;
177
+ }) => Promise<{
178
+ feedback: VerifiedRuntimeFeedbackReplayBundle;
179
+ runtimeEvidence: VerifiedRuntimeEvidenceBundle;
180
+ }>;
181
+
182
+ export { RUNTIME_EVIDENCE_COMPLETE_FILE, RUNTIME_EVIDENCE_MANIFEST_FILE, RUNTIME_EVIDENCE_PAYLOAD_FILE, RUNTIME_FEEDBACK_COMPLETE_FILE, RUNTIME_FEEDBACK_LOG_FILE, RUNTIME_FEEDBACK_MANIFEST_FILE, RUNTIME_FEEDBACK_REPLAY_FILE, type RuntimeEvidenceArtifactManifest, type RuntimeEvidenceDeploymentSnapshot, type RuntimeEvidenceProducer, type RuntimeEvidenceStrategySnapshot, type RuntimeFeedbackReplayManifest, type VerifiedRuntimeEvidenceBundle, type VerifiedRuntimeFeedbackReplayBundle, activeRuntimeEvidenceStrategies, assertCurrentRuntimeEvidenceArtifact, discoverRuntimeEvidenceBundles, discoverRuntimeFeedbackReplayBundles, parseRuntimeEvidenceDeploymentSnapshot, parseRuntimeEvidenceProducer, publishRuntimeEvidenceBundle, resolveRuntimeEvidenceDeploymentSnapshot, resolveRuntimeEvidenceProducer, resolveRuntimeEvidenceTickerUniverse, runtimeDeploymentFromEvidence, runtimeLineageMatchesStrategySnapshot, sealRuntimeFeedbackReplayBundle, verifyRuntimeEvidenceBundle, verifyRuntimeFeedbackReplayBundle, verifyRuntimeFeedbackReplaySource };
@@ -0,0 +1,182 @@
1
+ import { AssetClass, RuntimeStrategyControlState, Interval, MarketUniverse, StrategyConfig, RuntimeStrategySelection, RuntimeLineage, RuntimeDeployment } from '@tradejs/types';
2
+
3
+ declare const RUNTIME_EVIDENCE_MANIFEST_FILE = "manifest.json";
4
+ declare const RUNTIME_EVIDENCE_PAYLOAD_FILE = "runtime-evidence.json";
5
+ declare const RUNTIME_EVIDENCE_COMPLETE_FILE = ".complete";
6
+ type RuntimeEvidenceArtifactManifest = {
7
+ schemaVersion: 1;
8
+ artifactId: string;
9
+ reportType: 'runtime-evidence';
10
+ deploymentId: string;
11
+ userName: string;
12
+ createdAt: number;
13
+ window: {
14
+ startTime: number;
15
+ endTime: number;
16
+ };
17
+ payload: {
18
+ file: typeof RUNTIME_EVIDENCE_PAYLOAD_FILE;
19
+ sha256: string;
20
+ bytes: number;
21
+ };
22
+ counts: Record<string, number>;
23
+ lineageKeys: string[];
24
+ };
25
+ type VerifiedRuntimeEvidenceBundle = {
26
+ bundleDir: string;
27
+ manifestPath: string;
28
+ payloadPath: string;
29
+ manifest: RuntimeEvidenceArtifactManifest;
30
+ artifact: Record<string, unknown>;
31
+ };
32
+ declare const publishRuntimeEvidenceBundle: ({ publishRoot, deploymentId, userName, startTime, endTime, artifact, counts, lineageKeys, }: {
33
+ publishRoot: string;
34
+ deploymentId: string;
35
+ userName: string;
36
+ startTime: number;
37
+ endTime: number;
38
+ artifact: Record<string, unknown>;
39
+ counts: Record<string, number>;
40
+ lineageKeys: string[];
41
+ }) => Promise<VerifiedRuntimeEvidenceBundle>;
42
+ declare const verifyRuntimeEvidenceBundle: (bundleDir: string) => Promise<VerifiedRuntimeEvidenceBundle>;
43
+ declare const discoverRuntimeEvidenceBundles: (rootDir: string) => Promise<string[]>;
44
+
45
+ type RuntimeEvidenceStrategySnapshot = {
46
+ strategyName: string;
47
+ strategyRevision: string;
48
+ enabled: boolean;
49
+ controlState: RuntimeStrategyControlState;
50
+ interval: Interval;
51
+ universe: MarketUniverse;
52
+ accountId?: string;
53
+ strategyPackage: string;
54
+ strategyPackageVersion: string;
55
+ strategyDependencyVersions: Record<string, string>;
56
+ runtimePackageVersion: string;
57
+ strategyConfig: StrategyConfig;
58
+ selection?: RuntimeStrategySelection;
59
+ };
60
+ type RuntimeEvidenceDeploymentSnapshot = {
61
+ schemaVersion: 2;
62
+ id: string;
63
+ deploymentCompositionId: string;
64
+ label: string;
65
+ connectorName: string;
66
+ provider: string;
67
+ accountId: string;
68
+ enabled: boolean;
69
+ assetClasses?: AssetClass[];
70
+ tickers?: string[];
71
+ strategies: RuntimeEvidenceStrategySnapshot[];
72
+ };
73
+ type RuntimeEvidenceLineageScope = {
74
+ strategy: string;
75
+ symbol: string;
76
+ deploymentId?: string;
77
+ accountId?: string;
78
+ lineage?: RuntimeLineage;
79
+ };
80
+ declare const runtimeLineageMatchesStrategySnapshot: ({ lineage, deployment, strategy, }: {
81
+ lineage: RuntimeLineage | undefined;
82
+ deployment: RuntimeEvidenceDeploymentSnapshot;
83
+ strategy: RuntimeEvidenceStrategySnapshot;
84
+ }) => boolean;
85
+ declare const parseRuntimeEvidenceDeploymentSnapshot: (value: unknown) => RuntimeEvidenceDeploymentSnapshot;
86
+ declare const activeRuntimeEvidenceStrategies: (deployment: RuntimeEvidenceDeploymentSnapshot) => RuntimeEvidenceStrategySnapshot[];
87
+ declare const assertCurrentRuntimeEvidenceArtifact: (artifact: unknown) => RuntimeEvidenceDeploymentSnapshot;
88
+ declare const resolveRuntimeEvidenceTickerUniverse: ({ deployment, lineageScopes, fallbackTickers, }: {
89
+ deployment: RuntimeEvidenceDeploymentSnapshot;
90
+ lineageScopes: RuntimeEvidenceLineageScope[];
91
+ fallbackTickers?: string[];
92
+ }) => RuntimeEvidenceDeploymentSnapshot;
93
+ declare const runtimeDeploymentFromEvidence: (deployment: RuntimeEvidenceDeploymentSnapshot) => RuntimeDeployment;
94
+ declare const resolveRuntimeEvidenceDeploymentSnapshot: ({ userName, projectRoot, deploymentId, }: {
95
+ userName: string;
96
+ projectRoot: string;
97
+ deploymentId: string;
98
+ }) => Promise<RuntimeEvidenceDeploymentSnapshot>;
99
+
100
+ type RuntimeEvidenceProducer = {
101
+ schemaVersion: 1;
102
+ projectSha: string;
103
+ imageDigest: string;
104
+ runtimePackageManifest: {
105
+ file: 'runtime-package-manifest.json';
106
+ sha256: string;
107
+ };
108
+ };
109
+ declare const parseRuntimeEvidenceProducer: (value: unknown) => RuntimeEvidenceProducer;
110
+ declare const resolveRuntimeEvidenceProducer: ({ projectRoot, required, }: {
111
+ projectRoot: string;
112
+ required: boolean;
113
+ }) => Promise<RuntimeEvidenceProducer | null>;
114
+
115
+ declare const RUNTIME_FEEDBACK_MANIFEST_FILE = "manifest.json";
116
+ declare const RUNTIME_FEEDBACK_REPLAY_FILE = "replay-runtime-evidence.json";
117
+ declare const RUNTIME_FEEDBACK_LOG_FILE = "replay.log";
118
+ declare const RUNTIME_FEEDBACK_COMPLETE_FILE = ".complete";
119
+ type PayloadDescriptor = {
120
+ file: string;
121
+ sha256: string;
122
+ bytes: number;
123
+ };
124
+ type RuntimeFeedbackReplayManifest = {
125
+ schemaVersion: 1;
126
+ reportType: 'runtime-feedback-replay';
127
+ artifactId: string;
128
+ runId: string;
129
+ deploymentId: string;
130
+ deploymentCompositionId: string;
131
+ userName: string;
132
+ createdAt: number;
133
+ window: {
134
+ startTime: number;
135
+ endTime: number;
136
+ };
137
+ runtimeEvidence: {
138
+ artifactId: string;
139
+ payloadSha256: string;
140
+ };
141
+ producer: RuntimeEvidenceProducer;
142
+ activeStrategies: string[];
143
+ cycleCount: number;
144
+ safety: {
145
+ cacheOnly: true;
146
+ externalOrderPlacement: false;
147
+ redis: 'isolated';
148
+ timescale: 'read_only';
149
+ };
150
+ payloads: {
151
+ replayEvidence: PayloadDescriptor & {
152
+ file: typeof RUNTIME_FEEDBACK_REPLAY_FILE;
153
+ };
154
+ log: PayloadDescriptor & {
155
+ file: typeof RUNTIME_FEEDBACK_LOG_FILE;
156
+ };
157
+ };
158
+ };
159
+ type VerifiedRuntimeFeedbackReplayBundle = {
160
+ bundleDir: string;
161
+ manifestPath: string;
162
+ replayEvidencePath: string;
163
+ logPath: string;
164
+ manifest: RuntimeFeedbackReplayManifest;
165
+ replayEvidence: Record<string, unknown>;
166
+ };
167
+ declare const sealRuntimeFeedbackReplayBundle: ({ bundleDir, runId, runtimeEvidenceBundle, }: {
168
+ bundleDir: string;
169
+ runId: string;
170
+ runtimeEvidenceBundle: VerifiedRuntimeEvidenceBundle;
171
+ }) => Promise<VerifiedRuntimeFeedbackReplayBundle>;
172
+ declare const verifyRuntimeFeedbackReplayBundle: (bundleDir: string) => Promise<VerifiedRuntimeFeedbackReplayBundle>;
173
+ declare const discoverRuntimeFeedbackReplayBundles: (rootDir: string) => Promise<string[]>;
174
+ declare const verifyRuntimeFeedbackReplaySource: ({ bundleDir, runtimeEvidenceBundleDir, }: {
175
+ bundleDir: string;
176
+ runtimeEvidenceBundleDir: string;
177
+ }) => Promise<{
178
+ feedback: VerifiedRuntimeFeedbackReplayBundle;
179
+ runtimeEvidence: VerifiedRuntimeEvidenceBundle;
180
+ }>;
181
+
182
+ export { RUNTIME_EVIDENCE_COMPLETE_FILE, RUNTIME_EVIDENCE_MANIFEST_FILE, RUNTIME_EVIDENCE_PAYLOAD_FILE, RUNTIME_FEEDBACK_COMPLETE_FILE, RUNTIME_FEEDBACK_LOG_FILE, RUNTIME_FEEDBACK_MANIFEST_FILE, RUNTIME_FEEDBACK_REPLAY_FILE, type RuntimeEvidenceArtifactManifest, type RuntimeEvidenceDeploymentSnapshot, type RuntimeEvidenceProducer, type RuntimeEvidenceStrategySnapshot, type RuntimeFeedbackReplayManifest, type VerifiedRuntimeEvidenceBundle, type VerifiedRuntimeFeedbackReplayBundle, activeRuntimeEvidenceStrategies, assertCurrentRuntimeEvidenceArtifact, discoverRuntimeEvidenceBundles, discoverRuntimeFeedbackReplayBundles, parseRuntimeEvidenceDeploymentSnapshot, parseRuntimeEvidenceProducer, publishRuntimeEvidenceBundle, resolveRuntimeEvidenceDeploymentSnapshot, resolveRuntimeEvidenceProducer, resolveRuntimeEvidenceTickerUniverse, runtimeDeploymentFromEvidence, runtimeLineageMatchesStrategySnapshot, sealRuntimeFeedbackReplayBundle, verifyRuntimeEvidenceBundle, verifyRuntimeFeedbackReplayBundle, verifyRuntimeFeedbackReplaySource };