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 | # | Type | Description |
|---|---|---|---|
kind | 1 | ShareTargetKind | Which of the fields below apply. |
space | 2 | string | The Space, as sandbox commands name it (dev, local:dev). |
port | 3 | uint32 | The port (on the machine, or in the Space). |
path | 4 | string | Absolute path of the file or folder. |
Share#
One share.
| Field | # | Type | Description |
|---|---|---|---|
id | 1 | string | Handle for StopShare (share- plus hex). |
url | 2 | string | The link. |
name | 3 | string | Name for lists. |
target | 4 | ShareTarget | What it serves. |
access | 5 | ShareAccess | Who may open it. |
owner | 6 | string | The account that made it (email when known). |
created_at | 7 | google.protobuf.Timestamp | When it was made. |
expires_at | 8 | google.protobuf.Timestamp | When it ends. Unset: until stopped (private and team shares only). |
notices | 9 | repeated string | Plain-words limits of this link worth showing next to it (for example that browsers cannot open it yet). Empty when there are none. |
tcp | 10 | ShareTcp | A public TCP share: where people connect (unset for an HTTP link). |
origin | 11 | string | The Space whose agent made the share through its spawn channel; empty when it was made on this computer. The share ends with that Space. |
waiting | 12 | ShareWaiting | Set while the share waits for the owner; it serves nothing until ApproveShare. |
ShareWaiting#
Why a share waits for its owner.
| Field | # | Type | Description |
|---|---|---|---|
reason | 1 | string | approval (an agent in a Space asked for a public share) or consent (the first share edge in a cloud). |
text | 2 | string | What to show the owner: who asked, or the consent text with the cost. |
route_line | 3 | string | The 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 | # | Type | Description |
|---|---|---|---|
address | 1 | string | host:port on the relay. |
host | 2 | string | The relay host. |
port | 3 | uint32 | The relay port. |
srv_name | 4 | string | A 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. |
service | 5 | string | The SRV service (minecraft). Empty when there is none. |
route | 6 | string | How 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_line | 7 | string | The plain line next to the address ("Through your AWS account", "Through Cua"). |
cloud | 8 | string | The cloud a host or edge route uses (aws). Empty for relay. |
allow | 9 | repeated string | Who may connect (CIDRs). Empty: anyone. |
check_host | 10 | bool | Minecraft Java connections that did not dial this address are dropped. |
max_bytes | 11 | uint64 | The most data this share may move (its part of the daily cap); 0: no cap. |
CreateShareRequest#
Request for ShareService.CreateShare.
| Field | # | Type | Description |
|---|---|---|---|
target | 1 | ShareTarget | What to share. Paths are absolute: the client resolves them. |
access | 2 | ShareAccess | Who may open it. Unspecified: private. |
ttl | 3 | google.protobuf.Duration | Lifetime, 60 s to 24 h. Public shares default to 1 h; others to none. |
name | 4 | string | Name for lists. |
tcp | 5 | bool | Share 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. |
service | 6 | string | With tcp: the SRV service (minecraft), so people can type a name instead of the port. |
route | 7 | string | With 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. |
allow | 8 | repeated string | With tcp: who may connect (CIDRs or addresses, at most 32). Empty: the settings' default allowlist (usually anyone). |
check_host | 9 | bool | With tcp: drop Minecraft Java connections that did not dial this share's address (needs service minecraft). |
consent | 10 | bool | With 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 | # | Type | Description |
|---|---|---|---|
id | 1 | string | The waiting share's id. |
always | 2 | bool | Also let this share's Space share without asking from now on. |
ApproveShareResponse#
Response for ShareService.ApproveShare.
| Field | # | Type | Description |
|---|---|---|---|
share | 1 | Share | The share, now live, with its address. |
DenyShareRequest#
Request for ShareService.DenyShare.
| Field | # | Type | Description |
|---|---|---|---|
id | 1 | string | The waiting share's id. |
DenyShareResponse#
Response for ShareService.DenyShare.
No fields.
ShareSettings#
The share settings.
| Field | # | Type | Description |
|---|---|---|---|
landing | 1 | ShareLanding | Where public TCP shares land. |
relay_fallback | 2 | bool | Whether Cua's relay may carry public TCP shares at all. |
daily_cap_mib | 3 | uint64 | The most data public TCP shares may move in a day, in MiB. 0: no cap. |
default_allow | 4 | repeated string | The allowlist new shares start with (CIDRs). Empty: anyone. |
approve_agent_shares | 5 | bool | Ask the owner before a share an agent made goes public. |
always_allow_spaces | 6 | repeated string | Spaces whose agents may share without asking. |
edge_consent | 7 | repeated string | Clouds the owner agreed may hold a share edge. |
GetShareSettingsRequest#
Request for ShareService.GetShareSettings.
No fields.
GetShareSettingsResponse#
Response for ShareService.GetShareSettings.
| Field | # | Type | Description |
|---|---|---|---|
settings | 1 | ShareSettings | The settings. |
used_today | 2 | uint64 | Data public TCP shares moved today, in bytes. |
edge_cloud | 3 | string | The share edge, when there is one: its cloud, address and the monthly cost estimate in US dollars. |
edge_host | 4 | string | The edge's address. |
edge_monthly_usd | 5 | double | About what the edge costs a month, in US dollars. |
SetShareSettingsRequest#
Request for ShareService.SetShareSettings.
| Field | # | Type | Description |
|---|---|---|---|
settings | 1 | ShareSettings | The new settings (all fields). |
SetShareSettingsResponse#
Response for ShareService.SetShareSettings.
| Field | # | Type | Description |
|---|---|---|---|
settings | 1 | ShareSettings | The settings as saved. |
RemoveShareEdgeRequest#
Request for ShareService.RemoveShareEdge.
No fields.
RemoveShareEdgeResponse#
Response for ShareService.RemoveShareEdge.
| Field | # | Type | Description |
|---|---|---|---|
stopped | 1 | repeated string | Shares that ended with it. |
CreateShareResponse#
Response for ShareService.CreateShare.
| Field | # | Type | Description |
|---|---|---|---|
share | 1 | Share | The share, with its link. |
ListSharesRequest#
Request for ShareService.ListShares.
No fields.
ListSharesResponse#
Response for ShareService.ListShares.
| Field | # | Type | Description |
|---|---|---|---|
shares | 1 | repeated Share | Active shares, newest first. |
StopShareRequest#
Request for ShareService.StopShare.
| Field | # | Type | Description |
|---|---|---|---|
id | 1 | string | A share's id, or its name when that is unique. |
all | 2 | bool | Stop every share (id is ignored). |
StopShareResponse#
Response for ShareService.StopShare.
| Field | # | Type | Description |
|---|---|---|---|
stopped | 1 | repeated string | Ids of the shares stopped. |
CheckShareRequest#
Request for ShareService.CheckShare.
| Field | # | Type | Description |
|---|---|---|---|
id | 1 | string | A share's id or name. |
path | 2 | string | Path below the link to open. Empty: the link itself. |
CheckShareResponse#
Response for ShareService.CheckShare.
| Field | # | Type | Description |
|---|---|---|---|
status | 1 | uint32 | HTTP status the link answered. |
ok | 2 | bool | True when it answered 2xx (or 3xx to a page of the same link). |
via | 3 | string | What 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). |
detail | 4 | string | A short human line: the status, content type and size, or the error. |
ShareAccess#
Who may open a share.
| Value | # | Description |
|---|---|---|
SHARE_ACCESS_UNSPECIFIED | 0 | Treated as private. |
SHARE_ACCESS_PRIVATE | 1 | Only the owner's cua.ai account, on any of the owner's devices. |
SHARE_ACCESS_TEAM | 2 | Members of the owner's team. |
SHARE_ACCESS_PUBLIC | 3 | Anyone with the link, until it expires or is stopped. |
ShareTargetKind#
What a share points at.
| Value | # | Description |
|---|---|---|
SHARE_TARGET_KIND_UNSPECIFIED | 0 | Invalid. |
SHARE_TARGET_KIND_PORT | 1 | A TCP port on the daemon's machine (port). |
SHARE_TARGET_KIND_SPACE_PORT | 2 | A TCP port in a Space (space, port). |
SHARE_TARGET_KIND_FILE | 3 | One file on the daemon's machine (path), read-only. |
SHARE_TARGET_KIND_DIR | 4 | A folder on the daemon's machine (path), read-only, with a listing. |
ShareLanding#
Where public TCP shares land.
| Value | # | Description |
|---|---|---|
SHARE_LANDING_UNSPECIFIED | 0 | Auto: the Space's own cloud machine, else a share edge, else Cua. |
SHARE_LANDING_ONLY_MY_CLOUD | 1 | Only through the owner's clouds; never Cua's relay. |
SHARE_LANDING_ALLOW_RELAY | 2 | Cua's relay, unless the Space runs on its own cloud machine. |