finsteps

Public API Contract

Entry Point

presentMermaid({ mountEl, mermaidText, mpdText | ast, options }) => Controller

Required:

Optional:

Controller

Methods:

Events:

Interfaces

DiagramHandle

CameraHandle

OverlayHandle

ControlsHandle

Controls can be created using createFloatingControls():

import { createFloatingControls } from 'finsteps';

const controls = createFloatingControls({
  controller,        // Controller instance (required)
  camera,            // CameraHandle for zoom controls (optional)
  position: 'bottom-right',  // Position: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left' | 'bottom-center'
  showPlayPause: true,       // Show play/pause button (default: true)
  showPrevNext: true,       // Show prev/next buttons (default: true)
  showZoomControls: true,   // Show zoom controls (default: true)
  showStepIndicator: true,  // Show step counter (default: true)
  autoHide: false,          // Auto-hide after inactivity (default: false)
  offset: { x: 20, y: 20 }  // Offset from position edge (default: { x: 20, y: 20 })
});

Semantic Versioning Discipline

AI Model Management (Optional)

Finsteps includes an optional AI model management system for multi-provider AI integration:

Exports

import { 
  modelManager,           // Singleton model manager instance
  type ModelConfig,       // Model configuration interface
  type ModelChatRequest,  // Chat request interface
  type ModelChatResponse, // Chat response interface
  type ModelManager,      // Model manager interface
  type ModelProvider      // Supported provider types
} from 'finsteps';

ModelManager API

Pre-Configured Models

Example Usage

import { modelManager } from 'finsteps';

// List available models
const models = modelManager.getAvailableModels();

// Chat with local qwen3-coder:30b
const response = await modelManager.chat({
  model: 'qwen3-coder-30b',
  messages: [
    { role: 'user', content: 'Write MPD code for a flowchart' }
  ],
  options: { maxTokens: 500, temperature: 0.7 }
});

console.log(response.choices[0].message.content);

See AI Model Documentation for complete setup and provider configuration.