Skip to main content

Module actions

Module actions 

Source
Expand description

The five things the model may do inside the working folder: read a file, list a folder, search for text, edit a file and run a command.

The model asks for an action in tool-use form (a tool name and a JSON input). Action parses that request, Workspace::preview shows what it would do without changing anything, and Workspace::perform does it. Every path is confined to the workspace folder, and every failure becomes an Outcome with a sentence the model can act on. This module knows nothing about the screen: the application maps these types to its widgets.

Structs§

DiffLine
One line of a Preview::Diff.
Lines
Which lines of a file a read asks for. Both numbers count from 1 and both ends are inside the range; neither one given is the top of the file, as it was before.
Outcome
What an action did, as the tool result for the model.
Workspace
The folder the actions are confined to.

Enums§

Action
One action the model asked for.
ActionKind
Which of the five actions an Action is, without its details.
Change
How a DiffLine changes.
Preview
What an action would do, shown on the approval card before anything changes.