jcc_hyper_tool 0.1.4 → 0.1.6

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.
Files changed (179) hide show
  1. package/README.md +159 -21
  2. package/dist/advisor/actionRunner.d.ts +35 -0
  3. package/dist/advisor/actionRunner.d.ts.map +1 -0
  4. package/dist/advisor/actionRunner.js +194 -0
  5. package/dist/advisor/actionRunner.js.map +1 -0
  6. package/dist/advisor/actionSchema.d.ts +1551 -0
  7. package/dist/advisor/actionSchema.d.ts.map +1 -0
  8. package/dist/advisor/actionSchema.js +202 -0
  9. package/dist/advisor/actionSchema.js.map +1 -0
  10. package/dist/advisor/adviseDisplay.d.ts +26 -0
  11. package/dist/advisor/adviseDisplay.d.ts.map +1 -0
  12. package/dist/advisor/adviseDisplay.js +174 -0
  13. package/dist/advisor/adviseDisplay.js.map +1 -0
  14. package/dist/advisor/adviseEngine.d.ts +53 -0
  15. package/dist/advisor/adviseEngine.d.ts.map +1 -0
  16. package/dist/advisor/adviseEngine.js +172 -0
  17. package/dist/advisor/adviseEngine.js.map +1 -0
  18. package/dist/advisor/ambushPolicy.d.ts +47 -0
  19. package/dist/advisor/ambushPolicy.d.ts.map +1 -0
  20. package/dist/advisor/ambushPolicy.js +161 -0
  21. package/dist/advisor/ambushPolicy.js.map +1 -0
  22. package/dist/advisor/contextBuilder.d.ts +51 -0
  23. package/dist/advisor/contextBuilder.d.ts.map +1 -0
  24. package/dist/advisor/contextBuilder.js +153 -0
  25. package/dist/advisor/contextBuilder.js.map +1 -0
  26. package/dist/advisor/deepseekClient.d.ts +26 -0
  27. package/dist/advisor/deepseekClient.d.ts.map +1 -0
  28. package/dist/advisor/deepseekClient.js +96 -0
  29. package/dist/advisor/deepseekClient.js.map +1 -0
  30. package/dist/advisor/executionPolicy.d.ts +92 -0
  31. package/dist/advisor/executionPolicy.d.ts.map +1 -0
  32. package/dist/advisor/executionPolicy.js +273 -0
  33. package/dist/advisor/executionPolicy.js.map +1 -0
  34. package/dist/advisor/guards.d.ts +31 -0
  35. package/dist/advisor/guards.d.ts.map +1 -0
  36. package/dist/advisor/guards.js +198 -0
  37. package/dist/advisor/guards.js.map +1 -0
  38. package/dist/advisor/indicatorCompute.d.ts +45 -0
  39. package/dist/advisor/indicatorCompute.d.ts.map +1 -0
  40. package/dist/advisor/indicatorCompute.js +259 -0
  41. package/dist/advisor/indicatorCompute.js.map +1 -0
  42. package/dist/advisor/positionPlan.d.ts +33 -0
  43. package/dist/advisor/positionPlan.d.ts.map +1 -0
  44. package/dist/advisor/positionPlan.js +118 -0
  45. package/dist/advisor/positionPlan.js.map +1 -0
  46. package/dist/advisor/promptTemplate.d.ts +11 -0
  47. package/dist/advisor/promptTemplate.d.ts.map +1 -0
  48. package/dist/advisor/promptTemplate.js +230 -0
  49. package/dist/advisor/promptTemplate.js.map +1 -0
  50. package/dist/advisor/sessionLog.d.ts +41 -0
  51. package/dist/advisor/sessionLog.d.ts.map +1 -0
  52. package/dist/advisor/sessionLog.js +7 -0
  53. package/dist/advisor/sessionLog.js.map +1 -0
  54. package/dist/advisor/touchProbability.d.ts +54 -0
  55. package/dist/advisor/touchProbability.d.ts.map +1 -0
  56. package/dist/advisor/touchProbability.js +215 -0
  57. package/dist/advisor/touchProbability.js.map +1 -0
  58. package/dist/advisor/tpslPolicy.d.ts +22 -0
  59. package/dist/advisor/tpslPolicy.d.ts.map +1 -0
  60. package/dist/advisor/tpslPolicy.js +120 -0
  61. package/dist/advisor/tpslPolicy.js.map +1 -0
  62. package/dist/cli/advisorCli.d.ts +3 -0
  63. package/dist/cli/advisorCli.d.ts.map +1 -0
  64. package/dist/cli/advisorCli.js +706 -0
  65. package/dist/cli/advisorCli.js.map +1 -0
  66. package/dist/cli/index.js +6 -2
  67. package/dist/cli/index.js.map +1 -1
  68. package/dist/cli/riskCli.d.ts +3 -0
  69. package/dist/cli/riskCli.d.ts.map +1 -0
  70. package/dist/cli/riskCli.js +120 -0
  71. package/dist/cli/riskCli.js.map +1 -0
  72. package/dist/cli/strategyCli.d.ts.map +1 -1
  73. package/dist/cli/strategyCli.js +4 -2
  74. package/dist/cli/strategyCli.js.map +1 -1
  75. package/dist/cli/tradingCli.d.ts.map +1 -1
  76. package/dist/cli/tradingCli.js +34 -2
  77. package/dist/cli/tradingCli.js.map +1 -1
  78. package/dist/core/cliBin.d.ts +8 -0
  79. package/dist/core/cliBin.d.ts.map +1 -0
  80. package/dist/core/cliBin.js +15 -0
  81. package/dist/core/cliBin.js.map +1 -0
  82. package/dist/core/errorFormat.d.ts +7 -0
  83. package/dist/core/errorFormat.d.ts.map +1 -0
  84. package/dist/core/errorFormat.js +59 -0
  85. package/dist/core/errorFormat.js.map +1 -0
  86. package/dist/core/errors.d.ts +2 -1
  87. package/dist/core/errors.d.ts.map +1 -1
  88. package/dist/core/errors.js +3 -1
  89. package/dist/core/errors.js.map +1 -1
  90. package/dist/core/hyperliquid/asset.d.ts +2 -0
  91. package/dist/core/hyperliquid/asset.d.ts.map +1 -1
  92. package/dist/core/hyperliquid/asset.js +25 -0
  93. package/dist/core/hyperliquid/asset.js.map +1 -1
  94. package/dist/core/hyperliquid/client.d.ts +3 -0
  95. package/dist/core/hyperliquid/client.d.ts.map +1 -1
  96. package/dist/core/hyperliquid/client.js +31 -21
  97. package/dist/core/hyperliquid/client.js.map +1 -1
  98. package/dist/core/hyperliquid/exchange.d.ts +3 -0
  99. package/dist/core/hyperliquid/exchange.d.ts.map +1 -1
  100. package/dist/core/hyperliquid/exchange.js +31 -21
  101. package/dist/core/hyperliquid/exchange.js.map +1 -1
  102. package/dist/core/hyperliquid/exchangeParse.d.ts +3 -0
  103. package/dist/core/hyperliquid/exchangeParse.d.ts.map +1 -1
  104. package/dist/core/hyperliquid/exchangeParse.js +62 -0
  105. package/dist/core/hyperliquid/exchangeParse.js.map +1 -1
  106. package/dist/core/hyperliquid/httpRequest.d.ts +36 -0
  107. package/dist/core/hyperliquid/httpRequest.d.ts.map +1 -0
  108. package/dist/core/hyperliquid/httpRequest.js +171 -0
  109. package/dist/core/hyperliquid/httpRequest.js.map +1 -0
  110. package/dist/core/hyperliquid/orders.d.ts +5 -0
  111. package/dist/core/hyperliquid/orders.d.ts.map +1 -1
  112. package/dist/core/hyperliquid/orders.js +15 -5
  113. package/dist/core/hyperliquid/orders.js.map +1 -1
  114. package/dist/core/hyperliquid/rounding.d.ts +23 -0
  115. package/dist/core/hyperliquid/rounding.d.ts.map +1 -0
  116. package/dist/core/hyperliquid/rounding.js +53 -0
  117. package/dist/core/hyperliquid/rounding.js.map +1 -0
  118. package/dist/core/risk/isolatedTopUp.d.ts +112 -0
  119. package/dist/core/risk/isolatedTopUp.d.ts.map +1 -0
  120. package/dist/core/risk/isolatedTopUp.js +209 -0
  121. package/dist/core/risk/isolatedTopUp.js.map +1 -0
  122. package/dist/core/risk/isolatedTopUpHistory.d.ts +7 -0
  123. package/dist/core/risk/isolatedTopUpHistory.d.ts.map +1 -0
  124. package/dist/core/risk/isolatedTopUpHistory.js +26 -0
  125. package/dist/core/risk/isolatedTopUpHistory.js.map +1 -0
  126. package/dist/core/risk/isolatedTopUpParse.d.ts +16 -0
  127. package/dist/core/risk/isolatedTopUpParse.d.ts.map +1 -0
  128. package/dist/core/risk/isolatedTopUpParse.js +78 -0
  129. package/dist/core/risk/isolatedTopUpParse.js.map +1 -0
  130. package/dist/core/risk/runIsolatedTopUpReconcile.d.ts +28 -0
  131. package/dist/core/risk/runIsolatedTopUpReconcile.d.ts.map +1 -0
  132. package/dist/core/risk/runIsolatedTopUpReconcile.js +184 -0
  133. package/dist/core/risk/runIsolatedTopUpReconcile.js.map +1 -0
  134. package/dist/core/state/gcTradeState.js +1 -1
  135. package/dist/core/state/gcTradeState.js.map +1 -1
  136. package/dist/core/state/gridReconcile.d.ts +2 -0
  137. package/dist/core/state/gridReconcile.d.ts.map +1 -1
  138. package/dist/core/state/gridReconcile.js +42 -2
  139. package/dist/core/state/gridReconcile.js.map +1 -1
  140. package/dist/core/state/intentFactory.d.ts +1 -0
  141. package/dist/core/state/intentFactory.d.ts.map +1 -1
  142. package/dist/core/state/intentFactory.js +1 -0
  143. package/dist/core/state/intentFactory.js.map +1 -1
  144. package/dist/core/state/profileStore.d.ts +6 -0
  145. package/dist/core/state/profileStore.d.ts.map +1 -0
  146. package/dist/core/state/profileStore.js +26 -0
  147. package/dist/core/state/profileStore.js.map +1 -0
  148. package/dist/core/state/runReconcile.d.ts.map +1 -1
  149. package/dist/core/state/runReconcile.js +92 -30
  150. package/dist/core/state/runReconcile.js.map +1 -1
  151. package/dist/core/state/schema.d.ts +565 -124
  152. package/dist/core/state/schema.d.ts.map +1 -1
  153. package/dist/core/state/schema.js +62 -0
  154. package/dist/core/state/schema.js.map +1 -1
  155. package/dist/core/state/snapshot.d.ts +13 -0
  156. package/dist/core/state/snapshot.d.ts.map +1 -1
  157. package/dist/core/state/snapshot.js +36 -0
  158. package/dist/core/state/snapshot.js.map +1 -1
  159. package/dist/core/state/statePaths.d.ts +1 -0
  160. package/dist/core/state/statePaths.d.ts.map +1 -1
  161. package/dist/core/state/statePaths.js +4 -0
  162. package/dist/core/state/statePaths.js.map +1 -1
  163. package/dist/core/state/store.d.ts +21 -3
  164. package/dist/core/state/store.d.ts.map +1 -1
  165. package/dist/core/state/store.js +123 -14
  166. package/dist/core/state/store.js.map +1 -1
  167. package/dist/core/state/types.d.ts +13 -0
  168. package/dist/core/state/types.d.ts.map +1 -1
  169. package/dist/daemon/index.js +50 -5
  170. package/dist/daemon/index.js.map +1 -1
  171. package/dist/daemon/validateChild.d.ts +13 -0
  172. package/dist/daemon/validateChild.d.ts.map +1 -0
  173. package/dist/daemon/validateChild.js +77 -0
  174. package/dist/daemon/validateChild.js.map +1 -0
  175. package/dist/strategies/grid.d.ts +1 -0
  176. package/dist/strategies/grid.d.ts.map +1 -1
  177. package/dist/strategies/grid.js +1 -0
  178. package/dist/strategies/grid.js.map +1 -1
  179. package/package.json +3 -1
