Skip to main content

v3.2.0-alpha.2

Released: December 17, 2025

๐Ÿ”ง Bug Fixes

  • Compile: Fix compilation issue when skills are defined inline vs imported from separate files

v3.2.0-alpha.1

Released: December 16, 2025

โœจ New Features

New lua sync command to detect drift between server and local code:
lua sync
Features:
  • Compare agent name and persona between server state and local code
  • Fetch latest published persona version (excludes drafts and rollbacks)
  • Show colored line-by-line diff for easy comparison
  • Interactive resolution: update local from server or continue with local
  • Integrated into compile flow with --no-sync and --force-sync flags
New lua chat clear command to clear conversation history:
# Clear all conversation history
lua chat clear

# Clear history for a specific user
lua chat clear --user [email protected]
Accepts userId, email, or mobile number as the identifier.
New Lua namespace for runtime access:
import { Lua } from 'lua-cli';

// Access channel information
const channel = Lua.request.channel; // 'dev', 'webchat', 'whatsapp', etc.
Channel is typed as a union type: 'dev' | 'webchat' | 'whatsapp' | 'messenger' | 'voice' | 'api' | 'email'
Browse marketplace skills now supports pagination:
  • Navigate through pages with Previous/Next options
  • Shows page info (Page X/Y) and total count
  • Configurable page size (default: 10 items)

๐Ÿ”ง Improvements

  • Persona Handling Centralized: Moved persona load/save to shared agent-code-utils, simplified YAML to state-only
  • AST-based Code Updates: Using ts-morph for proper node replacement, fixing partial replacement bugs
  • New Dependencies: Added diff package for colored diff display

๐Ÿ“ Interface Updates

  • Added Channel type for typed channel identification
  • Added ProfileResponse interface for user profile data
  • Added MarketplacePaginationResponse and PaginatedMarketplaceSkillsResponse interfaces

v3.1.0

Released: December 7, 2025

โœจ New Features

New LuaMCPServer class for integrating Model Context Protocol servers with your agent:
import { LuaMCPServer, LuaAgent } from 'lua-cli';

const docsServer = new LuaMCPServer({
  name: 'lua-docs',
  transport: 'sse',
  url: 'https://docs.heylua.ai/mcp/sse'
});

export const agent = new LuaAgent({
  mcpServers: [docsServer]
});
CLI commands:
  • lua mcp - List, activate, deactivate, or delete MCP servers
  • lua push mcp - Push individual MCP servers
  • MCP servers included in lua push all --force
Tools can now have a condition function that determines if the tool is available:
const adminTool = new LuaTool({
  name: 'admin-tool',
  condition: async () => {
    const user = await User.get();
    return user.data?.isAdmin === true;
  },
  execute: async (input) => { return 'admin action completed'; }
});
Use conditions to dynamically enable/disable tools based on user subscription, verification status, feature flags, or region.
New CDN namespace for uploading and retrieving files:
import { CDN } from 'lua-cli';

// Upload a file
const file = new File([buffer], 'image.png', { type: 'image/png' });
const fileId = await CDN.upload(file);

// Get file
const file = await CDN.get(fileId);
New methods for job management:
// Get all jobs
const jobs = await Jobs.getAll();

// Activate/deactivate job scheduling
await job.activate();
await job.deactivate();

// Manually trigger execution
await job.trigger();
New lua evals command opens the Evaluations Dashboard with your agent pre-configured.
lua evals
New Templates namespace for WhatsApp template messaging:
import { Templates } from 'lua-cli';

// List templates
const result = await Templates.whatsapp.list(channelId);

// Send template message
await Templates.whatsapp.send(channelId, templateId, {
  phoneNumbers: ['+447551166594'],
  values: { body: { name: 'John' } }
});
New lua marketplace command for discovering, installing, and publishing skills:For Creators:
  • Publish skills to the global marketplace
  • Version management with semantic versioning
  • Environment variable configuration per version
For Installers:
  • Browse and search for verified skills
  • Smart installation with dependency checks
  • Interactive environment variable configuration
The lua logs command now features:
  • Interactive filtering by primitive type (Skills, Jobs, Webhooks, etc.)
  • Live data from API including dynamically created jobs
  • Context-aware log display with detailed metadata
New user._luaProfile property for read-only core user data:
const userId = user._luaProfile.userId;        // โœ… Recommended
const fullName = user._luaProfile.fullName;
const emails = user._luaProfile.emailAddresses;

// user.userId still works but is deprecated

๐Ÿ’ฅ Breaking Changes

These changes may require updates to your existing code.
JobInstance now receives the full Job entity with activeVersion:
// Before
const schedule = job.schedule;
const id = job.jobId;

// After
const schedule = job.activeVersion.schedule;
const id = job.id;
await job.trigger(); // New method
The welcomeMessage field has been removed from LuaAgent configuration:
  • For voice: use voiceConfig.welcomeMessage
  • For chat widgets: use WebchatChannelConfig.welcomeMessage
