> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superwire.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Expressions

> Values and operations used inside declarations.

Expressions appear in provider settings, model settings, dynamic blocks, agent instructions, bindings, and final outputs.

## Literals

```wire theme={"languages":{"custom":["/languages/wire.tmLanguage.json"]}}
"hello"
123
12.5
true
false
```

## References

```wire theme={"languages":{"custom":["/languages/wire.tmLanguage.json"]}}
input.topic
secrets.api_key
agent.extract.summary
dynamic.project_context
```

Use `.*.` to pluck a field from each item in an array. The result is an array of the selected values.

```wire theme={"languages":{"custom":["/languages/wire.tmLanguage.json"]}}
input.attachments.*.video_url
dynamic.video_recording_answers.answers.*.url
```

For example, if `attachments` is `[{ video_url: "a.mp4" }, { video_url: "b.mp4" }]`, then `input.attachments.*.video_url` evaluates to `["a.mp4", "b.mp4"]`. Missing fields, non-object items, and null values become `null`. Use `.**.` to filter those null values out, or `.***.` to reject null and mixed-type plucked values. These operators are only valid on arrays.

## Arrays and objects

```wire theme={"languages":{"custom":["/languages/wire.tmLanguage.json"]}}
["bug", "feature", "question"]

{
    project_id: input.project_id
    task_id: input.task_id
}
```

## Dynamic blocks

A `dynamic` block builds an object at runtime. Each field is evaluated as a normal expression.

```wire theme={"languages":{"custom":["/languages/wire.tmLanguage.json"]}}
dynamic {
    example: 123
    readme: read resource.project_readme
    instructions: render prompt.writer_instructions
    another: {
        value: 123
    }
}
```

Dynamic fields may contain literals, object values, resource reads, prompt renders, agent outputs, tool calls, and other supported runtime expressions.

## Assets

Use `asset` to attach model-supported assets to an instruction. The source can be a URL, a `data:*;base64,...` value, a runtime string expression, or an array of strings.

```wire theme={"languages":{"custom":["/languages/wire.tmLanguage.json"]}}
agent analyzer {
    model: model.vision

    instruction: "What is in this image? {{ asset input.image_url }}"

    output {
        result: string
    }
}
```

Assets can also be stored in `dynamic` blocks and referenced later.

```wire theme={"languages":{"custom":["/languages/wire.tmLanguage.json"]}}
dynamic {
    image: asset "https://example.com/image.png"
    video: asset "https://example.com/demo.mp4" {
        type: "video"
        media_type: "video/mp4"
    }
    videos: asset input.attachments.*.video_url {
        type: "video"
    }
}
```

Supported asset options are:

| Option       | Purpose                                                                    |
| ------------ | -------------------------------------------------------------------------- |
| `type`       | Explicit asset kind: `image`, `video`, or `document`.                      |
| `media_type` | Explicit MIME type such as `image/png`, `video/mp4`, or `application/pdf`. |
| `title`      | Optional title for document-like assets.                                   |
| `context`    | Optional context for document-like assets.                                 |
| `citations`  | Enables or disables provider citations when supported.                     |

Model profiles must declare the asset kinds they support with `assets`.

## Tool calls

Use `bindings {}` to assign runtime values to the tool input schema.

```wire theme={"languages":{"custom":["/languages/wire.tmLanguage.json"]}}
dynamic {
    task: call tool.fetch_task {
        bindings {
            task_id: input.task_id
        }
    }
}
```

## Resources and prompts

```wire theme={"languages":{"custom":["/languages/wire.tmLanguage.json"]}}
dynamic {
    readme: read resource.project_readme
    instructions: render prompt.writer_instructions
}
```

## Context continuation

```wire theme={"languages":{"custom":["/languages/wire.tmLanguage.json"]}}
agent continue_investigation {
    context: agent.investigate_task
}
```

`context: agent.name` passes the prior agent's message history so another agent can continue the work.
