@aleph-ai/tinyaleph 1.4.4 → 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.
Files changed (68) hide show
  1. package/backends/bioinformatics/binding.js +44 -52
  2. package/backends/bioinformatics/dna-computing.js +14 -23
  3. package/backends/bioinformatics/encoding.js +22 -30
  4. package/backends/bioinformatics/folding.js +24 -32
  5. package/backends/bioinformatics/genetic-code.js +17 -21
  6. package/backends/bioinformatics/index.js +12 -12
  7. package/backends/bioinformatics/transcription.js +5 -3
  8. package/backends/bioinformatics/translation.js +6 -4
  9. package/backends/cryptographic/index.js +10 -9
  10. package/backends/index.js +7 -6
  11. package/backends/interface.js +4 -1
  12. package/backends/scientific/index.js +7 -4
  13. package/backends/semantic/index.js +7 -4
  14. package/backends/semantic/surface.js +2 -1
  15. package/backends/semantic/two-layer.js +5 -3
  16. package/core/beacon.js +10 -9
  17. package/core/compound.js +4 -4
  18. package/core/crt-homology.js +5 -5
  19. package/core/enochian-vocabulary.js +5 -17
  20. package/core/enochian.js +3 -2
  21. package/core/entanglement.js +7 -7
  22. package/core/errors.js +2 -10
  23. package/core/events.js +7 -6
  24. package/core/fano.js +7 -6
  25. package/core/hilbert.js +40 -34
  26. package/core/hypercomplex.js +4 -2
  27. package/core/index.js +42 -80
  28. package/core/inference.js +6 -6
  29. package/core/lambda.js +5 -18
  30. package/core/llm.js +1 -1
  31. package/core/logger.js +3 -4
  32. package/core/prime.js +26 -1
  33. package/core/quaternion-semantics.js +3 -3
  34. package/core/reduction.js +5 -21
  35. package/core/resonance.js +2 -1
  36. package/core/rformer-crt.js +15 -29
  37. package/core/rformer-layers.js +12 -14
  38. package/core/rformer-tf.js +34 -43
  39. package/core/rformer.js +17 -32
  40. package/core/sieve.js +8 -3
  41. package/core/symbols/archetypes.js +3 -3
  42. package/core/symbols/base.js +4 -4
  43. package/core/symbols/elements.js +2 -2
  44. package/core/symbols/hieroglyphs.js +3 -3
  45. package/core/symbols/iching.js +3 -3
  46. package/core/symbols/index.js +32 -18
  47. package/core/symbols/tarot.js +2 -2
  48. package/core/symbols.js +1 -0
  49. package/core/topology.js +3 -14
  50. package/core/types.js +3 -14
  51. package/engine/aleph.js +8 -6
  52. package/engine/index.js +4 -2
  53. package/index.js +3 -2
  54. package/modular.js +18 -41
  55. package/package.json +4 -2
  56. package/physics/collapse.js +10 -11
  57. package/physics/entropy.js +8 -8
  58. package/physics/index.js +70 -102
  59. package/physics/kuramoto-coupled-ladder.js +10 -14
  60. package/physics/kuramoto.js +5 -2
  61. package/physics/lyapunov.js +7 -7
  62. package/physics/oscillator.js +2 -1
  63. package/physics/primeon_z_ladder_multi.js +7 -9
  64. package/physics/primeon_z_ladder_u.js +8 -9
  65. package/physics/stochastic-kuramoto.js +7 -7
  66. package/physics/sync-models.js +11 -14
  67. package/telemetry/index.js +1 -1
  68. package/telemetry/metrics.js +3 -8
@@ -21,10 +21,6 @@
21
21
 
22
22
  'use strict';
23
23
 
24
- const { firstNPrimes, isPrime, factorize } = require('./prime');
25
- const { Complex, PrimeState } = require('./hilbert');
26
- const { SparsePrimeState, resonanceScore, Quaternion } = require('./rformer');
27
-
28
24
  // ============================================================================
