@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-boosterKey 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-serverbinary 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
| Export | Type | Description |
|---|---|---|
SptBooster | class | Main code editing engine with Morph-compatible API |
MorphApplyRequest | interface | Input: code, edit instruction, language |
MorphApplyResponse | interface | Output: modified code, success, latency, confidence |
SptBoosterConfig | interface | Config: confidence threshold, max chunks |