Types
All TypeScript types exported by@castari/sdk.
Agent
Represents a Castari agent.| Field | Type | Description |
|---|---|---|
id | string | Unique identifier |
name | string | Display name |
slug | string | URL-safe identifier |
status | AgentStatus | Current status |
source_type | AgentSourceType | 'git' or 'local' |
git_repo_url | string? | Source repository URL |
sandbox_id | string? | Active sandbox ID (when deployed) |
created_at | string | ISO 8601 timestamp |
updated_at | string | ISO 8601 timestamp |
AgentStatus
Possible agent statuses.| Status | Description |
|---|---|
draft | Created but not yet deployed |
deploying | Deployment in progress |
active | Running and ready for invocations |
stopped | Manually stopped |
error | Deployment or runtime error |
AgentSourceType
Source type for agent code.InvocationResponse
Response from invoking an agent.| Field | Type | Description |
|---|---|---|
invocation_id | string | Unique identifier (e.g., inv_abc123) |
session_id | string | Session ID for the invocation |
response_content | string | Agent’s response text |
input_tokens | number | Tokens in the prompt |
output_tokens | number | Tokens in the response |
total_cost_usd | number | string | Total cost in USD |
duration_ms | number | Execution time in milliseconds |
status | string | 'completed' or 'failed' |
InvokeOptions
Options for invoking an agent.| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | The prompt to send |
sessionId | string | No | Session ID for conversation continuity |
CreateAgentOptions
Options for creating an agent.| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Display name for the agent |
slug | string | No | URL-safe identifier (auto-generated if omitted) |
description | string | No | Agent description |
sourceType | AgentSourceType | No | 'git' (default) or 'local' |
gitRepoUrl | string | No | Git repository URL |
UploadResponse
Response from uploading code.Secret
Represents a secret (metadata only — values are never returned).| Field | Type | Description |
|---|---|---|
key | string | Secret name (e.g., OPENAI_API_KEY) |
CastariClientOptions
Options for creating a client.| Field | Type | Description |
|---|---|---|
apiKey | string | API key (starts with cast_) |
token | string | OAuth token |
baseUrl | string | API base URL (default: https://api.castari.com) |
CastariError
Error thrown by SDK operations.| Field | Type | Description |
|---|---|---|
message | string | Human-readable error message |
statusCode | number | HTTP status code |
code | string? | Error code (e.g., agent_not_found) |
Storage v2 Types
The SDK includes types for managed file storage (Storage v2):ManagedFile— File metadata (id, filename, size, scope, tags, status)FileUploadResponse— Upload resultManagedFileList— Paginated file list with metadataStorageUsage— Quota information (total files, bytes, limits)PresignedUpload— Presigned URL for large file uploadsAgentFile— File attached to an agentAgentFileList— List of agent-attached files
Importing Types
All types are exported from the main package:See Also
- CastariClient — Client setup
- Agents API — Agent methods
- Secrets API — Secrets methods
- Auth API — Authentication methods
- Usage API — Usage statistics
- Storage API — Cloud bucket storage
- Mounts API — Agent mounts
- Files API — Managed file storage