@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.
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 +17 -5
  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 +24 -0
  68. package/telemetry/metrics.js +3 -8
@@ -70,11 +70,11 @@ function stabilityMargin(lyapunovExponent, threshold = 0.1) {
70
70
  return threshold - lyapunovExponent;
71
71
  }
72
72
 
73
- module.exports = {
74
- estimateLyapunov,
75
- classifyStability,
76
- adaptiveCoupling,
77
- localLyapunov,
78
- delayEmbedding,
79
- stabilityMargin
73
+ export {
74
+ estimateLyapunov,
75
+ classifyStability,
76
+ adaptiveCoupling,
77
+ localLyapunov,
78
+ delayEmbedding,
79
+ stabilityMargin
80
80
  };
@@ -5,6 +5,7 @@
5
5
  * by input to become active. This ensures the field response
6
6
  * reflects the input, not a default full-amplitude state.
7
7
  */
8
+
8
9
  class Oscillator {
9
10
  constructor(frequency, phase = 0, amplitude = 0) { // Start quiescent!
10
11
  this.freq = frequency;
@@ -92,4 +93,4 @@ class OscillatorBank {
92
93
  }
93
94
  }
94
95
 
95
- module.exports = { Oscillator, OscillatorBank };
96
+ export default { Oscillator, OscillatorBank };
@@ -16,13 +16,11 @@
16
16
 
17
17
  'use strict';
18
18
 
19
- const {
20
- PrimeonZLadderU,
19
+ import { PrimeonZLadderU,
21
20
  C,
22
21
  shannonEntropyNats,
23
22
  probsOf,
24
- normalize
25
- } = require('./primeon_z_ladder_u');
23
+ normalize } from './primeon_z_ladder_u.js';
26
24
 
27
25
  /**
28
26
  * Z Channel configuration
@@ -661,9 +659,9 @@ function createAdiabaticSchedule(J0, J1, T, schedule = 'linear') {
661
659
  }
662
660
  }
663
661
 
664
- module.exports = {
665
- ZChannel,
666
- PrimeonZLadderMulti,
667
- createMultiChannelLadder,
668
- createAdiabaticSchedule
662
+ export {
663
+ ZChannel,
664
+ PrimeonZLadderMulti,
665
+ createMultiChannelLadder,
666
+ createAdiabaticSchedule
669
667
  };
@@ -13,6 +13,7 @@
13
13
  /**
14
14
  * Minimal Complex number helpers (intentionally tiny for predictable perf).
15
15
  */
16
+
16
17
  class C {
17
18
  constructor(re = 0, im = 0) {
18
19
  this.re = re;
@@ -481,13 +482,11 @@ function createPrimeonLadder(primes, opts = {}) {
481
482
  return ladder;
482
483
  }
483
484
 
484
- module.exports = {
485
- PrimeonZLadderU,
486
- createPrimeonLadder,
487
- // Export helpers for potential reuse in entropy tooling
488
- shannonEntropyNats,
489
- probsOf,
490
- normalize,
491
- // Export Complex class for advanced usage
492
- C
485
+ export {
486
+ PrimeonZLadderU,
487
+ createPrimeonLadder,
488
+ shannonEntropyNats,
489
+ probsOf,
490
+ normalize,
491
+ C
493
492
  };
@@ -13,12 +13,12 @@
13
13
 
14
14
  'use strict';
15
15
 
16
- const { KuramotoModel } = require('./kuramoto');
17
-
18
16
  /**
19
17
  * Box-Muller transform for Gaussian random numbers
20
18
  * @returns {number} Standard normal random variable
21
19
  */
20
+ import { KuramotoModel } from './kuramoto.js';
21
+
22
22
  function gaussianRandom() {
23
23
  const u1 = Math.random();
24
24
  const u2 = Math.random();
@@ -558,9 +558,9 @@ class ThermalKuramoto extends StochasticKuramoto {
558
558
  }
559
559
  }
560
560
 
561
- module.exports = {
562
- StochasticKuramoto,
563
- ColoredNoiseKuramoto,
564
- ThermalKuramoto,
565
- gaussianRandom
561
+ export {
562
+ StochasticKuramoto,
563
+ ColoredNoiseKuramoto,
564
+ ThermalKuramoto,
565
+ gaussianRandom
566
566
  };
@@ -9,9 +9,6 @@
9
9
  * - MultiSystemCoupling: Cross-system synchronization
10
10
  */
11
11
 
12
- const { KuramotoModel } = require('./kuramoto');
13
- const { OscillatorBank } = require('./oscillator');
14
-
15
12
  /**
16
13
  * NetworkKuramoto - Topology-Aware Coupling
17
14
  *
@@ -20,6 +17,9 @@ const { OscillatorBank } = require('./oscillator');
20
17
  *
21
18
  * Enables modular synchronization respecting semantic neighborhoods.
22
19
  */
20
+ import { KuramotoModel } from './kuramoto.js';
21
+ import { OscillatorBank } from './oscillator.js';
22
+
23
23
  class NetworkKuramoto extends KuramotoModel {
24
24
  /**
25
25
  * @param {number[]} frequencies - Natural frequencies
@@ -756,15 +756,12 @@ function createPeerCoupling(frequencies, numPeers = 3, strength = 0.15) {
756
756
  return new MultiSystemCoupling(systems, G);
757
757
  }
758
758
 
759
- module.exports = {
760
- // Core extended models
761
- NetworkKuramoto,
762
- AdaptiveKuramoto,
763
- SakaguchiKuramoto,
764
- SmallWorldKuramoto,
765
- MultiSystemCoupling,
766
-
767
- // Factory functions
768
- createHierarchicalCoupling,
769
- createPeerCoupling
759
+ export {
760
+ NetworkKuramoto,
761
+ AdaptiveKuramoto,
762
+ SakaguchiKuramoto,
763
+ SmallWorldKuramoto,
764
+ MultiSystemCoupling,
765
+ createHierarchicalCoupling,
766
+ createPeerCoupling
770
767
  };
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Telemetry module for TinyAleph
3
+ *
4
+ * Provides Prometheus/OpenTelemetry-compatible metric types:
5
+ * - Counter: Monotonically increasing value
6
+ * - Gauge: Value that can go up and down
7
+ * - Histogram: Distribution of values in buckets
8
+ * - Summary: Quantile distribution
9
+ *
10
+ * Browser-compatible: No Node.js dependencies.
11
+ *
12
+ * @example
13
+ * import { MetricRegistry, Counter, Gauge } from '@aleph-ai/tinyaleph/telemetry';
14
+ *
15
+ * const registry = new MetricRegistry({ prefix: 'myapp_' });
16
+ * const requests = registry.counter('requests_total', { help: 'Total requests' });
17
+ * requests.inc(1, { method: 'GET', status: '200' });
18
+ *
19
+ * console.log(registry.toPrometheus());
20
+ *
21
+ * @module @aleph-ai/tinyaleph/telemetry
22
+ */
23
+
24
+ module.exports = require('./metrics');
@@ -12,12 +12,12 @@
12
12
  * Extracted from apps/sentient/lib/telemetry.js for library reuse.
13
13
  */
14
14
 
15
- const { SimpleEventEmitter } = require('../core/errors');
16
-
17
15
  // ============================================================================
18
16
  // METRIC TYPES
19
17
  // ============================================================================
20
18
 
19
+ import { SimpleEventEmitter } from '../core/errors.js';
20
+
21
21
  const MetricType = {
22
22
  COUNTER: 'counter',
23
23
  GAUGE: 'gauge',
@@ -692,17 +692,12 @@ class MetricRegistry extends SimpleEventEmitter {
692
692
  // EXPORTS
693
693
  // ============================================================================
694
694
 
695
- module.exports = {
696
- // Metric types
695
+ export {
697
696
  MetricType,
698
-
699
- // Metric classes
700
697
  Metric,
701
698
  Counter,
702
699
  Gauge,
703
700
  Histogram,
704
701
  Summary,
705
-
706
- // Registry
707
702
  MetricRegistry
708
703
  };