@aleph-ai/tinyaleph 1.4.2 → 1.5.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.
- package/backends/bioinformatics/binding.js +44 -52
- package/backends/bioinformatics/dna-computing.js +14 -23
- package/backends/bioinformatics/encoding.js +22 -30
- package/backends/bioinformatics/folding.js +24 -32
- package/backends/bioinformatics/genetic-code.js +17 -21
- package/backends/bioinformatics/index.js +12 -12
- package/backends/bioinformatics/transcription.js +5 -3
- package/backends/bioinformatics/translation.js +6 -4
- package/backends/cryptographic/index.js +10 -9
- package/backends/index.js +7 -6
- package/backends/interface.js +4 -1
- package/backends/scientific/index.js +7 -4
- package/backends/semantic/index.js +7 -4
- package/backends/semantic/surface.js +2 -1
- package/backends/semantic/two-layer.js +5 -3
- package/core/beacon.js +10 -9
- package/core/compound.js +4 -4
- package/core/crt-homology.js +5 -5
- package/core/enochian-vocabulary.js +5 -17
- package/core/enochian.js +3 -2
- package/core/entanglement.js +7 -7
- package/core/errors.js +2 -10
- package/core/events.js +7 -6
- package/core/fano.js +7 -6
- package/core/hilbert.js +40 -34
- package/core/hypercomplex.js +4 -2
- package/core/index.js +42 -80
- package/core/inference.js +6 -6
- package/core/lambda.js +5 -18
- package/core/llm.js +1 -1
- package/core/logger.js +3 -4
- package/core/prime.js +26 -1
- package/core/quaternion-semantics.js +3 -3
- package/core/reduction.js +5 -21
- package/core/resonance.js +2 -1
- package/core/rformer-crt.js +15 -29
- package/core/rformer-layers.js +12 -14
- package/core/rformer-tf.js +34 -43
- package/core/rformer.js +17 -32
- package/core/sieve.js +8 -3
- package/core/symbols/archetypes.js +3 -3
- package/core/symbols/base.js +4 -4
- package/core/symbols/elements.js +2 -2
- package/core/symbols/hieroglyphs.js +3 -3
- package/core/symbols/iching.js +3 -3
- package/core/symbols/index.js +32 -18
- package/core/symbols/tarot.js +2 -2
- package/core/symbols.js +1 -0
- package/core/topology.js +3 -14
- package/core/types.js +3 -14
- package/engine/aleph.js +8 -6
- package/engine/index.js +4 -2
- package/index.js +3 -2
- package/modular.js +18 -41
- package/package.json +17 -5
- package/physics/collapse.js +10 -11
- package/physics/entropy.js +8 -8
- package/physics/index.js +70 -102
- package/physics/kuramoto-coupled-ladder.js +10 -14
- package/physics/kuramoto.js +5 -2
- package/physics/lyapunov.js +7 -7
- package/physics/oscillator.js +2 -1
- package/physics/primeon_z_ladder_multi.js +7 -9
- package/physics/primeon_z_ladder_u.js +8 -9
- package/physics/stochastic-kuramoto.js +7 -7
- package/physics/sync-models.js +11 -14
- package/telemetry/index.js +24 -0
- package/telemetry/metrics.js +3 -8
package/core/llm.js
CHANGED
package/core/logger.js
CHANGED
|
@@ -12,8 +12,6 @@
|
|
|
12
12
|
* Extracted from apps/sentient/lib/error-handler.js for library reuse.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
const { LogLevel, LogLevelNames, SimpleEventEmitter } = require('./errors');
|
|
16
|
-
|
|
17
15
|
// ============================================================================
|
|
18
16
|
// LOGGER
|
|
19
17
|
// ============================================================================
|
|
@@ -21,6 +19,8 @@ const { LogLevel, LogLevelNames, SimpleEventEmitter } = require('./errors');
|
|
|
21
19
|
/**
|
|
22
20
|
* Structured Logger
|
|
23
21
|
*/
|
|
22
|
+
import { LogLevel, LogLevelNames, SimpleEventEmitter } from './errors.js';
|
|
23
|
+
|
|
24
24
|
class Logger extends SimpleEventEmitter {
|
|
25
25
|
constructor(options = {}) {
|
|
26
26
|
super();
|
|
@@ -341,10 +341,9 @@ function createLogger(namespace, options = {}) {
|
|
|
341
341
|
// EXPORTS
|
|
342
342
|
// ============================================================================
|
|
343
343
|
|
|
344
|
-
|
|
344
|
+
export {
|
|
345
345
|
Logger,
|
|
346
346
|
createLogger,
|
|
347
|
-
// Re-export LogLevel for convenience
|
|
348
347
|
LogLevel,
|
|
349
348
|
LogLevelNames
|
|
350
349
|
};
|
package/core/prime.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
// Prime generation
|
|
6
|
+
|
|
6
7
|
function* primeGenerator(start = 2) {
|
|
7
8
|
let n = start;
|
|
8
9
|
while (true) {
|
|
@@ -304,7 +305,31 @@ function findClosingPrimes(currentPrimes, epsilon = 1.0) {
|
|
|
304
305
|
return candidates.sort((a, b) => a.error - b.error);
|
|
305
306
|
}
|
|
306
307
|
|
|
307
|
-
|
|
308
|
+
// Named exports for ESM
|
|
309
|
+
export {
|
|
310
|
+
primeGenerator,
|
|
311
|
+
nthPrime,
|
|
312
|
+
primesUpTo,
|
|
313
|
+
isPrime,
|
|
314
|
+
factorize,
|
|
315
|
+
primeSignature,
|
|
316
|
+
firstNPrimes,
|
|
317
|
+
GaussianInteger,
|
|
318
|
+
EisensteinInteger,
|
|
319
|
+
primeToFrequency,
|
|
320
|
+
primeToAngle,
|
|
321
|
+
sumOfTwoSquares,
|
|
322
|
+
DEFAULT_PRIMES,
|
|
323
|
+
// 108 Invariant exports
|
|
324
|
+
TWIST_108,
|
|
325
|
+
twistAngle,
|
|
326
|
+
totalTwist,
|
|
327
|
+
isTwistClosed,
|
|
328
|
+
findClosingPrimes
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
// Default export for backwards compatibility
|
|
332
|
+
export default {
|
|
308
333
|
primeGenerator, nthPrime, primesUpTo, isPrime,
|
|
309
334
|
factorize, primeSignature, firstNPrimes,
|
|
310
335
|
GaussianInteger, EisensteinInteger,
|
|
@@ -16,8 +16,6 @@
|
|
|
16
16
|
* not from predetermined labels.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
const { isPrime, twistAngle, nthPrime } = require('./prime');
|
|
20
|
-
|
|
21
19
|
// ============================================================================
|
|
22
20
|
// AXIS MAPPING STRATEGIES
|
|
23
21
|
// ============================================================================
|
|
@@ -25,6 +23,8 @@ const { isPrime, twistAngle, nthPrime } = require('./prime');
|
|
|
25
23
|
/**
|
|
26
24
|
* Golden ratio for axis distribution
|
|
27
25
|
*/
|
|
26
|
+
import { isPrime, twistAngle, nthPrime } from './prime.js';
|
|
27
|
+
|
|
28
28
|
const PHI = (1 + Math.sqrt(5)) / 2;
|
|
29
29
|
|
|
30
30
|
/**
|
|
@@ -589,7 +589,7 @@ function analyzePrimeFamily(primes) {
|
|
|
589
589
|
// EXPORTS
|
|
590
590
|
// ============================================================================
|
|
591
591
|
|
|
592
|
-
|
|
592
|
+
export default {
|
|
593
593
|
// Axis mapping strategies
|
|
594
594
|
AxisMapper,
|
|
595
595
|
ModularAxisMapper,
|
package/core/reduction.js
CHANGED
|
@@ -10,17 +10,16 @@
|
|
|
10
10
|
* - Prime-preserving ⊕ operator
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
import { isPrime, nthPrime, firstNPrimes } from './prime.js';
|
|
14
|
+
|
|
15
|
+
import { NounTerm,
|
|
16
16
|
AdjTerm,
|
|
17
17
|
ChainTerm,
|
|
18
18
|
FusionTerm,
|
|
19
19
|
NounSentence,
|
|
20
20
|
SeqSentence,
|
|
21
21
|
ImplSentence,
|
|
22
|
-
N, A, FUSE, CHAIN
|
|
23
|
-
} = require('./types');
|
|
22
|
+
N, A, FUSE, CHAIN } from './types.js';
|
|
24
23
|
|
|
25
24
|
// ============================================================================
|
|
26
25
|
// PRIME-PRESERVING OPERATORS (⊕)
|
|
@@ -1091,41 +1090,26 @@ function testLocalConfluence(reducer = null) {
|
|
|
1091
1090
|
// EXPORTS
|
|
1092
1091
|
// ============================================================================
|
|
1093
1092
|
|
|
1094
|
-
|
|
1095
|
-
// Operators
|
|
1093
|
+
export {
|
|
1096
1094
|
PrimeOperator,
|
|
1097
1095
|
NextPrimeOperator,
|
|
1098
1096
|
ModularPrimeOperator,
|
|
1099
1097
|
ResonancePrimeOperator,
|
|
1100
1098
|
IdentityPrimeOperator,
|
|
1101
1099
|
DEFAULT_OPERATOR,
|
|
1102
|
-
|
|
1103
|
-
// Reduction
|
|
1104
1100
|
ReductionStep,
|
|
1105
1101
|
ReductionTrace,
|
|
1106
1102
|
ReductionSystem,
|
|
1107
|
-
|
|
1108
|
-
// Utilities
|
|
1109
1103
|
isNormalForm,
|
|
1110
1104
|
isReducible,
|
|
1111
1105
|
termSize,
|
|
1112
1106
|
termDepth,
|
|
1113
1107
|
extractPrimes,
|
|
1114
|
-
|
|
1115
|
-
// Canonicalization
|
|
1116
1108
|
FusionCanonicalizer,
|
|
1117
|
-
|
|
1118
|
-
// Verification
|
|
1119
1109
|
NormalFormVerifier,
|
|
1120
|
-
|
|
1121
|
-
// Formal Proofs (from ncpsc.pdf §5)
|
|
1122
1110
|
ProofTrace,
|
|
1123
1111
|
ProofGenerator,
|
|
1124
|
-
|
|
1125
|
-
// Route Statistics (from ncpsc.pdf §3)
|
|
1126
1112
|
RouteStatistics,
|
|
1127
|
-
|
|
1128
|
-
// Proofs
|
|
1129
1113
|
demonstrateStrongNormalization,
|
|
1130
1114
|
testLocalConfluence
|
|
1131
1115
|
};
|
package/core/resonance.js
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
// Golden ratio constant
|
|
15
|
+
|
|
15
16
|
const PHI = 1.618033988749895;
|
|
16
17
|
const PHI_THRESHOLD = 0.1; // How close to φ counts as "golden"
|
|
17
18
|
const PHI_BONUS = 0.3; // Bonus for golden ratio relationships
|
|
@@ -309,7 +310,7 @@ function findFibonacciSequences(primes, minLength = 3) {
|
|
|
309
310
|
// Singleton instance for convenience
|
|
310
311
|
const defaultCalculator = new ResonanceCalculator();
|
|
311
312
|
|
|
312
|
-
|
|
313
|
+
export default {
|
|
313
314
|
ResonanceCalculator,
|
|
314
315
|
resonanceSignature,
|
|
315
316
|
findFibonacciSequences,
|
package/core/rformer-crt.js
CHANGED
|
@@ -18,35 +18,29 @@
|
|
|
18
18
|
|
|
19
19
|
'use strict';
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
import { Complex, PrimeState } from './hilbert.js';
|
|
22
|
+
import { firstNPrimes, isPrime } from './prime.js';
|
|
23
|
+
|
|
24
|
+
import { Quaternion,
|
|
23
25
|
SparsePrimeState,
|
|
24
26
|
resonanceScore,
|
|
25
27
|
resonantAttention,
|
|
26
28
|
hamiltonCompose,
|
|
27
|
-
computeCoherence
|
|
28
|
-
} = require('./rformer');
|
|
29
|
+
computeCoherence } from './rformer.js';
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
ResonantMultiHeadAttention,
|
|
31
|
+
import { ResonantMultiHeadAttention,
|
|
32
32
|
PrimeFFN,
|
|
33
33
|
PrimeLayerNorm,
|
|
34
34
|
PositionalPrimeEncoding,
|
|
35
|
-
ResoFormerBlock
|
|
36
|
-
} = require('./rformer-layers');
|
|
35
|
+
ResoFormerBlock } from './rformer-layers.js';
|
|
37
36
|
|
|
38
|
-
|
|
39
|
-
CRTReconstructor,
|
|
37
|
+
import { CRTReconstructor,
|
|
40
38
|
BirkhoffProjector,
|
|
41
39
|
HomologyLoss,
|
|
42
40
|
CRTModularLayer,
|
|
43
41
|
CRTFusedAttention,
|
|
44
42
|
CoprimeSelector,
|
|
45
|
-
ResidueEncoder
|
|
46
|
-
} = require('./crt-homology');
|
|
47
|
-
|
|
48
|
-
const { Complex, PrimeState } = require('./hilbert');
|
|
49
|
-
const { firstNPrimes, isPrime } = require('./prime');
|
|
43
|
+
ResidueEncoder } from './crt-homology.js';
|
|
50
44
|
|
|
51
45
|
/**
|
|
52
46
|
* CRTResonantAttention - Multi-head attention with CRT-fused modular structure
|
|
@@ -876,17 +870,9 @@ function createCRTResoFormer(config = {}) {
|
|
|
876
870
|
});
|
|
877
871
|
}
|
|
878
872
|
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
// Complete model
|
|
887
|
-
CRTResoFormer,
|
|
888
|
-
|
|
889
|
-
// Factory function
|
|
890
|
-
createCRTResoFormer
|
|
891
|
-
};
|
|
892
|
-
|
|
873
|
+
export {
|
|
874
|
+
CRTResonantAttention,
|
|
875
|
+
HomologyRegularizedBlock,
|
|
876
|
+
CRTResoFormer,
|
|
877
|
+
createCRTResoFormer
|
|
878
|
+
};
|
package/core/rformer-layers.js
CHANGED
|
@@ -14,17 +14,15 @@
|
|
|
14
14
|
|
|
15
15
|
'use strict';
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
import { Complex, PrimeState } from './hilbert.js';
|
|
18
|
+
import { firstNPrimes, nthPrime, isPrime } from './prime.js';
|
|
19
|
+
|
|
20
|
+
import { Quaternion,
|
|
19
21
|
SparsePrimeState,
|
|
20
22
|
resonanceScore,
|
|
21
23
|
resonantAttention,
|
|
22
24
|
hamiltonCompose,
|
|
23
|
-
computeCoherence
|
|
24
|
-
} = require('./rformer');
|
|
25
|
-
|
|
26
|
-
const { Complex, PrimeState } = require('./hilbert');
|
|
27
|
-
const { firstNPrimes, nthPrime, isPrime } = require('./prime');
|
|
25
|
+
computeCoherence } from './rformer.js';
|
|
28
26
|
|
|
29
27
|
/**
|
|
30
28
|
* ResonantMultiHeadAttention
|
|
@@ -801,11 +799,11 @@ class ResoFormer {
|
|
|
801
799
|
}
|
|
802
800
|
}
|
|
803
801
|
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
802
|
+
export {
|
|
803
|
+
ResonantMultiHeadAttention,
|
|
804
|
+
PrimeFFN,
|
|
805
|
+
PrimeLayerNorm,
|
|
806
|
+
PositionalPrimeEncoding,
|
|
807
|
+
ResoFormerBlock,
|
|
808
|
+
ResoFormer
|
|
811
809
|
};
|
package/core/rformer-tf.js
CHANGED
|
@@ -13,20 +13,22 @@
|
|
|
13
13
|
* State space: H_Q = H_P ⊗ ℍ (Prime Hilbert space ⊗ Quaternions)
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
import { firstNPrimes } from './prime.js';
|
|
17
|
+
|
|
18
|
+
let tf = null;
|
|
17
19
|
try {
|
|
18
|
-
|
|
20
|
+
const mod = await import('@tensorflow/tfjs-node');
|
|
21
|
+
tf = mod.default || mod;
|
|
19
22
|
} catch (e) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
try {
|
|
24
|
+
const mod = await import('@tensorflow/tfjs');
|
|
25
|
+
tf = mod.default || mod;
|
|
26
|
+
} catch (e2) {
|
|
27
|
+
console.warn('tf not available');
|
|
28
|
+
tf = null;
|
|
29
|
+
}
|
|
26
30
|
}
|
|
27
31
|
|
|
28
|
-
const { firstNPrimes } = require('./prime');
|
|
29
|
-
|
|
30
32
|
// ============================================================================
|
|
31
33
|
// UTILITY FUNCTIONS
|
|
32
34
|
// ============================================================================
|
|
@@ -1050,37 +1052,26 @@ async function trainStep(model, optimizer, xBatch, yBatch) {
|
|
|
1050
1052
|
// EXPORTS
|
|
1051
1053
|
// ============================================================================
|
|
1052
1054
|
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
createResoFormerModel,
|
|
1076
|
-
createResoFormerClassifier,
|
|
1077
|
-
createResoFormerEmbedder,
|
|
1078
|
-
|
|
1079
|
-
// Training utilities
|
|
1080
|
-
resoFormerLoss,
|
|
1081
|
-
createOptimizer,
|
|
1082
|
-
trainStep,
|
|
1083
|
-
|
|
1084
|
-
// TensorFlow reference (for users who need it)
|
|
1085
|
-
tf
|
|
1055
|
+
export {
|
|
1056
|
+
getPrimeLookup,
|
|
1057
|
+
getPrimeLogFrequencies,
|
|
1058
|
+
quaternionMul,
|
|
1059
|
+
quaternionConj,
|
|
1060
|
+
quaternionNorm2,
|
|
1061
|
+
quaternionNormalize,
|
|
1062
|
+
QuaternionDense,
|
|
1063
|
+
SparsePrimeEmbedding,
|
|
1064
|
+
ResonantAttention,
|
|
1065
|
+
HamiltonCompose,
|
|
1066
|
+
CoherenceGating,
|
|
1067
|
+
EntropyCollapse,
|
|
1068
|
+
ResonanceOperator,
|
|
1069
|
+
ResoFormerBlock,
|
|
1070
|
+
createResoFormerModel,
|
|
1071
|
+
createResoFormerClassifier,
|
|
1072
|
+
createResoFormerEmbedder,
|
|
1073
|
+
resoFormerLoss,
|
|
1074
|
+
createOptimizer,
|
|
1075
|
+
trainStep,
|
|
1076
|
+
tf
|
|
1086
1077
|
};
|
package/core/rformer.js
CHANGED
|
@@ -14,9 +14,6 @@
|
|
|
14
14
|
* - Prime Resonant Graph Database
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
const { firstNPrimes, isPrime, factorize } = require('./prime');
|
|
18
|
-
const { Complex, PrimeState } = require('./hilbert');
|
|
19
|
-
|
|
20
17
|
// ============================================================================
|
|
21
18
|
// QUATERNION ALGEBRA
|
|
22
19
|
// ============================================================================
|
|
@@ -25,6 +22,9 @@ const { Complex, PrimeState } = require('./hilbert');
|
|
|
25
22
|
* Full Quaternion class for H_Q representation
|
|
26
23
|
* q = w + xi + yj + zk (Hamilton quaternion)
|
|
27
24
|
*/
|
|
25
|
+
import { firstNPrimes, isPrime, factorize } from './prime.js';
|
|
26
|
+
import { Complex, PrimeState } from './hilbert.js';
|
|
27
|
+
|
|
28
28
|
class Quaternion {
|
|
29
29
|
constructor(w = 1, x = 0, y = 0, z = 0) {
|
|
30
30
|
this.w = w; // scalar part
|
|
@@ -774,33 +774,18 @@ function applyResonanceOperator(state, n) {
|
|
|
774
774
|
return result;
|
|
775
775
|
}
|
|
776
776
|
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
// Halting
|
|
793
|
-
computeCoherence,
|
|
794
|
-
haltingDecision,
|
|
795
|
-
coherenceGatedCompute,
|
|
796
|
-
|
|
797
|
-
// Collapse
|
|
798
|
-
EntropyCollapseHead,
|
|
799
|
-
generateAttractorCodebook,
|
|
800
|
-
|
|
801
|
-
// Memory
|
|
802
|
-
PRGraphMemory,
|
|
803
|
-
|
|
804
|
-
// Operators
|
|
805
|
-
applyResonanceOperator
|
|
777
|
+
export {
|
|
778
|
+
Quaternion,
|
|
779
|
+
SparsePrimeState,
|
|
780
|
+
resonanceScore,
|
|
781
|
+
resonantAttention,
|
|
782
|
+
hamiltonCompose,
|
|
783
|
+
measureNonCommutativity,
|
|
784
|
+
computeCoherence,
|
|
785
|
+
haltingDecision,
|
|
786
|
+
coherenceGatedCompute,
|
|
787
|
+
EntropyCollapseHead,
|
|
788
|
+
generateAttractorCodebook,
|
|
789
|
+
PRGraphMemory,
|
|
790
|
+
applyResonanceOperator
|
|
806
791
|
};
|
package/core/sieve.js
CHANGED
|
@@ -5,9 +5,14 @@
|
|
|
5
5
|
* See: docs/sieve.md
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
import { createEngine, SemanticBackend, LLM } from '../modular.js';
|
|
9
|
+
|
|
10
|
+
import fs from 'fs';
|
|
11
|
+
import path from 'path';
|
|
12
|
+
import { fileURLToPath } from 'url';
|
|
13
|
+
|
|
14
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
15
|
+
const __dirname = path.dirname(__filename);
|
|
11
16
|
|
|
12
17
|
const DATA_FILE = path.join(__dirname, '..', 'data.json');
|
|
13
18
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* cultural, and symbolic meanings.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
import { SymbolCategory } from './base.js';
|
|
11
11
|
|
|
12
12
|
const archetypeSymbols = [
|
|
13
13
|
// ═══════════════════════════════════════════════════════════════════
|
|
@@ -473,6 +473,6 @@ const archetypeSymbols = [
|
|
|
473
473
|
}
|
|
474
474
|
];
|
|
475
475
|
|
|
476
|
-
|
|
477
|
-
|
|
476
|
+
export {
|
|
477
|
+
archetypeSymbols
|
|
478
478
|
};
|
package/core/symbols/base.js
CHANGED
package/core/symbols/elements.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* human symbolic expression.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
import { SymbolCategory } from './base.js';
|
|
11
11
|
|
|
12
12
|
const elementSymbols = [
|
|
13
13
|
// ═══════════════════════════════════════════════════════════════════
|
|
@@ -478,7 +478,7 @@ const abstractSymbols = [
|
|
|
478
478
|
}
|
|
479
479
|
];
|
|
480
480
|
|
|
481
|
-
|
|
481
|
+
export default {
|
|
482
482
|
elementSymbols,
|
|
483
483
|
placeSymbols,
|
|
484
484
|
objectSymbols,
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Fallback emoji equivalents are provided where possible.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
import { SymbolCategory } from './base.js';
|
|
14
14
|
|
|
15
15
|
const egyptianHieroglyphs = [
|
|
16
16
|
// ═══════════════════════════════════════════════════════════════════
|
|
@@ -298,6 +298,6 @@ const egyptianHieroglyphs = [
|
|
|
298
298
|
}
|
|
299
299
|
];
|
|
300
300
|
|
|
301
|
-
|
|
302
|
-
|
|
301
|
+
export {
|
|
302
|
+
egyptianHieroglyphs
|
|
303
303
|
};
|
package/core/symbols/iching.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* Unicode range: U+4DC0 to U+4DFF (Yijing Hexagram Symbols)
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
import { SymbolCategory } from './base.js';
|
|
13
13
|
|
|
14
14
|
const ichingHexagrams = [
|
|
15
15
|
// ═══════════════════════════════════════════════════════════════════
|
|
@@ -466,6 +466,6 @@ const ichingHexagrams = [
|
|
|
466
466
|
}
|
|
467
467
|
];
|
|
468
468
|
|
|
469
|
-
|
|
470
|
-
|
|
469
|
+
export {
|
|
470
|
+
ichingHexagrams
|
|
471
471
|
};
|
package/core/symbols/index.js
CHANGED
|
@@ -6,19 +6,19 @@
|
|
|
6
6
|
* by simply creating new files and importing them here.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
const { SymbolDatabase, SymbolCategory, PrimeGenerator } = require('./base');
|
|
10
|
-
|
|
11
9
|
// Import all symbol definition files
|
|
12
|
-
const { archetypeSymbols } = require('./archetypes');
|
|
13
|
-
const { tarotSymbols } = require('./tarot');
|
|
14
|
-
const { ichingHexagrams } = require('./iching');
|
|
15
|
-
const { egyptianHieroglyphs } = require('./hieroglyphs');
|
|
16
|
-
const { allElementSymbols } = require('./elements');
|
|
17
10
|
|
|
18
11
|
// ═══════════════════════════════════════════════════════════════════
|
|
19
12
|
// Create and populate the singleton database
|
|
20
13
|
// ═══════════════════════════════════════════════════════════════════
|
|
21
14
|
|
|
15
|
+
import { SymbolDatabase, SymbolCategory, PrimeGenerator } from './base.js';
|
|
16
|
+
import { archetypeSymbols } from './archetypes.js';
|
|
17
|
+
import { tarotSymbols } from './tarot.js';
|
|
18
|
+
import { ichingHexagrams } from './iching.js';
|
|
19
|
+
import { egyptianHieroglyphs } from './hieroglyphs.js';
|
|
20
|
+
import { allElementSymbols } from './elements.js';
|
|
21
|
+
|
|
22
22
|
let symbolDatabaseInstance = null;
|
|
23
23
|
|
|
24
24
|
function createSymbolDatabase() {
|
|
@@ -50,7 +50,18 @@ const symbolDatabase = createSymbolDatabase();
|
|
|
50
50
|
// Convenience exports
|
|
51
51
|
// ═══════════════════════════════════════════════════════════════════
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
// Convenience functions
|
|
54
|
+
const getSymbol = (id) => symbolDatabase.getSymbol(id);
|
|
55
|
+
const getSymbolByPrime = (prime) => symbolDatabase.getSymbolByPrime(prime);
|
|
56
|
+
const getSymbolsByCategory = (category) => symbolDatabase.getSymbolsByCategory(category);
|
|
57
|
+
const getSymbolsByTag = (tag) => symbolDatabase.getSymbolsByTag(tag);
|
|
58
|
+
const search = (query) => symbolDatabase.search(query);
|
|
59
|
+
const encode = (ids) => symbolDatabase.encode(ids);
|
|
60
|
+
const decode = (sig) => symbolDatabase.decode(sig);
|
|
61
|
+
const getAllSymbols = () => symbolDatabase.getAllSymbols();
|
|
62
|
+
const getStats = () => symbolDatabase.getStats();
|
|
63
|
+
|
|
64
|
+
export {
|
|
54
65
|
// Database instance and class
|
|
55
66
|
symbolDatabase,
|
|
56
67
|
SymbolDatabase,
|
|
@@ -65,13 +76,16 @@ module.exports = {
|
|
|
65
76
|
allElementSymbols,
|
|
66
77
|
|
|
67
78
|
// Convenience functions
|
|
68
|
-
getSymbol
|
|
69
|
-
getSymbolByPrime
|
|
70
|
-
getSymbolsByCategory
|
|
71
|
-
getSymbolsByTag
|
|
72
|
-
search
|
|
73
|
-
encode
|
|
74
|
-
decode
|
|
75
|
-
getAllSymbols
|
|
76
|
-
getStats
|
|
77
|
-
};
|
|
79
|
+
getSymbol,
|
|
80
|
+
getSymbolByPrime,
|
|
81
|
+
getSymbolsByCategory,
|
|
82
|
+
getSymbolsByTag,
|
|
83
|
+
search,
|
|
84
|
+
encode,
|
|
85
|
+
decode,
|
|
86
|
+
getAllSymbols,
|
|
87
|
+
getStats
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
// Default export for backward compatibility
|
|
91
|
+
export default symbolDatabase;
|
package/core/symbols/tarot.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* symbolic meaning from Kabbalistic, astrological, and esoteric traditions.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
import { SymbolCategory } from './base.js';
|
|
10
10
|
|
|
11
11
|
const tarotMajorArcana = [
|
|
12
12
|
// ═══════════════════════════════════════════════════════════════════
|
|
@@ -204,7 +204,7 @@ const tarotMinorSuits = [
|
|
|
204
204
|
}
|
|
205
205
|
];
|
|
206
206
|
|
|
207
|
-
|
|
207
|
+
export default {
|
|
208
208
|
tarotMajorArcana,
|
|
209
209
|
tarotMinorSuits,
|
|
210
210
|
tarotSymbols: [...tarotMajorArcana, ...tarotMinorSuits]
|