@aleph-ai/tinyaleph 1.5.1 → 1.5.3

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.
@@ -492,4 +492,10 @@ export {
492
492
  BindingAffinityCalculator,
493
493
  MolecularDocker,
494
494
  ProteinProteinDocker
495
+ };
496
+
497
+ export default {
498
+ BindingAffinityCalculator,
499
+ MolecularDocker,
500
+ ProteinProteinDocker
495
501
  };
@@ -652,4 +652,18 @@ export {
652
652
  DNACircuit,
653
653
  createHalfAdder,
654
654
  createFullAdder
655
+ };
656
+
657
+ export default {
658
+ DNAStrand,
659
+ DNADuplex,
660
+ ANDGate,
661
+ ORGate,
662
+ NOTGate,
663
+ NANDGate,
664
+ SeesawGate,
665
+ StrandDisplacementReaction,
666
+ DNACircuit,
667
+ createHalfAdder,
668
+ createFullAdder
655
669
  };
@@ -328,4 +328,27 @@ export {
328
328
  getAminoAcidProperties,
329
329
  getChargeFromPrime,
330
330
  getHydrophobicityFromPrime
331
+ };
332
+
333
+ export default {
334
+ NUCLEOTIDE_PRIMES,
335
+ PRIME_TO_NUCLEOTIDE,
336
+ DNA_COMPLEMENTS,
337
+ PRIME_COMPLEMENTS,
338
+ AMINO_ACID_PRIMES,
339
+ PRIME_TO_AMINO_ACID,
340
+ AMINO_ACID_PROPERTIES,
341
+ encodeCodon,
342
+ decodeCodon,
343
+ encodeDNA,
344
+ decodeDNA,
345
+ encodeRNA,
346
+ decodeRNA,
347
+ encodeProtein,
348
+ decodeProtein,
349
+ detectSequenceType,
350
+ parseFASTA,
351
+ getAminoAcidProperties,
352
+ getChargeFromPrime,
353
+ getHydrophobicityFromPrime
331
354
  };
