diff --git a/CHANGELOG.md b/CHANGELOG.md index 61c70794c..a74a8fb4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,6 +62,14 @@ The backend (`fastapi_backend`) and the frontend (`nextjs-frontend`) are version rclone keeps files being written in a cache on Lens's disk and puts them to Lens once they're closed; a file Lens can't take shows in the share's log. **Import files people add** in Settings, NFS share (`nfs.add_files`, on) turns it off and serves the share read-only again ([Adding files](docs/file-shares.md#adding-files)). +- **A private network between Lens's machines** (in progress). Lens is the certificate authority of a Nebula mesh + between the machines it runs on: an admin adds a node with a join token (`POST /api/v1/mesh/tokens`), the machine + joins without ever sending the token (`POST /api/v1/mesh/join`: an HMAC proves it, the answer comes back sealed with + a key derived from it) and gets an address, a certificate naming its role and namespaces, and its Nebula config, + whose firewall lets worker nodes reach the database and every node the API, and nothing else; a node renews, reports + and refreshes its config with its own node token, and removing one blocklists its certificates on every machine. + Off until a node is added; settings in `mesh`. Nebula running on the primary, the install line that joins a machine + and the Settings pages follow in their own pull requests ([Nodes and the mesh](docs/mesh.md)). - **Export a conversation.** `GET /api/v1/chats//export.md`, `.pdf` or `.json` gives the version showing, one message (`?message=`) or, as JSON, every version (`?all=true`). The Markdown has each question and answer, its citations as footnotes linking back to the moment in Lens and the tools it used; the PDF is that Markdown printed by diff --git a/README.md b/README.md index 31d94ee7b..e35aeb981 100644 --- a/README.md +++ b/README.md @@ -226,6 +226,8 @@ These are open pull requests, not yet part of Lens: - **Web clipper:** signing in, or using your API token, not only an import webhook's ([#406](https://github.com/adeelahmad/lense/pull/406)). - **Automations:** more operators for conditions ([#434](https://github.com/adeelahmad/lense/pull/434)). +- **Nodes:** Lens's own private network between the machines it runs on, a Nebula mesh it issues the certificates + for ([#546](https://github.com/adeelahmad/lense/pull/546)). ## Planned diff --git a/docs/mesh.md b/docs/mesh.md new file mode 100644 index 000000000..68f9afd19 --- /dev/null +++ b/docs/mesh.md @@ -0,0 +1,130 @@ +# Nodes and the mesh + +Status: **in progress**. Built: Lens as the mesh's certificate authority, join tokens, joining without sending the +token, each machine's Nebula config, a node's renewals and reports, removing a node, the `mesh` settings and the API +under `/api/v1/mesh`. Coming in their own pull requests: Nebula running on the primary and relaying the database, +`lens node` and the install line that joins another machine, Settings › Network and Nodes in the web app, and running +code on compute nodes. + +Lens runs on one machine until you add another: a Mac with a GPU to transcribe on, a box to run the assistant's code +on, a server with more disk. Those machines talk to this install over a private network of Lens's own, a +[Nebula](https://github.com/slackhq/nebula) mesh (MIT), never over the LAN or the internet in the clear: every packet +between them is encrypted and signed with certificates Lens issued, and Nebula's firewall lets through only what each +role needs. A single-machine install never turns it on. + +**Off until an admin adds a node.** Adding a node (Settings › Nodes, or `POST /api/v1/mesh/tokens`) makes the mesh's +certificate authority the first time and turns `mesh.enabled` on. Nothing goes in `.env`; nothing is asked at +install. + +## Roles + +| Role | What it does | What it reaches on the primary | +| --- | --- | --- | +| **primary** | This install: the lighthouse other machines find each other through, the relay for machines that can't reach each other directly, and the certificate authority | | +| **worker** | Runs jobs (transcription, OCR, the model steps it can) against this install's database, as `lens worker` does on this machine | the database port (8000) and the API (8080) | +| **compute** | Runs code in sandboxes for the assistant. It gets nothing of Lens's: no database, no keys | the API (8080) | + +A worker node needs this install's database to be a SurrealDB server, which Docker installs have (`SURREAL_URL`); +on an install with the embedded database only compute nodes can be added. A node may serve some namespaces only +(`namespaces` on its token, changed later on the node): its certificate carries them as Nebula groups +(`ns-`) for the firewall, and its workers take only those namespaces' jobs. + +## Joining + +An admin makes a join token for a role, shown once. It can be used once (or `uses` times) within `hours` (a day by +default), and withdrawn before that. The machine joins at this install's address with: + +```sh +curl -fsSL https://raw.githubusercontent.com/adeelahmad/lense/main/install.sh | LENS_JOIN=http://lens.home:3000 LENS_JOIN_TOKEN=lensjoin1.… sh +``` + +*(the install line's node path lands in its own pull request; the API it calls is here)* + +The token never crosses the wire. The machine makes its own Nebula key pair (`nebula-cert keygen`; the private key +never leaves it) and sends `POST /api/v1/mesh/join` with the token's id, a random nonce, its name, its public key and +a proof: `HMAC-SHA256(secret, "lens-mesh-join\n\n\n\n")`. Lens checks the proof in +constant time, spends the token, gives the machine the next address in `mesh.network`, signs a certificate for its +public key naming its role and namespaces as groups, and answers with its certificate, its whole Nebula config and its +credentials, sealed with AES-256-GCM under a key derived from the token's secret (HKDF-SHA256 with the nonce as salt). +So a join over plain `http://` on the LAN gives an eavesdropper nothing, and a machine in the middle can neither join +nor read the answer. Wrong proofs count towards a throttle per address (8 in 15 minutes). + +The answer holds: the node's id, name, role, address and groups; the primary's mesh address and ports; the config +(below); a **node token** (`lensnode1..`, kept on the node only, as a hash on the primary) for the node's +own calls; and an **agent key** the primary signs its calls to the node with. + +## After joining + +Over the mesh, with its node token (`Authorization: Bearer lensnode1.…`): + +| Call | | +| --- | --- | +| `GET /api/v1/mesh/node/config` | its Nebula config as it is now, and a `version` that changes when the config does (the blocklist grew, the primary's addresses changed): the node reloads Nebula when it sees a new one | +| `POST /api/v1/mesh/node/renew` | a new certificate for its public key (the same or a new one), with the groups its row has now. A node renews at a third of `mesh.cert_days` before its certificate runs out | +| `POST /api/v1/mesh/node/beat` | its report, every minute: whether Nebula runs, its peers, its machine, the sandboxes it can run, Nebula's last lines. Shown on the Nodes page | + +A removed node is refused on all three. + +## The config + +Each machine's config is rendered by Lens, from the settings and the node's row; the node adds only its private key. + +- `pki`: the CA certificate, the machine's certificate, and the **blocklist**: the fingerprints of every certificate a + removed node was given. Nebula drops a blocked peer's tunnels and refuses new ones (`disconnect_invalid`). +- `lighthouse` and `static_host_map`: the primary (the network's first address) is the lighthouse; nodes find it at + `mesh.hosts` on `mesh.port`, or, when that's empty, at the address they joined this install at. +- `relay`: the primary relays for nodes that can't reach each other directly (`mesh.relay`). +- `firewall`: outbound anything; inbound ICMP, and on the primary the database port (8000) to the `lens-worker` group + and the API port (8080) to `lens-node`; on a node its agent port (7443) to `lens-primary` only. Everything else is + dropped. +- `tun`: the `lens-mesh` interface, MTU `mesh.mtu`. `cipher`: `mesh.cipher`, the same on every machine. + +Nebula's programs come from Nebula's release for the machine (Linux amd64, arm64, ARMv7 and ARMv6 for a Raspberry +Pi; macOS), pinned to one version with its checksum kept in Lens, fetched into `/bin` on first use; a +`nebula` and `nebula-cert` on `PATH` or in `LENS_NEBULA_DIR` are used instead. + +## Settings + +Everything is in **Settings › Network** (`mesh`), editable in the app with defaults: + +| Setting | Default | | +| --- | --- | --- | +| `enabled` | off | on when a node is added; off stops the mesh | +| `network` | `10.73.0.0/16` | the mesh's addresses, a private IPv4 range from /8 to /28; the primary is its first. It can't change once machines have addresses in it | +| `port` | `4242` | the UDP port the primary listens on; nodes must reach it | +| `hosts` | none | where nodes reach that port from outside the mesh (`host` or `host:port`, up to 8). Empty: the address each node joined this install at | +| `cipher` | `aes` | or `chachapoly` (faster on machines without AES hardware, such as some Raspberry Pis); the same on every machine | +| `cert_days` | 30 | how long a machine's certificate lasts; it renews at two thirds | +| `relay` | on | the primary relays for machines that can't reach each other directly | +| `mtu` | 1300 | the mesh interface's MTU | +| `log_level` | info | Nebula's log level | + +**Nodes** (`/api/v1/mesh/nodes`): every machine, this one first, with its role, address, certificate and when it runs +out, last report, and the job workers running on it. `PATCH` renames a node or changes its namespaces; `DELETE` +removes it (undo with `POST /nodes/{id}/restore` while its certificate is good). Tokens: `GET`, `POST`, `DELETE +/api/v1/mesh/tokens`. + +## What keeps it safe + +- Nothing listens until an admin adds a node, and single-machine installs never do. +- Only a machine with a token an admin made joins; the token is spent on use, expires, and never crosses the wire. +- A machine's certificate names only its own address, role and namespaces; it can't widen them by renewing. +- Nebula's firewall, rendered by Lens, opens only what each role needs. Lens itself never trusts the mesh's address: + a worker node signs in to the database with its credential, a node's calls carry its node token, and the primary's + calls to a node carry its agent key. +- Removing a node blocks every certificate it was given, on every machine, and its credentials stop at once. +- The CA's key and the tokens' secrets are sealed in the database like any setting's secret (`ARCHIVE_SECRET_KEY` or + `secret.key`); node tokens are kept only as hashes. +- Nebula's download is pinned to one version with its checksum kept in Lens, unlike programs fetched from a "latest" + release. + +What it doesn't do: a worker node holds the database credential, so it is a trusted peer as a worker on this machine +is; a compute node is not, and gets no database. The lighthouse must be reachable on UDP `mesh.port` from the nodes +(a Raspberry Pi behind a carrier's NAT can be a node, not the primary a node reaches directly, unless `mesh.hosts` +names an address that forwards to it). Nebula's own isolation is upstream's. + +## Refine later + +- A second transport for networks that block UDP. +- Rotating the CA. +- Compute nodes running the assistant's sandboxes through the mesh, and their load shown on the Nodes page. diff --git a/fastapi_backend/app/api/v1/router.py b/fastapi_backend/app/api/v1/router.py index 344457eb4..ac11ad089 100644 --- a/fastapi_backend/app/api/v1/router.py +++ b/fastapi_backend/app/api/v1/router.py @@ -41,6 +41,7 @@ integrations, jobs, marketplaces, + mesh, metadata, namespaces, notebook, @@ -153,5 +154,6 @@ vaults, podcasts, specs, + mesh, ): api_router.include_router(module.router) diff --git a/fastapi_backend/app/api/v1/routes/mesh.py b/fastapi_backend/app/api/v1/routes/mesh.py new file mode 100644 index 000000000..2b45b9a3d --- /dev/null +++ b/fastapi_backend/app/api/v1/routes/mesh.py @@ -0,0 +1,185 @@ +"""The mesh between Lens's machines (docs/mesh.md): the network and its machines for admins (Settings › Network and +Nodes), joining it for a new machine (with a join token), and the calls a machine on it makes (with its node token). + +Adding a node makes a join token and turns the mesh on. Making and withdrawing tokens, joining, changing and removing +nodes are audited. +""" + +from __future__ import annotations + +import urllib.parse +from typing import Annotated, Any + +from fastapi import APIRouter, Depends, HTTPException, Request + +from app.api.deps import AdminReader, AdminWriter, Cfg, Db, client_ip, domain_errors, web_origin +from app.api.v1.routes.jobs import _worker as worker_info +from app.domain import auth, jobs, mesh, settings +from app.schemas.common import Ok +from app.schemas.mesh import ( + MeshBeat, + MeshJoin, + MeshJoined, + MeshNode, + MeshNodeChange, + MeshNodeConfig, + MeshRenew, + MeshStatus, + MeshToken, + MeshTokenCreate, + MeshTokenCreated, +) + +router = APIRouter(prefix="/mesh", tags=["mesh"]) + + +@router.get("") +def mesh_status(user: AdminReader, db: Db, cfg: Cfg) -> MeshStatus: + """Whether the mesh is on, its network and port, where other machines reach it, its CA and how many machines are + on it.""" + return MeshStatus(**mesh.status(db, cfg)) + + +def _with_workers(db, rows) -> list[MeshNode]: + """Each machine with the job workers running on it: a node's report as theirs, the rest (this machine's, and any + started by hand against the database) as the primary's.""" + by_node: dict[Any, list] = {} + for w in jobs.workers(db): + by_node.setdefault(w.get("node"), []).append(w) + ids = {n["id"] for n in rows} + out = [] + for n in rows: + mine = by_node.get(n["id"], []) + if n["role"] == "primary": + mine = mine + [w for k, ws in by_node.items() if k not in ids for w in ws] + out.append(MeshNode(**n, workers=[worker_info(w) for w in mine])) + return out + + +@router.get("/nodes") +def mesh_nodes(user: AdminReader, db: Db) -> list[MeshNode]: + """Every machine: this one (the primary) first, then each node with its role, address, certificate, last report + and the workers running on it. Removed nodes are listed too, with when.""" + rows = mesh.nodes(db) + if not rows: # no mesh yet: this machine and its workers + rows = [{"id": 0, "name": "This machine", "role": "primary", "ip": "", "groups": [], "namespaces": []}] + return _with_workers(db, rows) + + +@router.patch("/nodes/{node_id}") +def change_node(node_id: int, body: MeshNodeChange, user: AdminWriter, db: Db) -> MeshNode: + """Rename a node, or change the namespaces it serves (its certificate's groups follow when it next renews).""" + with domain_errors(): + n = mesh.update(db, node_id, name=body.name, namespaces=body.namespaces) + auth.audit(db, user.as_audit(), "mesh.node.change", f"mesh_node:{node_id}", body.model_dump(exclude_none=True)) + return _with_workers(db, [n])[0] + + +@router.delete("/nodes/{node_id}") +def remove_node(node_id: int, user: AdminWriter, db: Db) -> MeshNode: + """Take a node off the mesh: its certificates go on every machine's blocklist and its credentials stop working. + POST /mesh/nodes/{id}/restore undoes it while its certificate is good.""" + with domain_errors(): + n = mesh.remove(db, node_id, by=user.email) + auth.audit(db, user.as_audit(), "mesh.node.remove", f"mesh_node:{node_id}") + return _with_workers(db, [n])[0] + + +@router.post("/nodes/{node_id}/restore") +def restore_node(node_id: int, user: AdminWriter, db: Db) -> MeshNode: + """Undo removing a node.""" + with domain_errors(): + n = mesh.undo_remove(db, node_id) + auth.audit(db, user.as_audit(), "mesh.node.restore", f"mesh_node:{node_id}") + return _with_workers(db, [n])[0] + + +@router.get("/tokens") +def mesh_tokens(user: AdminReader, db: Db) -> list[MeshToken]: + """Join tokens that can still be used (their secrets are shown only when made).""" + return [MeshToken(**t) for t in mesh.tokens(db)] + + +@router.post("/tokens") +def make_mesh_token(body: MeshTokenCreate, user: AdminWriter, request: Request, db: Db, cfg: Cfg) -> MeshTokenCreated: + """Add a node: a token another machine joins the mesh with, shown this once. Makes the mesh's CA the first time, + and turns the mesh on.""" + with domain_errors(): + try: + tok, secret = mesh.make_token(db, cfg, user.email, body.role, body.name, body.namespaces, body.hours, body.uses) + except mesh.MeshError as e: + raise HTTPException(503, str(e)) from None + if not mesh.conf(cfg)["enabled"]: + settings.save(db, request.app.state.archive.base, "mesh", {"enabled": True}, user.email) + auth.audit(db, user.as_audit(), "settings.save", "mesh", ["enabled"]) + auth.audit(db, user.as_audit(), "mesh.token.create", f"mesh_token:{tok['id']}", {"role": body.role, "uses": body.uses}) + return MeshTokenCreated(token=MeshToken(**tok), secret=secret, join_url=web_origin(request)) + + +@router.delete("/tokens/{token_id}") +def withdraw_mesh_token(token_id: int, user: AdminWriter, db: Db) -> Ok: + """Withdraw a join token: no machine can join with it any more (those that did stay).""" + with domain_errors(): + mesh.revoke_token(db, token_id) + auth.audit(db, user.as_audit(), "mesh.token.withdraw", f"mesh_token:{token_id}") + return Ok() + + +@router.post("/join") +def join_mesh(body: MeshJoin, request: Request, db: Db, cfg: Cfg) -> MeshJoined: + """A machine joins the mesh with a join token, without sending it: the token's id, the machine's public key, and + an HMAC of the request keyed with the token's secret. The answer is sealed with a key from that secret + (docs/mesh.md, Joining). Too many wrong tries from one address are turned away for a while.""" + key = f"mesh-join:{client_ip(request)}" + if auth.throttled(key): + raise HTTPException(429, "too many tries; wait a few minutes") + host = urllib.parse.urlsplit(web_origin(request)).hostname or "" + try: + nid, sealed = mesh.join(db, cfg, body.token_id, body.nonce, body.name, body.public_key, body.proof, host, body.info) + except PermissionError as e: + auth.hit(key) + raise HTTPException(403, str(e)) from None + except ValueError as e: + raise HTTPException(400, str(e)) from None + except mesh.MeshError as e: + raise HTTPException(503, str(e)) from None + auth.audit(db, None, "mesh.join", f"mesh_node:{nid}", {"token": body.token_id, "name": body.name, "from": client_ip(request)}) + return MeshJoined(node=nid, sealed=sealed) + + +def _node(request: Request, db: Db) -> dict[str, Any]: + """The node calling, from its node token (Authorization: Bearer lensnode1..).""" + h = request.headers.get("authorization") or "" + row = mesh.by_token(db, h[7:] if h.lower().startswith("bearer ") else "") + if not row: + raise HTTPException(401, "not a node on this install's mesh (or it was removed)") + return row + + +Node = Annotated[dict[str, Any], Depends(_node)] + + +@router.get("/node/config") +def node_config(node: Node, db: Db, cfg: Cfg) -> MeshNodeConfig: + """The calling node's Nebula config as it is now (the blocklist, the lighthouse's addresses): it reloads when the + version changes.""" + with domain_errors(): + return MeshNodeConfig(**mesh.config_for(db, cfg, node)) + + +@router.post("/node/renew") +def renew_node(body: MeshRenew, node: Node, db: Db, cfg: Cfg) -> MeshNodeConfig: + """A new certificate for the calling node's public key, with the groups it has now.""" + try: + return MeshNodeConfig(**mesh.renew(db, cfg, node, body.public_key)) + except ValueError as e: + raise HTTPException(400, str(e)) from None + except mesh.MeshError as e: + raise HTTPException(503, str(e)) from None + + +@router.post("/node/beat") +def node_beat(body: MeshBeat, node: Node, db: Db) -> Ok: + """The calling node's report, every minute: Nebula, its peers, its machine.""" + mesh.beat(db, node, body.model_dump(exclude_none=True)) + return Ok() diff --git a/fastapi_backend/app/domain/jobs.py b/fastapi_backend/app/domain/jobs.py index 242bda891..655cd2052 100644 --- a/fastapi_backend/app/domain/jobs.py +++ b/fastapi_backend/app/domain/jobs.py @@ -887,8 +887,10 @@ def machine_load(): WORKER_BEAT = 15 # seconds between a busy worker's heartbeats +# the mesh node this worker runs on (docs/mesh.md): the node's agent starts it with LENS_MESH_NODE; none on the primary +MESH_NODE = int(os.environ["LENS_MESH_NODE"]) if os.environ.get("LENS_MESH_NODE", "").isdigit() else None WORKER_FIELDS = ( - "record::id(id) AS name, steps, host, heartbeat_at, current, paused, drain, paused_by, paused_at, load, cpus, components, machine" + "record::id(id) AS name, steps, host, heartbeat_at, current, paused, drain, paused_by, paused_at, load, cpus, components, machine, node" ) @@ -949,7 +951,7 @@ def __init__(self, db, cfg_fn, name=None, steps=None, log=None): def register(self, current=None): # SET, not CONTENT: being paused (from the app) outlasts restarts self.db.q( - "UPSERT $w SET steps = $s, host = $h, heartbeat_at = $t, current = $c, load = $l, cpus = $n", + "UPSERT $w SET steps = $s, host = $h, heartbeat_at = $t, current = $c, load = $l, cpus = $n, node = $node", w=R("worker", self.name), s=sorted(self.can), h=socket.gethostname(), @@ -957,6 +959,7 @@ def register(self, current=None): c=current, l=machine_load(), n=os.cpu_count(), + node=MESH_NODE, ) def paused(self): diff --git a/fastapi_backend/app/domain/mesh.py b/fastapi_backend/app/domain/mesh.py new file mode 100644 index 000000000..dcc30b26f --- /dev/null +++ b/fastapi_backend/app/domain/mesh.py @@ -0,0 +1,795 @@ +"""Lens's own private network between the machines it runs on: a Nebula mesh (docs/mesh.md). + +A single machine needs none, so it is off until an admin adds a node (Settings › Nodes, or `POST /mesh/tokens`), which +turns it on. Lens is the mesh's certificate authority. It makes the CA the first time (its key sealed in the database +like a setting's secret), and every machine gets an address in `mesh.network` and a certificate naming its role and +the namespaces it serves as Nebula groups: + +* the **primary**, this install: the lighthouse other machines find each other through, and the relay for those that + can't reach each other directly. It is the first address of the network. +* **worker** nodes run jobs against this install's database, which they reach over the mesh only. +* **compute** nodes run code in sandboxes for the assistant, and get nothing of Lens's: no database, no keys. + +A node joins with a join token, shown once to the admin who made it. The token never crosses the wire: the node sends +its token's id, its own public key (its private key never leaves it) and an HMAC of them keyed with the token's +secret, and the answer (its certificate, the mesh's settings and the credentials it signs in to this install with) is +sealed with a key derived from that secret, so a join over plain http:// on the LAN gives an eavesdropper nothing and +a machine in the middle can neither join nor read the answer. After that a node talks to this install over the mesh +only, and signs every call with its own credentials too: Lens trusts no address, the mesh's included. + +Certificates last `mesh.cert_days`; a node renews its own at two thirds of that. Removing a node puts its certificates +on the mesh's blocklist, which every machine's config carries, so Nebula drops its tunnels and refuses new ones. + +`nebula-cert` (from Nebula's release, MIT) makes the CA and signs certificates: on PATH, in LENS_NEBULA_DIR, or fetched +into data_dir/bin on first use, its checksum checked against the one kept here. +""" + +from __future__ import annotations + +import base64 +import datetime as dt +import hashlib +import hmac +import ipaddress +import json +import os +import pathlib +import platform +import re +import secrets +import shutil +import subprocess +import tarfile +import tempfile +import zipfile + +import httpx + +from . import settings, store + +R = store.R +NEBULA_VERSION = "1.11.2" +RELEASES = f"https://github.com/slackhq/nebula/releases/download/v{NEBULA_VERSION}/" +# Nebula's own SHASUM256.txt for these downloads, kept here so a changed file is refused +SHA256 = { + "nebula-linux-amd64.tar.gz": "6140d33f2ec21ce7f6b655b5bc820e93a684d97e51d0ddcf907324b5b28aac1e", + "nebula-linux-arm64.tar.gz": "85d10e7bc2d121193c1392a1a919172ded7c413f46e602138281cfa9fa1b0231", + "nebula-linux-arm-7.tar.gz": "dc9c890d7ec014ab709e0444592b33f35db4f396f28245c95887844b1565ff41", + "nebula-linux-arm-6.tar.gz": "d8f86452620eb6ab76bdf9ed9841a309ba8122ac2980c2b7c7e2d1aa8d160e84", + "nebula-darwin.zip": "ae23ebd29e570d72f28d71e608261d454fb87b1a19b4ca21c2aa26bb4698da88", +} +CA_ROW = R("mesh_ca", "current") +CA_YEARS = 10 +ROLES = ("worker", "compute") +GROUP_PRIMARY, GROUP_NODE = "lens-primary", "lens-node" +# ports on the mesh: the primary serves the database (to worker nodes) and the calls nodes make (to every node); a +# node's agent serves the primary only +DB_PORT, API_PORT, AGENT_PORT = 8000, 8080, 7443 +INTERFACE = "lens-mesh" +TOKEN_PREFIX = "lensjoin1." +NODE_PREFIX = "lensnode1." +TOKEN_HOURS = (1, 24 * 30) +TOKEN_USES = (1, 100) +NAME_RX = re.compile(r"^[A-Za-z0-9][A-Za-z0-9 ._-]{0,62}$") +NS_RX = re.compile(r"^[a-z0-9_-]{1,64}$") +PUBLIC_KEY_RX = re.compile( + r"^-----BEGIN NEBULA (X25519|P256) PUBLIC KEY-----\n[A-Za-z0-9+/=\n]{40,200}-----END NEBULA (X25519|P256) PUBLIC KEY-----\n?$" +) +HOST_RX = re.compile(r"^(\[[0-9A-Fa-f:]+\]|[A-Za-z0-9][A-Za-z0-9.-]{0,252})(:\d{1,5})?$") +JOIN_INFO = b"lens-mesh-join" +NODE_FIELDS = ( + "record::id(id) AS id, name, role, ip, groups, namespaces, fingerprint, not_after, joined_at, joined_by, last_seen, " + "status, revoked_at, revoked_by, hosts" +) + + +class MeshError(RuntimeError): + """Something about the mesh that didn't work; the message says why, for the admin.""" + + +def _now(): + return dt.datetime.now(dt.timezone.utc) + + +def _ts(t=None): + return (t or _now()).isoformat(timespec="seconds") + + +def conf(cfg): + return {**store.DEFAULTS["mesh"], **(cfg.get("mesh") or {})} + + +def network(cfg): + return ipaddress.ip_network(conf(cfg)["network"], strict=False) + + +def primary_ip(cfg): + """The primary's address on the mesh: the network's first.""" + return str(next(network(cfg).hosts())) + + +def host_port(value, port): + """`host` or `host:port` (an IPv6 address in brackets) as host:port, with the mesh's port when it has none.""" + v = str(value).strip() + if not HOST_RX.fullmatch(v): + raise ValueError(f"{v!r} isn't a host name or address, with or without :port") + if v.startswith("["): + return v if "]:" in v else f"{v}:{port}" + return v if ":" in v else f"{v}:{port}" + + +def check_setting(key, value): + """settings.save: mesh. checked and normalised; ValueError for what can't work.""" + if key == "network": + try: + net = ipaddress.ip_network(str(value).strip(), strict=False) + except ValueError: + raise ValueError("mesh.network is an address range, like 10.73.0.0/16") from None + if net.version != 4 or not net.is_private or net.prefixlen > 28 or net.prefixlen < 8: + raise ValueError("mesh.network is a private IPv4 range from /8 to /28, like 10.73.0.0/16") + return str(net) + if key == "hosts": + if not isinstance(value, list) or len(value) > 8: + raise ValueError("mesh.hosts is a list of up to 8 addresses, like lens.example.com:4242") + out = [] + for v in value: + v = str(v).strip() + if not HOST_RX.fullmatch(v): + raise ValueError(f"mesh.hosts: {v!r} isn't a host name or address, with or without :port") + out.append(v) + return out + if key in ("port", "mtu", "cert_days"): + lo, hi = {"port": (1, 65535), "mtu": (1200, 9000), "cert_days": (2, 365)}[key] + if not (isinstance(value, int) and not isinstance(value, bool) and lo <= value <= hi): + raise ValueError(f"mesh.{key} is a whole number from {lo} to {hi}") + return value + if key in ("enabled", "relay"): + if not isinstance(value, bool): + raise ValueError(f"mesh.{key} is true or false") + return value + return value + + +def check(db, cfg, changes): + """Before mesh settings are saved: the network can't move while machines have addresses in it.""" + if "network" in changes and changes["network"] != conf(cfg)["network"] and ca_row(db): + raise ValueError("the mesh's network can't change once it has a certificate authority: remove the nodes first") + + +# ---------- nebula-cert ---------- +def _platform(): + system = platform.system().lower() + arch = {"x86_64": "amd64", "amd64": "amd64", "aarch64": "arm64", "arm64": "arm64", "armv7l": "arm-7", "armv6l": "arm-6"}.get( + platform.machine().lower() + ) + if system == "darwin": + return "nebula-darwin.zip" + if system != "linux" or not arch: + raise MeshError(f"install Nebula {NEBULA_VERSION} yourself on this system ({system} {platform.machine()}); Lens finds it on PATH") + return f"nebula-linux-{arch}.tar.gz" + + +def _fetched(cfg): + return pathlib.Path(cfg["data_dir"]) / "bin" / f"nebula-{NEBULA_VERSION}" + + +def binaries(cfg): + """{"nebula": path, "nebula-cert": path} from LENS_NEBULA_DIR, PATH or the copy Lens fetched; None without both.""" + for d in (os.environ.get("LENS_NEBULA_DIR"), None, str(_fetched(cfg))): + found = {} + for name in ("nebula", "nebula-cert"): + exe = os.path.join(d, name) if d else shutil.which(name) + if exe and os.path.isfile(exe) and os.access(exe, os.X_OK): + found[name] = exe + if len(found) == 2: + return found + return None + + +def fetch(cfg, say=None, dest=None): + """Download Nebula's release for this machine into data_dir/bin (or `dest`), checksum checked. Returns binaries().""" + name = _platform() + out = pathlib.Path(dest) if dest else _fetched(cfg) + out.mkdir(parents=True, exist_ok=True) + tmp = out / (name + ".part") + if say: + say(f"downloading Nebula {NEBULA_VERSION} ({name})") + h = hashlib.sha256() + try: + with httpx.stream("GET", RELEASES + name, follow_redirects=True, timeout=300) as r: + r.raise_for_status() + with open(tmp, "wb") as f: + for chunk in r.iter_bytes(): + h.update(chunk) + f.write(chunk) + except httpx.HTTPError as e: + tmp.unlink(missing_ok=True) + raise MeshError(f"couldn't download Nebula from GitHub: {e}") from None + if h.hexdigest() != SHA256[name]: + tmp.unlink(missing_ok=True) + raise MeshError("the Nebula download doesn't match its checksum; try again") + try: + for prog in ("nebula", "nebula-cert"): + if name.endswith(".zip"): + with zipfile.ZipFile(tmp) as z, z.open(prog) as src, open(out / f"{prog}.new", "wb") as f: + shutil.copyfileobj(src, f) + else: + with tarfile.open(tmp) as t: + member = t.getmember(prog) + src = t.extractfile(member) + if src is None: + raise KeyError(prog) + with src, open(out / f"{prog}.new", "wb") as f: + shutil.copyfileobj(src, f) + (out / f"{prog}.new").chmod(0o755) + (out / f"{prog}.new").replace(out / prog) + except (KeyError, OSError, tarfile.TarError, zipfile.BadZipFile) as e: + raise MeshError(f"the Nebula download has no {e} in it") from None + finally: + tmp.unlink(missing_ok=True) + return {"nebula": str(out / "nebula"), "nebula-cert": str(out / "nebula-cert")} + + +def tools(cfg, say=None): + return binaries(cfg) or fetch(cfg, say) + + +def _cert_tool(cfg, args, stdin=None): + """Run nebula-cert; its stdout. MeshError with what it said when it fails.""" + exe = tools(cfg)["nebula-cert"] + try: + p = subprocess.run([exe, *args], input=stdin, capture_output=True, text=True, timeout=60) + except (OSError, subprocess.TimeoutExpired) as e: + raise MeshError(f"nebula-cert didn't run: {e}") from None + if p.returncode != 0: + raise MeshError(f"nebula-cert: {(p.stderr or p.stdout).strip()[:300]}") + return p.stdout + + +def describe(cfg, pem): + """A certificate's details from nebula-cert print: name, networks, groups, fingerprint, not_after, ...""" + out = json.loads(_cert_tool(cfg, ["print", "-json", "-path", "-"], pem)) + c = out[0] if isinstance(out, list) else out + d = c.get("details") or {} + return { + "name": d.get("name"), + "networks": d.get("networks") or d.get("ips") or [], + "groups": d.get("groups") or [], + "is_ca": bool(d.get("isCa")), + "issuer": d.get("issuer"), + "not_before": d.get("notBefore"), + "not_after": d.get("notAfter"), + "fingerprint": c.get("fingerprint"), + "public_key": c.get("publicKey"), + } + + +def keygen(cfg): + """A new X25519 key pair, (private PEM, public PEM): for this machine's own certificate (and tests').""" + with tempfile.TemporaryDirectory(prefix="lens-mesh-") as d: + _cert_tool(cfg, ["keygen", "-out-key", f"{d}/k", "-out-pub", f"{d}/p"]) + return pathlib.Path(d, "k").read_text(), pathlib.Path(d, "p").read_text() + + +# ---------- the certificate authority ---------- +def ca_row(db): + return db.one("SELECT * FROM $r", r=CA_ROW) + + +def ca(db, cfg): + """The mesh's CA, made the first time: {crt, fingerprint, not_after, network}. Its key stays sealed in the row.""" + row = ca_row(db) + if row: + return {k: row.get(k) for k in ("crt", "fingerprint", "not_after", "network", "created_at")} + net = conf(cfg)["network"] + with tempfile.TemporaryDirectory(prefix="lens-mesh-") as d: + _cert_tool( + cfg, + [ + "ca", + "-name", + f"Lens mesh {secrets.token_hex(3)}", + "-networks", + net, + "-duration", + f"{CA_YEARS * 8760}h", + "-out-crt", + f"{d}/ca.crt", + "-out-key", + f"{d}/ca.key", + ], + ) + crt, key = pathlib.Path(d, "ca.crt").read_text(), pathlib.Path(d, "ca.key").read_text() + info = describe(cfg, crt) + row = { + "crt": crt, + "key": settings.seal(cfg, key, "mesh:ca.key"), + "fingerprint": info["fingerprint"], + "not_after": info["not_after"], + "network": net, + "created_at": store.now(), + "blocklist": [], + } + try: + db.q("CREATE $r CONTENT $d", r=CA_ROW, d=row) + except Exception: # noqa: BLE001 - another process made it first: use theirs + if not ca_row(db): + raise + return ca(db, cfg) + + +def _sign(db, cfg, name, ip, groups, public_key): + """A certificate for `public_key` at `ip`, signed by the CA (whose key reaches nebula-cert on stdin only).""" + if not PUBLIC_KEY_RX.fullmatch(public_key.replace("\r\n", "\n")): + raise ValueError("that isn't a Nebula public key (nebula-cert keygen makes one)") + authority = ca(db, cfg) + key = settings.unseal(cfg, ca_row(db)["key"], "mesh:ca.key") + hours = conf(cfg)["cert_days"] * 24 + prefix = network(cfg).prefixlen + with tempfile.TemporaryDirectory(prefix="lens-mesh-") as d: + pathlib.Path(d, "ca.crt").write_text(authority["crt"]) + pathlib.Path(d, "host.pub").write_text(public_key) + crt = _cert_tool( + cfg, + [ + "sign", + "-ca-crt", + f"{d}/ca.crt", + "-ca-key", + "-", + "-name", + name, + "-networks", + f"{ip}/{prefix}", + "-groups", + ",".join(groups), + "-in-pub", + f"{d}/host.pub", + "-out-crt", + "-", + "-duration", + f"{hours}h", + ], + stdin=key, + ) + return crt, describe(cfg, crt) + + +# ---------- machines on the mesh ---------- +def _groups(role, namespaces): + base = [GROUP_PRIMARY] if role == "primary" else [GROUP_NODE, f"lens-{role}"] + return base + [f"ns-{n}" for n in namespaces or ()] + + +def _view(row): + if not row: + return None + out = { + k: row.get(k) for k in ("id", "name", "role", "ip", "groups", "namespaces", "fingerprint", "not_after", "joined_at", "joined_by") + } + out |= { + "last_seen": row.get("last_seen"), + "status": row.get("status") or {}, + "revoked_at": row.get("revoked_at"), + "revoked_by": row.get("revoked_by"), + "hosts": row.get("hosts") or [], + } + return out + + +def nodes(db, revoked=True): + """Every machine on the mesh, the primary first.""" + rows = db.rows(f"SELECT {NODE_FIELDS} FROM mesh_node ORDER BY id") + rows.sort(key=lambda r: (r.get("role") != "primary", r["id"])) + return [_view(r) for r in rows if revoked or not r.get("revoked_at")] + + +def node(db, nid): + row = db.one(f"SELECT {NODE_FIELDS} FROM $r", r=R("mesh_node", int(nid))) + if not row: + raise KeyError(nid) + return _view(row) + + +def _taken(db): + return {r for r in db.values("SELECT VALUE ip FROM mesh_node") if r} + + +def _next_ip(db, cfg): + taken = _taken(db) | {primary_ip(cfg)} + for ip in network(cfg).hosts(): # addresses are never given out again, so a removed node's stays its own + if str(ip) not in taken: + return str(ip) + raise MeshError("the mesh's network is full: give it a bigger range in Settings › Network before adding the CA") + + +def primary(db, cfg, public_key=None): + """The primary's row, made the first time; with `public_key`, a new certificate for it (it renews its own).""" + row = db.one(f"SELECT {NODE_FIELDS} FROM mesh_node WHERE role = 'primary' LIMIT 1") + if not row: + nid = db.next_id("mesh_node") + db.q( + "CREATE $r CONTENT $d", + r=R("mesh_node", nid), + d={ + "name": "This machine", + "role": "primary", + "ip": primary_ip(cfg), + "groups": _groups("primary", []), + "namespaces": [], + "joined_at": store.now(), + }, + ) + row = db.one(f"SELECT {NODE_FIELDS} FROM $r", r=R("mesh_node", nid)) + if public_key: + crt, info = _sign(db, cfg, "primary", row["ip"], row["groups"], public_key) + _record_cert(db, row["id"], info, crt) + return {**_view(row), "crt": crt, "fingerprint": info["fingerprint"], "not_after": info["not_after"]} + return _view(row) + + +def _record_cert(db, nid, info, crt): + """A machine's newest certificate; every one it was given stays listed, for the blocklist if it's removed.""" + db.q( + "UPDATE $r SET crt = $c, fingerprint = $f, not_after = $n, fingerprints = array::distinct(array::union(fingerprints ?? [], [$f]))", + r=R("mesh_node", int(nid)), + c=crt, + f=info["fingerprint"], + n=info["not_after"], + ) + + +def hosts(db, cfg, row=None): + """Where nodes reach the primary's mesh port from outside the mesh: mesh.hosts, or the address the node joined + at.""" + c = conf(cfg) + if c["hosts"]: + return [host_port(h, c["port"]) for h in c["hosts"]] + return [host_port(h, c["port"]) for h in (row or {}).get("hosts") or []] + + +def blocklist(db): + """The fingerprints of removed nodes' certificates, which every machine refuses.""" + out = [] + for r in db.rows("SELECT fingerprints FROM mesh_node WHERE revoked_at != NONE"): + out.extend(r.get("fingerprints") or []) + return sorted(set(out)) + + +def render(db, cfg, row, crt): + """A machine's Nebula config, as a dict to write out as YAML; the private key is the machine's own to add.""" + c = conf(cfg) + authority = ca(db, cfg) + me_primary = row["role"] == "primary" + lighthouse = primary_ip(cfg) + inbound = [{"proto": "icmp", "host": "any"}] + if me_primary: + inbound += [ + {"port": DB_PORT, "proto": "tcp", "group": "lens-worker"}, + {"port": API_PORT, "proto": "tcp", "group": GROUP_NODE}, + ] + else: + inbound += [{"port": AGENT_PORT, "proto": "tcp", "group": GROUP_PRIMARY}] + out = { + "pki": {"ca": authority["crt"], "cert": crt, "blocklist": blocklist(db), "disconnect_invalid": True}, + "static_host_map": {} if me_primary else {lighthouse: hosts(db, cfg, row)}, + "lighthouse": {"am_lighthouse": me_primary, "interval": 60, "hosts": [] if me_primary else [lighthouse]}, + "listen": {"host": "0.0.0.0", "port": c["port"] if me_primary else 0}, + "punchy": {"punch": True, "respond": True}, + "relay": {"am_relay": me_primary and c["relay"], "use_relays": c["relay"], "relays": [] if me_primary else [lighthouse]}, + "tun": {"dev": INTERFACE, "mtu": c["mtu"], "drop_local_broadcast": True, "drop_multicast": True}, + "cipher": c["cipher"], + "logging": {"level": c["log_level"], "format": "json"}, + "firewall": { + "outbound_action": "drop", + "inbound_action": "drop", + "conntrack": {"tcp_timeout": "12m", "udp_timeout": "3m", "default_timeout": "10m"}, + "outbound": [{"port": "any", "proto": "any", "host": "any"}], + "inbound": inbound, + }, + } + return out + + +def version(config): + """A short hash of a config, so a machine knows when to reload.""" + return hashlib.sha256(json.dumps(config, sort_keys=True).encode()).hexdigest()[:16] + + +# ---------- join tokens ---------- +def _token_view(row): + out = { + k: row.get(k) + for k in ("id", "role", "name", "namespaces", "expires_at", "uses", "used", "created_by", "created_at", "last_used_at") + } + out["namespaces"] = out["namespaces"] or [] + out["used"] = out["used"] or 0 + out["expired"] = bool(row.get("expires_at") and row["expires_at"] < _ts()) + return out + + +def tokens(db): + """Join tokens that can still be used, newest first (their secrets are never shown again).""" + rows = db.rows("SELECT record::id(id) AS id, * FROM mesh_token ORDER BY id DESC") + return [_token_view(r) for r in rows if not r.get("revoked_at") and (r.get("used") or 0) < (r.get("uses") or 1)] + + +def make_token(db, cfg, by=None, role="worker", name=None, namespaces=None, hours=24, uses=1): + """A token another machine joins with: (token row, the token itself, shown this once). Makes the CA if there isn't + one yet. The caller turns the mesh on (settings), which is what adding a node means.""" + if role not in ROLES: + raise ValueError(f"a node is a {' or a '.join(ROLES)}") + name = (name or "").strip() or None + if name and not NAME_RX.fullmatch(name): + raise ValueError("a node's name is letters, digits, spaces, dots, dashes and underscores, up to 63") + namespaces = sorted(set(namespaces or ())) + known = set(store.space_names(db).values()) + for n in namespaces: + if not NS_RX.fullmatch(n) or n not in known: + raise ValueError(f"there's no namespace {n!r}") + for v, (lo, hi), what in ((hours, TOKEN_HOURS, "hours"), (uses, TOKEN_USES, "uses")): + if not (isinstance(v, int) and not isinstance(v, bool) and lo <= v <= hi): + raise ValueError(f"a token's {what} is a whole number from {lo} to {hi}") + if role == "worker" and not str(db.url).startswith(("ws://", "wss://", "http://", "https://")): + raise ValueError( + "a worker on another machine needs this install's database to be a SurrealDB server (Docker installs have one); " + "add a compute node instead" + ) + ca(db, cfg) + primary(db, cfg) + tid, secret = db.next_id("mesh_token"), secrets.token_urlsafe(32) + db.q( + "CREATE $r CONTENT $d", + r=R("mesh_token", tid), + d=store.clean( + { + "role": role, + "name": name, + "namespaces": namespaces, + "secret": settings.seal(cfg, secret, f"mesh:token.{tid}"), + "expires_at": _ts(_now() + dt.timedelta(hours=hours)), + "uses": uses, + "used": 0, + "created_by": by, + "created_at": store.now(), + } + ), + ) + row = db.one("SELECT record::id(id) AS id, * FROM $r", r=R("mesh_token", tid)) + return _token_view(row), f"{TOKEN_PREFIX}{tid}.{secret}" + + +def revoke_token(db, tid): + if not db.one("SELECT id FROM $r", r=R("mesh_token", int(tid))): + raise KeyError(tid) + db.q("UPDATE $r SET revoked_at = $t", r=R("mesh_token", int(tid)), t=store.now()) + + +def parse_token(token): + """(id, secret) of a join token; ValueError when it isn't one.""" + m = re.fullmatch(re.escape(TOKEN_PREFIX) + r"(\d{1,12})\.([A-Za-z0-9_-]{20,100})", (token or "").strip()) + if not m: + raise ValueError("that isn't a Lens join token") + return int(m.group(1)), m.group(2) + + +def _material(token_id, nonce, name, public_key): + return "\n".join(["lens-mesh-join", str(token_id), nonce, name, public_key]).encode() + + +def proof(secret, token_id, nonce, name, public_key): + """What a joining machine sends to show it holds the token: an HMAC of the request, keyed with the token's + secret.""" + return hmac.new(secret.encode(), _material(token_id, nonce, name, public_key), hashlib.sha256).hexdigest() + + +def _box_key(secret, nonce): + from cryptography.hazmat.primitives import hashes + from cryptography.hazmat.primitives.kdf.hkdf import HKDF + + return HKDF(algorithm=hashes.SHA256(), length=32, salt=nonce.encode(), info=JOIN_INFO).derive(secret.encode()) + + +def seal_answer(secret, nonce, token_id, payload): + from cryptography.hazmat.primitives.ciphers.aead import AESGCM + + iv = secrets.token_bytes(12) + box = AESGCM(_box_key(secret, nonce)).encrypt(iv, json.dumps(payload).encode(), str(token_id).encode()) + return base64.urlsafe_b64encode(iv + box).decode() + + +def open_answer(secret, nonce, token_id, sealed): + """The joining machine's side of seal_answer: the payload, or ValueError when it wasn't sealed with the token.""" + from cryptography.exceptions import InvalidTag + from cryptography.hazmat.primitives.ciphers.aead import AESGCM + + raw = base64.urlsafe_b64decode(sealed) + try: + return json.loads(AESGCM(_box_key(secret, nonce)).decrypt(raw[:12], raw[12:], str(token_id).encode())) + except InvalidTag: + raise ValueError("the answer wasn't sealed with this token: is that the right Lens?") from None + + +def _hash(secret): + return hashlib.sha256(secret.encode()).hexdigest() + + +def join(db, cfg, token_id, nonce, name, public_key, sent_proof, joined_at=None, info=None): + """A machine joins with a token (parse_token's id, the HMAC from proof()): it gets an address, a certificate and + its credentials, sealed for it (seal_answer). PermissionError for a token that's wrong, used up or expired.""" + if not re.fullmatch(r"[A-Za-z0-9_-]{16,64}", nonce or ""): + raise ValueError("the join request's nonce is 16 to 64 letters, digits, - or _") + if not NAME_RX.fullmatch(name or ""): + raise ValueError("a node's name is letters, digits, spaces, dots, dashes and underscores, up to 63") + tok = db.one("SELECT record::id(id) AS id, * FROM $r", r=R("mesh_token", int(token_id))) + if not tok or tok.get("revoked_at"): + raise PermissionError("that join token isn't this install's, or it was withdrawn") + try: + secret = settings.unseal(cfg, tok["secret"], f"mesh:token.{tok['id']}") + except Exception: # noqa: BLE001 - the key changed since it was made + raise PermissionError("that join token can't be read any more: make a new one") from None + if not hmac.compare_digest(proof(secret, token_id, nonce, name, public_key), str(sent_proof or "")): + raise PermissionError("the join request wasn't made with that token") + if (tok.get("used") or 0) >= (tok.get("uses") or 1): + raise PermissionError("that join token has been used: make a new one in Settings › Nodes") + if tok.get("expires_at") and tok["expires_at"] < _ts(): + raise PermissionError("that join token has expired: make a new one in Settings › Nodes") + used = db.values( + "UPDATE $r SET used += 1, last_used_at = $t WHERE (used ?? 0) < (uses ?? 1) RETURN VALUE used", + r=R("mesh_token", tok["id"]), + t=store.now(), + ) + if not used: # another machine took the last use at the same moment + raise PermissionError("that join token has been used: make a new one in Settings › Nodes") + role, namespaces = tok["role"], tok.get("namespaces") or [] + nid, ip = db.next_id("mesh_node"), _next_ip(db, cfg) + groups = _groups(role, namespaces) + node_secret, agent_key = secrets.token_urlsafe(32), secrets.token_urlsafe(32) + db.q( + "CREATE $r CONTENT $d", + r=R("mesh_node", nid), + d=store.clean( + { + "name": tok.get("name") or name, + "role": role, + "ip": ip, + "groups": groups, + "namespaces": namespaces, + "secret_hash": _hash(node_secret), + "agent_key": settings.seal(cfg, agent_key, f"mesh:agent.{nid}"), + "token": tok["id"], + "joined_at": store.now(), + "joined_by": tok.get("created_by"), + "hosts": [joined_at] if joined_at else [], + "status": store.clean({"info": info}) if info else None, + } + ), + ) + try: + crt, cert_info = _sign(db, cfg, f"node-{nid}", ip, groups, public_key) + except Exception: + db.q("DELETE $r", r=R("mesh_node", nid)) + raise + _record_cert(db, nid, cert_info, crt) + row = db.one(f"SELECT {NODE_FIELDS} FROM $r", r=R("mesh_node", nid)) + config = render(db, cfg, row, crt) + payload = { + "node": {"id": nid, "name": row["name"], "role": role, "ip": ip, "groups": groups, "namespaces": namespaces}, + "primary": {"ip": primary_ip(cfg), "db_port": DB_PORT, "api_port": API_PORT}, + "agent_port": AGENT_PORT, + "config": config, + "version": version(config), + "not_after": cert_info["not_after"], + "node_token": f"{NODE_PREFIX}{nid}.{node_secret}", + "agent_key": agent_key, + "renew_days": renew_days(cfg), + } + return nid, seal_answer(secret, nonce, token_id, payload) + + +def renew_days(cfg): + """How many days before its certificate runs out a machine renews it: a third of its life.""" + return max(1, conf(cfg)["cert_days"] // 3) + + +# ---------- a node's own calls ---------- +def by_token(db, token): + """The node a node token belongs to, or None (a removed node's included: it gets nothing).""" + m = re.fullmatch(re.escape(NODE_PREFIX) + r"(\d{1,12})\.([A-Za-z0-9_-]{20,100})", (token or "").strip()) + if not m: + return None + row = db.one(f"SELECT {NODE_FIELDS}, secret_hash FROM $r", r=R("mesh_node", int(m.group(1)))) + if not row or row.get("revoked_at") or not hmac.compare_digest(row.get("secret_hash") or "", _hash(m.group(2))): + return None + return row + + +def config_for(db, cfg, row): + """A node's config as it is now (with the certificate it has), and its version.""" + crt = (db.one("SELECT crt FROM $r", r=R("mesh_node", row["id"])) or {}).get("crt") + config = render(db, cfg, row, crt or "") + return {"config": config, "version": version(config), "not_after": row.get("not_after"), "renew_days": renew_days(cfg)} + + +def renew(db, cfg, row, public_key): + """A new certificate for a node's (new or same) public key, with the groups its row says now.""" + groups = _groups(row["role"], row.get("namespaces")) + crt, info = _sign(db, cfg, f"node-{row['id']}", row["ip"], groups, public_key) + _record_cert(db, row["id"], info, crt) + db.q("UPDATE $r SET groups = $g", r=R("mesh_node", row["id"]), g=groups) + row = db.one(f"SELECT {NODE_FIELDS} FROM $r", r=R("mesh_node", row["id"])) + return {"crt": crt, **config_for(db, cfg, row)} + + +def beat(db, row, status): + """What a node reports every minute: whether Nebula runs, its peers, its machine. Kept as the node's status.""" + keep = {k: status.get(k) for k in ("nebula", "version", "peers", "machine", "sandbox", "error", "log") if k in status} + if isinstance(keep.get("log"), list): + keep["log"] = [str(x)[:300] for x in keep["log"][-40:]] + db.q( + "UPDATE $r SET last_seen = $t, status = $s", r=R("mesh_node", row["id"]), t=store.now(), s=json.loads(json.dumps(keep, default=str)) + ) + + +# ---------- the admin's changes ---------- +def update(db, nid, name=None, namespaces=None): + """Rename a node, or change the namespaces it serves (its certificate's groups follow when it next renews, which + its next config fetch asks for).""" + n = node(db, nid) + patch = {} + if name is not None: + name = name.strip() + if not NAME_RX.fullmatch(name): + raise ValueError("a node's name is letters, digits, spaces, dots, dashes and underscores, up to 63") + patch["name"] = name + if namespaces is not None: + if n["role"] == "primary": + raise ValueError("the primary serves every namespace") + known = set(store.space_names(db).values()) + bad = [x for x in namespaces if x not in known] + if bad: + raise ValueError(f"there's no namespace {bad[0]!r}") + patch["namespaces"] = sorted(set(namespaces)) + patch["groups"] = _groups(n["role"], patch["namespaces"]) + if patch: + db.q("UPDATE $r MERGE $p", r=R("mesh_node", int(nid)), p=patch) + return node(db, nid) + + +def remove(db, nid, by=None): + """Take a node off the mesh: its certificates go on the blocklist and its credentials stop working. undo() + brings it back while its certificate is still good.""" + n = node(db, nid) + if n["role"] == "primary": + raise ValueError("the primary is this machine; turn the mesh off in Settings › Network instead") + db.q("UPDATE $r SET revoked_at = $t, revoked_by = $b", r=R("mesh_node", int(nid)), t=store.now(), b=by) + return node(db, nid) + + +def undo_remove(db, nid): + n = node(db, nid) + if not n["revoked_at"]: + return n + if n["not_after"] and n["not_after"] < _ts(): + raise ValueError("its certificate has run out since: add it again with a new token") + db.q("UPDATE $r SET revoked_at = NONE, revoked_by = NONE", r=R("mesh_node", int(nid))) + return node(db, nid) + + +def status(db, cfg): + """What Settings › Network shows: on or off, the network, the CA, the primary's address, the counts.""" + c, row = conf(cfg), ca_row(db) + every = nodes(db) + return { + "enabled": c["enabled"], + "network": c["network"], + "port": c["port"], + "hosts": c["hosts"], + "primary_ip": primary_ip(cfg), + "ca": {"fingerprint": row["fingerprint"], "not_after": row["not_after"], "created_at": row.get("created_at")} if row else None, + "nodes": sum(1 for n in every if n["role"] != "primary" and not n["revoked_at"]), + "removed": sum(1 for n in every if n["revoked_at"]), + "tokens": len(tokens(db)), + "nebula": NEBULA_VERSION, + "tools": bool(binaries(cfg)), + } diff --git a/fastapi_backend/app/domain/settings.py b/fastapi_backend/app/domain/settings.py index e833d37c2..8d5eaa85f 100644 --- a/fastapi_backend/app/domain/settings.py +++ b/fastapi_backend/app/domain/settings.py @@ -65,6 +65,7 @@ "fedora": None, "tunnel": None, "https": None, + "mesh": None, # bind is a startup setting only "nfs": ("enabled", "port", "allowed_networks", "account", "add_files"), # bind is a startup setting only @@ -190,6 +191,8 @@ ("slack", "answer"): {"mention", "all"}, ("slack", "approve"): {"off", "low_risk"}, ("tunnel", "mode"): {"off", "quick", "token", "managed"}, + ("mesh", "cipher"): {"aes", "chachapoly"}, + ("mesh", "log_level"): {"error", "warning", "info", "debug"}, ("https", "ca"): {"letsencrypt", "zerossl", "both", "custom"}, ("https", "challenge"): {"http", "tls-alpn", "dns"}, ("https", "client_auth"): {"off", "optional", "required"}, @@ -507,6 +510,10 @@ def _check(section, key, value, default): return _sensor_setting(key, value) if section == "nfs": return _nfs_setting(key, value) + if section == "mesh": + from . import mesh + + return mesh.check_setting(key, value) if section == "smb": return _smb_setting(key, value) if section == "sandbox": @@ -1689,6 +1696,10 @@ def save(db, base, section, changes, user=None): url = data.get("opensearch_url", (base.get("search") or {}).get("opensearch_url")) if not (isinstance(url, str) and re.match(r"https?://[^/\s]+", url)): raise ValueError("search.engine opensearch needs search.opensearch_url (http:// or https://)") + if section == "mesh": + from . import mesh + + mesh.check(db, {"mesh": {**(base.get("mesh") or {}), **_data(row)}}, data) if section == "tunnel": from . import tunnel diff --git a/fastapi_backend/app/domain/store.py b/fastapi_backend/app/domain/store.py index 8cb532d88..fefc3161e 100644 --- a/fastapi_backend/app/domain/store.py +++ b/fastapi_backend/app/domain/store.py @@ -638,6 +638,22 @@ def labels(): # tunnel and DNS record for hostname with api_token). origin: the web app as this server reaches it (default # LENS_TUNNEL_ORIGIN, else FRONTEND_URL). token and api_token are secrets. "tunnel": {"mode": "off", "hostname": "", "token": None, "api_token": None, "origin": ""}, + # Lens's own private network between its machines, a Nebula mesh (domain/mesh.py, docs/mesh.md). Off until an admin + # adds a node. network: the mesh's addresses (the primary is the first); port: the UDP port the primary listens on; + # hosts: where other machines reach that port from outside the mesh (host or host:port; none: the address each + # joined at); cipher: aes or chachapoly, the same on every machine; cert_days: how long a machine's certificate + # lasts (renewed at two thirds); relay: the primary relays for machines that can't reach each other directly + "mesh": { + "enabled": False, + "network": "10.73.0.0/16", + "port": 4242, + "hosts": [], + "cipher": "aes", + "cert_days": 30, + "relay": True, + "mtu": 1300, + "log_level": "info", + }, # HTTPS with certificates from Let's Encrypt or ZeroSSL, got and renewed by Caddy run by Lens (domain/https.py). Off # by default. domains: the names to serve (and get certificates for); ca: letsencrypt, zerossl, both (Let's Encrypt # then ZeroSSL) or custom (ca_url, an ACME directory); challenge: http (ports 80 and 443 reach this machine), tls-alpn @@ -1248,6 +1264,12 @@ def close(self): # the Cloudflare tunnel: which process runs cloudflared, and what it's doing (app/domain/tunnel.py); HTTPS: which # process runs Caddy (app/domain/https.py) "DEFINE TABLE IF NOT EXISTS app_service SCHEMALESS", + # the mesh between Lens's machines (domain/mesh.py, docs/mesh.md): its CA (mesh_ca:current, the key sealed), each + # machine on it (mesh_node:, the primary among them) and the tokens machines join with (mesh_token:, sealed) + "DEFINE TABLE IF NOT EXISTS mesh_ca SCHEMALESS", + "DEFINE TABLE IF NOT EXISTS mesh_node SCHEMALESS", + "DEFINE INDEX IF NOT EXISTS mesh_node_role ON mesh_node FIELDS role", + "DEFINE TABLE IF NOT EXISTS mesh_token SCHEMALESS", # each namespace's data key, wrapped by the keys that can open it (app/domain/keyring.py) "DEFINE TABLE IF NOT EXISTS data_key SCHEMALESS", "DEFINE TABLE IF NOT EXISTS account SCHEMALESS", diff --git a/fastapi_backend/app/schemas/mesh.py b/fastapi_backend/app/schemas/mesh.py new file mode 100644 index 000000000..b620d17d4 --- /dev/null +++ b/fastapi_backend/app/schemas/mesh.py @@ -0,0 +1,120 @@ +"""The mesh between Lens's machines (docs/mesh.md): its status, the machines on it and the tokens they join with.""" + +from __future__ import annotations + +from typing import Any, Literal + +from pydantic import Field + +from app.schemas.common import RequestModel, ResponseModel +from app.schemas.jobs import WorkerInfo + +NodeRole = Literal["worker", "compute"] + + +class MeshAuthority(ResponseModel): + fingerprint: str = Field(description="the CA certificate's fingerprint: every machine on the mesh trusts it") + not_after: str | None = Field(None, description="when the CA runs out") + created_at: str | None = None + + +class MeshStatus(ResponseModel): + enabled: bool = Field(description="the mesh is on (mesh.enabled): adding a node turns it on") + network: str = Field(description="the mesh's addresses (mesh.network)") + port: int = Field(description="the UDP port the primary listens on (mesh.port)") + hosts: list[str] = Field(description="where other machines reach that port (mesh.hosts); empty: where each joined") + primary_ip: str = Field(description="this machine's address on the mesh") + ca: MeshAuthority | None = Field(None, description="the mesh's certificate authority, once made") + nodes: int = Field(description="machines on the mesh besides this one") + removed: int = Field(description="machines taken off it") + tokens: int = Field(description="join tokens that can still be used") + nebula: str = Field(description="the Nebula version Lens runs") + tools: bool = Field(description="Nebula's programs are on this server (else they're fetched when first needed)") + + +class MeshNode(ResponseModel): + id: int + name: str + role: Literal["primary", "worker", "compute"] + ip: str = Field(description="its address on the mesh") + groups: list[str] = Field(default_factory=list, description="its certificate's groups: role and namespaces, for the firewall") + namespaces: list[str] = Field(default_factory=list, description="the namespaces it serves (none: every one)") + fingerprint: str | None = Field(None, description="its current certificate's fingerprint") + not_after: str | None = Field(None, description="when its certificate runs out (it renews it at two thirds)") + joined_at: str | None = None + joined_by: str | None = Field(None, description="the admin who made the token it joined with") + last_seen: str | None = Field(None, description="its last report, every minute while it runs") + status: dict[str, Any] = Field(default_factory=dict, description="what it last reported: Nebula, its peers, its machine") + revoked_at: str | None = Field(None, description="when it was taken off the mesh") + revoked_by: str | None = None + hosts: list[str] = Field(default_factory=list, description="the address it reached this install at to join") + workers: list[WorkerInfo] = Field(default_factory=list, description="the job workers running on it") + + +class MeshNodeChange(RequestModel): + name: str | None = Field(None, max_length=63) + namespaces: list[str] | None = Field(None, max_length=100, description="the namespaces it serves (empty: every one)") + + +class MeshToken(ResponseModel): + id: int + role: NodeRole + name: str | None = None + namespaces: list[str] = Field(default_factory=list) + expires_at: str | None = None + uses: int = Field(1, description="how many machines may join with it") + used: int = Field(0, description="how many have") + expired: bool = False + created_by: str | None = None + created_at: str | None = None + last_used_at: str | None = None + + +class MeshTokenCreate(RequestModel): + role: NodeRole = Field("worker", description="worker: runs jobs against this install's database; compute: runs sandboxes only") + name: str | None = Field(None, max_length=63, description="the name it shows as (none: the name the machine sends)") + namespaces: list[str] = Field(default_factory=list, max_length=100, description="the namespaces it serves (empty: every one)") + hours: int = Field(24, description="how long the token can be used") + uses: int = Field(1, description="how many machines may join with it") + + +class MeshTokenCreated(ResponseModel): + token: MeshToken + secret: str = Field(description="the join token itself, shown this once") + join_url: str = Field(description="this install's address the machine joins at") + + +class MeshJoin(RequestModel): + token_id: int = Field(description="the number in the join token (lensjoin1..)") + nonce: str = Field(min_length=16, max_length=64, description="random, made for this request") + name: str = Field(min_length=1, max_length=63, description="the machine's name") + public_key: str = Field(max_length=500, description="its Nebula public key (nebula-cert keygen): its private key never leaves it") + proof: str = Field(max_length=128, description="HMAC-SHA256 of the request, keyed with the token's secret (docs/mesh.md)") + info: dict[str, Any] | None = Field(None, description="about the machine: os, arch, cpus, memory") + + +class MeshJoined(ResponseModel): + node: int + sealed: str = Field(description="the answer, sealed with a key from the token's secret: certificate, config, credentials") + + +class MeshNodeConfig(ResponseModel): + config: dict[str, Any] = Field(description="its Nebula config, without its private key") + version: str = Field(description="changes whenever the config does") + not_after: str | None = None + renew_days: int = Field(description="how many days before its certificate runs out it renews it") + crt: str | None = Field(None, description="the new certificate (renew)") + + +class MeshRenew(RequestModel): + public_key: str = Field(max_length=500, description="its Nebula public key, the same or a new one") + + +class MeshBeat(RequestModel): + nebula: str | None = Field(None, max_length=40, description="running, starting, stopped or failed") + version: str | None = Field(None, max_length=40, description="the Lens version it runs") + peers: list[dict[str, Any]] | None = Field(None, max_length=500, description="the machines it has tunnels to") + machine: dict[str, Any] | None = Field(None, description="its processors, memory and system") + sandbox: dict[str, Any] | None = Field(None, description="the sandboxes it can run") + error: str | None = Field(None, max_length=500) + log: list[str] | None = Field(None, max_length=40, description="Nebula's last lines") diff --git a/fastapi_backend/tests/api/test_mesh.py b/fastapi_backend/tests/api/test_mesh.py new file mode 100644 index 000000000..f6389cc4f --- /dev/null +++ b/fastapi_backend/tests/api/test_mesh.py @@ -0,0 +1,331 @@ +"""Lens's own network between its machines (docs/mesh.md): an admin adds a node, which makes the mesh's certificate +authority and a join token; the machine joins without ever sending the token, and gets a certificate, its Nebula +config and credentials sealed for it; after that it renews, reports and fetches its config with its own node token; +removing it blocks its certificates everywhere. nebula-cert is faked (tests/fake_nebula_cert.py); the same flows were +run against Nebula 1.11.2 itself, two machines in separate network namespaces reaching each other through the mesh.""" + +from __future__ import annotations + +import hashlib +import io +import pathlib +import secrets +import sys +import tarfile + +import httpx +import pytest + +from app.domain import auth, jobs, mesh, settings +from tests.helpers import login, make_user + +FAKE = pathlib.Path(__file__).resolve().parents[1] / "fake_nebula_cert.py" + + +@pytest.fixture +def nebula(tmp_path, monkeypatch): + """Nebula's programs for Lens to find: the fake nebula-cert, and a nebula that only says its version.""" + d = tmp_path / "nebula" + d.mkdir() + (d / "nebula-cert").write_text( + f"#!{sys.executable}\nimport sys\nsys.argv[0] = 'nebula-cert'\nexec(compile(open({str(FAKE)!r}).read(), {str(FAKE)!r}, 'exec'))\n" + ) + (d / "nebula").write_text(f"#!{sys.executable}\nprint('Version: {mesh.NEBULA_VERSION}')\n") + for p in d.iterdir(): + p.chmod(0o755) + monkeypatch.setenv("LENS_NEBULA_DIR", str(d)) + return d + + +@pytest.fixture +def server_db(db, monkeypatch): + """Tests run on the embedded database; a worker on another machine needs a SurrealDB server, as Docker installs have.""" + monkeypatch.setattr(db, "url", "ws://surrealdb:8000") + return db + + +def admin(client, db): + make_user(db, "root@x.io", "root password 1", admin=True) + return login(client, "root@x.io", "root password 1") + + +def joined(client, cfg, token, name="studio", info=None): + """A machine joining with `token`: what it sends, and the opened answer.""" + tid, secret = mesh.parse_token(token) + priv, pub = mesh.keygen(cfg) + nonce = secrets.token_urlsafe(16) + body = { + "token_id": tid, + "nonce": nonce, + "name": name, + "public_key": pub, + "proof": mesh.proof(secret, tid, nonce, name, pub), + "info": info, + } + r = client.post("/api/v1/mesh/join", json=body) + assert r.status_code == 200, r.text + return r.json()["node"], mesh.open_answer(secret, nonce, tid, r.json()["sealed"]), priv + + +def test_adding_a_node_makes_the_ca_a_token_and_turns_the_mesh_on(client, db, cfg, nebula): + h = admin(client, db) + before = client.get("/api/v1/mesh", headers=h).json() + assert before["enabled"] is False and before["ca"] is None and before["nodes"] == 0 + assert client.get("/api/v1/mesh/nodes", headers=h).json()[0]["role"] == "primary" # this machine, mesh or not + + r = client.post("/api/v1/mesh/tokens", json={"role": "compute", "name": "gpu box", "hours": 48}, headers=h) + assert r.status_code == 200, r.text + made = r.json() + assert made["secret"].startswith(mesh.TOKEN_PREFIX) and made["join_url"].startswith("http://") + assert made["token"]["role"] == "compute" and made["token"]["uses"] == 1 and made["token"]["used"] == 0 + + after = client.get("/api/v1/mesh", headers=h).json() + assert after["enabled"] is True and after["tokens"] == 1 and after["primary_ip"] == "10.73.0.1" + assert after["ca"]["fingerprint"] and after["ca"]["not_after"] > "2035" + assert db.one("SELECT key FROM $r", r=mesh.CA_ROW)["key"].startswith("v1.") # the CA's key is sealed, not plain + listed = client.get("/api/v1/mesh/tokens", headers=h).json() + assert [t["id"] for t in listed] == [made["token"]["id"]] and "secret" not in listed[0] + nodes = client.get("/api/v1/mesh/nodes", headers=h).json() + assert [(n["role"], n["ip"]) for n in nodes] == [("primary", "10.73.0.1")] + actions = [r["action"] for r in db.rows("SELECT action FROM audit_log")] + assert "mesh.token.create" in actions and "settings.save" in actions + + # withdrawn, it can't be used; a viewer can't make one + assert client.delete(f"/api/v1/mesh/tokens/{made['token']['id']}", headers=h).status_code == 200 + assert client.get("/api/v1/mesh/tokens", headers=h).json() == [] + make_user(db, "v@x.io", "viewer password 1") + assert client.post("/api/v1/mesh/tokens", json={}, headers=login(client, "v@x.io", "viewer password 1")).status_code == 403 + + +def test_a_worker_node_needs_a_database_server(client, db, cfg, nebula, monkeypatch): + monkeypatch.setattr(db, "url", "mem://") # an install on the embedded database (CI runs these on a server too) + h = admin(client, db) + r = client.post("/api/v1/mesh/tokens", json={"role": "worker"}, headers=h) + assert r.status_code == 400 and "SurrealDB server" in r.text + assert client.get("/api/v1/mesh", headers=h).json()["enabled"] is False # nothing was turned on + + +def test_a_machine_joins_without_sending_the_token(client, db, cfg, nebula, server_db): + h = admin(client, db) + made = client.post("/api/v1/mesh/tokens", json={"role": "worker", "namespaces": ["pods"]}, headers=h).json() + token = made["secret"] + tid, secret = mesh.parse_token(token) + priv, pub = mesh.keygen(cfg) + nonce = secrets.token_urlsafe(16) + + # a request made with the wrong secret, or for another name than it was signed for, is refused and counted + wrong = {"token_id": tid, "nonce": nonce, "name": "studio", "public_key": pub, "proof": mesh.proof("not it", tid, nonce, "studio", pub)} + r = client.post("/api/v1/mesh/join", json=wrong) + assert r.status_code == 403 and "wasn't made with that token" in r.text + good = mesh.proof(secret, tid, nonce, "studio", pub) + r = client.post("/api/v1/mesh/join", json={**wrong, "name": "other", "proof": good}) + assert r.status_code == 403 + assert client.get("/api/v1/mesh/nodes", headers=h).json()[-1]["role"] == "primary" # nothing joined + + nid, answer, _ = joined(client, cfg, token, info={"os": "Darwin", "cpus": 8}) + assert answer["node"] == { + "id": nid, + "name": "studio", + "role": "worker", + "ip": "10.73.0.2", + "groups": ["lens-node", "lens-worker", "ns-pods"], + "namespaces": ["pods"], + } + assert answer["primary"] == {"ip": "10.73.0.1", "db_port": 8000, "api_port": 8080} + assert answer["node_token"].startswith(mesh.NODE_PREFIX) and answer["agent_key"] and answer["renew_days"] == 10 + config = answer["config"] + assert "BEGIN NEBULA CERTIFICATE" in config["pki"]["ca"] and "BEGIN NEBULA CERTIFICATE" in config["pki"]["cert"] + assert "key" not in config["pki"] # the private key never left the machine, so the answer can't hold it + assert config["lighthouse"] == {"am_lighthouse": False, "interval": 60, "hosts": ["10.73.0.1"]} + assert config["static_host_map"] == {"10.73.0.1": ["127.0.0.1:4242"]} # where it joined from, on the mesh's port + assert config["tun"]["dev"] == "lens-mesh" and config["cipher"] == "aes" + inbound = config["firewall"]["inbound"] + assert {"port": 7443, "proto": "tcp", "group": "lens-primary"} in inbound # only the primary reaches its agent + assert config["firewall"]["outbound_action"] == "drop" and config["firewall"]["inbound_action"] == "drop" + cert = mesh.describe(cfg, config["pki"]["cert"]) + assert ( + cert["name"] == f"node-{nid}" and cert["networks"] == ["10.73.0.2/16"] and cert["groups"] == ["lens-node", "lens-worker", "ns-pods"] + ) + + nodes = client.get("/api/v1/mesh/nodes", headers=h).json() + assert [(n["role"], n["ip"], n["name"]) for n in nodes] == [("primary", "10.73.0.1", "This machine"), ("worker", "10.73.0.2", "studio")] + assert nodes[1]["fingerprint"] == cert["fingerprint"] and nodes[1]["status"] == {"info": {"os": "Darwin", "cpus": 8}} + assert nodes[1]["hosts"] == ["127.0.0.1"] and nodes[1]["joined_by"] == "root@x.io" + assert client.get("/api/v1/mesh/tokens", headers=h).json() == [] # used up + assert [r["detail"]["name"] for r in db.rows("SELECT detail FROM audit_log WHERE action = 'mesh.join'")] == ["studio"] + + # the token is spent: the same request again, or a fresh one, is refused + r = client.post("/api/v1/mesh/join", json={**wrong, "proof": good}) + assert r.status_code == 403 and "has been used" in r.text + + # the primary gets a certificate of its own when it asks, on the same CA + prim = mesh.primary(db, cfg, mesh.keygen(cfg)[1]) + assert prim["ip"] == "10.73.0.1" and mesh.describe(cfg, prim["crt"])["groups"] == ["lens-primary"] + pconf = mesh.render(db, cfg, db.one(f"SELECT {mesh.NODE_FIELDS} FROM mesh_node WHERE role = 'primary'"), prim["crt"]) + assert pconf["lighthouse"]["am_lighthouse"] is True and pconf["listen"]["port"] == 4242 and pconf["relay"]["am_relay"] is True + assert {"port": 8000, "proto": "tcp", "group": "lens-worker"} in pconf["firewall"]["inbound"] # the database, to workers + assert {"port": 8080, "proto": "tcp", "group": "lens-node"} in pconf["firewall"]["inbound"] # the API, to every node + + +def test_too_many_wrong_joins_from_one_address_are_turned_away(client, db, cfg, nebula, server_db): + h = admin(client, db) + made = client.post("/api/v1/mesh/tokens", json={}, headers=h).json() + tid, _ = mesh.parse_token(made["secret"]) + _, pub = mesh.keygen(cfg) + bad = {"token_id": tid, "nonce": secrets.token_urlsafe(16), "name": "x", "public_key": pub, "proof": "0" * 64} + codes = [client.post("/api/v1/mesh/join", json=bad).status_code for _ in range(9)] + assert codes[:8] == [403] * 8 and codes[8] == 429 + auth._FAILS.clear() + assert client.post("/api/v1/mesh/join", json={**bad, "token_id": 999}).status_code == 403 # not this install's + + +def test_a_node_reports_renews_and_follows_its_config(client, db, cfg, nebula, server_db): + h = admin(client, db) + made = client.post("/api/v1/mesh/tokens", json={"uses": 2}, headers=h).json() + nid, answer, _ = joined(client, cfg, made["secret"]) + nh = {"Authorization": f"Bearer {answer['node_token']}"} + assert client.get("/api/v1/mesh/node/config").status_code == 401 + assert client.get("/api/v1/mesh/node/config", headers={"Authorization": "Bearer lensnode1.1.nope"}).status_code == 401 + + got = client.get("/api/v1/mesh/node/config", headers=nh).json() + assert got["version"] == answer["version"] and got["config"]["pki"]["blocklist"] == [] + + r = client.post( + "/api/v1/mesh/node/beat", json={"nebula": "running", "peers": [{"ip": "10.73.0.1"}], "log": ["x" * 400], "junk": 1}, headers=nh + ) + assert r.status_code == 422 # unknown fields are refused + r = client.post("/api/v1/mesh/node/beat", json={"nebula": "running", "peers": [{"ip": "10.73.0.1"}], "log": ["x" * 400]}, headers=nh) + assert r.status_code == 200 + me = client.get("/api/v1/mesh/nodes", headers=h).json()[1] + assert me["last_seen"] and me["status"]["nebula"] == "running" and len(me["status"]["log"][0]) == 300 + + # a second machine joins with the same token (uses: 2): its arrival changes nothing in the first one's config yet + nid2, answer2, _ = joined(client, cfg, made["secret"], name="pi") + assert answer2["node"]["ip"] == "10.73.0.3" + assert client.get("/api/v1/mesh/node/config", headers=nh).json()["version"] == answer["version"] + + # the admin gives the first node a namespace: its next certificate carries it + r = client.patch(f"/api/v1/mesh/nodes/{nid}", json={"name": "Studio Mac", "namespaces": ["calls"]}, headers=h) + assert r.status_code == 200 and r.json()["name"] == "Studio Mac" and r.json()["groups"] == ["lens-node", "lens-worker", "ns-calls"] + assert client.patch(f"/api/v1/mesh/nodes/{nid}", json={"namespaces": ["nope"]}, headers=h).status_code == 400 + _, pub2 = mesh.keygen(cfg) + renewed = client.post("/api/v1/mesh/node/renew", json={"public_key": pub2}, headers=nh).json() + cert = mesh.describe(cfg, renewed["crt"]) + assert cert["groups"] == ["lens-node", "lens-worker", "ns-calls"] and cert["networks"] == ["10.73.0.2/16"] + assert renewed["version"] != answer["version"] and renewed["config"]["pki"]["cert"] == renewed["crt"] + assert client.post("/api/v1/mesh/node/renew", json={"public_key": "not a key"}, headers=nh).status_code == 400 + old_fp = me["fingerprint"] + me = client.get("/api/v1/mesh/nodes", headers=h).json()[1] + assert me["fingerprint"] == cert["fingerprint"] != old_fp + + # removed: its node token stops working, and both its certificates are blocked in everyone's config + r = client.delete(f"/api/v1/mesh/nodes/{nid}", headers=h) + assert r.status_code == 200 and r.json()["revoked_at"] and r.json()["revoked_by"] == "root@x.io" + assert client.get("/api/v1/mesh/node/config", headers=nh).status_code == 401 + other = client.get("/api/v1/mesh/node/config", headers={"Authorization": f"Bearer {answer2['node_token']}"}).json() + assert sorted(other["config"]["pki"]["blocklist"]) == sorted([old_fp, cert["fingerprint"]]) and other["version"] != answer2["version"] + status = client.get("/api/v1/mesh", headers=h).json() + assert status["nodes"] == 1 and status["removed"] == 1 + # the primary can't be removed; a removed node comes back with undo + primary_id = client.get("/api/v1/mesh/nodes", headers=h).json()[0]["id"] + assert client.delete(f"/api/v1/mesh/nodes/{primary_id}", headers=h).status_code == 400 + r = client.post(f"/api/v1/mesh/nodes/{nid}/restore", headers=h) + assert r.status_code == 200 and r.json()["revoked_at"] is None + assert client.get("/api/v1/mesh/node/config", headers=nh).json()["config"]["pki"]["blocklist"] == [] + assert client.get("/api/v1/mesh/nodes/", headers=h).status_code in (200, 307, 404) + assert client.get("/api/v1/mesh/node/config", headers=nh).status_code == 200 + # a node's address is never given out again + nid3, answer3, _ = joined(client, cfg, client.post("/api/v1/mesh/tokens", json={}, headers=h).json()["secret"], name="third") + assert answer3["node"]["ip"] == "10.73.0.4" + + +def test_the_nodes_list_shows_each_machines_workers(client, db, cfg, nebula, server_db, monkeypatch): + h = admin(client, db) + nid, answer, _ = joined(client, cfg, client.post("/api/v1/mesh/tokens", json={}, headers=h).json()["secret"]) + jobs.Worker(db, lambda: cfg, name="here-1").register() + monkeypatch.setattr(jobs, "MESH_NODE", nid) + jobs.Worker(db, lambda: cfg, name="studio-1").register() + nodes = client.get("/api/v1/mesh/nodes", headers=h).json() + assert [w["name"] for w in nodes[0]["workers"]] == ["here-1"] + assert [w["name"] for w in nodes[1]["workers"]] == ["studio-1"] and nodes[1]["workers"][0]["node"] == nid + + +def test_mesh_settings_are_checked(client, db, cfg, nebula, server_db): + h = admin(client, db) + r = client.put("/api/v1/settings/mesh", json={"network": "8.8.0.0/16"}, headers=h) + assert r.status_code == 400 and "private IPv4" in r.text + assert client.put("/api/v1/settings/mesh", json={"hosts": ["lens.example.com:4242", "bad host!"]}, headers=h).status_code == 400 + assert client.put("/api/v1/settings/mesh", json={"cipher": "rot13"}, headers=h).status_code == 400 + assert ( + client.put( + "/api/v1/settings/mesh", json={"network": "10.9.0.0/24", "hosts": ["lens.example.com:4242", "203.0.113.5"]}, headers=h + ).status_code + == 200 + ) + made = client.post("/api/v1/mesh/tokens", json={}, headers=h).json() + nid, answer, _ = joined(client, cfg, made["secret"]) + assert answer["node"]["ip"] == "10.9.0.2" and answer["primary"]["ip"] == "10.9.0.1" + assert answer["config"]["static_host_map"] == {"10.9.0.1": ["lens.example.com:4242", "203.0.113.5:4242"]} + # with machines on it, the network can't move + r = client.put("/api/v1/settings/mesh", json={"network": "10.10.0.0/24"}, headers=h) + assert r.status_code == 400 and "can't change" in r.text + assert client.put("/api/v1/settings/mesh", json={"cert_days": 3, "relay": False}, headers=h).status_code == 200 + got = client.get("/api/v1/mesh/node/config", headers={"Authorization": f"Bearer {answer['node_token']}"}).json() + assert got["renew_days"] == 1 and got["config"]["relay"]["use_relays"] is False + view = client.get("/api/v1/settings", headers=h).json()["mesh"]["values"] + assert view["enabled"] is True and view["network"] == "10.9.0.0/24" + + +def test_nebula_is_fetched_once_with_its_checksum_checked(cfg, monkeypatch, tmp_path): + monkeypatch.delenv("LENS_NEBULA_DIR", raising=False) + monkeypatch.setenv("PATH", str(tmp_path / "empty")) + assert mesh.binaries(cfg) is None + buf = io.BytesIO() + with tarfile.open(fileobj=buf, mode="w:gz") as t: + for name in ("nebula", "nebula-cert"): + data = f"#!/bin/sh\necho {name}\n".encode() + info = tarfile.TarInfo(name) + info.size, info.mode = len(data), 0o755 + t.addfile(info, io.BytesIO(data)) + tarball = buf.getvalue() + asked = [] + + def transport(request): + asked.append(str(request.url)) + return httpx.Response(200, content=tarball) + + class Fake: # httpx as mesh.py sees it, answering from `transport` + HTTPError = httpx.HTTPError + + @staticmethod + def stream(method, url, **kw): + return httpx.Client(transport=httpx.MockTransport(transport)).stream(method, url, **kw) + + monkeypatch.setattr(mesh, "httpx", Fake) + monkeypatch.setattr(mesh, "_platform", lambda: "nebula-linux-amd64.tar.gz") + with pytest.raises(mesh.MeshError, match="checksum"): + mesh.fetch(cfg) + assert mesh.binaries(cfg) is None and not list((pathlib.Path(cfg["data_dir"]) / "bin").rglob("*.part")) + monkeypatch.setitem(mesh.SHA256, "nebula-linux-amd64.tar.gz", hashlib.sha256(tarball).hexdigest()) + got = mesh.fetch(cfg) + assert asked[-1] == mesh.RELEASES + "nebula-linux-amd64.tar.gz" and asked[-1].startswith( + "https://github.com/slackhq/nebula/releases/download/v" + ) + assert got == mesh.binaries(cfg) and pathlib.Path(got["nebula-cert"]).read_text().endswith("echo nebula-cert\n") + assert mesh.tools(cfg) == got and len(asked) == 2 # found now: not fetched again + + +def test_a_join_answer_is_only_for_the_token_it_was_sealed_with(): + sealed = mesh.seal_answer("secret-a", "nonce-1", 7, {"node_token": "x"}) + assert mesh.open_answer("secret-a", "nonce-1", 7, sealed) == {"node_token": "x"} + with pytest.raises(ValueError, match="right Lens"): + mesh.open_answer("secret-b", "nonce-1", 7, sealed) + with pytest.raises(ValueError): + mesh.open_answer("secret-a", "nonce-1", 8, sealed) + assert mesh.parse_token("lensjoin1.12.abcdefghijklmnopqrstuvwxyz") == (12, "abcdefghijklmnopqrstuvwxyz") + with pytest.raises(ValueError): + mesh.parse_token("lensnode1.12.abcdefghijklmnopqrstuvwxyz") + assert mesh.check_setting("network", "10.73.0.1/16") == "10.73.0.0/16" + assert mesh.check_setting("hosts", ["lens.example.com", "[2001:db8::1]:4243"]) == ["lens.example.com", "[2001:db8::1]:4243"] + assert mesh.host_port("[2001:db8::1]", 4242) == "[2001:db8::1]:4242" and mesh.host_port("lens.home:5", 4242) == "lens.home:5" + assert settings.EDITABLE["mesh"] is None # every mesh setting is editable in the web app diff --git a/fastapi_backend/tests/fake_nebula_cert.py b/fastapi_backend/tests/fake_nebula_cert.py new file mode 100644 index 000000000..9c848b351 --- /dev/null +++ b/fastapi_backend/tests/fake_nebula_cert.py @@ -0,0 +1,159 @@ +#!/usr/bin/env python3 +"""A stand-in for `nebula-cert` (tests/api/test_mesh.py): the subcommands and flags domain/mesh.py uses, writing +certificates and keys in Nebula's PEM framing with JSON inside, so `print -json` gives back what `ca` and `sign` put +in. Public keys are in Nebula's own format (a base64 line between X25519 PUBLIC KEY lines), as mesh.PUBLIC_KEY_RX +expects. It checks what the real tool checks for these flows: a CA key that isn't the CA certificate's, a public key +that isn't one, a duration that isn't hours. Not a cryptographic implementation. +""" + +from __future__ import annotations + +import base64 +import datetime as dt +import hashlib +import json +import re +import secrets +import sys + +CERT = "NEBULA CERTIFICATE V2" +CA_KEY = "NEBULA ED25519 PRIVATE KEY" +KEY = "NEBULA X25519 PRIVATE KEY" +PUB = "NEBULA X25519 PUBLIC KEY" + + +def wrap(kind, text): + b64 = base64.b64encode(text.encode()).decode() + body = "\n".join(b64[i : i + 64] for i in range(0, len(b64), 64)) + return f"-----BEGIN {kind}-----\n{body}\n-----END {kind}-----\n" + + +def unwrap(pem, kind): + m = re.search(rf"-----BEGIN {kind}-----\n(.*?)-----END {kind}-----", pem, re.S) + if not m: + raise SystemExit(f"error while parsing: no {kind} block") + return base64.b64decode(m.group(1).replace("\n", "")).decode() + + +def read(path): + return sys.stdin.read() if path == "-" else open(path).read() + + +def write(path, text): + if path == "-": + sys.stdout.write(text) + else: + open(path, "w").write(text) + + +def flags(args): + out, i = {}, 0 + while i < len(args): + a = args[i] + if not a.startswith("-"): + raise SystemExit(f"flag provided but not defined: {a}") + out[a.lstrip("-")] = args[i + 1] if i + 1 < len(args) else "" + i += 2 + return out + + +def hours(value): + m = re.fullmatch(r"(\d+)h(0m0s)?", value or "") + if not m: + raise SystemExit(f'invalid value "{value}" for flag -duration: time: unknown unit') + return int(m.group(1)) + + +def now(): + return dt.datetime.now(dt.UTC).replace(microsecond=0) + + +def stamp(t): + return t.strftime("%Y-%m-%dT%H:%M:%SZ") + + +def cert(name, networks, groups, is_ca, issuer, duration, public_key): + start = now() + details = { + "groups": groups or None, + "isCa": is_ca, + "issuer": issuer, + "name": name, + "networks": networks, + "notAfter": stamp(start + dt.timedelta(hours=duration)), + "notBefore": stamp(start), + "unsafeNetworks": None, + } + body = json.dumps(details, sort_keys=True) + public_key + secrets.token_hex(8) + return { + "curve": "CURVE25519", + "details": details, + "fingerprint": hashlib.sha256(body.encode()).hexdigest(), + "publicKey": public_key, + "signature": secrets.token_hex(64), + "version": 2, + } + + +def main(argv): + if not argv: + raise SystemExit("Usage of nebula-cert ") + mode, f = argv[0], flags(argv[1:]) + if mode == "ca": + if not f.get("name"): + raise SystemExit("-name is required") + key_id = secrets.token_hex(16) + c = cert( + f["name"], + [n for n in (f.get("networks") or "").split(",") if n], + [], + True, + "", + hours(f.get("duration") or "8760h"), + secrets.token_hex(32), + ) + c["x_key"] = key_id + write(f.get("out-crt") or "ca.crt", wrap(CERT, json.dumps(c))) + write(f.get("out-key") or "ca.key", wrap(CA_KEY, json.dumps({"id": key_id}))) + return + if mode == "keygen": + write(f["out-key"], wrap(KEY, json.dumps({"id": secrets.token_hex(16)}))) + write(f["out-pub"], f"-----BEGIN {PUB}-----\n{base64.b64encode(secrets.token_bytes(32)).decode()}\n-----END {PUB}-----\n") + return + if mode == "sign": + ca = json.loads(unwrap(read(f.get("ca-crt") or "ca.crt"), CERT)) + key = json.loads(unwrap(read(f.get("ca-key") or "ca.key"), CA_KEY)) + if key["id"] != ca.get("x_key"): + raise SystemExit("error while signing: refusing to sign, root certificate does not match private key") + try: + pub = re.search(rf"-----BEGIN {PUB}-----\n([A-Za-z0-9+/=]+)\n-----END {PUB}-----", read(f["in-pub"])).group(1) + raw = base64.b64decode(pub) + if len(raw) != 32: + raise ValueError + except (AttributeError, ValueError, KeyError): + raise SystemExit("error while reading in-pub: bytes not the correct length for a public key") from None + if not f.get("name"): + raise SystemExit("-name is required") + if not f.get("networks"): + raise SystemExit("-networks is required") + c = cert( + f["name"], + f["networks"].split(","), + [g for g in (f.get("groups") or "").split(",") if g], + False, + ca["fingerprint"], + hours(f.get("duration") or "8759h"), + raw.hex(), + ) + write(f.get("out-crt") or f"{f['name']}.crt", wrap(CERT, json.dumps(c))) + return + if mode == "print": + c = json.loads(unwrap(read(f.get("path") or "-"), CERT)) + c.pop("x_key", None) + print(json.dumps([c]) if "json" in f else json.dumps(c, indent=2)) + return + raise SystemExit(f"unknown mode: {mode}") + + +if __name__ == "__main__": + main(sys.argv[1:]) diff --git a/mkdocs.yml b/mkdocs.yml index 0f43c58e3..e8d51e4b3 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -70,6 +70,7 @@ nav: - Updates and backups: updates.md - Remote access: remote-access.md - HTTPS: https.md + - Nodes and the mesh: mesh.md - Agents and apps: - MCP server: mcp.md - API: api.md diff --git a/nextjs-frontend/app/openapi-client/index.ts b/nextjs-frontend/app/openapi-client/index.ts index f4e1fdb84..b4bf68b1d 100644 --- a/nextjs-frontend/app/openapi-client/index.ts +++ b/nextjs-frontend/app/openapi-client/index.ts @@ -26,6 +26,7 @@ export { ImportHooks, Imports, Jobs, + Mesh, Metadata, Namespaces, Notes, @@ -299,6 +300,11 @@ export type { ChangeLoginProviderErrors, ChangeLoginProviderResponse, ChangeLoginProviderResponses, + ChangeNodeData, + ChangeNodeError, + ChangeNodeErrors, + ChangeNodeResponse, + ChangeNodeResponses, ChangePasswordData, ChangePasswordError, ChangePasswordErrors, @@ -1696,6 +1702,11 @@ export type { JobQueued, JobsCreate, JobsQueued, + JoinMeshData, + JoinMeshError, + JoinMeshErrors, + JoinMeshResponse, + JoinMeshResponses, KindTotals, LanguageCount, LastSend, @@ -2168,6 +2179,11 @@ export type { MailboxStatusResponse, MailboxStatusResponses, MailTestResult, + MakeMeshTokenData, + MakeMeshTokenError, + MakeMeshTokenErrors, + MakeMeshTokenResponse, + MakeMeshTokenResponses, MakeSigninLinkData, MakeSigninLinkError, MakeSigninLinkErrors, @@ -2251,6 +2267,27 @@ export type { MergeTopicsErrors, MergeTopicsResponse, MergeTopicsResponses, + MeshAuthority, + MeshBeat, + MeshJoin, + MeshJoined, + MeshNode, + MeshNodeChange, + MeshNodeConfig, + MeshNodesData, + MeshNodesResponse, + MeshNodesResponses, + MeshRenew, + MeshStatus, + MeshStatusData, + MeshStatusResponse, + MeshStatusResponses, + MeshToken, + MeshTokenCreate, + MeshTokenCreated, + MeshTokensData, + MeshTokensResponse, + MeshTokensResponses, MessageCreate, MessageDetail, MessageRecord, @@ -2306,6 +2343,14 @@ export type { NfsStatusData, NfsStatusResponse, NfsStatusResponses, + NodeBeatData, + NodeBeatError, + NodeBeatErrors, + NodeBeatResponse, + NodeBeatResponses, + NodeConfigData, + NodeConfigResponse, + NodeConfigResponses, NodeParam, NodeTrace, NodeType, @@ -2707,6 +2752,11 @@ export type { RemoveLoginProviderErrors, RemoveLoginProviderResponse, RemoveLoginProviderResponses, + RemoveNodeData, + RemoveNodeError, + RemoveNodeErrors, + RemoveNodeResponse, + RemoveNodeResponses, RemovePasskeyData, RemovePasskeyError, RemovePasskeyErrors, @@ -2753,6 +2803,11 @@ export type { RenameTokenResponse, RenameTokenResponses, Rendition, + RenewNodeData, + RenewNodeError, + RenewNodeErrors, + RenewNodeResponse, + RenewNodeResponses, ReprocessRecordingData, ReprocessRecordingError, ReprocessRecordingErrors, @@ -2828,6 +2883,11 @@ export type { RestoreDeletedErrors, RestoreDeletedResponse, RestoreDeletedResponses, + RestoreNodeData, + RestoreNodeError, + RestoreNodeErrors, + RestoreNodeResponse, + RestoreNodeResponses, RestoreStart, RestoreVersionData, RestoreVersionError, @@ -3839,6 +3899,11 @@ export type { WebImportRequest, WebPage, WikiPage, + WithdrawMeshTokenData, + WithdrawMeshTokenError, + WithdrawMeshTokenErrors, + WithdrawMeshTokenResponse, + WithdrawMeshTokenResponses, WorkerComponents, WorkerInfo, Workflow, diff --git a/nextjs-frontend/app/openapi-client/sdk.gen.ts b/nextjs-frontend/app/openapi-client/sdk.gen.ts index 2894e9735..948248465 100644 --- a/nextjs-frontend/app/openapi-client/sdk.gen.ts +++ b/nextjs-frontend/app/openapi-client/sdk.gen.ts @@ -97,6 +97,9 @@ import type { ChangeLoginProviderData, ChangeLoginProviderErrors, ChangeLoginProviderResponses, + ChangeNodeData, + ChangeNodeErrors, + ChangeNodeResponses, ChangePasswordData, ChangePasswordErrors, ChangePasswordResponses, @@ -817,6 +820,9 @@ import type { InstallMarketplacePluginData, InstallMarketplacePluginErrors, InstallMarketplacePluginResponses, + JoinMeshData, + JoinMeshErrors, + JoinMeshResponses, LinkEntityData, LinkEntityErrors, LinkEntityResponses, @@ -1093,6 +1099,9 @@ import type { LostPasskeyResponses, MailboxStatusData, MailboxStatusResponses, + MakeMeshTokenData, + MakeMeshTokenErrors, + MakeMeshTokenResponses, MakeSigninLinkData, MakeSigninLinkErrors, MakeSigninLinkResponses, @@ -1127,6 +1136,12 @@ import type { MergeTopicsData, MergeTopicsErrors, MergeTopicsResponses, + MeshNodesData, + MeshNodesResponses, + MeshStatusData, + MeshStatusResponses, + MeshTokensData, + MeshTokensResponses, MoveMentionData, MoveMentionErrors, MoveMentionResponses, @@ -1144,6 +1159,11 @@ import type { NewTokenResponses, NfsStatusData, NfsStatusResponses, + NodeBeatData, + NodeBeatErrors, + NodeBeatResponses, + NodeConfigData, + NodeConfigResponses, NotSameSpeakerData, NotSameSpeakerErrors, NotSameSpeakerResponses, @@ -1295,6 +1315,9 @@ import type { RemoveLoginProviderData, RemoveLoginProviderErrors, RemoveLoginProviderResponses, + RemoveNodeData, + RemoveNodeErrors, + RemoveNodeResponses, RemovePasskeyData, RemovePasskeyErrors, RemovePasskeyResponses, @@ -1322,6 +1345,9 @@ import type { RenameTokenData, RenameTokenErrors, RenameTokenResponses, + RenewNodeData, + RenewNodeErrors, + RenewNodeResponses, ReprocessRecordingData, ReprocessRecordingErrors, ReprocessRecordingResponses, @@ -1355,6 +1381,9 @@ import type { RestoreDeletedData, RestoreDeletedErrors, RestoreDeletedResponses, + RestoreNodeData, + RestoreNodeErrors, + RestoreNodeResponses, RestoreVersionData, RestoreVersionErrors, RestoreVersionResponses, @@ -1843,6 +1872,9 @@ import type { VaultOptionsResponses, VoiceInfoData, VoiceInfoResponses, + WithdrawMeshTokenData, + WithdrawMeshTokenErrors, + WithdrawMeshTokenResponses, WriteSpecData, WriteSpecErrors, WriteSpecResponses, @@ -12407,3 +12439,200 @@ export class Specs { }); } } + +export class Mesh { + /** + * Mesh Status + * + * Whether the mesh is on, its network and port, where other machines reach it, its CA and how many machines are + * on it. + */ + public static meshStatus( + options?: Options, + ): RequestResult { + return (options?.client ?? client).get({ + url: "/api/v1/mesh", + ...options, + }); + } + + /** + * Mesh Nodes + * + * Every machine: this one (the primary) first, then each node with its role, address, certificate, last report + * and the workers running on it. Removed nodes are listed too, with when. + */ + public static meshNodes( + options?: Options, + ): RequestResult { + return (options?.client ?? client).get({ + url: "/api/v1/mesh/nodes", + ...options, + }); + } + + /** + * Remove Node + * + * Take a node off the mesh: its certificates go on every machine's blocklist and its credentials stop working. + * POST /mesh/nodes/{id}/restore undoes it while its certificate is good. + */ + public static removeNode( + options: Options, + ): RequestResult { + return (options.client ?? client).delete({ + url: "/api/v1/mesh/nodes/{node_id}", + ...options, + }); + } + + /** + * Change Node + * + * Rename a node, or change the namespaces it serves (its certificate's groups follow when it next renews). + */ + public static changeNode( + options: Options, + ): RequestResult { + return (options.client ?? client).patch({ + url: "/api/v1/mesh/nodes/{node_id}", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, + }, + }); + } + + /** + * Restore Node + * + * Undo removing a node. + */ + public static restoreNode( + options: Options, + ): RequestResult { + return (options.client ?? client).post({ + url: "/api/v1/mesh/nodes/{node_id}/restore", + ...options, + }); + } + + /** + * Mesh Tokens + * + * Join tokens that can still be used (their secrets are shown only when made). + */ + public static meshTokens( + options?: Options, + ): RequestResult { + return (options?.client ?? client).get({ + url: "/api/v1/mesh/tokens", + ...options, + }); + } + + /** + * Make Mesh Token + * + * Add a node: a token another machine joins the mesh with, shown this once. Makes the mesh's CA the first time, + * and turns the mesh on. + */ + public static makeMeshToken( + options: Options, + ): RequestResult { + return (options.client ?? client).post({ + url: "/api/v1/mesh/tokens", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, + }, + }); + } + + /** + * Withdraw Mesh Token + * + * Withdraw a join token: no machine can join with it any more (those that did stay). + */ + public static withdrawMeshToken( + options: Options, + ): RequestResult { + return (options.client ?? client).delete({ + url: "/api/v1/mesh/tokens/{token_id}", + ...options, + }); + } + + /** + * Join Mesh + * + * A machine joins the mesh with a join token, without sending it: the token's id, the machine's public key, and + * an HMAC of the request keyed with the token's secret. The answer is sealed with a key from that secret + * (docs/mesh.md, Joining). Too many wrong tries from one address are turned away for a while. + */ + public static joinMesh( + options: Options, + ): RequestResult { + return (options.client ?? client).post({ + url: "/api/v1/mesh/join", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, + }, + }); + } + + /** + * Node Config + * + * The calling node's Nebula config as it is now (the blocklist, the lighthouse's addresses): it reloads when the + * version changes. + */ + public static nodeConfig( + options?: Options, + ): RequestResult { + return (options?.client ?? client).get({ + url: "/api/v1/mesh/node/config", + ...options, + }); + } + + /** + * Renew Node + * + * A new certificate for the calling node's public key, with the groups it has now. + */ + public static renewNode( + options: Options, + ): RequestResult { + return (options.client ?? client).post({ + url: "/api/v1/mesh/node/renew", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, + }, + }); + } + + /** + * Node Beat + * + * The calling node's report, every minute: Nebula, its peers, its machine. + */ + public static nodeBeat( + options: Options, + ): RequestResult { + return (options.client ?? client).post({ + url: "/api/v1/mesh/node/beat", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, + }, + }); + } +} diff --git a/nextjs-frontend/app/openapi-client/types.gen.ts b/nextjs-frontend/app/openapi-client/types.gen.ts index 22dde9c4a..a9c8d3c25 100644 --- a/nextjs-frontend/app/openapi-client/types.gen.ts +++ b/nextjs-frontend/app/openapi-client/types.gen.ts @@ -11756,6 +11756,484 @@ export type MentionMoved = { [key: string]: unknown; }; +/** + * MeshAuthority + */ +export type MeshAuthority = { + /** + * Fingerprint + * + * the CA certificate's fingerprint: every machine on the mesh trusts it + */ + fingerprint: string; + /** + * Not After + * + * when the CA runs out + */ + not_after?: string | null; + /** + * Created At + */ + created_at?: string | null; + [key: string]: unknown; +}; + +/** + * MeshBeat + */ +export type MeshBeat = { + /** + * Nebula + * + * running, starting, stopped or failed + */ + nebula?: string | null; + /** + * Version + * + * the Lens version it runs + */ + version?: string | null; + /** + * Peers + * + * the machines it has tunnels to + */ + peers?: Array<{ + [key: string]: unknown; + }> | null; + /** + * Machine + * + * its processors, memory and system + */ + machine?: { + [key: string]: unknown; + } | null; + /** + * Sandbox + * + * the sandboxes it can run + */ + sandbox?: { + [key: string]: unknown; + } | null; + /** + * Error + */ + error?: string | null; + /** + * Log + * + * Nebula's last lines + */ + log?: Array | null; +}; + +/** + * MeshJoin + */ +export type MeshJoin = { + /** + * Token Id + * + * the number in the join token (lensjoin1..) + */ + token_id: number; + /** + * Nonce + * + * random, made for this request + */ + nonce: string; + /** + * Name + * + * the machine's name + */ + name: string; + /** + * Public Key + * + * its Nebula public key (nebula-cert keygen): its private key never leaves it + */ + public_key: string; + /** + * Proof + * + * HMAC-SHA256 of the request, keyed with the token's secret (docs/mesh.md) + */ + proof: string; + /** + * Info + * + * about the machine: os, arch, cpus, memory + */ + info?: { + [key: string]: unknown; + } | null; +}; + +/** + * MeshJoined + */ +export type MeshJoined = { + /** + * Node + */ + node: number; + /** + * Sealed + * + * the answer, sealed with a key from the token's secret: certificate, config, credentials + */ + sealed: string; + [key: string]: unknown; +}; + +/** + * MeshNode + */ +export type MeshNode = { + /** + * Id + */ + id: number; + /** + * Name + */ + name: string; + /** + * Role + */ + role: "primary" | "worker" | "compute"; + /** + * Ip + * + * its address on the mesh + */ + ip: string; + /** + * Groups + * + * its certificate's groups: role and namespaces, for the firewall + */ + groups?: Array; + /** + * Namespaces + * + * the namespaces it serves (none: every one) + */ + namespaces?: Array; + /** + * Fingerprint + * + * its current certificate's fingerprint + */ + fingerprint?: string | null; + /** + * Not After + * + * when its certificate runs out (it renews it at two thirds) + */ + not_after?: string | null; + /** + * Joined At + */ + joined_at?: string | null; + /** + * Joined By + * + * the admin who made the token it joined with + */ + joined_by?: string | null; + /** + * Last Seen + * + * its last report, every minute while it runs + */ + last_seen?: string | null; + /** + * Status + * + * what it last reported: Nebula, its peers, its machine + */ + status?: { + [key: string]: unknown; + }; + /** + * Revoked At + * + * when it was taken off the mesh + */ + revoked_at?: string | null; + /** + * Revoked By + */ + revoked_by?: string | null; + /** + * Hosts + * + * the address it reached this install at to join + */ + hosts?: Array; + /** + * Workers + * + * the job workers running on it + */ + workers?: Array; + [key: string]: unknown; +}; + +/** + * MeshNodeChange + */ +export type MeshNodeChange = { + /** + * Name + */ + name?: string | null; + /** + * Namespaces + * + * the namespaces it serves (empty: every one) + */ + namespaces?: Array | null; +}; + +/** + * MeshNodeConfig + */ +export type MeshNodeConfig = { + /** + * Config + * + * its Nebula config, without its private key + */ + config: { + [key: string]: unknown; + }; + /** + * Version + * + * changes whenever the config does + */ + version: string; + /** + * Not After + */ + not_after?: string | null; + /** + * Renew Days + * + * how many days before its certificate runs out it renews it + */ + renew_days: number; + /** + * Crt + * + * the new certificate (renew) + */ + crt?: string | null; + [key: string]: unknown; +}; + +/** + * MeshRenew + */ +export type MeshRenew = { + /** + * Public Key + * + * its Nebula public key, the same or a new one + */ + public_key: string; +}; + +/** + * MeshStatus + */ +export type MeshStatus = { + /** + * Enabled + * + * the mesh is on (mesh.enabled): adding a node turns it on + */ + enabled: boolean; + /** + * Network + * + * the mesh's addresses (mesh.network) + */ + network: string; + /** + * Port + * + * the UDP port the primary listens on (mesh.port) + */ + port: number; + /** + * Hosts + * + * where other machines reach that port (mesh.hosts); empty: where each joined + */ + hosts: Array; + /** + * Primary Ip + * + * this machine's address on the mesh + */ + primary_ip: string; + /** + * the mesh's certificate authority, once made + */ + ca?: MeshAuthority | null; + /** + * Nodes + * + * machines on the mesh besides this one + */ + nodes: number; + /** + * Removed + * + * machines taken off it + */ + removed: number; + /** + * Tokens + * + * join tokens that can still be used + */ + tokens: number; + /** + * Nebula + * + * the Nebula version Lens runs + */ + nebula: string; + /** + * Tools + * + * Nebula's programs are on this server (else they're fetched when first needed) + */ + tools: boolean; + [key: string]: unknown; +}; + +/** + * MeshToken + */ +export type MeshToken = { + /** + * Id + */ + id: number; + /** + * Role + */ + role: "worker" | "compute"; + /** + * Name + */ + name?: string | null; + /** + * Namespaces + */ + namespaces?: Array; + /** + * Expires At + */ + expires_at?: string | null; + /** + * Uses + * + * how many machines may join with it + */ + uses?: number; + /** + * Used + * + * how many have + */ + used?: number; + /** + * Expired + */ + expired?: boolean; + /** + * Created By + */ + created_by?: string | null; + /** + * Created At + */ + created_at?: string | null; + /** + * Last Used At + */ + last_used_at?: string | null; + [key: string]: unknown; +}; + +/** + * MeshTokenCreate + */ +export type MeshTokenCreate = { + /** + * Role + * + * worker: runs jobs against this install's database; compute: runs sandboxes only + */ + role?: "worker" | "compute"; + /** + * Name + * + * the name it shows as (none: the name the machine sends) + */ + name?: string | null; + /** + * Namespaces + * + * the namespaces it serves (empty: every one) + */ + namespaces?: Array; + /** + * Hours + * + * how long the token can be used + */ + hours?: number; + /** + * Uses + * + * how many machines may join with it + */ + uses?: number; +}; + +/** + * MeshTokenCreated + */ +export type MeshTokenCreated = { + token: MeshToken; + /** + * Secret + * + * the join token itself, shown this once + */ + secret: string; + /** + * Join Url + * + * this install's address the machine joins at + */ + join_url: string; + [key: string]: unknown; +}; + /** * MessageCreate */ @@ -45153,3 +45631,291 @@ export type WriteSpecResponses = { }; export type WriteSpecResponse = WriteSpecResponses[keyof WriteSpecResponses]; + +export type MeshStatusData = { + body?: never; + path?: never; + query?: never; + url: "/api/v1/mesh"; +}; + +export type MeshStatusResponses = { + /** + * Successful Response + */ + 200: MeshStatus; +}; + +export type MeshStatusResponse = MeshStatusResponses[keyof MeshStatusResponses]; + +export type MeshNodesData = { + body?: never; + path?: never; + query?: never; + url: "/api/v1/mesh/nodes"; +}; + +export type MeshNodesResponses = { + /** + * Response Mesh-Mesh Nodes + * + * Successful Response + */ + 200: Array; +}; + +export type MeshNodesResponse = MeshNodesResponses[keyof MeshNodesResponses]; + +export type RemoveNodeData = { + body?: never; + path: { + /** + * Node Id + */ + node_id: number; + }; + query?: never; + url: "/api/v1/mesh/nodes/{node_id}"; +}; + +export type RemoveNodeErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type RemoveNodeError = RemoveNodeErrors[keyof RemoveNodeErrors]; + +export type RemoveNodeResponses = { + /** + * Successful Response + */ + 200: MeshNode; +}; + +export type RemoveNodeResponse = RemoveNodeResponses[keyof RemoveNodeResponses]; + +export type ChangeNodeData = { + body: MeshNodeChange; + path: { + /** + * Node Id + */ + node_id: number; + }; + query?: never; + url: "/api/v1/mesh/nodes/{node_id}"; +}; + +export type ChangeNodeErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type ChangeNodeError = ChangeNodeErrors[keyof ChangeNodeErrors]; + +export type ChangeNodeResponses = { + /** + * Successful Response + */ + 200: MeshNode; +}; + +export type ChangeNodeResponse = ChangeNodeResponses[keyof ChangeNodeResponses]; + +export type RestoreNodeData = { + body?: never; + path: { + /** + * Node Id + */ + node_id: number; + }; + query?: never; + url: "/api/v1/mesh/nodes/{node_id}/restore"; +}; + +export type RestoreNodeErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type RestoreNodeError = RestoreNodeErrors[keyof RestoreNodeErrors]; + +export type RestoreNodeResponses = { + /** + * Successful Response + */ + 200: MeshNode; +}; + +export type RestoreNodeResponse = RestoreNodeResponses[keyof RestoreNodeResponses]; + +export type MeshTokensData = { + body?: never; + path?: never; + query?: never; + url: "/api/v1/mesh/tokens"; +}; + +export type MeshTokensResponses = { + /** + * Response Mesh-Mesh Tokens + * + * Successful Response + */ + 200: Array; +}; + +export type MeshTokensResponse = MeshTokensResponses[keyof MeshTokensResponses]; + +export type MakeMeshTokenData = { + body: MeshTokenCreate; + path?: never; + query?: never; + url: "/api/v1/mesh/tokens"; +}; + +export type MakeMeshTokenErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type MakeMeshTokenError = MakeMeshTokenErrors[keyof MakeMeshTokenErrors]; + +export type MakeMeshTokenResponses = { + /** + * Successful Response + */ + 200: MeshTokenCreated; +}; + +export type MakeMeshTokenResponse = MakeMeshTokenResponses[keyof MakeMeshTokenResponses]; + +export type WithdrawMeshTokenData = { + body?: never; + path: { + /** + * Token Id + */ + token_id: number; + }; + query?: never; + url: "/api/v1/mesh/tokens/{token_id}"; +}; + +export type WithdrawMeshTokenErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type WithdrawMeshTokenError = WithdrawMeshTokenErrors[keyof WithdrawMeshTokenErrors]; + +export type WithdrawMeshTokenResponses = { + /** + * Successful Response + */ + 200: Ok; +}; + +export type WithdrawMeshTokenResponse = WithdrawMeshTokenResponses[keyof WithdrawMeshTokenResponses]; + +export type JoinMeshData = { + body: MeshJoin; + path?: never; + query?: never; + url: "/api/v1/mesh/join"; +}; + +export type JoinMeshErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type JoinMeshError = JoinMeshErrors[keyof JoinMeshErrors]; + +export type JoinMeshResponses = { + /** + * Successful Response + */ + 200: MeshJoined; +}; + +export type JoinMeshResponse = JoinMeshResponses[keyof JoinMeshResponses]; + +export type NodeConfigData = { + body?: never; + path?: never; + query?: never; + url: "/api/v1/mesh/node/config"; +}; + +export type NodeConfigResponses = { + /** + * Successful Response + */ + 200: MeshNodeConfig; +}; + +export type NodeConfigResponse = NodeConfigResponses[keyof NodeConfigResponses]; + +export type RenewNodeData = { + body: MeshRenew; + path?: never; + query?: never; + url: "/api/v1/mesh/node/renew"; +}; + +export type RenewNodeErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type RenewNodeError = RenewNodeErrors[keyof RenewNodeErrors]; + +export type RenewNodeResponses = { + /** + * Successful Response + */ + 200: MeshNodeConfig; +}; + +export type RenewNodeResponse = RenewNodeResponses[keyof RenewNodeResponses]; + +export type NodeBeatData = { + body: MeshBeat; + path?: never; + query?: never; + url: "/api/v1/mesh/node/beat"; +}; + +export type NodeBeatErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type NodeBeatError = NodeBeatErrors[keyof NodeBeatErrors]; + +export type NodeBeatResponses = { + /** + * Successful Response + */ + 200: Ok; +}; + +export type NodeBeatResponse = NodeBeatResponses[keyof NodeBeatResponses]; diff --git a/nextjs-frontend/openapi.json b/nextjs-frontend/openapi.json index 3ef57a5c7..0472f080c 100644 --- a/nextjs-frontend/openapi.json +++ b/nextjs-frontend/openapi.json @@ -31986,6 +31986,448 @@ } } } + }, + "/api/v1/mesh": { + "get": { + "tags": [ + "mesh" + ], + "summary": "Mesh Status", + "description": "Whether the mesh is on, its network and port, where other machines reach it, its CA and how many machines are\non it.", + "operationId": "mesh_status", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MeshStatus" + } + } + } + } + } + } + }, + "/api/v1/mesh/nodes": { + "get": { + "tags": [ + "mesh" + ], + "summary": "Mesh Nodes", + "description": "Every machine: this one (the primary) first, then each node with its role, address, certificate, last report\nand the workers running on it. Removed nodes are listed too, with when.", + "operationId": "mesh_nodes", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/MeshNode" + }, + "type": "array", + "title": "Response Mesh-Mesh Nodes" + } + } + } + } + } + } + }, + "/api/v1/mesh/nodes/{node_id}": { + "patch": { + "tags": [ + "mesh" + ], + "summary": "Change Node", + "description": "Rename a node, or change the namespaces it serves (its certificate's groups follow when it next renews).", + "operationId": "change_node", + "parameters": [ + { + "name": "node_id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "title": "Node Id" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MeshNodeChange" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MeshNode" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "mesh" + ], + "summary": "Remove Node", + "description": "Take a node off the mesh: its certificates go on every machine's blocklist and its credentials stop working.\nPOST /mesh/nodes/{id}/restore undoes it while its certificate is good.", + "operationId": "remove_node", + "parameters": [ + { + "name": "node_id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "title": "Node Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MeshNode" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/v1/mesh/nodes/{node_id}/restore": { + "post": { + "tags": [ + "mesh" + ], + "summary": "Restore Node", + "description": "Undo removing a node.", + "operationId": "restore_node", + "parameters": [ + { + "name": "node_id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "title": "Node Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MeshNode" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/v1/mesh/tokens": { + "get": { + "tags": [ + "mesh" + ], + "summary": "Mesh Tokens", + "description": "Join tokens that can still be used (their secrets are shown only when made).", + "operationId": "mesh_tokens", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/MeshToken" + }, + "type": "array", + "title": "Response Mesh-Mesh Tokens" + } + } + } + } + } + }, + "post": { + "tags": [ + "mesh" + ], + "summary": "Make Mesh Token", + "description": "Add a node: a token another machine joins the mesh with, shown this once. Makes the mesh's CA the first time,\nand turns the mesh on.", + "operationId": "make_mesh_token", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MeshTokenCreate" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MeshTokenCreated" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/v1/mesh/tokens/{token_id}": { + "delete": { + "tags": [ + "mesh" + ], + "summary": "Withdraw Mesh Token", + "description": "Withdraw a join token: no machine can join with it any more (those that did stay).", + "operationId": "withdraw_mesh_token", + "parameters": [ + { + "name": "token_id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "title": "Token Id" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Ok" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/v1/mesh/join": { + "post": { + "tags": [ + "mesh" + ], + "summary": "Join Mesh", + "description": "A machine joins the mesh with a join token, without sending it: the token's id, the machine's public key, and\nan HMAC of the request keyed with the token's secret. The answer is sealed with a key from that secret\n(docs/mesh.md, Joining). Too many wrong tries from one address are turned away for a while.", + "operationId": "join_mesh", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MeshJoin" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MeshJoined" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/v1/mesh/node/config": { + "get": { + "tags": [ + "mesh" + ], + "summary": "Node Config", + "description": "The calling node's Nebula config as it is now (the blocklist, the lighthouse's addresses): it reloads when the\nversion changes.", + "operationId": "node_config", + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MeshNodeConfig" + } + } + } + } + } + } + }, + "/api/v1/mesh/node/renew": { + "post": { + "tags": [ + "mesh" + ], + "summary": "Renew Node", + "description": "A new certificate for the calling node's public key, with the groups it has now.", + "operationId": "renew_node", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MeshRenew" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MeshNodeConfig" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/v1/mesh/node/beat": { + "post": { + "tags": [ + "mesh" + ], + "summary": "Node Beat", + "description": "The calling node's report, every minute: Nebula, its peers, its machine.", + "operationId": "node_beat", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MeshBeat" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Ok" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } } }, "components": { @@ -42625,60 +43067,232 @@ "type": "null" } ], - "title": "Description" - }, - "aliases": { - "items": { - "type": "string" - }, - "type": "array", - "maxItems": 100, - "title": "Aliases", - "description": "other ways it's written" + "title": "Description" + }, + "aliases": { + "items": { + "type": "string" + }, + "type": "array", + "maxItems": 100, + "title": "Aliases", + "description": "other ways it's written" + }, + "collection": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Collection", + "description": "for this collection (and those inside it) only; default: the namespace" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "name" + ], + "title": "EntityDefine" + }, + "EntityDetail": { + "properties": { + "id": { + "type": "integer", + "title": "Id" + }, + "name": { + "type": "string", + "title": "Name" + }, + "key": { + "type": "string", + "title": "Key" + }, + "type": { + "type": "string", + "title": "Type" + }, + "type_label": { + "type": "string", + "title": "Type Label" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "namespace": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Namespace" + }, + "aliases": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Aliases", + "default": [] + }, + "mentions": { + "type": "integer", + "title": "Mentions", + "default": 0 + }, + "recordings": { + "type": "integer", + "title": "Recordings", + "default": 0 + }, + "speakers": { + "type": "integer", + "title": "Speakers", + "default": 0 + }, + "first": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "First" + }, + "last": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Last" + }, + "links": { + "items": { + "$ref": "#/components/schemas/EntityLink" + }, + "type": "array", + "title": "Links", + "default": [] + }, + "same_name_elsewhere": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array", + "title": "Same Name Elsewhere", + "default": [] + }, + "hidden": { + "type": "boolean", + "title": "Hidden", + "default": false + }, + "defined": { + "type": "boolean", + "title": "Defined", + "description": "on the fixed list people defined", + "default": false + }, + "builtin": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Builtin", + "description": "unknown or unlabeled: one of the two entities that are always there" + }, + "collection": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Collection", + "description": "a defined entity of one collection (and those inside it)" + }, + "page": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Page", + "description": "its page in the web app, by name: /wiki//" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "id", + "name", + "key", + "type", + "type_label" + ], + "title": "EntityDetail" + }, + "EntityHide": { + "properties": { + "hidden": { + "type": "boolean", + "title": "Hidden", + "default": true }, - "collection": { + "reason": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Collection", - "description": "for this collection (and those inside it) only; default: the namespace" + "title": "Reason" } }, "additionalProperties": false, "type": "object", - "required": [ - "name" - ], - "title": "EntityDefine" + "title": "EntityHide" }, - "EntityDetail": { + "EntityLink": { "properties": { "id": { "type": "integer", "title": "Id" }, "name": { - "type": "string", - "title": "Name" - }, - "key": { - "type": "string", - "title": "Key" - }, - "type": { - "type": "string", - "title": "Type" - }, - "type_label": { - "type": "string", - "title": "Type Label" - }, - "description": { "anyOf": [ { "type": "string" @@ -42687,7 +43301,7 @@ "type": "null" } ], - "title": "Description" + "title": "Name" }, "namespace": { "anyOf": [ @@ -42699,31 +43313,129 @@ } ], "title": "Namespace" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "id" + ], + "title": "EntityLink" + }, + "EntityLinkRequest": { + "properties": { + "with": { + "type": "integer", + "title": "With", + "description": "the entity (in another namespace) that is the same thing", + "default": 0 + } + }, + "additionalProperties": false, + "type": "object", + "title": "EntityLinkRequest" + }, + "EntityList": { + "properties": { + "total": { + "type": "integer", + "title": "Total" }, - "aliases": { + "items": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array", + "title": "Items" + }, + "months": { "items": { "type": "string" }, "type": "array", - "title": "Aliases", + "title": "Months", "default": [] }, - "mentions": { + "facets": { + "additionalProperties": { + "additionalProperties": { + "type": "integer" + }, + "type": "object" + }, + "type": "object", + "title": "Facets", + "default": {} + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "total", + "items" + ], + "title": "EntityList" + }, + "EntityMerge": { + "properties": { + "keep": { "type": "integer", - "title": "Mentions", + "title": "Keep", "default": 0 }, - "recordings": { + "others": { + "items": { + "type": "integer" + }, + "type": "array", + "title": "Others", + "default": [] + } + }, + "additionalProperties": false, + "type": "object", + "title": "EntityMerge" + }, + "EntityMerged": { + "properties": { + "ok": { + "type": "boolean", + "title": "Ok", + "default": true + }, + "merge": { "type": "integer", - "title": "Recordings", + "title": "Merge" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "merge" + ], + "title": "EntityMerged" + }, + "EntityNotSame": { + "properties": { + "a": { + "type": "integer", + "title": "A", "default": 0 }, - "speakers": { + "b": { "type": "integer", - "title": "Speakers", + "title": "B", "default": 0 - }, - "first": { + } + }, + "additionalProperties": false, + "type": "object", + "title": "EntityNotSame" + }, + "EntityRename": { + "properties": { + "name": { "anyOf": [ { "type": "string" @@ -42732,9 +43444,40 @@ "type": "null" } ], - "title": "First" + "title": "Name" }, - "last": { + "keep_alias": { + "type": "boolean", + "title": "Keep Alias", + "default": true + }, + "correct": { + "type": "boolean", + "title": "Correct", + "description": "also correct the lines of text that have the old name", + "default": false + }, + "dry_run": { + "type": "boolean", + "title": "Dry Run", + "default": false + } + }, + "additionalProperties": false, + "type": "object", + "title": "EntityRename" + }, + "EntityRetype": { + "properties": { + "ids": { + "items": { + "type": "integer" + }, + "type": "array", + "title": "Ids", + "default": [] + }, + "type": { "anyOf": [ { "type": "string" @@ -42743,37 +43486,29 @@ "type": "null" } ], - "title": "Last" - }, - "links": { - "items": { - "$ref": "#/components/schemas/EntityLink" - }, - "type": "array", - "title": "Links", - "default": [] - }, - "same_name_elsewhere": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Same Name Elsewhere", - "default": [] - }, - "hidden": { - "type": "boolean", - "title": "Hidden", - "default": false - }, - "defined": { - "type": "boolean", - "title": "Defined", - "description": "on the fixed list people defined", - "default": false + "title": "Type" + } + }, + "additionalProperties": false, + "type": "object", + "title": "EntityRetype" + }, + "EntitySetup": { + "properties": { + "mode": { + "type": "string", + "title": "Mode", + "description": "self: every name found becomes an entity, and people curate them; fixed: names found are mapped onto the entities people defined, or onto Unlabeled (it belongs here) or Unknown; hybrid: the defined entities first, then names of the types kept become entities of their own and others go to Unknown" }, - "builtin": { + "types": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Types", + "description": "the types kept; empty: all of them" + }, + "description": { "anyOf": [ { "type": "string" @@ -42782,8 +43517,13 @@ "type": "null" } ], - "title": "Builtin", - "description": "unknown or unlabeled: one of the two entities that are always there" + "title": "Description", + "description": "what this place is about" + }, + "matching": { + "type": "string", + "title": "Matching", + "default": "rules" }, "collection": { "anyOf": [ @@ -42795,9 +43535,16 @@ } ], "title": "Collection", - "description": "a defined entity of one collection (and those inside it)" + "description": "the collection this setup is saved on; null: the namespace" }, - "page": { + "collection_path": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Collection Path" + }, + "updated_at": { "anyOf": [ { "type": "string" @@ -42806,194 +43553,248 @@ "type": "null" } ], - "title": "Page", - "description": "its page in the web app, by name: /wiki//" + "title": "Updated At" + }, + "updated_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Updated By" + }, + "can_change": { + "type": "boolean", + "title": "Can Change", + "default": false } }, "additionalProperties": true, "type": "object", "required": [ - "id", - "name", - "key", - "type", - "type_label" + "mode" ], - "title": "EntityDetail" + "title": "EntitySetup" }, - "EntityHide": { + "EntitySetupApplied": { "properties": { - "hidden": { - "type": "boolean", - "title": "Hidden", - "default": true - }, - "reason": { + "recordings": { + "type": "integer", + "title": "Recordings", + "description": "how many assets are analysed again" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "recordings" + ], + "title": "EntitySetupApplied" + }, + "EntitySetupApply": { + "properties": { + "collection": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Reason" + "title": "Collection", + "description": "only this collection's assets (and those inside it)" } }, "additionalProperties": false, "type": "object", - "title": "EntityHide" + "title": "EntitySetupApply" }, - "EntityLink": { + "EntitySetupSave": { "properties": { - "id": { - "type": "integer", - "title": "Id" - }, - "name": { + "collection": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Name" + "title": "Collection", + "description": "save it on this collection (default: the namespace)" }, - "namespace": { + "mode": { + "type": "string", + "enum": [ + "self", + "fixed", + "hybrid" + ], + "title": "Mode", + "default": "self" + }, + "types": { + "items": { + "type": "string" + }, + "type": "array", + "maxItems": 100, + "title": "Types" + }, + "description": { "anyOf": [ { - "type": "string" + "type": "string", + "maxLength": 2000 }, { "type": "null" } ], - "title": "Namespace" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "id" - ], - "title": "EntityLink" - }, - "EntityLinkRequest": { - "properties": { - "with": { - "type": "integer", - "title": "With", - "description": "the entity (in another namespace) that is the same thing", - "default": 0 + "title": "Description" + }, + "matching": { + "type": "string", + "enum": [ + "rules", + "model" + ], + "title": "Matching", + "default": "rules" } }, "additionalProperties": false, "type": "object", - "title": "EntityLinkRequest" + "title": "EntitySetupSave" }, - "EntityList": { + "EntitySetupView": { "properties": { - "total": { - "type": "integer", - "title": "Total" + "namespace": { + "$ref": "#/components/schemas/EntitySetup", + "description": "the namespace's setup (the default when none is saved)" }, - "items": { + "saved": { + "type": "boolean", + "title": "Saved", + "description": "whether the namespace has a setup of its own" + }, + "collections": { "items": { - "additionalProperties": true, - "type": "object" + "$ref": "#/components/schemas/EntitySetup" }, "type": "array", - "title": "Items" + "title": "Collections", + "description": "collections with a setup of their own" }, - "months": { + "types": { "items": { - "type": "string" + "$ref": "#/components/schemas/EntityTypeInfo" }, "type": "array", - "title": "Months", + "title": "Types", "default": [] }, - "facets": { - "additionalProperties": { - "additionalProperties": { - "type": "integer" - }, - "type": "object" - }, - "type": "object", - "title": "Facets", - "default": {} + "can_change": { + "type": "boolean", + "title": "Can Change", + "description": "you may change the namespace's setup and types: its editors" } }, "additionalProperties": true, "type": "object", "required": [ - "total", - "items" + "namespace", + "saved", + "can_change" ], - "title": "EntityList" + "title": "EntitySetupView" }, - "EntityMerge": { + "EntityType": { "properties": { - "keep": { - "type": "integer", - "title": "Keep", - "default": 0 + "type": { + "type": "string", + "title": "Type" }, - "others": { - "items": { - "type": "integer" - }, - "type": "array", - "title": "Others", - "default": [] - } - }, - "additionalProperties": false, - "type": "object", - "title": "EntityMerge" - }, - "EntityMerged": { - "properties": { - "ok": { + "label": { + "type": "string", + "title": "Label" + }, + "quiet": { "type": "boolean", - "title": "Ok", - "default": true + "title": "Quiet", + "description": "extracted but hidden unless a filter asks for it (dates, numbers)" }, - "merge": { - "type": "integer", - "title": "Merge" + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "builtin": { + "type": "boolean", + "title": "Builtin", + "description": "one of Lens's types; false: the namespace's own", + "default": true } }, "additionalProperties": true, "type": "object", "required": [ - "merge" + "type", + "label", + "quiet" ], - "title": "EntityMerged" + "title": "EntityType" }, - "EntityNotSame": { + "EntityTypeCreate": { "properties": { - "a": { - "type": "integer", - "title": "A", - "default": 0 + "label": { + "type": "string", + "maxLength": 40, + "minLength": 1, + "title": "Label" }, - "b": { - "type": "integer", - "title": "B", - "default": 0 + "description": { + "anyOf": [ + { + "type": "string", + "maxLength": 2000 + }, + { + "type": "null" + } + ], + "title": "Description" } }, "additionalProperties": false, "type": "object", - "title": "EntityNotSame" + "required": [ + "label" + ], + "title": "EntityTypeCreate" }, - "EntityRename": { + "EntityTypeInfo": { "properties": { - "name": { + "type": { + "type": "string", + "title": "Type", + "description": "the code extractors and models use, e.g. ORG or CLIENT_TEAM" + }, + "label": { + "type": "string", + "title": "Label" + }, + "description": { "anyOf": [ { "type": "string" @@ -43002,70 +43803,64 @@ "type": "null" } ], - "title": "Name" - }, - "keep_alias": { - "type": "boolean", - "title": "Keep Alias", - "default": true + "title": "Description" }, - "correct": { + "quiet": { "type": "boolean", - "title": "Correct", - "description": "also correct the lines of text that have the old name", + "title": "Quiet", + "description": "extracted but hidden unless a filter asks for it (dates, numbers)", "default": false }, - "dry_run": { + "builtin": { "type": "boolean", - "title": "Dry Run", - "default": false + "title": "Builtin", + "description": "one of Lens's types; false: the namespace's own", + "default": true } }, - "additionalProperties": false, + "additionalProperties": true, "type": "object", - "title": "EntityRename" + "required": [ + "type", + "label" + ], + "title": "EntityTypeInfo" }, - "EntityRetype": { + "EntityTypeUpdate": { "properties": { - "ids": { - "items": { - "type": "integer" - }, - "type": "array", - "title": "Ids", - "default": [] + "label": { + "anyOf": [ + { + "type": "string", + "maxLength": 40, + "minLength": 1 + }, + { + "type": "null" + } + ], + "title": "Label" }, - "type": { + "description": { "anyOf": [ { - "type": "string" + "type": "string", + "maxLength": 2000 }, { "type": "null" } ], - "title": "Type" + "title": "Description", + "description": "empty clears it" } }, "additionalProperties": false, "type": "object", - "title": "EntityRetype" + "title": "EntityTypeUpdate" }, - "EntitySetup": { + "EntityUpdate": { "properties": { - "mode": { - "type": "string", - "title": "Mode", - "description": "self: every name found becomes an entity, and people curate them; fixed: names found are mapped onto the entities people defined, or onto Unlabeled (it belongs here) or Unknown; hybrid: the defined entities first, then names of the types kept become entities of their own and others go to Unknown" - }, - "types": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Types", - "description": "the types kept; empty: all of them" - }, "description": { "anyOf": [ { @@ -43076,44 +43871,76 @@ } ], "title": "Description", - "description": "what this place is about" - }, - "matching": { - "type": "string", - "title": "Matching", - "default": "rules" + "description": "what the entity is; empty clears it" }, - "collection": { + "aliases": { "anyOf": [ { - "type": "integer" + "items": { + "type": "string" + }, + "type": "array", + "maxItems": 100 }, { "type": "null" } ], - "title": "Collection", - "description": "the collection this setup is saved on; null: the namespace" - }, - "collection_path": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Collection Path" + "title": "Aliases", + "description": "the other ways it's written (these replace the ones it has)" }, - "updated_at": { + "defined": { "anyOf": [ { - "type": "string" + "type": "boolean" }, { "type": "null" } ], - "title": "Updated At" + "title": "Defined", + "description": "on the fixed list of entities (namespaces in the fixed mode map names onto it)" + } + }, + "additionalProperties": false, + "type": "object", + "title": "EntityUpdate" + }, + "Estimate": { + "properties": { + "recordings": { + "type": "integer", + "title": "Recordings" }, - "updated_by": { + "by_kind": { + "additionalProperties": { + "type": "integer" + }, + "type": "object", + "title": "By Kind", + "default": {} + }, + "hours": { + "type": "number", + "title": "Hours" + }, + "seconds": { + "type": "integer", + "title": "Seconds" + }, + "llm": { + "$ref": "#/components/schemas/LlmEstimate" + }, + "would_replace": { + "type": "integer", + "title": "Would Replace", + "description": "existing outputs the run would overwrite" + }, + "needs_confirmation": { + "type": "boolean", + "title": "Needs Confirmation" + }, + "confirm_text": { "anyOf": [ { "type": "string" @@ -43122,171 +43949,172 @@ "type": "null" } ], - "title": "Updated By" - }, - "can_change": { - "type": "boolean", - "title": "Can Change", - "default": false + "title": "Confirm Text" } }, "additionalProperties": true, "type": "object", "required": [ - "mode" + "recordings", + "hours", + "seconds", + "llm", + "would_replace", + "needs_confirmation" ], - "title": "EntitySetup" + "title": "Estimate" }, - "EntitySetupApplied": { + "EventInfo": { "properties": { - "recordings": { - "type": "integer", - "title": "Recordings", - "description": "how many assets are analysed again" + "type": { + "type": "string", + "enum": [ + "job.succeeded", + "job.failed", + "job.cancelled", + "batch.finished", + "recording.added", + "lens.release", + "approval.waiting" + ], + "title": "Type" + }, + "label": { + "type": "string", + "title": "Label" } }, "additionalProperties": true, "type": "object", "required": [ - "recordings" + "type", + "label" ], - "title": "EntitySetupApplied" + "title": "EventInfo" }, - "EntitySetupApply": { + "Extension": { "properties": { - "collection": { + "id": { + "type": "integer", + "title": "Id" + }, + "name": { + "type": "string", + "title": "Name", + "description": "what the assistant calls it: its tool or skill name" + }, + "kind": { + "type": "string", + "enum": [ + "tool", + "skill", + "hook", + "plugin", + "mcp" + ], + "title": "Kind" + }, + "title": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Collection", - "description": "only this collection's assets (and those inside it)" - } - }, - "additionalProperties": false, - "type": "object", - "title": "EntitySetupApply" - }, - "EntitySetupSave": { - "properties": { - "collection": { + "title": "Title" + }, + "description": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Collection", - "description": "save it on this collection (default: the namespace)" + "title": "Description" }, - "mode": { + "visibility": { "type": "string", "enum": [ - "self", - "fixed", - "hybrid" + "private", + "namespace", + "everyone" ], - "title": "Mode", - "default": "self" + "title": "Visibility", + "default": "private" }, - "types": { + "namespaces": { "items": { "type": "string" }, "type": "array", - "maxItems": 100, - "title": "Types" + "title": "Namespaces", + "description": "who sees it, when shared with namespaces" }, - "description": { + "enabled": { + "type": "boolean", + "title": "Enabled", + "description": "whether it's switched on in conversations" + }, + "owner_email": { "anyOf": [ { - "type": "string", - "maxLength": 2000 + "type": "string" }, { "type": "null" } ], - "title": "Description" - }, - "matching": { - "type": "string", - "enum": [ - "rules", - "model" - ], - "title": "Matching", - "default": "rules" - } - }, - "additionalProperties": false, - "type": "object", - "title": "EntitySetupSave" - }, - "EntitySetupView": { - "properties": { - "namespace": { - "$ref": "#/components/schemas/EntitySetup", - "description": "the namespace's setup (the default when none is saved)" + "title": "Owner Email" }, - "saved": { + "editable": { "type": "boolean", - "title": "Saved", - "description": "whether the namespace has a setup of its own" + "title": "Editable", + "default": false }, - "collections": { - "items": { - "$ref": "#/components/schemas/EntitySetup" - }, - "type": "array", - "title": "Collections", - "description": "collections with a setup of their own" + "current": { + "type": "integer", + "title": "Current" }, - "types": { - "items": { - "$ref": "#/components/schemas/EntityTypeInfo" - }, - "type": "array", - "title": "Types", - "default": [] + "version": { + "type": "integer", + "title": "Version" }, - "can_change": { - "type": "boolean", - "title": "Can Change", - "description": "you may change the namespace's setup and types: its editors" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "namespace", - "saved", - "can_change" - ], - "title": "EntitySetupView" - }, - "EntityType": { - "properties": { - "type": { - "type": "string", - "title": "Type" + "spec": { + "additionalProperties": true, + "type": "object", + "title": "Spec", + "description": "the tool, skill, hook or plugin itself, as its manifest has it" }, - "label": { - "type": "string", - "title": "Label" + "origin": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Origin", + "description": "how this version was made: code, canvas, chat or import" }, - "quiet": { - "type": "boolean", - "title": "Quiet", - "description": "extracted but hidden unless a filter asks for it (dates, numbers)" + "source": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Source", + "description": "where it was imported from: a marketplace's plugin, a link or a file" }, - "description": { + "updated_at": { "anyOf": [ { "type": "string" @@ -43295,62 +44123,101 @@ "type": "null" } ], - "title": "Description" - }, - "builtin": { - "type": "boolean", - "title": "Builtin", - "description": "one of Lens's types; false: the namespace's own", - "default": true + "title": "Updated At" } }, "additionalProperties": true, "type": "object", "required": [ - "type", - "label", - "quiet" + "id", + "name", + "kind", + "enabled", + "current", + "version", + "spec" ], - "title": "EntityType" + "title": "Extension" }, - "EntityTypeCreate": { + "ExtensionCreate": { "properties": { - "label": { - "type": "string", - "maxLength": 40, - "minLength": 1, - "title": "Label" + "manifest": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Manifest", + "description": "{name, kind, description, ...settings}" }, - "description": { + "text": { "anyOf": [ { - "type": "string", - "maxLength": 2000 + "type": "string" }, { "type": "null" } ], - "title": "Description" + "title": "Text", + "description": "the manifest as code: YAML, JSON, or Markdown with frontmatter" + }, + "enabled": { + "type": "boolean", + "title": "Enabled", + "default": true + }, + "origin": { + "type": "string", + "enum": [ + "code", + "canvas", + "chat" + ], + "title": "Origin", + "default": "code" } }, "additionalProperties": false, "type": "object", - "required": [ - "label" - ], - "title": "EntityTypeCreate" + "title": "ExtensionCreate" }, - "EntityTypeInfo": { + "ExtensionDetail": { "properties": { - "type": { + "id": { + "type": "integer", + "title": "Id" + }, + "name": { "type": "string", - "title": "Type", - "description": "the code extractors and models use, e.g. ORG or CLIENT_TEAM" + "title": "Name", + "description": "what the assistant calls it: its tool or skill name" }, - "label": { + "kind": { "type": "string", - "title": "Label" + "enum": [ + "tool", + "skill", + "hook", + "plugin", + "mcp" + ], + "title": "Kind" + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Title" }, "description": { "anyOf": [ @@ -43363,216 +44230,260 @@ ], "title": "Description" }, - "quiet": { - "type": "boolean", - "title": "Quiet", - "description": "extracted but hidden unless a filter asks for it (dates, numbers)", - "default": false + "visibility": { + "type": "string", + "enum": [ + "private", + "namespace", + "everyone" + ], + "title": "Visibility", + "default": "private" }, - "builtin": { + "namespaces": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Namespaces", + "description": "who sees it, when shared with namespaces" + }, + "enabled": { "type": "boolean", - "title": "Builtin", - "description": "one of Lens's types; false: the namespace's own", - "default": true - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "type", - "label" - ], - "title": "EntityTypeInfo" - }, - "EntityTypeUpdate": { - "properties": { - "label": { + "title": "Enabled", + "description": "whether it's switched on in conversations" + }, + "owner_email": { "anyOf": [ { - "type": "string", - "maxLength": 40, - "minLength": 1 + "type": "string" }, { "type": "null" } ], - "title": "Label" + "title": "Owner Email" }, - "description": { + "editable": { + "type": "boolean", + "title": "Editable", + "default": false + }, + "current": { + "type": "integer", + "title": "Current" + }, + "version": { + "type": "integer", + "title": "Version" + }, + "spec": { + "additionalProperties": true, + "type": "object", + "title": "Spec", + "description": "the tool, skill, hook or plugin itself, as its manifest has it" + }, + "origin": { "anyOf": [ { - "type": "string", - "maxLength": 2000 + "type": "string" }, { "type": "null" } ], - "title": "Description", - "description": "empty clears it" - } - }, - "additionalProperties": false, - "type": "object", - "title": "EntityTypeUpdate" - }, - "EntityUpdate": { - "properties": { - "description": { + "title": "Origin", + "description": "how this version was made: code, canvas, chat or import" + }, + "source": { "anyOf": [ { - "type": "string" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "title": "Description", - "description": "what the entity is; empty clears it" + "title": "Source", + "description": "where it was imported from: a marketplace's plugin, a link or a file" }, - "aliases": { + "updated_at": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array", - "maxItems": 100 + "type": "string" }, { "type": "null" } ], - "title": "Aliases", - "description": "the other ways it's written (these replace the ones it has)" + "title": "Updated At" }, - "defined": { + "manifest": { + "type": "string", + "title": "Manifest", + "description": "the extension as a manifest to read, change and import again" + }, + "history": { + "items": { + "$ref": "#/components/schemas/ExtensionVersionInfo" + }, + "type": "array", + "title": "History", + "default": [] + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "id", + "name", + "kind", + "enabled", + "current", + "version", + "spec", + "manifest" + ], + "title": "ExtensionDetail" + }, + "ExtensionImportArchive": { + "properties": { + "filename": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { "type": "null" } ], - "title": "Defined", - "description": "on the fixed list of entities (namespaces in the fixed mode map names onto it)" + "title": "Filename" + }, + "data": { + "type": "string", + "maxLength": 28000000, + "title": "Data", + "description": "a .zip, .skill or .tar.gz with a plugin or a skill, as base64 (20 MB at most)" + }, + "preview": { + "type": "boolean", + "title": "Preview", + "default": false } }, "additionalProperties": false, "type": "object", - "title": "EntityUpdate" + "required": [ + "data" + ], + "title": "ExtensionImportArchive" }, - "Estimate": { + "ExtensionImportLink": { "properties": { - "recordings": { - "type": "integer", - "title": "Recordings" + "url": { + "type": "string", + "title": "Url", + "description": "a plugin or skill: a GitHub or GitLab repository or folder, or a .zip or .tar.gz link" }, - "by_kind": { - "additionalProperties": { - "type": "integer" - }, + "preview": { + "type": "boolean", + "title": "Preview", + "description": "say what it would install, without installing it", + "default": false + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "url" + ], + "title": "ExtensionImportLink" + }, + "ExtensionImportPreview": { + "properties": { + "manifest": { + "additionalProperties": true, "type": "object", - "title": "By Kind", - "default": {} + "title": "Manifest", + "description": "the plugin as Lens would install it" }, - "hours": { - "type": "number", - "title": "Hours" + "skipped": { + "items": { + "$ref": "#/components/schemas/ExtensionSkipped" + }, + "type": "array", + "title": "Skipped", + "default": [] }, - "seconds": { + "source": { + "type": "string", + "title": "Source" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "manifest", + "source" + ], + "title": "ExtensionImportPreview" + }, + "ExtensionImported": { + "properties": { + "id": { "type": "integer", - "title": "Seconds" - }, - "llm": { - "$ref": "#/components/schemas/LlmEstimate" + "title": "Id" }, - "would_replace": { + "version": { "type": "integer", - "title": "Would Replace", - "description": "existing outputs the run would overwrite" - }, - "needs_confirmation": { - "type": "boolean", - "title": "Needs Confirmation" + "title": "Version" }, - "confirm_text": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Confirm Text" + "skipped": { + "items": { + "$ref": "#/components/schemas/ExtensionSkipped" + }, + "type": "array", + "title": "Skipped", + "default": [] } }, "additionalProperties": true, "type": "object", "required": [ - "recordings", - "hours", - "seconds", - "llm", - "would_replace", - "needs_confirmation" + "id", + "version" ], - "title": "Estimate" + "title": "ExtensionImported" }, - "EventInfo": { + "ExtensionSkipped": { "properties": { - "type": { + "kind": { "type": "string", - "enum": [ - "job.succeeded", - "job.failed", - "job.cancelled", - "batch.finished", - "recording.added", - "lens.release", - "approval.waiting" - ], - "title": "Type" + "title": "Kind", + "description": "what was left out: hooks, mcp, skill, command, agent or file" }, - "label": { + "name": { "type": "string", - "title": "Label" + "title": "Name" + }, + "why": { + "type": "string", + "title": "Why" } }, "additionalProperties": true, "type": "object", "required": [ - "type", - "label" + "kind", + "name", + "why" ], - "title": "EventInfo" + "title": "ExtensionSkipped" }, - "Extension": { + "ExtensionTest": { "properties": { - "id": { - "type": "integer", - "title": "Id" - }, - "name": { - "type": "string", - "title": "Name", - "description": "what the assistant calls it: its tool or skill name" - }, - "kind": { - "type": "string", - "enum": [ - "tool", - "skill", - "hook", - "plugin", - "mcp" - ], - "title": "Kind" - }, - "title": { + "tool": { "anyOf": [ { "type": "string" @@ -43581,9 +44492,39 @@ "type": "null" } ], - "title": "Title" + "title": "Tool", + "description": "which of a plugin's tools (a tool extension: itself)" }, - "description": { + "args": { + "additionalProperties": true, + "type": "object", + "title": "Args", + "default": {} + }, + "confirm": { + "type": "boolean", + "title": "Confirm", + "description": "needed to try a tool that changes something: it really runs", + "default": false + } + }, + "additionalProperties": false, + "type": "object", + "title": "ExtensionTest" + }, + "ExtensionTestResult": { + "properties": { + "output": { + "title": "Output" + } + }, + "additionalProperties": true, + "type": "object", + "title": "ExtensionTestResult" + }, + "ExtensionUpdate": { + "properties": { + "title": { "anyOf": [ { "type": "string" @@ -43592,32 +44533,9 @@ "type": "null" } ], - "title": "Description" - }, - "visibility": { - "type": "string", - "enum": [ - "private", - "namespace", - "everyone" - ], - "title": "Visibility", - "default": "private" - }, - "namespaces": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Namespaces", - "description": "who sees it, when shared with namespaces" - }, - "enabled": { - "type": "boolean", - "title": "Enabled", - "description": "whether it's switched on in conversations" + "title": "Title" }, - "owner_email": { + "description": { "anyOf": [ { "type": "string" @@ -43626,78 +44544,55 @@ "type": "null" } ], - "title": "Owner Email" - }, - "editable": { - "type": "boolean", - "title": "Editable", - "default": false - }, - "current": { - "type": "integer", - "title": "Current" - }, - "version": { - "type": "integer", - "title": "Version" - }, - "spec": { - "additionalProperties": true, - "type": "object", - "title": "Spec", - "description": "the tool, skill, hook or plugin itself, as its manifest has it" + "title": "Description" }, - "origin": { + "enabled": { "anyOf": [ { - "type": "string" + "type": "boolean" }, { "type": "null" } ], - "title": "Origin", - "description": "how this version was made: code, canvas, chat or import" + "title": "Enabled" }, - "source": { + "visibility": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "string", + "enum": [ + "private", + "namespace", + "everyone" + ] }, { "type": "null" } ], - "title": "Source", - "description": "where it was imported from: a marketplace's plugin, a link or a file" + "title": "Visibility" }, - "updated_at": { + "namespaces": { "anyOf": [ { - "type": "string" + "items": { + "type": "string" + }, + "type": "array" }, { "type": "null" } ], - "title": "Updated At" + "title": "Namespaces" } }, - "additionalProperties": true, + "additionalProperties": false, "type": "object", - "required": [ - "id", - "name", - "kind", - "enabled", - "current", - "version", - "spec" - ], - "title": "Extension" + "title": "ExtensionUpdate" }, - "ExtensionCreate": { + "ExtensionVersionCreate": { "properties": { "manifest": { "anyOf": [ @@ -43709,8 +44604,7 @@ "type": "null" } ], - "title": "Manifest", - "description": "{name, kind, description, ...settings}" + "title": "Manifest" }, "text": { "anyOf": [ @@ -43721,63 +44615,9 @@ "type": "null" } ], - "title": "Text", - "description": "the manifest as code: YAML, JSON, or Markdown with frontmatter" - }, - "enabled": { - "type": "boolean", - "title": "Enabled", - "default": true - }, - "origin": { - "type": "string", - "enum": [ - "code", - "canvas", - "chat" - ], - "title": "Origin", - "default": "code" - } - }, - "additionalProperties": false, - "type": "object", - "title": "ExtensionCreate" - }, - "ExtensionDetail": { - "properties": { - "id": { - "type": "integer", - "title": "Id" - }, - "name": { - "type": "string", - "title": "Name", - "description": "what the assistant calls it: its tool or skill name" - }, - "kind": { - "type": "string", - "enum": [ - "tool", - "skill", - "hook", - "plugin", - "mcp" - ], - "title": "Kind" - }, - "title": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Title" + "title": "Text" }, - "description": { + "notes": { "anyOf": [ { "type": "string" @@ -43786,32 +44626,30 @@ "type": "null" } ], - "title": "Description" + "title": "Notes" }, - "visibility": { + "origin": { "type": "string", "enum": [ - "private", - "namespace", - "everyone" + "code", + "canvas", + "chat" ], - "title": "Visibility", - "default": "private" - }, - "namespaces": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Namespaces", - "description": "who sees it, when shared with namespaces" - }, - "enabled": { - "type": "boolean", - "title": "Enabled", - "description": "whether it's switched on in conversations" + "title": "Origin", + "default": "code" + } + }, + "additionalProperties": false, + "type": "object", + "title": "ExtensionVersionCreate" + }, + "ExtensionVersionInfo": { + "properties": { + "version": { + "type": "integer", + "title": "Version" }, - "owner_email": { + "notes": { "anyOf": [ { "type": "string" @@ -43820,26 +44658,7 @@ "type": "null" } ], - "title": "Owner Email" - }, - "editable": { - "type": "boolean", - "title": "Editable", - "default": false - }, - "current": { - "type": "integer", - "title": "Current" - }, - "version": { - "type": "integer", - "title": "Version" - }, - "spec": { - "additionalProperties": true, - "type": "object", - "title": "Spec", - "description": "the tool, skill, hook or plugin itself, as its manifest has it" + "title": "Notes" }, "origin": { "anyOf": [ @@ -43850,23 +44669,20 @@ "type": "null" } ], - "title": "Origin", - "description": "how this version was made: code, canvas, chat or import" + "title": "Origin" }, - "source": { + "created_at": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "string" }, { "type": "null" } ], - "title": "Source", - "description": "where it was imported from: a marketplace's plugin, a link or a file" + "title": "Created At" }, - "updated_at": { + "created_by": { "anyOf": [ { "type": "string" @@ -43875,39 +44691,41 @@ "type": "null" } ], - "title": "Updated At" - }, - "manifest": { - "type": "string", - "title": "Manifest", - "description": "the extension as a manifest to read, change and import again" - }, - "history": { - "items": { - "$ref": "#/components/schemas/ExtensionVersionInfo" - }, - "type": "array", - "title": "History", - "default": [] + "title": "Created By" } }, "additionalProperties": true, "type": "object", "required": [ - "id", - "name", - "kind", - "enabled", - "current", - "version", - "spec", - "manifest" + "version" ], - "title": "ExtensionDetail" + "title": "ExtensionVersionInfo" }, - "ExtensionImportArchive": { + "ExternalIdentity": { "properties": { - "filename": { + "id": { + "type": "string", + "title": "Id" + }, + "provider": { + "type": "string", + "title": "Provider" + }, + "label": { + "type": "string", + "title": "Label" + }, + "kind": { + "type": "string", + "enum": [ + "google", + "github", + "microsoft", + "oidc" + ], + "title": "Kind" + }, + "email": { "anyOf": [ { "type": "string" @@ -43916,331 +44734,383 @@ "type": "null" } ], - "title": "Filename" + "title": "Email" }, - "data": { + "created_at": { "type": "string", - "maxLength": 28000000, - "title": "Data", - "description": "a .zip, .skill or .tar.gz with a plugin or a skill, as base64 (20 MB at most)" + "title": "Created At" }, - "preview": { - "type": "boolean", - "title": "Preview", - "default": false + "last_used_at": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Last Used At" } }, - "additionalProperties": false, + "additionalProperties": true, "type": "object", "required": [ - "data" + "id", + "provider", + "label", + "kind", + "created_at" ], - "title": "ExtensionImportArchive" + "title": "ExternalIdentity" }, - "ExtensionImportLink": { + "ExternalProvider": { "properties": { - "url": { + "key": { "type": "string", - "title": "Url", - "description": "a plugin or skill: a GitHub or GitLab repository or folder, or a .zip or .tar.gz link" - }, - "preview": { - "type": "boolean", - "title": "Preview", - "description": "say what it would install, without installing it", - "default": false - } - }, - "additionalProperties": false, - "type": "object", - "required": [ - "url" - ], - "title": "ExtensionImportLink" - }, - "ExtensionImportPreview": { - "properties": { - "manifest": { - "additionalProperties": true, - "type": "object", - "title": "Manifest", - "description": "the plugin as Lens would install it" + "title": "Key" }, - "skipped": { - "items": { - "$ref": "#/components/schemas/ExtensionSkipped" - }, - "type": "array", - "title": "Skipped", - "default": [] + "kind": { + "type": "string", + "enum": [ + "google", + "github", + "microsoft", + "oidc" + ], + "title": "Kind" }, - "source": { + "label": { "type": "string", - "title": "Source" + "title": "Label" } }, "additionalProperties": true, "type": "object", "required": [ - "manifest", - "source" + "key", + "kind", + "label" ], - "title": "ExtensionImportPreview" + "title": "ExternalProvider" }, - "ExtensionImported": { + "ExternalProviderAdmin": { "properties": { - "id": { - "type": "integer", - "title": "Id" + "key": { + "type": "string", + "title": "Key" + }, + "kind": { + "type": "string", + "enum": [ + "google", + "github", + "microsoft", + "oidc" + ], + "title": "Kind" + }, + "label": { + "type": "string", + "title": "Label" + }, + "client_id": { + "type": "string", + "title": "Client Id" + }, + "secret_set": { + "type": "boolean", + "title": "Secret Set", + "description": "a client secret is kept (never shown)" + }, + "issuer": { + "type": "string", + "title": "Issuer", + "description": "OpenID Connect: the provider's address", + "default": "" + }, + "tenant": { + "type": "string", + "title": "Tenant", + "description": "Microsoft: the directory (tenant) id, or common", + "default": "" }, - "version": { - "type": "integer", - "title": "Version" + "signup": { + "type": "boolean", + "title": "Signup", + "description": "people without a Lens account get one when they sign in" }, - "skipped": { + "domains": { "items": { - "$ref": "#/components/schemas/ExtensionSkipped" + "type": "string" }, "type": "array", - "title": "Skipped", - "default": [] - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "id", - "version" - ], - "title": "ExtensionImported" - }, - "ExtensionSkipped": { - "properties": { - "kind": { - "type": "string", - "title": "Kind", - "description": "what was left out: hooks, mcp, skill, command, agent or file" + "title": "Domains", + "description": "sign-up only for these email domains; empty means any" }, - "name": { - "type": "string", - "title": "Name" + "enabled": { + "type": "boolean", + "title": "Enabled" }, - "why": { + "people": { + "type": "integer", + "title": "People", + "description": "Lens accounts connected through it" + }, + "callback_path": { "type": "string", - "title": "Why" + "title": "Callback Path", + "description": "add this path on the web app's address as the redirect URI at the provider" } }, "additionalProperties": true, "type": "object", "required": [ + "key", "kind", - "name", - "why" + "label", + "client_id", + "secret_set", + "signup", + "domains", + "enabled", + "people", + "callback_path" ], - "title": "ExtensionSkipped" + "title": "ExternalProviderAdmin" }, - "ExtensionTest": { + "ExternalProviderSave": { "properties": { - "tool": { + "kind": { "anyOf": [ { - "type": "string" + "type": "string", + "enum": [ + "google", + "github", + "microsoft", + "oidc" + ] }, { "type": "null" } ], - "title": "Tool", - "description": "which of a plugin's tools (a tool extension: itself)" + "title": "Kind", + "description": "when adding one" }, - "args": { - "additionalProperties": true, - "type": "object", - "title": "Args", - "default": {} + "label": { + "anyOf": [ + { + "type": "string", + "maxLength": 60 + }, + { + "type": "null" + } + ], + "title": "Label" }, - "confirm": { - "type": "boolean", - "title": "Confirm", - "description": "needed to try a tool that changes something: it really runs", - "default": false - } - }, - "additionalProperties": false, - "type": "object", - "title": "ExtensionTest" - }, - "ExtensionTestResult": { - "properties": { - "output": { - "title": "Output" - } - }, - "additionalProperties": true, - "type": "object", - "title": "ExtensionTestResult" - }, - "ExtensionUpdate": { - "properties": { - "title": { + "client_id": { "anyOf": [ { - "type": "string" + "type": "string", + "maxLength": 500 }, { "type": "null" } ], - "title": "Title" + "title": "Client Id" }, - "description": { + "client_secret": { "anyOf": [ { - "type": "string" + "type": "string", + "maxLength": 2000 }, { "type": "null" } ], - "title": "Description" + "title": "Client Secret", + "description": "leave out to keep the one kept" }, - "enabled": { + "issuer": { "anyOf": [ { - "type": "boolean" + "type": "string", + "maxLength": 500 }, { "type": "null" } ], - "title": "Enabled" + "title": "Issuer" }, - "visibility": { + "tenant": { "anyOf": [ { "type": "string", - "enum": [ - "private", - "namespace", - "everyone" - ] + "maxLength": 100 }, { "type": "null" } ], - "title": "Visibility" + "title": "Tenant" }, - "namespaces": { + "signup": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Signup" + }, + "domains": { "anyOf": [ { "items": { "type": "string" }, - "type": "array" + "type": "array", + "maxItems": 50 }, { "type": "null" } ], - "title": "Namespaces" + "title": "Domains" + }, + "enabled": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Enabled" + } + }, + "additionalProperties": false, + "type": "object", + "title": "ExternalProviderSave" + }, + "ExternalRedirect": { + "properties": { + "url": { + "type": "string", + "title": "Url", + "description": "the provider's sign-in page; open it in this browser" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "url" + ], + "title": "ExternalRedirect" + }, + "ExternalStart": { + "properties": { + "next": { + "type": "string", + "maxLength": 500, + "title": "Next", + "description": "the page to open after signing in", + "default": "/" + } + }, + "additionalProperties": false, + "type": "object", + "title": "ExternalStart" + }, + "FaceDismiss": { + "properties": { + "kind": { + "type": "string", + "title": "Kind", + "default": "face" + }, + "id": { + "type": "integer", + "title": "Id", + "default": 0 + } + }, + "additionalProperties": false, + "type": "object", + "title": "FaceDismiss" + }, + "FaceMerge": { + "properties": { + "into": { + "type": "integer", + "title": "Into", + "default": 0 + } + }, + "additionalProperties": false, + "type": "object", + "title": "FaceMerge" + }, + "FaceMerged": { + "properties": { + "ok": { + "type": "boolean", + "title": "Ok", + "default": true + }, + "merge": { + "type": "integer", + "title": "Merge" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "merge" + ], + "title": "FaceMerged" + }, + "FaceRename": { + "properties": { + "name": { + "type": "string", + "title": "Name", + "default": "" } }, "additionalProperties": false, "type": "object", - "title": "ExtensionUpdate" + "title": "FaceRename" }, - "ExtensionVersionCreate": { + "FaceSpeaker": { "properties": { - "manifest": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Manifest" - }, - "text": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Text" - }, - "notes": { + "speaker": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Notes" - }, - "origin": { - "type": "string", - "enum": [ - "code", - "canvas", - "chat" - ], - "title": "Origin", - "default": "code" + "title": "Speaker" } }, "additionalProperties": false, "type": "object", - "title": "ExtensionVersionCreate" + "title": "FaceSpeaker" }, - "ExtensionVersionInfo": { + "FacesMode": { "properties": { - "version": { - "type": "integer", - "title": "Version" - }, - "notes": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Notes" - }, - "origin": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Origin" - }, - "created_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Created At" - }, - "created_by": { + "mode": { "anyOf": [ { "type": "string" @@ -44249,56 +45119,22 @@ "type": "null" } ], - "title": "Created By" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "version" - ], - "title": "ExtensionVersionInfo" - }, - "ExternalIdentity": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "provider": { - "type": "string", - "title": "Provider" - }, - "label": { - "type": "string", - "title": "Label" - }, - "kind": { - "type": "string", - "enum": [ - "google", - "github", - "microsoft", - "oidc" - ], - "title": "Kind" + "title": "Mode", + "description": "off, detect or recognize; left out, the mode stays as it is" }, - "email": { + "pixelate": { "anyOf": [ { - "type": "string" + "type": "boolean" }, { "type": "null" } ], - "title": "Email" - }, - "created_at": { - "type": "string", - "title": "Created At" + "title": "Pixelate", + "description": "pixelate the faces found in the pictures visitors see (public pages, embeds, share links, IIIF); members see them as they are. Needs faces detected" }, - "last_used_at": { + "purpose": { "anyOf": [ { "type": "string" @@ -44307,350 +45143,344 @@ "type": "null" } ], - "title": "Last Used At" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "id", - "provider", - "label", - "kind", - "created_at" - ], - "title": "ExternalIdentity" - }, - "ExternalProvider": { - "properties": { - "key": { - "type": "string", - "title": "Key" - }, - "kind": { - "type": "string", - "enum": [ - "google", - "github", - "microsoft", - "oidc" - ], - "title": "Kind" + "title": "Purpose", + "description": "why faces are recognised (required for recognize)" }, - "label": { - "type": "string", - "title": "Label" + "reprocess": { + "type": "boolean", + "title": "Reprocess", + "description": "queue face detection for this namespace's videos, documents and images", + "default": false } }, - "additionalProperties": true, + "additionalProperties": false, "type": "object", - "required": [ - "key", - "kind", - "label" - ], - "title": "ExternalProvider" + "title": "FacesMode" }, - "ExternalProviderAdmin": { + "FacesModeSet": { "properties": { - "key": { - "type": "string", - "title": "Key" - }, - "kind": { - "type": "string", - "enum": [ - "google", - "github", - "microsoft", - "oidc" - ], - "title": "Kind" - }, - "label": { - "type": "string", - "title": "Label" - }, - "client_id": { - "type": "string", - "title": "Client Id" - }, - "secret_set": { - "type": "boolean", - "title": "Secret Set", - "description": "a client secret is kept (never shown)" - }, - "issuer": { - "type": "string", - "title": "Issuer", - "description": "OpenID Connect: the provider's address", - "default": "" - }, - "tenant": { - "type": "string", - "title": "Tenant", - "description": "Microsoft: the directory (tenant) id, or common", - "default": "" - }, - "signup": { - "type": "boolean", - "title": "Signup", - "description": "people without a Lens account get one when they sign in" - }, - "domains": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Domains", - "description": "sign-up only for these email domains; empty means any" - }, - "enabled": { + "ok": { "type": "boolean", - "title": "Enabled" - }, - "people": { - "type": "integer", - "title": "People", - "description": "Lens accounts connected through it" + "title": "Ok", + "default": true }, - "callback_path": { + "jobs": { + "items": { + "type": "integer" + }, + "type": "array", + "title": "Jobs", + "default": [] + } + }, + "additionalProperties": true, + "type": "object", + "title": "FacesModeSet" + }, + "FacetCount": { + "properties": { + "name": { "type": "string", - "title": "Callback Path", - "description": "add this path on the web app's address as the redirect URI at the provider" + "title": "Name" + }, + "count": { + "type": "integer", + "title": "Count", + "description": "matching moments" } }, "additionalProperties": true, "type": "object", "required": [ - "key", - "kind", - "label", - "client_id", - "secret_set", - "signup", - "domains", - "enabled", - "people", - "callback_path" + "name", + "count" ], - "title": "ExternalProviderAdmin" + "title": "FacetCount" }, - "ExternalProviderSave": { + "FedoraStatus": { "properties": { - "kind": { + "enabled": { + "type": "boolean", + "title": "Enabled" + }, + "url": { "anyOf": [ { - "type": "string", - "enum": [ - "google", - "github", - "microsoft", - "oidc" - ] + "type": "string" }, { "type": "null" } ], - "title": "Kind", - "description": "when adding one" + "title": "Url" }, - "label": { + "root": { + "type": "string", + "title": "Root" + }, + "pending": { + "type": "integer", + "title": "Pending" + }, + "resources": { + "type": "integer", + "title": "Resources" + }, + "last_sync": { "anyOf": [ { - "type": "string", - "maxLength": 60 + "type": "string" }, { "type": "null" } ], - "title": "Label" + "title": "Last Sync" }, - "client_id": { + "last_full": { "anyOf": [ { - "type": "string", - "maxLength": 500 + "type": "string" }, { "type": "null" } ], - "title": "Client Id" + "title": "Last Full" }, - "client_secret": { + "last_counts": { "anyOf": [ { - "type": "string", - "maxLength": 2000 + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "title": "Client Secret", - "description": "leave out to keep the one kept" + "title": "Last Counts" }, - "issuer": { + "last_error": { "anyOf": [ { - "type": "string", - "maxLength": 500 + "type": "string" }, { "type": "null" } ], - "title": "Issuer" + "title": "Last Error" }, - "tenant": { + "full_requested": { + "type": "boolean", + "title": "Full Requested" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "enabled", + "root", + "pending", + "resources", + "full_requested" + ], + "title": "FedoraStatus" + }, + "FedoraSyncResult": { + "properties": { + "sent": { + "type": "integer", + "title": "Sent" + }, + "files": { + "type": "integer", + "title": "Files" + }, + "unchanged": { + "type": "integer", + "title": "Unchanged" + }, + "deleted": { + "type": "integer", + "title": "Deleted" + }, + "failed": { + "type": "integer", + "title": "Failed" + }, + "errors": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Errors" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "sent", + "files", + "unchanged", + "deleted", + "failed", + "errors" + ], + "title": "FedoraSyncResult" + }, + "FieldCreate": { + "properties": { + "label": { + "type": "string", + "maxLength": 80, + "minLength": 1, + "title": "Label" + }, + "type": { + "type": "string", + "enum": [ + "text", + "longtext", + "number", + "date", + "boolean", + "choice", + "choices", + "link" + ], + "title": "Type" + }, + "target": { + "type": "string", + "enum": [ + "resource", + "collection", + "file" + ], + "title": "Target", + "default": "resource" + }, + "collection": { "anyOf": [ { - "type": "string", - "maxLength": 100 + "type": "integer" }, { "type": "null" } ], - "title": "Tenant" + "title": "Collection", + "description": "define it on this collection of the namespace (default: the namespace)" }, - "signup": { + "options": { "anyOf": [ { - "type": "boolean" + "items": { + "type": "string" + }, + "type": "array", + "maxItems": 200 }, { "type": "null" } ], - "title": "Signup" + "title": "Options", + "description": "choice and choices fields" + }, + "help": { + "anyOf": [ + { + "type": "string", + "maxLength": 300 + }, + { + "type": "null" + } + ], + "title": "Help" + }, + "published": { + "type": "boolean", + "title": "Published", + "default": false + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "label", + "type" + ], + "title": "FieldCreate" + }, + "FieldDef": { + "properties": { + "id": { + "type": "integer", + "title": "Id" + }, + "label": { + "type": "string", + "title": "Label" + }, + "type": { + "type": "string", + "enum": [ + "text", + "longtext", + "number", + "date", + "boolean", + "choice", + "choices", + "link" + ], + "title": "Type" }, - "domains": { + "target": { + "type": "string", + "enum": [ + "resource", + "collection", + "file" + ], + "title": "Target", + "description": "what it describes: the resources, the collections or the files inside where it's defined" + }, + "options": { "anyOf": [ { "items": { "type": "string" }, - "type": "array", - "maxItems": 50 + "type": "array" }, { "type": "null" } ], - "title": "Domains" + "title": "Options", + "description": "choice and choices fields: what may be chosen" }, - "enabled": { + "help": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { "type": "null" } ], - "title": "Enabled" - } - }, - "additionalProperties": false, - "type": "object", - "title": "ExternalProviderSave" - }, - "ExternalRedirect": { - "properties": { - "url": { - "type": "string", - "title": "Url", - "description": "the provider's sign-in page; open it in this browser" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "url" - ], - "title": "ExternalRedirect" - }, - "ExternalStart": { - "properties": { - "next": { - "type": "string", - "maxLength": 500, - "title": "Next", - "description": "the page to open after signing in", - "default": "/" - } - }, - "additionalProperties": false, - "type": "object", - "title": "ExternalStart" - }, - "FaceDismiss": { - "properties": { - "kind": { - "type": "string", - "title": "Kind", - "default": "face" + "title": "Help" }, - "id": { - "type": "integer", - "title": "Id", - "default": 0 - } - }, - "additionalProperties": false, - "type": "object", - "title": "FaceDismiss" - }, - "FaceMerge": { - "properties": { - "into": { - "type": "integer", - "title": "Into", - "default": 0 - } - }, - "additionalProperties": false, - "type": "object", - "title": "FaceMerge" - }, - "FaceMerged": { - "properties": { - "ok": { + "published": { "type": "boolean", - "title": "Ok", - "default": true + "title": "Published", + "description": "shown on public pages and in IIIF metadata; otherwise only in the workspace" }, - "merge": { - "type": "integer", - "title": "Merge" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "merge" - ], - "title": "FaceMerged" - }, - "FaceRename": { - "properties": { - "name": { - "type": "string", - "title": "Name", - "default": "" - } - }, - "additionalProperties": false, - "type": "object", - "title": "FaceRename" - }, - "FaceSpeaker": { - "properties": { - "speaker": { + "collection": { "anyOf": [ { "type": "integer" @@ -44659,370 +45489,335 @@ "type": "null" } ], - "title": "Speaker" - } - }, - "additionalProperties": false, - "type": "object", - "title": "FaceSpeaker" - }, - "FacesMode": { - "properties": { - "mode": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Mode", - "description": "off, detect or recognize; left out, the mode stays as it is" + "title": "Collection", + "description": "the collection it's defined on; null: the namespace" }, - "pixelate": { + "collection_path": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Collection Path", + "description": "that collection's names, from the top" + }, + "ord": { "anyOf": [ { - "type": "boolean" + "type": "integer" }, { "type": "null" } ], - "title": "Pixelate", - "description": "pixelate the faces found in the pictures visitors see (public pages, embeds, share links, IIIF); members see them as they are. Needs faces detected" + "title": "Ord" }, - "purpose": { + "can_change": { + "type": "boolean", + "title": "Can Change", + "description": "you may change or delete it: editors of where it's defined" + }, + "uses": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Purpose", - "description": "why faces are recognised (required for recognize)" - }, - "reprocess": { - "type": "boolean", - "title": "Reprocess", - "description": "queue face detection for this namespace's videos, documents and images", - "default": false - } - }, - "additionalProperties": false, - "type": "object", - "title": "FacesMode" - }, - "FacesModeSet": { - "properties": { - "ok": { - "type": "boolean", - "title": "Ok", - "default": true - }, - "jobs": { - "items": { - "type": "integer" - }, - "type": "array", - "title": "Jobs", - "default": [] - } - }, - "additionalProperties": true, - "type": "object", - "title": "FacesModeSet" - }, - "FacetCount": { - "properties": { - "name": { - "type": "string", - "title": "Name" - }, - "count": { - "type": "integer", - "title": "Count", - "description": "matching moments" + "title": "Uses", + "description": "how many items have a value for it (when asked for one field)" } }, "additionalProperties": true, "type": "object", "required": [ - "name", - "count" + "id", + "label", + "type", + "target", + "published", + "can_change" ], - "title": "FacetCount" + "title": "FieldDef" }, - "FedoraStatus": { + "FieldUpdate": { "properties": { - "enabled": { - "type": "boolean", - "title": "Enabled" - }, - "url": { + "label": { "anyOf": [ { - "type": "string" + "type": "string", + "maxLength": 80, + "minLength": 1 }, { "type": "null" } ], - "title": "Url" - }, - "root": { - "type": "string", - "title": "Root" - }, - "pending": { - "type": "integer", - "title": "Pending" - }, - "resources": { - "type": "integer", - "title": "Resources" + "title": "Label" }, - "last_sync": { + "options": { "anyOf": [ { - "type": "string" + "items": { + "type": "string" + }, + "type": "array", + "maxItems": 200 }, { "type": "null" } ], - "title": "Last Sync" + "title": "Options" }, - "last_full": { + "help": { "anyOf": [ { - "type": "string" + "type": "string", + "maxLength": 300 }, { "type": "null" } ], - "title": "Last Full" + "title": "Help", + "description": "null clears it" }, - "last_counts": { + "published": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "boolean" }, { "type": "null" } ], - "title": "Last Counts" + "title": "Published" }, - "last_error": { + "ord": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Last Error" + "title": "Ord", + "description": "its place among the namespace's fields, lowest first" + } + }, + "additionalProperties": false, + "type": "object", + "title": "FieldUpdate" + }, + "FieldValue": { + "properties": { + "field": { + "$ref": "#/components/schemas/FieldDef" }, - "full_requested": { - "type": "boolean", - "title": "Full Requested" + "value": { + "title": "Value", + "description": "text, a number, a date (YYYY, YYYY-MM or YYYY-MM-DD), yes/no, an option or options, a link" } }, "additionalProperties": true, "type": "object", "required": [ - "enabled", - "root", - "pending", - "resources", - "full_requested" + "field" ], - "title": "FedoraStatus" + "title": "FieldValue" }, - "FedoraSyncResult": { + "FieldValues": { "properties": { - "sent": { - "type": "integer", - "title": "Sent" - }, - "files": { - "type": "integer", - "title": "Files" - }, - "unchanged": { - "type": "integer", - "title": "Unchanged" - }, - "deleted": { - "type": "integer", - "title": "Deleted" - }, - "failed": { - "type": "integer", - "title": "Failed" - }, - "errors": { + "fields": { "items": { - "type": "string" + "$ref": "#/components/schemas/FieldValue" }, "type": "array", - "title": "Errors" + "title": "Fields", + "description": "the fields that describe it, in order, with its values (null: none)" + }, + "can_change": { + "type": "boolean", + "title": "Can Change", + "description": "you may change its values" } }, "additionalProperties": true, "type": "object", "required": [ - "sent", - "files", - "unchanged", - "deleted", - "failed", - "errors" + "fields", + "can_change" ], - "title": "FedoraSyncResult" + "title": "FieldValues" }, - "FieldCreate": { + "FieldValuesUpdate": { "properties": { - "label": { - "type": "string", - "maxLength": 80, - "minLength": 1, - "title": "Label" + "values": { + "additionalProperties": true, + "type": "object", + "title": "Values", + "description": "{\"\": its value, or null to clear it}; fields not named keep theirs" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "values" + ], + "title": "FieldValuesUpdate" + }, + "FileLine": { + "properties": { + "idx": { + "type": "integer", + "title": "Idx" }, - "type": { - "type": "string", - "enum": [ - "text", - "longtext", - "number", - "date", - "boolean", - "choice", - "choices", - "link" + "t0": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } ], - "title": "Type" + "title": "T0", + "description": "ms; none in a file that doesn't say when its lines are" }, - "target": { - "type": "string", - "enum": [ - "resource", - "collection", - "file" + "t1": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } ], - "title": "Target", - "default": "resource" + "title": "T1" }, - "collection": { + "text": { + "type": "string", + "title": "Text", + "description": "the line; for an index, its title, synopsis and keywords together" + }, + "speaker": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Collection", - "description": "define it on this collection of the namespace (default: the namespace)" + "title": "Speaker", + "description": "who says or writes it, as the file names them" }, - "options": { + "title": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array", - "maxItems": 200 + "type": "string" }, { "type": "null" } ], - "title": "Options", - "description": "choice and choices fields" + "title": "Title", + "description": "an index entry's title" }, - "help": { + "synopsis": { "anyOf": [ { - "type": "string", - "maxLength": 300 + "type": "string" }, { "type": "null" } ], - "title": "Help" + "title": "Synopsis", + "description": "an index entry's synopsis" }, - "published": { - "type": "boolean", - "title": "Published", - "default": false + "keywords": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Keywords", + "description": "an index entry's keywords" } }, - "additionalProperties": false, + "additionalProperties": true, "type": "object", "required": [ - "label", - "type" + "idx", + "text" ], - "title": "FieldCreate" + "title": "FileLine" }, - "FieldDef": { + "FileLines": { "properties": { - "id": { + "total": { "type": "integer", - "title": "Id" - }, - "label": { - "type": "string", - "title": "Label" + "title": "Total" }, - "type": { - "type": "string", - "enum": [ - "text", - "longtext", - "number", - "date", - "boolean", - "choice", - "choices", - "link" - ], - "title": "Type" + "lines": { + "items": { + "$ref": "#/components/schemas/FileLine" + }, + "type": "array", + "title": "Lines" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "total", + "lines" + ], + "title": "FileLines" + }, + "FileStoreTestResult": { + "properties": { + "ok": { + "type": "boolean", + "title": "Ok" }, - "target": { - "type": "string", - "enum": [ - "resource", - "collection", - "file" + "store": { + "anyOf": [ + { + "type": "string", + "enum": [ + "local", + "connection" + ] + }, + { + "type": "null" + } ], - "title": "Target", - "description": "what it describes: the resources, the collections or the files inside where it's defined" + "title": "Store" }, - "options": { + "seconds": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array" + "type": "number" }, { "type": "null" } ], - "title": "Options", - "description": "choice and choices fields: what may be chosen" + "title": "Seconds" }, - "help": { + "error": { "anyOf": [ { "type": "string" @@ -45031,50 +45826,46 @@ "type": "null" } ], - "title": "Help" - }, - "published": { - "type": "boolean", - "title": "Published", - "description": "shown on public pages and in IIIF metadata; otherwise only in the workspace" + "title": "Error" }, - "collection": { + "limited": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Collection", - "description": "the collection it's defined on; null: the namespace" - }, - "collection_path": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Collection Path", - "description": "that collection's names, from the top" - }, - "ord": { + "title": "Limited", + "description": "the connection is rate limiting: reads work, new files are kept here" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "ok" + ], + "title": "FileStoreTestResult" + }, + "FileStoreTry": { + "properties": { + "store": { "anyOf": [ { - "type": "integer" + "type": "string", + "enum": [ + "local", + "connection" + ] }, { "type": "null" } ], - "title": "Ord" - }, - "can_change": { - "type": "boolean", - "title": "Can Change", - "description": "you may change or delete it: editors of where it's defined" + "title": "Store" }, - "uses": { + "connection": { "anyOf": [ { "type": "integer" @@ -45083,169 +45874,129 @@ "type": "null" } ], - "title": "Uses", - "description": "how many items have a value for it (when asked for one field)" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "id", - "label", - "type", - "target", - "published", - "can_change" - ], - "title": "FieldDef" - }, - "FieldUpdate": { - "properties": { - "label": { + "title": "Connection", + "description": "a storage connection's id" + }, + "folder": { "anyOf": [ { "type": "string", - "maxLength": 80, - "minLength": 1 + "maxLength": 200 }, { "type": "null" } ], - "title": "Label" + "title": "Folder", + "description": "the folder on it (for S3, the bucket and a path)" }, - "options": { + "crypt": { + "type": "boolean", + "title": "Crypt", + "description": "wrap it in rclone crypt too", + "default": false + } + }, + "additionalProperties": false, + "type": "object", + "title": "FileStoreTry", + "description": "Where to try keeping files, before saving it (Settings \u2192 Storage); nothing given tries what is saved." + }, + "FileUpdate": { + "properties": { + "role": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array", - "maxItems": 200 + "type": "string", + "enum": [ + "transcript", + "captions", + "translation", + "index", + "thumbnail", + "attachment" + ] }, { "type": "null" } ], - "title": "Options" + "title": "Role", + "description": "a new role; transcripts, captions, translations and indexes are read again" }, - "help": { + "language": { "anyOf": [ { "type": "string", - "maxLength": 300 + "maxLength": 40 }, { "type": "null" } ], - "title": "Help", + "title": "Language", "description": "null clears it" }, - "published": { + "label": { "anyOf": [ { - "type": "boolean" + "type": "string", + "maxLength": 200 }, { "type": "null" } ], - "title": "Published" + "title": "Label", + "description": "null clears it" }, - "ord": { + "description": { "anyOf": [ { - "type": "integer" + "type": "string", + "maxLength": 2000 }, { "type": "null" } ], - "title": "Ord", - "description": "its place among the namespace's fields, lowest first" - } - }, - "additionalProperties": false, - "type": "object", - "title": "FieldUpdate" - }, - "FieldValue": { - "properties": { - "field": { - "$ref": "#/components/schemas/FieldDef" - }, - "value": { - "title": "Value", - "description": "text, a number, a date (YYYY, YYYY-MM or YYYY-MM-DD), yes/no, an option or options, a link" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "field" - ], - "title": "FieldValue" - }, - "FieldValues": { - "properties": { - "fields": { - "items": { - "$ref": "#/components/schemas/FieldValue" - }, - "type": "array", - "title": "Fields", - "description": "the fields that describe it, in order, with its values (null: none)" - }, - "can_change": { - "type": "boolean", - "title": "Can Change", - "description": "you may change its values" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "fields", - "can_change" - ], - "title": "FieldValues" - }, - "FieldValuesUpdate": { - "properties": { - "values": { - "additionalProperties": true, - "type": "object", - "title": "Values", - "description": "{\"\": its value, or null to clear it}; fields not named keep theirs" + "title": "Description", + "description": "null clears it" } }, "additionalProperties": false, "type": "object", - "required": [ - "values" - ], - "title": "FieldValuesUpdate" + "title": "FileUpdate" }, - "FileLine": { + "FindItem": { "properties": { - "idx": { + "id": { "type": "integer", - "title": "Idx" + "title": "Id" + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Title" }, - "t0": { + "recorded_at": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "T0", - "description": "ms; none in a file that doesn't say when its lines are" + "title": "Recorded At" }, - "t1": { + "duration_ms": { "anyOf": [ { "type": "integer" @@ -45254,14 +46005,20 @@ "type": "null" } ], - "title": "T1" + "title": "Duration Ms" }, - "text": { - "type": "string", - "title": "Text", - "description": "the line; for an index, its title, synopsis and keywords together" + "status": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Status" }, - "speaker": { + "error": { "anyOf": [ { "type": "string" @@ -45270,10 +46027,9 @@ "type": "null" } ], - "title": "Speaker", - "description": "who says or writes it, as the file names them" + "title": "Error" }, - "title": { + "source": { "anyOf": [ { "type": "string" @@ -45282,10 +46038,13 @@ "type": "null" } ], - "title": "Title", - "description": "an index entry's title" + "title": "Source" }, - "synopsis": { + "space": { + "type": "integer", + "title": "Space" + }, + "namespace": { "anyOf": [ { "type": "string" @@ -45294,88 +46053,125 @@ "type": "null" } ], - "title": "Synopsis", - "description": "an index entry's synopsis" + "title": "Namespace" }, - "keywords": { + "collection": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array" + "type": "integer" }, { "type": "null" } ], - "title": "Keywords", - "description": "an index entry's keywords" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "idx", - "text" - ], - "title": "FileLine" - }, - "FileLines": { - "properties": { - "total": { - "type": "integer", - "title": "Total" + "title": "Collection", + "description": "the collection it lives in" }, - "lines": { - "items": { - "$ref": "#/components/schemas/FileLine" - }, - "type": "array", - "title": "Lines" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "total", - "lines" - ], - "title": "FileLines" - }, - "FileStoreTestResult": { - "properties": { - "ok": { - "type": "boolean", - "title": "Ok" + "collection_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Collection Name" }, - "store": { + "media_kind": { + "type": "string", + "title": "Media Kind", + "description": "audio, video, transcript (text without media), document or image" + }, + "pages": { "anyOf": [ { - "type": "string", - "enum": [ - "local", - "connection" - ] + "type": "integer" }, { "type": "null" } ], - "title": "Store" + "title": "Pages", + "description": "a document's or an image's pages" }, - "seconds": { + "poster": { "anyOf": [ { - "type": "number" + "type": "string" }, { "type": "null" } ], - "title": "Seconds" + "title": "Poster", + "description": "signed link to a video's first frame, or a document's or image's first page" }, - "error": { + "emotions": { + "additionalProperties": true, + "type": "object", + "title": "Emotions" + }, + "words": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Words" + }, + "importance": { + "title": "Importance" + }, + "sentiment": { + "title": "Sentiment" + }, + "speakers": { + "type": "string", + "title": "Speakers", + "description": "names of the people in it, comma separated", + "default": "" + }, + "access": { + "type": "string", + "enum": [ + "public", + "restricted", + "private" + ], + "title": "Access", + "description": "its own access, or its namespace's default", + "default": "private" + }, + "open": { + "items": { + "type": "string", + "enum": [ + "media", + "transcript", + "index" + ] + }, + "type": "array", + "title": "Open", + "description": "the parts anyone may use when it is public" + }, + "featured": { + "type": "boolean", + "title": "Featured", + "default": false + }, + "tags": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Tags" + }, + "language": { "anyOf": [ { "type": "string" @@ -45384,9 +46180,10 @@ "type": "null" } ], - "title": "Error" + "title": "Language", + "description": "its language code, when known" }, - "limited": { + "origin": { "anyOf": [ { "type": "string" @@ -45395,144 +46192,130 @@ "type": "null" } ], - "title": "Limited", - "description": "the connection is rate limiting: reads work, new files are kept here" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "ok" - ], - "title": "FileStoreTestResult" - }, - "FileStoreTry": { - "properties": { - "store": { + "title": "Origin", + "description": "where it came from: source: (a connected source), upload, paste, iiif, folder or file" + }, + "origin_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Origin Name", + "description": "what to call its origin: the source's name, or e.g. Uploaded" + }, + "role": { "anyOf": [ { "type": "string", "enum": [ - "local", - "connection" + "viewer", + "editor", + "owner" ] }, { "type": "null" } ], - "title": "Store" + "title": "Role", + "description": "your role on it: through its namespace or its collection (an admin of the collection is an owner)" }, - "connection": { + "nsfw": { "anyOf": [ { - "type": "integer" + "$ref": "#/components/schemas/NsfwState" }, { "type": "null" } ], - "title": "Connection", - "description": "a storage connection's id" + "description": "NSFW classification, where it's on in its namespace and it was classified" }, - "folder": { + "why": { + "items": { + "$ref": "#/components/schemas/FindReason" + }, + "type": "array", + "title": "Why", + "description": "why it matched" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "id", + "space", + "media_kind" + ], + "title": "FindItem" + }, + "FindMoment": { + "properties": { + "t0": { "anyOf": [ { - "type": "string", - "maxLength": 200 + "type": "integer" }, { "type": "null" } ], - "title": "Folder", - "description": "the folder on it (for S3, the bucket and a path)" + "title": "T0", + "description": "ms from the start, on a timeline" }, - "crypt": { - "type": "boolean", - "title": "Crypt", - "description": "wrap it in rclone crypt too", - "default": false - } - }, - "additionalProperties": false, - "type": "object", - "title": "FileStoreTry", - "description": "Where to try keeping files, before saving it (Settings \u2192 Storage); nothing given tries what is saved." - }, - "FileUpdate": { - "properties": { - "role": { + "t1": { "anyOf": [ { - "type": "string", - "enum": [ - "transcript", - "captions", - "translation", - "index", - "thumbnail", - "attachment" - ] + "type": "integer" }, { "type": "null" } ], - "title": "Role", - "description": "a new role; transcripts, captions, translations and indexes are read again" + "title": "T1", + "description": "ms, where it ends" }, - "language": { + "page": { "anyOf": [ { - "type": "string", - "maxLength": 40 + "type": "integer" }, { "type": "null" } ], - "title": "Language", - "description": "null clears it" + "title": "Page", + "description": "in a document or an image: the page (from 0)" }, - "label": { + "last_page": { "anyOf": [ { - "type": "string", - "maxLength": 200 + "type": "integer" }, { "type": "null" } ], - "title": "Label", - "description": "null clears it" + "title": "Last Page", + "description": "a face over several pages: the last of them" }, - "description": { + "text": { "anyOf": [ { - "type": "string", - "maxLength": 2000 + "type": "string" }, { "type": "null" } ], - "title": "Description", - "description": "null clears it" - } - }, - "additionalProperties": false, - "type": "object", - "title": "FileUpdate" - }, - "FindItem": { - "properties": { - "id": { - "type": "integer", - "title": "Id" + "title": "Text", + "description": "the words there, when it has any" }, - "title": { + "speaker": { "anyOf": [ { "type": "string" @@ -45541,9 +46324,9 @@ "type": "null" } ], - "title": "Title" + "title": "Speaker" }, - "recorded_at": { + "source": { "anyOf": [ { "type": "string" @@ -45552,9 +46335,17 @@ "type": "null" } ], - "title": "Recorded At" - }, - "duration_ms": { + "title": "Source", + "description": "words: said, screen, file, page, object or described (as search has it)" + } + }, + "additionalProperties": true, + "type": "object", + "title": "FindMoment" + }, + "FindNamed": { + "properties": { + "id": { "anyOf": [ { "type": "integer" @@ -45563,9 +46354,9 @@ "type": "null" } ], - "title": "Duration Ms" + "title": "Id" }, - "status": { + "key": { "anyOf": [ { "type": "string" @@ -45574,9 +46365,9 @@ "type": "null" } ], - "title": "Status" + "title": "Key" }, - "error": { + "name": { "anyOf": [ { "type": "string" @@ -45585,9 +46376,9 @@ "type": "null" } ], - "title": "Error" + "title": "Name" }, - "source": { + "namespace": { "anyOf": [ { "type": "string" @@ -45596,12 +46387,15 @@ "type": "null" } ], - "title": "Source" - }, - "space": { - "type": "integer", - "title": "Space" - }, + "title": "Namespace" + } + }, + "additionalProperties": true, + "type": "object", + "title": "FindNamed" + }, + "FindQuery": { + "properties": { "namespace": { "anyOf": [ { @@ -45611,137 +46405,167 @@ "type": "null" } ], - "title": "Namespace" + "title": "Namespace", + "description": "one namespace (default: every namespace you can read)" }, - "collection": { + "text": { "anyOf": [ { - "type": "integer" + "type": "string", + "maxLength": 300 }, { "type": "null" } ], - "title": "Collection", - "description": "the collection it lives in" + "title": "Text", + "description": "words said or written in them, as search takes them (words, \"phrases\", OR); by meaning too when that is set up" }, - "collection_name": { + "title": { "anyOf": [ { - "type": "string" + "type": "string", + "maxLength": 200 }, { "type": "null" } ], - "title": "Collection Name" - }, - "media_kind": { - "type": "string", - "title": "Media Kind", - "description": "audio, video, transcript (text without media), document or image" + "title": "Title", + "description": "words that must all appear in the title, the namespace or a person's name" }, - "pages": { + "faces": { "anyOf": [ { - "type": "integer" + "items": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string" + } + ] + }, + "type": "array", + "maxItems": 20 }, { "type": "null" } ], - "title": "Pages", - "description": "a document's or an image's pages" + "title": "Faces", + "description": "people seen in them: face identities, by id or name" }, - "poster": { + "speakers": { "anyOf": [ { - "type": "string" + "items": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string" + } + ] + }, + "type": "array", + "maxItems": 20 }, { "type": "null" } ], - "title": "Poster", - "description": "signed link to a video's first frame, or a document's or image's first page" - }, - "emotions": { - "additionalProperties": true, - "type": "object", - "title": "Emotions" + "title": "Speakers", + "description": "people heard in them: speakers, by id or name" }, - "words": { + "entities": { "anyOf": [ { - "type": "integer" + "items": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string" + } + ] + }, + "type": "array", + "maxItems": 20 }, { "type": "null" } ], - "title": "Words" - }, - "importance": { - "title": "Importance" - }, - "sentiment": { - "title": "Sentiment" - }, - "speakers": { - "type": "string", - "title": "Speakers", - "description": "names of the people in it, comma separated", - "default": "" - }, - "access": { - "type": "string", - "enum": [ - "public", - "restricted", - "private" - ], - "title": "Access", - "description": "its own access, or its namespace's default", - "default": "private" - }, - "open": { - "items": { - "type": "string", - "enum": [ - "media", - "transcript", - "index" - ] - }, - "type": "array", - "title": "Open", - "description": "the parts anyone may use when it is public" + "title": "Entities", + "description": "entities they mention, by id or name" }, - "featured": { - "type": "boolean", - "title": "Featured", - "default": false + "topics": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string" + } + ] + }, + "type": "array", + "maxItems": 20 + }, + { + "type": "null" + } + ], + "title": "Topics", + "description": "topics they were accepted as about, by id or label; a topic's narrower topics count too" }, - "tags": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Tags" + "types": { + "anyOf": [ + { + "items": { + "type": "string", + "enum": [ + "audio", + "video", + "transcript", + "document", + "image" + ] + }, + "type": "array", + "maxItems": 5 + }, + { + "type": "null" + } + ], + "title": "Types", + "description": "their kind: audio, video, transcript, document or image" }, - "language": { + "content_types": { "anyOf": [ { - "type": "string" + "items": { + "type": "string" + }, + "type": "array", + "maxItems": 20 }, { "type": "null" } ], - "title": "Language", - "description": "its language code, when known" + "title": "Content Types", + "description": "content types (podcast, interview, scan, photo, email \u2026, GET /content-types), by key or label" }, - "origin": { + "date_from": { "anyOf": [ { "type": "string" @@ -45750,10 +46574,10 @@ "type": "null" } ], - "title": "Origin", - "description": "where it came from: source: (a connected source), upload, paste, iiif, folder or file" + "title": "Date From", + "description": "made on or after this day, month or year (2026-09-30, 2026-09, 2026)" }, - "origin_name": { + "date_to": { "anyOf": [ { "type": "string" @@ -45762,168 +46586,225 @@ "type": "null" } ], - "title": "Origin Name", - "description": "what to call its origin: the source's name, or e.g. Uploaded" + "title": "Date To", + "description": "made on or before this day, month or year" }, - "role": { + "min_duration": { "anyOf": [ { - "type": "string", - "enum": [ - "viewer", - "editor", - "owner" - ] + "type": "number", + "minimum": 0.0 }, { "type": "null" } ], - "title": "Role", - "description": "your role on it: through its namespace or its collection (an admin of the collection is an owner)" + "title": "Min Duration", + "description": "at least this many seconds long" }, - "nsfw": { + "max_duration": { "anyOf": [ { - "$ref": "#/components/schemas/NsfwState" + "type": "number", + "minimum": 0.0 }, { "type": "null" } ], - "description": "NSFW classification, where it's on in its namespace and it was classified" + "title": "Max Duration", + "description": "shorter than this many seconds" }, - "why": { - "items": { - "$ref": "#/components/schemas/FindReason" - }, - "type": "array", - "title": "Why", - "description": "why it matched" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "id", - "space", - "media_kind" - ], - "title": "FindItem" - }, - "FindMoment": { - "properties": { - "t0": { + "tags": { "anyOf": [ { - "type": "integer" + "items": { + "type": "string" + }, + "type": "array", + "maxItems": 20 }, { "type": "null" } ], - "title": "T0", - "description": "ms from the start, on a timeline" + "title": "Tags", + "description": "tags (ignoring case)" }, - "t1": { + "languages": { "anyOf": [ { - "type": "integer" + "items": { + "type": "string" + }, + "type": "array", + "maxItems": 20 }, { "type": "null" } ], - "title": "T1", - "description": "ms, where it ends" + "title": "Languages", + "description": "language codes; none for those whose language isn't known" }, - "page": { + "objects": { "anyOf": [ { - "type": "integer" + "items": { + "type": "string" + }, + "type": "array", + "maxItems": 20 }, { "type": "null" } ], - "title": "Page", - "description": "in a document or an image: the page (from 0)" + "title": "Objects", + "description": "kinds of object seen in them (person, car, dog \u2026)" }, - "last_page": { + "emotions": { "anyOf": [ { - "type": "integer" + "items": { + "type": "string" + }, + "type": "array", + "maxItems": 20 }, { "type": "null" } ], - "title": "Last Page", - "description": "a face over several pages: the last of them" + "title": "Emotions", + "description": "emotions heard in them (ignoring case)" }, - "text": { + "status": { "anyOf": [ { - "type": "string" + "items": { + "type": "string", + "enum": [ + "new", + "transcribed", + "diarized", + "analyzed", + "error", + "processing", + "failed" + ] + }, + "type": "array", + "maxItems": 10 }, { "type": "null" } ], - "title": "Text", - "description": "the words there, when it has any" + "title": "Status", + "description": "statuses, or processing and failed" }, - "speaker": { + "origins": { "anyOf": [ { - "type": "string" + "items": { + "type": "string" + }, + "type": "array", + "maxItems": 20 }, { "type": "null" } ], - "title": "Speaker" + "title": "Origins", + "description": "where they came from: source:, upload, paste, iiif, folder or file" }, - "source": { + "collection": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Source", - "description": "words: said, screen, file, page, object or described (as search has it)" - } - }, - "additionalProperties": true, - "type": "object", - "title": "FindMoment" - }, - "FindNamed": { - "properties": { - "id": { + "title": "Collection", + "description": "a collection: what's in it and in the collections inside it" + }, + "sensitive": { "anyOf": [ { - "type": "integer" + "type": "string", + "enum": [ + "include", + "only", + "exclude" + ] }, { "type": "null" } ], - "title": "Id" + "title": "Sensitive", + "description": "where NSFW classification is on: only those flagged, exclude them, or include them" }, - "key": { + "sort": { "anyOf": [ { - "type": "string" + "type": "string", + "enum": [ + "relevance", + "-date", + "date", + "-title", + "title", + "-duration", + "duration" + ] }, { "type": "null" } ], - "title": "Key" + "title": "Sort", + "description": "relevance (the default with text: best matching words first), else newest first" + }, + "limit": { + "type": "integer", + "maximum": 100.0, + "minimum": 1.0, + "title": "Limit", + "default": 20 + }, + "offset": { + "type": "integer", + "maximum": 10000.0, + "minimum": 0.0, + "title": "Offset", + "default": 0 + } + }, + "additionalProperties": false, + "type": "object", + "title": "FindQuery", + "description": "Filters combine with AND, the values of one filter with OR. Faces, speakers, entities and topics are ids or names\n(ignoring case; an entity's other names count, and any of a topic's labels)." + }, + "FindReason": { + "properties": { + "by": { + "type": "string", + "enum": [ + "words", + "face", + "voice", + "entity", + "topic", + "content_type", + "object", + "emotion" + ], + "title": "By" }, "name": { "anyOf": [ @@ -45934,437 +46815,507 @@ "type": "null" } ], - "title": "Name" + "title": "Name", + "description": "what matched: the words, the person's or the entity's name, the topic's label \u2026" }, - "namespace": { + "moments": { + "items": { + "$ref": "#/components/schemas/FindMoment" + }, + "type": "array", + "title": "Moments", + "description": "up to 3 moments that show it, to cite" + }, + "count": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Namespace" + "title": "Count", + "description": "emotion: how many lines have it" } }, "additionalProperties": true, "type": "object", - "title": "FindNamed" + "required": [ + "by" + ], + "title": "FindReason" }, - "FindQuery": { + "FindResults": { "properties": { - "namespace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Namespace", - "description": "one namespace (default: every namespace you can read)" - }, - "text": { - "anyOf": [ - { - "type": "string", - "maxLength": 300 - }, - { - "type": "null" - } - ], - "title": "Text", - "description": "words said or written in them, as search takes them (words, \"phrases\", OR); by meaning too when that is set up" + "total": { + "type": "integer", + "title": "Total", + "description": "how many assets match, on all pages" }, - "title": { - "anyOf": [ - { - "type": "string", - "maxLength": 200 - }, - { - "type": "null" - } - ], - "title": "Title", - "description": "words that must all appear in the title, the namespace or a person's name" + "items": { + "items": { + "$ref": "#/components/schemas/FindItem" + }, + "type": "array", + "title": "Items" }, - "faces": { - "anyOf": [ - { - "items": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "string" - } - ] + "resolved": { + "additionalProperties": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/FindNamed" + }, + "type": "array" }, - "type": "array", - "maxItems": 20 - }, - { - "type": "null" - } - ], - "title": "Faces", - "description": "people seen in them: face identities, by id or name" + { + "type": "integer" + } + ] + }, + "type": "object", + "title": "Resolved", + "description": "what the names given matched, by filter (and how many narrower topics came with them)" }, - "speakers": { + "text": { "anyOf": [ { - "items": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "string" - } - ] - }, - "type": "array", - "maxItems": 20 + "$ref": "#/components/schemas/FindText" }, { "type": "null" } - ], - "title": "Speakers", - "description": "people heard in them: speakers, by id or name" + ] + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "total", + "items" + ], + "title": "FindResults" + }, + "FindText": { + "properties": { + "mode": { + "type": "string", + "title": "Mode", + "description": "how the words were matched: keyword, semantic or hybrid" }, - "entities": { + "meaning": { "anyOf": [ { - "items": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "string" - } - ] - }, - "type": "array", - "maxItems": 20 + "type": "string" }, { "type": "null" } ], - "title": "Entities", - "description": "entities they mention, by id or name" + "title": "Meaning", + "description": "why not by meaning, when it was asked and couldn't be" }, - "topics": { + "moments": { + "type": "integer", + "title": "Moments", + "description": "moments the words were found in" + }, + "capped": { + "type": "boolean", + "title": "Capped", + "description": "more moments matched than were looked through, so some assets may be missing" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "mode", + "moments", + "capped" + ], + "title": "FindText" + }, + "ForgotPasswordRequest": { + "properties": { + "email": { + "type": "string", + "title": "Email" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "email" + ], + "title": "ForgotPasswordRequest" + }, + "GoogleClient": { + "properties": { + "origin": { "anyOf": [ { - "items": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "string" - } - ] - }, - "type": "array", - "maxItems": 20 + "type": "string", + "enum": [ + "sign-in", + "connection" + ] }, { "type": "null" } ], - "title": "Topics", - "description": "topics they were accepted as about, by id or label; a topic's narrower topics count too" + "title": "Origin", + "description": "where the OAuth client for connecting a Google account comes from: the Google sign-in provider, an earlier Google connection, or none (enter one to connect)" }, - "types": { + "client_id": { "anyOf": [ { - "items": { - "type": "string", - "enum": [ - "audio", - "video", - "transcript", - "document", - "image" - ] - }, - "type": "array", - "maxItems": 5 + "type": "string" }, { "type": "null" } ], - "title": "Types", - "description": "their kind: audio, video, transcript, document or image" + "title": "Client Id" }, - "content_types": { + "redirect_uri": { + "type": "string", + "title": "Redirect Uri", + "description": "the address to add to the OAuth client's authorized redirect URIs" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "origin", + "redirect_uri" + ], + "title": "GoogleClient" + }, + "GoogleConnect": { + "properties": { + "client_id": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array", - "maxItems": 20 + "type": "string", + "maxLength": 300 }, { "type": "null" } ], - "title": "Content Types", - "description": "content types (podcast, interview, scan, photo, email \u2026, GET /content-types), by key or label" + "title": "Client Id", + "description": "an OAuth client of your own (else the one Lens has)" }, - "date_from": { + "client_secret": { "anyOf": [ { - "type": "string" + "type": "string", + "maxLength": 300 }, { "type": "null" } ], - "title": "Date From", - "description": "made on or after this day, month or year (2026-09-30, 2026-09, 2026)" + "title": "Client Secret" + } + }, + "additionalProperties": false, + "type": "object", + "title": "GoogleConnect" + }, + "GoogleConnectStart": { + "properties": { + "url": { + "type": "string", + "title": "Url", + "description": "Google's consent page; open it in this browser" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "url" + ], + "title": "GoogleConnectStart" + }, + "Gpu": { + "properties": { + "name": { + "type": "string", + "title": "Name" }, - "date_to": { + "memory_gb": { "anyOf": [ { - "type": "string" + "type": "number" }, { "type": "null" } ], - "title": "Date To", - "description": "made on or before this day, month or year" + "title": "Memory Gb" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "name" + ], + "title": "Gpu" + }, + "Graph": { + "properties": { + "scope": { + "type": "string", + "title": "Scope" }, - "min_duration": { + "namespaces": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Namespaces" + }, + "nodes": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array", + "title": "Nodes" + }, + "edges": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array", + "title": "Edges" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "scope", + "namespaces", + "nodes", + "edges" + ], + "title": "Graph" + }, + "GraphChange": { + "properties": { + "id": { + "type": "integer", + "title": "Id" + }, + "kind": { + "type": "string", + "enum": [ + "merge", + "link" + ], + "title": "Kind" + }, + "a": { + "additionalProperties": true, + "type": "object", + "title": "A" + }, + "b": { + "additionalProperties": true, + "type": "object", + "title": "B" + }, + "spaces": { + "items": { + "type": "integer" + }, + "type": "array", + "title": "Spaces" + }, + "reason": { "anyOf": [ { - "type": "number", - "minimum": 0.0 + "type": "string" }, { "type": "null" } ], - "title": "Min Duration", - "description": "at least this many seconds long" + "title": "Reason" }, - "max_duration": { + "confidence": { "anyOf": [ { - "type": "number", - "minimum": 0.0 + "type": "number" }, { "type": "null" } ], - "title": "Max Duration", - "description": "shorter than this many seconds" + "title": "Confidence" }, - "tags": { + "verdict": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array", - "maxItems": 20 + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "title": "Tags", - "description": "tags (ignoring case)" + "title": "Verdict" }, - "languages": { + "keep": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array", - "maxItems": 20 + "type": "integer" }, { "type": "null" } ], - "title": "Languages", - "description": "language codes; none for those whose language isn't known" + "title": "Keep" }, - "objects": { + "status": { + "type": "string", + "enum": [ + "proposed", + "applied", + "dismissed", + "undone" + ], + "title": "Status" + }, + "routine": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array", - "maxItems": 20 + "type": "integer" }, { "type": "null" } ], - "title": "Objects", - "description": "kinds of object seen in them (person, car, dog \u2026)" + "title": "Routine" }, - "emotions": { + "run": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array", - "maxItems": 20 + "type": "integer" }, { "type": "null" } ], - "title": "Emotions", - "description": "emotions heard in them (ignoring case)" + "title": "Run" }, - "status": { + "workflow": { "anyOf": [ { - "items": { - "type": "string", - "enum": [ - "new", - "transcribed", - "diarized", - "analyzed", - "error", - "processing", - "failed" - ] - }, - "type": "array", - "maxItems": 10 + "type": "integer" }, { "type": "null" } ], - "title": "Status", - "description": "statuses, or processing and failed" + "title": "Workflow" }, - "origins": { + "created_at": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array", - "maxItems": 20 + "type": "string" }, { "type": "null" } ], - "title": "Origins", - "description": "where they came from: source:, upload, paste, iiif, folder or file" + "title": "Created At" }, - "collection": { + "decided_at": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Collection", - "description": "a collection: what's in it and in the collections inside it" + "title": "Decided At" }, - "sensitive": { + "decided_by": { "anyOf": [ { - "type": "string", - "enum": [ - "include", - "only", - "exclude" - ] + "type": "string" }, { "type": "null" } ], - "title": "Sensitive", - "description": "where NSFW classification is on: only those flagged, exclude them, or include them" - }, - "sort": { + "title": "Decided By" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "id", + "kind", + "a", + "b", + "spaces", + "status" + ], + "title": "GraphChange" + }, + "GraphChangeAccept": { + "properties": { + "keep": { "anyOf": [ { - "type": "string", - "enum": [ - "relevance", - "-date", - "date", - "-title", - "title", - "-duration", - "duration" - ] + "type": "integer" }, { "type": "null" } ], - "title": "Sort", - "description": "relevance (the default with text: best matching words first), else newest first" - }, - "limit": { - "type": "integer", - "maximum": 100.0, - "minimum": 1.0, - "title": "Limit", - "default": 20 - }, - "offset": { - "type": "integer", - "maximum": 10000.0, - "minimum": 0.0, - "title": "Offset", - "default": 0 + "title": "Keep", + "description": "for a merge: the entity to keep (default: the one proposed)" } }, "additionalProperties": false, "type": "object", - "title": "FindQuery", - "description": "Filters combine with AND, the values of one filter with OR. Faces, speakers, entities and topics are ids or names\n(ignoring case; an entity's other names count, and any of a topic's labels)." + "title": "GraphChangeAccept" }, - "FindReason": { + "GraphQuery": { "properties": { - "by": { + "query": { "type": "string", - "enum": [ - "words", - "face", - "voice", - "entity", - "topic", - "content_type", - "object", - "emotion" - ], - "title": "By" + "title": "Query", + "description": "read-only Cypher, e.g. MATCH (e:Person)<-[:MENTIONS]-(r:Recording) RETURN e.name, count(r)" }, - "name": { + "params": { + "additionalProperties": true, + "type": "object", + "title": "Params", + "description": "values for $parameters in the query" + }, + "scope": { + "type": "string", + "title": "Scope", + "default": "global" + }, + "limit": { + "type": "integer", + "maximum": 5000.0, + "minimum": 1.0, + "title": "Limit", + "description": "rows at most", + "default": 500 + }, + "as_of": { "anyOf": [ { "type": "string" @@ -46373,328 +47324,347 @@ "type": "null" } ], - "title": "Name", - "description": "what matched: the words, the person's or the entity's name, the topic's label \u2026" + "title": "As Of", + "description": "query the graph as of a version: a number or a version's name" + } + }, + "type": "object", + "required": [ + "query" + ], + "title": "GraphQuery" + }, + "GraphQuestion": { + "properties": { + "question": { + "type": "string", + "maxLength": 1000, + "minLength": 1, + "title": "Question", + "description": "a question in plain language" }, - "moments": { - "items": { - "$ref": "#/components/schemas/FindMoment" - }, - "type": "array", - "title": "Moments", - "description": "up to 3 moments that show it, to cite" + "scope": { + "type": "string", + "title": "Scope", + "default": "global" }, - "count": { + "limit": { + "type": "integer", + "maximum": 2000.0, + "minimum": 1.0, + "title": "Limit", + "default": 200 + }, + "as_of": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Count", - "description": "emotion: how many lines have it" + "title": "As Of", + "description": "ask the graph as of a version: a number or a version's name" } }, - "additionalProperties": true, "type": "object", "required": [ - "by" + "question" ], - "title": "FindReason" + "title": "GraphQuestion" }, - "FindResults": { + "HTTPValidationError": { "properties": { - "total": { - "type": "integer", - "title": "Total", - "description": "how many assets match, on all pages" - }, - "items": { + "detail": { "items": { - "$ref": "#/components/schemas/FindItem" + "$ref": "#/components/schemas/ValidationError" }, "type": "array", - "title": "Items" + "title": "Detail" + } + }, + "type": "object", + "title": "HTTPValidationError" + }, + "Handling": { + "properties": { + "store": { + "type": "string", + "enum": [ + "all", + "changes", + "summary", + "none" + ], + "title": "Store", + "description": "all readings, only changes, hourly summaries only, or none (counted and dropped)", + "default": "all" }, - "resolved": { - "additionalProperties": { - "anyOf": [ - { - "items": { - "$ref": "#/components/schemas/FindNamed" - }, - "type": "array" - }, - { - "type": "integer" - } - ] - }, - "type": "object", - "title": "Resolved", - "description": "what the names given matched, by filter (and how many narrower topics came with them)" + "raw_days": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Raw Days", + "description": "days readings are kept; none: for good" }, - "text": { + "rollup_days": { "anyOf": [ { - "$ref": "#/components/schemas/FindText" + "type": "integer" }, { "type": "null" } - ] - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "total", - "items" - ], - "title": "FindResults" - }, - "FindText": { - "properties": { - "mode": { - "type": "string", - "title": "Mode", - "description": "how the words were matched: keyword, semantic or hybrid" + ], + "title": "Rollup Days", + "description": "days hourly summaries are kept; none: for good" }, - "meaning": { + "important_days": { "anyOf": [ { - "type": "string" + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Important Days", + "description": "days log lines of warning or worse are kept, when longer than raw_days" + }, + "max_per_minute": { + "anyOf": [ + { + "type": "integer" }, { "type": "null" } ], - "title": "Meaning", - "description": "why not by meaning, when it was asked and couldn't be" + "title": "Max Per Minute", + "description": "readings a stream may send a minute; more are dropped" }, - "moments": { - "type": "integer", - "title": "Moments", - "description": "moments the words were found in" + "triage": { + "type": "boolean", + "title": "Triage", + "description": "the decision model labels new log patterns routine, notable or alert", + "default": false }, - "capped": { + "digest": { "type": "boolean", - "title": "Capped", - "description": "more moments matched than were looked through, so some assets may be missing" + "title": "Digest", + "description": "a daily digest becomes a document in the sensor's namespace", + "default": false } }, "additionalProperties": true, "type": "object", - "required": [ - "mode", - "moments", - "capped" - ], - "title": "FindText" - }, - "ForgotPasswordRequest": { - "properties": { - "email": { - "type": "string", - "title": "Email" - } - }, - "additionalProperties": false, - "type": "object", - "required": [ - "email" - ], - "title": "ForgotPasswordRequest" + "title": "Handling" }, - "GoogleClient": { + "HandlingChange": { "properties": { - "origin": { + "store": { "anyOf": [ { "type": "string", "enum": [ - "sign-in", - "connection" + "all", + "changes", + "summary", + "none" ] }, { "type": "null" } ], - "title": "Origin", - "description": "where the OAuth client for connecting a Google account comes from: the Google sign-in provider, an earlier Google connection, or none (enter one to connect)" + "title": "Store" }, - "client_id": { + "raw_days": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Client Id" + "title": "Raw Days" }, - "redirect_uri": { - "type": "string", - "title": "Redirect Uri", - "description": "the address to add to the OAuth client's authorized redirect URIs" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "origin", - "redirect_uri" - ], - "title": "GoogleClient" - }, - "GoogleConnect": { - "properties": { - "client_id": { + "rollup_days": { "anyOf": [ { - "type": "string", - "maxLength": 300 + "type": "integer" }, { "type": "null" } ], - "title": "Client Id", - "description": "an OAuth client of your own (else the one Lens has)" + "title": "Rollup Days" }, - "client_secret": { + "important_days": { "anyOf": [ { - "type": "string", - "maxLength": 300 + "type": "integer" }, { "type": "null" } ], - "title": "Client Secret" - } - }, - "additionalProperties": false, - "type": "object", - "title": "GoogleConnect" - }, - "GoogleConnectStart": { - "properties": { - "url": { - "type": "string", - "title": "Url", - "description": "Google's consent page; open it in this browser" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "url" - ], - "title": "GoogleConnectStart" - }, - "Gpu": { - "properties": { - "name": { - "type": "string", - "title": "Name" + "title": "Important Days" }, - "memory_gb": { + "max_per_minute": { "anyOf": [ { - "type": "number" + "type": "integer" }, { "type": "null" } ], - "title": "Memory Gb" + "title": "Max Per Minute" + }, + "triage": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Triage" + }, + "digest": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Digest" } }, - "additionalProperties": true, + "additionalProperties": false, + "type": "object", + "title": "HandlingChange", + "description": "A setting left out stays as it is; null goes back to the settings' default; 0 days keeps them for good." + }, + "HeadUpdate": { + "properties": { + "message": { + "type": "integer", + "title": "Message", + "description": "a message of the version to show: the head moves to the newest message below it" + } + }, + "additionalProperties": false, "type": "object", "required": [ - "name" + "message" ], - "title": "Gpu" + "title": "HeadUpdate" }, - "Graph": { + "Health": { "properties": { - "scope": { - "type": "string", - "title": "Scope" + "database": { + "$ref": "#/components/schemas/HealthDatabase" }, - "namespaces": { - "items": { - "type": "string" + "queue": { + "additionalProperties": { + "type": "integer" }, - "type": "array", - "title": "Namespaces" + "type": "object", + "title": "Queue", + "description": "jobs by status" }, - "nodes": { + "workers": { "items": { "additionalProperties": true, "type": "object" }, "type": "array", - "title": "Nodes" + "title": "Workers" }, - "edges": { + "sources": { "items": { - "additionalProperties": true, - "type": "object" + "$ref": "#/components/schemas/HealthSource" }, "type": "array", - "title": "Edges" + "title": "Sources" + }, + "disk": { + "$ref": "#/components/schemas/HealthDisk" + }, + "counts": { + "$ref": "#/components/schemas/HealthCounts" + }, + "machine": { + "anyOf": [ + { + "$ref": "#/components/schemas/HealthMachine" + }, + { + "type": "null" + } + ], + "description": "CPU, memory, load and uptime now" } }, "additionalProperties": true, "type": "object", "required": [ - "scope", - "namespaces", - "nodes", - "edges" + "database", + "queue", + "workers", + "sources", + "disk", + "counts" ], - "title": "Graph" + "title": "Health" }, - "GraphChange": { + "HealthCounts": { "properties": { - "id": { + "recordings": { "type": "integer", - "title": "Id" - }, - "kind": { - "type": "string", - "enum": [ - "merge", - "link" - ], - "title": "Kind" + "title": "Recordings" }, - "a": { - "additionalProperties": true, - "type": "object", - "title": "A" + "speakers": { + "type": "integer", + "title": "Speakers" }, - "b": { - "additionalProperties": true, - "type": "object", - "title": "B" + "accounts": { + "type": "integer", + "title": "Accounts" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "recordings", + "speakers", + "accounts" + ], + "title": "HealthCounts" + }, + "HealthDatabase": { + "properties": { + "url": { + "type": "string", + "title": "Url" }, - "spaces": { - "items": { - "type": "integer" - }, - "type": "array", - "title": "Spaces" + "embedded": { + "type": "boolean", + "title": "Embedded" }, - "reason": { + "fulltext": { "anyOf": [ { "type": "string" @@ -46703,9 +47673,50 @@ "type": "null" } ], - "title": "Reason" + "title": "Fulltext", + "description": "the full-text index keyword this SurrealDB uses (FULLTEXT or SEARCH); null: none" }, - "confidence": { + "ok": { + "type": "boolean", + "title": "Ok" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "url", + "embedded", + "ok" + ], + "title": "HealthDatabase" + }, + "HealthDisk": { + "properties": { + "path": { + "type": "string", + "title": "Path" + }, + "free_gb": { + "type": "number", + "title": "Free Gb" + }, + "total_gb": { + "type": "number", + "title": "Total Gb" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "path", + "free_gb", + "total_gb" + ], + "title": "HealthDisk" + }, + "HealthMachine": { + "properties": { + "cpu_pct": { "anyOf": [ { "type": "number" @@ -46714,21 +47725,21 @@ "type": "null" } ], - "title": "Confidence" + "title": "Cpu Pct", + "description": "busy share of all CPUs, 0-100; null where /proc isn't there" }, - "verdict": { + "cpus": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "integer" }, { "type": "null" } ], - "title": "Verdict" + "title": "Cpus" }, - "keep": { + "mem_used": { "anyOf": [ { "type": "integer" @@ -46737,19 +47748,10 @@ "type": "null" } ], - "title": "Keep" - }, - "status": { - "type": "string", - "enum": [ - "proposed", - "applied", - "dismissed", - "undone" - ], - "title": "Status" + "title": "Mem Used", + "description": "bytes" }, - "routine": { + "mem_total": { "anyOf": [ { "type": "integer" @@ -46758,122 +47760,133 @@ "type": "null" } ], - "title": "Routine" + "title": "Mem Total", + "description": "bytes" }, - "run": { + "load1": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" } ], - "title": "Run" + "title": "Load1" }, - "workflow": { + "load5": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" } ], - "title": "Workflow" + "title": "Load5" }, - "created_at": { + "load15": { "anyOf": [ { - "type": "string" + "type": "number" }, { "type": "null" } ], - "title": "Created At" + "title": "Load15" }, - "decided_at": { + "rss": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Decided At" + "title": "Rss", + "description": "the API process's memory, bytes" }, - "decided_by": { + "uptime": { + "type": "integer", + "title": "Uptime", + "description": "seconds since the API started" + }, + "host_uptime": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Decided By" + "title": "Host Uptime", + "description": "seconds since the machine started" } }, "additionalProperties": true, "type": "object", "required": [ - "id", - "kind", - "a", - "b", - "spaces", - "status" + "uptime" ], - "title": "GraphChange" + "title": "HealthMachine" }, - "GraphChangeAccept": { + "HealthSource": { "properties": { - "keep": { + "id": { + "type": "integer", + "title": "Id" + }, + "name": { + "type": "string", + "title": "Name" + }, + "type": { + "type": "string", + "title": "Type" + }, + "health": { "anyOf": [ { - "type": "integer" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "title": "Keep", - "description": "for a merge: the entity to keep (default: the one proposed)" + "title": "Health" } }, - "additionalProperties": false, + "additionalProperties": true, "type": "object", - "title": "GraphChangeAccept" + "required": [ + "id", + "name", + "type" + ], + "title": "HealthSource" }, - "GraphQuery": { + "Heard": { "properties": { - "query": { - "type": "string", - "title": "Query", - "description": "read-only Cypher, e.g. MATCH (e:Person)<-[:MENTIONS]-(r:Recording) RETURN e.name, count(r)" - }, - "params": { - "additionalProperties": true, - "type": "object", - "title": "Params", - "description": "values for $parameters in the query" - }, - "scope": { + "text": { "type": "string", - "title": "Scope", - "default": "global" + "title": "Text" }, - "limit": { - "type": "integer", - "maximum": 5000.0, - "minimum": 1.0, - "title": "Limit", - "description": "rows at most", - "default": 500 + "language": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Language" }, - "as_of": { + "engine": { "anyOf": [ { "type": "string" @@ -46882,38 +47895,58 @@ "type": "null" } ], - "title": "As Of", - "description": "query the graph as of a version: a number or a version's name" + "title": "Engine" + }, + "seconds": { + "type": "number", + "title": "Seconds", + "description": "how long the clip was", + "default": 0 } }, + "additionalProperties": true, "type": "object", "required": [ - "query" + "text" ], - "title": "GraphQuery" + "title": "Heard" }, - "GraphQuestion": { + "HeldRunDecision": { "properties": { - "question": { - "type": "string", - "maxLength": 1000, - "minLength": 1, - "title": "Question", - "description": "a question in plain language" + "run": { + "type": "boolean", + "title": "Run", + "description": "true: run it now, once, whatever its budgets say; false: skip it" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "run" + ], + "title": "HeldRunDecision" + }, + "Highlight": { + "properties": { + "id": { + "type": "integer", + "title": "Id" }, - "scope": { - "type": "string", - "title": "Scope", - "default": "global" + "recording": { + "type": "integer", + "title": "Recording" }, - "limit": { + "t0": { "type": "integer", - "maximum": 2000.0, - "minimum": 1.0, - "title": "Limit", - "default": 200 + "title": "T0", + "description": "where the passage starts, in ms from the start" }, - "as_of": { + "t1": { + "type": "integer", + "title": "T1", + "description": "where it ends, in ms" + }, + "quote": { "anyOf": [ { "type": "string" @@ -46922,646 +47955,730 @@ "type": "null" } ], - "title": "As Of", - "description": "ask the graph as of a version: a number or a version's name" - } - }, - "type": "object", - "required": [ - "question" - ], - "title": "GraphQuestion" - }, - "HTTPValidationError": { - "properties": { - "detail": { - "items": { - "$ref": "#/components/schemas/ValidationError" - }, - "type": "array", - "title": "Detail" - } - }, - "type": "object", - "title": "HTTPValidationError" - }, - "Handling": { - "properties": { - "store": { + "title": "Quote", + "description": "the words picked in the text" + }, + "colour": { "type": "string", "enum": [ - "all", - "changes", - "summary", - "none" + "yellow", + "green", + "blue", + "red" ], - "title": "Store", - "description": "all readings, only changes, hourly summaries only, or none (counted and dropped)", - "default": "all" + "title": "Colour" }, - "raw_days": { + "label": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Raw Days", - "description": "days readings are kept; none: for good" + "title": "Label", + "description": "what it marks, in a few words" }, - "rollup_days": { + "created_by": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Rollup Days", - "description": "days hourly summaries are kept; none: for good" + "title": "Created By", + "description": "who made it: their email" }, - "important_days": { + "created_by_name": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Important Days", - "description": "days log lines of warning or worse are kept, when longer than raw_days" + "title": "Created By Name" }, - "max_per_minute": { + "created_at": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Max Per Minute", - "description": "readings a stream may send a minute; more are dropped" + "title": "Created At" }, - "triage": { + "updated_at": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Updated At" + }, + "mine": { "type": "boolean", - "title": "Triage", - "description": "the decision model labels new log patterns routine, notable or alert", - "default": false + "title": "Mine", + "description": "you made it" }, - "digest": { + "can_edit": { "type": "boolean", - "title": "Digest", - "description": "a daily digest becomes a document in the sensor's namespace", - "default": false + "title": "Can Edit", + "description": "you can change or delete it: you edit the resource" } }, "additionalProperties": true, "type": "object", - "title": "Handling" + "required": [ + "id", + "recording", + "t0", + "t1", + "colour", + "mine", + "can_edit" + ], + "title": "Highlight" }, - "HandlingChange": { + "HighlightCreate": { "properties": { - "store": { + "t0": { + "type": "integer", + "minimum": 0.0, + "title": "T0", + "description": "where the passage starts, in ms from the start" + }, + "t1": { "anyOf": [ { - "type": "string", - "enum": [ - "all", - "changes", - "summary", - "none" - ] + "type": "integer", + "minimum": 0.0 }, { "type": "null" } ], - "title": "Store" + "title": "T1", + "description": "where it ends, in ms (default: t0)" }, - "raw_days": { + "quote": { "anyOf": [ { - "type": "integer" + "type": "string", + "maxLength": 1000 }, { "type": "null" } ], - "title": "Raw Days" + "title": "Quote", + "description": "the words picked in the text" }, - "rollup_days": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } + "colour": { + "type": "string", + "enum": [ + "yellow", + "green", + "blue", + "red" ], - "title": "Rollup Days" + "title": "Colour", + "default": "yellow" }, - "important_days": { + "label": { "anyOf": [ { - "type": "integer" + "type": "string", + "maxLength": 200 }, { "type": "null" } ], - "title": "Important Days" - }, - "max_per_minute": { + "title": "Label", + "description": "what it marks, in a few words" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "t0" + ], + "title": "HighlightCreate" + }, + "HighlightUpdate": { + "properties": { + "colour": { "anyOf": [ { - "type": "integer" + "type": "string", + "enum": [ + "yellow", + "green", + "blue", + "red" + ] }, { "type": "null" } ], - "title": "Max Per Minute" + "title": "Colour" }, - "triage": { + "label": { "anyOf": [ { - "type": "boolean" + "type": "string", + "maxLength": 200 }, { "type": "null" } ], - "title": "Triage" + "title": "Label", + "description": "a new label; empty clears it" + } + }, + "additionalProperties": false, + "type": "object", + "title": "HighlightUpdate" + }, + "HookCalled": { + "properties": { + "id": { + "type": "string", + "title": "Id", + "description": "the webhook.received activity the call made (the same one again for a retried call)" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "id" + ], + "title": "HookCalled" + }, + "HookItem": { + "properties": { + "kind": { + "type": "string", + "enum": [ + "file", + "url", + "text" + ], + "title": "Kind" }, - "digest": { + "name": { + "type": "string", + "title": "Name", + "description": "the file's name, the address, or the text's title" + }, + "recording": { + "type": "integer", + "title": "Recording", + "description": "the asset or resource it became" + }, + "job": { "anyOf": [ { - "type": "boolean" + "type": "integer" }, { "type": "null" } ], - "title": "Digest" + "title": "Job", + "description": "the job that runs its pipeline" + }, + "duplicate": { + "type": "boolean", + "title": "Duplicate", + "description": "the namespace had this file already; it's that asset", + "default": false } }, - "additionalProperties": false, + "additionalProperties": true, "type": "object", - "title": "HandlingChange", - "description": "A setting left out stays as it is; null goes back to the settings' default; 0 days keeps them for good." + "required": [ + "kind", + "name", + "recording" + ], + "title": "HookItem" }, - "HeadUpdate": { + "HookPushed": { "properties": { - "message": { - "type": "integer", - "title": "Message", - "description": "a message of the version to show: the head moves to the newest message below it" + "namespace": { + "type": "string", + "title": "Namespace" + }, + "items": { + "items": { + "$ref": "#/components/schemas/HookItem" + }, + "type": "array", + "title": "Items" } }, - "additionalProperties": false, + "additionalProperties": true, "type": "object", "required": [ - "message" + "namespace", + "items" ], - "title": "HeadUpdate" + "title": "HookPushed" }, - "Health": { + "HttpsCertificate": { "properties": { - "database": { - "$ref": "#/components/schemas/HealthDatabase" - }, - "queue": { - "additionalProperties": { - "type": "integer" - }, - "type": "object", - "title": "Queue", - "description": "jobs by status" - }, - "workers": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Workers" - }, - "sources": { + "names": { "items": { - "$ref": "#/components/schemas/HealthSource" + "type": "string" }, "type": "array", - "title": "Sources" - }, - "disk": { - "$ref": "#/components/schemas/HealthDisk" + "title": "Names", + "description": "the domain names it's for" }, - "counts": { - "$ref": "#/components/schemas/HealthCounts" + "expires": { + "type": "string", + "title": "Expires", + "description": "when it runs out (Caddy renews it about a month before)" }, - "machine": { - "anyOf": [ - { - "$ref": "#/components/schemas/HealthMachine" - }, - { - "type": "null" - } - ], - "description": "CPU, memory, load and uptime now" + "issuer": { + "type": "string", + "title": "Issuer", + "description": "the certificate authority that issued it" } }, "additionalProperties": true, "type": "object", "required": [ - "database", - "queue", - "workers", - "sources", - "disk", - "counts" + "names", + "expires", + "issuer" ], - "title": "Health" + "title": "HttpsCertificate" }, - "HealthCounts": { + "HttpsPorts": { "properties": { - "recordings": { - "type": "integer", - "title": "Recordings" - }, - "speakers": { - "type": "integer", - "title": "Speakers" - }, - "accounts": { - "type": "integer", - "title": "Accounts" + "open": { + "type": "boolean", + "title": "Open", + "description": "open the HTTPS ports (true) or close them", + "default": true } }, - "additionalProperties": true, + "additionalProperties": false, "type": "object", - "required": [ - "recordings", - "speakers", - "accounts" - ], - "title": "HealthCounts" + "title": "HttpsPorts" }, - "HealthDatabase": { + "HttpsProvider": { "properties": { - "url": { + "name": { "type": "string", - "title": "Url" - }, - "embedded": { - "type": "boolean", - "title": "Embedded" + "title": "Name", + "description": "the caddy-dns plugin's name, like cloudflare" }, - "fulltext": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Fulltext", - "description": "the full-text index keyword this SurrealDB uses (FULLTEXT or SEARCH); null: none" + "label": { + "type": "string", + "title": "Label" }, - "ok": { - "type": "boolean", - "title": "Ok" + "fields": { + "items": { + "$ref": "#/components/schemas/HttpsProviderField" + }, + "type": "array", + "title": "Fields" } }, "additionalProperties": true, "type": "object", "required": [ - "url", - "embedded", - "ok" + "name", + "label", + "fields" ], - "title": "HealthDatabase" + "title": "HttpsProvider" }, - "HealthDisk": { + "HttpsProviderField": { "properties": { - "path": { + "name": { "type": "string", - "title": "Path" + "title": "Name" }, - "free_gb": { - "type": "number", - "title": "Free Gb" + "label": { + "type": "string", + "title": "Label" }, - "total_gb": { - "type": "number", - "title": "Total Gb" + "secret": { + "type": "boolean", + "title": "Secret" } }, "additionalProperties": true, "type": "object", "required": [ - "path", - "free_gb", - "total_gb" + "name", + "label", + "secret" ], - "title": "HealthDisk" + "title": "HttpsProviderField" }, - "HealthMachine": { + "HttpsStatus": { "properties": { - "cpu_pct": { + "enabled": { + "type": "boolean", + "title": "Enabled" + }, + "running": { + "type": "boolean", + "title": "Running", + "description": "Caddy is running in a server process" + }, + "ports_open": { + "type": "boolean", + "title": "Ports Open", + "description": "a server process has the HTTPS ports (install.sh opened them)" + }, + "url": { "anyOf": [ { - "type": "number" + "type": "string" }, { "type": "null" } ], - "title": "Cpu Pct", - "description": "busy share of all CPUs, 0-100; null where /proc isn't there" + "title": "Url", + "description": "the https:// address people open Lens at" + }, + "certificates": { + "items": { + "$ref": "#/components/schemas/HttpsCertificate" + }, + "type": "array", + "title": "Certificates" + }, + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Error", + "description": "why there's no certificate yet, when there isn't" + }, + "log": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Log", + "description": "Caddy's last lines" + }, + "origin": { + "type": "string", + "title": "Origin", + "description": "where Caddy sends visitors: the web app, as the server reaches it" }, - "cpus": { + "process": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Cpus" + "title": "Process", + "description": "the server process with the HTTPS ports" }, - "mem_used": { + "agent": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Mem Used", - "description": "bytes" + "title": "Agent", + "description": "what can open the ports from here (the upgrade agent: systemd, launchd)" }, - "mem_total": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Mem Total", - "description": "bytes" + "manual": { + "type": "string", + "title": "Manual", + "description": "the line that opens the ports by hand, on the machine Lens runs on" }, - "load1": { + "reconfigure": { "anyOf": [ { - "type": "number" + "$ref": "#/components/schemas/UpgradeRun" }, { "type": "null" } ], - "title": "Load1" + "description": "the last run that opened or closed the ports (as in /admin/updates)" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "enabled", + "running", + "ports_open", + "origin", + "manual" + ], + "title": "HttpsStatus" + }, + "HubLogin": { + "properties": { + "id": { + "type": "integer", + "title": "Id" }, - "load5": { + "username": { + "type": "string", + "title": "Username" + }, + "space": { "anyOf": [ { - "type": "number" + "type": "integer" }, { "type": "null" } ], - "title": "Load5" + "title": "Space" }, - "load15": { + "namespace": { "anyOf": [ { - "type": "number" + "type": "string" }, { "type": "null" } ], - "title": "Load15" + "title": "Namespace" }, - "rss": { + "enabled": { + "type": "boolean", + "title": "Enabled", + "default": true + }, + "created_at": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Rss", - "description": "the API process's memory, bytes" - }, - "uptime": { - "type": "integer", - "title": "Uptime", - "description": "seconds since the API started" + "title": "Created At" }, - "host_uptime": { + "last_seen_at": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Host Uptime", - "description": "seconds since the machine started" + "title": "Last Seen At" } }, "additionalProperties": true, "type": "object", "required": [ - "uptime" + "id", + "username" ], - "title": "HealthMachine" + "title": "HubLogin" }, - "HealthSource": { + "HubLoginCreate": { "properties": { - "id": { - "type": "integer", - "title": "Id" - }, - "name": { + "username": { "type": "string", - "title": "Name" + "title": "Username" }, - "type": { + "password": { "type": "string", - "title": "Type" + "title": "Password" }, - "health": { + "space": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "integer" }, { "type": "null" } ], - "title": "Health" + "title": "Space", + "description": "the namespace new devices that sign in with it go to" } }, - "additionalProperties": true, + "additionalProperties": false, "type": "object", "required": [ - "id", - "name", - "type" + "username", + "password" ], - "title": "HealthSource" + "title": "HubLoginCreate" }, - "Heard": { + "HubStatus": { "properties": { - "text": { - "type": "string", - "title": "Text" + "enabled": { + "type": "boolean", + "title": "Enabled" }, - "language": { + "mqtt": { + "type": "boolean", + "title": "Mqtt" + }, + "mqtt_port": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Language" + "title": "Mqtt Port" }, - "engine": { + "mqtt_web": { + "type": "boolean", + "title": "Mqtt Web", + "description": "the broker over WebSockets too, which the web app relays at /mqtt", + "default": false + }, + "syslog": { + "type": "boolean", + "title": "Syslog" + }, + "syslog_port": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Engine" + "title": "Syslog Port" }, - "seconds": { - "type": "number", - "title": "Seconds", - "description": "how long the clip was", - "default": 0 + "processes": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array", + "title": "Processes", + "description": "the processes running the hub now, and what they listen on" + }, + "new": { + "type": "integer", + "title": "New", + "description": "sensors found that nobody has looked at yet" } }, "additionalProperties": true, "type": "object", "required": [ - "text" - ], - "title": "Heard" - }, - "HeldRunDecision": { - "properties": { - "run": { - "type": "boolean", - "title": "Run", - "description": "true: run it now, once, whatever its budgets say; false: skip it" - } - }, - "additionalProperties": false, - "type": "object", - "required": [ - "run" + "enabled", + "mqtt", + "syslog", + "processes", + "new" ], - "title": "HeldRunDecision" + "title": "HubStatus" }, - "Highlight": { + "IiifImport": { "properties": { - "id": { - "type": "integer", - "title": "Id" + "url": { + "type": "string", + "title": "Url", + "default": "" }, - "recording": { - "type": "integer", - "title": "Recording" + "namespace": { + "type": "string", + "title": "Namespace", + "default": "" }, - "t0": { - "type": "integer", - "title": "T0", - "description": "where the passage starts, in ms from the start" + "keep_transcripts": { + "type": "boolean", + "title": "Keep Transcripts", + "default": true }, - "t1": { + "limit": { "type": "integer", - "title": "T1", - "description": "where it ends, in ms" - }, - "quote": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Quote", - "description": "the words picked in the text" - }, - "colour": { - "type": "string", - "enum": [ - "yellow", - "green", - "blue", - "red" - ], - "title": "Colour" + "title": "Limit", + "default": 50 }, - "label": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Label", - "description": "what it marks, in a few words" + "wait": { + "type": "boolean", + "title": "Wait", + "description": "import before answering instead of in the background", + "default": false }, - "created_by": { + "collection": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Created By", - "description": "who made it: their email" + "title": "Collection", + "description": "a collection of the namespace to put them in; default: its default collection" + } + }, + "additionalProperties": false, + "type": "object", + "title": "IiifImport" + }, + "IiifImported": { + "properties": { + "ok": { + "type": "boolean", + "title": "Ok", + "default": true }, - "created_by_name": { + "recordings": { "anyOf": [ { - "type": "string" + "items": { + "type": "integer" + }, + "type": "array" }, { "type": "null" } ], - "title": "Created By Name" + "title": "Recordings" }, - "created_at": { + "status": { "anyOf": [ { "type": "string" @@ -47570,183 +48687,237 @@ "type": "null" } ], - "title": "Created At" + "title": "Status" + } + }, + "additionalProperties": true, + "type": "object", + "title": "IiifImported" + }, + "IiifPanel": { + "properties": { + "manifest": { + "type": "string", + "title": "Manifest" }, - "updated_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } + "collection": { + "type": "string", + "title": "Collection" + }, + "access": { + "type": "string", + "enum": [ + "public", + "restricted", + "private" ], - "title": "Updated At" + "title": "Access" }, - "mine": { + "open": { + "items": { + "type": "string", + "enum": [ + "media", + "transcript", + "index" + ] + }, + "type": "array", + "title": "Open", + "description": "the parts anyone may use, when the asset is public" + }, + "featured": { "type": "boolean", - "title": "Mine", - "description": "you made it" + "title": "Featured", + "default": false }, - "can_edit": { + "published": { "type": "boolean", - "title": "Can Edit", - "description": "you can change or delete it: you edit the resource" + "title": "Published", + "description": "IIIF publishes public assets" + }, + "layers": { + "items": {}, + "type": "array", + "title": "Layers" + }, + "search": { + "type": "boolean", + "title": "Search" + }, + "validation": { + "$ref": "#/components/schemas/IiifValidation" + }, + "viewers": { + "items": { + "$ref": "#/components/schemas/ViewerLink" + }, + "type": "array", + "title": "Viewers" + }, + "json": { + "additionalProperties": true, + "type": "object", + "title": "Json" } }, "additionalProperties": true, "type": "object", "required": [ - "id", - "recording", - "t0", - "t1", - "colour", - "mine", - "can_edit" + "manifest", + "collection", + "access", + "open", + "published", + "layers", + "search", + "validation", + "viewers", + "json" ], - "title": "Highlight" + "title": "IiifPanel" }, - "HighlightCreate": { + "IiifUrl": { "properties": { - "t0": { + "url": { + "type": "string", + "title": "Url", + "default": "" + } + }, + "additionalProperties": false, + "type": "object", + "title": "IiifUrl" + }, + "IiifValidation": { + "properties": { + "checked": { + "type": "boolean", + "title": "Checked" + }, + "problems": { + "items": {}, + "type": "array", + "title": "Problems" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "checked", + "problems" + ], + "title": "IiifValidation" + }, + "ImportHook": { + "properties": { + "id": { "type": "integer", - "minimum": 0.0, - "title": "T0", - "description": "where the passage starts, in ms from the start" + "title": "Id" }, - "t1": { + "name": { + "type": "string", + "title": "Name" + }, + "namespace": { + "type": "string", + "title": "Namespace" + }, + "collection": { "anyOf": [ { - "type": "integer", - "minimum": 0.0 + "type": "integer" }, { "type": "null" } ], - "title": "T1", - "description": "where it ends, in ms (default: t0)" + "title": "Collection", + "description": "where its imports go (default: the namespace's default collection)" }, - "quote": { + "pipeline": { "anyOf": [ { - "type": "string", - "maxLength": 1000 + "type": "integer" }, { "type": "null" } ], - "title": "Quote", - "description": "the words picked in the text" + "title": "Pipeline", + "description": "the pipeline its imports run (default: the namespace's)" }, - "colour": { - "type": "string", - "enum": [ - "yellow", - "green", - "blue", - "red" - ], - "title": "Colour", - "default": "yellow" + "enabled": { + "type": "boolean", + "title": "Enabled", + "description": "false while paused: pushes are refused, and the token keeps" }, - "label": { + "token_tail": { "anyOf": [ { - "type": "string", - "maxLength": 200 + "type": "string" }, { "type": "null" } ], - "title": "Label", - "description": "what it marks, in a few words" - } - }, - "additionalProperties": false, - "type": "object", - "required": [ - "t0" - ], - "title": "HighlightCreate" - }, - "HighlightUpdate": { - "properties": { - "colour": { + "title": "Token Tail", + "description": "the token's last four characters, to tell tokens apart" + }, + "used": { + "type": "integer", + "title": "Used", + "description": "how many things it has imported", + "default": 0 + }, + "last_used_at": { "anyOf": [ { - "type": "string", - "enum": [ - "yellow", - "green", - "blue", - "red" - ] + "type": "string" }, { "type": "null" } ], - "title": "Colour" + "title": "Last Used At" }, - "label": { + "created_by": { "anyOf": [ { - "type": "string", - "maxLength": 200 + "type": "string" }, { "type": "null" } ], - "title": "Label", - "description": "a new label; empty clears it" - } - }, - "additionalProperties": false, - "type": "object", - "title": "HighlightUpdate" - }, - "HookCalled": { - "properties": { - "id": { + "title": "Created By" + }, + "created_at": { "type": "string", - "title": "Id", - "description": "the webhook.received activity the call made (the same one again for a retried call)" + "title": "Created At" } }, "additionalProperties": true, "type": "object", "required": [ - "id" + "id", + "name", + "namespace", + "enabled", + "created_at" ], - "title": "HookCalled" + "title": "ImportHook" }, - "HookItem": { + "ImportHookCreate": { "properties": { - "kind": { - "type": "string", - "enum": [ - "file", - "url", - "text" - ], - "title": "Kind" - }, "name": { "type": "string", + "maxLength": 80, + "minLength": 1, "title": "Name", - "description": "the file's name, the address, or the text's title" - }, - "recording": { - "type": "integer", - "title": "Recording", - "description": "the asset or resource it became" + "description": "what pushes to it, e.g. Scanner or Zapier" }, - "job": { + "collection": { "anyOf": [ { "type": "integer" @@ -47755,159 +48926,190 @@ "type": "null" } ], - "title": "Job", - "description": "the job that runs its pipeline" + "title": "Collection" }, - "duplicate": { - "type": "boolean", - "title": "Duplicate", - "description": "the namespace had this file already; it's that asset", - "default": false + "pipeline": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Pipeline" } }, - "additionalProperties": true, + "additionalProperties": false, "type": "object", "required": [ - "kind", - "name", - "recording" + "name" ], - "title": "HookItem" + "title": "ImportHookCreate" }, - "HookPushed": { + "ImportHookCreated": { "properties": { - "namespace": { + "hook": { + "$ref": "#/components/schemas/ImportHook" + }, + "token": { "type": "string", - "title": "Namespace" + "title": "Token", + "description": "shown this once: send it as a bearer token, or put it in the address" }, - "items": { - "items": { - "$ref": "#/components/schemas/HookItem" - }, - "type": "array", - "title": "Items" + "path": { + "type": "string", + "title": "Path", + "description": "where to push, on this server's address (POST, with Authorization: Bearer )" } }, "additionalProperties": true, "type": "object", "required": [ - "namespace", - "items" + "hook", + "token", + "path" ], - "title": "HookPushed" + "title": "ImportHookCreated" }, - "HttpsCertificate": { + "ImportHookToken": { "properties": { - "names": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Names", - "description": "the domain names it's for" - }, - "expires": { - "type": "string", - "title": "Expires", - "description": "when it runs out (Caddy renews it about a month before)" - }, - "issuer": { + "token": { "type": "string", - "title": "Issuer", - "description": "the certificate authority that issued it" + "title": "Token", + "description": "shown this once; the old token has stopped working" } }, "additionalProperties": true, "type": "object", "required": [ - "names", - "expires", - "issuer" + "token" ], - "title": "HttpsCertificate" + "title": "ImportHookToken" }, - "HttpsPorts": { + "ImportHookUpdate": { "properties": { - "open": { - "type": "boolean", - "title": "Open", - "description": "open the HTTPS ports (true) or close them", - "default": true + "name": { + "anyOf": [ + { + "type": "string", + "maxLength": 80, + "minLength": 1 + }, + { + "type": "null" + } + ], + "title": "Name" + }, + "collection": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Collection" + }, + "pipeline": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Pipeline" + }, + "enabled": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Enabled" } }, "additionalProperties": false, "type": "object", - "title": "HttpsPorts" + "title": "ImportHookUpdate" }, - "HttpsProvider": { + "ImportPreview": { "properties": { - "name": { + "format": { "type": "string", - "title": "Name", - "description": "the caddy-dns plugin's name, like cloudflare" + "title": "Format" }, - "label": { - "type": "string", - "title": "Label" + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Title" }, - "fields": { + "segments": { + "type": "integer", + "title": "Segments" + }, + "duration_ms": { + "type": "integer", + "title": "Duration Ms" + }, + "speakers": { "items": { - "$ref": "#/components/schemas/HttpsProviderField" + "type": "string" }, "type": "array", - "title": "Fields" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "name", - "label", - "fields" - ], - "title": "HttpsProvider" - }, - "HttpsProviderField": { - "properties": { - "name": { - "type": "string", - "title": "Name" - }, - "label": { - "type": "string", - "title": "Label" - }, - "secret": { - "type": "boolean", - "title": "Secret" + "title": "Speakers" + }, + "preview": { + "items": { + "$ref": "#/components/schemas/PreviewLine" + }, + "type": "array", + "title": "Preview" } }, "additionalProperties": true, "type": "object", "required": [ - "name", - "label", - "secret" + "format", + "segments", + "duration_ms", + "speakers", + "preview" ], - "title": "HttpsProviderField" + "title": "ImportPreview" }, - "HttpsStatus": { + "ImportPreviewRequest": { "properties": { - "enabled": { - "type": "boolean", - "title": "Enabled" - }, - "running": { - "type": "boolean", - "title": "Running", - "description": "Caddy is running in a server process" - }, - "ports_open": { - "type": "boolean", - "title": "Ports Open", - "description": "a server process has the HTTPS ports (install.sh opened them)" + "format": { + "type": "string", + "enum": [ + "auto", + "text", + "markdown", + "mdx", + "json", + "jsonl", + "srt", + "vtt", + "chat" + ], + "title": "Format", + "default": "auto" }, - "url": { + "filename": { "anyOf": [ { "type": "string" @@ -47916,17 +49118,9 @@ "type": "null" } ], - "title": "Url", - "description": "the https:// address people open Lens at" - }, - "certificates": { - "items": { - "$ref": "#/components/schemas/HttpsCertificate" - }, - "type": "array", - "title": "Certificates" + "title": "Filename" }, - "error": { + "data": { "anyOf": [ { "type": "string" @@ -47935,23 +49129,45 @@ "type": "null" } ], - "title": "Error", - "description": "why there's no certificate yet, when there isn't" - }, - "log": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Log", - "description": "Caddy's last lines" + "title": "Data", + "description": "the file, base64 encoded" }, - "origin": { + "text": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Text" + } + }, + "additionalProperties": false, + "type": "object", + "title": "ImportPreviewRequest", + "description": "A file (``filename`` + base64 ``data``) or pasted ``text``." + }, + "ImportRequest": { + "properties": { + "format": { "type": "string", - "title": "Origin", - "description": "where Caddy sends visitors: the web app, as the server reaches it" + "enum": [ + "auto", + "text", + "markdown", + "mdx", + "json", + "jsonl", + "srt", + "vtt", + "chat" + ], + "title": "Format", + "default": "auto" }, - "process": { + "filename": { "anyOf": [ { "type": "string" @@ -47960,10 +49176,9 @@ "type": "null" } ], - "title": "Process", - "description": "the server process with the HTTPS ports" + "title": "Filename" }, - "agent": { + "data": { "anyOf": [ { "type": "string" @@ -47972,59 +49187,38 @@ "type": "null" } ], - "title": "Agent", - "description": "what can open the ports from here (the upgrade agent: systemd, launchd)" - }, - "manual": { - "type": "string", - "title": "Manual", - "description": "the line that opens the ports by hand, on the machine Lens runs on" + "title": "Data", + "description": "the file, base64 encoded" }, - "reconfigure": { + "text": { "anyOf": [ { - "$ref": "#/components/schemas/UpgradeRun" + "type": "string" }, { "type": "null" } ], - "description": "the last run that opened or closed the ports (as in /admin/updates)" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "enabled", - "running", - "ports_open", - "origin", - "manual" - ], - "title": "HttpsStatus" - }, - "HubLogin": { - "properties": { - "id": { - "type": "integer", - "title": "Id" + "title": "Text" }, - "username": { + "namespace": { "type": "string", - "title": "Username" + "title": "Namespace", + "description": "created if it doesn't exist (admins only)", + "default": "" }, - "space": { + "title": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Space" + "title": "Title" }, - "namespace": { + "speakers": { "anyOf": [ { "type": "string" @@ -48033,341 +49227,325 @@ "type": "null" } ], - "title": "Namespace" - }, - "enabled": { - "type": "boolean", - "title": "Enabled", - "default": true + "title": "Speakers", + "description": "rename speakers on the way in: \"S1=Alice,S2=Bob\"" }, - "created_at": { + "pipeline": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Created At" + "title": "Pipeline", + "description": "run this pipeline afterwards instead of the namespace's (GET /pipelines)" }, - "last_seen_at": { + "collection": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Last Seen At" + "title": "Collection", + "description": "a collection of the namespace to put it in; default: its default collection" + } + }, + "additionalProperties": false, + "type": "object", + "title": "ImportRequest" + }, + "ImportResult": { + "properties": { + "ok": { + "type": "boolean", + "title": "Ok", + "default": true + }, + "id": { + "type": "integer", + "title": "Id" + }, + "job": { + "type": "integer", + "title": "Job" } }, "additionalProperties": true, "type": "object", "required": [ "id", - "username" + "job" ], - "title": "HubLogin" + "title": "ImportResult" }, - "HubLoginCreate": { + "ImportTarget": { "properties": { - "username": { - "type": "string", - "title": "Username" - }, - "password": { + "kind": { "type": "string", - "title": "Password" + "enum": [ + "hook", + "person" + ], + "title": "Kind", + "description": "an import webhook's token, or a person's own" }, - "space": { + "hook": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Space", - "description": "the namespace new devices that sign in with it go to" - } - }, - "additionalProperties": false, - "type": "object", - "required": [ - "username", - "password" - ], - "title": "HubLoginCreate" - }, - "HubStatus": { - "properties": { - "enabled": { - "type": "boolean", - "title": "Enabled" - }, - "mqtt": { - "type": "boolean", - "title": "Mqtt" + "title": "Hook", + "description": "the hook's name" }, - "mqtt_port": { + "email": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Mqtt Port" - }, - "mqtt_web": { - "type": "boolean", - "title": "Mqtt Web", - "description": "the broker over WebSockets too, which the web app relays at /mqtt", - "default": false - }, - "syslog": { - "type": "boolean", - "title": "Syslog" + "title": "Email", + "description": "whom a person's own token acts as" }, - "syslog_port": { + "namespace": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Syslog Port" + "title": "Namespace", + "description": "where a push goes without ?namespace=; null when there's a choice" }, - "processes": { + "namespaces": { "items": { - "additionalProperties": true, - "type": "object" + "type": "string" }, "type": "array", - "title": "Processes", - "description": "the processes running the hub now, and what they listen on" + "title": "Namespaces", + "description": "every namespace this token can push into" }, - "new": { - "type": "integer", - "title": "New", - "description": "sensors found that nobody has looked at yet" + "write": { + "type": "boolean", + "title": "Write", + "description": "false for a read-only API token, which can't push" } }, "additionalProperties": true, "type": "object", "required": [ - "enabled", - "mqtt", - "syslog", - "processes", - "new" + "kind", + "write" ], - "title": "HubStatus" + "title": "ImportTarget", + "description": "Where pushes with a token go (GET /hooks/import)." }, - "IiifImport": { + "ImportedAs": { "properties": { - "url": { - "type": "string", - "title": "Url", - "default": "" + "recording": { + "type": "integer", + "title": "Recording" }, "namespace": { "type": "string", - "title": "Namespace", - "default": "" - }, - "keep_transcripts": { - "type": "boolean", - "title": "Keep Transcripts", - "default": true - }, - "limit": { + "title": "Namespace" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "recording", + "namespace" + ], + "title": "ImportedAs" + }, + "IndexQueued": { + "properties": { + "recordings": { "type": "integer", - "title": "Limit", - "default": 50 + "title": "Recordings", + "description": "assets queued to be indexed" }, - "wait": { + "remaining": { "type": "boolean", - "title": "Wait", - "description": "import before answering instead of in the background", - "default": false - }, - "collection": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Collection", - "description": "a collection of the namespace to put them in; default: its default collection" + "title": "Remaining", + "description": "more are waiting than were queued; run it again, or let the hourly routine" } }, - "additionalProperties": false, + "additionalProperties": true, "type": "object", - "title": "IiifImport" + "required": [ + "recordings", + "remaining" + ], + "title": "IndexQueued" }, - "IiifImported": { + "InstallChange": { "properties": { - "ok": { - "type": "boolean", - "title": "Ok", - "default": true - }, - "recordings": { + "public": { "anyOf": [ { - "items": { - "type": "integer" - }, - "type": "array" + "type": "boolean" }, { "type": "null" } ], - "title": "Recordings" + "title": "Public", + "description": "reachable from other machines on the network (true) or this machine only (false)" }, - "status": { + "target": { "anyOf": [ { - "type": "string" + "type": "string", + "enum": [ + "full", + "lean" + ] }, { "type": "null" } ], - "title": "Status" + "title": "Target", + "description": "the edition: full or lean" } }, - "additionalProperties": true, + "additionalProperties": false, "type": "object", - "title": "IiifImported" + "title": "InstallChange" }, - "IiifPanel": { + "InstallLines": { "properties": { - "manifest": { + "public": { "type": "string", - "title": "Manifest" + "title": "Public", + "description": "the install line that makes the web app reachable from other machines (LENS_PUBLIC=1)" }, - "collection": { + "private": { "type": "string", - "title": "Collection" + "title": "Private", + "description": "the install line that keeps it to this machine (LENS_PUBLIC=0)" }, - "access": { + "full": { "type": "string", - "enum": [ - "public", - "restricted", - "private" - ], - "title": "Access" - }, - "open": { - "items": { - "type": "string", - "enum": [ - "media", - "transcript", - "index" - ] - }, - "type": "array", - "title": "Open", - "description": "the parts anyone may use, when the asset is public" - }, - "featured": { - "type": "boolean", - "title": "Featured", - "default": false - }, - "published": { - "type": "boolean", - "title": "Published", - "description": "IIIF publishes public assets" - }, - "layers": { - "items": {}, - "type": "array", - "title": "Layers" + "title": "Full", + "description": "the install line for the full edition (LENS_TARGET=full)" }, - "search": { - "type": "boolean", - "title": "Search" + "lean": { + "type": "string", + "title": "Lean", + "description": "the install line for the lean edition (LENS_TARGET=lean)" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "public", + "private", + "full", + "lean" + ], + "title": "InstallLines" + }, + "InstallStatus": { + "properties": { + "public": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Public", + "description": "the web app is reachable from other machines on the network (LENS_BIND), or from this one only; none: Lens wasn't started by install.sh or docker-compose.prod.yml, so it doesn't know" }, - "validation": { - "$ref": "#/components/schemas/IiifValidation" + "target": { + "anyOf": [ + { + "type": "string", + "enum": [ + "full", + "lean" + ] + }, + { + "type": "null" + } + ], + "title": "Target", + "description": "the edition (LENS_TARGET): full has LibreOffice and Chromium, to read Office files, web pages and emails; lean doesn't. None: not known here" }, - "viewers": { - "items": { - "$ref": "#/components/schemas/ViewerLink" - }, - "type": "array", - "title": "Viewers" + "agent": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Agent", + "description": "what changes them on this machine (systemd, launchd); none: run a `manual` line there" }, - "json": { - "additionalProperties": true, - "type": "object", - "title": "Json" + "manual": { + "$ref": "#/components/schemas/InstallLines", + "description": "the line to run on the machine Lens runs on for each choice, when there's no agent" + }, + "reconfigure": { + "anyOf": [ + { + "$ref": "#/components/schemas/UpgradeRun" + }, + { + "type": "null" + } + ], + "description": "the last run that changed either (as in /admin/updates)" } }, "additionalProperties": true, "type": "object", "required": [ - "manifest", - "collection", - "access", - "open", - "published", - "layers", - "search", - "validation", - "viewers", - "json" + "manual" ], - "title": "IiifPanel" + "title": "InstallStatus" }, - "IiifUrl": { + "IntegrationTool": { "properties": { - "url": { + "name": { "type": "string", - "title": "Url", - "default": "" - } - }, - "additionalProperties": false, - "type": "object", - "title": "IiifUrl" - }, - "IiifValidation": { - "properties": { - "checked": { - "type": "boolean", - "title": "Checked" + "title": "Name" }, - "problems": { - "items": {}, - "type": "array", - "title": "Problems" + "description": { + "type": "string", + "title": "Description" } }, "additionalProperties": true, "type": "object", "required": [ - "checked", - "problems" + "name", + "description" ], - "title": "IiifValidation" + "title": "IntegrationTool" }, - "ImportHook": { + "IpGroup": { "properties": { "id": { "type": "integer", @@ -48377,40 +49555,43 @@ "type": "string", "title": "Name" }, - "namespace": { - "type": "string", - "title": "Namespace" + "ranges": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Ranges", + "description": "addresses and CIDR ranges" }, - "collection": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Collection", - "description": "where its imports go (default: the namespace's default collection)" + "everything": { + "type": "boolean", + "title": "Everything", + "description": "opens every asset in the namespace; else the ones chosen on each asset" }, - "pipeline": { + "chosen": { + "type": "integer", + "title": "Chosen", + "description": "how many assets it opens when it doesn't open everything", + "default": 0 + }, + "here": { + "type": "boolean", + "title": "Here", + "description": "the address you're asking from is in it", + "default": false + }, + "by": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Pipeline", - "description": "the pipeline its imports run (default: the namespace's)" - }, - "enabled": { - "type": "boolean", - "title": "Enabled", - "description": "false while paused: pushes are refused, and the token keeps" + "title": "By" }, - "token_tail": { + "at": { "anyOf": [ { "type": "string" @@ -48419,16 +49600,9 @@ "type": "null" } ], - "title": "Token Tail", - "description": "the token's last four characters, to tell tokens apart" - }, - "used": { - "type": "integer", - "title": "Used", - "description": "how many things it has imported", - "default": 0 + "title": "At" }, - "last_used_at": { + "updated_by": { "anyOf": [ { "type": "string" @@ -48437,9 +49611,9 @@ "type": "null" } ], - "title": "Last Used At" + "title": "Updated By" }, - "created_by": { + "updated_at": { "anyOf": [ { "type": "string" @@ -48448,11 +49622,7 @@ "type": "null" } ], - "title": "Created By" - }, - "created_at": { - "type": "string", - "title": "Created At" + "title": "Updated At" } }, "additionalProperties": true, @@ -48460,107 +49630,139 @@ "required": [ "id", "name", - "namespace", - "enabled", - "created_at" + "ranges", + "everything" ], - "title": "ImportHook" + "title": "IpGroup", + "description": "Address ranges whose visitors see all of some of the namespace's assets without signing in (docs/access.md)." }, - "ImportHookCreate": { + "IpGroupCreate": { "properties": { "name": { "type": "string", "maxLength": 80, "minLength": 1, - "title": "Name", - "description": "what pushes to it, e.g. Scanner or Zapier" + "title": "Name" }, - "collection": { + "ranges": { + "items": { + "type": "string" + }, + "type": "array", + "maxItems": 100, + "minItems": 1, + "title": "Ranges", + "description": "addresses (203.0.113.7) or CIDR ranges (203.0.113.0/24)" + }, + "everything": { + "type": "boolean", + "title": "Everything", + "description": "open every asset in the namespace; else choose them on each asset", + "default": false + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "name", + "ranges" + ], + "title": "IpGroupCreate" + }, + "IpGroupUpdate": { + "properties": { + "name": { "anyOf": [ { - "type": "integer" + "type": "string", + "maxLength": 80, + "minLength": 1 }, { "type": "null" } ], - "title": "Collection" + "title": "Name" }, - "pipeline": { + "ranges": { "anyOf": [ { - "type": "integer" + "items": { + "type": "string" + }, + "type": "array", + "maxItems": 100, + "minItems": 1 }, { "type": "null" } ], - "title": "Pipeline" + "title": "Ranges" + }, + "everything": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Everything" } }, "additionalProperties": false, "type": "object", - "required": [ - "name" - ], - "title": "ImportHookCreate" + "title": "IpGroupUpdate" }, - "ImportHookCreated": { + "IpGroups": { "properties": { - "hook": { - "$ref": "#/components/schemas/ImportHook" - }, - "token": { - "type": "string", - "title": "Token", - "description": "shown this once: send it as a bearer token, or put it in the address" + "address": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Address", + "description": "your address as the server sees it; null when it can't tell (see server.trusted_proxies)" }, - "path": { - "type": "string", - "title": "Path", - "description": "where to push, on this server's address (POST, with Authorization: Bearer )" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "hook", - "token", - "path" - ], - "title": "ImportHookCreated" - }, - "ImportHookToken": { - "properties": { - "token": { - "type": "string", - "title": "Token", - "description": "shown this once; the old token has stopped working" + "groups": { + "items": { + "$ref": "#/components/schemas/IpGroup" + }, + "type": "array", + "title": "Groups" } }, "additionalProperties": true, "type": "object", "required": [ - "token" + "groups" ], - "title": "ImportHookToken" + "title": "IpGroups" }, - "ImportHookUpdate": { + "Job": { "properties": { - "name": { + "id": { + "type": "integer", + "title": "Id" + }, + "recording": { "anyOf": [ { - "type": "string", - "maxLength": 80, - "minLength": 1 + "type": "integer" }, { "type": "null" } ], - "title": "Name" + "title": "Recording" }, - "collection": { + "space": { "anyOf": [ { "type": "integer" @@ -48569,9 +49771,9 @@ "type": "null" } ], - "title": "Collection" + "title": "Space" }, - "pipeline": { + "batch": { "anyOf": [ { "type": "integer" @@ -48580,94 +49782,51 @@ "type": "null" } ], - "title": "Pipeline" + "title": "Batch" }, - "enabled": { + "pipeline": { "anyOf": [ { - "type": "boolean" + "$ref": "#/components/schemas/JobPipeline" }, { "type": "null" } ], - "title": "Enabled" - } - }, - "additionalProperties": false, - "type": "object", - "title": "ImportHookUpdate" - }, - "ImportPreview": { - "properties": { - "format": { - "type": "string", - "title": "Format" + "description": "the pipeline it runs; null when its steps were chosen directly" }, - "title": { + "steps": { + "items": {}, + "type": "array", + "title": "Steps" + }, + "step_index": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Title" - }, - "segments": { - "type": "integer", - "title": "Segments" - }, - "duration_ms": { - "type": "integer", - "title": "Duration Ms" + "title": "Step Index" }, - "speakers": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Speakers" + "next_step": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Next Step" }, - "preview": { - "items": { - "$ref": "#/components/schemas/PreviewLine" - }, - "type": "array", - "title": "Preview" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "format", - "segments", - "duration_ms", - "speakers", - "preview" - ], - "title": "ImportPreview" - }, - "ImportPreviewRequest": { - "properties": { - "format": { + "status": { "type": "string", - "enum": [ - "auto", - "text", - "markdown", - "mdx", - "json", - "jsonl", - "srt", - "vtt", - "chat" - ], - "title": "Format", - "default": "auto" + "title": "Status" }, - "filename": { + "error": { "anyOf": [ { "type": "string" @@ -48676,9 +49835,9 @@ "type": "null" } ], - "title": "Filename" + "title": "Error" }, - "data": { + "title": { "anyOf": [ { "type": "string" @@ -48687,45 +49846,21 @@ "type": "null" } ], - "title": "Data", - "description": "the file, base64 encoded" + "title": "Title", + "description": "the asset's title" }, - "text": { + "progress": { "anyOf": [ { - "type": "string" + "type": "number" }, { "type": "null" } ], - "title": "Text" - } - }, - "additionalProperties": false, - "type": "object", - "title": "ImportPreviewRequest", - "description": "A file (``filename`` + base64 ``data``) or pasted ``text``." - }, - "ImportRequest": { - "properties": { - "format": { - "type": "string", - "enum": [ - "auto", - "text", - "markdown", - "mdx", - "json", - "jsonl", - "srt", - "vtt", - "chat" - ], - "title": "Format", - "default": "auto" + "title": "Progress" }, - "filename": { + "worker": { "anyOf": [ { "type": "string" @@ -48734,21 +49869,20 @@ "type": "null" } ], - "title": "Filename" + "title": "Worker" }, - "data": { + "attempts": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Data", - "description": "the file, base64 encoded" + "title": "Attempts" }, - "text": { + "created_by": { "anyOf": [ { "type": "string" @@ -48757,15 +49891,9 @@ "type": "null" } ], - "title": "Text" - }, - "namespace": { - "type": "string", - "title": "Namespace", - "description": "created if it doesn't exist (admins only)", - "default": "" + "title": "Created By" }, - "title": { + "created_at": { "anyOf": [ { "type": "string" @@ -48774,9 +49902,9 @@ "type": "null" } ], - "title": "Title" + "title": "Created At" }, - "speakers": { + "started_at": { "anyOf": [ { "type": "string" @@ -48785,591 +49913,511 @@ "type": "null" } ], - "title": "Speakers", - "description": "rename speakers on the way in: \"S1=Alice,S2=Bob\"" + "title": "Started At" }, - "pipeline": { + "finished_at": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Pipeline", - "description": "run this pipeline afterwards instead of the namespace's (GET /pipelines)" + "title": "Finished At" }, - "collection": { + "updated_at": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Collection", - "description": "a collection of the namespace to put it in; default: its default collection" - } - }, - "additionalProperties": false, - "type": "object", - "title": "ImportRequest" - }, - "ImportResult": { - "properties": { - "ok": { - "type": "boolean", - "title": "Ok", - "default": true - }, - "id": { - "type": "integer", - "title": "Id" + "title": "Updated At" }, - "job": { - "type": "integer", - "title": "Job" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "id", - "job" - ], - "title": "ImportResult" - }, - "ImportTarget": { - "properties": { - "kind": { - "type": "string", - "enum": [ - "hook", - "person" + "cancel_requested": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } ], - "title": "Kind", - "description": "an import webhook's token, or a person's own" + "title": "Cancel Requested" }, - "hook": { + "cost_usd": { "anyOf": [ { - "type": "string" + "type": "number" }, { "type": "null" } ], - "title": "Hook", - "description": "the hook's name" + "title": "Cost Usd", + "description": "what its calls cost, from the activity ledger (docs/activity.md); set when it ends" }, - "email": { + "tokens": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Email", - "description": "whom a person's own token acts as" + "title": "Tokens" }, - "namespace": { + "cost_estimate": { "anyOf": [ { - "type": "string" + "type": "boolean" }, { "type": "null" } ], - "title": "Namespace", - "description": "where a push goes without ?namespace=; null when there's a choice" - }, - "namespaces": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Namespaces", - "description": "every namespace this token can push into" - }, - "write": { - "type": "boolean", - "title": "Write", - "description": "false for a read-only API token, which can't push" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "kind", - "write" - ], - "title": "ImportTarget", - "description": "Where pushes with a token go (GET /hooks/import)." - }, - "ImportedAs": { - "properties": { - "recording": { - "type": "integer", - "title": "Recording" - }, - "namespace": { - "type": "string", - "title": "Namespace" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "recording", - "namespace" - ], - "title": "ImportedAs" - }, - "IndexQueued": { - "properties": { - "recordings": { - "type": "integer", - "title": "Recordings", - "description": "assets queued to be indexed" + "title": "Cost Estimate", + "description": "true: some calls had no price or token counts, so cost_usd is a floor" }, - "remaining": { - "type": "boolean", - "title": "Remaining", - "description": "more are waiting than were queued; run it again, or let the hourly routine" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "recordings", - "remaining" - ], - "title": "IndexQueued" - }, - "InstallChange": { - "properties": { - "public": { + "hold": { "anyOf": [ { - "type": "boolean" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "title": "Public", - "description": "reachable from other machines on the network (true) or this machine only (false)" + "title": "Hold", + "description": "held or skipped over a budget (docs/budgets.md): {why, resource (the budget), action (ask, skip), decided: {run, by, at} once someone picked}" }, - "target": { + "log": { "anyOf": [ { - "type": "string", - "enum": [ - "full", - "lean" - ] + "items": { + "type": "string" + }, + "type": "array" }, { "type": "null" } ], - "title": "Target", - "description": "the edition: full or lean" - } - }, - "additionalProperties": false, - "type": "object", - "title": "InstallChange" - }, - "InstallLines": { - "properties": { - "public": { - "type": "string", - "title": "Public", - "description": "the install line that makes the web app reachable from other machines (LENS_PUBLIC=1)" - }, - "private": { - "type": "string", - "title": "Private", - "description": "the install line that keeps it to this machine (LENS_PUBLIC=0)" - }, - "full": { - "type": "string", - "title": "Full", - "description": "the install line for the full edition (LENS_TARGET=full)" + "title": "Log", + "description": "the last 200 lines; GET /jobs/{jid}/log has them all" }, - "lean": { - "type": "string", - "title": "Lean", - "description": "the install line for the lean edition (LENS_TARGET=lean)" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "public", - "private", - "full", - "lean" - ], - "title": "InstallLines" - }, - "InstallStatus": { - "properties": { - "public": { + "log_total": { "anyOf": [ { - "type": "boolean" + "type": "integer" }, { "type": "null" } ], - "title": "Public", - "description": "the web app is reachable from other machines on the network (LENS_BIND), or from this one only; none: Lens wasn't started by install.sh or docker-compose.prod.yml, so it doesn't know" + "title": "Log Total", + "description": "how many lines the run has logged" }, - "target": { + "step_runs": { "anyOf": [ { - "type": "string", - "enum": [ - "full", - "lean" - ] + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/StepRun" + }, + { + "type": "null" + } + ] + }, + "type": "array" }, { "type": "null" } ], - "title": "Target", - "description": "the edition (LENS_TARGET): full has LibreOffice and Chromium, to read Office files, web pages and emails; lean doesn't. None: not known here" + "title": "Step Runs", + "description": "GET /jobs/{jid}: one per step, in order: how its latest run went (null until it has run; runs from before these were kept have none)" }, - "agent": { + "estimates": { "anyOf": [ { - "type": "string" + "items": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "type": "array" }, { "type": "null" } ], - "title": "Agent", - "description": "what changes them on this machine (systemd, launchd); none: run a `manual` line there" - }, - "manual": { - "$ref": "#/components/schemas/InstallLines", - "description": "the line to run on the machine Lens runs on for each choice, when there's no agent" + "title": "Estimates", + "description": "GET /jobs/{jid}: how long each step usually takes on this asset, in seconds, from recent runs (null for a step with none)" }, - "reconfigure": { + "eta_seconds": { "anyOf": [ { - "$ref": "#/components/schemas/UpgradeRun" + "type": "number" }, { "type": "null" } ], - "description": "the last run that changed either (as in /admin/updates)" + "title": "Eta Seconds", + "description": "GET /jobs/{jid}, while queued or running: about how long until it finishes, from `estimates`" } }, "additionalProperties": true, "type": "object", "required": [ - "manual" + "id", + "status" ], - "title": "InstallStatus" + "title": "Job" }, - "IntegrationTool": { + "JobList": { "properties": { - "name": { - "type": "string", - "title": "Name" + "jobs": { + "items": { + "$ref": "#/components/schemas/Job" + }, + "type": "array", + "title": "Jobs" + }, + "counts": { + "additionalProperties": { + "type": "integer" + }, + "type": "object", + "title": "Counts", + "description": "jobs of each status (in `namespace` and `batch`, whatever `status`)" + }, + "namespaces": { + "additionalProperties": { + "type": "integer" + }, + "type": "object", + "title": "Namespaces", + "description": "jobs in each namespace you can read (in `batch`, whatever `status`)" + }, + "running": { + "type": "boolean", + "title": "Running" + }, + "step": { + "title": "Step", + "description": "the latest job's current (or last) step" + }, + "returncode": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Returncode", + "description": "the latest job: null while active, 0 succeeded, 1 otherwise" }, - "description": { + "log": { "type": "string", - "title": "Description" + "title": "Log", + "default": "" } }, "additionalProperties": true, "type": "object", "required": [ - "name", - "description" + "jobs", + "counts", + "running" ], - "title": "IntegrationTool" + "title": "JobList" }, - "IpGroup": { + "JobLog": { "properties": { - "id": { + "start": { "type": "integer", - "title": "Id" - }, - "name": { - "type": "string", - "title": "Name" + "title": "Start", + "description": "the number of the first line here (0-based)" }, - "ranges": { + "lines": { "items": { "type": "string" }, "type": "array", - "title": "Ranges", - "description": "addresses and CIDR ranges" - }, - "everything": { - "type": "boolean", - "title": "Everything", - "description": "opens every asset in the namespace; else the ones chosen on each asset" + "title": "Lines" }, - "chosen": { + "total": { "type": "integer", - "title": "Chosen", - "description": "how many assets it opens when it doesn't open everything", - "default": 0 + "title": "Total", + "description": "how many lines the run has logged so far" }, - "here": { + "more": { "type": "boolean", - "title": "Here", - "description": "the address you're asking from is in it", - "default": false - }, - "by": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "By" - }, - "at": { + "title": "More", + "description": "whether there are lines after these" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "start", + "lines", + "total", + "more" + ], + "title": "JobLog" + }, + "JobPipeline": { + "properties": { + "id": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "At" + "title": "Id", + "description": "null for the standard steps" }, - "updated_by": { + "version": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Updated By" + "title": "Version", + "description": "the version the run pinned when it was queued" }, - "updated_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Updated At" + "name": { + "type": "string", + "title": "Name" } }, "additionalProperties": true, "type": "object", "required": [ - "id", - "name", - "ranges", - "everything" + "name" ], - "title": "IpGroup", - "description": "Address ranges whose visitors see all of some of the namespace's assets without signing in (docs/access.md)." + "title": "JobPipeline" }, - "IpGroupCreate": { + "JobQueued": { "properties": { - "name": { - "type": "string", - "maxLength": 80, - "minLength": 1, - "title": "Name" - }, - "ranges": { - "items": { - "type": "string" - }, - "type": "array", - "maxItems": 100, - "minItems": 1, - "title": "Ranges", - "description": "addresses (203.0.113.7) or CIDR ranges (203.0.113.0/24)" - }, - "everything": { + "ok": { "type": "boolean", - "title": "Everything", - "description": "open every asset in the namespace; else choose them on each asset", - "default": false + "title": "Ok", + "default": true + }, + "job": { + "type": "integer", + "title": "Job" } }, - "additionalProperties": false, + "additionalProperties": true, "type": "object", "required": [ - "name", - "ranges" + "job" ], - "title": "IpGroupCreate" + "title": "JobQueued" }, - "IpGroupUpdate": { + "JobsCreate": { "properties": { - "name": { + "recordings": { + "items": { + "type": "integer" + }, + "type": "array", + "title": "Recordings" + }, + "steps": { "anyOf": [ { - "type": "string", - "maxLength": 80, - "minLength": 1 + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": true, + "type": "object" + } + ] + }, + "type": "array" }, { "type": "null" } ], - "title": "Name" + "title": "Steps" }, - "ranges": { + "pipeline": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array", - "maxItems": 100, - "minItems": 1 + "type": "integer" }, { "type": "null" } ], - "title": "Ranges" + "title": "Pipeline" }, - "everything": { + "namespace": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { "type": "null" } ], - "title": "Everything" + "title": "Namespace", + "description": "also queue everything in this namespace that still needs work" } }, "additionalProperties": false, "type": "object", - "title": "IpGroupUpdate" + "title": "JobsCreate" }, - "IpGroups": { + "JobsQueued": { "properties": { - "address": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Address", - "description": "your address as the server sees it; null when it can't tell (see server.trusted_proxies)" + "ok": { + "type": "boolean", + "title": "Ok", + "default": true }, - "groups": { + "jobs": { "items": { - "$ref": "#/components/schemas/IpGroup" + "type": "integer" }, "type": "array", - "title": "Groups" + "title": "Jobs" } }, "additionalProperties": true, "type": "object", "required": [ - "groups" + "jobs" ], - "title": "IpGroups" + "title": "JobsQueued" + }, + "KindTotals": { + "properties": { + "calls": { + "type": "integer", + "title": "Calls", + "default": 0 + }, + "tokens_in": { + "type": "integer", + "title": "Tokens In", + "default": 0 + }, + "tokens_out": { + "type": "integer", + "title": "Tokens Out", + "default": 0 + }, + "cost_usd": { + "type": "number", + "title": "Cost Usd", + "default": 0 + }, + "ms": { + "type": "integer", + "title": "Ms", + "default": 0 + }, + "failed": { + "type": "integer", + "title": "Failed", + "default": 0 + } + }, + "additionalProperties": true, + "type": "object", + "title": "KindTotals" }, - "Job": { + "LanguageCount": { "properties": { - "id": { - "type": "integer", - "title": "Id" - }, - "recording": { + "language": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Recording" + "title": "Language", + "description": "a language code; null: not known" }, - "space": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Space" + "recordings": { + "type": "integer", + "title": "Recordings" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "recordings" + ], + "title": "LanguageCount" + }, + "LastSend": { + "properties": { + "at": { + "type": "string", + "title": "At" }, - "batch": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Batch" + "ok": { + "type": "boolean", + "title": "Ok" }, - "pipeline": { + "code": { "anyOf": [ { - "$ref": "#/components/schemas/JobPipeline" + "type": "integer" }, { "type": "null" } ], - "description": "the pipeline it runs; null when its steps were chosen directly" - }, - "steps": { - "items": {}, - "type": "array", - "title": "Steps" + "title": "Code", + "description": "the HTTP status it answered with" }, - "step_index": { + "error": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Step Index" + "title": "Error" }, - "next_step": { + "event": { "anyOf": [ { "type": "string" @@ -49378,13 +50426,44 @@ "type": "null" } ], - "title": "Next Step" + "title": "Event" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "at", + "ok" + ], + "title": "LastSend" + }, + "LayaModel": { + "properties": { + "id": { + "type": "string", + "title": "Id", + "description": "the Hugging Face repository" }, - "status": { + "about": { "type": "string", - "title": "Status" + "title": "About" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "id", + "about" + ], + "title": "LayaModel" + }, + "LayaStatus": { + "properties": { + "available": { + "type": "boolean", + "title": "Available" }, - "error": { + "where": { "anyOf": [ { "type": "string" @@ -49393,9 +50472,14 @@ "type": "null" } ], - "title": "Error" + "title": "Where", + "description": "here (this machine runs it), server (a Laya server), or none" }, - "title": { + "model": { + "type": "string", + "title": "Model" + }, + "reason": { "anyOf": [ { "type": "string" @@ -49404,32 +50488,46 @@ "type": "null" } ], - "title": "Title", - "description": "the asset's title" + "title": "Reason", + "description": "why it can't answer, when it can't" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "available", + "model" + ], + "title": "LayaStatus" + }, + "LinkImportResult": { + "properties": { + "url": { + "type": "string", + "title": "Url" }, - "progress": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } + "status": { + "type": "string", + "enum": [ + "queued", + "already", + "skipped" ], - "title": "Progress" + "title": "Status", + "description": "queued to be captured; already in the namespace (that resource); skipped (detail says why)" }, - "worker": { + "recording": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Worker" + "title": "Recording" }, - "attempts": { + "job": { "anyOf": [ { "type": "integer" @@ -49438,9 +50536,9 @@ "type": "null" } ], - "title": "Attempts" + "title": "Job" }, - "created_by": { + "detail": { "anyOf": [ { "type": "string" @@ -49449,31 +50547,71 @@ "type": "null" } ], - "title": "Created By" + "title": "Detail" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "url", + "status" + ], + "title": "LinkImportResult" + }, + "LinksImport": { + "properties": { + "results": { + "items": { + "$ref": "#/components/schemas/LinkImportResult" + }, + "type": "array", + "title": "Results" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "results" + ], + "title": "LinksImport" + }, + "LinksImportRequest": { + "properties": { + "namespace": { + "type": "string", + "title": "Namespace", + "description": "a namespace you edit; admins may name a new one" }, - "created_at": { + "text": { "anyOf": [ { - "type": "string" + "type": "string", + "maxLength": 1000000 }, { "type": "null" } ], - "title": "Created At" + "title": "Text", + "description": "addresses, one per line" }, - "started_at": { + "urls": { "anyOf": [ { - "type": "string" + "items": { + "type": "string" + }, + "type": "array", + "maxItems": 500 }, { "type": "null" } ], - "title": "Started At" + "title": "Urls", + "description": "addresses, as a list" }, - "finished_at": { + "filename": { "anyOf": [ { "type": "string" @@ -49482,9 +50620,9 @@ "type": "null" } ], - "title": "Finished At" + "title": "Filename" }, - "updated_at": { + "data": { "anyOf": [ { "type": "string" @@ -49493,32 +50631,16 @@ "type": "null" } ], - "title": "Updated At" - }, - "cancel_requested": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "title": "Cancel Requested" - }, - "cost_usd": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Cost Usd", - "description": "what its calls cost, from the activity ledger (docs/activity.md); set when it ends" + "title": "Data", + "description": "the file, base64 encoded" }, - "tokens": { + "folders_as_tags": { + "type": "boolean", + "title": "Folders As Tags", + "description": "tag each page with the bookmark folders it was in", + "default": true + }, + "pipeline": { "anyOf": [ { "type": "integer" @@ -49527,235 +50649,188 @@ "type": "null" } ], - "title": "Tokens" + "title": "Pipeline", + "description": "run this pipeline afterwards instead of the namespace's" }, - "cost_estimate": { + "collection": { "anyOf": [ { - "type": "boolean" + "type": "integer" }, { "type": "null" } ], - "title": "Cost Estimate", - "description": "true: some calls had no price or token counts, so cost_usd is a floor" + "title": "Collection", + "description": "a collection of the namespace to put them in; default: its default collection" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "namespace" + ], + "title": "LinksImportRequest", + "description": "Links pasted as ``text`` (one per line), listed in ``urls``, or a file (``filename`` + base64 ``data``): a list of addresses, a\nbrowser's bookmark export (HTML) or Chrome's Bookmarks file (JSON)." + }, + "LlmEstimate": { + "properties": { + "calls": { + "type": "integer", + "title": "Calls" }, - "hold": { + "input_tokens": { + "type": "integer", + "title": "Input Tokens" + }, + "output_tokens": { + "type": "integer", + "title": "Output Tokens" + }, + "cost": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "number" }, { "type": "null" } ], - "title": "Hold", - "description": "held or skipped over a budget (docs/budgets.md): {why, resource (the budget), action (ask, skip), decided: {run, by, at} once someone picked}" + "title": "Cost" }, - "log": { + "model": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array" + "type": "string" }, { "type": "null" } ], - "title": "Log", - "description": "the last 200 lines; GET /jobs/{jid}/log has them all" + "title": "Model" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "calls", + "input_tokens", + "output_tokens" + ], + "title": "LlmEstimate" + }, + "LlmTestResult": { + "properties": { + "ok": { + "type": "boolean", + "title": "Ok" }, - "log_total": { + "error": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Log Total", - "description": "how many lines the run has logged" + "title": "Error" }, - "step_runs": { + "reply": { "anyOf": [ { - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/StepRun" - }, - { - "type": "null" - } - ] - }, - "type": "array" + "type": "string" }, { "type": "null" } ], - "title": "Step Runs", - "description": "GET /jobs/{jid}: one per step, in order: how its latest run went (null until it has run; runs from before these were kept have none)" + "title": "Reply" }, - "estimates": { + "ms": { "anyOf": [ { - "items": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ] - }, - "type": "array" + "type": "integer" }, { "type": "null" } ], - "title": "Estimates", - "description": "GET /jobs/{jid}: how long each step usually takes on this asset, in seconds, from recent runs (null for a step with none)" + "title": "Ms" }, - "eta_seconds": { + "model": { "anyOf": [ { - "type": "number" + "type": "string" }, { "type": "null" } ], - "title": "Eta Seconds", - "description": "GET /jobs/{jid}, while queued or running: about how long until it finishes, from `estimates`" + "title": "Model" } }, "additionalProperties": true, "type": "object", "required": [ - "id", - "status" + "ok" ], - "title": "Job" + "title": "LlmTestResult" }, - "JobList": { + "LlmTry": { "properties": { - "jobs": { - "items": { - "$ref": "#/components/schemas/Job" - }, - "type": "array", - "title": "Jobs" - }, - "counts": { - "additionalProperties": { - "type": "integer" - }, - "type": "object", - "title": "Counts", - "description": "jobs of each status (in `namespace` and `batch`, whatever `status`)" - }, - "namespaces": { - "additionalProperties": { - "type": "integer" - }, - "type": "object", - "title": "Namespaces", - "description": "jobs in each namespace you can read (in `batch`, whatever `status`)" - }, - "running": { - "type": "boolean", - "title": "Running" - }, - "step": { - "title": "Step", - "description": "the latest job's current (or last) step" - }, - "returncode": { + "base_url": { "anyOf": [ { - "type": "integer" + "type": "string", + "maxLength": 500 }, { "type": "null" } ], - "title": "Returncode", - "description": "the latest job: null while active, 0 succeeded, 1 otherwise" - }, - "log": { - "type": "string", - "title": "Log", - "default": "" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "jobs", - "counts", - "running" - ], - "title": "JobList" - }, - "JobLog": { - "properties": { - "start": { - "type": "integer", - "title": "Start", - "description": "the number of the first line here (0-based)" - }, - "lines": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Lines" + "title": "Base Url", + "description": "the server's address, as typed" }, - "total": { - "type": "integer", - "title": "Total", - "description": "how many lines the run has logged so far" + "model": { + "anyOf": [ + { + "type": "string", + "maxLength": 200 + }, + { + "type": "null" + } + ], + "title": "Model", + "description": "the model name, as typed" }, - "more": { - "type": "boolean", - "title": "More", - "description": "whether there are lines after these" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "start", - "lines", - "total", - "more" - ], - "title": "JobLog" - }, - "JobPipeline": { - "properties": { - "id": { + "api_key": { "anyOf": [ { - "type": "integer" + "type": "string", + "maxLength": 500 }, { "type": "null" } ], - "title": "Id", - "description": "null for the standard steps" + "title": "Api Key", + "description": "a key typed but not saved; the saved key is used only at the saved address" + } + }, + "additionalProperties": false, + "type": "object", + "title": "LlmTry", + "description": "What to test before saving it (Settings \u2192 LLM provider); anything left out is taken from what is saved." + }, + "LocalLlmProgress": { + "properties": { + "done": { + "type": "integer", + "title": "Done" }, - "version": { + "total": { "anyOf": [ { "type": "integer" @@ -49764,83 +50839,68 @@ "type": "null" } ], - "title": "Version", - "description": "the version the run pinned when it was queued" - }, - "name": { - "type": "string", - "title": "Name" + "title": "Total" } }, "additionalProperties": true, "type": "object", "required": [ - "name" + "done" ], - "title": "JobPipeline" + "title": "LocalLlmProgress" }, - "JobQueued": { + "LocalLlmStatus": { "properties": { - "ok": { + "enabled": { "type": "boolean", - "title": "Ok", - "default": true - }, - "job": { - "type": "integer", - "title": "Job" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "job" - ], - "title": "JobQueued" - }, - "JobsCreate": { - "properties": { - "recordings": { - "items": { - "type": "integer" - }, - "type": "array", - "title": "Recordings" + "title": "Enabled" }, - "steps": { + "model": { "anyOf": [ { - "items": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": true, - "type": "object" - } - ] - }, - "type": "array" + "type": "string" }, { "type": "null" } ], - "title": "Steps" + "title": "Model" }, - "pipeline": { + "phase": { + "type": "string", + "enum": [ + "off", + "fetching-server", + "downloading", + "starting", + "running", + "error" + ], + "title": "Phase" + }, + "progress": { "anyOf": [ { - "type": "integer" + "$ref": "#/components/schemas/LocalLlmProgress" + }, + { + "type": "null" + } + ] + }, + "url": { + "anyOf": [ + { + "type": "string" }, { "type": "null" } ], - "title": "Pipeline" + "title": "Url", + "description": "the OpenAI-compatible address it answers at, while running" }, - "namespace": { + "error": { "anyOf": [ { "type": "string" @@ -49849,76 +50909,29 @@ "type": "null" } ], - "title": "Namespace", - "description": "also queue everything in this namespace that still needs work" - } - }, - "additionalProperties": false, - "type": "object", - "title": "JobsCreate" - }, - "JobsQueued": { - "properties": { - "ok": { - "type": "boolean", - "title": "Ok", - "default": true + "title": "Error" }, - "jobs": { + "log": { "items": { - "type": "integer" + "type": "string" }, "type": "array", - "title": "Jobs" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "jobs" - ], - "title": "JobsQueued" - }, - "KindTotals": { - "properties": { - "calls": { - "type": "integer", - "title": "Calls", - "default": 0 - }, - "tokens_in": { - "type": "integer", - "title": "Tokens In", - "default": 0 - }, - "tokens_out": { - "type": "integer", - "title": "Tokens Out", - "default": 0 - }, - "cost_usd": { - "type": "number", - "title": "Cost Usd", - "default": 0 + "title": "Log", + "description": "llama-server's last lines" }, - "ms": { - "type": "integer", - "title": "Ms", - "default": 0 + "process": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Process", + "description": "the server process running it" }, - "failed": { - "type": "integer", - "title": "Failed", - "default": 0 - } - }, - "additionalProperties": true, - "type": "object", - "title": "KindTotals" - }, - "LanguageCount": { - "properties": { - "language": { + "server": { "anyOf": [ { "type": "string" @@ -49927,44 +50940,59 @@ "type": "null" } ], - "title": "Language", - "description": "a language code; null: not known" + "title": "Server", + "description": "llama-server's path, when it's here" }, - "recordings": { - "type": "integer", - "title": "Recordings" + "catalog": { + "items": { + "$ref": "#/components/schemas/LocalModel" + }, + "type": "array", + "title": "Catalog" + }, + "files": { + "items": { + "$ref": "#/components/schemas/LocalModelFile" + }, + "type": "array", + "title": "Files" + }, + "machine": { + "additionalProperties": true, + "type": "object", + "title": "Machine" } }, "additionalProperties": true, "type": "object", "required": [ - "recordings" + "enabled", + "phase", + "catalog", + "files", + "machine" ], - "title": "LanguageCount" + "title": "LocalLlmStatus" }, - "LastSend": { + "LocalModel": { "properties": { - "at": { + "id": { "type": "string", - "title": "At" + "title": "Id" }, - "ok": { - "type": "boolean", - "title": "Ok" + "label": { + "type": "string", + "title": "Label" }, - "code": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Code", - "description": "the HTTP status it answered with" + "repo": { + "type": "string", + "title": "Repo" }, - "error": { + "file": { + "type": "string", + "title": "File" + }, + "license": { "anyOf": [ { "type": "string" @@ -49973,108 +51001,132 @@ "type": "null" } ], - "title": "Error" + "title": "License" + }, + "about": { + "type": "string", + "title": "About" + }, + "tools": { + "type": "boolean", + "title": "Tools", + "description": "good at the assistant's tool calls" + }, + "size_gb": { + "type": "number", + "title": "Size Gb" + }, + "memory_gb": { + "type": "number", + "title": "Memory Gb", + "description": "memory it needs to run, with room for Lens" + }, + "downloaded": { + "type": "boolean", + "title": "Downloaded" }, - "event": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Event" + "fits": { + "type": "boolean", + "title": "Fits", + "description": "this machine has the memory (or GPU memory) for it" + }, + "room": { + "type": "boolean", + "title": "Room", + "description": "there's disk for it, or it's downloaded" } }, "additionalProperties": true, "type": "object", "required": [ - "at", - "ok" + "id", + "label", + "repo", + "file", + "about", + "tools", + "size_gb", + "memory_gb", + "downloaded", + "fits", + "room" ], - "title": "LastSend" + "title": "LocalModel" }, - "LayaModel": { + "LocalModelFile": { "properties": { - "id": { + "path": { "type": "string", - "title": "Id", - "description": "the Hugging Face repository" + "title": "Path" }, - "about": { - "type": "string", - "title": "About" + "size_gb": { + "type": "number", + "title": "Size Gb" } }, "additionalProperties": true, "type": "object", "required": [ - "id", - "about" + "path", + "size_gb" ], - "title": "LayaModel" + "title": "LocalModelFile" }, - "LayaStatus": { + "LocalModelServer": { "properties": { - "available": { - "type": "boolean", - "title": "Available" - }, - "where": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Where", - "description": "here (this machine runs it), server (a Laya server), or none" + "kind": { + "type": "string", + "title": "Kind" }, - "model": { + "base_url": { "type": "string", - "title": "Model" + "title": "Base Url" }, - "reason": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Reason", - "description": "why it can't answer, when it can't" + "models": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Models" + }, + "suggested": { + "type": "string", + "title": "Suggested" } }, "additionalProperties": true, "type": "object", "required": [ - "available", - "model" + "kind", + "base_url", + "models", + "suggested" ], - "title": "LayaStatus" + "title": "LocalModelServer" }, - "LinkImportResult": { + "LogLine": { "properties": { - "url": { + "ts": { "type": "string", - "title": "Url" + "title": "Ts" }, - "status": { + "level": { "type": "string", - "enum": [ - "queued", - "already", - "skipped" - ], - "title": "Status", - "description": "queued to be captured; already in the namespace (that resource); skipped (detail says why)" + "title": "Level" }, - "recording": { + "logger": { + "type": "string", + "title": "Logger" + }, + "msg": { + "type": "string", + "title": "Msg" + }, + "process": { + "type": "string", + "title": "Process" + }, + "pid": { "anyOf": [ { "type": "integer" @@ -50083,20 +51135,20 @@ "type": "null" } ], - "title": "Recording" + "title": "Pid" }, - "job": { + "host": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Job" + "title": "Host" }, - "detail": { + "exc": { "anyOf": [ { "type": "string" @@ -50105,71 +51157,57 @@ "type": "null" } ], - "title": "Detail" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "url", - "status" - ], - "title": "LinkImportResult" - }, - "LinksImport": { - "properties": { - "results": { - "items": { - "$ref": "#/components/schemas/LinkImportResult" - }, - "type": "array", - "title": "Results" + "title": "Exc" + }, + "fields": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Fields" } }, "additionalProperties": true, "type": "object", "required": [ - "results" + "ts", + "level", + "logger", + "msg", + "process" ], - "title": "LinksImport" + "title": "LogLine", + "description": "One log record, redacted as it was written." }, - "LinksImportRequest": { + "LogStatus": { "properties": { - "namespace": { + "level": { "type": "string", - "title": "Namespace", - "description": "a namespace you edit; admins may name a new one" + "title": "Level" }, - "text": { + "file": { "anyOf": [ { - "type": "string", - "maxLength": 1000000 + "type": "string" }, { "type": "null" } ], - "title": "Text", - "description": "addresses, one per line" + "title": "File", + "description": "the API's log file, under data_dir/logs" }, - "urls": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array", - "maxItems": 500 - }, - { - "type": "null" - } - ], - "title": "Urls", - "description": "addresses, as a list" + "syslog": { + "type": "boolean", + "title": "Syslog", + "description": "whether lines are being sent to a syslog server" }, - "filename": { + "target": { "anyOf": [ { "type": "string" @@ -50178,242 +51216,325 @@ "type": "null" } ], - "title": "Filename" + "title": "Target", + "description": "where, as transport://host:port" }, - "data": { + "sent": { + "type": "integer", + "title": "Sent" + }, + "dropped": { + "type": "integer", + "title": "Dropped", + "description": "lines dropped because the server couldn't keep up or was unreachable" + }, + "queued": { + "type": "integer", + "title": "Queued" + }, + "last_sent": { "anyOf": [ { - "type": "string" + "type": "number" }, { "type": "null" } ], - "title": "Data", - "description": "the file, base64 encoded" - }, - "folders_as_tags": { - "type": "boolean", - "title": "Folders As Tags", - "description": "tag each page with the bookmark folders it was in", - "default": true + "title": "Last Sent" }, - "pipeline": { + "last_error": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Pipeline", - "description": "run this pipeline afterwards instead of the namespace's" + "title": "Last Error" }, - "collection": { + "error_at": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" } ], - "title": "Collection", - "description": "a collection of the namespace to put them in; default: its default collection" + "title": "Error At" } }, - "additionalProperties": false, + "additionalProperties": true, "type": "object", "required": [ - "namespace" + "level", + "syslog", + "sent", + "dropped", + "queued" ], - "title": "LinksImportRequest", - "description": "Links pasted as ``text`` (one per line), listed in ``urls``, or a file (``filename`` + base64 ``data``): a list of addresses, a\nbrowser's bookmark export (HTML) or Chrome's Bookmarks file (JSON)." + "title": "LogStatus", + "description": "What the API process does with its logs now; each worker follows the same settings on its own." }, - "LlmEstimate": { + "LogTestResult": { "properties": { - "calls": { - "type": "integer", - "title": "Calls" - }, - "input_tokens": { - "type": "integer", - "title": "Input Tokens" - }, - "output_tokens": { - "type": "integer", - "title": "Output Tokens" + "ok": { + "type": "boolean", + "title": "Ok" }, - "cost": { + "error": { "anyOf": [ { - "type": "number" + "type": "string" }, { "type": "null" } ], - "title": "Cost" + "title": "Error" }, - "model": { + "ms": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Model" + "title": "Ms" } }, "additionalProperties": true, "type": "object", "required": [ - "calls", - "input_tokens", - "output_tokens" + "ok" ], - "title": "LlmEstimate" + "title": "LogTestResult" }, - "LlmTestResult": { + "LoginRequest": { "properties": { - "ok": { - "type": "boolean", - "title": "Ok" + "email": { + "type": "string", + "title": "Email" }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Error" + "password": { + "type": "string", + "title": "Password" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "email", + "password" + ], + "title": "LoginRequest" + }, + "LoginTicket": { + "properties": { + "ticket": { + "type": "string", + "title": "Ticket", + "description": "swap it for a session at POST /auth/ticket within two minutes; it works once" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "ticket" + ], + "title": "LoginTicket" + }, + "Machine": { + "properties": { + "os": { + "type": "string", + "title": "Os" }, - "reply": { + "arch": { + "type": "string", + "title": "Arch" + }, + "cpus": { + "type": "integer", + "title": "Cpus" + }, + "memory_gb": { "anyOf": [ { - "type": "string" + "type": "number" }, { "type": "null" } ], - "title": "Reply" + "title": "Memory Gb" }, - "ms": { + "gpus": { + "items": { + "$ref": "#/components/schemas/Gpu" + }, + "type": "array", + "title": "Gpus" + }, + "cuda": { + "type": "boolean", + "title": "Cuda", + "default": false + }, + "apple_silicon": { + "type": "boolean", + "title": "Apple Silicon", + "default": false + }, + "container": { + "type": "boolean", + "title": "Container", + "default": false + }, + "python": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Ms" + "title": "Python" }, - "model": { + "disk_free_gb": { "anyOf": [ { - "type": "string" + "type": "number" }, { "type": "null" } ], - "title": "Model" + "title": "Disk Free Gb", + "description": "free space in the data folder, where models go" } }, "additionalProperties": true, "type": "object", "required": [ - "ok" + "os", + "arch", + "cpus" ], - "title": "LlmTestResult" + "title": "Machine" }, - "LlmTry": { + "MailTestResult": { "properties": { - "base_url": { + "ok": { + "type": "boolean", + "title": "Ok" + }, + "to": { "anyOf": [ { - "type": "string", - "maxLength": 500 + "type": "string" }, { "type": "null" } ], - "title": "Base Url", - "description": "the server's address, as typed" + "title": "To", + "description": "where the test message went: your own address" }, - "model": { + "error": { "anyOf": [ { - "type": "string", - "maxLength": 200 + "type": "string" }, { "type": "null" } ], - "title": "Model", - "description": "the model name, as typed" + "title": "Error" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "ok" + ], + "title": "MailTestResult" + }, + "MailboxPerson": { + "properties": { + "id": { + "type": "string", + "title": "Id", + "description": "their email address, for mailbox.users" }, - "api_key": { + "name": { + "type": "string", + "title": "Name" + }, + "allowed": { + "type": "boolean", + "title": "Allowed", + "description": "in mailbox.users: Lens answers their mail" + }, + "vouched": { "anyOf": [ { - "type": "string", - "maxLength": 500 + "type": "string" }, { "type": "null" } ], - "title": "Api Key", - "description": "a key typed but not saved; the saved key is used only at the saved address" + "title": "Vouched", + "description": "how their last message was known to be theirs (DMARC, DKIM, SPF, or From with mailbox.check off); none: it wasn't" + }, + "waiting": { + "type": "integer", + "title": "Waiting", + "description": "their messages held, answered once they're let in", + "default": 0 } }, - "additionalProperties": false, + "additionalProperties": true, "type": "object", - "title": "LlmTry", - "description": "What to test before saving it (Settings \u2192 LLM provider); anything left out is taken from what is saved." + "required": [ + "id", + "name", + "allowed" + ], + "title": "MailboxPerson" }, - "LocalLlmProgress": { + "MailboxStatus": { "properties": { - "done": { - "type": "integer", - "title": "Done" + "state": { + "type": "string", + "enum": [ + "off", + "incomplete", + "starting", + "running", + "error" + ], + "title": "State", + "description": "off; incomplete (`error` says what's missing); starting (no server process has picked it up yet); running; error (the last look at the mailbox failed, `error` says why)" }, - "total": { + "error": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Total" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "done" - ], - "title": "LocalLlmProgress" - }, - "LocalLlmStatus": { - "properties": { - "enabled": { - "type": "boolean", - "title": "Enabled" + "title": "Error" }, - "model": { + "holder": { "anyOf": [ { "type": "string" @@ -50422,43 +51543,34 @@ "type": "null" } ], - "title": "Model" - }, - "phase": { - "type": "string", - "enum": [ - "off", - "fetching-server", - "downloading", - "starting", - "running", - "error" - ], - "title": "Phase" + "title": "Holder", + "description": "the server process reading the mailbox" }, - "progress": { + "at": { "anyOf": [ { - "$ref": "#/components/schemas/LocalLlmProgress" + "type": "string" }, { "type": "null" } - ] + ], + "title": "At", + "description": "when it last looked" }, - "url": { + "answered": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Url", - "description": "the OpenAI-compatible address it answers at, while running" + "title": "Answered", + "description": "messages it answered" }, - "error": { + "address": { "anyOf": [ { "type": "string" @@ -50467,17 +51579,10 @@ "type": "null" } ], - "title": "Error" - }, - "log": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Log", - "description": "llama-server's last lines" + "title": "Address", + "description": "the assistant's address" }, - "process": { + "imap": { "anyOf": [ { "type": "string" @@ -50486,10 +51591,10 @@ "type": "null" } ], - "title": "Process", - "description": "the server process running it" + "title": "Imap", + "description": "the server it reads mail from (host:port and security), set or guessed" }, - "server": { + "smtp": { "anyOf": [ { "type": "string" @@ -50498,204 +51603,119 @@ "type": "null" } ], - "title": "Server", - "description": "llama-server's path, when it's here" - }, - "catalog": { - "items": { - "$ref": "#/components/schemas/LocalModel" - }, - "type": "array", - "title": "Catalog" + "title": "Smtp", + "description": "the server it sends from (host:port and security), set or guessed" }, - "files": { + "people": { "items": { - "$ref": "#/components/schemas/LocalModelFile" + "$ref": "#/components/schemas/MailboxPerson" }, "type": "array", - "title": "Files" - }, - "machine": { - "additionalProperties": true, - "type": "object", - "title": "Machine" + "title": "People", + "description": "who has written to it, latest first" } }, "additionalProperties": true, "type": "object", "required": [ - "enabled", - "phase", - "catalog", - "files", - "machine" + "state" ], - "title": "LocalLlmStatus" + "title": "MailboxStatus" }, - "LocalModel": { + "ManifestCheck": { "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "label": { - "type": "string", - "title": "Label" - }, - "repo": { - "type": "string", - "title": "Repo" - }, - "file": { - "type": "string", - "title": "File" - }, - "license": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "License" - }, - "about": { + "text": { "type": "string", - "title": "About" - }, - "tools": { - "type": "boolean", - "title": "Tools", - "description": "good at the assistant's tool calls" - }, - "size_gb": { - "type": "number", - "title": "Size Gb" - }, - "memory_gb": { - "type": "number", - "title": "Memory Gb", - "description": "memory it needs to run, with room for Lens" - }, - "downloaded": { - "type": "boolean", - "title": "Downloaded" - }, - "fits": { - "type": "boolean", - "title": "Fits", - "description": "this machine has the memory (or GPU memory) for it" - }, - "room": { - "type": "boolean", - "title": "Room", - "description": "there's disk for it, or it's downloaded" + "title": "Text" } }, - "additionalProperties": true, + "additionalProperties": false, "type": "object", "required": [ - "id", - "label", - "repo", - "file", - "about", - "tools", - "size_gb", - "memory_gb", - "downloaded", - "fits", - "room" + "text" ], - "title": "LocalModel" + "title": "ManifestCheck" }, - "LocalModelFile": { + "ManifestChecked": { "properties": { - "path": { - "type": "string", - "title": "Path" - }, - "size_gb": { - "type": "number", - "title": "Size Gb" + "manifest": { + "additionalProperties": true, + "type": "object", + "title": "Manifest", + "description": "the manifest, read and checked" } }, "additionalProperties": true, "type": "object", "required": [ - "path", - "size_gb" + "manifest" ], - "title": "LocalModelFile" + "title": "ManifestChecked" }, - "LocalModelServer": { + "MarkIn": { "properties": { - "kind": { - "type": "string", - "title": "Kind" - }, - "base_url": { - "type": "string", - "title": "Base Url" + "reviewed": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Reviewed" }, - "models": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Models" + "important": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Important" }, - "suggested": { - "type": "string", - "title": "Suggested" + "hidden": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Hidden" } }, - "additionalProperties": true, + "additionalProperties": false, "type": "object", - "required": [ - "kind", - "base_url", - "models", - "suggested" - ], - "title": "LocalModelServer" + "title": "MarkIn", + "description": "Marks to set: each given true or false; one left out stays as it is." }, - "LogLine": { + "Marketplace": { "properties": { - "ts": { - "type": "string", - "title": "Ts" - }, - "level": { - "type": "string", - "title": "Level" - }, - "logger": { - "type": "string", - "title": "Logger" - }, - "msg": { - "type": "string", - "title": "Msg" + "id": { + "type": "integer", + "title": "Id" }, - "process": { + "name": { "type": "string", - "title": "Process" + "title": "Name", + "description": "the name its marketplace.json gives it" }, - "pid": { + "title": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Pid" + "title": "Title" }, - "host": { + "description": { "anyOf": [ { "type": "string" @@ -50704,9 +51724,19 @@ "type": "null" } ], - "title": "Host" + "title": "Description" }, - "exc": { + "source": { + "type": "string", + "title": "Source", + "description": "where it is: a repository, or a link to its marketplace.json" + }, + "plugins": { + "type": "integer", + "title": "Plugins", + "description": "how many plugins it lists" + }, + "added_by": { "anyOf": [ { "type": "string" @@ -50715,40 +51745,38 @@ "type": "null" } ], - "title": "Exc" + "title": "Added By" }, - "fields": { + "fetched_at": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "string" }, { "type": "null" } ], - "title": "Fields" + "title": "Fetched At" } }, "additionalProperties": true, "type": "object", "required": [ - "ts", - "level", - "logger", - "msg", - "process" + "id", + "name", + "source", + "plugins" ], - "title": "LogLine", - "description": "One log record, redacted as it was written." + "title": "Marketplace" }, - "LogStatus": { + "MarketplaceCreate": { "properties": { - "level": { + "source": { "type": "string", - "title": "Level" + "title": "Source", + "description": "owner/repo on GitHub, a GitHub or GitLab link, or a link to a marketplace.json" }, - "file": { + "title": { "anyOf": [ { "type": "string" @@ -50757,15 +51785,23 @@ "type": "null" } ], - "title": "File", - "description": "the API's log file, under data_dir/logs" - }, - "syslog": { - "type": "boolean", - "title": "Syslog", - "description": "whether lines are being sent to a syslog server" + "title": "Title" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "source" + ], + "title": "MarketplaceCreate" + }, + "MarketplacePlugin": { + "properties": { + "name": { + "type": "string", + "title": "Name" }, - "target": { + "description": { "anyOf": [ { "type": "string" @@ -50774,34 +51810,31 @@ "type": "null" } ], - "title": "Target", - "description": "where, as transport://host:port" - }, - "sent": { - "type": "integer", - "title": "Sent" - }, - "dropped": { - "type": "integer", - "title": "Dropped", - "description": "lines dropped because the server couldn't keep up or was unreachable" + "title": "Description" }, - "queued": { - "type": "integer", - "title": "Queued" + "version": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Version" }, - "last_sent": { + "category": { "anyOf": [ { - "type": "number" + "type": "string" }, { "type": "null" } ], - "title": "Last Sent" + "title": "Category" }, - "last_error": { + "author": { "anyOf": [ { "type": "string" @@ -50810,39 +51843,25 @@ "type": "null" } ], - "title": "Last Error" + "title": "Author" }, - "error_at": { + "homepage": { "anyOf": [ { - "type": "number" + "type": "string" }, { "type": "null" } ], - "title": "Error At" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "level", - "syslog", - "sent", - "dropped", - "queued" - ], - "title": "LogStatus", - "description": "What the API process does with its logs now; each worker follows the same settings on its own." - }, - "LogTestResult": { - "properties": { - "ok": { + "title": "Homepage" + }, + "installable": { "type": "boolean", - "title": "Ok" + "title": "Installable", + "description": "whether Lens can read it (why_not says why when it can't)" }, - "error": { + "why_not": { "anyOf": [ { "type": "string" @@ -50851,9 +51870,9 @@ "type": "null" } ], - "title": "Error" + "title": "Why Not" }, - "ms": { + "installed": { "anyOf": [ { "type": "integer" @@ -50862,137 +51881,161 @@ "type": "null" } ], - "title": "Ms" + "title": "Installed", + "description": "your extension installed from it, if you installed it" } }, "additionalProperties": true, "type": "object", "required": [ - "ok" + "name", + "installable" ], - "title": "LogTestResult" + "title": "MarketplacePlugin" }, - "LoginRequest": { + "MarketplaceSuggestion": { "properties": { - "email": { + "name": { "type": "string", - "title": "Email" + "title": "Name" }, - "password": { + "title": { "type": "string", - "title": "Password" - } - }, - "additionalProperties": false, - "type": "object", - "required": [ - "email", - "password" - ], - "title": "LoginRequest" - }, - "LoginTicket": { - "properties": { - "ticket": { + "title": "Title" + }, + "source": { "type": "string", - "title": "Ticket", - "description": "swap it for a session at POST /auth/ticket within two minutes; it works once" + "title": "Source" } }, "additionalProperties": true, "type": "object", "required": [ - "ticket" + "name", + "title", + "source" ], - "title": "LoginTicket" + "title": "MarketplaceSuggestion" }, - "Machine": { + "MarksIn": { "properties": { - "os": { - "type": "string", - "title": "Os" - }, - "arch": { - "type": "string", - "title": "Arch" - }, - "cpus": { - "type": "integer", - "title": "Cpus" - }, - "memory_gb": { + "reviewed": { "anyOf": [ { - "type": "number" + "type": "boolean" }, { "type": "null" - } - ], - "title": "Memory Gb" - }, - "gpus": { - "items": { - "$ref": "#/components/schemas/Gpu" - }, - "type": "array", - "title": "Gpus" - }, - "cuda": { - "type": "boolean", - "title": "Cuda", - "default": false - }, - "apple_silicon": { - "type": "boolean", - "title": "Apple Silicon", - "default": false - }, - "container": { - "type": "boolean", - "title": "Container", - "default": false + } + ], + "title": "Reviewed" }, - "python": { + "important": { "anyOf": [ { - "type": "string" + "type": "boolean" }, { "type": "null" } ], - "title": "Python" + "title": "Important" }, - "disk_free_gb": { + "hidden": { "anyOf": [ { - "type": "number" + "type": "boolean" }, { "type": "null" } ], - "title": "Disk Free Gb", - "description": "free space in the data folder, where models go" + "title": "Hidden" + }, + "ids": { + "items": { + "type": "string" + }, + "type": "array", + "maxItems": 500, + "minItems": 1, + "title": "Ids", + "description": "the activities' ids" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "ids" + ], + "title": "MarksIn" + }, + "MarksOut": { + "properties": { + "marks": { + "additionalProperties": { + "$ref": "#/components/schemas/ActivityMark" + }, + "type": "object", + "title": "Marks", + "description": "your marks now, by id" + }, + "unknown": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Unknown", + "description": "ids of activities there are none of, or you can't see" } }, "additionalProperties": true, "type": "object", "required": [ - "os", - "arch", - "cpus" + "marks" ], - "title": "Machine" + "title": "MarksOut" }, - "MailTestResult": { + "MatterbridgeRoom": { "properties": { - "ok": { + "gateway": { + "type": "string", + "title": "Gateway", + "description": "its gateway's name, for bridge.rooms (like slack-general = pods)" + }, + "network": { + "type": "string", + "title": "Network" + }, + "room": { + "type": "string", + "title": "Room" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "gateway", + "network", + "room" + ], + "title": "MatterbridgeRoom" + }, + "MatterbridgeStatus": { + "properties": { + "run": { "type": "boolean", - "title": "Ok" + "title": "Run" }, - "to": { + "gateways": { + "items": { + "$ref": "#/components/schemas/MatterbridgeRoom" + }, + "type": "array", + "title": "Gateways", + "default": [] + }, + "whatsapp_qr": { "anyOf": [ { "type": "string" @@ -51001,8 +52044,8 @@ "type": "null" } ], - "title": "To", - "description": "where the test message went: your own address" + "title": "Whatsapp Qr", + "description": "the QR code WhatsApp waits to be scanned with, as text lines" }, "error": { "anyOf": [ @@ -51013,122 +52056,85 @@ "type": "null" } ], - "title": "Error" + "title": "Error", + "description": "why its config couldn't be written" } }, "additionalProperties": true, "type": "object", "required": [ - "ok" + "run" ], - "title": "MailTestResult" + "title": "MatterbridgeStatus" }, - "MailboxPerson": { + "McpConfig": { "properties": { - "id": { - "type": "string", - "title": "Id", - "description": "their email address, for mailbox.users" - }, - "name": { - "type": "string", - "title": "Name" - }, - "allowed": { - "type": "boolean", - "title": "Allowed", - "description": "in mailbox.users: Lens answers their mail" - }, - "vouched": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Vouched", - "description": "how their last message was known to be theirs (DMARC, DKIM, SPF, or From with mailbox.check off); none: it wasn't" + "servers": { + "items": { + "$ref": "#/components/schemas/McpServerFound" + }, + "type": "array", + "title": "Servers", + "default": [] }, - "waiting": { - "type": "integer", - "title": "Waiting", - "description": "their messages held, answered once they're let in", - "default": 0 + "skipped": { + "items": { + "$ref": "#/components/schemas/McpServerSkipped" + }, + "type": "array", + "title": "Skipped", + "default": [] } }, "additionalProperties": true, "type": "object", + "title": "McpConfig" + }, + "McpConfigText": { + "properties": { + "text": { + "type": "string", + "title": "Text", + "description": "an MCP config from another app: Claude's .mcp.json or mcpServers, VS Code's servers, or one server" + } + }, + "additionalProperties": false, + "type": "object", "required": [ - "id", - "name", - "allowed" + "text" ], - "title": "MailboxPerson" + "title": "McpConfigText" }, - "MailboxStatus": { + "McpPreset": { "properties": { - "state": { + "name": { "type": "string", - "enum": [ - "off", - "incomplete", - "starting", - "running", - "error" - ], - "title": "State", - "description": "off; incomplete (`error` says what's missing); starting (no server process has picked it up yet); running; error (the last look at the mailbox failed, `error` says why)" + "title": "Name", + "description": "what its tools are called by: name__tool" }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Error" + "label": { + "type": "string", + "title": "Label" }, - "holder": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Holder", - "description": "the server process reading the mailbox" + "description": { + "type": "string", + "title": "Description" }, - "at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "At", - "description": "when it last looked" + "spec": { + "additionalProperties": true, + "type": "object", + "title": "Spec", + "description": "the server, as an MCP extension keeps it" }, - "answered": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Answered", - "description": "messages it answered" + "fill": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Fill", + "description": "values written as ${NAME} in spec, to type in first" }, - "address": { + "needs": { "anyOf": [ { "type": "string" @@ -51137,22 +52143,56 @@ "type": "null" } ], - "title": "Address", - "description": "the assistant's address" + "title": "Needs", + "description": "the optional profile it runs in (GET /admin/services), if any" }, - "imap": { + "service": { "anyOf": [ { - "type": "string" + "$ref": "#/components/schemas/Service" }, { "type": "null" } ], - "title": "Imap", - "description": "the server it reads mail from (host:port and security), set or guessed" + "description": "that profile: whether it's on and running" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "name", + "label", + "description", + "spec" + ], + "title": "McpPreset" + }, + "McpPresets": { + "properties": { + "presets": { + "items": { + "$ref": "#/components/schemas/McpPreset" + }, + "type": "array", + "title": "Presets" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "presets" + ], + "title": "McpPresets" + }, + "McpServerFound": { + "properties": { + "name": { + "type": "string", + "title": "Name", + "description": "a name for it, from the config or guessed from its package or address" }, - "smtp": { + "description": { "anyOf": [ { "type": "string" @@ -51161,69 +52201,105 @@ "type": "null" } ], - "title": "Smtp", - "description": "the server it sends from (host:port and security), set or guessed" + "title": "Description" }, - "people": { + "spec": { + "additionalProperties": true, + "type": "object", + "title": "Spec", + "description": "{url, headers}, or {command, args, env} for one that runs as a program" + }, + "fill": { "items": { - "$ref": "#/components/schemas/MailboxPerson" + "type": "string" }, "type": "array", - "title": "People", - "description": "who has written to it, latest first" + "title": "Fill", + "description": "values written as ${NAME}, which its app filled in and Lens can't" } }, "additionalProperties": true, "type": "object", "required": [ - "state" + "name", + "spec" ], - "title": "MailboxStatus" + "title": "McpServerFound" }, - "ManifestCheck": { + "McpServerSkipped": { "properties": { - "text": { + "name": { "type": "string", - "title": "Text" + "title": "Name" + }, + "why": { + "type": "string", + "title": "Why" } }, - "additionalProperties": false, + "additionalProperties": true, "type": "object", "required": [ - "text" + "name", + "why" ], - "title": "ManifestCheck" + "title": "McpServerSkipped" }, - "ManifestChecked": { + "McpServerTools": { "properties": { - "manifest": { - "additionalProperties": true, - "type": "object", - "title": "Manifest", - "description": "the manifest, read and checked" + "tools": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array", + "title": "Tools", + "description": "its tools, as it lists them now: {name, description, schema, read_only}" } }, "additionalProperties": true, "type": "object", "required": [ - "manifest" + "tools" ], - "title": "ManifestChecked" + "title": "McpServerTools" }, - "MarkIn": { + "McpServerTry": { "properties": { - "reviewed": { + "spec": { + "additionalProperties": true, + "type": "object", + "title": "Spec", + "description": "{url, headers}, or {command, args, env} for one that runs as a program" + }, + "extension": { "anyOf": [ { - "type": "boolean" + "type": "integer" }, { "type": "null" } ], - "title": "Reviewed" + "title": "Extension", + "description": "the MCP server whose saved secrets fill in values sent as \u2022\u2022\u2022\u2022" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "spec" + ], + "title": "McpServerTry" + }, + "McpToolSwitch": { + "properties": { + "tool": { + "type": "string", + "title": "Tool", + "description": "the tool's name, as the server lists it" }, - "important": { + "on": { "anyOf": [ { "type": "boolean" @@ -51232,9 +52308,10 @@ "type": "null" } ], - "title": "Important" + "title": "On", + "description": "switch it on or off" }, - "hidden": { + "ask": { "anyOf": [ { "type": "boolean" @@ -51243,98 +52320,72 @@ "type": "null" } ], - "title": "Hidden" + "title": "Ask", + "description": "whether it asks first (default: unless the server says it only reads)" } }, "additionalProperties": false, "type": "object", - "title": "MarkIn", - "description": "Marks to set: each given true or false; one left out stays as it is." + "required": [ + "tool" + ], + "title": "McpToolSwitch" }, - "Marketplace": { + "Me": { "properties": { - "id": { - "type": "integer", - "title": "Id" + "user": { + "$ref": "#/components/schemas/UserPublic" }, - "name": { - "type": "string", - "title": "Name", - "description": "the name its marketplace.json gives it" + "roles": { + "additionalProperties": { + "type": "string", + "enum": [ + "viewer", + "editor", + "owner" + ] + }, + "type": "object", + "title": "Roles", + "description": "namespace name -> role, as a built-in role (a custom role counts as its rank)" }, - "title": { - "anyOf": [ - { + "permissions": { + "additionalProperties": { + "items": { "type": "string" }, - { - "type": "null" - } - ], - "title": "Title" + "type": "array" + }, + "type": "object", + "title": "Permissions", + "description": "namespace name -> what your role there allows (docs/access.md#roles-and-permissions)" }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Description" + "partial": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Partial", + "description": "namespaces you have no role in but see some collections of (roles on collections)" }, - "source": { + "via": { "type": "string", - "title": "Source", - "description": "where it is: a repository, or a link to its marketplace.json" - }, - "plugins": { - "type": "integer", - "title": "Plugins", - "description": "how many plugins it lists" - }, - "added_by": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } + "enum": [ + "access", + "token", + "oauth" ], - "title": "Added By" + "title": "Via" }, - "fetched_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Fetched At" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "id", - "name", - "source", - "plugins" - ], - "title": "Marketplace" - }, - "MarketplaceCreate": { - "properties": { - "source": { + "scope": { "type": "string", - "title": "Source", - "description": "owner/repo on GitHub, a GitHub or GitLab link, or a link to a marketplace.json" + "enum": [ + "read", + "write" + ], + "title": "Scope" }, - "title": { + "toured_at": { "anyOf": [ { "type": "string" @@ -51343,34 +52394,48 @@ "type": "null" } ], - "title": "Title" + "title": "Toured At", + "description": "when you finished or skipped the welcome tour; until then the web app opens it once you sign in" } }, - "additionalProperties": false, + "additionalProperties": true, "type": "object", "required": [ - "source" + "user", + "roles", + "via", + "scope" ], - "title": "MarketplaceCreate" + "title": "Me" }, - "MarketplacePlugin": { + "MeUpdate": { "properties": { "name": { "type": "string", - "title": "Name" + "maxLength": 80, + "minLength": 1, + "title": "Name", + "description": "whitespace is collapsed" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "name" + ], + "title": "MeUpdate" + }, + "Member": { + "properties": { + "account": { + "type": "integer", + "title": "Account" }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Description" + "role": { + "type": "string", + "title": "Role" }, - "version": { + "email": { "anyOf": [ { "type": "string" @@ -51379,9 +52444,9 @@ "type": "null" } ], - "title": "Version" + "title": "Email" }, - "category": { + "name": { "anyOf": [ { "type": "string" @@ -51390,9 +52455,20 @@ "type": "null" } ], - "title": "Category" - }, - "author": { + "title": "Name" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "account", + "role" + ], + "title": "Member" + }, + "MemberSet": { + "properties": { + "email": { "anyOf": [ { "type": "string" @@ -51401,199 +52477,145 @@ "type": "null" } ], - "title": "Author" + "title": "Email" }, - "homepage": { + "account": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Homepage" - }, - "installable": { - "type": "boolean", - "title": "Installable", - "description": "whether Lens can read it (why_not says why when it can't)" + "title": "Account" }, - "why_not": { + "role": { "anyOf": [ { - "type": "string" + "type": "string", + "maxLength": 40, + "minLength": 1, + "description": "viewer, editor, owner or a custom role's name" }, { "type": "null" } ], - "title": "Why Not" + "title": "Role" + } + }, + "additionalProperties": false, + "type": "object", + "title": "MemberSet", + "description": "Who (by email, or by account id) and their role; a null role removes them from the namespace." + }, + "Mention": { + "properties": { + "recording_id": { + "type": "integer", + "title": "Recording Id" }, - "installed": { + "title": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Installed", - "description": "your extension installed from it, if you installed it" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "name", - "installable" - ], - "title": "MarketplacePlugin" - }, - "MarketplaceSuggestion": { - "properties": { - "name": { - "type": "string", - "title": "Name" - }, - "title": { - "type": "string", "title": "Title" }, - "source": { - "type": "string", - "title": "Source" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "name", - "title", - "source" - ], - "title": "MarketplaceSuggestion" - }, - "MarksIn": { - "properties": { - "reviewed": { + "namespace": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { "type": "null" } ], - "title": "Reviewed" + "title": "Namespace" }, - "important": { + "t0": { + "type": "integer", + "title": "T0", + "default": 0 + }, + "text": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { "type": "null" } ], - "title": "Important" + "title": "Text" }, - "hidden": { + "speaker": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { "type": "null" } ], - "title": "Hidden" + "title": "Speaker" }, - "ids": { - "items": { - "type": "string" - }, - "type": "array", - "maxItems": 500, - "minItems": 1, - "title": "Ids", - "description": "the activities' ids" + "recorded_at": { + "type": "string", + "title": "Recorded At", + "default": "" } }, - "additionalProperties": false, + "additionalProperties": true, "type": "object", "required": [ - "ids" + "recording_id" ], - "title": "MarksIn" + "title": "Mention" }, - "MarksOut": { + "MentionList": { "properties": { - "marks": { - "additionalProperties": { - "$ref": "#/components/schemas/ActivityMark" - }, - "type": "object", - "title": "Marks", - "description": "your marks now, by id" + "total": { + "type": "integer", + "title": "Total" }, - "unknown": { + "items": { "items": { - "type": "string" + "additionalProperties": true, + "type": "object" }, "type": "array", - "title": "Unknown", - "description": "ids of activities there are none of, or you can't see" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "marks" - ], - "title": "MarksOut" - }, - "MatterbridgeRoom": { - "properties": { - "gateway": { - "type": "string", - "title": "Gateway", - "description": "its gateway's name, for bridge.rooms (like slack-general = pods)" - }, - "network": { - "type": "string", - "title": "Network" - }, - "room": { - "type": "string", - "title": "Room" + "title": "Items" } }, "additionalProperties": true, - "type": "object", - "required": [ - "gateway", - "network", - "room" - ], - "title": "MatterbridgeRoom" - }, - "MatterbridgeStatus": { - "properties": { - "run": { - "type": "boolean", - "title": "Run" - }, - "gateways": { - "items": { - "$ref": "#/components/schemas/MatterbridgeRoom" - }, - "type": "array", - "title": "Gateways", - "default": [] + "type": "object", + "required": [ + "total", + "items" + ], + "title": "MentionList" + }, + "MentionMove": { + "properties": { + "target": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Target", + "description": "an entity in the same namespace" }, - "whatsapp_qr": { + "new_name": { "anyOf": [ { "type": "string" @@ -51602,10 +52624,10 @@ "type": "null" } ], - "title": "Whatsapp Qr", - "description": "the QR code WhatsApp waits to be scanned with, as text lines" + "title": "New Name", + "description": "or a new (or existing) entity by name" }, - "error": { + "new_type": { "anyOf": [ { "type": "string" @@ -51614,336 +52636,381 @@ "type": "null" } ], - "title": "Error", - "description": "why its config couldn't be written" + "title": "New Type", + "default": "TERM" + }, + "remove": { + "type": "boolean", + "title": "Remove", + "description": "or say this mention isn't an entity at all", + "default": false } }, - "additionalProperties": true, + "additionalProperties": false, "type": "object", - "required": [ - "run" - ], - "title": "MatterbridgeStatus" + "title": "MentionMove" }, - "McpConfig": { + "MentionMoved": { "properties": { - "servers": { - "items": { - "$ref": "#/components/schemas/McpServerFound" - }, - "type": "array", - "title": "Servers", - "default": [] + "ok": { + "type": "boolean", + "title": "Ok", + "default": true }, - "skipped": { - "items": { - "$ref": "#/components/schemas/McpServerSkipped" - }, - "type": "array", - "title": "Skipped", - "default": [] + "entity": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Entity" } }, "additionalProperties": true, "type": "object", - "title": "McpConfig" + "title": "MentionMoved" }, - "McpConfigText": { + "MeshAuthority": { "properties": { - "text": { + "fingerprint": { "type": "string", - "title": "Text", - "description": "an MCP config from another app: Claude's .mcp.json or mcpServers, VS Code's servers, or one server" + "title": "Fingerprint", + "description": "the CA certificate's fingerprint: every machine on the mesh trusts it" + }, + "not_after": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Not After", + "description": "when the CA runs out" + }, + "created_at": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Created At" } }, - "additionalProperties": false, + "additionalProperties": true, "type": "object", "required": [ - "text" + "fingerprint" ], - "title": "McpConfigText" + "title": "MeshAuthority" }, - "McpPreset": { + "MeshBeat": { "properties": { - "name": { - "type": "string", - "title": "Name", - "description": "what its tools are called by: name__tool" - }, - "label": { - "type": "string", - "title": "Label" + "nebula": { + "anyOf": [ + { + "type": "string", + "maxLength": 40 + }, + { + "type": "null" + } + ], + "title": "Nebula", + "description": "running, starting, stopped or failed" }, - "description": { - "type": "string", - "title": "Description" + "version": { + "anyOf": [ + { + "type": "string", + "maxLength": 40 + }, + { + "type": "null" + } + ], + "title": "Version", + "description": "the Lens version it runs" }, - "spec": { - "additionalProperties": true, - "type": "object", - "title": "Spec", - "description": "the server, as an MCP extension keeps it" + "peers": { + "anyOf": [ + { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array", + "maxItems": 500 + }, + { + "type": "null" + } + ], + "title": "Peers", + "description": "the machines it has tunnels to" }, - "fill": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Fill", - "description": "values written as ${NAME} in spec, to type in first" + "machine": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Machine", + "description": "its processors, memory and system" }, - "needs": { + "sandbox": { "anyOf": [ { - "type": "string" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "title": "Needs", - "description": "the optional profile it runs in (GET /admin/services), if any" + "title": "Sandbox", + "description": "the sandboxes it can run" }, - "service": { + "error": { "anyOf": [ { - "$ref": "#/components/schemas/Service" + "type": "string", + "maxLength": 500 }, { "type": "null" } ], - "description": "that profile: whether it's on and running" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "name", - "label", - "description", - "spec" - ], - "title": "McpPreset" - }, - "McpPresets": { - "properties": { - "presets": { - "items": { - "$ref": "#/components/schemas/McpPreset" - }, - "type": "array", - "title": "Presets" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "presets" - ], - "title": "McpPresets" - }, - "McpServerFound": { - "properties": { - "name": { - "type": "string", - "title": "Name", - "description": "a name for it, from the config or guessed from its package or address" + "title": "Error" }, - "description": { + "log": { "anyOf": [ { - "type": "string" + "items": { + "type": "string" + }, + "type": "array", + "maxItems": 40 }, { "type": "null" } ], - "title": "Description" + "title": "Log", + "description": "Nebula's last lines" + } + }, + "additionalProperties": false, + "type": "object", + "title": "MeshBeat" + }, + "MeshJoin": { + "properties": { + "token_id": { + "type": "integer", + "title": "Token Id", + "description": "the number in the join token (lensjoin1..)" }, - "spec": { - "additionalProperties": true, - "type": "object", - "title": "Spec", - "description": "{url, headers}, or {command, args, env} for one that runs as a program" + "nonce": { + "type": "string", + "maxLength": 64, + "minLength": 16, + "title": "Nonce", + "description": "random, made for this request" }, - "fill": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Fill", - "description": "values written as ${NAME}, which its app filled in and Lens can't" + "name": { + "type": "string", + "maxLength": 63, + "minLength": 1, + "title": "Name", + "description": "the machine's name" + }, + "public_key": { + "type": "string", + "maxLength": 500, + "title": "Public Key", + "description": "its Nebula public key (nebula-cert keygen): its private key never leaves it" + }, + "proof": { + "type": "string", + "maxLength": 128, + "title": "Proof", + "description": "HMAC-SHA256 of the request, keyed with the token's secret (docs/mesh.md)" + }, + "info": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Info", + "description": "about the machine: os, arch, cpus, memory" } }, - "additionalProperties": true, + "additionalProperties": false, "type": "object", "required": [ + "token_id", + "nonce", "name", - "spec" + "public_key", + "proof" ], - "title": "McpServerFound" + "title": "MeshJoin" }, - "McpServerSkipped": { + "MeshJoined": { "properties": { - "name": { - "type": "string", - "title": "Name" + "node": { + "type": "integer", + "title": "Node" }, - "why": { + "sealed": { "type": "string", - "title": "Why" + "title": "Sealed", + "description": "the answer, sealed with a key from the token's secret: certificate, config, credentials" } }, "additionalProperties": true, "type": "object", "required": [ - "name", - "why" + "node", + "sealed" ], - "title": "McpServerSkipped" + "title": "MeshJoined" }, - "McpServerTools": { + "MeshNode": { "properties": { - "tools": { + "id": { + "type": "integer", + "title": "Id" + }, + "name": { + "type": "string", + "title": "Name" + }, + "role": { + "type": "string", + "enum": [ + "primary", + "worker", + "compute" + ], + "title": "Role" + }, + "ip": { + "type": "string", + "title": "Ip", + "description": "its address on the mesh" + }, + "groups": { "items": { - "additionalProperties": true, - "type": "object" + "type": "string" }, "type": "array", - "title": "Tools", - "description": "its tools, as it lists them now: {name, description, schema, read_only}" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "tools" - ], - "title": "McpServerTools" - }, - "McpServerTry": { - "properties": { - "spec": { - "additionalProperties": true, - "type": "object", - "title": "Spec", - "description": "{url, headers}, or {command, args, env} for one that runs as a program" + "title": "Groups", + "description": "its certificate's groups: role and namespaces, for the firewall" }, - "extension": { + "namespaces": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Namespaces", + "description": "the namespaces it serves (none: every one)" + }, + "fingerprint": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Extension", - "description": "the MCP server whose saved secrets fill in values sent as \u2022\u2022\u2022\u2022" - } - }, - "additionalProperties": false, - "type": "object", - "required": [ - "spec" - ], - "title": "McpServerTry" - }, - "McpToolSwitch": { - "properties": { - "tool": { - "type": "string", - "title": "Tool", - "description": "the tool's name, as the server lists it" + "title": "Fingerprint", + "description": "its current certificate's fingerprint" }, - "on": { + "not_after": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { "type": "null" } ], - "title": "On", - "description": "switch it on or off" + "title": "Not After", + "description": "when its certificate runs out (it renews it at two thirds)" }, - "ask": { + "joined_at": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { "type": "null" } ], - "title": "Ask", - "description": "whether it asks first (default: unless the server says it only reads)" - } - }, - "additionalProperties": false, - "type": "object", - "required": [ - "tool" - ], - "title": "McpToolSwitch" - }, - "Me": { - "properties": { - "user": { - "$ref": "#/components/schemas/UserPublic" - }, - "roles": { - "additionalProperties": { - "type": "string", - "enum": [ - "viewer", - "editor", - "owner" - ] - }, - "type": "object", - "title": "Roles", - "description": "namespace name -> role, as a built-in role (a custom role counts as its rank)" + "title": "Joined At" }, - "permissions": { - "additionalProperties": { - "items": { + "joined_by": { + "anyOf": [ + { "type": "string" }, - "type": "array" - }, - "type": "object", - "title": "Permissions", - "description": "namespace name -> what your role there allows (docs/access.md#roles-and-permissions)" - }, - "partial": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Partial", - "description": "namespaces you have no role in but see some collections of (roles on collections)" + { + "type": "null" + } + ], + "title": "Joined By", + "description": "the admin who made the token it joined with" }, - "via": { - "type": "string", - "enum": [ - "access", - "token", - "oauth" + "last_seen": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } ], - "title": "Via" + "title": "Last Seen", + "description": "its last report, every minute while it runs" }, - "scope": { - "type": "string", - "enum": [ - "read", - "write" + "status": { + "additionalProperties": true, + "type": "object", + "title": "Status", + "description": "what it last reported: Nebula, its peers, its machine" + }, + "revoked_at": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } ], - "title": "Scope" + "title": "Revoked At", + "description": "when it was taken off the mesh" }, - "toured_at": { + "revoked_by": { "anyOf": [ { "type": "string" @@ -51952,48 +53019,84 @@ "type": "null" } ], - "title": "Toured At", - "description": "when you finished or skipped the welcome tour; until then the web app opens it once you sign in" + "title": "Revoked By" + }, + "hosts": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Hosts", + "description": "the address it reached this install at to join" + }, + "workers": { + "items": { + "$ref": "#/components/schemas/WorkerInfo" + }, + "type": "array", + "title": "Workers", + "description": "the job workers running on it" } }, "additionalProperties": true, "type": "object", "required": [ - "user", - "roles", - "via", - "scope" + "id", + "name", + "role", + "ip" ], - "title": "Me" + "title": "MeshNode" }, - "MeUpdate": { + "MeshNodeChange": { "properties": { "name": { - "type": "string", - "maxLength": 80, - "minLength": 1, - "title": "Name", - "description": "whitespace is collapsed" + "anyOf": [ + { + "type": "string", + "maxLength": 63 + }, + { + "type": "null" + } + ], + "title": "Name" + }, + "namespaces": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array", + "maxItems": 100 + }, + { + "type": "null" + } + ], + "title": "Namespaces", + "description": "the namespaces it serves (empty: every one)" } }, "additionalProperties": false, "type": "object", - "required": [ - "name" - ], - "title": "MeUpdate" + "title": "MeshNodeChange" }, - "Member": { + "MeshNodeConfig": { "properties": { - "account": { - "type": "integer", - "title": "Account" + "config": { + "additionalProperties": true, + "type": "object", + "title": "Config", + "description": "its Nebula config, without its private key" }, - "role": { + "version": { "type": "string", - "title": "Role" + "title": "Version", + "description": "changes whenever the config does" }, - "email": { + "not_after": { "anyOf": [ { "type": "string" @@ -52002,9 +53105,14 @@ "type": "null" } ], - "title": "Email" + "title": "Not After" }, - "name": { + "renew_days": { + "type": "integer", + "title": "Renew Days", + "description": "how many days before its certificate runs out it renews it" + }, + "crt": { "anyOf": [ { "type": "string" @@ -52013,68 +53121,133 @@ "type": "null" } ], - "title": "Name" + "title": "Crt", + "description": "the new certificate (renew)" } }, "additionalProperties": true, "type": "object", "required": [ - "account", - "role" + "config", + "version", + "renew_days" ], - "title": "Member" + "title": "MeshNodeConfig" }, - "MemberSet": { + "MeshRenew": { "properties": { - "email": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Email" + "public_key": { + "type": "string", + "maxLength": 500, + "title": "Public Key", + "description": "its Nebula public key, the same or a new one" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "public_key" + ], + "title": "MeshRenew" + }, + "MeshStatus": { + "properties": { + "enabled": { + "type": "boolean", + "title": "Enabled", + "description": "the mesh is on (mesh.enabled): adding a node turns it on" }, - "account": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Account" + "network": { + "type": "string", + "title": "Network", + "description": "the mesh's addresses (mesh.network)" }, - "role": { + "port": { + "type": "integer", + "title": "Port", + "description": "the UDP port the primary listens on (mesh.port)" + }, + "hosts": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Hosts", + "description": "where other machines reach that port (mesh.hosts); empty: where each joined" + }, + "primary_ip": { + "type": "string", + "title": "Primary Ip", + "description": "this machine's address on the mesh" + }, + "ca": { "anyOf": [ { - "type": "string", - "maxLength": 40, - "minLength": 1, - "description": "viewer, editor, owner or a custom role's name" + "$ref": "#/components/schemas/MeshAuthority" }, { "type": "null" } ], - "title": "Role" + "description": "the mesh's certificate authority, once made" + }, + "nodes": { + "type": "integer", + "title": "Nodes", + "description": "machines on the mesh besides this one" + }, + "removed": { + "type": "integer", + "title": "Removed", + "description": "machines taken off it" + }, + "tokens": { + "type": "integer", + "title": "Tokens", + "description": "join tokens that can still be used" + }, + "nebula": { + "type": "string", + "title": "Nebula", + "description": "the Nebula version Lens runs" + }, + "tools": { + "type": "boolean", + "title": "Tools", + "description": "Nebula's programs are on this server (else they're fetched when first needed)" } }, - "additionalProperties": false, + "additionalProperties": true, "type": "object", - "title": "MemberSet", - "description": "Who (by email, or by account id) and their role; a null role removes them from the namespace." + "required": [ + "enabled", + "network", + "port", + "hosts", + "primary_ip", + "nodes", + "removed", + "tokens", + "nebula", + "tools" + ], + "title": "MeshStatus" }, - "Mention": { + "MeshToken": { "properties": { - "recording_id": { + "id": { "type": "integer", - "title": "Recording Id" + "title": "Id" }, - "title": { + "role": { + "type": "string", + "enum": [ + "worker", + "compute" + ], + "title": "Role" + }, + "name": { "anyOf": [ { "type": "string" @@ -52083,9 +53256,16 @@ "type": "null" } ], - "title": "Title" + "title": "Name" }, - "namespace": { + "namespaces": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Namespaces" + }, + "expires_at": { "anyOf": [ { "type": "string" @@ -52094,14 +53274,26 @@ "type": "null" } ], - "title": "Namespace" + "title": "Expires At" }, - "t0": { + "uses": { "type": "integer", - "title": "T0", + "title": "Uses", + "description": "how many machines may join with it", + "default": 1 + }, + "used": { + "type": "integer", + "title": "Used", + "description": "how many have", "default": 0 }, - "text": { + "expired": { + "type": "boolean", + "title": "Expired", + "default": false + }, + "created_by": { "anyOf": [ { "type": "string" @@ -52110,9 +53302,9 @@ "type": "null" } ], - "title": "Text" + "title": "Created By" }, - "speaker": { + "created_at": { "anyOf": [ { "type": "string" @@ -52121,115 +53313,103 @@ "type": "null" } ], - "title": "Speaker" - }, - "recorded_at": { - "type": "string", - "title": "Recorded At", - "default": "" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "recording_id" - ], - "title": "Mention" - }, - "MentionList": { - "properties": { - "total": { - "type": "integer", - "title": "Total" + "title": "Created At" }, - "items": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Items" + "last_used_at": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Last Used At" } }, "additionalProperties": true, "type": "object", "required": [ - "total", - "items" + "id", + "role" ], - "title": "MentionList" + "title": "MeshToken" }, - "MentionMove": { + "MeshTokenCreate": { "properties": { - "target": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } + "role": { + "type": "string", + "enum": [ + "worker", + "compute" ], - "title": "Target", - "description": "an entity in the same namespace" + "title": "Role", + "description": "worker: runs jobs against this install's database; compute: runs sandboxes only", + "default": "worker" }, - "new_name": { + "name": { "anyOf": [ { - "type": "string" + "type": "string", + "maxLength": 63 }, { "type": "null" } ], - "title": "New Name", - "description": "or a new (or existing) entity by name" + "title": "Name", + "description": "the name it shows as (none: the name the machine sends)" }, - "new_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "New Type", - "default": "TERM" + "namespaces": { + "items": { + "type": "string" + }, + "type": "array", + "maxItems": 100, + "title": "Namespaces", + "description": "the namespaces it serves (empty: every one)" }, - "remove": { - "type": "boolean", - "title": "Remove", - "description": "or say this mention isn't an entity at all", - "default": false + "hours": { + "type": "integer", + "title": "Hours", + "description": "how long the token can be used", + "default": 24 + }, + "uses": { + "type": "integer", + "title": "Uses", + "description": "how many machines may join with it", + "default": 1 } }, "additionalProperties": false, "type": "object", - "title": "MentionMove" + "title": "MeshTokenCreate" }, - "MentionMoved": { + "MeshTokenCreated": { "properties": { - "ok": { - "type": "boolean", - "title": "Ok", - "default": true + "token": { + "$ref": "#/components/schemas/MeshToken" }, - "entity": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Entity" + "secret": { + "type": "string", + "title": "Secret", + "description": "the join token itself, shown this once" + }, + "join_url": { + "type": "string", + "title": "Join Url", + "description": "this install's address the machine joins at" } }, "additionalProperties": true, "type": "object", - "title": "MentionMoved" + "required": [ + "token", + "secret", + "join_url" + ], + "title": "MeshTokenCreated" }, "MessageCreate": { "properties": { diff --git a/threat-model.json b/threat-model.json index 0cb5b997d..b649acf68 100644 --- a/threat-model.json +++ b/threat-model.json @@ -140,7 +140,10 @@ "POST /automations/hooks/{token} (an automation's webhook)", "automations' params and prompts, POST /automations/preview and /automations/variables", "MQTT 1883, syslog 5514, POST /sensors/push/{token}/{stream}", - "SMB share (port 1445 on the host, 4445 in the worker)" + "SMB share (port 1445 on the host, 4445 in the worker)", + "POST /api/v1/mesh/join (a machine joining the mesh)", + "/api/v1/mesh/node/config, /node/renew, /node/beat (a node's own calls, with its node token)", + "POST /api/v1/mesh/tokens, PATCH and DELETE /api/v1/mesh/nodes/{id}, PUT /api/v1/settings/mesh" ], "touches": [ "network", @@ -710,6 +713,33 @@ "caller_must_enforce": "the start script installs only libreoffice or chromium, each a fixed list of signed Debian packages, answers in a folder only root writes, and reads nothing but the name", "provenance": "documented", "source": "docs/microsandbox.md" + }, + { + "entry_point": "POST /api/v1/mesh/join (a machine joining the mesh)", + "parameter": "a join token's id, a nonce, the machine's name and Nebula public key, an HMAC of those keyed with the token's secret, facts about the machine", + "attacker_controllable": "yes", + "component": "optional", + "caller_must_enforce": "no sign-in: the token's secret never crosses the wire, the HMAC is checked in constant time, wrong proofs throttled per address (8 in 15 minutes), a token is spent on use and expires, and the answer is sealed with a key derived from the secret", + "provenance": "documented", + "source": "docs/mesh.md \"Joining\"" + }, + { + "entry_point": "/api/v1/mesh/node/config, /node/renew, /node/beat (a node's own calls, with its node token)", + "parameter": "a public key to certify; a status report: whether Nebula runs, its peers, its machine, its log lines", + "attacker_controllable": "yes", + "component": "optional", + "caller_must_enforce": "the node token is 256 random bits kept only as a hash; a node gets its own config and a certificate for its own address and groups only; reports are capped", + "provenance": "documented", + "source": "docs/mesh.md \"After joining\"" + }, + { + "entry_point": "POST /api/v1/mesh/tokens, PATCH and DELETE /api/v1/mesh/nodes/{id}, PUT /api/v1/settings/mesh", + "parameter": "a node's role, name, namespaces, token hours and uses; the mesh's network, port, hosts, cipher", + "attacker_controllable": "no", + "component": "optional", + "caller_must_enforce": "admin is trusted; audited (mesh.token.create, mesh.join, mesh.node.*); the network can't change once machines have addresses in it", + "provenance": "documented", + "source": "docs/mesh.md \"Settings\"" } ], "environment": { @@ -930,6 +960,14 @@ "discouraged": false, "provenance": "documented", "source": "maintainer ruling, 2026-10" + }, + { + "name": "mesh.enabled", + "default": "off", + "effect": "enables P-MESH", + "discouraged": false, + "provenance": "documented", + "source": "docs/mesh.md \"Off until an admin adds a node\"" } ], "adversaries": { @@ -1415,6 +1453,14 @@ "conditions": "a new key makes stored credentials and encrypted files unreadable (keep keys stable; §1.13)", "provenance": "documented", "source": "docs/deployment.md \"Stable secrets\"" + }, + { + "property": "P-MESH", + "violation_symptom": "info-leak, integrity-bypass", + "severity_tier": "security", + "conditions": "the mesh (mesh.enabled, off until an admin adds a node) admits only machines that joined with a token an admin made, spent on use and expiring, which never crosses the wire (HMAC proof; answer sealed with a key derived from it); each machine's certificate names only its own address, role and namespaces; the rendered firewall opens the database port to worker nodes and the API port to every node on the primary, a node's agent port to the primary only; removing a node blocklists every certificate it was given on every machine and stops its node token; nodes still sign in to Lens as any client does", + "provenance": "documented", + "source": "docs/mesh.md \"What keeps it safe\"" } ], "properties_not_provided": [ diff --git a/threat-model.md b/threat-model.md index 05c6e609f..d6883657d 100644 --- a/threat-model.md +++ b/threat-model.md @@ -250,6 +250,7 @@ machine requires HTTPS, and a changed DB credential when SurrealDB runs as its o | `shares.remote` | off | the web app relays the file shares at its own address (`/s3`, `/dav`; `nextjs-frontend/lens-relay.js`), so the tunnel and HTTPS reach them from the internet; until it's on, the share servers refuse requests carrying `X-Forwarded-Prefix` before any sign-in | Yes | *(documented, docs/file-tree.md "At the web app's address")* | | `tunnel.mode`, `local_llm.enabled`, `telemetry`, `analytics.enabled` | off | outbound tunnel (Cloudflare terminates TLS, Q30); local model server; OTLP export; GA4 Measurement Protocol export of daily counts | Yes | *(documented, docs/remote-access.md "It's off until an admin turns it on")* | | `https.enabled` (and install.sh's `LENS_HTTPS=1`, which Settings › HTTPS can also ask the upgrade agent for) | off | Caddy, fetched at run time, terminates TLS on ports 443/80 in the worker and proxies to the web app; the DNS provider's credentials are written to `data_dir/https/caddy.json` (mode 600), not a command line | Yes | *(documented, docs/https.md "Off by default")* | +| `mesh.enabled` (adding a node in Settings › Nodes or `POST /api/v1/mesh/tokens` turns it on) | off | Lens becomes the certificate authority of a Nebula mesh between its machines: it makes the CA (its key sealed in the database), signs a certificate per machine naming its role and namespaces as groups, and renders each machine's config, whose firewall opens the database port to worker nodes and the API port to every node on the primary, and a node's agent port to the primary only; single-machine installs never turn it on | Yes | *(documented, docs/mesh.md "Off until an admin adds a node")* | | Reachable from the network: install.sh's `LENS_PUBLIC` (kept as `LENS_BIND`), also switched from Settings › Access & embedding, `PUT /api/v1/admin/install` or MCP `set_install_settings` | `1` (`0.0.0.0`) on a server without a desktop, else `0` (`127.0.0.1`) | publishes the web app's port to the network over plain HTTP, and the sensor, file-share and Grafana ports with it unless `LENS_SENSOR_BIND` or `LENS_SHARE_BIND` say otherwise. Admins (an agent with an admin's write-scope token too) can open it without a shell: the host upgrade agent runs install.sh again; audited as `lens.install` | Supported on a trusted LAN only until HTTPS is set up, as the headless-host row | *(documented, docs/updates.md "Setting the machine up again")* | | Edition: install.sh's `LENS_TARGET`, also switched from Settings › Components or `PUT /api/v1/admin/install` | `full` | full ships LibreOffice and Chromium (Ingest's child processes); lean leaves them out | Yes, either | *(documented, docs/updates.md "Setting the machine up again")* | | `components.auto` | on | unpinned-hash pip installs at runtime | Yes | *(maintainer, 2026-10)* | @@ -326,6 +327,9 @@ classified by gate only *(inferred, Q8)*; unread modules are listed in Q34. | `GET /api/v1/chats/{cid}/files/{fid}`: a file the code sandbox shared (`share_sandbox_file`) | a file id; the file's bytes, which code the model wrote produced | yes: the person whose conversation it is; indirectly through content the model reads | data, x-prompt-injection | none; served only to the conversation's person (404 for anyone else, or for an id of another conversation) as an `attachment` with `nosniff` and a `sandbox` content policy, never rendered by Lens; the id is random (96 bits) and checked against the conversation; kept encrypted (AES-256-GCM with a key derived from the server's secret, bound to the file and its conversation), at most 20 a conversation and 25 MB each, and deleted with the conversation or the person's account | *(documented, docs/assistant.md "Code sandbox")* | | Deep research: `/research `, `research: true` on a question, `POST /chats/{cid}/research`, `/research/{id}` (revise, stop, resume, note, podcast), the assistant's and MCP's `start_research`, MCP's `research_status`, and the `research.*` settings | a goal, answers to follow-up questions, plan edits (sub-questions, sources, tool calls, outline); settings (admins) | yes: anyone who may use the assistant, in their own conversations; indirectly through what the run reads, through the model | data, x-prompt-injection, size | none; the plan waits for the person's own approval (P-RESEARCH); the run uses only the read tools of its plan's sources, as the person with their current access, within its tool calls, minutes and budgets; its web searches and page reads don't ask again, bounded by the plan and kept in the ledger; one run per person at a time; the report's claims are checked against what they cite and marked when unsupported | *(documented, docs/assistant.md "Deep research")* | | `ask/NAME.want` in a microsandbox's `/data/.lens/programs` (LibreOffice and Chromium on first use) | a program's name | writable by the Lens user inside the sandbox | x-env-config | the start script, as root, installs only `libreoffice` or `chromium`, each a fixed list of signed Debian packages, and answers in `got/`, which only root writes; it reads nothing from the file but its name, and only deletes any other name or link | *(documented, docs/microsandbox.md "LibreOffice and Chromium")* | +| `POST /api/v1/mesh/join` (a machine joining the mesh) | a join token's id, a nonce, the machine's name and Nebula public key, an HMAC of those keyed with the token's secret, facts about the machine | yes, anyone reaching the web app, once a token exists | x-credential, data | no sign-in: the token's secret never crosses the wire, the HMAC is checked in constant time, wrong proofs count towards a throttle per address (8 in 15 minutes), a token is spent on use (or after `uses`) and expires, and the answer (certificate, config, node token) is sealed with a key derived from the secret, so an eavesdropper on plain http:// learns nothing | *(documented, docs/mesh.md "Joining")* | +| `/api/v1/mesh/node/config`, `/node/renew`, `/node/beat` (a node's own calls, with its node token) | a public key to certify; a status report: whether Nebula runs, its peers, its machine, its log lines | yes, a machine that joined (a removed one is refused) | x-credential, data, x-peer | the node token is 256 random bits kept only as a hash; a node gets its own config and a certificate for its own address and groups only, and can't widen them; reports are capped and kept as its status for admins | *(documented, docs/mesh.md "After joining")* | +| `POST /api/v1/mesh/tokens`, `PATCH` and `DELETE /api/v1/mesh/nodes/{id}`, `PUT /api/v1/settings/mesh` | a node's role, name, namespaces, token hours and uses; the mesh's network, port, hosts, cipher | admin only | x-env-config | admin is trusted; audited (`mesh.token.create`, `mesh.join`, `mesh.node.*`); the network can't change once machines have addresses in it | *(documented, docs/mesh.md "Settings")* | **Stateful postconditions.** A refused or failed one-time secret check consumes nothing; a used one is deleted before Lens trusts it *(documented, docs/authentication.md "works once")*. An upload file only ever holds whole chunks @@ -574,6 +578,7 @@ Paths in the Voided by column are relative to `fastapi_backend/app/`. Searches c | P-BROWSER-GUARD | The Lens extension's side panel reads and acts only on sites the person allowed in it (and the browser granted), and opens an address only on such a site. It asks the person before a click, submit or Enter that the model marks consequential or whose control's words or posting form look so, and, once the answer has read text from outside Lens (`ai.untrusted_asks`), before opening or downloading an address or typing text the person's own message doesn't contain. It never types into password, card or file fields, never reports their values, and shows each action as it happens. | integrity-bypass | security-critical | *(documented, docs/browser-assistant.md "Letting it use your browser")* | Voided by: The consequential check is the model's flag plus a word list (`extensions/browser/src/core/act.js`): a control with no telling words that a misled model doesn't mark runs without asking; synthetic events reach only the page's own handlers. Removing a site from the options stops the side panel acting there, but leaves the browser's access to it for the clipper. Lens sends the ask (`confirm`) and the extension honours it: an extension older than this doesn't ask. | | P-SANDBOX | Code the assistant runs (`run_python`, `run_bash`; `sandbox.enabled`, off by default) runs only for people `sandbox.who` allows (editors and admins, or admins; never viewers), in a sandbox of that conversation's own on the OpenShell gateway, never in Lens's processes. The sandbox gets none of Lens's data, keys or database address: only the code and the files a run copies in, which must be attached to that conversation by that person (25 MB each, 100 MB a run). Its policy allows no egress with `sandbox.network: off`, only pypi.org, files.pythonhosted.org and registry.npmjs.org on 443 with `packages`, and those and the names in `sandbox.hosts` on 80 and 443 with `hosts`; every endpoint is held to public addresses (no private, loopback, link-local or reserved range), so a listed name that resolves to one is refused. A file leaves it only as one of the person's held uploads (25 MB) placed in a namespace by an `import_files` approval, or as a download (`share_sandbox_file`, 25 MB, 20 a conversation) kept encrypted with the conversation, served only to its person as an attachment with `nosniff`, and deleted with the conversation or their account. A sandbox stops after `sandbox.idle_minutes` idle and is deleted after `sandbox.keep_hours` unused or with its conversation. | integrity-bypass | security-critical | *(documented, docs/assistant.md "Code sandbox")* | Voided by: isolation inside the sandbox is OpenShell's (§1.9); `landlock.compatibility: best_effort` runs without Landlock on a kernel that lacks it — `domain/sandbox.py`; whoever the gateway lets in can run sandboxes of their own (in the `sandbox` profile, a holder of its client certificate); a file shared to download is readable by whoever holds `secret.key` or `ARCHIVE_SECRET_KEY` (Q14); what the code prints reaches the model as third-party text (N-PROMPT). | | P-RESEARCH | A research plan (`domain/research.py`) runs only once the person who asked for it approves it: signed in, or with a "yes" in their chat room from someone in `bridge.users`; an API key, an app or an agent (MCP, the assistant) can only decline it, unless an admin turns on `research.agents_skip_review`. The run acts as that person with their access at run time and stops if their account is disabled. It is offered only the read tools of the sources its plan names (never a tool that changes anything), makes at most the plan's tool calls (`research.max_tool_calls`, 40 by default), stops looking things up after `research.max_minutes` and writes up what it found, and checks the budgets of its namespaces and `all` before each stage, waiting or stopping as they say. Its web searches and page reads, and code runs with the network when the plan names the code sandbox, don't ask again after outside text, since the plan approved them. A person has one run going at a time. One process carries a run out at a time (a claim on `research_run:` with a heartbeat every 10 seconds, taken over only after two minutes of silence). Every call it makes is in the activity ledger for the conversation and `research:`. | integrity-bypass | correctness-only | *(documented, docs/assistant.md "Deep research")* | Voided by: `research.agents_skip_review: true` lets an agent's plan run without review — `domain/research.py` `agents_may_approve`; a run's web queries can carry archive text it read, within its plan's tool calls (the misled model of N-PROMPT); a "yes" in a room is the room's people's (N-BRIDGE). | +| P-MESH | The mesh between Lens's machines (`mesh.enabled`, off until an admin adds a node) admits only machines that joined with a token an admin made, which is spent on use and expires; the token never crosses the wire (an HMAC proves it, the answer is sealed with a key derived from it), each machine's certificate names only its own address, role and namespaces, and Nebula's firewall, rendered by Lens, lets worker nodes reach the database port and every node the API port on the primary, and the primary a node's agent port, and nothing else. Removing a node puts every certificate it was given on the blocklist every machine's config carries, and its node token stops working at once. Nodes still sign in to Lens as any client does: the mesh is a transport, not an identity. | info-leak, integrity-bypass | security-critical | *(documented, docs/mesh.md "What keeps it safe")* | Voided by: the join request goes to whatever address is put in the install line, so a wrong address gives a stranger the token's id (not its secret); a worker node that reaches the database port holds the database credential (a trusted peer, Q9); the lighthouse must be reachable on UDP `mesh.port`; Nebula's own isolation is upstream's (§1.9) — `domain/mesh.py`. | ### Worked routing examples diff --git a/threat-model.yaml b/threat-model.yaml index 785cd75e6..a268225c6 100644 --- a/threat-model.yaml +++ b/threat-model.yaml @@ -535,6 +535,33 @@ entry_points: control_kinds: [x-credential, resource-name, x-network-source] caller_must_enforce: "admin enables both; per-person access keys, files added imported as at the ports (shares.add_files); failed WebDAV sign-ins throttled per visitor from X-Forwarded-For as trusted proxies report it" provenance: {kind: documented, source: 'docs/file-tree.md "At the web app''s address"'} + - id: "POST /api/v1/mesh/join (a machine joining the mesh)" + component: optional + parameters: + - name: "a join token's id, a nonce, the machine's name and Nebula public key, an HMAC of those keyed with the token's secret, facts about the machine" + attacker_controllable: true + x-condition: "anyone reaching the web app, once a token exists" + control_kinds: [x-credential, data] + caller_must_enforce: "no sign-in: the token's secret never crosses the wire, the HMAC is checked in constant time, wrong proofs throttled per address (8 in 15 minutes), a token is spent on use and expires, and the answer is sealed with a key derived from the secret" + provenance: {kind: documented, source: 'docs/mesh.md "Joining"'} + - id: "/api/v1/mesh/node/config, /node/renew, /node/beat (a node's own calls, with its node token)" + component: optional + parameters: + - name: "a public key to certify; a status report: whether Nebula runs, its peers, its machine, its log lines" + attacker_controllable: true + x-condition: "a machine that joined (a removed one is refused)" + control_kinds: [x-credential, data, x-peer] + caller_must_enforce: "the node token is 256 random bits kept only as a hash; a node gets its own config and a certificate for its own address and groups only; reports are capped" + provenance: {kind: documented, source: 'docs/mesh.md "After joining"'} + - id: "POST /api/v1/mesh/tokens, PATCH and DELETE /api/v1/mesh/nodes/{id}, PUT /api/v1/settings/mesh" + component: optional + parameters: + - name: "a node's role, name, namespaces, token hours and uses; the mesh's network, port, hosts, cipher" + attacker_controllable: false + x-condition: "admin only" + control_kinds: [x-env-config] + caller_must_enforce: "admin is trusted; audited (mesh.token.create, mesh.join, mesh.node.*); the network can't change once machines have addresses in it" + provenance: {kind: documented, source: 'docs/mesh.md "Settings"'} - id: ".env, archive.yaml, LENS_*, ARCHIVE_SECRET_KEY, RCLONE_BINARY" component: outbound parameters: @@ -1306,6 +1333,14 @@ build_flags: affects_properties: - {property_id: P-SHARES, effect: narrows} provenance: {kind: documented, source: 'docs/file-tree.md "At the web app''s address"'} + - name: "mesh.enabled" + default: "off" + security_relevant: true + maintainer_stance: supported + x-scope: "Lens is the CA of a Nebula mesh between its machines (key sealed in the database); a certificate per machine names its role and namespaces as groups; the rendered firewall opens the database port to worker nodes and the API port to every node on the primary, a node's agent port to the primary only; single-machine installs never turn it on" + affects_properties: + - {property_id: P-MESH, effect: enables} + provenance: {kind: documented, source: 'docs/mesh.md "Off until an admin adds a node"'} - name: "https.enabled" default: "off" security_relevant: true @@ -1836,6 +1871,14 @@ properties_claimed: violation_symptoms: [integrity-bypass] x-voided-by: "the consequential check is the model's flag plus a word list (extensions/browser/src/core/act.js): an unlabelled control a misled model doesn't mark runs without asking; removing a site keeps the browser's access for the clipper; Lens sends the ask (confirm) and an extension older than this doesn't honour it" provenance: {kind: documented, source: 'docs/browser-assistant.md "Letting it use your browser"'} + - id: P-MESH + kind: authentication + components: [optional] + tier: security-critical + conditions: "the mesh (mesh.enabled, off until an admin adds a node) admits only machines that joined with a token an admin made, spent on use and expiring, which never crosses the wire (HMAC proof; answer sealed with a key derived from it); each machine's certificate names only its own address, role and namespaces; the rendered firewall opens the database port to worker nodes and the API port to every node on the primary, a node's agent port to the primary only; removing a node blocklists every certificate it was given on every machine and stops its node token; nodes still sign in to Lens as any client does" + violation_symptoms: [info-leak, integrity-bypass] + x-voided-by: "a wrong address in the install line gives a stranger the token's id (not its secret); a worker node holds the database credential (trusted peer, Q9); the lighthouse must be reachable on UDP mesh.port; Nebula's own isolation is upstream's (domain/mesh.py)" + provenance: {kind: documented, source: 'docs/mesh.md "What keeps it safe"'} - id: P-SANDBOX kind: integrity components: [assistant]