Skip to main content

Caller

Struct Caller 

Source
pub struct Caller { /* private fields */ }
Expand description

The authenticated actor behind a request.

Built only by the transport that authenticated the connection — from the certificate chain a peer presented, or from the admitted identity of a local connection. It is deliberately not Deserialize: a payload cannot assert who sent it.

Implementations§

Source§

impl Caller

Source

pub fn authenticated( user_public_key: [u8; 32], device_public_key: [u8; 32], ) -> Self

A remote device whose certificate the transport verified to chain to user_public_key.

Source

pub fn own_key( user_public_key: [u8; 32], device_public_key: [u8; 32], label: &str, ) -> Self

One of the person’s own keys, the certificate the transport verified said it is one of theirs (device_label is the name they gave it): a server key made for their programs, whose calls are their own — their grants decide every call, narrowed by the key’s certificate, and it is never anything more. Beside the person it acts as, the caller carries the key (KeyCall), so a listing says the key’s call is the key’s.

Source

pub const fn key(&self) -> Option<&KeyCall>

The key this caller’s call came in on (Self::own_key), where it did: whose name and member it is, never a second person’s.

Source

pub fn visitor(device_public_key: [u8; 32]) -> Self

A visitor: a key no certificate in the workspace names, known by the key its connection proved alone. A page at a workspace’s public entry is one, and so is a computer being added to a person’s devices while it asks to be certified. It acts for nobody, so it holds only what the workspace opens to any key (tilo_action_policy::Grantee::AnyKey).

Source

pub fn placed( device_public_key: [u8; 32], person: [u8; 32], workspace: impl Into<String>, channels: impl IntoIterator<Item = [u8; 32]>, ) -> Self

A device placed for records of workspace, the channels its certificate names, by a host for person: the transport read them from that verified certificate. It acts as its device’s key alone, never as the person and never as a member’s device: it has no person, no user key and nobody it acts for, so nothing that decides by those reaches it, and what it may do is decided by the records it reaches (Self::placed_records).

Source

pub const fn placed_records(&self) -> Option<&PlacedCaller>

What a placed device’s certificate says of this caller (Self::placed).

Source

pub fn invited(device_public_key: [u8; 32], invited: Invited) -> Self

A visitor redeeming invited: the device device_public_key its connection proved, acting by the authority of the invitation’s issuer and nothing more. The action that admits it checks the invitation, and the issuer’s grant, when it runs.

Source

pub const fn invitation(&self) -> Option<&Invited>

The invitation this caller redeems (Self::invited).

Source

pub fn local_person(person: impl Into<PersonId>) -> Self

A person on a connection the provider admitted itself, by the id that admission established.

Source

pub fn own_person(person: impl Into<PersonId>) -> Self

The person on a plain connection to their own device’s daemon, which the kernel says is their own account (crate::remote::Caller): their calls are their own act, and the answer their CLI’s own prompt gives on it to what the workspace asks them is their confirmation (crate::remote::asked). Making the call is never that answer.

Source

pub const fn is_own_connection(&self) -> bool

Whether this is the person on their own device’s daemon connection (Self::own_person).

Source

pub const fn on_own_connection(self) -> Self

The same caller, as the person on their own device’s daemon connection.

Source

pub const fn in_process(self) -> Self

The same caller, asked by the device’s own code in process rather than over a link: only the service that answers it sets this.

Source

pub const fn is_in_process(&self) -> bool

Whether the device’s own code asked this in process (Self::in_process).

Source

pub const fn in_engine_turn_here(self) -> Self

The same caller, calling from a turn this device’s agent engine runs here: where the call comes from, never what it may do. Its identity stays the agent’s, and its calls are decided on the agent’s grants as any other’s. Only the engine that runs the turn sets this.

Source

pub const fn is_engine_turn_here(&self) -> bool

Whether this call comes from a turn this device’s agent engine runs here (Self::in_engine_turn_here).

Source

pub fn local_system() -> Self

The device’s operating system on a local connection the provider admitted as its superuser: what signs people in at the device and out of it. It acts for nobody, so it has nothing in any workspace; only the device’s own actions answer it.

Source

pub const fn is_system(&self) -> bool

Whether this is the device’s operating system (Self::local_system).

Source

pub fn local_agent( agent_id: impl Into<String>, person: impl Into<PersonId>, ) -> Self

A delegated agent of person on a connection the provider admitted itself, acting for them.

Source

pub fn local_bot(installation: impl Into<String>) -> Self

An installed bot on a connection the provider admitted itself, by its installation: software, never a person, whatever its id spells.

