tradeblocks-mcp 3.0.2 → 3.0.3

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 (214) hide show
  1. package/README.md +82 -68
  2. package/dist/{chunk-LDKTV7GW.js → chunk-27S67XW3.js} +24 -52
  3. package/dist/chunk-27S67XW3.js.map +1 -0
  4. package/dist/{chunk-FGZH632F.js → chunk-2E63THNI.js} +13 -11
  5. package/dist/chunk-2E63THNI.js.map +1 -0
  6. package/dist/{chunk-BKQ4PM4Y.js → chunk-6S37CXUA.js} +11 -13
  7. package/dist/chunk-6S37CXUA.js.map +1 -0
  8. package/dist/{chunk-PRAYH3RT.js → chunk-AP7IHUUR.js} +29 -12
  9. package/dist/chunk-AP7IHUUR.js.map +1 -0
  10. package/dist/{chunk-QTTR7AAW.js → chunk-C6LL746C.js} +67 -84
  11. package/dist/{chunk-QTTR7AAW.js.map → chunk-C6LL746C.js.map} +1 -1
  12. package/dist/{chunk-W2PP3LEH.js → chunk-SEUZYQGQ.js} +17 -8
  13. package/dist/chunk-SEUZYQGQ.js.map +1 -0
  14. package/dist/{chunk-4BLCXNQ6.js → chunk-UBUC5A66.js} +105 -114
  15. package/dist/chunk-UBUC5A66.js.map +1 -0
  16. package/dist/{chunk-XXYOUIZY.js → chunk-VDU25Z6X.js} +63 -80
  17. package/dist/chunk-VDU25Z6X.js.map +1 -0
  18. package/dist/daily-log-processor-BY3ISY6K.js +9 -0
  19. package/dist/{daily-logs-store-D3QC2XPV.js → daily-logs-store-3C3OTGPK.js} +2 -2
  20. package/dist/iv-solver-worker.js +9 -1
  21. package/dist/market-provider-H3ARIVZ4.js +16 -0
  22. package/dist/{proto-3HZTCWK4.js → proto-V23GIZG2.js} +2 -2
  23. package/dist/{sync-PO4IPCYV.js → sync-EVLKB3ZJ.js} +7 -7
  24. package/dist/test-exports.js +358 -254
  25. package/dist/test-exports.js.map +1 -1
  26. package/dist/trade-processor-EYA3I3XB.js +9 -0
  27. package/dist/{trades-store-LOL3FQSF.js → trades-store-R3NL25T2.js} +2 -2
  28. package/manifest.json +3 -11
  29. package/package.json +1 -1
  30. package/server/{chunk-NZO6PT64.js → chunk-4P7D7YZP.js} +102 -113
  31. package/server/chunk-4P7D7YZP.js.map +1 -0
  32. package/server/{chunk-72GKJE2U.js → chunk-BOPHW5M6.js} +521 -235
  33. package/server/chunk-BOPHW5M6.js.map +1 -0
  34. package/server/{chunk-WA5AAPCH.js → chunk-GH2552SE.js} +17 -8
  35. package/server/chunk-GH2552SE.js.map +1 -0
  36. package/server/{chunk-5EBXHT6C.js → chunk-OBYKFW2B.js} +11 -13
  37. package/server/chunk-OBYKFW2B.js.map +1 -0
  38. package/server/{chunk-FBNDMCT5.js → chunk-T66KH2XH.js} +13 -11
  39. package/server/chunk-T66KH2XH.js.map +1 -0
  40. package/server/{chunk-NRFXAJF7.js → chunk-W5E7FHC4.js} +24 -52
  41. package/server/chunk-W5E7FHC4.js.map +1 -0
  42. package/server/{chunk-CSDVJPBB.js → chunk-YUCOAJ4Z.js} +29 -12
  43. package/server/chunk-YUCOAJ4Z.js.map +1 -0
  44. package/server/{chunk-PNKG7RY7.js → chunk-ZBJCF4ZG.js} +63 -80
  45. package/server/chunk-ZBJCF4ZG.js.map +1 -0
  46. package/server/{config-6IZXEFEX.js → config-DK7KOMNL.js} +1 -1
  47. package/server/config-DK7KOMNL.js.map +1 -0
  48. package/server/daily-log-processor-ENEUT22A.js +10 -0
  49. package/server/{daily-logs-store-NU7M4L5C.js → daily-logs-store-YFNXTB7J.js} +2 -2
  50. package/server/http-server.js +2 -5
  51. package/server/index.js +1771 -1538
  52. package/server/index.js.map +1 -1
  53. package/server/iv-solver-worker.js +9 -1
  54. package/server/market-provider-B437HKLW.js +17 -0
  55. package/server/{proto-DWRZJO4E.js → proto-YZ4TLX2N.js} +2 -2
  56. package/server/{sync-QFI5L7S7.js → sync-V25UQJA3.js} +7 -7
  57. package/server/trade-processor-L3PIQ5TG.js +10 -0
  58. package/server/{trades-store-VY26MWER.js → trades-store-RTTEYMXH.js} +2 -2
  59. package/src/auth/clients-store.ts +4 -4
  60. package/src/auth/code-store.ts +1 -1
  61. package/src/auth/config.ts +11 -12
  62. package/src/auth/login-page.ts +8 -10
  63. package/src/auth/provider.ts +35 -30
  64. package/src/auth/token.ts +17 -15
  65. package/src/db/backtest-schemas.ts +12 -4
  66. package/src/db/connection.ts +107 -40
  67. package/src/db/index.ts +37 -5
  68. package/src/db/json-adapters.ts +22 -31
  69. package/src/db/json-migration.ts +11 -15
  70. package/src/db/json-store.ts +5 -3
  71. package/src/db/market-datasets.ts +48 -15
  72. package/src/db/market-schemas.ts +11 -5
  73. package/src/db/market-views.ts +119 -32
  74. package/src/db/parquet-writer.ts +7 -7
  75. package/src/db/profile-schemas.ts +39 -22
  76. package/src/db/schemas.ts +2 -2
  77. package/src/http-server.ts +7 -12
  78. package/src/index.ts +8 -9
  79. package/src/market/ingestor/index.ts +1 -4
  80. package/src/market/ingestor/market-ingestor.ts +140 -67
  81. package/src/market/ingestor/types.ts +1 -3
  82. package/src/market/stores/chain-sql.ts +2 -8
  83. package/src/market/stores/chain-store.ts +1 -4
  84. package/src/market/stores/duckdb-chain-store.ts +3 -14
  85. package/src/market/stores/duckdb-enriched-store.ts +3 -13
  86. package/src/market/stores/duckdb-quote-store.ts +10 -27
  87. package/src/market/stores/duckdb-spot-store.ts +4 -20
  88. package/src/market/stores/enriched-sql.ts +3 -9
  89. package/src/market/stores/enriched-store.ts +2 -2
  90. package/src/market/stores/parquet-chain-store.ts +5 -22
  91. package/src/market/stores/parquet-enriched-store.ts +4 -16
  92. package/src/market/stores/parquet-oi-daily-store.ts +3 -14
  93. package/src/market/stores/parquet-quote-store.ts +9 -29
  94. package/src/market/stores/parquet-spot-store.ts +14 -33
  95. package/src/market/stores/quote-store.ts +2 -10
  96. package/src/market/stores/spot-sql.ts +3 -15
  97. package/src/market/stores/spot-store.ts +1 -1
  98. package/src/market/tickers/defaults.json +6 -6
  99. package/src/market/tickers/loader.ts +2 -7
  100. package/src/market/tickers/registry.ts +5 -15
  101. package/src/market/tickers/schemas.ts +2 -6
  102. package/src/models/strategy-profile.ts +39 -39
  103. package/src/sync/block-sync.ts +44 -65
  104. package/src/sync/index.ts +1 -4
  105. package/src/sync/metadata.ts +14 -20
  106. package/src/test-exports.ts +127 -123
  107. package/src/tools/analysis.ts +180 -159
  108. package/src/tools/batch-exit-analysis.ts +100 -59
  109. package/src/tools/blocks/analysis.ts +116 -101
  110. package/src/tools/blocks/comparison.ts +281 -364
  111. package/src/tools/blocks/core.ts +208 -253
  112. package/src/tools/blocks/health.ts +571 -563
  113. package/src/tools/blocks/similarity.ts +316 -283
  114. package/src/tools/edge-decay.ts +124 -197
  115. package/src/tools/exit-analysis.ts +130 -77
  116. package/src/tools/greeks-attribution.ts +84 -35
  117. package/src/tools/guides.ts +4 -6
  118. package/src/tools/imports.ts +9 -12
  119. package/src/tools/market-data.ts +1067 -757
  120. package/src/tools/market-enrichment.ts +3 -3
  121. package/src/tools/market-fetch.ts +148 -67
  122. package/src/tools/market-imports.ts +12 -12
  123. package/src/tools/middleware/sync-middleware.ts +5 -6
  124. package/src/tools/performance.ts +185 -302
  125. package/src/tools/profile-analysis.ts +52 -66
  126. package/src/tools/profiles.ts +106 -69
  127. package/src/tools/regime-advisor.ts +20 -45
  128. package/src/tools/replay.ts +81 -77
  129. package/src/tools/reports/discrepancies.ts +298 -328
  130. package/src/tools/reports/fields.ts +7 -25
  131. package/src/tools/reports/helpers.ts +18 -49
  132. package/src/tools/reports/predictive.ts +27 -70
  133. package/src/tools/reports/slippage-trends.ts +315 -345
  134. package/src/tools/reports/slippage.ts +1 -4
  135. package/src/tools/reports/strategy-matches.ts +399 -441
  136. package/src/tools/schema.ts +43 -40
  137. package/src/tools/shared/filters.ts +3 -9
  138. package/src/tools/snapshot.ts +9 -30
  139. package/src/tools/sql.ts +15 -14
  140. package/src/tools/tickers.ts +1 -4
  141. package/src/utils/batch-exit-analysis.ts +31 -42
  142. package/src/utils/black-scholes.ts +39 -29
  143. package/src/utils/block-loader.ts +68 -82
  144. package/src/utils/calibration-probe.ts +1 -2
  145. package/src/utils/chain-loader.ts +3 -3
  146. package/src/utils/csv-discovery.ts +16 -22
  147. package/src/utils/data-quality.ts +24 -36
  148. package/src/utils/exit-triggers.ts +91 -96
  149. package/src/utils/field-timing.ts +94 -79
  150. package/src/utils/filter-predicates.ts +13 -9
  151. package/src/utils/flatfile-importer.ts +94 -64
  152. package/src/utils/greeks-decomposition.ts +152 -100
  153. package/src/utils/iv-solver-pool.ts +55 -25
  154. package/src/utils/iv-solver-worker.ts +5 -5
  155. package/src/utils/market-enricher.ts +528 -497
  156. package/src/utils/market-importer.ts +31 -12
  157. package/src/utils/market-provider.ts +21 -23
  158. package/src/utils/massive-tier.ts +5 -7
  159. package/src/utils/migrate-option-data-helpers.ts +2 -8
  160. package/src/utils/option-quote-greeks.ts +25 -31
  161. package/src/utils/option-time.ts +4 -8
  162. package/src/utils/output-formatter.ts +1 -4
  163. package/src/utils/provider-capabilities.ts +1 -4
  164. package/src/utils/providers/massive.ts +59 -93
  165. package/src/utils/providers/thetadata/backfill.ts +14 -23
  166. package/src/utils/providers/thetadata/client.ts +12 -8
  167. package/src/utils/providers/thetadata/decode.ts +2 -20
  168. package/src/utils/providers/thetadata/endpoints.ts +32 -40
  169. package/src/utils/providers/thetadata/join.ts +11 -10
  170. package/src/utils/providers/thetadata/proto.ts +12 -10
  171. package/src/utils/providers/thetadata/quote-mid-greeks.ts +5 -5
  172. package/src/utils/providers/thetadata.ts +11 -10
  173. package/src/utils/quote-enricher.ts +4 -4
  174. package/src/utils/quote-parquet-projection.ts +3 -11
  175. package/src/utils/sample-date-selector.ts +3 -5
  176. package/src/utils/schema-metadata.ts +102 -70
  177. package/src/utils/ticker.ts +5 -9
  178. package/src/utils/trade-replay.ts +77 -68
  179. package/dist/chunk-4BLCXNQ6.js.map +0 -1
  180. package/dist/chunk-BKQ4PM4Y.js.map +0 -1
  181. package/dist/chunk-FGZH632F.js.map +0 -1
  182. package/dist/chunk-LDKTV7GW.js.map +0 -1
  183. package/dist/chunk-PRAYH3RT.js.map +0 -1
  184. package/dist/chunk-W2PP3LEH.js.map +0 -1
  185. package/dist/chunk-XXYOUIZY.js.map +0 -1
  186. package/dist/daily-log-processor-6MWJ23JK.js +0 -9
  187. package/dist/market-provider-VDRJUEF2.js +0 -16
  188. package/dist/trade-processor-NHU4VWRX.js +0 -9
  189. package/server/chunk-5EBXHT6C.js.map +0 -1
  190. package/server/chunk-72GKJE2U.js.map +0 -1
  191. package/server/chunk-CSDVJPBB.js.map +0 -1
  192. package/server/chunk-FBNDMCT5.js.map +0 -1
  193. package/server/chunk-NRFXAJF7.js.map +0 -1
  194. package/server/chunk-NZO6PT64.js.map +0 -1
  195. package/server/chunk-PNKG7RY7.js.map +0 -1
  196. package/server/chunk-WA5AAPCH.js.map +0 -1
  197. package/server/config-6IZXEFEX.js.map +0 -1
  198. package/server/daily-log-processor-Y3PVSVBM.js +0 -10
  199. package/server/market-provider-VOYYVYWT.js +0 -17
  200. package/server/trade-processor-JWVS37KM.js +0 -10
  201. /package/dist/{daily-log-processor-6MWJ23JK.js.map → daily-log-processor-BY3ISY6K.js.map} +0 -0
  202. /package/dist/{daily-logs-store-D3QC2XPV.js.map → daily-logs-store-3C3OTGPK.js.map} +0 -0
  203. /package/dist/{market-provider-VDRJUEF2.js.map → market-provider-H3ARIVZ4.js.map} +0 -0
  204. /package/dist/{proto-3HZTCWK4.js.map → proto-V23GIZG2.js.map} +0 -0
  205. /package/dist/{sync-PO4IPCYV.js.map → sync-EVLKB3ZJ.js.map} +0 -0
  206. /package/dist/{trade-processor-NHU4VWRX.js.map → trade-processor-EYA3I3XB.js.map} +0 -0
  207. /package/dist/{trades-store-LOL3FQSF.js.map → trades-store-R3NL25T2.js.map} +0 -0
  208. /package/server/{daily-log-processor-Y3PVSVBM.js.map → daily-log-processor-ENEUT22A.js.map} +0 -0
  209. /package/server/{daily-logs-store-NU7M4L5C.js.map → daily-logs-store-YFNXTB7J.js.map} +0 -0
  210. /package/server/{market-provider-VOYYVYWT.js.map → market-provider-B437HKLW.js.map} +0 -0
  211. /package/server/{proto-DWRZJO4E.js.map → proto-YZ4TLX2N.js.map} +0 -0
  212. /package/server/{sync-QFI5L7S7.js.map → sync-V25UQJA3.js.map} +0 -0
  213. /package/server/{trade-processor-JWVS37KM.js.map → trade-processor-L3PIQ5TG.js.map} +0 -0
  214. /package/server/{trades-store-VY26MWER.js.map → trades-store-RTTEYMXH.js.map} +0 -0
