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
impl Caller
Sourcepub fn authenticated(
user_public_key: [u8; 32],
device_public_key: [u8; 32],
) -> Self
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.
Sourcepub fn own_key(
user_public_key: [u8; 32],
device_public_key: [u8; 32],
label: &str,
) -> Self
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.
Sourcepub const fn key(&self) -> Option<&KeyCall>
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.
Sourcepub fn visitor(device_public_key: [u8; 32]) -> Self
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).
Sourcepub fn placed(
device_public_key: [u8; 32],
person: [u8; 32],
workspace: impl Into<String>,
channels: impl IntoIterator<Item = [u8; 32]>,
) -> Self
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).
Sourcepub const fn placed_records(&self) -> Option<&PlacedCaller>
pub const fn placed_records(&self) -> Option<&PlacedCaller>
What a placed device’s certificate says of this caller (Self::placed).
Sourcepub fn invited(device_public_key: [u8; 32], invited: Invited) -> Self
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.
Sourcepub const fn invitation(&self) -> Option<&Invited>
pub const fn invitation(&self) -> Option<&Invited>
The invitation this caller redeems (Self::invited).
Sourcepub fn local_person(person: impl Into<PersonId>) -> Self
pub fn local_person(person: impl Into<PersonId>) -> Self
A person on a connection the provider admitted itself, by the id that admission established.
Sourcepub fn own_person(person: impl Into<PersonId>) -> Self
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.
Sourcepub const fn is_own_connection(&self) -> bool
pub const fn is_own_connection(&self) -> bool
Whether this is the person on their own device’s daemon connection
(Self::own_person).
Sourcepub const fn on_own_connection(self) -> Self
pub const fn on_own_connection(self) -> Self
The same caller, as the person on their own device’s daemon connection.
Sourcepub const fn in_process(self) -> Self
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.
Sourcepub const fn is_in_process(&self) -> bool
pub const fn is_in_process(&self) -> bool
Whether the device’s own code asked this in process (Self::in_process).
Sourcepub const fn in_engine_turn_here(self) -> Self
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.
Sourcepub const fn is_engine_turn_here(&self) -> bool
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).
Sourcepub fn local_system() -> Self
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.
Sourcepub const fn is_system(&self) -> bool
pub const fn is_system(&self) -> bool
Whether this is the device’s operating system (Self::local_system).
Sourcepub fn local_agent(
agent_id: impl Into<String>,
person: impl Into<PersonId>,
) -> Self
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.
Sourcepub fn local_bot(installation: impl Into<String>) -> Self
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.
Sourcepub fn local_app(app_id: impl Into<String>) -> Self
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.
Sourcepub fn launched(app_id: impl Into<String>) -> Self
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.
Sourcepub const fn launched_app(&self) -> Option<&AppId>
pub const fn launched_app(&self) -> Option<&AppId>
The app this device’s daemon launched this caller’s process as (Self::launched).
Sourcepub fn delegated_agent(
agent_id: impl Into<String>,
user_public_key: [u8; 32],
device_public_key: [u8; 32],
) -> Self
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.
Sourcepub fn handed_agent(
agent_id: impl Into<String>,
user_public_key: [u8; 32],
device_public_key: [u8; 32],
owner: [u8; 32],
) -> Self
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.
Sourcepub fn agent_turn(
(agent_id, own): (impl Into<String>, impl Into<PersonId>),
person: impl Into<PersonId>,
turn: Turn,
) -> Self
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.
Sourcepub fn bot(
installation: impl Into<String>,
user_public_key: [u8; 32],
device_public_key: [u8; 32],
) -> Self
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.
Sourcepub fn in_new_execution(self) -> Self
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.
Sourcepub fn in_execution(self, execution: ExecutionLease) -> Self
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.
Sourcepub fn execution_id(&self) -> Option<Uuid>
pub fn execution_id(&self) -> Option<Uuid>
Provider-issued execution identity. An identifier alone conveys no authority.
pub fn execution_lease(&self) -> Option<ExecutionLease>
pub fn execution_is_live(&self) -> bool
Sourcepub fn continues(&self, owner: &Self) -> bool
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.
Sourcepub fn follows(&self, owner: &Self) -> bool
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.
Sourcepub fn retire_execution(&self)
pub fn retire_execution(&self)
A transport ends its own run; retained caller clones cannot reopen it.
Sourcepub fn from_foreign_device(self, foreign: bool) -> Self
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.
Sourcepub fn acting_for(self, person: impl Into<PersonId>) -> Self
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.
Sourcepub fn through_app(self, app: impl Into<String>) -> Self
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.
Sourcepub fn delegated_to(self, agent_id: impl Into<String>) -> Self
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.
Sourcepub fn session_handed(self) -> Self
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.
Sourcepub fn named(self, name: &str) -> Self
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.
Sourcepub fn in_named_session(self, message: &RemoteActionMessage) -> Self
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.
Sourcepub fn in_session_of(self, request: &InvokeRequest) -> Self
pub fn in_session_of(self, request: &InvokeRequest) -> Self
Self::in_named_session for the call request.
Sourcepub fn in_agent_session(self, session: impl Into<String>) -> Self
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.
Sourcepub fn asked(self, request: &str) -> Self
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.
Sourcepub fn agent_called(&self) -> Option<&str>
pub fn agent_called(&self) -> Option<&str>
What an agent caller is called: its name (Self::named), else its id.
Sourcepub fn agent_name(&self) -> Option<&str>
pub fn agent_name(&self) -> Option<&str>
The name an agent caller goes by (Self::named).
Sourcepub fn on_roster(self, created_at: i64, person: [u8; 32]) -> Self
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.
Sourcepub fn agent_of(self, owner: impl Into<PersonId>) -> Self
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.
Sourcepub fn on_roster_turn(self, turn: Turn) -> Self
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.
Sourcepub fn working_under(self, agent_id: impl Into<String>, name: &str) -> Self
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).
Sourcepub fn approved_agent(&self) -> Option<&str>
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.
Sourcepub const fn turn_person(&self) -> Option<&[u8; 32]>
pub const fn turn_person(&self) -> Option<&[u8; 32]>
The person a roster agent works for (Self::on_roster).
Sourcepub const fn roster_created_at(&self) -> Option<i64>
pub const fn roster_created_at(&self) -> Option<i64>
The creation time of the roster entry the provider bound this turn to.
Sourcepub fn is_device_agent(&self) -> bool
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.
Sourcepub fn is_session_delegated(&self) -> bool
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.
Sourcepub fn turn(&self) -> Option<&Turn>
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.
Sourcepub fn acting_for_person(&self) -> Option<&str>
pub fn acting_for_person(&self) -> Option<&str>
The person this caller acts for, when it is not that person.
Sourcepub fn running_shortcut(self, id: impl Into<String>) -> Self
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.
Sourcepub fn consented_in_advance(self) -> Self
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.
Sourcepub const fn is_consented_in_advance(&self) -> bool
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).
Sourcepub const fn acting(&self) -> &Acting
pub const fn acting(&self) -> &Acting
Who an action this caller invokes is decided for, as the transport
admitted it (tilo_action_policy::Acting).
Sourcepub fn certified(&self, workspace: &str) -> Vec<Grant>
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.
Sourcepub fn granted(&self) -> Vec<Grant>
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.
Sourcepub fn granting(self, grants: Vec<Grant>) -> Self
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.
Sourcepub fn session_group(&self, id: impl Into<String>) -> WorkGroup
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.
Sourcepub fn agent_session(&self) -> Option<WorkGroup>
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.
Sourcepub const fn forwarded_by(self, device: [u8; 32]) -> Self
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.
Sourcepub const fn forwarder(&self) -> Option<&[u8; 32]>
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).
Sourcepub fn in_workspace(self, workspace: impl Into<String>) -> Self
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.
Sourcepub const fn user_public_key(&self) -> Option<&[u8; 32]>
pub const fn user_public_key(&self) -> Option<&[u8; 32]>
The user root a remote device chains to.
pub const fn is_foreign_device(&self) -> bool
Sourcepub const fn device_public_key(&self) -> Option<&[u8; 32]>
pub const fn device_public_key(&self) -> Option<&[u8; 32]>
The remote device that sent the request.
Sourcepub fn kept(&self) -> KeptCaller
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
impl Caller
Sourcepub fn within(self, reach: Reach) -> Self
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.
Sourcepub const fn ceiling(&self) -> Option<Reach>
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§
impl Eq for Caller
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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