Source

pub fn local_app(app_id: impl Into<String>) -> Self

An application on a connection the provider admitted itself, by the package id that admission established. It acts as the person whose session runs it (Self::acting_for), in that app; with nobody behind it, it acts by itself, with only the grants that name it.

Source

pub fn launched(app_id: impl Into<String>) -> Self

App app_id, in the process this device’s daemon launched it as and attests to be it (Self::local_app): the one caller that may act as the app itself, with the grants that name it. Set only where the daemon attests the process; nothing restored or carried is it.

Source

pub const fn launched_app(&self) -> Option<&AppId>

The app this device’s daemon launched this caller’s process as (Self::launched).

Source

pub fn delegated_agent( agent_id: impl Into<String>, user_public_key: [u8; 32], device_public_key: [u8; 32], ) -> Self

A remote agent device whose certificate the transport verified to chain to user_public_key and whose root-signed delegation names it agent agent_id. It is its own member, never the person who delegated it.

Source

pub fn handed_agent( agent_id: impl Into<String>, user_public_key: [u8; 32], device_public_key: [u8; 32], owner: [u8; 32], ) -> Self

An agent a device handed its session to: user_public_key’s root certified the key device_public_key for agent_id, which is the device of owner, not the agent’s person’s. The change names the agent acting for its person, and owner’s device as the one that ran it.

Source

pub fn agent_turn( (agent_id, own): (impl Into<String>, impl Into<PersonId>), person: impl Into<PersonId>, turn: Turn, ) -> Self

The agent agent_id of own acting inside a turn: person’s message in turn’s conversation caused it, and the agent takes part there. It may do exactly what that person may, held to the bound its own record carries, and its reads are decided inside the turn, so a conversation’s own rules apply to them. Set only by the host that admitted the turn.

Source

pub fn bot( installation: impl Into<String>, user_public_key: [u8; 32], device_public_key: [u8; 32], ) -> Self

A bot device whose certificate chains to user_public_key (its installer) and whose root-signed delegation names it installation installation. It acts for its installer and is never that person.

Source

pub fn in_new_execution(self) -> Self

Give an already admitted connection its own execution scope. The provider mints the identifier; no payload, display name or history run selects it. This changes invocation ownership, never the caller’s permissions.

Source

pub fn in_execution(self, execution: ExecutionLease) -> Self

Retain a provider-issued execution when projecting the same transport into another verified action API. A lease conveys ownership and lifetime, never certificate ownership or additional permissions.

Source

pub fn execution_id(&self) -> Option<Uuid>

Provider-issued execution identity. An identifier alone conveys no authority.

Source

pub fn execution_lease(&self) -> Option<ExecutionLease>

Source

pub fn execution_is_live(&self) -> bool

Source

pub fn continues(&self, owner: &Self) -> bool

Whether this caller may follow, ask again or cancel an invocation owner started: it is owner, or owner’s connection ended and this is the same caller on a connection admitted after that. A device or key whose connection dropped in the middle of a long import (one does, now and then) keeps the invocations it started; a second live connection of the same device still borrows none of the first’s.

Source

pub fn follows(&self, owner: &Self) -> bool

Whether this caller may follow or cancel an invocation owner started: as Self::continues, or it is the device that brought owner’s call, in the run it brought it in, which hands the caller what became of the call as it handed them its first receipt. Never whether it may ask the invocation again as its own.

Source

pub fn retire_execution(&self)

A transport ends its own run; retained caller clones cannot reopen it.

Source

pub fn from_foreign_device(self, foreign: bool) -> Self

Mark whether the caller acts from a foreign device: a Tilo runtime on an operating system Tilo does not control, as its certificate says. Workspaces it does not govern cap such a caller’s role.

Source

pub fn acting_for(self, person: impl Into<PersonId>) -> Self

The caller acts for person: an agent or an app the person started. Set only by the provider that admitted the delegation, never from a payload. It names who the actor works for in presence and history; it widens nothing.

Source

pub fn through_app(self, app: impl Into<String>) -> Self

The caller, acting through the app app the provider admitted its connection for: an app process acting as its person. Set only by that provider, never from a payload. The one reader bounds what such a caller keeps open of a record by what the app declares.

Source

pub fn delegated_to(self, agent_id: impl Into<String>) -> Self

This person’s own device hands the connection to agent agent_id, acting for them: a program in the workspace’s machine its person let in, which has no key of its own yet. The agent is the actor, and it may do only what both the person and the delegation a device gives its agents allow. A caller that is not a person is returned as it is.

Source