@@ -15,47 +15,63 @@ export {
15
15
  type CsvMappings,
16
16
  type ImportCsvResult,
17
17
  type ImportCsvOptions,
18
- } from './utils/block-loader.ts';
18
+ } from "./utils/block-loader.ts";
19
19
 
20
20
  // Export CSV discovery utilities for unit testing
21
- export { detectCsvType, discoverCsvFiles, logCsvDiscoveryWarning, type CsvType } from './utils/csv-discovery.ts';
21
+ export {
22
+ detectCsvType,
23
+ discoverCsvFiles,
24
+ logCsvDiscoveryWarning,
25
+ type CsvType,
26
+ } from "./utils/csv-discovery.ts";
22
27
 
23
28
  // Export PortfolioStatsCalculator for testing block_diff logic
24
- export { PortfolioStatsCalculator } from '@tradeblocks/lib';
29
+ export { PortfolioStatsCalculator } from "@tradeblocks/lib";
25
30
 
26
31
  // Export correlation and tail-risk utilities for testing strategy_similarity
27
- export { calculateCorrelationMatrix, performTailRiskAnalysis } from '@tradeblocks/lib';
32
+ export { calculateCorrelationMatrix, performTailRiskAnalysis } from "@tradeblocks/lib";
28
33
 
29
34
  // Export sync layer for integration testing
