Skip to content

@smartpointstech/spt-booster

Ultra-fast code editing engine - WASM-accelerated AST-based code transformations

Overview

SPT Booster is a WASM-accelerated code editing engine that applies AST-based code transformations. It provides a Morph-compatible API for applying code edits with confidence scoring and strategy reporting. The package includes both a programmatic API and CLI/server binaries for integration into editor toolchains.

Installation

bash
npm install @smartpointstech/spt-booster

Key Features

  • WASM-Powered AST Transforms -- Rust/WASM backend for sub-millisecond code edits
  • Morph-Compatible API -- drop-in replacement for Morph-style apply requests
  • Confidence Scoring -- reports confidence (0-1) and merge strategy for each edit
  • Input Validation -- detects vague instructions and rejects non-code edits
  • HTTP Server Mode -- spt-booster-server binary for language-server-style integration

Dependencies

Key internal dependencies:

  • express -- HTTP server for the booster server mode

WASM module loaded from wasm/spt_booster_wasm.js (built from Rust).

Quick Start

typescript
import { SptBooster } from '@smartpointstech/spt-booster';

const booster = new SptBooster({ confidenceThreshold: 0.5 });
const result = await booster.apply({
  code: 'function add(a, b) { return a + b; }',
  edit: 'function add(a: number, b: number): number { return a + b; }',
  language: 'typescript',
});
console.log(result.output, result.confidence);

API Reference

Exports

ExportTypeDescription
SptBoosterclassMain code editing engine with Morph-compatible API
MorphApplyRequestinterfaceInput: code, edit instruction, language
MorphApplyResponseinterfaceOutput: modified code, success, latency, confidence
SptBoosterConfiginterfaceConfig: confidence threshold, max chunks

Released under the MIT License.