Skip to main content

Overview

Weavers are ephemeral Kubernetes pods that run Loom REPL sessions in isolated environments. Each weaver:
  • Runs in the loom-weavers namespace
  • Has configurable resource limits (CPU, memory)
  • Supports custom container images
  • Auto-expires after a configurable lifetime (default: 24 hours, max: 48 hours)
  • Provides terminal access via WebSocket
Permissions: Users can only manage weavers they own. System administrators can manage all weavers. Support users have read-only access.

Create Weaver

Provisions a new weaver pod in Kubernetes.

Request Body

image
string
required
Container image to run (e.g., "ghcr.io/loom/weaver:latest")
org_id
string
required
Organization ID (UUID). User must be a member of this organization.
repo_id
string
Repository ID for repo-scoped secrets access
env
object
default:"{}"
Environment variables as key-value pairs
resources
object
Resource limits:
  • memory_limit: e.g., "8Gi"
  • cpu_limit: e.g., "4"
tags
object
default:"{}"
User-defined metadata tags for filtering
lifetime_hours
integer
Time-to-live in hours (max: 48, default: 24)
command
array
Override container ENTRYPOINT
args
array
Override container CMD
workdir
string
Override container WORKDIR

Response

id
string
Weaver ID
pod_name
string
Kubernetes pod name
status
string
One of: pending, running, succeeded, failed, terminating
created_at
string
ISO 8601 timestamp
image
string
Container image
tags
object
User-defined tags
lifetime_hours
integer
Configured lifetime in hours
age_hours
number
Current age in hours
owner_user_id
string
Owner’s user ID

Example

Response (201 Created):
Error (403 Forbidden) if user is not an org member:

List Weavers

Lists weavers. Regular users see only their own weavers. Admins and support see all weavers.

Query Parameters

tag
string[]
Filter by tags (format: key:value). Multiple allowed.

Response

weavers
array
Array of weaver objects
count
integer
Number of weavers returned

Example

Get Weaver

Retrieves details for a specific weaver.

Path Parameters

id
string
required
Weaver ID

Response

Returns a single weaver object.

Example

Error (403 Forbidden) if user doesn’t have access:

Delete Weaver

Deletes a weaver pod. Only the owner or system admin can delete.

Path Parameters

id
string
required
Weaver ID

Response

Returns 204 No Content on success.

Example

Response: 204 No Content

Stream Weaver Logs

Streams logs from the weaver pod via Server-Sent Events (SSE).

Path Parameters

id
string
required
Weaver ID

Query Parameters

tail
integer
default:"256"
Number of lines to tail from the end
timestamps
boolean
default:"true"
Include timestamps in log lines

Response

Returns text/event-stream with log lines as SSE events.

Example

Stream output:

Attach to Weaver Terminal

Attaches to the weaver’s terminal via WebSocket for interactive I/O.

Path Parameters

id
string
required
Weaver ID

Authentication

Use a WebSocket token from /auth/ws-token in the first message:

Access Levels

  • Full access (owner or admin): Can send input and receive output
  • Read-only (support role): Can only view output

Example

Read-only notice (for support users):

Cleanup Expired Weavers

Triggers cleanup of weavers that have exceeded their lifetime. Requires system admin role.

Query Parameters

dry_run
boolean
default:"false"
If true, only list weavers that would be deleted without actually deleting them

Response

dry_run
boolean
Whether this was a dry run
deleted
string[]
Weaver IDs that were deleted (null in dry run)
would_delete
string[]
Weaver IDs that would be deleted (dry run only)
count
integer
Number of weavers affected

Example

Error (403 Forbidden) if not system admin: