@aleph-ai/tinyaleph 1.5.4 → 1.5.6

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/core/sieve.js CHANGED
@@ -53,7 +53,8 @@ class PrimeRegistry {
53
53
 
54
54
  class Sieve {
55
55
  constructor() {
56
- this.data = require('./data.json');
56
+ // Load data.json using ESM-compatible approach (fs already imported)
57
+ this.data = JSON.parse(fs.readFileSync(DATA_FILE, 'utf-8'));
57
58
 
58
59
  // Initialize Prime Registry with all currently used primes
59
60
  const usedPrimes = [
package/index.js CHANGED
@@ -20,5 +20,268 @@
20
20
  * @module @aleph-ai/tinyaleph
21
21
  */
22
22
 
23
- export * from './modular.js';
24
- export { default } from './modular.js';
23
+ import modular from './modular.js';
24
+
25
+ // Re-export all named exports from the default export object
26
+ export const {
27
+ // Main engine
28
+ AlephEngine,
29
+ createEngine,
30
+
31
+ // Backends
32
+ Backend,
33
+ SemanticBackend,
34
+ CryptographicBackend,
35
+ ScientificBackend,
36
+ BioinformaticsBackend,
37
+
38
+ // Bioinformatics operators
39
+ TranscriptionOperator,
40
+ TranslationOperator,
41
+ FoldingTransform,
42
+ BindingAffinityCalculator,
43
+ MolecularDocker,
44
+
45
+ // DNA Computing
46
+ DNAStrand,
47
+ DNACircuit,
48
+ ANDGate,
49
+ ORGate,
50
+ NOTGate,
51
+
52
+ // Core math
53
+ Hypercomplex,
54
+ FANO_LINES,
55
+ octonionMultiplyIndex,
56
+ sedenionMultiplyIndex,
57
+ multiplyIndices,
58
+ buildMultiplicationTable,
59
+
60
+ // Prime utilities
61
+ primeGenerator,
62
+ nthPrime,
63
+ primesUpTo,
64
+ isPrime,
65
+ factorize,
66
+ primeSignature,
67
+ firstNPrimes,
68
+ GaussianInteger,
69
+ EisensteinInteger,
70
+ primeToFrequency,
71
+ primeToAngle,
72
+ sumOfTwoSquares,
73
+ DEFAULT_PRIMES,
74
+
75
+ // Physics - Core oscillators
76
+ Oscillator,
77
+ OscillatorBank,
78
+ KuramotoModel,
79
+ // Extended sync models
80
+ NetworkKuramoto,
81
+ AdaptiveKuramoto,
82
+ SakaguchiKuramoto,
83
+ SmallWorldKuramoto,
84
+ MultiSystemCoupling,
85
+ createHierarchicalCoupling,
86
+ createPeerCoupling,
87
+ // Stochastic models
88
+ StochasticKuramoto,
89
+ ColoredNoiseKuramoto,
90
+ ThermalKuramoto,
91
+ gaussianRandom,
92
+ // Primeon Z-Ladder
93
+ PrimeonZLadderU,
94
+ createPrimeonLadder,
95
+ shannonEntropyNats,
96
+ probsOf,
97
+ normalizeComplex,
98
+ // Multi-channel ladder
99
+ ZChannel,
100
+ PrimeonZLadderMulti,
101
+ createMultiChannelLadder,
102
+ createAdiabaticSchedule,
103
+ // Kuramoto-coupled ladder
104
+ KuramotoCoupledLadder,
105
+ createKuramotoLadder,
106
+ runCollapsePressureExperiment,
107
+ kuramotoOrderParameter,
108
+ getPhase,
109
+ // Entropy & Information
110
+ shannonEntropy,
111
+ stateEntropy,
112
+ coherence,
113
+ mutualInformation,
114
+ relativeEntropy,
115
+ jointEntropy,
116
+ oscillatorEntropy,
117
+ estimateLyapunov,
118
+ classifyStability,
119
+ adaptiveCoupling,
120
+ localLyapunov,
121
+ delayEmbedding,
122
+ stabilityMargin,
123
+ collapseProbability,
124
+ shouldCollapse,
125
+ measureState,
126
+ collapseToIndex,
127
+ bornMeasurement,
128
+ partialCollapse,
129
+ applyDecoherence,
130
+
131
+ // Convenience functions
132
+ hash,
133
+ deriveKey,
134
+
135
+ // LLM client
136
+ LLM,
137
+
138
+ // Prime Hilbert Space (HP) - Quantum-like prime states
139
+ Complex,
140
+ PrimeState,
141
+ ResonanceOperators,
142
+ EntropyDrivenEvolution,
143
+ encodeMemory,
144
+ symbolicCompute,
145
+
146
+ // Prime Resonance Network - Non-local symbolic computing
147
+ PHI,
148
+ PHI_CONJ,
149
+ DELTA_S,
150
+ QuaternionPrime,
151
+ PrimeResonanceIdentity,
152
+ PhaseLockedRing,
153
+ HolographicField,
154
+ EntangledNode,
155
+ ResonantFragment,
156
+
157
+ // ResoFormer ML Primitives (H_Q = H_P ⊗ ℍ)
158
+ Quaternion,
159
+ SparsePrimeState,
160
+ resonanceScore,
161
+ resonantAttention,
162
+ hamiltonCompose,
163
+ measureNonCommutativity,
164
+ computeCoherence,
165
+ haltingDecision,
166
+ coherenceGatedCompute,
167
+ EntropyCollapseHead,
168
+ generateAttractorCodebook,
169
+ PRGraphMemory,
170
+ applyResonanceOperator,
171
+
172
+ // Sub-modules
173
+ core,
174
+ physics,
175
+ backends,
176
+ engine,
177
+
178
+ // Browser-compatible utilities (extracted from apps/sentient)
179
+ // Error handling
180
+ errors,
181
+ SimpleEventEmitter,
182
+ AlephError,
183
+ NetworkError,
184
+ LLMError,
185
+ ValidationError,
186
+ TimeoutError,
187
+ ErrorHandler,
188
+ withErrorHandling,
189
+ errorBoundary,
190
+ withTimeout,
191
+ LogLevel,
192
+ ErrorCategory,
193
+
194
+ // Logging
195
+ logger,
196
+ Logger,
197
+ createLogger,
198
+
199
+ // Metrics/Telemetry
200
+ metrics,
201
+ Counter,
202
+ Gauge,
203
+ Histogram,
204
+ Summary,
205
+ MetricRegistry,
206
+ MetricType,
207
+
208
+ // Observer Architecture (Sentient Observer core)
209
+ // SMF - Sedenion Memory Field
210
+ smf,
211
+ SedenionMemoryField,
212
+ SMF_AXES,
213
+ AXIS_INDEX,
214
+ SMF_CODEBOOK,
215
+ CODEBOOK_SIZE,
216
+ nearestCodebookAttractor,
217
+ codebookTunnel,
218
+ getTunnelingCandidates,
219
+
220
+ // PRSC - Prime Resonance Semantic Computation
221
+ prsc,
222
+ PRSCLayer,
223
+ PrimeOscillator,
224
+ EntanglementDetector,
225
+
226
+ // Temporal Layer
227
+ temporal,
228
+ TemporalLayer,
229
+ Moment,
230
+ TemporalPatternDetector,
231
+
232
+ // Entanglement Layer
233
+ entanglement,
234
+ EntanglementLayer,
235
+ EntangledPair,
236
+ Phrase,
237
+
238
+ // Agency Layer
239
+ agency,
240
+ AgencyLayer,
241
+ AttentionFocus,
242
+ Goal,
243
+ Action,
244
+
245
+ // Boundary Layer
246
+ boundary,
247
+ BoundaryLayer,
248
+ SensoryChannel,
249
+ MotorChannel,
250
+ EnvironmentalModel,
251
+ SelfModel,
252
+ ObjectivityGate,
253
+
254
+ // Safety Layer
255
+ safety,
256
+ SafetyLayer,
257
+ SafetyConstraint,
258
+ ViolationEvent,
259
+ SafetyMonitor,
260
+
261
+ // HQE - Holographic Quantum Encoding (discrete.pdf equations 12-15)
262
+ hqe,
263
+ TickGate,
264
+ StabilizationController,
265
+ HolographicEncoder,
266
+ HolographicMemory,
267
+ HolographicSimilarity,
268
+
269
+ // Enochian Packet Layer (Section 7.4 - prime-indexed twist encoding)
270
+ enochian,
271
+ enochianVocabulary,
272
+ ENOCHIAN_ALPHABET,
273
+ ENOCHIAN_LETTER_PRIMES,
274
+ ENOCHIAN_VOCABULARY,
275
+ ENOCHIAN_CALLS,
276
+ SedenionElement,
277
+ TwistOperator,
278
+ EnochianWord,
279
+ EnochianCall,
280
+ EnochianPacket,
281
+ EnochianEncoder,
282
+ EnochianDecoder,
283
+ EnhancedEnochianEncoder,
284
+ EnhancedEnochianDecoder
285
+ } = modular;
286
+
287
+ export default modular;
package/modular.js CHANGED
@@ -23,6 +23,27 @@
23
23
  * - Safety Layer - Ethical constraints and emergency shutdown
24
24
  */
25
25
 
26
+ // Core mathematical foundation
27
+ import core from './core/index.js';
28
+
29
+ // Enochian Packet Layer (Section 7.4 of whitepaper)
30
+ import enochian from './core/enochian.js';
31
+ import enochianVocabulary from './core/enochian-vocabulary.js';
32
+
33
+ // Browser-compatible utilities (extracted from apps/sentient)
34
+ import errors from './core/errors.js';
35
+ import logger from './core/logger.js';
36
+ import metrics from './telemetry/metrics.js';
37
+
38
+ // Observer architecture (Sentient Observer core modules)
39
+ import smf from './observer/smf.js';
40
+ import prsc from './observer/prsc.js';
41
+ import temporal from './observer/temporal.js';
42
+ import entanglement from './observer/entanglement.js';
43
+ import agency from './observer/agency.js';
44
+ import boundary from './observer/boundary.js';
45
+ import safety from './observer/safety.js';
46
+ import hqe from './observer/hqe.js';
26
47
 
27
48
  const {
28
49
  Hypercomplex,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aleph-ai/tinyaleph",
3
- "version": "1.5.4",
3
+ "version": "1.5.6",
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",
@@ -1,24 +1,40 @@
1
1
  /**
2
2
  * Telemetry module for TinyAleph
3
- *
3
+ *
4
4
  * Provides Prometheus/OpenTelemetry-compatible metric types:
5
5
  * - Counter: Monotonically increasing value
6
6
  * - Gauge: Value that can go up and down
7
7
  * - Histogram: Distribution of values in buckets
8
8
  * - Summary: Quantile distribution
9
- *
9
+ *
10
10
  * Browser-compatible: No Node.js dependencies.
11
- *
11
+ *
12
12
  * @example
13
13
  * import { MetricRegistry, Counter, Gauge } from '@aleph-ai/tinyaleph/telemetry';
14
- *
14
+ *
15
15
  * const registry = new MetricRegistry({ prefix: 'myapp_' });
16
16
  * const requests = registry.counter('requests_total', { help: 'Total requests' });
17
17
  * requests.inc(1, { method: 'GET', status: '200' });
18
- *
18
+ *
19
19
  * console.log(registry.toPrometheus());
20
- *
20
+ *
21
21
  * @module @aleph-ai/tinyaleph/telemetry
22
22
  */
23
23
 
24
- module.exports = require('./metrics');
24
+ // Re-export all from metrics
25
+ export * from './metrics.js';
26
+
27
+ // Import and re-export default
28
+ import metrics from './metrics.js';
29
+ export default metrics;
30
+
31
+ // Named exports for convenience
32
+ export {
33
+ MetricType,
34
+ Metric,
35
+ Counter,
36
+ Gauge,
37
+ Histogram,
38
+ Summary,
39
+ MetricRegistry
40
+ } from './metrics.js';