All types are TypeScript interfaces exported from infinium-o2.
Core Types
TaskData
The central data structure sent to the Infinium API. Represents a complete trace of an agent’s work.
import type { TaskData } from 'infinium-o2';
| Field | Type | Required | Description |
|---|
name | string | Yes | Short task name (max 500 chars) |
description | string | Yes | What the agent did (max 10,000 chars) |
currentDatetime | string | Yes | ISO 8601 timestamp |
duration | number | Yes | Wall-clock time in seconds (0-86,400) |
timeTracking | TimeTracking | No | Start/end timestamps |
customer | Customer | No | Customer context |
support | Support | No | Support ticket context |
sales | Sales | No | Sales pipeline context |
marketing | Marketing | No | Marketing campaign context |
content | Content | No | Content creation context |
research | Research | No | Research task context |
project | Project | No | Project management context |
development | Development | No | Software development context |
executive | Executive | No | Executive/meeting context |
general | General | No | General-purpose context |
llmUsage | LlmUsage | No | Aggregate token/cost stats |
inputSummary | string | No | Summary of agent input |
outputSummary | string | No | Summary of agent output |
outcome | string | No | Outcome description |
steps | ExecutionStep[] | No | Ordered execution steps |
expectedOutcome | ExpectedOutcome | No | Maestro’s grading rubric |
environment | EnvironmentContext | No | Runtime metadata |
errors | ErrorDetail[] | No | Errors encountered |
ApiResponse<T>
Returned by sendTask(), sendTaskData(), and getInterpretedTaskResult().
import type { ApiResponse } from 'infinium-o2';
| Field | Type | Description |
|---|
success | boolean | Whether the request succeeded |
statusCode | number | undefined | HTTP status code |
message | string | Response message |
data | T | undefined | Response payload (includes traceId on success) |
BatchResult
Returned by sendBatch() and sendBatchSequential().
import type { BatchResult } from 'infinium-o2';
| Field | Type | Description |
|---|
totalTasks | number | Total tasks in the batch |
successfulTasks | number | Number sent successfully |
failedTasks | number | Number that failed |
results | ApiResponse[] | Individual response per task |
errors | string[] | Error messages for failures |
PromptContent
Returned by getPrompt().
import type { PromptContent } from 'infinium-o2';
| Field | Type | Description |
|---|
promptId | string | The prompt’s UUID |
name | string | Display name |
version | number | Version number |
content | string | Raw template content |
createdAt | string | ISO timestamp of version creation |
renderedContent | string | undefined | Content with variables substituted |
Trace Enrichment Types
ExecutionStep
Represents one thing the agent did.
import type { ExecutionStep } from 'infinium-o2';
| Field | Type | Required | Description |
|---|
stepNumber | number | Yes | Sequential step number |
action | string | Yes | Action type (e.g., 'llm_inference', 'tool_use', 'decision') |
description | string | Yes | What this step did |
durationMs | number | No | Step duration in milliseconds |
inputPreview | string | No | Preview of step input (max 500 chars) |
outputPreview | string | No | Preview of step output (max 500 chars) |
error | ErrorDetail | No | Error that occurred |
toolCall | ToolCall | No | Tool/API invocation details |
llmCall | LlmCall | No | LLM invocation details |
metadata | Record<string, unknown> | No | Arbitrary metadata |
ErrorDetail
A factual error record.
import type { ErrorDetail } from 'infinium-o2';
| Field | Type | Required | Description |
|---|
errorType | string | Yes | Error class name |
message | string | Yes | Error message |
recoverable | boolean | No | Whether the agent recovered (default: false) |
retryCount | number | No | Number of retries attempted (default: 0) |
stackTrace | string | No | Full stack trace |
errorCode | string | No | Application error code |
A tool or API invocation.
import type { ToolCall } from 'infinium-o2';
| Field | Type | Required | Description |
|---|
toolName | string | Yes | Name of the tool |
durationMs | number | No | Call duration in milliseconds |
inputSummary | string | No | Summary of input |
outputSummary | string | No | Summary of output |
error | ErrorDetail | No | Error details if the call failed |
httpStatus | number | No | HTTP status code |
LlmCall
A single LLM invocation.
import type { LlmCall } from 'infinium-o2';
| Field | Type | Required | Description |
|---|
model | string | Yes | Model identifier |
provider | string | No | Provider name (openai, anthropic, google, xai) |
promptTokens | number | No | Input token count |
completionTokens | number | No | Output token count |
latencyMs | number | No | Call latency in milliseconds |
temperature | number | No | Temperature parameter |
purpose | string | No | What this LLM call was for |
LlmUsage
Aggregate token and cost statistics across the entire trace.
import type { LlmUsage } from 'infinium-o2';
| Field | Type | Description |
|---|
model | string | undefined | Primary model used |
provider | string | undefined | Primary provider |
promptTokens | number | undefined | Total input tokens |
completionTokens | number | undefined | Total output tokens |
totalTokens | number | undefined | Total tokens (prompt + completion) |
estimatedCostUsd | number | undefined | Estimated cost in USD |
apiCallsCount | number | undefined | Number of API calls made |
totalLatencyMs | number | undefined | Sum of all call latencies |
calls | LlmCall[] | undefined | Individual call details |
ExpectedOutcome
Defines what Maestro should evaluate the trace against.
import type { ExpectedOutcome } from 'infinium-o2';
| Field | Type | Required | Description |
|---|
taskObjective | string | Yes | The goal of the task |
requiredDeliverables | string[] | No | What the agent should produce |
constraints | string[] | No | Rules the agent should follow |
acceptanceCriteria | string[] | No | How to judge success |
EnvironmentContext
Runtime metadata about the execution environment.
import type { EnvironmentContext } from 'infinium-o2';
| Field | Type | Description |
|---|
framework | string | undefined | Framework name (e.g., 'langchain', 'crewai') |
frameworkVersion | string | undefined | Framework version |
nodeVersion | string | undefined | Node.js version |
sdkVersion | string | undefined | Infinium SDK version (auto-populated) |
runtime | string | undefined | Runtime environment |
region | string | undefined | Deployment region |
customTags | Record<string, string> | undefined | Custom key-value tags |
Configuration Types
ClientConfig
import type { ClientConfig } from 'infinium-o2';
| Field | Type | Required | Description |
|---|
agentId | string | Yes | Agent UUID |
agentSecret | string | Yes | Agent secret key |
baseUrl | string | No | API base URL |
timeout | number | No | Request timeout in ms |
maxRetries | number | No | Max retry attempts |
enableRateLimiting | boolean | No | Enable rate limiting |
requestsPerSecond | number | No | Rate limit threshold |
userAgent | string | No | Custom User-Agent |
enableLogging | boolean | No | Enable logging |
logLevel | string | No | Log level |
RequestOptions
import type { RequestOptions } from 'infinium-o2';
| Field | Type | Description |
|---|
timeout | number | undefined | Override timeout for this request |
retries | number | undefined | Override retries for this request |
retryDelay | number | undefined | Override retry delay |
headers | Record<string, string> | undefined | Additional headers |
RetryConfig
import type { RetryConfig } from 'infinium-o2';
| Field | Type | Description |
|---|
attempts | number | Max retry attempts |
delay | number | Base delay in ms |
factor | number | undefined | Backoff multiplier (default: 2) |
maxDelay | number | undefined | Max delay cap in ms (default: 30000) |
retryCondition | function | undefined | Custom retry predicate |
RateLimiterConfig
import type { RateLimiterConfig } from 'infinium-o2';
| Field | Type | Description |
|---|
requestsPerSecond | number | Requests per second |
burstSize | number | undefined | Max burst (default: 2x requestsPerSecond) |