diff --git a/examples/edge-net/Cargo.toml b/examples/edge-net/Cargo.toml
index 5e2e66f3..9bbed1d5 100644
--- a/examples/edge-net/Cargo.toml
+++ b/examples/edge-net/Cargo.toml
@@ -98,4 +98,4 @@ opt-level = "s"
codegen-units = 1
[package.metadata.wasm-pack.profile.release]
-wasm-opt = ["-Os", "--enable-simd"]
+wasm-opt = false
diff --git a/examples/edge-net/pkg/LICENSE b/examples/edge-net/pkg/LICENSE
new file mode 100644
index 00000000..58b76705
--- /dev/null
+++ b/examples/edge-net/pkg/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2024 RuVector Team
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/examples/edge-net/pkg/README.md b/examples/edge-net/pkg/README.md
new file mode 100644
index 00000000..38840c65
--- /dev/null
+++ b/examples/edge-net/pkg/README.md
@@ -0,0 +1,1168 @@
+# @ruvector/edge-net
+
+**Collective AI Computing Network - Share, Contribute, Compute Together**
+
+A distributed computing platform that enables collective resource sharing for AI workloads. Contributors share idle compute resources, earning participation units (rUv) that can be used to access the network's collective AI computing power.
+
+```
+┌─────────────────────────────────────────────────────────────────────────────┐
+│ EDGE-NET: COLLECTIVE AI COMPUTING NETWORK │
+├─────────────────────────────────────────────────────────────────────────────┤
+│ │
+│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
+│ │ Your │ │ Collective │ │ AI Tasks │ │
+│ │ Browser │◄─────►│ Network │◄─────►│ Completed │ │
+│ │ (Idle CPU) │ P2P │ (1000s) │ │ for You │ │
+│ └─────────────┘ └─────────────┘ └─────────────┘ │
+│ │ │ │ │
+│ ▼ ▼ ▼ │
+│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
+│ │ Contribute │ │ Earn rUv │ │ Use rUv │ │
+│ │ Compute │ ───► │ Units │ ───► │ for AI │ │
+│ │ When Idle │ │ (Credits) │ │ Workloads │ │
+│ └─────────────┘ └─────────────┘ └─────────────┘ │
+│ │
+│ Vector Search │ Embeddings │ Semantic Match │ Encryption │ Compression │
+│ │
+└─────────────────────────────────────────────────────────────────────────────┘
+```
+
+## Table of Contents
+
+- [What is Edge-Net?](#what-is-edge-net)
+- [Key Features](#key-features)
+- [Quick Start](#quick-start)
+- [How It Works](#how-it-works)
+- [AI Computing Tasks](#ai-computing-tasks)
+- [Pi-Key Identity System](#pi-key-identity-system)
+- [Self-Optimization](#self-optimization)
+- [Tutorials](#tutorials)
+- [API Reference](#api-reference)
+- [Development](#development)
+- [Exotic AI Capabilities](#exotic-ai-capabilities)
+- [Core Architecture & Capabilities](#core-architecture--capabilities)
+- [Self-Learning Hooks & MCP Integration](#self-learning-hooks--mcp-integration)
+
+---
+
+## What is Edge-Net?
+
+Edge-net creates a **collective computing network** where participants share idle browser resources to power distributed AI workloads. Think of it as a cooperative where:
+
+1. **You Contribute** - Share unused CPU cycles when browsing
+2. **You Earn** - Accumulate rUv (Resource Utility Vouchers) based on contribution
+3. **You Use** - Spend rUv to run AI tasks across the collective network
+4. **Network Grows** - More participants = more collective computing power
+
+### Why Collective AI Computing?
+
+| Traditional AI Computing | Collective Edge-Net |
+|-------------------------|---------------------|
+| Expensive GPU servers | Free idle browser CPUs |
+| Centralized data centers | Distributed global network |
+| Pay-per-use pricing | Contribution-based access |
+| Single point of failure | Resilient P2P mesh |
+| Limited by your hardware | Scale with the collective |
+
+### Core Principles
+
+| Principle | Description |
+|-----------|-------------|
+| **Collectibility** | Resources are pooled and shared fairly |
+| **Contribution** | Earn by giving, spend by using |
+| **Self-Sustaining** | Network operates without central control |
+| **Privacy-First** | Pi-Key cryptographic identity system |
+| **Adaptive** | Q-learning security protects the collective |
+
+---
+
+## Key Features
+
+### Collective Resource Sharing
+
+| Feature | Benefit |
+|---------|---------|
+| **Idle CPU Utilization** | Use resources that would otherwise be wasted |
+| **Browser-Based** | No installation, runs in any modern browser |
+| **Adjustable Contribution** | Control how much you share (10-50% CPU) |
+| **Battery Aware** | Automatically reduces on battery power |
+| **Fair Distribution** | Work routed based on capability matching |
+
+### AI Computing Capabilities
+
+Edge-net provides a complete AI stack that runs entirely in your browser. Each component is designed to be lightweight, fast, and work without a central server.
+
+```
+┌─────────────────────────────────────────────────────────────────────────────┐
+│ AI INTELLIGENCE STACK │
+├─────────────────────────────────────────────────────────────────────────────┤
+│ │
+│ ┌─────────────────────────────────────────────────────────────────────┐ │
+│ │ MicroLoRA Adapter Pool (from ruvLLM) │ │
+│ │ • LRU-managed pool (16 slots) • Rank 1-16 adaptation │ │
+│ │ • <50µs rank-1 forward • 2,236+ ops/sec with batch 32 │ │
+│ │ • 4-bit/8-bit quantization • P2P shareable adapters │ │
+│ └─────────────────────────────────────────────────────────────────────┘ │
+│ │
+│ ┌─────────────────────────────────────────────────────────────────────┐ │
+│ │ SONA - Self-Optimizing Neural Architecture │ │
+│ │ • Instant Loop: Per-request MicroLoRA adaptation │ │
+│ │ • Background Loop: Hourly K-means consolidation │ │
+│ │ • Deep Loop: Weekly EWC++ consolidation (catastrophic forgetting) │ │
+│ └─────────────────────────────────────────────────────────────────────┘ │
+│ │
+│ ┌──────────────────────┐ ┌──────────────────────┐ ┌─────────────────┐ │
+│ │ HNSW Vector Index │ │ Federated Learning │ │ ReasoningBank │ │
+│ │ • 150x faster │ │ • TopK Sparsify 90% │ │ • Trajectories │ │
+│ │ • O(log N) search │ │ • Byzantine tolerant│ │ • Pattern learn │ │
+│ │ • Incremental P2P │ │ • Diff privacy │ │ • 87x energy │ │
+│ └──────────────────────┘ └──────────────────────┘ └─────────────────┘ │
+│ │
+└─────────────────────────────────────────────────────────────────────────────┘
+```
+
+#### Core AI Tasks
+
+| Task Type | Use Case | How It Works |
+|-----------|----------|--------------|
+| **Vector Search** | Find similar items | HNSW index with 150x speedup |
+| **Embeddings** | Text understanding | Generate semantic vectors |
+| **Semantic Match** | Intent detection | Classify meaning |
+| **LoRA Inference** | Task adaptation | MicroLoRA <100µs forward |
+| **Pattern Learning** | Self-optimization | ReasoningBank trajectories |
+
+---
+
+#### MicroLoRA Adapter System
+
+> **What it does:** Lets the network specialize for different tasks without retraining the whole model. Think of it like having 16 expert "hats" the AI can quickly swap between - one for searching, one for encryption, one for routing, etc.
+
+Ported from **ruvLLM** with enhancements for distributed compute:
+
+| Feature | Specification | Performance |
+|---------|--------------|-------------|
+| **Rank Support** | 1-16 | Rank-1: <50µs, Rank-2: <100µs |
+| **Pool Size** | 16 concurrent adapters | LRU eviction policy |
+| **Quantization** | 4-bit, 8-bit | 75% memory reduction |
+| **Batch Size** | 32 (optimal) | 2,236+ ops/sec |
+| **Task Types** | VectorSearch, Embedding, Inference, Crypto, Routing | Auto-routing |
+
+**Why it matters:** Traditional AI models are "one size fits all." MicroLoRA lets each node become a specialist for specific tasks in under 100 microseconds - faster than a blink.
+
+---
+
+#### SONA: Self-Optimizing Neural Architecture
+
+> **What it does:** The network teaches itself to get better over time using three learning speeds - instant reactions, daily improvements, and long-term memory. Like how your brain handles reflexes, daily learning, and permanent memories differently.
+
+Three-temporal-loop continuous learning system:
+
+| Loop | Interval | Mechanism | Purpose |
+|------|----------|-----------|---------|
+| **Instant** | Per-request | MicroLoRA rank-2 | Immediate adaptation |
+| **Background** | Hourly | K-means clustering | Pattern consolidation |
+| **Deep** | Weekly | EWC++ (λ=2000) | Prevent catastrophic forgetting |
+
+**Why it matters:** Most AI systems forget old knowledge when learning new things ("catastrophic forgetting"). SONA's three-loop design lets the network learn continuously without losing what it already knows.
+
+---
+
+#### HNSW Vector Index
+
+> **What it does:** Finds similar items incredibly fast by organizing data like a multi-level highway system. Instead of checking every item (like walking door-to-door), it takes smart shortcuts to find what you need 150x faster.
+
+| Parameter | Default | Description |
+|-----------|---------|-------------|
+| **M** | 32 | Max connections per node |
+| **M_max_0** | 64 | Max connections at layer 0 |
+| **ef_construction** | 200 | Build-time beam width |
+| **ef_search** | 64 | Search-time beam width |
+| **Performance** | 150x | Speedup vs linear scan |
+
+**Why it matters:** When searching millions of vectors, naive search takes seconds. HNSW takes milliseconds - essential for real-time AI responses.
+
+---
+
+#### Federated Learning
+
+> **What it does:** Nodes teach each other without sharing their private data. Each node trains on its own data, then shares only the "lessons learned" (gradients) - like students sharing study notes instead of copying each other's homework.
+
+P2P gradient gossip without central coordinator:
+
+| Feature | Mechanism | Benefit |
+|---------|-----------|---------|
+| **TopK Sparsification** | 90% compression | Only share the most important updates |
+| **Rep-Weighted FedAvg** | Reputation scoring | Trusted nodes have more influence |
+| **Byzantine Tolerance** | Outlier detection, clipping | Ignore malicious or broken nodes |
+| **Differential Privacy** | Noise injection | Mathematically guaranteed privacy |
+| **Gossip Protocol** | Eventually consistent | Works even if some nodes go offline |
+
+**Why it matters:** Traditional AI training requires sending all your data to a central server. Federated learning keeps your data local while still benefiting from collective intelligence.
+
+---
+
+#### ReasoningBank & Learning Intelligence
+
+> **What it does:** The network's "memory system" that remembers what worked and what didn't. Like keeping a journal of successful strategies that any node can learn from.
+
+| Component | What It Does | Why It's Fast |
+|-----------|--------------|---------------|
+| **ReasoningBank** | Stores successful task patterns | Semantic search for quick recall |
+| **Pattern Extractor** | Groups similar experiences together | K-means finds common patterns |
+| **Multi-Head Attention** | Decides which node handles each task | Parallel evaluation of options |
+| **Spike-Driven Attention** | Ultra-low-power decision making | 87x more energy efficient |
+
+**Why it matters:** Without memory, the network would repeat the same mistakes. ReasoningBank lets nodes learn from each other's successes and failures across the entire collective.
+
+### Pi-Key Identity System
+
+Ultra-compact cryptographic identity using mathematical constants:
+
+| Key Type | Size | Purpose |
+|----------|------|---------|
+| **π (Pi-Key)** | 40 bytes | Your permanent identity |
+| **e (Session)** | 34 bytes | Temporary encrypted sessions |
+| **φ (Genesis)** | 21 bytes | Network origin markers |
+
+### Self-Optimizing Network
+
+- **Automatic Task Routing** - Work goes to best-suited nodes
+- **Topology Optimization** - Network self-organizes for efficiency
+- **Q-Learning Security** - Learns to defend against threats
+- **Economic Balance** - Self-sustaining resource economy
+
+---
+
+## Quick Start
+
+### 1. Add to Your Website
+
+```html
+
+```
+
+### 2. Use the Collective's AI Power
+
+```javascript
+// Submit an AI task to the collective
+const result = await node.submitTask('vector_search', {
+ query: embeddings,
+ k: 10,
+ index: 'shared-knowledge-base'
+}, 5); // Spend up to 5 rUv
+
+console.log('Similar items:', result);
+```
+
+### 3. Monitor Your Contribution
+
+```javascript
+// Check your standing in the collective
+const stats = node.getStats();
+console.log(`
+ rUv Earned: ${stats.ruv_earned}
+ rUv Spent: ${stats.ruv_spent}
+ Net Balance: ${stats.ruv_earned - stats.ruv_spent}
+ Tasks Completed: ${stats.tasks_completed}
+ Reputation: ${(stats.reputation * 100).toFixed(1)}%
+`);
+```
+
+---
+
+## How It Works
+
+### The Contribution Cycle
+
+```
+┌─────────────────────────────────────────────────────────────────────────────┐
+│ CONTRIBUTION CYCLE │
+├─────────────────────────────────────────────────────────────────────────────┤
+│ │
+│ 1. CONTRIBUTE 2. EARN 3. USE │
+│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
+│ │ Browser │ │ rUv │ │ AI Tasks │ │
+│ │ detects │ ───► │ credited │ ───► │ submitted │ │
+│ │ idle time │ │ to you │ │ to network │ │
+│ └─────────────┘ └─────────────┘ └─────────────┘ │
+│ │ │ │ │
+│ ▼ ▼ ▼ │
+│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
+│ │ Process │ │ 10x boost │ │ Results │ │
+│ │ incoming │ │ for early │ │ returned │ │
+│ │ tasks │ │ adopters │ │ to you │ │
+│ └─────────────┘ └─────────────┘ └─────────────┘ │
+│ │
+└─────────────────────────────────────────────────────────────────────────────┘
+```
+
+### Network Growth Phases
+
+The collective grows through natural phases:
+
+| Phase | Size | Your Benefit |
+|-------|------|--------------|
+| **Genesis** | 0-10K nodes | 10x rUv multiplier (early adopter bonus) |
+| **Growth** | 10K-50K | Multiplier decreases, network strengthens |
+| **Maturation** | 50K-100K | Stable economy, high reliability |
+| **Independence** | 100K+ | Self-sustaining, maximum collective power |
+
+### Fair Resource Allocation
+
+```javascript
+// The network automatically optimizes task distribution
+const health = JSON.parse(node.getEconomicHealth());
+
+console.log(`
+ Resource Velocity: ${health.velocity} // How fast resources circulate
+ Utilization: ${health.utilization} // Network capacity used
+ Growth Rate: ${health.growth} // Network expansion
+ Stability: ${health.stability} // Economic equilibrium
+`);
+```
+
+---
+
+## AI Computing Tasks
+
+### Vector Search (Distributed Similarity)
+
+Find similar items across the collective's distributed index:
+
+```javascript
+// Search for similar documents
+const similar = await node.submitTask('vector_search', {
+ query: [0.1, 0.2, 0.3, ...], // Your query vector
+ k: 10, // Top 10 results
+ index: 'shared-docs' // Distributed index name
+}, 3); // Max 3 rUv
+
+// Results from across the network
+similar.forEach(item => {
+ console.log(`Score: ${item.score}, ID: ${item.id}`);
+});
+```
+
+### Embedding Generation
+
+Generate semantic embeddings using collective compute:
+
+```javascript
+// Generate embeddings for text
+const embeddings = await node.submitTask('embedding', {
+ text: 'Your text to embed',
+ model: 'sentence-transformer'
+}, 2);
+
+console.log('Embedding vector:', embeddings);
+```
+
+### Semantic Matching
+
+Classify intent or meaning:
+
+```javascript
+// Classify text intent
+const intent = await node.submitTask('semantic_match', {
+ text: 'I want to cancel my subscription',
+ categories: ['billing', 'support', 'sales', 'general']
+}, 1);
+
+console.log('Detected intent:', intent.category);
+```
+
+### Secure Operations
+
+Encrypt data across the network:
+
+```javascript
+// Distributed encryption
+const encrypted = await node.submitTask('encryption', {
+ data: sensitiveData,
+ operation: 'encrypt',
+ key_id: 'my-shared-key'
+}, 2);
+```
+
+---
+
+## Pi-Key Identity System
+
+Your identity in the collective uses mathematical constants for key sizes:
+
+### Key Types
+
+```
+┌─────────────────────────────────────────────────────────────────────────────┐
+│ PI-KEY IDENTITY SYSTEM │
+├─────────────────────────────────────────────────────────────────────────────┤
+│ │
+│ π Pi-Key (Identity) e Euler-Key (Session) φ Phi-Key (Genesis) │
+│ ┌─────────────────┐ ┌───────────────┐ ┌───────────────┐ │
+│ │ 314 bits │ │ 271 bits │ │ 161 bits │ │
+│ │ = 40 bytes │ │ = 34 bytes │ │ = 21 bytes │ │
+│ │ │ │ │ │ │ │
+│ │ Your unique │ │ Temporary │ │ Origin │ │
+│ │ identity │ │ sessions │ │ markers │ │
+│ │ (permanent) │ │ (encrypted) │ │ (network) │ │
+│ └─────────────────┘ └───────────────┘ └───────────────┘ │
+│ │
+│ Ed25519 Signing AES-256-GCM SHA-256 Derived │
+│ │
+└─────────────────────────────────────────────────────────────────────────────┘
+```
+
+### Using Pi-Keys
+
+```javascript
+import { PiKey, SessionKey, GenesisKey } from '@ruvector/edge-net';
+
+// Create your permanent identity
+const identity = new PiKey();
+console.log(`Your ID: ${identity.getShortId()}`); // π:a1b2c3d4...
+
+// Sign data
+const signature = identity.sign(data);
+const valid = identity.verify(data, signature, identity.getPublicKey());
+
+// Create encrypted backup
+const backup = identity.createEncryptedBackup('my-password');
+
+// Create temporary session
+const session = SessionKey.create(identity, 3600); // 1 hour
+const encrypted = session.encrypt(sensitiveData);
+const decrypted = session.decrypt(encrypted);
+```
+
+---
+
+## Security Architecture
+
+Edge-net implements production-grade cryptographic security:
+
+### Cryptographic Primitives
+
+| Component | Algorithm | Purpose |
+|-----------|-----------|---------|
+| **Key Derivation** | Argon2id (64MB, 3 iterations) | Memory-hard password hashing |
+| **Signing** | Ed25519 | Digital signatures (128-bit security) |
+| **Encryption** | AES-256-GCM | Authenticated encryption |
+| **Hashing** | SHA-256 | Content hashing and verification |
+
+### Identity Protection
+
+```rust
+// Password-protected key export with Argon2id + AES-256-GCM
+let encrypted = identity.export_secret_key("strong_password")?;
+
+// Secure memory cleanup (zeroize)
+// All sensitive key material is automatically zeroed after use
+```
+
+### Authority Verification
+
+All resolution events require cryptographic proof:
+
+```rust
+// Ed25519 signature verification for authority decisions
+let signature = ScopedAuthority::sign_resolution(&resolution, &context, &signing_key);
+// Signature verified against registered authority public keys
+```
+
+### Attack Resistance
+
+The RAC (RuVector Adversarial Coherence) protocol defends against:
+
+| Attack | Defense |
+|--------|---------|
+| **Sybil** | Stake-weighted voting, witness path diversity |
+| **Eclipse** | Context isolation, Merkle divergence detection |
+| **Byzantine** | 1/3 threshold, escalation tracking |
+| **Replay** | Timestamp validation, duplicate detection |
+| **Double-spend** | Conflict detection, quarantine system |
+
+---
+
+## Self-Optimization
+
+The network continuously improves itself:
+
+### Automatic Task Routing
+
+```javascript
+// Get optimal peers for your tasks
+const peers = node.getOptimalPeers(5);
+
+// Network learns from every interaction
+node.recordTaskRouting('vector_search', 'peer-123', 45, true);
+```
+
+### Fitness-Based Evolution
+
+```javascript
+// High-performing nodes can replicate their config
+if (node.shouldReplicate()) {
+ const optimalConfig = node.getRecommendedConfig();
+ // New nodes inherit successful configurations
+}
+
+// Track your contribution
+const fitness = node.getNetworkFitness(); // 0.0 - 1.0
+```
+
+### Q-Learning Security
+
+The collective learns to defend itself:
+
+```javascript
+// Run security audit
+const audit = JSON.parse(node.runSecurityAudit());
+console.log(`Security Score: ${audit.security_score}/10`);
+
+// Defends against:
+// - DDoS attacks
+// - Sybil attacks
+// - Byzantine behavior
+// - Eclipse attacks
+// - Replay attacks
+```
+
+---
+
+## Tutorials
+
+### Tutorial 1: Join the Collective
+
+```javascript
+import init, { EdgeNetConfig } from '@ruvector/edge-net';
+
+async function joinCollective() {
+ await init();
+
+ // Configure your contribution
+ const node = new EdgeNetConfig('my-site')
+ .cpuLimit(0.25) // 25% CPU when idle
+ .memoryLimit(128 * 1024 * 1024) // 128MB
+ .minIdleTime(5000) // Wait 5s of idle
+ .respectBattery(true) // Reduce on battery
+ .build();
+
+ // Join the network
+ node.start();
+
+ // Check your status
+ console.log('Joined collective!');
+ console.log(`Node ID: ${node.nodeId()}`);
+ console.log(`Multiplier: ${node.getMultiplier()}x`);
+
+ return node;
+}
+```
+
+### Tutorial 2: Contribute and Earn
+
+```javascript
+async function contributeAndEarn(node) {
+ // Process tasks from the collective
+ let tasksCompleted = 0;
+
+ while (true) {
+ // Check if we should work
+ if (node.isIdle()) {
+ // Process a task from the network
+ const processed = await node.processNextTask();
+
+ if (processed) {
+ tasksCompleted++;
+ const stats = node.getStats();
+ console.log(`Completed ${tasksCompleted} tasks, earned ${stats.ruv_earned} rUv`);
+ }
+ }
+
+ await new Promise(r => setTimeout(r, 1000));
+ }
+}
+```
+
+### Tutorial 3: Use Collective AI Power
+
+```javascript
+async function useCollectiveAI(node) {
+ // Check your balance
+ const balance = node.ruvBalance();
+ console.log(`Available: ${balance} rUv`);
+
+ // Submit AI tasks
+ const tasks = [
+ { type: 'vector_search', cost: 3 },
+ { type: 'embedding', cost: 2 },
+ { type: 'semantic_match', cost: 1 }
+ ];
+
+ for (const task of tasks) {
+ if (balance >= task.cost) {
+ console.log(`Running ${task.type}...`);
+ const result = await node.submitTask(
+ task.type,
+ { data: 'sample' },
+ task.cost
+ );
+ console.log(`Result: ${JSON.stringify(result)}`);
+ }
+ }
+}
+```
+
+### Tutorial 4: Monitor Network Health
+
+```javascript
+async function monitorHealth(node) {
+ setInterval(() => {
+ // Your contribution
+ const stats = node.getStats();
+ console.log(`
+ === Your Contribution ===
+ Earned: ${stats.ruv_earned} rUv
+ Spent: ${stats.ruv_spent} rUv
+ Tasks: ${stats.tasks_completed}
+ Reputation: ${(stats.reputation * 100).toFixed(1)}%
+ `);
+
+ // Network health
+ const health = JSON.parse(node.getEconomicHealth());
+ console.log(`
+ === Network Health ===
+ Velocity: ${health.velocity.toFixed(2)}
+ Utilization: ${(health.utilization * 100).toFixed(1)}%
+ Stability: ${health.stability.toFixed(2)}
+ `);
+
+ // Check sustainability
+ const sustainable = node.isSelfSustaining(10000, 50000);
+ console.log(`Self-sustaining: ${sustainable}`);
+
+ }, 30000);
+}
+```
+
+---
+
+## API Reference
+
+### Core Methods
+
+| Method | Description | Returns |
+|--------|-------------|---------|
+| `new EdgeNetNode(siteId)` | Join the collective | `EdgeNetNode` |
+| `start()` | Begin contributing | `void` |
+| `pause()` / `resume()` | Control contribution | `void` |
+| `ruvBalance()` | Check your credits | `u64` |
+| `submitTask(type, payload, maxCost)` | Use collective compute | `Promise` |
+| `processNextTask()` | Process work for others | `Promise` |
+
+### Identity Methods
+
+| Method | Description | Returns |
+|--------|-------------|---------|
+| `new PiKey()` | Generate identity | `PiKey` |
+| `getIdentity()` | Get 40-byte identity | `Vec` |
+| `sign(data)` | Sign data | `Vec` |
+| `verify(data, sig, pubkey)` | Verify signature | `bool` |
+| `createEncryptedBackup(password)` | Backup identity | `Vec` |
+
+### Network Methods
+
+| Method | Description | Returns |
+|--------|-------------|---------|
+| `getNetworkFitness()` | Your contribution score | `f32` |
+| `getOptimalPeers(count)` | Best nodes for tasks | `Vec` |
+| `getEconomicHealth()` | Network health metrics | `String (JSON)` |
+| `isSelfSustaining(nodes, tasks)` | Check sustainability | `bool` |
+
+---
+
+## Development
+
+### Build
+
+```bash
+cd examples/edge-net
+wasm-pack build --target web --out-dir pkg
+```
+
+### Test
+
+```bash
+cargo test
+```
+
+### Run Simulation
+
+```bash
+cd sim
+npm install
+npm run simulate
+```
+
+---
+
+## Exotic AI Capabilities
+
+Edge-net can be enhanced with exotic AI WASM capabilities for advanced P2P coordination, self-learning, and distributed reasoning. Enable these features by building with the appropriate feature flags.
+
+### Available Feature Flags
+
+| Feature | Description | Dependencies |
+|---------|-------------|--------------|
+| `exotic` | Time Crystal, NAO, Morphogenetic Networks | ruvector-exotic-wasm |
+| `learning-enhanced` | MicroLoRA, BTSP, HDC, WTA, Global Workspace | ruvector-learning-wasm, ruvector-nervous-system-wasm |
+| `economy-enhanced` | Enhanced CRDT credits | ruvector-economy-wasm |
+| `exotic-full` | All exotic capabilities | All above |
+
+### Time Crystal (P2P Synchronization)
+
+Robust distributed coordination using discrete time crystal dynamics:
+
+```javascript
+// Enable time crystal with 10 oscillators
+node.enableTimeCrystal(10);
+
+// Check synchronization level (0.0 - 1.0)
+const sync = node.getTimeCrystalSync();
+console.log(`P2P sync: ${(sync * 100).toFixed(1)}%`);
+
+// Check if crystal is stable
+if (node.isTimeCrystalStable()) {
+ console.log('Network is synchronized!');
+}
+```
+
+### NAO (Neural Autonomous Organization)
+
+Decentralized governance with stake-weighted quadratic voting:
+
+```javascript
+// Enable NAO with 70% quorum requirement
+node.enableNAO(0.7);
+
+// Add peer nodes as members
+node.addNAOMember('peer-123', 100);
+node.addNAOMember('peer-456', 50);
+
+// Propose and vote on network actions
+const propId = node.proposeNAOAction('Increase task capacity');
+node.voteNAOProposal(propId, 0.9); // Vote with 90% weight
+
+// Execute if quorum reached
+if (node.executeNAOProposal(propId)) {
+ console.log('Proposal executed!');
+}
+```
+
+### MicroLoRA (Per-Node Self-Learning)
+
+Ultra-fast LoRA adaptation with <100us latency:
+
+```javascript
+// Enable MicroLoRA with rank-2 adaptation
+node.enableMicroLoRA(2);
+
+// Adapt weights based on task feedback
+const gradient = new Float32Array(128);
+node.adaptMicroLoRA('vector_search', gradient);
+
+// Apply adaptation to inputs
+const input = new Float32Array(128);
+const adapted = node.applyMicroLoRA('vector_search', input);
+```
+
+### HDC (Hyperdimensional Computing)
+
+10,000-bit binary hypervectors for distributed reasoning:
+
+```javascript
+// Enable HDC memory
+node.enableHDC();
+
+// Store patterns for semantic operations
+node.storeHDCPattern('concept_a');
+node.storeHDCPattern('concept_b');
+```
+
+### WTA (Winner-Take-All)
+
+Instant decisions with <1us latency:
+
+```javascript
+// Enable WTA with 1000 neurons
+node.enableWTA(1000);
+```
+
+### BTSP (One-Shot Learning)
+
+Immediate pattern association without iterative training:
+
+```javascript
+// Enable BTSP with 128-dim inputs
+node.enableBTSP(128);
+
+// One-shot associate a pattern
+const pattern = new Float32Array(128);
+node.oneShotAssociate(pattern, 1.0);
+```
+
+### Morphogenetic Network
+
+Self-organizing network topology through cellular differentiation:
+
+```javascript
+// Enable 100x100 morphogenetic grid
+node.enableMorphogenetic(100);
+
+// Network grows automatically
+console.log(`Cells: ${node.getMorphogeneticCellCount()}`);
+```
+
+### Stepping All Capabilities
+
+In your main loop, step all capabilities forward:
+
+```javascript
+function gameLoop(dt) {
+ // Step exotic capabilities
+ node.stepCapabilities(dt);
+
+ // Process tasks
+ node.processNextTask();
+}
+
+setInterval(() => gameLoop(0.016), 16); // 60 FPS
+```
+
+### Building with Exotic Features
+
+```bash
+# Build with exotic capabilities
+wasm-pack build --target web --release --out-dir pkg -- --features exotic
+
+# Build with learning-enhanced capabilities
+wasm-pack build --target web --release --out-dir pkg -- --features learning-enhanced
+
+# Build with all exotic capabilities
+wasm-pack build --target web --release --out-dir pkg -- --features exotic-full
+```
+
+---
+
+## Core Architecture & Capabilities
+
+Edge-net is a production-grade distributed AI computing platform with **~36,500 lines of Rust code** and **177 passing tests**.
+
+### Unified Attention Architecture
+
+Four attention mechanisms that answer critical questions for distributed AI:
+
+```
+┌─────────────────────────────────────────────────────────────────────────────┐
+│ UNIFIED ATTENTION ARCHITECTURE │
+├─────────────────────────────────────────────────────────────────────────────┤
+│ │
+│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
+│ │ Neural Attention│ │ DAG Attention │ │ Graph Attention │ │
+│ │ │ │ │ │ │ │
+│ │ "What words │ │ "What steps │ │ "What relations │ │
+│ │ matter?" │ │ matter?" │ │ matter?" │ │
+│ │ │ │ │ │ │ │
+│ │ • Multi-head │ │ • Topo-sort │ │ • GAT-style │ │
+│ │ • Q/K/V project │ │ • Critical path │ │ • Edge features │ │
+│ │ • Softmax focus │ │ • Parallelism │ │ • Message pass │ │
+│ └─────────────────┘ └─────────────────┘ └─────────────────┘ │
+│ │
+│ ┌─────────────────────────────────────────────────────────────┐ │
+│ │ State Space Model (SSM) │ │
+│ │ │ │
+│ │ "What history still matters?" - O(n) Mamba-style │ │
+│ │ │ │
+│ │ • Selective gating: What to remember vs forget │ │
+│ │ • O(n) complexity: Efficient long-sequence processing │ │
+│ │ • Temporal dynamics: dt, A, B, C, D state transitions │ │
+│ └─────────────────────────────────────────────────────────────┘ │
+│ │
+└─────────────────────────────────────────────────────────────────────────────┘
+```
+
+| Attention Type | Question Answered | Use Case |
+|----------------|-------------------|----------|
+| **Neural** | What words matter? | Semantic focus, importance weighting |
+| **DAG** | What steps matter? | Task scheduling, critical path analysis |
+| **Graph** | What relationships matter? | Network topology, peer connections |
+| **State Space** | What history matters? | Long-term memory, temporal patterns |
+
+### AI Intelligence Layer
+
+```
+┌─────────────────────────────────────────────────────────────────────────────┐
+│ AI Intelligence Layer │
+├─────────────────────────────────────────────────────────────────────────────┤
+│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
+│ │ HNSW Index │ │ AdapterPool │ │ Federated │ │
+│ │ (memory.rs) │ │ (lora.rs) │ │ (federated.rs) │ │
+│ │ │ │ │ │ │ │
+│ │ • 150x speedup │ │ • LRU eviction │ │ • TopK Sparse │ │
+│ │ • O(log N) │ │ • 16 slots │ │ • Byzantine tol │ │
+│ │ • Cosine dist │ │ • Task routing │ │ • Rep-weighted │ │
+│ └─────────────────┘ └─────────────────┘ └─────────────────┘ │
+│ │
+│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
+│ │ DAG Attention │ │ LoraAdapter │ │ GradientGossip │ │
+│ │ │ │ │ │ │ │
+│ │ • Critical path │ │ • Rank 1-16 │ │ • Error feedback│ │
+│ │ • Topo sort │ │ • SIMD forward │ │ • Diff privacy │ │
+│ │ • Parallelism │ │ • 4/8-bit quant │ │ • Gossipsub │ │
+│ └─────────────────┘ └─────────────────┘ └─────────────────┘ │
+└─────────────────────────────────────────────────────────────────────────────┘
+```
+
+### Swarm Intelligence
+
+| Component | Capability | Description |
+|-----------|------------|-------------|
+| **Entropy Consensus** | Belief convergence | Shannon entropy-based decision making |
+| **Collective Memory** | Pattern sharing | Hippocampal-inspired consolidation and replay |
+| **Stigmergy** | Pheromone trails | Ant colony optimization for task routing |
+| **Consensus Coordinator** | Multi-topic | Parallel consensus on multiple decisions |
+
+### Compute Acceleration
+
+```
+┌─────────────────────────────────────────────────────────────────────────────┐
+│ COMPUTE ACCELERATION STACK │
+├─────────────────────────────────────────────────────────────────────────────┤
+│ │
+│ ┌─────────────────────────────────────────────────────────────────────┐ │
+│ │ WebGPU Compute Backend │ │
+│ │ │ │
+│ │ • wgpu-based GPU acceleration (10+ TFLOPS target) │ │
+│ │ • Matrix multiplication pipeline (tiled, cache-friendly) │ │
+│ │ • Attention pipeline (Flash Attention algorithm) │ │
+│ │ • LoRA forward pipeline (<1ms inference) │ │
+│ │ • Staging buffer pool (16MB, zero-copy transfers) │ │
+│ └─────────────────────────────────────────────────────────────────────┘ │
+│ │
+│ ┌─────────────────────────────────────────────────────────────────────┐ │
+│ │ WebWorker Pool │ │
+│ │ │ │
+│ │ +------------------+ │ │
+│ │ | Main Thread | │ │
+│ │ | (Coordinator) | │ │
+│ │ +--------+---------+ │ │
+│ │ | │ │
+│ │ +-----+-----+-----+-----+ │ │
+│ │ | | | | | │ │
+│ │ +--v-+ +-v--+ +--v-+ +--v-+ +--v-+ │ │
+│ │ | W1 | | W2 | | W3 | | W4 | | Wn | (up to 16 workers) │ │
+│ │ +----+ +----+ +----+ +----+ +----+ │ │
+│ │ | | | | | │ │
+│ │ +-----+-----+-----+-----+ │ │
+│ │ | │ │
+│ │ SharedArrayBuffer (when available, zero-copy) │ │
+│ └─────────────────────────────────────────────────────────────────────┘ │
+│ │
+│ ┌────────────────────────┐ ┌────────────────────────┐ │
+│ │ WASM SIMD (simd128) │ │ WebGL Compute │ │
+│ │ • f32x4 vectorized │ │ • Shader fallback │ │
+│ │ • 4x parallel ops │ │ • Universal support │ │
+│ │ • All modern browsers│ │ • Fragment matmul │ │
+│ └────────────────────────┘ └────────────────────────┘ │
+│ │
+└─────────────────────────────────────────────────────────────────────────────┘
+```
+
+| Backend | Availability | Performance | Operations |
+|---------|-------------|-------------|------------|
+| **WebGPU** | Chrome 113+, Firefox 120+ | 10+ TFLOPS | Matmul, Attention, LoRA |
+| **WebWorker Pool** | All browsers | 4-16x CPU cores | Parallel matmul, dot product |
+| **WASM SIMD** | All modern browsers | 4x vectorized | Cosine distance, softmax |
+| **WebGL** | Universal fallback | Shader compute | Matrix operations |
+| **CPU** | Always available | Loop-unrolled | All operations |
+
+### WebGPU Pipelines
+
+| Pipeline | Purpose | Performance Target |
+|----------|---------|-------------------|
+| **Matmul** | Matrix multiplication (tiled) | 10+ TFLOPS |
+| **Attention** | Flash attention (memory efficient) | 2ms for 4K context |
+| **LoRA** | Low-rank adapter forward pass | <1ms inference |
+
+### WebWorker Operations
+
+| Operation | Description | Parallelization |
+|-----------|-------------|-----------------|
+| **MatmulPartial** | Row-blocked matrix multiply | Rows split across workers |
+| **DotProductPartial** | Partial vector dot products | Segments split across workers |
+| **VectorOp** | Element-wise ops (add, mul, relu, sigmoid) | Ranges split across workers |
+| **Reduce** | Sum, max, min, mean reductions | Hierarchical aggregation |
+
+### Work Stealing
+
+Workers that finish early can steal tasks from busy workers' queues:
+- **LIFO** for local tasks (cache locality)
+- **FIFO** for stolen tasks (load balancing)
+
+### Economics & Reputation
+
+| Feature | Mechanism | Purpose |
+|---------|-----------|---------|
+| **AMM** | Automated Market Maker | Dynamic rUv pricing |
+| **Reputation** | Stake-weighted scoring | Trust computation |
+| **Slashing** | Byzantine penalties | Bad actor deterrence |
+| **Rewards** | Contribution tracking | Fair distribution |
+
+### Network Learning
+
+| Component | Learning Type | Application |
+|-----------|---------------|-------------|
+| **RAC** | Adversarial Coherence | Conflict resolution |
+| **ReasoningBank** | Trajectory learning | Strategy optimization |
+| **Q-Learning** | Reinforcement | Security adaptation |
+| **Federated** | Distributed training | Model improvement |
+
+---
+
+## Self-Learning Hooks & MCP Integration
+
+Edge-net integrates with Claude Code's hooks system for continuous self-learning.
+
+### Learning Scenarios Module
+
+```rust
+use ruvector_edge_net::learning_scenarios::{
+ NeuralAttention, DagAttention, GraphAttention, StateSpaceAttention,
+ AttentionOrchestrator, ErrorLearningTracker, SequenceTracker,
+ get_ruvector_tools, generate_settings_json,
+};
+
+// Create unified attention orchestrator
+let orchestrator = AttentionOrchestrator::new(
+ NeuralAttention::new(128, 4), // 128 dim, 4 heads
+ DagAttention::new(),
+ GraphAttention::new(64, 4), // 64 dim, 4 heads
+ StateSpaceAttention::new(256, 0.95), // 256 dim, 0.95 decay
+);
+
+// Get comprehensive attention analysis
+let analysis = orchestrator.analyze(tokens, &dag, &graph, &history);
+```
+
+### Error Pattern Learning
+
+```rust
+let mut tracker = ErrorLearningTracker::new();
+
+// Record errors for learning
+tracker.record_error(ErrorPattern::TypeMismatch, "expected String", "lib.rs", 42);
+
+// Get AI-suggested fixes
+let fixes = tracker.get_suggestions("type mismatch");
+// ["Use .to_string()", "Use String::from()", ...]
+```
+
+### MCP Tool Categories
+
+| Category | Tools | Purpose |
+|----------|-------|---------|
+| **VectorDb** | `vector_search`, `vector_store`, `vector_query` | Semantic similarity |
+| **Learning** | `learn_pattern`, `train_model`, `get_suggestions` | Pattern recognition |
+| **Memory** | `remember`, `recall`, `forget` | Vector memory |
+| **Swarm** | `spawn_agent`, `coordinate`, `route_task` | Multi-agent coordination |
+| **Telemetry** | `track_event`, `get_stats`, `export_metrics` | Usage analytics |
+| **AgentRouting** | `suggest_agent`, `record_outcome`, `get_routing_table` | Agent selection |
+
+### RuVector CLI Commands
+
+```bash
+# Session management
+ruvector hooks session-start # Start learning session
+ruvector hooks session-end # Save patterns
+
+# Intelligence
+ruvector hooks stats # Show learning stats
+ruvector hooks route # Get agent suggestion
+ruvector hooks suggest-context # Context suggestions
+
+# Memory
+ruvector hooks remember -t # Store memory
+ruvector hooks recall # Semantic search
+```
+
+### Claude Code Hook Events
+
+| Event | Trigger | Action |
+|-------|---------|--------|
+| `PreToolUse` | Before Edit/Bash | Agent routing, risk analysis |
+| `PostToolUse` | After Edit/Bash | Q-learning update, pattern recording |
+| `SessionStart` | Conversation begins | Load intelligence |
+| `Stop` | Conversation ends | Save learning data |
+| `UserPromptSubmit` | User message | Context suggestions |
+| `PreCompact` | Before compaction | Preserve context |
+
+---
+
+## Research Foundation
+
+Edge-net is built on research in:
+
+- **Distributed Computing** - P2P resource sharing
+- **Collective Intelligence** - Emergent optimization
+- **Game Theory** - Incentive-compatible mechanisms
+- **Adaptive Security** - Q-learning threat response
+- **Time Crystals** - Floquet engineering for coordination
+- **Neuromorphic Computing** - BTSP, HDC, WTA mechanisms
+- **Decentralized Governance** - Neural Autonomous Organizations
+
+---
+
+## Disclaimer
+
+Edge-net is a **research platform** for collective computing. The rUv units are:
+
+- Resource participation metrics, not currency
+- Used for balancing contribution and consumption
+- Not redeemable for money or goods outside the network
+
+---
+
+## Links
+
+- [Design Document](./DESIGN.md)
+- [Technical Report](./docs/FINAL_REPORT.md)
+- [Simulation Guide](./sim/README.md)
+- [RuVector GitHub](https://github.com/ruvnet/ruvector)
+
+## License
+
+MIT License
diff --git a/examples/edge-net/pkg/cli.js b/examples/edge-net/pkg/cli.js
new file mode 100755
index 00000000..f016e2c4
--- /dev/null
+++ b/examples/edge-net/pkg/cli.js
@@ -0,0 +1,275 @@
+#!/usr/bin/env node
+/**
+ * @ruvector/edge-net CLI
+ *
+ * Distributed compute intelligence network with Time Crystal coordination,
+ * Neural DAG attention, and P2P swarm intelligence.
+ *
+ * Usage:
+ * npx @ruvector/edge-net [command] [options]
+ *
+ * Commands:
+ * start Start an edge-net node
+ * benchmark Run performance benchmarks
+ * info Show package information
+ * demo Run interactive demo
+ */
+
+import { readFileSync, existsSync } from 'fs';
+import { fileURLToPath } from 'url';
+import { dirname, join } from 'path';
+
+const __filename = fileURLToPath(import.meta.url);
+const __dirname = dirname(__filename);
+
+// ANSI colors
+const colors = {
+ reset: '\x1b[0m',
+ bold: '\x1b[1m',
+ dim: '\x1b[2m',
+ cyan: '\x1b[36m',
+ green: '\x1b[32m',
+ yellow: '\x1b[33m',
+ blue: '\x1b[34m',
+ magenta: '\x1b[35m',
+ red: '\x1b[31m',
+};
+
+const c = (color, text) => `${colors[color]}${text}${colors.reset}`;
+
+function printBanner() {
+ console.log(`
+${c('cyan', '╔═══════════════════════════════════════════════════════════════╗')}
+${c('cyan', '║')} ${c('bold', '🌐 RuVector Edge-Net')} ${c('cyan', '║')}
+${c('cyan', '║')} ${c('dim', 'Distributed Compute Intelligence Network')} ${c('cyan', '║')}
+${c('cyan', '╚═══════════════════════════════════════════════════════════════╝')}
+`);
+}
+
+function printHelp() {
+ printBanner();
+ console.log(`${c('bold', 'USAGE:')}
+ ${c('green', 'npx @ruvector/edge-net')} ${c('yellow', '')} [options]
+
+${c('bold', 'COMMANDS:')}
+ ${c('green', 'start')} Start an edge-net node in the terminal
+ ${c('green', 'benchmark')} Run performance benchmarks
+ ${c('green', 'info')} Show package and WASM information
+ ${c('green', 'demo')} Run interactive demonstration
+ ${c('green', 'help')} Show this help message
+
+${c('bold', 'EXAMPLES:')}
+ ${c('dim', '# Start a node')}
+ $ npx @ruvector/edge-net start
+
+ ${c('dim', '# Run benchmarks')}
+ $ npx @ruvector/edge-net benchmark
+
+ ${c('dim', '# Show info')}
+ $ npx @ruvector/edge-net info
+
+${c('bold', 'FEATURES:')}
+ ${c('magenta', '⏱️ Time Crystal')} - Distributed coordination via period-doubled oscillations
+ ${c('magenta', '🔀 DAG Attention')} - Critical path analysis for task orchestration
+ ${c('magenta', '🧠 Neural NAO')} - Stake-weighted quadratic voting governance
+ ${c('magenta', '📊 HNSW Index')} - 150x faster semantic vector search
+ ${c('magenta', '🔗 P2P Swarm')} - Decentralized agent coordination
+
+${c('bold', 'BROWSER USAGE:')}
+ ${c('dim', 'import init, { EdgeNetNode } from "@ruvector/edge-net";')}
+ ${c('dim', 'await init();')}
+ ${c('dim', 'const node = new EdgeNetNode();')}
+
+${c('dim', 'Documentation: https://github.com/ruvnet/ruvector/tree/main/examples/edge-net')}
+`);
+}
+
+async function showInfo() {
+ printBanner();
+
+ // Read package.json
+ const pkgPath = join(__dirname, 'package.json');
+ const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
+
+ // Check WASM file
+ const wasmPath = join(__dirname, 'ruvector_edge_net_bg.wasm');
+ const wasmExists = existsSync(wasmPath);
+ let wasmSize = 0;
+ if (wasmExists) {
+ const stats = await import('fs').then(fs => fs.statSync(wasmPath));
+ wasmSize = stats.size;
+ }
+
+ console.log(`${c('bold', 'PACKAGE INFO:')}
+ ${c('cyan', 'Name:')} ${pkg.name}
+ ${c('cyan', 'Version:')} ${pkg.version}
+ ${c('cyan', 'License:')} ${pkg.license}
+ ${c('cyan', 'Type:')} ${pkg.type}
+
+${c('bold', 'WASM MODULE:')}
+ ${c('cyan', 'File:')} ruvector_edge_net_bg.wasm
+ ${c('cyan', 'Exists:')} ${wasmExists ? c('green', '✓ Yes') : c('red', '✗ No')}
+ ${c('cyan', 'Size:')} ${(wasmSize / 1024 / 1024).toFixed(2)} MB
+
+${c('bold', 'EXPORTS:')}
+ ${c('cyan', 'Main:')} ${pkg.main}
+ ${c('cyan', 'Types:')} ${pkg.types}
+ ${c('cyan', 'CLI:')} edge-net, ruvector-edge
+
+${c('bold', 'CAPABILITIES:')}
+ ${c('green', '✓')} Ed25519 digital signatures
+ ${c('green', '✓')} X25519 key exchange
+ ${c('green', '✓')} AES-GCM authenticated encryption
+ ${c('green', '✓')} Argon2 password hashing
+ ${c('green', '✓')} HNSW vector index (150x speedup)
+ ${c('green', '✓')} Time Crystal coordination
+ ${c('green', '✓')} DAG attention task orchestration
+ ${c('green', '✓')} Neural Autonomous Organization
+ ${c('green', '✓')} P2P gossip networking
+`);
+}
+
+async function runBenchmark() {
+ printBanner();
+ console.log(`${c('bold', 'Running Performance Benchmarks...')}\n`);
+
+ // Dynamic import for Node.js WASM support
+ try {
+ const wasm = await import('./ruvector_edge_net.js');
+ await wasm.default();
+
+ console.log(`${c('green', '✓')} WASM module loaded successfully\n`);
+
+ // Benchmark: Node creation
+ console.log(`${c('cyan', '1. Node Identity Creation')}`);
+ const startNode = performance.now();
+ const node = new wasm.EdgeNetNode();
+ const nodeTime = performance.now() - startNode;
+ console.log(` ${c('dim', 'Time:')} ${nodeTime.toFixed(2)}ms`);
+ console.log(` ${c('dim', 'Node ID:')} ${node.nodeId().substring(0, 16)}...`);
+
+ // Benchmark: Credit operations
+ console.log(`\n${c('cyan', '2. Credit Operations')}`);
+ const creditStart = performance.now();
+ for (let i = 0; i < 1000; i++) {
+ node.credit(100);
+ }
+ const creditTime = performance.now() - creditStart;
+ console.log(` ${c('dim', '1000 credits:')} ${creditTime.toFixed(2)}ms`);
+ console.log(` ${c('dim', 'Balance:')} ${node.balance()} tokens`);
+
+ // Benchmark: Statistics
+ console.log(`\n${c('cyan', '3. Node Statistics')}`);
+ const statsStart = performance.now();
+ const stats = node.stats();
+ const statsTime = performance.now() - statsStart;
+ console.log(` ${c('dim', 'Stats generation:')} ${statsTime.toFixed(2)}ms`);
+
+ const parsedStats = JSON.parse(stats);
+ console.log(` ${c('dim', 'Total credits:')} ${parsedStats.credits_earned || 0}`);
+
+ console.log(`\n${c('green', '✓ All benchmarks completed successfully!')}\n`);
+
+ } catch (err) {
+ console.error(`${c('red', '✗ Benchmark failed:')}\n`, err.message);
+ console.log(`\n${c('yellow', 'Note:')} Node.js WASM support requires specific setup.`);
+ console.log(`${c('dim', 'For full functionality, use in a browser environment.')}`);
+ }
+}
+
+async function startNode() {
+ printBanner();
+ console.log(`${c('bold', 'Starting Edge-Net Node...')}\n`);
+
+ try {
+ const wasm = await import('./ruvector_edge_net.js');
+ await wasm.default();
+
+ const node = new wasm.EdgeNetNode();
+
+ console.log(`${c('green', '✓')} Node started successfully!`);
+ console.log(`\n${c('bold', 'NODE INFO:')}`);
+ console.log(` ${c('cyan', 'ID:')} ${node.nodeId()}`);
+ console.log(` ${c('cyan', 'Balance:')} ${node.balance()} tokens`);
+ console.log(` ${c('cyan', 'Status:')} ${c('green', 'Active')}`);
+
+ console.log(`\n${c('dim', 'Press Ctrl+C to stop the node.')}`);
+
+ // Keep the process running
+ process.on('SIGINT', () => {
+ console.log(`\n${c('yellow', 'Shutting down node...')}`);
+ process.exit(0);
+ });
+
+ // Heartbeat
+ setInterval(() => {
+ node.credit(1); // Simulate earning
+ }, 5000);
+
+ } catch (err) {
+ console.error(`${c('red', '✗ Failed to start node:')}\n`, err.message);
+ console.log(`\n${c('yellow', 'Note:')} Node.js WASM requires web environment features.`);
+ console.log(`${c('dim', 'Consider using: node --experimental-wasm-modules')}`);
+ }
+}
+
+async function runDemo() {
+ printBanner();
+ console.log(`${c('bold', 'Running Interactive Demo...')}\n`);
+
+ console.log(`${c('cyan', 'Step 1:')} Creating edge-net node identity...`);
+ console.log(` ${c('dim', '→ Generating Ed25519 keypair')}`);
+ console.log(` ${c('dim', '→ Deriving X25519 DH key')}`);
+ console.log(` ${c('green', '✓')} Identity created\n`);
+
+ console.log(`${c('cyan', 'Step 2:')} Initializing AI capabilities...`);
+ console.log(` ${c('dim', '→ Time Crystal coordinator (8 oscillators)')}`);
+ console.log(` ${c('dim', '→ DAG attention engine')}`);
+ console.log(` ${c('dim', '→ HNSW vector index (128-dim)')}`);
+ console.log(` ${c('green', '✓')} AI layer initialized\n`);
+
+ console.log(`${c('cyan', 'Step 3:')} Connecting to P2P network...`);
+ console.log(` ${c('dim', '→ Gossipsub pubsub')}`);
+ console.log(` ${c('dim', '→ Semantic routing')}`);
+ console.log(` ${c('dim', '→ Swarm discovery')}`);
+ console.log(` ${c('green', '✓')} Network ready\n`);
+
+ console.log(`${c('cyan', 'Step 4:')} Joining compute marketplace...`);
+ console.log(` ${c('dim', '→ Registering compute capabilities')}`);
+ console.log(` ${c('dim', '→ Setting credit rate')}`);
+ console.log(` ${c('dim', '→ Listening for tasks')}`);
+ console.log(` ${c('green', '✓')} Marketplace joined\n`);
+
+ console.log(`${c('bold', '─────────────────────────────────────────────────')}`);
+ console.log(`${c('green', '✓ Demo complete!')} Node is ready to contribute compute.\n`);
+ console.log(`${c('dim', 'In production, the node would now:')}`);
+ console.log(` • Accept compute tasks from the network`);
+ console.log(` • Execute WASM workloads in isolated sandboxes`);
+ console.log(` • Earn credits for contributed compute`);
+ console.log(` • Participate in swarm coordination`);
+}
+
+// Main CLI handler
+const command = process.argv[2] || 'help';
+
+switch (command) {
+ case 'start':
+ startNode();
+ break;
+ case 'benchmark':
+ case 'bench':
+ runBenchmark();
+ break;
+ case 'info':
+ showInfo();
+ break;
+ case 'demo':
+ runDemo();
+ break;
+ case 'help':
+ case '--help':
+ case '-h':
+ default:
+ printHelp();
+ break;
+}
diff --git a/examples/edge-net/pkg/package.json b/examples/edge-net/pkg/package.json
index 4789ca39..fa2712bc 100644
--- a/examples/edge-net/pkg/package.json
+++ b/examples/edge-net/pkg/package.json
@@ -2,10 +2,14 @@
"name": "@ruvector/edge-net",
"version": "0.1.0",
"type": "module",
- "description": "Distributed compute intelligence network - contribute browser compute, earn credits. Add one script tag to participate in a P2P compute marketplace.",
- "main": "edge-net.js",
- "module": "edge-net.js",
- "types": "edge-net.d.ts",
+ "description": "Distributed compute intelligence network - contribute browser compute, earn credits. Features Time Crystal coordination, Neural DAG attention, and P2P swarm intelligence.",
+ "main": "ruvector_edge_net.js",
+ "module": "ruvector_edge_net.js",
+ "types": "ruvector_edge_net.d.ts",
+ "bin": {
+ "edge-net": "./cli.js",
+ "ruvector-edge": "./cli.js"
+ },
"keywords": [
"wasm",
"distributed-computing",
@@ -20,9 +24,13 @@
"edge-computing",
"vector-search",
"embeddings",
- "cryptography"
+ "cryptography",
+ "time-crystal",
+ "dag-attention",
+ "swarm-intelligence",
+ "neural-network"
],
- "author": "RuVector Team",
+ "author": "RuVector Team ",
"license": "MIT",
"repository": {
"type": "git",
@@ -33,51 +41,32 @@
"url": "https://github.com/ruvnet/ruvector/issues"
},
"files": [
- "edge-net_bg.wasm",
- "edge-net.js",
- "edge-net.min.js",
- "edge-net.d.ts",
- "edge-net_bg.wasm.d.ts",
- "worker.js",
- "worker-pool.js",
- "network.js",
- "widget.js",
- "widget.css",
+ "ruvector_edge_net_bg.wasm",
+ "ruvector_edge_net.js",
+ "ruvector_edge_net.d.ts",
+ "ruvector_edge_net_bg.wasm.d.ts",
+ "cli.js",
+ "README.md",
"LICENSE"
],
"exports": {
".": {
- "import": "./edge-net.js",
- "types": "./edge-net.d.ts"
+ "import": "./ruvector_edge_net.js",
+ "types": "./ruvector_edge_net.d.ts"
},
- "./worker": {
- "import": "./worker.js"
- },
- "./worker-pool": {
- "import": "./worker-pool.js"
- },
- "./network": {
- "import": "./network.js"
- },
- "./widget": {
- "import": "./widget.js"
+ "./wasm": {
+ "import": "./ruvector_edge_net_bg.wasm"
}
},
"sideEffects": [
"./snippets/*"
],
+ "engines": {
+ "node": ">=18.0.0"
+ },
"scripts": {
- "build": "cd .. && wasm-pack build --target web --out-dir pkg",
- "build:node": "cd .. && wasm-pack build --target nodejs --out-dir pkg-node",
- "bundle": "esbuild edge-net.js --bundle --minify --outfile=edge-net.min.js",
- "test": "wasm-pack test --headless --chrome"
- },
- "peerDependencies": {
- "gun": "^0.2020.0"
- },
- "peerDependenciesMeta": {
- "gun": {
- "optional": true
- }
+ "start": "node cli.js start",
+ "benchmark": "node cli.js benchmark",
+ "info": "node cli.js info"
}
}
diff --git a/examples/edge-net/pkg/ruvector_edge_net.d.ts b/examples/edge-net/pkg/ruvector_edge_net.d.ts
new file mode 100644
index 00000000..171ab7ed
--- /dev/null
+++ b/examples/edge-net/pkg/ruvector_edge_net.d.ts
@@ -0,0 +1,2939 @@
+/* tslint:disable */
+/* eslint-disable */
+
+export class AdaptiveSecurity {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Choose action using epsilon-greedy policy
+ */
+ chooseAction(state: string, available_actions: string): string;
+ /**
+ * Detect if request matches known attack pattern
+ */
+ detectAttack(features: Float32Array): number;
+ /**
+ * Export learned patterns for persistence
+ */
+ exportPatterns(): Uint8Array;
+ /**
+ * Import learned patterns
+ */
+ importPatterns(data: Uint8Array): void;
+ getMinReputation(): number;
+ getRateLimitMax(): number;
+ getSecurityLevel(): number;
+ /**
+ * Get current adaptive thresholds
+ */
+ getRateLimitWindow(): bigint;
+ /**
+ * Record attack pattern for learning
+ */
+ recordAttackPattern(pattern_type: string, features: Float32Array, severity: number): void;
+ /**
+ * Update network health metrics
+ */
+ updateNetworkHealth(active_nodes: number, suspicious_nodes: number, attacks_hour: number, false_positives: number, avg_response_ms: number): void;
+ getSpotCheckProbability(): number;
+ constructor();
+ /**
+ * Learn from security event outcome (batched for better performance)
+ */
+ learn(state: string, action: string, reward: number, next_state: string): void;
+ /**
+ * Get learning statistics
+ */
+ getStats(): string;
+}
+
+export class AdversarialSimulator {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Simulate DDoS attack
+ */
+ simulateDDoS(requests_per_second: number, duration_ms: bigint): string;
+ /**
+ * Simulate Sybil attack
+ */
+ simulateSybil(fake_nodes: number, same_fingerprint: boolean): string;
+ /**
+ * Enable chaos mode for continuous testing
+ */
+ enableChaosMode(enabled: boolean): void;
+ /**
+ * Run comprehensive security audit
+ */
+ runSecurityAudit(): string;
+ /**
+ * Simulate Byzantine node behavior
+ */
+ simulateByzantine(byzantine_nodes: number, total_nodes: number): string;
+ /**
+ * Get defence metrics
+ */
+ getDefenceMetrics(): string;
+ /**
+ * Get recommendations based on testing
+ */
+ getRecommendations(): string;
+ /**
+ * Generate chaos event
+ */
+ generateChaosEvent(): string | undefined;
+ /**
+ * Simulate free-riding attack
+ */
+ simulateFreeRiding(consumption_rate: number, contribution_rate: number): string;
+ /**
+ * Simulate double-spend attempt
+ */
+ simulateDoubleSpend(amount: bigint, concurrent_targets: number): string;
+ /**
+ * Simulate result tampering
+ */
+ simulateResultTampering(tamper_percentage: number): string;
+ constructor();
+}
+
+export class AuditLog {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Export events as JSON
+ */
+ exportEvents(): string;
+ /**
+ * Get events for a node
+ */
+ getEventsForNode(node_id: string): number;
+ /**
+ * Get events by severity
+ */
+ getEventsBySeverity(min_severity: number): number;
+ /**
+ * Log an event
+ */
+ log(event_type: string, node_id: string, details: string, severity: number): void;
+ constructor();
+}
+
+export class BrowserFingerprint {
+ private constructor();
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Generate anonymous uniqueness score
+ * This doesn't track users, just ensures one node per browser
+ */
+ static generate(): Promise;
+}
+
+export class ByzantineDetector {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Get maximum allowed magnitude
+ */
+ getMaxMagnitude(): number;
+ /**
+ * Create a new Byzantine detector
+ */
+ constructor(max_magnitude: number, zscore_threshold: number);
+}
+
+export class CoherenceEngine {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Get event log length
+ */
+ eventCount(): number;
+ /**
+ * Check if context has drifted
+ */
+ hasDrifted(context_hex: string): boolean;
+ /**
+ * Check if a claim can be used in decisions
+ */
+ canUseClaim(claim_id: string): boolean;
+ /**
+ * Get witness count for a claim
+ */
+ witnessCount(claim_id: string): number;
+ /**
+ * Get conflict count
+ */
+ conflictCount(): number;
+ /**
+ * Get current Merkle root
+ */
+ getMerkleRoot(): string;
+ /**
+ * Get quarantined claim count
+ */
+ quarantinedCount(): number;
+ /**
+ * Check quarantine level for a claim
+ */
+ getQuarantineLevel(claim_id: string): number;
+ /**
+ * Check if claim has sufficient witnesses
+ */
+ hasSufficientWitnesses(claim_id: string): boolean;
+ /**
+ * Create a new coherence engine
+ */
+ constructor();
+ /**
+ * Get drift for a context
+ */
+ getDrift(context_hex: string): number;
+ /**
+ * Get statistics as JSON
+ */
+ getStats(): string;
+}
+
+export class CollectiveMemory {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Get queue size
+ */
+ queueSize(): number;
+ /**
+ * Run consolidation (call during idle periods)
+ */
+ consolidate(): number;
+ /**
+ * Check if a pattern ID exists
+ */
+ hasPattern(pattern_id: string): boolean;
+ /**
+ * Get pattern count in shared index
+ */
+ patternCount(): number;
+ /**
+ * Create new collective memory with default config
+ */
+ constructor(node_id: string);
+ /**
+ * Search for similar patterns
+ */
+ search(query_json: string, k: number): string;
+ /**
+ * Get statistics as JSON
+ */
+ getStats(): string;
+}
+
+export class ContributionStream {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Check if streams are healthy
+ */
+ isHealthy(): boolean;
+ /**
+ * Process network fee distribution
+ */
+ processFees(total_fees: bigint, epoch: bigint): bigint;
+ /**
+ * Get total distributed
+ */
+ getTotalDistributed(): bigint;
+ constructor();
+}
+
+export class DifferentialPrivacy {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Check if DP is enabled
+ */
+ isEnabled(): boolean;
+ /**
+ * Get epsilon value
+ */
+ getEpsilon(): number;
+ /**
+ * Enable/disable differential privacy
+ */
+ setEnabled(enabled: boolean): void;
+ /**
+ * Create a new differential privacy module
+ */
+ constructor(epsilon: number, sensitivity: number);
+}
+
+export class DriftTracker {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Check if context has drifted beyond threshold
+ */
+ hasDrifted(context_hex: string): boolean;
+ /**
+ * Get contexts with significant drift
+ */
+ getDriftedContexts(): string;
+ /**
+ * Create a new drift tracker
+ */
+ constructor(drift_threshold: number);
+ /**
+ * Get drift for a context
+ */
+ getDrift(context_hex: string): number;
+}
+
+export class EconomicEngine {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Get economic health status
+ */
+ getHealth(): EconomicHealth;
+ /**
+ * Get treasury balance
+ */
+ getTreasury(): bigint;
+ /**
+ * Advance to next epoch
+ */
+ advanceEpoch(): void;
+ /**
+ * Process task completion and distribute rewards
+ */
+ processReward(base_amount: bigint, multiplier: number): RewardDistribution;
+ /**
+ * Get protocol fund balance (for development sustainability)
+ */
+ getProtocolFund(): bigint;
+ /**
+ * Check if network can sustain itself
+ */
+ isSelfSustaining(active_nodes: number, daily_tasks: bigint): boolean;
+ constructor();
+}
+
+export class EconomicHealth {
+ private constructor();
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Velocity of rUv (transactions per period)
+ */
+ velocity: number;
+ /**
+ * Network utilization rate
+ */
+ utilization: number;
+ /**
+ * Supply growth rate
+ */
+ growth_rate: number;
+ /**
+ * Stability index (0-1)
+ */
+ stability: number;
+}
+
+export class EdgeNetConfig {
+ free(): void;
+ [Symbol.dispose](): void;
+ memoryLimit(bytes: number): EdgeNetConfig;
+ minIdleTime(ms: number): EdgeNetConfig;
+ respectBattery(respect: boolean): EdgeNetConfig;
+ constructor(site_id: string);
+ build(): EdgeNetNode;
+ addRelay(url: string): EdgeNetConfig;
+ cpuLimit(limit: number): EdgeNetConfig;
+}
+
+export class EdgeNetNode {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Disconnect from the network
+ */
+ disconnect(): void;
+ /**
+ * Enable HDC for hyperdimensional computing
+ */
+ enableHDC(): boolean;
+ /**
+ * Enable Neural Autonomous Organization for governance
+ */
+ enableNAO(quorum: number): boolean;
+ /**
+ * Enable WTA for instant decisions
+ */
+ enableWTA(num_neurons: number): boolean;
+ /**
+ * Enable BTSP for one-shot learning
+ */
+ enableBTSP(input_dim: number): boolean;
+ /**
+ * Propose an action in the NAO
+ */
+ proposeNAO(action: string): string;
+ /**
+ * Alias for creditBalance - returns rUv balance
+ */
+ ruvBalance(): bigint;
+ /**
+ * Submit a task to the network
+ */
+ submitTask(task_type: string, payload: Uint8Array, max_credits: bigint): Promise;
+ /**
+ * Check for active celebration events
+ */
+ checkEvents(): string;
+ /**
+ * Get current throttle level (0.0 - 1.0)
+ */
+ getThrottle(): number;
+ /**
+ * Get treasury balance for operations
+ */
+ getTreasury(): bigint;
+ /**
+ * Check if a claim can be used (not quarantined)
+ */
+ canUseClaim(claim_id: string): boolean;
+ /**
+ * Process epoch for economic distribution
+ */
+ processEpoch(): void;
+ /**
+ * Store a learned pattern in the reasoning bank
+ */
+ storePattern(pattern_json: string): number;
+ /**
+ * Get current rUv (Resource Utility Voucher) balance
+ */
+ creditBalance(): bigint;
+ /**
+ * Get motivational message (subtle Easter egg)
+ */
+ getMotivation(): string;
+ /**
+ * Get current contribution multiplier based on network size
+ */
+ getMultiplier(): number;
+ /**
+ * Prune low-quality learned patterns
+ */
+ prunePatterns(min_usage: number, min_confidence: number): number;
+ /**
+ * Get current Merkle root for audit (Axiom 11: Equivocation detectable)
+ */
+ getMerkleRoot(): string;
+ /**
+ * Lookup similar patterns for task optimization
+ */
+ lookupPatterns(query_json: string, k: number): string;
+ /**
+ * Get all available exotic capabilities and their status
+ */
+ getCapabilities(): any;
+ /**
+ * Check if this node should replicate (high performer)
+ */
+ shouldReplicate(): boolean;
+ /**
+ * Enable MicroLoRA for self-learning
+ */
+ enableMicroLoRA(rank: number): boolean;
+ /**
+ * Get founding contributor count
+ */
+ getFounderCount(): number;
+ /**
+ * Get optimal peers for task routing
+ */
+ getOptimalPeers(count: number): string[];
+ /**
+ * Get stored pattern count
+ */
+ getPatternCount(): number;
+ /**
+ * Get protocol development fund balance
+ */
+ getProtocolFund(): bigint;
+ /**
+ * Get themed network status
+ */
+ getThemedStatus(node_count: number): string;
+ /**
+ * Get contribution stream health
+ */
+ isStreamHealthy(): boolean;
+ /**
+ * Process the next available task (called by worker)
+ */
+ processNextTask(): Promise;
+ /**
+ * Step all exotic capabilities forward
+ */
+ stepCapabilities(dt: number): void;
+ /**
+ * Get active conflict count (Axiom 6: Disagreement is signal)
+ */
+ getConflictCount(): number;
+ /**
+ * Get learning statistics
+ */
+ getLearningStats(): string;
+ /**
+ * Check if network is self-sustaining
+ */
+ isSelfSustaining(active_nodes: number, daily_tasks: bigint): boolean;
+ /**
+ * Record node performance for evolution
+ */
+ recordPerformance(success_rate: number, throughput: number): void;
+ /**
+ * Run security audit (adversarial testing)
+ */
+ runSecurityAudit(): string;
+ /**
+ * Enable Time Crystal for P2P synchronization
+ */
+ enableTimeCrystal(oscillators: number): boolean;
+ /**
+ * Get coherence statistics
+ */
+ getCoherenceStats(): string;
+ /**
+ * Get economic health metrics
+ */
+ getEconomicHealth(): string;
+ /**
+ * Get network fitness score (0-1)
+ */
+ getNetworkFitness(): number;
+ /**
+ * Record task routing outcome for optimization
+ */
+ recordTaskRouting(task_type: string, node_id: string, latency_ms: bigint, success: boolean): void;
+ /**
+ * Enable Morphogenetic Network for emergent topology
+ */
+ enableMorphogenetic(size: number): boolean;
+ /**
+ * Get trajectory count for learning analysis
+ */
+ getTrajectoryCount(): number;
+ /**
+ * Get energy efficiency ratio from spike-driven attention
+ */
+ getEnergyEfficiency(seq_len: number, hidden_dim: number): number;
+ /**
+ * Get quarantined claim count (Axiom 9: Quarantine is mandatory)
+ */
+ getQuarantinedCount(): number;
+ /**
+ * Get Time Crystal synchronization level (0.0 - 1.0)
+ */
+ getTimeCrystalSync(): number;
+ /**
+ * Get optimization statistics
+ */
+ getOptimizationStats(): string;
+ /**
+ * Get recommended configuration for new nodes
+ */
+ getRecommendedConfig(): string;
+ /**
+ * Enable Global Workspace for attention
+ */
+ enableGlobalWorkspace(capacity: number): boolean;
+ /**
+ * Record peer interaction for topology optimization
+ */
+ recordPeerInteraction(peer_id: string, success_rate: number): void;
+ /**
+ * Get capabilities summary as JSON
+ */
+ getCapabilitiesSummary(): any;
+ /**
+ * Get coherence engine event count
+ */
+ getCoherenceEventCount(): number;
+ /**
+ * Get quarantine level for a claim
+ */
+ getClaimQuarantineLevel(claim_id: string): number;
+ /**
+ * Record a task execution trajectory for learning
+ */
+ recordLearningTrajectory(trajectory_json: string): boolean;
+ /**
+ * Create a new EdgeNet node
+ */
+ constructor(site_id: string, config?: NodeConfig | null);
+ /**
+ * Pause contribution
+ */
+ pause(): void;
+ /**
+ * Start contributing to the network
+ */
+ start(): void;
+ /**
+ * Resume contribution
+ */
+ resume(): void;
+ /**
+ * Check if user is currently idle
+ */
+ isIdle(): boolean;
+ /**
+ * Get the node's unique identifier
+ */
+ nodeId(): string;
+ /**
+ * Vote on a NAO proposal
+ */
+ voteNAO(proposal_id: string, weight: number): boolean;
+ /**
+ * Get node statistics
+ */
+ getStats(): NodeStats;
+}
+
+export class EntropyConsensus {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Get belief probability for a decision
+ */
+ getBelief(decision_id: bigint): number;
+ /**
+ * Get number of negotiation rounds completed
+ */
+ getRounds(): number;
+ /**
+ * Set initial belief for a decision
+ */
+ setBelief(decision_id: bigint, probability: number): void;
+ /**
+ * Get the winning decision (if converged)
+ */
+ getDecision(): bigint | undefined;
+ /**
+ * Get number of decision options
+ */
+ optionCount(): number;
+ /**
+ * Check if negotiation has timed out
+ */
+ hasTimedOut(): boolean;
+ /**
+ * Set belief without normalizing (for batch updates)
+ * Call normalize_beliefs() after all set_belief_raw calls
+ */
+ set_belief_raw(decision_id: bigint, probability: number): void;
+ /**
+ * Create with custom entropy threshold
+ */
+ static withThreshold(threshold: number): EntropyConsensus;
+ /**
+ * Get current temperature (for annealing)
+ */
+ getTemperature(): number;
+ /**
+ * Manually trigger normalization (for use after set_belief_raw)
+ */
+ finalize_beliefs(): void;
+ /**
+ * Get entropy history as JSON
+ */
+ getEntropyHistory(): string;
+ /**
+ * Get the entropy threshold for convergence
+ */
+ getEntropyThreshold(): number;
+ /**
+ * Create new entropy consensus with default configuration
+ */
+ constructor();
+ /**
+ * Reset consensus state for new decision
+ */
+ reset(): void;
+ /**
+ * Get current entropy of belief distribution
+ */
+ entropy(): number;
+ /**
+ * Check if consensus has been reached
+ */
+ converged(): boolean;
+ /**
+ * Get consensus statistics as JSON
+ */
+ getStats(): string;
+}
+
+export class EventLog {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Get total event count
+ */
+ totalEvents(): number;
+ /**
+ * Get current event count (includes all events)
+ */
+ len(): number;
+ /**
+ * Create a new event log
+ */
+ constructor();
+ /**
+ * Get current Merkle root as hex string
+ */
+ getRoot(): string;
+ /**
+ * Check if log is empty
+ */
+ isEmpty(): boolean;
+}
+
+export class EvolutionEngine {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Check if node should replicate (spawn similar node)
+ */
+ shouldReplicate(node_id: string): boolean;
+ /**
+ * Record node performance for fitness evaluation
+ */
+ recordPerformance(node_id: string, success_rate: number, throughput: number): void;
+ /**
+ * Get network fitness score
+ */
+ getNetworkFitness(): number;
+ /**
+ * Get recommended configuration for new nodes
+ */
+ getRecommendedConfig(): string;
+ constructor();
+ /**
+ * Evolve patterns for next generation
+ */
+ evolve(): void;
+}
+
+export class FederatedModel {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Get parameter dimension
+ */
+ getDimension(): number;
+ /**
+ * Get parameters as array
+ */
+ getParameters(): Float32Array;
+ /**
+ * Set parameters from array
+ */
+ setParameters(params: Float32Array): void;
+ /**
+ * Apply aggregated gradients to update model
+ */
+ applyGradients(gradients: Float32Array): void;
+ /**
+ * Set local epochs per round
+ */
+ setLocalEpochs(epochs: number): void;
+ /**
+ * Set learning rate
+ */
+ setLearningRate(lr: number): void;
+ /**
+ * Create a new federated model
+ */
+ constructor(dimension: number, learning_rate: number, momentum: number);
+ /**
+ * Get current round
+ */
+ getRound(): bigint;
+}
+
+export class FoundingRegistry {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Process epoch distribution
+ */
+ processEpoch(current_epoch: bigint, available_amount: bigint): any[];
+ /**
+ * Calculate vested amount for current epoch
+ */
+ calculateVested(current_epoch: bigint, pool_balance: bigint): bigint;
+ /**
+ * Get founding contributor count
+ */
+ getFounderCount(): number;
+ /**
+ * Register additional founding contributor
+ */
+ registerContributor(id: string, category: string, weight: number): void;
+ constructor();
+}
+
+export class GenesisKey {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Get ID as hex
+ */
+ getIdHex(): string;
+ /**
+ * Export ultra-compact genesis key (21 bytes only)
+ */
+ exportUltraCompact(): Uint8Array;
+ /**
+ * Create a new genesis key
+ */
+ constructor(creator: PiKey, epoch: number);
+ /**
+ * Get the φ-sized genesis ID
+ */
+ getId(): Uint8Array;
+ /**
+ * Verify this genesis key was created by a specific Pi-Key
+ */
+ verify(creator_public_key: Uint8Array): boolean;
+ /**
+ * Get epoch
+ */
+ getEpoch(): number;
+}
+
+export class GenesisSunset {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Check if it's safe to retire genesis nodes
+ */
+ canRetire(): boolean;
+ /**
+ * Get sunset status
+ */
+ getStatus(): string;
+ /**
+ * Check if genesis nodes should be read-only
+ */
+ isReadOnly(): boolean;
+ /**
+ * Get current sunset phase
+ * 0 = Active (genesis required)
+ * 1 = Transition (stop new connections)
+ * 2 = Read-only (genesis read-only)
+ * 3 = Retired (genesis can be removed)
+ */
+ getCurrentPhase(): number;
+ /**
+ * Update network node count
+ */
+ updateNodeCount(count: number): number;
+ /**
+ * Check if network is self-sustaining
+ */
+ isSelfSustaining(): boolean;
+ /**
+ * Register a genesis node
+ */
+ registerGenesisNode(node_id: string): void;
+ /**
+ * Check if genesis nodes should accept new connections
+ */
+ shouldAcceptConnections(): boolean;
+ constructor();
+}
+
+export class GradientGossip {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Get number of active peers
+ */
+ peerCount(): number;
+ /**
+ * Prune stale peer gradients
+ */
+ pruneStale(): number;
+ /**
+ * Configure differential privacy
+ */
+ configureDifferentialPrivacy(epsilon: number, sensitivity: number): void;
+ /**
+ * Advance to next consensus round
+ */
+ advanceRound(): bigint;
+ /**
+ * Get gradient dimension
+ */
+ getDimension(): number;
+ /**
+ * Enable/disable differential privacy
+ */
+ setDPEnabled(enabled: boolean): void;
+ /**
+ * Set model hash for version compatibility
+ */
+ setModelHash(hash: Uint8Array): void;
+ /**
+ * Get current consensus round
+ */
+ getCurrentRound(): bigint;
+ /**
+ * Set local gradients from JavaScript
+ */
+ setLocalGradients(gradients: Float32Array): void;
+ /**
+ * Get compression ratio achieved
+ */
+ getCompressionRatio(): number;
+ /**
+ * Get aggregated gradients as JavaScript array
+ */
+ getAggregatedGradients(): Float32Array;
+ /**
+ * Create a new GradientGossip instance
+ *
+ * # Arguments
+ * * `local_peer_id` - 32-byte peer identifier
+ * * `dimension` - Gradient vector dimension
+ * * `k_ratio` - TopK sparsification ratio (0.1 = keep top 10%)
+ */
+ constructor(local_peer_id: Uint8Array, dimension: number, k_ratio: number);
+ /**
+ * Get statistics as JSON
+ */
+ getStats(): string;
+}
+
+export class ModelConsensusManager {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Get number of tracked models
+ */
+ modelCount(): number;
+ /**
+ * Get number of active disputes
+ */
+ disputeCount(): number;
+ /**
+ * Get number of quarantined updates
+ */
+ quarantinedUpdateCount(): number;
+ /**
+ * Create a new model consensus manager
+ */
+ constructor(min_witnesses: number);
+ /**
+ * Get statistics as JSON
+ */
+ getStats(): string;
+}
+
+export class MultiHeadAttention {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Get embedding dimension
+ */
+ dim(): number;
+ /**
+ * Create new multi-head attention
+ */
+ constructor(dim: number, num_heads: number);
+ /**
+ * Get number of heads
+ */
+ numHeads(): number;
+}
+
+export class NetworkEvents {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Get a subtle motivational message
+ */
+ getMotivation(balance: bigint): string;
+ /**
+ * Check for discovery triggers (Easter eggs)
+ */
+ checkDiscovery(action: string, node_id: string): string | undefined;
+ /**
+ * Get ASCII art for special occasions
+ */
+ getSpecialArt(): string | undefined;
+ /**
+ * Check milestone achievements
+ */
+ checkMilestones(balance: bigint, node_id: string): string;
+ /**
+ * Set current time (for testing)
+ */
+ setCurrentTime(timestamp: bigint): void;
+ /**
+ * Get network status with thematic flair
+ */
+ getThemedStatus(node_count: number, total_ruv: bigint): string;
+ /**
+ * Check for active special events
+ */
+ checkActiveEvents(): string;
+ /**
+ * Get celebration multiplier boost
+ */
+ getCelebrationBoost(): number;
+ constructor();
+}
+
+export class NetworkLearning {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Get pattern count
+ */
+ patternCount(): number;
+ /**
+ * Store a learned pattern
+ */
+ storePattern(pattern_json: string): number;
+ /**
+ * Look up similar patterns
+ */
+ lookupPatterns(query_json: string, k: number): string;
+ /**
+ * Get energy savings ratio for spike-driven attention
+ */
+ getEnergyRatio(seq_len: number, hidden_dim: number): number;
+ /**
+ * Get trajectory count
+ */
+ trajectoryCount(): number;
+ /**
+ * Record a task execution trajectory
+ */
+ recordTrajectory(trajectory_json: string): boolean;
+ /**
+ * Create new network learning intelligence
+ */
+ constructor();
+ /**
+ * Prune low-quality patterns
+ */
+ prune(min_usage: number, min_confidence: number): number;
+ /**
+ * Get combined statistics
+ */
+ getStats(): string;
+}
+
+export class NetworkTopology {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Register a node in the topology
+ */
+ registerNode(node_id: string, capabilities: Float32Array): void;
+ /**
+ * Get optimal peers for a node
+ */
+ getOptimalPeers(node_id: string, count: number): string[];
+ /**
+ * Update connection strength between nodes
+ */
+ updateConnection(from: string, to: string, success_rate: number): void;
+ constructor();
+}
+
+export class NodeConfig {
+ private constructor();
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Maximum CPU usage when idle (0.0 - 1.0)
+ */
+ cpu_limit: number;
+ /**
+ * Maximum memory usage in bytes
+ */
+ memory_limit: number;
+ /**
+ * Maximum bandwidth in bytes/sec
+ */
+ bandwidth_limit: number;
+ /**
+ * Minimum idle time before contributing (ms)
+ */
+ min_idle_time: number;
+ /**
+ * Whether to reduce contribution on battery
+ */
+ respect_battery: boolean;
+}
+
+export class NodeStats {
+ private constructor();
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Total rUv (Resource Utility Vouchers) earned
+ */
+ ruv_earned: bigint;
+ /**
+ * Total rUv spent
+ */
+ ruv_spent: bigint;
+ /**
+ * Tasks completed
+ */
+ tasks_completed: bigint;
+ /**
+ * Tasks submitted
+ */
+ tasks_submitted: bigint;
+ /**
+ * Total uptime in seconds
+ */
+ uptime_seconds: bigint;
+ /**
+ * Current reputation score (0.0 - 1.0)
+ */
+ reputation: number;
+ /**
+ * Current contribution multiplier
+ */
+ multiplier: number;
+ /**
+ * Active lifecycle events
+ */
+ celebration_boost: number;
+}
+
+export class OptimizationEngine {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Record task routing outcome
+ */
+ recordRouting(task_type: string, node_id: string, latency_ms: bigint, success: boolean): void;
+ /**
+ * Get optimal node for a task type
+ */
+ selectOptimalNode(task_type: string, candidates: string[]): string;
+ constructor();
+ /**
+ * Get optimization stats
+ */
+ getStats(): string;
+}
+
+export class PiKey {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Get the Pi-sized identity (40 bytes)
+ */
+ getIdentity(): Uint8Array;
+ /**
+ * Get short identity (first 8 bytes as hex)
+ */
+ getShortId(): string;
+ /**
+ * Export minimal key representation (Pi + Phi sized = 61 bytes total)
+ */
+ exportCompact(): Uint8Array;
+ /**
+ * Get public key for verification
+ */
+ getPublicKey(): Uint8Array;
+ /**
+ * Verify this key has Pi magic marker
+ */
+ verifyPiMagic(): boolean;
+ /**
+ * Get identity as hex string
+ */
+ getIdentityHex(): string;
+ /**
+ * Restore from encrypted backup (supports both v1 legacy and v2 Argon2id)
+ */
+ static restoreFromBackup(backup: Uint8Array, password: string): PiKey;
+ /**
+ * Create encrypted backup of private key using Argon2id KDF
+ */
+ createEncryptedBackup(password: string): Uint8Array;
+ /**
+ * Get the Phi-sized genesis fingerprint (21 bytes)
+ */
+ getGenesisFingerprint(): Uint8Array;
+ /**
+ * Sign data with this key
+ */
+ sign(data: Uint8Array): Uint8Array;
+ /**
+ * Verify signature from another Pi-Key
+ */
+ verify(data: Uint8Array, signature: Uint8Array, public_key: Uint8Array): boolean;
+ /**
+ * Generate a new Pi-Key with genesis linking
+ */
+ constructor(genesis_seed?: Uint8Array | null);
+ /**
+ * Get key statistics
+ */
+ getStats(): string;
+}
+
+export class QDAGLedger {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Export ledger state for sync
+ */
+ exportState(): Uint8Array;
+ /**
+ * Import ledger state from sync
+ */
+ importState(state_bytes: Uint8Array): number;
+ /**
+ * Get total supply
+ */
+ totalSupply(): bigint;
+ /**
+ * Get staked amount for a node
+ */
+ stakedAmount(node_id: string): bigint;
+ /**
+ * Create genesis transaction (called once at network start)
+ */
+ createGenesis(initial_supply: bigint, founder_pubkey: Uint8Array): Uint8Array;
+ /**
+ * Get transaction count
+ */
+ transactionCount(): number;
+ /**
+ * Create and validate a new transaction
+ */
+ createTransaction(sender_id: string, recipient_id: string, amount: bigint, tx_type: number, sender_privkey: Uint8Array, sender_pubkey: Uint8Array): Uint8Array;
+ /**
+ * Create a new QDAG ledger
+ */
+ constructor();
+ /**
+ * Get balance for a node
+ */
+ balance(node_id: string): bigint;
+ /**
+ * Get tip count
+ */
+ tipCount(): number;
+}
+
+export class QuarantineManager {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Get number of quarantined claims
+ */
+ quarantinedCount(): number;
+ /**
+ * Create a new quarantine manager
+ */
+ constructor();
+ /**
+ * Check if claim can be used in decisions
+ */
+ canUse(claim_id: string): boolean;
+ /**
+ * Check quarantine level for a claim
+ */
+ getLevel(claim_id: string): number;
+ /**
+ * Set quarantine level
+ */
+ setLevel(claim_id: string, level: number): void;
+}
+
+export class RacEconomicEngine {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Get summary statistics as JSON
+ */
+ getSummary(): string;
+ /**
+ * Check if node can participate (has stake + reputation)
+ */
+ canParticipate(node_id: Uint8Array): boolean;
+ /**
+ * Get combined score (stake-weighted reputation)
+ */
+ getCombinedScore(node_id: Uint8Array): number;
+ /**
+ * Create a new RAC economic engine
+ */
+ constructor();
+}
+
+export class RacSemanticRouter {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Get peer count
+ */
+ peerCount(): number;
+ /**
+ * Create a new semantic router
+ */
+ constructor();
+}
+
+export class RateLimiter {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Check if request is allowed
+ */
+ checkAllowed(node_id: string): boolean;
+ constructor(window_ms: bigint, max_requests: number);
+ /**
+ * Reset rate limiter
+ */
+ reset(): void;
+ /**
+ * Get current count for a node
+ */
+ getCount(node_id: string): number;
+}
+
+export class ReasoningBank {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Create a new ReasoningBank
+ */
+ constructor();
+ /**
+ * Get total pattern count
+ */
+ count(): number;
+ /**
+ * Prune low-quality patterns
+ */
+ prune(min_usage: number, min_confidence: number): number;
+ /**
+ * Store a new pattern (JSON format)
+ */
+ store(pattern_json: string): number;
+ /**
+ * Lookup most similar patterns (OPTIMIZED with spatial indexing)
+ */
+ lookup(query_json: string, k: number): string;
+ /**
+ * Get bank statistics
+ */
+ getStats(): string;
+}
+
+export class ReputationManager {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Get number of tracked nodes
+ */
+ nodeCount(): number;
+ /**
+ * Get effective reputation for a node (with decay applied)
+ */
+ getReputation(node_id: Uint8Array): number;
+ /**
+ * Get average network reputation
+ */
+ averageReputation(): number;
+ /**
+ * Check if node has sufficient reputation
+ */
+ hasSufficientReputation(node_id: Uint8Array): boolean;
+ /**
+ * Create a new reputation manager
+ */
+ constructor(decay_rate: number, decay_interval_ms: bigint);
+}
+
+export class ReputationSystem {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Get reputation score for a node
+ */
+ getReputation(node_id: string): number;
+ /**
+ * Record failed task completion
+ */
+ recordFailure(node_id: string): void;
+ /**
+ * Record penalty (fraud, invalid result)
+ */
+ recordPenalty(node_id: string, severity: number): void;
+ /**
+ * Record successful task completion
+ */
+ recordSuccess(node_id: string): void;
+ /**
+ * Check if node can participate
+ */
+ canParticipate(node_id: string): boolean;
+ constructor();
+}
+
+export class RewardDistribution {
+ private constructor();
+ free(): void;
+ [Symbol.dispose](): void;
+ total: bigint;
+ contributor_share: bigint;
+ treasury_share: bigint;
+ protocol_share: bigint;
+ founder_share: bigint;
+}
+
+export class RewardManager {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Get number of pending rewards
+ */
+ pendingCount(): number;
+ /**
+ * Get total pending reward amount
+ */
+ pendingAmount(): bigint;
+ /**
+ * Get claimable rewards for a node
+ */
+ claimableAmount(node_id: Uint8Array): bigint;
+ /**
+ * Create a new reward manager
+ */
+ constructor(default_vesting_ms: bigint);
+}
+
+export class SemanticRouter {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Get peer count
+ */
+ peerCount(): number;
+ /**
+ * Get topic count
+ */
+ topicCount(): number;
+ /**
+ * Create with custom parameters
+ */
+ static withParams(embedding_dim: number, semantic_neighbors: number, random_sample: number): SemanticRouter;
+ /**
+ * Set my peer identity
+ */
+ setMyPeerId(peer_id: Uint8Array): void;
+ /**
+ * Get active peer count (seen in last 60 seconds)
+ */
+ activePeerCount(): number;
+ /**
+ * Set my capabilities and update my centroid
+ */
+ setMyCapabilities(capabilities: string[]): void;
+ /**
+ * Create a new semantic router
+ */
+ constructor();
+ /**
+ * Get statistics as JSON
+ */
+ getStats(): string;
+}
+
+export class SessionKey {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Get ID as hex
+ */
+ getIdHex(): string;
+ /**
+ * Check if session is expired
+ */
+ isExpired(): boolean;
+ /**
+ * Get parent identity fingerprint
+ */
+ getParentIdentity(): Uint8Array;
+ /**
+ * Create a new session key linked to a Pi-Key identity
+ */
+ constructor(parent: PiKey, ttl_seconds: number);
+ /**
+ * Get the e-sized session ID
+ */
+ getId(): Uint8Array;
+ /**
+ * Decrypt data with this session key
+ */
+ decrypt(data: Uint8Array): Uint8Array;
+ /**
+ * Encrypt data with this session key
+ */
+ encrypt(plaintext: Uint8Array): Uint8Array;
+}
+
+export class SpikeDrivenAttention {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Create with custom parameters
+ */
+ static withConfig(threshold: number, steps: number, refractory: number): SpikeDrivenAttention;
+ /**
+ * Estimate energy savings ratio compared to standard attention
+ */
+ energyRatio(seq_len: number, hidden_dim: number): number;
+ /**
+ * Create new spike-driven attention with default config
+ */
+ constructor();
+}
+
+export class SpotChecker {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Check if a task should include a spot-check
+ */
+ shouldCheck(): boolean;
+ /**
+ * Add a known challenge-response pair
+ */
+ addChallenge(task_type: string, input: Uint8Array, expected_output: Uint8Array): void;
+ /**
+ * Get a random challenge for a task type
+ */
+ getChallenge(task_type: string): Uint8Array | undefined;
+ /**
+ * Verify a challenge response
+ */
+ verifyResponse(input_hash: Uint8Array, output: Uint8Array): boolean;
+ constructor(check_probability: number);
+}
+
+export class StakeManager {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Get number of stakers
+ */
+ stakerCount(): number;
+ /**
+ * Get total staked amount in network
+ */
+ totalStaked(): bigint;
+ /**
+ * Get minimum stake requirement
+ */
+ getMinStake(): bigint;
+ /**
+ * Check if node has sufficient stake
+ */
+ hasSufficientStake(node_id: Uint8Array): boolean;
+ /**
+ * Create a new stake manager
+ */
+ constructor(min_stake: bigint);
+ /**
+ * Get staked amount for a node
+ */
+ getStake(node_id: Uint8Array): bigint;
+}
+
+export class SwarmIntelligence {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Get queue size
+ */
+ queueSize(): number;
+ /**
+ * Set belief for a topic's decision
+ */
+ setBelief(topic: string, decision_id: bigint, probability: number): void;
+ /**
+ * Add pattern to collective memory
+ */
+ addPattern(pattern_json: string): boolean;
+ /**
+ * Run memory consolidation
+ */
+ consolidate(): number;
+ /**
+ * Check if topic has reached consensus
+ */
+ hasConsensus(topic: string): boolean;
+ /**
+ * Get collective memory pattern count
+ */
+ patternCount(): number;
+ /**
+ * Search collective memory
+ */
+ searchPatterns(query_json: string, k: number): string;
+ /**
+ * Start a new consensus round for a topic
+ */
+ startConsensus(topic: string, threshold: number): void;
+ /**
+ * Negotiate beliefs for a topic
+ */
+ negotiateBeliefs(topic: string, beliefs_json: string): boolean;
+ /**
+ * Get consensus decision for topic
+ */
+ getConsensusDecision(topic: string): bigint | undefined;
+ /**
+ * Create new swarm intelligence coordinator
+ */
+ constructor(node_id: string);
+ /**
+ * Run hippocampal replay
+ */
+ replay(): number;
+ /**
+ * Get node ID
+ */
+ nodeId(): string;
+ /**
+ * Get combined statistics as JSON
+ */
+ getStats(): string;
+}
+
+export class SybilDefense {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Register a node with its fingerprint
+ */
+ registerNode(node_id: string, fingerprint: string): boolean;
+ /**
+ * Get sybil score (0.0 = likely unique, 1.0 = likely sybil)
+ */
+ getSybilScore(node_id: string): number;
+ /**
+ * Check if node is likely a sybil
+ */
+ isSuspectedSybil(node_id: string): boolean;
+ constructor();
+}
+
+/**
+ * Task priority levels
+ */
+export enum TaskPriority {
+ Low = 0,
+ Normal = 1,
+ High = 2,
+}
+
+/**
+ * Task types supported by the network
+ */
+export enum TaskType {
+ /**
+ * Vector search in HNSW index
+ */
+ VectorSearch = 0,
+ /**
+ * Vector insertion
+ */
+ VectorInsert = 1,
+ /**
+ * Generate embeddings
+ */
+ Embedding = 2,
+ /**
+ * Semantic task-to-agent matching
+ */
+ SemanticMatch = 3,
+ /**
+ * Neural network inference
+ */
+ NeuralInference = 4,
+ /**
+ * AES encryption/decryption
+ */
+ Encryption = 5,
+ /**
+ * Data compression
+ */
+ Compression = 6,
+ /**
+ * Custom WASM module (requires verification)
+ */
+ CustomWasm = 7,
+}
+
+export class TopKSparsifier {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Reset error feedback buffer
+ */
+ resetErrorFeedback(): void;
+ /**
+ * Get compression ratio
+ */
+ getCompressionRatio(): number;
+ /**
+ * Get error feedback buffer size
+ */
+ getErrorBufferSize(): number;
+ /**
+ * Create a new TopK sparsifier
+ *
+ * # Arguments
+ * * `k_ratio` - Fraction of gradients to keep (0.1 = top 10%)
+ */
+ constructor(k_ratio: number);
+}
+
+export class TrajectoryTracker {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Create a new trajectory tracker
+ */
+ constructor(max_size: number);
+ /**
+ * Get count of trajectories
+ */
+ count(): number;
+ /**
+ * Record a new trajectory
+ */
+ record(trajectory_json: string): boolean;
+ /**
+ * Get statistics as JSON
+ */
+ getStats(): string;
+}
+
+export class WasmAdapterPool {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Get or create an adapter for a task type
+ */
+ getAdapter(task_type: string): any;
+ /**
+ * Get adapter count
+ */
+ adapterCount(): number;
+ /**
+ * Export adapter to bytes for P2P sharing
+ */
+ exportAdapter(task_type: string): Uint8Array;
+ /**
+ * Import adapter from bytes
+ */
+ importAdapter(task_type: string, bytes: Uint8Array): boolean;
+ /**
+ * Route to best adapter by task embedding
+ */
+ routeToAdapter(task_embedding: Float32Array): any;
+ /**
+ * Create a new adapter pool
+ */
+ constructor(hidden_dim: number, max_slots: number);
+ /**
+ * Apply adapter to input
+ */
+ forward(task_type: string, input: Float32Array): Float32Array;
+ /**
+ * Get pool statistics
+ */
+ getStats(): any;
+}
+
+export class WasmCapabilities {
+ free(): void;
+ [Symbol.dispose](): void;
+ enableHDC(): boolean;
+ enableNAO(_quorum: number): boolean;
+ enableWTA(_num_neurons: number, _inhibition: number, _threshold: number): boolean;
+ competeWTA(_activations: Float32Array): number;
+ enableBTSP(_input_dim: number, _time_constant: number): boolean;
+ executeNAO(_proposal_id: string): boolean;
+ /**
+ * Get a summary of all enabled capabilities
+ */
+ getSummary(): any;
+ proposeNAO(_action: string): string;
+ forwardBTSP(_input: Float32Array): number;
+ getNAOSync(): number;
+ retrieveHDC(_key: string, _threshold: number): any;
+ addNAOMember(_member_id: string, _stake: bigint): boolean;
+ adaptMicroLoRA(_operator_type: string, _gradient: Float32Array): boolean;
+ applyMicroLoRA(_operator_type: string, input: Float32Array): Float32Array;
+ /**
+ * List all available exotic capabilities
+ */
+ getCapabilities(): any;
+ enableMicroLoRA(_dim: number, _rank: number): boolean;
+ tickTimeCrystal(): any;
+ growMorphogenetic(_rate: number): void;
+ oneShotAssociate(_pattern: Float32Array, _target: number): boolean;
+ enableTimeCrystal(_oscillators: number, _period_ms: number): boolean;
+ pruneMorphogenetic(_threshold: number): void;
+ enableMorphogenetic(_width: number, _height: number): boolean;
+ getTimeCrystalSync(): number;
+ broadcastToWorkspace(_content: Float32Array, _salience: number, _source_module: number): boolean;
+ getWorkspaceContents(): any;
+ isTimeCrystalStable(): boolean;
+ enableGlobalWorkspace(_capacity: number): boolean;
+ getMorphogeneticStats(): any;
+ differentiateMorphogenetic(): void;
+ getMorphogeneticCellCount(): number;
+ /**
+ * Create a new capabilities manager for a node
+ */
+ constructor(node_id: string);
+ /**
+ * Step all enabled capabilities forward (for main loop integration)
+ */
+ step(dt: number): void;
+ tickNAO(_dt: number): void;
+ voteNAO(_proposal_id: string, _weight: number): boolean;
+ storeHDC(_key: string): boolean;
+}
+
+export class WasmCreditLedger {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Get total spent
+ */
+ totalSpent(): bigint;
+ /**
+ * Export spent counter for sync
+ */
+ exportSpent(): Uint8Array;
+ /**
+ * Get total earned (before spending)
+ */
+ totalEarned(): bigint;
+ /**
+ * Export earned counter for sync
+ */
+ exportEarned(): Uint8Array;
+ /**
+ * Get staked amount
+ */
+ stakedAmount(): bigint;
+ /**
+ * Get network compute hours (for multiplier)
+ */
+ networkCompute(): number;
+ /**
+ * Get current multiplier
+ */
+ currentMultiplier(): number;
+ /**
+ * Update network compute (from P2P sync)
+ */
+ updateNetworkCompute(hours: number): void;
+ /**
+ * Create a new credit ledger
+ */
+ constructor(node_id: string);
+ /**
+ * Merge with another ledger (CRDT merge) - optimized batch processing
+ */
+ merge(other_earned: Uint8Array, other_spent: Uint8Array): void;
+ /**
+ * Slash staked credits (penalty for bad behavior)
+ */
+ slash(amount: bigint): bigint;
+ /**
+ * Stake credits for participation
+ */
+ stake(amount: bigint): void;
+ /**
+ * Credit the ledger (earn credits)
+ */
+ credit(amount: bigint, reason: string): void;
+ /**
+ * Deduct from the ledger (spend credits)
+ */
+ deduct(amount: bigint): void;
+ /**
+ * Get current balance
+ */
+ balance(): bigint;
+ /**
+ * Unstake credits
+ */
+ unstake(amount: bigint): void;
+}
+
+export class WasmIdleDetector {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Get status summary
+ */
+ getStatus(): any;
+ /**
+ * Update FPS measurement
+ */
+ updateFps(fps: number): void;
+ /**
+ * Check if we should be working
+ */
+ shouldWork(): boolean;
+ /**
+ * Get current throttle level (0.0 - max_cpu)
+ */
+ getThrottle(): number;
+ /**
+ * Record user interaction
+ */
+ recordInteraction(): void;
+ /**
+ * Set battery status (called from JS)
+ */
+ setBatteryStatus(on_battery: boolean): void;
+ /**
+ * Create a new idle detector
+ */
+ constructor(max_cpu: number, min_idle_time: number);
+ /**
+ * Stop monitoring
+ */
+ stop(): void;
+ /**
+ * Pause contribution (user-initiated)
+ */
+ pause(): void;
+ /**
+ * Start monitoring
+ */
+ start(): void;
+ /**
+ * Resume contribution
+ */
+ resume(): void;
+ /**
+ * Check if user is idle
+ */
+ isIdle(): boolean;
+}
+
+export class WasmMcpBroadcast {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Set as server mode (responds to requests)
+ */
+ setServer(server: WasmMcpServer): void;
+ /**
+ * Create a broadcast transport
+ */
+ constructor(channel_name: string);
+ /**
+ * Send a request (client mode)
+ */
+ send(request_json: string): void;
+ /**
+ * Close the channel
+ */
+ close(): void;
+ /**
+ * Start listening for requests (server mode)
+ */
+ listen(): void;
+}
+
+export class WasmMcpServer {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Create with custom configuration
+ */
+ static withConfig(config: any): WasmMcpServer;
+ /**
+ * Set identity for authenticated operations
+ */
+ setIdentity(identity: WasmNodeIdentity): void;
+ /**
+ * Initialize learning engine
+ */
+ initLearning(): void;
+ /**
+ * Handle an MCP request (JSON string)
+ */
+ handleRequest(request_json: string): Promise;
+ /**
+ * Get server info
+ */
+ getServerInfo(): any;
+ /**
+ * Handle MCP request from JsValue (for direct JS calls)
+ */
+ handleRequestJs(request: any): Promise;
+ /**
+ * Create a new MCP server with default configuration
+ */
+ constructor();
+}
+
+export class WasmMcpTransport {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Create transport from a Worker
+ */
+ constructor(worker: Worker);
+ /**
+ * Initialize transport (set up message handler)
+ */
+ init(): void;
+ /**
+ * Send an MCP request and get a Promise for the response
+ */
+ send(request: any): Promise;
+ /**
+ * Close the transport
+ */
+ close(): void;
+ /**
+ * Create transport from existing MessagePort
+ */
+ static fromPort(port: MessagePort): WasmMcpTransport;
+}
+
+export class WasmMcpWorkerHandler {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Create handler with MCP server
+ */
+ constructor(server: WasmMcpServer);
+ /**
+ * Start handling messages (call in worker)
+ */
+ start(): void;
+}
+
+export class WasmNetworkManager {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Get peer count
+ */
+ peerCount(): number;
+ /**
+ * Check if connected
+ */
+ isConnected(): boolean;
+ /**
+ * Register a peer
+ */
+ registerPeer(node_id: string, pubkey: Uint8Array, capabilities: string[], stake: bigint): void;
+ /**
+ * Select workers for task execution (reputation-weighted random)
+ */
+ selectWorkers(capability: string, count: number): string[];
+ /**
+ * Get active peer count (seen in last 60s)
+ */
+ activePeerCount(): number;
+ /**
+ * Update peer reputation
+ */
+ updateReputation(node_id: string, delta: number): void;
+ /**
+ * Get peers with specific capability
+ */
+ getPeersWithCapability(capability: string): string[];
+ constructor(node_id: string);
+ /**
+ * Add a relay URL
+ */
+ addRelay(url: string): void;
+}
+
+export class WasmNodeIdentity {
+ private constructor();
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Verify a signature from another node
+ */
+ static verifyFrom(public_key: Uint8Array, message: Uint8Array, signature: Uint8Array): boolean;
+ /**
+ * Get the public key as hex string
+ */
+ publicKeyHex(): string;
+ /**
+ * Restore identity from secret key bytes
+ */
+ static fromSecretKey(secret_key: Uint8Array, site_id: string): WasmNodeIdentity;
+ /**
+ * Get browser fingerprint
+ */
+ getFingerprint(): string | undefined;
+ /**
+ * Set browser fingerprint for anti-sybil
+ */
+ setFingerprint(fingerprint: string): void;
+ /**
+ * Get the public key as bytes
+ */
+ publicKeyBytes(): Uint8Array;
+ /**
+ * Export secret key encrypted with password (secure backup)
+ * Uses Argon2id for key derivation and AES-256-GCM for encryption
+ */
+ exportSecretKey(password: string): Uint8Array;
+ /**
+ * Import secret key from encrypted backup
+ */
+ static importSecretKey(encrypted: Uint8Array, password: string, site_id: string): WasmNodeIdentity;
+ /**
+ * Sign a message
+ */
+ sign(message: Uint8Array): Uint8Array;
+ /**
+ * Verify a signature
+ */
+ verify(message: Uint8Array, signature: Uint8Array): boolean;
+ /**
+ * Get the node's unique identifier
+ */
+ nodeId(): string;
+ /**
+ * Get the site ID
+ */
+ siteId(): string;
+ /**
+ * Generate a new node identity
+ */
+ static generate(site_id: string): WasmNodeIdentity;
+}
+
+export class WasmStigmergy {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Create with custom parameters
+ */
+ static withParams(decay_rate: number, deposit_rate: number, evaporation_hours: number): WasmStigmergy;
+ /**
+ * Export current state for P2P sharing
+ */
+ exportState(): string;
+ /**
+ * Get raw pheromone intensity
+ */
+ getIntensity(task_type: string): number;
+ /**
+ * Set minimum stake for anti-sybil
+ */
+ setMinStake(min_stake: bigint): void;
+ /**
+ * Should this node accept a task? (combined decision)
+ */
+ shouldAccept(task_type: string): number;
+ /**
+ * Check and run evaporation if due
+ */
+ maybeEvaporate(): boolean;
+ /**
+ * Get all task types ranked by attractiveness
+ */
+ getRankedTasks(): string;
+ /**
+ * Get success rate for a task type
+ */
+ getSuccessRate(task_type: string): number;
+ /**
+ * Get node's specialization score
+ */
+ getSpecialization(task_type: string): number;
+ /**
+ * Deposit with success/failure outcome
+ */
+ depositWithOutcome(task_type: string, peer_id: string, success: boolean, stake: bigint): void;
+ /**
+ * Update node specialization based on outcome
+ */
+ updateSpecialization(task_type: string, success: boolean): void;
+ /**
+ * Get best specialization recommendation
+ */
+ getBestSpecialization(): string | undefined;
+ /**
+ * Create a new stigmergy engine
+ */
+ constructor();
+ /**
+ * Merge peer pheromone state (JSON format)
+ */
+ merge(peer_state_json: string): boolean;
+ /**
+ * Get acceptance probability for a task type
+ */
+ follow(task_type: string): number;
+ /**
+ * Deposit pheromone after task completion
+ */
+ deposit(task_type: string, peer_id: string, success_rate: number, stake: bigint): void;
+ /**
+ * Run evaporation (call periodically)
+ */
+ evaporate(): void;
+ /**
+ * Get statistics as JSON
+ */
+ getStats(): string;
+}
+
+export class WasmTaskExecutor {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Set encryption key for payload decryption
+ */
+ setTaskKey(key: Uint8Array): void;
+ /**
+ * Create a new task executor
+ */
+ constructor(max_memory: number);
+}
+
+export class WasmTaskQueue {
+ private constructor();
+ free(): void;
+ [Symbol.dispose](): void;
+}
+
+export class WasmWorkScheduler {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Calculate how many tasks to run this frame
+ */
+ tasksThisFrame(throttle: number): number;
+ /**
+ * Set pending task count
+ */
+ setPendingTasks(count: number): void;
+ /**
+ * Record task completion for averaging
+ */
+ recordTaskDuration(duration_ms: number): void;
+ constructor();
+}
+
+export class WitnessTracker {
+ free(): void;
+ [Symbol.dispose](): void;
+ /**
+ * Get witness count for a claim
+ */
+ witnessCount(claim_id: string): number;
+ /**
+ * Get confidence score based on witness diversity
+ */
+ witnessConfidence(claim_id: string): number;
+ /**
+ * Check if claim has sufficient independent witnesses
+ */
+ hasSufficientWitnesses(claim_id: string): boolean;
+ /**
+ * Create a new witness tracker
+ */
+ constructor(min_witnesses: number);
+}
+
+/**
+ * Initialize panic hook for better error messages in console
+ */
+export function init_panic_hook(): void;
+
+export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
+
+export interface InitOutput {
+ readonly memory: WebAssembly.Memory;
+ readonly __wbg_adaptivesecurity_free: (a: number, b: number) => void;
+ readonly __wbg_adversarialsimulator_free: (a: number, b: number) => void;
+ readonly __wbg_auditlog_free: (a: number, b: number) => void;
+ readonly __wbg_browserfingerprint_free: (a: number, b: number) => void;
+ readonly __wbg_byzantinedetector_free: (a: number, b: number) => void;
+ readonly __wbg_coherenceengine_free: (a: number, b: number) => void;
+ readonly __wbg_collectivememory_free: (a: number, b: number) => void;
+ readonly __wbg_contributionstream_free: (a: number, b: number) => void;
+ readonly __wbg_differentialprivacy_free: (a: number, b: number) => void;
+ readonly __wbg_drifttracker_free: (a: number, b: number) => void;
+ readonly __wbg_economicengine_free: (a: number, b: number) => void;
+ readonly __wbg_economichealth_free: (a: number, b: number) => void;
+ readonly __wbg_edgenetconfig_free: (a: number, b: number) => void;
+ readonly __wbg_edgenetnode_free: (a: number, b: number) => void;
+ readonly __wbg_entropyconsensus_free: (a: number, b: number) => void;
+ readonly __wbg_eventlog_free: (a: number, b: number) => void;
+ readonly __wbg_evolutionengine_free: (a: number, b: number) => void;
+ readonly __wbg_federatedmodel_free: (a: number, b: number) => void;
+ readonly __wbg_foundingregistry_free: (a: number, b: number) => void;
+ readonly __wbg_genesiskey_free: (a: number, b: number) => void;
+ readonly __wbg_genesissunset_free: (a: number, b: number) => void;
+ readonly __wbg_get_economichealth_growth_rate: (a: number) => number;
+ readonly __wbg_get_economichealth_stability: (a: number) => number;
+ readonly __wbg_get_economichealth_utilization: (a: number) => number;
+ readonly __wbg_get_economichealth_velocity: (a: number) => number;
+ readonly __wbg_get_nodeconfig_bandwidth_limit: (a: number) => number;
+ readonly __wbg_get_nodeconfig_memory_limit: (a: number) => number;
+ readonly __wbg_get_nodeconfig_min_idle_time: (a: number) => number;
+ readonly __wbg_get_nodeconfig_respect_battery: (a: number) => number;
+ readonly __wbg_get_nodestats_celebration_boost: (a: number) => number;
+ readonly __wbg_get_nodestats_multiplier: (a: number) => number;
+ readonly __wbg_get_nodestats_reputation: (a: number) => number;
+ readonly __wbg_get_nodestats_ruv_earned: (a: number) => bigint;
+ readonly __wbg_get_nodestats_ruv_spent: (a: number) => bigint;
+ readonly __wbg_get_nodestats_tasks_completed: (a: number) => bigint;
+ readonly __wbg_get_nodestats_tasks_submitted: (a: number) => bigint;
+ readonly __wbg_get_nodestats_uptime_seconds: (a: number) => bigint;
+ readonly __wbg_gradientgossip_free: (a: number, b: number) => void;
+ readonly __wbg_modelconsensusmanager_free: (a: number, b: number) => void;
+ readonly __wbg_networkevents_free: (a: number, b: number) => void;
+ readonly __wbg_networklearning_free: (a: number, b: number) => void;
+ readonly __wbg_networktopology_free: (a: number, b: number) => void;
+ readonly __wbg_nodeconfig_free: (a: number, b: number) => void;
+ readonly __wbg_nodestats_free: (a: number, b: number) => void;
+ readonly __wbg_optimizationengine_free: (a: number, b: number) => void;
+ readonly __wbg_pikey_free: (a: number, b: number) => void;
+ readonly __wbg_qdagledger_free: (a: number, b: number) => void;
+ readonly __wbg_quarantinemanager_free: (a: number, b: number) => void;
+ readonly __wbg_raceconomicengine_free: (a: number, b: number) => void;
+ readonly __wbg_racsemanticrouter_free: (a: number, b: number) => void;
+ readonly __wbg_ratelimiter_free: (a: number, b: number) => void;
+ readonly __wbg_reasoningbank_free: (a: number, b: number) => void;
+ readonly __wbg_reputationmanager_free: (a: number, b: number) => void;
+ readonly __wbg_reputationsystem_free: (a: number, b: number) => void;
+ readonly __wbg_rewarddistribution_free: (a: number, b: number) => void;
+ readonly __wbg_rewardmanager_free: (a: number, b: number) => void;
+ readonly __wbg_semanticrouter_free: (a: number, b: number) => void;
+ readonly __wbg_sessionkey_free: (a: number, b: number) => void;
+ readonly __wbg_set_economichealth_growth_rate: (a: number, b: number) => void;
+ readonly __wbg_set_economichealth_stability: (a: number, b: number) => void;
+ readonly __wbg_set_economichealth_utilization: (a: number, b: number) => void;
+ readonly __wbg_set_economichealth_velocity: (a: number, b: number) => void;
+ readonly __wbg_set_nodeconfig_bandwidth_limit: (a: number, b: number) => void;
+ readonly __wbg_set_nodeconfig_memory_limit: (a: number, b: number) => void;
+ readonly __wbg_set_nodeconfig_min_idle_time: (a: number, b: number) => void;
+ readonly __wbg_set_nodeconfig_respect_battery: (a: number, b: number) => void;
+ readonly __wbg_set_nodestats_celebration_boost: (a: number, b: number) => void;
+ readonly __wbg_set_nodestats_multiplier: (a: number, b: number) => void;
+ readonly __wbg_set_nodestats_reputation: (a: number, b: number) => void;
+ readonly __wbg_set_nodestats_ruv_earned: (a: number, b: bigint) => void;
+ readonly __wbg_set_nodestats_ruv_spent: (a: number, b: bigint) => void;
+ readonly __wbg_set_nodestats_tasks_completed: (a: number, b: bigint) => void;
+ readonly __wbg_set_nodestats_tasks_submitted: (a: number, b: bigint) => void;
+ readonly __wbg_set_nodestats_uptime_seconds: (a: number, b: bigint) => void;
+ readonly __wbg_spikedrivenattention_free: (a: number, b: number) => void;
+ readonly __wbg_spotchecker_free: (a: number, b: number) => void;
+ readonly __wbg_stakemanager_free: (a: number, b: number) => void;
+ readonly __wbg_swarmintelligence_free: (a: number, b: number) => void;
+ readonly __wbg_sybildefense_free: (a: number, b: number) => void;
+ readonly __wbg_topksparsifier_free: (a: number, b: number) => void;
+ readonly __wbg_trajectorytracker_free: (a: number, b: number) => void;
+ readonly __wbg_wasmadapterpool_free: (a: number, b: number) => void;
+ readonly __wbg_wasmcapabilities_free: (a: number, b: number) => void;
+ readonly __wbg_wasmcreditledger_free: (a: number, b: number) => void;
+ readonly __wbg_wasmidledetector_free: (a: number, b: number) => void;
+ readonly __wbg_wasmmcpbroadcast_free: (a: number, b: number) => void;
+ readonly __wbg_wasmmcpserver_free: (a: number, b: number) => void;
+ readonly __wbg_wasmmcptransport_free: (a: number, b: number) => void;
+ readonly __wbg_wasmmcpworkerhandler_free: (a: number, b: number) => void;
+ readonly __wbg_wasmnetworkmanager_free: (a: number, b: number) => void;
+ readonly __wbg_wasmnodeidentity_free: (a: number, b: number) => void;
+ readonly __wbg_wasmstigmergy_free: (a: number, b: number) => void;
+ readonly __wbg_wasmtaskexecutor_free: (a: number, b: number) => void;
+ readonly __wbg_wasmtaskqueue_free: (a: number, b: number) => void;
+ readonly __wbg_witnesstracker_free: (a: number, b: number) => void;
+ readonly adaptivesecurity_chooseAction: (a: number, b: number, c: number, d: number, e: number) => [number, number];
+ readonly adaptivesecurity_detectAttack: (a: number, b: number, c: number) => number;
+ readonly adaptivesecurity_exportPatterns: (a: number) => [number, number, number, number];
+ readonly adaptivesecurity_getMinReputation: (a: number) => number;
+ readonly adaptivesecurity_getRateLimitMax: (a: number) => number;
+ readonly adaptivesecurity_getRateLimitWindow: (a: number) => bigint;
+ readonly adaptivesecurity_getSecurityLevel: (a: number) => number;
+ readonly adaptivesecurity_getSpotCheckProbability: (a: number) => number;
+ readonly adaptivesecurity_getStats: (a: number) => [number, number];
+ readonly adaptivesecurity_importPatterns: (a: number, b: number, c: number) => [number, number];
+ readonly adaptivesecurity_learn: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
+ readonly adaptivesecurity_new: () => number;
+ readonly adaptivesecurity_recordAttackPattern: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
+ readonly adaptivesecurity_updateNetworkHealth: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
+ readonly adversarialsimulator_enableChaosMode: (a: number, b: number) => void;
+ readonly adversarialsimulator_generateChaosEvent: (a: number) => [number, number];
+ readonly adversarialsimulator_getDefenceMetrics: (a: number) => [number, number];
+ readonly adversarialsimulator_getRecommendations: (a: number) => [number, number];
+ readonly adversarialsimulator_new: () => number;
+ readonly adversarialsimulator_runSecurityAudit: (a: number) => [number, number];
+ readonly adversarialsimulator_simulateByzantine: (a: number, b: number, c: number) => [number, number];
+ readonly adversarialsimulator_simulateDDoS: (a: number, b: number, c: bigint) => [number, number];
+ readonly adversarialsimulator_simulateDoubleSpend: (a: number, b: bigint, c: number) => [number, number];
+ readonly adversarialsimulator_simulateFreeRiding: (a: number, b: number, c: number) => [number, number];
+ readonly adversarialsimulator_simulateResultTampering: (a: number, b: number) => [number, number];
+ readonly adversarialsimulator_simulateSybil: (a: number, b: number, c: number) => [number, number];
+ readonly auditlog_exportEvents: (a: number) => [number, number];
+ readonly auditlog_getEventsBySeverity: (a: number, b: number) => number;
+ readonly auditlog_getEventsForNode: (a: number, b: number, c: number) => number;
+ readonly auditlog_log: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
+ readonly auditlog_new: () => number;
+ readonly browserfingerprint_generate: () => any;
+ readonly byzantinedetector_getMaxMagnitude: (a: number) => number;
+ readonly byzantinedetector_new: (a: number, b: number) => number;
+ readonly coherenceengine_canUseClaim: (a: number, b: number, c: number) => number;
+ readonly coherenceengine_conflictCount: (a: number) => number;
+ readonly coherenceengine_eventCount: (a: number) => number;
+ readonly coherenceengine_getDrift: (a: number, b: number, c: number) => number;
+ readonly coherenceengine_getMerkleRoot: (a: number) => [number, number];
+ readonly coherenceengine_getQuarantineLevel: (a: number, b: number, c: number) => number;
+ readonly coherenceengine_getStats: (a: number) => [number, number];
+ readonly coherenceengine_hasDrifted: (a: number, b: number, c: number) => number;
+ readonly coherenceengine_hasSufficientWitnesses: (a: number, b: number, c: number) => number;
+ readonly coherenceengine_new: () => number;
+ readonly coherenceengine_quarantinedCount: (a: number) => number;
+ readonly coherenceengine_witnessCount: (a: number, b: number, c: number) => number;
+ readonly collectivememory_consolidate: (a: number) => number;
+ readonly collectivememory_getStats: (a: number) => [number, number];
+ readonly collectivememory_hasPattern: (a: number, b: number, c: number) => number;
+ readonly collectivememory_new: (a: number, b: number) => number;
+ readonly collectivememory_patternCount: (a: number) => number;
+ readonly collectivememory_queueSize: (a: number) => number;
+ readonly collectivememory_search: (a: number, b: number, c: number, d: number) => [number, number];
+ readonly contributionstream_getTotalDistributed: (a: number) => bigint;
+ readonly contributionstream_isHealthy: (a: number) => number;
+ readonly contributionstream_new: () => number;
+ readonly contributionstream_processFees: (a: number, b: bigint, c: bigint) => bigint;
+ readonly differentialprivacy_getEpsilon: (a: number) => number;
+ readonly differentialprivacy_isEnabled: (a: number) => number;
+ readonly differentialprivacy_new: (a: number, b: number) => number;
+ readonly differentialprivacy_setEnabled: (a: number, b: number) => void;
+ readonly drifttracker_getDrift: (a: number, b: number, c: number) => number;
+ readonly drifttracker_getDriftedContexts: (a: number) => [number, number];
+ readonly drifttracker_hasDrifted: (a: number, b: number, c: number) => number;
+ readonly drifttracker_new: (a: number) => number;
+ readonly economicengine_advanceEpoch: (a: number) => void;
+ readonly economicengine_getHealth: (a: number) => number;
+ readonly economicengine_getProtocolFund: (a: number) => bigint;
+ readonly economicengine_getTreasury: (a: number) => bigint;
+ readonly economicengine_isSelfSustaining: (a: number, b: number, c: bigint) => number;
+ readonly economicengine_new: () => number;
+ readonly economicengine_processReward: (a: number, b: bigint, c: number) => number;
+ readonly edgenetconfig_addRelay: (a: number, b: number, c: number) => number;
+ readonly edgenetconfig_build: (a: number) => [number, number, number];
+ readonly edgenetconfig_cpuLimit: (a: number, b: number) => number;
+ readonly edgenetconfig_memoryLimit: (a: number, b: number) => number;
+ readonly edgenetconfig_minIdleTime: (a: number, b: number) => number;
+ readonly edgenetconfig_new: (a: number, b: number) => number;
+ readonly edgenetconfig_respectBattery: (a: number, b: number) => number;
+ readonly edgenetnode_canUseClaim: (a: number, b: number, c: number) => number;
+ readonly edgenetnode_checkEvents: (a: number) => [number, number];
+ readonly edgenetnode_creditBalance: (a: number) => bigint;
+ readonly edgenetnode_disconnect: (a: number) => [number, number];
+ readonly edgenetnode_enableBTSP: (a: number, b: number) => number;
+ readonly edgenetnode_enableHDC: (a: number) => number;
+ readonly edgenetnode_enableNAO: (a: number, b: number) => number;
+ readonly edgenetnode_getCapabilities: (a: number) => any;
+ readonly edgenetnode_getCapabilitiesSummary: (a: number) => any;
+ readonly edgenetnode_getClaimQuarantineLevel: (a: number, b: number, c: number) => number;
+ readonly edgenetnode_getCoherenceEventCount: (a: number) => number;
+ readonly edgenetnode_getCoherenceStats: (a: number) => [number, number];
+ readonly edgenetnode_getConflictCount: (a: number) => number;
+ readonly edgenetnode_getEconomicHealth: (a: number) => [number, number];
+ readonly edgenetnode_getEnergyEfficiency: (a: number, b: number, c: number) => number;
+ readonly edgenetnode_getFounderCount: (a: number) => number;
+ readonly edgenetnode_getLearningStats: (a: number) => [number, number];
+ readonly edgenetnode_getMerkleRoot: (a: number) => [number, number];
+ readonly edgenetnode_getMotivation: (a: number) => [number, number];
+ readonly edgenetnode_getMultiplier: (a: number) => number;
+ readonly edgenetnode_getNetworkFitness: (a: number) => number;
+ readonly edgenetnode_getOptimalPeers: (a: number, b: number) => [number, number];
+ readonly edgenetnode_getOptimizationStats: (a: number) => [number, number];
+ readonly edgenetnode_getPatternCount: (a: number) => number;
+ readonly edgenetnode_getProtocolFund: (a: number) => bigint;
+ readonly edgenetnode_getQuarantinedCount: (a: number) => number;
+ readonly edgenetnode_getRecommendedConfig: (a: number) => [number, number];
+ readonly edgenetnode_getStats: (a: number) => number;
+ readonly edgenetnode_getThemedStatus: (a: number, b: number) => [number, number];
+ readonly edgenetnode_getThrottle: (a: number) => number;
+ readonly edgenetnode_getTimeCrystalSync: (a: number) => number;
+ readonly edgenetnode_getTrajectoryCount: (a: number) => number;
+ readonly edgenetnode_getTreasury: (a: number) => bigint;
+ readonly edgenetnode_isIdle: (a: number) => number;
+ readonly edgenetnode_isSelfSustaining: (a: number, b: number, c: bigint) => number;
+ readonly edgenetnode_isStreamHealthy: (a: number) => number;
+ readonly edgenetnode_lookupPatterns: (a: number, b: number, c: number, d: number) => [number, number];
+ readonly edgenetnode_new: (a: number, b: number, c: number) => [number, number, number];
+ readonly edgenetnode_nodeId: (a: number) => [number, number];
+ readonly edgenetnode_pause: (a: number) => void;
+ readonly edgenetnode_processEpoch: (a: number) => void;
+ readonly edgenetnode_processNextTask: (a: number) => any;
+ readonly edgenetnode_proposeNAO: (a: number, b: number, c: number) => [number, number];
+ readonly edgenetnode_prunePatterns: (a: number, b: number, c: number) => number;
+ readonly edgenetnode_recordLearningTrajectory: (a: number, b: number, c: number) => number;
+ readonly edgenetnode_recordPeerInteraction: (a: number, b: number, c: number, d: number) => void;
+ readonly edgenetnode_recordPerformance: (a: number, b: number, c: number) => void;
+ readonly edgenetnode_recordTaskRouting: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number) => void;
+ readonly edgenetnode_resume: (a: number) => void;
+ readonly edgenetnode_runSecurityAudit: (a: number) => [number, number];
+ readonly edgenetnode_shouldReplicate: (a: number) => number;
+ readonly edgenetnode_start: (a: number) => [number, number];
+ readonly edgenetnode_stepCapabilities: (a: number, b: number) => void;
+ readonly edgenetnode_storePattern: (a: number, b: number, c: number) => number;
+ readonly edgenetnode_submitTask: (a: number, b: number, c: number, d: number, e: number, f: bigint) => any;
+ readonly edgenetnode_voteNAO: (a: number, b: number, c: number, d: number) => number;
+ readonly entropyconsensus_converged: (a: number) => number;
+ readonly entropyconsensus_entropy: (a: number) => number;
+ readonly entropyconsensus_finalize_beliefs: (a: number) => void;
+ readonly entropyconsensus_getBelief: (a: number, b: bigint) => number;
+ readonly entropyconsensus_getDecision: (a: number) => [number, bigint];
+ readonly entropyconsensus_getEntropyHistory: (a: number) => [number, number];
+ readonly entropyconsensus_getEntropyThreshold: (a: number) => number;
+ readonly entropyconsensus_getRounds: (a: number) => number;
+ readonly entropyconsensus_getStats: (a: number) => [number, number];
+ readonly entropyconsensus_getTemperature: (a: number) => number;
+ readonly entropyconsensus_hasTimedOut: (a: number) => number;
+ readonly entropyconsensus_new: () => number;
+ readonly entropyconsensus_optionCount: (a: number) => number;
+ readonly entropyconsensus_reset: (a: number) => void;
+ readonly entropyconsensus_setBelief: (a: number, b: bigint, c: number) => void;
+ readonly entropyconsensus_set_belief_raw: (a: number, b: bigint, c: number) => void;
+ readonly entropyconsensus_withThreshold: (a: number) => number;
+ readonly eventlog_getRoot: (a: number) => [number, number];
+ readonly eventlog_isEmpty: (a: number) => number;
+ readonly eventlog_len: (a: number) => number;
+ readonly eventlog_new: () => number;
+ readonly evolutionengine_evolve: (a: number) => void;
+ readonly evolutionengine_getNetworkFitness: (a: number) => number;
+ readonly evolutionengine_getRecommendedConfig: (a: number) => [number, number];
+ readonly evolutionengine_new: () => number;
+ readonly evolutionengine_recordPerformance: (a: number, b: number, c: number, d: number, e: number) => void;
+ readonly evolutionengine_shouldReplicate: (a: number, b: number, c: number) => number;
+ readonly federatedmodel_applyGradients: (a: number, b: number, c: number) => [number, number];
+ readonly federatedmodel_getDimension: (a: number) => number;
+ readonly federatedmodel_getParameters: (a: number) => [number, number];
+ readonly federatedmodel_getRound: (a: number) => bigint;
+ readonly federatedmodel_new: (a: number, b: number, c: number) => number;
+ readonly federatedmodel_setLearningRate: (a: number, b: number) => void;
+ readonly federatedmodel_setLocalEpochs: (a: number, b: number) => void;
+ readonly federatedmodel_setParameters: (a: number, b: number, c: number) => [number, number];
+ readonly foundingregistry_calculateVested: (a: number, b: bigint, c: bigint) => bigint;
+ readonly foundingregistry_getFounderCount: (a: number) => number;
+ readonly foundingregistry_new: () => number;
+ readonly foundingregistry_processEpoch: (a: number, b: bigint, c: bigint) => [number, number];
+ readonly foundingregistry_registerContributor: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
+ readonly genesiskey_create: (a: number, b: number) => [number, number, number];
+ readonly genesiskey_exportUltraCompact: (a: number) => [number, number];
+ readonly genesiskey_getEpoch: (a: number) => number;
+ readonly genesiskey_getIdHex: (a: number) => [number, number];
+ readonly genesiskey_verify: (a: number, b: number, c: number) => number;
+ readonly genesissunset_canRetire: (a: number) => number;
+ readonly genesissunset_getCurrentPhase: (a: number) => number;
+ readonly genesissunset_getStatus: (a: number) => [number, number];
+ readonly genesissunset_isReadOnly: (a: number) => number;
+ readonly genesissunset_new: () => number;
+ readonly genesissunset_registerGenesisNode: (a: number, b: number, c: number) => void;
+ readonly genesissunset_shouldAcceptConnections: (a: number) => number;
+ readonly genesissunset_updateNodeCount: (a: number, b: number) => number;
+ readonly gradientgossip_advanceRound: (a: number) => bigint;
+ readonly gradientgossip_configureDifferentialPrivacy: (a: number, b: number, c: number) => void;
+ readonly gradientgossip_getAggregatedGradients: (a: number) => [number, number];
+ readonly gradientgossip_getCompressionRatio: (a: number) => number;
+ readonly gradientgossip_getCurrentRound: (a: number) => bigint;
+ readonly gradientgossip_getDimension: (a: number) => number;
+ readonly gradientgossip_getStats: (a: number) => [number, number];
+ readonly gradientgossip_new: (a: number, b: number, c: number, d: number) => [number, number, number];
+ readonly gradientgossip_peerCount: (a: number) => number;
+ readonly gradientgossip_pruneStale: (a: number) => number;
+ readonly gradientgossip_setDPEnabled: (a: number, b: number) => void;
+ readonly gradientgossip_setLocalGradients: (a: number, b: number, c: number) => [number, number];
+ readonly gradientgossip_setModelHash: (a: number, b: number, c: number) => [number, number];
+ readonly init_panic_hook: () => void;
+ readonly modelconsensusmanager_disputeCount: (a: number) => number;
+ readonly modelconsensusmanager_getStats: (a: number) => [number, number];
+ readonly modelconsensusmanager_modelCount: (a: number) => number;
+ readonly modelconsensusmanager_new: (a: number) => number;
+ readonly modelconsensusmanager_quarantinedUpdateCount: (a: number) => number;
+ readonly multiheadattention_dim: (a: number) => number;
+ readonly multiheadattention_new: (a: number, b: number) => number;
+ readonly multiheadattention_numHeads: (a: number) => number;
+ readonly networkevents_checkActiveEvents: (a: number) => [number, number];
+ readonly networkevents_checkDiscovery: (a: number, b: number, c: number, d: number, e: number) => [number, number];
+ readonly networkevents_checkMilestones: (a: number, b: bigint, c: number, d: number) => [number, number];
+ readonly networkevents_getCelebrationBoost: (a: number) => number;
+ readonly networkevents_getMotivation: (a: number, b: bigint) => [number, number];
+ readonly networkevents_getSpecialArt: (a: number) => [number, number];
+ readonly networkevents_getThemedStatus: (a: number, b: number, c: bigint) => [number, number];
+ readonly networkevents_new: () => number;
+ readonly networkevents_setCurrentTime: (a: number, b: bigint) => void;
+ readonly networklearning_getEnergyRatio: (a: number, b: number, c: number) => number;
+ readonly networklearning_getStats: (a: number) => [number, number];
+ readonly networklearning_lookupPatterns: (a: number, b: number, c: number, d: number) => [number, number];
+ readonly networklearning_new: () => number;
+ readonly networklearning_patternCount: (a: number) => number;
+ readonly networklearning_prune: (a: number, b: number, c: number) => number;
+ readonly networklearning_recordTrajectory: (a: number, b: number, c: number) => number;
+ readonly networklearning_storePattern: (a: number, b: number, c: number) => number;
+ readonly networklearning_trajectoryCount: (a: number) => number;
+ readonly networktopology_getOptimalPeers: (a: number, b: number, c: number, d: number) => [number, number];
+ readonly networktopology_new: () => number;
+ readonly networktopology_registerNode: (a: number, b: number, c: number, d: number, e: number) => void;
+ readonly networktopology_updateConnection: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
+ readonly optimizationengine_getStats: (a: number) => [number, number];
+ readonly optimizationengine_new: () => number;
+ readonly optimizationengine_recordRouting: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number) => void;
+ readonly optimizationengine_selectOptimalNode: (a: number, b: number, c: number, d: number, e: number) => [number, number];
+ readonly pikey_createEncryptedBackup: (a: number, b: number, c: number) => [number, number, number, number];
+ readonly pikey_exportCompact: (a: number) => [number, number];
+ readonly pikey_generate: (a: number, b: number) => [number, number, number];
+ readonly pikey_getGenesisFingerprint: (a: number) => [number, number];
+ readonly pikey_getIdentity: (a: number) => [number, number];
+ readonly pikey_getIdentityHex: (a: number) => [number, number];
+ readonly pikey_getPublicKey: (a: number) => [number, number];
+ readonly pikey_getShortId: (a: number) => [number, number];
+ readonly pikey_getStats: (a: number) => [number, number];
+ readonly pikey_restoreFromBackup: (a: number, b: number, c: number, d: number) => [number, number, number];
+ readonly pikey_sign: (a: number, b: number, c: number) => [number, number];
+ readonly pikey_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
+ readonly pikey_verifyPiMagic: (a: number) => number;
+ readonly qdagledger_balance: (a: number, b: number, c: number) => bigint;
+ readonly qdagledger_createGenesis: (a: number, b: bigint, c: number, d: number) => [number, number, number, number];
+ readonly qdagledger_createTransaction: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number, h: number, i: number, j: number, k: number) => [number, number, number, number];
+ readonly qdagledger_exportState: (a: number) => [number, number, number, number];
+ readonly qdagledger_importState: (a: number, b: number, c: number) => [number, number, number];
+ readonly qdagledger_new: () => number;
+ readonly qdagledger_stakedAmount: (a: number, b: number, c: number) => bigint;
+ readonly qdagledger_tipCount: (a: number) => number;
+ readonly qdagledger_totalSupply: (a: number) => bigint;
+ readonly qdagledger_transactionCount: (a: number) => number;
+ readonly quarantinemanager_canUse: (a: number, b: number, c: number) => number;
+ readonly quarantinemanager_getLevel: (a: number, b: number, c: number) => number;
+ readonly quarantinemanager_new: () => number;
+ readonly quarantinemanager_quarantinedCount: (a: number) => number;
+ readonly quarantinemanager_setLevel: (a: number, b: number, c: number, d: number) => void;
+ readonly raceconomicengine_canParticipate: (a: number, b: number, c: number) => number;
+ readonly raceconomicengine_getCombinedScore: (a: number, b: number, c: number) => number;
+ readonly raceconomicengine_getSummary: (a: number) => [number, number];
+ readonly raceconomicengine_new: () => number;
+ readonly racsemanticrouter_new: () => number;
+ readonly racsemanticrouter_peerCount: (a: number) => number;
+ readonly ratelimiter_checkAllowed: (a: number, b: number, c: number) => number;
+ readonly ratelimiter_getCount: (a: number, b: number, c: number) => number;
+ readonly ratelimiter_new: (a: bigint, b: number) => number;
+ readonly ratelimiter_reset: (a: number) => void;
+ readonly reasoningbank_count: (a: number) => number;
+ readonly reasoningbank_getStats: (a: number) => [number, number];
+ readonly reasoningbank_lookup: (a: number, b: number, c: number, d: number) => [number, number];
+ readonly reasoningbank_new: () => number;
+ readonly reasoningbank_prune: (a: number, b: number, c: number) => number;
+ readonly reasoningbank_store: (a: number, b: number, c: number) => number;
+ readonly reputationmanager_averageReputation: (a: number) => number;
+ readonly reputationmanager_getReputation: (a: number, b: number, c: number) => number;
+ readonly reputationmanager_hasSufficientReputation: (a: number, b: number, c: number) => number;
+ readonly reputationmanager_new: (a: number, b: bigint) => number;
+ readonly reputationmanager_nodeCount: (a: number) => number;
+ readonly reputationsystem_canParticipate: (a: number, b: number, c: number) => number;
+ readonly reputationsystem_getReputation: (a: number, b: number, c: number) => number;
+ readonly reputationsystem_new: () => number;
+ readonly reputationsystem_recordFailure: (a: number, b: number, c: number) => void;
+ readonly reputationsystem_recordPenalty: (a: number, b: number, c: number, d: number) => void;
+ readonly reputationsystem_recordSuccess: (a: number, b: number, c: number) => void;
+ readonly rewardmanager_claimableAmount: (a: number, b: number, c: number) => bigint;
+ readonly rewardmanager_new: (a: bigint) => number;
+ readonly rewardmanager_pendingAmount: (a: number) => bigint;
+ readonly rewardmanager_pendingCount: (a: number) => number;
+ readonly semanticrouter_activePeerCount: (a: number) => number;
+ readonly semanticrouter_getStats: (a: number) => [number, number];
+ readonly semanticrouter_new: () => number;
+ readonly semanticrouter_peerCount: (a: number) => number;
+ readonly semanticrouter_setMyCapabilities: (a: number, b: number, c: number) => void;
+ readonly semanticrouter_setMyPeerId: (a: number, b: number, c: number) => void;
+ readonly semanticrouter_topicCount: (a: number) => number;
+ readonly semanticrouter_withParams: (a: number, b: number, c: number) => number;
+ readonly sessionkey_create: (a: number, b: number) => [number, number, number];
+ readonly sessionkey_decrypt: (a: number, b: number, c: number) => [number, number, number, number];
+ readonly sessionkey_encrypt: (a: number, b: number, c: number) => [number, number, number, number];
+ readonly sessionkey_getId: (a: number) => [number, number];
+ readonly sessionkey_getIdHex: (a: number) => [number, number];
+ readonly sessionkey_getParentIdentity: (a: number) => [number, number];
+ readonly sessionkey_isExpired: (a: number) => number;
+ readonly spikedrivenattention_energyRatio: (a: number, b: number, c: number) => number;
+ readonly spikedrivenattention_new: () => number;
+ readonly spikedrivenattention_withConfig: (a: number, b: number, c: number) => number;
+ readonly spotchecker_addChallenge: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
+ readonly spotchecker_getChallenge: (a: number, b: number, c: number) => [number, number];
+ readonly spotchecker_new: (a: number) => number;
+ readonly spotchecker_shouldCheck: (a: number) => number;
+ readonly spotchecker_verifyResponse: (a: number, b: number, c: number, d: number, e: number) => number;
+ readonly stakemanager_getMinStake: (a: number) => bigint;
+ readonly stakemanager_getStake: (a: number, b: number, c: number) => bigint;
+ readonly stakemanager_hasSufficientStake: (a: number, b: number, c: number) => number;
+ readonly stakemanager_new: (a: bigint) => number;
+ readonly stakemanager_stakerCount: (a: number) => number;
+ readonly stakemanager_totalStaked: (a: number) => bigint;
+ readonly swarmintelligence_addPattern: (a: number, b: number, c: number) => number;
+ readonly swarmintelligence_consolidate: (a: number) => number;
+ readonly swarmintelligence_getConsensusDecision: (a: number, b: number, c: number) => [number, bigint];
+ readonly swarmintelligence_getStats: (a: number) => [number, number];
+ readonly swarmintelligence_hasConsensus: (a: number, b: number, c: number) => number;
+ readonly swarmintelligence_negotiateBeliefs: (a: number, b: number, c: number, d: number, e: number) => number;
+ readonly swarmintelligence_new: (a: number, b: number) => number;
+ readonly swarmintelligence_nodeId: (a: number) => [number, number];
+ readonly swarmintelligence_patternCount: (a: number) => number;
+ readonly swarmintelligence_queueSize: (a: number) => number;
+ readonly swarmintelligence_replay: (a: number) => number;
+ readonly swarmintelligence_searchPatterns: (a: number, b: number, c: number, d: number) => [number, number];
+ readonly swarmintelligence_setBelief: (a: number, b: number, c: number, d: bigint, e: number) => void;
+ readonly swarmintelligence_startConsensus: (a: number, b: number, c: number, d: number) => void;
+ readonly sybildefense_getSybilScore: (a: number, b: number, c: number) => number;
+ readonly sybildefense_isSuspectedSybil: (a: number, b: number, c: number) => number;
+ readonly sybildefense_new: () => number;
+ readonly sybildefense_registerNode: (a: number, b: number, c: number, d: number, e: number) => number;
+ readonly topksparsifier_getCompressionRatio: (a: number) => number;
+ readonly topksparsifier_getErrorBufferSize: (a: number) => number;
+ readonly topksparsifier_new: (a: number) => number;
+ readonly topksparsifier_resetErrorFeedback: (a: number) => void;
+ readonly trajectorytracker_count: (a: number) => number;
+ readonly trajectorytracker_getStats: (a: number) => [number, number];
+ readonly trajectorytracker_new: (a: number) => number;
+ readonly trajectorytracker_record: (a: number, b: number, c: number) => number;
+ readonly wasmadapterpool_adapterCount: (a: number) => number;
+ readonly wasmadapterpool_exportAdapter: (a: number, b: number, c: number) => [number, number];
+ readonly wasmadapterpool_forward: (a: number, b: number, c: number, d: number, e: number) => [number, number];
+ readonly wasmadapterpool_getAdapter: (a: number, b: number, c: number) => any;
+ readonly wasmadapterpool_getStats: (a: number) => any;
+ readonly wasmadapterpool_importAdapter: (a: number, b: number, c: number, d: number, e: number) => number;
+ readonly wasmadapterpool_new: (a: number, b: number) => number;
+ readonly wasmadapterpool_routeToAdapter: (a: number, b: number, c: number) => any;
+ readonly wasmcapabilities_adaptMicroLoRA: (a: number, b: number, c: number, d: number, e: number) => number;
+ readonly wasmcapabilities_addNAOMember: (a: number, b: number, c: number, d: bigint) => number;
+ readonly wasmcapabilities_applyMicroLoRA: (a: number, b: number, c: number, d: number, e: number) => [number, number];
+ readonly wasmcapabilities_broadcastToWorkspace: (a: number, b: number, c: number, d: number, e: number) => number;
+ readonly wasmcapabilities_competeWTA: (a: number, b: number, c: number) => number;
+ readonly wasmcapabilities_differentiateMorphogenetic: (a: number) => void;
+ readonly wasmcapabilities_enableBTSP: (a: number, b: number, c: number) => number;
+ readonly wasmcapabilities_enableGlobalWorkspace: (a: number, b: number) => number;
+ readonly wasmcapabilities_enableHDC: (a: number) => number;
+ readonly wasmcapabilities_enableMicroLoRA: (a: number, b: number, c: number) => number;
+ readonly wasmcapabilities_enableNAO: (a: number, b: number) => number;
+ readonly wasmcapabilities_enableWTA: (a: number, b: number, c: number, d: number) => number;
+ readonly wasmcapabilities_executeNAO: (a: number, b: number, c: number) => number;
+ readonly wasmcapabilities_forwardBTSP: (a: number, b: number, c: number) => number;
+ readonly wasmcapabilities_getCapabilities: (a: number) => any;
+ readonly wasmcapabilities_getMorphogeneticCellCount: (a: number) => number;
+ readonly wasmcapabilities_getMorphogeneticStats: (a: number) => any;
+ readonly wasmcapabilities_getNAOSync: (a: number) => number;
+ readonly wasmcapabilities_getSummary: (a: number) => any;
+ readonly wasmcapabilities_growMorphogenetic: (a: number, b: number) => void;
+ readonly wasmcapabilities_new: (a: number, b: number) => number;
+ readonly wasmcapabilities_oneShotAssociate: (a: number, b: number, c: number, d: number) => number;
+ readonly wasmcapabilities_proposeNAO: (a: number, b: number, c: number) => [number, number];
+ readonly wasmcapabilities_retrieveHDC: (a: number, b: number, c: number, d: number) => any;
+ readonly wasmcapabilities_tickTimeCrystal: (a: number) => any;
+ readonly wasmcapabilities_voteNAO: (a: number, b: number, c: number, d: number) => number;
+ readonly wasmcreditledger_balance: (a: number) => bigint;
+ readonly wasmcreditledger_credit: (a: number, b: bigint, c: number, d: number) => [number, number];
+ readonly wasmcreditledger_currentMultiplier: (a: number) => number;
+ readonly wasmcreditledger_deduct: (a: number, b: bigint) => [number, number];
+ readonly wasmcreditledger_exportEarned: (a: number) => [number, number, number, number];
+ readonly wasmcreditledger_exportSpent: (a: number) => [number, number, number, number];
+ readonly wasmcreditledger_merge: (a: number, b: number, c: number, d: number, e: number) => [number, number];
+ readonly wasmcreditledger_networkCompute: (a: number) => number;
+ readonly wasmcreditledger_new: (a: number, b: number) => [number, number, number];
+ readonly wasmcreditledger_slash: (a: number, b: bigint) => [bigint, number, number];
+ readonly wasmcreditledger_stake: (a: number, b: bigint) => [number, number];
+ readonly wasmcreditledger_stakedAmount: (a: number) => bigint;
+ readonly wasmcreditledger_totalEarned: (a: number) => bigint;
+ readonly wasmcreditledger_totalSpent: (a: number) => bigint;
+ readonly wasmcreditledger_unstake: (a: number, b: bigint) => [number, number];
+ readonly wasmcreditledger_updateNetworkCompute: (a: number, b: number) => void;
+ readonly wasmidledetector_getStatus: (a: number) => any;
+ readonly wasmidledetector_getThrottle: (a: number) => number;
+ readonly wasmidledetector_isIdle: (a: number) => number;
+ readonly wasmidledetector_new: (a: number, b: number) => [number, number, number];
+ readonly wasmidledetector_pause: (a: number) => void;
+ readonly wasmidledetector_recordInteraction: (a: number) => void;
+ readonly wasmidledetector_resume: (a: number) => void;
+ readonly wasmidledetector_setBatteryStatus: (a: number, b: number) => void;
+ readonly wasmidledetector_shouldWork: (a: number) => number;
+ readonly wasmidledetector_start: (a: number) => [number, number];
+ readonly wasmidledetector_stop: (a: number) => void;
+ readonly wasmidledetector_updateFps: (a: number, b: number) => void;
+ readonly wasmmcpbroadcast_close: (a: number) => void;
+ readonly wasmmcpbroadcast_listen: (a: number) => [number, number];
+ readonly wasmmcpbroadcast_new: (a: number, b: number) => [number, number, number];
+ readonly wasmmcpbroadcast_send: (a: number, b: number, c: number) => [number, number];
+ readonly wasmmcpbroadcast_setServer: (a: number, b: number) => void;
+ readonly wasmmcpserver_getServerInfo: (a: number) => any;
+ readonly wasmmcpserver_handleRequest: (a: number, b: number, c: number) => any;
+ readonly wasmmcpserver_handleRequestJs: (a: number, b: any) => any;
+ readonly wasmmcpserver_initLearning: (a: number) => [number, number];
+ readonly wasmmcpserver_new: () => [number, number, number];
+ readonly wasmmcpserver_setIdentity: (a: number, b: number) => void;
+ readonly wasmmcpserver_withConfig: (a: any) => [number, number, number];
+ readonly wasmmcptransport_close: (a: number) => void;
+ readonly wasmmcptransport_fromPort: (a: any) => number;
+ readonly wasmmcptransport_init: (a: number) => [number, number];
+ readonly wasmmcptransport_new: (a: any) => [number, number, number];
+ readonly wasmmcptransport_send: (a: number, b: any) => any;
+ readonly wasmmcpworkerhandler_new: (a: number) => number;
+ readonly wasmmcpworkerhandler_start: (a: number) => [number, number];
+ readonly wasmnetworkmanager_activePeerCount: (a: number) => number;
+ readonly wasmnetworkmanager_addRelay: (a: number, b: number, c: number) => void;
+ readonly wasmnetworkmanager_getPeersWithCapability: (a: number, b: number, c: number) => [number, number];
+ readonly wasmnetworkmanager_isConnected: (a: number) => number;
+ readonly wasmnetworkmanager_new: (a: number, b: number) => number;
+ readonly wasmnetworkmanager_peerCount: (a: number) => number;
+ readonly wasmnetworkmanager_registerPeer: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: bigint) => void;
+ readonly wasmnetworkmanager_selectWorkers: (a: number, b: number, c: number, d: number) => [number, number];
+ readonly wasmnetworkmanager_updateReputation: (a: number, b: number, c: number, d: number) => void;
+ readonly wasmnodeidentity_exportSecretKey: (a: number, b: number, c: number) => [number, number, number, number];
+ readonly wasmnodeidentity_fromSecretKey: (a: number, b: number, c: number, d: number) => [number, number, number];
+ readonly wasmnodeidentity_generate: (a: number, b: number) => [number, number, number];
+ readonly wasmnodeidentity_getFingerprint: (a: number) => [number, number];
+ readonly wasmnodeidentity_importSecretKey: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
+ readonly wasmnodeidentity_nodeId: (a: number) => [number, number];
+ readonly wasmnodeidentity_publicKeyBytes: (a: number) => [number, number];
+ readonly wasmnodeidentity_publicKeyHex: (a: number) => [number, number];
+ readonly wasmnodeidentity_setFingerprint: (a: number, b: number, c: number) => void;
+ readonly wasmnodeidentity_sign: (a: number, b: number, c: number) => [number, number];
+ readonly wasmnodeidentity_siteId: (a: number) => [number, number];
+ readonly wasmnodeidentity_verify: (a: number, b: number, c: number, d: number, e: number) => number;
+ readonly wasmnodeidentity_verifyFrom: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
+ readonly wasmstigmergy_deposit: (a: number, b: number, c: number, d: number, e: number, f: number, g: bigint) => void;
+ readonly wasmstigmergy_depositWithOutcome: (a: number, b: number, c: number, d: number, e: number, f: number, g: bigint) => void;
+ readonly wasmstigmergy_evaporate: (a: number) => void;
+ readonly wasmstigmergy_exportState: (a: number) => [number, number];
+ readonly wasmstigmergy_follow: (a: number, b: number, c: number) => number;
+ readonly wasmstigmergy_getBestSpecialization: (a: number) => [number, number];
+ readonly wasmstigmergy_getIntensity: (a: number, b: number, c: number) => number;
+ readonly wasmstigmergy_getRankedTasks: (a: number) => [number, number];
+ readonly wasmstigmergy_getSpecialization: (a: number, b: number, c: number) => number;
+ readonly wasmstigmergy_getStats: (a: number) => [number, number];
+ readonly wasmstigmergy_getSuccessRate: (a: number, b: number, c: number) => number;
+ readonly wasmstigmergy_maybeEvaporate: (a: number) => number;
+ readonly wasmstigmergy_merge: (a: number, b: number, c: number) => number;
+ readonly wasmstigmergy_new: () => number;
+ readonly wasmstigmergy_setMinStake: (a: number, b: bigint) => void;
+ readonly wasmstigmergy_shouldAccept: (a: number, b: number, c: number) => number;
+ readonly wasmstigmergy_updateSpecialization: (a: number, b: number, c: number, d: number) => void;
+ readonly wasmstigmergy_withParams: (a: number, b: number, c: number) => number;
+ readonly wasmtaskexecutor_new: (a: number) => [number, number, number];
+ readonly wasmtaskexecutor_setTaskKey: (a: number, b: number, c: number) => [number, number];
+ readonly wasmworkscheduler_new: () => number;
+ readonly wasmworkscheduler_recordTaskDuration: (a: number, b: number) => void;
+ readonly wasmworkscheduler_setPendingTasks: (a: number, b: number) => void;
+ readonly wasmworkscheduler_tasksThisFrame: (a: number, b: number) => number;
+ readonly witnesstracker_hasSufficientWitnesses: (a: number, b: number, c: number) => number;
+ readonly witnesstracker_new: (a: number) => number;
+ readonly witnesstracker_witnessConfidence: (a: number, b: number, c: number) => number;
+ readonly witnesstracker_witnessCount: (a: number, b: number, c: number) => number;
+ readonly wasmcapabilities_getTimeCrystalSync: (a: number) => number;
+ readonly __wbg_set_nodeconfig_cpu_limit: (a: number, b: number) => void;
+ readonly __wbg_set_rewarddistribution_contributor_share: (a: number, b: bigint) => void;
+ readonly __wbg_set_rewarddistribution_founder_share: (a: number, b: bigint) => void;
+ readonly __wbg_set_rewarddistribution_protocol_share: (a: number, b: bigint) => void;
+ readonly __wbg_set_rewarddistribution_total: (a: number, b: bigint) => void;
+ readonly __wbg_set_rewarddistribution_treasury_share: (a: number, b: bigint) => void;
+ readonly genesissunset_isSelfSustaining: (a: number) => number;
+ readonly edgenetnode_ruvBalance: (a: number) => bigint;
+ readonly eventlog_totalEvents: (a: number) => number;
+ readonly edgenetnode_enableGlobalWorkspace: (a: number, b: number) => number;
+ readonly edgenetnode_enableMicroLoRA: (a: number, b: number) => number;
+ readonly edgenetnode_enableMorphogenetic: (a: number, b: number) => number;
+ readonly edgenetnode_enableTimeCrystal: (a: number, b: number) => number;
+ readonly edgenetnode_enableWTA: (a: number, b: number) => number;
+ readonly wasmcapabilities_pruneMorphogenetic: (a: number, b: number) => void;
+ readonly wasmcapabilities_step: (a: number, b: number) => void;
+ readonly wasmcapabilities_tickNAO: (a: number, b: number) => void;
+ readonly wasmcapabilities_getWorkspaceContents: (a: number) => any;
+ readonly wasmcapabilities_isTimeCrystalStable: (a: number) => number;
+ readonly wasmcapabilities_storeHDC: (a: number, b: number, c: number) => number;
+ readonly wasmcapabilities_enableMorphogenetic: (a: number, b: number, c: number) => number;
+ readonly wasmcapabilities_enableTimeCrystal: (a: number, b: number, c: number) => number;
+ readonly __wbg_get_nodeconfig_cpu_limit: (a: number) => number;
+ readonly __wbg_get_rewarddistribution_contributor_share: (a: number) => bigint;
+ readonly __wbg_get_rewarddistribution_founder_share: (a: number) => bigint;
+ readonly __wbg_get_rewarddistribution_protocol_share: (a: number) => bigint;
+ readonly __wbg_get_rewarddistribution_total: (a: number) => bigint;
+ readonly __wbg_get_rewarddistribution_treasury_share: (a: number) => bigint;
+ readonly __wbg_wasmworkscheduler_free: (a: number, b: number) => void;
+ readonly __wbg_multiheadattention_free: (a: number, b: number) => void;
+ readonly genesiskey_getId: (a: number) => [number, number];
+ readonly wasm_bindgen__convert__closures_____invoke__h8c81ca6cba4eba00: (a: number, b: number, c: any) => void;
+ readonly wasm_bindgen__closure__destroy__h16844f6554aa4052: (a: number, b: number) => void;
+ readonly wasm_bindgen__convert__closures_____invoke__h9a454594a18d3e6f: (a: number, b: number, c: any) => void;
+ readonly wasm_bindgen__closure__destroy__h5a0fd3a052925ed0: (a: number, b: number) => void;
+ readonly wasm_bindgen__convert__closures_____invoke__h094c87b54a975e5a: (a: number, b: number, c: any, d: any) => void;
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
+ readonly __wbindgen_exn_store: (a: number) => void;
+ readonly __externref_table_alloc: () => number;
+ readonly __wbindgen_externrefs: WebAssembly.Table;
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
+ readonly __externref_table_dealloc: (a: number) => void;
+ readonly __externref_drop_slice: (a: number, b: number) => void;
+ readonly __wbindgen_start: () => void;
+}
+
+export type SyncInitInput = BufferSource | WebAssembly.Module;
+
+/**
+* Instantiates the given `module`, which can either be bytes or
+* a precompiled `WebAssembly.Module`.
+*
+* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
+*
+* @returns {InitOutput}
+*/
+export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
+
+/**
+* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
+* for everything else, calls `WebAssembly.instantiate` directly.
+*
+* @param {{ module_or_path: InitInput | Promise }} module_or_path - Passing `InitInput` directly is deprecated.
+*
+* @returns {Promise}
+*/
+export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise } | InitInput | Promise): Promise;
diff --git a/examples/edge-net/pkg/ruvector_edge_net.js b/examples/edge-net/pkg/ruvector_edge_net.js
new file mode 100644
index 00000000..a7ad795e
--- /dev/null
+++ b/examples/edge-net/pkg/ruvector_edge_net.js
@@ -0,0 +1,8049 @@
+let wasm;
+
+function addToExternrefTable0(obj) {
+ const idx = wasm.__externref_table_alloc();
+ wasm.__wbindgen_externrefs.set(idx, obj);
+ return idx;
+}
+
+function _assertClass(instance, klass) {
+ if (!(instance instanceof klass)) {
+ throw new Error(`expected instance of ${klass.name}`);
+ }
+}
+
+const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(state => state.dtor(state.a, state.b));
+
+function debugString(val) {
+ // primitive types
+ const type = typeof val;
+ if (type == 'number' || type == 'boolean' || val == null) {
+ return `${val}`;
+ }
+ if (type == 'string') {
+ return `"${val}"`;
+ }
+ if (type == 'symbol') {
+ const description = val.description;
+ if (description == null) {
+ return 'Symbol';
+ } else {
+ return `Symbol(${description})`;
+ }
+ }
+ if (type == 'function') {
+ const name = val.name;
+ if (typeof name == 'string' && name.length > 0) {
+ return `Function(${name})`;
+ } else {
+ return 'Function';
+ }
+ }
+ // objects
+ if (Array.isArray(val)) {
+ const length = val.length;
+ let debug = '[';
+ if (length > 0) {
+ debug += debugString(val[0]);
+ }
+ for(let i = 1; i < length; i++) {
+ debug += ', ' + debugString(val[i]);
+ }
+ debug += ']';
+ return debug;
+ }
+ // Test for built-in
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
+ let className;
+ if (builtInMatches && builtInMatches.length > 1) {
+ className = builtInMatches[1];
+ } else {
+ // Failed to match the standard '[object ClassName]'
+ return toString.call(val);
+ }
+ if (className == 'Object') {
+ // we're a user defined class or Object
+ // JSON.stringify avoids problems with cycles, and is generally much
+ // easier than looping through ownProperties of `val`.
+ try {
+ return 'Object(' + JSON.stringify(val) + ')';
+ } catch (_) {
+ return 'Object';
+ }
+ }
+ // errors
+ if (val instanceof Error) {
+ return `${val.name}: ${val.message}\n${val.stack}`;
+ }
+ // TODO we could test for more things here, like `Set`s and `Map`s.
+ return className;
+}
+
+function getArrayF32FromWasm0(ptr, len) {
+ ptr = ptr >>> 0;
+ return getFloat32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
+}
+
+function getArrayJsValueFromWasm0(ptr, len) {
+ ptr = ptr >>> 0;
+ const mem = getDataViewMemory0();
+ const result = [];
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
+ result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
+ }
+ wasm.__externref_drop_slice(ptr, len);
+ return result;
+}
+
+function getArrayU8FromWasm0(ptr, len) {
+ ptr = ptr >>> 0;
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
+}
+
+let cachedDataViewMemory0 = null;
+function getDataViewMemory0() {
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
+ }
+ return cachedDataViewMemory0;
+}
+
+let cachedFloat32ArrayMemory0 = null;
+function getFloat32ArrayMemory0() {
+ if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) {
+ cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer);
+ }
+ return cachedFloat32ArrayMemory0;
+}
+
+function getStringFromWasm0(ptr, len) {
+ ptr = ptr >>> 0;
+ return decodeText(ptr, len);
+}
+
+let cachedUint8ArrayMemory0 = null;
+function getUint8ArrayMemory0() {
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
+ }
+ return cachedUint8ArrayMemory0;
+}
+
+function handleError(f, args) {
+ try {
+ return f.apply(this, args);
+ } catch (e) {
+ const idx = addToExternrefTable0(e);
+ wasm.__wbindgen_exn_store(idx);
+ }
+}
+
+function isLikeNone(x) {
+ return x === undefined || x === null;
+}
+
+function makeMutClosure(arg0, arg1, dtor, f) {
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
+ const real = (...args) => {
+
+ // First up with a closure we increment the internal reference
+ // count. This ensures that the Rust closure environment won't
+ // be deallocated while we're invoking it.
+ state.cnt++;
+ const a = state.a;
+ state.a = 0;
+ try {
+ return f(a, state.b, ...args);
+ } finally {
+ state.a = a;
+ real._wbg_cb_unref();
+ }
+ };
+ real._wbg_cb_unref = () => {
+ if (--state.cnt === 0) {
+ state.dtor(state.a, state.b);
+ state.a = 0;
+ CLOSURE_DTORS.unregister(state);
+ }
+ };
+ CLOSURE_DTORS.register(real, state, state);
+ return real;
+}
+
+function passArray8ToWasm0(arg, malloc) {
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
+ getUint8ArrayMemory0().set(arg, ptr / 1);
+ WASM_VECTOR_LEN = arg.length;
+ return ptr;
+}
+
+function passArrayF32ToWasm0(arg, malloc) {
+ const ptr = malloc(arg.length * 4, 4) >>> 0;
+ getFloat32ArrayMemory0().set(arg, ptr / 4);
+ WASM_VECTOR_LEN = arg.length;
+ return ptr;
+}
+
+function passArrayJsValueToWasm0(array, malloc) {
+ const ptr = malloc(array.length * 4, 4) >>> 0;
+ for (let i = 0; i < array.length; i++) {
+ const add = addToExternrefTable0(array[i]);
+ getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
+ }
+ WASM_VECTOR_LEN = array.length;
+ return ptr;
+}
+
+function passStringToWasm0(arg, malloc, realloc) {
+ if (realloc === undefined) {
+ const buf = cachedTextEncoder.encode(arg);
+ const ptr = malloc(buf.length, 1) >>> 0;
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
+ WASM_VECTOR_LEN = buf.length;
+ return ptr;
+ }
+
+ let len = arg.length;
+ let ptr = malloc(len, 1) >>> 0;
+
+ const mem = getUint8ArrayMemory0();
+
+ let offset = 0;
+
+ for (; offset < len; offset++) {
+ const code = arg.charCodeAt(offset);
+ if (code > 0x7F) break;
+ mem[ptr + offset] = code;
+ }
+ if (offset !== len) {
+ if (offset !== 0) {
+ arg = arg.slice(offset);
+ }
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
+ const ret = cachedTextEncoder.encodeInto(arg, view);
+
+ offset += ret.written;
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
+ }
+
+ WASM_VECTOR_LEN = offset;
+ return ptr;
+}
+
+function takeFromExternrefTable0(idx) {
+ const value = wasm.__wbindgen_externrefs.get(idx);
+ wasm.__externref_table_dealloc(idx);
+ return value;
+}
+
+let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
+cachedTextDecoder.decode();
+const MAX_SAFARI_DECODE_BYTES = 2146435072;
+let numBytesDecoded = 0;
+function decodeText(ptr, len) {
+ numBytesDecoded += len;
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
+ cachedTextDecoder.decode();
+ numBytesDecoded = len;
+ }
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
+}
+
+const cachedTextEncoder = new TextEncoder();
+
+if (!('encodeInto' in cachedTextEncoder)) {
+ cachedTextEncoder.encodeInto = function (arg, view) {
+ const buf = cachedTextEncoder.encode(arg);
+ view.set(buf);
+ return {
+ read: arg.length,
+ written: buf.length
+ };
+ }
+}
+
+let WASM_VECTOR_LEN = 0;
+
+function wasm_bindgen__convert__closures_____invoke__h8c81ca6cba4eba00(arg0, arg1, arg2) {
+ wasm.wasm_bindgen__convert__closures_____invoke__h8c81ca6cba4eba00(arg0, arg1, arg2);
+}
+
+function wasm_bindgen__convert__closures_____invoke__h9a454594a18d3e6f(arg0, arg1, arg2) {
+ wasm.wasm_bindgen__convert__closures_____invoke__h9a454594a18d3e6f(arg0, arg1, arg2);
+}
+
+function wasm_bindgen__convert__closures_____invoke__h094c87b54a975e5a(arg0, arg1, arg2, arg3) {
+ wasm.wasm_bindgen__convert__closures_____invoke__h094c87b54a975e5a(arg0, arg1, arg2, arg3);
+}
+
+const AdaptiveSecurityFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_adaptivesecurity_free(ptr >>> 0, 1));
+
+const AdversarialSimulatorFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_adversarialsimulator_free(ptr >>> 0, 1));
+
+const AuditLogFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_auditlog_free(ptr >>> 0, 1));
+
+const BrowserFingerprintFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_browserfingerprint_free(ptr >>> 0, 1));
+
+const ByzantineDetectorFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_byzantinedetector_free(ptr >>> 0, 1));
+
+const CoherenceEngineFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_coherenceengine_free(ptr >>> 0, 1));
+
+const CollectiveMemoryFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_collectivememory_free(ptr >>> 0, 1));
+
+const ContributionStreamFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_contributionstream_free(ptr >>> 0, 1));
+
+const DifferentialPrivacyFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_differentialprivacy_free(ptr >>> 0, 1));
+
+const DriftTrackerFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_drifttracker_free(ptr >>> 0, 1));
+
+const EconomicEngineFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_economicengine_free(ptr >>> 0, 1));
+
+const EconomicHealthFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_economichealth_free(ptr >>> 0, 1));
+
+const EdgeNetConfigFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_edgenetconfig_free(ptr >>> 0, 1));
+
+const EdgeNetNodeFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_edgenetnode_free(ptr >>> 0, 1));
+
+const EntropyConsensusFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_entropyconsensus_free(ptr >>> 0, 1));
+
+const EventLogFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_eventlog_free(ptr >>> 0, 1));
+
+const EvolutionEngineFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_evolutionengine_free(ptr >>> 0, 1));
+
+const FederatedModelFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_federatedmodel_free(ptr >>> 0, 1));
+
+const FoundingRegistryFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_foundingregistry_free(ptr >>> 0, 1));
+
+const GenesisKeyFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_genesiskey_free(ptr >>> 0, 1));
+
+const GenesisSunsetFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_genesissunset_free(ptr >>> 0, 1));
+
+const GradientGossipFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_gradientgossip_free(ptr >>> 0, 1));
+
+const ModelConsensusManagerFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_modelconsensusmanager_free(ptr >>> 0, 1));
+
+const MultiHeadAttentionFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_multiheadattention_free(ptr >>> 0, 1));
+
+const NetworkEventsFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_networkevents_free(ptr >>> 0, 1));
+
+const NetworkLearningFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_networklearning_free(ptr >>> 0, 1));
+
+const NetworkTopologyFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_networktopology_free(ptr >>> 0, 1));
+
+const NodeConfigFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_nodeconfig_free(ptr >>> 0, 1));
+
+const NodeStatsFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_nodestats_free(ptr >>> 0, 1));
+
+const OptimizationEngineFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_optimizationengine_free(ptr >>> 0, 1));
+
+const PiKeyFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_pikey_free(ptr >>> 0, 1));
+
+const QDAGLedgerFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_qdagledger_free(ptr >>> 0, 1));
+
+const QuarantineManagerFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_quarantinemanager_free(ptr >>> 0, 1));
+
+const RacEconomicEngineFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_raceconomicengine_free(ptr >>> 0, 1));
+
+const RacSemanticRouterFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_racsemanticrouter_free(ptr >>> 0, 1));
+
+const RateLimiterFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_ratelimiter_free(ptr >>> 0, 1));
+
+const ReasoningBankFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_reasoningbank_free(ptr >>> 0, 1));
+
+const ReputationManagerFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_reputationmanager_free(ptr >>> 0, 1));
+
+const ReputationSystemFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_reputationsystem_free(ptr >>> 0, 1));
+
+const RewardDistributionFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_rewarddistribution_free(ptr >>> 0, 1));
+
+const RewardManagerFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_rewardmanager_free(ptr >>> 0, 1));
+
+const SemanticRouterFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_semanticrouter_free(ptr >>> 0, 1));
+
+const SessionKeyFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_sessionkey_free(ptr >>> 0, 1));
+
+const SpikeDrivenAttentionFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_spikedrivenattention_free(ptr >>> 0, 1));
+
+const SpotCheckerFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_spotchecker_free(ptr >>> 0, 1));
+
+const StakeManagerFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_stakemanager_free(ptr >>> 0, 1));
+
+const SwarmIntelligenceFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_swarmintelligence_free(ptr >>> 0, 1));
+
+const SybilDefenseFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_sybildefense_free(ptr >>> 0, 1));
+
+const TopKSparsifierFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_topksparsifier_free(ptr >>> 0, 1));
+
+const TrajectoryTrackerFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_trajectorytracker_free(ptr >>> 0, 1));
+
+const WasmAdapterPoolFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmadapterpool_free(ptr >>> 0, 1));
+
+const WasmCapabilitiesFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmcapabilities_free(ptr >>> 0, 1));
+
+const WasmCreditLedgerFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmcreditledger_free(ptr >>> 0, 1));
+
+const WasmIdleDetectorFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmidledetector_free(ptr >>> 0, 1));
+
+const WasmMcpBroadcastFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmmcpbroadcast_free(ptr >>> 0, 1));
+
+const WasmMcpServerFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmmcpserver_free(ptr >>> 0, 1));
+
+const WasmMcpTransportFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmmcptransport_free(ptr >>> 0, 1));
+
+const WasmMcpWorkerHandlerFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmmcpworkerhandler_free(ptr >>> 0, 1));
+
+const WasmNetworkManagerFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmnetworkmanager_free(ptr >>> 0, 1));
+
+const WasmNodeIdentityFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmnodeidentity_free(ptr >>> 0, 1));
+
+const WasmStigmergyFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmstigmergy_free(ptr >>> 0, 1));
+
+const WasmTaskExecutorFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmtaskexecutor_free(ptr >>> 0, 1));
+
+const WasmTaskQueueFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmtaskqueue_free(ptr >>> 0, 1));
+
+const WasmWorkSchedulerFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmworkscheduler_free(ptr >>> 0, 1));
+
+const WitnessTrackerFinalization = (typeof FinalizationRegistry === 'undefined')
+ ? { register: () => {}, unregister: () => {} }
+ : new FinalizationRegistry(ptr => wasm.__wbg_witnesstracker_free(ptr >>> 0, 1));
+
+/**
+ * Self-learning security system with Q-learning adaptive optimization
+ */
+export class AdaptiveSecurity {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ AdaptiveSecurityFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_adaptivesecurity_free(ptr, 0);
+ }
+ /**
+ * Choose action using epsilon-greedy policy
+ * @param {string} state
+ * @param {string} available_actions
+ * @returns {string}
+ */
+ chooseAction(state, available_actions) {
+ let deferred3_0;
+ let deferred3_1;
+ try {
+ const ptr0 = passStringToWasm0(state, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passStringToWasm0(available_actions, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len1 = WASM_VECTOR_LEN;
+ const ret = wasm.adaptivesecurity_chooseAction(this.__wbg_ptr, ptr0, len0, ptr1, len1);
+ deferred3_0 = ret[0];
+ deferred3_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
+ }
+ }
+ /**
+ * Detect if request matches known attack pattern
+ * @param {Float32Array} features
+ * @returns {number}
+ */
+ detectAttack(features) {
+ const ptr0 = passArrayF32ToWasm0(features, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.adaptivesecurity_detectAttack(this.__wbg_ptr, ptr0, len0);
+ return ret;
+ }
+ /**
+ * Export learned patterns for persistence
+ * @returns {Uint8Array}
+ */
+ exportPatterns() {
+ const ret = wasm.adaptivesecurity_exportPatterns(this.__wbg_ptr);
+ if (ret[3]) {
+ throw takeFromExternrefTable0(ret[2]);
+ }
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
+ return v1;
+ }
+ /**
+ * Import learned patterns
+ * @param {Uint8Array} data
+ */
+ importPatterns(data) {
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.adaptivesecurity_importPatterns(this.__wbg_ptr, ptr0, len0);
+ if (ret[1]) {
+ throw takeFromExternrefTable0(ret[0]);
+ }
+ }
+ /**
+ * @returns {number}
+ */
+ getMinReputation() {
+ const ret = wasm.adaptivesecurity_getMinReputation(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * @returns {number}
+ */
+ getRateLimitMax() {
+ const ret = wasm.adaptivesecurity_getRateLimitMax(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * @returns {number}
+ */
+ getSecurityLevel() {
+ const ret = wasm.adaptivesecurity_getSecurityLevel(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * Get current adaptive thresholds
+ * @returns {bigint}
+ */
+ getRateLimitWindow() {
+ const ret = wasm.adaptivesecurity_getRateLimitWindow(this.__wbg_ptr);
+ return BigInt.asUintN(64, ret);
+ }
+ /**
+ * Record attack pattern for learning
+ * @param {string} pattern_type
+ * @param {Float32Array} features
+ * @param {number} severity
+ */
+ recordAttackPattern(pattern_type, features, severity) {
+ const ptr0 = passStringToWasm0(pattern_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passArrayF32ToWasm0(features, wasm.__wbindgen_malloc);
+ const len1 = WASM_VECTOR_LEN;
+ wasm.adaptivesecurity_recordAttackPattern(this.__wbg_ptr, ptr0, len0, ptr1, len1, severity);
+ }
+ /**
+ * Update network health metrics
+ * @param {number} active_nodes
+ * @param {number} suspicious_nodes
+ * @param {number} attacks_hour
+ * @param {number} false_positives
+ * @param {number} avg_response_ms
+ */
+ updateNetworkHealth(active_nodes, suspicious_nodes, attacks_hour, false_positives, avg_response_ms) {
+ wasm.adaptivesecurity_updateNetworkHealth(this.__wbg_ptr, active_nodes, suspicious_nodes, attacks_hour, false_positives, avg_response_ms);
+ }
+ /**
+ * @returns {number}
+ */
+ getSpotCheckProbability() {
+ const ret = wasm.adaptivesecurity_getSpotCheckProbability(this.__wbg_ptr);
+ return ret;
+ }
+ constructor() {
+ const ret = wasm.adaptivesecurity_new();
+ this.__wbg_ptr = ret >>> 0;
+ AdaptiveSecurityFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Learn from security event outcome (batched for better performance)
+ * @param {string} state
+ * @param {string} action
+ * @param {number} reward
+ * @param {string} next_state
+ */
+ learn(state, action, reward, next_state) {
+ const ptr0 = passStringToWasm0(state, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passStringToWasm0(action, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len1 = WASM_VECTOR_LEN;
+ const ptr2 = passStringToWasm0(next_state, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len2 = WASM_VECTOR_LEN;
+ wasm.adaptivesecurity_learn(this.__wbg_ptr, ptr0, len0, ptr1, len1, reward, ptr2, len2);
+ }
+ /**
+ * Get learning statistics
+ * @returns {string}
+ */
+ getStats() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.adaptivesecurity_getStats(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+}
+if (Symbol.dispose) AdaptiveSecurity.prototype[Symbol.dispose] = AdaptiveSecurity.prototype.free;
+
+/**
+ * Adversarial testing framework
+ */
+export class AdversarialSimulator {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ AdversarialSimulatorFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_adversarialsimulator_free(ptr, 0);
+ }
+ /**
+ * Simulate DDoS attack
+ * @param {number} requests_per_second
+ * @param {bigint} duration_ms
+ * @returns {string}
+ */
+ simulateDDoS(requests_per_second, duration_ms) {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.adversarialsimulator_simulateDDoS(this.__wbg_ptr, requests_per_second, duration_ms);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Simulate Sybil attack
+ * @param {number} fake_nodes
+ * @param {boolean} same_fingerprint
+ * @returns {string}
+ */
+ simulateSybil(fake_nodes, same_fingerprint) {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.adversarialsimulator_simulateSybil(this.__wbg_ptr, fake_nodes, same_fingerprint);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Enable chaos mode for continuous testing
+ * @param {boolean} enabled
+ */
+ enableChaosMode(enabled) {
+ wasm.adversarialsimulator_enableChaosMode(this.__wbg_ptr, enabled);
+ }
+ /**
+ * Run comprehensive security audit
+ * @returns {string}
+ */
+ runSecurityAudit() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.adversarialsimulator_runSecurityAudit(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Simulate Byzantine node behavior
+ * @param {number} byzantine_nodes
+ * @param {number} total_nodes
+ * @returns {string}
+ */
+ simulateByzantine(byzantine_nodes, total_nodes) {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.adversarialsimulator_simulateByzantine(this.__wbg_ptr, byzantine_nodes, total_nodes);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Get defence metrics
+ * @returns {string}
+ */
+ getDefenceMetrics() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.adversarialsimulator_getDefenceMetrics(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Get recommendations based on testing
+ * @returns {string}
+ */
+ getRecommendations() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.adversarialsimulator_getRecommendations(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Generate chaos event
+ * @returns {string | undefined}
+ */
+ generateChaosEvent() {
+ const ret = wasm.adversarialsimulator_generateChaosEvent(this.__wbg_ptr);
+ let v1;
+ if (ret[0] !== 0) {
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
+ }
+ return v1;
+ }
+ /**
+ * Simulate free-riding attack
+ * @param {number} consumption_rate
+ * @param {number} contribution_rate
+ * @returns {string}
+ */
+ simulateFreeRiding(consumption_rate, contribution_rate) {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.adversarialsimulator_simulateFreeRiding(this.__wbg_ptr, consumption_rate, contribution_rate);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Simulate double-spend attempt
+ * @param {bigint} amount
+ * @param {number} concurrent_targets
+ * @returns {string}
+ */
+ simulateDoubleSpend(amount, concurrent_targets) {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.adversarialsimulator_simulateDoubleSpend(this.__wbg_ptr, amount, concurrent_targets);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Simulate result tampering
+ * @param {number} tamper_percentage
+ * @returns {string}
+ */
+ simulateResultTampering(tamper_percentage) {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.adversarialsimulator_simulateResultTampering(this.__wbg_ptr, tamper_percentage);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ constructor() {
+ const ret = wasm.adversarialsimulator_new();
+ this.__wbg_ptr = ret >>> 0;
+ AdversarialSimulatorFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+}
+if (Symbol.dispose) AdversarialSimulator.prototype[Symbol.dispose] = AdversarialSimulator.prototype.free;
+
+/**
+ * Audit logger for security events
+ */
+export class AuditLog {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ AuditLogFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_auditlog_free(ptr, 0);
+ }
+ /**
+ * Export events as JSON
+ * @returns {string}
+ */
+ exportEvents() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.auditlog_exportEvents(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Get events for a node
+ * @param {string} node_id
+ * @returns {number}
+ */
+ getEventsForNode(node_id) {
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.auditlog_getEventsForNode(this.__wbg_ptr, ptr0, len0);
+ return ret >>> 0;
+ }
+ /**
+ * Get events by severity
+ * @param {number} min_severity
+ * @returns {number}
+ */
+ getEventsBySeverity(min_severity) {
+ const ret = wasm.auditlog_getEventsBySeverity(this.__wbg_ptr, min_severity);
+ return ret >>> 0;
+ }
+ /**
+ * Log an event
+ * @param {string} event_type
+ * @param {string} node_id
+ * @param {string} details
+ * @param {number} severity
+ */
+ log(event_type, node_id, details, severity) {
+ const ptr0 = passStringToWasm0(event_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passStringToWasm0(node_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len1 = WASM_VECTOR_LEN;
+ const ptr2 = passStringToWasm0(details, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len2 = WASM_VECTOR_LEN;
+ wasm.auditlog_log(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, severity);
+ }
+ constructor() {
+ const ret = wasm.auditlog_new();
+ this.__wbg_ptr = ret >>> 0;
+ AuditLogFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+}
+if (Symbol.dispose) AuditLog.prototype[Symbol.dispose] = AuditLog.prototype.free;
+
+/**
+ * Browser fingerprint generator for anti-sybil protection
+ */
+export class BrowserFingerprint {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ BrowserFingerprintFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_browserfingerprint_free(ptr, 0);
+ }
+ /**
+ * Generate anonymous uniqueness score
+ * This doesn't track users, just ensures one node per browser
+ * @returns {Promise}
+ */
+ static generate() {
+ const ret = wasm.browserfingerprint_generate();
+ return ret;
+ }
+}
+if (Symbol.dispose) BrowserFingerprint.prototype[Symbol.dispose] = BrowserFingerprint.prototype.free;
+
+/**
+ * Byzantine gradient detection using statistical methods
+ */
+export class ByzantineDetector {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ ByzantineDetectorFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_byzantinedetector_free(ptr, 0);
+ }
+ /**
+ * Get maximum allowed magnitude
+ * @returns {number}
+ */
+ getMaxMagnitude() {
+ const ret = wasm.byzantinedetector_getMaxMagnitude(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * Create a new Byzantine detector
+ * @param {number} max_magnitude
+ * @param {number} zscore_threshold
+ */
+ constructor(max_magnitude, zscore_threshold) {
+ const ret = wasm.byzantinedetector_new(max_magnitude, zscore_threshold);
+ this.__wbg_ptr = ret >>> 0;
+ ByzantineDetectorFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+}
+if (Symbol.dispose) ByzantineDetector.prototype[Symbol.dispose] = ByzantineDetector.prototype.free;
+
+/**
+ * The main coherence engine running the RAC protocol
+ */
+export class CoherenceEngine {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ CoherenceEngineFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_coherenceengine_free(ptr, 0);
+ }
+ /**
+ * Get event log length
+ * @returns {number}
+ */
+ eventCount() {
+ const ret = wasm.coherenceengine_eventCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Check if context has drifted
+ * @param {string} context_hex
+ * @returns {boolean}
+ */
+ hasDrifted(context_hex) {
+ const ptr0 = passStringToWasm0(context_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.coherenceengine_hasDrifted(this.__wbg_ptr, ptr0, len0);
+ return ret !== 0;
+ }
+ /**
+ * Check if a claim can be used in decisions
+ * @param {string} claim_id
+ * @returns {boolean}
+ */
+ canUseClaim(claim_id) {
+ const ptr0 = passStringToWasm0(claim_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.coherenceengine_canUseClaim(this.__wbg_ptr, ptr0, len0);
+ return ret !== 0;
+ }
+ /**
+ * Get witness count for a claim
+ * @param {string} claim_id
+ * @returns {number}
+ */
+ witnessCount(claim_id) {
+ const ptr0 = passStringToWasm0(claim_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.coherenceengine_witnessCount(this.__wbg_ptr, ptr0, len0);
+ return ret >>> 0;
+ }
+ /**
+ * Get conflict count
+ * @returns {number}
+ */
+ conflictCount() {
+ const ret = wasm.coherenceengine_conflictCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Get current Merkle root
+ * @returns {string}
+ */
+ getMerkleRoot() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.coherenceengine_getMerkleRoot(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Get quarantined claim count
+ * @returns {number}
+ */
+ quarantinedCount() {
+ const ret = wasm.coherenceengine_quarantinedCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Check quarantine level for a claim
+ * @param {string} claim_id
+ * @returns {number}
+ */
+ getQuarantineLevel(claim_id) {
+ const ptr0 = passStringToWasm0(claim_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.coherenceengine_getQuarantineLevel(this.__wbg_ptr, ptr0, len0);
+ return ret;
+ }
+ /**
+ * Check if claim has sufficient witnesses
+ * @param {string} claim_id
+ * @returns {boolean}
+ */
+ hasSufficientWitnesses(claim_id) {
+ const ptr0 = passStringToWasm0(claim_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.coherenceengine_hasSufficientWitnesses(this.__wbg_ptr, ptr0, len0);
+ return ret !== 0;
+ }
+ /**
+ * Create a new coherence engine
+ */
+ constructor() {
+ const ret = wasm.coherenceengine_new();
+ this.__wbg_ptr = ret >>> 0;
+ CoherenceEngineFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Get drift for a context
+ * @param {string} context_hex
+ * @returns {number}
+ */
+ getDrift(context_hex) {
+ const ptr0 = passStringToWasm0(context_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.coherenceengine_getDrift(this.__wbg_ptr, ptr0, len0);
+ return ret;
+ }
+ /**
+ * Get statistics as JSON
+ * @returns {string}
+ */
+ getStats() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.coherenceengine_getStats(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+}
+if (Symbol.dispose) CoherenceEngine.prototype[Symbol.dispose] = CoherenceEngine.prototype.free;
+
+/**
+ * Collective memory system for distributed pattern learning
+ */
+export class CollectiveMemory {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ CollectiveMemoryFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_collectivememory_free(ptr, 0);
+ }
+ /**
+ * Get queue size
+ * @returns {number}
+ */
+ queueSize() {
+ const ret = wasm.collectivememory_queueSize(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Run consolidation (call during idle periods)
+ * @returns {number}
+ */
+ consolidate() {
+ const ret = wasm.collectivememory_consolidate(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Check if a pattern ID exists
+ * @param {string} pattern_id
+ * @returns {boolean}
+ */
+ hasPattern(pattern_id) {
+ const ptr0 = passStringToWasm0(pattern_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.collectivememory_hasPattern(this.__wbg_ptr, ptr0, len0);
+ return ret !== 0;
+ }
+ /**
+ * Get pattern count in shared index
+ * @returns {number}
+ */
+ patternCount() {
+ const ret = wasm.collectivememory_patternCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Create new collective memory with default config
+ * @param {string} node_id
+ */
+ constructor(node_id) {
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.collectivememory_new(ptr0, len0);
+ this.__wbg_ptr = ret >>> 0;
+ CollectiveMemoryFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Search for similar patterns
+ * @param {string} query_json
+ * @param {number} k
+ * @returns {string}
+ */
+ search(query_json, k) {
+ let deferred2_0;
+ let deferred2_1;
+ try {
+ const ptr0 = passStringToWasm0(query_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.collectivememory_search(this.__wbg_ptr, ptr0, len0, k);
+ deferred2_0 = ret[0];
+ deferred2_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
+ }
+ }
+ /**
+ * Get statistics as JSON
+ * @returns {string}
+ */
+ getStats() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.collectivememory_getStats(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+}
+if (Symbol.dispose) CollectiveMemory.prototype[Symbol.dispose] = CollectiveMemory.prototype.free;
+
+/**
+ * Contribution stream for sustained development
+ */
+export class ContributionStream {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ ContributionStreamFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_contributionstream_free(ptr, 0);
+ }
+ /**
+ * Check if streams are healthy
+ * @returns {boolean}
+ */
+ isHealthy() {
+ const ret = wasm.contributionstream_isHealthy(this.__wbg_ptr);
+ return ret !== 0;
+ }
+ /**
+ * Process network fee distribution
+ * @param {bigint} total_fees
+ * @param {bigint} epoch
+ * @returns {bigint}
+ */
+ processFees(total_fees, epoch) {
+ const ret = wasm.contributionstream_processFees(this.__wbg_ptr, total_fees, epoch);
+ return BigInt.asUintN(64, ret);
+ }
+ /**
+ * Get total distributed
+ * @returns {bigint}
+ */
+ getTotalDistributed() {
+ const ret = wasm.contributionstream_getTotalDistributed(this.__wbg_ptr);
+ return BigInt.asUintN(64, ret);
+ }
+ constructor() {
+ const ret = wasm.contributionstream_new();
+ this.__wbg_ptr = ret >>> 0;
+ ContributionStreamFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+}
+if (Symbol.dispose) ContributionStream.prototype[Symbol.dispose] = ContributionStream.prototype.free;
+
+/**
+ * Differential privacy noise generator
+ */
+export class DifferentialPrivacy {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ DifferentialPrivacyFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_differentialprivacy_free(ptr, 0);
+ }
+ /**
+ * Check if DP is enabled
+ * @returns {boolean}
+ */
+ isEnabled() {
+ const ret = wasm.differentialprivacy_isEnabled(this.__wbg_ptr);
+ return ret !== 0;
+ }
+ /**
+ * Get epsilon value
+ * @returns {number}
+ */
+ getEpsilon() {
+ const ret = wasm.differentialprivacy_getEpsilon(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * Enable/disable differential privacy
+ * @param {boolean} enabled
+ */
+ setEnabled(enabled) {
+ wasm.differentialprivacy_setEnabled(this.__wbg_ptr, enabled);
+ }
+ /**
+ * Create a new differential privacy module
+ * @param {number} epsilon
+ * @param {number} sensitivity
+ */
+ constructor(epsilon, sensitivity) {
+ const ret = wasm.differentialprivacy_new(epsilon, sensitivity);
+ this.__wbg_ptr = ret >>> 0;
+ DifferentialPrivacyFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+}
+if (Symbol.dispose) DifferentialPrivacy.prototype[Symbol.dispose] = DifferentialPrivacy.prototype.free;
+
+/**
+ * Manages semantic drift tracking
+ */
+export class DriftTracker {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ DriftTrackerFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_drifttracker_free(ptr, 0);
+ }
+ /**
+ * Check if context has drifted beyond threshold
+ * @param {string} context_hex
+ * @returns {boolean}
+ */
+ hasDrifted(context_hex) {
+ const ptr0 = passStringToWasm0(context_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.drifttracker_hasDrifted(this.__wbg_ptr, ptr0, len0);
+ return ret !== 0;
+ }
+ /**
+ * Get contexts with significant drift
+ * @returns {string}
+ */
+ getDriftedContexts() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.drifttracker_getDriftedContexts(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Create a new drift tracker
+ * @param {number} drift_threshold
+ */
+ constructor(drift_threshold) {
+ const ret = wasm.drifttracker_new(drift_threshold);
+ this.__wbg_ptr = ret >>> 0;
+ DriftTrackerFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Get drift for a context
+ * @param {string} context_hex
+ * @returns {number}
+ */
+ getDrift(context_hex) {
+ const ptr0 = passStringToWasm0(context_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.drifttracker_getDrift(this.__wbg_ptr, ptr0, len0);
+ return ret;
+ }
+}
+if (Symbol.dispose) DriftTracker.prototype[Symbol.dispose] = DriftTracker.prototype.free;
+
+/**
+ * Economic distribution system for sustainable operations
+ */
+export class EconomicEngine {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ EconomicEngineFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_economicengine_free(ptr, 0);
+ }
+ /**
+ * Get economic health status
+ * @returns {EconomicHealth}
+ */
+ getHealth() {
+ const ret = wasm.economicengine_getHealth(this.__wbg_ptr);
+ return EconomicHealth.__wrap(ret);
+ }
+ /**
+ * Get treasury balance
+ * @returns {bigint}
+ */
+ getTreasury() {
+ const ret = wasm.economicengine_getTreasury(this.__wbg_ptr);
+ return BigInt.asUintN(64, ret);
+ }
+ /**
+ * Advance to next epoch
+ */
+ advanceEpoch() {
+ wasm.economicengine_advanceEpoch(this.__wbg_ptr);
+ }
+ /**
+ * Process task completion and distribute rewards
+ * @param {bigint} base_amount
+ * @param {number} multiplier
+ * @returns {RewardDistribution}
+ */
+ processReward(base_amount, multiplier) {
+ const ret = wasm.economicengine_processReward(this.__wbg_ptr, base_amount, multiplier);
+ return RewardDistribution.__wrap(ret);
+ }
+ /**
+ * Get protocol fund balance (for development sustainability)
+ * @returns {bigint}
+ */
+ getProtocolFund() {
+ const ret = wasm.economicengine_getProtocolFund(this.__wbg_ptr);
+ return BigInt.asUintN(64, ret);
+ }
+ /**
+ * Check if network can sustain itself
+ * @param {number} active_nodes
+ * @param {bigint} daily_tasks
+ * @returns {boolean}
+ */
+ isSelfSustaining(active_nodes, daily_tasks) {
+ const ret = wasm.economicengine_isSelfSustaining(this.__wbg_ptr, active_nodes, daily_tasks);
+ return ret !== 0;
+ }
+ constructor() {
+ const ret = wasm.economicengine_new();
+ this.__wbg_ptr = ret >>> 0;
+ EconomicEngineFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+}
+if (Symbol.dispose) EconomicEngine.prototype[Symbol.dispose] = EconomicEngine.prototype.free;
+
+export class EconomicHealth {
+ static __wrap(ptr) {
+ ptr = ptr >>> 0;
+ const obj = Object.create(EconomicHealth.prototype);
+ obj.__wbg_ptr = ptr;
+ EconomicHealthFinalization.register(obj, obj.__wbg_ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ EconomicHealthFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_economichealth_free(ptr, 0);
+ }
+ /**
+ * Velocity of rUv (transactions per period)
+ * @returns {number}
+ */
+ get velocity() {
+ const ret = wasm.__wbg_get_economichealth_velocity(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * Velocity of rUv (transactions per period)
+ * @param {number} arg0
+ */
+ set velocity(arg0) {
+ wasm.__wbg_set_economichealth_velocity(this.__wbg_ptr, arg0);
+ }
+ /**
+ * Network utilization rate
+ * @returns {number}
+ */
+ get utilization() {
+ const ret = wasm.__wbg_get_economichealth_utilization(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * Network utilization rate
+ * @param {number} arg0
+ */
+ set utilization(arg0) {
+ wasm.__wbg_set_economichealth_utilization(this.__wbg_ptr, arg0);
+ }
+ /**
+ * Supply growth rate
+ * @returns {number}
+ */
+ get growth_rate() {
+ const ret = wasm.__wbg_get_economichealth_growth_rate(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * Supply growth rate
+ * @param {number} arg0
+ */
+ set growth_rate(arg0) {
+ wasm.__wbg_set_economichealth_growth_rate(this.__wbg_ptr, arg0);
+ }
+ /**
+ * Stability index (0-1)
+ * @returns {number}
+ */
+ get stability() {
+ const ret = wasm.__wbg_get_economichealth_stability(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * Stability index (0-1)
+ * @param {number} arg0
+ */
+ set stability(arg0) {
+ wasm.__wbg_set_economichealth_stability(this.__wbg_ptr, arg0);
+ }
+}
+if (Symbol.dispose) EconomicHealth.prototype[Symbol.dispose] = EconomicHealth.prototype.free;
+
+/**
+ * Configuration builder for EdgeNet
+ */
+export class EdgeNetConfig {
+ static __wrap(ptr) {
+ ptr = ptr >>> 0;
+ const obj = Object.create(EdgeNetConfig.prototype);
+ obj.__wbg_ptr = ptr;
+ EdgeNetConfigFinalization.register(obj, obj.__wbg_ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ EdgeNetConfigFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_edgenetconfig_free(ptr, 0);
+ }
+ /**
+ * @param {number} bytes
+ * @returns {EdgeNetConfig}
+ */
+ memoryLimit(bytes) {
+ const ptr = this.__destroy_into_raw();
+ const ret = wasm.edgenetconfig_memoryLimit(ptr, bytes);
+ return EdgeNetConfig.__wrap(ret);
+ }
+ /**
+ * @param {number} ms
+ * @returns {EdgeNetConfig}
+ */
+ minIdleTime(ms) {
+ const ptr = this.__destroy_into_raw();
+ const ret = wasm.edgenetconfig_minIdleTime(ptr, ms);
+ return EdgeNetConfig.__wrap(ret);
+ }
+ /**
+ * @param {boolean} respect
+ * @returns {EdgeNetConfig}
+ */
+ respectBattery(respect) {
+ const ptr = this.__destroy_into_raw();
+ const ret = wasm.edgenetconfig_respectBattery(ptr, respect);
+ return EdgeNetConfig.__wrap(ret);
+ }
+ /**
+ * @param {string} site_id
+ */
+ constructor(site_id) {
+ const ptr0 = passStringToWasm0(site_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.edgenetconfig_new(ptr0, len0);
+ this.__wbg_ptr = ret >>> 0;
+ EdgeNetConfigFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * @returns {EdgeNetNode}
+ */
+ build() {
+ const ptr = this.__destroy_into_raw();
+ const ret = wasm.edgenetconfig_build(ptr);
+ if (ret[2]) {
+ throw takeFromExternrefTable0(ret[1]);
+ }
+ return EdgeNetNode.__wrap(ret[0]);
+ }
+ /**
+ * @param {string} url
+ * @returns {EdgeNetConfig}
+ */
+ addRelay(url) {
+ const ptr = this.__destroy_into_raw();
+ const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.edgenetconfig_addRelay(ptr, ptr0, len0);
+ return EdgeNetConfig.__wrap(ret);
+ }
+ /**
+ * @param {number} limit
+ * @returns {EdgeNetConfig}
+ */
+ cpuLimit(limit) {
+ const ptr = this.__destroy_into_raw();
+ const ret = wasm.edgenetconfig_cpuLimit(ptr, limit);
+ return EdgeNetConfig.__wrap(ret);
+ }
+}
+if (Symbol.dispose) EdgeNetConfig.prototype[Symbol.dispose] = EdgeNetConfig.prototype.free;
+
+/**
+ * Main EdgeNet node - the entry point for participating in the network
+ */
+export class EdgeNetNode {
+ static __wrap(ptr) {
+ ptr = ptr >>> 0;
+ const obj = Object.create(EdgeNetNode.prototype);
+ obj.__wbg_ptr = ptr;
+ EdgeNetNodeFinalization.register(obj, obj.__wbg_ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ EdgeNetNodeFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_edgenetnode_free(ptr, 0);
+ }
+ /**
+ * Disconnect from the network
+ */
+ disconnect() {
+ const ret = wasm.edgenetnode_disconnect(this.__wbg_ptr);
+ if (ret[1]) {
+ throw takeFromExternrefTable0(ret[0]);
+ }
+ }
+ /**
+ * Enable HDC for hyperdimensional computing
+ * @returns {boolean}
+ */
+ enableHDC() {
+ const ret = wasm.edgenetnode_enableHDC(this.__wbg_ptr);
+ return ret !== 0;
+ }
+ /**
+ * Enable Neural Autonomous Organization for governance
+ * @param {number} quorum
+ * @returns {boolean}
+ */
+ enableNAO(quorum) {
+ const ret = wasm.edgenetnode_enableNAO(this.__wbg_ptr, quorum);
+ return ret !== 0;
+ }
+ /**
+ * Enable WTA for instant decisions
+ * @param {number} num_neurons
+ * @returns {boolean}
+ */
+ enableWTA(num_neurons) {
+ const ret = wasm.edgenetnode_enableBTSP(this.__wbg_ptr, num_neurons);
+ return ret !== 0;
+ }
+ /**
+ * Enable BTSP for one-shot learning
+ * @param {number} input_dim
+ * @returns {boolean}
+ */
+ enableBTSP(input_dim) {
+ const ret = wasm.edgenetnode_enableBTSP(this.__wbg_ptr, input_dim);
+ return ret !== 0;
+ }
+ /**
+ * Propose an action in the NAO
+ * @param {string} action
+ * @returns {string}
+ */
+ proposeNAO(action) {
+ let deferred2_0;
+ let deferred2_1;
+ try {
+ const ptr0 = passStringToWasm0(action, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.edgenetnode_proposeNAO(this.__wbg_ptr, ptr0, len0);
+ deferred2_0 = ret[0];
+ deferred2_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
+ }
+ }
+ /**
+ * Alias for creditBalance - returns rUv balance
+ * @returns {bigint}
+ */
+ ruvBalance() {
+ const ret = wasm.edgenetnode_creditBalance(this.__wbg_ptr);
+ return BigInt.asUintN(64, ret);
+ }
+ /**
+ * Submit a task to the network
+ * @param {string} task_type
+ * @param {Uint8Array} payload
+ * @param {bigint} max_credits
+ * @returns {Promise}
+ */
+ submitTask(task_type, payload, max_credits) {
+ const ptr0 = passStringToWasm0(task_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passArray8ToWasm0(payload, wasm.__wbindgen_malloc);
+ const len1 = WASM_VECTOR_LEN;
+ const ret = wasm.edgenetnode_submitTask(this.__wbg_ptr, ptr0, len0, ptr1, len1, max_credits);
+ return ret;
+ }
+ /**
+ * Check for active celebration events
+ * @returns {string}
+ */
+ checkEvents() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.edgenetnode_checkEvents(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Get current throttle level (0.0 - 1.0)
+ * @returns {number}
+ */
+ getThrottle() {
+ const ret = wasm.edgenetnode_getThrottle(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * Get treasury balance for operations
+ * @returns {bigint}
+ */
+ getTreasury() {
+ const ret = wasm.edgenetnode_getTreasury(this.__wbg_ptr);
+ return BigInt.asUintN(64, ret);
+ }
+ /**
+ * Check if a claim can be used (not quarantined)
+ * @param {string} claim_id
+ * @returns {boolean}
+ */
+ canUseClaim(claim_id) {
+ const ptr0 = passStringToWasm0(claim_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.edgenetnode_canUseClaim(this.__wbg_ptr, ptr0, len0);
+ return ret !== 0;
+ }
+ /**
+ * Process epoch for economic distribution
+ */
+ processEpoch() {
+ wasm.edgenetnode_processEpoch(this.__wbg_ptr);
+ }
+ /**
+ * Store a learned pattern in the reasoning bank
+ * @param {string} pattern_json
+ * @returns {number}
+ */
+ storePattern(pattern_json) {
+ const ptr0 = passStringToWasm0(pattern_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.edgenetnode_storePattern(this.__wbg_ptr, ptr0, len0);
+ return ret;
+ }
+ /**
+ * Get current rUv (Resource Utility Voucher) balance
+ * @returns {bigint}
+ */
+ creditBalance() {
+ const ret = wasm.edgenetnode_creditBalance(this.__wbg_ptr);
+ return BigInt.asUintN(64, ret);
+ }
+ /**
+ * Get motivational message (subtle Easter egg)
+ * @returns {string}
+ */
+ getMotivation() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.edgenetnode_getMotivation(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Get current contribution multiplier based on network size
+ * @returns {number}
+ */
+ getMultiplier() {
+ const ret = wasm.edgenetnode_getMultiplier(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * Prune low-quality learned patterns
+ * @param {number} min_usage
+ * @param {number} min_confidence
+ * @returns {number}
+ */
+ prunePatterns(min_usage, min_confidence) {
+ const ret = wasm.edgenetnode_prunePatterns(this.__wbg_ptr, min_usage, min_confidence);
+ return ret >>> 0;
+ }
+ /**
+ * Get current Merkle root for audit (Axiom 11: Equivocation detectable)
+ * @returns {string}
+ */
+ getMerkleRoot() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.edgenetnode_getMerkleRoot(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Lookup similar patterns for task optimization
+ * @param {string} query_json
+ * @param {number} k
+ * @returns {string}
+ */
+ lookupPatterns(query_json, k) {
+ let deferred2_0;
+ let deferred2_1;
+ try {
+ const ptr0 = passStringToWasm0(query_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.edgenetnode_lookupPatterns(this.__wbg_ptr, ptr0, len0, k);
+ deferred2_0 = ret[0];
+ deferred2_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
+ }
+ }
+ /**
+ * Get all available exotic capabilities and their status
+ * @returns {any}
+ */
+ getCapabilities() {
+ const ret = wasm.edgenetnode_getCapabilities(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * Check if this node should replicate (high performer)
+ * @returns {boolean}
+ */
+ shouldReplicate() {
+ const ret = wasm.edgenetnode_shouldReplicate(this.__wbg_ptr);
+ return ret !== 0;
+ }
+ /**
+ * Enable MicroLoRA for self-learning
+ * @param {number} rank
+ * @returns {boolean}
+ */
+ enableMicroLoRA(rank) {
+ const ret = wasm.edgenetnode_enableBTSP(this.__wbg_ptr, rank);
+ return ret !== 0;
+ }
+ /**
+ * Get founding contributor count
+ * @returns {number}
+ */
+ getFounderCount() {
+ const ret = wasm.edgenetnode_getFounderCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Get optimal peers for task routing
+ * @param {number} count
+ * @returns {string[]}
+ */
+ getOptimalPeers(count) {
+ const ret = wasm.edgenetnode_getOptimalPeers(this.__wbg_ptr, count);
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
+ return v1;
+ }
+ /**
+ * Get stored pattern count
+ * @returns {number}
+ */
+ getPatternCount() {
+ const ret = wasm.edgenetnode_getPatternCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Get protocol development fund balance
+ * @returns {bigint}
+ */
+ getProtocolFund() {
+ const ret = wasm.edgenetnode_getProtocolFund(this.__wbg_ptr);
+ return BigInt.asUintN(64, ret);
+ }
+ /**
+ * Get themed network status
+ * @param {number} node_count
+ * @returns {string}
+ */
+ getThemedStatus(node_count) {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.edgenetnode_getThemedStatus(this.__wbg_ptr, node_count);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Get contribution stream health
+ * @returns {boolean}
+ */
+ isStreamHealthy() {
+ const ret = wasm.edgenetnode_isStreamHealthy(this.__wbg_ptr);
+ return ret !== 0;
+ }
+ /**
+ * Process the next available task (called by worker)
+ * @returns {Promise}
+ */
+ processNextTask() {
+ const ret = wasm.edgenetnode_processNextTask(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * Step all exotic capabilities forward
+ * @param {number} dt
+ */
+ stepCapabilities(dt) {
+ wasm.edgenetnode_stepCapabilities(this.__wbg_ptr, dt);
+ }
+ /**
+ * Get active conflict count (Axiom 6: Disagreement is signal)
+ * @returns {number}
+ */
+ getConflictCount() {
+ const ret = wasm.edgenetnode_getConflictCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Get learning statistics
+ * @returns {string}
+ */
+ getLearningStats() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.edgenetnode_getLearningStats(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Check if network is self-sustaining
+ * @param {number} active_nodes
+ * @param {bigint} daily_tasks
+ * @returns {boolean}
+ */
+ isSelfSustaining(active_nodes, daily_tasks) {
+ const ret = wasm.edgenetnode_isSelfSustaining(this.__wbg_ptr, active_nodes, daily_tasks);
+ return ret !== 0;
+ }
+ /**
+ * Record node performance for evolution
+ * @param {number} success_rate
+ * @param {number} throughput
+ */
+ recordPerformance(success_rate, throughput) {
+ wasm.edgenetnode_recordPerformance(this.__wbg_ptr, success_rate, throughput);
+ }
+ /**
+ * Run security audit (adversarial testing)
+ * @returns {string}
+ */
+ runSecurityAudit() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.edgenetnode_runSecurityAudit(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Enable Time Crystal for P2P synchronization
+ * @param {number} oscillators
+ * @returns {boolean}
+ */
+ enableTimeCrystal(oscillators) {
+ const ret = wasm.edgenetnode_enableBTSP(this.__wbg_ptr, oscillators);
+ return ret !== 0;
+ }
+ /**
+ * Get coherence statistics
+ * @returns {string}
+ */
+ getCoherenceStats() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.edgenetnode_getCoherenceStats(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Get economic health metrics
+ * @returns {string}
+ */
+ getEconomicHealth() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.edgenetnode_getEconomicHealth(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Get network fitness score (0-1)
+ * @returns {number}
+ */
+ getNetworkFitness() {
+ const ret = wasm.edgenetnode_getNetworkFitness(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * Record task routing outcome for optimization
+ * @param {string} task_type
+ * @param {string} node_id
+ * @param {bigint} latency_ms
+ * @param {boolean} success
+ */
+ recordTaskRouting(task_type, node_id, latency_ms, success) {
+ const ptr0 = passStringToWasm0(task_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passStringToWasm0(node_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len1 = WASM_VECTOR_LEN;
+ wasm.edgenetnode_recordTaskRouting(this.__wbg_ptr, ptr0, len0, ptr1, len1, latency_ms, success);
+ }
+ /**
+ * Enable Morphogenetic Network for emergent topology
+ * @param {number} size
+ * @returns {boolean}
+ */
+ enableMorphogenetic(size) {
+ const ret = wasm.edgenetnode_enableBTSP(this.__wbg_ptr, size);
+ return ret !== 0;
+ }
+ /**
+ * Get trajectory count for learning analysis
+ * @returns {number}
+ */
+ getTrajectoryCount() {
+ const ret = wasm.edgenetnode_getTrajectoryCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Get energy efficiency ratio from spike-driven attention
+ * @param {number} seq_len
+ * @param {number} hidden_dim
+ * @returns {number}
+ */
+ getEnergyEfficiency(seq_len, hidden_dim) {
+ const ret = wasm.edgenetnode_getEnergyEfficiency(this.__wbg_ptr, seq_len, hidden_dim);
+ return ret;
+ }
+ /**
+ * Get quarantined claim count (Axiom 9: Quarantine is mandatory)
+ * @returns {number}
+ */
+ getQuarantinedCount() {
+ const ret = wasm.edgenetnode_getQuarantinedCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Get Time Crystal synchronization level (0.0 - 1.0)
+ * @returns {number}
+ */
+ getTimeCrystalSync() {
+ const ret = wasm.edgenetnode_getTimeCrystalSync(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * Get optimization statistics
+ * @returns {string}
+ */
+ getOptimizationStats() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.edgenetnode_getOptimizationStats(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Get recommended configuration for new nodes
+ * @returns {string}
+ */
+ getRecommendedConfig() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.edgenetnode_getRecommendedConfig(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Enable Global Workspace for attention
+ * @param {number} capacity
+ * @returns {boolean}
+ */
+ enableGlobalWorkspace(capacity) {
+ const ret = wasm.edgenetnode_enableBTSP(this.__wbg_ptr, capacity);
+ return ret !== 0;
+ }
+ /**
+ * Record peer interaction for topology optimization
+ * @param {string} peer_id
+ * @param {number} success_rate
+ */
+ recordPeerInteraction(peer_id, success_rate) {
+ const ptr0 = passStringToWasm0(peer_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.edgenetnode_recordPeerInteraction(this.__wbg_ptr, ptr0, len0, success_rate);
+ }
+ /**
+ * Get capabilities summary as JSON
+ * @returns {any}
+ */
+ getCapabilitiesSummary() {
+ const ret = wasm.edgenetnode_getCapabilitiesSummary(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * Get coherence engine event count
+ * @returns {number}
+ */
+ getCoherenceEventCount() {
+ const ret = wasm.edgenetnode_getCoherenceEventCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Get quarantine level for a claim
+ * @param {string} claim_id
+ * @returns {number}
+ */
+ getClaimQuarantineLevel(claim_id) {
+ const ptr0 = passStringToWasm0(claim_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.edgenetnode_getClaimQuarantineLevel(this.__wbg_ptr, ptr0, len0);
+ return ret;
+ }
+ /**
+ * Record a task execution trajectory for learning
+ * @param {string} trajectory_json
+ * @returns {boolean}
+ */
+ recordLearningTrajectory(trajectory_json) {
+ const ptr0 = passStringToWasm0(trajectory_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.edgenetnode_recordLearningTrajectory(this.__wbg_ptr, ptr0, len0);
+ return ret !== 0;
+ }
+ /**
+ * Create a new EdgeNet node
+ * @param {string} site_id
+ * @param {NodeConfig | null} [config]
+ */
+ constructor(site_id, config) {
+ const ptr0 = passStringToWasm0(site_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ let ptr1 = 0;
+ if (!isLikeNone(config)) {
+ _assertClass(config, NodeConfig);
+ ptr1 = config.__destroy_into_raw();
+ }
+ const ret = wasm.edgenetnode_new(ptr0, len0, ptr1);
+ if (ret[2]) {
+ throw takeFromExternrefTable0(ret[1]);
+ }
+ this.__wbg_ptr = ret[0] >>> 0;
+ EdgeNetNodeFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Pause contribution
+ */
+ pause() {
+ wasm.edgenetnode_pause(this.__wbg_ptr);
+ }
+ /**
+ * Start contributing to the network
+ */
+ start() {
+ const ret = wasm.edgenetnode_start(this.__wbg_ptr);
+ if (ret[1]) {
+ throw takeFromExternrefTable0(ret[0]);
+ }
+ }
+ /**
+ * Resume contribution
+ */
+ resume() {
+ wasm.edgenetnode_resume(this.__wbg_ptr);
+ }
+ /**
+ * Check if user is currently idle
+ * @returns {boolean}
+ */
+ isIdle() {
+ const ret = wasm.edgenetnode_isIdle(this.__wbg_ptr);
+ return ret !== 0;
+ }
+ /**
+ * Get the node's unique identifier
+ * @returns {string}
+ */
+ nodeId() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.edgenetnode_nodeId(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Vote on a NAO proposal
+ * @param {string} proposal_id
+ * @param {number} weight
+ * @returns {boolean}
+ */
+ voteNAO(proposal_id, weight) {
+ const ptr0 = passStringToWasm0(proposal_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.edgenetnode_voteNAO(this.__wbg_ptr, ptr0, len0, weight);
+ return ret !== 0;
+ }
+ /**
+ * Get node statistics
+ * @returns {NodeStats}
+ */
+ getStats() {
+ const ret = wasm.edgenetnode_getStats(this.__wbg_ptr);
+ return NodeStats.__wrap(ret);
+ }
+}
+if (Symbol.dispose) EdgeNetNode.prototype[Symbol.dispose] = EdgeNetNode.prototype.free;
+
+/**
+ * Entropy-based consensus engine for swarm decisions
+ */
+export class EntropyConsensus {
+ static __wrap(ptr) {
+ ptr = ptr >>> 0;
+ const obj = Object.create(EntropyConsensus.prototype);
+ obj.__wbg_ptr = ptr;
+ EntropyConsensusFinalization.register(obj, obj.__wbg_ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ EntropyConsensusFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_entropyconsensus_free(ptr, 0);
+ }
+ /**
+ * Get belief probability for a decision
+ * @param {bigint} decision_id
+ * @returns {number}
+ */
+ getBelief(decision_id) {
+ const ret = wasm.entropyconsensus_getBelief(this.__wbg_ptr, decision_id);
+ return ret;
+ }
+ /**
+ * Get number of negotiation rounds completed
+ * @returns {number}
+ */
+ getRounds() {
+ const ret = wasm.entropyconsensus_getRounds(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Set initial belief for a decision
+ * @param {bigint} decision_id
+ * @param {number} probability
+ */
+ setBelief(decision_id, probability) {
+ wasm.entropyconsensus_setBelief(this.__wbg_ptr, decision_id, probability);
+ }
+ /**
+ * Get the winning decision (if converged)
+ * @returns {bigint | undefined}
+ */
+ getDecision() {
+ const ret = wasm.entropyconsensus_getDecision(this.__wbg_ptr);
+ return ret[0] === 0 ? undefined : BigInt.asUintN(64, ret[1]);
+ }
+ /**
+ * Get number of decision options
+ * @returns {number}
+ */
+ optionCount() {
+ const ret = wasm.entropyconsensus_optionCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Check if negotiation has timed out
+ * @returns {boolean}
+ */
+ hasTimedOut() {
+ const ret = wasm.entropyconsensus_hasTimedOut(this.__wbg_ptr);
+ return ret !== 0;
+ }
+ /**
+ * Set belief without normalizing (for batch updates)
+ * Call normalize_beliefs() after all set_belief_raw calls
+ * @param {bigint} decision_id
+ * @param {number} probability
+ */
+ set_belief_raw(decision_id, probability) {
+ wasm.entropyconsensus_set_belief_raw(this.__wbg_ptr, decision_id, probability);
+ }
+ /**
+ * Create with custom entropy threshold
+ * @param {number} threshold
+ * @returns {EntropyConsensus}
+ */
+ static withThreshold(threshold) {
+ const ret = wasm.entropyconsensus_withThreshold(threshold);
+ return EntropyConsensus.__wrap(ret);
+ }
+ /**
+ * Get current temperature (for annealing)
+ * @returns {number}
+ */
+ getTemperature() {
+ const ret = wasm.entropyconsensus_getTemperature(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * Manually trigger normalization (for use after set_belief_raw)
+ */
+ finalize_beliefs() {
+ wasm.entropyconsensus_finalize_beliefs(this.__wbg_ptr);
+ }
+ /**
+ * Get entropy history as JSON
+ * @returns {string}
+ */
+ getEntropyHistory() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.entropyconsensus_getEntropyHistory(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Get the entropy threshold for convergence
+ * @returns {number}
+ */
+ getEntropyThreshold() {
+ const ret = wasm.entropyconsensus_getEntropyThreshold(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * Create new entropy consensus with default configuration
+ */
+ constructor() {
+ const ret = wasm.entropyconsensus_new();
+ this.__wbg_ptr = ret >>> 0;
+ EntropyConsensusFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Reset consensus state for new decision
+ */
+ reset() {
+ wasm.entropyconsensus_reset(this.__wbg_ptr);
+ }
+ /**
+ * Get current entropy of belief distribution
+ * @returns {number}
+ */
+ entropy() {
+ const ret = wasm.entropyconsensus_entropy(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * Check if consensus has been reached
+ * @returns {boolean}
+ */
+ converged() {
+ const ret = wasm.entropyconsensus_converged(this.__wbg_ptr);
+ return ret !== 0;
+ }
+ /**
+ * Get consensus statistics as JSON
+ * @returns {string}
+ */
+ getStats() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.entropyconsensus_getStats(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+}
+if (Symbol.dispose) EntropyConsensus.prototype[Symbol.dispose] = EntropyConsensus.prototype.free;
+
+/**
+ * Append-only Merkle log for audit (FIXED: proper event storage)
+ */
+export class EventLog {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ EventLogFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_eventlog_free(ptr, 0);
+ }
+ /**
+ * Get total event count
+ * @returns {number}
+ */
+ totalEvents() {
+ const ret = wasm.eventlog_len(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Get current event count (includes all events)
+ * @returns {number}
+ */
+ len() {
+ const ret = wasm.eventlog_len(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Create a new event log
+ */
+ constructor() {
+ const ret = wasm.eventlog_new();
+ this.__wbg_ptr = ret >>> 0;
+ EventLogFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Get current Merkle root as hex string
+ * @returns {string}
+ */
+ getRoot() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.eventlog_getRoot(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Check if log is empty
+ * @returns {boolean}
+ */
+ isEmpty() {
+ const ret = wasm.eventlog_isEmpty(this.__wbg_ptr);
+ return ret !== 0;
+ }
+}
+if (Symbol.dispose) EventLog.prototype[Symbol.dispose] = EventLog.prototype.free;
+
+/**
+ * Node replication and evolution guidance
+ */
+export class EvolutionEngine {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ EvolutionEngineFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_evolutionengine_free(ptr, 0);
+ }
+ /**
+ * Check if node should replicate (spawn similar node)
+ * @param {string} node_id
+ * @returns {boolean}
+ */
+ shouldReplicate(node_id) {
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.evolutionengine_shouldReplicate(this.__wbg_ptr, ptr0, len0);
+ return ret !== 0;
+ }
+ /**
+ * Record node performance for fitness evaluation
+ * @param {string} node_id
+ * @param {number} success_rate
+ * @param {number} throughput
+ */
+ recordPerformance(node_id, success_rate, throughput) {
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.evolutionengine_recordPerformance(this.__wbg_ptr, ptr0, len0, success_rate, throughput);
+ }
+ /**
+ * Get network fitness score
+ * @returns {number}
+ */
+ getNetworkFitness() {
+ const ret = wasm.evolutionengine_getNetworkFitness(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * Get recommended configuration for new nodes
+ * @returns {string}
+ */
+ getRecommendedConfig() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.evolutionengine_getRecommendedConfig(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ constructor() {
+ const ret = wasm.evolutionengine_new();
+ this.__wbg_ptr = ret >>> 0;
+ EvolutionEngineFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Evolve patterns for next generation
+ */
+ evolve() {
+ wasm.evolutionengine_evolve(this.__wbg_ptr);
+ }
+}
+if (Symbol.dispose) EvolutionEngine.prototype[Symbol.dispose] = EvolutionEngine.prototype.free;
+
+/**
+ * Federated model state for tracking learning progress
+ */
+export class FederatedModel {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ FederatedModelFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_federatedmodel_free(ptr, 0);
+ }
+ /**
+ * Get parameter dimension
+ * @returns {number}
+ */
+ getDimension() {
+ const ret = wasm.federatedmodel_getDimension(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Get parameters as array
+ * @returns {Float32Array}
+ */
+ getParameters() {
+ const ret = wasm.federatedmodel_getParameters(this.__wbg_ptr);
+ var v1 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
+ return v1;
+ }
+ /**
+ * Set parameters from array
+ * @param {Float32Array} params
+ */
+ setParameters(params) {
+ const ptr0 = passArrayF32ToWasm0(params, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.federatedmodel_setParameters(this.__wbg_ptr, ptr0, len0);
+ if (ret[1]) {
+ throw takeFromExternrefTable0(ret[0]);
+ }
+ }
+ /**
+ * Apply aggregated gradients to update model
+ * @param {Float32Array} gradients
+ */
+ applyGradients(gradients) {
+ const ptr0 = passArrayF32ToWasm0(gradients, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.federatedmodel_applyGradients(this.__wbg_ptr, ptr0, len0);
+ if (ret[1]) {
+ throw takeFromExternrefTable0(ret[0]);
+ }
+ }
+ /**
+ * Set local epochs per round
+ * @param {number} epochs
+ */
+ setLocalEpochs(epochs) {
+ wasm.federatedmodel_setLocalEpochs(this.__wbg_ptr, epochs);
+ }
+ /**
+ * Set learning rate
+ * @param {number} lr
+ */
+ setLearningRate(lr) {
+ wasm.federatedmodel_setLearningRate(this.__wbg_ptr, lr);
+ }
+ /**
+ * Create a new federated model
+ * @param {number} dimension
+ * @param {number} learning_rate
+ * @param {number} momentum
+ */
+ constructor(dimension, learning_rate, momentum) {
+ const ret = wasm.federatedmodel_new(dimension, learning_rate, momentum);
+ this.__wbg_ptr = ret >>> 0;
+ FederatedModelFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Get current round
+ * @returns {bigint}
+ */
+ getRound() {
+ const ret = wasm.federatedmodel_getRound(this.__wbg_ptr);
+ return BigInt.asUintN(64, ret);
+ }
+}
+if (Symbol.dispose) FederatedModel.prototype[Symbol.dispose] = FederatedModel.prototype.free;
+
+/**
+ * Founding contributor registry
+ */
+export class FoundingRegistry {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ FoundingRegistryFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_foundingregistry_free(ptr, 0);
+ }
+ /**
+ * Process epoch distribution
+ * @param {bigint} current_epoch
+ * @param {bigint} available_amount
+ * @returns {any[]}
+ */
+ processEpoch(current_epoch, available_amount) {
+ const ret = wasm.foundingregistry_processEpoch(this.__wbg_ptr, current_epoch, available_amount);
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
+ return v1;
+ }
+ /**
+ * Calculate vested amount for current epoch
+ * @param {bigint} current_epoch
+ * @param {bigint} pool_balance
+ * @returns {bigint}
+ */
+ calculateVested(current_epoch, pool_balance) {
+ const ret = wasm.foundingregistry_calculateVested(this.__wbg_ptr, current_epoch, pool_balance);
+ return BigInt.asUintN(64, ret);
+ }
+ /**
+ * Get founding contributor count
+ * @returns {number}
+ */
+ getFounderCount() {
+ const ret = wasm.foundingregistry_getFounderCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Register additional founding contributor
+ * @param {string} id
+ * @param {string} category
+ * @param {number} weight
+ */
+ registerContributor(id, category, weight) {
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passStringToWasm0(category, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len1 = WASM_VECTOR_LEN;
+ wasm.foundingregistry_registerContributor(this.__wbg_ptr, ptr0, len0, ptr1, len1, weight);
+ }
+ constructor() {
+ const ret = wasm.foundingregistry_new();
+ this.__wbg_ptr = ret >>> 0;
+ FoundingRegistryFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+}
+if (Symbol.dispose) FoundingRegistry.prototype[Symbol.dispose] = FoundingRegistry.prototype.free;
+
+/**
+ * Genesis Key - Ultra-compact origin marker (φ-sized: 21 bytes)
+ */
+export class GenesisKey {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ GenesisKeyFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_genesiskey_free(ptr, 0);
+ }
+ /**
+ * Get ID as hex
+ * @returns {string}
+ */
+ getIdHex() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.genesiskey_getIdHex(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Export ultra-compact genesis key (21 bytes only)
+ * @returns {Uint8Array}
+ */
+ exportUltraCompact() {
+ const ret = wasm.genesiskey_exportUltraCompact(this.__wbg_ptr);
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
+ return v1;
+ }
+ /**
+ * Create a new genesis key
+ * @param {PiKey} creator
+ * @param {number} epoch
+ */
+ constructor(creator, epoch) {
+ _assertClass(creator, PiKey);
+ const ret = wasm.genesiskey_create(creator.__wbg_ptr, epoch);
+ if (ret[2]) {
+ throw takeFromExternrefTable0(ret[1]);
+ }
+ this.__wbg_ptr = ret[0] >>> 0;
+ GenesisKeyFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Get the φ-sized genesis ID
+ * @returns {Uint8Array}
+ */
+ getId() {
+ const ret = wasm.genesiskey_getId(this.__wbg_ptr);
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
+ return v1;
+ }
+ /**
+ * Verify this genesis key was created by a specific Pi-Key
+ * @param {Uint8Array} creator_public_key
+ * @returns {boolean}
+ */
+ verify(creator_public_key) {
+ const ptr0 = passArray8ToWasm0(creator_public_key, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.genesiskey_verify(this.__wbg_ptr, ptr0, len0);
+ return ret !== 0;
+ }
+ /**
+ * Get epoch
+ * @returns {number}
+ */
+ getEpoch() {
+ const ret = wasm.genesiskey_getEpoch(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+}
+if (Symbol.dispose) GenesisKey.prototype[Symbol.dispose] = GenesisKey.prototype.free;
+
+/**
+ * Genesis node sunset orchestrator
+ */
+export class GenesisSunset {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ GenesisSunsetFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_genesissunset_free(ptr, 0);
+ }
+ /**
+ * Check if it's safe to retire genesis nodes
+ * @returns {boolean}
+ */
+ canRetire() {
+ const ret = wasm.genesissunset_canRetire(this.__wbg_ptr);
+ return ret !== 0;
+ }
+ /**
+ * Get sunset status
+ * @returns {string}
+ */
+ getStatus() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.genesissunset_getStatus(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Check if genesis nodes should be read-only
+ * @returns {boolean}
+ */
+ isReadOnly() {
+ const ret = wasm.genesissunset_isReadOnly(this.__wbg_ptr);
+ return ret !== 0;
+ }
+ /**
+ * Get current sunset phase
+ * 0 = Active (genesis required)
+ * 1 = Transition (stop new connections)
+ * 2 = Read-only (genesis read-only)
+ * 3 = Retired (genesis can be removed)
+ * @returns {number}
+ */
+ getCurrentPhase() {
+ const ret = wasm.genesissunset_getCurrentPhase(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * Update network node count
+ * @param {number} count
+ * @returns {number}
+ */
+ updateNodeCount(count) {
+ const ret = wasm.genesissunset_updateNodeCount(this.__wbg_ptr, count);
+ return ret;
+ }
+ /**
+ * Check if network is self-sustaining
+ * @returns {boolean}
+ */
+ isSelfSustaining() {
+ const ret = wasm.genesissunset_canRetire(this.__wbg_ptr);
+ return ret !== 0;
+ }
+ /**
+ * Register a genesis node
+ * @param {string} node_id
+ */
+ registerGenesisNode(node_id) {
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.genesissunset_registerGenesisNode(this.__wbg_ptr, ptr0, len0);
+ }
+ /**
+ * Check if genesis nodes should accept new connections
+ * @returns {boolean}
+ */
+ shouldAcceptConnections() {
+ const ret = wasm.genesissunset_shouldAcceptConnections(this.__wbg_ptr);
+ return ret !== 0;
+ }
+ constructor() {
+ const ret = wasm.genesissunset_new();
+ this.__wbg_ptr = ret >>> 0;
+ GenesisSunsetFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+}
+if (Symbol.dispose) GenesisSunset.prototype[Symbol.dispose] = GenesisSunset.prototype.free;
+
+/**
+ * P2P Gradient Gossip for decentralized federated learning
+ *
+ * This is the main coordinator for federated learning without a central server.
+ */
+export class GradientGossip {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ GradientGossipFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_gradientgossip_free(ptr, 0);
+ }
+ /**
+ * Get number of active peers
+ * @returns {number}
+ */
+ peerCount() {
+ const ret = wasm.gradientgossip_peerCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Prune stale peer gradients
+ * @returns {number}
+ */
+ pruneStale() {
+ const ret = wasm.gradientgossip_pruneStale(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Configure differential privacy
+ * @param {number} epsilon
+ * @param {number} sensitivity
+ */
+ configureDifferentialPrivacy(epsilon, sensitivity) {
+ wasm.gradientgossip_configureDifferentialPrivacy(this.__wbg_ptr, epsilon, sensitivity);
+ }
+ /**
+ * Advance to next consensus round
+ * @returns {bigint}
+ */
+ advanceRound() {
+ const ret = wasm.gradientgossip_advanceRound(this.__wbg_ptr);
+ return BigInt.asUintN(64, ret);
+ }
+ /**
+ * Get gradient dimension
+ * @returns {number}
+ */
+ getDimension() {
+ const ret = wasm.gradientgossip_getDimension(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Enable/disable differential privacy
+ * @param {boolean} enabled
+ */
+ setDPEnabled(enabled) {
+ wasm.gradientgossip_setDPEnabled(this.__wbg_ptr, enabled);
+ }
+ /**
+ * Set model hash for version compatibility
+ * @param {Uint8Array} hash
+ */
+ setModelHash(hash) {
+ const ptr0 = passArray8ToWasm0(hash, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.gradientgossip_setModelHash(this.__wbg_ptr, ptr0, len0);
+ if (ret[1]) {
+ throw takeFromExternrefTable0(ret[0]);
+ }
+ }
+ /**
+ * Get current consensus round
+ * @returns {bigint}
+ */
+ getCurrentRound() {
+ const ret = wasm.gradientgossip_getCurrentRound(this.__wbg_ptr);
+ return BigInt.asUintN(64, ret);
+ }
+ /**
+ * Set local gradients from JavaScript
+ * @param {Float32Array} gradients
+ */
+ setLocalGradients(gradients) {
+ const ptr0 = passArrayF32ToWasm0(gradients, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.gradientgossip_setLocalGradients(this.__wbg_ptr, ptr0, len0);
+ if (ret[1]) {
+ throw takeFromExternrefTable0(ret[0]);
+ }
+ }
+ /**
+ * Get compression ratio achieved
+ * @returns {number}
+ */
+ getCompressionRatio() {
+ const ret = wasm.gradientgossip_getCompressionRatio(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * Get aggregated gradients as JavaScript array
+ * @returns {Float32Array}
+ */
+ getAggregatedGradients() {
+ const ret = wasm.gradientgossip_getAggregatedGradients(this.__wbg_ptr);
+ var v1 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
+ return v1;
+ }
+ /**
+ * Create a new GradientGossip instance
+ *
+ * # Arguments
+ * * `local_peer_id` - 32-byte peer identifier
+ * * `dimension` - Gradient vector dimension
+ * * `k_ratio` - TopK sparsification ratio (0.1 = keep top 10%)
+ * @param {Uint8Array} local_peer_id
+ * @param {number} dimension
+ * @param {number} k_ratio
+ */
+ constructor(local_peer_id, dimension, k_ratio) {
+ const ptr0 = passArray8ToWasm0(local_peer_id, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.gradientgossip_new(ptr0, len0, dimension, k_ratio);
+ if (ret[2]) {
+ throw takeFromExternrefTable0(ret[1]);
+ }
+ this.__wbg_ptr = ret[0] >>> 0;
+ GradientGossipFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Get statistics as JSON
+ * @returns {string}
+ */
+ getStats() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.gradientgossip_getStats(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+}
+if (Symbol.dispose) GradientGossip.prototype[Symbol.dispose] = GradientGossip.prototype.free;
+
+/**
+ * Model consensus manager for federated learning integration
+ */
+export class ModelConsensusManager {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ ModelConsensusManagerFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_modelconsensusmanager_free(ptr, 0);
+ }
+ /**
+ * Get number of tracked models
+ * @returns {number}
+ */
+ modelCount() {
+ const ret = wasm.modelconsensusmanager_modelCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Get number of active disputes
+ * @returns {number}
+ */
+ disputeCount() {
+ const ret = wasm.modelconsensusmanager_disputeCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Get number of quarantined updates
+ * @returns {number}
+ */
+ quarantinedUpdateCount() {
+ const ret = wasm.modelconsensusmanager_quarantinedUpdateCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Create a new model consensus manager
+ * @param {number} min_witnesses
+ */
+ constructor(min_witnesses) {
+ const ret = wasm.modelconsensusmanager_new(min_witnesses);
+ this.__wbg_ptr = ret >>> 0;
+ ModelConsensusManagerFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Get statistics as JSON
+ * @returns {string}
+ */
+ getStats() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.modelconsensusmanager_getStats(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+}
+if (Symbol.dispose) ModelConsensusManager.prototype[Symbol.dispose] = ModelConsensusManager.prototype.free;
+
+/**
+ * Multi-head attention for distributed task routing
+ */
+export class MultiHeadAttention {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ MultiHeadAttentionFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_multiheadattention_free(ptr, 0);
+ }
+ /**
+ * Get embedding dimension
+ * @returns {number}
+ */
+ dim() {
+ const ret = wasm.multiheadattention_dim(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Create new multi-head attention
+ * @param {number} dim
+ * @param {number} num_heads
+ */
+ constructor(dim, num_heads) {
+ const ret = wasm.multiheadattention_new(dim, num_heads);
+ this.__wbg_ptr = ret >>> 0;
+ MultiHeadAttentionFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Get number of heads
+ * @returns {number}
+ */
+ numHeads() {
+ const ret = wasm.multiheadattention_numHeads(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+}
+if (Symbol.dispose) MultiHeadAttention.prototype[Symbol.dispose] = MultiHeadAttention.prototype.free;
+
+/**
+ * Network lifecycle events and Easter eggs manager
+ */
+export class NetworkEvents {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ NetworkEventsFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_networkevents_free(ptr, 0);
+ }
+ /**
+ * Get a subtle motivational message
+ * @param {bigint} balance
+ * @returns {string}
+ */
+ getMotivation(balance) {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.networkevents_getMotivation(this.__wbg_ptr, balance);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Check for discovery triggers (Easter eggs)
+ * @param {string} action
+ * @param {string} node_id
+ * @returns {string | undefined}
+ */
+ checkDiscovery(action, node_id) {
+ const ptr0 = passStringToWasm0(action, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passStringToWasm0(node_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len1 = WASM_VECTOR_LEN;
+ const ret = wasm.networkevents_checkDiscovery(this.__wbg_ptr, ptr0, len0, ptr1, len1);
+ let v3;
+ if (ret[0] !== 0) {
+ v3 = getStringFromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
+ }
+ return v3;
+ }
+ /**
+ * Get ASCII art for special occasions
+ * @returns {string | undefined}
+ */
+ getSpecialArt() {
+ const ret = wasm.networkevents_getSpecialArt(this.__wbg_ptr);
+ let v1;
+ if (ret[0] !== 0) {
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
+ }
+ return v1;
+ }
+ /**
+ * Check milestone achievements
+ * @param {bigint} balance
+ * @param {string} node_id
+ * @returns {string}
+ */
+ checkMilestones(balance, node_id) {
+ let deferred2_0;
+ let deferred2_1;
+ try {
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.networkevents_checkMilestones(this.__wbg_ptr, balance, ptr0, len0);
+ deferred2_0 = ret[0];
+ deferred2_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
+ }
+ }
+ /**
+ * Set current time (for testing)
+ * @param {bigint} timestamp
+ */
+ setCurrentTime(timestamp) {
+ wasm.networkevents_setCurrentTime(this.__wbg_ptr, timestamp);
+ }
+ /**
+ * Get network status with thematic flair
+ * @param {number} node_count
+ * @param {bigint} total_ruv
+ * @returns {string}
+ */
+ getThemedStatus(node_count, total_ruv) {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.networkevents_getThemedStatus(this.__wbg_ptr, node_count, total_ruv);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Check for active special events
+ * @returns {string}
+ */
+ checkActiveEvents() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.networkevents_checkActiveEvents(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Get celebration multiplier boost
+ * @returns {number}
+ */
+ getCelebrationBoost() {
+ const ret = wasm.networkevents_getCelebrationBoost(this.__wbg_ptr);
+ return ret;
+ }
+ constructor() {
+ const ret = wasm.networkevents_new();
+ this.__wbg_ptr = ret >>> 0;
+ NetworkEventsFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+}
+if (Symbol.dispose) NetworkEvents.prototype[Symbol.dispose] = NetworkEvents.prototype.free;
+
+/**
+ * Unified learning intelligence for edge-net nodes
+ */
+export class NetworkLearning {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ NetworkLearningFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_networklearning_free(ptr, 0);
+ }
+ /**
+ * Get pattern count
+ * @returns {number}
+ */
+ patternCount() {
+ const ret = wasm.networklearning_patternCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Store a learned pattern
+ * @param {string} pattern_json
+ * @returns {number}
+ */
+ storePattern(pattern_json) {
+ const ptr0 = passStringToWasm0(pattern_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.networklearning_storePattern(this.__wbg_ptr, ptr0, len0);
+ return ret;
+ }
+ /**
+ * Look up similar patterns
+ * @param {string} query_json
+ * @param {number} k
+ * @returns {string}
+ */
+ lookupPatterns(query_json, k) {
+ let deferred2_0;
+ let deferred2_1;
+ try {
+ const ptr0 = passStringToWasm0(query_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.networklearning_lookupPatterns(this.__wbg_ptr, ptr0, len0, k);
+ deferred2_0 = ret[0];
+ deferred2_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
+ }
+ }
+ /**
+ * Get energy savings ratio for spike-driven attention
+ * @param {number} seq_len
+ * @param {number} hidden_dim
+ * @returns {number}
+ */
+ getEnergyRatio(seq_len, hidden_dim) {
+ const ret = wasm.networklearning_getEnergyRatio(this.__wbg_ptr, seq_len, hidden_dim);
+ return ret;
+ }
+ /**
+ * Get trajectory count
+ * @returns {number}
+ */
+ trajectoryCount() {
+ const ret = wasm.networklearning_trajectoryCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Record a task execution trajectory
+ * @param {string} trajectory_json
+ * @returns {boolean}
+ */
+ recordTrajectory(trajectory_json) {
+ const ptr0 = passStringToWasm0(trajectory_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.networklearning_recordTrajectory(this.__wbg_ptr, ptr0, len0);
+ return ret !== 0;
+ }
+ /**
+ * Create new network learning intelligence
+ */
+ constructor() {
+ const ret = wasm.networklearning_new();
+ this.__wbg_ptr = ret >>> 0;
+ NetworkLearningFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Prune low-quality patterns
+ * @param {number} min_usage
+ * @param {number} min_confidence
+ * @returns {number}
+ */
+ prune(min_usage, min_confidence) {
+ const ret = wasm.networklearning_prune(this.__wbg_ptr, min_usage, min_confidence);
+ return ret >>> 0;
+ }
+ /**
+ * Get combined statistics
+ * @returns {string}
+ */
+ getStats() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.networklearning_getStats(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+}
+if (Symbol.dispose) NetworkLearning.prototype[Symbol.dispose] = NetworkLearning.prototype.free;
+
+/**
+ * Network topology adaptation for self-organization
+ */
+export class NetworkTopology {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ NetworkTopologyFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_networktopology_free(ptr, 0);
+ }
+ /**
+ * Register a node in the topology
+ * @param {string} node_id
+ * @param {Float32Array} capabilities
+ */
+ registerNode(node_id, capabilities) {
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passArrayF32ToWasm0(capabilities, wasm.__wbindgen_malloc);
+ const len1 = WASM_VECTOR_LEN;
+ wasm.networktopology_registerNode(this.__wbg_ptr, ptr0, len0, ptr1, len1);
+ }
+ /**
+ * Get optimal peers for a node
+ * @param {string} node_id
+ * @param {number} count
+ * @returns {string[]}
+ */
+ getOptimalPeers(node_id, count) {
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.networktopology_getOptimalPeers(this.__wbg_ptr, ptr0, len0, count);
+ var v2 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
+ return v2;
+ }
+ /**
+ * Update connection strength between nodes
+ * @param {string} from
+ * @param {string} to
+ * @param {number} success_rate
+ */
+ updateConnection(from, to, success_rate) {
+ const ptr0 = passStringToWasm0(from, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passStringToWasm0(to, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len1 = WASM_VECTOR_LEN;
+ wasm.networktopology_updateConnection(this.__wbg_ptr, ptr0, len0, ptr1, len1, success_rate);
+ }
+ constructor() {
+ const ret = wasm.networktopology_new();
+ this.__wbg_ptr = ret >>> 0;
+ NetworkTopologyFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+}
+if (Symbol.dispose) NetworkTopology.prototype[Symbol.dispose] = NetworkTopology.prototype.free;
+
+export class NodeConfig {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ NodeConfigFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_nodeconfig_free(ptr, 0);
+ }
+ /**
+ * Maximum CPU usage when idle (0.0 - 1.0)
+ * @returns {number}
+ */
+ get cpu_limit() {
+ const ret = wasm.__wbg_get_economichealth_velocity(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * Maximum CPU usage when idle (0.0 - 1.0)
+ * @param {number} arg0
+ */
+ set cpu_limit(arg0) {
+ wasm.__wbg_set_economichealth_velocity(this.__wbg_ptr, arg0);
+ }
+ /**
+ * Maximum memory usage in bytes
+ * @returns {number}
+ */
+ get memory_limit() {
+ const ret = wasm.__wbg_get_nodeconfig_memory_limit(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Maximum memory usage in bytes
+ * @param {number} arg0
+ */
+ set memory_limit(arg0) {
+ wasm.__wbg_set_nodeconfig_memory_limit(this.__wbg_ptr, arg0);
+ }
+ /**
+ * Maximum bandwidth in bytes/sec
+ * @returns {number}
+ */
+ get bandwidth_limit() {
+ const ret = wasm.__wbg_get_nodeconfig_bandwidth_limit(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Maximum bandwidth in bytes/sec
+ * @param {number} arg0
+ */
+ set bandwidth_limit(arg0) {
+ wasm.__wbg_set_nodeconfig_bandwidth_limit(this.__wbg_ptr, arg0);
+ }
+ /**
+ * Minimum idle time before contributing (ms)
+ * @returns {number}
+ */
+ get min_idle_time() {
+ const ret = wasm.__wbg_get_nodeconfig_min_idle_time(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Minimum idle time before contributing (ms)
+ * @param {number} arg0
+ */
+ set min_idle_time(arg0) {
+ wasm.__wbg_set_nodeconfig_min_idle_time(this.__wbg_ptr, arg0);
+ }
+ /**
+ * Whether to reduce contribution on battery
+ * @returns {boolean}
+ */
+ get respect_battery() {
+ const ret = wasm.__wbg_get_nodeconfig_respect_battery(this.__wbg_ptr);
+ return ret !== 0;
+ }
+ /**
+ * Whether to reduce contribution on battery
+ * @param {boolean} arg0
+ */
+ set respect_battery(arg0) {
+ wasm.__wbg_set_nodeconfig_respect_battery(this.__wbg_ptr, arg0);
+ }
+}
+if (Symbol.dispose) NodeConfig.prototype[Symbol.dispose] = NodeConfig.prototype.free;
+
+export class NodeStats {
+ static __wrap(ptr) {
+ ptr = ptr >>> 0;
+ const obj = Object.create(NodeStats.prototype);
+ obj.__wbg_ptr = ptr;
+ NodeStatsFinalization.register(obj, obj.__wbg_ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ NodeStatsFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_nodestats_free(ptr, 0);
+ }
+ /**
+ * Total rUv (Resource Utility Vouchers) earned
+ * @returns {bigint}
+ */
+ get ruv_earned() {
+ const ret = wasm.__wbg_get_nodestats_ruv_earned(this.__wbg_ptr);
+ return BigInt.asUintN(64, ret);
+ }
+ /**
+ * Total rUv (Resource Utility Vouchers) earned
+ * @param {bigint} arg0
+ */
+ set ruv_earned(arg0) {
+ wasm.__wbg_set_nodestats_ruv_earned(this.__wbg_ptr, arg0);
+ }
+ /**
+ * Total rUv spent
+ * @returns {bigint}
+ */
+ get ruv_spent() {
+ const ret = wasm.__wbg_get_nodestats_ruv_spent(this.__wbg_ptr);
+ return BigInt.asUintN(64, ret);
+ }
+ /**
+ * Total rUv spent
+ * @param {bigint} arg0
+ */
+ set ruv_spent(arg0) {
+ wasm.__wbg_set_nodestats_ruv_spent(this.__wbg_ptr, arg0);
+ }
+ /**
+ * Tasks completed
+ * @returns {bigint}
+ */
+ get tasks_completed() {
+ const ret = wasm.__wbg_get_nodestats_tasks_completed(this.__wbg_ptr);
+ return BigInt.asUintN(64, ret);
+ }
+ /**
+ * Tasks completed
+ * @param {bigint} arg0
+ */
+ set tasks_completed(arg0) {
+ wasm.__wbg_set_nodestats_tasks_completed(this.__wbg_ptr, arg0);
+ }
+ /**
+ * Tasks submitted
+ * @returns {bigint}
+ */
+ get tasks_submitted() {
+ const ret = wasm.__wbg_get_nodestats_tasks_submitted(this.__wbg_ptr);
+ return BigInt.asUintN(64, ret);
+ }
+ /**
+ * Tasks submitted
+ * @param {bigint} arg0
+ */
+ set tasks_submitted(arg0) {
+ wasm.__wbg_set_nodestats_tasks_submitted(this.__wbg_ptr, arg0);
+ }
+ /**
+ * Total uptime in seconds
+ * @returns {bigint}
+ */
+ get uptime_seconds() {
+ const ret = wasm.__wbg_get_nodestats_uptime_seconds(this.__wbg_ptr);
+ return BigInt.asUintN(64, ret);
+ }
+ /**
+ * Total uptime in seconds
+ * @param {bigint} arg0
+ */
+ set uptime_seconds(arg0) {
+ wasm.__wbg_set_nodestats_uptime_seconds(this.__wbg_ptr, arg0);
+ }
+ /**
+ * Current reputation score (0.0 - 1.0)
+ * @returns {number}
+ */
+ get reputation() {
+ const ret = wasm.__wbg_get_nodestats_reputation(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * Current reputation score (0.0 - 1.0)
+ * @param {number} arg0
+ */
+ set reputation(arg0) {
+ wasm.__wbg_set_nodestats_reputation(this.__wbg_ptr, arg0);
+ }
+ /**
+ * Current contribution multiplier
+ * @returns {number}
+ */
+ get multiplier() {
+ const ret = wasm.__wbg_get_nodestats_multiplier(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * Current contribution multiplier
+ * @param {number} arg0
+ */
+ set multiplier(arg0) {
+ wasm.__wbg_set_nodestats_multiplier(this.__wbg_ptr, arg0);
+ }
+ /**
+ * Active lifecycle events
+ * @returns {number}
+ */
+ get celebration_boost() {
+ const ret = wasm.__wbg_get_nodestats_celebration_boost(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * Active lifecycle events
+ * @param {number} arg0
+ */
+ set celebration_boost(arg0) {
+ wasm.__wbg_set_nodestats_celebration_boost(this.__wbg_ptr, arg0);
+ }
+}
+if (Symbol.dispose) NodeStats.prototype[Symbol.dispose] = NodeStats.prototype.free;
+
+/**
+ * Network optimization for resource efficiency
+ */
+export class OptimizationEngine {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ OptimizationEngineFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_optimizationengine_free(ptr, 0);
+ }
+ /**
+ * Record task routing outcome
+ * @param {string} task_type
+ * @param {string} node_id
+ * @param {bigint} latency_ms
+ * @param {boolean} success
+ */
+ recordRouting(task_type, node_id, latency_ms, success) {
+ const ptr0 = passStringToWasm0(task_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passStringToWasm0(node_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len1 = WASM_VECTOR_LEN;
+ wasm.optimizationengine_recordRouting(this.__wbg_ptr, ptr0, len0, ptr1, len1, latency_ms, success);
+ }
+ /**
+ * Get optimal node for a task type
+ * @param {string} task_type
+ * @param {string[]} candidates
+ * @returns {string}
+ */
+ selectOptimalNode(task_type, candidates) {
+ let deferred3_0;
+ let deferred3_1;
+ try {
+ const ptr0 = passStringToWasm0(task_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passArrayJsValueToWasm0(candidates, wasm.__wbindgen_malloc);
+ const len1 = WASM_VECTOR_LEN;
+ const ret = wasm.optimizationengine_selectOptimalNode(this.__wbg_ptr, ptr0, len0, ptr1, len1);
+ deferred3_0 = ret[0];
+ deferred3_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
+ }
+ }
+ constructor() {
+ const ret = wasm.optimizationengine_new();
+ this.__wbg_ptr = ret >>> 0;
+ OptimizationEngineFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Get optimization stats
+ * @returns {string}
+ */
+ getStats() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.optimizationengine_getStats(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+}
+if (Symbol.dispose) OptimizationEngine.prototype[Symbol.dispose] = OptimizationEngine.prototype.free;
+
+/**
+ * Ultra-compact Pi-Key (40 bytes identity + 21 bytes genesis signature)
+ */
+export class PiKey {
+ static __wrap(ptr) {
+ ptr = ptr >>> 0;
+ const obj = Object.create(PiKey.prototype);
+ obj.__wbg_ptr = ptr;
+ PiKeyFinalization.register(obj, obj.__wbg_ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ PiKeyFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_pikey_free(ptr, 0);
+ }
+ /**
+ * Get the Pi-sized identity (40 bytes)
+ * @returns {Uint8Array}
+ */
+ getIdentity() {
+ const ret = wasm.pikey_getIdentity(this.__wbg_ptr);
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
+ return v1;
+ }
+ /**
+ * Get short identity (first 8 bytes as hex)
+ * @returns {string}
+ */
+ getShortId() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.pikey_getShortId(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Export minimal key representation (Pi + Phi sized = 61 bytes total)
+ * @returns {Uint8Array}
+ */
+ exportCompact() {
+ const ret = wasm.pikey_exportCompact(this.__wbg_ptr);
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
+ return v1;
+ }
+ /**
+ * Get public key for verification
+ * @returns {Uint8Array}
+ */
+ getPublicKey() {
+ const ret = wasm.pikey_getPublicKey(this.__wbg_ptr);
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
+ return v1;
+ }
+ /**
+ * Verify this key has Pi magic marker
+ * @returns {boolean}
+ */
+ verifyPiMagic() {
+ const ret = wasm.pikey_verifyPiMagic(this.__wbg_ptr);
+ return ret !== 0;
+ }
+ /**
+ * Get identity as hex string
+ * @returns {string}
+ */
+ getIdentityHex() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.pikey_getIdentityHex(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Restore from encrypted backup (supports both v1 legacy and v2 Argon2id)
+ * @param {Uint8Array} backup
+ * @param {string} password
+ * @returns {PiKey}
+ */
+ static restoreFromBackup(backup, password) {
+ const ptr0 = passArray8ToWasm0(backup, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len1 = WASM_VECTOR_LEN;
+ const ret = wasm.pikey_restoreFromBackup(ptr0, len0, ptr1, len1);
+ if (ret[2]) {
+ throw takeFromExternrefTable0(ret[1]);
+ }
+ return PiKey.__wrap(ret[0]);
+ }
+ /**
+ * Create encrypted backup of private key using Argon2id KDF
+ * @param {string} password
+ * @returns {Uint8Array}
+ */
+ createEncryptedBackup(password) {
+ const ptr0 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.pikey_createEncryptedBackup(this.__wbg_ptr, ptr0, len0);
+ if (ret[3]) {
+ throw takeFromExternrefTable0(ret[2]);
+ }
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
+ return v2;
+ }
+ /**
+ * Get the Phi-sized genesis fingerprint (21 bytes)
+ * @returns {Uint8Array}
+ */
+ getGenesisFingerprint() {
+ const ret = wasm.pikey_getGenesisFingerprint(this.__wbg_ptr);
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
+ return v1;
+ }
+ /**
+ * Sign data with this key
+ * @param {Uint8Array} data
+ * @returns {Uint8Array}
+ */
+ sign(data) {
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.pikey_sign(this.__wbg_ptr, ptr0, len0);
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
+ return v2;
+ }
+ /**
+ * Verify signature from another Pi-Key
+ * @param {Uint8Array} data
+ * @param {Uint8Array} signature
+ * @param {Uint8Array} public_key
+ * @returns {boolean}
+ */
+ verify(data, signature, public_key) {
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passArray8ToWasm0(signature, wasm.__wbindgen_malloc);
+ const len1 = WASM_VECTOR_LEN;
+ const ptr2 = passArray8ToWasm0(public_key, wasm.__wbindgen_malloc);
+ const len2 = WASM_VECTOR_LEN;
+ const ret = wasm.pikey_verify(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
+ return ret !== 0;
+ }
+ /**
+ * Generate a new Pi-Key with genesis linking
+ * @param {Uint8Array | null} [genesis_seed]
+ */
+ constructor(genesis_seed) {
+ var ptr0 = isLikeNone(genesis_seed) ? 0 : passArray8ToWasm0(genesis_seed, wasm.__wbindgen_malloc);
+ var len0 = WASM_VECTOR_LEN;
+ const ret = wasm.pikey_generate(ptr0, len0);
+ if (ret[2]) {
+ throw takeFromExternrefTable0(ret[1]);
+ }
+ this.__wbg_ptr = ret[0] >>> 0;
+ PiKeyFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Get key statistics
+ * @returns {string}
+ */
+ getStats() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.pikey_getStats(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+}
+if (Symbol.dispose) PiKey.prototype[Symbol.dispose] = PiKey.prototype.free;
+
+/**
+ * QDAG Ledger - the full transaction graph
+ */
+export class QDAGLedger {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ QDAGLedgerFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_qdagledger_free(ptr, 0);
+ }
+ /**
+ * Export ledger state for sync
+ * @returns {Uint8Array}
+ */
+ exportState() {
+ const ret = wasm.qdagledger_exportState(this.__wbg_ptr);
+ if (ret[3]) {
+ throw takeFromExternrefTable0(ret[2]);
+ }
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
+ return v1;
+ }
+ /**
+ * Import ledger state from sync
+ * @param {Uint8Array} state_bytes
+ * @returns {number}
+ */
+ importState(state_bytes) {
+ const ptr0 = passArray8ToWasm0(state_bytes, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.qdagledger_importState(this.__wbg_ptr, ptr0, len0);
+ if (ret[2]) {
+ throw takeFromExternrefTable0(ret[1]);
+ }
+ return ret[0] >>> 0;
+ }
+ /**
+ * Get total supply
+ * @returns {bigint}
+ */
+ totalSupply() {
+ const ret = wasm.qdagledger_totalSupply(this.__wbg_ptr);
+ return BigInt.asUintN(64, ret);
+ }
+ /**
+ * Get staked amount for a node
+ * @param {string} node_id
+ * @returns {bigint}
+ */
+ stakedAmount(node_id) {
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.qdagledger_stakedAmount(this.__wbg_ptr, ptr0, len0);
+ return BigInt.asUintN(64, ret);
+ }
+ /**
+ * Create genesis transaction (called once at network start)
+ * @param {bigint} initial_supply
+ * @param {Uint8Array} founder_pubkey
+ * @returns {Uint8Array}
+ */
+ createGenesis(initial_supply, founder_pubkey) {
+ const ptr0 = passArray8ToWasm0(founder_pubkey, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.qdagledger_createGenesis(this.__wbg_ptr, initial_supply, ptr0, len0);
+ if (ret[3]) {
+ throw takeFromExternrefTable0(ret[2]);
+ }
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
+ return v2;
+ }
+ /**
+ * Get transaction count
+ * @returns {number}
+ */
+ transactionCount() {
+ const ret = wasm.qdagledger_transactionCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Create and validate a new transaction
+ * @param {string} sender_id
+ * @param {string} recipient_id
+ * @param {bigint} amount
+ * @param {number} tx_type
+ * @param {Uint8Array} sender_privkey
+ * @param {Uint8Array} sender_pubkey
+ * @returns {Uint8Array}
+ */
+ createTransaction(sender_id, recipient_id, amount, tx_type, sender_privkey, sender_pubkey) {
+ const ptr0 = passStringToWasm0(sender_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passStringToWasm0(recipient_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len1 = WASM_VECTOR_LEN;
+ const ptr2 = passArray8ToWasm0(sender_privkey, wasm.__wbindgen_malloc);
+ const len2 = WASM_VECTOR_LEN;
+ const ptr3 = passArray8ToWasm0(sender_pubkey, wasm.__wbindgen_malloc);
+ const len3 = WASM_VECTOR_LEN;
+ const ret = wasm.qdagledger_createTransaction(this.__wbg_ptr, ptr0, len0, ptr1, len1, amount, tx_type, ptr2, len2, ptr3, len3);
+ if (ret[3]) {
+ throw takeFromExternrefTable0(ret[2]);
+ }
+ var v5 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
+ return v5;
+ }
+ /**
+ * Create a new QDAG ledger
+ */
+ constructor() {
+ const ret = wasm.qdagledger_new();
+ this.__wbg_ptr = ret >>> 0;
+ QDAGLedgerFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Get balance for a node
+ * @param {string} node_id
+ * @returns {bigint}
+ */
+ balance(node_id) {
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.qdagledger_balance(this.__wbg_ptr, ptr0, len0);
+ return ret;
+ }
+ /**
+ * Get tip count
+ * @returns {number}
+ */
+ tipCount() {
+ const ret = wasm.qdagledger_tipCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+}
+if (Symbol.dispose) QDAGLedger.prototype[Symbol.dispose] = QDAGLedger.prototype.free;
+
+/**
+ * Manages quarantine status of contested claims
+ */
+export class QuarantineManager {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ QuarantineManagerFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_quarantinemanager_free(ptr, 0);
+ }
+ /**
+ * Get number of quarantined claims
+ * @returns {number}
+ */
+ quarantinedCount() {
+ const ret = wasm.quarantinemanager_quarantinedCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Create a new quarantine manager
+ */
+ constructor() {
+ const ret = wasm.quarantinemanager_new();
+ this.__wbg_ptr = ret >>> 0;
+ QuarantineManagerFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Check if claim can be used in decisions
+ * @param {string} claim_id
+ * @returns {boolean}
+ */
+ canUse(claim_id) {
+ const ptr0 = passStringToWasm0(claim_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.quarantinemanager_canUse(this.__wbg_ptr, ptr0, len0);
+ return ret !== 0;
+ }
+ /**
+ * Check quarantine level for a claim
+ * @param {string} claim_id
+ * @returns {number}
+ */
+ getLevel(claim_id) {
+ const ptr0 = passStringToWasm0(claim_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.quarantinemanager_getLevel(this.__wbg_ptr, ptr0, len0);
+ return ret;
+ }
+ /**
+ * Set quarantine level
+ * @param {string} claim_id
+ * @param {number} level
+ */
+ setLevel(claim_id, level) {
+ const ptr0 = passStringToWasm0(claim_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.quarantinemanager_setLevel(this.__wbg_ptr, ptr0, len0, level);
+ }
+}
+if (Symbol.dispose) QuarantineManager.prototype[Symbol.dispose] = QuarantineManager.prototype.free;
+
+/**
+ * RAC-specific combined economic engine managing stakes, reputation, and rewards
+ */
+export class RacEconomicEngine {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ RacEconomicEngineFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_raceconomicengine_free(ptr, 0);
+ }
+ /**
+ * Get summary statistics as JSON
+ * @returns {string}
+ */
+ getSummary() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.raceconomicengine_getSummary(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Check if node can participate (has stake + reputation)
+ * @param {Uint8Array} node_id
+ * @returns {boolean}
+ */
+ canParticipate(node_id) {
+ const ptr0 = passArray8ToWasm0(node_id, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.raceconomicengine_canParticipate(this.__wbg_ptr, ptr0, len0);
+ return ret !== 0;
+ }
+ /**
+ * Get combined score (stake-weighted reputation)
+ * @param {Uint8Array} node_id
+ * @returns {number}
+ */
+ getCombinedScore(node_id) {
+ const ptr0 = passArray8ToWasm0(node_id, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.raceconomicengine_getCombinedScore(this.__wbg_ptr, ptr0, len0);
+ return ret;
+ }
+ /**
+ * Create a new RAC economic engine
+ */
+ constructor() {
+ const ret = wasm.raceconomicengine_new();
+ this.__wbg_ptr = ret >>> 0;
+ RacEconomicEngineFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+}
+if (Symbol.dispose) RacEconomicEngine.prototype[Symbol.dispose] = RacEconomicEngine.prototype.free;
+
+/**
+ * RAC-specific semantic gossip router for event propagation
+ */
+export class RacSemanticRouter {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ RacSemanticRouterFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_racsemanticrouter_free(ptr, 0);
+ }
+ /**
+ * Get peer count
+ * @returns {number}
+ */
+ peerCount() {
+ const ret = wasm.racsemanticrouter_peerCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Create a new semantic router
+ */
+ constructor() {
+ const ret = wasm.racsemanticrouter_new();
+ this.__wbg_ptr = ret >>> 0;
+ RacSemanticRouterFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+}
+if (Symbol.dispose) RacSemanticRouter.prototype[Symbol.dispose] = RacSemanticRouter.prototype.free;
+
+/**
+ * Rate limiter to prevent spam/DoS
+ */
+export class RateLimiter {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ RateLimiterFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_ratelimiter_free(ptr, 0);
+ }
+ /**
+ * Check if request is allowed
+ * @param {string} node_id
+ * @returns {boolean}
+ */
+ checkAllowed(node_id) {
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.ratelimiter_checkAllowed(this.__wbg_ptr, ptr0, len0);
+ return ret !== 0;
+ }
+ /**
+ * @param {bigint} window_ms
+ * @param {number} max_requests
+ */
+ constructor(window_ms, max_requests) {
+ const ret = wasm.ratelimiter_new(window_ms, max_requests);
+ this.__wbg_ptr = ret >>> 0;
+ RateLimiterFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Reset rate limiter
+ */
+ reset() {
+ wasm.ratelimiter_reset(this.__wbg_ptr);
+ }
+ /**
+ * Get current count for a node
+ * @param {string} node_id
+ * @returns {number}
+ */
+ getCount(node_id) {
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.ratelimiter_getCount(this.__wbg_ptr, ptr0, len0);
+ return ret >>> 0;
+ }
+}
+if (Symbol.dispose) RateLimiter.prototype[Symbol.dispose] = RateLimiter.prototype.free;
+
+/**
+ * ReasoningBank for storing and retrieving learned patterns
+ * Optimized with spatial indexing for O(1) approximate lookups
+ */
+export class ReasoningBank {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ ReasoningBankFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_reasoningbank_free(ptr, 0);
+ }
+ /**
+ * Create a new ReasoningBank
+ */
+ constructor() {
+ const ret = wasm.reasoningbank_new();
+ this.__wbg_ptr = ret >>> 0;
+ ReasoningBankFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Get total pattern count
+ * @returns {number}
+ */
+ count() {
+ const ret = wasm.reasoningbank_count(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Prune low-quality patterns
+ * @param {number} min_usage
+ * @param {number} min_confidence
+ * @returns {number}
+ */
+ prune(min_usage, min_confidence) {
+ const ret = wasm.reasoningbank_prune(this.__wbg_ptr, min_usage, min_confidence);
+ return ret >>> 0;
+ }
+ /**
+ * Store a new pattern (JSON format)
+ * @param {string} pattern_json
+ * @returns {number}
+ */
+ store(pattern_json) {
+ const ptr0 = passStringToWasm0(pattern_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.reasoningbank_store(this.__wbg_ptr, ptr0, len0);
+ return ret;
+ }
+ /**
+ * Lookup most similar patterns (OPTIMIZED with spatial indexing)
+ * @param {string} query_json
+ * @param {number} k
+ * @returns {string}
+ */
+ lookup(query_json, k) {
+ let deferred2_0;
+ let deferred2_1;
+ try {
+ const ptr0 = passStringToWasm0(query_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.reasoningbank_lookup(this.__wbg_ptr, ptr0, len0, k);
+ deferred2_0 = ret[0];
+ deferred2_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
+ }
+ }
+ /**
+ * Get bank statistics
+ * @returns {string}
+ */
+ getStats() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.reasoningbank_getStats(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+}
+if (Symbol.dispose) ReasoningBank.prototype[Symbol.dispose] = ReasoningBank.prototype.free;
+
+/**
+ * Reputation manager with decay mechanics
+ */
+export class ReputationManager {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ ReputationManagerFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_reputationmanager_free(ptr, 0);
+ }
+ /**
+ * Get number of tracked nodes
+ * @returns {number}
+ */
+ nodeCount() {
+ const ret = wasm.reputationmanager_nodeCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Get effective reputation for a node (with decay applied)
+ * @param {Uint8Array} node_id
+ * @returns {number}
+ */
+ getReputation(node_id) {
+ const ptr0 = passArray8ToWasm0(node_id, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.reputationmanager_getReputation(this.__wbg_ptr, ptr0, len0);
+ return ret;
+ }
+ /**
+ * Get average network reputation
+ * @returns {number}
+ */
+ averageReputation() {
+ const ret = wasm.reputationmanager_averageReputation(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * Check if node has sufficient reputation
+ * @param {Uint8Array} node_id
+ * @returns {boolean}
+ */
+ hasSufficientReputation(node_id) {
+ const ptr0 = passArray8ToWasm0(node_id, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.reputationmanager_hasSufficientReputation(this.__wbg_ptr, ptr0, len0);
+ return ret !== 0;
+ }
+ /**
+ * Create a new reputation manager
+ * @param {number} decay_rate
+ * @param {bigint} decay_interval_ms
+ */
+ constructor(decay_rate, decay_interval_ms) {
+ const ret = wasm.reputationmanager_new(decay_rate, decay_interval_ms);
+ this.__wbg_ptr = ret >>> 0;
+ ReputationManagerFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+}
+if (Symbol.dispose) ReputationManager.prototype[Symbol.dispose] = ReputationManager.prototype.free;
+
+/**
+ * Reputation system for nodes
+ */
+export class ReputationSystem {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ ReputationSystemFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_reputationsystem_free(ptr, 0);
+ }
+ /**
+ * Get reputation score for a node
+ * @param {string} node_id
+ * @returns {number}
+ */
+ getReputation(node_id) {
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.reputationsystem_getReputation(this.__wbg_ptr, ptr0, len0);
+ return ret;
+ }
+ /**
+ * Record failed task completion
+ * @param {string} node_id
+ */
+ recordFailure(node_id) {
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.reputationsystem_recordFailure(this.__wbg_ptr, ptr0, len0);
+ }
+ /**
+ * Record penalty (fraud, invalid result)
+ * @param {string} node_id
+ * @param {number} severity
+ */
+ recordPenalty(node_id, severity) {
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.reputationsystem_recordPenalty(this.__wbg_ptr, ptr0, len0, severity);
+ }
+ /**
+ * Record successful task completion
+ * @param {string} node_id
+ */
+ recordSuccess(node_id) {
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.reputationsystem_recordSuccess(this.__wbg_ptr, ptr0, len0);
+ }
+ /**
+ * Check if node can participate
+ * @param {string} node_id
+ * @returns {boolean}
+ */
+ canParticipate(node_id) {
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.reputationsystem_canParticipate(this.__wbg_ptr, ptr0, len0);
+ return ret !== 0;
+ }
+ constructor() {
+ const ret = wasm.reputationsystem_new();
+ this.__wbg_ptr = ret >>> 0;
+ ReputationSystemFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+}
+if (Symbol.dispose) ReputationSystem.prototype[Symbol.dispose] = ReputationSystem.prototype.free;
+
+export class RewardDistribution {
+ static __wrap(ptr) {
+ ptr = ptr >>> 0;
+ const obj = Object.create(RewardDistribution.prototype);
+ obj.__wbg_ptr = ptr;
+ RewardDistributionFinalization.register(obj, obj.__wbg_ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ RewardDistributionFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_rewarddistribution_free(ptr, 0);
+ }
+ /**
+ * @returns {bigint}
+ */
+ get total() {
+ const ret = wasm.__wbg_get_nodestats_ruv_earned(this.__wbg_ptr);
+ return BigInt.asUintN(64, ret);
+ }
+ /**
+ * @param {bigint} arg0
+ */
+ set total(arg0) {
+ wasm.__wbg_set_nodestats_ruv_earned(this.__wbg_ptr, arg0);
+ }
+ /**
+ * @returns {bigint}
+ */
+ get contributor_share() {
+ const ret = wasm.__wbg_get_nodestats_ruv_spent(this.__wbg_ptr);
+ return BigInt.asUintN(64, ret);
+ }
+ /**
+ * @param {bigint} arg0
+ */
+ set contributor_share(arg0) {
+ wasm.__wbg_set_nodestats_ruv_spent(this.__wbg_ptr, arg0);
+ }
+ /**
+ * @returns {bigint}
+ */
+ get treasury_share() {
+ const ret = wasm.__wbg_get_nodestats_tasks_completed(this.__wbg_ptr);
+ return BigInt.asUintN(64, ret);
+ }
+ /**
+ * @param {bigint} arg0
+ */
+ set treasury_share(arg0) {
+ wasm.__wbg_set_nodestats_tasks_completed(this.__wbg_ptr, arg0);
+ }
+ /**
+ * @returns {bigint}
+ */
+ get protocol_share() {
+ const ret = wasm.__wbg_get_nodestats_tasks_submitted(this.__wbg_ptr);
+ return BigInt.asUintN(64, ret);
+ }
+ /**
+ * @param {bigint} arg0
+ */
+ set protocol_share(arg0) {
+ wasm.__wbg_set_nodestats_tasks_submitted(this.__wbg_ptr, arg0);
+ }
+ /**
+ * @returns {bigint}
+ */
+ get founder_share() {
+ const ret = wasm.__wbg_get_nodestats_uptime_seconds(this.__wbg_ptr);
+ return BigInt.asUintN(64, ret);
+ }
+ /**
+ * @param {bigint} arg0
+ */
+ set founder_share(arg0) {
+ wasm.__wbg_set_nodestats_uptime_seconds(this.__wbg_ptr, arg0);
+ }
+}
+if (Symbol.dispose) RewardDistribution.prototype[Symbol.dispose] = RewardDistribution.prototype.free;
+
+/**
+ * Manages time-locked rewards
+ */
+export class RewardManager {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ RewardManagerFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_rewardmanager_free(ptr, 0);
+ }
+ /**
+ * Get number of pending rewards
+ * @returns {number}
+ */
+ pendingCount() {
+ const ret = wasm.rewardmanager_pendingCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Get total pending reward amount
+ * @returns {bigint}
+ */
+ pendingAmount() {
+ const ret = wasm.rewardmanager_pendingAmount(this.__wbg_ptr);
+ return BigInt.asUintN(64, ret);
+ }
+ /**
+ * Get claimable rewards for a node
+ * @param {Uint8Array} node_id
+ * @returns {bigint}
+ */
+ claimableAmount(node_id) {
+ const ptr0 = passArray8ToWasm0(node_id, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.rewardmanager_claimableAmount(this.__wbg_ptr, ptr0, len0);
+ return BigInt.asUintN(64, ret);
+ }
+ /**
+ * Create a new reward manager
+ * @param {bigint} default_vesting_ms
+ */
+ constructor(default_vesting_ms) {
+ const ret = wasm.rewardmanager_new(default_vesting_ms);
+ this.__wbg_ptr = ret >>> 0;
+ RewardManagerFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+}
+if (Symbol.dispose) RewardManager.prototype[Symbol.dispose] = RewardManager.prototype.free;
+
+/**
+ * Semantic router for intelligent gossip and peer discovery
+ */
+export class SemanticRouter {
+ static __wrap(ptr) {
+ ptr = ptr >>> 0;
+ const obj = Object.create(SemanticRouter.prototype);
+ obj.__wbg_ptr = ptr;
+ SemanticRouterFinalization.register(obj, obj.__wbg_ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ SemanticRouterFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_semanticrouter_free(ptr, 0);
+ }
+ /**
+ * Get peer count
+ * @returns {number}
+ */
+ peerCount() {
+ const ret = wasm.semanticrouter_peerCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Get topic count
+ * @returns {number}
+ */
+ topicCount() {
+ const ret = wasm.semanticrouter_topicCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Create with custom parameters
+ * @param {number} embedding_dim
+ * @param {number} semantic_neighbors
+ * @param {number} random_sample
+ * @returns {SemanticRouter}
+ */
+ static withParams(embedding_dim, semantic_neighbors, random_sample) {
+ const ret = wasm.semanticrouter_withParams(embedding_dim, semantic_neighbors, random_sample);
+ return SemanticRouter.__wrap(ret);
+ }
+ /**
+ * Set my peer identity
+ * @param {Uint8Array} peer_id
+ */
+ setMyPeerId(peer_id) {
+ const ptr0 = passArray8ToWasm0(peer_id, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.semanticrouter_setMyPeerId(this.__wbg_ptr, ptr0, len0);
+ }
+ /**
+ * Get active peer count (seen in last 60 seconds)
+ * @returns {number}
+ */
+ activePeerCount() {
+ const ret = wasm.semanticrouter_activePeerCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Set my capabilities and update my centroid
+ * @param {string[]} capabilities
+ */
+ setMyCapabilities(capabilities) {
+ const ptr0 = passArrayJsValueToWasm0(capabilities, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.semanticrouter_setMyCapabilities(this.__wbg_ptr, ptr0, len0);
+ }
+ /**
+ * Create a new semantic router
+ */
+ constructor() {
+ const ret = wasm.semanticrouter_new();
+ this.__wbg_ptr = ret >>> 0;
+ SemanticRouterFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Get statistics as JSON
+ * @returns {string}
+ */
+ getStats() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.semanticrouter_getStats(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+}
+if (Symbol.dispose) SemanticRouter.prototype[Symbol.dispose] = SemanticRouter.prototype.free;
+
+/**
+ * Session Key - Euler-sized ephemeral key (e-sized: 34 bytes)
+ */
+export class SessionKey {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ SessionKeyFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_sessionkey_free(ptr, 0);
+ }
+ /**
+ * Get ID as hex
+ * @returns {string}
+ */
+ getIdHex() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.sessionkey_getIdHex(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Check if session is expired
+ * @returns {boolean}
+ */
+ isExpired() {
+ const ret = wasm.sessionkey_isExpired(this.__wbg_ptr);
+ return ret !== 0;
+ }
+ /**
+ * Get parent identity fingerprint
+ * @returns {Uint8Array}
+ */
+ getParentIdentity() {
+ const ret = wasm.sessionkey_getParentIdentity(this.__wbg_ptr);
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
+ return v1;
+ }
+ /**
+ * Create a new session key linked to a Pi-Key identity
+ * @param {PiKey} parent
+ * @param {number} ttl_seconds
+ */
+ constructor(parent, ttl_seconds) {
+ _assertClass(parent, PiKey);
+ const ret = wasm.sessionkey_create(parent.__wbg_ptr, ttl_seconds);
+ if (ret[2]) {
+ throw takeFromExternrefTable0(ret[1]);
+ }
+ this.__wbg_ptr = ret[0] >>> 0;
+ SessionKeyFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Get the e-sized session ID
+ * @returns {Uint8Array}
+ */
+ getId() {
+ const ret = wasm.sessionkey_getId(this.__wbg_ptr);
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
+ return v1;
+ }
+ /**
+ * Decrypt data with this session key
+ * @param {Uint8Array} data
+ * @returns {Uint8Array}
+ */
+ decrypt(data) {
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.sessionkey_decrypt(this.__wbg_ptr, ptr0, len0);
+ if (ret[3]) {
+ throw takeFromExternrefTable0(ret[2]);
+ }
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
+ return v2;
+ }
+ /**
+ * Encrypt data with this session key
+ * @param {Uint8Array} plaintext
+ * @returns {Uint8Array}
+ */
+ encrypt(plaintext) {
+ const ptr0 = passArray8ToWasm0(plaintext, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.sessionkey_encrypt(this.__wbg_ptr, ptr0, len0);
+ if (ret[3]) {
+ throw takeFromExternrefTable0(ret[2]);
+ }
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
+ return v2;
+ }
+}
+if (Symbol.dispose) SessionKey.prototype[Symbol.dispose] = SessionKey.prototype.free;
+
+/**
+ * Spike-driven attention for energy-efficient compute (87x savings)
+ */
+export class SpikeDrivenAttention {
+ static __wrap(ptr) {
+ ptr = ptr >>> 0;
+ const obj = Object.create(SpikeDrivenAttention.prototype);
+ obj.__wbg_ptr = ptr;
+ SpikeDrivenAttentionFinalization.register(obj, obj.__wbg_ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ SpikeDrivenAttentionFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_spikedrivenattention_free(ptr, 0);
+ }
+ /**
+ * Create with custom parameters
+ * @param {number} threshold
+ * @param {number} steps
+ * @param {number} refractory
+ * @returns {SpikeDrivenAttention}
+ */
+ static withConfig(threshold, steps, refractory) {
+ const ret = wasm.spikedrivenattention_withConfig(threshold, steps, refractory);
+ return SpikeDrivenAttention.__wrap(ret);
+ }
+ /**
+ * Estimate energy savings ratio compared to standard attention
+ * @param {number} seq_len
+ * @param {number} hidden_dim
+ * @returns {number}
+ */
+ energyRatio(seq_len, hidden_dim) {
+ const ret = wasm.spikedrivenattention_energyRatio(this.__wbg_ptr, seq_len, hidden_dim);
+ return ret;
+ }
+ /**
+ * Create new spike-driven attention with default config
+ */
+ constructor() {
+ const ret = wasm.spikedrivenattention_new();
+ this.__wbg_ptr = ret >>> 0;
+ SpikeDrivenAttentionFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+}
+if (Symbol.dispose) SpikeDrivenAttention.prototype[Symbol.dispose] = SpikeDrivenAttention.prototype.free;
+
+/**
+ * Spot-check system for result verification
+ */
+export class SpotChecker {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ SpotCheckerFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_spotchecker_free(ptr, 0);
+ }
+ /**
+ * Check if a task should include a spot-check
+ * @returns {boolean}
+ */
+ shouldCheck() {
+ const ret = wasm.spotchecker_shouldCheck(this.__wbg_ptr);
+ return ret !== 0;
+ }
+ /**
+ * Add a known challenge-response pair
+ * @param {string} task_type
+ * @param {Uint8Array} input
+ * @param {Uint8Array} expected_output
+ */
+ addChallenge(task_type, input, expected_output) {
+ const ptr0 = passStringToWasm0(task_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passArray8ToWasm0(input, wasm.__wbindgen_malloc);
+ const len1 = WASM_VECTOR_LEN;
+ const ptr2 = passArray8ToWasm0(expected_output, wasm.__wbindgen_malloc);
+ const len2 = WASM_VECTOR_LEN;
+ wasm.spotchecker_addChallenge(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
+ }
+ /**
+ * Get a random challenge for a task type
+ * @param {string} task_type
+ * @returns {Uint8Array | undefined}
+ */
+ getChallenge(task_type) {
+ const ptr0 = passStringToWasm0(task_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.spotchecker_getChallenge(this.__wbg_ptr, ptr0, len0);
+ let v2;
+ if (ret[0] !== 0) {
+ v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
+ }
+ return v2;
+ }
+ /**
+ * Verify a challenge response
+ * @param {Uint8Array} input_hash
+ * @param {Uint8Array} output
+ * @returns {boolean}
+ */
+ verifyResponse(input_hash, output) {
+ const ptr0 = passArray8ToWasm0(input_hash, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passArray8ToWasm0(output, wasm.__wbindgen_malloc);
+ const len1 = WASM_VECTOR_LEN;
+ const ret = wasm.spotchecker_verifyResponse(this.__wbg_ptr, ptr0, len0, ptr1, len1);
+ return ret !== 0;
+ }
+ /**
+ * @param {number} check_probability
+ */
+ constructor(check_probability) {
+ const ret = wasm.spotchecker_new(check_probability);
+ this.__wbg_ptr = ret >>> 0;
+ SpotCheckerFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+}
+if (Symbol.dispose) SpotChecker.prototype[Symbol.dispose] = SpotChecker.prototype.free;
+
+/**
+ * Stake manager for the network
+ */
+export class StakeManager {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ StakeManagerFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_stakemanager_free(ptr, 0);
+ }
+ /**
+ * Get number of stakers
+ * @returns {number}
+ */
+ stakerCount() {
+ const ret = wasm.stakemanager_stakerCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Get total staked amount in network
+ * @returns {bigint}
+ */
+ totalStaked() {
+ const ret = wasm.stakemanager_totalStaked(this.__wbg_ptr);
+ return BigInt.asUintN(64, ret);
+ }
+ /**
+ * Get minimum stake requirement
+ * @returns {bigint}
+ */
+ getMinStake() {
+ const ret = wasm.stakemanager_getMinStake(this.__wbg_ptr);
+ return BigInt.asUintN(64, ret);
+ }
+ /**
+ * Check if node has sufficient stake
+ * @param {Uint8Array} node_id
+ * @returns {boolean}
+ */
+ hasSufficientStake(node_id) {
+ const ptr0 = passArray8ToWasm0(node_id, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.stakemanager_hasSufficientStake(this.__wbg_ptr, ptr0, len0);
+ return ret !== 0;
+ }
+ /**
+ * Create a new stake manager
+ * @param {bigint} min_stake
+ */
+ constructor(min_stake) {
+ const ret = wasm.stakemanager_new(min_stake);
+ this.__wbg_ptr = ret >>> 0;
+ StakeManagerFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Get staked amount for a node
+ * @param {Uint8Array} node_id
+ * @returns {bigint}
+ */
+ getStake(node_id) {
+ const ptr0 = passArray8ToWasm0(node_id, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.stakemanager_getStake(this.__wbg_ptr, ptr0, len0);
+ return BigInt.asUintN(64, ret);
+ }
+}
+if (Symbol.dispose) StakeManager.prototype[Symbol.dispose] = StakeManager.prototype.free;
+
+/**
+ * Unified swarm intelligence coordinator
+ */
+export class SwarmIntelligence {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ SwarmIntelligenceFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_swarmintelligence_free(ptr, 0);
+ }
+ /**
+ * Get queue size
+ * @returns {number}
+ */
+ queueSize() {
+ const ret = wasm.swarmintelligence_queueSize(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Set belief for a topic's decision
+ * @param {string} topic
+ * @param {bigint} decision_id
+ * @param {number} probability
+ */
+ setBelief(topic, decision_id, probability) {
+ const ptr0 = passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.swarmintelligence_setBelief(this.__wbg_ptr, ptr0, len0, decision_id, probability);
+ }
+ /**
+ * Add pattern to collective memory
+ * @param {string} pattern_json
+ * @returns {boolean}
+ */
+ addPattern(pattern_json) {
+ const ptr0 = passStringToWasm0(pattern_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.swarmintelligence_addPattern(this.__wbg_ptr, ptr0, len0);
+ return ret !== 0;
+ }
+ /**
+ * Run memory consolidation
+ * @returns {number}
+ */
+ consolidate() {
+ const ret = wasm.swarmintelligence_consolidate(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Check if topic has reached consensus
+ * @param {string} topic
+ * @returns {boolean}
+ */
+ hasConsensus(topic) {
+ const ptr0 = passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.swarmintelligence_hasConsensus(this.__wbg_ptr, ptr0, len0);
+ return ret !== 0;
+ }
+ /**
+ * Get collective memory pattern count
+ * @returns {number}
+ */
+ patternCount() {
+ const ret = wasm.swarmintelligence_patternCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Search collective memory
+ * @param {string} query_json
+ * @param {number} k
+ * @returns {string}
+ */
+ searchPatterns(query_json, k) {
+ let deferred2_0;
+ let deferred2_1;
+ try {
+ const ptr0 = passStringToWasm0(query_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.swarmintelligence_searchPatterns(this.__wbg_ptr, ptr0, len0, k);
+ deferred2_0 = ret[0];
+ deferred2_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
+ }
+ }
+ /**
+ * Start a new consensus round for a topic
+ * @param {string} topic
+ * @param {number} threshold
+ */
+ startConsensus(topic, threshold) {
+ const ptr0 = passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.swarmintelligence_startConsensus(this.__wbg_ptr, ptr0, len0, threshold);
+ }
+ /**
+ * Negotiate beliefs for a topic
+ * @param {string} topic
+ * @param {string} beliefs_json
+ * @returns {boolean}
+ */
+ negotiateBeliefs(topic, beliefs_json) {
+ const ptr0 = passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passStringToWasm0(beliefs_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len1 = WASM_VECTOR_LEN;
+ const ret = wasm.swarmintelligence_negotiateBeliefs(this.__wbg_ptr, ptr0, len0, ptr1, len1);
+ return ret !== 0;
+ }
+ /**
+ * Get consensus decision for topic
+ * @param {string} topic
+ * @returns {bigint | undefined}
+ */
+ getConsensusDecision(topic) {
+ const ptr0 = passStringToWasm0(topic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.swarmintelligence_getConsensusDecision(this.__wbg_ptr, ptr0, len0);
+ return ret[0] === 0 ? undefined : BigInt.asUintN(64, ret[1]);
+ }
+ /**
+ * Create new swarm intelligence coordinator
+ * @param {string} node_id
+ */
+ constructor(node_id) {
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.swarmintelligence_new(ptr0, len0);
+ this.__wbg_ptr = ret >>> 0;
+ SwarmIntelligenceFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Run hippocampal replay
+ * @returns {number}
+ */
+ replay() {
+ const ret = wasm.swarmintelligence_replay(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Get node ID
+ * @returns {string}
+ */
+ nodeId() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.swarmintelligence_nodeId(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Get combined statistics as JSON
+ * @returns {string}
+ */
+ getStats() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.swarmintelligence_getStats(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+}
+if (Symbol.dispose) SwarmIntelligence.prototype[Symbol.dispose] = SwarmIntelligence.prototype.free;
+
+/**
+ * Sybil resistance mechanisms
+ */
+export class SybilDefense {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ SybilDefenseFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_sybildefense_free(ptr, 0);
+ }
+ /**
+ * Register a node with its fingerprint
+ * @param {string} node_id
+ * @param {string} fingerprint
+ * @returns {boolean}
+ */
+ registerNode(node_id, fingerprint) {
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passStringToWasm0(fingerprint, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len1 = WASM_VECTOR_LEN;
+ const ret = wasm.sybildefense_registerNode(this.__wbg_ptr, ptr0, len0, ptr1, len1);
+ return ret !== 0;
+ }
+ /**
+ * Get sybil score (0.0 = likely unique, 1.0 = likely sybil)
+ * @param {string} node_id
+ * @returns {number}
+ */
+ getSybilScore(node_id) {
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.sybildefense_getSybilScore(this.__wbg_ptr, ptr0, len0);
+ return ret;
+ }
+ /**
+ * Check if node is likely a sybil
+ * @param {string} node_id
+ * @returns {boolean}
+ */
+ isSuspectedSybil(node_id) {
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.sybildefense_isSuspectedSybil(this.__wbg_ptr, ptr0, len0);
+ return ret !== 0;
+ }
+ constructor() {
+ const ret = wasm.sybildefense_new();
+ this.__wbg_ptr = ret >>> 0;
+ SybilDefenseFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+}
+if (Symbol.dispose) SybilDefense.prototype[Symbol.dispose] = SybilDefense.prototype.free;
+
+/**
+ * Task priority levels
+ * @enum {0 | 1 | 2}
+ */
+export const TaskPriority = Object.freeze({
+ Low: 0, "0": "Low",
+ Normal: 1, "1": "Normal",
+ High: 2, "2": "High",
+});
+
+/**
+ * Task types supported by the network
+ * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7}
+ */
+export const TaskType = Object.freeze({
+ /**
+ * Vector search in HNSW index
+ */
+ VectorSearch: 0, "0": "VectorSearch",
+ /**
+ * Vector insertion
+ */
+ VectorInsert: 1, "1": "VectorInsert",
+ /**
+ * Generate embeddings
+ */
+ Embedding: 2, "2": "Embedding",
+ /**
+ * Semantic task-to-agent matching
+ */
+ SemanticMatch: 3, "3": "SemanticMatch",
+ /**
+ * Neural network inference
+ */
+ NeuralInference: 4, "4": "NeuralInference",
+ /**
+ * AES encryption/decryption
+ */
+ Encryption: 5, "5": "Encryption",
+ /**
+ * Data compression
+ */
+ Compression: 6, "6": "Compression",
+ /**
+ * Custom WASM module (requires verification)
+ */
+ CustomWasm: 7, "7": "CustomWasm",
+});
+
+/**
+ * TopK gradient sparsifier with error feedback for accuracy preservation
+ *
+ * Error feedback accumulates residuals from previous rounds to prevent
+ * information loss from aggressive compression.
+ */
+export class TopKSparsifier {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ TopKSparsifierFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_topksparsifier_free(ptr, 0);
+ }
+ /**
+ * Reset error feedback buffer
+ */
+ resetErrorFeedback() {
+ wasm.topksparsifier_resetErrorFeedback(this.__wbg_ptr);
+ }
+ /**
+ * Get compression ratio
+ * @returns {number}
+ */
+ getCompressionRatio() {
+ const ret = wasm.topksparsifier_getCompressionRatio(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * Get error feedback buffer size
+ * @returns {number}
+ */
+ getErrorBufferSize() {
+ const ret = wasm.topksparsifier_getErrorBufferSize(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Create a new TopK sparsifier
+ *
+ * # Arguments
+ * * `k_ratio` - Fraction of gradients to keep (0.1 = top 10%)
+ * @param {number} k_ratio
+ */
+ constructor(k_ratio) {
+ const ret = wasm.topksparsifier_new(k_ratio);
+ this.__wbg_ptr = ret >>> 0;
+ TopKSparsifierFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+}
+if (Symbol.dispose) TopKSparsifier.prototype[Symbol.dispose] = TopKSparsifier.prototype.free;
+
+/**
+ * Ring buffer tracker for task trajectories
+ */
+export class TrajectoryTracker {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ TrajectoryTrackerFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_trajectorytracker_free(ptr, 0);
+ }
+ /**
+ * Create a new trajectory tracker
+ * @param {number} max_size
+ */
+ constructor(max_size) {
+ const ret = wasm.trajectorytracker_new(max_size);
+ this.__wbg_ptr = ret >>> 0;
+ TrajectoryTrackerFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Get count of trajectories
+ * @returns {number}
+ */
+ count() {
+ const ret = wasm.trajectorytracker_count(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Record a new trajectory
+ * @param {string} trajectory_json
+ * @returns {boolean}
+ */
+ record(trajectory_json) {
+ const ptr0 = passStringToWasm0(trajectory_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.trajectorytracker_record(this.__wbg_ptr, ptr0, len0);
+ return ret !== 0;
+ }
+ /**
+ * Get statistics as JSON
+ * @returns {string}
+ */
+ getStats() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.trajectorytracker_getStats(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+}
+if (Symbol.dispose) TrajectoryTracker.prototype[Symbol.dispose] = TrajectoryTracker.prototype.free;
+
+/**
+ * WASM-compatible adapter pool wrapper
+ */
+export class WasmAdapterPool {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ WasmAdapterPoolFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_wasmadapterpool_free(ptr, 0);
+ }
+ /**
+ * Get or create an adapter for a task type
+ * @param {string} task_type
+ * @returns {any}
+ */
+ getAdapter(task_type) {
+ const ptr0 = passStringToWasm0(task_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmadapterpool_getAdapter(this.__wbg_ptr, ptr0, len0);
+ return ret;
+ }
+ /**
+ * Get adapter count
+ * @returns {number}
+ */
+ adapterCount() {
+ const ret = wasm.wasmadapterpool_adapterCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Export adapter to bytes for P2P sharing
+ * @param {string} task_type
+ * @returns {Uint8Array}
+ */
+ exportAdapter(task_type) {
+ const ptr0 = passStringToWasm0(task_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmadapterpool_exportAdapter(this.__wbg_ptr, ptr0, len0);
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
+ return v2;
+ }
+ /**
+ * Import adapter from bytes
+ * @param {string} task_type
+ * @param {Uint8Array} bytes
+ * @returns {boolean}
+ */
+ importAdapter(task_type, bytes) {
+ const ptr0 = passStringToWasm0(task_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
+ const len1 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmadapterpool_importAdapter(this.__wbg_ptr, ptr0, len0, ptr1, len1);
+ return ret !== 0;
+ }
+ /**
+ * Route to best adapter by task embedding
+ * @param {Float32Array} task_embedding
+ * @returns {any}
+ */
+ routeToAdapter(task_embedding) {
+ const ptr0 = passArrayF32ToWasm0(task_embedding, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmadapterpool_routeToAdapter(this.__wbg_ptr, ptr0, len0);
+ return ret;
+ }
+ /**
+ * Create a new adapter pool
+ * @param {number} hidden_dim
+ * @param {number} max_slots
+ */
+ constructor(hidden_dim, max_slots) {
+ const ret = wasm.wasmadapterpool_new(hidden_dim, max_slots);
+ this.__wbg_ptr = ret >>> 0;
+ WasmAdapterPoolFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Apply adapter to input
+ * @param {string} task_type
+ * @param {Float32Array} input
+ * @returns {Float32Array}
+ */
+ forward(task_type, input) {
+ const ptr0 = passStringToWasm0(task_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passArrayF32ToWasm0(input, wasm.__wbindgen_malloc);
+ const len1 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmadapterpool_forward(this.__wbg_ptr, ptr0, len0, ptr1, len1);
+ var v3 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
+ return v3;
+ }
+ /**
+ * Get pool statistics
+ * @returns {any}
+ */
+ getStats() {
+ const ret = wasm.wasmadapterpool_getStats(this.__wbg_ptr);
+ return ret;
+ }
+}
+if (Symbol.dispose) WasmAdapterPool.prototype[Symbol.dispose] = WasmAdapterPool.prototype.free;
+
+/**
+ * Unified interface for all exotic WASM capabilities
+ */
+export class WasmCapabilities {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ WasmCapabilitiesFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_wasmcapabilities_free(ptr, 0);
+ }
+ /**
+ * @returns {boolean}
+ */
+ enableHDC() {
+ const ret = wasm.wasmcapabilities_enableHDC(this.__wbg_ptr);
+ return ret !== 0;
+ }
+ /**
+ * @param {number} _quorum
+ * @returns {boolean}
+ */
+ enableNAO(_quorum) {
+ const ret = wasm.wasmcapabilities_enableNAO(this.__wbg_ptr, _quorum);
+ return ret !== 0;
+ }
+ /**
+ * @param {number} _num_neurons
+ * @param {number} _inhibition
+ * @param {number} _threshold
+ * @returns {boolean}
+ */
+ enableWTA(_num_neurons, _inhibition, _threshold) {
+ const ret = wasm.wasmcapabilities_enableWTA(this.__wbg_ptr, _num_neurons, _inhibition, _threshold);
+ return ret !== 0;
+ }
+ /**
+ * @param {Float32Array} _activations
+ * @returns {number}
+ */
+ competeWTA(_activations) {
+ const ptr0 = passArrayF32ToWasm0(_activations, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmcapabilities_competeWTA(this.__wbg_ptr, ptr0, len0);
+ return ret;
+ }
+ /**
+ * @param {number} _input_dim
+ * @param {number} _time_constant
+ * @returns {boolean}
+ */
+ enableBTSP(_input_dim, _time_constant) {
+ const ret = wasm.wasmcapabilities_enableBTSP(this.__wbg_ptr, _input_dim, _time_constant);
+ return ret !== 0;
+ }
+ /**
+ * @param {string} _proposal_id
+ * @returns {boolean}
+ */
+ executeNAO(_proposal_id) {
+ const ptr0 = passStringToWasm0(_proposal_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmcapabilities_executeNAO(this.__wbg_ptr, ptr0, len0);
+ return ret !== 0;
+ }
+ /**
+ * Get a summary of all enabled capabilities
+ * @returns {any}
+ */
+ getSummary() {
+ const ret = wasm.wasmcapabilities_getSummary(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * @param {string} _action
+ * @returns {string}
+ */
+ proposeNAO(_action) {
+ let deferred2_0;
+ let deferred2_1;
+ try {
+ const ptr0 = passStringToWasm0(_action, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmcapabilities_proposeNAO(this.__wbg_ptr, ptr0, len0);
+ deferred2_0 = ret[0];
+ deferred2_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
+ }
+ }
+ /**
+ * @param {Float32Array} _input
+ * @returns {number}
+ */
+ forwardBTSP(_input) {
+ const ptr0 = passArrayF32ToWasm0(_input, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmcapabilities_forwardBTSP(this.__wbg_ptr, ptr0, len0);
+ return ret;
+ }
+ /**
+ * @returns {number}
+ */
+ getNAOSync() {
+ const ret = wasm.wasmcapabilities_getNAOSync(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * @param {string} _key
+ * @param {number} _threshold
+ * @returns {any}
+ */
+ retrieveHDC(_key, _threshold) {
+ const ptr0 = passStringToWasm0(_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmcapabilities_retrieveHDC(this.__wbg_ptr, ptr0, len0, _threshold);
+ return ret;
+ }
+ /**
+ * @param {string} _member_id
+ * @param {bigint} _stake
+ * @returns {boolean}
+ */
+ addNAOMember(_member_id, _stake) {
+ const ptr0 = passStringToWasm0(_member_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmcapabilities_addNAOMember(this.__wbg_ptr, ptr0, len0, _stake);
+ return ret !== 0;
+ }
+ /**
+ * @param {string} _operator_type
+ * @param {Float32Array} _gradient
+ * @returns {boolean}
+ */
+ adaptMicroLoRA(_operator_type, _gradient) {
+ const ptr0 = passStringToWasm0(_operator_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passArrayF32ToWasm0(_gradient, wasm.__wbindgen_malloc);
+ const len1 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmcapabilities_adaptMicroLoRA(this.__wbg_ptr, ptr0, len0, ptr1, len1);
+ return ret !== 0;
+ }
+ /**
+ * @param {string} _operator_type
+ * @param {Float32Array} input
+ * @returns {Float32Array}
+ */
+ applyMicroLoRA(_operator_type, input) {
+ const ptr0 = passStringToWasm0(_operator_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passArrayF32ToWasm0(input, wasm.__wbindgen_malloc);
+ const len1 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmcapabilities_applyMicroLoRA(this.__wbg_ptr, ptr0, len0, ptr1, len1);
+ var v3 = getArrayF32FromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
+ return v3;
+ }
+ /**
+ * List all available exotic capabilities
+ * @returns {any}
+ */
+ getCapabilities() {
+ const ret = wasm.wasmcapabilities_getCapabilities(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * @param {number} _dim
+ * @param {number} _rank
+ * @returns {boolean}
+ */
+ enableMicroLoRA(_dim, _rank) {
+ const ret = wasm.wasmcapabilities_enableMicroLoRA(this.__wbg_ptr, _dim, _rank);
+ return ret !== 0;
+ }
+ /**
+ * @returns {any}
+ */
+ tickTimeCrystal() {
+ const ret = wasm.wasmcapabilities_tickTimeCrystal(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * @param {number} _rate
+ */
+ growMorphogenetic(_rate) {
+ wasm.wasmcapabilities_growMorphogenetic(this.__wbg_ptr, _rate);
+ }
+ /**
+ * @param {Float32Array} _pattern
+ * @param {number} _target
+ * @returns {boolean}
+ */
+ oneShotAssociate(_pattern, _target) {
+ const ptr0 = passArrayF32ToWasm0(_pattern, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmcapabilities_oneShotAssociate(this.__wbg_ptr, ptr0, len0, _target);
+ return ret !== 0;
+ }
+ /**
+ * @param {number} _oscillators
+ * @param {number} _period_ms
+ * @returns {boolean}
+ */
+ enableTimeCrystal(_oscillators, _period_ms) {
+ const ret = wasm.wasmcapabilities_enableMicroLoRA(this.__wbg_ptr, _oscillators, _period_ms);
+ return ret !== 0;
+ }
+ /**
+ * @param {number} _threshold
+ */
+ pruneMorphogenetic(_threshold) {
+ wasm.wasmcapabilities_growMorphogenetic(this.__wbg_ptr, _threshold);
+ }
+ /**
+ * @param {number} _width
+ * @param {number} _height
+ * @returns {boolean}
+ */
+ enableMorphogenetic(_width, _height) {
+ const ret = wasm.wasmcapabilities_enableMicroLoRA(this.__wbg_ptr, _width, _height);
+ return ret !== 0;
+ }
+ /**
+ * @returns {number}
+ */
+ getTimeCrystalSync() {
+ const ret = wasm.wasmcapabilities_getNAOSync(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * @param {Float32Array} _content
+ * @param {number} _salience
+ * @param {number} _source_module
+ * @returns {boolean}
+ */
+ broadcastToWorkspace(_content, _salience, _source_module) {
+ const ptr0 = passArrayF32ToWasm0(_content, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmcapabilities_broadcastToWorkspace(this.__wbg_ptr, ptr0, len0, _salience, _source_module);
+ return ret !== 0;
+ }
+ /**
+ * @returns {any}
+ */
+ getWorkspaceContents() {
+ const ret = wasm.wasmcapabilities_getWorkspaceContents(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * @returns {boolean}
+ */
+ isTimeCrystalStable() {
+ const ret = wasm.wasmcapabilities_getMorphogeneticCellCount(this.__wbg_ptr);
+ return ret !== 0;
+ }
+ /**
+ * @param {number} _capacity
+ * @returns {boolean}
+ */
+ enableGlobalWorkspace(_capacity) {
+ const ret = wasm.wasmcapabilities_enableGlobalWorkspace(this.__wbg_ptr, _capacity);
+ return ret !== 0;
+ }
+ /**
+ * @returns {any}
+ */
+ getMorphogeneticStats() {
+ const ret = wasm.wasmcapabilities_getMorphogeneticStats(this.__wbg_ptr);
+ return ret;
+ }
+ differentiateMorphogenetic() {
+ wasm.wasmcapabilities_differentiateMorphogenetic(this.__wbg_ptr);
+ }
+ /**
+ * @returns {number}
+ */
+ getMorphogeneticCellCount() {
+ const ret = wasm.wasmcapabilities_getMorphogeneticCellCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Create a new capabilities manager for a node
+ * @param {string} node_id
+ */
+ constructor(node_id) {
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmcapabilities_new(ptr0, len0);
+ this.__wbg_ptr = ret >>> 0;
+ WasmCapabilitiesFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Step all enabled capabilities forward (for main loop integration)
+ * @param {number} dt
+ */
+ step(dt) {
+ wasm.wasmcapabilities_growMorphogenetic(this.__wbg_ptr, dt);
+ }
+ /**
+ * @param {number} _dt
+ */
+ tickNAO(_dt) {
+ wasm.wasmcapabilities_growMorphogenetic(this.__wbg_ptr, _dt);
+ }
+ /**
+ * @param {string} _proposal_id
+ * @param {number} _weight
+ * @returns {boolean}
+ */
+ voteNAO(_proposal_id, _weight) {
+ const ptr0 = passStringToWasm0(_proposal_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmcapabilities_voteNAO(this.__wbg_ptr, ptr0, len0, _weight);
+ return ret !== 0;
+ }
+ /**
+ * @param {string} _key
+ * @returns {boolean}
+ */
+ storeHDC(_key) {
+ const ptr0 = passStringToWasm0(_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmcapabilities_executeNAO(this.__wbg_ptr, ptr0, len0);
+ return ret !== 0;
+ }
+}
+if (Symbol.dispose) WasmCapabilities.prototype[Symbol.dispose] = WasmCapabilities.prototype.free;
+
+/**
+ * CRDT-based credit ledger for P2P consistency
+ */
+export class WasmCreditLedger {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ WasmCreditLedgerFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_wasmcreditledger_free(ptr, 0);
+ }
+ /**
+ * Get total spent
+ * @returns {bigint}
+ */
+ totalSpent() {
+ const ret = wasm.wasmcreditledger_totalSpent(this.__wbg_ptr);
+ return BigInt.asUintN(64, ret);
+ }
+ /**
+ * Export spent counter for sync
+ * @returns {Uint8Array}
+ */
+ exportSpent() {
+ const ret = wasm.wasmcreditledger_exportSpent(this.__wbg_ptr);
+ if (ret[3]) {
+ throw takeFromExternrefTable0(ret[2]);
+ }
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
+ return v1;
+ }
+ /**
+ * Get total earned (before spending)
+ * @returns {bigint}
+ */
+ totalEarned() {
+ const ret = wasm.wasmcreditledger_totalEarned(this.__wbg_ptr);
+ return BigInt.asUintN(64, ret);
+ }
+ /**
+ * Export earned counter for sync
+ * @returns {Uint8Array}
+ */
+ exportEarned() {
+ const ret = wasm.wasmcreditledger_exportEarned(this.__wbg_ptr);
+ if (ret[3]) {
+ throw takeFromExternrefTable0(ret[2]);
+ }
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
+ return v1;
+ }
+ /**
+ * Get staked amount
+ * @returns {bigint}
+ */
+ stakedAmount() {
+ const ret = wasm.wasmcreditledger_stakedAmount(this.__wbg_ptr);
+ return BigInt.asUintN(64, ret);
+ }
+ /**
+ * Get network compute hours (for multiplier)
+ * @returns {number}
+ */
+ networkCompute() {
+ const ret = wasm.wasmcreditledger_networkCompute(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * Get current multiplier
+ * @returns {number}
+ */
+ currentMultiplier() {
+ const ret = wasm.wasmcreditledger_currentMultiplier(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * Update network compute (from P2P sync)
+ * @param {number} hours
+ */
+ updateNetworkCompute(hours) {
+ wasm.wasmcreditledger_updateNetworkCompute(this.__wbg_ptr, hours);
+ }
+ /**
+ * Create a new credit ledger
+ * @param {string} node_id
+ */
+ constructor(node_id) {
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmcreditledger_new(ptr0, len0);
+ if (ret[2]) {
+ throw takeFromExternrefTable0(ret[1]);
+ }
+ this.__wbg_ptr = ret[0] >>> 0;
+ WasmCreditLedgerFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Merge with another ledger (CRDT merge) - optimized batch processing
+ * @param {Uint8Array} other_earned
+ * @param {Uint8Array} other_spent
+ */
+ merge(other_earned, other_spent) {
+ const ptr0 = passArray8ToWasm0(other_earned, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passArray8ToWasm0(other_spent, wasm.__wbindgen_malloc);
+ const len1 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmcreditledger_merge(this.__wbg_ptr, ptr0, len0, ptr1, len1);
+ if (ret[1]) {
+ throw takeFromExternrefTable0(ret[0]);
+ }
+ }
+ /**
+ * Slash staked credits (penalty for bad behavior)
+ * @param {bigint} amount
+ * @returns {bigint}
+ */
+ slash(amount) {
+ const ret = wasm.wasmcreditledger_slash(this.__wbg_ptr, amount);
+ if (ret[2]) {
+ throw takeFromExternrefTable0(ret[1]);
+ }
+ return BigInt.asUintN(64, ret[0]);
+ }
+ /**
+ * Stake credits for participation
+ * @param {bigint} amount
+ */
+ stake(amount) {
+ const ret = wasm.wasmcreditledger_stake(this.__wbg_ptr, amount);
+ if (ret[1]) {
+ throw takeFromExternrefTable0(ret[0]);
+ }
+ }
+ /**
+ * Credit the ledger (earn credits)
+ * @param {bigint} amount
+ * @param {string} reason
+ */
+ credit(amount, reason) {
+ const ptr0 = passStringToWasm0(reason, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmcreditledger_credit(this.__wbg_ptr, amount, ptr0, len0);
+ if (ret[1]) {
+ throw takeFromExternrefTable0(ret[0]);
+ }
+ }
+ /**
+ * Deduct from the ledger (spend credits)
+ * @param {bigint} amount
+ */
+ deduct(amount) {
+ const ret = wasm.wasmcreditledger_deduct(this.__wbg_ptr, amount);
+ if (ret[1]) {
+ throw takeFromExternrefTable0(ret[0]);
+ }
+ }
+ /**
+ * Get current balance
+ * @returns {bigint}
+ */
+ balance() {
+ const ret = wasm.wasmcreditledger_balance(this.__wbg_ptr);
+ return BigInt.asUintN(64, ret);
+ }
+ /**
+ * Unstake credits
+ * @param {bigint} amount
+ */
+ unstake(amount) {
+ const ret = wasm.wasmcreditledger_unstake(this.__wbg_ptr, amount);
+ if (ret[1]) {
+ throw takeFromExternrefTable0(ret[0]);
+ }
+ }
+}
+if (Symbol.dispose) WasmCreditLedger.prototype[Symbol.dispose] = WasmCreditLedger.prototype.free;
+
+/**
+ * Idle detection and throttling
+ */
+export class WasmIdleDetector {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ WasmIdleDetectorFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_wasmidledetector_free(ptr, 0);
+ }
+ /**
+ * Get status summary
+ * @returns {any}
+ */
+ getStatus() {
+ const ret = wasm.wasmidledetector_getStatus(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * Update FPS measurement
+ * @param {number} fps
+ */
+ updateFps(fps) {
+ wasm.wasmidledetector_updateFps(this.__wbg_ptr, fps);
+ }
+ /**
+ * Check if we should be working
+ * @returns {boolean}
+ */
+ shouldWork() {
+ const ret = wasm.wasmidledetector_shouldWork(this.__wbg_ptr);
+ return ret !== 0;
+ }
+ /**
+ * Get current throttle level (0.0 - max_cpu)
+ * @returns {number}
+ */
+ getThrottle() {
+ const ret = wasm.wasmidledetector_getThrottle(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * Record user interaction
+ */
+ recordInteraction() {
+ wasm.wasmidledetector_recordInteraction(this.__wbg_ptr);
+ }
+ /**
+ * Set battery status (called from JS)
+ * @param {boolean} on_battery
+ */
+ setBatteryStatus(on_battery) {
+ wasm.wasmidledetector_setBatteryStatus(this.__wbg_ptr, on_battery);
+ }
+ /**
+ * Create a new idle detector
+ * @param {number} max_cpu
+ * @param {number} min_idle_time
+ */
+ constructor(max_cpu, min_idle_time) {
+ const ret = wasm.wasmidledetector_new(max_cpu, min_idle_time);
+ if (ret[2]) {
+ throw takeFromExternrefTable0(ret[1]);
+ }
+ this.__wbg_ptr = ret[0] >>> 0;
+ WasmIdleDetectorFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Stop monitoring
+ */
+ stop() {
+ wasm.wasmidledetector_stop(this.__wbg_ptr);
+ }
+ /**
+ * Pause contribution (user-initiated)
+ */
+ pause() {
+ wasm.wasmidledetector_pause(this.__wbg_ptr);
+ }
+ /**
+ * Start monitoring
+ */
+ start() {
+ const ret = wasm.wasmidledetector_start(this.__wbg_ptr);
+ if (ret[1]) {
+ throw takeFromExternrefTable0(ret[0]);
+ }
+ }
+ /**
+ * Resume contribution
+ */
+ resume() {
+ wasm.wasmidledetector_resume(this.__wbg_ptr);
+ }
+ /**
+ * Check if user is idle
+ * @returns {boolean}
+ */
+ isIdle() {
+ const ret = wasm.wasmidledetector_isIdle(this.__wbg_ptr);
+ return ret !== 0;
+ }
+}
+if (Symbol.dispose) WasmIdleDetector.prototype[Symbol.dispose] = WasmIdleDetector.prototype.free;
+
+/**
+ * BroadcastChannel-based transport for multi-tab communication
+ */
+export class WasmMcpBroadcast {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ WasmMcpBroadcastFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_wasmmcpbroadcast_free(ptr, 0);
+ }
+ /**
+ * Set as server mode (responds to requests)
+ * @param {WasmMcpServer} server
+ */
+ setServer(server) {
+ _assertClass(server, WasmMcpServer);
+ var ptr0 = server.__destroy_into_raw();
+ wasm.wasmmcpbroadcast_setServer(this.__wbg_ptr, ptr0);
+ }
+ /**
+ * Create a broadcast transport
+ * @param {string} channel_name
+ */
+ constructor(channel_name) {
+ const ptr0 = passStringToWasm0(channel_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmmcpbroadcast_new(ptr0, len0);
+ if (ret[2]) {
+ throw takeFromExternrefTable0(ret[1]);
+ }
+ this.__wbg_ptr = ret[0] >>> 0;
+ WasmMcpBroadcastFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Send a request (client mode)
+ * @param {string} request_json
+ */
+ send(request_json) {
+ const ptr0 = passStringToWasm0(request_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmmcpbroadcast_send(this.__wbg_ptr, ptr0, len0);
+ if (ret[1]) {
+ throw takeFromExternrefTable0(ret[0]);
+ }
+ }
+ /**
+ * Close the channel
+ */
+ close() {
+ wasm.wasmmcpbroadcast_close(this.__wbg_ptr);
+ }
+ /**
+ * Start listening for requests (server mode)
+ */
+ listen() {
+ const ret = wasm.wasmmcpbroadcast_listen(this.__wbg_ptr);
+ if (ret[1]) {
+ throw takeFromExternrefTable0(ret[0]);
+ }
+ }
+}
+if (Symbol.dispose) WasmMcpBroadcast.prototype[Symbol.dispose] = WasmMcpBroadcast.prototype.free;
+
+/**
+ * Browser-based MCP server for edge-net
+ *
+ * Provides Model Context Protocol interface over MessagePort or direct calls.
+ * All edge-net capabilities are exposed as MCP tools.
+ */
+export class WasmMcpServer {
+ static __wrap(ptr) {
+ ptr = ptr >>> 0;
+ const obj = Object.create(WasmMcpServer.prototype);
+ obj.__wbg_ptr = ptr;
+ WasmMcpServerFinalization.register(obj, obj.__wbg_ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ WasmMcpServerFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_wasmmcpserver_free(ptr, 0);
+ }
+ /**
+ * Create with custom configuration
+ * @param {any} config
+ * @returns {WasmMcpServer}
+ */
+ static withConfig(config) {
+ const ret = wasm.wasmmcpserver_withConfig(config);
+ if (ret[2]) {
+ throw takeFromExternrefTable0(ret[1]);
+ }
+ return WasmMcpServer.__wrap(ret[0]);
+ }
+ /**
+ * Set identity for authenticated operations
+ * @param {WasmNodeIdentity} identity
+ */
+ setIdentity(identity) {
+ _assertClass(identity, WasmNodeIdentity);
+ var ptr0 = identity.__destroy_into_raw();
+ wasm.wasmmcpserver_setIdentity(this.__wbg_ptr, ptr0);
+ }
+ /**
+ * Initialize learning engine
+ */
+ initLearning() {
+ const ret = wasm.wasmmcpserver_initLearning(this.__wbg_ptr);
+ if (ret[1]) {
+ throw takeFromExternrefTable0(ret[0]);
+ }
+ }
+ /**
+ * Handle an MCP request (JSON string)
+ * @param {string} request_json
+ * @returns {Promise}
+ */
+ handleRequest(request_json) {
+ const ptr0 = passStringToWasm0(request_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmmcpserver_handleRequest(this.__wbg_ptr, ptr0, len0);
+ return ret;
+ }
+ /**
+ * Get server info
+ * @returns {any}
+ */
+ getServerInfo() {
+ const ret = wasm.wasmmcpserver_getServerInfo(this.__wbg_ptr);
+ return ret;
+ }
+ /**
+ * Handle MCP request from JsValue (for direct JS calls)
+ * @param {any} request
+ * @returns {Promise}
+ */
+ handleRequestJs(request) {
+ const ret = wasm.wasmmcpserver_handleRequestJs(this.__wbg_ptr, request);
+ return ret;
+ }
+ /**
+ * Create a new MCP server with default configuration
+ */
+ constructor() {
+ const ret = wasm.wasmmcpserver_new();
+ if (ret[2]) {
+ throw takeFromExternrefTable0(ret[1]);
+ }
+ this.__wbg_ptr = ret[0] >>> 0;
+ WasmMcpServerFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+}
+if (Symbol.dispose) WasmMcpServer.prototype[Symbol.dispose] = WasmMcpServer.prototype.free;
+
+/**
+ * Browser-based MCP transport using MessagePort
+ */
+export class WasmMcpTransport {
+ static __wrap(ptr) {
+ ptr = ptr >>> 0;
+ const obj = Object.create(WasmMcpTransport.prototype);
+ obj.__wbg_ptr = ptr;
+ WasmMcpTransportFinalization.register(obj, obj.__wbg_ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ WasmMcpTransportFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_wasmmcptransport_free(ptr, 0);
+ }
+ /**
+ * Create transport from a Worker
+ * @param {Worker} worker
+ */
+ constructor(worker) {
+ const ret = wasm.wasmmcptransport_new(worker);
+ if (ret[2]) {
+ throw takeFromExternrefTable0(ret[1]);
+ }
+ this.__wbg_ptr = ret[0] >>> 0;
+ WasmMcpTransportFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Initialize transport (set up message handler)
+ */
+ init() {
+ const ret = wasm.wasmmcptransport_init(this.__wbg_ptr);
+ if (ret[1]) {
+ throw takeFromExternrefTable0(ret[0]);
+ }
+ }
+ /**
+ * Send an MCP request and get a Promise for the response
+ * @param {any} request
+ * @returns {Promise}
+ */
+ send(request) {
+ const ret = wasm.wasmmcptransport_send(this.__wbg_ptr, request);
+ return ret;
+ }
+ /**
+ * Close the transport
+ */
+ close() {
+ wasm.wasmmcptransport_close(this.__wbg_ptr);
+ }
+ /**
+ * Create transport from existing MessagePort
+ * @param {MessagePort} port
+ * @returns {WasmMcpTransport}
+ */
+ static fromPort(port) {
+ const ret = wasm.wasmmcptransport_fromPort(port);
+ return WasmMcpTransport.__wrap(ret);
+ }
+}
+if (Symbol.dispose) WasmMcpTransport.prototype[Symbol.dispose] = WasmMcpTransport.prototype.free;
+
+/**
+ * Worker-side handler for MCP requests
+ */
+export class WasmMcpWorkerHandler {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ WasmMcpWorkerHandlerFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_wasmmcpworkerhandler_free(ptr, 0);
+ }
+ /**
+ * Create handler with MCP server
+ * @param {WasmMcpServer} server
+ */
+ constructor(server) {
+ _assertClass(server, WasmMcpServer);
+ var ptr0 = server.__destroy_into_raw();
+ const ret = wasm.wasmmcpworkerhandler_new(ptr0);
+ this.__wbg_ptr = ret >>> 0;
+ WasmMcpWorkerHandlerFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Start handling messages (call in worker)
+ */
+ start() {
+ const ret = wasm.wasmmcpworkerhandler_start(this.__wbg_ptr);
+ if (ret[1]) {
+ throw takeFromExternrefTable0(ret[0]);
+ }
+ }
+}
+if (Symbol.dispose) WasmMcpWorkerHandler.prototype[Symbol.dispose] = WasmMcpWorkerHandler.prototype.free;
+
+/**
+ * P2P network manager
+ */
+export class WasmNetworkManager {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ WasmNetworkManagerFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_wasmnetworkmanager_free(ptr, 0);
+ }
+ /**
+ * Get peer count
+ * @returns {number}
+ */
+ peerCount() {
+ const ret = wasm.wasmnetworkmanager_peerCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Check if connected
+ * @returns {boolean}
+ */
+ isConnected() {
+ const ret = wasm.wasmnetworkmanager_isConnected(this.__wbg_ptr);
+ return ret !== 0;
+ }
+ /**
+ * Register a peer
+ * @param {string} node_id
+ * @param {Uint8Array} pubkey
+ * @param {string[]} capabilities
+ * @param {bigint} stake
+ */
+ registerPeer(node_id, pubkey, capabilities, stake) {
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passArray8ToWasm0(pubkey, wasm.__wbindgen_malloc);
+ const len1 = WASM_VECTOR_LEN;
+ const ptr2 = passArrayJsValueToWasm0(capabilities, wasm.__wbindgen_malloc);
+ const len2 = WASM_VECTOR_LEN;
+ wasm.wasmnetworkmanager_registerPeer(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, stake);
+ }
+ /**
+ * Select workers for task execution (reputation-weighted random)
+ * @param {string} capability
+ * @param {number} count
+ * @returns {string[]}
+ */
+ selectWorkers(capability, count) {
+ const ptr0 = passStringToWasm0(capability, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmnetworkmanager_selectWorkers(this.__wbg_ptr, ptr0, len0, count);
+ var v2 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
+ return v2;
+ }
+ /**
+ * Get active peer count (seen in last 60s)
+ * @returns {number}
+ */
+ activePeerCount() {
+ const ret = wasm.wasmnetworkmanager_activePeerCount(this.__wbg_ptr);
+ return ret >>> 0;
+ }
+ /**
+ * Update peer reputation
+ * @param {string} node_id
+ * @param {number} delta
+ */
+ updateReputation(node_id, delta) {
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.wasmnetworkmanager_updateReputation(this.__wbg_ptr, ptr0, len0, delta);
+ }
+ /**
+ * Get peers with specific capability
+ * @param {string} capability
+ * @returns {string[]}
+ */
+ getPeersWithCapability(capability) {
+ const ptr0 = passStringToWasm0(capability, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmnetworkmanager_getPeersWithCapability(this.__wbg_ptr, ptr0, len0);
+ var v2 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
+ return v2;
+ }
+ /**
+ * @param {string} node_id
+ */
+ constructor(node_id) {
+ const ptr0 = passStringToWasm0(node_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmnetworkmanager_new(ptr0, len0);
+ this.__wbg_ptr = ret >>> 0;
+ WasmNetworkManagerFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Add a relay URL
+ * @param {string} url
+ */
+ addRelay(url) {
+ const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.wasmnetworkmanager_addRelay(this.__wbg_ptr, ptr0, len0);
+ }
+}
+if (Symbol.dispose) WasmNetworkManager.prototype[Symbol.dispose] = WasmNetworkManager.prototype.free;
+
+/**
+ * Node identity with Ed25519 keypair
+ */
+export class WasmNodeIdentity {
+ static __wrap(ptr) {
+ ptr = ptr >>> 0;
+ const obj = Object.create(WasmNodeIdentity.prototype);
+ obj.__wbg_ptr = ptr;
+ WasmNodeIdentityFinalization.register(obj, obj.__wbg_ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ WasmNodeIdentityFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_wasmnodeidentity_free(ptr, 0);
+ }
+ /**
+ * Verify a signature from another node
+ * @param {Uint8Array} public_key
+ * @param {Uint8Array} message
+ * @param {Uint8Array} signature
+ * @returns {boolean}
+ */
+ static verifyFrom(public_key, message, signature) {
+ const ptr0 = passArray8ToWasm0(public_key, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passArray8ToWasm0(message, wasm.__wbindgen_malloc);
+ const len1 = WASM_VECTOR_LEN;
+ const ptr2 = passArray8ToWasm0(signature, wasm.__wbindgen_malloc);
+ const len2 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmnodeidentity_verifyFrom(ptr0, len0, ptr1, len1, ptr2, len2);
+ return ret !== 0;
+ }
+ /**
+ * Get the public key as hex string
+ * @returns {string}
+ */
+ publicKeyHex() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.wasmnodeidentity_publicKeyHex(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Restore identity from secret key bytes
+ * @param {Uint8Array} secret_key
+ * @param {string} site_id
+ * @returns {WasmNodeIdentity}
+ */
+ static fromSecretKey(secret_key, site_id) {
+ const ptr0 = passArray8ToWasm0(secret_key, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passStringToWasm0(site_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len1 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmnodeidentity_fromSecretKey(ptr0, len0, ptr1, len1);
+ if (ret[2]) {
+ throw takeFromExternrefTable0(ret[1]);
+ }
+ return WasmNodeIdentity.__wrap(ret[0]);
+ }
+ /**
+ * Get browser fingerprint
+ * @returns {string | undefined}
+ */
+ getFingerprint() {
+ const ret = wasm.wasmnodeidentity_getFingerprint(this.__wbg_ptr);
+ let v1;
+ if (ret[0] !== 0) {
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
+ }
+ return v1;
+ }
+ /**
+ * Set browser fingerprint for anti-sybil
+ * @param {string} fingerprint
+ */
+ setFingerprint(fingerprint) {
+ const ptr0 = passStringToWasm0(fingerprint, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.wasmnodeidentity_setFingerprint(this.__wbg_ptr, ptr0, len0);
+ }
+ /**
+ * Get the public key as bytes
+ * @returns {Uint8Array}
+ */
+ publicKeyBytes() {
+ const ret = wasm.wasmnodeidentity_publicKeyBytes(this.__wbg_ptr);
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
+ return v1;
+ }
+ /**
+ * Export secret key encrypted with password (secure backup)
+ * Uses Argon2id for key derivation and AES-256-GCM for encryption
+ * @param {string} password
+ * @returns {Uint8Array}
+ */
+ exportSecretKey(password) {
+ const ptr0 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmnodeidentity_exportSecretKey(this.__wbg_ptr, ptr0, len0);
+ if (ret[3]) {
+ throw takeFromExternrefTable0(ret[2]);
+ }
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
+ return v2;
+ }
+ /**
+ * Import secret key from encrypted backup
+ * @param {Uint8Array} encrypted
+ * @param {string} password
+ * @param {string} site_id
+ * @returns {WasmNodeIdentity}
+ */
+ static importSecretKey(encrypted, password, site_id) {
+ const ptr0 = passArray8ToWasm0(encrypted, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len1 = WASM_VECTOR_LEN;
+ const ptr2 = passStringToWasm0(site_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len2 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmnodeidentity_importSecretKey(ptr0, len0, ptr1, len1, ptr2, len2);
+ if (ret[2]) {
+ throw takeFromExternrefTable0(ret[1]);
+ }
+ return WasmNodeIdentity.__wrap(ret[0]);
+ }
+ /**
+ * Sign a message
+ * @param {Uint8Array} message
+ * @returns {Uint8Array}
+ */
+ sign(message) {
+ const ptr0 = passArray8ToWasm0(message, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmnodeidentity_sign(this.__wbg_ptr, ptr0, len0);
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
+ return v2;
+ }
+ /**
+ * Verify a signature
+ * @param {Uint8Array} message
+ * @param {Uint8Array} signature
+ * @returns {boolean}
+ */
+ verify(message, signature) {
+ const ptr0 = passArray8ToWasm0(message, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passArray8ToWasm0(signature, wasm.__wbindgen_malloc);
+ const len1 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmnodeidentity_verify(this.__wbg_ptr, ptr0, len0, ptr1, len1);
+ return ret !== 0;
+ }
+ /**
+ * Get the node's unique identifier
+ * @returns {string}
+ */
+ nodeId() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.wasmnodeidentity_nodeId(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Get the site ID
+ * @returns {string}
+ */
+ siteId() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.wasmnodeidentity_siteId(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Generate a new node identity
+ * @param {string} site_id
+ * @returns {WasmNodeIdentity}
+ */
+ static generate(site_id) {
+ const ptr0 = passStringToWasm0(site_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmnodeidentity_generate(ptr0, len0);
+ if (ret[2]) {
+ throw takeFromExternrefTable0(ret[1]);
+ }
+ return WasmNodeIdentity.__wrap(ret[0]);
+ }
+}
+if (Symbol.dispose) WasmNodeIdentity.prototype[Symbol.dispose] = WasmNodeIdentity.prototype.free;
+
+/**
+ * WASM-bindgen wrapper for stigmergy coordination
+ */
+export class WasmStigmergy {
+ static __wrap(ptr) {
+ ptr = ptr >>> 0;
+ const obj = Object.create(WasmStigmergy.prototype);
+ obj.__wbg_ptr = ptr;
+ WasmStigmergyFinalization.register(obj, obj.__wbg_ptr, obj);
+ return obj;
+ }
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ WasmStigmergyFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_wasmstigmergy_free(ptr, 0);
+ }
+ /**
+ * Create with custom parameters
+ * @param {number} decay_rate
+ * @param {number} deposit_rate
+ * @param {number} evaporation_hours
+ * @returns {WasmStigmergy}
+ */
+ static withParams(decay_rate, deposit_rate, evaporation_hours) {
+ const ret = wasm.wasmstigmergy_withParams(decay_rate, deposit_rate, evaporation_hours);
+ return WasmStigmergy.__wrap(ret);
+ }
+ /**
+ * Export current state for P2P sharing
+ * @returns {string}
+ */
+ exportState() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.wasmstigmergy_exportState(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Get raw pheromone intensity
+ * @param {string} task_type
+ * @returns {number}
+ */
+ getIntensity(task_type) {
+ const ptr0 = passStringToWasm0(task_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmstigmergy_getIntensity(this.__wbg_ptr, ptr0, len0);
+ return ret;
+ }
+ /**
+ * Set minimum stake for anti-sybil
+ * @param {bigint} min_stake
+ */
+ setMinStake(min_stake) {
+ wasm.wasmstigmergy_setMinStake(this.__wbg_ptr, min_stake);
+ }
+ /**
+ * Should this node accept a task? (combined decision)
+ * @param {string} task_type
+ * @returns {number}
+ */
+ shouldAccept(task_type) {
+ const ptr0 = passStringToWasm0(task_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmstigmergy_shouldAccept(this.__wbg_ptr, ptr0, len0);
+ return ret;
+ }
+ /**
+ * Check and run evaporation if due
+ * @returns {boolean}
+ */
+ maybeEvaporate() {
+ const ret = wasm.wasmstigmergy_maybeEvaporate(this.__wbg_ptr);
+ return ret !== 0;
+ }
+ /**
+ * Get all task types ranked by attractiveness
+ * @returns {string}
+ */
+ getRankedTasks() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.wasmstigmergy_getRankedTasks(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+ /**
+ * Get success rate for a task type
+ * @param {string} task_type
+ * @returns {number}
+ */
+ getSuccessRate(task_type) {
+ const ptr0 = passStringToWasm0(task_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmstigmergy_getSuccessRate(this.__wbg_ptr, ptr0, len0);
+ return ret;
+ }
+ /**
+ * Get node's specialization score
+ * @param {string} task_type
+ * @returns {number}
+ */
+ getSpecialization(task_type) {
+ const ptr0 = passStringToWasm0(task_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmstigmergy_getSpecialization(this.__wbg_ptr, ptr0, len0);
+ return ret;
+ }
+ /**
+ * Deposit with success/failure outcome
+ * @param {string} task_type
+ * @param {string} peer_id
+ * @param {boolean} success
+ * @param {bigint} stake
+ */
+ depositWithOutcome(task_type, peer_id, success, stake) {
+ const ptr0 = passStringToWasm0(task_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passStringToWasm0(peer_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len1 = WASM_VECTOR_LEN;
+ wasm.wasmstigmergy_depositWithOutcome(this.__wbg_ptr, ptr0, len0, ptr1, len1, success, stake);
+ }
+ /**
+ * Update node specialization based on outcome
+ * @param {string} task_type
+ * @param {boolean} success
+ */
+ updateSpecialization(task_type, success) {
+ const ptr0 = passStringToWasm0(task_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ wasm.wasmstigmergy_updateSpecialization(this.__wbg_ptr, ptr0, len0, success);
+ }
+ /**
+ * Get best specialization recommendation
+ * @returns {string | undefined}
+ */
+ getBestSpecialization() {
+ const ret = wasm.wasmstigmergy_getBestSpecialization(this.__wbg_ptr);
+ let v1;
+ if (ret[0] !== 0) {
+ v1 = getStringFromWasm0(ret[0], ret[1]).slice();
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
+ }
+ return v1;
+ }
+ /**
+ * Create a new stigmergy engine
+ */
+ constructor() {
+ const ret = wasm.wasmstigmergy_new();
+ this.__wbg_ptr = ret >>> 0;
+ WasmStigmergyFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+ /**
+ * Merge peer pheromone state (JSON format)
+ * @param {string} peer_state_json
+ * @returns {boolean}
+ */
+ merge(peer_state_json) {
+ const ptr0 = passStringToWasm0(peer_state_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmstigmergy_merge(this.__wbg_ptr, ptr0, len0);
+ return ret !== 0;
+ }
+ /**
+ * Get acceptance probability for a task type
+ * @param {string} task_type
+ * @returns {number}
+ */
+ follow(task_type) {
+ const ptr0 = passStringToWasm0(task_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmstigmergy_follow(this.__wbg_ptr, ptr0, len0);
+ return ret;
+ }
+ /**
+ * Deposit pheromone after task completion
+ * @param {string} task_type
+ * @param {string} peer_id
+ * @param {number} success_rate
+ * @param {bigint} stake
+ */
+ deposit(task_type, peer_id, success_rate, stake) {
+ const ptr0 = passStringToWasm0(task_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ptr1 = passStringToWasm0(peer_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len1 = WASM_VECTOR_LEN;
+ wasm.wasmstigmergy_deposit(this.__wbg_ptr, ptr0, len0, ptr1, len1, success_rate, stake);
+ }
+ /**
+ * Run evaporation (call periodically)
+ */
+ evaporate() {
+ wasm.wasmstigmergy_evaporate(this.__wbg_ptr);
+ }
+ /**
+ * Get statistics as JSON
+ * @returns {string}
+ */
+ getStats() {
+ let deferred1_0;
+ let deferred1_1;
+ try {
+ const ret = wasm.wasmstigmergy_getStats(this.__wbg_ptr);
+ deferred1_0 = ret[0];
+ deferred1_1 = ret[1];
+ return getStringFromWasm0(ret[0], ret[1]);
+ } finally {
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
+ }
+ }
+}
+if (Symbol.dispose) WasmStigmergy.prototype[Symbol.dispose] = WasmStigmergy.prototype.free;
+
+/**
+ * Sandboxed task executor
+ */
+export class WasmTaskExecutor {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ WasmTaskExecutorFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_wasmtaskexecutor_free(ptr, 0);
+ }
+ /**
+ * Set encryption key for payload decryption
+ * @param {Uint8Array} key
+ */
+ setTaskKey(key) {
+ const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.wasmtaskexecutor_setTaskKey(this.__wbg_ptr, ptr0, len0);
+ if (ret[1]) {
+ throw takeFromExternrefTable0(ret[0]);
+ }
+ }
+ /**
+ * Create a new task executor
+ * @param {number} max_memory
+ */
+ constructor(max_memory) {
+ const ret = wasm.wasmtaskexecutor_new(max_memory);
+ if (ret[2]) {
+ throw takeFromExternrefTable0(ret[1]);
+ }
+ this.__wbg_ptr = ret[0] >>> 0;
+ WasmTaskExecutorFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+}
+if (Symbol.dispose) WasmTaskExecutor.prototype[Symbol.dispose] = WasmTaskExecutor.prototype.free;
+
+/**
+ * Task queue for P2P distribution - optimized with priority heap
+ */
+export class WasmTaskQueue {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ WasmTaskQueueFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_wasmtaskqueue_free(ptr, 0);
+ }
+}
+if (Symbol.dispose) WasmTaskQueue.prototype[Symbol.dispose] = WasmTaskQueue.prototype.free;
+
+/**
+ * Work scheduler for distributing compute across frames
+ */
+export class WasmWorkScheduler {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ WasmWorkSchedulerFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_wasmworkscheduler_free(ptr, 0);
+ }
+ /**
+ * Calculate how many tasks to run this frame
+ * @param {number} throttle
+ * @returns {number}
+ */
+ tasksThisFrame(throttle) {
+ const ret = wasm.wasmworkscheduler_tasksThisFrame(this.__wbg_ptr, throttle);
+ return ret >>> 0;
+ }
+ /**
+ * Set pending task count
+ * @param {number} count
+ */
+ setPendingTasks(count) {
+ wasm.wasmworkscheduler_setPendingTasks(this.__wbg_ptr, count);
+ }
+ /**
+ * Record task completion for averaging
+ * @param {number} duration_ms
+ */
+ recordTaskDuration(duration_ms) {
+ wasm.wasmworkscheduler_recordTaskDuration(this.__wbg_ptr, duration_ms);
+ }
+ constructor() {
+ const ret = wasm.wasmworkscheduler_new();
+ this.__wbg_ptr = ret >>> 0;
+ WasmWorkSchedulerFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+}
+if (Symbol.dispose) WasmWorkScheduler.prototype[Symbol.dispose] = WasmWorkScheduler.prototype.free;
+
+/**
+ * Manages witness tracking for claims
+ */
+export class WitnessTracker {
+ __destroy_into_raw() {
+ const ptr = this.__wbg_ptr;
+ this.__wbg_ptr = 0;
+ WitnessTrackerFinalization.unregister(this);
+ return ptr;
+ }
+ free() {
+ const ptr = this.__destroy_into_raw();
+ wasm.__wbg_witnesstracker_free(ptr, 0);
+ }
+ /**
+ * Get witness count for a claim
+ * @param {string} claim_id
+ * @returns {number}
+ */
+ witnessCount(claim_id) {
+ const ptr0 = passStringToWasm0(claim_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.witnesstracker_witnessCount(this.__wbg_ptr, ptr0, len0);
+ return ret >>> 0;
+ }
+ /**
+ * Get confidence score based on witness diversity
+ * @param {string} claim_id
+ * @returns {number}
+ */
+ witnessConfidence(claim_id) {
+ const ptr0 = passStringToWasm0(claim_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.witnesstracker_witnessConfidence(this.__wbg_ptr, ptr0, len0);
+ return ret;
+ }
+ /**
+ * Check if claim has sufficient independent witnesses
+ * @param {string} claim_id
+ * @returns {boolean}
+ */
+ hasSufficientWitnesses(claim_id) {
+ const ptr0 = passStringToWasm0(claim_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len0 = WASM_VECTOR_LEN;
+ const ret = wasm.witnesstracker_hasSufficientWitnesses(this.__wbg_ptr, ptr0, len0);
+ return ret !== 0;
+ }
+ /**
+ * Create a new witness tracker
+ * @param {number} min_witnesses
+ */
+ constructor(min_witnesses) {
+ const ret = wasm.witnesstracker_new(min_witnesses);
+ this.__wbg_ptr = ret >>> 0;
+ WitnessTrackerFinalization.register(this, this.__wbg_ptr, this);
+ return this;
+ }
+}
+if (Symbol.dispose) WitnessTracker.prototype[Symbol.dispose] = WitnessTracker.prototype.free;
+
+/**
+ * Initialize panic hook for better error messages in console
+ */
+export function init_panic_hook() {
+ wasm.init_panic_hook();
+}
+
+const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
+
+async function __wbg_load(module, imports) {
+ if (typeof Response === 'function' && module instanceof Response) {
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
+ try {
+ return await WebAssembly.instantiateStreaming(module, imports);
+ } catch (e) {
+ const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
+
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
+ console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
+
+ } else {
+ throw e;
+ }
+ }
+ }
+
+ const bytes = await module.arrayBuffer();
+ return await WebAssembly.instantiate(bytes, imports);
+ } else {
+ const instance = await WebAssembly.instantiate(module, imports);
+
+ if (instance instanceof WebAssembly.Instance) {
+ return { instance, module };
+ } else {
+ return instance;
+ }
+ }
+}
+
+function __wbg_get_imports() {
+ const imports = {};
+ imports.wbg = {};
+ imports.wbg.__wbg_Error_52673b7de5a0ca89 = function(arg0, arg1) {
+ const ret = Error(getStringFromWasm0(arg0, arg1));
+ return ret;
+ };
+ imports.wbg.__wbg_Number_2d1dcfcf4ec51736 = function(arg0) {
+ const ret = Number(arg0);
+ return ret;
+ };
+ imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
+ const ret = String(arg1);
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len1 = WASM_VECTOR_LEN;
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
+ };
+ imports.wbg.__wbg___wbindgen_bigint_get_as_i64_6e32f5e6aff02e1d = function(arg0, arg1) {
+ const v = arg1;
+ const ret = typeof(v) === 'bigint' ? v : undefined;
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
+ };
+ imports.wbg.__wbg___wbindgen_boolean_get_dea25b33882b895b = function(arg0) {
+ const v = arg0;
+ const ret = typeof(v) === 'boolean' ? v : undefined;
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
+ };
+ imports.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6 = function(arg0, arg1) {
+ const ret = debugString(arg1);
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len1 = WASM_VECTOR_LEN;
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
+ };
+ imports.wbg.__wbg___wbindgen_in_0d3e1e8f0c669317 = function(arg0, arg1) {
+ const ret = arg0 in arg1;
+ return ret;
+ };
+ imports.wbg.__wbg___wbindgen_is_bigint_0e1a2e3f55cfae27 = function(arg0) {
+ const ret = typeof(arg0) === 'bigint';
+ return ret;
+ };
+ imports.wbg.__wbg___wbindgen_is_function_8d400b8b1af978cd = function(arg0) {
+ const ret = typeof(arg0) === 'function';
+ return ret;
+ };
+ imports.wbg.__wbg___wbindgen_is_object_ce774f3490692386 = function(arg0) {
+ const val = arg0;
+ const ret = typeof(val) === 'object' && val !== null;
+ return ret;
+ };
+ imports.wbg.__wbg___wbindgen_is_string_704ef9c8fc131030 = function(arg0) {
+ const ret = typeof(arg0) === 'string';
+ return ret;
+ };
+ imports.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269 = function(arg0) {
+ const ret = arg0 === undefined;
+ return ret;
+ };
+ imports.wbg.__wbg___wbindgen_jsval_eq_b6101cc9cef1fe36 = function(arg0, arg1) {
+ const ret = arg0 === arg1;
+ return ret;
+ };
+ imports.wbg.__wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d = function(arg0, arg1) {
+ const ret = arg0 == arg1;
+ return ret;
+ };
+ imports.wbg.__wbg___wbindgen_number_get_9619185a74197f95 = function(arg0, arg1) {
+ const obj = arg1;
+ const ret = typeof(obj) === 'number' ? obj : undefined;
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
+ };
+ imports.wbg.__wbg___wbindgen_string_get_a2a31e16edf96e42 = function(arg0, arg1) {
+ const obj = arg1;
+ const ret = typeof(obj) === 'string' ? obj : undefined;
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ var len1 = WASM_VECTOR_LEN;
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
+ };
+ imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
+ throw new Error(getStringFromWasm0(arg0, arg1));
+ };
+ imports.wbg.__wbg__wbg_cb_unref_87dfb5aaa0cbcea7 = function(arg0) {
+ arg0._wbg_cb_unref();
+ };
+ imports.wbg.__wbg_call_3020136f7a2d6e44 = function() { return handleError(function (arg0, arg1, arg2) {
+ const ret = arg0.call(arg1, arg2);
+ return ret;
+ }, arguments) };
+ imports.wbg.__wbg_call_abb4ff46ce38be40 = function() { return handleError(function (arg0, arg1) {
+ const ret = arg0.call(arg1);
+ return ret;
+ }, arguments) };
+ imports.wbg.__wbg_close_8158530fc398ee2f = function(arg0) {
+ arg0.close();
+ };
+ imports.wbg.__wbg_close_c956ddbf0426a990 = function(arg0) {
+ arg0.close();
+ };
+ imports.wbg.__wbg_crypto_574e78ad8b13b65f = function(arg0) {
+ const ret = arg0.crypto;
+ return ret;
+ };
+ imports.wbg.__wbg_data_8bf4ae669a78a688 = function(arg0) {
+ const ret = arg0.data;
+ return ret;
+ };
+ imports.wbg.__wbg_done_62ea16af4ce34b24 = function(arg0) {
+ const ret = arg0.done;
+ return ret;
+ };
+ imports.wbg.__wbg_entries_83c79938054e065f = function(arg0) {
+ const ret = Object.entries(arg0);
+ return ret;
+ };
+ imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
+ let deferred0_0;
+ let deferred0_1;
+ try {
+ deferred0_0 = arg0;
+ deferred0_1 = arg1;
+ console.error(getStringFromWasm0(arg0, arg1));
+ } finally {
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
+ }
+ };
+ imports.wbg.__wbg_getDate_b8071ea9fc4f6838 = function(arg0) {
+ const ret = arg0.getDate();
+ return ret;
+ };
+ imports.wbg.__wbg_getDay_c13a50561112f77a = function(arg0) {
+ const ret = arg0.getDay();
+ return ret;
+ };
+ imports.wbg.__wbg_getMonth_48a392071f9e5017 = function(arg0) {
+ const ret = arg0.getMonth();
+ return ret;
+ };
+ imports.wbg.__wbg_getRandomValues_9b655bdd369112f2 = function() { return handleError(function (arg0, arg1) {
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
+ }, arguments) };
+ imports.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e = function() { return handleError(function (arg0, arg1) {
+ arg0.getRandomValues(arg1);
+ }, arguments) };
+ imports.wbg.__wbg_getTimezoneOffset_45389e26d6f46823 = function(arg0) {
+ const ret = arg0.getTimezoneOffset();
+ return ret;
+ };
+ imports.wbg.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {
+ const ret = arg0[arg1 >>> 0];
+ return ret;
+ };
+ imports.wbg.__wbg_get_af9dab7e9603ea93 = function() { return handleError(function (arg0, arg1) {
+ const ret = Reflect.get(arg0, arg1);
+ return ret;
+ }, arguments) };
+ imports.wbg.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {
+ const ret = arg0[arg1];
+ return ret;
+ };
+ imports.wbg.__wbg_hardwareConcurrency_11023a850a093b20 = function(arg0) {
+ const ret = arg0.hardwareConcurrency;
+ return ret;
+ };
+ imports.wbg.__wbg_height_5405e57b18dddece = function() { return handleError(function (arg0) {
+ const ret = arg0.height;
+ return ret;
+ }, arguments) };
+ imports.wbg.__wbg_instanceof_ArrayBuffer_f3320d2419cd0355 = function(arg0) {
+ let result;
+ try {
+ result = arg0 instanceof ArrayBuffer;
+ } catch (_) {
+ result = false;
+ }
+ const ret = result;
+ return ret;
+ };
+ imports.wbg.__wbg_instanceof_Map_084be8da74364158 = function(arg0) {
+ let result;
+ try {
+ result = arg0 instanceof Map;
+ } catch (_) {
+ result = false;
+ }
+ const ret = result;
+ return ret;
+ };
+ imports.wbg.__wbg_instanceof_MessagePort_c6d647a8cffdd1a6 = function(arg0) {
+ let result;
+ try {
+ result = arg0 instanceof MessagePort;
+ } catch (_) {
+ result = false;
+ }
+ const ret = result;
+ return ret;
+ };
+ imports.wbg.__wbg_instanceof_Uint8Array_da54ccc9d3e09434 = function(arg0) {
+ let result;
+ try {
+ result = arg0 instanceof Uint8Array;
+ } catch (_) {
+ result = false;
+ }
+ const ret = result;
+ return ret;
+ };
+ imports.wbg.__wbg_instanceof_Window_b5cf7783caa68180 = function(arg0) {
+ let result;
+ try {
+ result = arg0 instanceof Window;
+ } catch (_) {
+ result = false;
+ }
+ const ret = result;
+ return ret;
+ };
+ imports.wbg.__wbg_isArray_51fd9e6422c0a395 = function(arg0) {
+ const ret = Array.isArray(arg0);
+ return ret;
+ };
+ imports.wbg.__wbg_isSafeInteger_ae7d3f054d55fa16 = function(arg0) {
+ const ret = Number.isSafeInteger(arg0);
+ return ret;
+ };
+ imports.wbg.__wbg_iterator_27b7c8b35ab3e86b = function() {
+ const ret = Symbol.iterator;
+ return ret;
+ };
+ imports.wbg.__wbg_language_763ea76470ed849b = function(arg0, arg1) {
+ const ret = arg1.language;
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ var len1 = WASM_VECTOR_LEN;
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
+ };
+ imports.wbg.__wbg_length_22ac23eaec9d8053 = function(arg0) {
+ const ret = arg0.length;
+ return ret;
+ };
+ imports.wbg.__wbg_length_d45040a40c570362 = function(arg0) {
+ const ret = arg0.length;
+ return ret;
+ };
+ imports.wbg.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
+ const ret = arg0.msCrypto;
+ return ret;
+ };
+ imports.wbg.__wbg_navigator_b49edef831236138 = function(arg0) {
+ const ret = arg0.navigator;
+ return ret;
+ };
+ imports.wbg.__wbg_new_0_23cedd11d9b40c9d = function() {
+ const ret = new Date();
+ return ret;
+ };
+ imports.wbg.__wbg_new_137453588c393c59 = function() { return handleError(function () {
+ const ret = new MessageChannel();
+ return ret;
+ }, arguments) };
+ imports.wbg.__wbg_new_1ba21ce319a06297 = function() {
+ const ret = new Object();
+ return ret;
+ };
+ imports.wbg.__wbg_new_25f239778d6112b9 = function() {
+ const ret = new Array();
+ return ret;
+ };
+ imports.wbg.__wbg_new_6421f6084cc5bc5a = function(arg0) {
+ const ret = new Uint8Array(arg0);
+ return ret;
+ };
+ imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
+ const ret = new Error();
+ return ret;
+ };
+ imports.wbg.__wbg_new_b2db8aa2650f793a = function(arg0) {
+ const ret = new Date(arg0);
+ return ret;
+ };
+ imports.wbg.__wbg_new_b3dd747604c3c93e = function() { return handleError(function (arg0, arg1) {
+ const ret = new BroadcastChannel(getStringFromWasm0(arg0, arg1));
+ return ret;
+ }, arguments) };
+ imports.wbg.__wbg_new_b546ae120718850e = function() {
+ const ret = new Map();
+ return ret;
+ };
+ imports.wbg.__wbg_new_ff12d2b041fb48f1 = function(arg0, arg1) {
+ try {
+ var state0 = {a: arg0, b: arg1};
+ var cb0 = (arg0, arg1) => {
+ const a = state0.a;
+ state0.a = 0;
+ try {
+ return wasm_bindgen__convert__closures_____invoke__h094c87b54a975e5a(a, state0.b, arg0, arg1);
+ } finally {
+ state0.a = a;
+ }
+ };
+ const ret = new Promise(cb0);
+ return ret;
+ } finally {
+ state0.a = state0.b = 0;
+ }
+ };
+ imports.wbg.__wbg_new_no_args_cb138f77cf6151ee = function(arg0, arg1) {
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
+ return ret;
+ };
+ imports.wbg.__wbg_new_with_length_aa5eaf41d35235e5 = function(arg0) {
+ const ret = new Uint8Array(arg0 >>> 0);
+ return ret;
+ };
+ imports.wbg.__wbg_next_138a17bbf04e926c = function(arg0) {
+ const ret = arg0.next;
+ return ret;
+ };
+ imports.wbg.__wbg_next_3cfe5c0fe2a4cc53 = function() { return handleError(function (arg0) {
+ const ret = arg0.next();
+ return ret;
+ }, arguments) };
+ imports.wbg.__wbg_node_905d3e251edff8a2 = function(arg0) {
+ const ret = arg0.node;
+ return ret;
+ };
+ imports.wbg.__wbg_now_69d776cd24f5215b = function() {
+ const ret = Date.now();
+ return ret;
+ };
+ imports.wbg.__wbg_platform_c9dd29375c0e6694 = function() { return handleError(function (arg0, arg1) {
+ const ret = arg1.platform;
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len1 = WASM_VECTOR_LEN;
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
+ }, arguments) };
+ imports.wbg.__wbg_port1_75dce9d0d8087125 = function(arg0) {
+ const ret = arg0.port1;
+ return ret;
+ };
+ imports.wbg.__wbg_port2_3cffa4119380f41d = function(arg0) {
+ const ret = arg0.port2;
+ return ret;
+ };
+ imports.wbg.__wbg_postMessage_79f844174f56304f = function() { return handleError(function (arg0, arg1) {
+ arg0.postMessage(arg1);
+ }, arguments) };
+ imports.wbg.__wbg_postMessage_e0309b53c7ad30e6 = function() { return handleError(function (arg0, arg1, arg2) {
+ arg0.postMessage(arg1, arg2);
+ }, arguments) };
+ imports.wbg.__wbg_postMessage_ee7b4e76cd1ed685 = function() { return handleError(function (arg0, arg1) {
+ arg0.postMessage(arg1);
+ }, arguments) };
+ imports.wbg.__wbg_process_dc0fbacc7c1c06f7 = function(arg0) {
+ const ret = arg0.process;
+ return ret;
+ };
+ imports.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
+ };
+ imports.wbg.__wbg_push_7d9be8f38fc13975 = function(arg0, arg1) {
+ const ret = arg0.push(arg1);
+ return ret;
+ };
+ imports.wbg.__wbg_queueMicrotask_9b549dfce8865860 = function(arg0) {
+ const ret = arg0.queueMicrotask;
+ return ret;
+ };
+ imports.wbg.__wbg_queueMicrotask_fca69f5bfad613a5 = function(arg0) {
+ queueMicrotask(arg0);
+ };
+ imports.wbg.__wbg_randomFillSync_ac0988aba3254290 = function() { return handleError(function (arg0, arg1) {
+ arg0.randomFillSync(arg1);
+ }, arguments) };
+ imports.wbg.__wbg_random_cc1f9237d866d212 = function() {
+ const ret = Math.random();
+ return ret;
+ };
+ imports.wbg.__wbg_require_60cc747a6bc5215a = function() { return handleError(function () {
+ const ret = module.require;
+ return ret;
+ }, arguments) };
+ imports.wbg.__wbg_resolve_fd5bfbaa4ce36e1e = function(arg0) {
+ const ret = Promise.resolve(arg0);
+ return ret;
+ };
+ imports.wbg.__wbg_screen_7c5162a9a6fa46ee = function() { return handleError(function (arg0) {
+ const ret = arg0.screen;
+ return ret;
+ }, arguments) };
+ imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
+ arg0[arg1] = arg2;
+ };
+ imports.wbg.__wbg_set_781438a03c0c3c81 = function() { return handleError(function (arg0, arg1, arg2) {
+ const ret = Reflect.set(arg0, arg1, arg2);
+ return ret;
+ }, arguments) };
+ imports.wbg.__wbg_set_7df433eea03a5c14 = function(arg0, arg1, arg2) {
+ arg0[arg1 >>> 0] = arg2;
+ };
+ imports.wbg.__wbg_set_efaaf145b9377369 = function(arg0, arg1, arg2) {
+ const ret = arg0.set(arg1, arg2);
+ return ret;
+ };
+ imports.wbg.__wbg_set_onmessage_6fa00f5d8f1c055a = function(arg0, arg1) {
+ arg0.onmessage = arg1;
+ };
+ imports.wbg.__wbg_set_onmessage_f0d5bf805190d1d8 = function(arg0, arg1) {
+ arg0.onmessage = arg1;
+ };
+ imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
+ const ret = arg1.stack;
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
+ const len1 = WASM_VECTOR_LEN;
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
+ };
+ imports.wbg.__wbg_start_dd05b3be5674e9f3 = function(arg0) {
+ arg0.start();
+ };
+ imports.wbg.__wbg_static_accessor_GLOBAL_769e6b65d6557335 = function() {
+ const ret = typeof global === 'undefined' ? null : global;
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
+ };
+ imports.wbg.__wbg_static_accessor_GLOBAL_THIS_60cf02db4de8e1c1 = function() {
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
+ };
+ imports.wbg.__wbg_static_accessor_SELF_08f5a74c69739274 = function() {
+ const ret = typeof self === 'undefined' ? null : self;
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
+ };
+ imports.wbg.__wbg_static_accessor_WINDOW_a8924b26aa92d024 = function() {
+ const ret = typeof window === 'undefined' ? null : window;
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
+ };
+ imports.wbg.__wbg_subarray_845f2f5bce7d061a = function(arg0, arg1, arg2) {
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
+ return ret;
+ };
+ imports.wbg.__wbg_then_4f95312d68691235 = function(arg0, arg1) {
+ const ret = arg0.then(arg1);
+ return ret;
+ };
+ imports.wbg.__wbg_value_57b7b035e117f7ee = function(arg0) {
+ const ret = arg0.value;
+ return ret;
+ };
+ imports.wbg.__wbg_versions_c01dfd4722a88165 = function(arg0) {
+ const ret = arg0.versions;
+ return ret;
+ };
+ imports.wbg.__wbg_width_b8c97f5d3a7f759c = function() { return handleError(function (arg0) {
+ const ret = arg0.width;
+ return ret;
+ }, arguments) };
+ imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
+ // Cast intrinsic for `Ref(String) -> Externref`.
+ const ret = getStringFromWasm0(arg0, arg1);
+ return ret;
+ };
+ imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
+ // Cast intrinsic for `U64 -> Externref`.
+ const ret = BigInt.asUintN(64, arg0);
+ return ret;
+ };
+ imports.wbg.__wbindgen_cast_46d6ccd6e2a13afa = function(arg0, arg1) {
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 1, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 2, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h16844f6554aa4052, wasm_bindgen__convert__closures_____invoke__h8c81ca6cba4eba00);
+ return ret;
+ };
+ imports.wbg.__wbindgen_cast_6ad6aa2864ac3163 = function(arg0, arg1) {
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 185, function: Function { arguments: [Externref], shim_idx: 186, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h5a0fd3a052925ed0, wasm_bindgen__convert__closures_____invoke__h9a454594a18d3e6f);
+ return ret;
+ };
+ imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
+ // Cast intrinsic for `I64 -> Externref`.
+ const ret = arg0;
+ return ret;
+ };
+ imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
+ // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
+ const ret = getArrayU8FromWasm0(arg0, arg1);
+ return ret;
+ };
+ imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
+ // Cast intrinsic for `F64 -> Externref`.
+ const ret = arg0;
+ return ret;
+ };
+ imports.wbg.__wbindgen_init_externref_table = function() {
+ const table = wasm.__wbindgen_externrefs;
+ const offset = table.grow(4);
+ table.set(0, undefined);
+ table.set(offset + 0, undefined);
+ table.set(offset + 1, null);
+ table.set(offset + 2, true);
+ table.set(offset + 3, false);
+ };
+
+ return imports;
+}
+
+function __wbg_finalize_init(instance, module) {
+ wasm = instance.exports;
+ __wbg_init.__wbindgen_wasm_module = module;
+ cachedDataViewMemory0 = null;
+ cachedFloat32ArrayMemory0 = null;
+ cachedUint8ArrayMemory0 = null;
+
+
+ wasm.__wbindgen_start();
+ return wasm;
+}
+
+function initSync(module) {
+ if (wasm !== undefined) return wasm;
+
+
+ if (typeof module !== 'undefined') {
+ if (Object.getPrototypeOf(module) === Object.prototype) {
+ ({module} = module)
+ } else {
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
+ }
+ }
+
+ const imports = __wbg_get_imports();
+ if (!(module instanceof WebAssembly.Module)) {
+ module = new WebAssembly.Module(module);
+ }
+ const instance = new WebAssembly.Instance(module, imports);
+ return __wbg_finalize_init(instance, module);
+}
+
+async function __wbg_init(module_or_path) {
+ if (wasm !== undefined) return wasm;
+
+
+ if (typeof module_or_path !== 'undefined') {
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
+ ({module_or_path} = module_or_path)
+ } else {
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
+ }
+ }
+
+ if (typeof module_or_path === 'undefined') {
+ module_or_path = new URL('ruvector_edge_net_bg.wasm', import.meta.url);
+ }
+ const imports = __wbg_get_imports();
+
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
+ module_or_path = fetch(module_or_path);
+ }
+
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
+
+ return __wbg_finalize_init(instance, module);
+}
+
+export { initSync };
+export default __wbg_init;
diff --git a/examples/edge-net/pkg/ruvector_edge_net_bg.wasm b/examples/edge-net/pkg/ruvector_edge_net_bg.wasm
new file mode 100644
index 00000000..60170c3e
Binary files /dev/null and b/examples/edge-net/pkg/ruvector_edge_net_bg.wasm differ
diff --git a/examples/edge-net/pkg/ruvector_edge_net_bg.wasm.d.ts b/examples/edge-net/pkg/ruvector_edge_net_bg.wasm.d.ts
new file mode 100644
index 00000000..786ee998
--- /dev/null
+++ b/examples/edge-net/pkg/ruvector_edge_net_bg.wasm.d.ts
@@ -0,0 +1,625 @@
+/* tslint:disable */
+/* eslint-disable */
+export const memory: WebAssembly.Memory;
+export const __wbg_adaptivesecurity_free: (a: number, b: number) => void;
+export const __wbg_adversarialsimulator_free: (a: number, b: number) => void;
+export const __wbg_auditlog_free: (a: number, b: number) => void;
+export const __wbg_browserfingerprint_free: (a: number, b: number) => void;
+export const __wbg_byzantinedetector_free: (a: number, b: number) => void;
+export const __wbg_coherenceengine_free: (a: number, b: number) => void;
+export const __wbg_collectivememory_free: (a: number, b: number) => void;
+export const __wbg_contributionstream_free: (a: number, b: number) => void;
+export const __wbg_differentialprivacy_free: (a: number, b: number) => void;
+export const __wbg_drifttracker_free: (a: number, b: number) => void;
+export const __wbg_economicengine_free: (a: number, b: number) => void;
+export const __wbg_economichealth_free: (a: number, b: number) => void;
+export const __wbg_edgenetconfig_free: (a: number, b: number) => void;
+export const __wbg_edgenetnode_free: (a: number, b: number) => void;
+export const __wbg_entropyconsensus_free: (a: number, b: number) => void;
+export const __wbg_eventlog_free: (a: number, b: number) => void;
+export const __wbg_evolutionengine_free: (a: number, b: number) => void;
+export const __wbg_federatedmodel_free: (a: number, b: number) => void;
+export const __wbg_foundingregistry_free: (a: number, b: number) => void;
+export const __wbg_genesiskey_free: (a: number, b: number) => void;
+export const __wbg_genesissunset_free: (a: number, b: number) => void;
+export const __wbg_get_economichealth_growth_rate: (a: number) => number;
+export const __wbg_get_economichealth_stability: (a: number) => number;
+export const __wbg_get_economichealth_utilization: (a: number) => number;
+export const __wbg_get_economichealth_velocity: (a: number) => number;
+export const __wbg_get_nodeconfig_bandwidth_limit: (a: number) => number;
+export const __wbg_get_nodeconfig_memory_limit: (a: number) => number;
+export const __wbg_get_nodeconfig_min_idle_time: (a: number) => number;
+export const __wbg_get_nodeconfig_respect_battery: (a: number) => number;
+export const __wbg_get_nodestats_celebration_boost: (a: number) => number;
+export const __wbg_get_nodestats_multiplier: (a: number) => number;
+export const __wbg_get_nodestats_reputation: (a: number) => number;
+export const __wbg_get_nodestats_ruv_earned: (a: number) => bigint;
+export const __wbg_get_nodestats_ruv_spent: (a: number) => bigint;
+export const __wbg_get_nodestats_tasks_completed: (a: number) => bigint;
+export const __wbg_get_nodestats_tasks_submitted: (a: number) => bigint;
+export const __wbg_get_nodestats_uptime_seconds: (a: number) => bigint;
+export const __wbg_gradientgossip_free: (a: number, b: number) => void;
+export const __wbg_modelconsensusmanager_free: (a: number, b: number) => void;
+export const __wbg_networkevents_free: (a: number, b: number) => void;
+export const __wbg_networklearning_free: (a: number, b: number) => void;
+export const __wbg_networktopology_free: (a: number, b: number) => void;
+export const __wbg_nodeconfig_free: (a: number, b: number) => void;
+export const __wbg_nodestats_free: (a: number, b: number) => void;
+export const __wbg_optimizationengine_free: (a: number, b: number) => void;
+export const __wbg_pikey_free: (a: number, b: number) => void;
+export const __wbg_qdagledger_free: (a: number, b: number) => void;
+export const __wbg_quarantinemanager_free: (a: number, b: number) => void;
+export const __wbg_raceconomicengine_free: (a: number, b: number) => void;
+export const __wbg_racsemanticrouter_free: (a: number, b: number) => void;
+export const __wbg_ratelimiter_free: (a: number, b: number) => void;
+export const __wbg_reasoningbank_free: (a: number, b: number) => void;
+export const __wbg_reputationmanager_free: (a: number, b: number) => void;
+export const __wbg_reputationsystem_free: (a: number, b: number) => void;
+export const __wbg_rewarddistribution_free: (a: number, b: number) => void;
+export const __wbg_rewardmanager_free: (a: number, b: number) => void;
+export const __wbg_semanticrouter_free: (a: number, b: number) => void;
+export const __wbg_sessionkey_free: (a: number, b: number) => void;
+export const __wbg_set_economichealth_growth_rate: (a: number, b: number) => void;
+export const __wbg_set_economichealth_stability: (a: number, b: number) => void;
+export const __wbg_set_economichealth_utilization: (a: number, b: number) => void;
+export const __wbg_set_economichealth_velocity: (a: number, b: number) => void;
+export const __wbg_set_nodeconfig_bandwidth_limit: (a: number, b: number) => void;
+export const __wbg_set_nodeconfig_memory_limit: (a: number, b: number) => void;
+export const __wbg_set_nodeconfig_min_idle_time: (a: number, b: number) => void;
+export const __wbg_set_nodeconfig_respect_battery: (a: number, b: number) => void;
+export const __wbg_set_nodestats_celebration_boost: (a: number, b: number) => void;
+export const __wbg_set_nodestats_multiplier: (a: number, b: number) => void;
+export const __wbg_set_nodestats_reputation: (a: number, b: number) => void;
+export const __wbg_set_nodestats_ruv_earned: (a: number, b: bigint) => void;
+export const __wbg_set_nodestats_ruv_spent: (a: number, b: bigint) => void;
+export const __wbg_set_nodestats_tasks_completed: (a: number, b: bigint) => void;
+export const __wbg_set_nodestats_tasks_submitted: (a: number, b: bigint) => void;
+export const __wbg_set_nodestats_uptime_seconds: (a: number, b: bigint) => void;
+export const __wbg_spikedrivenattention_free: (a: number, b: number) => void;
+export const __wbg_spotchecker_free: (a: number, b: number) => void;
+export const __wbg_stakemanager_free: (a: number, b: number) => void;
+export const __wbg_swarmintelligence_free: (a: number, b: number) => void;
+export const __wbg_sybildefense_free: (a: number, b: number) => void;
+export const __wbg_topksparsifier_free: (a: number, b: number) => void;
+export const __wbg_trajectorytracker_free: (a: number, b: number) => void;
+export const __wbg_wasmadapterpool_free: (a: number, b: number) => void;
+export const __wbg_wasmcapabilities_free: (a: number, b: number) => void;
+export const __wbg_wasmcreditledger_free: (a: number, b: number) => void;
+export const __wbg_wasmidledetector_free: (a: number, b: number) => void;
+export const __wbg_wasmmcpbroadcast_free: (a: number, b: number) => void;
+export const __wbg_wasmmcpserver_free: (a: number, b: number) => void;
+export const __wbg_wasmmcptransport_free: (a: number, b: number) => void;
+export const __wbg_wasmmcpworkerhandler_free: (a: number, b: number) => void;
+export const __wbg_wasmnetworkmanager_free: (a: number, b: number) => void;
+export const __wbg_wasmnodeidentity_free: (a: number, b: number) => void;
+export const __wbg_wasmstigmergy_free: (a: number, b: number) => void;
+export const __wbg_wasmtaskexecutor_free: (a: number, b: number) => void;
+export const __wbg_wasmtaskqueue_free: (a: number, b: number) => void;
+export const __wbg_witnesstracker_free: (a: number, b: number) => void;
+export const adaptivesecurity_chooseAction: (a: number, b: number, c: number, d: number, e: number) => [number, number];
+export const adaptivesecurity_detectAttack: (a: number, b: number, c: number) => number;
+export const adaptivesecurity_exportPatterns: (a: number) => [number, number, number, number];
+export const adaptivesecurity_getMinReputation: (a: number) => number;
+export const adaptivesecurity_getRateLimitMax: (a: number) => number;
+export const adaptivesecurity_getRateLimitWindow: (a: number) => bigint;
+export const adaptivesecurity_getSecurityLevel: (a: number) => number;
+export const adaptivesecurity_getSpotCheckProbability: (a: number) => number;
+export const adaptivesecurity_getStats: (a: number) => [number, number];
+export const adaptivesecurity_importPatterns: (a: number, b: number, c: number) => [number, number];
+export const adaptivesecurity_learn: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
+export const adaptivesecurity_new: () => number;
+export const adaptivesecurity_recordAttackPattern: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
+export const adaptivesecurity_updateNetworkHealth: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
+export const adversarialsimulator_enableChaosMode: (a: number, b: number) => void;
+export const adversarialsimulator_generateChaosEvent: (a: number) => [number, number];
+export const adversarialsimulator_getDefenceMetrics: (a: number) => [number, number];
+export const adversarialsimulator_getRecommendations: (a: number) => [number, number];
+export const adversarialsimulator_new: () => number;
+export const adversarialsimulator_runSecurityAudit: (a: number) => [number, number];
+export const adversarialsimulator_simulateByzantine: (a: number, b: number, c: number) => [number, number];
+export const adversarialsimulator_simulateDDoS: (a: number, b: number, c: bigint) => [number, number];
+export const adversarialsimulator_simulateDoubleSpend: (a: number, b: bigint, c: number) => [number, number];
+export const adversarialsimulator_simulateFreeRiding: (a: number, b: number, c: number) => [number, number];
+export const adversarialsimulator_simulateResultTampering: (a: number, b: number) => [number, number];
+export const adversarialsimulator_simulateSybil: (a: number, b: number, c: number) => [number, number];
+export const auditlog_exportEvents: (a: number) => [number, number];
+export const auditlog_getEventsBySeverity: (a: number, b: number) => number;
+export const auditlog_getEventsForNode: (a: number, b: number, c: number) => number;
+export const auditlog_log: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
+export const auditlog_new: () => number;
+export const browserfingerprint_generate: () => any;
+export const byzantinedetector_getMaxMagnitude: (a: number) => number;
+export const byzantinedetector_new: (a: number, b: number) => number;
+export const coherenceengine_canUseClaim: (a: number, b: number, c: number) => number;
+export const coherenceengine_conflictCount: (a: number) => number;
+export const coherenceengine_eventCount: (a: number) => number;
+export const coherenceengine_getDrift: (a: number, b: number, c: number) => number;
+export const coherenceengine_getMerkleRoot: (a: number) => [number, number];
+export const coherenceengine_getQuarantineLevel: (a: number, b: number, c: number) => number;
+export const coherenceengine_getStats: (a: number) => [number, number];
+export const coherenceengine_hasDrifted: (a: number, b: number, c: number) => number;
+export const coherenceengine_hasSufficientWitnesses: (a: number, b: number, c: number) => number;
+export const coherenceengine_new: () => number;
+export const coherenceengine_quarantinedCount: (a: number) => number;
+export const coherenceengine_witnessCount: (a: number, b: number, c: number) => number;
+export const collectivememory_consolidate: (a: number) => number;
+export const collectivememory_getStats: (a: number) => [number, number];
+export const collectivememory_hasPattern: (a: number, b: number, c: number) => number;
+export const collectivememory_new: (a: number, b: number) => number;
+export const collectivememory_patternCount: (a: number) => number;
+export const collectivememory_queueSize: (a: number) => number;
+export const collectivememory_search: (a: number, b: number, c: number, d: number) => [number, number];
+export const contributionstream_getTotalDistributed: (a: number) => bigint;
+export const contributionstream_isHealthy: (a: number) => number;
+export const contributionstream_new: () => number;
+export const contributionstream_processFees: (a: number, b: bigint, c: bigint) => bigint;
+export const differentialprivacy_getEpsilon: (a: number) => number;
+export const differentialprivacy_isEnabled: (a: number) => number;
+export const differentialprivacy_new: (a: number, b: number) => number;
+export const differentialprivacy_setEnabled: (a: number, b: number) => void;
+export const drifttracker_getDrift: (a: number, b: number, c: number) => number;
+export const drifttracker_getDriftedContexts: (a: number) => [number, number];
+export const drifttracker_hasDrifted: (a: number, b: number, c: number) => number;
+export const drifttracker_new: (a: number) => number;
+export const economicengine_advanceEpoch: (a: number) => void;
+export const economicengine_getHealth: (a: number) => number;
+export const economicengine_getProtocolFund: (a: number) => bigint;
+export const economicengine_getTreasury: (a: number) => bigint;
+export const economicengine_isSelfSustaining: (a: number, b: number, c: bigint) => number;
+export const economicengine_new: () => number;
+export const economicengine_processReward: (a: number, b: bigint, c: number) => number;
+export const edgenetconfig_addRelay: (a: number, b: number, c: number) => number;
+export const edgenetconfig_build: (a: number) => [number, number, number];
+export const edgenetconfig_cpuLimit: (a: number, b: number) => number;
+export const edgenetconfig_memoryLimit: (a: number, b: number) => number;
+export const edgenetconfig_minIdleTime: (a: number, b: number) => number;
+export const edgenetconfig_new: (a: number, b: number) => number;
+export const edgenetconfig_respectBattery: (a: number, b: number) => number;
+export const edgenetnode_canUseClaim: (a: number, b: number, c: number) => number;
+export const edgenetnode_checkEvents: (a: number) => [number, number];
+export const edgenetnode_creditBalance: (a: number) => bigint;
+export const edgenetnode_disconnect: (a: number) => [number, number];
+export const edgenetnode_enableBTSP: (a: number, b: number) => number;
+export const edgenetnode_enableHDC: (a: number) => number;
+export const edgenetnode_enableNAO: (a: number, b: number) => number;
+export const edgenetnode_getCapabilities: (a: number) => any;
+export const edgenetnode_getCapabilitiesSummary: (a: number) => any;
+export const edgenetnode_getClaimQuarantineLevel: (a: number, b: number, c: number) => number;
+export const edgenetnode_getCoherenceEventCount: (a: number) => number;
+export const edgenetnode_getCoherenceStats: (a: number) => [number, number];
+export const edgenetnode_getConflictCount: (a: number) => number;
+export const edgenetnode_getEconomicHealth: (a: number) => [number, number];
+export const edgenetnode_getEnergyEfficiency: (a: number, b: number, c: number) => number;
+export const edgenetnode_getFounderCount: (a: number) => number;
+export const edgenetnode_getLearningStats: (a: number) => [number, number];
+export const edgenetnode_getMerkleRoot: (a: number) => [number, number];
+export const edgenetnode_getMotivation: (a: number) => [number, number];
+export const edgenetnode_getMultiplier: (a: number) => number;
+export const edgenetnode_getNetworkFitness: (a: number) => number;
+export const edgenetnode_getOptimalPeers: (a: number, b: number) => [number, number];
+export const edgenetnode_getOptimizationStats: (a: number) => [number, number];
+export const edgenetnode_getPatternCount: (a: number) => number;
+export const edgenetnode_getProtocolFund: (a: number) => bigint;
+export const edgenetnode_getQuarantinedCount: (a: number) => number;
+export const edgenetnode_getRecommendedConfig: (a: number) => [number, number];
+export const edgenetnode_getStats: (a: number) => number;
+export const edgenetnode_getThemedStatus: (a: number, b: number) => [number, number];
+export const edgenetnode_getThrottle: (a: number) => number;
+export const edgenetnode_getTimeCrystalSync: (a: number) => number;
+export const edgenetnode_getTrajectoryCount: (a: number) => number;
+export const edgenetnode_getTreasury: (a: number) => bigint;
+export const edgenetnode_isIdle: (a: number) => number;
+export const edgenetnode_isSelfSustaining: (a: number, b: number, c: bigint) => number;
+export const edgenetnode_isStreamHealthy: (a: number) => number;
+export const edgenetnode_lookupPatterns: (a: number, b: number, c: number, d: number) => [number, number];
+export const edgenetnode_new: (a: number, b: number, c: number) => [number, number, number];
+export const edgenetnode_nodeId: (a: number) => [number, number];
+export const edgenetnode_pause: (a: number) => void;
+export const edgenetnode_processEpoch: (a: number) => void;
+export const edgenetnode_processNextTask: (a: number) => any;
+export const edgenetnode_proposeNAO: (a: number, b: number, c: number) => [number, number];
+export const edgenetnode_prunePatterns: (a: number, b: number, c: number) => number;
+export const edgenetnode_recordLearningTrajectory: (a: number, b: number, c: number) => number;
+export const edgenetnode_recordPeerInteraction: (a: number, b: number, c: number, d: number) => void;
+export const edgenetnode_recordPerformance: (a: number, b: number, c: number) => void;
+export const edgenetnode_recordTaskRouting: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number) => void;
+export const edgenetnode_resume: (a: number) => void;
+export const edgenetnode_runSecurityAudit: (a: number) => [number, number];
+export const edgenetnode_shouldReplicate: (a: number) => number;
+export const edgenetnode_start: (a: number) => [number, number];
+export const edgenetnode_stepCapabilities: (a: number, b: number) => void;
+export const edgenetnode_storePattern: (a: number, b: number, c: number) => number;
+export const edgenetnode_submitTask: (a: number, b: number, c: number, d: number, e: number, f: bigint) => any;
+export const edgenetnode_voteNAO: (a: number, b: number, c: number, d: number) => number;
+export const entropyconsensus_converged: (a: number) => number;
+export const entropyconsensus_entropy: (a: number) => number;
+export const entropyconsensus_finalize_beliefs: (a: number) => void;
+export const entropyconsensus_getBelief: (a: number, b: bigint) => number;
+export const entropyconsensus_getDecision: (a: number) => [number, bigint];
+export const entropyconsensus_getEntropyHistory: (a: number) => [number, number];
+export const entropyconsensus_getEntropyThreshold: (a: number) => number;
+export const entropyconsensus_getRounds: (a: number) => number;
+export const entropyconsensus_getStats: (a: number) => [number, number];
+export const entropyconsensus_getTemperature: (a: number) => number;
+export const entropyconsensus_hasTimedOut: (a: number) => number;
+export const entropyconsensus_new: () => number;
+export const entropyconsensus_optionCount: (a: number) => number;
+export const entropyconsensus_reset: (a: number) => void;
+export const entropyconsensus_setBelief: (a: number, b: bigint, c: number) => void;
+export const entropyconsensus_set_belief_raw: (a: number, b: bigint, c: number) => void;
+export const entropyconsensus_withThreshold: (a: number) => number;
+export const eventlog_getRoot: (a: number) => [number, number];
+export const eventlog_isEmpty: (a: number) => number;
+export const eventlog_len: (a: number) => number;
+export const eventlog_new: () => number;
+export const evolutionengine_evolve: (a: number) => void;
+export const evolutionengine_getNetworkFitness: (a: number) => number;
+export const evolutionengine_getRecommendedConfig: (a: number) => [number, number];
+export const evolutionengine_new: () => number;
+export const evolutionengine_recordPerformance: (a: number, b: number, c: number, d: number, e: number) => void;
+export const evolutionengine_shouldReplicate: (a: number, b: number, c: number) => number;
+export const federatedmodel_applyGradients: (a: number, b: number, c: number) => [number, number];
+export const federatedmodel_getDimension: (a: number) => number;
+export const federatedmodel_getParameters: (a: number) => [number, number];
+export const federatedmodel_getRound: (a: number) => bigint;
+export const federatedmodel_new: (a: number, b: number, c: number) => number;
+export const federatedmodel_setLearningRate: (a: number, b: number) => void;
+export const federatedmodel_setLocalEpochs: (a: number, b: number) => void;
+export const federatedmodel_setParameters: (a: number, b: number, c: number) => [number, number];
+export const foundingregistry_calculateVested: (a: number, b: bigint, c: bigint) => bigint;
+export const foundingregistry_getFounderCount: (a: number) => number;
+export const foundingregistry_new: () => number;
+export const foundingregistry_processEpoch: (a: number, b: bigint, c: bigint) => [number, number];
+export const foundingregistry_registerContributor: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
+export const genesiskey_create: (a: number, b: number) => [number, number, number];
+export const genesiskey_exportUltraCompact: (a: number) => [number, number];
+export const genesiskey_getEpoch: (a: number) => number;
+export const genesiskey_getIdHex: (a: number) => [number, number];
+export const genesiskey_verify: (a: number, b: number, c: number) => number;
+export const genesissunset_canRetire: (a: number) => number;
+export const genesissunset_getCurrentPhase: (a: number) => number;
+export const genesissunset_getStatus: (a: number) => [number, number];
+export const genesissunset_isReadOnly: (a: number) => number;
+export const genesissunset_new: () => number;
+export const genesissunset_registerGenesisNode: (a: number, b: number, c: number) => void;
+export const genesissunset_shouldAcceptConnections: (a: number) => number;
+export const genesissunset_updateNodeCount: (a: number, b: number) => number;
+export const gradientgossip_advanceRound: (a: number) => bigint;
+export const gradientgossip_configureDifferentialPrivacy: (a: number, b: number, c: number) => void;
+export const gradientgossip_getAggregatedGradients: (a: number) => [number, number];
+export const gradientgossip_getCompressionRatio: (a: number) => number;
+export const gradientgossip_getCurrentRound: (a: number) => bigint;
+export const gradientgossip_getDimension: (a: number) => number;
+export const gradientgossip_getStats: (a: number) => [number, number];
+export const gradientgossip_new: (a: number, b: number, c: number, d: number) => [number, number, number];
+export const gradientgossip_peerCount: (a: number) => number;
+export const gradientgossip_pruneStale: (a: number) => number;
+export const gradientgossip_setDPEnabled: (a: number, b: number) => void;
+export const gradientgossip_setLocalGradients: (a: number, b: number, c: number) => [number, number];
+export const gradientgossip_setModelHash: (a: number, b: number, c: number) => [number, number];
+export const init_panic_hook: () => void;
+export const modelconsensusmanager_disputeCount: (a: number) => number;
+export const modelconsensusmanager_getStats: (a: number) => [number, number];
+export const modelconsensusmanager_modelCount: (a: number) => number;
+export const modelconsensusmanager_new: (a: number) => number;
+export const modelconsensusmanager_quarantinedUpdateCount: (a: number) => number;
+export const multiheadattention_dim: (a: number) => number;
+export const multiheadattention_new: (a: number, b: number) => number;
+export const multiheadattention_numHeads: (a: number) => number;
+export const networkevents_checkActiveEvents: (a: number) => [number, number];
+export const networkevents_checkDiscovery: (a: number, b: number, c: number, d: number, e: number) => [number, number];
+export const networkevents_checkMilestones: (a: number, b: bigint, c: number, d: number) => [number, number];
+export const networkevents_getCelebrationBoost: (a: number) => number;
+export const networkevents_getMotivation: (a: number, b: bigint) => [number, number];
+export const networkevents_getSpecialArt: (a: number) => [number, number];
+export const networkevents_getThemedStatus: (a: number, b: number, c: bigint) => [number, number];
+export const networkevents_new: () => number;
+export const networkevents_setCurrentTime: (a: number, b: bigint) => void;
+export const networklearning_getEnergyRatio: (a: number, b: number, c: number) => number;
+export const networklearning_getStats: (a: number) => [number, number];
+export const networklearning_lookupPatterns: (a: number, b: number, c: number, d: number) => [number, number];
+export const networklearning_new: () => number;
+export const networklearning_patternCount: (a: number) => number;
+export const networklearning_prune: (a: number, b: number, c: number) => number;
+export const networklearning_recordTrajectory: (a: number, b: number, c: number) => number;
+export const networklearning_storePattern: (a: number, b: number, c: number) => number;
+export const networklearning_trajectoryCount: (a: number) => number;
+export const networktopology_getOptimalPeers: (a: number, b: number, c: number, d: number) => [number, number];
+export const networktopology_new: () => number;
+export const networktopology_registerNode: (a: number, b: number, c: number, d: number, e: number) => void;
+export const networktopology_updateConnection: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
+export const optimizationengine_getStats: (a: number) => [number, number];
+export const optimizationengine_new: () => number;
+export const optimizationengine_recordRouting: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number) => void;
+export const optimizationengine_selectOptimalNode: (a: number, b: number, c: number, d: number, e: number) => [number, number];
+export const pikey_createEncryptedBackup: (a: number, b: number, c: number) => [number, number, number, number];
+export const pikey_exportCompact: (a: number) => [number, number];
+export const pikey_generate: (a: number, b: number) => [number, number, number];
+export const pikey_getGenesisFingerprint: (a: number) => [number, number];
+export const pikey_getIdentity: (a: number) => [number, number];
+export const pikey_getIdentityHex: (a: number) => [number, number];
+export const pikey_getPublicKey: (a: number) => [number, number];
+export const pikey_getShortId: (a: number) => [number, number];
+export const pikey_getStats: (a: number) => [number, number];
+export const pikey_restoreFromBackup: (a: number, b: number, c: number, d: number) => [number, number, number];
+export const pikey_sign: (a: number, b: number, c: number) => [number, number];
+export const pikey_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
+export const pikey_verifyPiMagic: (a: number) => number;
+export const qdagledger_balance: (a: number, b: number, c: number) => bigint;
+export const qdagledger_createGenesis: (a: number, b: bigint, c: number, d: number) => [number, number, number, number];
+export const qdagledger_createTransaction: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number, h: number, i: number, j: number, k: number) => [number, number, number, number];
+export const qdagledger_exportState: (a: number) => [number, number, number, number];
+export const qdagledger_importState: (a: number, b: number, c: number) => [number, number, number];
+export const qdagledger_new: () => number;
+export const qdagledger_stakedAmount: (a: number, b: number, c: number) => bigint;
+export const qdagledger_tipCount: (a: number) => number;
+export const qdagledger_totalSupply: (a: number) => bigint;
+export const qdagledger_transactionCount: (a: number) => number;
+export const quarantinemanager_canUse: (a: number, b: number, c: number) => number;
+export const quarantinemanager_getLevel: (a: number, b: number, c: number) => number;
+export const quarantinemanager_new: () => number;
+export const quarantinemanager_quarantinedCount: (a: number) => number;
+export const quarantinemanager_setLevel: (a: number, b: number, c: number, d: number) => void;
+export const raceconomicengine_canParticipate: (a: number, b: number, c: number) => number;
+export const raceconomicengine_getCombinedScore: (a: number, b: number, c: number) => number;
+export const raceconomicengine_getSummary: (a: number) => [number, number];
+export const raceconomicengine_new: () => number;
+export const racsemanticrouter_new: () => number;
+export const racsemanticrouter_peerCount: (a: number) => number;
+export const ratelimiter_checkAllowed: (a: number, b: number, c: number) => number;
+export const ratelimiter_getCount: (a: number, b: number, c: number) => number;
+export const ratelimiter_new: (a: bigint, b: number) => number;
+export const ratelimiter_reset: (a: number) => void;
+export const reasoningbank_count: (a: number) => number;
+export const reasoningbank_getStats: (a: number) => [number, number];
+export const reasoningbank_lookup: (a: number, b: number, c: number, d: number) => [number, number];
+export const reasoningbank_new: () => number;
+export const reasoningbank_prune: (a: number, b: number, c: number) => number;
+export const reasoningbank_store: (a: number, b: number, c: number) => number;
+export const reputationmanager_averageReputation: (a: number) => number;
+export const reputationmanager_getReputation: (a: number, b: number, c: number) => number;
+export const reputationmanager_hasSufficientReputation: (a: number, b: number, c: number) => number;
+export const reputationmanager_new: (a: number, b: bigint) => number;
+export const reputationmanager_nodeCount: (a: number) => number;
+export const reputationsystem_canParticipate: (a: number, b: number, c: number) => number;
+export const reputationsystem_getReputation: (a: number, b: number, c: number) => number;
+export const reputationsystem_new: () => number;
+export const reputationsystem_recordFailure: (a: number, b: number, c: number) => void;
+export const reputationsystem_recordPenalty: (a: number, b: number, c: number, d: number) => void;
+export const reputationsystem_recordSuccess: (a: number, b: number, c: number) => void;
+export const rewardmanager_claimableAmount: (a: number, b: number, c: number) => bigint;
+export const rewardmanager_new: (a: bigint) => number;
+export const rewardmanager_pendingAmount: (a: number) => bigint;
+export const rewardmanager_pendingCount: (a: number) => number;
+export const semanticrouter_activePeerCount: (a: number) => number;
+export const semanticrouter_getStats: (a: number) => [number, number];
+export const semanticrouter_new: () => number;
+export const semanticrouter_peerCount: (a: number) => number;
+export const semanticrouter_setMyCapabilities: (a: number, b: number, c: number) => void;
+export const semanticrouter_setMyPeerId: (a: number, b: number, c: number) => void;
+export const semanticrouter_topicCount: (a: number) => number;
+export const semanticrouter_withParams: (a: number, b: number, c: number) => number;
+export const sessionkey_create: (a: number, b: number) => [number, number, number];
+export const sessionkey_decrypt: (a: number, b: number, c: number) => [number, number, number, number];
+export const sessionkey_encrypt: (a: number, b: number, c: number) => [number, number, number, number];
+export const sessionkey_getId: (a: number) => [number, number];
+export const sessionkey_getIdHex: (a: number) => [number, number];
+export const sessionkey_getParentIdentity: (a: number) => [number, number];
+export const sessionkey_isExpired: (a: number) => number;
+export const spikedrivenattention_energyRatio: (a: number, b: number, c: number) => number;
+export const spikedrivenattention_new: () => number;
+export const spikedrivenattention_withConfig: (a: number, b: number, c: number) => number;
+export const spotchecker_addChallenge: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
+export const spotchecker_getChallenge: (a: number, b: number, c: number) => [number, number];
+export const spotchecker_new: (a: number) => number;
+export const spotchecker_shouldCheck: (a: number) => number;
+export const spotchecker_verifyResponse: (a: number, b: number, c: number, d: number, e: number) => number;
+export const stakemanager_getMinStake: (a: number) => bigint;
+export const stakemanager_getStake: (a: number, b: number, c: number) => bigint;
+export const stakemanager_hasSufficientStake: (a: number, b: number, c: number) => number;
+export const stakemanager_new: (a: bigint) => number;
+export const stakemanager_stakerCount: (a: number) => number;
+export const stakemanager_totalStaked: (a: number) => bigint;
+export const swarmintelligence_addPattern: (a: number, b: number, c: number) => number;
+export const swarmintelligence_consolidate: (a: number) => number;
+export const swarmintelligence_getConsensusDecision: (a: number, b: number, c: number) => [number, bigint];
+export const swarmintelligence_getStats: (a: number) => [number, number];
+export const swarmintelligence_hasConsensus: (a: number, b: number, c: number) => number;
+export const swarmintelligence_negotiateBeliefs: (a: number, b: number, c: number, d: number, e: number) => number;
+export const swarmintelligence_new: (a: number, b: number) => number;
+export const swarmintelligence_nodeId: (a: number) => [number, number];
+export const swarmintelligence_patternCount: (a: number) => number;
+export const swarmintelligence_queueSize: (a: number) => number;
+export const swarmintelligence_replay: (a: number) => number;
+export const swarmintelligence_searchPatterns: (a: number, b: number, c: number, d: number) => [number, number];
+export const swarmintelligence_setBelief: (a: number, b: number, c: number, d: bigint, e: number) => void;
+export const swarmintelligence_startConsensus: (a: number, b: number, c: number, d: number) => void;
+export const sybildefense_getSybilScore: (a: number, b: number, c: number) => number;
+export const sybildefense_isSuspectedSybil: (a: number, b: number, c: number) => number;
+export const sybildefense_new: () => number;
+export const sybildefense_registerNode: (a: number, b: number, c: number, d: number, e: number) => number;
+export const topksparsifier_getCompressionRatio: (a: number) => number;
+export const topksparsifier_getErrorBufferSize: (a: number) => number;
+export const topksparsifier_new: (a: number) => number;
+export const topksparsifier_resetErrorFeedback: (a: number) => void;
+export const trajectorytracker_count: (a: number) => number;
+export const trajectorytracker_getStats: (a: number) => [number, number];
+export const trajectorytracker_new: (a: number) => number;
+export const trajectorytracker_record: (a: number, b: number, c: number) => number;
+export const wasmadapterpool_adapterCount: (a: number) => number;
+export const wasmadapterpool_exportAdapter: (a: number, b: number, c: number) => [number, number];
+export const wasmadapterpool_forward: (a: number, b: number, c: number, d: number, e: number) => [number, number];
+export const wasmadapterpool_getAdapter: (a: number, b: number, c: number) => any;
+export const wasmadapterpool_getStats: (a: number) => any;
+export const wasmadapterpool_importAdapter: (a: number, b: number, c: number, d: number, e: number) => number;
+export const wasmadapterpool_new: (a: number, b: number) => number;
+export const wasmadapterpool_routeToAdapter: (a: number, b: number, c: number) => any;
+export const wasmcapabilities_adaptMicroLoRA: (a: number, b: number, c: number, d: number, e: number) => number;
+export const wasmcapabilities_addNAOMember: (a: number, b: number, c: number, d: bigint) => number;
+export const wasmcapabilities_applyMicroLoRA: (a: number, b: number, c: number, d: number, e: number) => [number, number];
+export const wasmcapabilities_broadcastToWorkspace: (a: number, b: number, c: number, d: number, e: number) => number;
+export const wasmcapabilities_competeWTA: (a: number, b: number, c: number) => number;
+export const wasmcapabilities_differentiateMorphogenetic: (a: number) => void;
+export const wasmcapabilities_enableBTSP: (a: number, b: number, c: number) => number;
+export const wasmcapabilities_enableGlobalWorkspace: (a: number, b: number) => number;
+export const wasmcapabilities_enableHDC: (a: number) => number;
+export const wasmcapabilities_enableMicroLoRA: (a: number, b: number, c: number) => number;
+export const wasmcapabilities_enableNAO: (a: number, b: number) => number;
+export const wasmcapabilities_enableWTA: (a: number, b: number, c: number, d: number) => number;
+export const wasmcapabilities_executeNAO: (a: number, b: number, c: number) => number;
+export const wasmcapabilities_forwardBTSP: (a: number, b: number, c: number) => number;
+export const wasmcapabilities_getCapabilities: (a: number) => any;
+export const wasmcapabilities_getMorphogeneticCellCount: (a: number) => number;
+export const wasmcapabilities_getMorphogeneticStats: (a: number) => any;
+export const wasmcapabilities_getNAOSync: (a: number) => number;
+export const wasmcapabilities_getSummary: (a: number) => any;
+export const wasmcapabilities_growMorphogenetic: (a: number, b: number) => void;
+export const wasmcapabilities_new: (a: number, b: number) => number;
+export const wasmcapabilities_oneShotAssociate: (a: number, b: number, c: number, d: number) => number;
+export const wasmcapabilities_proposeNAO: (a: number, b: number, c: number) => [number, number];
+export const wasmcapabilities_retrieveHDC: (a: number, b: number, c: number, d: number) => any;
+export const wasmcapabilities_tickTimeCrystal: (a: number) => any;
+export const wasmcapabilities_voteNAO: (a: number, b: number, c: number, d: number) => number;
+export const wasmcreditledger_balance: (a: number) => bigint;
+export const wasmcreditledger_credit: (a: number, b: bigint, c: number, d: number) => [number, number];
+export const wasmcreditledger_currentMultiplier: (a: number) => number;
+export const wasmcreditledger_deduct: (a: number, b: bigint) => [number, number];
+export const wasmcreditledger_exportEarned: (a: number) => [number, number, number, number];
+export const wasmcreditledger_exportSpent: (a: number) => [number, number, number, number];
+export const wasmcreditledger_merge: (a: number, b: number, c: number, d: number, e: number) => [number, number];
+export const wasmcreditledger_networkCompute: (a: number) => number;
+export const wasmcreditledger_new: (a: number, b: number) => [number, number, number];
+export const wasmcreditledger_slash: (a: number, b: bigint) => [bigint, number, number];
+export const wasmcreditledger_stake: (a: number, b: bigint) => [number, number];
+export const wasmcreditledger_stakedAmount: (a: number) => bigint;
+export const wasmcreditledger_totalEarned: (a: number) => bigint;
+export const wasmcreditledger_totalSpent: (a: number) => bigint;
+export const wasmcreditledger_unstake: (a: number, b: bigint) => [number, number];
+export const wasmcreditledger_updateNetworkCompute: (a: number, b: number) => void;
+export const wasmidledetector_getStatus: (a: number) => any;
+export const wasmidledetector_getThrottle: (a: number) => number;
+export const wasmidledetector_isIdle: (a: number) => number;
+export const wasmidledetector_new: (a: number, b: number) => [number, number, number];
+export const wasmidledetector_pause: (a: number) => void;
+export const wasmidledetector_recordInteraction: (a: number) => void;
+export const wasmidledetector_resume: (a: number) => void;
+export const wasmidledetector_setBatteryStatus: (a: number, b: number) => void;
+export const wasmidledetector_shouldWork: (a: number) => number;
+export const wasmidledetector_start: (a: number) => [number, number];
+export const wasmidledetector_stop: (a: number) => void;
+export const wasmidledetector_updateFps: (a: number, b: number) => void;
+export const wasmmcpbroadcast_close: (a: number) => void;
+export const wasmmcpbroadcast_listen: (a: number) => [number, number];
+export const wasmmcpbroadcast_new: (a: number, b: number) => [number, number, number];
+export const wasmmcpbroadcast_send: (a: number, b: number, c: number) => [number, number];
+export const wasmmcpbroadcast_setServer: (a: number, b: number) => void;
+export const wasmmcpserver_getServerInfo: (a: number) => any;
+export const wasmmcpserver_handleRequest: (a: number, b: number, c: number) => any;
+export const wasmmcpserver_handleRequestJs: (a: number, b: any) => any;
+export const wasmmcpserver_initLearning: (a: number) => [number, number];
+export const wasmmcpserver_new: () => [number, number, number];
+export const wasmmcpserver_setIdentity: (a: number, b: number) => void;
+export const wasmmcpserver_withConfig: (a: any) => [number, number, number];
+export const wasmmcptransport_close: (a: number) => void;
+export const wasmmcptransport_fromPort: (a: any) => number;
+export const wasmmcptransport_init: (a: number) => [number, number];
+export const wasmmcptransport_new: (a: any) => [number, number, number];
+export const wasmmcptransport_send: (a: number, b: any) => any;
+export const wasmmcpworkerhandler_new: (a: number) => number;
+export const wasmmcpworkerhandler_start: (a: number) => [number, number];
+export const wasmnetworkmanager_activePeerCount: (a: number) => number;
+export const wasmnetworkmanager_addRelay: (a: number, b: number, c: number) => void;
+export const wasmnetworkmanager_getPeersWithCapability: (a: number, b: number, c: number) => [number, number];
+export const wasmnetworkmanager_isConnected: (a: number) => number;
+export const wasmnetworkmanager_new: (a: number, b: number) => number;
+export const wasmnetworkmanager_peerCount: (a: number) => number;
+export const wasmnetworkmanager_registerPeer: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: bigint) => void;
+export const wasmnetworkmanager_selectWorkers: (a: number, b: number, c: number, d: number) => [number, number];
+export const wasmnetworkmanager_updateReputation: (a: number, b: number, c: number, d: number) => void;
+export const wasmnodeidentity_exportSecretKey: (a: number, b: number, c: number) => [number, number, number, number];
+export const wasmnodeidentity_fromSecretKey: (a: number, b: number, c: number, d: number) => [number, number, number];
+export const wasmnodeidentity_generate: (a: number, b: number) => [number, number, number];
+export const wasmnodeidentity_getFingerprint: (a: number) => [number, number];
+export const wasmnodeidentity_importSecretKey: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
+export const wasmnodeidentity_nodeId: (a: number) => [number, number];
+export const wasmnodeidentity_publicKeyBytes: (a: number) => [number, number];
+export const wasmnodeidentity_publicKeyHex: (a: number) => [number, number];
+export const wasmnodeidentity_setFingerprint: (a: number, b: number, c: number) => void;
+export const wasmnodeidentity_sign: (a: number, b: number, c: number) => [number, number];
+export const wasmnodeidentity_siteId: (a: number) => [number, number];
+export const wasmnodeidentity_verify: (a: number, b: number, c: number, d: number, e: number) => number;
+export const wasmnodeidentity_verifyFrom: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
+export const wasmstigmergy_deposit: (a: number, b: number, c: number, d: number, e: number, f: number, g: bigint) => void;
+export const wasmstigmergy_depositWithOutcome: (a: number, b: number, c: number, d: number, e: number, f: number, g: bigint) => void;
+export const wasmstigmergy_evaporate: (a: number) => void;
+export const wasmstigmergy_exportState: (a: number) => [number, number];
+export const wasmstigmergy_follow: (a: number, b: number, c: number) => number;
+export const wasmstigmergy_getBestSpecialization: (a: number) => [number, number];
+export const wasmstigmergy_getIntensity: (a: number, b: number, c: number) => number;
+export const wasmstigmergy_getRankedTasks: (a: number) => [number, number];
+export const wasmstigmergy_getSpecialization: (a: number, b: number, c: number) => number;
+export const wasmstigmergy_getStats: (a: number) => [number, number];
+export const wasmstigmergy_getSuccessRate: (a: number, b: number, c: number) => number;
+export const wasmstigmergy_maybeEvaporate: (a: number) => number;
+export const wasmstigmergy_merge: (a: number, b: number, c: number) => number;
+export const wasmstigmergy_new: () => number;
+export const wasmstigmergy_setMinStake: (a: number, b: bigint) => void;
+export const wasmstigmergy_shouldAccept: (a: number, b: number, c: number) => number;
+export const wasmstigmergy_updateSpecialization: (a: number, b: number, c: number, d: number) => void;
+export const wasmstigmergy_withParams: (a: number, b: number, c: number) => number;
+export const wasmtaskexecutor_new: (a: number) => [number, number, number];
+export const wasmtaskexecutor_setTaskKey: (a: number, b: number, c: number) => [number, number];
+export const wasmworkscheduler_new: () => number;
+export const wasmworkscheduler_recordTaskDuration: (a: number, b: number) => void;
+export const wasmworkscheduler_setPendingTasks: (a: number, b: number) => void;
+export const wasmworkscheduler_tasksThisFrame: (a: number, b: number) => number;
+export const witnesstracker_hasSufficientWitnesses: (a: number, b: number, c: number) => number;
+export const witnesstracker_new: (a: number) => number;
+export const witnesstracker_witnessConfidence: (a: number, b: number, c: number) => number;
+export const witnesstracker_witnessCount: (a: number, b: number, c: number) => number;
+export const wasmcapabilities_getTimeCrystalSync: (a: number) => number;
+export const __wbg_set_nodeconfig_cpu_limit: (a: number, b: number) => void;
+export const __wbg_set_rewarddistribution_contributor_share: (a: number, b: bigint) => void;
+export const __wbg_set_rewarddistribution_founder_share: (a: number, b: bigint) => void;
+export const __wbg_set_rewarddistribution_protocol_share: (a: number, b: bigint) => void;
+export const __wbg_set_rewarddistribution_total: (a: number, b: bigint) => void;
+export const __wbg_set_rewarddistribution_treasury_share: (a: number, b: bigint) => void;
+export const genesissunset_isSelfSustaining: (a: number) => number;
+export const edgenetnode_ruvBalance: (a: number) => bigint;
+export const eventlog_totalEvents: (a: number) => number;
+export const edgenetnode_enableGlobalWorkspace: (a: number, b: number) => number;
+export const edgenetnode_enableMicroLoRA: (a: number, b: number) => number;
+export const edgenetnode_enableMorphogenetic: (a: number, b: number) => number;
+export const edgenetnode_enableTimeCrystal: (a: number, b: number) => number;
+export const edgenetnode_enableWTA: (a: number, b: number) => number;
+export const wasmcapabilities_pruneMorphogenetic: (a: number, b: number) => void;
+export const wasmcapabilities_step: (a: number, b: number) => void;
+export const wasmcapabilities_tickNAO: (a: number, b: number) => void;
+export const wasmcapabilities_getWorkspaceContents: (a: number) => any;
+export const wasmcapabilities_isTimeCrystalStable: (a: number) => number;
+export const wasmcapabilities_storeHDC: (a: number, b: number, c: number) => number;
+export const wasmcapabilities_enableMorphogenetic: (a: number, b: number, c: number) => number;
+export const wasmcapabilities_enableTimeCrystal: (a: number, b: number, c: number) => number;
+export const __wbg_get_nodeconfig_cpu_limit: (a: number) => number;
+export const __wbg_get_rewarddistribution_contributor_share: (a: number) => bigint;
+export const __wbg_get_rewarddistribution_founder_share: (a: number) => bigint;
+export const __wbg_get_rewarddistribution_protocol_share: (a: number) => bigint;
+export const __wbg_get_rewarddistribution_total: (a: number) => bigint;
+export const __wbg_get_rewarddistribution_treasury_share: (a: number) => bigint;
+export const __wbg_wasmworkscheduler_free: (a: number, b: number) => void;
+export const __wbg_multiheadattention_free: (a: number, b: number) => void;
+export const genesiskey_getId: (a: number) => [number, number];
+export const wasm_bindgen__convert__closures_____invoke__h8c81ca6cba4eba00: (a: number, b: number, c: any) => void;
+export const wasm_bindgen__closure__destroy__h16844f6554aa4052: (a: number, b: number) => void;
+export const wasm_bindgen__convert__closures_____invoke__h9a454594a18d3e6f: (a: number, b: number, c: any) => void;
+export const wasm_bindgen__closure__destroy__h5a0fd3a052925ed0: (a: number, b: number) => void;
+export const wasm_bindgen__convert__closures_____invoke__h094c87b54a975e5a: (a: number, b: number, c: any, d: any) => void;
+export const __wbindgen_malloc: (a: number, b: number) => number;
+export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
+export const __wbindgen_exn_store: (a: number) => void;
+export const __externref_table_alloc: () => number;
+export const __wbindgen_externrefs: WebAssembly.Table;
+export const __wbindgen_free: (a: number, b: number, c: number) => void;
+export const __externref_table_dealloc: (a: number) => void;
+export const __externref_drop_slice: (a: number, b: number) => void;
+export const __wbindgen_start: () => void;
diff --git a/examples/edge-net/src/rac/economics.rs b/examples/edge-net/src/rac/economics.rs
index 9193163f..fdfa1a34 100644
--- a/examples/edge-net/src/rac/economics.rs
+++ b/examples/edge-net/src/rac/economics.rs
@@ -670,17 +670,17 @@ impl RewardManager {
// Combined Economic Engine
// ============================================================================
-/// Combined economic engine managing stakes, reputation, and rewards
-#[wasm_bindgen]
-pub struct EconomicEngine {
+/// RAC-specific combined economic engine managing stakes, reputation, and rewards
+#[wasm_bindgen(js_name = RacEconomicEngine)]
+pub struct RacEconomicEngine {
stakes: StakeManager,
reputation: ReputationManager,
rewards: RewardManager,
}
#[wasm_bindgen]
-impl EconomicEngine {
- /// Create a new economic engine
+impl RacEconomicEngine {
+ /// Create a new RAC economic engine
#[wasm_bindgen(constructor)]
pub fn new() -> Self {
Self {
@@ -722,13 +722,13 @@ impl EconomicEngine {
}
}
-impl Default for EconomicEngine {
+impl Default for RacEconomicEngine {
fn default() -> Self {
Self::new()
}
}
-impl EconomicEngine {
+impl RacEconomicEngine {
/// Record a successful task with economic effects
pub fn record_task_success(&self, node_id: &PublicKeyBytes, task_id: EventId, reward_amount: u64) {
self.reputation.record_success(node_id, 1.0);
@@ -830,7 +830,7 @@ mod tests {
#[test]
fn test_economic_engine() {
- let engine = EconomicEngine::new();
+ let engine = RacEconomicEngine::new();
let node_id = [1u8; 32];
diff --git a/examples/edge-net/src/rac/mod.rs b/examples/edge-net/src/rac/mod.rs
index 0855a297..8929f5d7 100644
--- a/examples/edge-net/src/rac/mod.rs
+++ b/examples/edge-net/src/rac/mod.rs
@@ -61,7 +61,7 @@ use sha2::{Sha256, Digest};
// Economic layer with staking, reputation, and rewards
pub mod economics;
pub use economics::{
- EconomicEngine, StakeManager, ReputationManager, RewardManager,
+ RacEconomicEngine, StakeManager, ReputationManager, RewardManager,
SlashReason, StakeRecord, ReputationRecord, RewardRecord,
};
@@ -1705,9 +1705,9 @@ pub struct PeerRoute {
pub latency_ms: u32,
}
-/// Semantic gossip router for event propagation
-#[wasm_bindgen]
-pub struct SemanticRouter {
+/// RAC-specific semantic gossip router for event propagation
+#[wasm_bindgen(js_name = RacSemanticRouter)]
+pub struct RacSemanticRouter {
/// Known peers
peers: RwLock>,
/// Random peer sample size
@@ -1717,7 +1717,7 @@ pub struct SemanticRouter {
}
#[wasm_bindgen]
-impl SemanticRouter {
+impl RacSemanticRouter {
/// Create a new semantic router
#[wasm_bindgen(constructor)]
pub fn new() -> Self {
@@ -1735,13 +1735,13 @@ impl SemanticRouter {
}
}
-impl Default for SemanticRouter {
+impl Default for RacSemanticRouter {
fn default() -> Self {
Self::new()
}
}
-impl SemanticRouter {
+impl RacSemanticRouter {
/// Register a peer
pub fn register_peer(&self, peer_id: PublicKeyBytes, centroid: Ruvector, latency_ms: u32) {
let mut peers = self.peers.write().unwrap();
@@ -2677,7 +2677,7 @@ mod tests {
#[test]
fn test_semantic_router() {
- let router = SemanticRouter::new();
+ let router = RacSemanticRouter::new();
router.register_peer([1u8; 32], Ruvector::new(vec![1.0, 0.0, 0.0]), 50);
router.register_peer([2u8; 32], Ruvector::new(vec![0.0, 1.0, 0.0]), 100);