pub fn session_handed(self) -> Self

Mark this agent caller as one a device handed its session to: the mark Self::delegated_to sets, for a caller whose certificate the transport verified and whose admission said a member’s own session runs it. Set only by that admission, never from a payload; changes nothing for a caller that is not an agent.

Source

pub fn named(self, name: &str) -> Self

An agent caller named name, as the certificate the transport verified for its key says (device_label): what History names its changes by. Names nothing for a caller that is not an agent.

Source

pub fn in_named_session(self, message: &RemoteActionMessage) -> Self

An agent caller as message says the session it works in is called: by that name (super::InvokeRequest::said_session_name), where its client named one, and by the name it went by else. One name for everything the agent does here: the window it opens, the message it writes, its History rows and the questions it puts to its person. Display only, like the session’s name itself; it grants nothing and changes no member id.

Source

pub fn in_session_of(self, request: &InvokeRequest) -> Self

Self::in_named_session for the call request.

Source

pub fn in_agent_session(self, session: impl Into<String>) -> Self

An agent caller working in the agent session session: what its changes are grouped and taken back by. Set only by the provider that admitted the session; names nothing for a caller that is not an agent.

Source

pub fn asked(self, request: &str) -> Self

An agent caller working on request, the words of the person that started its session (their message, what they sent it): its first line, trimmed and bounded, labels the session (Self::agent_session). A blank request leaves the session labelled by the agent’s name.

Source

pub fn agent_called(&self) -> Option<&str>

What an agent caller is called: its name (Self::named), else its id.

Source

pub fn agent_name(&self) -> Option<&str>

The name an agent caller goes by (Self::named).

Source

pub fn on_roster(self, created_at: i64, person: [u8; 32]) -> Self

Bind a certified agent caller to the hosted roster entry it was approved as, answering person: the author of the message whose turn it answers, as its provider read it. The agent’s own key still signs: every call is decided for person, bounded by the agent and by the person it belongs to (Acting::agent_of, tilo_action_policy::Acting::signed_by), so the turn does only what both the agent and person may, whoever the agent belongs to. The workspace service must verify this binding.

Source

pub fn agent_of(self, owner: impl Into<PersonId>) -> Self

This agent caller as the agent of owner, the person it belongs to, answering whoever it acts for (Acting::agent_of): where that is someone else, owner bounds it too. Set only by the provider that runs the agent, from the agent’s own record. Changes nothing for a caller that is not an agent.

Source

pub fn on_roster_turn(self, turn: Turn) -> Self

A caller bound to its roster entry (Self::on_roster), inside turn. Changes nothing for a caller that is not so bound.

Source

pub fn working_under(self, agent_id: impl Into<String>, name: &str) -> Self

The agent agent_id, named name, working under this roster agent’s approval: a sub-agent its starter started. It acts as itself, so what it writes and says is its own, for the same person, as one more actor in its starter’s chain (Acting::handed_on): the starter, the person its turn answers and the person the starter belongs to all bound it. Every change it makes is signed by the starter’s key, whose approval bounds that tree too (Acting::signed_by). It holds no approval of its own. Changes nothing for a caller not bound to its roster entry (Self::on_roster).

Source

pub fn approved_agent(&self) -> Option<&str>

The roster agent whose approval a caller bound to its roster entry acts under (Self::on_roster): the acting agent itself, or the starter of a sub-agent (Self::working_under). None for any other caller.

Source

pub const fn turn_person(&self) -> Option<&[u8; 32]>

The person a roster agent works for (Self::on_roster).

Source

pub const fn roster_created_at(&self) -> Option<i64>

The creation time of the roster entry the provider bound this turn to.

Source

pub fn is_device_agent(&self) -> bool

Whether this is an agent a person’s own device runs with a key of its own, outside a roster turn: an MCP client, a local assistant. Its key’s certificate names its person (Self::user_public_key) and every invocation it makes is signed by that key, so this reads nothing a payload says.

Source

pub fn is_session_delegated(&self) -> bool

Whether this agent is one the person’s own device handed its session to (Self::delegated_to): it carries the delegation a device gives its agents. An agent admitted as a member that acts for a person (Self::acting_for) carries only what the workspace grants it.

Source

pub fn turn(&self) -> Option<&Turn>

The turn this agent acts inside (Self::agent_turn), when it was admitted as one: the message whose conversation caused its ops, which every API it reaches decides it against.

Source

pub fn acting_for_person(&self) -> Option<&str>

The person this caller acts for, when it is not that person.

Source

pub fn running_shortcut(self, id: impl Into<String>) -> Self

