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

FieldRequiredDescription
typeYesData type: string, number, boolean, unknown
descriptionNoDescribes what this input is for
optionalNoIf true, consumer doesn't have to provide it
defaultNoDefault 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

FieldRequiredDescription
typeYesData type: string, number, boolean, unknown
descriptionNoDescribes the resource purpose
defaultNoInitial value
readonlyNoIf 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

FieldRequiredDescription
typeYesData type: string, number, boolean, unknown
descriptionNoDescribes what this variable stores
defaultNoInitial value

Using Variables

Set variables as output from blocks:

yaml

Scoping

TypeScopePersistenceSynced to Consumer
inputSessionImmutableYes (at creation)
resourcesSessionPersists across triggersYes (via callbacks)
variablesSessionPersists across triggersNo (internal only)