Files
Codeman maintainer a30524060a feat(predictive-echo): PredictiveEchoAddon + Layers 1-3 test suites (0.2.0)
Mosh-style write-through prediction: the consumer sends every keystroke
unchanged; the addon paints predicted glyphs and reconciles against the
parsed buffer. Confirm = cell match + cursor advance (placeholder-safe,
repaint-safe); two-pass mismatch cascade with neutral blanks (measured:
codex clears its placeholder on first echo); TTL bound; baseY-based line
reads; scroll/resize/off-row clears. Zero edits to zerolag-input-addon.ts.

Tests: 30 addon-law specs + renderer geometry (fake performance clock for
TTL/grace), 6 replay suites running the real algorithm through a real
@xterm/headless parser fed by the recorded codex fixtures, and a
500-iteration seeded fuzz with per-op span/record + grid invariants.
227 total, the pre-existing 175 untouched.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-09 04:25:24 +02:00

41 lines
1.2 KiB
TypeScript

import { defineConfig } from 'tsup';
export default defineConfig([
// Standard builds (CJS + ESM + DTS)
{
entry: ['src/index.ts'],
format: ['cjs', 'esm'],
dts: true,
clean: true,
},
// IIFE build for browser <script> tag usage
{
entry: ['src/index.ts'],
format: ['iife'],
globalName: 'XtermZerolagInput',
outDir: 'dist',
// Append global aliases so app.js can access classes directly
footer: {
js: [
'// Global aliases for browser usage',
'if(typeof window!=="undefined"){',
' window.ZerolagInputAddon=XtermZerolagInput.ZerolagInputAddon;',
' window.LocalEchoOverlay=class extends XtermZerolagInput.ZerolagInputAddon{',
' constructor(terminal){',
' super({prompt:{type:"character",char:"\\u276f",offset:2}});',
' this.activate(terminal);',
' }',
' };',
' window.PredictiveEchoAddon=XtermZerolagInput.PredictiveEchoAddon;',
' window.PredictiveEchoOverlay=class extends XtermZerolagInput.PredictiveEchoAddon{',
' constructor(terminal){',
' super({});',
' this.activate(terminal);',
' }',
' };',
'}',
].join('\n'),
},
},
]);