tradeblocks-mcp 3.0.2 → 3.3.1

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