Daemon: shares

cua.daemon.v1 ShareService: links to a port, a Space port, a file or a folder that open on your other signed-in devices.

Shares are links the cua daemon owns and serves (cua share): created, listed, stopped and checked through ShareService.

Source: libs/cua/proto/cua/daemon/v1/shares.proto.

ShareService#

cua.daemon.v1.ShareService

Shares of the daemon's machine.

ShareService.CreateShare#

/cua.daemon.v1.ShareService/CreateShare, unary: CreateShareRequest to CreateShareResponse.

Shares a port on this machine, a port in a Space, or a file or folder (read-only), and returns the link. The machine must be on the cua.ai relay (cua host setup); there is no localhost fallback.

ShareService.ListShares#

/cua.daemon.v1.ShareService/ListShares, unary: ListSharesRequest to ListSharesResponse.

The active shares.

ShareService.StopShare#

/cua.daemon.v1.ShareService/StopShare, unary: StopShareRequest to StopShareResponse.

Stops one share, or all of them. The link stops working at once.

ShareService.CheckShare#

/cua.daemon.v1.ShareService/CheckShare, unary: CheckShareRequest to CheckShareResponse.

Opens the share's link once, as its owner would, and reports what came back, so an agent can confirm the link works before handing it over.

ShareService.ApproveShare#

/cua.daemon.v1.ShareService/ApproveShare, unary: ApproveShareRequest to ApproveShareResponse.

