kaabalah 6.2.0 → 6.2.2

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 (34) hide show
  1. package/README.md +31 -1
  2. package/dist/{chunk-6G2QXVWA.js → chunk-25YFW677.js} +165 -15
  3. package/dist/chunk-25YFW677.js.map +1 -0
  4. package/dist/{chunk-IRA4VGG4.js → chunk-HSPUNESW.js} +6 -6
  5. package/dist/{chunk-IRA4VGG4.js.map → chunk-HSPUNESW.js.map} +1 -1
  6. package/dist/{chunk-CQSSLFU6.mjs → chunk-NMIXWQBN.mjs} +3 -3
  7. package/dist/{chunk-CQSSLFU6.mjs.map → chunk-NMIXWQBN.mjs.map} +1 -1
  8. package/dist/{chunk-ZDWTBYDE.mjs → chunk-VWGXOGEJ.mjs} +160 -16
  9. package/dist/chunk-VWGXOGEJ.mjs.map +1 -0
  10. package/dist/cli.js +61 -2
  11. package/dist/cli.js.map +1 -1
  12. package/dist/core/index.d.mts +2 -4
  13. package/dist/core/index.d.ts +2 -4
  14. package/dist/{constants-C0XjrYIG.d.mts → correspondence-model-DWXbAjC-.d.mts} +279 -1
  15. package/dist/{constants-C0XjrYIG.d.ts → correspondence-model-DWXbAjC-.d.ts} +279 -1
  16. package/dist/gematria/index.d.mts +1 -2
  17. package/dist/gematria/index.d.ts +1 -2
  18. package/dist/index.d.mts +2 -3
  19. package/dist/index.d.ts +2 -3
  20. package/dist/index.js +45 -21
  21. package/dist/index.mjs +2 -2
  22. package/dist/semantic/index.d.mts +1 -1
  23. package/dist/semantic/index.d.ts +1 -1
  24. package/dist/semantic/index.js +8 -8
  25. package/dist/semantic/index.mjs +2 -2
  26. package/dist/tarot/index.d.mts +13 -3
  27. package/dist/tarot/index.d.ts +13 -3
  28. package/dist/tarot/index.js +38 -14
  29. package/dist/tarot/index.mjs +1 -1
  30. package/package.json +1 -1
  31. package/dist/chunk-6G2QXVWA.js.map +0 -1
  32. package/dist/chunk-ZDWTBYDE.mjs.map +0 -1
  33. package/dist/correspondence-model-BrtIu5tW.d.mts +0 -281
  34. package/dist/correspondence-model-CpFOWeBr.d.ts +0 -281
package/README.md CHANGED
@@ -81,7 +81,11 @@ const spread = getRandomSpread(3, true);
81
81
  import { id, KaabalahTypes } from "kaabalah/core";
82
82
  import {
83
83
  getTarotArchetype,
84
+ getTarotCardByNumber,
85
+ getTarotCardNumber,
86
+ getTarotCardProfile,
84
87
  getTarotRepresentation,
88
+ listTarotTrees,
85
89
  resolveTarotImageUrl
86
90
  } from "kaabalah/tarot";
87
91
 
@@ -94,6 +98,18 @@ const queenOfCups = getTarotRepresentation(
94
98
  { tarotCardName: "Queen of Cups" },
95
99
  "rider-waite"
96
100
  );
