fix(sprites-list): add 'warm' to valid sprite statuses

The Sprites API can return 'warm' status for sprites that are warming up.
This was causing sprites-list to throw 'Invalid sprite status: warm' error.
This commit is contained in:
Ajax Davis 2026-01-16 18:00:58 +10:00
parent 839e1b3bef
commit a7a0cbb988
2 changed files with 4 additions and 3 deletions

View file

@ -1,6 +1,6 @@
{
"name": "@tpmjs/tools-sprites-list",
"version": "0.1.3",
"version": "0.1.4",
"description": "List all sprites in the account with their current status and metadata",
"type": "module",
"keywords": [

View file

@ -11,7 +11,7 @@ const SPRITES_API_BASE = 'https://api.sprites.dev/v1';
export interface Sprite {
name: string;
status: 'creating' | 'running' | 'stopped' | 'error' | 'cold';
status: 'creating' | 'running' | 'stopped' | 'error' | 'cold' | 'warm';
createdAt: string;
runtime?: string;
metadata?: Record<string, unknown>;
@ -96,7 +96,8 @@ export const spritesListTool = tool({
// Validate status is a known value
// Note: "cold" is returned for sprites that have been idle
if (status && !['creating', 'running', 'stopped', 'error', 'cold'].includes(status)) {
// Note: "warm" is returned for sprites that are warming up
if (status && !['creating', 'running', 'stopped', 'error', 'cold', 'warm'].includes(status)) {
throw new Error(`Invalid sprite status: ${status}`);
}