tpmjs/packages/tools/official/sprites-sessions
Ajax Davis 4e3cb78ba4 feat(sprites): add SPRITES_TOKEN env requirement to package metadata
All sprites tools require a SPRITES_TOKEN to authenticate with sprites.dev.
This adds the env field to the tpmjs metadata so Omega can warn users
about missing API keys.
2026-01-25 12:23:43 +10:00
..
src fix: correct API endpoints for sprites tools v0.1.3/v0.1.4 2026-01-15 04:30:52 +10:00
CHANGELOG.md feat(sprites): add SPRITES_TOKEN env requirement to package metadata 2026-01-25 12:23:43 +10:00
package.json feat(sprites): add SPRITES_TOKEN env requirement to package metadata 2026-01-25 12:23:43 +10:00
README.md feat: add READMEs to sprites packages and fix blocks.yml schema 2026-01-14 16:22:39 +10:00
tsconfig.json refactor: replace exportName with name throughout codebase 2026-01-14 14:18:36 +10:00
tsup.config.ts refactor: replace exportName with name throughout codebase 2026-01-14 14:18:36 +10:00

@tpmjs/sprites-sessions

List active execution sessions for a sprite.

Installation

npm install @tpmjs/sprites-sessions

Requirements

Usage

import { spritesSessionsTool } from '@tpmjs/sprites-sessions';

const result = await spritesSessionsTool.execute({
  name: 'my-sandbox'
});

console.log(result);
// {
//   sessions: [
//     { id: 'sess_123', status: 'active', startedAt: '2024-01-15T10:30:00Z', command: 'python server.py' },
//     { id: 'sess_124', status: 'completed', startedAt: '2024-01-15T10:25:00Z' }
//   ],
//   count: 2
// }

Input Parameters

Parameter Type Required Description
name string Yes Name of the sprite to list sessions for

Output

Field Type Description
sessions ExecSession[] Array of execution sessions
count number Total number of sessions

ExecSession Object

Field Type Description
id string Unique session identifier
status 'active' | 'completed' | 'terminated' Session status
startedAt string ISO 8601 timestamp when session started
command string? Optional command that started the session

Use Cases

  • Monitor running commands in a sprite
  • Check if long-running processes are still active
  • Debug execution issues by reviewing session history

Error Handling

The tool throws errors in these cases:

  • SPRITES_TOKEN environment variable is not set
  • Sprite not found (HTTP 404)
  • Invalid or expired API token (HTTP 401)
  • Network timeout (30 second limit)
  • API errors with descriptive messages

License

MIT