101
+ const tenOfSwords = getTarotRepresentation(
102
+ { tarotCardNumber: 55 },
103
+ "mythic"
104
+ );
105
+ const aceOfPentacles = getTarotCardProfile({
106
+ tarotCardName: "Ace of Pentacles"
107
+ });
108
+ const aceOfPentaclesNumber = getTarotCardNumber({
109
+ tarotCardName: "Ace of Pentacles"
110
+ });
111
+ const kingOfSwords = getTarotCardByNumber(51);
112
+ const tarotTrees = listTarotTrees();
97
113
  const papusImageUrl = resolveTarotImageUrl(
98
114
  { tarotCardFilename: "02_the_high_priestess" },
99
115
  "papus_pt"
@@ -106,7 +122,21 @@ const aceOfWandsUrl = resolveTarotImageUrl(
106
122
  // Persist the canonical archetype ID (for example `path:2`), not the image URL.
107
123
  ```
108
124
 
109
- `getTarotArchetype()` remains major-only. The image helpers (`getTarotRepresentation()`, `getTarotRepresentations()`, and `resolveTarotImageUrl()`) support all 78 cards, using `major/` for the 22 archetypes and `minor/` for court plus pip cards.
125
+ `getTarotArchetype()` remains major-only. The image helpers (`getTarotRepresentation()`, `getTarotRepresentations()`, and `resolveTarotImageUrl()`) support all 78 cards and own the canonical asset rules:
126
+
127
+ - majors: `major/<filename>.jpg`
128
+ - minors: `minor/<suit>/<filename>.jpg`
129
+ - courts: `daat+royalship/<suit>/<filename>.jpg`
130
+
131
+ Downstream apps should consume the returned `imageUrl` (or `assetPath`) from the library instead of reconstructing S3 paths locally.
132
+
133
+ Tarot numbering is tree-scoped. In the current library release the canonical default tree is `kaabalah`, and `getTarotCardProfile()` resolves its `tarotCardNumber` from the direct `tarotArkAnnu ↔ number` correspondence in that tree. Use `getTarotCardNumber()` / `getTarotCardByNumber()` for forward and reverse numbering lookups, and treat raw `ARKANNUS` entries as compatibility data rather than the source of truth.
134
+
135
+ Observable kaabalah-default renumbering:
136
+
137
+ - `Ten of Swords` is `55` and `Ace of Swords` is `64`
138
+ - `Ten of Pentacles` is `69` and `Ace of Pentacles` is `78`
139
+ - court/minor suit blocks run `King → Queen → Knight → Page → Ten → ... → Ace`
110
140
 
111
141
  ### Canonical Semantic Profiles
112
142
 
@@ -4,6 +4,12 @@ var chunkTMN4PYVG_js = require('./chunk-TMN4PYVG.js');
4
4
  var chunkHAMDOCS5_js = require('./chunk-HAMDOCS5.js');
5
5
 
6
6
  // src/tarot/index.ts
7
+ var DEFAULT_TAROT_TREE_ID = "kaabalah";
8
+ var TAROT_TREE_IDS = [
9
+ "kaabalah",
10
+ "hermetic-qabalah",
11
+ "lurianic-kabbalah"
12
+ ];
7
13
  var majorArcana = [
8
14
  "01_the_magician",
9
15
  "02_the_high_priestess",
@@ -28,7 +34,7 @@ var majorArcana = [
28
34
  "21_the_fool",
29
35
  "22_the_world"
30
36
  ];
31
- var ARKANNUS = [
37
+ var RAW_ARKANNUS = [
32
38
  // Major Arcana (1-22)
33
39
  {
34
40
  number: 1,
@@ -903,9 +909,6 @@ var TAROT_DECK_METADATA = [
903
909
  label: "Rider Waite"
904
910
  }
905
911
  ];
906
- var MAJOR_ARCANA_CARDS = ARKANNUS.filter(
907
- (card) => card.type === "major" && majorArcana.includes(card.tarotCardFilename)
908
- );
909
912
  var tarotArchetypeCache;
910
913
  var tarotCardProfileCache;
911
914
  function normalizePathSlug(pathSlug) {
@@ -914,14 +917,98 @@ function normalizePathSlug(pathSlug) {
914
917
  function normalizeTarotLookupKey(value) {
915
918
  return value.trim().toLowerCase();
916
919
  }
920
+ var TAROT_TREE_PARTS = {
921
+ kaabalah: ["tarot"]
922
+ };
923
+ var TAROT_ARK_ANNU_ID_BY_NAME = new Map(
924
+ RAW_ARKANNUS.map((card) => [
925
+ normalizeTarotLookupKey(card.tarotCard),
926
+ chunkHAMDOCS5_js.id("tarotArkAnnu" /* TAROT_ARK_ANNU */, card.tarotCard)
927
+ ])
928
+ );
929
+ var TAROT_ARK_ANNU_ID_BY_FILENAME = new Map(
930
+ RAW_ARKANNUS.map((card) => [
931
+ normalizeTarotLookupKey(card.tarotCardFilename),
932
+ chunkHAMDOCS5_js.id("tarotArkAnnu" /* TAROT_ARK_ANNU */, card.tarotCard)
933
+ ])
934
+ );
935
+ function getTarotTreeWorkspace(treeId = DEFAULT_TAROT_TREE_ID) {
936
+ const parts = TAROT_TREE_PARTS[treeId];
937
+ if (!parts) {
938
+ return void 0;
939
+ }
940
+ return chunkTMN4PYVG_js.getCanonicalTree({
941
+ system: treeId,
942
+ parts: [...parts]
943
+ });
944
+ }
945
+ function getDirectTarotCardNumber(tarotArkAnnuId, treeId = DEFAULT_TAROT_TREE_ID) {
946
+ const tree = getTarotTreeWorkspace(treeId);
947
+ if (!tree) {
948
+ return void 0;
949
+ }
950
+ const match = tree.getCorrespondences(tarotArkAnnuId, {
951
+ type: "number" /* NUMBER */,
952
+ depth: 1,
953
+ limit: 1
954
+ })[0];
955
+ if (!match) {
956
+ return void 0;
957
+ }
958
+ return Number.parseInt(chunkHAMDOCS5_js.parseId(match.node.id), 10);
959
+ }
960
+ function buildDefaultArkannus(cards) {
961
+ const tree = getTarotTreeWorkspace(DEFAULT_TAROT_TREE_ID);
962
+ const resolveNumber = (tarotCardName) => {
963
+ if (!tree) {
964
+ return void 0;
965
+ }
966
+ const match = tree.getCorrespondences(
967
+ chunkHAMDOCS5_js.id("tarotArkAnnu" /* TAROT_ARK_ANNU */, tarotCardName),
968
+ {
969
+ type: "number" /* NUMBER */,
970
+ depth: 1,
971
+ limit: 1
972
+ }
973
+ )[0];
974
+ if (!match) {
975
+ return void 0;
976
+ }
977
+ return Number.parseInt(chunkHAMDOCS5_js.parseId(match.node.id), 10);
978
+ };
979
+ return [...cards].map((card) => ({
980
+ ...card,
981
+ number: resolveNumber(card.tarotCard) ?? card.number
982
+ })).sort((left, right) => {
983
+ if (left.number !== right.number) {
984
+ return left.number - right.number;
985
+ }
986
+ return left.tarotCard.localeCompare(right.tarotCard);
987
+ });
988
+ }
989
+ var ARKANNUS = buildDefaultArkannus(RAW_ARKANNUS);
990
+ var MAJOR_ARCANA_CARDS = ARKANNUS.filter(
991
+ (card) => card.type === "major" && majorArcana.includes(card.tarotCardFilename)
992
+ );
917
993
  function toTarotCardKind(card) {
918
994
  if (card.type === "major") {
919
995
  return "major";
920
996
  }
921
997
  return card.type === "minor" ? "minor" : "court";
922
998
  }
923
- function getTarotImagePath(card) {
924
- return card.kind === "major" ? "major" : "minor";
999
+ function toTarotAssetPathType(card) {
1000
+ return card.type;
1001
+ }
1002
+ function buildTarotAssetPath(card) {
1003
+ if (card.assetPathType === "major") {
1004
+ return `major/${card.tarotCardFilename}`;
1005
+ }
1006
+ if (!card.suit) {
1007
+ throw new Error(
1008
+ `Missing suit metadata required to resolve tarot image path for ${card.tarotCardName}.`
1009
+ );
1010
+ }
1011
+ return `${card.assetPathType}/${card.suit}/${card.tarotCardFilename}`;
925
1012
  }
926
1013
  function toAstrologyCorrespondence(node) {
927
1014
  return {
@@ -1022,7 +1109,6 @@ function getTarotCardProfileCache() {
1022
1109
  system: "kaabalah",
1023
1110
  parts: ["westernAstrology", "tarot"]
1024
1111
  });
1025
- const archetypesByTarotCardNumber = getTarotArchetypeCache().byTarotCardNumber;
1026
1112
  const availableDeckIds = TAROT_DECK_METADATA.map((deck) => deck.id);
1027
1113
  const profiles = ARKANNUS.map((card) => {
1028
1114
  const tarotArkAnnuId = chunkHAMDOCS5_js.id("tarotArkAnnu" /* TAROT_ARK_ANNU */, card.tarotCard);
@@ -1038,10 +1124,10 @@ function getTarotCardProfileCache() {
1038
1124
  tarotCardFilename: card.tarotCardFilename,
1039
1125
  tarotMeaning: descriptionsByDeck.papus_pt?.meaning ?? card.meaning,
1040
1126
  kind: toTarotCardKind(card),
1127
+ assetPathType: toTarotAssetPathType(card),
1041
1128
  suit: card.suit,
1042
1129
  availableDeckIds,
1043
- descriptionsByDeck,
1044
- archetype: archetypesByTarotCardNumber.get(card.number)
1130
+ descriptionsByDeck
1045
1131
  };
1046
1132
  });
1047
1133
  tarotCardProfileCache = {
@@ -1069,11 +1155,13 @@ function getTarotCardProfileCache() {
1069
1155
  }
1070
1156
  function buildTarotRepresentation(card, deck) {
1071
1157
  const description = card.descriptionsByDeck[deck.id];
1072
- const imageUrl = `${TAROT_IMAGE_BASE_URL}/${deck.id}/${getTarotImagePath(card)}/${card.tarotCardFilename}.jpg`;
1158
+ const assetPath = buildTarotAssetPath(card);
1159
+ const imageUrl = `${TAROT_IMAGE_BASE_URL}/${deck.id}/${assetPath}.jpg`;
1073
1160
  return {
1074
1161
  card,
1075
1162
  archetype: card.kind === "major" ? getTarotArchetype({ tarotCardNumber: card.tarotCardNumber }) : void 0,
1076
1163
  deck: { id: deck.id, label: deck.label },
1164
+ assetPath,
1077
1165
  imageUrl,
1078
1166
  label: `${card.tarotCardName} - ${deck.label}`,
1079
1167
  altText: `${card.tarotCardName} - ${deck.label}`,
@@ -1081,6 +1169,25 @@ function buildTarotRepresentation(card, deck) {
1081
1169
  description
1082
1170
  };
1083
1171
  }
1172
+ function resolveTarotArkAnnuId(lookup) {
1173
+ if ("pathSlug" in lookup || "pathId" in lookup) {
1174
+ return getTarotArchetype(lookup)?.tarotArkAnnuId;
1175
+ }
1176
+ if ("tarotArkAnnuId" in lookup) {
1177
+ return lookup.tarotArkAnnuId;
1178
+ }
1179
+ if ("tarotCardName" in lookup) {
1180
+ return TAROT_ARK_ANNU_ID_BY_NAME.get(
1181
+ normalizeTarotLookupKey(lookup.tarotCardName)
1182
+ );
1183
+ }
1184
+ if ("tarotCardFilename" in lookup) {
1185
+ return TAROT_ARK_ANNU_ID_BY_FILENAME.get(
1186
+ normalizeTarotLookupKey(lookup.tarotCardFilename)
1187
+ );
1188
+ }
1189
+ return void 0;
1190
+ }
1084
1191
  function getTarotCardProfile(lookup) {
1085
1192
  const cache = getTarotCardProfileCache();
1086
1193
  if ("pathSlug" in lookup || "pathId" in lookup) {
@@ -1100,11 +1207,48 @@ function getTarotCardProfile(lookup) {
1100
1207
  normalizeTarotLookupKey(lookup.tarotCardFilename)
1101
1208
  );
1102
1209
  }
1103
- return cache.byTarotCardNumber.get(lookup.tarotCardNumber);
1210
+ return getTarotCardByNumber(lookup.tarotCardNumber);
1104
1211
  }
1105
1212
  function listTarotDecks() {
1106
1213
  return TAROT_DECK_METADATA.map(({ id: id2, label }) => ({ id: id2, label }));
1107
1214
  }
1215
+ function listTarotTrees() {
1216
+ return [...TAROT_TREE_IDS];
1217
+ }
1218
+ function getTarotCardNumber(lookup, treeId = DEFAULT_TAROT_TREE_ID) {
1219
+ if ("tarotCardNumber" in lookup) {
1220
+ return getTarotCardByNumber(lookup.tarotCardNumber, treeId)?.tarotCardNumber;
1221
+ }
1222
+ const tarotArkAnnuId = resolveTarotArkAnnuId(lookup);
1223
+ if (!tarotArkAnnuId) {
1224
+ return void 0;
1225
+ }
1226
+ return getDirectTarotCardNumber(tarotArkAnnuId, treeId);
1227
+ }
1228
+ function getTarotCardByNumber(cardNumber, treeId = DEFAULT_TAROT_TREE_ID) {
1229
+ const tree = getTarotTreeWorkspace(treeId);
1230
+ if (!tree) {
1231
+ return void 0;
1232
+ }
1233
+ const match = tree.getCorrespondences(chunkHAMDOCS5_js.id("number" /* NUMBER */, cardNumber), {
1234
+ type: "tarotArkAnnu" /* TAROT_ARK_ANNU */,
1235
+ depth: 1,
1236
+ limit: 1
1237
+ })[0];
1238
+ if (!match) {
1239
+ return void 0;
1240
+ }
1241
+ const profile = getTarotCardProfile({
1242
+ tarotArkAnnuId: match.node.id
1243
+ });
1244
+ if (!profile || profile.tarotCardNumber === cardNumber) {
1245
+ return profile;
1246
+ }
1247
+ return {
1248
+ ...profile,
1249
+ tarotCardNumber: cardNumber
1250
+ };
1251
+ }
1108
1252
  function getTarotArchetype(lookup) {
1109
1253
  const cache = getTarotArchetypeCache();
1110
1254
  if ("pathSlug" in lookup) {
@@ -1837,7 +1981,7 @@ function cloneSpreadDefinition(spread) {
1837
1981
  } : void 0
1838
1982
  };
1839
1983
  }
1840
- function getTarotCardByNumber(cardNumber) {
1984
+ function getTarotDeckCardByNumber(cardNumber) {
1841
1985
  return TAROT_CARD_BY_NUMBER.get(cardNumber);
1842
1986
  }
1843
1987
  function getTarotSpreadRuleForValidation(slot) {
@@ -2086,7 +2230,7 @@ function validateTarotSpreadSelection(input) {
2086
2230
  });
2087
2231
  continue;
2088
2232
  }
2089
- const tarotCard = getTarotCardByNumber(selectedCard.cardNumber);
2233
+ const tarotCard = getTarotDeckCardByNumber(selectedCard.cardNumber);
2090
2234
  if (!tarotCard) {
2091
2235
  errors.push({
2092
2236
  code: "CARD_NOT_FOUND",
@@ -2217,17 +2361,23 @@ function drawTarotSpread(options) {
2217
2361
  }
2218
2362
 
2219
2363
  exports.ARKANNUS = ARKANNUS;
2364
+ exports.DEFAULT_TAROT_TREE_ID = DEFAULT_TAROT_TREE_ID;
2220
2365
  exports.TAROT_IMAGE_BASE_URL = TAROT_IMAGE_BASE_URL;
2366
+ exports.TAROT_TREE_IDS = TAROT_TREE_IDS;
2221
2367
  exports.drawTarotSpread = drawTarotSpread;
2222
2368
  exports.getTarotArchetype = getTarotArchetype;
2369
+ exports.getTarotCardByNumber = getTarotCardByNumber;
2370
+ exports.getTarotCardNumber = getTarotCardNumber;
2371
+ exports.getTarotCardProfile = getTarotCardProfile;
2223
2372
  exports.getTarotRepresentation = getTarotRepresentation;
2224
2373
  exports.getTarotRepresentations = getTarotRepresentations;
2225
2374
  exports.getTarotSpread = getTarotSpread;
2226
2375
  exports.listTarotDecks = listTarotDecks;
2227
2376
  exports.listTarotSpreads = listTarotSpreads;
2377
+ exports.listTarotTrees = listTarotTrees;
2228
2378
  exports.majorArcana = majorArcana;
2229
2379
  exports.resolveTarotImageUrl = resolveTarotImageUrl;
2230
2380
  exports.shuffleTarotDeck = shuffleTarotDeck;
2231
2381
  exports.validateTarotSpreadSelection = validateTarotSpreadSelection;
2232
- //# sourceMappingURL=chunk-6G2QXVWA.js.map
2233
- //# sourceMappingURL=chunk-6G2QXVWA.js.map
2382
+ //# sourceMappingURL=chunk-25YFW677.js.map
2383
+ //# sourceMappingURL=chunk-25YFW677.js.map