30
- export {
31
- syncAllBlocks,
32
- syncBlock,
33
- type SyncResult,
34
- type BlockSyncResult,
35
- } from './sync/index.ts';
35
+ export { syncAllBlocks, syncBlock, type SyncResult, type BlockSyncResult } from "./sync/index.ts";
36
36
 
37
37
  // Export DuckDB connection utilities for integration testing
38
- export { getConnection, getReadOnlyConnection, closeConnection, isConnected, getConnectionMode, upgradeToReadWrite, downgradeToReadOnly, getCurrentConnection, openMarketOnlyConnection, openMarketParquetConnection, openMarketReadOnlyConnection } from './db/connection.ts';
39
- export type { MarketOnlyConnection, MarketParquetConnection, MarketReadOnlyConnection } from './db/connection.ts';
40
- export { setDataRoot, getDataRoot, resetDataRoot } from './db/data-root.ts';
41
- export { yesterdayET } from './utils/trading-dates.ts';
38
+ export {
39
+ getConnection,
40
+ getReadOnlyConnection,
41
+ closeConnection,
42
+ isConnected,
43
+ getConnectionMode,
44
+ upgradeToReadWrite,
45
+ downgradeToReadOnly,
46
+ getCurrentConnection,
47
+ openMarketOnlyConnection,
48
+ openMarketParquetConnection,
49
+ openMarketReadOnlyConnection,
50
+ } from "./db/connection.ts";
51
+ export type {
52
+ MarketOnlyConnection,
53
+ MarketParquetConnection,
54
+ MarketReadOnlyConnection,
55
+ } from "./db/connection.ts";
56
+ export { setDataRoot, getDataRoot, resetDataRoot } from "./db/data-root.ts";
57
+ export { yesterdayET } from "./utils/trading-dates.ts";
42
58
  export {
43
59
  resolveCanonicalMarketFile,
44
60
  resolveCanonicalMarketPartitionDir,
45
61
  resolveCanonicalMarketPartitionPath,
46
62
  resolveCanonicalMarketPartitionFile,
47
63
  canonicalMarketTableName,
48
- } from './db/market-datasets.ts';
64
+ } from "./db/market-datasets.ts";
49
65
 
