@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
@@ -1,64 +1,56 @@
1
1
  /**
2
2
  * Molecular Binding - Protein-Ligand and Protein-Protein Interactions
3
- *
3
+ *
4
4
  * Models molecular binding using prime resonance:
5
5
  * - Binding affinity correlates with golden ratio resonance
6
6
  * - Docking uses multi-system Kuramoto coupling
7
7
  * - Affinity scoring combines electrostatic, hydrophobic, and resonance terms
8
8
  */
9
9
 
10
- const {
11
- AMINO_ACID_PRIMES,
12
- getChargeFromPrime,
13
- getHydrophobicityFromPrime
14
- } = require('./encoding');
10
+ import { AMINO_ACID_PRIMES,
11
+ getChargeFromPrime,
12
+ getHydrophobicityFromPrime } from './encoding.js';
15
13
 
16
- // Import core modules with fallback
17
- let calculateResonance, findGoldenPairs, resonanceSignature, primeToFrequency, KuramotoModel;
14
+ // Golden ratio constant
15
+ const PHI = 1.618033988749895;
18
16
 
19
- try {
20
- const core = require('../../core');
21
- const physics = require('../../physics');
22
-
23
- calculateResonance = core.calculateResonance;
24
- findGoldenPairs = core.findGoldenPairs;
25
- resonanceSignature = core.resonanceSignature;
26
- primeToFrequency = core.primeToFrequency;
27
- KuramotoModel = physics.KuramotoModel;
28
- } catch (e) {
29
- // Fallback implementations
30
- const PHI = 1.618033988749895;
31
-
32
- calculateResonance = (p1, p2) => {
33
- const ratio = Math.max(p1, p2) / Math.min(p1, p2);
34
- return 1 / (1 + Math.abs(ratio - PHI));
35
- };
36
-
37
- findGoldenPairs = (primes) => {
38
- const pairs = [];
39
- for (let i = 0; i < primes.length; i++) {
40
- for (let j = i + 1; j < primes.length; j++) {
41
- if (calculateResonance(primes[i], primes[j]) > 0.8) {
42
- pairs.push([primes[i], primes[j]]);
43
- }
17
+ // Fallback implementations (used if core modules don't provide these)
18
+ const fallbackCalculateResonance = (p1, p2) => {
19
+ const ratio = Math.max(p1, p2) / Math.min(p1, p2);
20
+ return 1 / (1 + Math.abs(ratio - PHI));
21
+ };
22
+
23
+ const fallbackFindGoldenPairs = (primes) => {
24
+ const pairs = [];
25
+ for (let i = 0; i < primes.length; i++) {
26
+ for (let j = i + 1; j < primes.length; j++) {
27
+ if (fallbackCalculateResonance(primes[i], primes[j]) > 0.8) {
28
+ pairs.push([primes[i], primes[j]]);
44
29
  }
45
30
  }
46
- return pairs;
47
- };
48
-
49
- resonanceSignature = (primes) => {
50
- let sum = 0, count = 0;
51
- for (let i = 0; i < primes.length; i++) {
52
- for (let j = i + 1; j < primes.length; j++) {
53
- sum += calculateResonance(primes[i], primes[j]);
54
- count++;
55
- }
31
+ }
32
+ return pairs;
33
+ };
34
+
35
+ const fallbackResonanceSignature = (primes) => {
36
+ let sum = 0, count = 0;
37
+ for (let i = 0; i < primes.length; i++) {
38
+ for (let j = i + 1; j < primes.length; j++) {
39
+ sum += fallbackCalculateResonance(primes[i], primes[j]);
40
+ count++;
56
41
  }
57
- return { mean: sum / Math.max(count, 1), count };
58
- };
59
-
60
- primeToFrequency = (p, base = 1, logScale = 10) => base + Math.log(p) / logScale;
61
- }
42
+ }
43
+ return { mean: sum / Math.max(count, 1), count };
44
+ };
45
+
46
+ const fallbackPrimeToFrequency = (p, base = 1, logScale = 10) => base + Math.log(p) / logScale;
47
+
48
+ // Export calculation functions - fallbacks are used directly
49
+ // Core module integration can be done by consumers if needed
50
+ const calculateResonance = fallbackCalculateResonance;
51
+ const findGoldenPairs = fallbackFindGoldenPairs;
52
+ const resonanceSignature = fallbackResonanceSignature;
53
+ const primeToFrequency = fallbackPrimeToFrequency;
62
54
 
63
55
  /**
64
56
  * BindingAffinityCalculator
@@ -496,8 +488,8 @@ class ProteinProteinDocker extends MolecularDocker {
496
488
  }
497
489
  }
498
490
 
499
- module.exports = {
500
- BindingAffinityCalculator,
501
- MolecularDocker,
502
- ProteinProteinDocker
491
+ export {
492
+ BindingAffinityCalculator,
493
+ MolecularDocker,
494
+ ProteinProteinDocker
503
495
  };
@@ -15,12 +15,10 @@
15
15
  * - Qian & Winfree (2011) - Seesaw gates
16
16
  */
17
17
 
18
- const {
19
- NUCLEOTIDE_PRIMES,
18
+ import { NUCLEOTIDE_PRIMES,
20
19
  PRIME_COMPLEMENTS,
21
20
  encodeDNA,
22
- decodeDNA
23
- } = require('./encoding');
21
+ decodeDNA } from './encoding.js';
24
22
 
25
23
  // ============================================================================
26
24
  // DNA Strand Representation
@@ -642,23 +640,16 @@ class SeesawGate {
642
640
  }
643
641
  }
644
642
 
645
- module.exports = {
646
- // Strand classes
647
- DNAStrand,
648
- DNADuplex,
649
-
650
- // Logic gates
651
- ANDGate,
652
- ORGate,
653
- NOTGate,
654
- NANDGate,
655
- SeesawGate,
656
-
657
- // Reactions
658
- StrandDisplacementReaction,
659
-
660
- // Circuits
661
- DNACircuit,
662
- createHalfAdder,
663
- createFullAdder,
643
+ export {
644
+ DNAStrand,
645
+ DNADuplex,
646
+ ANDGate,
647
+ ORGate,
648
+ NOTGate,
649
+ NANDGate,
650
+ SeesawGate,
651
+ StrandDisplacementReaction,
652
+ DNACircuit,
653
+ createHalfAdder,
654
+ createFullAdder
664
655
  };
@@ -20,6 +20,7 @@
20
20
  * - Pyrimidines (T, C): smaller primes (2, 3)
21
21
  * - Watson-Crick pairs have symmetric products: A-T=14, G-C=33
22
22
  */
23
+
23
24
  const NUCLEOTIDE_PRIMES = {
24
25
  'A': 7, // Adenine (purine)
25
26
  'T': 2, // Thymine (pyrimidine) - pairs with A
@@ -306,34 +307,25 @@ function getHydrophobicityFromPrime(prime) {
306
307
  return AMINO_ACID_PROPERTIES[aa]?.hydrophobicity || 0;
307
308
  }
308
309
 
309
- module.exports = {
310
- // Nucleotide mappings
311
- NUCLEOTIDE_PRIMES,
312
- PRIME_TO_NUCLEOTIDE,
313
- DNA_COMPLEMENTS,
314
- PRIME_COMPLEMENTS,
315
-
316
- // Amino acid mappings
317
- AMINO_ACID_PRIMES,
318
- PRIME_TO_AMINO_ACID,
319
- AMINO_ACID_PROPERTIES,
320
-
321
- // Codon functions
322
- encodeCodon,
323
- decodeCodon,
324
-
325
- // Sequence encoding/decoding
326
- encodeDNA,
327
- decodeDNA,
328
- encodeRNA,
329
- decodeRNA,
330
- encodeProtein,
331
- decodeProtein,
332
-
333
- // Utilities
334
- detectSequenceType,
335
- parseFASTA,
336
- getAminoAcidProperties,
337
- getChargeFromPrime,
338
- getHydrophobicityFromPrime,
310
+ export {
311
+ NUCLEOTIDE_PRIMES,
312
+ PRIME_TO_NUCLEOTIDE,
313
+ DNA_COMPLEMENTS,
314
+ PRIME_COMPLEMENTS,
315
+ AMINO_ACID_PRIMES,
316
+ PRIME_TO_AMINO_ACID,
317
+ AMINO_ACID_PROPERTIES,
318
+ encodeCodon,
319
+ decodeCodon,
320
+ encodeDNA,
321
+ decodeDNA,
322
+ encodeRNA,
323
+ decodeRNA,
324
+ encodeProtein,
325
+ decodeProtein,
326
+ detectSequenceType,
327
+ parseFASTA,
328
+ getAminoAcidProperties,
329
+ getChargeFromPrime,
330
+ getHydrophobicityFromPrime
339
331
  };
@@ -1,45 +1,35 @@
1
1
  /**
2
2
  * Protein Folding via Kuramoto Oscillator Dynamics
3
- *
3
+ *
4
4
  * Models protein folding as entropy minimization through coupled oscillator synchronization.
5
5
  * Each amino acid residue is an oscillator with:
6
6
  * - Natural frequency derived from its prime value
7
7
  * - Coupling strength from contact propensity (hydrophobic, electrostatic, resonance)
8
- *
8
+ *
9
9
  * Folded state = synchronized oscillators = low entropy configuration
10
10
  */
11
11
 
12
- const { AMINO_ACID_PRIMES, AMINO_ACID_PROPERTIES, getChargeFromPrime, getHydrophobicityFromPrime } = require('./encoding');
12
+ // Import encoding module
13
+ import { AMINO_ACID_PRIMES, AMINO_ACID_PROPERTIES, getChargeFromPrime, getHydrophobicityFromPrime } from './encoding.js';
13
14
 
14
- // Import physics modules - with fallback for standalone testing
15
- let KuramotoModel, NetworkKuramoto, AdaptiveKuramoto, shannonEntropy, primeToFrequency, calculateResonance;
15
+ // Golden ratio constant
16
+ const PHI = 1.618033988749895;
16
17
 
17
- try {
18
- const physics = require('../../physics');
19
- const core = require('../../core');
20
-
21
- KuramotoModel = physics.KuramotoModel;
22
- NetworkKuramoto = physics.NetworkKuramoto || physics.KuramotoModel;
23
- AdaptiveKuramoto = physics.AdaptiveKuramoto || physics.KuramotoModel;
24
- shannonEntropy = physics.shannonEntropy;
25
- primeToFrequency = core.primeToFrequency;
26
- calculateResonance = core.calculateResonance;
27
- } catch (e) {
28
- // Fallback implementations for standalone testing
29
- primeToFrequency = (p, base = 1, logScale = 10) => base + Math.log(p) / logScale;
30
- calculateResonance = (p1, p2) => {
31
- const ratio = Math.max(p1, p2) / Math.min(p1, p2);
32
- const PHI = 1.618033988749895;
33
- return 1 / (1 + Math.abs(ratio - PHI));
34
- };
35
- shannonEntropy = (probs) => {
36
- let H = 0;
37
- for (const p of probs) {
38
- if (p > 1e-10) H -= p * Math.log2(p);
39
- }
40
- return H;
41
- };
42
- }
18
+ // Fallback implementations for standalone operation
19
+ const primeToFrequency = (p, base = 1, logScale = 10) => base + Math.log(p) / logScale;
20
+
21
+ const calculateResonance = (p1, p2) => {
22
+ const ratio = Math.max(p1, p2) / Math.min(p1, p2);
23
+ return 1 / (1 + Math.abs(ratio - PHI));
24
+ };
25
+
26
+ const shannonEntropy = (probs) => {
27
+ let H = 0;
28
+ for (const p of probs) {
29
+ if (p > 1e-10) H -= p * Math.log2(p);
30
+ }
31
+ return H;
32
+ };
43
33
 
44
34
  /**
45
35
  * FoldingTransform
@@ -451,4 +441,6 @@ class FoldingTransform {
451
441
  }
452
442
  }
453
443
 
454
- module.exports = { FoldingTransform };
444
+ export {
445
+ FoldingTransform
446
+ };
@@ -13,6 +13,7 @@
13
13
  * Standard (universal) genetic code
14
14
  * Maps RNA codons to single-letter amino acid codes
15
15
  */
16
+
16
17
  const STANDARD_GENETIC_CODE = {
17
18
  // UUX codons
18
19
  'UUU': 'F', 'UUC': 'F', // Phenylalanine
@@ -245,25 +246,20 @@ function classifyMutation(originalCodon, mutatedCodon, geneticCode = STANDARD_GE
245
246
  return 'missense';
246
247
  }
247
248
 
248
- module.exports = {
249
- // Genetic codes
250
- STANDARD_GENETIC_CODE,
251
- VERTEBRATE_MITOCHONDRIAL_CODE,
252
- YEAST_MITOCHONDRIAL_CODE,
253
-
254
- // Codon lists
255
- START_CODONS,
256
- STOP_CODONS,
257
- CODON_USAGE_ECOLI,
258
-
259
- // Functions
260
- translateCodon,
261
- getCodonsForAminoAcid,
262
- getCodonDegeneracy,
263
- isStartCodon,
264
- isStopCodon,
265
- calculateGCContent,
266
- calculateCAI,
267
- getSynonymousCodons,
268
- classifyMutation,
249
+ export {
250
+ STANDARD_GENETIC_CODE,
251
+ VERTEBRATE_MITOCHONDRIAL_CODE,
252
+ YEAST_MITOCHONDRIAL_CODE,
253
+ START_CODONS,
254
+ STOP_CODONS,
255
+ CODON_USAGE_ECOLI,
256
+ translateCodon,
257
+ getCodonsForAminoAcid,
258
+ getCodonDegeneracy,
259
+ isStartCodon,
260
+ isStopCodon,
261
+ calculateGCContent,
262
+ calculateCAI,
263
+ getSynonymousCodons,
264
+ classifyMutation
269
265
  };
@@ -12,18 +12,18 @@
12
12
  * - DNA computing (logic gates, strand displacement)
13
13
  */
14
14
 
15
- const { Backend } = require('../interface');
16
- const { Hypercomplex } = require('../../core/hypercomplex');
17
- const { primeToFrequency } = require('../../core/prime');
18
-
19
15
  // Import all submodules
20
- const encoding = require('./encoding');
21
- const geneticCode = require('./genetic-code');
22
- const { TranscriptionOperator } = require('./transcription');
23
- const { TranslationOperator } = require('./translation');
24
- const { FoldingTransform } = require('./folding');
25
- const dnaComputing = require('./dna-computing');
26
- const binding = require('./binding');
16
+ import { Backend } from '../interface.js';
17
+ import { Hypercomplex } from '../../core/hypercomplex.js';
18
+ import { primeToFrequency } from '../../core/prime.js';
19
+ import { TranscriptionOperator } from './transcription.js';
20
+ import { TranslationOperator } from './translation.js';
21
+ import { FoldingTransform } from './folding.js';
22
+
23
+ import encoding from './encoding.js';
24
+ import geneticCode from './genetic-code.js';
25
+ import dnaComputing from './dna-computing.js';
26
+ import binding from './binding.js';
27
27
 
28
28
  /**
29
29
  * BioinformaticsBackend
@@ -487,7 +487,7 @@ class BioinformaticsBackend extends Backend {
487
487
  }
488
488
 
489
489
  // Export everything
490
- module.exports = {
490
+ export default {
491
491
  // Main backend
492
492
  BioinformaticsBackend,
493
493
 
@@ -7,14 +7,14 @@
7
7
  * In prime space: T(2) → U(5) substitution
8
8
  */
9
9
 
10
- const { NUCLEOTIDE_PRIMES, PRIME_COMPLEMENTS, PRIME_TO_NUCLEOTIDE } = require('./encoding');
11
-
12
10
  /**
13
11
  * TranscriptionOperator
14
12
  *
15
13
  * Transforms DNA prime sequences to RNA prime sequences.
16
14
  * Models the biological process of transcription.
17
15
  */
16
+ import { NUCLEOTIDE_PRIMES, PRIME_COMPLEMENTS, PRIME_TO_NUCLEOTIDE } from './encoding.js';
17
+
18
18
  class TranscriptionOperator {
19
19
  constructor(options = {}) {
20
20
  this.options = {
@@ -218,4 +218,6 @@ class TranscriptionOperator {
218
218
  }
219
219
  }
220
220
 
221
- module.exports = { TranscriptionOperator };
221
+ export {
222
+ TranscriptionOperator
223
+ };
@@ -8,15 +8,15 @@
8
8
  * (64 codons → 21 amino acids = significant information compression)
9
9
  */
10
10
 
11
- const { NUCLEOTIDE_PRIMES, AMINO_ACID_PRIMES, PRIME_TO_NUCLEOTIDE } = require('./encoding');
12
- const { STANDARD_GENETIC_CODE, isStartCodon, isStopCodon, translateCodon } = require('./genetic-code');
13
-
14
11
  /**
15
12
  * TranslationOperator
16
13
  *
17
14
  * Transforms RNA prime sequences to protein prime sequences.
18
15
  * Models ribosome-mediated translation.
19
16
  */
17
+ import { NUCLEOTIDE_PRIMES, AMINO_ACID_PRIMES, PRIME_TO_NUCLEOTIDE } from './encoding.js';
18
+ import { STANDARD_GENETIC_CODE, isStartCodon, isStopCodon, translateCodon } from './genetic-code.js';
19
+
20
20
  class TranslationOperator {
21
21
  constructor(geneticCode = STANDARD_GENETIC_CODE) {
22
22
  this.geneticCode = geneticCode;
@@ -261,4 +261,6 @@ class TranslationOperator {
261
261
  }
262
262
  }
263
263
 
264
- module.exports = { TranslationOperator };
264
+ export {
265
+ TranslationOperator
266
+ };
@@ -6,10 +6,11 @@
6
6
  * - Holographic Key Distribution
7
7
  * - Entropy-Sensitive Encryption
8
8
  */
9
- const { Backend } = require('../interface');
10
- const { Hypercomplex } = require('../../core/hypercomplex');
11
- const { GaussianInteger, primeToFrequency, isPrime, firstNPrimes, factorize } = require('../../core/prime');
12
- const { Complex, PrimeState } = require('../../core/hilbert');
9
+
10
+ import { Backend } from '../interface.js';
11
+ import { Hypercomplex } from '../../core/hypercomplex.js';
12
+ import { GaussianInteger, primeToFrequency, isPrime, firstNPrimes, factorize } from '../../core/prime.js';
13
+ import { Complex, PrimeState } from '../../core/hilbert.js';
13
14
 
14
15
  class CryptographicBackend extends Backend {
15
16
  constructor(config) {
@@ -641,9 +642,9 @@ class HolographicKeyDistributor {
641
642
  }
642
643
  }
643
644
 
644
- module.exports = {
645
- CryptographicBackend,
646
- PrimeStateKeyGenerator,
647
- EntropySensitiveEncryptor,
648
- HolographicKeyDistributor
645
+ export {
646
+ CryptographicBackend,
647
+ PrimeStateKeyGenerator,
648
+ EntropySensitiveEncryptor,
649
+ HolographicKeyDistributor
649
650
  };
package/backends/index.js CHANGED
@@ -2,13 +2,14 @@
2
2
  * Backends - exports all domain backends
3
3
  */
4
4
 
5
- const { Backend } = require('./interface');
6
- const { SemanticBackend } = require('./semantic');
7
- const { CryptographicBackend } = require('./cryptographic');
8
- const { ScientificBackend } = require('./scientific');
9
- const bioinformatics = require('./bioinformatics');
5
+ import { Backend } from './interface.js';
6
+ import SemanticBackend from './semantic/index.js';
7
+ import CryptographicBackend from './cryptographic/index.js';
8
+ import ScientificBackend from './scientific/index.js';
10
9
 
11
- module.exports = {
10
+ import bioinformatics from './bioinformatics/index.js';
11
+
12
+ export default {
12
13
  Backend,
13
14
  SemanticBackend,
14
15
  CryptographicBackend,
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Common interface for all domain backends
3
3
  */
4
+
4
5
  class Backend {
5
6
  constructor(config) {
6
7
  this.config = config;
@@ -86,4 +87,6 @@ class Backend {
86
87
  }
87
88
  }
88
89
 
89
- module.exports = { Backend };
90
+ export {
91
+ Backend
92
+ };
@@ -1,9 +1,10 @@
1
1
  /**
2
2
  * Scientific Backend - Quantum simulation, particle physics, molecular dynamics
3
3
  */
4
- const { Backend } = require('../interface');
5
- const { Hypercomplex } = require('../../core/hypercomplex');
6
- const { primeToFrequency, factorize, firstNPrimes, DEFAULT_PRIMES } = require('../../core/prime');
4
+
5
+ import { Backend } from '../interface.js';
6
+ import { Hypercomplex } from '../../core/hypercomplex.js';
7
+ import { primeToFrequency, factorize, firstNPrimes, DEFAULT_PRIMES } from '../../core/prime.js';
7
8
 
8
9
  class ScientificBackend extends Backend {
9
10
  constructor(config) {
@@ -269,4 +270,6 @@ class ScientificBackend extends Backend {
269
270
  }
270
271
  }
271
272
 
272
- module.exports = { ScientificBackend };
273
+ export {
274
+ ScientificBackend
275
+ };
@@ -10,9 +10,10 @@
10
10
  * - Reading frames: 6 frames (3 forward + 3 reverse offsets)
11
11
  * - Sense/Antisense: Dual representations via conjugation
12
12
  */
13
- const { Backend } = require('../interface');
14
- const { Hypercomplex } = require('../../core/hypercomplex');
15
- const { primeToFrequency, primeToAngle, DEFAULT_PRIMES, nthPrime } = require('../../core/prime');
13
+
14
+ import { Backend } from '../interface.js';
15
+ import { Hypercomplex } from '../../core/hypercomplex.js';
16
+ import { primeToFrequency, primeToAngle, DEFAULT_PRIMES, nthPrime } from '../../core/prime.js';
16
17
 
17
18
  class SemanticBackend extends Backend {
18
19
  constructor(config) {
@@ -524,4 +525,6 @@ class SemanticBackend extends Backend {
524
525
  }
525
526
  }
526
527
 
527
- module.exports = { SemanticBackend };
528
+ export {
529
+ SemanticBackend
530
+ };
@@ -11,6 +11,7 @@
11
11
  * A Surface represents a specific vocabulary/style mapping
12
12
  * Multiple words can map to the same prime signature with different biases
13
13
  */
14
+
14
15
  class Surface {
15
16
  constructor(config = {}) {
16
17
  this.name = config.name || 'default';
@@ -390,4 +391,4 @@ class BiasEngine {
390
391
  }
391
392
  }
392
393
 
393
- module.exports = { Surface, SurfaceManager, BiasEngine };
394
+ export default { Surface, SurfaceManager, BiasEngine };
@@ -12,8 +12,8 @@
12
12
  * - Handles context-dependent vocabulary
13
13
  */
14
14
 
15
- const { SemanticBackend } = require('./index');
16
- const { Surface, SurfaceManager, BiasEngine } = require('./surface');
15
+ import { SemanticBackend } from './index.js';
16
+ import { Surface, SurfaceManager, BiasEngine } from './surface.js';
17
17
 
18
18
  class TwoLayerEngine {
19
19
  constructor(config = {}) {
@@ -372,4 +372,6 @@ class TwoLayerEngine {
372
372
  }
373
373
  }
374
374
 
375
- module.exports = { TwoLayerEngine };
375
+ export {
376
+ TwoLayerEngine
377
+ };
package/core/beacon.js CHANGED
@@ -13,9 +13,10 @@
13
13
  * - Hilbert space mapping
14
14
  */
15
15
 
16
- const crypto = require('crypto');
17
- const { isPrime, primesUpTo, factorize } = require('./prime');
18
- const { Complex, PrimeState } = require('./hilbert');
16
+ import { isPrime, primesUpTo, factorize } from './prime.js';
17
+ import { Complex, PrimeState } from './hilbert.js';
18
+
19
+ import crypto from 'crypto';
19
20
 
20
21
  /**
21
22
  * Resonant Fragment
@@ -726,10 +727,10 @@ class DataSummoner {
726
727
  }
727
728
  }
728
729
 
729
- module.exports = {
730
- ResonantFragment,
731
- Beacon,
732
- BeaconCache,
733
- CRTReconstructor,
734
- DataSummoner
730
+ export {
731
+ ResonantFragment,
732
+ Beacon,
733
+ BeaconCache,
734
+ CRTReconstructor,
735
+ DataSummoner
735
736
  };
package/core/compound.js CHANGED
@@ -14,9 +14,6 @@
14
14
  * Ported from symprime's CompoundBuilder system.
15
15
  */
16
16
 
17
- const { symbolDatabase, SymbolCategory } = require('./symbols');
18
- const { ResonanceCalculator } = require('./resonance');
19
-
20
17
  // ═══════════════════════════════════════════════════════════════════
21
18
  // Compound Symbol Type
22
19
  // ═══════════════════════════════════════════════════════════════════
@@ -25,6 +22,9 @@ const { ResonanceCalculator } = require('./resonance');
25
22
  * A compound symbol is a combination of multiple base symbols
26
23
  * with a unified meaning and cultural context.
27
24
  */
25
+ import { symbolDatabase, SymbolCategory } from './symbols.js';
26
+ import { ResonanceCalculator } from './resonance.js';
27
+
28
28
  class CompoundSymbol {
29
29
  constructor(id, components, meaning, culturalTags = []) {
30
30
  this.id = id;
@@ -514,7 +514,7 @@ class CompoundBuilder {
514
514
  // Singleton instance
515
515
  const defaultBuilder = new CompoundBuilder();
516
516
 
517
- module.exports = {
517
+ export default {
518
518
  CompoundBuilder,
519
519
  CompoundSymbol,
520
520
  SymbolSequence,