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 | # | 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. |
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. |
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. |