50
66
  // Export market schema utilities for integration testing
51
- export { ensureMutableMarketTables, ensureMarketDataTables } from './db/market-schemas.ts';
67
+ export { ensureMutableMarketTables, ensureMarketDataTables } from "./db/market-schemas.ts";
52
68
 
53
69
  // Export shared filter utilities for testing
54
70
  export {
55
71
  filterByStrategy,
56
72
  filterByDateRange,
57
73
  filterDailyLogsByDateRange,
58
- } from './tools/shared/filters.ts';
74
+ } from "./tools/shared/filters.ts";
59
75
 
60
76
  // Export field timing utilities for testing
61
77
  export {
@@ -70,27 +86,24 @@ export {
70
86
  buildLookaheadFreeQuery,
71
87
  buildOutcomeQuery,
72
88
  buildVixJoinClause,
73
- } from './utils/field-timing.ts';
89
+ } from "./utils/field-timing.ts";
74
90
 
75
91
  // Export data availability helper for testing
76
- export {
77
- checkDataAvailability,
78
- type DataAvailabilityReport,
79
- } from './utils/data-availability.ts';
92
+ export { checkDataAvailability, type DataAvailabilityReport } from "./utils/data-availability.ts";
80
93
  export {
81
94
  queryCoverage,
82
95
  scoreDataQuality,
83
96
  formatCoverageReport,
84
97
  type DataQualityInput,
85
98
  type CoverageResult,
86
- } from './utils/data-quality.ts';
99
+ } from "./utils/data-quality.ts";
87
100
 
88
101
  // Export intraday timing utilities for testing
89
- export { computeIntradayTimingFields } from './utils/market-enricher.ts';
102
+ export { computeIntradayTimingFields } from "./utils/market-enricher.ts";
90
103
 
91
104
  // Export schema metadata for classification completeness tests
92
- export { SCHEMA_DESCRIPTIONS } from './utils/schema-metadata.ts';
93
- export type { ColumnDescription } from './utils/schema-metadata.ts';
105
+ export { SCHEMA_DESCRIPTIONS } from "./utils/schema-metadata.ts";
106
+ export type { ColumnDescription } from "./utils/schema-metadata.ts";
94
107
 
95
108
  // Export market import utilities for integration testing
96
109
  export {
@@ -102,14 +115,14 @@ export {
102
115
  type ImportMarketCsvParams,
103
116
  type ImportFromDatabaseParams,
104
117
  type ImportSpotResult,
105
- } from './utils/market-importer.ts';
118
+ } from "./utils/market-importer.ts";
106
119
 
107
120
  // Export market import metadata helpers for integration testing
108
121
  export {
109
122
  type MarketImportMetadata,
110
123
  getMarketImportMetadata,
111
124
  upsertMarketImportMetadata,
112
- } from './sync/metadata.ts';
125
+ } from "./sync/metadata.ts";
113
126
 
114
127
  // Export market enricher indicator functions for unit testing
115
128
  export {
@@ -129,7 +142,7 @@ export {
129
142
  computeIVP,
130
143
  type ContextRow,
131
144
  type EnrichedContextRow,
132
- } from './utils/market-enricher.ts';
145
+ } from "./utils/market-enricher.ts";
133
146
 
134
147
  // Export market enrichment utilities for integration testing
135
148
  export {
@@ -138,7 +151,7 @@ export {
138
151
  type EnrichmentResult,
139
152
  type EnrichmentOptions,
140
153
  type TierStatus,
141
- } from './utils/market-enricher.ts';
154
+ } from "./utils/market-enricher.ts";
142
155
 
143
156
  // Export strategy profile types and CRUD functions for integration testing