@@ -443,4 +443,8 @@ class FoldingTransform {
443
443
 
444
444
  export {
445
445
  FoldingTransform
446
+ };
447
+
448
+ export default {
449
+ FoldingTransform
446
450
  };
@@ -262,4 +262,22 @@ export {
262
262
  calculateCAI,
263
263
  getSynonymousCodons,
264
264
  classifyMutation
265
+ };
266
+
267
+ export default {
268
+ STANDARD_GENETIC_CODE,
269
+ VERTEBRATE_MITOCHONDRIAL_CODE,
270
+ YEAST_MITOCHONDRIAL_CODE,
271
+ START_CODONS,
272
+ STOP_CODONS,
273
+ CODON_USAGE_ECOLI,
274
+ translateCodon,
275
+ getCodonsForAminoAcid,
276
+ getCodonDegeneracy,
277
+ isStartCodon,
278
+ isStopCodon,
279
+ calculateGCContent,
280
+ calculateCAI,
281
+ getSynonymousCodons,
282
+ classifyMutation
265
283
  };
@@ -220,4 +220,8 @@ class TranscriptionOperator {
220
220
 
221
221
  export {
222
222
  TranscriptionOperator
223
+ };
224
+
225
+ export default {
226
+ TranscriptionOperator
223
227
  };
@@ -263,4 +263,8 @@ class TranslationOperator {
263
263
 
264
264
  export {
265
265
  TranslationOperator
266
+ };
267
+
268
+ export default {
269
+ TranslationOperator
266
270
  };
@@ -647,4 +647,11 @@ export {
647
647
  PrimeStateKeyGenerator,
648
648
  EntropySensitiveEncryptor,
649
649
  HolographicKeyDistributor
650
+ };
651
+
652
+ export default {
653
+ CryptographicBackend,
654
+ PrimeStateKeyGenerator,
655
+ EntropySensitiveEncryptor,
656
+ HolographicKeyDistributor
650
657
  };
@@ -272,4 +272,8 @@ class ScientificBackend extends Backend {
272
272
 
273
273
  export {
274
274
  ScientificBackend
275
+ };
276
+
277
+ export default {
278
+ ScientificBackend
275
279
  };
@@ -527,4 +527,8 @@ class SemanticBackend extends Backend {
527
527
 
528
528
  export {
529
529
  SemanticBackend
530
+ };
531
+
532
+ export default {
533
+ SemanticBackend
530
534
  };
@@ -374,4 +374,8 @@ class TwoLayerEngine {
374
374
 
375
375
  export {
376
376
  TwoLayerEngine
377
+ };
378
+
379
+ export default {
380
+ TwoLayerEngine
377
381
  };
package/core/compound.js CHANGED
@@ -514,19 +514,37 @@ class CompoundBuilder {
514
514
  // Singleton instance
515
515
  const defaultBuilder = new CompoundBuilder();
516
516
 
517
+ // Named exports for ESM compatibility
518
+ const compoundBuilder = defaultBuilder;
519
+ const createCompound = (id, components, meaning, tags) =>
520
+ defaultBuilder.createCompound(id, components, meaning, tags);
521
+ const getCompound = (id) => defaultBuilder.getCompound(id);
522
+ const createSequence = (id, symbols, type, desc) =>
523
+ defaultBuilder.createSequence(id, symbols, type, desc);
524
+ const getSequence = (id) => defaultBuilder.getSequence(id);
525
+ const findCompoundsContaining = (symbolId) =>
526
+ defaultBuilder.findCompoundsContaining(symbolId);
527
+
528
+ export {
529
+ CompoundBuilder,
530
+ CompoundSymbol,
531
+ SymbolSequence,
532
+ compoundBuilder,
533
+ createCompound,
534
+ getCompound,
535
+ createSequence,
536
+ getSequence,
537
+ findCompoundsContaining
538
+ };
539
+
517
540
  export default {
518
541
  CompoundBuilder,
519
542
  CompoundSymbol,
520
543
  SymbolSequence,
521
- compoundBuilder: defaultBuilder,
522
-
523
- // Convenience functions
524
- createCompound: (id, components, meaning, tags) =>
525
- defaultBuilder.createCompound(id, components, meaning, tags),
526
- getCompound: (id) => defaultBuilder.getCompound(id),
527
- createSequence: (id, symbols, type, desc) =>
528
- defaultBuilder.createSequence(id, symbols, type, desc),
529
- getSequence: (id) => defaultBuilder.getSequence(id),
530
- findCompoundsContaining: (symbolId) =>
531
- defaultBuilder.findCompoundsContaining(symbolId)
544
+ compoundBuilder,
545
+ createCompound,
546
+ getCompound,
547
+ createSequence,
548
+ getSequence,
549
+ findCompoundsContaining
532
550
  };
@@ -974,6 +974,36 @@ class CoprimeSelector {
974
974
  // EXPORTS
975
975
  // ============================================================================
976
976
 
977
+ // Named exports for ESM compatibility
978
+ export {
979
+ // Modular arithmetic utilities
980
+ extendedGCD,
981
+ modInverse,
982
+ areCoprime,
983
+ softmax,
984
+
985
+ // Core classes
986
+ ResidueEncoder,
987
+ CRTReconstructor,
988
+ BirkhoffProjector,
989
+ HomologyLoss,
990
+ CRTModularLayer,
991
+ CRTFusedAttention,
992
+ CoprimeSelector
993
+ };
994
+
995
+ // Factory functions as named exports
996
+ export const createCRTLayer = (primes, hiddenDim, options = {}) =>
997
+ new CRTModularLayer(primes, hiddenDim, options);
998
+
999
+ export const createFusedAttention = (primes, hiddenDim, headDim, options = {}) =>
1000
+ new CRTFusedAttention(primes, hiddenDim, headDim, options);
1001
+
1002
+ // Default configurations
1003
+ export const DEFAULT_PRIMES_SMALL = [2, 3, 5, 7];
1004
+ export const DEFAULT_PRIMES_MEDIUM = [5, 7, 11, 13];
1005
+ export const DEFAULT_PRIMES_SEMANTIC = [2, 3, 5, 7, 11];
1006
+
977
1007
  export default {
978
1008
  // Modular arithmetic utilities
979
1009
  extendedGCD,
@@ -991,14 +1021,11 @@ export default {
991
1021
  CoprimeSelector,
992
1022
 
993
1023
  // Factory functions
994
- createCRTLayer: (primes, hiddenDim, options = {}) =>
995
- new CRTModularLayer(primes, hiddenDim, options),
996
-
997
- createFusedAttention: (primes, hiddenDim, headDim, options = {}) =>
998
- new CRTFusedAttention(primes, hiddenDim, headDim, options),
1024
+ createCRTLayer,
1025
+ createFusedAttention,
999
1026
 
1000
1027
  // Default configurations
1001
- DEFAULT_PRIMES_SMALL: [2, 3, 5, 7],
1002
- DEFAULT_PRIMES_MEDIUM: [5, 7, 11, 13],
1003
- DEFAULT_PRIMES_SEMANTIC: [2, 3, 5, 7, 11]
1028
+ DEFAULT_PRIMES_SMALL,
1029
+ DEFAULT_PRIMES_MEDIUM,
1030
+ DEFAULT_PRIMES_SEMANTIC
1004
1031
  };
package/core/index.js CHANGED
@@ -166,6 +166,216 @@ let rformerTF = null;
166
166
  // Dynamic import for optional TensorFlow.js support
167
167
  // Use: const tf = await import('./rformer-tf.js') when needed
168
168
 
169
+ // Named exports for ESM compatibility
170
+ export {
171
+ // Hypercomplex algebra
172
+ Hypercomplex,
173
+
174
+ // Fano plane / multiplication
175
+ FANO_LINES,
176
+ octonionMultiplyIndex,
177
+ sedenionMultiplyIndex,
178
+ multiplyIndices,
179
+ buildMultiplicationTable,
180
+
181
+ // Prime utilities
182
+ primeGenerator,
183
+ nthPrime,
184
+ primesUpTo,
185
+ isPrime,
186
+ factorize,
187
+ primeSignature,
188
+ firstNPrimes,
189
+ GaussianInteger,
190
+ EisensteinInteger,
191
+ primeToFrequency,
192
+ primeToAngle,
193
+ sumOfTwoSquares,
194
+ DEFAULT_PRIMES,
195
+
196
+ // LLM client
197
+ LLM,
198
+
199
+ // Prime Hilbert Space
200
+ Complex,
201
+ PrimeState,
202
+ ResonanceOperators,
203
+ EntropyDrivenEvolution,
204
+ encodeMemory,
205
+ symbolicCompute,
206
+ QuaternionPrime,
207
+ PrimeResonanceIdentity,
208
+ PhaseLockedRing,
209
+ HolographicField,
210
+ EntangledNode,
211
+ ResonantFragment,
212
+ DELTA_S,
213
+
214
+ // Golden Ratio Resonance
215
+ PHI,
216
+ PHI_THRESHOLD,
217
+ PHI_BONUS,
218
+ ResonanceCalculator,
219
+ resonanceSignature,
220
+ findFibonacciSequences,
221
+ calculateResonance,
222
+ findGoldenPairs,
223
+ findMostResonant,
224
+
225
+ // Symbol Database
226
+ SymbolDatabase,
227
+ SymbolCategory,
228
+ PrimeGenerator,
229
+ symbolDatabase,
230
+ getSymbol,
231
+ getSymbolByPrime,
232
+ searchSymbols,
233
+ encodeSymbols,
234
+ decodeSymbols,
235
+
236
+ // Semantic Inference
237
+ SemanticInference,
238
+ EntityExtractor,
239
+ InferenceMethod,
240
+ semanticInference,
241
+ entityExtractor,
242
+ inferSymbol,
243
+ inferSymbols,
244
+ extractEntities,
245
+ extractAndInfer,
246
+ inferWithResonance,
247
+ inferMostResonant,
248
+
249
+ // Compound Builder
250
+ CompoundBuilder,
251
+ CompoundSymbol,
252
+ SymbolSequence,
253
+ compoundBuilder,
254
+ createCompound,
255
+ getCompound,
256
+ createSequence,
257
+ getSequence,
258
+ findCompoundsContaining,
259
+
260
+ // ResoFormer ML Primitives
261
+ Quaternion,
262
+ SparsePrimeState,
263
+ resonanceScore,
264
+ resonantAttention,
265
+ hamiltonCompose,
266
+ measureNonCommutativity,
267
+ computeCoherence,
268
+ haltingDecision,
269
+ coherenceGatedCompute,
270
+ EntropyCollapseHead,
271
+ generateAttractorCodebook,
272
+ PRGraphMemory,
273
+ applyResonanceOperator,
274
+
275
+ // ResoFormer Complete Layers
276
+ ResonantMultiHeadAttention,
277
+ PrimeFFN,
278
+ PrimeLayerNorm,
279
+ PositionalPrimeEncoding,
280
+ ResoFormerBlock,
281
+ ResoFormer,
282
+
283
+ // CRT-enhanced ResoFormer
284
+ CRTResonantAttention,
285
+ HomologyRegularizedBlock,
286
+ CRTResoFormer,
287
+ createCRTResoFormer,
288
+
289
+ // Prime Entanglement Graph
290
+ EntanglementEdge,
291
+ PrimeEntanglementGraph,
292
+ createEntanglementGraph,
293
+
294
+ // Event System
295
+ AlephEventEmitter,
296
+ AlephMonitor,
297
+ EvolutionStream,
298
+ createEvolutionStream,
299
+ createMonitor,
300
+
301
+ // Formal Type System
302
+ NounType,
303
+ AdjType,
304
+ SentenceType,
305
+ NounTerm,
306
+ AdjTerm,
307
+ ChainTerm,
308
+ FusionTerm,
309
+ NounSentence,
310
+ SeqSentence,
311
+ ImplSentence,
312
+ TypingContext,
313
+ TypingJudgment,
314
+ TypeChecker,
315
+ N,
316
+ A,
317
+ FUSE,
318
+ CHAIN,
319
+ SENTENCE,
320
+ SEQ,
321
+ IMPL,
322
+
323
+ // Reduction Semantics
324
+ PrimeOperator,
325
+ NextPrimeOperator,
326
+ ModularPrimeOperator,
327
+ ResonancePrimeOperator,
328
+ IdentityPrimeOperator,
329
+ DEFAULT_OPERATOR,
330
+ ReductionStep,
331
+ ReductionTrace,
332
+ ReductionSystem,
333
+ isNormalForm,
334
+ isReducible,
335
+ termSize,
336
+ FusionCanonicalizer,
337
+ NormalFormVerifier,
338
+ demonstrateStrongNormalization,
339
+ testLocalConfluence,
340
+
341
+ // Lambda Calculus
342
+ LambdaExpr,
343
+ VarExpr,
344
+ ConstExpr,
345
+ LamExpr,
346
+ AppExpr,
347
+ PairExpr,
348
+ ImplExpr,
349
+ PrimOpExpr,
350
+ Translator,
351
+ TypeDirectedTranslator,
352
+ LambdaEvaluator,
353
+ Semantics,
354
+ ConceptInterpreter,
355
+
356
+ // Enochian
357
+ enochian,
358
+ enochianVocabulary,
359
+
360
+ // CRT-Homology
361
+ extendedGCD,
362
+ modInverse,
363
+ areCoprime,
364
+ softmax,
365
+ ResidueEncoder,
366
+ CRTReconstructor,
367
+ BirkhoffProjector,
368
+ HomologyLoss,
369
+ CRTModularLayer,
370
+ CRTFusedAttention,
371
+ CoprimeSelector,
372
+ createCRTLayer,
373
+ createFusedAttention,
374
+ DEFAULT_PRIMES_SMALL,
375
+ DEFAULT_PRIMES_MEDIUM,
376
+ DEFAULT_PRIMES_SEMANTIC
377
+ };
378
+
169
379
  export default {
170
380
  // Hypercomplex algebra
171
381
  Hypercomplex,
package/core/inference.js CHANGED
@@ -584,22 +584,47 @@ class EntityExtractor {
584
584
  const defaultInference = new SemanticInference();
585
585
  const defaultExtractor = new EntityExtractor();
586
586
 
587
+ // Convenience function aliases
588
+ const semanticInference = defaultInference;
589
+ const entityExtractor = defaultExtractor;
590
+ const inferSymbol = (text) => defaultInference.inferSymbol(text);
591
+ const inferSymbols = (entities) => defaultInference.inferSymbols(entities);
592
+ const inferWithResonance = (text, options) => defaultInference.inferWithResonance(text, options);
593
+ const inferMostResonant = (text, contextSymbols) => defaultInference.inferMostResonant(text, contextSymbols);
594
+ const extractEntities = (text) => defaultExtractor.extract(text);
595
+ const extractAndInfer = (text) => defaultExtractor.extractAndInfer(text, defaultInference);
596
+
597
+ // Named exports for ESM compatibility
598
+ export {
599
+ SemanticInference,
600
+ EntityExtractor,
601
+ InferenceMethod,
602
+ semanticInference,
603
+ entityExtractor,
604
+ inferSymbol,
605
+ inferSymbols,
606
+ inferWithResonance,
607
+ inferMostResonant,
608
+ extractEntities,
609
+ extractAndInfer
610
+ };
611
+
587
612
  export default {
588
613
  SemanticInference,
589
614
  EntityExtractor,
590
615
  InferenceMethod,
591
616
 
592
617
  // Singleton instances
593
- semanticInference: defaultInference,
594
- entityExtractor: defaultExtractor,
618
+ semanticInference,
619
+ entityExtractor,
595
620
 
596
621
  // Convenience functions
597
- inferSymbol: (text) => defaultInference.inferSymbol(text),
598
- inferSymbols: (entities) => defaultInference.inferSymbols(entities),
622
+ inferSymbol,
623
+ inferSymbols,
599
624
 
600
625
  // Resonance-enhanced inference
601
- inferWithResonance: (text, options) => defaultInference.inferWithResonance(text, options),
602
- inferMostResonant: (text, contextSymbols) => defaultInference.inferMostResonant(text, contextSymbols),
603
- extractEntities: (text) => defaultExtractor.extract(text),
604
- extractAndInfer: (text) => defaultExtractor.extractAndInfer(text, defaultInference)
626
+ inferWithResonance,
627
+ inferMostResonant,
628
+ extractEntities,
629
+ extractAndInfer
605
630
  };
package/core/resonance.js CHANGED
@@ -310,6 +310,21 @@ function findFibonacciSequences(primes, minLength = 3) {
310
310
  // Singleton instance for convenience
311
311
  const defaultCalculator = new ResonanceCalculator();
312
312
 
313
+ // Named exports for ESM compatibility
314
+ export {
315
+ ResonanceCalculator,
316
+ resonanceSignature,
317
+ findFibonacciSequences,
318
+ PHI,
319
+ PHI_THRESHOLD,
320
+ PHI_BONUS
321
+ };
322
+
323
+ // Convenience functions using default calculator
324
+ export const calculateResonance = (p1, p2) => defaultCalculator.calculateResonance(p1, p2);
325
+ export const findGoldenPairs = (primes) => defaultCalculator.findGoldenPairs(primes);
326
+ export const findMostResonant = (target, candidates) => defaultCalculator.findMostResonant(target, candidates);
327
+
313
328
  export default {
314
329
  ResonanceCalculator,
315
330
  resonanceSignature,
@@ -317,9 +332,7 @@ export default {
317
332
  PHI,
318
333
  PHI_THRESHOLD,
319
334
  PHI_BONUS,
320
-
321
- // Convenience functions using default calculator
322
- calculateResonance: (p1, p2) => defaultCalculator.calculateResonance(p1, p2),
323
- findGoldenPairs: (primes) => defaultCalculator.findGoldenPairs(primes),
324
- findMostResonant: (target, candidates) => defaultCalculator.findMostResonant(target, candidates)
335
+ calculateResonance,
336
+ findGoldenPairs,
337
+ findMostResonant
325
338
  };
@@ -478,10 +478,13 @@ const abstractSymbols = [
478
478
  }
479
479
  ];
480
480
 
481
+ // Named export for allElementSymbols (used by index.js)
482
+ export const allElementSymbols = [...elementSymbols, ...placeSymbols, ...objectSymbols, ...abstractSymbols];
483
+
481
484
  export default {
482
485
  elementSymbols,
483
486
  placeSymbols,
484
487
  objectSymbols,
485
488
  abstractSymbols,
486
- allElementSymbols: [...elementSymbols, ...placeSymbols, ...objectSymbols, ...abstractSymbols]
489
+ allElementSymbols
487
490
  };
@@ -204,8 +204,11 @@ const tarotMinorSuits = [
204
204
  }
205
205
  ];
206
206
 
207
+ // Named export for tarotSymbols (used by index.js)
208
+ export const tarotSymbols = [...tarotMajorArcana, ...tarotMinorSuits];
209
+
207
210
  export default {
208
211
  tarotMajorArcana,
209
212
  tarotMinorSuits,
210
- tarotSymbols: [...tarotMajorArcana, ...tarotMinorSuits]
213
+ tarotSymbols
211
214
  };
package/core/symbols.js CHANGED
@@ -1,23 +1,44 @@
1
1
  /**
2
2
  * Symbol Database
3
- *
3
+ *
4
4
  * Comprehensive database of 400+ symbols with:
5
5
  * - Unicode emoji representation
6
6
  * - Prime number assignment (unique per symbol)
7
7
  * - Category organization
8
8
  * - Cultural tags for cross-cultural mapping
9
9
  * - Rich, detailed meanings
10
- *
10
+ *
11
11
  * Includes:
12
12
  * - Jungian archetypes and mythological figures
13
13
  * - Tarot Major and Minor Arcana
14
14
  * - I-Ching 64 hexagrams
15
15
  * - Egyptian hieroglyphs
16
16
  * - Natural elements, places, objects, abstracts
17
- *
17
+ *
18
18
  * Refactored to use modular symbol definition files.
19
19
  */
20
20
 
21
21
  // Re-export everything from the modular structure
22
+ export {
23
+ symbolDatabase,
24
+ SymbolDatabase,
25
+ SymbolCategory,
26
+ PrimeGenerator,
27
+ archetypeSymbols,
28
+ tarotSymbols,
29
+ ichingHexagrams,
30
+ egyptianHieroglyphs,
31
+ allElementSymbols,
32
+ getSymbol,
33
+ getSymbolByPrime,
34
+ getSymbolsByCategory,
35
+ getSymbolsByTag,
36
+ search,
37
+ encode,
38
+ decode,
39
+ getAllSymbols,
40
+ getStats
41
+ } from './symbols/index.js';
22
42
 
23
- module.exports = require('./symbols/index');
43
+ // Default export
44
+ export { default } from './symbols/index.js';
package/core/types.js CHANGED
@@ -878,8 +878,16 @@ function IMPL(s1, s2) {
878
878
  // EXPORTS
879
879
  // ============================================================================
880
880
 
881
+ // Type aliases for compatibility with core/index.js
882
+ const NounType = Types.NOUN;
883
+ const AdjType = Types.ADJECTIVE;
884
+ const SentenceType = Types.SENTENCE;
885
+
881
886
  export {
882
887
  Types,
888
+ NounType,
889
+ AdjType,
890
+ SentenceType,
883
891
  Term,
884
892
  NounTerm,
885
893
  AdjTerm,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aleph-ai/tinyaleph",
3
- "version": "1.5.1",
3
+ "version": "1.5.3",
4
4
  "description": "Prime-resonant semantic computing framework - hypercomplex algebra, oscillator dynamics, and entropy-minimizing reasoning",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -93,4 +93,7 @@ class OscillatorBank {
93
93
  }
94
94
  }
95
95
 
96
+ // Named exports for ESM compatibility
97
+ export { Oscillator, OscillatorBank };
98
+
96
99
  export default { Oscillator, OscillatorBank };