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';
FieldTypeRequiredDescription
namestringYesShort task name (max 500 chars)
descriptionstringYesWhat the agent did (max 10,000 chars)
currentDatetimestringYesISO 8601 timestamp
durationnumberYesWall-clock time in seconds (0-86,400)
timeTrackingTimeTrackingNoStart/end timestamps
customerCustomerNoCustomer context
supportSupportNoSupport ticket context
salesSalesNoSales pipeline context
marketingMarketingNoMarketing campaign context
contentContentNoContent creation context
researchResearchNoResearch task context
projectProjectNoProject management context
developmentDevelopmentNoSoftware development context
executiveExecutiveNoExecutive/meeting context
generalGeneralNoGeneral-purpose context
llmUsageLlmUsageNoAggregate token/cost stats
inputSummarystringNoSummary of agent input
outputSummarystringNoSummary of agent output
outcomestringNoOutcome description
stepsExecutionStep[]NoOrdered execution steps
expectedOutcomeExpectedOutcomeNoMaestro’s grading rubric
environmentEnvironmentContextNoRuntime metadata
errorsErrorDetail[]NoErrors encountered

ApiResponse<T>

Returned by sendTask(), sendTaskData(), and getInterpretedTaskResult().

import type { ApiResponse } from 'infinium-o2';
FieldTypeDescription
successbooleanWhether the request succeeded
statusCodenumber | undefinedHTTP status code
messagestringResponse message
dataT | undefinedResponse payload (includes traceId on success)

BatchResult

Returned by sendBatch() and sendBatchSequential().

import type { BatchResult } from 'infinium-o2';
FieldTypeDescription
totalTasksnumberTotal tasks in the batch
successfulTasksnumberNumber sent successfully
failedTasksnumberNumber that failed
resultsApiResponse[]Individual response per task
errorsstring[]Error messages for failures

PromptContent

Returned by getPrompt().

import type { PromptContent } from 'infinium-o2';
FieldTypeDescription
promptIdstringThe prompt’s UUID
namestringDisplay name
versionnumberVersion number
contentstringRaw template content
createdAtstringISO timestamp of version creation
renderedContentstring | undefinedContent with variables substituted

Trace Enrichment Types

ExecutionStep

Represents one thing the agent did.

import type { ExecutionStep } from 'infinium-o2';
FieldTypeRequiredDescription
stepNumbernumberYesSequential step number
actionstringYesAction type (e.g., 'llm_inference', 'tool_use', 'decision')
descriptionstringYesWhat this step did
durationMsnumberNoStep duration in milliseconds
inputPreviewstringNoPreview of step input (max 500 chars)
outputPreviewstringNoPreview of step output (max 500 chars)
errorErrorDetailNoError that occurred
toolCallToolCallNoTool/API invocation details
llmCallLlmCallNoLLM invocation details
metadataRecord<string, unknown>NoArbitrary metadata

ErrorDetail

A factual error record.

import type { ErrorDetail } from 'infinium-o2';
FieldTypeRequiredDescription
errorTypestringYesError class name
messagestringYesError message
recoverablebooleanNoWhether the agent recovered (default: false)
retryCountnumberNoNumber of retries attempted (default: 0)
stackTracestringNoFull stack trace
errorCodestringNoApplication error code

ToolCall

A tool or API invocation.

import type { ToolCall } from 'infinium-o2';
FieldTypeRequiredDescription
toolNamestringYesName of the tool
durationMsnumberNoCall duration in milliseconds
inputSummarystringNoSummary of input
outputSummarystringNoSummary of output
errorErrorDetailNoError details if the call failed
httpStatusnumberNoHTTP status code

LlmCall

A single LLM invocation.

import type { LlmCall } from 'infinium-o2';
FieldTypeRequiredDescription
modelstringYesModel identifier
providerstringNoProvider name (openai, anthropic, google, xai)
promptTokensnumberNoInput token count
completionTokensnumberNoOutput token count
latencyMsnumberNoCall latency in milliseconds
temperaturenumberNoTemperature parameter
purposestringNoWhat this LLM call was for

LlmUsage

Aggregate token and cost statistics across the entire trace.

import type { LlmUsage } from 'infinium-o2';
FieldTypeDescription
modelstring | undefinedPrimary model used
providerstring | undefinedPrimary provider
promptTokensnumber | undefinedTotal input tokens
completionTokensnumber | undefinedTotal output tokens
totalTokensnumber | undefinedTotal tokens (prompt + completion)
estimatedCostUsdnumber | undefinedEstimated cost in USD
apiCallsCountnumber | undefinedNumber of API calls made
totalLatencyMsnumber | undefinedSum of all call latencies
callsLlmCall[] | undefinedIndividual call details

ExpectedOutcome

Defines what Maestro should evaluate the trace against.

import type { ExpectedOutcome } from 'infinium-o2';
FieldTypeRequiredDescription
taskObjectivestringYesThe goal of the task
requiredDeliverablesstring[]NoWhat the agent should produce
constraintsstring[]NoRules the agent should follow
acceptanceCriteriastring[]NoHow to judge success

EnvironmentContext

Runtime metadata about the execution environment.

import type { EnvironmentContext } from 'infinium-o2';
FieldTypeDescription
frameworkstring | undefinedFramework name (e.g., 'langchain', 'crewai')
frameworkVersionstring | undefinedFramework version
nodeVersionstring | undefinedNode.js version
sdkVersionstring | undefinedInfinium SDK version (auto-populated)
runtimestring | undefinedRuntime environment
regionstring | undefinedDeployment region
customTagsRecord<string, string> | undefinedCustom key-value tags

Configuration Types

ClientConfig

import type { ClientConfig } from 'infinium-o2';
FieldTypeRequiredDescription
agentIdstringYesAgent UUID
agentSecretstringYesAgent secret key
baseUrlstringNoAPI base URL
timeoutnumberNoRequest timeout in ms
maxRetriesnumberNoMax retry attempts
enableRateLimitingbooleanNoEnable rate limiting
requestsPerSecondnumberNoRate limit threshold
userAgentstringNoCustom User-Agent
enableLoggingbooleanNoEnable logging
logLevelstringNoLog level

RequestOptions

import type { RequestOptions } from 'infinium-o2';
FieldTypeDescription
timeoutnumber | undefinedOverride timeout for this request
retriesnumber | undefinedOverride retries for this request
retryDelaynumber | undefinedOverride retry delay
headersRecord<string, string> | undefinedAdditional headers

RetryConfig

import type { RetryConfig } from 'infinium-o2';
FieldTypeDescription
attemptsnumberMax retry attempts
delaynumberBase delay in ms
factornumber | undefinedBackoff multiplier (default: 2)
maxDelaynumber | undefinedMax delay cap in ms (default: 30000)
retryConditionfunction | undefinedCustom retry predicate

RateLimiterConfig

import type { RateLimiterConfig } from 'infinium-o2';
FieldTypeDescription
requestsPerSecondnumberRequests per second
burstSizenumber | undefinedMax burst (default: 2x requestsPerSecond)