144
157
  export type {
@@ -149,18 +162,18 @@ export type {
149
162
  ExitRule,
150
163
  KeyMetrics,
151
164
  PositionSizing,
152
- } from './models/strategy-profile.ts';
165
+ } from "./models/strategy-profile.ts";
153
166
  export {
154
167
  ensureProfilesSchema,
155
168
  upsertProfile,
156
169
  getProfile,
157
170
  listProfiles,
158
171
  deleteProfile,
159
- } from './db/profile-schemas.ts';
172
+ } from "./db/profile-schemas.ts";
160
173
 
161
174
  // Export analysis utility modules for unit testing
162
- export { computeSliceStats, type SliceStats } from './utils/analysis-stats.ts';
163
- export { buildFilterPredicate, type FilterPredicate } from './utils/filter-predicates.ts';
175
+ export { computeSliceStats, type SliceStats } from "./utils/analysis-stats.ts";
176
+ export { buildFilterPredicate, type FilterPredicate } from "./utils/filter-predicates.ts";
164
177
 
165
178
  // Export profile tool handlers and schemas for integration testing
166
179
  export {
@@ -172,7 +185,7 @@ export {
172
185
  getStrategyProfileSchema,
173
186
  listProfilesSchema,
174
187
  deleteProfileSchema,
175
- } from './tools/profiles.ts';
188
+ } from "./tools/profiles.ts";
176
189
 
177
190
  // Export profile analysis tool handlers and schemas for integration testing
178
191
  export {
@@ -182,13 +195,13 @@ export {
182
195
  analyzeStructureFitSchema,
183
196
  validateEntryFiltersSchema,
184
197
  portfolioStructureMapSchema,
185
- } from './tools/profile-analysis.ts';
198
+ } from "./tools/profile-analysis.ts";
186
199
 
187
200
  // Export regime advisor tool handler and schema for integration testing
188
201
  export {
189
202
  handleRegimeAllocationAdvisor,
190
203
  regimeAllocationAdvisorSchema,
191
- } from './tools/regime-advisor.ts';
204
+ } from "./tools/regime-advisor.ts";
192
205
 
193
206
  // Export market data provider interface and types
194
207
  export {
@@ -201,14 +214,14 @@ export {
201
214
  type FetchSnapshotOptions,
202
215
  type FetchSnapshotResult,
203
216
  type MarketDataProvider,
204
- } from './utils/market-provider.ts';
217
+ } from "./utils/market-provider.ts";
205
218
  export {
206
219
  resolveMassiveDataTier,
207
220
  resolveProviderCapabilities,
208
221
  getResolvedProviderCapabilities,
209
222
  type MassiveDataTier,
210
223
  type ResolvedProviderCapabilities,
211
- } from './utils/provider-capabilities.ts';
224
+ } from "./utils/provider-capabilities.ts";
212
225
 
213
226
  // Export Massive provider internals for provider-specific tests
214
227
  export {
@@ -229,7 +242,7 @@ export {
229
242
  type MassiveAggregateResponse,
230
243
  type MassiveQuote,
231
244
  type MassiveQuotesResponse,
232
- } from './utils/providers/massive.ts';
245
+ } from "./utils/providers/massive.ts";
233
246
 
234
247
  // Export trade replay utilities for unit testing
235
248
  export {
@@ -245,14 +258,10 @@ export {
245
258
  type ParsedLeg,
246
259
  type ParsedLegOO,
247
260
  type GreeksConfig,
248
- } from './utils/trade-replay.ts';
261
+ } from "./utils/trade-replay.ts";
249
262
 
250
263
  // Export trade replay tool handler and schema for integration testing
251
- export {
252
- handleReplayTrade,
253
- replayTradeSchema,
254
- resolveOODateRange,
255
- } from './tools/replay.ts';
264
+ export { handleReplayTrade, replayTradeSchema, resolveOODateRange } from "./tools/replay.ts";
256
265
 
257
266
  // Export Black-Scholes and Bachelier greeks computation for unit testing
258
267
  export {
@@ -273,9 +282,9 @@ export {
273
282
  BACHELIER_DTE_THRESHOLD,
274
283
  computeLegGreeks,
275
284
  type GreeksResult,
276
- } from './utils/black-scholes.ts';
285
+ } from "./utils/black-scholes.ts";
277
286
 
278
- export { computeFractionalDte } from './utils/option-time.ts';
287
+ export { computeFractionalDte } from "./utils/option-time.ts";
279
288
  export {
280
289
  applyQuoteGreeks,
281
290
  applyQuoteGreeksParallel,
@@ -283,22 +292,27 @@ export {
283
292
  OPTION_QUOTE_GREEKS_REVISION,
284
293
  type QuoteGreeksMode,
285
294
  type QuoteGreeksSource,
286
- } from './utils/option-quote-greeks.ts';
295
+ } from "./utils/option-quote-greeks.ts";
287
296
  export {
288
297
  IvSolverPool,
289
298
  getSharedIvSolverPool,
290
299
  destroySharedIvSolverPool,
291
300
  type IvSolveJob,
292
301
  type IvSolveJobResult,
293
- } from './utils/iv-solver-pool.ts';
302
+ } from "./utils/iv-solver-pool.ts";
294
303
  export {
295
304
  describeReadParquetColumns,
296
305
  quoteParquetCanonicalProjection,
297
306
  readParquetFilesSql,
298
- } from './utils/quote-parquet-projection.ts';
307
+ } from "./utils/quote-parquet-projection.ts";
299
308
 
300
309
  // Export parquet-writer utility functions for unit testing
301
- export { isParquetMode, writeParquetAtomic, writeParquetPartition, resolveMarketDir } from './db/parquet-writer.ts';
310
+ export {
311
+ isParquetMode,
312
+ writeParquetAtomic,
313
+ writeParquetPartition,
314
+ resolveMarketDir,
315
+ } from "./db/parquet-writer.ts";
302
316
 