@@ -0,0 +1,1551 @@
1
+ import { z } from "zod";
2
+ export declare const PriceTargetSchema: z.ZodObject<{
3
+ level: z.ZodNumber;
4
+ label: z.ZodString;
5
+ time_est: z.ZodString;
6
+ probability: z.ZodOptional<z.ZodNumber>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ level: number;
9
+ label: string;
10
+ time_est: string;
11
+ probability?: number | undefined;
12
+ }, {
13
+ level: number;
14
+ label: string;
15
+ time_est: string;
16
+ probability?: number | undefined;
17
+ }>;
18
+ export declare const Range15_30mSchema: z.ZodObject<{
19
+ low: z.ZodNumber;
20
+ high: z.ZodNumber;
21
+ optimistic_side: z.ZodEnum<["buy", "sell"]>;
22
+ confidence: z.ZodOptional<z.ZodNumber>;
23
+ }, "strip", z.ZodTypeAny, {
24
+ low: number;
25
+ high: number;
26
+ optimistic_side: "buy" | "sell";
27
+ confidence?: number | undefined;
28
+ }, {
29
+ low: number;
30
+ high: number;
31
+ optimistic_side: "buy" | "sell";
32
+ confidence?: number | undefined;
33
+ }>;
34
+ export declare const AnalysisSchema: z.ZodObject<{
35
+ indicators: z.ZodString;
36
+ elliott_wave: z.ZodString;
37
+ chan_theory: z.ZodString;
38
+ price_targets: z.ZodOptional<z.ZodArray<z.ZodObject<{
39
+ level: z.ZodNumber;
40
+ label: z.ZodString;
41
+ time_est: z.ZodString;
42
+ probability: z.ZodOptional<z.ZodNumber>;
43
+ }, "strip", z.ZodTypeAny, {
44
+ level: number;
45
+ label: string;
46
+ time_est: string;
47
+ probability?: number | undefined;
48
+ }, {
49
+ level: number;
50
+ label: string;
51
+ time_est: string;
52
+ probability?: number | undefined;
53
+ }>, "many">>;
54
+ time_horizon: z.ZodOptional<z.ZodString>;
55
+ range_15_30m: z.ZodOptional<z.ZodObject<{
56
+ low: z.ZodNumber;
57
+ high: z.ZodNumber;
58
+ optimistic_side: z.ZodEnum<["buy", "sell"]>;
59
+ confidence: z.ZodOptional<z.ZodNumber>;
60
+ }, "strip", z.ZodTypeAny, {
61
+ low: number;
62
+ high: number;
63
+ optimistic_side: "buy" | "sell";
64
+ confidence?: number | undefined;
65
+ }, {
66
+ low: number;
67
+ high: number;
68
+ optimistic_side: "buy" | "sell";
69
+ confidence?: number | undefined;
70
+ }>>;
71
+ }, "strip", z.ZodTypeAny, {
72
+ indicators: string;
73
+ elliott_wave: string;
74
+ chan_theory: string;
75
+ price_targets?: {
76
+ level: number;
77
+ label: string;
78
+ time_est: string;
79
+ probability?: number | undefined;
80
+ }[] | undefined;
81
+ time_horizon?: string | undefined;
82
+ range_15_30m?: {
83
+ low: number;
84
+ high: number;
85
+ optimistic_side: "buy" | "sell";
86
+ confidence?: number | undefined;
87
+ } | undefined;
88
+ }, {
89
+ indicators: string;
90
+ elliott_wave: string;
91
+ chan_theory: string;
92
+ price_targets?: {
93
+ level: number;
94
+ label: string;
95
+ time_est: string;
96
+ probability?: number | undefined;
97
+ }[] | undefined;
98
+ time_horizon?: string | undefined;
99
+ range_15_30m?: {
100
+ low: number;
101
+ high: number;
102
+ optimistic_side: "buy" | "sell";
103
+ confidence?: number | undefined;
104
+ } | undefined;
105
+ }>;
106
+ export type AdvisorAnalysis = z.infer<typeof AnalysisSchema>;
107
+ export type PriceTarget = z.infer<typeof PriceTargetSchema>;
108
+ export declare const AdvisorActionSchema: z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
109
+ analysis: z.ZodOptional<z.ZodObject<{
110
+ indicators: z.ZodString;
111
+ elliott_wave: z.ZodString;
112
+ chan_theory: z.ZodString;
113
+ price_targets: z.ZodOptional<z.ZodArray<z.ZodObject<{
114
+ level: z.ZodNumber;
115
+ label: z.ZodString;
116
+ time_est: z.ZodString;
117
+ probability: z.ZodOptional<z.ZodNumber>;
118
+ }, "strip", z.ZodTypeAny, {
119
+ level: number;
120
+ label: string;
121
+ time_est: string;
122
+ probability?: number | undefined;
123
+ }, {
124
+ level: number;
125
+ label: string;
126
+ time_est: string;
127
+ probability?: number | undefined;
128
+ }>, "many">>;
129
+ time_horizon: z.ZodOptional<z.ZodString>;
130
+ range_15_30m: z.ZodOptional<z.ZodObject<{
131
+ low: z.ZodNumber;
132
+ high: z.ZodNumber;
133
+ optimistic_side: z.ZodEnum<["buy", "sell"]>;
134
+ confidence: z.ZodOptional<z.ZodNumber>;
135
+ }, "strip", z.ZodTypeAny, {
136
+ low: number;
137
+ high: number;
138
+ optimistic_side: "buy" | "sell";
139
+ confidence?: number | undefined;
140
+ }, {
141
+ low: number;
142
+ high: number;
143
+ optimistic_side: "buy" | "sell";
144
+ confidence?: number | undefined;
145
+ }>>;
146
+ }, "strip", z.ZodTypeAny, {
147
+ indicators: string;
148
+ elliott_wave: string;
149
+ chan_theory: string;
150
+ price_targets?: {
151
+ level: number;
152
+ label: string;
153
+ time_est: string;
154
+ probability?: number | undefined;
155
+ }[] | undefined;
156
+ time_horizon?: string | undefined;
157
+ range_15_30m?: {
158
+ low: number;
159
+ high: number;
160
+ optimistic_side: "buy" | "sell";
161
+ confidence?: number | undefined;
162
+ } | undefined;
163
+ }, {
164
+ indicators: string;
165
+ elliott_wave: string;
166
+ chan_theory: string;
167
+ price_targets?: {
168
+ level: number;
169
+ label: string;
170
+ time_est: string;
171
+ probability?: number | undefined;
172
+ }[] | undefined;
173
+ time_horizon?: string | undefined;
174
+ range_15_30m?: {
175
+ low: number;
176
+ high: number;
177
+ optimistic_side: "buy" | "sell";
178
+ confidence?: number | undefined;
179
+ } | undefined;
180
+ }>>;
181
+ action: z.ZodLiteral<"wait">;
182
+ reason: z.ZodString;
183
+ confidence: z.ZodNumber;
184
+ }, "strip", z.ZodTypeAny, {
185
+ confidence: number;
186
+ action: "wait";
187
+ reason: string;
188
+ analysis?: {
189
+ indicators: string;
190
+ elliott_wave: string;
191
+ chan_theory: string;
192
+ price_targets?: {
193
+ level: number;
194
+ label: string;
195
+ time_est: string;
196
+ probability?: number | undefined;
197
+ }[] | undefined;
198
+ time_horizon?: string | undefined;
199
+ range_15_30m?: {
200
+ low: number;
201
+ high: number;
202
+ optimistic_side: "buy" | "sell";
203
+ confidence?: number | undefined;
204
+ } | undefined;
205
+ } | undefined;
206
+ }, {
207
+ confidence: number;
208
+ action: "wait";
209
+ reason: string;
210
+ analysis?: {
211
+ indicators: string;
212
+ elliott_wave: string;
213
+ chan_theory: string;
214
+ price_targets?: {
215
+ level: number;
216
+ label: string;
217
+ time_est: string;
218
+ probability?: number | undefined;
219
+ }[] | undefined;
220
+ time_horizon?: string | undefined;
221
+ range_15_30m?: {
222
+ low: number;
223
+ high: number;
224
+ optimistic_side: "buy" | "sell";
225
+ confidence?: number | undefined;
226
+ } | undefined;
227
+ } | undefined;
228
+ }>, z.ZodObject<{
229
+ analysis: z.ZodOptional<z.ZodObject<{
230
+ indicators: z.ZodString;
231
+ elliott_wave: z.ZodString;
232
+ chan_theory: z.ZodString;
233
+ price_targets: z.ZodOptional<z.ZodArray<z.ZodObject<{
234
+ level: z.ZodNumber;
235
+ label: z.ZodString;
236
+ time_est: z.ZodString;
237
+ probability: z.ZodOptional<z.ZodNumber>;
238
+ }, "strip", z.ZodTypeAny, {
239
+ level: number;
240
+ label: string;
241
+ time_est: string;
242
+ probability?: number | undefined;
243
+ }, {
244
+ level: number;
245
+ label: string;
246
+ time_est: string;
247
+ probability?: number | undefined;
248
+ }>, "many">>;
249
+ time_horizon: z.ZodOptional<z.ZodString>;
250
+ range_15_30m: z.ZodOptional<z.ZodObject<{
251
+ low: z.ZodNumber;
252
+ high: z.ZodNumber;
253
+ optimistic_side: z.ZodEnum<["buy", "sell"]>;
254
+ confidence: z.ZodOptional<z.ZodNumber>;
255
+ }, "strip", z.ZodTypeAny, {
256
+ low: number;
257
+ high: number;
258
+ optimistic_side: "buy" | "sell";
259
+ confidence?: number | undefined;
260
+ }, {
261
+ low: number;
262
+ high: number;
263
+ optimistic_side: "buy" | "sell";
264
+ confidence?: number | undefined;
265
+ }>>;
266
+ }, "strip", z.ZodTypeAny, {
267
+ indicators: string;
268
+ elliott_wave: string;
269
+ chan_theory: string;
270
+ price_targets?: {
271
+ level: number;
272
+ label: string;
273
+ time_est: string;
274
+ probability?: number | undefined;
275
+ }[] | undefined;
276
+ time_horizon?: string | undefined;
277
+ range_15_30m?: {
278
+ low: number;
279
+ high: number;
280
+ optimistic_side: "buy" | "sell";
281
+ confidence?: number | undefined;
282
+ } | undefined;
283
+ }, {
284
+ indicators: string;
285
+ elliott_wave: string;
286
+ chan_theory: string;
287
+ price_targets?: {
288
+ level: number;
289
+ label: string;
290
+ time_est: string;
291
+ probability?: number | undefined;
292
+ }[] | undefined;
293
+ time_horizon?: string | undefined;
294
+ range_15_30m?: {
295
+ low: number;
296
+ high: number;
297
+ optimistic_side: "buy" | "sell";
298
+ confidence?: number | undefined;
299
+ } | undefined;
300
+ }>>;
301
+ action: z.ZodLiteral<"open_with_bracket">;
302
+ side: z.ZodEnum<["buy", "sell"]>;
303
+ limit_px: z.ZodNumber;
304
+ sz: z.ZodNumber;
305
+ tp_px: z.ZodNumber;
306
+ sl_px: z.ZodNumber;
307
+ is_market: z.ZodDefault<z.ZodBoolean>;
308
+ protection_limit_px: z.ZodOptional<z.ZodNumber>;
309
+ reason: z.ZodString;
310
+ confidence: z.ZodNumber;
311
+ risk_flags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
312
+ }, "strip", z.ZodTypeAny, {
313
+ confidence: number;
314
+ action: "open_with_bracket";
315
+ reason: string;
316
+ side: "buy" | "sell";
317
+ limit_px: number;
318
+ sz: number;
319
+ tp_px: number;
320
+ sl_px: number;
321
+ is_market: boolean;
322
+ risk_flags: string[];
323
+ analysis?: {
324
+ indicators: string;
325
+ elliott_wave: string;
326
+ chan_theory: string;
327
+ price_targets?: {
328
+ level: number;
329
+ label: string;
330
+ time_est: string;
331
+ probability?: number | undefined;
332
+ }[] | undefined;
333
+ time_horizon?: string | undefined;
334
+ range_15_30m?: {
335
+ low: number;
336
+ high: number;
337
+ optimistic_side: "buy" | "sell";
338
+ confidence?: number | undefined;
339
+ } | undefined;
340
+ } | undefined;
341
+ protection_limit_px?: number | undefined;
342
+ }, {
343
+ confidence: number;
344
+ action: "open_with_bracket";
345
+ reason: string;
346
+ side: "buy" | "sell";
347
+ limit_px: number;
348
+ sz: number;
349
+ tp_px: number;
350
+ sl_px: number;
351
+ analysis?: {
352
+ indicators: string;
353
+ elliott_wave: string;
354
+ chan_theory: string;
355
+ price_targets?: {
356
+ level: number;
357
+ label: string;
358
+ time_est: string;
359
+ probability?: number | undefined;
360
+ }[] | undefined;
361
+ time_horizon?: string | undefined;
362
+ range_15_30m?: {
363
+ low: number;
364
+ high: number;
365
+ optimistic_side: "buy" | "sell";
366
+ confidence?: number | undefined;
367
+ } | undefined;
368
+ } | undefined;
369
+ is_market?: boolean | undefined;
370
+ protection_limit_px?: number | undefined;
371
+ risk_flags?: string[] | undefined;
372
+ }>, z.ZodObject<{
373
+ analysis: z.ZodOptional<z.ZodObject<{
374
+ indicators: z.ZodString;
375
+ elliott_wave: z.ZodString;
376
+ chan_theory: z.ZodString;
377
+ price_targets: z.ZodOptional<z.ZodArray<z.ZodObject<{
378
+ level: z.ZodNumber;
379
+ label: z.ZodString;
380
+ time_est: z.ZodString;
381
+ probability: z.ZodOptional<z.ZodNumber>;
382
+ }, "strip", z.ZodTypeAny, {
383
+ level: number;
384
+ label: string;
385
+ time_est: string;
386
+ probability?: number | undefined;
387
+ }, {
388
+ level: number;
389
+ label: string;
390
+ time_est: string;
391
+ probability?: number | undefined;
392
+ }>, "many">>;
393
+ time_horizon: z.ZodOptional<z.ZodString>;
394
+ range_15_30m: z.ZodOptional<z.ZodObject<{
395
+ low: z.ZodNumber;
396
+ high: z.ZodNumber;
397
+ optimistic_side: z.ZodEnum<["buy", "sell"]>;
398
+ confidence: z.ZodOptional<z.ZodNumber>;
399
+ }, "strip", z.ZodTypeAny, {
400
+ low: number;
401
+ high: number;
402
+ optimistic_side: "buy" | "sell";
403
+ confidence?: number | undefined;
404
+ }, {
405
+ low: number;
406
+ high: number;
407
+ optimistic_side: "buy" | "sell";
408
+ confidence?: number | undefined;
409
+ }>>;
410
+ }, "strip", z.ZodTypeAny, {
411
+ indicators: string;
412
+ elliott_wave: string;
413
+ chan_theory: string;
414
+ price_targets?: {
415
+ level: number;
416
+ label: string;
417
+ time_est: string;
418
+ probability?: number | undefined;
419
+ }[] | undefined;
420
+ time_horizon?: string | undefined;
421
+ range_15_30m?: {
422
+ low: number;
423
+ high: number;
424
+ optimistic_side: "buy" | "sell";
425
+ confidence?: number | undefined;
426
+ } | undefined;
427
+ }, {
428
+ indicators: string;
429
+ elliott_wave: string;
430
+ chan_theory: string;
431
+ price_targets?: {
432
+ level: number;
433
+ label: string;
434
+ time_est: string;
435
+ probability?: number | undefined;
436
+ }[] | undefined;
437
+ time_horizon?: string | undefined;
438
+ range_15_30m?: {
439
+ low: number;
440
+ high: number;
441
+ optimistic_side: "buy" | "sell";
442
+ confidence?: number | undefined;
443
+ } | undefined;
444
+ }>>;
445
+ action: z.ZodLiteral<"close_position">;
446
+ method: z.ZodEnum<["market", "limit"]>;
447
+ limit_px: z.ZodOptional<z.ZodNumber>;
448
+ /**
449
+ * Required when active_position_plan shows trend_toward_tp: model asserts price
450
+ * is unlikely to reach TP before SL/time horizon (not merely "no protection on book").
451
+ */
452
+ tp_unreachable: z.ZodOptional<z.ZodBoolean>;
453
+ reason: z.ZodString;
454
+ confidence: z.ZodNumber;
455
+ }, "strip", z.ZodTypeAny, {
456
+ confidence: number;
457
+ action: "close_position";
458
+ reason: string;
459
+ method: "market" | "limit";
460
+ analysis?: {
461
+ indicators: string;
462
+ elliott_wave: string;
463
+ chan_theory: string;
464
+ price_targets?: {
465
+ level: number;
466
+ label: string;
467
+ time_est: string;
468
+ probability?: number | undefined;
469
+ }[] | undefined;
470
+ time_horizon?: string | undefined;
471
+ range_15_30m?: {
472
+ low: number;
473
+ high: number;
474
+ optimistic_side: "buy" | "sell";
475
+ confidence?: number | undefined;
476
+ } | undefined;
477
+ } | undefined;
478
+ limit_px?: number | undefined;
479
+ tp_unreachable?: boolean | undefined;
480
+ }, {
481
+ confidence: number;
482
+ action: "close_position";
483
+ reason: string;
484
+ method: "market" | "limit";
485
+ analysis?: {
486
+ indicators: string;
487
+ elliott_wave: string;
488
+ chan_theory: string;
489
+ price_targets?: {
490
+ level: number;
491
+ label: string;
492
+ time_est: string;
493
+ probability?: number | undefined;
494
+ }[] | undefined;
495
+ time_horizon?: string | undefined;
496
+ range_15_30m?: {
497
+ low: number;
498
+ high: number;
499
+ optimistic_side: "buy" | "sell";
500
+ confidence?: number | undefined;
501
+ } | undefined;
502
+ } | undefined;
503
+ limit_px?: number | undefined;
504
+ tp_unreachable?: boolean | undefined;
505
+ }>, z.ZodObject<{
506
+ analysis: z.ZodOptional<z.ZodObject<{
507
+ indicators: z.ZodString;
508
+ elliott_wave: z.ZodString;
509
+ chan_theory: z.ZodString;
510
+ price_targets: z.ZodOptional<z.ZodArray<z.ZodObject<{
511
+ level: z.ZodNumber;
512
+ label: z.ZodString;
513
+ time_est: z.ZodString;
514
+ probability: z.ZodOptional<z.ZodNumber>;
515
+ }, "strip", z.ZodTypeAny, {
516
+ level: number;
517
+ label: string;
518
+ time_est: string;
519
+ probability?: number | undefined;
520
+ }, {
521
+ level: number;
522
+ label: string;
523
+ time_est: string;
524
+ probability?: number | undefined;
525
+ }>, "many">>;
526
+ time_horizon: z.ZodOptional<z.ZodString>;
527
+ range_15_30m: z.ZodOptional<z.ZodObject<{
528
+ low: z.ZodNumber;
529
+ high: z.ZodNumber;
530
+ optimistic_side: z.ZodEnum<["buy", "sell"]>;
531
+ confidence: z.ZodOptional<z.ZodNumber>;
532
+ }, "strip", z.ZodTypeAny, {
533
+ low: number;
534
+ high: number;
535
+ optimistic_side: "buy" | "sell";
536
+ confidence?: number | undefined;
537
+ }, {
538
+ low: number;
539
+ high: number;
540
+ optimistic_side: "buy" | "sell";
541
+ confidence?: number | undefined;
542
+ }>>;
543
+ }, "strip", z.ZodTypeAny, {
544
+ indicators: string;
545
+ elliott_wave: string;
546
+ chan_theory: string;
547
+ price_targets?: {
548
+ level: number;
549
+ label: string;
550
+ time_est: string;
551
+ probability?: number | undefined;
552
+ }[] | undefined;
553
+ time_horizon?: string | undefined;
554
+ range_15_30m?: {
555
+ low: number;
556
+ high: number;
557
+ optimistic_side: "buy" | "sell";
558
+ confidence?: number | undefined;
559
+ } | undefined;
560
+ }, {
561
+ indicators: string;
562
+ elliott_wave: string;
563
+ chan_theory: string;
564
+ price_targets?: {
565
+ level: number;
566
+ label: string;
567
+ time_est: string;
568
+ probability?: number | undefined;
569
+ }[] | undefined;
570
+ time_horizon?: string | undefined;
571
+ range_15_30m?: {
572
+ low: number;
573
+ high: number;
574
+ optimistic_side: "buy" | "sell";
575
+ confidence?: number | undefined;
576
+ } | undefined;
577
+ }>>;
578
+ action: z.ZodLiteral<"cancel_all">;
579
+ reason: z.ZodString;
580
+ }, "strip", z.ZodTypeAny, {
581
+ action: "cancel_all";
582
+ reason: string;
583
+ analysis?: {
584
+ indicators: string;
585
+ elliott_wave: string;
586
+ chan_theory: string;
587
+ price_targets?: {
588
+ level: number;
589
+ label: string;
590
+ time_est: string;
591
+ probability?: number | undefined;
592
+ }[] | undefined;
593
+ time_horizon?: string | undefined;
594
+ range_15_30m?: {
595
+ low: number;
596
+ high: number;
597
+ optimistic_side: "buy" | "sell";
598
+ confidence?: number | undefined;
599
+ } | undefined;
600
+ } | undefined;
601
+ }, {
602
+ action: "cancel_all";
603
+ reason: string;
604
+ analysis?: {
605
+ indicators: string;
606
+ elliott_wave: string;
607
+ chan_theory: string;
608
+ price_targets?: {
609
+ level: number;
610
+ label: string;
611
+ time_est: string;
612
+ probability?: number | undefined;
613
+ }[] | undefined;
614
+ time_horizon?: string | undefined;
615
+ range_15_30m?: {
616
+ low: number;
617
+ high: number;
618
+ optimistic_side: "buy" | "sell";
619
+ confidence?: number | undefined;
620
+ } | undefined;
621
+ } | undefined;
622
+ }>, z.ZodObject<{
623
+ analysis: z.ZodOptional<z.ZodObject<{
624
+ indicators: z.ZodString;
625
+ elliott_wave: z.ZodString;
626
+ chan_theory: z.ZodString;
627
+ price_targets: z.ZodOptional<z.ZodArray<z.ZodObject<{
628
+ level: z.ZodNumber;
629
+ label: z.ZodString;
630
+ time_est: z.ZodString;
631
+ probability: z.ZodOptional<z.ZodNumber>;
632
+ }, "strip", z.ZodTypeAny, {
633
+ level: number;
634
+ label: string;
635
+ time_est: string;
636
+ probability?: number | undefined;
637
+ }, {
638
+ level: number;
639
+ label: string;
640
+ time_est: string;
641
+ probability?: number | undefined;
642
+ }>, "many">>;
643
+ time_horizon: z.ZodOptional<z.ZodString>;
644
+ range_15_30m: z.ZodOptional<z.ZodObject<{
645
+ low: z.ZodNumber;
646
+ high: z.ZodNumber;
647
+ optimistic_side: z.ZodEnum<["buy", "sell"]>;
648
+ confidence: z.ZodOptional<z.ZodNumber>;
649
+ }, "strip", z.ZodTypeAny, {
650
+ low: number;
651
+ high: number;
652
+ optimistic_side: "buy" | "sell";
653
+ confidence?: number | undefined;
654
+ }, {
655
+ low: number;
656
+ high: number;
657
+ optimistic_side: "buy" | "sell";
658
+ confidence?: number | undefined;
659
+ }>>;
660
+ }, "strip", z.ZodTypeAny, {
661
+ indicators: string;
662
+ elliott_wave: string;
663
+ chan_theory: string;
664
+ price_targets?: {
665
+ level: number;
666
+ label: string;
667
+ time_est: string;
668
+ probability?: number | undefined;
669
+ }[] | undefined;
670
+ time_horizon?: string | undefined;
671
+ range_15_30m?: {
672
+ low: number;
673
+ high: number;
674
+ optimistic_side: "buy" | "sell";
675
+ confidence?: number | undefined;
676
+ } | undefined;
677
+ }, {
678
+ indicators: string;
679
+ elliott_wave: string;
680
+ chan_theory: string;
681
+ price_targets?: {
682
+ level: number;
683
+ label: string;
684
+ time_est: string;
685
+ probability?: number | undefined;
686
+ }[] | undefined;
687
+ time_horizon?: string | undefined;
688
+ range_15_30m?: {
689
+ low: number;
690
+ high: number;
691
+ optimistic_side: "buy" | "sell";
692
+ confidence?: number | undefined;
693
+ } | undefined;
694
+ }>>;
695
+ action: z.ZodLiteral<"place_limit_ambush">;
696
+ side: z.ZodEnum<["buy", "sell"]>;
697
+ limit_px: z.ZodNumber;
698
+ sz: z.ZodNumber;
699
+ tp_px: z.ZodNumber;
700
+ sl_px: z.ZodNumber;
701
+ /** TTL minutes for unfilled entry (typical 15–30). */
702
+ expires_in_min: z.ZodNumber;
703
+ is_market: z.ZodDefault<z.ZodBoolean>;
704
+ protection_limit_px: z.ZodOptional<z.ZodNumber>;
705
+ range_15_30m: z.ZodOptional<z.ZodObject<{
706
+ low: z.ZodNumber;
707
+ high: z.ZodNumber;
708
+ optimistic_side: z.ZodEnum<["buy", "sell"]>;
709
+ confidence: z.ZodOptional<z.ZodNumber>;
710
+ }, "strip", z.ZodTypeAny, {
711
+ low: number;
712
+ high: number;
713
+ optimistic_side: "buy" | "sell";
714
+ confidence?: number | undefined;
715
+ }, {
716
+ low: number;
717
+ high: number;
718
+ optimistic_side: "buy" | "sell";
719
+ confidence?: number | undefined;
720
+ }>>;
721
+ reason: z.ZodString;
722
+ confidence: z.ZodNumber;
723
+ risk_flags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
724
+ }, "strip", z.ZodTypeAny, {
725
+ confidence: number;
726
+ action: "place_limit_ambush";
727
+ reason: string;
728
+ side: "buy" | "sell";
729
+ limit_px: number;
730
+ sz: number;
731
+ tp_px: number;
732
+ sl_px: number;
733
+ is_market: boolean;
734
+ risk_flags: string[];
735
+ expires_in_min: number;
736
+ range_15_30m?: {
737
+ low: number;
738
+ high: number;
739
+ optimistic_side: "buy" | "sell";
740
+ confidence?: number | undefined;
741
+ } | undefined;
742
+ analysis?: {
743
+ indicators: string;
744
+ elliott_wave: string;
745
+ chan_theory: string;
746
+ price_targets?: {
747
+ level: number;
748
+ label: string;
749
+ time_est: string;
750
+ probability?: number | undefined;
751
+ }[] | undefined;
752
+ time_horizon?: string | undefined;
753
+ range_15_30m?: {
754
+ low: number;
755
+ high: number;
756
+ optimistic_side: "buy" | "sell";
757
+ confidence?: number | undefined;
758
+ } | undefined;
759
+ } | undefined;
760
+ protection_limit_px?: number | undefined;
761
+ }, {
762
+ confidence: number;
763
+ action: "place_limit_ambush";
764
+ reason: string;
765
+ side: "buy" | "sell";
766
+ limit_px: number;
767
+ sz: number;
768
+ tp_px: number;
769
+ sl_px: number;
770
+ expires_in_min: number;
771
+ range_15_30m?: {
772
+ low: number;
773
+ high: number;
774
+ optimistic_side: "buy" | "sell";
775
+ confidence?: number | undefined;
776
+ } | undefined;
777
+ analysis?: {
778
+ indicators: string;
779
+ elliott_wave: string;
780
+ chan_theory: string;
781
+ price_targets?: {
782
+ level: number;
783
+ label: string;
784
+ time_est: string;
785
+ probability?: number | undefined;
786
+ }[] | undefined;
787
+ time_horizon?: string | undefined;
788
+ range_15_30m?: {
789
+ low: number;
790
+ high: number;
791
+ optimistic_side: "buy" | "sell";
792
+ confidence?: number | undefined;
793
+ } | undefined;
794
+ } | undefined;
795
+ is_market?: boolean | undefined;
796
+ protection_limit_px?: number | undefined;
797
+ risk_flags?: string[] | undefined;
798
+ }>]>;
799
+ export type AdvisorAction = z.infer<typeof AdvisorActionSchema>;
800
+ export type AdvisorBracketOpenAction = Extract<AdvisorAction, {
801
+ action: "open_with_bracket" | "place_limit_ambush";
802
+ }>;
803
+ export declare function isAdvisorBracketOpenAction(action: AdvisorAction): action is AdvisorBracketOpenAction;
804
+ /** Bracket and non–is_market paths need an explicit protection limit. */
805
+ export declare function refineBracketProtection(action: AdvisorAction): AdvisorAction;
806
+ export declare function extractJsonObjectFromModelText(raw: string): string;
807
+ export declare function parseAdvisorActionFromModelText(raw: string): AdvisorAction;
808
+ declare const StrategyActionSchema: z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
809
+ action: z.ZodLiteral<"wait">;
810
+ reason: z.ZodString;
811
+ confidence: z.ZodNumber;
812
+ }, "strip", z.ZodTypeAny, {
813
+ confidence: number;
814
+ action: "wait";
815
+ reason: string;
816
+ }, {
817
+ confidence: number;
818
+ action: "wait";
819
+ reason: string;
820
+ }>, z.ZodObject<{
821
+ action: z.ZodLiteral<"open_with_bracket">;
822
+ side: z.ZodEnum<["buy", "sell"]>;
823
+ limit_px: z.ZodNumber;
824
+ sz: z.ZodNumber;
825
+ tp_px: z.ZodNumber;
826
+ sl_px: z.ZodNumber;
827
+ is_market: z.ZodDefault<z.ZodBoolean>;
828
+ protection_limit_px: z.ZodOptional<z.ZodNumber>;
829
+ reason: z.ZodString;
830
+ confidence: z.ZodNumber;
831
+ risk_flags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
832
+ }, "strip", z.ZodTypeAny, {
833
+ confidence: number;
834
+ action: "open_with_bracket";
835
+ reason: string;
836
+ side: "buy" | "sell";
837
+ limit_px: number;
838
+ sz: number;
839
+ tp_px: number;
840
+ sl_px: number;
841
+ is_market: boolean;
842
+ risk_flags: string[];
843
+ protection_limit_px?: number | undefined;
844
+ }, {
845
+ confidence: number;
846
+ action: "open_with_bracket";
847
+ reason: string;
848
+ side: "buy" | "sell";
849
+ limit_px: number;
850
+ sz: number;
851
+ tp_px: number;
852
+ sl_px: number;
853
+ is_market?: boolean | undefined;
854
+ protection_limit_px?: number | undefined;
855
+ risk_flags?: string[] | undefined;
856
+ }>, z.ZodObject<{
857
+ action: z.ZodLiteral<"close_position">;
858
+ method: z.ZodEnum<["market", "limit"]>;
859
+ limit_px: z.ZodOptional<z.ZodNumber>;
860
+ tp_unreachable: z.ZodOptional<z.ZodBoolean>;
861
+ reason: z.ZodString;
862
+ confidence: z.ZodNumber;
863
+ }, "strip", z.ZodTypeAny, {
864
+ confidence: number;
865
+ action: "close_position";
866
+ reason: string;
867
+ method: "market" | "limit";
868
+ limit_px?: number | undefined;
869
+ tp_unreachable?: boolean | undefined;
870
+ }, {
871
+ confidence: number;
872
+ action: "close_position";
873
+ reason: string;
874
+ method: "market" | "limit";
875
+ limit_px?: number | undefined;
876
+ tp_unreachable?: boolean | undefined;
877
+ }>, z.ZodObject<{
878
+ action: z.ZodLiteral<"cancel_all">;
879
+ reason: z.ZodString;
880
+ }, "strip", z.ZodTypeAny, {
881
+ action: "cancel_all";
882
+ reason: string;
883
+ }, {
884
+ action: "cancel_all";
885
+ reason: string;
886
+ }>, z.ZodObject<{
887
+ action: z.ZodLiteral<"place_limit_ambush">;
888
+ side: z.ZodEnum<["buy", "sell"]>;
889
+ limit_px: z.ZodNumber;
890
+ sz: z.ZodNumber;
891
+ tp_px: z.ZodNumber;
892
+ sl_px: z.ZodNumber;
893
+ expires_in_min: z.ZodNumber;
894
+ is_market: z.ZodDefault<z.ZodBoolean>;
895
+ protection_limit_px: z.ZodOptional<z.ZodNumber>;
896
+ range_15_30m: z.ZodOptional<z.ZodObject<{
897
+ low: z.ZodNumber;
898
+ high: z.ZodNumber;
899
+ optimistic_side: z.ZodEnum<["buy", "sell"]>;
900
+ confidence: z.ZodOptional<z.ZodNumber>;
901
+ }, "strip", z.ZodTypeAny, {
902
+ low: number;
903
+ high: number;
904
+ optimistic_side: "buy" | "sell";
905
+ confidence?: number | undefined;
906
+ }, {
907
+ low: number;
908
+ high: number;
909
+ optimistic_side: "buy" | "sell";
910
+ confidence?: number | undefined;
911
+ }>>;
912
+ reason: z.ZodString;
913
+ confidence: z.ZodNumber;
914
+ risk_flags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
915
+ }, "strip", z.ZodTypeAny, {
916
+ confidence: number;
917
+ action: "place_limit_ambush";
918
+ reason: string;
919
+ side: "buy" | "sell";
920
+ limit_px: number;
921
+ sz: number;
922
+ tp_px: number;
923
+ sl_px: number;
924
+ is_market: boolean;
925
+ risk_flags: string[];
926
+ expires_in_min: number;
927
+ range_15_30m?: {
928
+ low: number;
929
+ high: number;
930
+ optimistic_side: "buy" | "sell";
931
+ confidence?: number | undefined;
932
+ } | undefined;
933
+ protection_limit_px?: number | undefined;
934
+ }, {
935
+ confidence: number;
936
+ action: "place_limit_ambush";
937
+ reason: string;
938
+ side: "buy" | "sell";
939
+ limit_px: number;
940
+ sz: number;
941
+ tp_px: number;
942
+ sl_px: number;
943
+ expires_in_min: number;
944
+ range_15_30m?: {
945
+ low: number;
946
+ high: number;
947
+ optimistic_side: "buy" | "sell";
948
+ confidence?: number | undefined;
949
+ } | undefined;
950
+ is_market?: boolean | undefined;
951
+ protection_limit_px?: number | undefined;
952
+ risk_flags?: string[] | undefined;
953
+ }>]>;
954
+ export type StrategyAction = z.infer<typeof StrategyActionSchema>;
955
+ export declare const DualAdvisorResponseSchema: z.ZodObject<{
956
+ analysis: z.ZodObject<{
957
+ indicators: z.ZodString;
958
+ elliott_wave: z.ZodString;
959
+ chan_theory: z.ZodString;
960
+ price_targets: z.ZodOptional<z.ZodArray<z.ZodObject<{
961
+ level: z.ZodNumber;
962
+ label: z.ZodString;
963
+ time_est: z.ZodString;
964
+ probability: z.ZodOptional<z.ZodNumber>;
965
+ }, "strip", z.ZodTypeAny, {
966
+ level: number;
967
+ label: string;
968
+ time_est: string;
969
+ probability?: number | undefined;
970
+ }, {
971
+ level: number;
972
+ label: string;
973
+ time_est: string;
974
+ probability?: number | undefined;
975
+ }>, "many">>;
976
+ time_horizon: z.ZodOptional<z.ZodString>;
977
+ range_15_30m: z.ZodOptional<z.ZodObject<{
978
+ low: z.ZodNumber;
979
+ high: z.ZodNumber;
980
+ optimistic_side: z.ZodEnum<["buy", "sell"]>;
981
+ confidence: z.ZodOptional<z.ZodNumber>;
982
+ }, "strip", z.ZodTypeAny, {
983
+ low: number;
984
+ high: number;
985
+ optimistic_side: "buy" | "sell";
986
+ confidence?: number | undefined;
987
+ }, {
988
+ low: number;
989
+ high: number;
990
+ optimistic_side: "buy" | "sell";
991
+ confidence?: number | undefined;
992
+ }>>;
993
+ }, "strip", z.ZodTypeAny, {
994
+ indicators: string;
995
+ elliott_wave: string;
996
+ chan_theory: string;
997
+ price_targets?: {
998
+ level: number;
999
+ label: string;
1000
+ time_est: string;
1001
+ probability?: number | undefined;
1002
+ }[] | undefined;
1003
+ time_horizon?: string | undefined;
1004
+ range_15_30m?: {
1005
+ low: number;
1006
+ high: number;
1007
+ optimistic_side: "buy" | "sell";
1008
+ confidence?: number | undefined;
1009
+ } | undefined;
1010
+ }, {
1011
+ indicators: string;
1012
+ elliott_wave: string;
1013
+ chan_theory: string;
1014
+ price_targets?: {
1015
+ level: number;
1016
+ label: string;
1017
+ time_est: string;
1018
+ probability?: number | undefined;
1019
+ }[] | undefined;
1020
+ time_horizon?: string | undefined;
1021
+ range_15_30m?: {
1022
+ low: number;
1023
+ high: number;
1024
+ optimistic_side: "buy" | "sell";
1025
+ confidence?: number | undefined;
1026
+ } | undefined;
1027
+ }>;
1028
+ scalp: z.ZodOptional<z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
1029
+ action: z.ZodLiteral<"wait">;
1030
+ reason: z.ZodString;
1031
+ confidence: z.ZodNumber;
1032
+ }, "strip", z.ZodTypeAny, {
1033
+ confidence: number;
1034
+ action: "wait";
1035
+ reason: string;
1036
+ }, {
1037
+ confidence: number;
1038
+ action: "wait";
1039
+ reason: string;
1040
+ }>, z.ZodObject<{
1041
+ action: z.ZodLiteral<"open_with_bracket">;
1042
+ side: z.ZodEnum<["buy", "sell"]>;
1043
+ limit_px: z.ZodNumber;
1044
+ sz: z.ZodNumber;
1045
+ tp_px: z.ZodNumber;
1046
+ sl_px: z.ZodNumber;
1047
+ is_market: z.ZodDefault<z.ZodBoolean>;
1048
+ protection_limit_px: z.ZodOptional<z.ZodNumber>;
1049
+ reason: z.ZodString;
1050
+ confidence: z.ZodNumber;
1051
+ risk_flags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1052
+ }, "strip", z.ZodTypeAny, {
1053
+ confidence: number;
1054
+ action: "open_with_bracket";
1055
+ reason: string;
1056
+ side: "buy" | "sell";
1057
+ limit_px: number;
1058
+ sz: number;
1059
+ tp_px: number;
1060
+ sl_px: number;
1061
+ is_market: boolean;
1062
+ risk_flags: string[];
1063
+ protection_limit_px?: number | undefined;
1064
+ }, {
1065
+ confidence: number;
1066
+ action: "open_with_bracket";
1067
+ reason: string;
1068
+ side: "buy" | "sell";
1069
+ limit_px: number;
1070
+ sz: number;
1071
+ tp_px: number;
1072
+ sl_px: number;
1073
+ is_market?: boolean | undefined;
1074
+ protection_limit_px?: number | undefined;
1075
+ risk_flags?: string[] | undefined;
1076
+ }>, z.ZodObject<{
1077
+ action: z.ZodLiteral<"close_position">;
1078
+ method: z.ZodEnum<["market", "limit"]>;
1079
+ limit_px: z.ZodOptional<z.ZodNumber>;
1080
+ tp_unreachable: z.ZodOptional<z.ZodBoolean>;
1081
+ reason: z.ZodString;
1082
+ confidence: z.ZodNumber;
1083
+ }, "strip", z.ZodTypeAny, {
1084
+ confidence: number;
1085
+ action: "close_position";
1086
+ reason: string;
1087
+ method: "market" | "limit";
1088
+ limit_px?: number | undefined;
1089
+ tp_unreachable?: boolean | undefined;
1090
+ }, {
1091
+ confidence: number;
1092
+ action: "close_position";
1093
+ reason: string;
1094
+ method: "market" | "limit";
1095
+ limit_px?: number | undefined;
1096
+ tp_unreachable?: boolean | undefined;
1097
+ }>, z.ZodObject<{
1098
+ action: z.ZodLiteral<"cancel_all">;
1099
+ reason: z.ZodString;
1100
+ }, "strip", z.ZodTypeAny, {
1101
+ action: "cancel_all";
1102
+ reason: string;
1103
+ }, {
1104
+ action: "cancel_all";
1105
+ reason: string;
1106
+ }>, z.ZodObject<{
1107
+ action: z.ZodLiteral<"place_limit_ambush">;
1108
+ side: z.ZodEnum<["buy", "sell"]>;
1109
+ limit_px: z.ZodNumber;
1110
+ sz: z.ZodNumber;
1111
+ tp_px: z.ZodNumber;
1112
+ sl_px: z.ZodNumber;
1113
+ expires_in_min: z.ZodNumber;
1114
+ is_market: z.ZodDefault<z.ZodBoolean>;
1115
+ protection_limit_px: z.ZodOptional<z.ZodNumber>;
1116
+ range_15_30m: z.ZodOptional<z.ZodObject<{
1117
+ low: z.ZodNumber;
1118
+ high: z.ZodNumber;
1119
+ optimistic_side: z.ZodEnum<["buy", "sell"]>;
1120
+ confidence: z.ZodOptional<z.ZodNumber>;
1121
+ }, "strip", z.ZodTypeAny, {
1122
+ low: number;
1123
+ high: number;
1124
+ optimistic_side: "buy" | "sell";
1125
+ confidence?: number | undefined;
1126
+ }, {
1127
+ low: number;
1128
+ high: number;
1129
+ optimistic_side: "buy" | "sell";
1130
+ confidence?: number | undefined;
1131
+ }>>;
1132
+ reason: z.ZodString;
1133
+ confidence: z.ZodNumber;
1134
+ risk_flags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1135
+ }, "strip", z.ZodTypeAny, {
1136
+ confidence: number;
1137
+ action: "place_limit_ambush";
1138
+ reason: string;
1139
+ side: "buy" | "sell";
1140
+ limit_px: number;
1141
+ sz: number;
1142
+ tp_px: number;
1143
+ sl_px: number;
1144
+ is_market: boolean;
1145
+ risk_flags: string[];
1146
+ expires_in_min: number;
1147
+ range_15_30m?: {
1148
+ low: number;
1149
+ high: number;
1150
+ optimistic_side: "buy" | "sell";
1151
+ confidence?: number | undefined;
1152
+ } | undefined;
1153
+ protection_limit_px?: number | undefined;
1154
+ }, {
1155
+ confidence: number;
1156
+ action: "place_limit_ambush";
1157
+ reason: string;
1158
+ side: "buy" | "sell";
1159
+ limit_px: number;
1160
+ sz: number;
1161
+ tp_px: number;
1162
+ sl_px: number;
1163
+ expires_in_min: number;
1164
+ range_15_30m?: {
1165
+ low: number;
1166
+ high: number;
1167
+ optimistic_side: "buy" | "sell";
1168
+ confidence?: number | undefined;
1169
+ } | undefined;
1170
+ is_market?: boolean | undefined;
1171
+ protection_limit_px?: number | undefined;
1172
+ risk_flags?: string[] | undefined;
1173
+ }>]>>;
1174
+ ambush: z.ZodOptional<z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
1175
+ action: z.ZodLiteral<"wait">;
1176
+ reason: z.ZodString;
1177
+ confidence: z.ZodNumber;
1178
+ }, "strip", z.ZodTypeAny, {
1179
+ confidence: number;
1180
+ action: "wait";
1181
+ reason: string;
1182
+ }, {
1183
+ confidence: number;
1184
+ action: "wait";
1185
+ reason: string;
1186
+ }>, z.ZodObject<{
1187
+ action: z.ZodLiteral<"open_with_bracket">;
1188
+ side: z.ZodEnum<["buy", "sell"]>;
1189
+ limit_px: z.ZodNumber;
1190
+ sz: z.ZodNumber;
1191
+ tp_px: z.ZodNumber;
1192
+ sl_px: z.ZodNumber;
1193
+ is_market: z.ZodDefault<z.ZodBoolean>;
1194
+ protection_limit_px: z.ZodOptional<z.ZodNumber>;
1195
+ reason: z.ZodString;
1196
+ confidence: z.ZodNumber;
1197
+ risk_flags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1198
+ }, "strip", z.ZodTypeAny, {
1199
+ confidence: number;
1200
+ action: "open_with_bracket";
1201
+ reason: string;
1202
+ side: "buy" | "sell";
1203
+ limit_px: number;
1204
+ sz: number;
1205
+ tp_px: number;
1206
+ sl_px: number;
1207
+ is_market: boolean;
1208
+ risk_flags: string[];
1209
+ protection_limit_px?: number | undefined;
1210
+ }, {
1211
+ confidence: number;
1212
+ action: "open_with_bracket";
1213
+ reason: string;
1214
+ side: "buy" | "sell";
1215
+ limit_px: number;
1216
+ sz: number;
1217
+ tp_px: number;
1218
+ sl_px: number;
1219
+ is_market?: boolean | undefined;
1220
+ protection_limit_px?: number | undefined;
1221
+ risk_flags?: string[] | undefined;
1222
+ }>, z.ZodObject<{
1223
+ action: z.ZodLiteral<"close_position">;
1224
+ method: z.ZodEnum<["market", "limit"]>;
1225
+ limit_px: z.ZodOptional<z.ZodNumber>;
1226
+ tp_unreachable: z.ZodOptional<z.ZodBoolean>;
1227
+ reason: z.ZodString;
1228
+ confidence: z.ZodNumber;
1229
+ }, "strip", z.ZodTypeAny, {
1230
+ confidence: number;
1231
+ action: "close_position";
1232
+ reason: string;
1233
+ method: "market" | "limit";
1234
+ limit_px?: number | undefined;
1235
+ tp_unreachable?: boolean | undefined;
1236
+ }, {
1237
+ confidence: number;
1238
+ action: "close_position";
1239
+ reason: string;
1240
+ method: "market" | "limit";
1241
+ limit_px?: number | undefined;
1242
+ tp_unreachable?: boolean | undefined;
1243
+ }>, z.ZodObject<{
1244
+ action: z.ZodLiteral<"cancel_all">;
1245
+ reason: z.ZodString;
1246
+ }, "strip", z.ZodTypeAny, {
1247
+ action: "cancel_all";
1248
+ reason: string;
1249
+ }, {
1250
+ action: "cancel_all";
1251
+ reason: string;
1252
+ }>, z.ZodObject<{
1253
+ action: z.ZodLiteral<"place_limit_ambush">;
1254
+ side: z.ZodEnum<["buy", "sell"]>;
1255
+ limit_px: z.ZodNumber;
1256
+ sz: z.ZodNumber;
1257
+ tp_px: z.ZodNumber;
1258
+ sl_px: z.ZodNumber;
1259
+ expires_in_min: z.ZodNumber;
1260
+ is_market: z.ZodDefault<z.ZodBoolean>;
1261
+ protection_limit_px: z.ZodOptional<z.ZodNumber>;
1262
+ range_15_30m: z.ZodOptional<z.ZodObject<{
1263
+ low: z.ZodNumber;
1264
+ high: z.ZodNumber;
1265
+ optimistic_side: z.ZodEnum<["buy", "sell"]>;
1266
+ confidence: z.ZodOptional<z.ZodNumber>;
1267
+ }, "strip", z.ZodTypeAny, {
1268
+ low: number;
1269
+ high: number;
1270
+ optimistic_side: "buy" | "sell";
1271
+ confidence?: number | undefined;
1272
+ }, {
1273
+ low: number;
1274
+ high: number;
1275
+ optimistic_side: "buy" | "sell";
1276
+ confidence?: number | undefined;
1277
+ }>>;
1278
+ reason: z.ZodString;
1279
+ confidence: z.ZodNumber;
1280
+ risk_flags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1281
+ }, "strip", z.ZodTypeAny, {
1282
+ confidence: number;
1283
+ action: "place_limit_ambush";
1284
+ reason: string;
1285
+ side: "buy" | "sell";
1286
+ limit_px: number;
1287
+ sz: number;
1288
+ tp_px: number;
1289
+ sl_px: number;
1290
+ is_market: boolean;
1291
+ risk_flags: string[];
1292
+ expires_in_min: number;
1293
+ range_15_30m?: {
1294
+ low: number;
1295
+ high: number;
1296
+ optimistic_side: "buy" | "sell";
1297
+ confidence?: number | undefined;
1298
+ } | undefined;
1299
+ protection_limit_px?: number | undefined;
1300
+ }, {
1301
+ confidence: number;
1302
+ action: "place_limit_ambush";
1303
+ reason: string;
1304
+ side: "buy" | "sell";
1305
+ limit_px: number;
1306
+ sz: number;
1307
+ tp_px: number;
1308
+ sl_px: number;
1309
+ expires_in_min: number;
1310
+ range_15_30m?: {
1311
+ low: number;
1312
+ high: number;
1313
+ optimistic_side: "buy" | "sell";
1314
+ confidence?: number | undefined;
1315
+ } | undefined;
1316
+ is_market?: boolean | undefined;
1317
+ protection_limit_px?: number | undefined;
1318
+ risk_flags?: string[] | undefined;
1319
+ }>]>>;
1320
+ }, "strip", z.ZodTypeAny, {
1321
+ analysis: {
1322
+ indicators: string;
1323
+ elliott_wave: string;
1324
+ chan_theory: string;
1325
+ price_targets?: {
1326
+ level: number;
1327
+ label: string;
1328
+ time_est: string;
1329
+ probability?: number | undefined;
1330
+ }[] | undefined;
1331
+ time_horizon?: string | undefined;
1332
+ range_15_30m?: {
1333
+ low: number;
1334
+ high: number;
1335
+ optimistic_side: "buy" | "sell";
1336
+ confidence?: number | undefined;
1337
+ } | undefined;
1338
+ };
1339
+ scalp?: {
1340
+ confidence: number;
1341
+ action: "wait";
1342
+ reason: string;
1343
+ } | {
1344
+ confidence: number;
1345
+ action: "open_with_bracket";
1346
+ reason: string;
1347
+ side: "buy" | "sell";
1348
+ limit_px: number;
1349
+ sz: number;
1350
+ tp_px: number;
1351
+ sl_px: number;
1352
+ is_market: boolean;
1353
+ risk_flags: string[];
1354
+ protection_limit_px?: number | undefined;
1355
+ } | {
1356
+ confidence: number;
1357
+ action: "close_position";
1358
+ reason: string;
1359
+ method: "market" | "limit";
1360
+ limit_px?: number | undefined;
1361
+ tp_unreachable?: boolean | undefined;
1362
+ } | {
1363
+ action: "cancel_all";
1364
+ reason: string;
1365
+ } | {
1366
+ confidence: number;
1367
+ action: "place_limit_ambush";
1368
+ reason: string;
1369
+ side: "buy" | "sell";
1370
+ limit_px: number;
1371
+ sz: number;
1372
+ tp_px: number;
1373
+ sl_px: number;
1374
+ is_market: boolean;
1375
+ risk_flags: string[];
1376
+ expires_in_min: number;
1377
+ range_15_30m?: {
1378
+ low: number;
1379
+ high: number;
1380
+ optimistic_side: "buy" | "sell";
1381
+ confidence?: number | undefined;
1382
+ } | undefined;
1383
+ protection_limit_px?: number | undefined;
1384
+ } | undefined;
1385
+ ambush?: {
1386
+ confidence: number;
1387
+ action: "wait";
1388
+ reason: string;
1389
+ } | {
1390
+ confidence: number;
1391
+ action: "open_with_bracket";
1392
+ reason: string;
1393
+ side: "buy" | "sell";
1394
+ limit_px: number;
1395
+ sz: number;
1396
+ tp_px: number;
1397
+ sl_px: number;
1398
+ is_market: boolean;
1399
+ risk_flags: string[];
1400
+ protection_limit_px?: number | undefined;
1401
+ } | {
1402
+ confidence: number;
1403
+ action: "close_position";
1404
+ reason: string;
1405
+ method: "market" | "limit";
1406
+ limit_px?: number | undefined;
1407
+ tp_unreachable?: boolean | undefined;
1408
+ } | {
1409
+ action: "cancel_all";
1410
+ reason: string;
1411
+ } | {
1412
+ confidence: number;
1413
+ action: "place_limit_ambush";
1414
+ reason: string;
1415
+ side: "buy" | "sell";
1416
+ limit_px: number;
1417
+ sz: number;
1418
+ tp_px: number;
1419
+ sl_px: number;
1420
+ is_market: boolean;
1421
+ risk_flags: string[];
1422
+ expires_in_min: number;
1423
+ range_15_30m?: {
1424
+ low: number;
1425
+ high: number;
1426
+ optimistic_side: "buy" | "sell";
1427
+ confidence?: number | undefined;
1428
+ } | undefined;
1429
+ protection_limit_px?: number | undefined;
1430
+ } | undefined;
1431
+ }, {
1432
+ analysis: {
1433
+ indicators: string;
1434
+ elliott_wave: string;
1435
+ chan_theory: string;
1436
+ price_targets?: {
1437
+ level: number;
1438
+ label: string;
1439
+ time_est: string;
1440
+ probability?: number | undefined;
1441
+ }[] | undefined;
1442
+ time_horizon?: string | undefined;
1443
+ range_15_30m?: {
1444
+ low: number;
1445
+ high: number;
1446
+ optimistic_side: "buy" | "sell";
1447
+ confidence?: number | undefined;
1448
+ } | undefined;
1449
+ };
1450
+ scalp?: {
1451
+ confidence: number;
1452
+ action: "wait";
1453
+ reason: string;
1454
+ } | {
1455
+ confidence: number;
1456
+ action: "open_with_bracket";
1457
+ reason: string;
1458
+ side: "buy" | "sell";
1459
+ limit_px: number;
1460
+ sz: number;
1461
+ tp_px: number;
1462
+ sl_px: number;
1463
+ is_market?: boolean | undefined;
1464
+ protection_limit_px?: number | undefined;
1465
+ risk_flags?: string[] | undefined;
1466
+ } | {
1467
+ confidence: number;
1468
+ action: "close_position";
1469
+ reason: string;
1470
+ method: "market" | "limit";
1471
+ limit_px?: number | undefined;
1472
+ tp_unreachable?: boolean | undefined;
1473
+ } | {
1474
+ action: "cancel_all";
1475
+ reason: string;
1476
+ } | {
1477
+ confidence: number;
1478
+ action: "place_limit_ambush";
1479
+ reason: string;
1480
+ side: "buy" | "sell";
1481
+ limit_px: number;
1482
+ sz: number;
1483
+ tp_px: number;
1484
+ sl_px: number;
1485
+ expires_in_min: number;
1486
+ range_15_30m?: {
1487
+ low: number;
1488
+ high: number;
1489
+ optimistic_side: "buy" | "sell";
1490
+ confidence?: number | undefined;
1491
+ } | undefined;
1492
+ is_market?: boolean | undefined;
1493
+ protection_limit_px?: number | undefined;
1494
+ risk_flags?: string[] | undefined;
1495
+ } | undefined;
1496
+ ambush?: {
1497
+ confidence: number;
1498
+ action: "wait";
1499
+ reason: string;
1500
+ } | {
1501
+ confidence: number;
1502
+ action: "open_with_bracket";
1503
+ reason: string;
1504
+ side: "buy" | "sell";
1505
+ limit_px: number;
1506
+ sz: number;
1507
+ tp_px: number;
1508
+ sl_px: number;
1509
+ is_market?: boolean | undefined;
1510
+ protection_limit_px?: number | undefined;
1511
+ risk_flags?: string[] | undefined;
1512
+ } | {
1513
+ confidence: number;
1514
+ action: "close_position";
1515
+ reason: string;
1516
+ method: "market" | "limit";
1517
+ limit_px?: number | undefined;
1518
+ tp_unreachable?: boolean | undefined;
1519
+ } | {
1520
+ action: "cancel_all";
1521
+ reason: string;
1522
+ } | {
1523
+ confidence: number;
1524
+ action: "place_limit_ambush";
1525
+ reason: string;
1526
+ side: "buy" | "sell";
1527
+ limit_px: number;
1528
+ sz: number;
1529
+ tp_px: number;
1530
+ sl_px: number;
1531
+ expires_in_min: number;
1532
+ range_15_30m?: {
1533
+ low: number;
1534
+ high: number;
1535
+ optimistic_side: "buy" | "sell";
1536
+ confidence?: number | undefined;
1537
+ } | undefined;
1538
+ is_market?: boolean | undefined;
1539
+ protection_limit_px?: number | undefined;
1540
+ risk_flags?: string[] | undefined;
1541
+ } | undefined;
1542
+ }>;
1543
+ export type DualAdvisorResponse = z.infer<typeof DualAdvisorResponseSchema>;
1544
+ export declare function parseDualAdvisorResponse(raw: string): DualAdvisorResponse;
1545
+ /** Flatten dual response into executable actions (wait skipped). */
1546
+ export declare function dualActionsFromResponse(resp: DualAdvisorResponse): Array<{
1547
+ strategy: "scalp" | "ambush";
1548
+ action: AdvisorAction;
1549
+ }>;
1550
+ export {};
1551
+ //# sourceMappingURL=actionSchema.d.ts.map