Lets a share that waits for the owner go live: a public share an agent in a Space asked for, or the first share through a share edge in a cloud (the owner agrees to the edge's cost). Owner only; never on a Space's spawn channel.

ShareService.DenyShare#

/cua.daemon.v1.ShareService/DenyShare, unary: DenyShareRequest to DenyShareResponse.

Turns down a waiting share.

ShareService.GetShareSettings#

/cua.daemon.v1.ShareService/GetShareSettings, unary: GetShareSettingsRequest to GetShareSettingsResponse.

Where public TCP shares may land, the daily data cap, the default allowlist and the approval rule.

ShareService.SetShareSettings#

/cua.daemon.v1.ShareService/SetShareSettings, unary: SetShareSettingsRequest to SetShareSettingsResponse.

Changes those settings. Owner only.

ShareService.RemoveShareEdge#

/cua.daemon.v1.ShareService/RemoveShareEdge, unary: RemoveShareEdgeRequest to RemoveShareEdgeResponse.

Removes the share edge from the owner's cloud now (its shares end).

Types in cua/daemon/v1/shares.proto#

ShareTarget#

The target of a share.

Field#TypeDescription
kind1ShareTargetKindWhich of the fields below apply.
space2stringThe Space, as sandbox commands name it (dev, local:dev).
port3uint32The port (on the machine, or in the Space).
path4stringAbsolute path of the file or folder.

Share#

One share.

Field#TypeDescription
id1stringHandle for StopShare (share- plus hex).
url2stringThe link.
name3stringName for lists.
target4ShareTargetWhat it serves.
access5ShareAccessWho may open it.
owner6stringThe account that made it (email when known).
created_at7google.protobuf.TimestampWhen it was made.
expires_at8google.protobuf.TimestampWhen it ends. Unset: until stopped (private and team shares only).
notices9repeated stringPlain-words limits of this link worth showing next to it (for example that browsers cannot open it yet). Empty when there are none.
tcp10ShareTcpA public TCP share: where people connect (unset for an HTTP link).
origin11stringThe Space whose agent made the share through its spawn channel; empty when it was made on this computer. The share ends with that Space.
waiting12ShareWaitingSet while the share waits for the owner; it serves nothing until ApproveShare.

ShareWaiting#

Why a share waits for its owner.

Field#TypeDescription
reason1stringapproval (an agent in a Space asked for a public share) or consent (the first share edge in a cloud).
text2stringWhat to show the owner: who asked, or the consent text with the cost.
route_line3stringThe route it would take, in plain words ("Through your AWS account").

ShareTcp#

Where people reach a public TCP share (a raw TCP service in a Space, such as a game server). An experiment, off unless turned on.

Field#TypeDescription
address1stringhost:port on the relay.
host2stringThe relay host.
port3uint32The relay port.
srv_name4stringA name people can type instead of the address (an SRV record, for example mc-1a2b3c4d.m.cua.sh for Minecraft). Empty when there is none.
service5stringThe SRV service (minecraft). Empty when there is none.
route6stringHow people reach it: host (the Space's own machine in the owner's cloud), edge (a share edge in the owner's cloud) or relay (Cua).
route_line7stringThe plain line next to the address ("Through your AWS account", "Through Cua").
cloud8stringThe cloud a host or edge route uses (aws). Empty for relay.
allow9repeated stringWho may connect (CIDRs). Empty: anyone.
check_host10boolMinecraft Java connections that did not dial this address are dropped.
max_bytes11uint64The most data this share may move (its part of the daily cap); 0: no cap.

CreateShareRequest#

Request for ShareService.CreateShare.

Field#TypeDescription
target1ShareTargetWhat to share. Paths are absolute: the client resolves them.
access2ShareAccessWho may open it. Unspecified: private.
ttl3google.protobuf.DurationLifetime, 60 s to 24 h. Public shares default to 1 h; others to none.
name4stringName for lists.
tcp5boolShare the Space port as raw TCP at a public address on the relay (a game server, for example) instead of an HTTP link. Needs a Space port target and public access; lasts 24 h unless ttl says less. An experiment, off unless turned on.
service6stringWith tcp: the SRV service (minecraft), so people can type a name instead of the port.
route7stringWith tcp: the route, auto (or empty), host, edge or relay. Auto takes the Space's own cloud machine when it has one, else a share edge in a linked cloud, else Cua's relay, within the share settings.
allow8repeated stringWith tcp: who may connect (CIDRs or addresses, at most 32). Empty: the settings' default allowlist (usually anyone).
check_host9boolWith tcp: drop Minecraft Java connections that did not dial this share's address (needs service minecraft).
consent10boolWith tcp: the owner agrees now to a share edge the route needs (the consent card was shown). Without it such a share waits for ApproveShare.

ApproveShareRequest#

Request for ShareService.ApproveShare.

Field#TypeDescription
id1stringThe waiting share's id.
always2boolAlso let this share's Space share without asking from now on.

ApproveShareResponse#

Response for ShareService.ApproveShare.

Field#TypeDescription
share1ShareThe share, now live, with its address.

DenyShareRequest#

Request for ShareService.DenyShare.

Field#TypeDescription
id1stringThe waiting share's id.

DenyShareResponse#

Response for ShareService.DenyShare.

No fields.

ShareSettings#

The share settings.

Field#TypeDescription
landing1ShareLandingWhere public TCP shares land.
relay_fallback2boolWhether Cua's relay may carry public TCP shares at all.
daily_cap_mib3uint64The most data public TCP shares may move in a day, in MiB. 0: no cap.
default_allow4repeated stringThe allowlist new shares start with (CIDRs). Empty: anyone.
approve_agent_shares5boolAsk the owner before a share an agent made goes public.
always_allow_spaces6repeated stringSpaces whose agents may share without asking.
edge_consent7repeated stringClouds the owner agreed may hold a share edge.

GetShareSettingsRequest#

Request for ShareService.GetShareSettings.

No fields.

GetShareSettingsResponse#

Response for ShareService.GetShareSettings.

Field#TypeDescription
settings1ShareSettingsThe settings.
used_today2uint64Data public TCP shares moved today, in bytes.
edge_cloud3stringThe share edge, when there is one: its cloud, address and the monthly cost estimate in US dollars.
edge_host4stringThe edge's address.
edge_monthly_usd5doubleAbout what the edge costs a month, in US dollars.

SetShareSettingsRequest#

Request for ShareService.SetShareSettings.

Field#TypeDescription
settings1ShareSettingsThe new settings (all fields).

SetShareSettingsResponse#

Response for ShareService.SetShareSettings.

Field#TypeDescription
settings1ShareSettingsThe settings as saved.

RemoveShareEdgeRequest#

Request for ShareService.RemoveShareEdge.

No fields.

RemoveShareEdgeResponse#

Response for ShareService.RemoveShareEdge.

Field#TypeDescription
stopped1repeated stringShares that ended with it.

CreateShareResponse#

Response for ShareService.CreateShare.

Field#TypeDescription
share1ShareThe share, with its link.

ListSharesRequest#

Request for ShareService.ListShares.

No fields.

ListSharesResponse#

Response for ShareService.ListShares.

Field#TypeDescription
shares1repeated ShareActive shares, newest first.

StopShareRequest#

Request for ShareService.StopShare.

Field#TypeDescription
id1stringA share's id, or its name when that is unique.
all2boolStop every share (id is ignored).

StopShareResponse#

Response for ShareService.StopShare.

Field#TypeDescription
stopped1repeated stringIds of the shares stopped.

CheckShareRequest#

Request for ShareService.CheckShare.

Field#TypeDescription
id1stringA share's id or name.
path2stringPath below the link to open. Empty: the link itself.

CheckShareResponse#

Response for ShareService.CheckShare.

Field#TypeDescription
status1uint32HTTP status the link answered.
ok2boolTrue when it answered 2xx (or 3xx to a page of the same link).
via3stringWhat was fetched, or why it could not be: link (the real link, through the relay, as the owner), or local (the daemon's own gateway, when this machine cannot reach the relay).
detail4stringA short human line: the status, content type and size, or the error.

ShareAccess#

Who may open a share.

Value#Description
SHARE_ACCESS_UNSPECIFIED0Treated as private.
SHARE_ACCESS_PRIVATE1Only the owner's cua.ai account, on any of the owner's devices.
SHARE_ACCESS_TEAM2Members of the owner's team.
SHARE_ACCESS_PUBLIC3Anyone with the link, until it expires or is stopped.

ShareTargetKind#

What a share points at.

Value#Description
SHARE_TARGET_KIND_UNSPECIFIED0Invalid.
SHARE_TARGET_KIND_PORT1A TCP port on the daemon's machine (port).
SHARE_TARGET_KIND_SPACE_PORT2A TCP port in a Space (space, port).
SHARE_TARGET_KIND_FILE3One file on the daemon's machine (path), read-only.
SHARE_TARGET_KIND_DIR4A folder on the daemon's machine (path), read-only, with a listing.

ShareLanding#

Where public TCP shares land.

Value#Description
SHARE_LANDING_UNSPECIFIED0Auto: the Space's own cloud machine, else a share edge, else Cua.
SHARE_LANDING_ONLY_MY_CLOUD1Only through the owner's clouds; never Cua's relay.
SHARE_LANDING_ALLOW_RELAY2Cua's relay, unless the Space runs on its own cloud machine.