303
317
  // Export json-store utility for unit testing
304
318
  export {
@@ -307,19 +321,16 @@ export {
307
321
  deleteJsonFile,
308
322
  listJsonFiles,
309
323
  toFileSlug,
310
- } from './db/json-store.ts';
324
+ } from "./db/json-store.ts";
311
325
 
312
326
  // Export Massive snapshot schemas for unit testing
313
327
  export {
314
328
  MassiveSnapshotResponseSchema,
315
329
  MassiveSnapshotContractSchema,
316
- } from './utils/providers/massive.ts';
330
+ } from "./utils/providers/massive.ts";
317
331
 
318
332
  // Export snapshot tool handler and schema for integration testing
319
- export {
320
- handleGetOptionSnapshot,
321
- getOptionSnapshotSchema,
322
- } from './tools/snapshot.ts';
333
+ export { handleGetOptionSnapshot, getOptionSnapshotSchema } from "./tools/snapshot.ts";
323
334
 
324
335
  // Export greeks decomposition utilities for unit testing
325
336
  export {
@@ -331,7 +342,7 @@ export {
331
342
  type LegGroupVega,
332
343
  type LegGroupDef,
333
344
  type FactorName,
334
- } from './utils/greeks-decomposition.ts';
345
+ } from "./utils/greeks-decomposition.ts";
335
346
 
336
347
  // Export exit trigger analysis utilities for unit testing
337
348
  export {
@@ -343,7 +354,7 @@ export {
343
354
  type TriggerType,
344
355
  type LegGroupConfig,
345
356
  type LegGroupResult,
346
- } from './utils/exit-triggers.ts';
357
+ } from "./utils/exit-triggers.ts";
347
358
 
348
359
  // Export exit analysis tool handlers and schemas for integration testing
349
360
  export {
@@ -351,7 +362,7 @@ export {
351
362
  handleDecomposeGreeks,
352
363
  analyzeExitTriggersSchema,
353
364
  decomposeGreeksSchema,
354
- } from './tools/exit-analysis.ts';
365
+ } from "./tools/exit-analysis.ts";
355
366
 
356
367
  // Export batch exit analysis engine for unit testing
357
368
  export {
@@ -365,26 +376,23 @@ export {
365
376
  type AggregateStats,
366
377
  type TriggerAttribution,
367
378
  type BaselineMode,
368
- } from './utils/batch-exit-analysis.ts';
379
+ } from "./utils/batch-exit-analysis.ts";
369
380
 
370
381
  // Export batch exit analysis tool handler and schema for integration testing
371
- export {
372
- handleBatchExitAnalysis,
373
- batchExitAnalysisSchema,
374
- } from './tools/batch-exit-analysis.ts';
382
+ export { handleBatchExitAnalysis, batchExitAnalysisSchema } from "./tools/batch-exit-analysis.ts";
375
383
 
376
384
  // Export quote enricher pure functions for unit testing
377
- export { shouldSkipEnrichment, buildEnrichmentPlan } from './utils/quote-enricher.ts';
378
- export type { EnrichmentPlanInput } from './utils/quote-enricher.ts';
385
+ export { shouldSkipEnrichment, buildEnrichmentPlan } from "./utils/quote-enricher.ts";
386
+ export type { EnrichmentPlanInput } from "./utils/quote-enricher.ts";
379
387
 
380
388
  // SQL tool validator — unit-tested for path-gate + hard-block rules
381
- export { validateQuery, isUnderDataRoot } from './tools/sql.ts';
389
+ export { validateQuery, isUnderDataRoot } from "./tools/sql.ts";
382
390
 
383
391
  // Chain loader pure functions (unit testing)
384
- export { filterChain } from './utils/chain-loader.ts';
392
+ export { filterChain } from "./utils/chain-loader.ts";
385
393
 
386
394
  // Provider classes for capability-resolution testing
387
- export { ThetaDataProvider } from './utils/providers/thetadata.ts';
395
+ export { ThetaDataProvider } from "./utils/providers/thetadata.ts";
388
396
 
389
397
  // ThetaData MDDS provider internals (unit testing)
390
398
  export {
@@ -413,7 +421,7 @@ export {
413
421
  stockHistoryEod,
414
422
  stockHistoryOhlc,
415
423
  thetaTimestampToEtMinute,
416
- } from './utils/providers/thetadata/index.ts';
424
+ } from "./utils/providers/thetadata/index.ts";
417
425
 
418
426
  // ThetaData MDDS backfill preflight helpers
419
427
  export {
@@ -432,7 +440,7 @@ export {
432
440
  makeBackfillRunId,
433
441
  parseBackfillOccTicker,
434
442
  projectBackfillWallTimeHours,
435
- } from './utils/providers/thetadata/backfill.ts';
443
+ } from "./utils/providers/thetadata/backfill.ts";
436
444
  export type {
437
445
  BackfillBandRequestCountInput,
438
446
  BackfillConcreteFallback,
@@ -445,10 +453,10 @@ export type {
445
453
  BackfillRequestCountInput,
446
454
  BackfillRewriteSelectInput,
447
455
  BackfillStagedGreekRow,
448
- } from './utils/providers/thetadata/backfill.ts';
456
+ } from "./utils/providers/thetadata/backfill.ts";
449
457
 
450
458
  // Parquet view registration (integration testing)
451
- export { createMarketParquetViews } from './db/market-views.ts';
459
+ export { createMarketParquetViews } from "./db/market-views.ts";
452
460
 
453
461
  // Greeks attribution (v2.3)
