Composable agent runtime monorepo built on the pi ecosystem
Find a file
Mario Zechner afa807b200 tui-double-buffer: Implement smart differential rendering with terminal abstraction
- Create Terminal interface abstracting stdin/stdout operations for dependency injection
- Implement ProcessTerminal for production use with process.stdin/stdout
- Implement VirtualTerminal using @xterm/headless for accurate terminal emulation in tests
- Fix TypeScript imports for @xterm/headless module
- Move all component files to src/components/ directory for better organization
- Add comprehensive test suite with async/await patterns for proper render timing
- Fix critical TUI differential rendering bug when components grow in height
  - Issue: Old content wasn't properly cleared when component line count increased
  - Solution: Clear each old line individually before redrawing, ensure cursor at line start
- Add test verifying terminal content preservation and text editor growth behavior
- Update tsconfig.json to include test files in type checking
- Add benchmark test comparing single vs double buffer performance

The implementation successfully reduces flicker by only updating changed lines
rather than clearing entire sections. Both TUI implementations maintain the
same interface for backward compatibility.
2025-08-10 22:33:03 +02:00
packages tui-double-buffer: Implement smart differential rendering with terminal abstraction 2025-08-10 22:33:03 +02:00
scripts Initial monorepo setup with npm workspaces and dual TypeScript configuration 2025-08-09 17:18:38 +02:00
todos tui-double-buffer: Implement smart differential rendering with terminal abstraction 2025-08-10 22:33:03 +02:00
.gitignore Initial monorepo setup with npm workspaces and dual TypeScript configuration 2025-08-09 17:18:38 +02:00
.npmrc Initial monorepo setup with npm workspaces and dual TypeScript configuration 2025-08-09 17:18:38 +02:00
biome.json Initial monorepo setup with npm workspaces and dual TypeScript configuration 2025-08-09 17:18:38 +02:00
CLAUDE.md agent: Add reasoning token support for OpenAI reasoning models 2025-08-10 00:32:30 +02:00
LICENSE Initial monorepo setup with npm workspaces and dual TypeScript configuration 2025-08-09 17:18:38 +02:00
models.js Initial monorepo setup with npm workspaces and dual TypeScript configuration 2025-08-09 17:18:38 +02:00
package-lock.json tui-double-buffer: Implement smart differential rendering with terminal abstraction 2025-08-10 22:33:03 +02:00
package.json Fix npm publishing warnings and clean up package.json files 2025-08-09 17:27:16 +02:00
README.md Fix pi-agent CLI execution issue when installed globally 2025-08-09 18:02:34 +02:00
tsconfig.base.json Initial monorepo setup with npm workspaces and dual TypeScript configuration 2025-08-09 17:18:38 +02:00
tsconfig.json tui-double-buffer: Implement smart differential rendering with terminal abstraction 2025-08-10 22:33:03 +02:00

Pi Monorepo

A collection of tools for managing LLM deployments and building AI agents.

Packages

Development

This is a monorepo using npm workspaces for package management and a dual TypeScript configuration for development and building.

Common Commands

# Install all dependencies
npm install

# Build all packages (required for publishing to NPM)
npm run build

# Clean out dist/ folders in all packages
npm run clean

# Run linting, formatting, and tsc typechecking (no build needed)
npm run check

# Run directly with tsx during development (no build needed)
cd packages/pods && npx tsx src/cli.ts
cd packages/agent && npx tsx src/cli.ts

Package Dependencies

The packages have the following dependency structure:

pi-tui -> pi-agent -> pi

When new packages are added, the must be inserted in the correct order in the build script in package.json.

TypeScript Configuration

The monorepo uses a dual TypeScript configuration approach:

  • Root tsconfig.json: Contains path mappings for all packages, used for type checking and development with tsx
  • Package tsconfig.build.json: Clean build configuration with rootDir and outDir, used for production builds

This setup allows:

  • Type checking without building (npm run check works immediately)
  • Running source files directly with tsx during development
  • Clean, organized build outputs for publishing

Versioning

All packages use lockstep versioning - they share the same version number:

# Bump patch version (0.5.0 -> 0.5.1)
npm run version:patch

# Bump minor version (0.5.0 -> 0.6.0)
npm run version:minor

# Bump major version (0.5.0 -> 1.0.0)
npm run version:major

These commands automatically:

  1. Update all package versions
  2. Sync inter-package dependency versions
  3. Update package-lock.json

Publishing

# Dry run to see what would be published
npm run publish:dry

# Publish all packages to npm
npm run publish

License

MIT