Skip to main content
Superwire types describe input, secrets, schema fields, tool contracts, and agent outputs.

Primitives

string
number
float
boolean
null
object is also available as a broad object type when you do not want to define fixed fields.
object

Objects

{
    title: string
    score: number
}
Inline object fields use commas:
{ title: string, score: number }

Arrays

[string]
[number]
[schema.participant]
Fixed-length arrays use a semicolon:
[string; 3]

Tuples

(string, number)
(string, number, [string; 3])

Unions and nullable types

Use | when a value may be one of multiple types:
string | number
schema.contact.email | schema.contact.phone
Use maybe as nullable shorthand:
maybe string
maybe string is equivalent to string | null.

Enums

Inline enum variants use commas:
enum { draft, ready, published }
Multiline enum variants do not require commas:
enum {
    draft
    ready
    published
}

Schema references

schema participant {
    name: string
    role: string
}

schema article {
    title: string
    author: schema.participant
}

Variants

Use variant for tagged unions where each case has its own object shape.
schema event_payload {
    payload: variant type {
        user_created {
            user_id: string
        }

        "user.deleted" {
            user_id: string
            reason: maybe string
        }
    }
}
You can also define a root-level variant directly on a schema:
schema api_event {
    variant type {
        created {
            id: string
        }

        deleted {
            id: string
        }
    }
}