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.

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.

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.

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.