Skip to main content

MachineTool

Enum MachineTool 

Source
pub enum MachineTool {
Show 31 variants Move { x: f64, y: f64, }, Click { x: Option<f64>, y: Option<f64>, down_ms: Option<f64>, button: Option<MouseButton>, count: Option<f64>, }, Drag { to: Point, from: Option<Point>, down_ms: Option<f64>, }, Scroll { delta_x: Option<f64>, delta_y: Option<f64>, }, Type { text: String, }, Press { x: f64, y: f64, button: Option<MouseButton>, }, Pointer { x: f64, y: f64, }, Release { x: f64, y: f64, button: Option<MouseButton>, }, Wheel { x: f64, y: f64, delta_x: f64, delta_y: f64, }, Keys { strokes: Vec<KeyStroke>, }, Windows, Focus { window: f64, }, Place { window: f64, x: f64, y: f64, }, Resize { window: f64, width: f64, height: f64, }, Close { window: f64, }, Reload { window: f64, }, Open { app: WindowApp, url: Option<String>, path: Option<String>, command: Option<String>, }, Key { keys: Vec<String>, window: Option<f64>, }, PageHtml { window: Option<f64>, }, PageScript { script: String, window: Option<f64>, }, List { path: Option<String>, pattern: Option<String>, }, Grep { pattern: String, path: Option<String>, glob: Option<String>, ignore_case: Option<bool>, context: Option<f64>, output: Option<GrepOutput>, max: Option<f64>, }, Read { path: String, line: Option<f64>, before: Option<f64>, after: Option<f64>, }, Write { path: String, text: String, }, Replace { path: String, old: String, new: String, all: Option<bool>, }, Insert { path: String, after: f64, text: String, }, Remove { path: String, start: f64, end: f64, }, Processes { sort: Option<ProcessSort>, limit: Option<f64>, filter: Option<String>, }, Kill { pid: f64, signal: Option<ProcessSignal>, }, Internet { mode: InternetMode, }, Wait { seconds: f64, },
}
Expand description

Everything a seat or an agent does on a machine. Positions are desktop pixels. Paths are relative to /repository, and / is the repository root.

Variants§

§

Move

Fields

§

Click

count clicks in a row (2 is a double click). A click on the same spot right after another continues its run, the way a person’s quick second click does.

Fields

§down_ms: Option<f64>
§count: Option<f64>
§

Drag

Fields

§down_ms: Option<f64>
§

Scroll

Fields

§delta_x: Option<f64>
§delta_y: Option<f64>
§

Type

Fields

§text: String
§

Press

A person’s own input, sent as it happens: a button goes down and up where the pointer is, pointer moves it while a button is down (a drag), the wheel turns at a point, and keys go down and up in order. Each lands at once; agents use the tools above.

Fields

§

Pointer

Fields

§

Release

Fields

§

Wheel

Fields

§delta_x: f64
§delta_y: f64
§

Keys

Fields

§strokes: Vec<KeyStroke>
§

Windows

§

Focus

Fields

§window: f64
§

Place

Fields

§window: f64
§

Resize

Fields

§window: f64
§width: f64
§height: f64
§

Close

Fields

§window: f64
§

Reload

Load a Web window’s page again, after its files change. Previews follow their file on their own.

Fields

§window: f64
§

Open

A web window at url; a files window at path (a folder of /repository); the file at path in an editor (text and code) or a preview (images, PDFs, video, audio), which follows the file as it changes; or a terminal, running command in view and staying open at a prompt when it ends.

Fields

§command: Option<String>
§

Key

A chord like [‘ctrl’, ‘s’]. Focuses window first when given.

Fields

§keys: Vec<String>
§window: Option<f64>
§

PageHtml

The page in Web window window, or the focused one: { url, html } as JSON, the HTML trimmed to the body without styles, scripts and SVG.

Fields

§window: Option<f64>
§

PageScript

Runs script in the page of Web window window, or the focused one: its result as text, a string as it is and anything else as JSON.

Fields

§script: String
§window: Option<f64>
§

List

Fields

§pattern: Option<String>
§

Grep

Fields

§pattern: String
§ignore_case: Option<bool>
§context: Option<f64>
§

Read

Fields

§path: String
§line: Option<f64>
§before: Option<f64>
§after: Option<f64>
§

Write

Fields

§path: String
§text: String
§

Replace

Fields

§path: String
§

Insert

Fields

§path: String
§after: f64
§text: String
§

Remove

Fields

§path: String
§start: f64
§end: f64
§

Processes

Fields

§limit: Option<f64>
§filter: Option<String>
§

Kill

Stops only the agent user’s own processes, never the machine’s or the desktop’s.

Fields

§pid: f64
§

Internet

How the machine reaches the internet: private only from a residential address, billed per GB to whoever pays for the machine, or public from its own.

Fields

§

Wait

Pause, then look again. Costs machine time but no model calls; at most WAIT_MAX_SECONDS a call.

Fields

§seconds: f64

Trait Implementations§

Source§

impl Clone for MachineTool

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MachineTool

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for MachineTool

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for MachineTool

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for MachineTool

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for MachineTool

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more