kaabalah 5.6.0 → 6.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.
package/dist/cli.js CHANGED
@@ -7053,8 +7053,164 @@ __export(swisseph_exports, {
7053
7053
  inspectVirtualEphemerisPath: () => inspectVirtualEphemerisPath,
7054
7054
  normalizeAngle: () => normalizeAngle,
7055
7055
  resolveNodeEphemerisPath: () => resolveNodeEphemerisPath,
7056
+ resolveSwissEphRuntimeAssets: () => resolveSwissEphRuntimeAssets,
7056
7057
  toUtcDate: () => toUtcDate
7057
7058
  });
7059
+ function emitRuntimeNotice(message) {
7060
+ if (typeof process !== "undefined" && process.stderr && typeof process.stderr.write === "function") {
7061
+ process.stderr.write(`${message}
7062
+ `);
7063
+ return;
7064
+ }
7065
+ console.info(message);
7066
+ }
7067
+ function getRuntimeEnv(env) {
7068
+ if (env) {
7069
+ return env;
7070
+ }
7071
+ if (typeof process !== "undefined" && process.env) {
7072
+ return process.env;
7073
+ }
7074
+ return {};
7075
+ }
7076
+ function firstDefinedEnvValue(env, keys) {
7077
+ for (const key of keys) {
7078
+ const value = env[key];
7079
+ if (typeof value === "string" && value.length > 0) {
7080
+ return value;
7081
+ }
7082
+ }
7083
+ return void 0;
7084
+ }
7085
+ function getBundledNodeSwissEphAssets(options) {
7086
+ if (options.bundledNodeWasmPath && options.bundledNodeEphePath) {
7087
+ return {
7088
+ wasmPaths: [options.bundledNodeWasmPath],
7089
+ ephePaths: [options.bundledNodeEphePath]
7090
+ };
7091
+ }
7092
+ const resolvePath = options.nodePathResolve ?? ((...paths) => require("path").resolve(...paths));
7093
+ return {
7094
+ wasmPaths: [
7095
+ options.bundledNodeWasmPath,
7096
+ resolvePath(__dirname, swisseph_node_default),
7097
+ resolvePath(__dirname, "../../wasm/build/swisseph.node.wasm"),
7098
+ resolvePath(__dirname, "../wasm/build/swisseph.node.wasm")
7099
+ ].filter((value) => typeof value === "string"),
7100
+ ephePaths: [
7101
+ options.bundledNodeEphePath,
7102
+ resolvePath(__dirname, "../../ephe"),
7103
+ resolvePath(__dirname, "../ephe")
7104
+ ].filter((value) => typeof value === "string")
7105
+ };
7106
+ }
7107
+ function getBundledBrowserSwissEphAssets(options) {
7108
+ return {
7109
+ wasmPath: options.bundledBrowserWasmPath ?? swisseph_web_default,
7110
+ ephePath: options.bundledBrowserEphePath ?? "../ephe"
7111
+ };
7112
+ }
7113
+ function formatCandidatePaths(paths) {
7114
+ return paths.length > 0 ? paths.join(", ") : "(none)";
7115
+ }
7116
+ function resolveBundledRuntimeAssetPath(label, bundledPaths, existsSync2) {
7117
+ for (const bundledPath of bundledPaths) {
7118
+ if (existsSync2(bundledPath)) {
7119
+ return {
7120
+ path: bundledPath,
7121
+ source: "bundled"
7122
+ };
7123
+ }
7124
+ }
7125
+ throw new Error(
7126
+ `Unable to resolve Swiss Ephemeris ${label}. Bundled paths checked: ${formatCandidatePaths(
7127
+ bundledPaths
7128
+ )}.`
7129
+ );
7130
+ }
7131
+ function resolveRuntimeAssetPath(label, explicitPath, envPath, candidatePaths, bundledPaths, existsSync2) {
7132
+ if (explicitPath) {
7133
+ if (!existsSync2(explicitPath)) {
7134
+ throw new Error(
7135
+ `Swiss Ephemeris ${label} override does not exist: "${explicitPath}".`
7136
+ );
7137
+ }
7138
+ return {
7139
+ path: explicitPath,
7140
+ source: "explicit"
7141
+ };
7142
+ }
7143
+ if (envPath) {
7144
+ if (!existsSync2(envPath)) {
7145
+ throw new Error(
7146
+ `Swiss Ephemeris ${label} from environment does not exist: "${envPath}".`
7147
+ );
7148
+ }
7149
+ return {
7150
+ path: envPath,
7151
+ source: "env"
7152
+ };
7153
+ }
7154
+ for (const candidatePath of candidatePaths) {
7155
+ if (existsSync2(candidatePath)) {
7156
+ return {
7157
+ path: candidatePath,
7158
+ source: "candidate"
7159
+ };
7160
+ }
7161
+ }
7162
+ try {
7163
+ return resolveBundledRuntimeAssetPath(label, bundledPaths, existsSync2);
7164
+ } catch (error) {
7165
+ throw new Error(
7166
+ `Unable to resolve Swiss Ephemeris ${label}. Checked candidate paths: ${formatCandidatePaths(
7167
+ candidatePaths
7168
+ )}. ${toError(error).message}`
7169
+ );
7170
+ }
7171
+ }
7172
+ function resolveSwissEphRuntimeAssetsInternal(options = {}) {
7173
+ const isBrowser = options.isBrowser ?? typeof window !== "undefined";
7174
+ if (isBrowser) {
7175
+ const bundledAssets2 = getBundledBrowserSwissEphAssets(options);
7176
+ return {
7177
+ wasmPath: options.wasmPath ?? bundledAssets2.wasmPath,
7178
+ ephePath: options.ephePath ?? bundledAssets2.ephePath,
7179
+ wasmPathSource: options.wasmPath ? "explicit" : "bundled",
7180
+ ephePathSource: options.ephePath ? "explicit" : "bundled"
7181
+ };
7182
+ }
7183
+ const env = getRuntimeEnv(options.env);
7184
+ const existsSync2 = options.existsSync ?? ((path) => require("fs").existsSync(path));
7185
+ const bundledAssets = getBundledNodeSwissEphAssets(options);
7186
+ const envWasmPath = firstDefinedEnvValue(env, SWISS_EPH_RUNTIME_WASM_ENV_KEYS);
7187
+ const envEphePath = firstDefinedEnvValue(env, SWISS_EPH_RUNTIME_EPHE_ENV_KEYS);
7188
+ const resolvedWasm = resolveRuntimeAssetPath(
7189
+ "wasmPath",
7190
+ options.wasmPath,
7191
+ envWasmPath,
7192
+ options.wasmPathCandidates ?? [],
7193
+ bundledAssets.wasmPaths,
7194
+ existsSync2
7195
+ );
7196
+ const resolvedEphe = resolveRuntimeAssetPath(
7197
+ "ephePath",
7198
+ options.ephePath,
7199
+ envEphePath,
7200
+ options.ephePathCandidates ?? [],
7201
+ bundledAssets.ephePaths,
7202
+ existsSync2
7203
+ );
7204
+ return {
7205
+ wasmPath: resolvedWasm.path,
7206
+ ephePath: resolvedEphe.path,
7207
+ wasmPathSource: resolvedWasm.source,
7208
+ ephePathSource: resolvedEphe.source
7209
+ };
7210
+ }
7211
+ function resolveSwissEphRuntimeAssets(options = {}) {
7212
+ return resolveSwissEphRuntimeAssetsInternal(options);
7213
+ }
7058
7214
  function normalizeVirtualPath(path) {
7059
7215
  if (path === "/") {
7060
7216
  return path;
@@ -7228,15 +7384,17 @@ async function getSwissEph(options = {}) {
7228
7384
  }
7229
7385
  try {
7230
7386
  const isBrowser = typeof window !== "undefined";
7231
- const wasmUrl = isBrowser ? swisseph_web_default : swisseph_node_default;
7232
- const finalWasmPath = options.wasmPath || (isBrowser ? wasmUrl : require("path").resolve(__dirname, wasmUrl));
7387
+ const runtimeAssets = resolveSwissEphRuntimeAssets({
7388
+ wasmPath: options.wasmPath,
7389
+ ephePath: options.ephePath
7390
+ });
7391
+ const finalWasmPath = runtimeAssets.wasmPath;
7233
7392
  const moduleFactory = isBrowser ? (await Promise.resolve().then(() => __toESM(require_swisseph_web()))).default : (await Promise.resolve().then(() => __toESM(require_swisseph_node()))).default;
7234
7393
  const module2 = await moduleFactory({
7235
7394
  locateFile: () => finalWasmPath
7236
7395
  });
7237
7396
  const instance = new SwissEph(module2);
7238
- const defaultEphePath = isBrowser ? "../ephe" : require("path").resolve(__dirname, "../ephe");
7239
- const finalEphePath = options.ephePath || defaultEphePath;
7397
+ const finalEphePath = runtimeAssets.ephePath;
7240
7398
  if (isBrowser) {
7241
7399
  const epheFsPath = "/ephe";
7242
7400
  try {
@@ -7264,16 +7422,16 @@ async function getSwissEph(options = {}) {
7264
7422
  `Failed to materialize browser ephemeris files at "${epheFsPath}". Missing: ${browserCheck.missingFiles.join(", ")}.`
7265
7423
  );
7266
7424
  }
7267
- console.info(`Setting ephemeris path to: ${epheFsPath}`);
7425
+ emitRuntimeNotice(`Setting ephemeris path to: ${epheFsPath}`);
7268
7426
  instance.setEphemerisPath(epheFsPath);
7269
7427
  } else {
7270
7428
  const resolution = resolveNodeEphemerisPath(module2, finalEphePath);
7271
7429
  if (resolution.strategy === "nodefs-mount") {
7272
- console.info(`Setting ephemeris path to: ${resolution.path} (mounted from ${finalEphePath})`);
7430
+ emitRuntimeNotice(`Setting ephemeris path to: ${resolution.path} (mounted from ${finalEphePath})`);
7273
7431
  } else if (resolution.strategy === "memfs-copy") {
7274
- console.info(`Setting ephemeris path to: ${resolution.path} (copied from ${finalEphePath})`);
7432
+ emitRuntimeNotice(`Setting ephemeris path to: ${resolution.path} (copied from ${finalEphePath})`);
7275
7433
  } else {
7276
- console.info(`Setting ephemeris path to: ${resolution.path}`);
7434
+ emitRuntimeNotice(`Setting ephemeris path to: ${resolution.path}`);
7277
7435
  }
7278
7436
  instance.setEphemerisPath(resolution.path);
7279
7437
  }
@@ -7495,7 +7653,7 @@ async function localToUtcDate(local, latitude, longitude, opts = {}) {
7495
7653
  async function toUtcDate(local, latitude, longitude, options = {}) {
7496
7654
  return localToUtcDate(local, latitude, longitude, options);
7497
7655
  }
7498
- var swissEph, DEFAULT_FLAGS, REQUIRED_EPHE_FILES, NODE_EPHE_MOUNT_POINT, NODE_EPHE_MEMFS_PATH;
7656
+ var swissEph, DEFAULT_FLAGS, REQUIRED_EPHE_FILES, NODE_EPHE_MOUNT_POINT, NODE_EPHE_MEMFS_PATH, SWISS_EPH_RUNTIME_WASM_ENV_KEYS, SWISS_EPH_RUNTIME_EPHE_ENV_KEYS;
7499
7657
  var init_swisseph2 = __esm({
7500
7658
  "src/astrology/swisseph.ts"() {
7501
7659
  "use strict";
@@ -7507,6 +7665,14 @@ var init_swisseph2 = __esm({
7507
7665
  REQUIRED_EPHE_FILES = ["seas_18.se1", "semo_18.se1", "sepl_18.se1"];
7508
7666
  NODE_EPHE_MOUNT_POINT = "/ephefs";
7509
7667
  NODE_EPHE_MEMFS_PATH = "/ephemem";
7668
+ SWISS_EPH_RUNTIME_WASM_ENV_KEYS = [
7669
+ "KAABALAH_SWISSEPH_WASM_PATH",
7670
+ "KAABALAH_WASM_PATH"
7671
+ ];
7672
+ SWISS_EPH_RUNTIME_EPHE_ENV_KEYS = [
7673
+ "KAABALAH_SWISSEPH_EPHE_PATH",
7674
+ "KAABALAH_EPHE_PATH"
7675
+ ];
7510
7676
  }
7511
7677
  });
7512
7678
 
@@ -8192,6 +8358,7 @@ __export(astrology_exports, {
8192
8358
  getZodiacPosition: () => getZodiacPosition,
8193
8359
  normalizeAngle: () => normalizeAngle,
8194
8360
  queryAstrocartographyLocation: () => queryAstrocartographyLocation,
8361
+ resolveSwissEphRuntimeAssets: () => resolveSwissEphRuntimeAssets,
8195
8362
  shorterArcMidpoint: () => shorterArcMidpoint
8196
8363
  });
8197
8364
  function validateInputs(options) {
@@ -8735,7 +8902,7 @@ var import_config3 = require("dotenv/config");
8735
8902
  // package.json
8736
8903
  var package_default = {
8737
8904
  name: "kaabalah",
8738
- version: "5.6.0",
8905
+ version: "6.0.0",
8739
8906
  description: "The de-facto library for any esoteric calculations and tooling",
8740
8907
  engines: {
8741
8908
  node: ">=18.18.0"
@@ -9015,6 +9182,8 @@ var COMMANDS = [
9015
9182
  { name: "location", type: "string", description: "Location string for geocoding (requires GOOGLE_MAPS_API_KEY or KAABALAH_GOOGLE_MAPS_API_KEY)" },
9016
9183
  { name: "house-system", type: "string", default: "placidus", description: "House system: placidus, koch, porphyrius, regiomontanus, campanus, equal, whole-sign, meridian, morinus, krusinski, alcabitius" },
9017
9184
  { name: "timezone", type: "string", description: "IANA timezone string (e.g. America/New_York). Auto-resolved from coordinates if omitted" },
9185
+ { name: "max-orb", type: "number", description: "Maximum orb in degrees to include in the returned aspects array" },
9186
+ { name: "aspect-types", type: "string", description: "Comma-separated aspect names, or 'major' for conjunction,sextile,square,trine,opposition" },
9018
9187
  { name: "wasm-path", type: "string", description: "Override the Swiss Ephemeris WASM runtime path" },
9019
9188
  { name: "ephe-path", type: "string", description: "Override the ephemeris data directory path" }
9020
9189
  ],
@@ -9031,6 +9200,8 @@ var COMMANDS = [
9031
9200
  flags: [
9032
9201
  { name: "house-system", type: "string", default: "placidus", description: "House system for both charts" },
9033
9202
  { name: "timezone", type: "string", description: "Default timezone for both charts when omitted in chartA/chartB" },
9203
+ { name: "max-orb", type: "number", description: "Maximum orb in degrees to include in the returned aspect arrays" },
9204
+ { name: "aspect-types", type: "string", description: "Comma-separated aspect names, or 'major' for conjunction,sextile,square,trine,opposition" },
9034
9205
  { name: "wasm-path", type: "string", description: "Override the Swiss Ephemeris WASM runtime path" },
9035
9206
  { name: "ephe-path", type: "string", description: "Override the ephemeris data directory path" }
9036
9207
  ],
@@ -9045,6 +9216,8 @@ var COMMANDS = [
9045
9216
  flags: [
9046
9217
  { name: "house-system", type: "string", default: "placidus", description: "House system for both charts" },
9047
9218
  { name: "timezone", type: "string", description: "Default timezone for both charts when omitted in chartA/chartB" },
9219
+ { name: "max-orb", type: "number", description: "Maximum orb in degrees to include in the returned aspect arrays" },
9220
+ { name: "aspect-types", type: "string", description: "Comma-separated aspect names, or 'major' for conjunction,sextile,square,trine,opposition" },
9048
9221
  { name: "wasm-path", type: "string", description: "Override the Swiss Ephemeris WASM runtime path" },
9049
9222
  { name: "ephe-path", type: "string", description: "Override the ephemeris data directory path" }
9050
9223
  ],
@@ -9072,6 +9245,7 @@ var COMMANDS = [
9072
9245
  { name: "transit-timezone", type: "string", description: "Transit IANA timezone (default: natal timezone)" },
9073
9246
  { name: "max-orb", type: "number", description: "Maximum orb in degrees to include" },
9074
9247
  { name: "aspects", type: "string", description: "Comma-separated aspect names, or 'major' for conjunction,sextile,square,trine,opposition" },
9248
+ { name: "aspect-types", type: "string", description: "Alias for --aspects" },
9075
9249
  { name: "transit-planets", type: "string", description: "Comma-separated transit planet names to include" },
9076
9250
  { name: "natal-planets", type: "string", description: "Comma-separated natal planet/point names to include" },
9077
9251
  { name: "from", type: "string", description: "Range start date YYYY-MM-DD (enables date range mode)" },
@@ -9104,6 +9278,8 @@ var COMMANDS = [
9104
9278
  { name: "sr-lon", type: "number", description: "Solar return location longitude (default: natal lon)" },
9105
9279
  { name: "sr-location", type: "string", description: "Solar return location for geocoding" },
9106
9280
  { name: "sr-house-system", type: "string", description: "House system for solar return chart (default: natal house system)" },
9281
+ { name: "max-orb", type: "number", description: "Maximum orb in degrees to include in natal and solar return aspect arrays" },
9282
+ { name: "aspect-types", type: "string", description: "Comma-separated aspect names, or 'major' for conjunction,sextile,square,trine,opposition" },
9107
9283
  { name: "wasm-path", type: "string", description: "Override the Swiss Ephemeris WASM runtime path" },
9108
9284
  { name: "ephe-path", type: "string", description: "Override the ephemeris data directory path" }
9109
9285
  ],
@@ -10070,7 +10246,7 @@ function rethrowInterruptedOrError(err, executionContext) {
10070
10246
  throw err;
10071
10247
  }
10072
10248
  function describeTimeZoneSettings(timeZoneSettings) {
10073
- return "timeZone" in timeZoneSettings ? timeZoneSettings.timeZone : "auto";
10249
+ return "timeZone" in timeZoneSettings && timeZoneSettings.timeZone != null ? timeZoneSettings.timeZone : "auto";
10074
10250
  }
10075
10251
  async function geocodeLocation(location, flags, executionContext) {
10076
10252
  const apiKey = getGoogleMapsApiKey();
@@ -10171,6 +10347,46 @@ function formatInputEcho(chartAInput, chartBInput) {
10171
10347
  }
10172
10348
  };
10173
10349
  }
10350
+ var MAJOR_ASPECTS = ["conjunction", "sextile", "square", "trine", "opposition"];
10351
+ function parseMaxOrb(flags, inputPayload) {
10352
+ const maxOrb = inputPayload?.maxOrb != null ? Number(inputPayload.maxOrb) : getFlagNumber(flags, "max-orb");
10353
+ if (maxOrb == null) {
10354
+ return void 0;
10355
+ }
10356
+ if (Number.isNaN(maxOrb) || maxOrb < 0) {
10357
+ exitWithError("INVALID_ARGUMENT", `--max-orb must be a non-negative number, got "${maxOrb}".`, flags);
10358
+ }
10359
+ return maxOrb;
10360
+ }
10361
+ function parseAspectTypeFilter(flags, inputPayload) {
10362
+ const rawValue = inputPayload?.aspectTypes ?? inputPayload?.aspects ?? getFlagString(flags, "aspect-types") ?? getFlagString(flags, "aspects");
10363
+ if (!rawValue) {
10364
+ return void 0;
10365
+ }
10366
+ const items = Array.isArray(rawValue) ? rawValue : rawValue.split(",");
10367
+ const normalized = items.map((item) => item.trim().toLowerCase()).filter(Boolean).flatMap((item) => item === "major" ? MAJOR_ASPECTS : [item]);
10368
+ return normalized.length > 0 ? normalized : void 0;
10369
+ }
10370
+ function filterAspects(aspects, { maxOrb, aspectFilter }) {
10371
+ return aspects.filter((aspect) => {
10372
+ if (maxOrb != null) {
10373
+ const orb = aspect.orb ?? aspect.exactOrb;
10374
+ if (orb == null || orb > maxOrb) {
10375
+ return false;
10376
+ }
10377
+ }
10378
+ if (aspectFilter && !aspectFilter.includes(aspect.aspect)) {
10379
+ return false;
10380
+ }
10381
+ return true;
10382
+ });
10383
+ }
10384
+ function filterChartAspects(chart, options) {
10385
+ return {
10386
+ ...chart,
10387
+ aspects: filterAspects(chart.aspects, options)
10388
+ };
10389
+ }
10174
10390
  async function parseTwoChartCommand(flags, inputPayload, commandName, executionContext) {
10175
10391
  if (!inputPayload?.chartA || !inputPayload?.chartB) {
10176
10392
  exitWithError("MISSING_ARGUMENT", `Usage: kaabalah ${commandName} --input-json=- < payload.json`, flags);
@@ -10293,6 +10509,8 @@ async function cmdAstrologySynastry(flags, inputPayload, executionContext) {
10293
10509
  releaseSwissEphCleanup
10294
10510
  } = await parseTwoChartCommand(flags, inputPayload, "astrology:synastry", executionContext);
10295
10511
  const { getSynastryChart: getSynastryChart2, closeSwissEph: closeSwissEph2, HouseSystem: HouseSystem2 } = astroModule;
10512
+ const maxOrb = parseMaxOrb(flags, inputPayload);
10513
+ const aspectFilter = parseAspectTypeFilter(flags, inputPayload);
10296
10514
  try {
10297
10515
  debugLog("astrology", "Running astrology:synastry.", {
10298
10516
  chartA: { date: chartAInput.dateStr, time: chartAInput.timeStr },
@@ -10303,12 +10521,18 @@ async function cmdAstrologySynastry(flags, inputPayload, executionContext) {
10303
10521
  chartB: buildBirthChartOptions(chartBInput, HouseSystem2),
10304
10522
  aspectSpecs
10305
10523
  });
10524
+ const filteredResult = {
10525
+ ...result,
10526
+ chartA: filterChartAspects(result.chartA, { maxOrb, aspectFilter }),
10527
+ chartB: filterChartAspects(result.chartB, { maxOrb, aspectFilter }),
10528
+ aspects: filterAspects(result.aspects, { maxOrb, aspectFilter })
10529
+ };
10306
10530
  executionContext.throwIfInterrupted();
10307
10531
  debugLog("astrology", "Completed astrology:synastry.", {
10308
- aspects: result.aspects.length
10532
+ aspects: filteredResult.aspects.length
10309
10533
  });
10310
10534
  if (isJsonMode(flags)) {
10311
- outputJson({ ...result, input: formatInputEcho(chartAInput, chartBInput) }, flags);
10535
+ outputJson({ ...filteredResult, input: formatInputEcho(chartAInput, chartBInput) }, flags);
10312
10536
  return;
10313
10537
  }
10314
10538
  console.log(`
@@ -10317,9 +10541,9 @@ Synastry Chart
10317
10541
  console.log(` Chart A: ${chartAInput.dateStr} ${chartAInput.timeStr} (${chartAInput.latitude}, ${chartAInput.longitude})`);
10318
10542
  console.log(` Chart B: ${chartBInput.dateStr} ${chartBInput.timeStr} (${chartBInput.latitude}, ${chartBInput.longitude})`);
10319
10543
  console.log(`
10320
- Cross-chart Aspects (${result.aspects.length}):
10544
+ Cross-chart Aspects (${filteredResult.aspects.length}):
10321
10545
  `);
10322
- for (const aspect of result.aspects) {
10546
+ for (const aspect of filteredResult.aspects) {
10323
10547
  console.log(` ${aspect.planetA.padEnd(14)} ${aspect.aspect.padEnd(12)} ${aspect.planetB.padEnd(14)} orb ${aspect.orb.toFixed(2)}\xB0`);
10324
10548
  }
10325
10549
  console.log();
@@ -10339,6 +10563,8 @@ async function cmdAstrologyComposite(flags, inputPayload, executionContext) {
10339
10563
  releaseSwissEphCleanup
10340
10564
  } = await parseTwoChartCommand(flags, inputPayload, "astrology:composite", executionContext);
10341
10565
  const { getCompositeChart: getCompositeChart2, closeSwissEph: closeSwissEph2, HouseSystem: HouseSystem2 } = astroModule;
10566
+ const maxOrb = parseMaxOrb(flags, inputPayload);
10567
+ const aspectFilter = parseAspectTypeFilter(flags, inputPayload);
10342
10568
  try {
10343
10569
  debugLog("astrology", "Running astrology:composite.", {
10344
10570
  chartA: { date: chartAInput.dateStr, time: chartAInput.timeStr },
@@ -10349,13 +10575,19 @@ async function cmdAstrologyComposite(flags, inputPayload, executionContext) {
10349
10575
  chartB: buildBirthChartOptions(chartBInput, HouseSystem2),
10350
10576
  aspectSpecs
10351
10577
  });
10578
+ const filteredResult = {
10579
+ ...result,
10580
+ chartA: filterChartAspects(result.chartA, { maxOrb, aspectFilter }),
10581
+ chartB: filterChartAspects(result.chartB, { maxOrb, aspectFilter }),
10582
+ aspects: filterAspects(result.aspects, { maxOrb, aspectFilter })
10583
+ };
10352
10584
  executionContext.throwIfInterrupted();
10353
10585
  debugLog("astrology", "Completed astrology:composite.", {
10354
- aspects: result.aspects.length,
10355
- compositePlanets: Object.keys(result.compositePlanets).length
10586
+ aspects: filteredResult.aspects.length,
10587
+ compositePlanets: Object.keys(filteredResult.compositePlanets).length
10356
10588
  });
10357
10589
  if (isJsonMode(flags)) {
10358
- outputJson({ ...result, input: formatInputEcho(chartAInput, chartBInput) }, flags);
10590
+ outputJson({ ...filteredResult, input: formatInputEcho(chartAInput, chartBInput) }, flags);
10359
10591
  return;
10360
10592
  }
10361
10593
  console.log(`
@@ -10365,20 +10597,20 @@ Composite Chart (Midpoint Method)
10365
10597
  console.log(` Chart B: ${chartBInput.dateStr} ${chartBInput.timeStr} (${chartBInput.latitude}, ${chartBInput.longitude})`);
10366
10598
  console.log(`
10367
10599
  Composite Planets:`);
10368
- for (const [name, planet] of Object.entries(result.compositePlanets)) {
10600
+ for (const [name, planet] of Object.entries(filteredResult.compositePlanets)) {
10369
10601
  const zodiacPosition = planet.zodiacPosition;
10370
10602
  console.log(` ${name.padEnd(14)} ${zodiacPosition.sign.padEnd(12)} ${zodiacPosition.traditionalFormat.padEnd(8)} House ${zodiacPosition.house}`);
10371
10603
  }
10372
10604
  console.log(`
10373
10605
  Composite House Cusps:`);
10374
- for (let i = 0; i < result.compositeHouses.length; i++) {
10375
- const house = result.compositeHouses[i];
10606
+ for (let i = 0; i < filteredResult.compositeHouses.length; i++) {
10607
+ const house = filteredResult.compositeHouses[i];
10376
10608
  console.log(` House ${String(i + 1).padStart(2)}: ${house.sign.padEnd(12)} ${house.traditionalFormat}`);
10377
10609
  }
10378
10610
  console.log(`
10379
- Composite Aspects (${result.aspects.length}):
10611
+ Composite Aspects (${filteredResult.aspects.length}):
10380
10612
  `);
10381
- for (const aspect of result.aspects) {
10613
+ for (const aspect of filteredResult.aspects) {
10382
10614
  console.log(` ${aspect.planetA.padEnd(14)} ${aspect.aspect.padEnd(12)} ${aspect.planetB.padEnd(14)} orb ${aspect.orb.toFixed(2)}\xB0`);
10383
10615
  }
10384
10616
  console.log();
@@ -10389,7 +10621,6 @@ Composite Chart (Midpoint Method)
10389
10621
  closeSwissEph2();
10390
10622
  }
10391
10623
  }
10392
- var MAJOR_ASPECTS = ["conjunction", "sextile", "square", "trine", "opposition"];
10393
10624
  async function cmdAstrologyTransits(args, flags, inputPayload, executionContext) {
10394
10625
  const natalPayload = inputPayload?.natal;
10395
10626
  const effectiveArgs = natalPayload ? [] : args;
@@ -10415,8 +10646,8 @@ async function cmdAstrologyTransits(args, flags, inputPayload, executionContext)
10415
10646
  const transitLatFlag = inputPayload?.transitLat != null ? Number(inputPayload.transitLat) : getFlagNumber(flags, "transit-lat");
10416
10647
  const transitLonFlag = inputPayload?.transitLon != null ? Number(inputPayload.transitLon) : getFlagNumber(flags, "transit-lon");
10417
10648
  const transitTzStr = inputPayload?.transitTimezone ?? getFlagString(flags, "transit-timezone");
10418
- const maxOrbFlag = inputPayload?.maxOrb != null ? Number(inputPayload.maxOrb) : getFlagNumber(flags, "max-orb");
10419
- const aspectsStr = inputPayload?.aspects ?? getFlagString(flags, "aspects");
10649
+ const maxOrbFlag = parseMaxOrb(flags, inputPayload);
10650
+ const aspectFilter = parseAspectTypeFilter(flags, inputPayload);
10420
10651
  const transitPlanetsStr = inputPayload?.transitPlanets ?? getFlagString(flags, "transit-planets");
10421
10652
  const natalPlanetsStr = inputPayload?.natalPlanets ?? getFlagString(flags, "natal-planets");
10422
10653
  const fromStr = inputPayload?.from ?? getFlagString(flags, "from");
@@ -10425,11 +10656,6 @@ async function cmdAstrologyTransits(args, flags, inputPayload, executionContext)
10425
10656
  if (stepDaysFlag != null && (isNaN(stepDaysFlag) || stepDaysFlag <= 0)) {
10426
10657
  exitWithError("INVALID_ARGUMENT", `--step-days must be a positive number, got "${stepDaysFlag}".`, flags);
10427
10658
  }
10428
- let aspectFilter;
10429
- if (aspectsStr) {
10430
- const raw = Array.isArray(aspectsStr) ? aspectsStr : aspectsStr.split(",").map((s) => s.trim());
10431
- aspectFilter = raw.flatMap((a) => a === "major" ? MAJOR_ASPECTS : [a]);
10432
- }
10433
10659
  const transitPlanets = transitPlanetsStr ? Array.isArray(transitPlanetsStr) ? transitPlanetsStr : transitPlanetsStr.split(",").map((s) => s.trim().toLowerCase()) : void 0;
10434
10660
  const natalPlanets = natalPlanetsStr ? Array.isArray(natalPlanetsStr) ? natalPlanetsStr : natalPlanetsStr.split(",").map((s) => s.trim().toLowerCase()) : void 0;
10435
10661
  const natalOpts = buildBirthChartOptions(natalInput, HouseSystem2);
@@ -10576,6 +10802,8 @@ async function cmdAstrologySolarReturn(args, flags, inputPayload, executionConte
10576
10802
  const natalInput = await parseSingleChartRequest(effectiveArgs, flags, effectiveInputPayload, executionContext);
10577
10803
  const astroModule = await Promise.resolve().then(() => (init_astrology(), astrology_exports));
10578
10804
  const { getSolarReturnChart: getSolarReturnChart2, closeSwissEph: closeSwissEph2, HouseSystem: HouseSystem2 } = astroModule;
10805
+ const maxOrb = parseMaxOrb(flags, inputPayload);
10806
+ const aspectFilter = parseAspectTypeFilter(flags, inputPayload);
10579
10807
  const releaseSwissEphCleanup = executionContext.registerCleanup(() => {
10580
10808
  astroModule.closeSwissEph();
10581
10809
  });
@@ -10618,14 +10846,19 @@ async function cmdAstrologySolarReturn(args, flags, inputPayload, executionConte
10618
10846
  solarReturnLongitude: srLon ?? void 0,
10619
10847
  solarReturnHouseSystem: srHouseSystem
10620
10848
  });
10849
+ const filteredResult = {
10850
+ ...result,
10851
+ natalChart: filterChartAspects(result.natalChart, { maxOrb, aspectFilter }),
10852
+ solarReturnChart: filterChartAspects(result.solarReturnChart, { maxOrb, aspectFilter })
10853
+ };
10621
10854
  executionContext.throwIfInterrupted();
10622
10855
  debugLog("astrology", "Completed astrology:solar-return.", {
10623
- exactReturnDate: result.exactReturnDate.toISOString(),
10624
- natalSunLongitude: result.natalSunLongitude
10856
+ exactReturnDate: filteredResult.exactReturnDate.toISOString(),
10857
+ natalSunLongitude: filteredResult.natalSunLongitude
10625
10858
  });
10626
10859
  if (isJsonMode(flags)) {
10627
10860
  outputJson({
10628
- ...result,
10861
+ ...filteredResult,
10629
10862
  input: {
10630
10863
  natal: { date: natalInput.dateStr, time: natalInput.timeStr, lat: natalInput.latitude, lon: natalInput.longitude },
10631
10864
  year,
@@ -10635,14 +10868,14 @@ async function cmdAstrologySolarReturn(args, flags, inputPayload, executionConte
10635
10868
  }, flags);
10636
10869
  return;
10637
10870
  }
10638
- const srChart = result.solarReturnChart;
10639
- const natalSun = result.natalChart.planets.sun.zodiacPosition;
10640
- const returnDateStr = result.exactReturnDate.toISOString().replace("T", " ").replace(/\.\d{3}Z$/, " UTC");
10871
+ const srChart = filteredResult.solarReturnChart;
10872
+ const natalSun = filteredResult.natalChart.planets.sun.zodiacPosition;
10873
+ const returnDateStr = filteredResult.exactReturnDate.toISOString().replace("T", " ").replace(/\.\d{3}Z$/, " UTC");
10641
10874
  console.log(`
10642
10875
  Solar Return ${year}
10643
10876
  `);
10644
10877
  console.log(` Natal: ${natalInput.dateStr} ${natalInput.timeStr} (${natalInput.latitude}, ${natalInput.longitude})`);
10645
- console.log(` Natal Sun: ${natalSun.sign} ${natalSun.traditionalFormat} (${result.natalSunLongitude.toFixed(4)}\xB0)`);
10878
+ console.log(` Natal Sun: ${natalSun.sign} ${natalSun.traditionalFormat} (${filteredResult.natalSunLongitude.toFixed(4)}\xB0)`);
10646
10879
  console.log(` Exact Return: ${returnDateStr}`);
10647
10880
  console.log(` SR Sun: ${srChart.planets.sun.zodiacPosition.sign} ${srChart.planets.sun.zodiacPosition.traditionalFormat} (${srChart.planets.sun.longitude.toFixed(4)}\xB0)`);
10648
10881
  console.log(`
@@ -10928,6 +11161,8 @@ async function cmdAstrology(args, flags, inputPayload, executionContext) {
10928
11161
  const input = await parseSingleChartRequest(args, flags, inputPayload, executionContext);
10929
11162
  const astroModule = await Promise.resolve().then(() => (init_astrology(), astrology_exports));
10930
11163
  const { getSwissEph: getSwissEph2, closeSwissEph: closeSwissEph2, getBirthChart: getBirthChart2, HouseSystem: HouseSystem2 } = astroModule;
11164
+ const maxOrb = parseMaxOrb(flags, inputPayload);
11165
+ const aspectFilter = parseAspectTypeFilter(flags, inputPayload);
10931
11166
  const releaseSwissEphCleanup = executionContext.registerCleanup(() => {
10932
11167
  astroModule.closeSwissEph();
10933
11168
  });
@@ -10956,14 +11191,15 @@ async function cmdAstrology(args, flags, inputPayload, executionContext) {
10956
11191
  houseSystem: input.houseSystemCode,
10957
11192
  timeZoneSettings: input.timeZoneSettings
10958
11193
  });
11194
+ const filteredChart = filterChartAspects(chart, { maxOrb, aspectFilter });
10959
11195
  executionContext.throwIfInterrupted();
10960
11196
  debugLog("astrology", "Completed astrology.", {
10961
- planets: Object.keys(chart.planets).length,
10962
- nodes: Object.keys(chart.nodes ?? {}).length,
10963
- aspects: chart.aspects.length
11197
+ planets: Object.keys(filteredChart.planets).length,
11198
+ nodes: Object.keys(filteredChart.nodes ?? {}).length,
11199
+ aspects: filteredChart.aspects.length
10964
11200
  });
10965
11201
  if (isJsonMode(flags)) {
10966
- const result = { ...chart };
11202
+ const result = { ...filteredChart };
10967
11203
  if (input.resolvedLocation) {
10968
11204
  result.resolvedLocation = input.resolvedLocation;
10969
11205
  }
@@ -10986,29 +11222,29 @@ Birth Chart: ${input.dateStr} ${input.timeStr}
10986
11222
  }
10987
11223
  console.log(` Coordinates: ${input.latitude.toFixed(4)}, ${input.longitude.toFixed(4)}`);
10988
11224
  console.log(` House System: ${input.houseSystem}`);
10989
- console.log(` UTC Date: ${chart.dateUtc.toISOString()}`);
11225
+ console.log(` UTC Date: ${filteredChart.dateUtc.toISOString()}`);
10990
11226
  console.log(`
10991
11227
  Planets:`);
10992
- for (const [name, planet] of Object.entries(chart.planets)) {
11228
+ for (const [name, planet] of Object.entries(filteredChart.planets)) {
10993
11229
  const zodiacPosition = planet.zodiacPosition;
10994
11230
  console.log(` ${name.padEnd(14)} ${zodiacPosition.sign.padEnd(12)} ${zodiacPosition.traditionalFormat.padEnd(8)} House ${zodiacPosition.house}`);
10995
11231
  }
10996
11232
  console.log(`
10997
11233
  Houses:`);
10998
- console.log(` Ascendant: ${chart.houses.ascendant.sign} ${chart.houses.ascendant.traditionalFormat}`);
10999
- console.log(` Midheaven: ${chart.houses.mc.sign} ${chart.houses.mc.traditionalFormat}`);
11000
- console.log(` Descendant: ${chart.houses.dc.sign} ${chart.houses.dc.traditionalFormat}`);
11001
- console.log(` IC: ${chart.houses.ic.sign} ${chart.houses.ic.traditionalFormat}`);
11234
+ console.log(` Ascendant: ${filteredChart.houses.ascendant.sign} ${filteredChart.houses.ascendant.traditionalFormat}`);
11235
+ console.log(` Midheaven: ${filteredChart.houses.mc.sign} ${filteredChart.houses.mc.traditionalFormat}`);
11236
+ console.log(` Descendant: ${filteredChart.houses.dc.sign} ${filteredChart.houses.dc.traditionalFormat}`);
11237
+ console.log(` IC: ${filteredChart.houses.ic.sign} ${filteredChart.houses.ic.traditionalFormat}`);
11002
11238
  console.log(`
11003
11239
  House Cusps:`);
11004
- for (let i = 0; i < chart.houses.houses.length; i++) {
11005
- const house = chart.houses.houses[i];
11240
+ for (let i = 0; i < filteredChart.houses.houses.length; i++) {
11241
+ const house = filteredChart.houses.houses[i];
11006
11242
  console.log(` House ${String(i + 1).padStart(2)}: ${house.sign.padEnd(12)} ${house.traditionalFormat}`);
11007
11243
  }
11008
- if (chart.nodes && Object.keys(chart.nodes).length > 0) {
11244
+ if (filteredChart.nodes && Object.keys(filteredChart.nodes).length > 0) {
11009
11245
  console.log(`
11010
11246
  Nodes:`);
11011
- for (const [, node] of Object.entries(chart.nodes)) {
11247
+ for (const [, node] of Object.entries(filteredChart.nodes)) {
11012
11248
  console.log(` ${node.name.padEnd(18)} ${node.sign.padEnd(12)} ${node.traditionalFormat.padEnd(8)} House ${node.house}`);
11013
11249
  }
11014
11250
  }
@@ -21431,6 +21667,655 @@ async function shuffleTarotDeck(cards, includeInvertedCards = false, shuffleCoun
21431
21667
  var MAJOR_ARCANA_CARDS = ARKANNUS.filter(
21432
21668
  (card) => card.type === "major" && majorArcana.includes(card.tarotCardFilename)
21433
21669
  );
21670
+ var EVENT_INNER_SLOT_KEYS = [
21671
+ "inner-1",
21672
+ "inner-2",
21673
+ "inner-3",
21674
+ "inner-4",
21675
+ "inner-5",
21676
+ "inner-6",
21677
+ "inner-7"
21678
+ ];
21679
+ var TAROT_CARD_BY_NUMBER = new Map(
21680
+ ARKANNUS.map((card) => [card.number, card])
21681
+ );
21682
+ function createEventOuterSlot(index, temporalPhase) {
21683
+ return {
21684
+ slotKey: `outer-${index}`,
21685
+ label: String(index),
21686
+ order: index,
21687
+ minCards: 1,
21688
+ maxCards: 1,
21689
+ validationRules: {
21690
+ allowedTypes: ["minor", "daat+royalship"]
21691
+ },
21692
+ manualSelectionRules: {
21693
+ allowedTypes: ["minor", "daat+royalship"]
21694
+ },
21695
+ drawRules: {
21696
+ allowedTypes: ["minor", "daat+royalship"]
21697
+ },
21698
+ metadata: {
21699
+ displayLabel: String(index),
21700
+ groupKey: "outer",
21701
+ temporalPhase
21702
+ }
21703
+ };
21704
+ }
21705
+ function createEventInnerSlot(index, label, note) {
21706
+ return {
21707
+ slotKey: `inner-${index}`,
21708
+ label,
21709
+ order: 100 + index,
21710
+ minCards: 1,
21711
+ maxCards: 1,
21712
+ validationRules: {
21713
+ allowedTypes: ["major"]
21714
+ },
21715
+ manualSelectionRules: {
21716
+ allowedTypes: ["major"],
21717
+ excludedCardFilenames: [
21718
+ "01_the_magician",
21719
+ "02_the_high_priestess"
21720
+ ]
21721
+ },
21722
+ drawRules: {
21723
+ allowedTypes: ["major"]
21724
+ },
21725
+ metadata: {
21726
+ displayLabel: `${index}.`,
21727
+ groupKey: "inner",
21728
+ note
21729
+ }
21730
+ };
21731
+ }
21732
+ var TAROT_SPREADS = [
21733
+ {
21734
+ spreadId: "quick-insight",
21735
+ label: "Quick Insight",
21736
+ description: "A single-card reading for immediate insight.",
21737
+ slots: [
21738
+ {
21739
+ slotKey: "quick-insight",
21740
+ label: "Quick Insight",
21741
+ order: 1,
21742
+ minCards: 1,
21743
+ maxCards: 1
21744
+ }
21745
+ ]
21746
+ },
21747
+ {
21748
+ spreadId: "conscious-reading",
21749
+ label: "Conscious Reading",
21750
+ description: "Three-card spread for conscious, unconscious, and subconscious layers.",
21751
+ slots: [
21752
+ {
21753
+ slotKey: "conscious",
21754
+ label: "Conscious",
21755
+ order: 1,
21756
+ minCards: 1,
21757
+ maxCards: 1,
21758
+ validationRules: {
21759
+ allowedTypes: ["major"]
21760
+ },
21761
+ manualSelectionRules: {
21762
+ allowedTypes: ["major"]
21763
+ },
21764
+ drawRules: {
21765
+ allowedTypes: ["major"]
21766
+ }
21767
+ },
21768
+ {
21769
+ slotKey: "unconscious",
21770
+ label: "Unconscious",
21771
+ order: 2,
21772
+ minCards: 1,
21773
+ maxCards: 1,
21774
+ validationRules: {
21775
+ allowedTypes: ["daat+royalship"]
21776
+ },
21777
+ manualSelectionRules: {
21778
+ allowedTypes: ["daat+royalship"]
21779
+ },
21780
+ drawRules: {
21781
+ allowedTypes: ["daat+royalship"]
21782
+ }
21783
+ },
21784
+ {
21785
+ slotKey: "subconscious",
21786
+ label: "Subconscious",
21787
+ order: 3,
21788
+ minCards: 1,
21789
+ maxCards: 1,
21790
+ validationRules: {
21791
+ allowedTypes: ["minor"]
21792
+ },
21793
+ manualSelectionRules: {
21794
+ allowedTypes: ["minor"]
21795
+ },
21796
+ drawRules: {
21797
+ allowedTypes: ["minor"]
21798
+ }
21799
+ }
21800
+ ]
21801
+ },
21802
+ {
21803
+ spreadId: "time-reading",
21804
+ label: "Time Reading",
21805
+ description: "Three major arcana cards for past, present, and future.",
21806
+ slots: [
21807
+ {
21808
+ slotKey: "past",
21809
+ label: "Past",
21810
+ order: 1,
21811
+ minCards: 1,
21812
+ maxCards: 1,
21813
+ validationRules: {
21814
+ allowedTypes: ["major"]
21815
+ },
21816
+ manualSelectionRules: {
21817
+ allowedTypes: ["major"]
21818
+ },
21819
+ drawRules: {
21820
+ allowedTypes: ["major"]
21821
+ }
21822
+ },
21823
+ {
21824
+ slotKey: "present",
21825
+ label: "Present",
21826
+ order: 2,
21827
+ minCards: 1,
21828
+ maxCards: 1,
21829
+ validationRules: {
21830
+ allowedTypes: ["major"]
21831
+ },
21832
+ manualSelectionRules: {
21833
+ allowedTypes: ["major"]
21834
+ },
21835
+ drawRules: {
21836
+ allowedTypes: ["major"]
21837
+ }
21838
+ },
21839
+ {
21840
+ slotKey: "future",
21841
+ label: "Future",
21842
+ order: 3,
21843
+ minCards: 1,
21844
+ maxCards: 1,
21845
+ validationRules: {
21846
+ allowedTypes: ["major"]
21847
+ },
21848
+ manualSelectionRules: {
21849
+ allowedTypes: ["major"]
21850
+ },
21851
+ drawRules: {
21852
+ allowedTypes: ["major"]
21853
+ }
21854
+ }
21855
+ ]
21856
+ },
21857
+ {
21858
+ spreadId: "dialectic-reading",
21859
+ label: "Dialectic Reading",
21860
+ description: "Three major arcana cards for thesis, antithesis, and synthesis.",
21861
+ slots: [
21862
+ {
21863
+ slotKey: "thesis",
21864
+ label: "Thesis",
21865
+ order: 1,
21866
+ minCards: 1,
21867
+ maxCards: 1,
21868
+ validationRules: {
21869
+ allowedTypes: ["major"]
21870
+ },
21871
+ manualSelectionRules: {
21872
+ allowedTypes: ["major"]
21873
+ },
21874
+ drawRules: {
21875
+ allowedTypes: ["major"]
21876
+ }
21877
+ },
21878
+ {
21879
+ slotKey: "antithesis",
21880
+ label: "Antithesis",
21881
+ order: 2,
21882
+ minCards: 1,
21883
+ maxCards: 1,
21884
+ validationRules: {
21885
+ allowedTypes: ["major"]
21886
+ },
21887
+ manualSelectionRules: {
21888
+ allowedTypes: ["major"]
21889
+ },
21890
+ drawRules: {
21891
+ allowedTypes: ["major"]
21892
+ }
21893
+ },
21894
+ {
21895
+ slotKey: "synthesis",
21896
+ label: "Synthesis",
21897
+ order: 3,
21898
+ minCards: 1,
21899
+ maxCards: 1,
21900
+ validationRules: {
21901
+ allowedTypes: ["major"]
21902
+ },
21903
+ manualSelectionRules: {
21904
+ allowedTypes: ["major"]
21905
+ },
21906
+ drawRules: {
21907
+ allowedTypes: ["major"]
21908
+ }
21909
+ }
21910
+ ]
21911
+ },
21912
+ {
21913
+ spreadId: "tree-of-life-reading",
21914
+ label: "Tree of Life Reading",
21915
+ description: "Ten numbered minor arcana slots mapped to the spheres plus four Daath court cards.",
21916
+ slots: [
21917
+ {
21918
+ slotKey: "kether",
21919
+ label: "Kether",
21920
+ order: 1,
21921
+ minCards: 1,
21922
+ maxCards: 1,
21923
+ validationRules: {
21924
+ allowedTypes: ["minor"],
21925
+ requiredRank: "ace"
21926
+ },
21927
+ manualSelectionRules: {
21928
+ allowedTypes: ["minor"],
21929
+ requiredRank: "ace"
21930
+ },
21931
+ drawRules: {
21932
+ allowedTypes: ["minor"],
21933
+ requiredRank: "ace"
21934
+ }
21935
+ },
21936
+ {
21937
+ slotKey: "chokhmah",
21938
+ label: "Chokhmah",
21939
+ order: 2,
21940
+ minCards: 1,
21941
+ maxCards: 1,
21942
+ validationRules: {
21943
+ allowedTypes: ["minor"],
21944
+ requiredRank: "2"
21945
+ },
21946
+ manualSelectionRules: {
21947
+ allowedTypes: ["minor"],
21948
+ requiredRank: "2"
21949
+ },
21950
+ drawRules: {
21951
+ allowedTypes: ["minor"],
21952
+ requiredRank: "2"
21953
+ }
21954
+ },
21955
+ {
21956
+ slotKey: "binah",
21957
+ label: "Binah",
21958
+ order: 3,
21959
+ minCards: 1,
21960
+ maxCards: 1,
21961
+ validationRules: {
21962
+ allowedTypes: ["minor"],
21963
+ requiredRank: "3"
21964
+ },
21965
+ manualSelectionRules: {
21966
+ allowedTypes: ["minor"],
21967
+ requiredRank: "3"
21968
+ },
21969
+ drawRules: {
21970
+ allowedTypes: ["minor"],
21971
+ requiredRank: "3"
21972
+ }
21973
+ },
21974
+ {
21975
+ slotKey: "chesed",
21976
+ label: "Chesed",
21977
+ order: 4,
21978
+ minCards: 1,
21979
+ maxCards: 1,
21980
+ validationRules: {
21981
+ allowedTypes: ["minor"],
21982
+ requiredRank: "4"
21983
+ },
21984
+ manualSelectionRules: {
21985
+ allowedTypes: ["minor"],
21986
+ requiredRank: "4"
21987
+ },
21988
+ drawRules: {
21989
+ allowedTypes: ["minor"],
21990
+ requiredRank: "4"
21991
+ }
21992
+ },
21993
+ {
21994
+ slotKey: "geburah",
21995
+ label: "Geburah",
21996
+ order: 5,
21997
+ minCards: 1,
21998
+ maxCards: 1,
21999
+ validationRules: {
22000
+ allowedTypes: ["minor"],
22001
+ requiredRank: "5"
22002
+ },
22003
+ manualSelectionRules: {
22004
+ allowedTypes: ["minor"],
22005
+ requiredRank: "5"
22006
+ },
22007
+ drawRules: {
22008
+ allowedTypes: ["minor"],
22009
+ requiredRank: "5"
22010
+ }
22011
+ },
22012
+ {
22013
+ slotKey: "tiphareth",
22014
+ label: "Tiphareth",
22015
+ order: 6,
22016
+ minCards: 1,
22017
+ maxCards: 1,
22018
+ validationRules: {
22019
+ allowedTypes: ["minor"],
22020
+ requiredRank: "6"
22021
+ },
22022
+ manualSelectionRules: {
22023
+ allowedTypes: ["minor"],
22024
+ requiredRank: "6"
22025
+ },
22026
+ drawRules: {
22027
+ allowedTypes: ["minor"],
22028
+ requiredRank: "6"
22029
+ }
22030
+ },
22031
+ {
22032
+ slotKey: "netzach",
22033
+ label: "Netzach",
22034
+ order: 7,
22035
+ minCards: 1,
22036
+ maxCards: 1,
22037
+ validationRules: {
22038
+ allowedTypes: ["minor"],
22039
+ requiredRank: "7"
22040
+ },
22041
+ manualSelectionRules: {
22042
+ allowedTypes: ["minor"],
22043
+ requiredRank: "7"
22044
+ },
22045
+ drawRules: {
22046
+ allowedTypes: ["minor"],
22047
+ requiredRank: "7"
22048
+ }
22049
+ },
22050
+ {
22051
+ slotKey: "hod",
22052
+ label: "Hod",
22053
+ order: 8,
22054
+ minCards: 1,
22055
+ maxCards: 1,
22056
+ validationRules: {
22057
+ allowedTypes: ["minor"],
22058
+ requiredRank: "8"
22059
+ },
22060
+ manualSelectionRules: {
22061
+ allowedTypes: ["minor"],
22062
+ requiredRank: "8"
22063
+ },
22064
+ drawRules: {
22065
+ allowedTypes: ["minor"],
22066
+ requiredRank: "8"
22067
+ }
22068
+ },
22069
+ {
22070
+ slotKey: "yesod",
22071
+ label: "Yesod",
22072
+ order: 9,
22073
+ minCards: 1,
22074
+ maxCards: 1,
22075
+ validationRules: {
22076
+ allowedTypes: ["minor"],
22077
+ requiredRank: "9"
22078
+ },
22079
+ manualSelectionRules: {
22080
+ allowedTypes: ["minor"],
22081
+ requiredRank: "9"
22082
+ },
22083
+ drawRules: {
22084
+ allowedTypes: ["minor"],
22085
+ requiredRank: "9"
22086
+ }
22087
+ },
22088
+ {
22089
+ slotKey: "malkuth",
22090
+ label: "Malkuth",
22091
+ order: 10,
22092
+ minCards: 1,
22093
+ maxCards: 1,
22094
+ validationRules: {
22095
+ allowedTypes: ["minor"],
22096
+ requiredRank: "10"
22097
+ },
22098
+ manualSelectionRules: {
22099
+ allowedTypes: ["minor"],
22100
+ requiredRank: "10"
22101
+ },
22102
+ drawRules: {
22103
+ allowedTypes: ["minor"],
22104
+ requiredRank: "10"
22105
+ }
22106
+ },
22107
+ {
22108
+ slotKey: "daath",
22109
+ label: "Daath",
22110
+ order: 11,
22111
+ minCards: 4,
22112
+ maxCards: 4,
22113
+ validationRules: {
22114
+ allowedTypes: ["daat+royalship"]
22115
+ },
22116
+ manualSelectionRules: {
22117
+ allowedTypes: ["daat+royalship"]
22118
+ },
22119
+ drawRules: {
22120
+ allowedTypes: ["daat+royalship"]
22121
+ }
22122
+ }
22123
+ ]
22124
+ },
22125
+ {
22126
+ spreadId: "celtic-cross",
22127
+ label: "Celtic Cross",
22128
+ description: "Classic ten-card Celtic Cross spread.",
22129
+ slots: [
22130
+ {
22131
+ slotKey: "present",
22132
+ label: "The Present",
22133
+ order: 1,
22134
+ minCards: 1,
22135
+ maxCards: 1,
22136
+ metadata: {
22137
+ displayLabel: "1."
22138
+ }
22139
+ },
22140
+ {
22141
+ slotKey: "challenge",
22142
+ label: "The Challenge",
22143
+ order: 2,
22144
+ minCards: 1,
22145
+ maxCards: 1,
22146
+ metadata: {
22147
+ displayLabel: "2.",
22148
+ orientation: "sideways"
22149
+ }
22150
+ },
22151
+ {
22152
+ slotKey: "above",
22153
+ label: "Above",
22154
+ order: 3,
22155
+ minCards: 1,
22156
+ maxCards: 1,
22157
+ metadata: {
22158
+ displayLabel: "3."
22159
+ }
22160
+ },
22161
+ {
22162
+ slotKey: "below",
22163
+ label: "Below",
22164
+ order: 4,
22165
+ minCards: 1,
22166
+ maxCards: 1,
22167
+ metadata: {
22168
+ displayLabel: "4."
22169
+ }
22170
+ },
22171
+ {
22172
+ slotKey: "behind",
22173
+ label: "Behind",
22174
+ order: 5,
22175
+ minCards: 1,
22176
+ maxCards: 1,
22177
+ metadata: {
22178
+ displayLabel: "5."
22179
+ }
22180
+ },
22181
+ {
22182
+ slotKey: "before",
22183
+ label: "Before",
22184
+ order: 6,
22185
+ minCards: 1,
22186
+ maxCards: 1,
22187
+ metadata: {
22188
+ displayLabel: "6."
22189
+ }
22190
+ },
22191
+ {
22192
+ slotKey: "self",
22193
+ label: "Self",
22194
+ order: 7,
22195
+ minCards: 1,
22196
+ maxCards: 1,
22197
+ metadata: {
22198
+ displayLabel: "7."
22199
+ }
22200
+ },
22201
+ {
22202
+ slotKey: "environment",
22203
+ label: "Environment",
22204
+ order: 8,
22205
+ minCards: 1,
22206
+ maxCards: 1,
22207
+ metadata: {
22208
+ displayLabel: "8."
22209
+ }
22210
+ },
22211
+ {
22212
+ slotKey: "hopes-fears",
22213
+ label: "Hopes/Fears",
22214
+ order: 9,
22215
+ minCards: 1,
22216
+ maxCards: 1,
22217
+ metadata: {
22218
+ displayLabel: "9."
22219
+ }
22220
+ },
22221
+ {
22222
+ slotKey: "outcome",
22223
+ label: "Outcome",
22224
+ order: 10,
22225
+ minCards: 1,
22226
+ maxCards: 1,
22227
+ metadata: {
22228
+ displayLabel: "10."
22229
+ }
22230
+ }
22231
+ ]
22232
+ },
22233
+ {
22234
+ spreadId: "event-reading",
22235
+ label: "Event Reading",
22236
+ description: "Papus-style event spread with outer minor/court cards, seven major cards, and an inquirer card.",
22237
+ contextRequirements: ["inquirerGender"],
22238
+ slots: [
22239
+ createEventOuterSlot(1, "past"),
22240
+ createEventOuterSlot(2, "past"),
22241
+ createEventOuterSlot(3, "past"),
22242
+ createEventOuterSlot(4, "past"),
22243
+ createEventOuterSlot(5, "present"),
22244
+ createEventOuterSlot(6, "present"),
22245
+ createEventOuterSlot(7, "present"),
22246
+ createEventOuterSlot(8, "present"),
22247
+ createEventOuterSlot(9, "future"),
22248
+ createEventOuterSlot(10, "future"),
22249
+ createEventOuterSlot(11, "future"),
22250
+ createEventOuterSlot(12, "future"),
22251
+ createEventInnerSlot(
22252
+ 1,
22253
+ "Commencement",
22254
+ "Character of the beginning phase."
22255
+ ),
22256
+ createEventInnerSlot(2, "Apogee", "Peak or zenith of the event."),
22257
+ createEventInnerSlot(
22258
+ 3,
22259
+ "Decline/Obstacle",
22260
+ "Challenges, obstacles, or decline."
22261
+ ),
22262
+ createEventInnerSlot(4, "Fall", "Conclusion or end phase."),
22263
+ createEventInnerSlot(
22264
+ 5,
22265
+ "The Past",
22266
+ "Special character or influence in the past."
22267
+ ),
22268
+ createEventInnerSlot(
22269
+ 6,
22270
+ "The Present",
22271
+ "Special character or influence in the present."
22272
+ ),
22273
+ createEventInnerSlot(
22274
+ 7,
22275
+ "The Future",
22276
+ "Special character or influence to come."
22277
+ ),
22278
+ {
22279
+ slotKey: "inquirer",
22280
+ label: "Inquirer",
22281
+ order: 200,
22282
+ minCards: 1,
22283
+ maxCards: 1,
22284
+ validationRules: {
22285
+ allowedTypes: ["major"]
22286
+ },
22287
+ manualSelectionRules: {
22288
+ allowedTypes: ["major"],
22289
+ allowedCardFilenames: [
22290
+ "01_the_magician",
22291
+ "02_the_high_priestess"
22292
+ ]
22293
+ },
22294
+ drawRules: {
22295
+ allowedTypes: ["major"]
22296
+ },
22297
+ metadata: {
22298
+ displayLabel: "Inquirer",
22299
+ groupKey: "center",
22300
+ note: "The querent's energy in this reading."
22301
+ }
22302
+ }
22303
+ ],
22304
+ specialRules: {
22305
+ inquirerCard: {
22306
+ slotKey: "inquirer",
22307
+ sourceSlotKeys: [...EVENT_INNER_SLOT_KEYS],
22308
+ cardNumbersByGender: {
22309
+ man: 1,
22310
+ woman: 2
22311
+ }
22312
+ }
22313
+ }
22314
+ }
22315
+ ];
22316
+ var TAROT_SPREAD_BY_ID = new Map(
22317
+ TAROT_SPREADS.map((spread) => [spread.spreadId, spread])
22318
+ );
21434
22319
 
21435
22320
  // src/cli/commands/tarot.ts
21436
22321
  function findCardsByQuery(query) {