454
462
  export {
@@ -460,13 +468,13 @@ export {
460
468
  type AttributionSummaryResult,
461
469
  type AttributionInstanceResult,
462
470
  type AttributionStepEntry,
463
- } from './tools/greeks-attribution.ts';
471
+ } from "./tools/greeks-attribution.ts";
464
472
 
465
473
  export {
466
474
  handleGetGreeksAttribution,
467
475
  getGreeksAttributionSchema,
468
476
  filterSparseSteps,
469
- } from './tools/greeks-attribution.ts';
477
+ } from "./tools/greeks-attribution.ts";
470
478
 
471
479
  // Export json-adapters for integration testing
472
480
  export {
@@ -482,11 +490,11 @@ export {
482
490
  upsertMarketImportMetadataJson,
483
491
  getFlatImportLogJson,
484
492
  upsertFlatImportLogJson,
485
- } from './db/json-adapters.ts';
486
- export type { FlatImportLogEntry } from './db/json-adapters.ts';
493
+ } from "./db/json-adapters.ts";
494
+ export type { FlatImportLogEntry } from "./db/json-adapters.ts";
487
495
 
488
496
  // Export json-migration for integration testing
489
- export { migrateMetadataToJson, type MigrationResult } from './db/json-migration.ts';
497
+ export { migrateMetadataToJson, type MigrationResult } from "./db/json-migration.ts";
490
498
 
491
499
  // ============================================================================
492
500
  // Market Data — store interfaces, registry, datasets
@@ -501,21 +509,21 @@ export {
501
509
  ChainStore,
502
510
  QuoteStore,
503
511
  createMarketStores,
504
- } from './market/stores/index.ts';
512
+ } from "./market/stores/index.ts";
505
513
  export type {
506
514
  StoreContext,
507
515
  MarketStores,
508
516
  EnrichedReadOpts,
509
517
  QuoteRow,
510
518
  CoverageReport,
511
- } from './market/stores/index.ts';
512
- export type { BarRow as MarketStoreBarRow, ContractRow } from './market/stores/index.ts';
519
+ } from "./market/stores/index.ts";
520
+ export type { BarRow as MarketStoreBarRow, ContractRow } from "./market/stores/index.ts";
513
521
 
514
522
  // Ticker registry + resolver + loader + schemas
515
- export { extractRoot, rootToUnderlying } from './market/tickers/resolver.ts';
516
- export { TickerRegistry } from './market/tickers/registry.ts';
517
- export type { TickerEntry, EntrySource } from './market/tickers/registry.ts';
518
- export { loadRegistry, saveUserOverride } from './market/tickers/loader.ts';
523
+ export { extractRoot, rootToUnderlying } from "./market/tickers/resolver.ts";
524
+ export { TickerRegistry } from "./market/tickers/registry.ts";
525
+ export type { TickerEntry, EntrySource } from "./market/tickers/registry.ts";
526
+ export { loadRegistry, saveUserOverride } from "./market/tickers/loader.ts";
519
527
  export {
520
528
  UnderlyingsFileSchema,
521
529
  registerUnderlyingSchema,
@@ -523,13 +531,13 @@ export {
523
531
  listUnderlyingsSchema,
524
532
  resolveRootSchema,
525
533
  TICKER_RE,
526
- } from './market/tickers/schemas.ts';
534
+ } from "./market/tickers/schemas.ts";
527
535
 
528
536
  // Parquet writer multi-level options type
529
537
  // Note: the value-level parquet-writer re-exports above already cover the
530
538
  // runtime symbols; this line adds the type alias for the multi-level
531
539
  // overload so tests can type-check against the V3 shape.
532
- export type { WriteParquetPartitionOptsV3 } from './db/parquet-writer.ts';
540
+ export type { WriteParquetPartitionOptsV3 } from "./db/parquet-writer.ts";
533
541
 
534
542
  // Dataset registry + per-dataset helpers
535
543
  export {
@@ -540,8 +548,8 @@ export {
540
548
  writeOiDailyPartition,
541
549
  writeEnrichedTickerFile,
542
550
  writeEnrichedContext,
543
- } from './db/market-datasets.ts';
544
- export type { DatasetDef } from './db/market-datasets.ts';
551
+ } from "./db/market-datasets.ts";
552
+ export type { DatasetDef } from "./db/market-datasets.ts";
545
553
 
546
554
  // Ticker MCP tool handlers — schemas re-exported from tickers/schemas.ts above
547
555
  export {
@@ -550,7 +558,7 @@ export {
550
558
  handleUnregisterUnderlying,
551
559
  handleListUnderlyings,
552
560
  handleResolveRoot,
553
- } from './tools/tickers.ts';
561
+ } from "./tools/tickers.ts";
554
562
 
555
563
  // ============================================================================
556
564
  // Pure helpers + watermark adapter
@@ -564,17 +572,17 @@ export {
564
572
  buildReadBarsSQL,
565
573
  buildReadDailyBarsSQL,
566
574
  buildReadRthOpensSQL,
567
- } from './market/stores/spot-sql.ts';
568
- export type { BuiltSQL } from './market/stores/spot-sql.ts';
569
- export { buildReadEnrichedSQL } from './market/stores/enriched-sql.ts';
570
- export type { BuildReadEnrichedArgs } from './market/stores/enriched-sql.ts';
571
- export { buildReadChainSQL } from './market/stores/chain-sql.ts';
572
- export { buildReadQuotesSQL } from './market/stores/quote-sql.ts';
573
- export { rthDailyAggregateSubquery } from './market/stores/rth-aggregation.ts';
574
- export type { RthWindowOpts } from './market/stores/rth-aggregation.ts';
575
+ } from "./market/stores/spot-sql.ts";
576
+ export type { BuiltSQL } from "./market/stores/spot-sql.ts";
577
+ export { buildReadEnrichedSQL } from "./market/stores/enriched-sql.ts";
578
+ export type { BuildReadEnrichedArgs } from "./market/stores/enriched-sql.ts";
579
+ export { buildReadChainSQL } from "./market/stores/chain-sql.ts";
580
+ export { buildReadQuotesSQL } from "./market/stores/quote-sql.ts";
581
+ export { rthDailyAggregateSubquery } from "./market/stores/rth-aggregation.ts";
582
+ export type { RthWindowOpts } from "./market/stores/rth-aggregation.ts";
575
583
 
