Mist Solution API Documentation
Core Modules Overview
Each function is annotated with its source module and primary purpose. Functions are grouped by module and functionality.
## MistIllum.js (Visualization and Metric Tensors)
class MetricTensorND {
constructor(rank: number, data: number[][])
intervalSquared(p1: vec[], p2: vec[]): number // Calculate squared interval
project(vec: vec[], targetRank: number): vec[] // Project to lower dimension
transform(vec: vec[]): vec[] // Apply metric transformation
}
### Asset Management
```typescript
createShaderModule(device: VkDevice, assetId: string, db: Connection): Promise<VkShaderModule>
loadAsset(assetId: string, db: Connection): Promise<Asset>
ensureAssetsTables(db: Connection): Promise<void>
generateAssetId(): string
### Security and Moderation
```typescript
cullObject(obj: Object): void // Remove object from scene/model
deleteUser(userId: string): void // Remove user and cleanup
rateLimitWarn(userId: string): void // Rate limit warningPhysics Core)
### Physics Engine
```typescript
class MistPhysicsEngineND {
// Core nD physics engine with quantum mechanics support
constructor(config: { mode: string, metric: MetricTensorND })
setMode(mode: string): void // Set physics engine mode (3D/4D/nD)
distance(p1: vec[], p2: vec[]): number // Calculate distance using appropriate metric
gravityAt(p: vec[], mass?: number): number // Calculate gravity at point
bellTheorem(a,b,c,d: number): boolean // Bell's theorem validation
pilotWave(psi: number, potential: number): number // Pilot wave calculations
locality(p1: vec[], p2: vec[]): boolean // Check spatial locality
lightWave(source: vec[], obj1: vec[], obj2: vec[]): {time1: number, time2: number}
eulerLagrange(L: Function, q: vec[], qDot: vec[]): vec[] // Euler-Lagrange equations
particleWaveDuality(particle: Object, wave: Object): Object // Particle-wave modeling
}
endSession // End current session, persist state to database, cleanup resources
onExit // Handle unexpected termination, save state, trigger user presence update
captureViewport // Capture viewport state and persist to database with timestamps
saveSessionPath // Save user navigation path with provenance metadata
saveCurrentState // Save current UI and rendering state for session persistence
MapModeState // Class for 3D/nD navigation state, with metric tensor support
SelectionModeState // Tracks selection steps (time/category/item) with input handling
Milestone // Class for tracking precision and mode enablement progression
MilestoneManager // Manages milestone-based feature unlocks and tensor metricsion and State Management (MistTrackerVulkan.js) ---
startSession // Initialize a new user session, set up session variables and state (user, time, etc.)
endSession // End the current session, persist state to database
onExit // Handle unexpected session termination (e.g., window close), persist state
priorState // Load previous state from persistent storage (e.g., mySQL)
nextState // Load next state from persistent storage (e.g., mySQL)
captureViewport // Capture current viewport state and persist to database
persistUpdate // Save current rendered items (not full user path) to persistent storage
userPath // Save user navigation path for session tracking
MapModeState // Class for 3D navigation state
SelectionModeState // Tracks selection step and indices for time/category/item
// --- Data Model and CRUD Operations (MistTrackerVulkan.js) ---
createPrimaryLine // Initialize the primary (time) line in the database
addCategoryLine // Add a category line at a specific time index
addItemLine // Add an item line for a category
loadPrimaryLine // Load primary line (time indexes) from database, generate if missing
loadCategoriesForTime // Load categories for a given time index from database, generate if missing
loadItemsForCategory // Load items for a given category from database
addTimeIndex // Add a new time index to the primary line
addCategory // Add a new category for a given time index
addItem // Add a new item for a given category
addCharacterLocation // Add a character's location at a specific time
getCharacterLocationsByTime // Get all character locations for a given time
getCharacterLocation // Get a character's location at a specific time
resetMistModel // Reset the in-memory MistModel to its initial state
addUserToMistModel // Add a user to MistModel
findUserInMistModel // Find a user in MistModel by accountId
// --- Data Integrity and Utilities (MistTrackerVulkan.js, MistMulti.js) ---
ensureMistDatabase // Create/verify MySQL schemas and tables with proper constraints
updateMistData // Update from local files (replaces Google Drive integration)
ensureCharacterLocationsTable // Create/verify character location tracking table
loadMistUser // Load/create user with proper account management
getMistDataSheets // Get data schema table references with proper access checks
getMistSheets // Get main schema table references with security context
getMistDataTables // Get required table references with integrity validation
getMistTables // Get core table references with transaction support
loadWordDefinition // Load and validate word definitions with metadata
flushUserData // Remove user data with proper cascading/cleanup
banInteraction // Ban interaction with swarm notification
checkAndSyncEvent // Validate events with peer consensus
grimReaper // Monitor tensor inputs for anomalies
createProvenance // Attach metadata to all user actions
eventHorizonUser // Ban user and flush all Mist data from host
isInteractionBanned // Check if an interaction is banned for a user
hashInteraction // Hash an event for moderation
createProvenance // Attach provenance to user actions/events
// --- Viewport and UI Logic (MistCore.js, MistIllum.js) ---
getMistViewportData // Provide structured data for the UI (lines, categories, items)
advanceSelectionMode // Advance selection mode state based on user input
getViewportCentering // Compute viewport centering offsets for UI
isItemVisible // Check if an item is visible in the current session
handleSelectionBackend // Handle selection logic in memory, update session state
initViewport // Initialize the viewport with current state and user input
renderViewport // Render the viewport using current state and visible items
selectTimeIndex // Select a time index from the primary line
selectCategory // Select a category from the categories for the selected time index
selectItem // Select an item from the items for the selected category
showAddTimeInput // Show input for adding a new time index
showAddCategoryInput // Show input for adding a new category
showAddItemInput // Show input for adding a new item
showInputBox // Show generic input box for user input
handleSelection // Handle user selection, update session state, and persist as needed
calculateLineOrientation // Compute orientation of lines for nD arrangement
getLineTransformationMatrix // For Vulkan/OpenGL rendering
projectItemsTo3D // Map items and locations to 3D for map mode
getMapModeProjection // Get 3D projection for map mode
// --- Audio and Input Management (MistIllum.js, MistTrackerVulkan.js) ---
audioQueue // Queue sounds with wave/geometric modulation
volumeGlobal // Set master volume with wave modulation
volumeAmbient // Set ambient audio with spatial/temporal waves
volumeInteract // Set interaction volume with interference patterns
volumeDialogue // Set dialogue volume with distance/envelope
mapKeybinds // Configure X11 input bindings
handleInput // Process X11 events with dispatch
getUserKeybind // Get the current keybind for an action
setUserKeybind // Set a keybind for a specific action
resetUserKeybinds // Reset all user keybinds to default
userKeybinds // Current user keybinds mapping
// --- Advanced Rendering and Navigation (MistIllum.js, MistTrackerVulkan.js) ---
hourGlass // Compute nD orthogonal vectors for line arrangement
enableRelativeNavigation // Enable input-based navigation along any line, relative to parent/plane
cullVisible // Only show items/lines opened by the user in the current session
gramSchmidt // Orthonormalize vectors for nD arrangement
projectItemsTo3D // Project items and locations to 3D for map mode
getMapModeProjection // Get 3D projection for map mode
storyWriter // Parse and extract structured data from story files (RTF or plain text)
mapRead // Requirements block for mapReader
mapReader // Map reader for image-based location extraction
// --- Lighting, Rendering, and Physics (MistIllum.js) ---
LightSource // Class for all light sources (point, directional, ambient, etc.)
globalIllumination // Wave-based global illumination using interference and metric tensors
fastTransform // Fourier transform for ray/wave analysis (DFT/FFT)
worldWarp // Transform 3D projected volume to different geometries (plane, sphere, torus, etc.)
wireFrames // Generate wireframe mesh for items using metric tensor
rastRenderMap // Rasterize wireframes and combine with texture/wave-based shading
waveFunction // Core wave function: psi = A * exp(i(kx - wt)), used for light/sound
interferencePattern // Calculate interference pattern for wave-based rendering and audio
applyInterference // Apply interference pattern to objects (modulate intensity, color, etc.)
createVoxelObject // Create a voxel-based 3D object
updateDistanceFromObserver // Update object's distance from observer
computeAngularMomentumMap // Compute angular momentum map for object
isEdgeVoxel // Determine if a voxel is on the edge of an object
interactObjects // Cause interaction between objects using tensors
spawnObjectNearPlayer // Spawn a new object near the player
// --- Audio and Soundscape (MistIllum.js) ---
audioQueue // Queue a sound file for playback, modulated by wave/geometric logic
volumeGlobal // Set global volume, optionally modulated by wave envelope
volumeAmbient // Set ambient sound volume, modulated by spatial/temporal wave logic
volumeInteract // Set volume for object interaction sounds, modulated by proximity/interference
volumeDialogue // Set volume for character dialogue, modulated by distance and wave envelope
// --- Settings and UI (MistIllum.js) ---
settingsMenu // Display and manage the settings menu, including audio/wave/geometric parameters
mistFirstStart // Display title, credits, and disclaimers for Mist modules
mistSetup // Setup/check dependencies for MistTracker, MistMulti, and MistIllum
mistDepend // Check user system for software/hardware dependencies
mistWarn // Display a warning message to the user
warnTypes // Enum/class for warning types
mistMenu // Display a menu overlay for the Mist solution
// --- Menu and Environment Interaction (MistIllum.js) ---
MistMenuControl // Menu control logic using viewport functions and 3D/nD mode switching
handleUserInput // Route input to menu or environment logic
handleMenuInput // Handle input for menu objects
handleEnvironmentInput // Handle input for environment (scene/world) objects
getAvailableModes // Returns available projection/render modes based on milestones
showModeSelectionMenu // UI for selecting modes, only if milestones are met
trySwitchMode // Attempt to switch mode, only if milestone is achieved
trySwitchModes // Alternate signature for mode switching
getMenuOptionsWithMilestones // Get menu options for all milestone-enabled modes
// --- Multi-User, P2P, and Real-Time Collaboration (MistMulti.js) ---
addUserSession // Add or update a user session in memory
removeUserSession // Remove a user session from memory
updateUserPresence // Update user's lastSeen and state in memory
announceHostSession // Announce host's public key/session info to DHT
discoverHostSession // Discover host's session by searching DHT
generateSessionToken // Generate a secure random session token
signMessage // Sign a message using user's private key
verifyMessage // Verify a message signature using sender's public key
onEvent // Register an event handler for a specific event type
emitEvent // Emit an event to all handlers and broadcast to peers
broadcastToPeers // Use P2P transport to send messages to all connected peers
syncStateWithPeer // Send local state to peer, receive remote state, and merge
encryptMessage // Encrypt message using recipient's public key (ECC/AES)
decryptMessage // Decrypt message using own private key (ECC/AES) *WIP*
canSendMessage // Rate limiting for outgoing messages per user
mergeState // Merge local and remote session state, resolving conflicts
encodeMessageFEC // Encode message with Reed-Solomon FEC for reliability
decodeMessageFEC // Decode message with Reed-Solomon FEC
sendReliableMessageToPeers // Send message shards to peers using FEC
onFECShardMessage // Handle incoming FEC_SHARD messages and reconstruct original message
grimReaper // Track database tensor inputs for moderation
// --- Physics Engine and Metric Tensor (MistIllum.js) ---
MistPhysicsEngine // Physics engine for menu/navigation logic
MistPhysicsEngineND // Physics engine for 3D/4D/nD world interactions and simulation
MetricTensor // General nD metric tensor for distance, projection, transformation
MetricTensor3D // 3D-only metric tensor for spatial calculations
MetricTensorND // nD metric tensor for advanced physics
// --- Dimensional and Extra-Dimensional Utilities (MistIllum.js) ---
dimensionalStack // Stack objects/spaces in higher dimensions
perspectiveTransform // Calculate apparent distance/size from different dimensional perspectives
projectToLowerDimension// Project higher-dimensional object into lower dimension over time/motion
decomposeHigherToLower // Decompose higher-dimensional object into lower-dimensional "shadows"
extraDimensionMode // Treat extra dimensions as spatial axes or object properties
setDimensionLimit // Set limits/boundaries for extra dimensions
energyDistribution // Simulate energy distribution across extra dimensions
distributeEnergy // Distribute energy across dimensions
deformObject // Apply deformation to object based on energy distribution
applyCurvature // Apply curvature/non-flat geometry to extra dimensions
schwarzschildCurvature // Schwarzschild curvature for 4D spacetime
sphericalCurvature // Spherical curvature for extra dimensions
// --- Advanced Physics and Math (pureMathPhysicsEngine.js, MistIllum.js) ---
eulerLagrange // Euler-Lagrange equation for wave function
gaussLawMagnetism // Gauss's law for magnetism
principleOfStationaryAction // Principle of stationary action
pilotWave // Pilot wave theory for defined objects
bellTheorem // Bell's theorem culling logic
locality // Check if two points are local to each other
lightWave // Relationship between light wave and arrival at objects
relativeAcceleration // Relative acceleration between two velocities over time
composeWaves // Compose multiple wave objects
intensityHardnessRelationship // Relationship between intensity and object hardness
particleWaveDuality // Model particle-wave duality
// --- Moderation and Security (MistMulti.js, MistTrackerVulkan.js) ---
cullObject // Remove object from scene/model, call deleteUser if user
deleteUser // Remove user from active sessions and/or database, or warn/add strike
rateLimitWarn // Warn user if rate limit is exceeded
// --- Swarm Health and Data Coherence (MistTrackerVulkan.js, MistMulti.js) ---
checkAndSyncEvent // Check event probability, sync to swarm, require confirms for anomalies, ban if needed
AnomalousResults // Table of anomalous results for error checking and moderation
isInteractionBanned // Check if an interaction is banned for a user
eventHorizonUser // Ban user and flush all Mist data from host
flushUserData // Remove all user data from persistent tables
banInteraction // Ban a specific interaction type or event
// --- Milestone Modeling (MistTrackerVulkan.js, MistIllum.js) ---
Milestone // Milestone class for precision and mode enablement
MilestoneManager // Manages milestones, tensor metric tables, and mode unlocks
milestoneManager // Singleton instance for milestone tracking
getCurrentMilestoneOrder // Get the highest achieved milestone order
enableModeIfMilestone // Enable a projection or render mode if milestone is achieved
listEnabledModes // List all enabled projection and render modes
// --- User Profile Management (MistTrackerVulkan.js) ---
nominateSuccessor // Nominate a successor by email (before 6th milestone)
nominateSuccessorPGP // Nominate a successor by PGP cert (after 6th milestone)
nominateSuccessorFlexible // Nominate successor, enforcing milestone-based method
// --- Miscellaneous and Utility (MistIllum.js, MistMulti.js, MistTrackerVulkan.js) ---
createVoxelObject // Create a voxel-based 3D object
updateDistanceFromObserver // Update object's distance from observer
computeAngularMomentumMap // Compute angular momentum map for object
isEdgeVoxel // Determine if a voxel is on the edge of an object
interactObjects // Cause interaction between objects using tensors
spawnObjectNearPlayer // Spawn a new object near the player
// --- Multi-User Moderation and Provenance (MistMulti.js) ---
createProvenance // Attach provenance to user actions/events
// --- Multi-User and P2P Features (MistMulti.js) ---
addUserSession // Add user to active sessions with encryption
removeUserSession // Remove user with proper cleanup
updateUserPresence // Update user status with timestamp
announceHostSession // Announce host with DHT integration
discoverHostSession // Discover hosts via DHT/P2P
generateSessionToken // Generate secure session tokens
signMessage // Sign messages with ECC
verifyMessage // Verify signed messages
onEvent // Register event handlers
emitEvent // Emit events to peers
broadcastToPeers // Broadcast with FEC support
mergeState // Merge states with conflict resolution
syncStateWithPeer // Sync state with encryption
encryptMessage // Encrypt with ECC
decryptMessage // Decrypt messages
canSendMessage // Check rate limits
grimReaper // Monitor tensor anomalies
encodeMessageFEC // Reed-Solomon encoding
decodeMessageFEC // FEC message recovery
handleARPointerInput // Handle AR input mapping
// --- Migration Status ---
// ✓ MySQL integration complete (replacing Google Sheets/Drive)
// ✓ X11 native UI toolkit implemented
// ✓ Vulkan/OpenCL acceleration integrated
// ✓ State persistence using MySQL
// ✓ GPU-accelerated matrix operations
// ✓ Wave/physics logic unified in pureMathPhysicsEngine.js
// ✓ P2P multi-user features implemented
// ✓ Milestone-based mode system active
// ✓ Provenance system implemented
// ✓ AR integration framework added
// - Vulkan window management optimizations ongoing
// - Advanced nD visualization features in progress
// - Additional haptic/AR device support planned