ether-to-astro 1.0.0

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 (138) hide show
  1. package/.env.example +13 -0
  2. package/.github/pull_request_template.md +16 -0
  3. package/.github/workflows/release.yml +35 -0
  4. package/.github/workflows/test.yml +32 -0
  5. package/AGENTS.md +99 -0
  6. package/LICENSE +18 -0
  7. package/NOTICE.md +45 -0
  8. package/README.md +301 -0
  9. package/SETUP.md +70 -0
  10. package/TESTING_SUMMARY.md +238 -0
  11. package/TEST_SUITE_STATUS.md +218 -0
  12. package/biome.json +48 -0
  13. package/dist/astro-service.d.ts +98 -0
  14. package/dist/astro-service.js +496 -0
  15. package/dist/chart-types.d.ts +52 -0
  16. package/dist/chart-types.js +51 -0
  17. package/dist/charts.d.ts +125 -0
  18. package/dist/charts.js +324 -0
  19. package/dist/cli.d.ts +7 -0
  20. package/dist/cli.js +472 -0
  21. package/dist/constants.d.ts +81 -0
  22. package/dist/constants.js +76 -0
  23. package/dist/eclipses.d.ts +85 -0
  24. package/dist/eclipses.js +184 -0
  25. package/dist/ephemeris.d.ts +120 -0
  26. package/dist/ephemeris.js +379 -0
  27. package/dist/formatter.d.ts +2 -0
  28. package/dist/formatter.js +22 -0
  29. package/dist/houses.d.ts +82 -0
  30. package/dist/houses.js +169 -0
  31. package/dist/index.d.ts +14 -0
  32. package/dist/index.js +150 -0
  33. package/dist/loader.d.ts +2 -0
  34. package/dist/loader.js +31 -0
  35. package/dist/logger.d.ts +25 -0
  36. package/dist/logger.js +73 -0
  37. package/dist/profile-store.d.ts +48 -0
  38. package/dist/profile-store.js +156 -0
  39. package/dist/riseset.d.ts +82 -0
  40. package/dist/riseset.js +185 -0
  41. package/dist/storage.d.ts +10 -0
  42. package/dist/storage.js +40 -0
  43. package/dist/time-utils.d.ts +68 -0
  44. package/dist/time-utils.js +136 -0
  45. package/dist/tool-registry.d.ts +35 -0
  46. package/dist/tool-registry.js +307 -0
  47. package/dist/tool-result.d.ts +175 -0
  48. package/dist/tool-result.js +188 -0
  49. package/dist/transits.d.ts +108 -0
  50. package/dist/transits.js +263 -0
  51. package/dist/types.d.ts +450 -0
  52. package/dist/types.js +161 -0
  53. package/example-usage.md +131 -0
  54. package/natal-chart.json +187 -0
  55. package/package.json +61 -0
  56. package/scripts/download-ephemeris.js +115 -0
  57. package/setup.sh +21 -0
  58. package/src/astro-service.ts +710 -0
  59. package/src/chart-types.ts +125 -0
  60. package/src/charts.ts +399 -0
  61. package/src/cli.ts +694 -0
  62. package/src/constants.ts +89 -0
  63. package/src/eclipses.ts +226 -0
  64. package/src/ephemeris.ts +437 -0
  65. package/src/formatter.ts +25 -0
  66. package/src/houses.ts +202 -0
  67. package/src/index.ts +170 -0
  68. package/src/loader.ts +36 -0
  69. package/src/logger.ts +104 -0
  70. package/src/profile-store.ts +285 -0
  71. package/src/riseset.ts +229 -0
  72. package/src/time-utils.ts +167 -0
  73. package/src/tool-registry.ts +357 -0
  74. package/src/tool-result.ts +283 -0
  75. package/src/transits.ts +352 -0
  76. package/src/types.ts +547 -0
  77. package/tests/README.md +173 -0
  78. package/tests/TESTING_STRATEGY.md +178 -0
  79. package/tests/fixtures/bowen-yang-chart.ts +69 -0
  80. package/tests/fixtures/calculate-expected.ts +81 -0
  81. package/tests/fixtures/expected-results.ts +117 -0
  82. package/tests/fixtures/generate-expected-simple.ts +94 -0
  83. package/tests/helpers/date-fixtures.ts +15 -0
  84. package/tests/helpers/ephem.ts +11 -0
  85. package/tests/helpers/temp.ts +9 -0
  86. package/tests/setup.ts +11 -0
  87. package/tests/unit/astro-service.test.ts +323 -0
  88. package/tests/unit/chart-types.test.ts +18 -0
  89. package/tests/unit/charts-errors.test.ts +42 -0
  90. package/tests/unit/charts.test.ts +157 -0
  91. package/tests/unit/cli-commands.test.ts +82 -0
  92. package/tests/unit/cli-profiles.test.ts +128 -0
  93. package/tests/unit/cli.test.ts +191 -0
  94. package/tests/unit/constants.test.ts +26 -0
  95. package/tests/unit/correctness-critical.test.ts +408 -0
  96. package/tests/unit/eclipses.test.ts +108 -0
  97. package/tests/unit/ephemeris.test.ts +213 -0
  98. package/tests/unit/error-handling.test.ts +116 -0
  99. package/tests/unit/formatter.test.ts +29 -0
  100. package/tests/unit/houses-errors.test.ts +27 -0
  101. package/tests/unit/houses-validation.test.ts +164 -0
  102. package/tests/unit/houses.test.ts +205 -0
  103. package/tests/unit/profile-store.test.ts +163 -0
  104. package/tests/unit/real-user-charts.test.ts +148 -0
  105. package/tests/unit/riseset.test.ts +106 -0
  106. package/tests/unit/solver-edges.test.ts +197 -0
  107. package/tests/unit/time-utils-temporal.test.ts +303 -0
  108. package/tests/unit/time-utils.test.ts +173 -0
  109. package/tests/unit/tool-registry.test.ts +222 -0
  110. package/tests/unit/tool-result.test.ts +45 -0
  111. package/tests/unit/transit-correctness.test.ts +78 -0
  112. package/tests/unit/transits.test.ts +238 -0
  113. package/tests/validation/README.md +32 -0
  114. package/tests/validation/adapters/astrolog.ts +306 -0
  115. package/tests/validation/adapters/internal.ts +184 -0
  116. package/tests/validation/compare/eclipses.ts +47 -0
  117. package/tests/validation/compare/houses.ts +76 -0
  118. package/tests/validation/compare/positions.ts +104 -0
  119. package/tests/validation/compare/riseSet.ts +48 -0
  120. package/tests/validation/compare/roots.ts +90 -0
  121. package/tests/validation/compare/transits.ts +69 -0
  122. package/tests/validation/fixtures/astrolog-parity/core.ts +194 -0
  123. package/tests/validation/fixtures/eclipses/core.ts +14 -0
  124. package/tests/validation/fixtures/houses/core.ts +47 -0
  125. package/tests/validation/fixtures/positions/core.ts +159 -0
  126. package/tests/validation/fixtures/rise-set/core.ts +20 -0
  127. package/tests/validation/fixtures/roots/core.ts +47 -0
  128. package/tests/validation/fixtures/transits/core.ts +61 -0
  129. package/tests/validation/fixtures/transits/dst.ts +21 -0
  130. package/tests/validation/oracle.spec.ts +129 -0
  131. package/tests/validation/utils/denseRootOracle.ts +269 -0
  132. package/tests/validation/utils/fixtureTypes.ts +146 -0
  133. package/tests/validation/utils/report.ts +60 -0
  134. package/tests/validation/utils/tolerances.ts +23 -0
  135. package/tests/validation/validation.spec.ts +836 -0
  136. package/tools/color-picker.html +388 -0
  137. package/tsconfig.json +17 -0
  138. package/vitest.config.ts +31 -0