Webhook execute functions now receive a single event object:
// Before
execute: async (query, headers, body) => {
  // handle webhook
}

// After
execute: async (event) => {
  const { query, headers, body, timestamp } = event;
  // handle webhook
}
PreProcessorResult now uses a discriminated union:
// Block response
return { action: 'block', response: 'Blocked' };

// Proceed response
return { 
  action: 'proceed', 
  modifiedMessage: [{ type: 'text', text: '...' }] 
};
  • modifiedMessage is now ChatMessage[] (array)
  • Added priority field for execution order
  • Removed context field

๐Ÿ”ง Improvements

  • Data API Type Safety: searchText parameter added to Data.create() and Data.update(), data parameter type changed to Record<string, any>
  • PostProcessor Simplified: Return type now requires modifiedResponse: string, removed async field
  • Compilation: Handle .js extensions for Node16/NodeNext module resolution
  • Template: Minimal by default, use --with-examples flag for examples
  • Web UI: React Query, Sonner toasts, improved env panels, docs in toolbar

๐Ÿ› ๏ธ Refactoring

  • Removed context field from webhooks, jobs, and postprocessors
  • Removed version field from LuaSkill, LuaJob, and processor configurations
  • Improved push command: displays both webhookId and webhook-name URL formats
  • Rewritten interfaces/jobs.ts to match lua-api DTOs exactly

v3.0.3

Released: October 30, 2025

๐ŸŽฏ User API Enhancement

Enhanced User.get() method now accepts an optional userId parameter:
// Get current user (existing behavior)
const userData = await User.get();

// NEW: Get specific user by ID
const specificUser = await User.get('user_123456');
Use Cases:
  • Fetch data for specific users in admin tools
  • Access user information in webhooks/jobs
  • Multi-user data operations
  • User management features
This enhancement allows tools, webhooks, and jobs to access any userโ€™s data, enabling more sophisticated multi-user scenarios.

v3.0.2

Released: October 30, 2025

๐Ÿš€ Major Improvements to Compilation System

This release brings comprehensive dependency bundling, debug mode, enhanced validation, and critical bug fixes.
All components now properly bundle external dependencies:
  • โœ… LuaWebhooks bundle dependencies (e.g., Stripe, axios)
  • โœ… LuaJobs bundle dependencies
  • โœ… PreProcessors bundle dependencies (e.g., lodash)
  • โœ… PostProcessors bundle dependencies (e.g., date-fns)
  • โœ… Nested Jobs (Jobs.create()) independently bundle their own dependencies
Impact: All compiled components are now truly portable and self-contained, requiring no dependency installation on deployment targets.
Added --debug flag to lua compile command:
lua compile --debug
# or
LUA_DEBUG=true lua compile
Features:
  • Verbose step-by-step logging
  • Shows detected imports and dependencies
  • Displays bundle sizes (uncompressed and compressed)
  • Preserves temp files for inspection
  • Shows timing information for each component
  • Full error stack traces
  • tsconfig.json validation - Clear error if missing or invalid
  • Empty bundle detection - Warns about suspiciously small bundles (under 100 bytes)
  • Bundle output validation - Ensures esbuild creates valid output
  • Null config handling - Graceful compilation without lua.skill.yaml
  • Safe optional chaining - Fixed crash when agentData is null
Context-aware error messages with actionable hints:
  • Dependency resolution failures โ†’ โ€œRun npm installโ€
  • TypeScript syntax errors โ†’ โ€œCheck syntax in filename.tsโ€
  • Missing files โ†’ Shows expected path
  • Full stack traces in debug mode
Enhanced resolveImportPath() to support:
  • .ts, .tsx, .js, .jsx files
  • Directory imports (index.ts, index.tsx, index.js)
Critical Fix: Relative imports now work correctly in Jobs, Webhooks, and Processors:
// โœ… Now works perfectly
import { MyService } from "../services/MyService";
// โœ… Also works
import { MyService } from "@/services/MyService";

๐Ÿ› Bug Fixes

  • Fixed null reference error when compiling without LuaAgent
  • Fixed crash when lua.skill.yaml is missing
  • Fixed compilation with empty agent name/persona
  • Critical: Fixed relative import resolution in all component types

๐Ÿงน Code Quality

  • Removed obsolete dynamic-job-bundler.ts
  • Extracted common helpers (extractRelevantImports, bundleAndCompressExecuteFunction)
  • Reduced bundling.ts from 1,149 to 1,036 lines (9.8% reduction)
  • Added 27 comprehensive tests for bundling, execution, validation, and relative imports

v3.0.0

Released: October 2025

๐ŸŽ‰ Major Release

Version 3.0.0 focuses on developer experience, deployment automation, and real-time chat capabilities.

โœจ New Features