29
25
  // MODULAR ARITHMETIC UTILITIES
30
26
  // ============================================================================
@@ -36,6 +32,10 @@ const { SparsePrimeState, resonanceScore, Quaternion } = require('./rformer');
36
32
  * @param {number} b - Second number
37
33
  * @returns {Object} { gcd, x, y }
38
34
  */
35
+ import { firstNPrimes, isPrime, factorize } from './prime.js';
36
+ import { Complex, PrimeState } from './hilbert.js';
37
+ import { SparsePrimeState, resonanceScore, Quaternion } from './rformer.js';
38
+
39
39
  function extendedGCD(a, b) {
40
40
  if (b === 0) {
41
41
  return { gcd: a, x: 1, y: 0 };
@@ -974,7 +974,7 @@ class CoprimeSelector {
974
974
  // EXPORTS
975
975
  // ============================================================================
976
976
 
977
- module.exports = {
977
+ export default {
978
978
  // Modular arithmetic utilities
979
979
  extendedGCD,
980
980
  modInverse,
@@ -15,8 +15,6 @@
15
15
  * for robust symbolic packets with geometric validity gates.
16
16
  */
17
17
 
18
- const { isPrime, nthPrime, firstNPrimes } = require('./prime');
19
-
20
18
  // ============================================================================
21
19
  // ENOCHIAN ALPHABET (21 Letters)
22
20
  // ============================================================================
@@ -25,6 +23,8 @@ const { isPrime, nthPrime, firstNPrimes } = require('./prime');
25
23
  * The Enochian alphabet consists of 21 letters, each mapped to a prime number.
26
24
  * The mapping follows the original Dee/Kelley system with prime assignments.
27
25
  */
26
+ import { isPrime, nthPrime, firstNPrimes } from './prime.js';
27
+
28
28
  const ENOCHIAN_ALPHABET = [
29
29
  { letter: 'A', name: 'Un', prime: 2, meaning: 'Beginning', phonetic: 'ah' },
30
30
  { letter: 'B', name: 'Pa', prime: 3, meaning: 'Father', phonetic: 'beh' },
@@ -874,37 +874,25 @@ class EnochianEngine {
874
874
  // EXPORTS
875
875
  // ============================================================================
876
876
 
877
- module.exports = {
878
- // Alphabet
877
+ export {
879
878
  ENOCHIAN_ALPHABET,
880
879
  letterToPrime,
881
880
  primeToLetter,
882
881
  letterToData,
883
-
884
- // Prime Basis
885
882
  PRIME_BASIS,
886
883
  BASIS_MEANINGS,
887
-
888
- // Twist Operations
889
884
  TWIST_MODES,
890
885
  twistAngle,
891
886
  twistRadians,
892
887
  TwistOperator,
893
888
  validateTwistClosure,
894
-
895
- // Words
896
889
  EnochianWord,
897
890
  CORE_VOCABULARY,
898
891
  wordLookup,
899
-
900
- // Calls
901
892
  EnochianCall,
902
893
  THE_NINETEEN_CALLS,
903
-
904
- // Sedenions
905
894
  SedenionElement,
906
895
  sedenionMultTable,
907
-
908
- // Engine
909
896
  EnochianEngine
910
- };
897
+ };
898
+ export default { ENOCHIAN_ALPHABET, letterToPrime, primeToLetter, letterToData, PRIME_BASIS, BASIS_MEANINGS, TWIST_MODES, twistAngle, twistRadians, TwistOperator, validateTwistClosure, EnochianWord, CORE_VOCABULARY, wordLookup, EnochianCall, THE_NINETEEN_CALLS, SedenionElement, sedenionMultTable, EnochianEngine };
package/core/enochian.js CHANGED
@@ -21,7 +21,8 @@
21
21
  */
22
22
 
23
23
  // Import the comprehensive Enochian vocabulary system
24
- const EnochianVocabulary = require('./enochian-vocabulary');
24
+
25
+ import EnochianVocabulary from './enochian-vocabulary.js';
25
26
 
26
27
  /**
27
28
  * Enochian prime alphabet (Section 7.4)
@@ -703,7 +704,7 @@ class EnhancedEnochianDecoder extends EnochianDecoder {
703
704
  }
704
705
  }
705
706
 
706
- module.exports = {
707
+ export default {
707
708
  // Constants
708
709
  ENOCHIAN_PRIMES,
709
710
  MODES,
@@ -18,11 +18,12 @@
18
18
 
19
19
  'use strict';
20
20
 
21
- const { isPrime, firstNPrimes } = require('./prime');
22
-
23
21
  /**
24
22
  * Edge data for entanglement between two primes
25
23
  */
24
+ import { NetworkKuramoto } from '../physics/sync-models.js';
25
+ import { isPrime, firstNPrimes } from './prime.js';
26
+
26
27
  class EntanglementEdge {
27
28
  constructor(source, target) {
28
29
  this.source = source;
@@ -506,7 +507,6 @@ class PrimeEntanglementGraph {
506
507
  */
507
508
  toNetworkKuramoto(frequencies, coupling = 0.3) {
508
509
  // Import dynamically to avoid circular dependency
509
- const { NetworkKuramoto } = require('../physics/sync-models');
510
510
 
511
511
  const primeOrder = Array.from(this.primes).sort((a, b) => a - b);
512
512
  const adjacency = this.toAdjacencyMatrix(primeOrder);
@@ -705,8 +705,8 @@ function createEntanglementGraph(config = {}) {
705
705
  });
706
706
  }
707
707
 
708
- module.exports = {
709
- EntanglementEdge,
710
- PrimeEntanglementGraph,
711
- createEntanglementGraph
708
+ export {
709
+ EntanglementEdge,
710
+ PrimeEntanglementGraph,
711
+ createEntanglementGraph
712
712
  };
package/core/errors.js CHANGED
@@ -13,6 +13,7 @@
13
13
  */
14
14
 
15
15
  // Simple EventEmitter that works in both browser and Node.js
16
+
16
17
  class SimpleEventEmitter {
17
18
  constructor() {
18
19
  this._events = new Map();
@@ -561,26 +562,17 @@ function withTimeout(promise, timeout, operation = 'operation') {
561
562
  // EXPORTS
562
563
  // ============================================================================
563
564
 
564
- module.exports = {
565
- // Levels and categories
565
+ export {
566
566
  LogLevel,
567
567
  LogLevelNames,
568
568
  ErrorCategory,
569
-
570
- // Error classes
571
569
  AlephError,
572
570
  NetworkError,
573
571
  LLMError,
574
572
  ValidationError,
575
573
  TimeoutError,
576
-
577
- // Event emitter (browser-compatible)
578
574
  SimpleEventEmitter,
579
-
580
- // Error handler
581
575
  ErrorHandler,
582
-
583
- // Utilities
584
576
  withErrorHandling,
585
577
  errorBoundary,
586
578
  withTimeout
package/core/events.js CHANGED
@@ -26,6 +26,7 @@
26
26
  *
27
27
  * Compatible with Node.js EventEmitter pattern but standalone.
28
28
  */
29
+
29
30
  class AlephEventEmitter {
30
31
  constructor(options = {}) {
31
32
  this._listeners = new Map();
@@ -898,10 +899,10 @@ function createMonitor(engine, options = {}) {
898
899
  return new AlephMonitor(engine, options);
899
900
  }
900
901
 
901
- module.exports = {
902
- AlephEventEmitter,
903
- AlephMonitor,
904
- EvolutionStream,
905
- createEvolutionStream,
906
- createMonitor
902
+ export {
903
+ AlephEventEmitter,
904
+ AlephMonitor,
905
+ EvolutionStream,
906
+ createEvolutionStream,
907
+ createMonitor
907
908
  };
package/core/fano.js CHANGED
@@ -3,6 +3,7 @@
3
3
  */
4
4
 
5
5
  // Standard Fano plane lines (7 lines of 3 points each)
6
+
6
7
  const FANO_LINES = [
7
8
  [1, 2, 3],
8
9
  [1, 4, 5],
@@ -118,10 +119,10 @@ function buildMultiplicationTable(dim) {
118
119
  return table;
119
120
  }
120
121
 
121
- module.exports = {
122
- FANO_LINES,
123
- octonionMultiplyIndex,
124
- sedenionMultiplyIndex,
125
- multiplyIndices,
126
- buildMultiplicationTable
122
+ export {
123
+ FANO_LINES,
124
+ octonionMultiplyIndex,
125
+ sedenionMultiplyIndex,
126
+ multiplyIndices,
127
+ buildMultiplicationTable
127
128
  };
package/core/hilbert.js CHANGED
@@ -13,11 +13,11 @@
13
13
  * - Resonance operators (P̂, F̂, R̂, Ĉ)
14
14
  */
15
15
 
16
- const { isPrime, firstNPrimes, factorize } = require('./prime');
17
-
18
16
  /**
19
17
  * Complex number class for amplitudes
20
18
  */
19
+ import { factorize, isPrime, firstNPrimes } from './prime.js';
20
+
21
21
  class Complex {
22
22
  constructor(re = 0, im = 0) {
23
23
  this.re = re;
@@ -995,26 +995,7 @@ class ResonantFragment {
995
995
  }
996
996
  }
997
997
 
998
- module.exports = {
999
- Complex,
1000
- PrimeState,
1001
- ResonanceOperators,
1002
- EntropyDrivenEvolution,
1003
- encodeMemory,
1004
- symbolicCompute,
1005
-
1006
- // New classes
1007
- QuaternionPrime,
1008
- PrimeResonanceIdentity,
1009
- PhaseLockedRing,
1010
- HolographicField,
1011
- EntangledNode,
1012
- ResonantFragment,
1013
-
1014
- // Constants
1015
- PHI,
1016
- DELTA_S
1017
- };
998
+ // Legacy CommonJS export removed - ESM exports at end of file
1018
999
 
1019
1000
  // ============================================================================
1020
1001
  // P-ADIC COHERENCE (from Quantum_Semantics paper)
@@ -1132,7 +1113,6 @@ function pAdicCoherence(state1, state2, primes = [2, 3, 5]) {
1132
1113
  function mobiusFunction(n) {
1133
1114
  if (n === 1) return 1;
1134
1115
 
1135
- const { factorize } = require('./prime');
1136
1116
  const factors = factorize(n);
1137
1117
 
1138
1118
  // Check for squared factors
@@ -1157,7 +1137,6 @@ function mobiusFunction(n) {
1157
1137
  function eulerTotient(n) {
1158
1138
  if (n === 1) return 1;
1159
1139
 
1160
- const { factorize } = require('./prime');
1161
1140
  const factors = factorize(n);
1162
1141
 
1163
1142
  let result = n;
@@ -1655,13 +1634,40 @@ class SemanticPatternDetector {
1655
1634
  }
1656
1635
  }
1657
1636
 
1658
- // Export new classes and functions
1659
- module.exports.pAdicNorm = pAdicNorm;
1660
- module.exports.pAdicValuation = pAdicValuation;
1661
- module.exports.pAdicCoherence = pAdicCoherence;
1662
- module.exports.mobiusFunction = mobiusFunction;
1663
- module.exports.eulerTotient = eulerTotient;
1664
- module.exports.ExtendedOperators = ExtendedOperators;
1665
- module.exports.KnowledgeResonanceCalculator = KnowledgeResonanceCalculator;
1666
- module.exports.FibonacciWaveletBank = FibonacciWaveletBank;
1667
- module.exports.SemanticPatternDetector = SemanticPatternDetector;
1637
+ // Export all classes and functions
1638
+ export {
1639
+ // Core classes
1640
+ Complex,
1641
+ PrimeState,
1642
+ ResonanceOperators,
1643
+ EntropyDrivenEvolution,
1644
+ encodeMemory,
1645
+ symbolicCompute,
1646
+
1647
+ // Extended classes
1648
+ QuaternionPrime,
1649
+ PrimeResonanceIdentity,
1650
+ PhaseLockedRing,
1651
+ HolographicField,
1652
+ EntangledNode,
1653
+ ResonantFragment,
1654
+
1655
+ // Constants
1656
+ PHI,
1657
+ DELTA_S,
1658
+
1659
+ // P-adic functions
1660
+ pAdicNorm,
1661
+ pAdicValuation,
1662
+ pAdicCoherence,
1663
+
1664
+ // Number theory functions
1665
+ mobiusFunction,
1666
+ eulerTotient,
1667
+
1668
+ // Extended operators and calculators
1669
+ ExtendedOperators,
1670
+ KnowledgeResonanceCalculator,
1671
+ FibonacciWaveletBank,
1672
+ SemanticPatternDetector
1673
+ };
@@ -9,7 +9,7 @@
9
9
  * Dimension 32: Pathions (further structure loss)
10
10
  */
11
11
 
12
- const { multiplyIndices } = require('./fano');
12
+ import { multiplyIndices } from './fano.js';
13
13
 
14
14
  class Hypercomplex {
15
15
  constructor(dim, components = null) {
@@ -638,4 +638,6 @@ class Hypercomplex {
638
638
  }
639
639
  }
640
640
 
641
- module.exports = { Hypercomplex };
641
+ export {
642
+ Hypercomplex
643
+ };
package/core/index.js CHANGED
@@ -2,11 +2,10 @@
2
2
  * Core mathematical foundation - exports all core modules
3
3
  */
4
4
 
5
- const { Hypercomplex } = require('./hypercomplex');
6
-
7
5
  // CRT-Homology Module (Chinese Remainder Theorem + Birkhoff Attention + Homology Loss)
8
- const {
9
- extendedGCD,
6
+ import { Hypercomplex } from './hypercomplex.js';
7
+
8
+ import { extendedGCD,
10
9
  modInverse,
11
10
  areCoprime,
12
11
  softmax,
@@ -21,59 +20,47 @@ const {
21
20
  createFusedAttention,
22
21
  DEFAULT_PRIMES_SMALL,
23
22
  DEFAULT_PRIMES_MEDIUM,
24
- DEFAULT_PRIMES_SEMANTIC
25
- } = require('./crt-homology');
23
+ DEFAULT_PRIMES_SEMANTIC } from './crt-homology.js';
26
24
 
27
25
  // Formal Type System (mtspbc.pdf implementation)
28
- const {
29
- NounType, AdjType, SentenceType,
26
+ import { NounType, AdjType, SentenceType,
30
27
  NounTerm, AdjTerm, ChainTerm, FusionTerm,
31
28
  NounSentence, SeqSentence, ImplSentence,
32
29
  TypingContext, TypingJudgment, TypeChecker,
33
- N, A, FUSE, CHAIN, SENTENCE, SEQ, IMPL
34
- } = require('./types');
30
+ N, A, FUSE, CHAIN, SENTENCE, SEQ, IMPL } from './types.js';
35
31
 
36
32
  // Reduction Semantics (ncpsc.pdf implementation)
37
- const {
38
- PrimeOperator, NextPrimeOperator, ModularPrimeOperator,
33
+ import { PrimeOperator, NextPrimeOperator, ModularPrimeOperator,
39
34
  ResonancePrimeOperator, IdentityPrimeOperator, DEFAULT_OPERATOR,
40
35
  ReductionStep, ReductionTrace, ReductionSystem,
41
36
  isNormalForm, isReducible, termSize,
42
37
  FusionCanonicalizer, NormalFormVerifier,
43
- demonstrateStrongNormalization, testLocalConfluence
44
- } = require('./reduction');
38
+ demonstrateStrongNormalization, testLocalConfluence } from './reduction.js';
45
39
 
46
40
  // Lambda Calculus Translation (Section 4 from mtspbc.pdf)
47
- const {
48
- LambdaExpr, VarExpr, ConstExpr, LamExpr, AppExpr,
41
+ import { LambdaExpr, VarExpr, ConstExpr, LamExpr, AppExpr,
49
42
  PairExpr, ImplExpr, PrimOpExpr,
50
43
  Translator, TypeDirectedTranslator,
51
- LambdaEvaluator, Semantics, ConceptInterpreter
52
- } = require('./lambda');
44
+ LambdaEvaluator, Semantics, ConceptInterpreter } from './lambda.js';
53
45
 
54
46
  // Enochian Packet Layer (Section 7.4)
55
- const enochian = require('./enochian');
56
- const enochianVocabulary = require('./enochian-vocabulary');
47
+ import enochian from './enochian.js';
48
+ import enochianVocabulary from './enochian-vocabulary.js';
57
49
 
58
- const {
59
- FANO_LINES,
50
+ import { FANO_LINES,
60
51
  octonionMultiplyIndex,
61
52
  sedenionMultiplyIndex,
62
53
  multiplyIndices,
63
- buildMultiplicationTable
64
- } = require('./fano');
65
- const {
66
- primeGenerator, nthPrime, primesUpTo, isPrime,
54
+ buildMultiplicationTable } from './fano.js';
55
+ import { primeGenerator, nthPrime, primesUpTo, isPrime,
67
56
  factorize, primeSignature, firstNPrimes,
68
57
  GaussianInteger, EisensteinInteger,
69
58
  primeToFrequency, primeToAngle, sumOfTwoSquares,
70
- DEFAULT_PRIMES
71
- } = require('./prime');
72
- const LLM = require('./llm');
59
+ DEFAULT_PRIMES } from './prime.js';
60
+ import LLM from './llm.js';
73
61
 
74
62
  // Prime Hilbert Space (complex amplitudes, quantum-like)
75
- const {
76
- Complex,
63
+ import { Complex,
77
64
  PrimeState,
78
65
  ResonanceOperators,
79
66
  EntropyDrivenEvolution,
@@ -85,12 +72,10 @@ const {
85
72
  HolographicField,
86
73
  EntangledNode,
87
74
  ResonantFragment,
88
- DELTA_S
89
- } = require('./hilbert');
75
+ DELTA_S } from './hilbert.js';
90
76
 
91
77
  // Golden Ratio Resonance (from symprime symbolic AI)
92
- const {
93
- ResonanceCalculator,
78
+ import { ResonanceCalculator,
94
79
  resonanceSignature,
95
80
  findFibonacciSequences,
96
81
  PHI,
@@ -98,25 +83,21 @@ const {
98
83
  PHI_BONUS,
99
84
  calculateResonance,
100
85
  findGoldenPairs,
101
- findMostResonant
102
- } = require('./resonance');
86
+ findMostResonant } from './resonance.js';
103
87
 
104
88
  // Symbol Database (200+ emoji symbols from symprime)
105
- const {
106
- SymbolDatabase,
89
+ import { SymbolDatabase,
107
90
  SymbolCategory,
108
91
  PrimeGenerator,
109
92
  symbolDatabase,
110
93
  getSymbol,
111
94
  getSymbolByPrime,
112
- search: searchSymbols,
113
- encode: encodeSymbols,
114
- decode: decodeSymbols
115
- } = require('./symbols');
95
+ search as searchSymbols,
96
+ encode as encodeSymbols,
97
+ decode as decodeSymbols } from './symbols/index.js';
116
98
 
117
99
  // Semantic Inference Engine (from symprime)
118
- const {
119
- SemanticInference,
100
+ import { SemanticInference,
120
101
  EntityExtractor,
121
102
  InferenceMethod,
122
103
  semanticInference,
@@ -126,12 +107,10 @@ const {
126
107
  extractEntities,
127
108
  extractAndInfer,
128
109
  inferWithResonance,
129
- inferMostResonant
130
- } = require('./inference');
110
+ inferMostResonant } from './inference.js';
131
111
 
132
112
  // Compound Builder (multi-symbol concepts from symprime)
133
- const {
134
- CompoundBuilder,
113
+ import { CompoundBuilder,
135
114
  CompoundSymbol,
136
115
  SymbolSequence,
137
116
  compoundBuilder,
@@ -139,12 +118,10 @@ const {
139
118
  getCompound,
140
119
  createSequence,
141
120
  getSequence,
142
- findCompoundsContaining
143
- } = require('./compound');
121
+ findCompoundsContaining } from './compound.js';
144
122
 
145
123
  // ResoFormer ML primitives
146
- const {
147
- Quaternion,
124
+ import { Quaternion,
148
125
  SparsePrimeState,
149
126
  resonanceScore,
150
127
  resonantAttention,
@@ -156,52 +133,40 @@ const {
156
133
  EntropyCollapseHead,
157
134
  generateAttractorCodebook,
158
135
  PRGraphMemory,
159
- applyResonanceOperator
160
- } = require('./rformer');
136
+ applyResonanceOperator } from './rformer.js';
161
137
 
162
138
  // ResoFormer complete layers
163
- const {
164
- ResonantMultiHeadAttention,
139
+ import { ResonantMultiHeadAttention,
165
140
  PrimeFFN,
166
141
  PrimeLayerNorm,
167
142
  PositionalPrimeEncoding,
168
143
  ResoFormerBlock,
169
- ResoFormer
170
- } = require('./rformer-layers');
144
+ ResoFormer } from './rformer-layers.js';
171
145
 
172
146
  // CRT-enhanced ResoFormer layers
173
- const {
174
- CRTResonantAttention,
147
+ import { CRTResonantAttention,
175
148
  HomologyRegularizedBlock,
176
149
  CRTResoFormer,
177
- createCRTResoFormer
178
- } = require('./rformer-crt');
150
+ createCRTResoFormer } from './rformer-crt.js';
179
151
 
180
152
  // Prime Entanglement Graph
181
- const {
182
- EntanglementEdge,
153
+ import { EntanglementEdge,
183
154
  PrimeEntanglementGraph,
184
- createEntanglementGraph
185
- } = require('./entanglement');
155
+ createEntanglementGraph } from './entanglement.js';
186
156
 
187
157
  // Event system and streaming
188
- const {
189
- AlephEventEmitter,
158
+ import { AlephEventEmitter,
190
159
  AlephMonitor,
191
160
  EvolutionStream,
192
161
  createEvolutionStream,
193
- createMonitor
194
- } = require('./events');
162
+ createMonitor } from './events.js';
195
163
 
196
164
  // TensorFlow.js layers (lazy load - may not be available)
197
165
  let rformerTF = null;
198
- try {
199
- rformerTF = require('./rformer-tf');
200
- } catch (e) {
201
- // TensorFlow.js not available, skip
202
- }
166
+ // Dynamic import for optional TensorFlow.js support
167
+ // Use: const tf = await import('./rformer-tf.js') when needed
203
168
 
204
- module.exports = {
169
+ export default {
205
170
  // Hypercomplex algebra
206
171
  Hypercomplex,
207
172
 
@@ -328,9 +293,6 @@ module.exports = {
328
293
  createEvolutionStream,
329
294
  createMonitor,
330
295
 
331
- // TensorFlow.js ResoFormer layers (if available)
332
- ...(rformerTF || {}),
333
-
334
296
  // Formal Type System (mtspbc.pdf)
335
297
  NounType,
336
298
  AdjType,
package/core/inference.js CHANGED
@@ -13,14 +13,15 @@
13
13
  * Enhanced with resonance attention from tinyaleph's rformer.
14
14
  */
15
15
 
16
- const { symbolDatabase, SymbolCategory } = require('./symbols');
17
- const { SparsePrimeState, resonanceScore, resonantAttention } = require('./rformer');
18
- const { ResonanceCalculator } = require('./resonance');
19
-
20
16
  // ═══════════════════════════════════════════════════════════════════
21
17
  // Inference Result Types
22
18
  // ═══════════════════════════════════════════════════════════════════
23
19
 
20
+ import { Complex } from './hilbert.js';
21
+ import { symbolDatabase, SymbolCategory } from './symbols.js';
22
+ import { SparsePrimeState, resonanceScore, resonantAttention } from './rformer.js';
23
+ import { ResonanceCalculator } from './resonance.js';
24
+
24
25
  const InferenceMethod = {
25
26
  DIRECT: 'direct', // Exact match in database
26
27
  REGEX: 'regex', // Pattern rule match
@@ -315,7 +316,6 @@ class SemanticInference {
315
316
  * Convert a symbol to SparsePrimeState for resonance calculations
316
317
  */
317
318
  symbolToState(symbol) {
318
- const { Complex } = require('./hilbert');
319
319
  const state = new SparsePrimeState(4096, 8);
320
320
 
321
321
  // Primary prime activation
@@ -584,7 +584,7 @@ class EntityExtractor {
584
584
  const defaultInference = new SemanticInference();
585
585
  const defaultExtractor = new EntityExtractor();
586
586
 
587
- module.exports = {
587
+ export default {
588
588
  SemanticInference,
589
589
  EntityExtractor,
590
590
  InferenceMethod,
package/core/lambda.js CHANGED
@@ -16,21 +16,17 @@
16
16
  * - S₁ ⇒ S₂ → τ(S₁) → τ(S₂)
17
17
  */
18
18
 
19
- const {
20
- NounTerm,
19
+ import { NounTerm,
21
20
  AdjTerm,
22
21
  ChainTerm,
23
22
  FusionTerm,
24
23
  NounSentence,
25
24
  SeqSentence,
26
25
  ImplSentence,
27
- N, A, FUSE, CHAIN
28
- } = require('./types');
26
+ N, A, FUSE, CHAIN } from './types.js';
29
27
 
30
- const {
31
- ReductionSystem,
32
- DEFAULT_OPERATOR
33
- } = require('./reduction');
28
+ import { ReductionSystem,
29
+ DEFAULT_OPERATOR } from './reduction.js';
34
30
 
35
31
  // ============================================================================
36
32
  // λ-EXPRESSION AST
@@ -1068,8 +1064,7 @@ class TypeDirectedTranslator extends Translator {
1068
1064
  // EXPORTS
1069
1065
  // ============================================================================
1070
1066
 
1071
- module.exports = {
1072
- // Lambda expressions
1067
+ export {
1073
1068
  LambdaExpr,
1074
1069
  VarExpr,
1075
1070
  ConstExpr,
@@ -1078,19 +1073,11 @@ module.exports = {
1078
1073
  PairExpr,
1079
1074
  ImplExpr,
1080
1075
  PrimOpExpr,
1081
-
1082
- // Translator
1083
1076
  Translator,
1084
1077
  TypeDirectedTranslator,
1085
-
1086
- // Evaluator
1087
1078
  LambdaEvaluator,
1088
-
1089
- // Semantics
1090
1079
  Semantics,
1091
1080
  ConceptInterpreter,
1092
-
1093
- // PRQS Lexicon (from TriadicPrimeFusion paper)
1094
1081
  PRQS_LEXICON,
1095
1082
  classifyPrime
1096
1083
  };