576
584
  // Shared coverage helper
577
- export { listPartitionValues } from './market/stores/coverage.ts';
585
+ export { listPartitionValues } from "./market/stores/coverage.ts";
578
586
 
579
587
  // Enrichment watermark adapter
580
588
  export {
@@ -582,8 +590,8 @@ export {
582
590
  loadEnrichmentWatermarks,
583
591
  getEnrichedThrough,
584
592
  upsertEnrichedThrough,
585
- } from './db/json-adapters.ts';
586
- export type { EnrichmentWatermarks } from './db/json-adapters.ts';
593
+ } from "./db/json-adapters.ts";
594
+ export type { EnrichmentWatermarks } from "./db/json-adapters.ts";
587
595
 
588
596
  // Schema ensure functions are re-exported earlier in this file via
589
597
  // `ensureMutableMarketTables, ensureMarketDataTables` near the top; do NOT
@@ -597,19 +605,19 @@ export type { EnrichmentWatermarks } from './db/json-adapters.ts';
597
605
  // ============================================================================
598
606
 
599
607
  // Concrete Spot store pair
600
- export { ParquetSpotStore } from './market/stores/parquet-spot-store.ts';
601
- export { DuckdbSpotStore } from './market/stores/duckdb-spot-store.ts';
608
+ export { ParquetSpotStore } from "./market/stores/parquet-spot-store.ts";
609
+ export { DuckdbSpotStore } from "./market/stores/duckdb-spot-store.ts";
602
610
 
603
611
  // Concrete Chain store pair
604
- export { ParquetChainStore } from './market/stores/parquet-chain-store.ts';
605
- export { DuckdbChainStore } from './market/stores/duckdb-chain-store.ts';
612
+ export { ParquetChainStore } from "./market/stores/parquet-chain-store.ts";
613
+ export { DuckdbChainStore } from "./market/stores/duckdb-chain-store.ts";
606
614
 
607
615
  // Concrete Quote store pair
608
- export { ParquetQuoteStore } from './market/stores/parquet-quote-store.ts';
609
- export { DuckdbQuoteStore } from './market/stores/duckdb-quote-store.ts';
616
+ export { ParquetQuoteStore } from "./market/stores/parquet-quote-store.ts";
617
+ export { DuckdbQuoteStore } from "./market/stores/duckdb-quote-store.ts";
610
618
 
611
619
  // Daily open-interest store
612
- export { ParquetOiDailyStore } from './market/stores/parquet-oi-daily-store.ts';
620
+ export { ParquetOiDailyStore } from "./market/stores/parquet-oi-daily-store.ts";
613
621
 
614
622
  // ============================================================================
615
623
  // Concrete Enriched stores
@@ -621,8 +629,8 @@ export { ParquetOiDailyStore } from './market/stores/parquet-oi-daily-store.ts';
621
629
  // ============================================================================
622
630
 
623
631
  // Concrete Enriched store pair
624
- export { ParquetEnrichedStore } from './market/stores/parquet-enriched-store.ts';
625
- export { DuckdbEnrichedStore } from './market/stores/duckdb-enriched-store.ts';
632
+ export { ParquetEnrichedStore } from "./market/stores/parquet-enriched-store.ts";
633
+ export { DuckdbEnrichedStore } from "./market/stores/duckdb-enriched-store.ts";
626
634
 
627
635
  // ============================================================================
628
636
  // Ingestor exports
@@ -660,8 +668,8 @@ export {
660
668
  buildOptionChainSelectQuery,
661
669
  buildOptionQuoteSelectQuery,
662
670
  LEVERAGED_ETFS,
663
- } from './utils/migrate-option-data-helpers.ts';
664
- export type { GroupResult } from './utils/migrate-option-data-helpers.ts';
671
+ } from "./utils/migrate-option-data-helpers.ts";
672
+ export type { GroupResult } from "./utils/migrate-option-data-helpers.ts";
665
673
 
666
674
  // ============================================================================
667
675
  // Spot backfill + enrichment-rebuild support
@@ -673,19 +681,15 @@ export {
673
681
  PHASE_5_FIXTURE_SEED,
674
682
  PHASE_5_KNOWN_EVENTS,
675
683
  PHASE_5_STRUCTURAL_DATES,
676
- } from './utils/sample-date-selector.ts';
677
- export type { SampleDate } from './utils/sample-date-selector.ts';
684
+ } from "./utils/sample-date-selector.ts";
685
+ export type { SampleDate } from "./utils/sample-date-selector.ts";
678
686
  export {
679
687
  compareFields,
680
688
  compareRow,
681
689
  DOUBLE_EPSILON,
682
690
  ENRICHED_FIELD_TYPES,
683
691
  CONTEXT_FIELD_TYPES,
684
- } from './utils/enrichment-verification.ts';
685
- export type {
686
- FieldType,
687
- FieldDiff,
688
- RowDiff,
689
- } from './utils/enrichment-verification.ts';
690
- export { calibrateProviderFetch } from './utils/calibration-probe.ts';
692
+ } from "./utils/enrichment-verification.ts";
693
+ export type { FieldType, FieldDiff, RowDiff } from "./utils/enrichment-verification.ts";
694
+ export { calibrateProviderFetch } from "./utils/calibration-probe.ts";
691
695
  // ============================================================================