The flagship feature: a single, intuitive way to configure your entire agent.Before (v2.x):
export const skill1 = new LuaSkill({ name: 'skill1', tools: [] });
export const skill2 = new LuaSkill({ name: 'skill2', tools: [] });
export const webhook1 = new LuaWebhook({ name: 'webhook1', execute: async () => 'ok' });
After (v3.0.0):
export const agent = new LuaAgent({
  name: 'my-assistant',
  persona: 'You are a helpful AI assistant...',
  skills: [skill1, skill2],
  webhooks: [webhook1],
  jobs: [job1],
  preProcessors: [processor1],
  postProcessors: [processor2]
});
Benefits:
  • Single source of truth
  • Clearer organization
  • Automatic YAML synchronization
  • Better IDE support
Real-time chat responses with improved UX:
lua chat
  • โœ… Animated typing indicator while waiting
  • โœ… Text streams character-by-character
  • โœ… Sandbox and production environment selection
  • โœ… Uses /chat/stream endpoint for real-time updates
New command for deploying all components without prompts:
# Push all with auto-versioning
lua push all --force

# Push and deploy to production
lua push all --force --auto-deploy
What it does:
  1. Compiles project
  2. Reads all components from lua.skill.yaml
  3. Increments patch versions automatically
  4. Pushes all components to server
  5. Deploys to production (if --auto-deploy)
Features:
  • Auto-bumps patch versions (e.g., 1.0.0 โ†’ 1.0.1)
  • Perfect for CI/CD pipelines
  • Retry mechanism with exponential backoff
Flexible authentication with multiple sources (priority order):
  1. System Keychain (macOS Keychain, Windows Credential Vault, Linux libsecret)
  2. Environment Variable (LUA_API_KEY)
  3. .env File (LUA_API_KEY=...)
Usage in CI/CD:
export LUA_API_KEY=your-key
lua push all --force --auto-deploy
Bidirectional synchronization ensures consistency:On lua init:
  • Agent name, persona โ†’ YAML + index.ts LuaAgent
On lua compile:
  • LuaAgent persona โ†’ YAML
No manual synchronization needed!

๐Ÿ”ง Improvements

  • Excluded lua-cli internals from bundles
  • Reduced bundle sizes by 50-70%
  • Fixed relative import issues
  • Proper sandbox globals (tools use sandbox-provided APIs)
  • code field now properly compressed and included
  • Execute function properly converts to strings
  • Excludes lua-cli imports from job execute functions
  • Better metadata support for passing data
  • Comprehensive template with 30+ example tools
  • Quick Start Guide for new users
  • TypeScript examples with best practices
  • CI/CD integration examples

๐Ÿ› Bug Fixes

Bundling:
  • Fixed Cannot find module '../services/ApiService' in pre-bundled tools
  • Fixed process.cwd is not a function in sandbox execution
  • Fixed lua-cli API code being bundled into tools
Push & Deploy:
  • Fixed webhooks and jobs not found during push all
  • Fixed missing tools array causing validation errors
  • Fixed deployment timing issues with retry mechanism
Chat:
  • Fixed welcome message reading from lua.skill.yaml
  • Fixed streaming endpoint integration
  • Fixed typing indicator cleanup on errors

๐Ÿ’ฅ Breaking Changes

These changes require updates to your existing code.
Old Way:
export const skill1 = new LuaSkill({ name: 'skill1', tools: [] });
export const skill2 = new LuaSkill({ name: 'skill2', tools: [] });
New Way:
export const agent = new LuaAgent({
  skills: [skill1, skill2]
});
Migration:
  1. Wrap your existing skills in a LuaAgent
  2. Add name and persona fields
  3. Run lua compile to sync with YAML
  • Old: /chat/generate/:agentId
  • New: /chat/stream/:agentId
No action needed - handled automatically by CLI.
Jobs must use metadata for data passing:
await Jobs.create({
  metadata: { userId: input.userId },
  execute: async (job) => {
    const userId = job.metadata.userId;
  }
});

๐Ÿ“Š Statistics

MetricBeforeAfter
Bundle overhead~500KB50-70% smaller
Compilation speed-30% faster
Template examples530+
CLI commands-25+

Upgrade Guides

From v3.0.x to v3.1.0

npm install [email protected]
Required changes:
  1. Update JobInstance access patterns (use activeVersion.schedule, id instead of jobId)
  2. Update webhook execute functions to use event object
  3. Update PreProcessor responses to use discriminated union
  4. Remove welcomeMessage from LuaAgent (configure on channel/voice instead)

From v2.x to v3.0.0

npm install [email protected]
Required changes:
  1. Wrap skills in a LuaAgent configuration
  2. Update jobs to use metadata for data passing
  3. Run lua compile to sync with YAML
// src/index.ts
import { LuaAgent } from 'lua-cli';

export const agent = new LuaAgent({
  name: 'my-agent',
  persona: 'Your agent persona...',
  skills: [/* your existing skills */],
});