Input & Resources
Inputs are provided when creating a session. Resources are persistent state the agent can read and write.
Input Variables
Define inputs that consumers must (or may) provide:
yaml
Input Definition
| Field | Required | Description |
|---|---|---|
type | Yes | Data type: string, number, boolean, unknown |
description | No | Describes what this input is for |
optional | No | If true, consumer doesn't have to provide it |
default | No | Default value if not provided (defaults to "NONE") |
Using Inputs
When creating a session, pass input values:
typescript
In prompts, reference with {{INPUT_NAME}}:
markdown
Note: Variables must be UPPER_SNAKE_CASE. Nested properties (dot notation like {{VAR.property}}) are not supported. Objects are serialized as JSON when interpolated.
Resources
Resources are persistent state that:
- Survive across triggers
- Can be read and written by the agent
- Are synced to the consumer's application
yaml
Resource Definition
| Field | Required | Description |
|---|---|---|
type | Yes | Data type: string, number, boolean, unknown |
description | No | Describes the resource purpose |
default | No | Initial value |
readonly | No | If true, agent cannot write to it |
Writing Resources
Use the set-resource block in handlers:
yaml
Resource Events
When a resource is updated, the client SDK receives a resource-update event:
typescript
Variables
Variables are internal state managed by block outputs. They persist across triggers but are not synced to the consumer (unlike resources).
yaml
Variable Definition
| Field | Required | Description |
|---|---|---|
type | Yes | Data type: string, number, boolean, unknown |
description | No | Describes what this variable stores |
default | No | Initial value |
Using Variables
Set variables as output from blocks:
yaml
Scoping
| Type | Scope | Persistence | Synced to Consumer |
|---|---|---|---|
input | Session | Immutable | Yes (at creation) |
resources | Session | Persists across triggers | Yes (via callbacks) |
variables | Session | Persists across triggers | No (internal only) |