The caller’s invocations are the steps of Shortcut id’s run: still the person’s authority (bounded by the Shortcut’s own grants, which the runner applies), but the Shortcut is who acts, for the person. Set only by the provider’s Shortcut runner.

Source

pub fn consented_in_advance(self) -> Self

The step of a Shortcut run (Self::running_shortcut) whose action the rules the person saved with the Shortcut consent to in advance: the yes they gave when they saved it, which answers this step’s ask. Set only by the runner, after it checked those rules name this very action; a caller that runs no Shortcut is left as it was.

Source

pub const fn is_consented_in_advance(&self) -> bool

Whether the person’s saved Shortcut consents to this step in advance (Self::consented_in_advance).

Source

pub const fn acting(&self) -> &Acting

Who an action this caller invokes is decided for, as the transport admitted it (tilo_action_policy::Acting).

Source

pub fn certified(&self, workspace: &str) -> Vec<Grant>

The grants this caller’s certificate names for the agent it is in workspace (tilo_action_policy::roles::certified_agent): its person’s default delegation, which the workspace’s own grants naming the agent then narrow. Nothing for a caller no certificate names as an agent: it holds only what the workspace grants it.

The certificate delegates to an agent a device handed its session (Self::delegated_to) or a workspace’s roster bound (Self::on_roster): a caller that only says it is an agent acting for a person, on that person’s key, is named by no session and no roster, and is offered nothing.

Source

pub fn granted(&self) -> Vec<Grant>

The grants made for this caller’s software: its certificate’s (Self::certified), the one place an agent’s rights become grants, so every host and every receiver decides an agent alike. Asked in no workspace (its person’s list of them), the certificate gives the delegation at the root.

Source

pub fn granting(self, grants: Vec<Grant>) -> Self

This caller with grants too, which the transport that admitted it holds for it: what a device hands an app it started, from its signed manifest. Never accepted from a request.

Source

pub fn session_group(&self, id: impl Into<String>) -> WorkGroup

The group a session named id is, as this caller’s provider admitted it: called by what the session was asked (Self::asked), else by the name the provider knows the agent by (Self::named). History groups its changes, Activity lists it and undo takes it back whole.

Source

pub fn agent_session(&self) -> Option<WorkGroup>

The session this caller’s actions are part of, as the provider that admitted it says: an agent (or a key it holds) in an execution the provider minted for its connection works in one session (Self::session_group), whatever the client says of itself. None for anyone else.

Source

pub const fn forwarded_by(self, device: [u8; 32]) -> Self

The request reached here over the link of device, which forwarded it for this caller, who signed it. Set only by the transport that verified both, never from a payload.

Source

pub const fn forwarder(&self) -> Option<&[u8; 32]>

The device whose link brought this caller’s request, when another device than its own did (Self::forwarded_by).

Source

pub fn in_workspace(self, workspace: impl Into<String>) -> Self

Confine the caller to one workspace: the connection was admitted to that workspace only, so nothing outside it is offered or reachable.

Source

pub fn workspace(&self) -> Option<&str>

The workspace this caller is confined to, if any.

Source

pub const fn user_public_key(&self) -> Option<&[u8; 32]>

The user root a remote device chains to.

Source

pub const fn is_foreign_device(&self) -> bool

Source

pub const fn device_public_key(&self) -> Option<&[u8; 32]>

The remote device that sent the request.

Source

pub fn kept(&self) -> KeptCaller

This caller as the host keeps it beside a call that waits for its person’s yes, to admit the call again for it after a restart (KeptCaller). The execution it ran in is not kept: it ended with the process.

Source§

impl Caller

Source

pub fn within(self, reach: Reach) -> Self

The same caller, asking as part of an invocation admitted to reach reach: what goes further runs only once the person confirmed it. It only narrows. Set only by the provider that matched the request to the invocation it continues, never from a payload.

Source

pub const fn ceiling(&self) -> Option<Reach>

How far this caller’s requests reach without the person being asked, when they continue an invocation (Self::within).

Trait Implementations§

Source§

impl Clone for Caller

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 Caller

Source§

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

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

impl Eq for Caller

Source§

impl Hash for Caller

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Caller

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 StructuralPartialEq for Caller

Auto Trait Implementations§

§

impl Forget for Caller

§

impl Freeze for Caller

§

impl Move for Caller

§

impl RefUnwindSafe for Caller

§

impl Send for Caller

§

impl Sync for Caller

§

impl Unpin for Caller

§

impl UnsafeUnpin for Caller

§

impl UnwindSafe for Caller

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<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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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