ruvector/examples/delta-behavior/wasm/package.json
rUv 6886e727d2 feat(delta-behavior): Complete Δ-behavior implementation with WASM
Implements the full delta-behavior framework - systems where change is
permitted but collapse is not.

## Core Implementation
- Coherence type with [0,1] bounds and safe constructors
- Three-layer enforcement: energy cost, scheduling, memory gating
- DeltaSystem trait for coherence-preserving systems
- DeltaConfig with strict/relaxed/default presets

## 11 Exotic Applications
1. Self-Limiting Reasoning - AI that does less when uncertain
2. Computational Event Horizon - bounded computation without hard limits
3. Artificial Homeostasis - synthetic life with coherence-based survival
4. Self-Stabilizing World Model - models that refuse to hallucinate
5. Coherence-Bounded Creativity - novelty without chaos
6. Anti-Cascade Financial System - markets that cannot collapse
7. Graceful Aging - systems that simplify over time
8. Swarm Intelligence - collective behavior without pathology
9. Graceful Shutdown - systems that seek safe termination
10. Pre-AGI Containment - bounded intelligence growth
11. Extropic Substrate - goal mutation, agent lifecycles, spike semantics

## Performance Optimizations
- O(n²) → O(n·k) swarm neighbor detection via SpatialGrid
- O(n) → O(1) coherence calculation with incremental cache
- VecDeque for O(1) history removal
- SIMD utilities with 8x loop unrolling
- Bounded history to prevent memory leaks

## Security Fixes
- Replaced unsafe static mut with AtomicU64 for thread-safe RNG
- NaN validation on all coherence inputs
- Overflow protection in calculations

## WASM + TypeScript SDK
- Full wasm-bindgen exports for all 11 applications
- High-level TypeScript SDK with ergonomic APIs
- Browser and Node.js examples

## Test Coverage
- 32 lib tests, 14 WASM tests, 13 doc tests (59 total)

Resolves #140

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 04:18:34 +00:00

84 lines
2.4 KiB
JSON

{
"name": "@ruvector/delta-behavior",
"version": "0.1.0",
"description": "Delta-Behavior: TypeScript/JavaScript SDK for coherence-preserving state transitions and self-limiting AI systems",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs"
},
"./types": {
"types": "./dist/types.d.ts",
"import": "./dist/types.js"
},
"./wasm": {
"import": "./pkg/delta_behavior.js",
"types": "./pkg/delta_behavior.d.ts"
}
},
"files": [
"dist/",
"pkg/",
"README.md"
],
"repository": {
"type": "git",
"url": "https://github.com/ruvnet/ruvector.git",
"directory": "examples/delta-behavior/wasm"
},
"keywords": [
"wasm",
"webassembly",
"rust",
"ai-safety",
"coherence",
"state-machine",
"containment",
"homeostasis",
"delta-behavior",
"self-limiting",
"attractors",
"swarm-intelligence"
],
"author": "RuVector Team",
"license": "MIT OR Apache-2.0",
"bugs": {
"url": "https://github.com/ruvnet/ruvector/issues"
},
"homepage": "https://github.com/ruvnet/ruvector/tree/main/examples/delta-behavior#readme",
"scripts": {
"build": "tsup src/index.ts src/types.ts --format esm,cjs --dts --clean",
"build:wasm": "cd .. && wasm-pack build --target web --release --out-dir wasm/pkg .",
"build:wasm:dev": "cd .. && wasm-pack build --target web --dev --out-dir wasm/pkg .",
"build:wasm:nodejs": "cd .. && wasm-pack build --target nodejs --out-dir wasm/pkg-node .",
"build:all": "npm run build:wasm && npm run build",
"dev": "tsup src/index.ts src/types.ts --format esm,cjs --dts --watch",
"test": "vitest",
"test:run": "vitest run",
"test:wasm": "wasm-pack test --node ..",
"typecheck": "tsc --noEmit",
"lint": "eslint src --ext .ts",
"format": "prettier --write 'src/**/*.ts'",
"example:node": "tsx examples/node-example.ts",
"clean": "rm -rf dist pkg pkg-node",
"prepublishOnly": "npm run build:all"
},
"devDependencies": {
"@types/node": "^20.10.0",
"eslint": "^8.55.0",
"prettier": "^3.1.0",
"tsup": "^8.0.1",
"tsx": "^4.6.2",
"typescript": "^5.3.2",
"vitest": "^1.0.4"
},
"engines": {
"node": ">=18.0.0"
},
"sideEffects": false
}