@@ -0,0 +1,388 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Astro Chart Color Picker</title>
7
+ <script src="https://cdn.jsdelivr.net/npm/@astrodraw/astrochart@3/dist/astrochart.js"></script>
8
+ <style>
9
+ * { margin: 0; padding: 0; box-sizing: border-box; }
10
+ body {
11
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
12
+ padding: 20px;
13
+ background: #f5f5f5;
14
+ }
15
+ .container { max-width: 1400px; margin: 0 auto; }
16
+ h1 { margin-bottom: 20px; color: #333; }
17
+ .controls {
18
+ background: white;
19
+ padding: 20px;
20
+ border-radius: 8px;
21
+ margin-bottom: 20px;
22
+ box-shadow: 0 2px 8px rgba(0,0,0,0.1);
23
+ }
24
+ .color-grid {
25
+ display: grid;
26
+ grid-template-columns: repeat(4, 1fr);
27
+ gap: 15px;
28
+ margin-bottom: 20px;
29
+ }
30
+ .color-control {
31
+ display: flex;
32
+ flex-direction: column;
33
+ gap: 5px;
34
+ }
35
+ .color-control label {
36
+ font-size: 12px;
37
+ font-weight: 600;
38
+ color: #666;
39
+ }
40
+ .color-inputs {
41
+ display: flex;
42
+ gap: 5px;
43
+ }
44
+ .color-inputs input[type="color"] {
45
+ width: 60px;
46
+ height: 40px;
47
+ border: none;
48
+ border-radius: 4px;
49
+ cursor: pointer;
50
+ }
51
+ .color-inputs input[type="text"] {
52
+ flex: 1;
53
+ padding: 8px;
54
+ border: 1px solid #ddd;
55
+ border-radius: 4px;
56
+ font-family: 'Monaco', monospace;
57
+ font-size: 12px;
58
+ }
59
+ .theme-toggle {
60
+ display: flex;
61
+ gap: 10px;
62
+ margin-bottom: 15px;
63
+ }
64
+ .theme-btn {
65
+ padding: 8px 16px;
66
+ border: 2px solid #ddd;
67
+ background: white;
68
+ border-radius: 4px;
69
+ cursor: pointer;
70
+ font-weight: 600;
71
+ }
72
+ .theme-btn.active {
73
+ background: #8b5cf6;
74
+ color: white;
75
+ border-color: #8b5cf6;
76
+ }
77
+ .charts {
78
+ display: grid;
79
+ grid-template-columns: 1fr 1fr;
80
+ gap: 20px;
81
+ }
82
+ .chart-block {
83
+ background: white;
84
+ padding: 20px;
85
+ border-radius: 8px;
86
+ box-shadow: 0 2px 8px rgba(0,0,0,0.1);
87
+ }
88
+ .chart-block.dark {
89
+ background: #282c34;
90
+ }
91
+ .chart-block h2 {
92
+ margin-bottom: 15px;
93
+ font-size: 18px;
94
+ }
95
+ .chart-block.dark h2 {
96
+ color: #abb2bf;
97
+ }
98
+ #chart-light, #chart-dark {
99
+ width: 100%;
100
+ height: 500px;
101
+ }
102
+ .export-btn {
103
+ padding: 12px 24px;
104
+ background: #8b5cf6;
105
+ color: white;
106
+ border: none;
107
+ border-radius: 4px;
108
+ font-weight: 600;
109
+ cursor: pointer;
110
+ font-size: 14px;
111
+ }
112
+ .export-btn:hover {
113
+ background: #7c3aed;
114
+ }
115
+ .output {
116
+ margin-top: 15px;
117
+ padding: 15px;
118
+ background: #f9fafb;
119
+ border: 1px solid #e5e7eb;
120
+ border-radius: 4px;
121
+ font-family: 'Monaco', monospace;
122
+ font-size: 12px;
123
+ white-space: pre-wrap;
124
+ display: none;
125
+ }
126
+ .output.show {
127
+ display: block;
128
+ }
129
+ </style>
130
+ </head>
131
+ <body>
132
+ <div class="container">
133
+ <h1>🌟 Astro Chart Color Picker</h1>
134
+
135
+ <div class="controls">
136
+ <div class="theme-toggle">
137
+ <button class="theme-btn active" data-theme="light">Light Colors</button>
138
+ <button class="theme-btn" data-theme="dark">Dark Colors</button>
139
+ </div>
140
+
141
+ <div class="color-grid">
142
+ <div class="color-control">
143
+ <label>🔥 Fire (Aries/Leo/Sag)</label>
144
+ <div class="color-inputs">
145
+ <input type="color" id="fire-light" value="#FF4500">
146
+ <input type="text" id="fire-light-hex" value="#FF4500">
147
+ </div>
148
+ </div>
149
+ <div class="color-control">
150
+ <label>🌍 Earth (Taurus/Virgo/Cap)</label>
151
+ <div class="color-inputs">
152
+ <input type="color" id="earth-light" value="#8B4513">
153
+ <input type="text" id="earth-light-hex" value="#8B4513">
154
+ </div>
155
+ </div>
156
+ <div class="color-control">
157
+ <label>🌬️ Air (Gemini/Libra/Aquarius)</label>
158
+ <div class="color-inputs">
159
+ <input type="color" id="air-light" value="#87CEEB">
160
+ <input type="text" id="air-light-hex" value="#87CEEB">
161
+ </div>
162
+ </div>
163
+ <div class="color-control">
164
+ <label>💧 Water (Cancer/Scorpio/Pisces)</label>
165
+ <div class="color-inputs">
166
+ <input type="color" id="water-light" value="#27AE60">
167
+ <input type="text" id="water-light-hex" value="#27AE60">
168
+ </div>
169
+ </div>
170
+ </div>
171
+
172
+ <div class="color-grid" style="display: none;" id="dark-colors">
173
+ <div class="color-control">
174
+ <label>🔥 Fire (Aries/Leo/Sag)</label>
175
+ <div class="color-inputs">
176
+ <input type="color" id="fire-dark" value="#FF4500">
177
+ <input type="text" id="fire-dark-hex" value="#FF4500">
178
+ </div>
179
+ </div>
180
+ <div class="color-control">
181
+ <label>🌍 Earth (Taurus/Virgo/Cap)</label>
182
+ <div class="color-inputs">
183
+ <input type="color" id="earth-dark" value="#8B4513">
184
+ <input type="text" id="earth-dark-hex" value="#8B4513">
185
+ </div>
186
+ </div>
187
+ <div class="color-control">
188
+ <label>🌬️ Air (Gemini/Libra/Aquarius)</label>
189
+ <div class="color-inputs">
190
+ <input type="color" id="air-dark" value="#87CEEB">
191
+ <input type="text" id="air-dark-hex" value="#87CEEB">
192
+ </div>
193
+ </div>
194
+ <div class="color-control">
195
+ <label>💧 Water (Cancer/Scorpio/Pisces)</label>
196
+ <div class="color-inputs">
197
+ <input type="color" id="water-dark" value="#27AE60">
198
+ <input type="text" id="water-dark-hex" value="#27AE60">
199
+ </div>
200
+ </div>
201
+ </div>
202
+
203
+ <button class="export-btn" onclick="exportColors()">📋 Export Colors</button>
204
+ <div class="output" id="output"></div>
205
+ </div>
206
+
207
+ <div class="charts">
208
+ <div class="chart-block">
209
+ <h2>☀️ Light Theme</h2>
210
+ <div id="chart-light"></div>
211
+ </div>
212
+ <div class="chart-block dark">
213
+ <h2>🌙 Dark Theme</h2>
214
+ <div id="chart-dark"></div>
215
+ </div>
216
+ </div>
217
+ </div>
218
+
219
+ <script>
220
+ const data = {
221
+ planets: {
222
+ Sun: [281],
223
+ Moon: [268],
224
+ Mercury: [312],
225
+ Venus: [330],
226
+ Mars: [210],
227
+ Jupiter: [192],
228
+ Saturn: [201],
229
+ Uranus: [318],
230
+ Neptune: [110],
231
+ Pluto: [63]
232
+ },
233
+ cusps: [296, 350, 30, 56, 75, 94, 116, 170, 210, 236, 255, 274]
234
+ };
235
+
236
+ let lightChart, darkChart;
237
+
238
+ function getColors(theme) {
239
+ const prefix = theme === 'light' ? 'light' : 'dark';
240
+ const fire = document.getElementById(`fire-${prefix}`).value;
241
+ const earth = document.getElementById(`earth-${prefix}`).value;
242
+ const air = document.getElementById(`air-${prefix}`).value;
243
+ const water = document.getElementById(`water-${prefix}`).value;
244
+
245
+ return [
246
+ fire, // Aries
247
+ earth, // Taurus
248
+ air, // Gemini
249
+ water, // Cancer
250
+ fire, // Leo
251
+ earth, // Virgo
252
+ air, // Libra
253
+ water, // Scorpio
254
+ fire, // Sagittarius
255
+ earth, // Capricorn
256
+ air, // Aquarius
257
+ water // Pisces
258
+ ];
259
+ }
260
+
261
+ function renderCharts() {
262
+ const lightColors = getColors('light');
263
+ const darkColors = getColors('dark');
264
+
265
+ document.getElementById('chart-light').innerHTML = '';
266
+ document.getElementById('chart-dark').innerHTML = '';
267
+
268
+ const lightSettings = {
269
+ COLOR_BACKGROUND: '#ffffff',
270
+ CIRCLE_COLOR: '#333333',
271
+ LINE_COLOR: '#333333',
272
+ POINTS_COLOR: '#000000',
273
+ SIGNS_COLOR: '#000000',
274
+ CUSPS_FONT_COLOR: '#000000',
275
+ SYMBOL_AXIS_FONT_COLOR: '#333333',
276
+ COLOR_ARIES: lightColors[0],
277
+ COLOR_TAURUS: lightColors[1],
278
+ COLOR_GEMINI: lightColors[2],
279
+ COLOR_CANCER: lightColors[3],
280
+ COLOR_LEO: lightColors[4],
281
+ COLOR_VIRGO: lightColors[5],
282
+ COLOR_LIBRA: lightColors[6],
283
+ COLOR_SCORPIO: lightColors[7],
284
+ COLOR_SAGITTARIUS: lightColors[8],
285
+ COLOR_CAPRICORN: lightColors[9],
286
+ COLOR_AQUARIUS: lightColors[10],
287
+ COLOR_PISCES: lightColors[11]
288
+ };
289
+
290
+ const darkSettings = {
291
+ COLOR_BACKGROUND: '#282c34',
292
+ CIRCLE_COLOR: '#4b5263',
293
+ LINE_COLOR: '#4b5263',
294
+ POINTS_COLOR: '#abb2bf',
295
+ SIGNS_COLOR: '#d7dae0',
296
+ CUSPS_FONT_COLOR: '#abb2bf',
297
+ SYMBOL_AXIS_FONT_COLOR: '#abb2bf',
298
+ COLOR_ARIES: darkColors[0],
299
+ COLOR_TAURUS: darkColors[1],
300
+ COLOR_GEMINI: darkColors[2],
301
+ COLOR_CANCER: darkColors[3],
302
+ COLOR_LEO: darkColors[4],
303
+ COLOR_VIRGO: darkColors[5],
304
+ COLOR_LIBRA: darkColors[6],
305
+ COLOR_SCORPIO: darkColors[7],
306
+ COLOR_SAGITTARIUS: darkColors[8],
307
+ COLOR_CAPRICORN: darkColors[9],
308
+ COLOR_AQUARIUS: darkColors[10],
309
+ COLOR_PISCES: darkColors[11]
310
+ };
311
+
312
+ if (typeof astrochart !== 'undefined') {
313
+ lightChart = new astrochart.Chart('chart-light', 500, 500, lightSettings);
314
+ lightChart.radix(data);
315
+
316
+ darkChart = new astrochart.Chart('chart-dark', 500, 500, darkSettings);
317
+ darkChart.radix(data);
318
+ } else {
319
+ console.error('AstroChart library not loaded');
320
+ document.getElementById('chart-light').innerHTML = '<p style="color: red; padding: 20px;">⚠️ Chart library loading...</p>';
321
+ document.getElementById('chart-dark').innerHTML = '<p style="color: #abb2bf; padding: 20px;">⚠️ Chart library loading...</p>';
322
+ }
323
+ }
324
+
325
+ function syncColorInputs(id) {
326
+ const colorInput = document.getElementById(id);
327
+ const hexInput = document.getElementById(id + '-hex');
328
+
329
+ colorInput.addEventListener('input', (e) => {
330
+ hexInput.value = e.target.value;
331
+ renderCharts();
332
+ });
333
+
334
+ hexInput.addEventListener('input', (e) => {
335
+ colorInput.value = e.target.value;
336
+ renderCharts();
337
+ });
338
+ }
339
+
340
+ function exportColors() {
341
+ const lightColors = getColors('light');
342
+ const darkColors = getColors('dark');
343
+
344
+ const output = `LIGHT_THEME_COLORS:
345
+ Fire: ${lightColors[0]}
346
+ Earth: ${lightColors[1]}
347
+ Air: ${lightColors[2]}
348
+ Water: ${lightColors[3]}
349
+
350
+ DARK_THEME_COLORS:
351
+ Fire: ${darkColors[0]}
352
+ Earth: ${darkColors[1]}
353
+ Air: ${darkColors[2]}
354
+ Water: ${darkColors[3]}`;
355
+
356
+ const outputEl = document.getElementById('output');
357
+ outputEl.textContent = output;
358
+ outputEl.classList.add('show');
359
+
360
+ navigator.clipboard.writeText(output);
361
+ alert('Colors copied to clipboard!');
362
+ }
363
+
364
+ document.querySelectorAll('.theme-btn').forEach(btn => {
365
+ btn.addEventListener('click', () => {
366
+ document.querySelectorAll('.theme-btn').forEach(b => b.classList.remove('active'));
367
+ btn.classList.add('active');
368
+
369
+ const theme = btn.dataset.theme;
370
+ if (theme === 'dark') {
371
+ document.getElementById('dark-colors').style.display = 'grid';
372
+ document.querySelectorAll('.color-grid')[0].style.display = 'none';
373
+ } else {
374
+ document.getElementById('dark-colors').style.display = 'none';
375
+ document.querySelectorAll('.color-grid')[0].style.display = 'grid';
376
+ }
377
+ });
378
+ });
379
+
380
+ ['fire-light', 'earth-light', 'air-light', 'water-light',
381
+ 'fire-dark', 'earth-dark', 'air-dark', 'water-dark'].forEach(syncColorInputs);
382
+
383
+ window.addEventListener('load', () => {
384
+ setTimeout(renderCharts, 500);
385
+ });
386
+ </script>
387
+ </body>
388
+ </html>
package/tsconfig.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "Node16",
5
+ "moduleResolution": "Node16",
6
+ "outDir": "./dist",
7
+ "rootDir": "./src",
8
+ "strict": true,
9
+ "esModuleInterop": true,
10
+ "skipLibCheck": true,
11
+ "forceConsistentCasingInFileNames": true,
12
+ "resolveJsonModule": true,
13
+ "declaration": true
14
+ },
15
+ "include": ["src/**/*"],
16
+ "exclude": ["node_modules", "dist"]
17
+ }
@@ -0,0 +1,31 @@
1
+ import { defineConfig } from 'vitest/config';
2
+
3
+ export default defineConfig({
4
+ test: {
5
+ globals: true,
6
+ environment: 'jsdom',
7
+ setupFiles: ['./tests/setup.ts'],
8
+ testTimeout: 30000,
9
+ coverage: {
10
+ provider: 'v8',
11
+ reporter: ['text', 'json', 'html', 'lcov'],
12
+ thresholds: {
13
+ lines: 80,
14
+ functions: 80,
15
+ branches: 80,
16
+ statements: 80,
17
+ },
18
+ exclude: [
19
+ 'node_modules/',
20
+ 'dist/',
21
+ 'tests/',
22
+ '**/*.test.ts',
23
+ 'src/loader.ts',
24
+ 'src/logger.ts',
25
+ 'src/constants.ts', // UI preference helper - not core calculation logic
26
+ 'scripts/',
27
+ 'color-picker.html',
28
+ ],
29
+ },
30
+ },
31
+ });