From 420c34ff3e38211b0cea7506b84d2e6aea6d92ed Mon Sep 17 00:00:00 2001 From: Adeel Ahmad Date: Sat, 17 Oct 2026 09:45:06 +0000 Subject: [PATCH] feat(feeds): private RSS and podcast feeds with API and MCP A namespace publishes what's in it as an RSS or iTunes podcast feed at a tokenized address that feed readers and podcast apps follow: resources, podcast episodes (their audio as enclosures, with byte ranges), timeline activities and text. Editors make feeds and add to them through the API (/api/v1/feeds) and the MCP tools list_feeds, create_feed and publish_to_feed. What a feed lists is bounded by who reads its namespace and never a vault; the token is found by its hash, rotated on demand, and the feed asks directories and crawlers to keep out. Threat model: P-FEEDS. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01CDEiKGoyQX8Vmnv9bi5JpD --- CHANGELOG.md | 7 + README.md | 7 +- docs/feeds.md | 72 + docs/mcp.md | 5 +- docs/requirements.md | 1 + fastapi_backend/app/api/mcp_tools.py | 96 + fastapi_backend/app/api/v1/router.py | 2 + fastapi_backend/app/api/v1/routes/feeds.py | 193 + fastapi_backend/app/domain/store.py | 8 + fastapi_backend/app/domain/syndication.py | 644 + fastapi_backend/app/schemas/feeds.py | 95 + fastapi_backend/tests/api/test_feeds.py | 214 + fastapi_backend/tests/api/test_mcp.py | 2 + mkdocs.yml | 1 + nextjs-frontend/app/openapi-client/index.ts | 62 + nextjs-frontend/app/openapi-client/sdk.gen.ts | 205 + .../app/openapi-client/types.gen.ts | 720 + nextjs-frontend/openapi.json | 15863 +++++++++------- threat-model.json | 20 +- threat-model.md | 3 + threat-model.yaml | 32 +- 21 files changed, 10944 insertions(+), 7308 deletions(-) create mode 100644 docs/feeds.md create mode 100644 fastapi_backend/app/api/v1/routes/feeds.py create mode 100644 fastapi_backend/app/domain/syndication.py create mode 100644 fastapi_backend/app/schemas/feeds.py create mode 100644 fastapi_backend/tests/api/test_feeds.py diff --git a/CHANGELOG.md b/CHANGELOG.md index aac866543..3132d3d40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ The backend (`fastapi_backend`) and the frontend (`nextjs-frontend`) are version ## Unreleased +- **Published feeds.** A namespace publishes a private RSS feed, or a podcast feed with Apple Podcasts' tags, that any + feed reader or podcast app follows at its address: resources (with their audio as the enclosure), podcast episodes + once they're made (with the sources they cite), timeline activities and text. A feed holds only what everyone who + reads its namespace can already read, never a vault's; its token is all a reader needs, so it's kept sealed, a new + one stops the old address at once, and the feed asks directories and search engines not to list it. Editors make and + fill feeds with `POST /api/v1/feeds` and `POST /api/v1/feeds/{id}/items`; agents use the MCP tools `list_feeds`, + `create_feed` and `publish_to_feed` ([Published feeds](docs/feeds.md)). - **Specs from transcripts.** Turn a voice session or a meeting into a technical spec, saved as a note linked to it: the model writes the spec, then lists every named decision, every "no" and "not that, this", every constraint and every gap the speaker left to decide later, each with its quote and a link to the moment it was said; a quote the diff --git a/README.md b/README.md index 3532f9807..b30acc719 100644 --- a/README.md +++ b/README.md @@ -139,8 +139,11 @@ listed under [In progress](#in-progress), and what comes next under [Planned](#p are your own) and each note shows the notes it's inside and the ones inside it, with today's note one click away, templates to start from, a search by their words, a download as Markdown, and Undo and Recently deleted instead of a confirm. Export an asset or a collection as an evidence PDF with everything Lens found about it, or the parts you - pick. ([Podcasts](docs/podcasts.md), [specs from transcripts](docs/notes.md#specs-from-transcripts), - [notes](docs/notes.md), [evidence PDFs](docs/api.md#evidence-pdfs); [checks](docs/requirements.md#learn-from-it)) + pick. Publish a namespace's resources, episodes, timeline activities or text as a private RSS feed or a podcast + feed that any feed reader or podcast app follows. ([Podcasts](docs/podcasts.md), + [specs from transcripts](docs/notes.md#specs-from-transcripts), [notes](docs/notes.md), + [evidence PDFs](docs/api.md#evidence-pdfs), [published feeds](docs/feeds.md); + [checks](docs/requirements.md#learn-from-it)) - **Automate it.** Pipelines and workflows on a canvas, routines on a schedule, batch runs over a collection, and notifications to webhooks, Slack, Discord and Matterbridge. Everything that happens in Lens (new assets, emails, calendar events, files, what people say to Lens, sensor readings, notes, graph changes, runs, budget warnings) is kept diff --git a/docs/feeds.md b/docs/feeds.md new file mode 100644 index 000000000..eff497aac --- /dev/null +++ b/docs/feeds.md @@ -0,0 +1,72 @@ +# Published feeds (RSS and podcasts) + +**Status: in progress.** Feeds, their private addresses, the API and the MCP tools are built. Routine workflow nodes +that pick part of the graph or the timeline and publish it, and the Feeds page in the web app, come next. + +A namespace can publish what's in it as a feed that any feed reader or podcast app follows: new resources, podcast +episodes, things on the timeline, or text a person or an agent wrote. Each feed has a private address; add it to the +app on your phone and new items arrive there. + +## Two kinds + +| Kind | Lists | For | +|---|---|---| +| `rss` | everything added to it: resources, episodes, timeline activities and text | feed readers | +| `podcast` | items with audio: podcast episodes once their audio is made, and resources that have audio (or video) | podcast apps (Apple Podcasts, Pocket Casts, Overcast, AntennaPod and the rest) | + +Both are RSS 2.0. A podcast feed adds Apple Podcasts' tags (author, category, explicit, artwork, each episode's +duration) and each item's audio as its enclosure, which podcast apps download with byte ranges. + +## What an item shows + +- **A resource**: its title and summary as they are now, a link to its page in the web app, and its audio when it + has some. A resource deleted since drops out of the feed. +- **A podcast episode** ([Podcasts](podcasts.md)): listed once it's made. Its description is the outline's summary, + then the sources it cites, each with a link, so a listener can check every claim. In a podcast feed it's listed + once its audio is made; in an RSS feed a script-only episode is listed as text. +- **A timeline activity** ([Timeline](timeline.md)): its one-line summary, when it happened, its kind as the + category, and a link to what it's about. +- **Text**: a title, text and a link (http or https), such as a digest a workflow or an agent wrote. + +An item is listed once per feed: adding the same resource or activity again does nothing, so a routine that runs +again adds only what's new. A feed lists its newest items (50 by default, up to 500) and keeps its newest 1000. + +## Private by default + +- A feed's address carries a token (`/api/v1/feeds/public/lfd_...`). The token is all a reader needs, so share the + address as you would a password. Readers of the feed's namespace see the address in the web app and the API; a new + address (**rotate**) stops the old one at once. +- What a feed shows is bounded by who can already read its namespace: an item's resource or activity is in that + namespace, or in one that everyone who reads the feed's namespace can read too, and never in a + [vault](encryption.md). A vault can't publish a feed, since its resources open only with a passkey. +- A feed asks podcast directories not to list it (`itunes:block`, `podcast:locked`) and search engines not to index + it (`X-Robots-Tag`), and its address isn't sent on to other sites (`Referrer-Policy: no-referrer`). +- Text in an item is escaped for the XML and again for readers that show a description as HTML, so a title or a + transcript can't add markup or scripts to a reader. +- Nothing is published until someone makes a feed and adds to it, and a feed changes nothing else in Lens. + +Feed readers poll; the feed answers `304 Not Modified` when nothing changed (its `ETag`), and notes when a reader +last read it (`fetched_at`, at most once a minute), so the web app can show that a podcast app is subscribed. + +## API and MCP + +| | | +|---|---| +| `GET /api/v1/feeds` | feeds in the namespaces you can read (or `?namespace=`), each with its private address (`url`), how many items it holds and when a reader last read it | +| `POST /api/v1/feeds` | make a feed (editors of its namespace): `namespace`, `title`, `kind` (`rss` or `podcast`), and optionally `description`, `author`, `language`, `category`, `explicit`, `image` (an `https://` address) and `max_items`. Audited as `feed.create` | +| `GET /api/v1/feeds/{id}` | one feed | +| `PATCH /api/v1/feeds/{id}` | change its settings (editors) | +| `DELETE /api/v1/feeds/{id}` | delete it and its items (editors); its address stops working. What the items were about stays | +| `POST /api/v1/feeds/{id}/token` | a new private address (editors); the old one stops working | +| `GET /api/v1/feeds/{id}/items` | its items, newest first | +| `POST /api/v1/feeds/{id}/items` | add `recordings` (resources and episodes), `activities` (timeline activity ids) and `texts` (`{title, summary, link, guid}`) (editors, who can read each one). Answers what was `added`, how many were there `already`, and what was `refused`, with why. Audited as `feed.publish` | +| `DELETE /api/v1/feeds/{id}/items/{item}` | take an item out (editors) | +| `GET /api/v1/feeds/public/{token}` | the feed itself, as feed readers and podcast apps read it: no session, the token is the credential | +| `GET /api/v1/feeds/public/{token}/items/{item}/audio` | an item's audio, with byte ranges (and `HEAD`) | + +Agents use the MCP tools `list_feeds` (each feed's address, or one feed with its newest items), `create_feed` and +`publish_to_feed` ([MCP](mcp.md)). + +Refine later: artwork Lens makes for a feed without an `image`; Atom and JSON Feed alongside RSS; chapters and +transcripts in a podcast feed (`podcast:transcript`); an automation action that publishes to a feed when something +happens. diff --git a/docs/mcp.md b/docs/mcp.md index 261fb36c8..cd80f11af 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -99,6 +99,9 @@ For an app that speaks OpenAI's API rather than MCP, the namespace can also answ | `export_chat` | one of them as Markdown or JSON ([Copy and export](assistant.md#copy-and-export)): the version showing, one `message`, every version (`all_versions`) or OpenAI's `{"messages": [...]}` shape (`as_messages`) | | `create_podcast` | make a two-host learning [episode](podcasts.md) about assets or lines in them, with an angle, a length and a style; it's made in the background. Needs a write-scope token and editor access where it goes | | `get_podcast` | an episode: how far it has got, its script with each line's speaker and the sources it cites (links), and what the fact-check changed | +| `list_feeds` | the RSS and podcast [feeds](feeds.md) your namespaces publish, each with its private address and how many items it holds; with `feed_id`, one feed and its newest items | +| `create_feed` | make an RSS feed or a podcast feed in a namespace, for feed readers and podcast apps. Needs a write-scope token and editor access | +| `publish_to_feed` | add resources, episodes, timeline activities and a text item to a feed; what's there already isn't added twice, and what may not show there comes back refused, with why. Needs a write-scope token and editor access | | `write_spec` | write a technical [spec](notes.md#specs-from-transcripts) from a recording's transcript as a note linked to it: every decision, no and constraint in the speaker's own words with links to when they said them, and the gaps left to decide later; it's written in the background. Needs a write-scope token and the right to process the recording | | `get_spec` | how a recording's spec is coming (`writing`, `ready` or `failed` with why), its note's id and link, and how many decisions, things turned down, constraints and gaps it holds and quotes the transcript doesn't | | `nsfw_settings` | how [NSFW classification](nsfw.md) works in a namespace: on or off, the threshold, how flagged resources show, and how many are classified, flagged and not classified yet | @@ -146,7 +149,7 @@ Every tool reads, except `suggest_topic`, which adds suggestions people accept o which records an undoable change (proposed by default), `undo_graph_change`, `edit_entity`, `edit_topic`, `merge_topics`, `delete_topic` and `undo_topic_change`, which curate entities and topics as an editor does in the web app (merges and deletes can be undone), `write_note`, which adds a note, `create_podcast`, which -queues an episode, `write_spec`, which queues a spec, `set_nsfw` and `mark_nsfw`, which change [NSFW classification](nsfw.md) (owners or admins, and +queues an episode, `create_feed` and `publish_to_feed`, which make and fill a [published feed](feeds.md), `write_spec`, which queues a spec, `set_nsfw` and `mark_nsfw`, which change [NSFW classification](nsfw.md) (owners or admins, and editors), `set_namespace_integrations`, which turns a namespace's own MCP server or chat completions on or off (owners), `set_picture_descriptions`, which changes what describes pictures (admins), `set_file_storage`, which changes where new files are kept (admins), and `set_monitoring`, `set_sandbox_gateway` (the [code sandbox](assistant.md#code-sandbox)'s gateway) and `set_install_settings`, which have the machine change how Lens runs (admins). diff --git a/docs/requirements.md b/docs/requirements.md index b8552cd7e..2a1462f17 100644 --- a/docs/requirements.md +++ b/docs/requirements.md @@ -164,6 +164,7 @@ request, to another check that proves the same thing; loosening a requirement or | Templates a note starts from, and a copy of any note | [test_notebook.py](https://github.com/adeelahmad/lense/blob/main/fastapi_backend/tests/api/test_notebook.py) `test_templates_and_copies`; [notes-templates.test.tsx](https://github.com/adeelahmad/lense/blob/main/nextjs-frontend/__tests__/notes-templates.test.tsx); [notes-tree.test.tsx](https://github.com/adeelahmad/lense/blob/main/nextjs-frontend/__tests__/notes-tree.test.tsx) `makes a copy beside the note and opens it` | | A note shows the notes it's inside and the notes inside it, to people and agents | [test_notebook.py](https://github.com/adeelahmad/lense/blob/main/fastapi_backend/tests/api/test_notebook.py) `test_path_and_children`, `test_assistant_keeps_notes`; [test_mcp.py](https://github.com/adeelahmad/lense/blob/main/fastapi_backend/tests/api/test_mcp.py) `test_note_tools`; [note-page.test.tsx](https://github.com/adeelahmad/lense/blob/main/nextjs-frontend/__tests__/note-page.test.tsx) | | Undo and Recently deleted instead of a confirm | [test_notebook.py](https://github.com/adeelahmad/lense/blob/main/fastapi_backend/tests/api/test_notebook.py) `test_recently_deleted`; [notes-delete.test.tsx](https://github.com/adeelahmad/lense/blob/main/nextjs-frontend/__tests__/notes-delete.test.tsx) | +| A namespace publishes a private RSS feed or a podcast feed (Apple Podcasts' tags, audio with byte ranges) of resources, episodes, timeline activities and text, holding only what its readers can already read; through the API and MCP | [test_feeds.py](https://github.com/adeelahmad/lense/blob/main/fastapi_backend/tests/api/test_feeds.py) `test_making_filling_and_reading_a_feed`, `test_a_podcast_feed_lists_what_has_audio`, `test_timeline_activities_in_a_feed`, `test_vaults_and_settings`, `test_agents_use_feeds` | | An asset or a collection exported as an evidence PDF, whole or the parts you pick | [test_evidence.py](https://github.com/adeelahmad/lense/blob/main/fastapi_backend/tests/api/test_evidence.py) `test_a_collection_as_one_evidence_pdf`, `test_everything_lens_found_goes_in`, `test_picking_the_parts`; [evidence-parts.test.tsx](https://github.com/adeelahmad/lense/blob/main/nextjs-frontend/__tests__/evidence-parts.test.tsx) | ## Automate it diff --git a/fastapi_backend/app/api/mcp_tools.py b/fastapi_backend/app/api/mcp_tools.py index e6ca14a38..41d813d3f 100644 --- a/fastapi_backend/app/api/mcp_tools.py +++ b/fastapi_backend/app/api/mcp_tools.py @@ -2045,6 +2045,102 @@ def get_podcast(ctx: Context, episode_id: int) -> dict[str, Any]: ) +# ---------- published feeds (docs/feeds.md) ---------- +def _feed_out(ctx: Context, row: dict[str, Any]) -> dict[str, Any]: + from app.domain import syndication + + f = syndication.view(ctx.db, ctx.cfg, row, ctx.web) + keep = ("id", "kind", "title", "namespace", "description", "url", "page", "items", "last_item_at", "fetched_at") + return store.clean({("feed_id" if k == "id" else k): f.get(k) for k in keep}) + + +@tool( + "list_feeds", + "List published feeds", + "The RSS and podcast feeds the person's namespaces publish (docs/feeds.md): each one's kind, title, namespace, how " + "many items it holds, and its private address, which feed readers and podcast apps subscribe to. Anyone with the " + "address can read the feed, so give it only to the person. With feed_id, one feed and its newest items.", + Arg("namespace", "string", "only this namespace's feeds"), + Arg("feed_id", "integer", "one feed, with its newest items"), +) +def list_feeds(ctx: Context, namespace: str | None, feed_id: int | None) -> dict[str, Any]: + from app.domain import syndication + + if feed_id is not None: + row = syndication.get(ctx.db, feed_id) # KeyError: not found + ctx.acl.need(row["space"]) + shown = [ + store.clean({k: i.get(k) for k in ("id", "kind", "title", "summary", "link", "published_at", "recording")}) + | ({"url": ctx.link(i["recording"])} if i.get("recording") is not None else {}) + for i in syndication.items(ctx.db, feed_id, 20) + ] + return {**_feed_out(ctx, row), "newest": shown} + spaces = {ctx.acl.namespace(namespace)} if namespace else ctx.acl.readable() + return {"feeds": [_feed_out(ctx, f) for f in syndication.list_feeds(ctx.db, spaces)]} + + +@tool( + "create_feed", + "Make a published feed", + "Make an RSS feed (any items) or a podcast feed (items with audio, with Apple Podcasts' tags) in a namespace, for " + "feed readers and podcast apps to follow at its private address; fill it with publish_to_feed, or with a routine " + "whose workflow publishes to it. Needs a write-scope token and editor access to the namespace.", + Arg("namespace", "string", "the namespace it belongs to", required=True), + Arg("title", "string", "its title", required=True, max_length=200), + Arg("kind", "string", "rss or podcast", enum=("rss", "podcast"), default="rss"), + Arg("description", "string", "what it's about", max_length=2000), + writes=True, +) +def create_feed(ctx: Context, namespace: str, title: str, kind: str, description: str | None) -> dict[str, Any]: + from app.domain import syndication + + if not ctx.user.can_write: + raise ToolError("this token is read-only: ask for a token with the write scope to make feeds") + sid = ctx.acl.namespace(namespace, "editor") + fid = syndication.create(ctx.db, ctx.cfg, sid, title, kind, by=ctx.user.email, description=description) + auth.audit(ctx.db, ctx.user.as_audit(), "feed.create", f"feed:{fid}", {"kind": kind, "via": "mcp"}) + return _feed_out(ctx, syndication.get(ctx.db, fid)) + + +@tool( + "publish_to_feed", + "Add to a published feed", + "Add resources (podcast episodes too: a podcast feed lists them once their audio is made), timeline activities " + "(by id, as timeline gives them) and a text item (title, text, link) to a feed made with create_feed. What's in " + "it already isn't added twice; what may not show there (it's in a namespace not everyone who reads the feed can " + "read) comes back in `refused`, with why. Needs a write-scope token and editor access to the feed's namespace.", + Arg("feed_id", "integer", "the feed", required=True), + Arg("recording_ids", "integer[]", "resources or episodes to list", maximum=200), + Arg("activity_ids", "string[]", "timeline activities to list"), + Arg("title", "string", "a text item's title", max_length=200), + Arg("text", "string", "a text item's text", max_length=4000), + Arg("link", "string", "a text item's link (http or https)", max_length=2000), + writes=True, +) +def publish_to_feed( + ctx: Context, + feed_id: int, + recording_ids: list[int] | None, + activity_ids: list[str] | None, + title: str | None, + text: str | None, + link: str | None, +) -> dict[str, Any]: + from app.api.v1.routes import feeds as feed_routes + from app.schemas.feeds import FeedPublish + + if not ctx.user.can_write: + raise ToolError("this token is read-only: ask for a token with the write scope to add to feeds") + texts = [store.clean({"title": title, "summary": text, "link": link})] if title or text else [] + if not recording_ids and not activity_ids and not texts: + raise ToolError("give recording_ids, activity_ids, or a title or text to add") + try: + body = FeedPublish(recordings=recording_ids or [], activities=activity_ids or [], texts=texts) + except ValueError as e: + raise ToolError(str(e)) from None + return feed_routes.publish(ctx.acl, ctx.user, ctx.db, ctx.cfg, feed_id, body).model_dump() + + # ---------- specs from transcripts (docs/notes.md#specs-from-transcripts) ---------- @tool( "write_spec", diff --git a/fastapi_backend/app/api/v1/router.py b/fastapi_backend/app/api/v1/router.py index 701471d63..e329927bd 100644 --- a/fastapi_backend/app/api/v1/router.py +++ b/fastapi_backend/app/api/v1/router.py @@ -28,6 +28,7 @@ extensions, external, fedora, + feeds, fields, files, filetree, @@ -150,6 +151,7 @@ voice, vaults, podcasts, + feeds, specs, ): api_router.include_router(module.router) diff --git a/fastapi_backend/app/api/v1/routes/feeds.py b/fastapi_backend/app/api/v1/routes/feeds.py new file mode 100644 index 000000000..7a09183b6 --- /dev/null +++ b/fastapi_backend/app/api/v1/routes/feeds.py @@ -0,0 +1,193 @@ +"""Published feeds (app/domain/syndication.py, docs/feeds.md): RSS and podcast feeds a namespace's editors make and +fill (and routines fill through a workflow's publish nodes), and the private addresses feed readers and podcast apps +read them at. The token in a feed's address is all a reader needs.""" + +from __future__ import annotations + +import hashlib +from typing import Any + +from fastapi import APIRouter, HTTPException, Query, Request, Response + +from app.api.deps import Access, Acl, Cfg, CurrentUser, Db, Principal, Writer, domain_errors, web_origin +from app.api.v1.routes import activities as activity_routes +from app.api.v1.routes import recordings as recording_routes +from app.domain import auth, events, syndication +from app.domain.store import DB +from app.schemas.common import Ok +from app.schemas.feeds import Feed, FeedCreate, FeedItem, FeedPublish, FeedPublished, FeedSettings + +router = APIRouter(prefix="/feeds", tags=["feeds"]) +# a feed's address carries its token: kept out of other sites' logs, and out of search engines +PRIVATE = {"Referrer-Policy": "no-referrer", "X-Robots-Tag": "noindex, nofollow"} + + +def _feed(acl: Access, db: DB, fid: int, role: str = "viewer") -> dict[str, Any]: + """The feed, if this person has `role` in its namespace (404 when they can't read it).""" + try: + feed = syndication.get(db, fid) + except KeyError: + raise HTTPException(404, "not found") from None + acl.need(feed["space"], role) + return feed + + +def _out(db: DB, cfg: dict[str, Any], request: Request, feed: dict[str, Any]) -> Feed: + return Feed.model_validate(syndication.view(db, cfg, feed, web_origin(request))) + + +# ---------- what feed readers read (no session: the token is the credential) ---------- +@router.get( + "/public/{token}", + response_class=Response, + responses={200: {"content": {"application/rss+xml": {}}}, 304: {"description": "unchanged since the reader's copy"}}, +) +def read_feed(token: str, request: Request, db: Db, cfg: Cfg) -> Response: + """A feed as RSS 2.0, with Apple Podcasts' tags for a podcast feed: what feed readers and podcast apps subscribe + to. No session: the token in the address is the credential (404 for any other). Answers 304 to a reader whose + copy (If-None-Match) is current.""" + try: + feed = syndication.by_token(db, token) + except KeyError: + raise HTTPException(404, "not found") from None + body = syndication.render_xml(db, cfg, feed, web_origin(request), token) + tag = '"' + hashlib.sha256(body).hexdigest()[:32] + '"' + if request.method == "GET": + syndication.seen(db, feed) + headers = {**PRIVATE, "ETag": tag, "Cache-Control": f"private, max-age={syndication.TTL_MINUTES * 60}"} + if tag in [t.strip() for t in (request.headers.get("if-none-match") or "").split(",")]: + return Response(status_code=304, headers=headers) + return Response(body, media_type="application/rss+xml; charset=utf-8", headers=headers) + + +@router.get( + "/public/{token}/items/{iid}/audio", + response_class=Response, + responses={200: {"content": {"audio/*": {}}}, 206: {"description": "a byte range"}}, +) +def read_feed_audio(token: str, iid: int, request: Request, db: Db, cfg: Cfg) -> Response: + """An item's audio (or video), with byte ranges, as podcast apps download it. The feed's token is the credential.""" + try: + feed = syndication.by_token(db, token) + rid, rec = syndication.item_recording(db, feed, iid) + except KeyError: + raise HTTPException(404, "not found") from None + got = recording_routes.serve_audio(db, cfg, rec, rid, request) + got.headers.update(PRIVATE) + if request.method == "HEAD": # the headers alone; nothing is read or decrypted + return Response(status_code=got.status_code, headers=dict(got.headers)) + return got + + +# podcast apps check an enclosure with HEAD before they download it (the same answers, without a body) +router.add_api_route("/public/{token}", read_feed, methods=["HEAD"], include_in_schema=False) +router.add_api_route("/public/{token}/items/{iid}/audio", read_feed_audio, methods=["HEAD"], include_in_schema=False) + + +# ---------- managing feeds (signed in) ---------- +@router.get("") +def list_feeds(request: Request, acl: Acl, user: CurrentUser, db: Db, cfg: Cfg, namespace: str | None = None) -> list[Feed]: + """Feeds in the namespaces you can read (or one of them), each with its private address.""" + spaces = acl.readable() + if namespace: + spaces = {acl.namespace(namespace)} + return [_out(db, cfg, request, f) for f in syndication.list_feeds(db, spaces)] + + +@router.post("", status_code=201) +def create_feed(body: FeedCreate, request: Request, acl: Acl, user: Writer, db: Db, cfg: Cfg) -> Feed: + """A new feed in a namespace you edit, with its private address. Audited as `feed.create`.""" + sid = acl.namespace(body.namespace, "editor") + opts = body.model_dump(exclude={"namespace", "title", "kind"}, exclude_none=True) + with domain_errors(): + fid = syndication.create(db, cfg, sid, body.title, body.kind, by=user.email, **opts) + auth.audit(db, user.as_audit(), "feed.create", f"feed:{fid}", {"kind": body.kind}) + return _out(db, cfg, request, syndication.get(db, fid)) + + +@router.get("/{fid}") +def get_feed(fid: int, request: Request, acl: Acl, user: CurrentUser, db: Db, cfg: Cfg) -> Feed: + return _out(db, cfg, request, _feed(acl, db, fid)) + + +@router.patch("/{fid}") +def update_feed(fid: int, body: FeedSettings, request: Request, acl: Acl, user: Writer, db: Db, cfg: Cfg) -> Feed: + """Change a feed's settings (editors of its namespace). Fields left out stay as they are.""" + _feed(acl, db, fid, "editor") + with domain_errors(): + syndication.update(db, fid, **body.model_dump(exclude_unset=True)) + return _out(db, cfg, request, syndication.get(db, fid)) + + +@router.delete("/{fid}") +def delete_feed(fid: int, acl: Acl, user: Writer, db: Db) -> Ok: + """Delete a feed and its items (editors): its address stops working at once. What the items were about stays. + Audited as `feed.delete`.""" + _feed(acl, db, fid, "editor") + syndication.remove(db, fid) + auth.audit(db, user.as_audit(), "feed.delete", f"feed:{fid}") + return Ok() + + +@router.post("/{fid}/token") +def rotate_feed_token(fid: int, request: Request, acl: Acl, user: Writer, db: Db, cfg: Cfg) -> Feed: + """A new private address for a feed (editors): the old one stops working at once, so readers subscribed to it + need the new one. Audited as `feed.token`.""" + _feed(acl, db, fid, "editor") + syndication.rotate(db, cfg, fid) + auth.audit(db, user.as_audit(), "feed.token", f"feed:{fid}") + return _out(db, cfg, request, syndication.get(db, fid)) + + +@router.get("/{fid}/items") +def list_feed_items( + fid: int, acl: Acl, user: CurrentUser, db: Db, limit: int = Query(50, ge=1, le=200), offset: int = Query(0, ge=0) +) -> list[FeedItem]: + """A feed's items, newest first.""" + _feed(acl, db, fid) + return [FeedItem.model_validate(i) for i in syndication.items(db, fid, limit, offset)] + + +def publish(acl: Access, user: Principal, db: DB, cfg: dict[str, Any], fid: int, body: FeedPublish) -> FeedPublished: + """Add resources, activities and text to a feed, for this person: an editor of the feed's namespace, who can read + every resource and activity named.""" + feed = _feed(acl, db, fid, "editor") + entries: list[dict[str, Any]] = [] + refused = [] + for rid in dict.fromkeys(body.recordings): + acl.recording(rid) # 404 for one they can't see + entries.append({"recording": rid}) + if body.activities: + found = events.get_many(db, cfg, body.activities, activity_routes.viewer(db, user, acl)) + for aid in dict.fromkeys(body.activities): + if aid in found: + entries.append({"activity": found[aid]}) + else: + refused.append({"what": f"activity {aid}", "why": "not found"}) + entries += [t.model_dump(exclude_none=True) for t in body.texts] + if not entries and not refused: + raise HTTPException(400, "name resources, activities or text to add") + out = syndication.publish(db, cfg, feed["id"], entries, by=user.email) + out["refused"] = refused + out["refused"] + if out["added"]: + auth.audit(db, user.as_audit(), "feed.publish", f"feed:{fid}", {"items": out["added"]}) + return FeedPublished.model_validate(out) + + +@router.post("/{fid}/items") +def publish_to_feed(fid: int, body: FeedPublish, acl: Acl, user: Writer, db: Db, cfg: Cfg) -> FeedPublished: + """Add resources (podcast episodes too), timeline activities and text items to a feed (editors of its namespace). + What's already in it isn't added twice; what may not show there (it's in a namespace not everyone who reads the + feed can read) is refused, with why. Audited as `feed.publish`.""" + return publish(acl, user, db, cfg, fid, body) + + +@router.delete("/{fid}/items/{iid}") +def remove_feed_item(fid: int, iid: int, acl: Acl, user: Writer, db: Db) -> Ok: + """Take an item out of a feed (editors). A routine may add it again; what it was about stays.""" + _feed(acl, db, fid, "editor") + try: + syndication.remove_item(db, fid, iid) + except KeyError: + raise HTTPException(404, "not found") from None + return Ok() diff --git a/fastapi_backend/app/domain/store.py b/fastapi_backend/app/domain/store.py index 5d74ee50c..cfc234022 100644 --- a/fastapi_backend/app/domain/store.py +++ b/fastapi_backend/app/domain/store.py @@ -1458,6 +1458,14 @@ def close(self): # what a podcast episode was made from and of, beside its recording (app/domain/podcasts.py): podcast: "DEFINE TABLE IF NOT EXISTS podcast SCHEMALESS", "DEFINE INDEX IF NOT EXISTS podcast_space ON podcast FIELDS space", + # published RSS and podcast feeds (app/domain/syndication.py): feed:, its token kept sealed and as a hash, and + # its items, one per feed for what each is about (key: ":") + "DEFINE TABLE IF NOT EXISTS feed SCHEMALESS", + "DEFINE INDEX IF NOT EXISTS feed_token ON feed FIELDS token_hash UNIQUE", + "DEFINE INDEX IF NOT EXISTS feed_space ON feed FIELDS space", + "DEFINE TABLE IF NOT EXISTS feed_item SCHEMALESS", + "DEFINE INDEX IF NOT EXISTS feed_item_feed ON feed_item FIELDS feed", + "DEFINE INDEX IF NOT EXISTS feed_item_key ON feed_item FIELDS key UNIQUE", "DEFINE TABLE IF NOT EXISTS output SCHEMALESS", "DEFINE INDEX IF NOT EXISTS output_rec ON output FIELDS recording", "DEFINE TABLE IF NOT EXISTS chat SCHEMALESS", diff --git a/fastapi_backend/app/domain/syndication.py b/fastapi_backend/app/domain/syndication.py new file mode 100644 index 000000000..87f12aa00 --- /dev/null +++ b/fastapi_backend/app/domain/syndication.py @@ -0,0 +1,644 @@ +"""Published feeds (docs/feeds.md): RSS 2.0 feeds and podcast feeds that Lens writes, for feed readers and podcast apps +to follow. Routines fill them through a workflow's publish nodes; people and agents add to them through the API and MCP. + +A feed (`feed:`) belongs to one namespace: its editors make, change and delete it, and its readers see it. Its kind +is `rss` (any items) or `podcast` (RSS with Apple Podcasts' itunes tags, listing only items with audio). It is +private: its address carries a token (`lfd_...`), which is all a reader needs. The token is kept sealed with the server's +key, so the namespace's readers can see the address again, and is found by its hash; `rotate` gives a new one and the +old address stops working at once. A feed asks podcast directories not to list it (itunes:block, podcast:locked) and +search engines not to index it. + +An item (`feed_item:`) is one of: + +- `asset`: a resource (a recording, a document, a page...): its title and summary, a link to its page in the web app, + and its audio (or video) as the enclosure when it has some; +- `episode`: a podcast episode (podcasts.py), listed once it's made: its audio as the enclosure, the outline's + summary, and the sources it cites; +- `activity`: something on the timeline (events.py): its summary, when it happened, its kind, and a link to what it is + about; +- `text`: a title, text and a link that someone (or a workflow) wrote. + +An item is kept once per feed for what it's about (its `guid`), so a routine that runs again adds only what's new; the +newest KEEP items are kept. What an item may show is bounded by who can already read the feed's namespace: its asset or +activity is in that namespace, or in one that everyone who reads the feed's namespace can read too, and never in a +vault. A resource is read when the feed is (its title as it is now, its audio if it's still there), so one deleted +since drops out. Text is written escaped twice over: once for the XML, and once for readers that show an item's +description as HTML, so nothing in it can become markup. +""" + +from __future__ import annotations + +import datetime as dt +import email.utils +import hashlib +import html +import os +import pathlib +import re +import secrets +import urllib.parse +from xml.sax.saxutils import escape, quoteattr + +from . import events, keyring, podcasts, render, settings, store, video + +R = store.R +KINDS = ("rss", "podcast") +ITEM_KINDS = ("asset", "episode", "activity", "text") +TOKEN_PREFIX = "lfd_" # recognisable in logs and secret scanners +TOKEN_RX = re.compile(r"^lfd_[A-Za-z0-9_-]{20,64}$") +PATH = "/api/v1/feeds/public/" +LANG_RX = re.compile(r"^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$") +DEFAULTS = {"language": "en", "category": "Education", "explicit": False, "max_items": 50} +MAX_ITEMS = 500 # the most items a feed lists +KEEP = 1000 # items kept per feed, newest first +TITLE_MAX, TEXT_MAX, DESCRIPTION_MAX = 200, 4000, 2000 +SEEN_SECONDS = 60 # a feed's last read is written at most this often +TTL_MINUTES = 30 # how long readers may keep a copy before asking again +NS = { + "atom": "http://www.w3.org/2005/Atom", + "itunes": "http://www.itunes.com/dtds/podcast-1.0.dtd", + "podcast": "https://podcastindex.org/namespace/1.0", +} +FIELDS = ( + "record::id(id) AS id, space, kind, title, description, author, language, category, explicit, image, max_items, " + "created_by, created_at, updated_at, fetched_at" +) +ITEM_FIELDS = ( + "record::id(id) AS id, feed, kind, guid, title, summary, link, published_at, recording, activity, categories, origin, by, created_at" +) +# where a timeline object's lens: reference opens in the web app (components/timeline/model.ts objectHref) +PAGES = { + "recording": "/resources/{id}", + "sensor": "/sensors", + "storage_source": "/sources", + "chat": "/chat/{id}", + "entity": "/entities/{id}", + "topic": "/topics/{id}", + "automation_run": "/activity", +} +_XML_BAD = re.compile("[\x00-\x08\x0b\x0c\x0e-\x1f￾￿]") + + +def _hash(token): + return hashlib.sha256(token.encode()).hexdigest() + + +def _context(fid): + return f"feed:{int(fid)}:token" + + +def _text(v, most=None): + """Text without characters XML can't hold, trimmed (to `most` characters).""" + s = _XML_BAD.sub("", str(v or "")).strip() + return s[:most] if most else s + + +def _line(v, most=None): + return " ".join(_text(v).split())[:most] if most else " ".join(_text(v).split()) + + +def _href(v): + """An http or https address, or None.""" + v = _line(v) + return v if v and urllib.parse.urlsplit(v).scheme in ("http", "https") and len(v) <= 2000 else None + + +# ---------- feeds ---------- +def _check(d): + """A feed's settings, checked: ValueError naming the first problem.""" + out = {} + if "kind" in d: + if d["kind"] not in KINDS: + raise ValueError(f"a feed's kind is {' or '.join(KINDS)}") + out["kind"] = d["kind"] + if "title" in d: + if not _line(d["title"]): + raise ValueError("give the feed a title") + out["title"] = _line(d["title"], TITLE_MAX) + if "description" in d: + out["description"] = _text(d["description"], DESCRIPTION_MAX) or None + if "author" in d: + out["author"] = _line(d["author"], TITLE_MAX) or None + if "language" in d: + lang = _line(d["language"]) or DEFAULTS["language"] + if not LANG_RX.match(lang): + raise ValueError("language is a language tag, like en or en-GB") + out["language"] = lang + if "category" in d: + out["category"] = _line(d["category"], 60) or None + if "explicit" in d: + out["explicit"] = bool(d["explicit"]) + if "image" in d: + img = d["image"] + if img and not (_href(img) or "").startswith("https://"): + raise ValueError("the image is an https:// address (podcast apps fetch it)") + out["image"] = _href(img) if img else None + if "max_items" in d: + n = d["max_items"] + if n is not None and (not isinstance(n, int) or isinstance(n, bool) or not 1 <= n <= MAX_ITEMS): + raise ValueError(f"a feed lists 1 to {MAX_ITEMS} items") + out["max_items"] = n or DEFAULTS["max_items"] + return out + + +def create(db, cfg, space, title, kind="rss", by=None, **opts): + """A new feed in namespace `space`; its id. ValueError for a vault, or settings that don't fit.""" + if int(space) not in store.space_names(db): + raise KeyError(space) + if podcasts._vault(db, int(space)): + raise ValueError("a vault's resources are opened with a passkey, so a vault can't publish a feed") + d = _check({"title": title, "kind": kind, **{k: v for k, v in opts.items() if v is not None}}) + fid, token, t = db.next_id("feed"), TOKEN_PREFIX + secrets.token_urlsafe(32), store.now() + db.q( + "CREATE $r CONTENT $d", + r=R("feed", fid), + d=store.clean( + { + **{k: v for k, v in DEFAULTS.items() if kind == "podcast" or k != "category"}, + **d, + "space": int(space), + "token_hash": _hash(token), + "token": settings.seal(cfg, token, _context(fid)), + "created_by": by, + "created_at": t, + "updated_at": t, + } + ), + ) + return fid + + +def update(db, fid, **changes): + get(db, fid) + d = _check(changes) + sets = {k: v for k, v in d.items() if v is not None} + db.q("UPDATE $r MERGE $d", r=R("feed", int(fid)), d={**sets, "updated_at": store.now()}) + for k in (k for k, v in d.items() if v is None): + db.q(f"UPDATE $r SET {k} = NONE", r=R("feed", int(fid))) + + +def remove(db, fid): + """Delete a feed and its items: its address stops working at once.""" + get(db, fid) + db.run(["DELETE feed_item WHERE feed = $f", "DELETE $r"], f=int(fid), r=R("feed", int(fid))) + + +def get(db, fid): + """A feed's row (without its token); KeyError when there's none.""" + row = db.one(f"SELECT {FIELDS} FROM $r", r=R("feed", int(fid))) + if not row: + raise KeyError(fid) + return row + + +def list_feeds(db, spaces=None): + """Feeds in namespaces `spaces` (None: every one), oldest first, each with how many items it holds.""" + rows = db.rows( + f"SELECT {FIELDS} FROM feed" + (" WHERE space IN $s" if spaces is not None else "") + " ORDER BY id", s=sorted(spaces or []) + ) + return [{**r, **_fill(db, r["id"])} for r in rows] + + +def _fill(db, fid): + """How many items a feed holds, and when the newest was published.""" + n = db.one("SELECT count() AS n FROM feed_item WHERE feed = $f GROUP ALL", f=int(fid)) or {} + last = db.values("SELECT VALUE published_at FROM feed_item WHERE feed = $f ORDER BY published_at DESC LIMIT 1", f=int(fid)) + return {"items": n.get("n", 0), "last_item_at": last[0] if last else None} + + +def view(db, cfg, row, base): + """A feed as people and agents see it: its settings, its namespace's name, its address, and how full it is.""" + if "items" not in row: + row = {**row, **_fill(db, row["id"])} + token = token_of(db, cfg, row["id"]) + return store.clean( + { + **row, + "namespace": store.space_names(db).get(row["space"]), + "explicit": bool(row.get("explicit")), + "max_items": row.get("max_items") or DEFAULTS["max_items"], + "url": address(base, token), + "path": PATH + token, + "page": f"{base}/feeds/{row['id']}", + } + ) + + +def token_of(db, cfg, fid): + row = db.one("SELECT token FROM $r", r=R("feed", int(fid))) + if not row: + raise KeyError(fid) + return settings.unseal(cfg, row["token"], _context(fid)) + + +def rotate(db, cfg, fid): + """A new token for a feed: the old address stops working at once. The new token.""" + get(db, fid) + token = TOKEN_PREFIX + secrets.token_urlsafe(32) + db.q( + "UPDATE $r SET token_hash = $h, token = $t, updated_at = $u", + r=R("feed", int(fid)), + h=_hash(token), + t=settings.seal(cfg, token, _context(fid)), + u=store.now(), + ) + return token + + +def address(base, token): + return f"{base.rstrip('/')}{PATH}{token}" + + +def by_token(db, token): + """The feed whose token this is; KeyError for any other.""" + if not isinstance(token, str) or not TOKEN_RX.match(token): + raise KeyError("token") + row = db.one(f"SELECT {FIELDS} FROM feed WHERE token_hash = $h LIMIT 1", h=_hash(token)) + if not row or podcasts._vault(db, row["space"]): # a namespace made a vault since: its feeds stop + raise KeyError("token") + return row + + +def seen(db, feed, now=None): + """Note that a reader fetched the feed (at most once a minute, so readers that poll often don't write each time).""" + now = now or dt.datetime.now(dt.timezone.utc) + last = feed.get("fetched_at") + if last and (now - events._parse(last)).total_seconds() < SEEN_SECONDS: + return + db.q("UPDATE $r SET fetched_at = $t", r=R("feed", feed["id"]), t=now.isoformat(timespec="seconds")) + + +# ---------- what may go in ---------- +class Fit: + """Whether what's in a namespace may show in a feed of namespace `space`: the same namespace, or one everyone who + reads the feed's can read too, and not a vault (podcasts.target's rule for where an episode may go).""" + + def __init__(self, db, space): + self.db, self.space, self._ok = db, int(space), {} + self._readers = None + + def __call__(self, sid): + if sid is None: + return False + sid = int(sid) + if sid == self.space: + return True + if sid not in self._ok: + if self._readers is None: + self._readers = podcasts._readers(self.db, self.space) + self._ok[sid] = not podcasts._vault(self.db, sid) and self._readers <= podcasts._readers(self.db, sid, collections=False) + return self._ok[sid] + + +def entry_from(value): + """What a workflow passes on, as something to publish: a resource ({id, title...} as select nodes pass them, a + {recording: id}, or an id), an activity (anything with a kind, published and lens), or text ({title, summary or + text, link}). None for anything else.""" + if isinstance(value, bool): + return None + if isinstance(value, int): + return {"recording": value} + if not isinstance(value, dict): + return None + if isinstance(value.get("kind"), str) and isinstance(value.get("lens"), dict) and value.get("published"): + return {"activity": value} + for k in ("recording", "episode"): + if isinstance(value.get(k), int) and not isinstance(value.get(k), bool): + return {"recording": value[k]} + if isinstance(value.get("id"), int) and not isinstance(value["id"], bool) and ("title" in value or "recorded_at" in value): + return {"recording": value["id"]} + text = value.get("summary") if value.get("summary") is not None else value.get("text") + if value.get("title") or text: + return store.clean({"title": value.get("title"), "summary": text, "link": value.get("link"), "guid": value.get("guid")}) + return None + + +def _guid_text(e): + return "text/" + ( + _line(e.get("guid"), 120) or hashlib.sha256(f"{e.get('title')}\n{e.get('summary')}\n{e.get('link')}".encode()).hexdigest()[:32] + ) + + +def _activity_item(a): + lens = a.get("lens") or {} + obj = a.get("object") or {} + actor = (a.get("actor") or {}).get("name") + kind = a.get("kind") + label = (events.kind_info(kind) or {}).get("label") if kind in {k["name"] for k in events.kinds()} else None + about = _line(obj.get("name"), TITLE_MAX) + summary = " · ".join(x for x in (label or kind, f"by {actor}" if actor else None, about or None) if x) + return store.clean( + { + "kind": "activity", + "guid": f"activity/{a['id']}", + "title": _line(a.get("summary"), TITLE_MAX) or kind, + "summary": summary, + "link": obj.get("url") if isinstance(obj.get("url"), str) else None, + "published_at": events._parse(a["published"]).isoformat(timespec="seconds"), + "activity": store.clean( + { + "id": a["id"], + "kind": kind, + "object": obj.get("id") if isinstance(obj.get("id"), str) else None, + "source": lens.get("source"), + } + ), + "categories": [kind] if kind else None, + } + ) + + +def publish(db, cfg, fid, entries, origin=None, by=None): + """Add `entries` (entry_from's shapes) to feed `fid`: {added: [item ids], already, refused: [{what, why}]}. An entry + already in the feed isn't added again; one that may not show there is refused, with why.""" + feed = get(db, fid) + fits = Fit(db, feed["space"]) + have = set(db.values("SELECT VALUE guid FROM feed_item WHERE feed = $f", f=feed["id"])) + out = {"added": [], "already": 0, "refused": []} + t = store.now() + for e in entries or []: + item, why = None, None + if not isinstance(e, dict): + why, what = "not something a feed can list", str(e)[:80] + elif e.get("recording") is not None: + what = f"resource {e['recording']}" + rec = db.one("SELECT space, title FROM $r", r=R("recording", int(e["recording"]))) + if not rec: + why = "no such resource" + elif not fits(rec["space"]): + why = "it's in a namespace not everyone who reads the feed can read" + else: + episode = bool(db.one("SELECT id FROM $r", r=R("podcast", int(e["recording"])))) + item = { + "kind": "episode" if episode else "asset", + "guid": f"recording/{int(e['recording'])}", + "title": _line(rec.get("title"), TITLE_MAX) or None, + "recording": int(e["recording"]), + "published_at": t, + } + elif e.get("activity") is not None: + a = e["activity"] + what = f"activity {a.get('id') if isinstance(a, dict) else a}" + if not isinstance(a, dict) or not isinstance(a.get("id"), str) or not a.get("published"): + why = "not an activity" + elif ((a.get("lens") or {}).get("audience") or "space") != "space": + why = "it's only for its owner or admins" + elif not events.spaces_of(a) or not all(fits(s) for s in events.spaces_of(a)): + why = "it's in a namespace not everyone who reads the feed can read" + else: + item = _activity_item(a) + else: + what = f"text {_line(e.get('title'), 60)!r}" + title, text = _line(e.get("title"), TITLE_MAX), _text(e.get("summary"), TEXT_MAX) + if not title and not text: + why = "give it a title or some text" + elif e.get("link") and not _href(e["link"]): + why = "a link is an http or https address" + else: + item = store.clean( + { + "kind": "text", + "guid": _guid_text(e), + "title": title or _line(text, 80), + "summary": text or None, + "link": _href(e.get("link")), + "published_at": t, + } + ) + if item is None: + out["refused"].append({"what": what, "why": why}) + continue + if item["guid"] in have: + out["already"] += 1 + continue + iid = db.next_id("feed_item") + db.q( + "CREATE $r CONTENT $d", + r=R("feed_item", iid), + d=store.clean( + {**item, "feed": feed["id"], "key": f"{feed['id']}:{item['guid']}", "origin": origin or None, "by": by, "created_at": t} + ), + ) + have.add(item["guid"]) + out["added"].append(iid) + if out["added"]: + _prune(db, feed["id"]) + return out + + +def _prune(db, fid): + """Keep a feed's newest KEEP items.""" + old = db.rows("SELECT id, published_at FROM feed_item WHERE feed = $f ORDER BY published_at DESC, id DESC START $k", f=int(fid), k=KEEP) + if old: + db.q("DELETE $ids", ids=[r["id"] for r in old]) + + +def items(db, fid, limit=50, offset=0): + """A feed's items, newest first.""" + return db.rows( + f"SELECT {ITEM_FIELDS} FROM feed_item WHERE feed = $f ORDER BY published_at DESC, id DESC LIMIT $l START $o", + f=int(fid), + l=int(limit), + o=int(offset), + ) + + +def remove_item(db, fid, iid): + got = db.rows("DELETE $r WHERE feed = $f RETURN BEFORE", r=R("feed_item", int(iid)), f=int(fid)) + if not got: + raise KeyError(iid) + + +# ---------- media ---------- +def media(db, cfg, rid): + """(content type, size in bytes) of a resource's audio or video, for an enclosure; None without any (or when it + can't be read).""" + rec = db.one("SELECT source, path, remote, size, media FROM $r", r=R("recording", int(rid))) or {} + if rec.get("source") != "audio": + return None + is_video = (rec.get("media") or {}).get("kind") == "video" + path = render.has_audio(db, cfg, int(rid)) + name = path or (rec.get("remote") or {}).get("path") or "" + ext = pathlib.PurePosixPath(str(name)).suffix.lower() + ctype = (video.VIDEO_TYPES.get(ext) if is_video else None) or render.AUDIO_TYPES.get(ext) or "audio/mpeg" + if path: + try: + size = keyring.plain_size(db, cfg, path) if keyring.is_encrypted(path) else os.path.getsize(path) + except (keyring.Locked, keyring.Damaged, OSError): + return None + return ctype, size + if rec.get("remote") and rec.get("size"): + return ctype, int(rec["size"]) + return None + + +def item_recording(db, feed, iid): + """The recording behind item `iid` of `feed`, for its enclosure; KeyError when it has none (or may not show).""" + it = db.one("SELECT recording FROM $r WHERE feed = $f", r=R("feed_item", int(iid)), f=feed["id"]) + if not it or it.get("recording") is None: + raise KeyError(iid) + rec = db.one("SELECT * FROM $r", r=R("recording", int(it["recording"]))) + if not rec or not Fit(db, feed["space"])(rec.get("space")): + raise KeyError(iid) + return int(it["recording"]), rec + + +# ---------- the feed itself ---------- +def _rfc822(t): + return email.utils.format_datetime(events._parse(t), usegmt=True) + + +def _duration(ms): + s = max(0, int((ms or 0) // 1000)) + return f"{s // 3600}:{s % 3600 // 60:02d}:{s % 60:02d}" + + +def _el(tag, text=None, **attrs): + a = "".join(f" {k.replace('__', ':')}={quoteattr(str(v))}" for k, v in attrs.items() if v is not None) + return f"<{tag}{a}/>" if text is None else f"<{tag}{a}>{escape(_text(text))}" + + +def _html(text): + """Plain text as the HTML a reader shows: escaped, with its line breaks kept.""" + return "
".join(html.escape(line) for line in _text(text).splitlines()) + + +def _object_link(base, obj): + url = obj.get("url") if isinstance(obj, dict) else None + if isinstance(url, str) and url.startswith("/") and not url.startswith("//"): + return base + url + if _href(url): + return _href(url) + m = re.match(r"^lens:([a-z_]+)/(.+)$", obj.get("id") or "" if isinstance(obj, dict) else "") + if m and m.group(1) in PAGES: + return base + PAGES[m.group(1)].format(id=urllib.parse.quote(m.group(2), safe="")) + return None + + +def _shown(db, cfg, feed, base, token): + """The items a reader sees, newest first, each as {title, link, guid, published, description, categories, + enclosure}: resources read as they are now, episodes once they're made, and only items with audio in a podcast + feed.""" + fits, out = Fit(db, feed["space"]), [] + limit = feed.get("max_items") or DEFAULTS["max_items"] + rows = items(db, feed["id"], limit=min(KEEP, limit * 3 if feed["kind"] == "podcast" else limit)) + rids = [r["recording"] for r in rows if r.get("recording") is not None] + recs = ( + { + r["id"]: r + for r in db.rows( + "SELECT record::id(id) AS id, space, title, summary, duration_ms, recorded_at FROM recording WHERE id IN $ids", + ids=[R("recording", x) for x in rids], + ) + } + if rids + else {} + ) + for it in rows: + if len(out) >= limit: + break + shown = { + "title": it.get("title"), + "guid": f"lens:feed-{feed['id']}:{it['guid']}", + "published": it["published_at"], + "categories": it.get("categories") or [], + "description": it.get("summary") or "", + "link": it.get("link"), + "enclosure": None, + } + rid = it.get("recording") + if rid is not None: + rec = recs.get(rid) + if not rec or not fits(rec["space"]): + continue # deleted, or moved somewhere the feed's readers can't read + shown["title"] = rec.get("title") or shown["title"] or "Untitled" + shown["link"] = f"{base}/resources/{rid}" + shown["description"] = ((rec.get("summary") or {}).get("summary") if isinstance(rec.get("summary"), dict) else None) or "" + if it["kind"] == "episode": + p = db.one("SELECT status, outline, sources FROM $r", r=R("podcast", rid)) or {} + if p.get("status") not in ("ready", "script_only"): + continue # still being made, or failed + shown["description"] = _episode_text(p, base) or shown["description"] + got = media(db, cfg, rid) + if got: + shown["enclosure"] = {"url": f"{address(base, token)}/items/{it['id']}/audio", "type": got[0], "length": got[1]} + shown["duration_ms"] = rec.get("duration_ms") + elif it["kind"] == "activity": + obj = {"id": (it.get("activity") or {}).get("object"), "url": it.get("link")} + shown["link"] = _object_link(base, obj) or f"{base}/timeline" + if feed["kind"] == "podcast" and not shown["enclosure"]: + continue + out.append(shown) + return out + + +def _episode_text(p, base): + """An episode's description: the outline's summary (or its key ideas), then the sources it draws on.""" + o = p.get("outline") or {} + text = _text(o.get("summary")) or "\n".join(f"- {_line(i.get('point'))}" for i in (o.get("ideas") or [])[:6] if isinstance(i, dict)) + cited = [] + for s in p.get("sources") or []: + rid = (s.get("ref") or {}).get("recording") + if rid is not None and rid not in [c[1] for c in cited]: + cited.append((_line(s.get("title"), TITLE_MAX) or "Untitled", rid)) + if cited: + text += ( + ("\n\n" if text else "") + "Sources:\n" + "\n".join(f"{n}. {t}: {base}/resources/{rid}" for n, (t, rid) in enumerate(cited, 1)) + ) + return text + + +def render_xml(db, cfg, feed, base, token): + """The feed as RSS 2.0 (with Apple Podcasts' tags for a podcast feed), UTF-8.""" + pod = feed["kind"] == "podcast" + shown = _shown(db, cfg, feed, base, token) + me = address(base, token) + ns = f' xmlns:atom="{NS["atom"]}"' + (f' xmlns:itunes="{NS["itunes"]}" xmlns:podcast="{NS["podcast"]}"' if pod else "") + built = max([s["published"] for s in shown] + [feed.get("updated_at") or feed.get("created_at") or store.now()]) + parts = [ + '', + f'', + "", + _el("title", feed["title"]), + _el("link", f"{base}/feeds/{feed['id']}"), + _el("description", _html(feed.get("description") or feed["title"])), + _el("language", feed.get("language") or DEFAULTS["language"]), + _el("lastBuildDate", _rfc822(built)), + _el("generator", "Lens"), + _el("ttl", str(TTL_MINUTES)), + _el("atom:link", href=me, rel="self", type="application/rss+xml"), + ] + if feed.get("image"): + parts.append(f"{_el('url', feed['image'])}{_el('title', feed['title'])}{_el('link', f'{base}/feeds/{feed["id"]}')}") + if pod: + parts += [ + _el("itunes:author", feed.get("author") or "Lens"), + _el("itunes:explicit", "true" if feed.get("explicit") else "false"), + f"", + _el("itunes:type", "episodic"), + _el("itunes:block", "Yes"), # private: not listed in Apple Podcasts + _el("podcast:locked", "yes"), # nor imported by other platforms + ] + if feed.get("image"): + parts.append(_el("itunes:image", href=feed["image"])) + for s in shown: + bits = [ + _el("title", s["title"] or "Untitled"), + _el("guid", s["guid"], isPermaLink="false"), + _el("pubDate", _rfc822(s["published"])), + ] + if s.get("link"): + bits.append(_el("link", s["link"])) + if s.get("description"): + bits.append(_el("description", _html(s["description"]))) + bits += [_el("category", c) for c in s["categories"]] + enc = s.get("enclosure") + if enc: + bits.append(_el("enclosure", url=enc["url"], length=str(enc["length"]), type=enc["type"])) + if pod: + if s.get("duration_ms"): + bits.append(_el("itunes:duration", _duration(s["duration_ms"]))) + bits.append(_el("itunes:episodeType", "full")) + parts.append("" + "".join(bits) + "") + parts += ["", ""] + return "\n".join(parts).encode("utf-8") diff --git a/fastapi_backend/app/schemas/feeds.py b/fastapi_backend/app/schemas/feeds.py new file mode 100644 index 000000000..cfb211b11 --- /dev/null +++ b/fastapi_backend/app/schemas/feeds.py @@ -0,0 +1,95 @@ +"""Published RSS and podcast feeds (app/domain/syndication.py, docs/feeds.md).""" + +from __future__ import annotations + +from typing import Any, Literal + +from pydantic import Field + +from app.schemas.common import RequestModel, ResponseModel + +FeedKind = Literal["rss", "podcast"] +ItemKind = Literal["asset", "episode", "activity", "text"] + + +class FeedSettings(RequestModel): + title: str | None = Field(None, max_length=200) + description: str | None = Field(None, max_length=2000) + author: str | None = Field(None, max_length=200, description="who a podcast app shows it's by (default Lens)") + language: str | None = Field(None, max_length=20, description="a language tag, like en or en-GB (default en)") + category: str | None = Field(None, max_length=60, description="an Apple Podcasts category (podcast feeds; default Education)") + explicit: bool | None = None + image: str | None = Field(None, max_length=2000, description="artwork: an https:// address of a square picture") + max_items: int | None = Field(None, ge=1, le=500, description="how many items the feed lists, newest first (default 50)") + kind: FeedKind | None = Field(None, description="rss lists anything; podcast lists items with audio, with Apple Podcasts' tags") + + +class FeedCreate(FeedSettings): + namespace: str = Field(description="the namespace the feed belongs to: its editors manage it, its readers see it") + title: str = Field(min_length=1, max_length=200) + kind: FeedKind = "rss" + + +class Feed(ResponseModel): + id: int + space: int + namespace: str | None = None + kind: FeedKind + title: str + description: str | None = None + author: str | None = None + language: str | None = None + category: str | None = None + explicit: bool = False + image: str | None = None + max_items: int + url: str = Field(description="the feed's private address: anyone with it can read the feed, so share it like a password") + path: str = Field(description="the address without the server") + page: str = Field(description="the feed's page in the web app") + items: int = Field(description="how many items it holds") + last_item_at: str | None = None + fetched_at: str | None = Field(None, description="when a feed reader or podcast app last read it") + created_by: str | None = None + created_at: str | None = None + updated_at: str | None = None + + +class FeedText(RequestModel): + title: str | None = Field(None, max_length=200) + summary: str | None = Field(None, max_length=4000, description="the item's text") + link: str | None = Field(None, max_length=2000, description="an http or https address") + guid: str | None = Field(None, max_length=120, description="what the item is about, so the same item isn't added twice") + + +class FeedPublish(RequestModel): + recordings: list[int] = Field(default_factory=list, max_length=200, description="resources (and podcast episodes) to list") + activities: list[str] = Field(default_factory=list, max_length=200, description="timeline activities to list, by id") + texts: list[FeedText] = Field(default_factory=list, max_length=50, description="text items") + + +class FeedRefused(ResponseModel): + what: str + why: str + + +class FeedPublished(ResponseModel): + added: list[int] = Field(description="the new items' ids") + already: int = Field(description="how many were in the feed already") + refused: list[FeedRefused] = Field(description="what can't go in this feed, and why") + + +class FeedItem(ResponseModel): + id: int + feed: int + kind: ItemKind + guid: str + title: str | None = None + summary: str | None = None + link: str | None = None + published_at: str + recording: int | None = None + activity: dict[str, Any] | None = None + categories: list[str] | None = None + origin: dict[str, Any] | None = Field(None, description="the routine run and workflow node that added it") + by: str | None = None + created_at: str | None = None diff --git a/fastapi_backend/tests/api/test_feeds.py b/fastapi_backend/tests/api/test_feeds.py new file mode 100644 index 000000000..a2b282481 --- /dev/null +++ b/fastapi_backend/tests/api/test_feeds.py @@ -0,0 +1,214 @@ +"""Published feeds: who makes and fills a feed, what may go in it, and what feed readers and podcast apps read at its +private address (RSS 2.0, and Apple Podcasts' tags for a podcast feed).""" + +from __future__ import annotations + +import xml.etree.ElementTree as ET + +import pytest + +from app.domain import store, syndication +from tests import fake_llm +from tests.api.test_mcp import tool, tool_error +from tests.helpers import drain, login, make_user, seed + +R = store.R +ITUNES = "{http://www.itunes.com/dtds/podcast-1.0.dtd}" + + +@pytest.fixture +def env(client, db, cfg, folder): + srv, url = fake_llm.start() + cfg["llm"].update(base_url=url, model="fake") + fake_llm.Handler.podcast_script = None + a, b, c = seed(db, cfg, folder) + make_user(db, "ed@x.io", "editor password 1", roles={"pods": "editor"}) + make_user(db, "vi@x.io", "viewer password 1", roles={"pods": "viewer"}) + make_user(db, "ca@x.io", "calls password 1", roles={"calls": "editor"}) + make_user(db, "root@x.io", "root password 1", admin=True) + yield { + "ids": (a, b, c), + "ed": login(client, "ed@x.io", "editor password 1"), + "vi": login(client, "vi@x.io", "viewer password 1"), + "ca": login(client, "ca@x.io", "calls password 1"), + "root": login(client, "root@x.io", "root password 1"), + } + srv.shutdown() + + +def _read(client, path, **headers): + r = client.get(path, headers=headers) + assert r.status_code == 200, r.text + assert r.headers["content-type"].startswith("application/rss+xml") and r.headers["x-robots-tag"] == "noindex, nofollow" + return ET.fromstring(r.content).find("channel"), r + + +def test_making_filling_and_reading_a_feed(client, db, cfg, env): + a, b, c = env["ids"] + # only editors make feeds; readers of the namespace see them, nobody else does + assert client.post("/api/v1/feeds", headers=env["vi"], json={"namespace": "pods", "title": "Pods"}).status_code == 403 + assert client.post("/api/v1/feeds", headers=env["ca"], json={"namespace": "pods", "title": "Pods"}).status_code == 404 + r = client.post("/api/v1/feeds", headers=env["ed"], json={"namespace": "pods", "title": "Pods news", "description": "What's new"}) + assert r.status_code == 201, r.text + feed = r.json() + assert feed["kind"] == "rss" and feed["namespace"] == "pods" and feed["items"] == 0 and feed["max_items"] == 50 + assert feed["path"].startswith("/api/v1/feeds/public/lfd_") and feed["url"].endswith(feed["path"]) + fid = feed["id"] + assert [f["id"] for f in client.get("/api/v1/feeds", headers=env["vi"]).json()] == [fid] + assert client.get(f"/api/v1/feeds/{fid}", headers=env["vi"]).json()["url"] == feed["url"] + assert client.get("/api/v1/feeds", headers=env["ca"]).json() == [] + assert client.get(f"/api/v1/feeds/{fid}", headers=env["ca"]).status_code == 404 + assert client.patch(f"/api/v1/feeds/{fid}", headers=env["vi"], json={"title": "x"}).status_code == 403 + assert client.patch(f"/api/v1/feeds/{fid}", headers=env["ed"], json={"image": "http://x.io/a.png"}).status_code == 400 + assert client.patch(f"/api/v1/feeds/{fid}", headers=env["ed"], json={"max_items": 10}).json()["max_items"] == 10 + assert not db.one("SELECT token FROM $r", r=R("feed", fid))["token"].startswith("lfd_") # sealed + + # filling it: what the person can't read is 404; text that would be markup stays text + items = f"/api/v1/feeds/{fid}/items" + assert client.post(items, headers=env["ed"], json={"recordings": [c]}).status_code == 404 + assert client.post(items, headers=env["vi"], json={"recordings": [a]}).status_code == 403 + assert client.post(items, headers=env["ed"], json={}).status_code == 400 + note = {"title": "Weekly digest", "summary": "Line one \nLine two", "link": "https://x.io/d"} + out = client.post(items, headers=env["ed"], json={"recordings": [a, b], "texts": [note, {"title": "Bad", "link": "ftp://x"}]}).json() + assert len(out["added"]) == 3 and out["already"] == 0 + assert out["refused"] == [{"what": "text 'Bad'", "why": "a link is an http or https address"}] + again = client.post(items, headers=env["ed"], json={"recordings": [a], "texts": [note]}).json() + assert again == {"added": [], "already": 2, "refused": []} + # an admin can read everything, but what goes in is bounded by who reads the feed's namespace + out = client.post(items, headers=env["root"], json={"recordings": [c]}).json() + assert out["added"] == [] and "not everyone who reads the feed can read" in out["refused"][0]["why"] + listed = client.get(items, headers=env["vi"]).json() + assert {i["kind"] for i in listed} == {"asset", "text"} and len(listed) == 3 + + # what a feed reader sees, with no session + ch, r = _read(client, feed["path"]) + assert ch.findtext("title") == "Pods news" and ch.findtext("generator") == "Lens" + got = {i.findtext("title"): i for i in ch.findall("item")} + assert set(got) == {"ep1", "ep2", "Weekly digest"} + assert got["ep1"].findtext("link") == f"http://127.0.0.1/resources/{a}" and got["ep1"].find("enclosure") is None + assert got["ep1"].find("guid").get("isPermaLink") == "false" + text = got["Weekly digest"] + assert text.findtext("description") == "Line one <script>alert(1)</script>
Line two" # escaped for HTML + assert text.findtext("link") == "https://x.io/d" + assert ch.find("{http://www.w3.org/2005/Atom}link").get("href") == feed["url"] + assert client.get(feed["path"], headers={"If-None-Match": r.headers["etag"]}).status_code == 304 + assert db.one("SELECT fetched_at FROM $r", r=R("feed", fid))["fetched_at"] + assert client.get("/api/v1/feeds/public/lfd_" + "x" * 43).status_code == 404 + assert client.get("/api/v1/feeds/public/nope").status_code == 404 + + # a deleted resource drops out; an item taken out is gone + db.q("DELETE $r", r=R("recording", b)) + ch, _ = _read(client, feed["path"]) + assert "ep2" not in {i.findtext("title") for i in ch.findall("item")} + tid = next(i["id"] for i in listed if i["kind"] == "text") + assert client.delete(f"{items}/{tid}", headers=env["vi"]).status_code == 403 + assert client.delete(f"{items}/{tid}", headers=env["ed"]).json() == {"ok": True} + assert client.delete(f"{items}/{tid}", headers=env["ed"]).status_code == 404 + + # a new address: the old one stops working at once + new = client.post(f"/api/v1/feeds/{fid}/token", headers=env["ed"]).json() + assert new["url"] != feed["url"] and client.get(feed["path"]).status_code == 404 + _read(client, new["path"]) + # a namespace made a vault stops its feeds + db.q("UPSERT $r SET vault = true", r=R("data_key", feed["space"])) + assert client.get(new["path"]).status_code == 404 + db.q("UPSERT $r SET vault = false", r=R("data_key", feed["space"])) + assert client.delete(f"/api/v1/feeds/{fid}", headers=env["vi"]).status_code == 403 + assert client.delete(f"/api/v1/feeds/{fid}", headers=env["ed"]).json() == {"ok": True} + assert client.get(new["path"]).status_code == 404 and not db.rows("SELECT id FROM feed_item") + + +def test_a_podcast_feed_lists_what_has_audio(client, db, cfg, env, folder): + a, b, _c = env["ids"] + pod = client.post("/api/v1/feeds", headers=env["ed"], json={"namespace": "pods", "title": "Learning", "kind": "podcast"}).json() + rss = client.post("/api/v1/feeds", headers=env["ed"], json={"namespace": "pods", "title": "All"}).json() + assert pod["category"] == "Education" and pod["language"] == "en" and rss.get("category") is None + ep = client.post("/api/v1/podcasts", headers=env["ed"], json={"selection": {"recordings": [a, b]}}).json()["episode"] + for f in (pod, rss): + out = client.post(f"/api/v1/feeds/{f['id']}/items", headers=env["ed"], json={"recordings": [ep, a]}).json() + assert len(out["added"]) == 2 + assert {i["kind"] for i in client.get(f"/api/v1/feeds/{pod['id']}/items", headers=env["ed"]).json()} == {"episode", "asset"} + # while it's being made, the episode isn't listed anywhere; a transcript without audio isn't a podcast's + ch, _ = _read(client, pod["path"]) + assert ch.findall("item") == [] and ch.findtext(f"{ITUNES}block") == "Yes" + assert ch.find(f"{ITUNES}category").get("text") == "Education" + drain(db, cfg) + ch, _ = _read(client, rss["path"]) + titles = [i.findtext("title") for i in ch.findall("item")] + assert "Capsids and shipments" in titles and "ep1" in titles # a script-only episode is text in an RSS feed + episode = next(i for i in ch.findall("item") if i.findtext("title") == "Capsids and shipments") + assert "Sources:" in episode.findtext("description") and f"/resources/{a}" in episode.findtext("description") + assert _read(client, pod["path"])[0].findall("item") == [] + + # with its audio made, it's an episode podcast apps play + audio = folder / "episode.mp3" + audio.write_bytes(b"ID3" + bytes(range(256)) * 40) + db.q("UPDATE $r SET source = 'audio', path = $p, duration_ms = 754000", r=R("recording", ep), p=str(audio)) + db.q("UPDATE $r SET status = 'ready'", r=R("podcast", ep)) + ch, _ = _read(client, pod["path"]) + (item,) = ch.findall("item") + enc = item.find("enclosure") + assert enc.get("type") == "audio/mpeg" and enc.get("length") == str(audio.stat().st_size) + assert enc.get("url").startswith(pod["url"] + "/items/") and item.findtext(f"{ITUNES}duration") == "0:12:34" + path = enc.get("url").removeprefix("http://127.0.0.1") + got = client.get(path, headers={"Range": "bytes=0-2"}) + assert got.status_code == 206 and got.content == b"ID3" and got.headers["referrer-policy"] == "no-referrer" + head = client.head(path) + assert head.status_code == 200 and head.headers["content-length"] == str(audio.stat().st_size) and head.content == b"" + assert client.get(path.replace(pod["path"], rss["path"])).status_code == 404 # an item of another feed + # a recording moved where the feed's readers can't read it stops being served + db.q("UPDATE $r SET space = $s", r=R("recording", ep), s=store.ns_id(db, "calls")) + assert client.get(path).status_code == 404 + + +def test_timeline_activities_in_a_feed(client, db, cfg, env): + feed = client.post("/api/v1/feeds", headers=env["ed"], json={"namespace": "pods", "title": "What happened"}).json() + page = client.get("/api/v1/activities", headers=env["ed"]).json()["items"] + assert page, "the seeded assets are on the timeline" + act = page[0] + out = client.post(f"/api/v1/feeds/{feed['id']}/items", headers=env["ed"], json={"activities": [act["id"], "nope-1"]}).json() + assert len(out["added"]) == 1 and out["refused"] == [{"what": "activity nope-1", "why": "not found"}] + (item,) = client.get(f"/api/v1/feeds/{feed['id']}/items", headers=env["ed"]).json() + assert item["kind"] == "activity" and item["categories"] == [act["kind"]] and item["title"] == act["summary"] + ch, _ = _read(client, feed["path"]) + (shown,) = ch.findall("item") + assert shown.findtext("category") == act["kind"] and shown.findtext("link").startswith("http://127.0.0.1/") + # another namespace's activity can't be named by someone who can't read it + theirs = client.get("/api/v1/activities", headers=env["ca"]).json()["items"][0] + out = client.post(f"/api/v1/feeds/{feed['id']}/items", headers=env["ed"], json={"activities": [theirs["id"]]}).json() + assert out["added"] == [] and out["refused"][0]["why"] == "not found" + + +def test_vaults_and_settings(db, cfg, env): + sid = store.ns_id(db, "pods") + with pytest.raises(ValueError, match="language"): + syndication.create(db, cfg, sid, "x", language="english please") + with pytest.raises(ValueError, match="kind"): + syndication.create(db, cfg, sid, "x", kind="atom") + with pytest.raises(ValueError, match="title"): + syndication.create(db, cfg, sid, " ") + db.q("UPSERT $r SET vault = true", r=R("data_key", sid)) + with pytest.raises(ValueError, match="vault"): + syndication.create(db, cfg, sid, "Secret") + assert syndication.entry_from(7) == {"recording": 7} + assert syndication.entry_from({"id": 3, "title": "x"}) == {"recording": 3} + assert syndication.entry_from({"title": "Digest", "text": "hi"}) == {"title": "Digest", "summary": "hi"} + assert syndication.entry_from(True) is None and syndication.entry_from("x") is None + + +def test_agents_use_feeds(client, db, cfg, env): + a, _b, c = env["ids"] + he = env["ed"] + assert "needs editor access" in tool_error(client, env["vi"], "create_feed", namespace="pods", title="x") + feed = tool(client, he, "create_feed", namespace="pods", title="For my phone", kind="podcast") + assert feed["kind"] == "podcast" and feed["url"].startswith("http") and feed["items"] == 0 + assert "give recording_ids" in tool_error(client, he, "publish_to_feed", feed_id=feed["feed_id"]) + assert "not found" in tool_error(client, he, "publish_to_feed", feed_id=feed["feed_id"], recording_ids=[c]) + out = tool(client, he, "publish_to_feed", feed_id=feed["feed_id"], recording_ids=[a], title="Note", text="Read this") + assert len(out["added"]) == 2 + listed = tool(client, env["vi"], "list_feeds")["feeds"] + assert [f["feed_id"] for f in listed] == [feed["feed_id"]] and listed[0]["items"] == 2 + one = tool(client, env["vi"], "list_feeds", feed_id=feed["feed_id"]) + assert {i["kind"] for i in one["newest"]} == {"asset", "text"} and any(i.get("url") for i in one["newest"]) + assert tool(client, env["ca"], "list_feeds")["feeds"] == [] + assert "not found" in tool_error(client, env["ca"], "list_feeds", feed_id=feed["feed_id"]) diff --git a/fastapi_backend/tests/api/test_mcp.py b/fastapi_backend/tests/api/test_mcp.py index 27ec14753..e4ba15f44 100644 --- a/fastapi_backend/tests/api/test_mcp.py +++ b/fastapi_backend/tests/api/test_mcp.py @@ -83,6 +83,8 @@ def test_clients_are_sent_to_sign_in(client, app, env): "undo_topic_change", "write_note", "create_podcast", + "create_feed", + "publish_to_feed", "write_spec", "set_nsfw", "mark_nsfw", diff --git a/mkdocs.yml b/mkdocs.yml index 0f43c58e3..6fd7e1338 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -80,6 +80,7 @@ nav: - Chat rooms: chat-rooms.md - Email: assistant-email.md - Podcasts: podcasts.md + - Published feeds: feeds.md - Notes: notes.md - Web clipper: web-clipper.md - The assistant in your browser: browser-assistant.md diff --git a/nextjs-frontend/app/openapi-client/index.ts b/nextjs-frontend/app/openapi-client/index.ts index 43c7de15e..5de494fb7 100644 --- a/nextjs-frontend/app/openapi-client/index.ts +++ b/nextjs-frontend/app/openapi-client/index.ts @@ -19,6 +19,7 @@ export { Entities, Extensions, Fedora, + Feeds, Fields, Files, Graph as Graph2, @@ -505,6 +506,11 @@ export type { CreateExtensionVersionErrors, CreateExtensionVersionResponse, CreateExtensionVersionResponses, + CreateFeedData, + CreateFeedError, + CreateFeedErrors, + CreateFeedResponse, + CreateFeedResponses, CreateFieldData, CreateFieldError, CreateFieldErrors, @@ -757,6 +763,11 @@ export type { DeleteFaceTrackErrors, DeleteFaceTrackResponse, DeleteFaceTrackResponses, + DeleteFeedData, + DeleteFeedError, + DeleteFeedErrors, + DeleteFeedResponse, + DeleteFeedResponses, DeleteFieldData, DeleteFieldError, DeleteFieldErrors, @@ -1051,6 +1062,14 @@ export type { FacetCount, FedoraStatus, FedoraSyncResult, + Feed, + FeedCreate, + FeedItem, + FeedPublish, + FeedPublished, + FeedRefused, + FeedSettings, + FeedText, FetchBackupData, FetchBackupError, FetchBackupErrors, @@ -1228,6 +1247,11 @@ export type { GetFedoraStatusData, GetFedoraStatusResponse, GetFedoraStatusResponses, + GetFeedData, + GetFeedError, + GetFeedErrors, + GetFeedResponse, + GetFeedResponses, GetFieldData, GetFieldError, GetFieldErrors, @@ -1838,6 +1862,16 @@ export type { ListExtensionsErrors, ListExtensionsResponse, ListExtensionsResponses, + ListFeedItemsData, + ListFeedItemsError, + ListFeedItemsErrors, + ListFeedItemsResponse, + ListFeedItemsResponses, + ListFeedsData, + ListFeedsError, + ListFeedsErrors, + ListFeedsResponse, + ListFeedsResponses, ListFieldsData, ListFieldsError, ListFieldsErrors, @@ -2514,6 +2548,11 @@ export type { PublicSegment, PublicSpeaker, PublicTranscript, + PublishToFeedData, + PublishToFeedError, + PublishToFeedErrors, + PublishToFeedResponse, + PublishToFeedResponses, PurgeDeletedData, PurgeDeletedError, PurgeDeletedErrors, @@ -2577,6 +2616,14 @@ export type { RdfImportItem, RdfImportResult, RdfUnmatched, + ReadFeedAudioData, + ReadFeedAudioError, + ReadFeedAudioErrors, + ReadFeedAudioResponses, + ReadFeedData, + ReadFeedError, + ReadFeedErrors, + ReadFeedResponses, ReadFileData, ReadFileError, ReadFileErrors, @@ -2666,6 +2713,11 @@ export type { RemoveBudgetResponse, RemoveBudgetResponses, Removed, + RemoveFeedItemData, + RemoveFeedItemError, + RemoveFeedItemErrors, + RemoveFeedItemResponse, + RemoveFeedItemResponses, RemoveLocalModelData, RemoveLocalModelError, RemoveLocalModelErrors, @@ -2845,6 +2897,11 @@ export type { Roles, RoleUpdate, RollbackAsk, + RotateFeedTokenData, + RotateFeedTokenError, + RotateFeedTokenErrors, + RotateFeedTokenResponse, + RotateFeedTokenResponses, RotateNotifySecretData, RotateNotifySecretError, RotateNotifySecretErrors, @@ -3526,6 +3583,11 @@ export type { UpdateExtensionErrors, UpdateExtensionResponse, UpdateExtensionResponses, + UpdateFeedData, + UpdateFeedError, + UpdateFeedErrors, + UpdateFeedResponse, + UpdateFeedResponses, UpdateFieldData, UpdateFieldError, UpdateFieldErrors, diff --git a/nextjs-frontend/app/openapi-client/sdk.gen.ts b/nextjs-frontend/app/openapi-client/sdk.gen.ts index a8a1ba2f7..86dae25d3 100644 --- a/nextjs-frontend/app/openapi-client/sdk.gen.ts +++ b/nextjs-frontend/app/openapi-client/sdk.gen.ts @@ -189,6 +189,9 @@ import type { CreateExtensionVersionData, CreateExtensionVersionErrors, CreateExtensionVersionResponses, + CreateFeedData, + CreateFeedErrors, + CreateFeedResponses, CreateFieldData, CreateFieldErrors, CreateFieldResponses, @@ -335,6 +338,9 @@ import type { DeleteFaceTrackData, DeleteFaceTrackErrors, DeleteFaceTrackResponses, + DeleteFeedData, + DeleteFeedErrors, + DeleteFeedResponses, DeleteFieldData, DeleteFieldErrors, DeleteFieldResponses, @@ -573,6 +579,9 @@ import type { GetExtensionResponses, GetFedoraStatusData, GetFedoraStatusResponses, + GetFeedData, + GetFeedErrors, + GetFeedResponses, GetFieldData, GetFieldErrors, GetFieldResponses, @@ -901,6 +910,12 @@ import type { ListExtensionsData, ListExtensionsErrors, ListExtensionsResponses, + ListFeedItemsData, + ListFeedItemsErrors, + ListFeedItemsResponses, + ListFeedsData, + ListFeedsErrors, + ListFeedsResponses, ListFieldsData, ListFieldsErrors, ListFieldsResponses, @@ -1205,6 +1220,9 @@ import type { ProposeGraphChangeData, ProposeGraphChangeErrors, ProposeGraphChangeResponses, + PublishToFeedData, + PublishToFeedErrors, + PublishToFeedResponses, PurgeDeletedData, PurgeDeletedErrors, PurgeDeletedResponses, @@ -1237,6 +1255,12 @@ import type { QueueStepData, QueueStepErrors, QueueStepResponses, + ReadFeedAudioData, + ReadFeedAudioErrors, + ReadFeedAudioResponses, + ReadFeedData, + ReadFeedErrors, + ReadFeedResponses, ReadFileData, ReadFileErrors, ReadFileResponses, @@ -1274,6 +1298,9 @@ import type { RemoveBudgetData, RemoveBudgetErrors, RemoveBudgetResponses, + RemoveFeedItemData, + RemoveFeedItemErrors, + RemoveFeedItemResponses, RemoveLocalModelData, RemoveLocalModelErrors, RemoveLocalModelResponses, @@ -1372,6 +1399,9 @@ import type { RevokeTokenData, RevokeTokenErrors, RevokeTokenResponses, + RotateFeedTokenData, + RotateFeedTokenErrors, + RotateFeedTokenResponses, RotateNotifySecretData, RotateNotifySecretErrors, RotateNotifySecretResponses, @@ -1691,6 +1721,9 @@ import type { UpdateExtensionData, UpdateExtensionErrors, UpdateExtensionResponses, + UpdateFeedData, + UpdateFeedErrors, + UpdateFeedResponses, UpdateFieldData, UpdateFieldErrors, UpdateFieldResponses, @@ -12075,6 +12108,178 @@ export class Podcasts { } } +export class Feeds { + /** + * Read Feed + * + * A feed as RSS 2.0, with Apple Podcasts' tags for a podcast feed: what feed readers and podcast apps subscribe + * to. No session: the token in the address is the credential (404 for any other). Answers 304 to a reader whose + * copy (If-None-Match) is current. + */ + public static readFeed( + options: Options, + ): RequestResult { + return (options.client ?? client).get({ + url: "/api/v1/feeds/public/{token}", + ...options, + }); + } + + /** + * Read Feed Audio + * + * An item's audio (or video), with byte ranges, as podcast apps download it. The feed's token is the credential. + */ + public static readFeedAudio( + options: Options, + ): RequestResult { + return (options.client ?? client).get({ + url: "/api/v1/feeds/public/{token}/items/{iid}/audio", + ...options, + }); + } + + /** + * List Feeds + * + * Feeds in the namespaces you can read (or one of them), each with its private address. + */ + public static listFeeds( + options?: Options, + ): RequestResult { + return (options?.client ?? client).get({ + url: "/api/v1/feeds", + ...options, + }); + } + + /** + * Create Feed + * + * A new feed in a namespace you edit, with its private address. Audited as `feed.create`. + */ + public static createFeed( + options: Options, + ): RequestResult { + return (options.client ?? client).post({ + url: "/api/v1/feeds", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, + }, + }); + } + + /** + * Delete Feed + * + * Delete a feed and its items (editors): its address stops working at once. What the items were about stays. + * Audited as `feed.delete`. + */ + public static deleteFeed( + options: Options, + ): RequestResult { + return (options.client ?? client).delete({ + url: "/api/v1/feeds/{fid}", + ...options, + }); + } + + /** + * Get Feed + */ + public static getFeed( + options: Options, + ): RequestResult { + return (options.client ?? client).get({ + url: "/api/v1/feeds/{fid}", + ...options, + }); + } + + /** + * Update Feed + * + * Change a feed's settings (editors of its namespace). Fields left out stay as they are. + */ + public static updateFeed( + options: Options, + ): RequestResult { + return (options.client ?? client).patch({ + url: "/api/v1/feeds/{fid}", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, + }, + }); + } + + /** + * Rotate Feed Token + * + * A new private address for a feed (editors): the old one stops working at once, so readers subscribed to it + * need the new one. Audited as `feed.token`. + */ + public static rotateFeedToken( + options: Options, + ): RequestResult { + return (options.client ?? client).post({ + url: "/api/v1/feeds/{fid}/token", + ...options, + }); + } + + /** + * List Feed Items + * + * A feed's items, newest first. + */ + public static listFeedItems( + options: Options, + ): RequestResult { + return (options.client ?? client).get({ + url: "/api/v1/feeds/{fid}/items", + ...options, + }); + } + + /** + * Publish To Feed + * + * Add resources (podcast episodes too), timeline activities and text items to a feed (editors of its namespace). + * What's already in it isn't added twice; what may not show there (it's in a namespace not everyone who reads the + * feed can read) is refused, with why. Audited as `feed.publish`. + */ + public static publishToFeed( + options: Options, + ): RequestResult { + return (options.client ?? client).post({ + url: "/api/v1/feeds/{fid}/items", + ...options, + headers: { + "Content-Type": "application/json", + ...options.headers, + }, + }); + } + + /** + * Remove Feed Item + * + * Take an item out of a feed (editors). A routine may add it again; what it was about stays. + */ + public static removeFeedItem( + options: Options, + ): RequestResult { + return (options.client ?? client).delete({ + url: "/api/v1/feeds/{fid}/items/{iid}", + ...options, + }); + } +} + export class Specs { /** * Get Spec diff --git a/nextjs-frontend/app/openapi-client/types.gen.ts b/nextjs-frontend/app/openapi-client/types.gen.ts index 36a98b46d..10c07e74a 100644 --- a/nextjs-frontend/app/openapi-client/types.gen.ts +++ b/nextjs-frontend/app/openapi-client/types.gen.ts @@ -7486,6 +7486,380 @@ export type FedoraSyncResult = { [key: string]: unknown; }; +/** + * Feed + */ +export type Feed = { + /** + * Id + */ + id: number; + /** + * Space + */ + space: number; + /** + * Namespace + */ + namespace?: string | null; + /** + * Kind + */ + kind: "rss" | "podcast"; + /** + * Title + */ + title: string; + /** + * Description + */ + description?: string | null; + /** + * Author + */ + author?: string | null; + /** + * Language + */ + language?: string | null; + /** + * Category + */ + category?: string | null; + /** + * Explicit + */ + explicit?: boolean; + /** + * Image + */ + image?: string | null; + /** + * Max Items + */ + max_items: number; + /** + * Url + * + * the feed's private address: anyone with it can read the feed, so share it like a password + */ + url: string; + /** + * Path + * + * the address without the server + */ + path: string; + /** + * Page + * + * the feed's page in the web app + */ + page: string; + /** + * Items + * + * how many items it holds + */ + items: number; + /** + * Last Item At + */ + last_item_at?: string | null; + /** + * Fetched At + * + * when a feed reader or podcast app last read it + */ + fetched_at?: string | null; + /** + * Created By + */ + created_by?: string | null; + /** + * Created At + */ + created_at?: string | null; + /** + * Updated At + */ + updated_at?: string | null; + [key: string]: unknown; +}; + +/** + * FeedCreate + */ +export type FeedCreate = { + /** + * Title + */ + title: string; + /** + * Description + */ + description?: string | null; + /** + * Author + * + * who a podcast app shows it's by (default Lens) + */ + author?: string | null; + /** + * Language + * + * a language tag, like en or en-GB (default en) + */ + language?: string | null; + /** + * Category + * + * an Apple Podcasts category (podcast feeds; default Education) + */ + category?: string | null; + /** + * Explicit + */ + explicit?: boolean | null; + /** + * Image + * + * artwork: an https:// address of a square picture + */ + image?: string | null; + /** + * Max Items + * + * how many items the feed lists, newest first (default 50) + */ + max_items?: number | null; + /** + * Kind + */ + kind?: "rss" | "podcast"; + /** + * Namespace + * + * the namespace the feed belongs to: its editors manage it, its readers see it + */ + namespace: string; +}; + +/** + * FeedItem + */ +export type FeedItem = { + /** + * Id + */ + id: number; + /** + * Feed + */ + feed: number; + /** + * Kind + */ + kind: "asset" | "episode" | "activity" | "text"; + /** + * Guid + */ + guid: string; + /** + * Title + */ + title?: string | null; + /** + * Summary + */ + summary?: string | null; + /** + * Link + */ + link?: string | null; + /** + * Published At + */ + published_at: string; + /** + * Recording + */ + recording?: number | null; + /** + * Activity + */ + activity?: { + [key: string]: unknown; + } | null; + /** + * Categories + */ + categories?: Array | null; + /** + * Origin + * + * the routine run and workflow node that added it + */ + origin?: { + [key: string]: unknown; + } | null; + /** + * By + */ + by?: string | null; + /** + * Created At + */ + created_at?: string | null; + [key: string]: unknown; +}; + +/** + * FeedPublish + */ +export type FeedPublish = { + /** + * Recordings + * + * resources (and podcast episodes) to list + */ + recordings?: Array; + /** + * Activities + * + * timeline activities to list, by id + */ + activities?: Array; + /** + * Texts + * + * text items + */ + texts?: Array; +}; + +/** + * FeedPublished + */ +export type FeedPublished = { + /** + * Added + * + * the new items' ids + */ + added: Array; + /** + * Already + * + * how many were in the feed already + */ + already: number; + /** + * Refused + * + * what can't go in this feed, and why + */ + refused: Array; + [key: string]: unknown; +}; + +/** + * FeedRefused + */ +export type FeedRefused = { + /** + * What + */ + what: string; + /** + * Why + */ + why: string; + [key: string]: unknown; +}; + +/** + * FeedSettings + */ +export type FeedSettings = { + /** + * Title + */ + title?: string | null; + /** + * Description + */ + description?: string | null; + /** + * Author + * + * who a podcast app shows it's by (default Lens) + */ + author?: string | null; + /** + * Language + * + * a language tag, like en or en-GB (default en) + */ + language?: string | null; + /** + * Category + * + * an Apple Podcasts category (podcast feeds; default Education) + */ + category?: string | null; + /** + * Explicit + */ + explicit?: boolean | null; + /** + * Image + * + * artwork: an https:// address of a square picture + */ + image?: string | null; + /** + * Max Items + * + * how many items the feed lists, newest first (default 50) + */ + max_items?: number | null; + /** + * Kind + * + * rss lists anything; podcast lists items with audio, with Apple Podcasts' tags + */ + kind?: "rss" | "podcast" | null; +}; + +/** + * FeedText + */ +export type FeedText = { + /** + * Title + */ + title?: string | null; + /** + * Summary + * + * the item's text + */ + summary?: string | null; + /** + * Link + * + * an http or https address + */ + link?: string | null; + /** + * Guid + * + * what the item is about, so the same item isn't added twice + */ + guid?: string | null; +}; + /** * FieldCreate */ @@ -43988,6 +44362,352 @@ export type RegeneratePodcastResponses = { export type RegeneratePodcastResponse = RegeneratePodcastResponses[keyof RegeneratePodcastResponses]; +export type ReadFeedData = { + body?: never; + path: { + /** + * Token + */ + token: string; + }; + query?: never; + url: "/api/v1/feeds/public/{token}"; +}; + +export type ReadFeedErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type ReadFeedError = ReadFeedErrors[keyof ReadFeedErrors]; + +export type ReadFeedResponses = { + /** + * Successful Response + */ + 200: unknown; +}; + +export type ReadFeedAudioData = { + body?: never; + path: { + /** + * Token + */ + token: string; + /** + * Iid + */ + iid: number; + }; + query?: never; + url: "/api/v1/feeds/public/{token}/items/{iid}/audio"; +}; + +export type ReadFeedAudioErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type ReadFeedAudioError = ReadFeedAudioErrors[keyof ReadFeedAudioErrors]; + +export type ReadFeedAudioResponses = { + /** + * Successful Response + */ + 200: unknown; + /** + * a byte range + */ + 206: unknown; +}; + +export type ListFeedsData = { + body?: never; + path?: never; + query?: { + /** + * Namespace + */ + namespace?: string | null; + }; + url: "/api/v1/feeds"; +}; + +export type ListFeedsErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type ListFeedsError = ListFeedsErrors[keyof ListFeedsErrors]; + +export type ListFeedsResponses = { + /** + * Response Feeds-List Feeds + * + * Successful Response + */ + 200: Array; +}; + +export type ListFeedsResponse = ListFeedsResponses[keyof ListFeedsResponses]; + +export type CreateFeedData = { + body: FeedCreate; + path?: never; + query?: never; + url: "/api/v1/feeds"; +}; + +export type CreateFeedErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type CreateFeedError = CreateFeedErrors[keyof CreateFeedErrors]; + +export type CreateFeedResponses = { + /** + * Successful Response + */ + 201: Feed; +}; + +export type CreateFeedResponse = CreateFeedResponses[keyof CreateFeedResponses]; + +export type DeleteFeedData = { + body?: never; + path: { + /** + * Fid + */ + fid: number; + }; + query?: never; + url: "/api/v1/feeds/{fid}"; +}; + +export type DeleteFeedErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type DeleteFeedError = DeleteFeedErrors[keyof DeleteFeedErrors]; + +export type DeleteFeedResponses = { + /** + * Successful Response + */ + 200: Ok; +}; + +export type DeleteFeedResponse = DeleteFeedResponses[keyof DeleteFeedResponses]; + +export type GetFeedData = { + body?: never; + path: { + /** + * Fid + */ + fid: number; + }; + query?: never; + url: "/api/v1/feeds/{fid}"; +}; + +export type GetFeedErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type GetFeedError = GetFeedErrors[keyof GetFeedErrors]; + +export type GetFeedResponses = { + /** + * Successful Response + */ + 200: Feed; +}; + +export type GetFeedResponse = GetFeedResponses[keyof GetFeedResponses]; + +export type UpdateFeedData = { + body: FeedSettings; + path: { + /** + * Fid + */ + fid: number; + }; + query?: never; + url: "/api/v1/feeds/{fid}"; +}; + +export type UpdateFeedErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type UpdateFeedError = UpdateFeedErrors[keyof UpdateFeedErrors]; + +export type UpdateFeedResponses = { + /** + * Successful Response + */ + 200: Feed; +}; + +export type UpdateFeedResponse = UpdateFeedResponses[keyof UpdateFeedResponses]; + +export type RotateFeedTokenData = { + body?: never; + path: { + /** + * Fid + */ + fid: number; + }; + query?: never; + url: "/api/v1/feeds/{fid}/token"; +}; + +export type RotateFeedTokenErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type RotateFeedTokenError = RotateFeedTokenErrors[keyof RotateFeedTokenErrors]; + +export type RotateFeedTokenResponses = { + /** + * Successful Response + */ + 200: Feed; +}; + +export type RotateFeedTokenResponse = RotateFeedTokenResponses[keyof RotateFeedTokenResponses]; + +export type ListFeedItemsData = { + body?: never; + path: { + /** + * Fid + */ + fid: number; + }; + query?: { + /** + * Limit + */ + limit?: number; + /** + * Offset + */ + offset?: number; + }; + url: "/api/v1/feeds/{fid}/items"; +}; + +export type ListFeedItemsErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type ListFeedItemsError = ListFeedItemsErrors[keyof ListFeedItemsErrors]; + +export type ListFeedItemsResponses = { + /** + * Response Feeds-List Feed Items + * + * Successful Response + */ + 200: Array; +}; + +export type ListFeedItemsResponse = ListFeedItemsResponses[keyof ListFeedItemsResponses]; + +export type PublishToFeedData = { + body: FeedPublish; + path: { + /** + * Fid + */ + fid: number; + }; + query?: never; + url: "/api/v1/feeds/{fid}/items"; +}; + +export type PublishToFeedErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type PublishToFeedError = PublishToFeedErrors[keyof PublishToFeedErrors]; + +export type PublishToFeedResponses = { + /** + * Successful Response + */ + 200: FeedPublished; +}; + +export type PublishToFeedResponse = PublishToFeedResponses[keyof PublishToFeedResponses]; + +export type RemoveFeedItemData = { + body?: never; + path: { + /** + * Fid + */ + fid: number; + /** + * Iid + */ + iid: number; + }; + query?: never; + url: "/api/v1/feeds/{fid}/items/{iid}"; +}; + +export type RemoveFeedItemErrors = { + /** + * Validation Error + */ + 422: HttpValidationError; +}; + +export type RemoveFeedItemError = RemoveFeedItemErrors[keyof RemoveFeedItemErrors]; + +export type RemoveFeedItemResponses = { + /** + * Successful Response + */ + 200: Ok; +}; + +export type RemoveFeedItemResponse = RemoveFeedItemResponses[keyof RemoveFeedItemResponses]; + export type GetSpecData = { body?: never; path: { diff --git a/nextjs-frontend/openapi.json b/nextjs-frontend/openapi.json index 2d887e8f9..bad51bd64 100644 --- a/nextjs-frontend/openapi.json +++ b/nextjs-frontend/openapi.json @@ -31234,49 +31234,176 @@ } } }, - "/api/v1/resources/{rid}/spec": { - "post": { + "/api/v1/feeds/public/{token}": { + "get": { "tags": [ - "specs" + "feeds" ], - "summary": "Write Spec", - "description": "Write a technical spec from this asset's transcript as a note linked to it, in the background: every named\ndecision, every no and every \"not that, this\", every constraint, in the speaker's own words with when they said\nthem, and the gaps they left to decide later, flagged. It's written with the Spec from transcript prompt template\n(edited on the Templates page), or `template`; writing it again updates the same note, whose history keeps what it\nsaid before. It runs after what the asset's job still has to do. Needs the right to process the asset and a\nlanguage model (400 without one, or with no text and none on the way). Audited as `spec.write`.", - "operationId": "write_spec", + "summary": "Read Feed", + "description": "A feed as RSS 2.0, with Apple Podcasts' tags for a podcast feed: what feed readers and podcast apps subscribe\nto. No session: the token in the address is the credential (404 for any other). Answers 304 to a reader whose\ncopy (If-None-Match) is current.", + "operationId": "read_feed", "parameters": [ { - "name": "rid", + "name": "token", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Token" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/rss+xml": {} + } + }, + "304": { + "description": "unchanged since the reader's copy" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/v1/feeds/public/{token}/items/{iid}/audio": { + "get": { + "tags": [ + "feeds" + ], + "summary": "Read Feed Audio", + "description": "An item's audio (or video), with byte ranges, as podcast apps download it. The feed's token is the credential.", + "operationId": "read_feed_audio", + "parameters": [ + { + "name": "token", + "in": "path", + "required": true, + "schema": { + "type": "string", + "title": "Token" + } + }, + { + "name": "iid", "in": "path", "required": true, "schema": { "type": "integer", - "title": "Rid" + "title": "Iid" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "audio/*": {} + } + }, + "206": { + "description": "a byte range" + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/v1/feeds": { + "get": { + "tags": [ + "feeds" + ], + "summary": "List Feeds", + "description": "Feeds in the namespaces you can read (or one of them), each with its private address.", + "operationId": "list_feeds", + "parameters": [ + { + "name": "namespace", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Namespace" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Feed" + }, + "title": "Response Feeds-List Feeds" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } } } + } + }, + "post": { + "tags": [ + "feeds" ], + "summary": "Create Feed", + "description": "A new feed in a namespace you edit, with its private address. Audited as `feed.create`.", + "operationId": "create_feed", "requestBody": { + "required": true, "content": { "application/json": { "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/SpecWrite" - }, - { - "type": "null" - } - ], - "title": "Body" + "$ref": "#/components/schemas/FeedCreate" } } } }, "responses": { - "202": { + "201": { "description": "Successful Response", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/JobQueued" + "$ref": "#/components/schemas/Feed" } } } @@ -31292,22 +31419,23 @@ } } } - }, + } + }, + "/api/v1/feeds/{fid}": { "get": { "tags": [ - "specs" + "feeds" ], - "summary": "Get Spec", - "description": "What there is of this asset's spec: its note and what it holds when it's written, the job writing it, or why\nthe last one failed; and the template it was (or would be) written with.", - "operationId": "get_spec", + "summary": "Get Feed", + "operationId": "get_feed", "parameters": [ { - "name": "rid", + "name": "fid", "in": "path", "required": true, "schema": { "type": "integer", - "title": "Rid" + "title": "Fid" } } ], @@ -31317,7 +31445,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Spec" + "$ref": "#/components/schemas/Feed" } } } @@ -31333,90 +31461,1103 @@ } } } - } - } - }, - "components": { - "schemas": { - "AccessRequest": { - "properties": { - "recording": { - "type": "integer", - "title": "Recording" - }, - "title": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Title" - }, - "namespace": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Namespace" - }, - "account": { - "type": "integer", - "title": "Account" - }, - "email": { - "type": "string", - "title": "Email" - }, - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" + }, + "patch": { + "tags": [ + "feeds" + ], + "summary": "Update Feed", + "description": "Change a feed's settings (editors of its namespace). Fields left out stay as they are.", + "operationId": "update_feed", + "parameters": [ + { + "name": "fid", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "title": "Fid" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeedSettings" } - ], - "title": "Name" - }, - "message": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Feed" + } } - ], - "title": "Message" + } }, - "at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "delete": { + "tags": [ + "feeds" + ], + "summary": "Delete Feed", + "description": "Delete a feed and its items (editors): its address stops working at once. What the items were about stays.\nAudited as `feed.delete`.", + "operationId": "delete_feed", + "parameters": [ + { + "name": "fid", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "title": "Fid" + } + } + ], + "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/feeds/{fid}/token": { + "post": { + "tags": [ + "feeds" + ], + "summary": "Rotate Feed Token", + "description": "A new private address for a feed (editors): the old one stops working at once, so readers subscribed to it\nneed the new one. Audited as `feed.token`.", + "operationId": "rotate_feed_token", + "parameters": [ + { + "name": "fid", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "title": "Fid" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Feed" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/v1/feeds/{fid}/items": { + "get": { + "tags": [ + "feeds" + ], + "summary": "List Feed Items", + "description": "A feed's items, newest first.", + "operationId": "list_feed_items", + "parameters": [ + { + "name": "fid", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "title": "Fid" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "maximum": 200, + "minimum": 1, + "default": 50, + "title": "Limit" + } + }, + { + "name": "offset", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "minimum": 0, + "default": 0, + "title": "Offset" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FeedItem" + }, + "title": "Response Feeds-List Feed Items" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "post": { + "tags": [ + "feeds" + ], + "summary": "Publish To Feed", + "description": "Add resources (podcast episodes too), timeline activities and text items to a feed (editors of its namespace).\nWhat's already in it isn't added twice; what may not show there (it's in a namespace not everyone who reads the\nfeed can read) is refused, with why. Audited as `feed.publish`.", + "operationId": "publish_to_feed", + "parameters": [ + { + "name": "fid", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "title": "Fid" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeedPublish" + } + } + } + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeedPublished" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, + "/api/v1/feeds/{fid}/items/{iid}": { + "delete": { + "tags": [ + "feeds" + ], + "summary": "Remove Feed Item", + "description": "Take an item out of a feed (editors). A routine may add it again; what it was about stays.", + "operationId": "remove_feed_item", + "parameters": [ + { + "name": "fid", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "title": "Fid" + } + }, + { + "name": "iid", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "title": "Iid" + } + } + ], + "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/resources/{rid}/spec": { + "post": { + "tags": [ + "specs" + ], + "summary": "Write Spec", + "description": "Write a technical spec from this asset's transcript as a note linked to it, in the background: every named\ndecision, every no and every \"not that, this\", every constraint, in the speaker's own words with when they said\nthem, and the gaps they left to decide later, flagged. It's written with the Spec from transcript prompt template\n(edited on the Templates page), or `template`; writing it again updates the same note, whose history keeps what it\nsaid before. It runs after what the asset's job still has to do. Needs the right to process the asset and a\nlanguage model (400 without one, or with no text and none on the way). Audited as `spec.write`.", + "operationId": "write_spec", + "parameters": [ + { + "name": "rid", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "title": "Rid" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/SpecWrite" + }, + { + "type": "null" + } + ], + "title": "Body" + } + } + } + }, + "responses": { + "202": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/JobQueued" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + }, + "get": { + "tags": [ + "specs" + ], + "summary": "Get Spec", + "description": "What there is of this asset's spec: its note and what it holds when it's written, the job writing it, or why\nthe last one failed; and the template it was (or would be) written with.", + "operationId": "get_spec", + "parameters": [ + { + "name": "rid", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "title": "Rid" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Spec" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "AccessRequest": { + "properties": { + "recording": { + "type": "integer", + "title": "Recording" + }, + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Title" + }, + "namespace": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Namespace" + }, + "account": { + "type": "integer", + "title": "Account" + }, + "email": { + "type": "string", + "title": "Email" + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Name" + }, + "message": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Message" + }, + "at": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "At" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "approved", + "declined" + ], + "title": "Status" + }, + "decided_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Decided By" + }, + "decided_at": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Decided At" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "recording", + "account", + "email", + "status" + ], + "title": "AccessRequest", + "description": "Someone asking for permission on an asset (docs/access.md)." + }, + "AccountToken": { + "properties": { + "id": { + "type": "integer", + "title": "Id" + }, + "name": { + "type": "string", + "title": "Name" + }, + "scope": { + "type": "string", + "enum": [ + "read", + "write" + ], + "title": "Scope" + }, + "prefix": { + "type": "string", + "title": "Prefix" + }, + "created_at": { + "type": "string", + "title": "Created At" + }, + "expires_at": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Expires At" + }, + "last_used_at": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Last Used At" + }, + "namespace": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Namespace", + "description": "the one namespace it opens (its own servers alone), when it was made for one" + }, + "account": { + "type": "integer", + "title": "Account" + }, + "email": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Email" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "id", + "name", + "scope", + "prefix", + "created_at", + "account" + ], + "title": "AccountToken", + "description": "Anyone's key, for admins." + }, + "ActionInfo": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "label": { + "type": "string", + "title": "Label" + }, + "group": { + "type": "string", + "title": "Group" + }, + "description": { + "type": "string", + "title": "Description", + "default": "" + }, + "params": { + "additionalProperties": true, + "type": "object", + "title": "Params", + "description": "a JSON Schema (type object) of its params; a string holding {{ }} stands for any type" + }, + "required": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Required" + }, + "effect": { + "type": "string", + "enum": [ + "read", + "self", + "lens", + "out", + "depends" + ], + "title": "Effect", + "description": "what it reaches: read and self run at once; lens asks unless it changes the event's own object; out asks first unless you let it run on its own; depends: worked out from its params" + }, + "output": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Output", + "description": "a JSON Schema of what it gives back, for later nodes (steps.)" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "name", + "label", + "group", + "params", + "effect" + ], + "title": "ActionInfo" + }, + "ActivityActor": { + "properties": { + "type": { + "type": "string", + "enum": [ + "Service", + "Person", + "Application" + ], + "title": "Type" + }, + "id": { + "type": "string", + "title": "Id", + "description": "a Lens reference, like lens:account/1 or lens:automation/4" + }, + "name": { + "type": "string", + "title": "Name" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "type", + "id", + "name" + ], + "title": "ActivityActor" + }, + "ActivityCosts": { + "properties": { + "period": { + "type": "string", + "title": "Period" + }, + "since": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Since" + }, + "costs": { + "additionalProperties": { + "$ref": "#/components/schemas/ResourceSpend" + }, + "type": "object", + "title": "Costs", + "description": "by resource; ones you can't see are left out" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "period", + "costs" + ], + "title": "ActivityCosts" + }, + "ActivityEntry": { + "properties": { + "id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Id", + "description": "the ledger row's id; none for an audit log entry" + }, + "at": { + "type": "string", + "title": "At" + }, + "kind": { + "type": "string", + "enum": [ + "in", + "out", + "run", + "change" + ], + "title": "Kind", + "description": "in: an API request; out: a call Lens made (a model, embeddings, the decision model, a webhook, a web tool); run: a job or routine run ended; change: an audit log entry, or a change to the entity graph (action `graph.`)" + }, + "action": { + "type": "string", + "title": "Action", + "description": "what it was: `POST /api/v1/routines/{rid}/run`, `model.chat`, `job.succeeded`, `routine.update`" + }, + "resources": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Resources", + "description": "every resource it counts for, as table:id" + }, + "actor": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Actor", + "description": "the account that made it, when a person did" + }, + "email": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Email" + }, + "model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Model" + }, + "tokens_in": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Tokens In" + }, + "tokens_out": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Tokens Out" + }, + "cost_usd": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Cost Usd", + "description": "estimated from the prices in Settings; none when the model has no price" + }, + "ms": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Ms" + }, + "ok": { + "type": "boolean", + "title": "Ok", + "default": true + }, + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Error", + "description": "the error's type or HTTP status; never its message" + }, + "detail": { + "title": "Detail" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "at", + "kind", + "action" + ], + "title": "ActivityEntry" + }, + "ActivityKind": { + "properties": { + "name": { + "type": "string", + "title": "Name" + }, + "label": { + "type": "string", + "title": "Label" + }, + "source": { + "type": "string", + "title": "Source" + }, + "type": { + "type": "string", + "title": "Type", + "description": "the Activity Streams verb its activities have" + }, + "object_type": { + "type": "string", + "title": "Object Type" + }, + "parent": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" } ], - "title": "At" + "title": "Parent" }, - "status": { + "children": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Children" + }, + "fields": { + "additionalProperties": true, + "type": "object", + "title": "Fields", + "description": "JSON Schemas of its own object, actor or target fields" + }, + "schema": { + "additionalProperties": true, + "type": "object", + "title": "Schema", + "description": "a JSON Schema of its activities, with every field" + }, + "untrusted": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Untrusted" + }, + "noisy": { + "type": "boolean", + "title": "Noisy", + "description": "left out of the timeline unless named", + "default": false + }, + "sample": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Sample" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "name", + "label", + "source", + "type", + "object_type", + "schema" + ], + "title": "ActivityKind" + }, + "ActivityLens": { + "properties": { + "source": { "type": "string", - "enum": [ - "pending", - "approved", - "declined" + "title": "Source", + "description": "the source that made it, like recordings or log" + }, + "pos": { + "items": {}, + "type": "array", + "title": "Pos", + "description": "the source's position, [time, id]; for the stream machinery" + }, + "untrusted": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Untrusted", + "description": "dotted paths holding text from outside Lens" + }, + "cause": { + "anyOf": [ + { + "additionalProperties": { + "type": "integer" + }, + "type": "object" + }, + { + "type": "null" + } ], - "title": "Status" + "title": "Cause", + "description": "{automation, run, depth} when an automation caused it" }, - "decided_by": { + "spaces": { + "anyOf": [ + { + "items": { + "type": "integer" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Spaces", + "description": "every namespace it belongs to, when there are several" + }, + "audience": { + "anyOf": [ + { + "type": "string", + "enum": [ + "space", + "owner", + "admins" + ] + }, + { + "type": "null" + } + ], + "title": "Audience", + "description": "who may see it (default: space)" + }, + "owner": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Owner", + "description": "the account that alone sees it, with audience owner" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "source", + "pos" + ], + "title": "ActivityLens" + }, + "ActivityMark": { + "properties": { + "reviewed": { + "type": "boolean", + "title": "Reviewed", + "default": false + }, + "important": { + "type": "boolean", + "title": "Important", + "default": false + }, + "hidden": { + "type": "boolean", + "title": "Hidden", + "default": false + }, + "at": { "anyOf": [ { "type": "string" @@ -31425,9 +32566,22 @@ "type": "null" } ], - "title": "Decided By" + "title": "At", + "description": "when you last marked it" + } + }, + "additionalProperties": true, + "type": "object", + "title": "ActivityMark", + "description": "Your own review marks on an activity; nobody else sees them." + }, + "ActivityObject": { + "properties": { + "type": { + "type": "string", + "title": "Type" }, - "decided_at": { + "id": { "anyOf": [ { "type": "string" @@ -31436,47 +32590,94 @@ "type": "null" } ], - "title": "Decided At" + "title": "Id", + "description": "a Lens reference, like lens:recording/7" + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Name" + }, + "url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Url", + "description": "its page in the web app, relative to it" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "type" + ], + "title": "ActivityObject", + "description": "What the activity is about; each kind adds its own fields (GET /activities/kinds has its schema)." + }, + "ActivityPage": { + "properties": { + "items": { + "items": { + "$ref": "#/components/schemas/StreamActivity" + }, + "type": "array", + "title": "Items", + "description": "newest first" + }, + "next": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Next", + "description": "give it as before for the page after; null at the end" + }, + "namespaces": { + "additionalProperties": { + "type": "string" + }, + "type": "object", + "title": "Namespaces", + "description": "the names of the namespaces in items, by id" + }, + "marks": { + "additionalProperties": { + "$ref": "#/components/schemas/ActivityMark" + }, + "type": "object", + "title": "Marks", + "description": "your marks on items, by id (those you marked)" } }, "additionalProperties": true, "type": "object", "required": [ - "recording", - "account", - "email", - "status" + "items" ], - "title": "AccessRequest", - "description": "Someone asking for permission on an asset (docs/access.md)." + "title": "ActivityPage" }, - "AccountToken": { + "ActivityTop": { "properties": { - "id": { - "type": "integer", - "title": "Id" - }, - "name": { - "type": "string", - "title": "Name" - }, - "scope": { - "type": "string", - "enum": [ - "read", - "write" - ], - "title": "Scope" - }, - "prefix": { - "type": "string", - "title": "Prefix" - }, - "created_at": { + "period": { "type": "string", - "title": "Created At" + "title": "Period" }, - "expires_at": { + "since": { "anyOf": [ { "type": "string" @@ -31485,9 +32686,27 @@ "type": "null" } ], - "title": "Expires At" + "title": "Since" }, - "last_used_at": { + "resources": { + "items": { + "$ref": "#/components/schemas/ResourceCost" + }, + "type": "array", + "title": "Resources" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "period", + "resources" + ], + "title": "ActivityTop" + }, + "ActivityTotals": { + "properties": { + "resource": { "anyOf": [ { "type": "string" @@ -31496,9 +32715,13 @@ "type": "null" } ], - "title": "Last Used At" + "title": "Resource" }, - "namespace": { + "period": { + "type": "string", + "title": "Period" + }, + "since": { "anyOf": [ { "type": "string" @@ -31507,237 +32730,287 @@ "type": "null" } ], - "title": "Namespace", - "description": "the one namespace it opens (its own servers alone), when it was made for one" + "title": "Since" }, - "account": { + "calls": { "type": "integer", - "title": "Account" + "title": "Calls" }, - "email": { + "failed": { + "type": "integer", + "title": "Failed" + }, + "tokens_in": { + "type": "integer", + "title": "Tokens In" + }, + "tokens_out": { + "type": "integer", + "title": "Tokens Out" + }, + "cost_usd": { + "type": "number", + "title": "Cost Usd", + "description": "what its calls cost (run rows repeat their calls' cost and aren't added again)" + }, + "ms": { + "type": "integer", + "title": "Ms" + }, + "unpriced": { + "type": "integer", + "title": "Unpriced", + "description": "calls that cost something but have no figure (a model with no price, a reply without token counts)", + "default": 0 + }, + "estimate": { + "type": "boolean", + "title": "Estimate", + "description": "true when unpriced calls make cost_usd a floor rather than exact", + "default": false + }, + "by_kind": { + "additionalProperties": { + "$ref": "#/components/schemas/KindTotals" + }, + "type": "object", + "title": "By Kind" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "period", + "calls", + "failed", + "tokens_in", + "tokens_out", + "cost_usd", + "ms", + "by_kind" + ], + "title": "ActivityTotals" + }, + "AnalyticsChurn": { + "properties": { + "previous_active": { + "type": "integer", + "title": "Previous Active" + }, + "retained": { + "type": "integer", + "title": "Retained" + }, + "churned": { + "type": "integer", + "title": "Churned" + }, + "rate": { "anyOf": [ { - "type": "string" + "type": "number" }, { "type": "null" } ], - "title": "Email" + "title": "Rate" + }, + "returning": { + "type": "integer", + "title": "Returning" } }, "additionalProperties": true, "type": "object", "required": [ - "id", - "name", - "scope", - "prefix", - "created_at", - "account" + "previous_active", + "retained", + "churned", + "returning" ], - "title": "AccountToken", - "description": "Anyone's key, for admins." + "title": "AnalyticsChurn" }, - "ActionInfo": { + "AnalyticsCohort": { "properties": { - "name": { - "type": "string", - "title": "Name" - }, - "label": { - "type": "string", - "title": "Label" - }, - "group": { - "type": "string", - "title": "Group" - }, - "description": { + "week": { "type": "string", - "title": "Description", - "default": "" + "title": "Week" }, - "params": { - "additionalProperties": true, - "type": "object", - "title": "Params", - "description": "a JSON Schema (type object) of its params; a string holding {{ }} stands for any type" + "users": { + "type": "integer", + "title": "Users" }, - "required": { + "retention": { "items": { - "type": "string" + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] }, "type": "array", - "title": "Required" - }, - "effect": { - "type": "string", - "enum": [ - "read", - "self", - "lens", - "out", - "depends" - ], - "title": "Effect", - "description": "what it reaches: read and self run at once; lens asks unless it changes the event's own object; out asks first unless you let it run on its own; depends: worked out from its params" - }, - "output": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Output", - "description": "a JSON Schema of what it gives back, for later nodes (steps.)" + "title": "Retention" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "week", + "users", + "retention" + ], + "title": "AnalyticsCohort" + }, + "AnalyticsDay": { + "properties": { + "day": { + "type": "string", + "title": "Day" + }, + "active_users": { + "type": "integer", + "title": "Active Users" + }, + "actions": { + "type": "integer", + "title": "Actions" } }, "additionalProperties": true, "type": "object", "required": [ - "name", - "label", - "group", - "params", - "effect" + "day", + "active_users", + "actions" ], - "title": "ActionInfo" + "title": "AnalyticsDay" }, - "ActivityActor": { + "AnalyticsEvent": { "properties": { - "type": { + "name": { "type": "string", - "enum": [ - "Service", - "Person", - "Application" - ], - "title": "Type" + "title": "Name" }, - "id": { + "description": { "type": "string", - "title": "Id", - "description": "a Lens reference, like lens:account/1 or lens:automation/4" + "title": "Description" }, - "name": { - "type": "string", - "title": "Name" + "on": { + "type": "boolean", + "title": "On" } }, "additionalProperties": true, "type": "object", "required": [ - "type", - "id", - "name" + "name", + "description", + "on" ], - "title": "ActivityActor" + "title": "AnalyticsEvent" }, - "ActivityCosts": { + "AnalyticsFeature": { "properties": { - "period": { + "feature": { "type": "string", - "title": "Period" + "title": "Feature" }, - "since": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Since" + "actions": { + "type": "integer", + "title": "Actions" }, - "costs": { - "additionalProperties": { - "$ref": "#/components/schemas/ResourceSpend" - }, - "type": "object", - "title": "Costs", - "description": "by resource; ones you can't see are left out" + "users": { + "type": "integer", + "title": "Users" } }, "additionalProperties": true, "type": "object", "required": [ - "period", - "costs" + "feature", + "actions", + "users" ], - "title": "ActivityCosts" + "title": "AnalyticsFeature" }, - "ActivityEntry": { + "AnalyticsMetrics": { "properties": { - "id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Id", - "description": "the ledger row's id; none for an audit log entry" - }, - "at": { - "type": "string", - "title": "At" + "days": { + "type": "integer", + "title": "Days" }, - "kind": { + "since": { "type": "string", - "enum": [ - "in", - "out", - "run", - "change" - ], - "title": "Kind", - "description": "in: an API request; out: a call Lens made (a model, embeddings, the decision model, a webhook, a web tool); run: a job or routine run ended; change: an audit log entry, or a change to the entity graph (action `graph.`)" + "title": "Since" }, - "action": { + "until": { "type": "string", - "title": "Action", - "description": "what it was: `POST /api/v1/routines/{rid}/run`, `model.chat`, `job.succeeded`, `routine.update`" + "title": "Until" }, - "resources": { + "daily": { "items": { - "type": "string" + "$ref": "#/components/schemas/AnalyticsDay" }, "type": "array", - "title": "Resources", - "description": "every resource it counts for, as table:id" + "title": "Daily" }, - "actor": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Actor", - "description": "the account that made it, when a person did" + "dau": { + "type": "integer", + "title": "Dau" }, - "email": { + "wau": { + "type": "integer", + "title": "Wau" + }, + "mau": { + "type": "integer", + "title": "Mau" + }, + "stickiness": { "anyOf": [ { - "type": "string" + "type": "number" }, { "type": "null" } ], - "title": "Email" + "title": "Stickiness" }, - "model": { + "accounts": { + "type": "integer", + "title": "Accounts" + }, + "active_users": { + "type": "integer", + "title": "Active Users" + }, + "new_users": { + "type": "integer", + "title": "New Users" + }, + "churn": { + "$ref": "#/components/schemas/AnalyticsChurn" + }, + "retention": { + "items": { + "$ref": "#/components/schemas/AnalyticsCohort" + }, + "type": "array", + "title": "Retention" + }, + "features": { + "items": { + "$ref": "#/components/schemas/AnalyticsFeature" + }, + "type": "array", + "title": "Features" + }, + "last_active_day": { "anyOf": [ { "type": "string" @@ -31746,9 +33019,9 @@ "type": "null" } ], - "title": "Model" + "title": "Last Active Day" }, - "tokens_in": { + "days_since_active": { "anyOf": [ { "type": "integer" @@ -31757,48 +33030,81 @@ "type": "null" } ], - "title": "Tokens In" + "title": "Days Since Active" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "days", + "since", + "until", + "daily", + "dau", + "wau", + "mau", + "accounts", + "active_users", + "new_users", + "churn", + "retention", + "features" + ], + "title": "AnalyticsMetrics", + "description": "Active people, churn, retention and feature use, worked out on this machine from the activity ledger and\nsign-ins (docs/analytics.md#the-numbers)." + }, + "AnalyticsStatus": { + "properties": { + "enabled": { + "type": "boolean", + "title": "Enabled" }, - "tokens_out": { + "configured": { + "type": "boolean", + "title": "Configured" + }, + "measurement_id": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Tokens Out" + "title": "Measurement Id" }, - "cost_usd": { + "client_id": { "anyOf": [ { - "type": "number" + "type": "string" }, { "type": "null" } ], - "title": "Cost Usd", - "description": "estimated from the prices in Settings; none when the model has no price" + "title": "Client Id" }, - "ms": { + "last_sent_at": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Ms" + "title": "Last Sent At" }, - "ok": { - "type": "boolean", - "title": "Ok", - "default": true + "last_sent": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Last Sent", + "default": [] }, - "error": { + "last_error": { "anyOf": [ { "type": "string" @@ -31807,46 +33113,33 @@ "type": "null" } ], - "title": "Error", - "description": "the error's type or HTTP status; never its message" + "title": "Last Error" }, - "detail": { - "title": "Detail" + "events": { + "items": { + "$ref": "#/components/schemas/AnalyticsEvent" + }, + "type": "array", + "title": "Events" } }, "additionalProperties": true, "type": "object", "required": [ - "at", - "kind", - "action" + "enabled", + "configured", + "events" ], - "title": "ActivityEntry" + "title": "AnalyticsStatus", + "description": "Whether usage statistics go to Google Analytics, and how the last send went (docs/analytics.md)." }, - "ActivityKind": { + "AnalyticsTestResult": { "properties": { - "name": { - "type": "string", - "title": "Name" - }, - "label": { - "type": "string", - "title": "Label" - }, - "source": { - "type": "string", - "title": "Source" - }, - "type": { - "type": "string", - "title": "Type", - "description": "the Activity Streams verb its activities have" - }, - "object_type": { - "type": "string", - "title": "Object Type" + "ok": { + "type": "boolean", + "title": "Ok" }, - "parent": { + "error": { "anyOf": [ { "type": "string" @@ -31855,196 +33148,243 @@ "type": "null" } ], - "title": "Parent" + "title": "Error" }, - "children": { + "messages": { "items": { "type": "string" }, "type": "array", - "title": "Children" + "title": "Messages", + "default": [] + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "ok" + ], + "title": "AnalyticsTestResult" + }, + "AnswerCheck": { + "properties": { + "claims": { + "type": "integer", + "title": "Claims", + "description": "sentences that cite a source" }, - "fields": { - "additionalProperties": true, - "type": "object", - "title": "Fields", - "description": "JSON Schemas of its own object, actor or target fields" + "supported": { + "type": "integer", + "title": "Supported", + "description": "claims the cited excerpts support" }, - "schema": { - "additionalProperties": true, - "type": "object", - "title": "Schema", - "description": "a JSON Schema of its activities, with every field" + "verdicts": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array", + "title": "Verdicts", + "default": [] }, - "untrusted": { + "uncited": { "items": { "type": "string" }, "type": "array", - "title": "Untrusted" - }, - "noisy": { - "type": "boolean", - "title": "Noisy", - "description": "left out of the timeline unless named", - "default": false - }, - "sample": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Sample" + "title": "Uncited", + "default": [] } }, "additionalProperties": true, "type": "object", "required": [ - "name", - "label", - "source", - "type", - "object_type", - "schema" + "claims", + "supported" ], - "title": "ActivityKind" + "title": "AnswerCheck" }, - "ActivityLens": { + "ApiToken": { "properties": { - "source": { + "id": { + "type": "integer", + "title": "Id" + }, + "name": { "type": "string", - "title": "Source", - "description": "the source that made it, like recordings or log" + "title": "Name" }, - "pos": { - "items": {}, - "type": "array", - "title": "Pos", - "description": "the source's position, [time, id]; for the stream machinery" + "scope": { + "type": "string", + "enum": [ + "read", + "write" + ], + "title": "Scope" }, - "untrusted": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Untrusted", - "description": "dotted paths holding text from outside Lens" + "prefix": { + "type": "string", + "title": "Prefix" }, - "cause": { + "created_at": { + "type": "string", + "title": "Created At" + }, + "expires_at": { "anyOf": [ { - "additionalProperties": { - "type": "integer" - }, - "type": "object" + "type": "string" }, { "type": "null" } ], - "title": "Cause", - "description": "{automation, run, depth} when an automation caused it" + "title": "Expires At" }, - "spaces": { + "last_used_at": { "anyOf": [ { - "items": { - "type": "integer" - }, - "type": "array" + "type": "string" }, { "type": "null" } ], - "title": "Spaces", - "description": "every namespace it belongs to, when there are several" + "title": "Last Used At" }, - "audience": { + "namespace": { "anyOf": [ { - "type": "string", - "enum": [ - "space", - "owner", - "admins" - ] + "type": "string" }, { "type": "null" } ], - "title": "Audience", - "description": "who may see it (default: space)" + "title": "Namespace", + "description": "the one namespace it opens (its own servers alone), when it was made for one" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "id", + "name", + "scope", + "prefix", + "created_at" + ], + "title": "ApiToken" + }, + "ApiTokenCreate": { + "properties": { + "name": { + "type": "string", + "title": "Name", + "default": "token" }, - "owner": { + "scope": { + "type": "string", + "enum": [ + "read", + "write" + ], + "title": "Scope", + "default": "read" + }, + "namespace": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Owner", - "description": "the account that alone sees it, with audience owner" + "title": "Namespace", + "description": "a namespace you can read: the key opens that namespace's own MCP server and chat completions alone, and nothing else in Lens; none: whatever you can reach" + }, + "days": { + "anyOf": [ + { + "type": "integer", + "maximum": 3650.0, + "minimum": 0.0 + }, + { + "type": "null" + } + ], + "title": "Days", + "description": "how long it lasts; default: tokens.default_days; 0: never expires, when tokens.never_expire allows" + } + }, + "additionalProperties": false, + "type": "object", + "title": "ApiTokenCreate" + }, + "ApiTokenCreated": { + "properties": { + "id": { + "type": "integer", + "title": "Id" + }, + "token": { + "type": "string", + "title": "Token" + }, + "note": { + "type": "string", + "title": "Note", + "default": "copy it now; it won't be shown again" } }, "additionalProperties": true, "type": "object", "required": [ - "source", - "pos" + "id", + "token" ], - "title": "ActivityLens" + "title": "ApiTokenCreated" }, - "ActivityMark": { + "ApiTokenRename": { "properties": { - "reviewed": { - "type": "boolean", - "title": "Reviewed", - "default": false - }, - "important": { - "type": "boolean", - "title": "Important", - "default": false - }, - "hidden": { - "type": "boolean", - "title": "Hidden", - "default": false + "name": { + "type": "string", + "maxLength": 80, + "minLength": 1, + "title": "Name" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "name" + ], + "title": "ApiTokenRename" + }, + "Approval": { + "properties": { + "id": { + "type": "integer", + "title": "Id" }, - "at": { + "chat": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "At", - "description": "when you last marked it" - } - }, - "additionalProperties": true, - "type": "object", - "title": "ActivityMark", - "description": "Your own review marks on an activity; nobody else sees them." - }, - "ActivityObject": { - "properties": { - "type": { + "title": "Chat" + }, + "tool": { "type": "string", - "title": "Type" + "title": "Tool" }, - "id": { + "summary": { "anyOf": [ { "type": "string" @@ -32053,10 +33393,17 @@ "type": "null" } ], - "title": "Id", - "description": "a Lens reference, like lens:recording/7" + "title": "Summary" }, - "name": { + "estimate": { + "title": "Estimate" + }, + "status": { + "type": "string", + "title": "Status", + "description": "pending (waiting), running, done, failed, declined or expired" + }, + "created_at": { "anyOf": [ { "type": "string" @@ -32065,9 +33412,12 @@ "type": "null" } ], - "title": "Name" + "title": "Created At" }, - "url": { + "result": { + "title": "Result" + }, + "error": { "anyOf": [ { "type": "string" @@ -32076,100 +33426,31 @@ "type": "null" } ], - "title": "Url", - "description": "its page in the web app, relative to it" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "type" - ], - "title": "ActivityObject", - "description": "What the activity is about; each kind adds its own fields (GET /activities/kinds has its schema)." - }, - "ActivityPage": { - "properties": { - "items": { - "items": { - "$ref": "#/components/schemas/StreamActivity" - }, - "type": "array", - "title": "Items", - "description": "newest first" + "title": "Error" }, - "next": { + "origin": { "anyOf": [ { - "type": "string" + "$ref": "#/components/schemas/ApprovalOrigin" }, { "type": "null" } ], - "title": "Next", - "description": "give it as before for the page after; null at the end" - }, - "namespaces": { - "additionalProperties": { - "type": "string" - }, - "type": "object", - "title": "Namespaces", - "description": "the names of the namespaces in items, by id" - }, - "marks": { - "additionalProperties": { - "$ref": "#/components/schemas/ActivityMark" - }, - "type": "object", - "title": "Marks", - "description": "your marks on items, by id (those you marked)" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "items" - ], - "title": "ActivityPage" - }, - "ActivityTop": { - "properties": { - "period": { - "type": "string", - "title": "Period" + "description": "the automation run that asked, when one did" }, - "since": { + "intent": { "anyOf": [ { - "type": "string" + "$ref": "#/components/schemas/ApprovalIntent" }, { "type": "null" } ], - "title": "Since" + "description": "an automation's action: what it would do" }, - "resources": { - "items": { - "$ref": "#/components/schemas/ResourceCost" - }, - "type": "array", - "title": "Resources" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "period", - "resources" - ], - "title": "ActivityTop" - }, - "ActivityTotals": { - "properties": { - "resource": { + "automation": { "anyOf": [ { "type": "string" @@ -32178,377 +33459,334 @@ "type": "null" } ], - "title": "Resource" - }, - "period": { - "type": "string", - "title": "Period" + "title": "Automation", + "description": "the automation's name" }, - "since": { + "space": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Since" - }, - "calls": { - "type": "integer", - "title": "Calls" - }, - "failed": { - "type": "integer", - "title": "Failed" - }, - "tokens_in": { - "type": "integer", - "title": "Tokens In" - }, - "tokens_out": { - "type": "integer", - "title": "Tokens Out" - }, - "cost_usd": { - "type": "number", - "title": "Cost Usd", - "description": "what its calls cost (run rows repeat their calls' cost and aren't added again)" - }, - "ms": { - "type": "integer", - "title": "Ms" - }, - "unpriced": { - "type": "integer", - "title": "Unpriced", - "description": "calls that cost something but have no figure (a model with no price, a reply without token counts)", - "default": 0 - }, - "estimate": { - "type": "boolean", - "title": "Estimate", - "description": "true when unpriced calls make cost_usd a floor rather than exact", - "default": false + "title": "Space" }, - "by_kind": { - "additionalProperties": { - "$ref": "#/components/schemas/KindTotals" - }, - "type": "object", - "title": "By Kind" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "period", - "calls", - "failed", - "tokens_in", - "tokens_out", - "cost_usd", - "ms", - "by_kind" - ], - "title": "ActivityTotals" - }, - "AnalyticsChurn": { - "properties": { - "previous_active": { - "type": "integer", - "title": "Previous Active" + "why": { + "anyOf": [ + { + "$ref": "#/components/schemas/ApprovalWhy" + }, + { + "type": "null" + } + ] }, - "retained": { - "type": "integer", - "title": "Retained" + "expires_at": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Expires At", + "description": "when it expires and nothing runs (automations only)" }, - "churned": { - "type": "integer", - "title": "Churned" + "decided_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Decided By" }, - "rate": { + "decided_at": { "anyOf": [ { - "type": "number" + "type": "string" }, { "type": "null" } ], - "title": "Rate" + "title": "Decided At" }, - "returning": { - "type": "integer", - "title": "Returning" + "told": { + "items": { + "$ref": "#/components/schemas/ApprovalTold" + }, + "type": "array", + "title": "Told", + "description": "the chats you were told in" + }, + "can": { + "anyOf": [ + { + "$ref": "#/components/schemas/ApprovalCan" + }, + { + "type": "null" + } + ] } }, "additionalProperties": true, "type": "object", "required": [ - "previous_active", - "retained", - "churned", - "returning" + "id", + "tool", + "status" ], - "title": "AnalyticsChurn" + "title": "Approval" }, - "AnalyticsCohort": { + "ApprovalCan": { "properties": { - "week": { - "type": "string", - "title": "Week" + "approve": { + "type": "boolean", + "title": "Approve", + "default": false }, - "users": { - "type": "integer", - "title": "Users" + "decline": { + "type": "boolean", + "title": "Decline", + "default": false }, - "retention": { - "items": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ] - }, - "type": "array", - "title": "Retention" + "edit": { + "type": "boolean", + "title": "Edit", + "default": false + }, + "always": { + "type": "boolean", + "title": "Always", + "default": false } }, "additionalProperties": true, "type": "object", - "required": [ - "week", - "users", - "retention" - ], - "title": "AnalyticsCohort" + "title": "ApprovalCan", + "description": "What you can do with it from where you asked: approving an automation's action is yours, signed in or in the\nchat it told you in; an API key, an app or an agent can only decline it." }, - "AnalyticsDay": { + "ApprovalCount": { "properties": { - "day": { - "type": "string", - "title": "Day" - }, - "active_users": { + "waiting": { "type": "integer", - "title": "Active Users" + "title": "Waiting" }, - "actions": { + "automations": { "type": "integer", - "title": "Actions" + "title": "Automations", + "description": "of them, waiting for an automation" } }, "additionalProperties": true, "type": "object", "required": [ - "day", - "active_users", - "actions" + "waiting", + "automations" ], - "title": "AnalyticsDay" + "title": "ApprovalCount" }, - "AnalyticsEvent": { + "ApprovalDecision": { "properties": { - "name": { - "type": "string", - "title": "Name" - }, - "description": { + "decision": { "type": "string", - "title": "Description" + "enum": [ + "approve", + "sample", + "decline", + "edit", + "always" + ], + "title": "Decision", + "description": "sample: a batch run on 3 assets first; edit: an automation's action with `params` changed, then carried out; always: carried out, and that action node of the automation runs without asking from now on (signed in only)", + "default": "approve" }, - "on": { - "type": "boolean", - "title": "On" + "params": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Params", + "description": "edit: the params to change (null leaves one out)" } }, - "additionalProperties": true, + "additionalProperties": false, "type": "object", - "required": [ - "name", - "description", - "on" - ], - "title": "AnalyticsEvent" + "title": "ApprovalDecision" }, - "AnalyticsFeature": { + "ApprovalIntent": { "properties": { - "feature": { + "action": { "type": "string", - "title": "Feature" + "title": "Action" }, - "actions": { - "type": "integer", - "title": "Actions" + "params": { + "additionalProperties": true, + "type": "object", + "title": "Params" }, - "users": { - "type": "integer", - "title": "Users" + "effect": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Effect" + }, + "risk": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Risk" + }, + "untrusted": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Untrusted", + "description": "its run read text from outside Lens" + }, + "node": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Node" + }, + "status": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Status" + }, + "spaces": { + "anyOf": [ + { + "items": { + "type": "integer" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Spaces" } }, "additionalProperties": true, "type": "object", "required": [ - "feature", - "actions", - "users" + "action" ], - "title": "AnalyticsFeature" + "title": "ApprovalIntent", + "description": "What an automation's action would do, as the inbox shows it (credential headers hidden)." }, - "AnalyticsMetrics": { + "ApprovalOrigin": { "properties": { - "days": { - "type": "integer", - "title": "Days" - }, - "since": { - "type": "string", - "title": "Since" - }, - "until": { - "type": "string", - "title": "Until" - }, - "daily": { - "items": { - "$ref": "#/components/schemas/AnalyticsDay" - }, - "type": "array", - "title": "Daily" - }, - "dau": { - "type": "integer", - "title": "Dau" - }, - "wau": { - "type": "integer", - "title": "Wau" - }, - "mau": { - "type": "integer", - "title": "Mau" - }, - "stickiness": { + "automation": { "anyOf": [ { - "type": "number" + "type": "integer" }, { "type": "null" } ], - "title": "Stickiness" - }, - "accounts": { - "type": "integer", - "title": "Accounts" - }, - "active_users": { - "type": "integer", - "title": "Active Users" - }, - "new_users": { - "type": "integer", - "title": "New Users" - }, - "churn": { - "$ref": "#/components/schemas/AnalyticsChurn" - }, - "retention": { - "items": { - "$ref": "#/components/schemas/AnalyticsCohort" - }, - "type": "array", - "title": "Retention" - }, - "features": { - "items": { - "$ref": "#/components/schemas/AnalyticsFeature" - }, - "type": "array", - "title": "Features" + "title": "Automation" }, - "last_active_day": { + "run": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Last Active Day" + "title": "Run" }, - "days_since_active": { + "node": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Days Since Active" + "title": "Node" } }, "additionalProperties": true, "type": "object", - "required": [ - "days", - "since", - "until", - "daily", - "dau", - "wau", - "mau", - "accounts", - "active_users", - "new_users", - "churn", - "retention", - "features" - ], - "title": "AnalyticsMetrics", - "description": "Active people, churn, retention and feature use, worked out on this machine from the activity ledger and\nsign-ins (docs/analytics.md#the-numbers)." + "title": "ApprovalOrigin" }, - "AnalyticsStatus": { + "ApprovalOutcome": { "properties": { - "enabled": { - "type": "boolean", - "title": "Enabled" - }, - "configured": { - "type": "boolean", - "title": "Configured" + "status": { + "type": "string", + "title": "Status" }, - "measurement_id": { + "batch": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Measurement Id" + "title": "Batch", + "description": "the batch run started, for run_template" }, - "client_id": { + "job": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Client Id" + "title": "Job", + "description": "the job started, for write_spec" }, - "last_sent_at": { + "error": { "anyOf": [ { "type": "string" @@ -32557,52 +33795,40 @@ "type": "null" } ], - "title": "Last Sent At" + "title": "Error", + "description": "why an automation's action failed" }, - "last_sent": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Last Sent", - "default": [] + "result": { + "title": "Result", + "description": "what an automation's action gave back" }, - "last_error": { + "always": { "anyOf": [ { - "type": "string" + "type": "boolean" }, { "type": "null" } ], - "title": "Last Error" - }, - "events": { - "items": { - "$ref": "#/components/schemas/AnalyticsEvent" - }, - "type": "array", - "title": "Events" + "title": "Always", + "description": "that node runs without asking from now on" } }, "additionalProperties": true, "type": "object", "required": [ - "enabled", - "configured", - "events" + "status" ], - "title": "AnalyticsStatus", - "description": "Whether usage statistics go to Google Analytics, and how the last send went (docs/analytics.md)." + "title": "ApprovalOutcome" }, - "AnalyticsTestResult": { + "ApprovalTold": { "properties": { - "ok": { - "type": "boolean", - "title": "Ok" + "channel": { + "type": "string", + "title": "Channel" }, - "error": { + "label": { "anyOf": [ { "type": "string" @@ -32611,89 +33837,124 @@ "type": "null" } ], - "title": "Error" + "title": "Label" }, - "messages": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Messages", - "default": [] + "chat": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Chat" } }, "additionalProperties": true, "type": "object", "required": [ - "ok" + "channel" ], - "title": "AnalyticsTestResult" + "title": "ApprovalTold" }, - "AnswerCheck": { + "ApprovalWhy": { "properties": { - "claims": { - "type": "integer", - "title": "Claims", - "description": "sentences that cite a source" + "activity": { + "type": "string", + "title": "Activity" }, - "supported": { - "type": "integer", - "title": "Supported", - "description": "claims the cited excerpts support" + "kind": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Kind" }, - "verdicts": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Verdicts", - "default": [] + "summary": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Summary" + }, + "published": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Published" }, - "uncited": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Uncited", - "default": [] + "url": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Url" } }, "additionalProperties": true, "type": "object", "required": [ - "claims", - "supported" + "activity" ], - "title": "AnswerCheck" + "title": "ApprovalWhy", + "description": "The activity that caused it, as it was when it asked." }, - "ApiToken": { + "AssistantMemory": { "properties": { "id": { "type": "integer", "title": "Id" }, - "name": { + "text": { "type": "string", - "title": "Name" + "title": "Text" }, - "scope": { - "type": "string", - "enum": [ - "read", - "write" + "recording": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } ], - "title": "Scope" - }, - "prefix": { - "type": "string", - "title": "Prefix" + "title": "Recording", + "description": "the asset it came from" }, - "created_at": { - "type": "string", - "title": "Created At" + "t0": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "T0", + "description": "the moment in that asset (ms)" }, - "expires_at": { + "title": { "anyOf": [ { "type": "string" @@ -32702,9 +33963,10 @@ "type": "null" } ], - "title": "Expires At" + "title": "Title", + "description": "that asset's title" }, - "last_used_at": { + "time": { "anyOf": [ { "type": "string" @@ -32713,49 +33975,33 @@ "type": "null" } ], - "title": "Last Used At" + "title": "Time", + "description": "that moment as \"12:34\"" }, - "namespace": { + "chat": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Namespace", - "description": "the one namespace it opens (its own servers alone), when it was made for one" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "id", - "name", - "scope", - "prefix", - "created_at" - ], - "title": "ApiToken" - }, - "ApiTokenCreate": { - "properties": { - "name": { - "type": "string", - "title": "Name", - "default": "token" + "title": "Chat", + "description": "the conversation it was told in" }, - "scope": { + "author": { "type": "string", - "enum": [ - "read", - "write" - ], - "title": "Scope", - "default": "read" + "title": "Author", + "description": "assistant (kept from a conversation) or person (written here)" }, - "namespace": { + "pinned": { + "type": "boolean", + "title": "Pinned", + "description": "always read with every question", + "default": false + }, + "created_at": { "anyOf": [ { "type": "string" @@ -32764,109 +34010,97 @@ "type": "null" } ], - "title": "Namespace", - "description": "a namespace you can read: the key opens that namespace's own MCP server and chat completions alone, and nothing else in Lens; none: whatever you can reach" + "title": "Created At" }, - "days": { + "updated_at": { "anyOf": [ { - "type": "integer", - "maximum": 3650.0, - "minimum": 0.0 + "type": "string" }, { "type": "null" } ], - "title": "Days", - "description": "how long it lasts; default: tokens.default_days; 0: never expires, when tokens.never_expire allows" - } - }, - "additionalProperties": false, - "type": "object", - "title": "ApiTokenCreate" - }, - "ApiTokenCreated": { - "properties": { - "id": { - "type": "integer", - "title": "Id" - }, - "token": { - "type": "string", - "title": "Token" - }, - "note": { - "type": "string", - "title": "Note", - "default": "copy it now; it won't be shown again" + "title": "Updated At" } }, "additionalProperties": true, "type": "object", "required": [ "id", - "token" + "text", + "author" ], - "title": "ApiTokenCreated" + "title": "AssistantMemory" }, - "ApiTokenRename": { + "AssistantMemoryCreate": { "properties": { - "name": { + "text": { "type": "string", - "maxLength": 80, - "minLength": 1, - "title": "Name" + "maxLength": 500, + "title": "Text" + }, + "pinned": { + "type": "boolean", + "title": "Pinned", + "default": false } }, "additionalProperties": false, "type": "object", "required": [ - "name" + "text" ], - "title": "ApiTokenRename" + "title": "AssistantMemoryCreate" }, - "Approval": { + "AssistantMemoryUpdate": { "properties": { - "id": { - "type": "integer", - "title": "Id" - }, - "chat": { + "text": { "anyOf": [ { - "type": "integer" + "type": "string", + "maxLength": 500 }, { "type": "null" } ], - "title": "Chat" - }, - "tool": { - "type": "string", - "title": "Tool" + "title": "Text" }, - "summary": { + "pinned": { "anyOf": [ { - "type": "string" + "type": "boolean" }, { "type": "null" } ], - "title": "Summary" - }, - "estimate": { - "title": "Estimate" + "title": "Pinned" + } + }, + "additionalProperties": false, + "type": "object", + "title": "AssistantMemoryUpdate" + }, + "AttachedTo": { + "properties": { + "resource": { + "type": "integer", + "title": "Resource" }, - "status": { - "type": "string", - "title": "Status", - "description": "pending (waiting), running, done, failed, declined or expired" + "file": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "File" }, - "created_at": { + "title": { "anyOf": [ { "type": "string" @@ -32875,45 +34109,76 @@ "type": "null" } ], - "title": "Created At" + "title": "Title" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "resource" + ], + "title": "AttachedTo", + "description": "The email a resource was attached to (it's one of that email's files too)." + }, + "Attachment": { + "properties": { + "id": { + "type": "string", + "title": "Id", + "description": "the upload" + }, + "filename": { + "type": "string", + "title": "Filename" }, - "result": { - "title": "Result" + "size": { + "type": "integer", + "title": "Size" }, - "error": { + "recording": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Error" + "title": "Recording", + "description": "the asset it became, once imported" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "id", + "filename", + "size" + ], + "title": "Attachment" + }, + "AuditEntry": { + "properties": { + "at": { + "type": "string", + "title": "At" }, - "origin": { + "email": { "anyOf": [ { - "$ref": "#/components/schemas/ApprovalOrigin" + "type": "string" }, { "type": "null" } ], - "description": "the automation run that asked, when one did" + "title": "Email" }, - "intent": { - "anyOf": [ - { - "$ref": "#/components/schemas/ApprovalIntent" - }, - { - "type": "null" - } - ], - "description": "an automation's action: what it would do" + "action": { + "type": "string", + "title": "Action" }, - "automation": { + "target": { "anyOf": [ { "type": "string" @@ -32922,31 +34187,70 @@ "type": "null" } ], - "title": "Automation", - "description": "the automation's name" + "title": "Target" }, - "space": { + "detail": { + "title": "Detail" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "at", + "action" + ], + "title": "AuditEntry" + }, + "AuthStatus": { + "properties": { + "setup_required": { + "type": "boolean", + "title": "Setup Required" + }, + "wizard_pending": { + "type": "boolean", + "title": "Wizard Pending", + "default": false + }, + "passwords": { + "type": "boolean", + "title": "Passwords", + "default": false + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "setup_required" + ], + "title": "AuthStatus" + }, + "Automation": { + "properties": { + "id": { + "type": "integer", + "title": "Id" + }, + "name": { + "type": "string", + "title": "Name" + }, + "description": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Space" + "title": "Description" }, - "why": { - "anyOf": [ - { - "$ref": "#/components/schemas/ApprovalWhy" - }, - { - "type": "null" - } - ] + "enabled": { + "type": "boolean", + "title": "Enabled" }, - "expires_at": { + "enabled_at": { "anyOf": [ { "type": "string" @@ -32955,123 +34259,108 @@ "type": "null" } ], - "title": "Expires At", - "description": "when it expires and nothing runs (automations only)" + "title": "Enabled At", + "description": "when it was last switched on: it reacts only to what happens after" }, - "decided_by": { + "spaces": { "anyOf": [ { - "type": "string" + "items": { + "type": "integer" + }, + "type": "array" }, { "type": "null" } ], - "title": "Decided By" + "title": "Spaces", + "description": "the namespaces it works in; none for every one (admins)" }, - "decided_at": { + "namespace_names": { "anyOf": [ { - "type": "string" + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": "array" }, { "type": "null" } ], - "title": "Decided At" + "title": "Namespace Names" }, - "told": { + "run_as": { + "type": "integer", + "title": "Run As", + "description": "the account it acts for, with that person's permissions: its maker" + }, + "triggers": { "items": { - "$ref": "#/components/schemas/ApprovalTold" + "additionalProperties": true, + "type": "object" }, "type": "array", - "title": "Told", - "description": "the chats you were told in" + "title": "Triggers", + "description": "each {as, on, ...}: {as, on: event, kinds, where?, from_automations?}, {as, on: manual}; on schedule, at, relative and webhook are coming soon (docs/automations.md, Triggers)" }, - "can": { + "join": { + "additionalProperties": true, + "type": "object", + "title": "Join", + "description": "how several triggers make one run: {mode: any} (each on its own)" + }, + "if": { "anyOf": [ { - "$ref": "#/components/schemas/ApprovalCan" + "additionalProperties": true, + "type": "object" }, { "type": "null" } - ] - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "id", - "tool", - "status" - ], - "title": "Approval" - }, - "ApprovalCan": { - "properties": { - "approve": { - "type": "boolean", - "title": "Approve", - "default": false - }, - "decline": { - "type": "boolean", - "title": "Decline", - "default": false - }, - "edit": { - "type": "boolean", - "title": "Edit", - "default": false + ], + "title": "If", + "description": "a match tree over the run context, tested before the Then runs, like {all: [{path, op, value}]}" }, - "always": { - "type": "boolean", - "title": "Always", - "default": false - } - }, - "additionalProperties": true, - "type": "object", - "title": "ApprovalCan", - "description": "What you can do with it from where you asked: approving an automation's action is yours, signed in or in the\nchat it told you in; an API key, an app or an agent can only decline it." - }, - "ApprovalCount": { - "properties": { - "waiting": { + "workflow": { "type": "integer", - "title": "Waiting" + "title": "Workflow", + "description": "its workflow (scope event)" }, - "automations": { - "type": "integer", - "title": "Automations", - "description": "of them, waiting for an automation" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "waiting", - "automations" - ], - "title": "ApprovalCount" - }, - "ApprovalDecision": { - "properties": { - "decision": { - "type": "string", - "enum": [ - "approve", - "sample", - "decline", - "edit", - "always" + "version": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } ], - "title": "Decision", - "description": "sample: a batch run on 3 assets first; edit: an automation's action with `params` changed, then carried out; always: carried out, and that action node of the automation runs without asking from now on (signed in only)", - "default": "approve" + "title": "Version", + "description": "the workflow version it runs; none follows the published one" }, - "params": { + "runs_version": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Runs Version", + "description": "the version it runs now" + }, + "graph": { "anyOf": [ { "additionalProperties": true, @@ -33081,26 +34370,36 @@ "type": "null" } ], - "title": "Params", - "description": "edit: the params to change (null leaves one out)" - } - }, - "additionalProperties": false, - "type": "object", - "title": "ApprovalDecision" - }, - "ApprovalIntent": { - "properties": { - "action": { - "type": "string", - "title": "Action" + "title": "Graph", + "description": "the Then: a workflow graph of scope event (an input node, then action nodes and the flow primitives)" }, - "params": { + "policy": { + "additionalProperties": { + "type": "string", + "enum": [ + "ask", + "auto" + ] + }, + "type": "object", + "title": "Policy", + "description": "{action node id: ask or auto}" + }, + "limits": { "additionalProperties": true, "type": "object", - "title": "Params" + "title": "Limits", + "description": "{cooldown (like 10m), max_per_hour}" }, - "effect": { + "counters": { + "additionalProperties": { + "type": "integer" + }, + "type": "object", + "title": "Counters", + "description": "{runs, skipped (its If was false), limited (over a limit), missed}" + }, + "last_run_at": { "anyOf": [ { "type": "string" @@ -33109,9 +34408,9 @@ "type": "null" } ], - "title": "Effect" + "title": "Last Run At" }, - "risk": { + "last_status": { "anyOf": [ { "type": "string" @@ -33120,21 +34419,20 @@ "type": "null" } ], - "title": "Risk" + "title": "Last Status" }, - "untrusted": { + "created_by": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { "type": "null" } ], - "title": "Untrusted", - "description": "its run read text from outside Lens" + "title": "Created By" }, - "node": { + "created_at": { "anyOf": [ { "type": "string" @@ -33143,9 +34441,9 @@ "type": "null" } ], - "title": "Node" + "title": "Created At" }, - "status": { + "updated_at": { "anyOf": [ { "type": "string" @@ -33154,34 +34452,21 @@ "type": "null" } ], - "title": "Status" + "title": "Updated At" }, - "spaces": { + "removed_at": { "anyOf": [ { - "items": { - "type": "integer" - }, - "type": "array" + "type": "string" }, { "type": "null" } ], - "title": "Spaces" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "action" - ], - "title": "ApprovalIntent", - "description": "What an automation's action would do, as the inbox shows it (credential headers hidden)." - }, - "ApprovalOrigin": { - "properties": { - "automation": { + "title": "Removed At", + "description": "when it was deleted (restore brings it back)" + }, + "waiting": { "anyOf": [ { "type": "integer" @@ -33190,20 +34475,23 @@ "type": "null" } ], - "title": "Automation" + "title": "Waiting", + "description": "in lists: its actions waiting for your pick or for their time" }, - "run": { + "cost_month": { "anyOf": [ { - "type": "integer" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "title": "Run" + "title": "Cost Month", + "description": "in lists: what it cost this month {cost_usd, estimate (true when some calls had no price)}" }, - "node": { + "next_at": { "anyOf": [ { "type": "string" @@ -33212,133 +34500,224 @@ "type": "null" } ], - "title": "Node" + "title": "Next At", + "description": "in lists: when it runs next, from its schedules (coming soon)" } }, "additionalProperties": true, "type": "object", - "title": "ApprovalOrigin" + "required": [ + "id", + "name", + "enabled", + "run_as", + "triggers", + "join", + "workflow", + "limits", + "counters" + ], + "title": "Automation" }, - "ApprovalOutcome": { + "AutomationCatalog": { "properties": { - "status": { + "automations": { + "items": { + "$ref": "#/components/schemas/Automation" + }, + "type": "array", + "title": "Automations" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "automations" + ], + "title": "AutomationCatalog" + }, + "AutomationCreate": { + "properties": { + "name": { "type": "string", - "title": "Status" + "title": "Name" }, - "batch": { + "description": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Batch", - "description": "the batch run started, for run_template" + "title": "Description" }, - "job": { + "enabled": { + "type": "boolean", + "title": "Enabled", + "description": "switched on, it reacts to what happens from now on", + "default": true + }, + "spaces": { "anyOf": [ { - "type": "integer" + "items": { + "type": "integer" + }, + "type": "array" }, { "type": "null" } ], - "title": "Job", - "description": "the job started, for write_spec" + "title": "Spaces", + "description": "namespace ids you can edit; default: each one you can edit (every one, for admins)" }, - "error": { + "triggers": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array", + "title": "Triggers", + "description": "each {as, on, ...}: {as, on: event, kinds, where?, from_automations?}, {as, on: manual}; on schedule, at, relative and webhook are coming soon (docs/automations.md, Triggers)" + }, + "join": { "anyOf": [ { - "type": "string" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "title": "Error", - "description": "why an automation's action failed" + "title": "Join", + "description": "default {mode: any}: each trigger starts a run of its own" }, - "result": { - "title": "Result", - "description": "what an automation's action gave back" + "if": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "If", + "description": "a match tree over the run context, tested before the Then runs, like {all: [{path, op, value}]}" }, - "always": { + "graph": { "anyOf": [ { - "type": "boolean" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "title": "Always", - "description": "that node runs without asking from now on" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "status" - ], - "title": "ApprovalOutcome" - }, - "ApprovalTold": { - "properties": { - "channel": { - "type": "string", - "title": "Channel" + "title": "Graph", + "description": "the Then: a workflow graph of scope event (an input node, then action nodes and the flow primitives); or name a saved one in workflow" + }, + "workflow": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Workflow", + "description": "a saved workflow of scope event, instead of a graph" + }, + "version": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Version", + "description": "with workflow: the version to run; none follows the published one" }, - "label": { + "policy": { "anyOf": [ { - "type": "string" + "additionalProperties": { + "type": "string", + "const": "ask" + }, + "type": "object" }, { "type": "null" } ], - "title": "Label" + "title": "Policy", + "description": "{action node id: ask}; only you, signed in, let a node run on its own (POST /automations/{id}/policy)" }, - "chat": { + "limits": { "anyOf": [ { - "type": "string" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "title": "Chat" + "title": "Limits", + "description": "{cooldown: 0s, max_per_hour: 60}" } }, - "additionalProperties": true, + "additionalProperties": false, "type": "object", "required": [ - "channel" + "name", + "triggers" ], - "title": "ApprovalTold" + "title": "AutomationCreate" }, - "ApprovalWhy": { + "AutomationDraftRequest": { "properties": { - "activity": { + "text": { "type": "string", - "title": "Activity" + "maxLength": 2000, + "title": "Text", + "description": "what it should do, in a sentence, like: when a recording is added to pods, log its title" }, - "kind": { + "spaces": { "anyOf": [ { - "type": "string" + "items": { + "type": "integer" + }, + "type": "array" }, { "type": "null" } ], - "title": "Kind" - }, - "summary": { + "title": "Spaces", + "description": "namespace ids it would work in; default: each one you can edit" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "text" + ], + "title": "AutomationDraftRequest" + }, + "AutomationDraftTry": { + "properties": { + "activity": { "anyOf": [ { "type": "string" @@ -33347,9 +34726,10 @@ "type": "null" } ], - "title": "Summary" + "title": "Activity", + "description": "an activity's id to run it on (GET /api/v1/activities)" }, - "published": { + "as": { "anyOf": [ { "type": "string" @@ -33358,9 +34738,10 @@ "type": "null" } ], - "title": "Published" + "title": "As", + "description": "which trigger it runs as (its `as`); default: the first that fits" }, - "url": { + "kind": { "anyOf": [ { "type": "string" @@ -33369,67 +34750,89 @@ "type": "null" } ], - "title": "Url" + "title": "Kind", + "description": "else a kind of activity, to run it on that kind's sample" + }, + "draft": { + "$ref": "#/components/schemas/AutomationCreate", + "description": "the automation as you would save it" } }, - "additionalProperties": true, + "additionalProperties": false, "type": "object", "required": [ - "activity" + "draft" ], - "title": "ApprovalWhy", - "description": "The activity that caused it, as it was when it asked." + "title": "AutomationDraftTry" }, - "AssistantMemory": { + "AutomationDrafted": { "properties": { - "id": { - "type": "integer", - "title": "Id" + "draft": { + "additionalProperties": true, + "type": "object", + "title": "Draft", + "description": "what POST /automations takes, switched off: name, triggers, if, graph" }, - "text": { - "type": "string", - "title": "Text" + "dropped": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Dropped", + "description": "parts of the model's draft that didn't fit, and why" }, - "recording": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Recording", - "description": "the asset it came from" + "unmapped": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Unmapped", + "description": "parts of the sentence it couldn't express (schedules, say)" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "draft" + ], + "title": "AutomationDrafted" + }, + "AutomationPolicy": { + "properties": { + "node": { + "type": "string", + "title": "Node", + "description": "an action node's id" }, - "t0": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "null" - } + "value": { + "type": "string", + "enum": [ + "ask", + "auto" ], - "title": "T0", - "description": "the moment in that asset (ms)" + "title": "Value", + "description": "ask: it asks you first; auto: it runs on its own" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "node", + "value" + ], + "title": "AutomationPolicy" + }, + "AutomationRun": { + "properties": { + "id": { + "type": "integer", + "title": "Id" }, - "title": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Title", - "description": "that asset's title" + "automation": { + "type": "integer", + "title": "Automation" }, - "time": { + "name": { "anyOf": [ { "type": "string" @@ -33438,10 +34841,9 @@ "type": "null" } ], - "title": "Time", - "description": "that moment as \"12:34\"" + "title": "Name" }, - "chat": { + "version": { "anyOf": [ { "type": "integer" @@ -33450,21 +34852,10 @@ "type": "null" } ], - "title": "Chat", - "description": "the conversation it was told in" - }, - "author": { - "type": "string", - "title": "Author", - "description": "assistant (kept from a conversation) or person (written here)" - }, - "pinned": { - "type": "boolean", - "title": "Pinned", - "description": "always read with every question", - "default": false + "title": "Version", + "description": "the workflow version it ran" }, - "created_at": { + "trigger": { "anyOf": [ { "type": "string" @@ -33473,9 +34864,10 @@ "type": "null" } ], - "title": "Created At" + "title": "Trigger", + "description": "the trigger (its `as`) that started it" }, - "updated_at": { + "trigger_on": { "anyOf": [ { "type": "string" @@ -33484,86 +34876,57 @@ "type": "null" } ], - "title": "Updated At" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "id", - "text", - "author" - ], - "title": "AssistantMemory" - }, - "AssistantMemoryCreate": { - "properties": { - "text": { - "type": "string", - "maxLength": 500, - "title": "Text" + "title": "Trigger On" }, - "pinned": { - "type": "boolean", - "title": "Pinned", - "default": false - } - }, - "additionalProperties": false, - "type": "object", - "required": [ - "text" - ], - "title": "AssistantMemoryCreate" - }, - "AssistantMemoryUpdate": { - "properties": { - "text": { + "event": { "anyOf": [ { - "type": "string", - "maxLength": 500 + "type": "string" }, { "type": "null" } ], - "title": "Text" + "title": "Event", + "description": "the activity that started it (an id)" }, - "pinned": { + "event_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Event Ids", + "description": "every activity it ran on (a join's are several)" + }, + "status": { + "type": "string", + "title": "Status", + "description": "running, done, partly (some actions failed), failed, waiting (actions wait for your pick or their time), held (over a budget: decide), released or skipped (your pick on a held run)" + }, + "by": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { "type": "null" } ], - "title": "Pinned" - } - }, - "additionalProperties": false, - "type": "object", - "title": "AssistantMemoryUpdate" - }, - "AttachedTo": { - "properties": { - "resource": { - "type": "integer", - "title": "Resource" + "title": "By", + "description": "who started it by hand" }, - "file": { + "started_at": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "File" + "title": "Started At" }, - "title": { + "finished_at": { "anyOf": [ { "type": "string" @@ -33572,33 +34935,28 @@ "type": "null" } ], - "title": "Title" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "resource" - ], - "title": "AttachedTo", - "description": "The email a resource was attached to (it's one of that email's files too)." - }, - "Attachment": { - "properties": { - "id": { - "type": "string", - "title": "Id", - "description": "the upload" + "title": "Finished At" }, - "filename": { - "type": "string", - "title": "Filename" + "counts": { + "additionalProperties": { + "type": "integer" + }, + "type": "object", + "title": "Counts", + "description": "its actions: {done, waiting, scheduled, failed}" }, - "size": { - "type": "integer", - "title": "Size" + "cost_usd": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Cost Usd" }, - "recording": { + "tokens": { "anyOf": [ { "type": "integer" @@ -33607,41 +34965,21 @@ "type": "null" } ], - "title": "Recording", - "description": "the asset it became, once imported" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "id", - "filename", - "size" - ], - "title": "Attachment" - }, - "AuditEntry": { - "properties": { - "at": { - "type": "string", - "title": "At" + "title": "Tokens" }, - "email": { + "cost_estimate": { "anyOf": [ { - "type": "string" + "type": "boolean" }, { "type": "null" } ], - "title": "Email" - }, - "action": { - "type": "string", - "title": "Action" + "title": "Cost Estimate", + "description": "true when some calls had no price, so the cost is a floor" }, - "target": { + "error": { "anyOf": [ { "type": "string" @@ -33650,55 +34988,9 @@ "type": "null" } ], - "title": "Target" - }, - "detail": { - "title": "Detail" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "at", - "action" - ], - "title": "AuditEntry" - }, - "AuthStatus": { - "properties": { - "setup_required": { - "type": "boolean", - "title": "Setup Required" - }, - "wizard_pending": { - "type": "boolean", - "title": "Wizard Pending", - "default": false - }, - "passwords": { - "type": "boolean", - "title": "Passwords", - "default": false - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "setup_required" - ], - "title": "AuthStatus" - }, - "Automation": { - "properties": { - "id": { - "type": "integer", - "title": "Id" - }, - "name": { - "type": "string", - "title": "Name" + "title": "Error" }, - "description": { + "why": { "anyOf": [ { "type": "string" @@ -33707,97 +34999,86 @@ "type": "null" } ], - "title": "Description" - }, - "enabled": { - "type": "boolean", - "title": "Enabled" + "title": "Why", + "description": "why it was held" }, - "enabled_at": { + "hold": { "anyOf": [ { - "type": "string" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "title": "Enabled At", - "description": "when it was last switched on: it reacts only to what happens after" + "title": "Hold", + "description": "a held run: the budget it is over and how many runs it missed" }, - "spaces": { + "cause_depth": { "anyOf": [ { - "items": { - "type": "integer" - }, - "type": "array" + "type": "integer" }, { "type": "null" } ], - "title": "Spaces", - "description": "the namespaces it works in; none for every one (admins)" + "title": "Cause Depth", + "description": "how many automations' runs led to this one" }, - "namespace_names": { + "space": { "anyOf": [ { - "items": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": "array" + "type": "integer" }, { "type": "null" } ], - "title": "Namespace Names" - }, - "run_as": { - "type": "integer", - "title": "Run As", - "description": "the account it acts for, with that person's permissions: its maker" - }, - "triggers": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Triggers", - "description": "each {as, on, ...}: {as, on: event, kinds, where?, from_automations?}, {as, on: manual}; on schedule, at, relative and webhook are coming soon (docs/automations.md, Triggers)" + "title": "Space" }, - "join": { - "additionalProperties": true, - "type": "object", - "title": "Join", - "description": "how several triggers make one run: {mode: any} (each on its own)" + "dry": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Dry" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "id", + "automation", + "status" + ], + "title": "AutomationRun" + }, + "AutomationRunDetail": { + "properties": { + "id": { + "type": "integer", + "title": "Id" }, - "if": { + "automation": { + "type": "integer", + "title": "Automation" + }, + "name": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "string" }, { "type": "null" } ], - "title": "If", - "description": "a match tree over the run context, tested before the Then runs, like {all: [{path, op, value}]}" - }, - "workflow": { - "type": "integer", - "title": "Workflow", - "description": "its workflow (scope event)" + "title": "Name" }, "version": { "anyOf": [ @@ -33809,60 +35090,32 @@ } ], "title": "Version", - "description": "the workflow version it runs; none follows the published one" + "description": "the workflow version it ran" }, - "runs_version": { + "trigger": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Runs Version", - "description": "the version it runs now" + "title": "Trigger", + "description": "the trigger (its `as`) that started it" }, - "graph": { + "trigger_on": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "string" }, { "type": "null" } ], - "title": "Graph", - "description": "the Then: a workflow graph of scope event (an input node, then action nodes and the flow primitives)" - }, - "policy": { - "additionalProperties": { - "type": "string", - "enum": [ - "ask", - "auto" - ] - }, - "type": "object", - "title": "Policy", - "description": "{action node id: ask or auto}" - }, - "limits": { - "additionalProperties": true, - "type": "object", - "title": "Limits", - "description": "{cooldown (like 10m), max_per_hour}" - }, - "counters": { - "additionalProperties": { - "type": "integer" - }, - "type": "object", - "title": "Counters", - "description": "{runs, skipped (its If was false), limited (over a limit), missed}" + "title": "Trigger On" }, - "last_run_at": { + "event": { "anyOf": [ { "type": "string" @@ -33871,9 +35124,23 @@ "type": "null" } ], - "title": "Last Run At" + "title": "Event", + "description": "the activity that started it (an id)" }, - "last_status": { + "event_ids": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Event Ids", + "description": "every activity it ran on (a join's are several)" + }, + "status": { + "type": "string", + "title": "Status", + "description": "running, done, partly (some actions failed), failed, waiting (actions wait for your pick or their time), held (over a budget: decide), released or skipped (your pick on a held run)" + }, + "by": { "anyOf": [ { "type": "string" @@ -33882,9 +35149,10 @@ "type": "null" } ], - "title": "Last Status" + "title": "By", + "description": "who started it by hand" }, - "created_by": { + "started_at": { "anyOf": [ { "type": "string" @@ -33893,9 +35161,9 @@ "type": "null" } ], - "title": "Created By" + "title": "Started At" }, - "created_at": { + "finished_at": { "anyOf": [ { "type": "string" @@ -33904,57 +35172,62 @@ "type": "null" } ], - "title": "Created At" + "title": "Finished At" }, - "updated_at": { + "counts": { + "additionalProperties": { + "type": "integer" + }, + "type": "object", + "title": "Counts", + "description": "its actions: {done, waiting, scheduled, failed}" + }, + "cost_usd": { "anyOf": [ { - "type": "string" + "type": "number" }, { "type": "null" } ], - "title": "Updated At" + "title": "Cost Usd" }, - "removed_at": { + "tokens": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Removed At", - "description": "when it was deleted (restore brings it back)" + "title": "Tokens" }, - "waiting": { + "cost_estimate": { "anyOf": [ { - "type": "integer" + "type": "boolean" }, { "type": "null" } ], - "title": "Waiting", - "description": "in lists: its actions waiting for your pick or for their time" + "title": "Cost Estimate", + "description": "true when some calls had no price, so the cost is a floor" }, - "cost_month": { + "error": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "string" }, { "type": "null" } ], - "title": "Cost Month", - "description": "in lists: what it cost this month {cost_usd, estimate (true when some calls had no price)}" + "title": "Error" }, - "next_at": { + "why": { "anyOf": [ { "type": "string" @@ -33963,129 +35236,129 @@ "type": "null" } ], - "title": "Next At", - "description": "in lists: when it runs next, from its schedules (coming soon)" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "id", - "name", - "enabled", - "run_as", - "triggers", - "join", - "workflow", - "limits", - "counters" - ], - "title": "Automation" - }, - "AutomationCatalog": { - "properties": { - "automations": { - "items": { - "$ref": "#/components/schemas/Automation" - }, - "type": "array", - "title": "Automations" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "automations" - ], - "title": "AutomationCatalog" - }, - "AutomationCreate": { - "properties": { - "name": { - "type": "string", - "title": "Name" + "title": "Why", + "description": "why it was held" }, - "description": { + "hold": { "anyOf": [ { - "type": "string" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "title": "Description" - }, - "enabled": { - "type": "boolean", - "title": "Enabled", - "description": "switched on, it reacts to what happens from now on", - "default": true + "title": "Hold", + "description": "a held run: the budget it is over and how many runs it missed" }, - "spaces": { + "cause_depth": { "anyOf": [ { - "items": { - "type": "integer" - }, - "type": "array" + "type": "integer" }, { "type": "null" } ], - "title": "Spaces", - "description": "namespace ids you can edit; default: each one you can edit (every one, for admins)" + "title": "Cause Depth", + "description": "how many automations' runs led to this one" }, - "triggers": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Triggers", - "description": "each {as, on, ...}: {as, on: event, kinds, where?, from_automations?}, {as, on: manual}; on schedule, at, relative and webhook are coming soon (docs/automations.md, Triggers)" + "space": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Space" }, - "join": { + "dry": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "boolean" }, { "type": "null" } ], - "title": "Join", - "description": "default {mode: any}: each trigger starts a run of its own" + "title": "Dry" }, - "if": { + "trace": { + "additionalProperties": true, + "type": "object", + "title": "Trace", + "description": "by node id: what each node took in and passed on" + }, + "log": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Log" + }, + "intents": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array", + "title": "Intents", + "description": "what its actions did, asked or wait to do: action, params, effect, risk, status, result" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "id", + "automation", + "status" + ], + "title": "AutomationRunDetail" + }, + "AutomationRunNow": { + "properties": { + "activity": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "string" }, { "type": "null" } ], - "title": "If", - "description": "a match tree over the run context, tested before the Then runs, like {all: [{path, op, value}]}" + "title": "Activity", + "description": "an activity's id to run it on (GET /api/v1/activities)" }, - "graph": { + "as": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "string" }, { "type": "null" } ], - "title": "Graph", - "description": "the Then: a workflow graph of scope event (an input node, then action nodes and the flow primitives); or name a saved one in workflow" + "title": "As", + "description": "which trigger it runs as (its `as`); default: the first that fits" + } + }, + "additionalProperties": false, + "type": "object", + "title": "AutomationRunNow" + }, + "AutomationRuns": { + "properties": { + "runs": { + "items": { + "$ref": "#/components/schemas/AutomationRun" + }, + "type": "array", + "title": "Runs" }, - "workflow": { + "next": { "anyOf": [ { "type": "integer" @@ -34094,10 +35367,45 @@ "type": "null" } ], - "title": "Workflow", - "description": "a saved workflow of scope event, instead of a graph" + "title": "Next", + "description": "for the page after: pass it as `before`" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "runs" + ], + "title": "AutomationRuns" + }, + "AutomationSaved": { + "properties": { + "id": { + "type": "integer", + "title": "Id" }, - "version": { + "hooks": { + "items": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "type": "array", + "title": "Hooks", + "description": "new webhook triggers' addresses and signing secrets {as, url, secret}, shown this once" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "id" + ], + "title": "AutomationSaved" + }, + "AutomationStarted": { + "properties": { + "run": { "anyOf": [ { "type": "integer" @@ -34106,93 +35414,52 @@ "type": "null" } ], - "title": "Version", - "description": "with workflow: the version to run; none follows the published one" + "title": "Run", + "description": "the run's id (GET /automations/runs/{run}); none when nothing ran" }, - "policy": { + "status": { "anyOf": [ { - "additionalProperties": { - "type": "string", - "const": "ask" - }, - "type": "object" + "type": "string" }, { "type": "null" } ], - "title": "Policy", - "description": "{action node id: ask}; only you, signed in, let a node run on its own (POST /automations/{id}/policy)" + "title": "Status" }, - "limits": { + "why": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "string" }, { "type": "null" } ], - "title": "Limits", - "description": "{cooldown: 0s, max_per_hour: 60}" + "title": "Why", + "description": "why it didn't run, or was held" } }, - "additionalProperties": false, + "additionalProperties": true, "type": "object", - "required": [ - "name", - "triggers" - ], - "title": "AutomationCreate" + "title": "AutomationStarted" }, - "AutomationDraftRequest": { + "AutomationSwitch": { "properties": { - "text": { - "type": "string", - "maxLength": 2000, - "title": "Text", - "description": "what it should do, in a sentence, like: when a recording is added to pods, log its title" - }, - "spaces": { - "anyOf": [ - { - "items": { - "type": "integer" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "title": "Spaces", - "description": "namespace ids it would work in; default: each one you can edit" + "on": { + "type": "boolean", + "title": "On", + "default": true } }, "additionalProperties": false, "type": "object", - "required": [ - "text" - ], - "title": "AutomationDraftRequest" + "title": "AutomationSwitch" }, - "AutomationDraftTry": { + "AutomationTried": { "properties": { - "activity": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Activity", - "description": "an activity's id to run it on (GET /api/v1/activities)" - }, - "as": { + "status": { "anyOf": [ { "type": "string" @@ -34201,10 +35468,10 @@ "type": "null" } ], - "title": "As", - "description": "which trigger it runs as (its `as`); default: the first that fits" + "title": "Status", + "description": "done, waiting, partly or failed as it would end; skipped when its If is false (limits and budgets aren't checked: a try costs no run)" }, - "kind": { + "why": { "anyOf": [ { "type": "string" @@ -34213,89 +35480,53 @@ "type": "null" } ], - "title": "Kind", - "description": "else a kind of activity, to run it on that kind's sample" + "title": "Why" }, - "draft": { - "$ref": "#/components/schemas/AutomationCreate", - "description": "the automation as you would save it" - } - }, - "additionalProperties": false, - "type": "object", - "required": [ - "draft" - ], - "title": "AutomationDraftTry" - }, - "AutomationDrafted": { - "properties": { - "draft": { + "trace": { "additionalProperties": true, "type": "object", - "title": "Draft", - "description": "what POST /automations takes, switched off: name, triggers, if, graph" + "title": "Trace" }, - "dropped": { + "log": { "items": { "type": "string" }, "type": "array", - "title": "Dropped", - "description": "parts of the model's draft that didn't fit, and why" + "title": "Log" }, - "unmapped": { + "intents": { "items": { - "type": "string" + "additionalProperties": true, + "type": "object" }, "type": "array", - "title": "Unmapped", - "description": "parts of the sentence it couldn't express (schedules, say)" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "draft" - ], - "title": "AutomationDrafted" - }, - "AutomationPolicy": { - "properties": { - "node": { - "type": "string", - "title": "Node", - "description": "an action node's id" + "title": "Intents", + "description": "what each action would do (nothing is done)" }, - "value": { - "type": "string", - "enum": [ - "ask", - "auto" + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } ], - "title": "Value", - "description": "ask: it asks you first; auto: it runs on its own" - } - }, - "additionalProperties": false, - "type": "object", - "required": [ - "node", - "value" - ], - "title": "AutomationPolicy" - }, - "AutomationRun": { - "properties": { - "id": { - "type": "integer", - "title": "Id" + "title": "Error" }, - "automation": { + "steps": { "type": "integer", - "title": "Automation" - }, - "name": { + "title": "Steps", + "default": 0 + } + }, + "additionalProperties": true, + "type": "object", + "title": "AutomationTried" + }, + "AutomationTry": { + "properties": { + "activity": { "anyOf": [ { "type": "string" @@ -34304,21 +35535,22 @@ "type": "null" } ], - "title": "Name" + "title": "Activity", + "description": "an activity's id to run it on (GET /api/v1/activities)" }, - "version": { + "as": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Version", - "description": "the workflow version it ran" + "title": "As", + "description": "which trigger it runs as (its `as`); default: the first that fits" }, - "trigger": { + "kind": { "anyOf": [ { "type": "string" @@ -34327,10 +35559,30 @@ "type": "null" } ], - "title": "Trigger", - "description": "the trigger (its `as`) that started it" - }, - "trigger_on": { + "title": "Kind", + "description": "else a kind of activity, to run it on that kind's sample" + } + }, + "additionalProperties": false, + "type": "object", + "title": "AutomationTry" + }, + "AutomationUpcoming": { + "properties": { + "times": { + "items": {}, + "type": "array", + "title": "Times", + "description": "when it runs next, from its schedules and timers (coming soon)" + } + }, + "additionalProperties": true, + "type": "object", + "title": "AutomationUpcoming" + }, + "AutomationUpdate": { + "properties": { + "name": { "anyOf": [ { "type": "string" @@ -34339,9 +35591,9 @@ "type": "null" } ], - "title": "Trigger On" + "title": "Name" }, - "event": { + "description": { "anyOf": [ { "type": "string" @@ -34350,122 +35602,129 @@ "type": "null" } ], - "title": "Event", - "description": "the activity that started it (an id)" - }, - "event_ids": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Event Ids", - "description": "every activity it ran on (a join's are several)" - }, - "status": { - "type": "string", - "title": "Status", - "description": "running, done, partly (some actions failed), failed, waiting (actions wait for your pick or their time), held (over a budget: decide), released or skipped (your pick on a held run)" + "title": "Description" }, - "by": { + "enabled": { "anyOf": [ { - "type": "string" + "type": "boolean" }, { "type": "null" } ], - "title": "By", - "description": "who started it by hand" + "title": "Enabled" }, - "started_at": { + "spaces": { "anyOf": [ { - "type": "string" + "items": { + "type": "integer" + }, + "type": "array" }, { "type": "null" } ], - "title": "Started At" + "title": "Spaces" }, - "finished_at": { + "triggers": { "anyOf": [ { - "type": "string" + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array" }, { "type": "null" } ], - "title": "Finished At" + "title": "Triggers" }, - "counts": { - "additionalProperties": { - "type": "integer" - }, - "type": "object", - "title": "Counts", - "description": "its actions: {done, waiting, scheduled, failed}" + "join": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Join" }, - "cost_usd": { + "if": { "anyOf": [ { - "type": "number" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "title": "Cost Usd" + "title": "If", + "description": "a match tree over the run context, tested before the Then runs, like {all: [{path, op, value}]}; null for none" }, - "tokens": { + "graph": { "anyOf": [ { - "type": "integer" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "title": "Tokens" + "title": "Graph", + "description": "a new Then, saved as a new version of its workflow" }, - "cost_estimate": { + "workflow": { "anyOf": [ { - "type": "boolean" + "type": "integer" }, { "type": "null" } ], - "title": "Cost Estimate", - "description": "true when some calls had no price, so the cost is a floor" + "title": "Workflow" }, - "error": { + "version": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Error" + "title": "Version", + "description": "the workflow version to run; null follows the published one" }, - "why": { + "policy": { "anyOf": [ { - "type": "string" + "additionalProperties": { + "type": "string", + "enum": [ + "ask", + "auto" + ] + }, + "type": "object" }, { "type": "null" } ], - "title": "Why", - "description": "why it was held" + "title": "Policy", + "description": "{action node id: ask}; a node already set to auto may stay auto, and only you set auto (its own route)" }, - "hold": { + "limits": { "anyOf": [ { "additionalProperties": true, @@ -34475,64 +35734,213 @@ "type": "null" } ], - "title": "Hold", - "description": "a held run: the budget it is over and how many runs it missed" + "title": "Limits" + } + }, + "additionalProperties": false, + "type": "object", + "title": "AutomationUpdate" + }, + "AutomationVar": { + "properties": { + "name": { + "type": "string", + "title": "Name" }, - "cause_depth": { + "value": { + "title": "Value", + "description": "JSON up to 16 KB" + }, + "untrusted": { + "type": "boolean", + "title": "Untrusted", + "description": "set from text from outside Lens: prompts mark it as data", + "default": false + }, + "updated_at": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Cause Depth", - "description": "how many automations' runs led to this one" + "title": "Updated At" }, - "space": { + "updated_by": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Space" + "title": "Updated By", + "description": "who set it last: an email, or automation:" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "name" + ], + "title": "AutomationVar" + }, + "AutomationVars": { + "properties": { + "vars": { + "items": { + "$ref": "#/components/schemas/AutomationVar" + }, + "type": "array", + "title": "Vars" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "vars" + ], + "title": "AutomationVars" + }, + "AutomationVarsIn": { + "properties": { + "vars": { + "additionalProperties": true, + "type": "object", + "title": "Vars", + "description": "{name: value}: each one set to its value (JSON up to 16 KB), null clears it; the others stay" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "vars" + ], + "title": "AutomationVarsIn" + }, + "Backend": { + "properties": { + "label": { + "type": "string", + "title": "Label" + }, + "fields": { + "additionalProperties": { + "type": "string" + }, + "type": "object", + "title": "Fields", + "description": "parameters and their defaults" + }, + "secrets": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Secrets" }, - "dry": { + "oauth": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { "type": "null" } ], - "title": "Dry" + "title": "Oauth", + "description": "the command that produces the token, for OAuth backends" + }, + "google": { + "type": "boolean", + "title": "Google", + "description": "signs in to Google: with a service account key, or as a Google account (its authorized user JSON as `token`)", + "default": false } }, "additionalProperties": true, "type": "object", "required": [ - "id", - "automation", - "status" + "label", + "fields", + "secrets" ], - "title": "AutomationRun" + "title": "Backend" }, - "AutomationRunDetail": { + "Backup": { "properties": { - "id": { - "type": "integer", - "title": "Id" + "name": { + "type": "string", + "title": "Name" }, - "automation": { + "label": { + "type": "string", + "title": "Label", + "description": "manual, or before-upgrade" + }, + "kind": { + "type": "string", + "enum": [ + "export", + "folder" + ], + "title": "Kind", + "description": "export: a SurrealDB export (.surql.gz); folder: an embedded database's copy" + }, + "bytes": { "type": "integer", - "title": "Automation" + "title": "Bytes", + "description": "the database's part and the files kept with it" }, - "name": { + "files": { + "type": "boolean", + "title": "Files", + "description": "the files under data_dir are kept with it, and put back when it is restored", + "default": false + }, + "taken_at": { + "type": "string", + "title": "Taken At" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "name", + "label", + "kind", + "bytes", + "taken_at" + ], + "title": "Backup" + }, + "BackupLink": { + "properties": { + "url": { + "type": "string", + "title": "Url", + "description": "opens the download, without signing in, until it expires" + }, + "expires_in": { + "type": "integer", + "title": "Expires In", + "description": "seconds" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "url", + "expires_in" + ], + "title": "BackupLink" + }, + "BackupSchedule": { + "properties": { + "schedule": { "anyOf": [ { "type": "string" @@ -34541,21 +35949,32 @@ "type": "null" } ], - "title": "Name" + "title": "Schedule", + "description": "backups.schedule: a cron expression, or none" }, - "version": { + "timezone": { + "type": "string", + "title": "Timezone", + "default": "UTC" + }, + "keep": { + "type": "integer", + "title": "Keep", + "description": "how many scheduled backups are kept", + "default": 7 + }, + "next_at": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Version", - "description": "the workflow version it ran" + "title": "Next At" }, - "trigger": { + "last_at": { "anyOf": [ { "type": "string" @@ -34564,10 +35983,9 @@ "type": "null" } ], - "title": "Trigger", - "description": "the trigger (its `as`) that started it" + "title": "Last At" }, - "trigger_on": { + "last_name": { "anyOf": [ { "type": "string" @@ -34576,9 +35994,9 @@ "type": "null" } ], - "title": "Trigger On" + "title": "Last Name" }, - "event": { + "last_error": { "anyOf": [ { "type": "string" @@ -34587,135 +36005,201 @@ "type": "null" } ], - "title": "Event", - "description": "the activity that started it (an id)" + "title": "Last Error" + } + }, + "additionalProperties": true, + "type": "object", + "title": "BackupSchedule" + }, + "Backups": { + "properties": { + "folder": { + "type": "string", + "title": "Folder" }, - "event_ids": { + "backups": { "items": { - "type": "string" + "$ref": "#/components/schemas/Backup" }, "type": "array", - "title": "Event Ids", - "description": "every activity it ran on (a join's are several)" - }, - "status": { - "type": "string", - "title": "Status", - "description": "running, done, partly (some actions failed), failed, waiting (actions wait for your pick or their time), held (over a budget: decide), released or skipped (your pick on a held run)" + "title": "Backups" }, - "by": { + "database": { "anyOf": [ { - "type": "string" + "type": "string", + "enum": [ + "server", + "embedded", + "memory" + ] }, { "type": "null" } ], - "title": "By", - "description": "who started it by hand" + "title": "Database", + "description": "the database this Lens uses: a restore needs a backup of the same kind (export or folder)" }, - "started_at": { + "in_progress": { + "items": { + "type": "string" + }, + "type": "array", + "title": "In Progress", + "description": "backups being written now, by any Lens process" + }, + "restore": { "anyOf": [ { - "type": "string" + "$ref": "#/components/schemas/RestoreWork" }, { "type": "null" } ], - "title": "Started At" + "description": "the restore running on this server, or the last one" }, - "finished_at": { + "schedule": { "anyOf": [ { - "type": "string" + "$ref": "#/components/schemas/BackupSchedule" }, { "type": "null" } - ], - "title": "Finished At" + ] + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "folder", + "backups" + ], + "title": "Backups" + }, + "Batch": { + "properties": { + "id": { + "type": "integer", + "title": "Id" }, - "counts": { - "additionalProperties": { - "type": "integer" - }, - "type": "object", - "title": "Counts", - "description": "its actions: {done, waiting, scheduled, failed}" + "label": { + "type": "string", + "title": "Label" }, - "cost_usd": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Cost Usd" + "status": { + "type": "string", + "title": "Status" }, - "tokens": { + "created_by": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Tokens" + "title": "Created By" }, - "cost_estimate": { + "created_at": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { "type": "null" } ], - "title": "Cost Estimate", - "description": "true when some calls had no price, so the cost is a floor" + "title": "Created At" }, - "error": { + "progress": { + "$ref": "#/components/schemas/BatchProgress" + }, + "steps": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array", + "title": "Steps" + }, + "selection": { "anyOf": [ { - "type": "string" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "title": "Error" + "title": "Selection" }, - "why": { + "recordings": { + "items": { + "type": "integer" + }, + "type": "array", + "title": "Recordings" + }, + "started": { + "items": { + "type": "integer" + }, + "type": "array", + "title": "Started" + }, + "skipped": { + "type": "integer", + "title": "Skipped", + "default": 0 + }, + "estimate": { "anyOf": [ { - "type": "string" + "$ref": "#/components/schemas/Estimate" }, { "type": "null" } - ], - "title": "Why", - "description": "why it was held" + ] }, - "hold": { + "report": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "$ref": "#/components/schemas/BatchReport" }, { "type": "null" } - ], - "title": "Hold", - "description": "a held run: the budget it is over and how many runs it missed" + ] + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "id", + "label", + "status", + "progress", + "steps", + "recordings", + "started" + ], + "title": "Batch" + }, + "BatchActionResult": { + "properties": { + "ok": { + "type": "boolean", + "title": "Ok", + "default": true }, - "cause_depth": { + "result": { "anyOf": [ { "type": "integer" @@ -34724,78 +36208,65 @@ "type": "null" } ], - "title": "Cause Depth", - "description": "how many automations' runs led to this one" - }, - "space": { + "title": "Result", + "description": "assets started (continue) or jobs retried (retry)" + } + }, + "additionalProperties": true, + "type": "object", + "title": "BatchActionResult" + }, + "BatchCombine": { + "properties": { + "instructions": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Space" + "title": "Instructions" }, - "dry": { + "key": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { "type": "null" } ], - "title": "Dry" - }, - "trace": { - "additionalProperties": true, - "type": "object", - "title": "Trace", - "description": "by node id: what each node took in and passed on" - }, - "log": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Log" - }, - "intents": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Intents", - "description": "what its actions did, asked or wait to do: action, params, effect, risk, status, result" + "title": "Key" } }, - "additionalProperties": true, + "additionalProperties": false, "type": "object", - "required": [ - "id", - "automation", - "status" - ], - "title": "AutomationRunDetail" + "title": "BatchCombine" }, - "AutomationRunNow": { + "BatchCreate": { "properties": { - "activity": { + "selection": { + "$ref": "#/components/schemas/BatchSelection" + }, + "run": { + "$ref": "#/components/schemas/BatchRun" + }, + "sample": { "anyOf": [ { - "type": "string" + "type": "integer", + "minimum": 1.0 }, { "type": "null" } ], - "title": "Activity", - "description": "an activity's id to run it on (GET /api/v1/activities)" + "title": "Sample", + "description": "run on this many first; continue after review" }, - "as": { + "confirm": { "anyOf": [ { "type": "string" @@ -34804,204 +36275,166 @@ "type": "null" } ], - "title": "As", - "description": "which trigger it runs as (its `as`); default: the first that fits" + "title": "Confirm", + "description": "the confirmation text a big run asks for, e.g. \"RUN 40\"" } }, "additionalProperties": false, "type": "object", - "title": "AutomationRunNow" + "title": "BatchCreate" }, - "AutomationRuns": { + "BatchEstimate": { "properties": { - "runs": { - "items": { - "$ref": "#/components/schemas/AutomationRun" + "recordings": { + "type": "integer", + "title": "Recordings" + }, + "by_kind": { + "additionalProperties": { + "type": "integer" }, - "type": "array", - "title": "Runs" + "type": "object", + "title": "By Kind", + "default": {} }, - "next": { + "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": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Next", - "description": "for the page after: pass it as `before`" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "runs" - ], - "title": "AutomationRuns" - }, - "AutomationSaved": { - "properties": { - "id": { - "type": "integer", - "title": "Id" + "title": "Confirm Text" }, - "hooks": { + "label": { + "type": "string", + "title": "Label" + }, + "steps": { "items": { - "additionalProperties": { - "type": "string" - }, + "additionalProperties": true, "type": "object" }, "type": "array", - "title": "Hooks", - "description": "new webhook triggers' addresses and signing secrets {as, url, secret}, shown this once" + "title": "Steps" + }, + "skipped": { + "type": "integer", + "title": "Skipped", + "description": "matching assets you can't change" } }, "additionalProperties": true, "type": "object", "required": [ - "id" + "recordings", + "hours", + "seconds", + "llm", + "would_replace", + "needs_confirmation", + "label", + "steps", + "skipped" ], - "title": "AutomationSaved" + "title": "BatchEstimate" }, - "AutomationStarted": { + "BatchNeedsConfirmation": { "properties": { - "run": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Run", - "description": "the run's id (GET /automations/runs/{run}); none when nothing ran" - }, - "status": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Status" + "detail": { + "type": "string", + "title": "Detail" }, - "why": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Why", - "description": "why it didn't run, or was held" + "estimate": { + "$ref": "#/components/schemas/Estimate" } }, "additionalProperties": true, "type": "object", - "title": "AutomationStarted" + "required": [ + "detail", + "estimate" + ], + "title": "BatchNeedsConfirmation" }, - "AutomationSwitch": { + "BatchPlan": { "properties": { - "on": { - "type": "boolean", - "title": "On", - "default": true + "selection": { + "$ref": "#/components/schemas/BatchSelection" + }, + "run": { + "$ref": "#/components/schemas/BatchRun" } }, "additionalProperties": false, "type": "object", - "title": "AutomationSwitch" + "title": "BatchPlan" }, - "AutomationTried": { + "BatchProgress": { "properties": { - "status": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Status", - "description": "done, waiting, partly or failed as it would end; skipped when its If is false (limits and budgets aren't checked: a try costs no run)" - }, - "why": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Why" - }, - "trace": { - "additionalProperties": true, - "type": "object", - "title": "Trace" - }, - "log": { - "items": { - "type": "string" + "counts": { + "additionalProperties": { + "type": "integer" }, - "type": "array", - "title": "Log" + "type": "object", + "title": "Counts" }, - "intents": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Intents", - "description": "what each action would do (nothing is done)" + "done": { + "type": "integer", + "title": "Done" }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Error" + "total": { + "type": "integer", + "title": "Total" }, - "steps": { + "remaining": { "type": "integer", - "title": "Steps", - "default": 0 + "title": "Remaining" } }, "additionalProperties": true, "type": "object", - "title": "AutomationTried" + "required": [ + "counts", + "done", + "total", + "remaining" + ], + "title": "BatchProgress" }, - "AutomationTry": { + "BatchReport": { "properties": { - "activity": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Activity", - "description": "an activity's id to run it on (GET /api/v1/activities)" + "text": { + "type": "string", + "title": "Text" }, - "as": { + "instructions": { + "type": "string", + "title": "Instructions" + }, + "key": { "anyOf": [ { "type": "string" @@ -35010,10 +36443,9 @@ "type": "null" } ], - "title": "As", - "description": "which trigger it runs as (its `as`); default: the first that fits" + "title": "Key" }, - "kind": { + "at": { "anyOf": [ { "type": "string" @@ -35022,30 +36454,36 @@ "type": "null" } ], - "title": "Kind", - "description": "else a kind of activity, to run it on that kind's sample" - } - }, - "additionalProperties": false, - "type": "object", - "title": "AutomationTry" - }, - "AutomationUpcoming": { - "properties": { - "times": { - "items": {}, + "title": "At" + }, + "refs": { + "items": { + "$ref": "#/components/schemas/BatchReportRef" + }, "type": "array", - "title": "Times", - "description": "when it runs next, from its schedules and timers (coming soon)" + "title": "Refs", + "default": [] } }, "additionalProperties": true, "type": "object", - "title": "AutomationUpcoming" + "required": [ + "text", + "instructions" + ], + "title": "BatchReport" }, - "AutomationUpdate": { + "BatchReportRef": { "properties": { - "name": { + "n": { + "type": "integer", + "title": "N" + }, + "recording_id": { + "type": "integer", + "title": "Recording Id" + }, + "title": { "anyOf": [ { "type": "string" @@ -35054,9 +36492,9 @@ "type": "null" } ], - "title": "Name" + "title": "Title" }, - "description": { + "date": { "anyOf": [ { "type": "string" @@ -35065,98 +36503,133 @@ "type": "null" } ], - "title": "Description" - }, - "enabled": { + "title": "Date" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "n", + "recording_id" + ], + "title": "BatchReportRef" + }, + "BatchResults": { + "properties": { + "key": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { "type": "null" } ], - "title": "Enabled" + "title": "Key" }, - "spaces": { - "anyOf": [ - { - "items": { - "type": "integer" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "title": "Spaces" + "columns": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Columns" }, - "triggers": { + "rows": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array", + "title": "Rows" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "columns", + "rows" + ], + "title": "BatchResults" + }, + "BatchRun": { + "properties": { + "template": { "anyOf": [ { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" + "type": "integer" }, { "type": "null" } ], - "title": "Triggers" + "title": "Template" }, - "join": { + "key": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "string" }, { "type": "null" } ], - "title": "Join" + "title": "Key", + "description": "output key for a prompt template" }, - "if": { + "filename": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "string" }, { "type": "null" } ], - "title": "If", - "description": "a match tree over the run context, tested before the Then runs, like {all: [{path, op, value}]}; null for none" + "title": "Filename", + "description": "file name for an export template" }, - "graph": { + "pipeline": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "integer" }, { "type": "null" } ], - "title": "Graph", - "description": "a new Then, saved as a new version of its workflow" + "title": "Pipeline" }, - "workflow": { + "steps": { "anyOf": [ { - "type": "integer" + "items": { + "anyOf": [ + { + "type": "string" + }, + { + "additionalProperties": true, + "type": "object" + } + ] + }, + "type": "array" }, { "type": "null" } ], - "title": "Workflow" - }, - "version": { + "title": "Steps" + } + }, + "additionalProperties": false, + "type": "object", + "title": "BatchRun", + "description": "What to run: a template, a pipeline, or a list of steps." + }, + "BatchSelection": { + "properties": { + "collection": { "anyOf": [ { "type": "integer" @@ -35165,29 +36638,23 @@ "type": "null" } ], - "title": "Version", - "description": "the workflow version to run; null follows the published one" + "title": "Collection" }, - "policy": { + "recordings": { "anyOf": [ { - "additionalProperties": { - "type": "string", - "enum": [ - "ask", - "auto" - ] + "items": { + "type": "integer" }, - "type": "object" + "type": "array" }, { "type": "null" } ], - "title": "Policy", - "description": "{action node id: ask}; a node already set to auto may stay auto, and only you set auto (its own route)" + "title": "Recordings" }, - "limits": { + "filter": { "anyOf": [ { "additionalProperties": true, @@ -35197,30 +36664,9 @@ "type": "null" } ], - "title": "Limits" - } - }, - "additionalProperties": false, - "type": "object", - "title": "AutomationUpdate" - }, - "AutomationVar": { - "properties": { - "name": { - "type": "string", - "title": "Name" - }, - "value": { - "title": "Value", - "description": "JSON up to 16 KB" - }, - "untrusted": { - "type": "boolean", - "title": "Untrusted", - "description": "set from text from outside Lens: prompts mark it as data", - "default": false + "title": "Filter" }, - "updated_at": { + "namespace": { "anyOf": [ { "type": "string" @@ -35229,181 +36675,93 @@ "type": "null" } ], - "title": "Updated At" + "title": "Namespace" }, - "updated_by": { + "entity": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Updated By", - "description": "who set it last: an email, or automation:" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "name" - ], - "title": "AutomationVar" - }, - "AutomationVars": { - "properties": { - "vars": { - "items": { - "$ref": "#/components/schemas/AutomationVar" - }, - "type": "array", - "title": "Vars" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "vars" - ], - "title": "AutomationVars" - }, - "AutomationVarsIn": { - "properties": { - "vars": { - "additionalProperties": true, - "type": "object", - "title": "Vars", - "description": "{name: value}: each one set to its value (JSON up to 16 KB), null clears it; the others stay" - } - }, - "additionalProperties": false, - "type": "object", - "required": [ - "vars" - ], - "title": "AutomationVarsIn" - }, - "Backend": { - "properties": { - "label": { - "type": "string", - "title": "Label" - }, - "fields": { - "additionalProperties": { - "type": "string" - }, - "type": "object", - "title": "Fields", - "description": "parameters and their defaults" - }, - "secrets": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Secrets" + "title": "Entity" }, - "oauth": { + "speaker": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Oauth", - "description": "the command that produces the token, for OAuth backends" - }, - "google": { - "type": "boolean", - "title": "Google", - "description": "signs in to Google: with a service account key, or as a Google account (its authorized user JSON as `token`)", - "default": false + "title": "Speaker" } }, - "additionalProperties": true, + "additionalProperties": false, "type": "object", - "required": [ - "label", - "fields", - "secrets" - ], - "title": "Backend" + "title": "BatchSelection", + "description": "Which assets: a collection, a list, or a filter (optionally narrowed to a namespace, entity or person)." }, - "Backup": { + "BatchSummary": { "properties": { - "name": { - "type": "string", - "title": "Name" + "id": { + "type": "integer", + "title": "Id" }, "label": { "type": "string", - "title": "Label", - "description": "manual, or before-upgrade" + "title": "Label" }, - "kind": { + "status": { "type": "string", - "enum": [ - "export", - "folder" - ], - "title": "Kind", - "description": "export: a SurrealDB export (.surql.gz); folder: an embedded database's copy" - }, - "bytes": { - "type": "integer", - "title": "Bytes", - "description": "the database's part and the files kept with it" + "title": "Status" }, - "files": { - "type": "boolean", - "title": "Files", - "description": "the files under data_dir are kept with it, and put back when it is restored", - "default": false + "created_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Created By" }, - "taken_at": { - "type": "string", - "title": "Taken At" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "name", - "label", - "kind", - "bytes", - "taken_at" - ], - "title": "Backup" - }, - "BackupLink": { - "properties": { - "url": { - "type": "string", - "title": "Url", - "description": "opens the download, without signing in, until it expires" + "created_at": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Created At" }, - "expires_in": { - "type": "integer", - "title": "Expires In", - "description": "seconds" + "progress": { + "$ref": "#/components/schemas/BatchProgress" } }, "additionalProperties": true, "type": "object", "required": [ - "url", - "expires_in" + "id", + "label", + "status", + "progress" ], - "title": "BackupLink" + "title": "BatchSummary" }, - "BackupSchedule": { + "Body_oauth-revoke": { "properties": { - "schedule": { + "token": { + "type": "string", + "title": "Token" + }, + "client_id": { "anyOf": [ { "type": "string" @@ -35412,21 +36770,9 @@ "type": "null" } ], - "title": "Schedule", - "description": "backups.schedule: a cron expression, or none" - }, - "timezone": { - "type": "string", - "title": "Timezone", - "default": "UTC" - }, - "keep": { - "type": "integer", - "title": "Keep", - "description": "how many scheduled backups are kept", - "default": 7 + "title": "Client Id" }, - "next_at": { + "client_secret": { "anyOf": [ { "type": "string" @@ -35435,9 +36781,22 @@ "type": "null" } ], - "title": "Next At" + "title": "Client Secret" + } + }, + "type": "object", + "required": [ + "token" + ], + "title": "Body_oauth-revoke" + }, + "Body_oauth-token": { + "properties": { + "grant_type": { + "type": "string", + "title": "Grant Type" }, - "last_at": { + "code": { "anyOf": [ { "type": "string" @@ -35446,9 +36805,9 @@ "type": "null" } ], - "title": "Last At" + "title": "Code" }, - "last_name": { + "redirect_uri": { "anyOf": [ { "type": "string" @@ -35457,9 +36816,9 @@ "type": "null" } ], - "title": "Last Name" + "title": "Redirect Uri" }, - "last_error": { + "code_verifier": { "anyOf": [ { "type": "string" @@ -35468,96 +36827,63 @@ "type": "null" } ], - "title": "Last Error" - } - }, - "additionalProperties": true, - "type": "object", - "title": "BackupSchedule" - }, - "Backups": { - "properties": { - "folder": { - "type": "string", - "title": "Folder" - }, - "backups": { - "items": { - "$ref": "#/components/schemas/Backup" - }, - "type": "array", - "title": "Backups" + "title": "Code Verifier" }, - "database": { + "refresh_token": { "anyOf": [ { - "type": "string", - "enum": [ - "server", - "embedded", - "memory" - ] + "type": "string" }, { "type": "null" } ], - "title": "Database", - "description": "the database this Lens uses: a restore needs a backup of the same kind (export or folder)" - }, - "in_progress": { - "items": { - "type": "string" - }, - "type": "array", - "title": "In Progress", - "description": "backups being written now, by any Lens process" + "title": "Refresh Token" }, - "restore": { + "client_id": { "anyOf": [ { - "$ref": "#/components/schemas/RestoreWork" + "type": "string" }, { "type": "null" } ], - "description": "the restore running on this server, or the last one" + "title": "Client Id" }, - "schedule": { + "client_secret": { "anyOf": [ { - "$ref": "#/components/schemas/BackupSchedule" + "type": "string" }, { "type": "null" } - ] + ], + "title": "Client Secret" } }, - "additionalProperties": true, "type": "object", "required": [ - "folder", - "backups" + "grant_type" ], - "title": "Backups" + "title": "Body_oauth-token" }, - "Batch": { + "BridgeStatus": { "properties": { - "id": { - "type": "integer", - "title": "Id" - }, - "label": { - "type": "string", - "title": "Label" - }, - "status": { + "state": { "type": "string", - "title": "Status" + "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 Matterbridge failed, `error` says why)" }, - "created_by": { + "error": { "anyOf": [ { "type": "string" @@ -35566,9 +36892,9 @@ "type": "null" } ], - "title": "Created By" + "title": "Error" }, - "created_at": { + "holder": { "anyOf": [ { "type": "string" @@ -35577,122 +36903,59 @@ "type": "null" } ], - "title": "Created At" - }, - "progress": { - "$ref": "#/components/schemas/BatchProgress" - }, - "steps": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Steps" + "title": "Holder", + "description": "the server process reading Matterbridge" }, - "selection": { + "at": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "string" }, { "type": "null" } ], - "title": "Selection" - }, - "recordings": { - "items": { - "type": "integer" - }, - "type": "array", - "title": "Recordings" - }, - "started": { - "items": { - "type": "integer" - }, - "type": "array", - "title": "Started" - }, - "skipped": { - "type": "integer", - "title": "Skipped", - "default": 0 + "title": "At", + "description": "when it last looked" }, - "estimate": { + "answered": { "anyOf": [ { - "$ref": "#/components/schemas/Estimate" + "type": "integer" }, { "type": "null" } - ] + ], + "title": "Answered", + "description": "messages it answered since it started" }, - "report": { + "matterbridge": { "anyOf": [ { - "$ref": "#/components/schemas/BatchReport" + "$ref": "#/components/schemas/MatterbridgeStatus" }, { "type": "null" } - ] + ], + "description": "the Matterbridge Lens runs, when it runs one" } }, "additionalProperties": true, "type": "object", "required": [ - "id", - "label", - "status", - "progress", - "steps", - "recordings", - "started" + "state" ], - "title": "Batch" - }, - "BatchActionResult": { - "properties": { - "ok": { - "type": "boolean", - "title": "Ok", - "default": true - }, - "result": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Result", - "description": "assets started (continue) or jobs retried (retry)" - } - }, - "additionalProperties": true, - "type": "object", - "title": "BatchActionResult" + "title": "BridgeStatus" }, - "BatchCombine": { - "properties": { - "instructions": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Instructions" + "BridgeTestResult": { + "properties": { + "ok": { + "type": "boolean", + "title": "Ok" }, - "key": { + "error": { "anyOf": [ { "type": "string" @@ -35701,35 +36964,46 @@ "type": "null" } ], - "title": "Key" + "title": "Error" } }, - "additionalProperties": false, + "additionalProperties": true, "type": "object", - "title": "BatchCombine" + "required": [ + "ok" + ], + "title": "BridgeTestResult" }, - "BatchCreate": { + "BrowseEntry": { "properties": { - "selection": { - "$ref": "#/components/schemas/BatchSelection" + "path": { + "type": "string", + "title": "Path" }, - "run": { - "$ref": "#/components/schemas/BatchRun" + "rel": { + "type": "string", + "title": "Rel" }, - "sample": { + "name": { + "type": "string", + "title": "Name" + }, + "dir": { + "type": "boolean", + "title": "Dir" + }, + "size": { "anyOf": [ { - "type": "integer", - "minimum": 1.0 + "type": "integer" }, { "type": "null" } ], - "title": "Sample", - "description": "run on this many first; continue after review" + "title": "Size" }, - "confirm": { + "modified": { "anyOf": [ { "type": "string" @@ -35738,49 +37012,9 @@ "type": "null" } ], - "title": "Confirm", - "description": "the confirmation text a big run asks for, e.g. \"RUN 40\"" - } - }, - "additionalProperties": false, - "type": "object", - "title": "BatchCreate" - }, - "BatchEstimate": { - "properties": { - "recordings": { - "type": "integer", - "title": "Recordings" - }, - "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" + "title": "Modified" }, - "confirm_text": { + "title": { "anyOf": [ { "type": "string" @@ -35789,164 +37023,169 @@ "type": "null" } ], - "title": "Confirm Text" + "title": "Title", + "description": "an email's subject, a calendar event's title" }, - "label": { - "type": "string", - "title": "Label" + "when": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "When", + "description": "when an email was sent, or a calendar event starts" }, - "steps": { + "imported": { "items": { - "additionalProperties": true, - "type": "object" + "$ref": "#/components/schemas/ImportedAs" }, "type": "array", - "title": "Steps" - }, - "skipped": { - "type": "integer", - "title": "Skipped", - "description": "matching assets you can't change" + "title": "Imported", + "description": "the assets this file already is, and where" } }, "additionalProperties": true, "type": "object", "required": [ - "recordings", - "hours", - "seconds", - "llm", - "would_replace", - "needs_confirmation", - "label", - "steps", - "skipped" + "path", + "rel", + "name", + "dir" ], - "title": "BatchEstimate" + "title": "BrowseEntry" }, - "BatchNeedsConfirmation": { + "BrowserAnswer": { "properties": { - "detail": { - "type": "string", - "title": "Detail" + "ok": { + "type": "boolean", + "title": "Ok", + "description": "whether the browser did it" }, - "estimate": { - "$ref": "#/components/schemas/Estimate" + "result": { + "title": "Result", + "description": "what it found or did (the page, the tabs, the file it attached...)" + }, + "error": { + "anyOf": [ + { + "type": "string", + "maxLength": 1000 + }, + { + "type": "null" + } + ], + "title": "Error", + "description": "why not, when it didn't (the person said no, no such ref...)" } }, - "additionalProperties": true, + "additionalProperties": false, "type": "object", "required": [ - "detail", - "estimate" + "ok" ], - "title": "BatchNeedsConfirmation" + "title": "BrowserAnswer" }, - "BatchPlan": { + "BrowserConnect": { "properties": { - "selection": { - "$ref": "#/components/schemas/BatchSelection" - }, - "run": { - "$ref": "#/components/schemas/BatchRun" + "label": { + "anyOf": [ + { + "type": "string", + "maxLength": 80 + }, + { + "type": "null" + } + ], + "title": "Label", + "description": "what to call this browser, e.g. 'Chrome on the laptop'" } }, "additionalProperties": false, "type": "object", - "title": "BatchPlan" + "title": "BrowserConnect" }, - "BatchProgress": { + "BrowserResult": { "properties": { - "counts": { - "additionalProperties": { - "type": "integer" - }, - "type": "object", - "title": "Counts" - }, - "done": { - "type": "integer", - "title": "Done" + "ok": { + "type": "boolean", + "title": "Ok" }, - "total": { - "type": "integer", - "title": "Total" + "result": { + "title": "Result" }, - "remaining": { - "type": "integer", - "title": "Remaining" + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Error" } }, "additionalProperties": true, "type": "object", "required": [ - "counts", - "done", - "total", - "remaining" + "ok" ], - "title": "BatchProgress" + "title": "BrowserResult" }, - "BatchReport": { + "BrowserRun": { "properties": { - "text": { - "type": "string", - "title": "Text" - }, - "instructions": { + "tool": { "type": "string", - "title": "Instructions" - }, - "key": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } + "enum": [ + "tabs", + "open", + "read", + "click", + "type", + "press", + "import" ], - "title": "Key" + "title": "Tool", + "description": "the action: one of the assistant's browser_ tools, without browser_" }, - "at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "At" + "args": { + "additionalProperties": true, + "type": "object", + "title": "Args", + "description": "its arguments, as the browser_ tool takes them" }, - "refs": { - "items": { - "$ref": "#/components/schemas/BatchReportRef" - }, - "type": "array", - "title": "Refs", - "default": [] + "wait": { + "type": "integer", + "maximum": 120.0, + "minimum": 1.0, + "title": "Wait", + "description": "seconds to wait for the browser", + "default": 60 } }, - "additionalProperties": true, + "additionalProperties": false, "type": "object", "required": [ - "text", - "instructions" + "tool" ], - "title": "BatchReport" + "title": "BrowserRun" }, - "BatchReportRef": { + "BrowserSession": { "properties": { - "n": { - "type": "integer", - "title": "N" + "id": { + "type": "string", + "title": "Id" }, - "recording_id": { - "type": "integer", - "title": "Recording Id" + "label": { + "type": "string", + "title": "Label" }, - "title": { + "created_at": { "anyOf": [ { "type": "string" @@ -35955,9 +37194,9 @@ "type": "null" } ], - "title": "Title" + "title": "Created At" }, - "date": { + "seen_at": { "anyOf": [ { "type": "string" @@ -35966,57 +37205,41 @@ "type": "null" } ], - "title": "Date" + "title": "Seen At" + }, + "live": { + "type": "boolean", + "title": "Live", + "description": "its side panel is connected now" } }, "additionalProperties": true, "type": "object", "required": [ - "n", - "recording_id" + "id", + "label", + "live" ], - "title": "BatchReportRef" + "title": "BrowserSession" }, - "BatchResults": { + "Budget": { "properties": { - "key": { + "resource": { + "type": "string", + "title": "Resource" + }, + "usd": { "anyOf": [ { - "type": "string" + "type": "number" }, { "type": "null" } ], - "title": "Key" - }, - "columns": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Columns" + "title": "Usd" }, - "rows": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Rows" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "columns", - "rows" - ], - "title": "BatchResults" - }, - "BatchRun": { - "properties": { - "template": { + "tokens": { "anyOf": [ { "type": "integer" @@ -36025,9 +37248,21 @@ "type": "null" } ], - "title": "Template" + "title": "Tokens" }, - "key": { + "period": { + "type": "string", + "title": "Period" + }, + "on_over": { + "type": "string", + "title": "On Over" + }, + "warn_at": { + "type": "number", + "title": "Warn At" + }, + "note": { "anyOf": [ { "type": "string" @@ -36036,10 +37271,9 @@ "type": "null" } ], - "title": "Key", - "description": "output key for a prompt template" + "title": "Note" }, - "filename": { + "by": { "anyOf": [ { "type": "string" @@ -36048,88 +37282,78 @@ "type": "null" } ], - "title": "Filename", - "description": "file name for an export template" + "title": "By" }, - "pipeline": { + "updated_at": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Pipeline" + "title": "Updated At" }, - "steps": { + "alert": { "anyOf": [ { - "items": { - "anyOf": [ - { - "type": "string" - }, - { - "additionalProperties": true, - "type": "object" - } - ] - }, - "type": "array" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "title": "Steps" + "title": "Alert", + "description": "the last warning: {state near|over, since, at, share}" } }, - "additionalProperties": false, + "additionalProperties": true, "type": "object", - "title": "BatchRun", - "description": "What to run: a template, a pipeline, or a list of steps." + "required": [ + "resource", + "period", + "on_over", + "warn_at" + ], + "title": "Budget" }, - "BatchSelection": { + "BudgetMeter": { "properties": { - "collection": { + "resource": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Collection" + "title": "Resource", + "description": "space:, or none for all of Lens" }, - "recordings": { + "namespace": { "anyOf": [ { - "items": { - "type": "integer" - }, - "type": "array" + "type": "string" }, { "type": "null" } ], - "title": "Recordings" + "title": "Namespace" }, - "filter": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } + "period": { + "type": "string", + "enum": [ + "day", + "week", + "month" ], - "title": "Filter" + "title": "Period" }, - "namespace": { + "since": { "anyOf": [ { "type": "string" @@ -36138,215 +37362,195 @@ "type": "null" } ], - "title": "Namespace" + "title": "Since" }, - "entity": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Entity" + "spent": { + "$ref": "#/components/schemas/Spent" }, - "speaker": { + "calls": { + "type": "integer", + "title": "Calls" + }, + "budget": { "anyOf": [ { - "type": "integer" + "$ref": "#/components/schemas/BudgetStatus" }, { "type": "null" } ], - "title": "Speaker" - } - }, - "additionalProperties": false, - "type": "object", - "title": "BatchSelection", - "description": "Which assets: a collection, a list, or a filter (optionally narrowed to a namespace, entity or person)." - }, - "BatchSummary": { - "properties": { - "id": { - "type": "integer", - "title": "Id" - }, - "label": { - "type": "string", - "title": "Label" - }, - "status": { - "type": "string", - "title": "Status" + "description": "where the budget it is measured against stands; none without one" }, - "created_by": { + "by_day": { "anyOf": [ { - "type": "string" + "items": { + "$ref": "#/components/schemas/DaySpend" + }, + "type": "array" }, { "type": "null" } ], - "title": "Created By" + "title": "By Day" }, - "created_at": { + "by_model": { "anyOf": [ { - "type": "string" + "items": { + "$ref": "#/components/schemas/ModelSpend" + }, + "type": "array" }, { "type": "null" } ], - "title": "Created At" - }, - "progress": { - "$ref": "#/components/schemas/BatchProgress" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "id", - "label", - "status", - "progress" - ], - "title": "BatchSummary" - }, - "Body_oauth-revoke": { - "properties": { - "token": { - "type": "string", - "title": "Token" + "title": "By Model" }, - "client_id": { + "top": { "anyOf": [ { - "type": "string" + "items": { + "$ref": "#/components/schemas/TopSpend" + }, + "type": "array" }, { "type": "null" } ], - "title": "Client Id" + "title": "Top" }, - "client_secret": { + "by_namespace": { "anyOf": [ { - "type": "string" + "items": { + "$ref": "#/components/schemas/TopSpend" + }, + "type": "array" }, { "type": "null" } ], - "title": "Client Secret" + "title": "By Namespace" } }, + "additionalProperties": true, "type": "object", "required": [ - "token" + "period", + "spent", + "calls" ], - "title": "Body_oauth-revoke" + "title": "BudgetMeter" }, - "Body_oauth-token": { + "BudgetSet": { "properties": { - "grant_type": { - "type": "string", - "title": "Grant Type" - }, - "code": { + "usd": { "anyOf": [ { - "type": "string" + "type": "number", + "minimum": 0.0 }, { "type": "null" } ], - "title": "Code" + "title": "Usd", + "description": "the cap in USD (from the costs in the activity ledger)" }, - "redirect_uri": { + "tokens": { "anyOf": [ { - "type": "string" + "type": "integer", + "minimum": 0.0 }, { "type": "null" } ], - "title": "Redirect Uri" + "title": "Tokens", + "description": "the cap in tokens (in and out)" }, - "code_verifier": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } + "period": { + "type": "string", + "enum": [ + "run", + "day", + "week", + "month" ], - "title": "Code Verifier" + "title": "Period", + "description": "what the cap is for: one run, or a day, week or month (UTC)", + "default": "month" }, - "refresh_token": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } + "on_over": { + "type": "string", + "enum": [ + "ask", + "skip", + "assistant" ], - "title": "Refresh Token" + "title": "On Over", + "description": "a run that would go over: ask (hold it until someone picks run or skip), skip, or assistant (the decision model weighs it; it runs only when sure, else asks)", + "default": "ask" }, - "client_id": { + "warn_at": { + "type": "number", + "maximum": 1.0, + "minimum": 0.1, + "title": "Warn At", + "description": "the share spent at which it's marked near (and warned about)", + "default": 0.8 + }, + "note": { "anyOf": [ { - "type": "string" + "type": "string", + "maxLength": 300 }, { "type": "null" } ], - "title": "Client Id" + "title": "Note" + } + }, + "additionalProperties": false, + "type": "object", + "title": "BudgetSet" + }, + "BudgetStatus": { + "properties": { + "resource": { + "type": "string", + "title": "Resource" }, - "client_secret": { + "budget": { "anyOf": [ { - "type": "string" + "$ref": "#/components/schemas/Budget" }, { "type": "null" } - ], - "title": "Client Secret" - } - }, - "type": "object", - "required": [ - "grant_type" - ], - "title": "Body_oauth-token" - }, - "BridgeStatus": { - "properties": { + ] + }, "state": { "type": "string", "enum": [ - "off", - "incomplete", - "starting", - "running", - "error" + "none", + "ok", + "near", + "over" ], - "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 Matterbridge failed, `error` says why)" + "title": "State" }, - "error": { + "since": { "anyOf": [ { "type": "string" @@ -36355,141 +37559,185 @@ "type": "null" } ], - "title": "Error" + "title": "Since", + "description": "the start of the period being counted" }, - "holder": { + "spent": { "anyOf": [ { - "type": "string" + "$ref": "#/components/schemas/Spent" }, { "type": "null" } - ], - "title": "Holder", - "description": "the server process reading Matterbridge" + ] }, - "at": { + "next": { + "$ref": "#/components/schemas/NextRun", + "description": "what one more run will likely cost: always an estimate" + }, + "left": { "anyOf": [ { - "type": "string" + "additionalProperties": { + "type": "number" + }, + "type": "object" }, { "type": "null" } ], - "title": "At", - "description": "when it last looked" + "title": "Left" }, - "answered": { + "share": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" } ], - "title": "Answered", - "description": "messages it answered since it started" + "title": "Share", + "description": "the largest share of a cap spent (1 is all of it)" }, - "matterbridge": { + "share_after_next": { "anyOf": [ { - "$ref": "#/components/schemas/MatterbridgeStatus" + "type": "number" }, { "type": "null" } ], - "description": "the Matterbridge Lens runs, when it runs one" + "title": "Share After Next", + "description": "the share once the next run (estimated) is done" } }, "additionalProperties": true, "type": "object", "required": [ - "state" + "resource", + "state", + "next" ], - "title": "BridgeStatus" + "title": "BudgetStatus" }, - "BridgeTestResult": { + "ChangeAsk": { "properties": { - "ok": { - "type": "boolean", - "title": "Ok" + "kind": { + "type": "string", + "enum": [ + "merge", + "link" + ], + "title": "Kind", + "description": "merge: two entities of one namespace are one; link: entities of two namespaces are the same thing" }, - "error": { + "a": { + "type": "string", + "title": "A", + "description": "an entity node id, e (for a merge, the one kept)" + }, + "b": { + "type": "string", + "title": "B" + }, + "reason": { "anyOf": [ { - "type": "string" + "type": "string", + "maxLength": 300 }, { "type": "null" } ], - "title": "Error" + "title": "Reason" + }, + "apply": { + "type": "boolean", + "title": "Apply", + "description": "make it now (editors) instead of proposing it for someone to accept", + "default": false } }, - "additionalProperties": true, "type": "object", "required": [ - "ok" + "kind", + "a", + "b" ], - "title": "BridgeTestResult" + "title": "ChangeAsk" }, - "BrowseEntry": { + "Chat": { "properties": { - "path": { - "type": "string", - "title": "Path" + "id": { + "type": "integer", + "title": "Id" }, - "rel": { + "title": { "type": "string", - "title": "Rel" + "title": "Title" }, - "name": { + "kind": { "type": "string", - "title": "Name" + "enum": [ + "chat", + "setup", + "bridge" + ], + "title": "Kind", + "description": "bridge: a conversation in a chat room, through Matterbridge", + "default": "chat" }, - "dir": { - "type": "boolean", - "title": "Dir" + "scope": { + "additionalProperties": true, + "type": "object", + "title": "Scope", + "default": {} }, - "size": { + "model": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Size" + "title": "Model", + "description": "the model chosen for this conversation; null: the configured one" }, - "modified": { + "tools": { "anyOf": [ { - "type": "string" + "items": { + "type": "string" + }, + "type": "array" }, { "type": "null" } ], - "title": "Modified" + "title": "Tools", + "description": "the tool groups and tools its answers may use; null: Auto" }, - "title": { + "max_tool_calls": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Title", - "description": "an email's subject, a calendar event's title" + "title": "Max Tool Calls", + "description": "at most this many tool calls in each answer; null: no limit but the rounds" }, - "when": { + "created_at": { "anyOf": [ { "type": "string" @@ -36498,90 +37746,69 @@ "type": "null" } ], - "title": "When", - "description": "when an email was sent, or a calendar event starts" - }, - "imported": { - "items": { - "$ref": "#/components/schemas/ImportedAs" - }, - "type": "array", - "title": "Imported", - "description": "the assets this file already is, and where" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "path", - "rel", - "name", - "dir" - ], - "title": "BrowseEntry" - }, - "BrowserAnswer": { - "properties": { - "ok": { - "type": "boolean", - "title": "Ok", - "description": "whether the browser did it" - }, - "result": { - "title": "Result", - "description": "what it found or did (the page, the tabs, the file it attached...)" + "title": "Created At" }, - "error": { + "updated_at": { "anyOf": [ { - "type": "string", - "maxLength": 1000 + "type": "string" }, { "type": "null" } ], - "title": "Error", - "description": "why not, when it didn't (the person said no, no such ref...)" - } - }, - "additionalProperties": false, - "type": "object", - "required": [ - "ok" - ], - "title": "BrowserAnswer" - }, - "BrowserConnect": { - "properties": { - "label": { + "title": "Updated At" + }, + "account": { + "type": "integer", + "title": "Account" + }, + "head": { "anyOf": [ { - "type": "string", - "maxLength": 80 + "type": "integer" }, { "type": "null" } ], - "title": "Label", - "description": "what to call this browser, e.g. 'Chrome on the laptop'" + "title": "Head", + "description": "the last message of the version showing, which the next question follows" + }, + "messages": { + "items": { + "$ref": "#/components/schemas/ChatMessage" + }, + "type": "array", + "title": "Messages", + "description": "the version showing, from the first message to `head`" + }, + "tree": { + "items": { + "$ref": "#/components/schemas/ChatNode" + }, + "type": "array", + "title": "Tree", + "description": "every message of every version, oldest first" } }, - "additionalProperties": false, + "additionalProperties": true, "type": "object", - "title": "BrowserConnect" + "required": [ + "id", + "title", + "account" + ], + "title": "Chat" }, - "BrowserResult": { + "ChatCapabilities": { "properties": { - "ok": { + "configured": { "type": "boolean", - "title": "Ok" - }, - "result": { - "title": "Result" + "title": "Configured", + "description": "a language model is set up; without one, answers are the best-matching passages" }, - "error": { + "model": { "anyOf": [ { "type": "string" @@ -36590,65 +37817,112 @@ "type": "null" } ], - "title": "Error" + "title": "Model", + "description": "the model answers come from" + }, + "tools": { + "type": "boolean", + "title": "Tools", + "description": "the assistant looks things up with tools (and may propose work for approval)" + }, + "max_steps": { + "type": "integer", + "title": "Max Steps", + "description": "the most rounds of tool calls it makes for one answer (a round makes one call or more)" + }, + "max_tool_calls": { + "type": "integer", + "title": "Max Tool Calls", + "description": "the most tool calls a question may give one answer (`max_tool_calls`)", + "default": 50 + }, + "check": { + "type": "boolean", + "title": "Check", + "description": "answers can be checked against their sources" + }, + "models": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Models", + "description": "the models people may pick, the configured one first (llm.chat_models, else the server's list)" } }, "additionalProperties": true, "type": "object", "required": [ - "ok" + "configured", + "tools", + "max_steps", + "check" ], - "title": "BrowserResult" + "title": "ChatCapabilities" }, - "BrowserRun": { + "ChatCompletion": { "properties": { - "tool": { + "id": { "type": "string", - "enum": [ - "tabs", - "open", - "read", - "click", - "type", - "press", - "import" - ], - "title": "Tool", - "description": "the action: one of the assistant's browser_ tools, without browser_" + "title": "Id" }, - "args": { - "additionalProperties": true, - "type": "object", - "title": "Args", - "description": "its arguments, as the browser_ tool takes them" + "object": { + "type": "string", + "title": "Object", + "default": "chat.completion" + }, + "created": { + "type": "integer", + "title": "Created" + }, + "model": { + "type": "string", + "title": "Model" + }, + "choices": { + "items": { + "$ref": "#/components/schemas/CompletionChoice" + }, + "type": "array", + "title": "Choices" + }, + "citations": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Citations", + "description": "the links of what it can cite, in order: [n] is the n-th" }, - "wait": { - "type": "integer", - "maximum": 120.0, - "minimum": 1.0, - "title": "Wait", - "description": "seconds to wait for the browser", - "default": 60 + "lens": { + "$ref": "#/components/schemas/CompletionLens" } }, - "additionalProperties": false, + "additionalProperties": true, "type": "object", "required": [ - "tool" + "id", + "created", + "model", + "choices", + "citations", + "lens" ], - "title": "BrowserRun" + "title": "ChatCompletion" }, - "BrowserSession": { + "ChatCompletionRequest": { "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "label": { - "type": "string", - "title": "Label" + "messages": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array", + "maxItems": 1000, + "title": "Messages", + "description": "the conversation: system, user, assistant (and tool) messages; the last is the question" }, - "created_at": { + "model": { "anyOf": [ { "type": "string" @@ -36657,75 +37931,96 @@ "type": "null" } ], - "title": "Created At" + "title": "Model", + "description": "lens (the configured model), or one people may pick in Lens's chat; anything else is lens" }, - "seen_at": { + "stream": { + "type": "boolean", + "title": "Stream", + "description": "send the answer as server-sent events, OpenAI's chunks, ending in data: [DONE]", + "default": false + }, + "temperature": { "anyOf": [ { - "type": "string" + "type": "number", + "maximum": 2.0, + "minimum": 0.0 }, { "type": "null" } ], - "title": "Seen At" + "title": "Temperature" }, - "live": { - "type": "boolean", - "title": "Live", - "description": "its side panel is connected now" + "stream_options": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Stream Options" + }, + "response_format": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Response Format", + "description": "any format asked for: the answer then has no Sources list after it (the format itself isn't enforced yet)" } }, "additionalProperties": true, "type": "object", "required": [ - "id", - "label", - "live" + "messages" ], - "title": "BrowserSession" + "title": "ChatCompletionRequest", + "description": "OpenAI's request. Fields it has that aren't listed here (n, top_p, user, max_tokens, tools, \u2026) are taken and\nleft alone." }, - "Budget": { + "ChatCreate": { "properties": { - "resource": { - "type": "string", - "title": "Resource" - }, - "usd": { + "title": { "anyOf": [ { - "type": "number" + "type": "string" }, { "type": "null" } ], - "title": "Usd" + "title": "Title" }, - "tokens": { + "kind": { + "type": "string", + "enum": [ + "chat", + "setup" + ], + "title": "Kind", + "description": "setup (admins): the assistant sets the server up with you, and makes the changes it proposes without asking (telemetry still asks)", + "default": "chat" + }, + "scope": { "anyOf": [ { - "type": "integer" + "$ref": "#/components/schemas/ChatScope" }, { "type": "null" } - ], - "title": "Tokens" - }, - "period": { - "type": "string", - "title": "Period" - }, - "on_over": { - "type": "string", - "title": "On Over" - }, - "warn_at": { - "type": "number", - "title": "Warn At" + ] }, - "note": { + "model": { "anyOf": [ { "type": "string" @@ -36734,69 +38029,95 @@ "type": "null" } ], - "title": "Note" + "title": "Model", + "description": "the model that answers in it (one of GET /chats/capabilities `models`); null: the configured one" }, - "by": { + "tools": { "anyOf": [ { - "type": "string" + "items": { + "type": "string" + }, + "type": "array", + "maxItems": 100 }, { "type": "null" } ], - "title": "By" + "title": "Tools", + "description": "what its answers may use: tool groups and tools (GET /chats/tools); [] for none; left out: your latest choice (PATCH /chats/{cid}), else Auto" }, - "updated_at": { + "max_tool_calls": { "anyOf": [ { - "type": "string" + "type": "integer", + "minimum": 1.0 }, { "type": "null" } ], - "title": "Updated At" + "title": "Max Tool Calls", + "description": "at most this many tool calls in each answer (1 to ai.max_tool_calls); left out: your latest choice" + } + }, + "additionalProperties": false, + "type": "object", + "title": "ChatCreate" + }, + "ChatMessage": { + "properties": { + "id": { + "type": "integer", + "title": "Id" }, - "alert": { + "role": { + "type": "string", + "enum": [ + "user", + "assistant" + ], + "title": "Role" + }, + "content": { + "type": "string", + "title": "Content" + }, + "context": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "$ref": "#/components/schemas/SharedContext" }, { "type": "null" } ], - "title": "Alert", - "description": "the last warning: {state near|over, since, at, share}" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "resource", - "period", - "on_over", - "warn_at" - ], - "title": "Budget" - }, - "BudgetMeter": { - "properties": { - "resource": { + "description": "a question asked from a page: the page, and any highlighted text" + }, + "attachments": { + "items": { + "$ref": "#/components/schemas/Attachment" + }, + "type": "array", + "title": "Attachments", + "description": "files sent with it (POST /uploads with hold)" + }, + "passages": { "anyOf": [ { - "type": "string" + "items": { + "$ref": "#/components/schemas/Passage" + }, + "type": "array" }, { "type": "null" } ], - "title": "Resource", - "description": "space:, or none for all of Lens" + "title": "Passages" }, - "namespace": { + "created_at": { "anyOf": [ { "type": "string" @@ -36805,18 +38126,35 @@ "type": "null" } ], - "title": "Namespace" + "title": "Created At" }, - "period": { - "type": "string", - "enum": [ - "day", - "week", - "month" + "stopped": { + "type": "boolean", + "title": "Stopped", + "description": "the answer was stopped (POST /chats/{cid}/stop): `content` is what came before", + "default": false + }, + "steps": { + "items": { + "$ref": "#/components/schemas/ToolStep" + }, + "type": "array", + "title": "Steps", + "description": "the tools the assistant used for this answer, in order" + }, + "notice": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } ], - "title": "Period" + "title": "Notice", + "description": "e.g. the model can't use tools, so the answer came from a search" }, - "since": { + "error": { "anyOf": [ { "type": "string" @@ -36825,316 +38163,212 @@ "type": "null" } ], - "title": "Since" - }, - "spent": { - "$ref": "#/components/schemas/Spent" - }, - "calls": { - "type": "integer", - "title": "Calls" + "title": "Error", + "description": "why there's no answer" }, - "budget": { + "check": { "anyOf": [ { - "$ref": "#/components/schemas/BudgetStatus" + "$ref": "#/components/schemas/AnswerCheck" }, { "type": "null" } ], - "description": "where the budget it is measured against stands; none without one" + "description": "its latest source check (POST .../messages/{mid}/check)" }, - "by_day": { + "model": { "anyOf": [ { - "items": { - "$ref": "#/components/schemas/DaySpend" - }, - "type": "array" + "type": "string" }, { "type": "null" } ], - "title": "By Day" + "title": "Model", + "description": "the model that wrote the answer" }, - "by_model": { + "parent": { "anyOf": [ { - "items": { - "$ref": "#/components/schemas/ModelSpend" - }, - "type": "array" + "type": "integer" }, { "type": "null" } ], - "title": "By Model" + "title": "Parent", + "description": "the message it follows; null for a first question" }, - "top": { + "versions": { "anyOf": [ { - "items": { - "$ref": "#/components/schemas/TopSpend" - }, - "type": "array" + "$ref": "#/components/schemas/Versions" }, { "type": "null" } ], - "title": "Top" + "description": "it and the others said in its place, from regenerating or editing" }, - "by_namespace": { + "meta": { "anyOf": [ { - "items": { - "$ref": "#/components/schemas/TopSpend" - }, - "type": "array" + "$ref": "#/components/schemas/MessageRecord" }, { "type": "null" } ], - "title": "By Namespace" + "description": "what produced it; none on messages from before it was recorded" } }, "additionalProperties": true, "type": "object", "required": [ - "period", - "spent", - "calls" + "id", + "role", + "content" ], - "title": "BudgetMeter" + "title": "ChatMessage" }, - "BudgetSet": { + "ChatNode": { "properties": { - "usd": { - "anyOf": [ - { - "type": "number", - "minimum": 0.0 - }, - { - "type": "null" - } - ], - "title": "Usd", - "description": "the cap in USD (from the costs in the activity ledger)" + "id": { + "type": "integer", + "title": "Id" }, - "tokens": { + "parent": { "anyOf": [ { - "type": "integer", - "minimum": 0.0 + "type": "integer" }, { "type": "null" } ], - "title": "Tokens", - "description": "the cap in tokens (in and out)" - }, - "period": { - "type": "string", - "enum": [ - "run", - "day", - "week", - "month" - ], - "title": "Period", - "description": "what the cap is for: one run, or a day, week or month (UTC)", - "default": "month" + "title": "Parent" }, - "on_over": { + "role": { "type": "string", "enum": [ - "ask", - "skip", + "user", "assistant" ], - "title": "On Over", - "description": "a run that would go over: ask (hold it until someone picks run or skip), skip, or assistant (the decision model weighs it; it runs only when sure, else asks)", - "default": "ask" - }, - "warn_at": { - "type": "number", - "maximum": 1.0, - "minimum": 0.1, - "title": "Warn At", - "description": "the share spent at which it's marked near (and warned about)", - "default": 0.8 + "title": "Role" }, - "note": { + "created_at": { "anyOf": [ { - "type": "string", - "maxLength": 300 + "type": "string" }, { "type": "null" } ], - "title": "Note" + "title": "Created At" } }, - "additionalProperties": false, + "additionalProperties": true, "type": "object", - "title": "BudgetSet" + "required": [ + "id", + "role" + ], + "title": "ChatNode", + "description": "A message of any version, as `tree` lists them." }, - "BudgetStatus": { + "ChatScope": { "properties": { - "resource": { - "type": "string", - "title": "Resource" - }, - "budget": { + "namespaces": { "anyOf": [ { - "$ref": "#/components/schemas/Budget" + "items": { + "type": "string" + }, + "type": "array" }, { "type": "null" } - ] - }, - "state": { - "type": "string", - "enum": [ - "none", - "ok", - "near", - "over" ], - "title": "State" + "title": "Namespaces" }, - "since": { + "recordings": { "anyOf": [ { - "type": "string" + "items": { + "type": "integer" + }, + "type": "array" }, { "type": "null" } ], - "title": "Since", - "description": "the start of the period being counted" - }, - "spent": { - "anyOf": [ - { - "$ref": "#/components/schemas/Spent" - }, - { - "type": "null" - } - ] - }, - "next": { - "$ref": "#/components/schemas/NextRun", - "description": "what one more run will likely cost: always an estimate" + "title": "Recordings" }, - "left": { + "collections": { "anyOf": [ { - "additionalProperties": { - "type": "number" + "items": { + "type": "integer" }, - "type": "object" + "type": "array" }, { "type": "null" } ], - "title": "Left" + "title": "Collections", + "description": "saved collections (yours or shared): their assets as they are when it answers" }, - "share": { + "speakers": { "anyOf": [ { - "type": "number" + "items": { + "type": "integer" + }, + "type": "array" }, { "type": "null" } ], - "title": "Share", - "description": "the largest share of a cap spent (1 is all of it)" + "title": "Speakers" }, - "share_after_next": { + "from": { "anyOf": [ { - "type": "number" + "type": "string" }, { "type": "null" } ], - "title": "Share After Next", - "description": "the share once the next run (estimated) is done" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "resource", - "state", - "next" - ], - "title": "BudgetStatus" - }, - "ChangeAsk": { - "properties": { - "kind": { - "type": "string", - "enum": [ - "merge", - "link" - ], - "title": "Kind", - "description": "merge: two entities of one namespace are one; link: entities of two namespaces are the same thing" - }, - "a": { - "type": "string", - "title": "A", - "description": "an entity node id, e (for a merge, the one kept)" - }, - "b": { - "type": "string", - "title": "B" + "title": "From", + "description": "YYYY-MM-DD" }, - "reason": { + "to": { "anyOf": [ { - "type": "string", - "maxLength": 300 + "type": "string" }, { "type": "null" } - ], - "title": "Reason" - }, - "apply": { - "type": "boolean", - "title": "Apply", - "description": "make it now (editors) instead of proposing it for someone to accept", - "default": false + ], + "title": "To", + "description": "YYYY-MM-DD" } }, + "additionalProperties": false, "type": "object", - "required": [ - "kind", - "a", - "b" - ], - "title": "ChangeAsk" + "title": "ChatScope", + "description": "What a conversation may draw on. Every field narrows it; leave them out to use everything you can read." }, - "Chat": { + "ChatSummary": { "properties": { "id": { "type": "integer", @@ -37221,257 +38455,63 @@ } ], "title": "Updated At" - }, - "account": { - "type": "integer", - "title": "Account" - }, - "head": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Head", - "description": "the last message of the version showing, which the next question follows" - }, - "messages": { - "items": { - "$ref": "#/components/schemas/ChatMessage" - }, - "type": "array", - "title": "Messages", - "description": "the version showing, from the first message to `head`" - }, - "tree": { - "items": { - "$ref": "#/components/schemas/ChatNode" - }, - "type": "array", - "title": "Tree", - "description": "every message of every version, oldest first" } }, "additionalProperties": true, "type": "object", "required": [ "id", - "title", - "account" + "title" ], - "title": "Chat" + "title": "ChatSummary" }, - "ChatCapabilities": { + "ChatTools": { "properties": { - "configured": { - "type": "boolean", - "title": "Configured", - "description": "a language model is set up; without one, answers are the best-matching passages" - }, - "model": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Model", - "description": "the model answers come from" - }, - "tools": { - "type": "boolean", - "title": "Tools", - "description": "the assistant looks things up with tools (and may propose work for approval)" - }, - "max_steps": { - "type": "integer", - "title": "Max Steps", - "description": "the most rounds of tool calls it makes for one answer (a round makes one call or more)" - }, - "max_tool_calls": { - "type": "integer", - "title": "Max Tool Calls", - "description": "the most tool calls a question may give one answer (`max_tool_calls`)", - "default": 50 - }, - "check": { - "type": "boolean", - "title": "Check", - "description": "answers can be checked against their sources" - }, - "models": { + "groups": { "items": { - "type": "string" + "$ref": "#/components/schemas/ToolGroup" }, "type": "array", - "title": "Models", - "description": "the models people may pick, the configured one first (llm.chat_models, else the server's list)" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "configured", - "tools", - "max_steps", - "check" - ], - "title": "ChatCapabilities" - }, - "ChatCompletion": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "object": { - "type": "string", - "title": "Object", - "default": "chat.completion" + "title": "Groups", + "description": "the built-in groups, then your extensions' (mcp:, ext:)" }, - "created": { + "max_tool_calls": { "type": "integer", - "title": "Created" - }, - "model": { - "type": "string", - "title": "Model" - }, - "choices": { - "items": { - "$ref": "#/components/schemas/CompletionChoice" - }, - "type": "array", - "title": "Choices" - }, - "citations": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Citations", - "description": "the links of what it can cite, in order: [n] is the n-th" - }, - "lens": { - "$ref": "#/components/schemas/CompletionLens" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "id", - "created", - "model", - "choices", - "citations", - "lens" - ], - "title": "ChatCompletion" - }, - "ChatCompletionRequest": { - "properties": { - "messages": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "maxItems": 1000, - "title": "Messages", - "description": "the conversation: system, user, assistant (and tool) messages; the last is the question" - }, - "model": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Model", - "description": "lens (the configured model), or one people may pick in Lens's chat; anything else is lens" - }, - "stream": { - "type": "boolean", - "title": "Stream", - "description": "send the answer as server-sent events, OpenAI's chunks, ending in data: [DONE]", - "default": false - }, - "temperature": { - "anyOf": [ - { - "type": "number", - "maximum": 2.0, - "minimum": 0.0 - }, - { - "type": "null" - } - ], - "title": "Temperature" + "title": "Max Tool Calls", + "description": "the most tool calls one answer may be given (ai.max_tool_calls)" }, - "stream_options": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Stream Options" + "remembered": { + "$ref": "#/components/schemas/ToolChoice", + "description": "your latest choice, which new conversations start with" }, - "response_format": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Response Format", - "description": "any format asked for: the answer then has no Sources list after it (the format itself isn't enforced yet)" + "namespaces_note": { + "type": "string", + "title": "Namespaces Note", + "description": "what the choice of namespaces doesn't narrow", + "default": "Web and MCP tools reach beyond your namespaces: the namespaces you pick narrow the archive's tools only." } }, "additionalProperties": true, "type": "object", "required": [ - "messages" + "groups", + "max_tool_calls", + "remembered" ], - "title": "ChatCompletionRequest", - "description": "OpenAI's request. Fields it has that aren't listed here (n, top_p, user, max_tokens, tools, \u2026) are taken and\nleft alone." + "title": "ChatTools" }, - "ChatCreate": { + "ChatUpdate": { "properties": { "title": { "anyOf": [ { "type": "string" - }, - { - "type": "null" - } - ], - "title": "Title" - }, - "kind": { - "type": "string", - "enum": [ - "chat", - "setup" + }, + { + "type": "null" + } ], - "title": "Kind", - "description": "setup (admins): the assistant sets the server up with you, and makes the changes it proposes without asking (telemetry still asks)", - "default": "chat" + "title": "Title" }, "scope": { "anyOf": [ @@ -37509,7 +38549,7 @@ } ], "title": "Tools", - "description": "what its answers may use: tool groups and tools (GET /chats/tools); [] for none; left out: your latest choice (PATCH /chats/{cid}), else Auto" + "description": "what its answers may use: tool groups and tools (GET /chats/tools); [] for none; null: Auto (everything you may use). Your new conversations start with it too" }, "max_tool_calls": { "anyOf": [ @@ -37522,125 +38562,78 @@ } ], "title": "Max Tool Calls", - "description": "at most this many tool calls in each answer (1 to ai.max_tool_calls); left out: your latest choice" + "description": "at most this many tool calls in each answer (1 to ai.max_tool_calls); null: no limit but the rounds" } }, "additionalProperties": false, "type": "object", - "title": "ChatCreate" + "title": "ChatUpdate" }, - "ChatMessage": { + "ClassifyRequest": { "properties": { - "id": { - "type": "integer", - "title": "Id" - }, - "role": { - "type": "string", - "enum": [ - "user", - "assistant" - ], - "title": "Role" - }, - "content": { - "type": "string", - "title": "Content" - }, - "context": { - "anyOf": [ - { - "$ref": "#/components/schemas/SharedContext" - }, - { - "type": "null" - } - ], - "description": "a question asked from a page: the page, and any highlighted text" - }, - "attachments": { - "items": { - "$ref": "#/components/schemas/Attachment" - }, - "type": "array", - "title": "Attachments", - "description": "files sent with it (POST /uploads with hold)" - }, - "passages": { + "recording": { "anyOf": [ { - "items": { - "$ref": "#/components/schemas/Passage" - }, - "type": "array" + "type": "integer" }, { "type": "null" } ], - "title": "Passages" + "title": "Recording", + "description": "the asset to classify" }, - "created_at": { + "text": { "anyOf": [ { - "type": "string" + "type": "string", + "maxLength": 20000 }, { "type": "null" } ], - "title": "Created At" - }, - "stopped": { - "type": "boolean", - "title": "Stopped", - "description": "the answer was stopped (POST /chats/{cid}/stop): `content` is what came before", - "default": false - }, - "steps": { - "items": { - "$ref": "#/components/schemas/ToolStep" - }, - "type": "array", - "title": "Steps", - "description": "the tools the assistant used for this answer, in order" + "title": "Text", + "description": "text to classify instead" }, - "notice": { + "labels": { "anyOf": [ { - "type": "string" + "additionalProperties": { + "type": "string" + }, + "type": "object" }, { - "type": "null" - } - ], - "title": "Notice", - "description": "e.g. the model can't use tools, so the answer came from a search" - }, - "error": { - "anyOf": [ - { - "type": "string" + "items": { + "type": "string" + }, + "type": "array" }, { "type": "null" } ], - "title": "Error", - "description": "why there's no answer" + "title": "Labels", + "description": "the labels to choose from (2 to 60): names, or {name: what it means}" }, - "check": { + "vocabulary": { "anyOf": [ { - "$ref": "#/components/schemas/AnswerCheck" + "type": "string", + "enum": [ + "content_type", + "topic" + ] }, { "type": "null" } ], - "description": "its latest source check (POST .../messages/{mid}/check)" + "title": "Vocabulary", + "description": "choose from Lens's content types (of the asset's kind), or the namespace's topics" }, - "model": { + "namespace": { "anyOf": [ { "type": "string" @@ -37649,79 +38642,65 @@ "type": "null" } ], - "title": "Model", - "description": "the model that wrote the answer" - }, - "parent": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Parent", - "description": "the message it follows; null for a first question" + "title": "Namespace", + "description": "whose topics, when classifying a text by topic" }, - "versions": { + "question": { "anyOf": [ { - "$ref": "#/components/schemas/Versions" + "type": "string", + "maxLength": 500 }, { "type": "null" } ], - "description": "it and the others said in its place, from regenerating or editing" + "title": "Question", + "description": "what to ask (default: which label fits best)" }, - "meta": { - "anyOf": [ - { - "$ref": "#/components/schemas/MessageRecord" - }, - { - "type": "null" - } - ], - "description": "what produced it; none on messages from before it was recorded" + "apply": { + "type": "boolean", + "title": "Apply", + "description": "act on a sure answer: set the content type, suggest the topic, or add the label as a tag (editors)", + "default": false } }, - "additionalProperties": true, + "additionalProperties": false, "type": "object", - "required": [ - "id", - "role", - "content" - ], - "title": "ChatMessage" + "title": "ClassifyRequest", + "description": "Give a `recording` or a `text`, and `labels` or a `vocabulary`." }, - "ChatNode": { + "ClassifyResult": { "properties": { - "id": { - "type": "integer", - "title": "Id" + "choice": { + "type": "string", + "title": "Choice", + "description": "the label that fits best" }, - "parent": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Parent" + "confidence": { + "type": "number", + "title": "Confidence", + "description": "how sure, from 0 to 1" }, - "role": { + "sure": { + "type": "boolean", + "title": "Sure", + "description": "sure enough to act on without asking (decisions.act_above)" + }, + "ranked": { + "items": { + "$ref": "#/components/schemas/RankedLabel" + }, + "type": "array", + "title": "Ranked", + "description": "every label, the likeliest first" + }, + "by": { "type": "string", - "enum": [ - "user", - "assistant" - ], - "title": "Role" + "title": "By", + "description": "what answered: jev, laya, llm, or only option" }, - "created_at": { + "vocabulary": { "anyOf": [ { "type": "string" @@ -37730,78 +38709,73 @@ "type": "null" } ], - "title": "Created At" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "id", - "role" - ], - "title": "ChatNode", - "description": "A message of any version, as `tree` lists them." - }, - "ChatScope": { - "properties": { - "namespaces": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "title": "Namespaces" + "title": "Vocabulary" }, - "recordings": { + "question": { + "type": "string", + "title": "Question" + }, + "applied": { "anyOf": [ - { - "items": { - "type": "integer" - }, - "type": "array" + { + "type": "string", + "enum": [ + "content_type", + "topic_suggested", + "tag" + ] }, { "type": "null" } ], - "title": "Recordings" + "title": "Applied", + "description": "what was done with a sure answer, when apply was asked" }, - "collections": { + "key": { "anyOf": [ { - "items": { - "type": "integer" - }, - "type": "array" + "type": "string" }, { "type": "null" } ], - "title": "Collections", - "description": "saved collections (yours or shared): their assets as they are when it answers" + "title": "Key", + "description": "content_type: the chosen content type's key" }, - "speakers": { + "id": { "anyOf": [ { - "items": { - "type": "integer" - }, - "type": "array" + "type": "integer" }, { "type": "null" } ], - "title": "Speakers" + "title": "Id", + "description": "topic: the chosen topic's id" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "choice", + "confidence", + "sure", + "ranked", + "by", + "question" + ], + "title": "ClassifyResult" + }, + "ClientRegistered": { + "properties": { + "client_id": { + "type": "string", + "title": "Client Id" }, - "from": { + "client_secret": { "anyOf": [ { "type": "string" @@ -37810,10 +38784,24 @@ "type": "null" } ], - "title": "From", - "description": "YYYY-MM-DD" + "title": "Client Secret", + "description": "only for apps that asked for one; shown once" }, - "to": { + "client_id_issued_at": { + "type": "integer", + "title": "Client Id Issued At" + }, + "client_secret_expires_at": { + "type": "integer", + "title": "Client Secret Expires At", + "description": "0: it doesn't expire", + "default": 0 + }, + "client_name": { + "type": "string", + "title": "Client Name" + }, + "client_uri": { "anyOf": [ { "type": "string" @@ -37822,43 +38810,68 @@ "type": "null" } ], - "title": "To", - "description": "YYYY-MM-DD" - } - }, - "additionalProperties": false, - "type": "object", - "title": "ChatScope", - "description": "What a conversation may draw on. Every field narrows it; leave them out to use everything you can read." - }, - "ChatSummary": { - "properties": { - "id": { - "type": "integer", - "title": "Id" + "title": "Client Uri" }, - "title": { - "type": "string", - "title": "Title" + "redirect_uris": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Redirect Uris" }, - "kind": { + "token_endpoint_auth_method": { "type": "string", - "enum": [ - "chat", - "setup", - "bridge" - ], - "title": "Kind", - "description": "bridge: a conversation in a chat room, through Matterbridge", - "default": "chat" + "title": "Token Endpoint Auth Method" + }, + "grant_types": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Grant Types", + "default": [ + "authorization_code", + "refresh_token" + ] + }, + "response_types": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Response Types", + "default": [ + "code" + ] }, "scope": { - "additionalProperties": true, - "type": "object", + "type": "string", "title": "Scope", - "default": {} + "default": "read write" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "client_id", + "client_id_issued_at", + "client_name", + "redirect_uris", + "token_endpoint_auth_method" + ], + "title": "ClientRegistered" + }, + "ClientRegistration": { + "properties": { + "redirect_uris": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Redirect Uris", + "description": "https, http://localhost (any port), or the app's own scheme; 1 to 10" }, - "model": { + "client_name": { "anyOf": [ { "type": "string" @@ -37867,48 +38880,55 @@ "type": "null" } ], - "title": "Model", - "description": "the model chosen for this conversation; null: the configured one" + "title": "Client Name", + "description": "shown on the consent page and in the list of apps with access" }, - "tools": { + "client_uri": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array" + "type": "string" }, { "type": "null" } ], - "title": "Tools", - "description": "the tool groups and tools its answers may use; null: Auto" + "title": "Client Uri" }, - "max_tool_calls": { + "token_endpoint_auth_method": { + "type": "string", + "title": "Token Endpoint Auth Method", + "description": "none (public apps), client_secret_post or client_secret_basic", + "default": "none" + }, + "grant_types": { "anyOf": [ { - "type": "integer" + "items": { + "type": "string" + }, + "type": "array" }, { "type": "null" } ], - "title": "Max Tool Calls", - "description": "at most this many tool calls in each answer; null: no limit but the rounds" + "title": "Grant Types" }, - "created_at": { + "response_types": { "anyOf": [ { - "type": "string" + "items": { + "type": "string" + }, + "type": "array" }, { "type": "null" } ], - "title": "Created At" + "title": "Response Types" }, - "updated_at": { + "scope": { "anyOf": [ { "type": "string" @@ -37917,55 +38937,68 @@ "type": "null" } ], - "title": "Updated At" + "title": "Scope" } }, - "additionalProperties": true, "type": "object", "required": [ - "id", - "title" + "redirect_uris" ], - "title": "ChatSummary" + "title": "ClientRegistration", + "description": "Dynamic client registration (RFC 7591). Metadata Lens has no use for is ignored, as the RFC asks." }, - "ChatTools": { + "CloudModelProvider": { "properties": { - "groups": { + "name": { + "type": "string", + "title": "Name" + }, + "base_url": { + "type": "string", + "title": "Base Url" + }, + "model": { + "type": "string", + "title": "Model" + }, + "models": { "items": { - "$ref": "#/components/schemas/ToolGroup" + "type": "string" }, "type": "array", - "title": "Groups", - "description": "the built-in groups, then your extensions' (mcp:, ext:)" - }, - "max_tool_calls": { - "type": "integer", - "title": "Max Tool Calls", - "description": "the most tool calls one answer may be given (ai.max_tool_calls)" - }, - "remembered": { - "$ref": "#/components/schemas/ToolChoice", - "description": "your latest choice, which new conversations start with" + "title": "Models" }, - "namespaces_note": { + "key_url": { "type": "string", - "title": "Namespaces Note", - "description": "what the choice of namespaces doesn't narrow", - "default": "Web and MCP tools reach beyond your namespaces: the namespaces you pick narrow the archive's tools only." + "title": "Key Url" } }, "additionalProperties": true, "type": "object", "required": [ - "groups", - "max_tool_calls", - "remembered" + "name", + "base_url", + "model", + "models", + "key_url" ], - "title": "ChatTools" + "title": "CloudModelProvider" }, - "ChatUpdate": { + "Collection": { "properties": { - "title": { + "id": { + "type": "integer", + "title": "Id" + }, + "account": { + "type": "integer", + "title": "Account" + }, + "name": { + "type": "string", + "title": "Name" + }, + "description": { "anyOf": [ { "type": "string" @@ -37974,19 +39007,34 @@ "type": "null" } ], - "title": "Title" + "title": "Description" }, - "scope": { + "kind": { + "type": "string", + "enum": [ + "filter", + "fixed" + ], + "title": "Kind" + }, + "filter": { "anyOf": [ { - "$ref": "#/components/schemas/ChatScope" + "additionalProperties": true, + "type": "object" }, { "type": "null" } - ] + ], + "title": "Filter" }, - "model": { + "shared": { + "type": "boolean", + "title": "Shared", + "default": false + }, + "updated_at": { "anyOf": [ { "type": "string" @@ -37995,81 +39043,74 @@ "type": "null" } ], - "title": "Model", - "description": "the model that answers in it (one of GET /chats/capabilities `models`); null: the configured one" + "title": "Updated At" }, - "tools": { + "count": { + "type": "integer", + "title": "Count", + "description": "assets in it you can read" + }, + "recordings": { "anyOf": [ { "items": { - "type": "string" + "type": "integer" }, - "type": "array", - "maxItems": 100 - }, - { - "type": "null" - } - ], - "title": "Tools", - "description": "what its answers may use: tool groups and tools (GET /chats/tools); [] for none; null: Auto (everything you may use). Your new conversations start with it too" - }, - "max_tool_calls": { - "anyOf": [ - { - "type": "integer", - "minimum": 1.0 + "type": "array" }, { "type": "null" } ], - "title": "Max Tool Calls", - "description": "at most this many tool calls in each answer (1 to ai.max_tool_calls); null: no limit but the rounds" + "title": "Recordings" } }, - "additionalProperties": false, + "additionalProperties": true, "type": "object", - "title": "ChatUpdate" + "required": [ + "id", + "account", + "name", + "kind", + "count" + ], + "title": "Collection" }, - "ClassifyRequest": { + "CollectionCreate": { "properties": { - "recording": { + "name": { + "type": "string", + "title": "Name" + }, + "description": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Recording", - "description": "the asset to classify" + "title": "Description" }, - "text": { + "filter": { "anyOf": [ { - "type": "string", - "maxLength": 20000 + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "title": "Text", - "description": "text to classify instead" + "title": "Filter", + "description": "keys: namespaces, speakers, entities, from, to, q, media, status" }, - "labels": { + "recordings": { "anyOf": [ - { - "additionalProperties": { - "type": "string" - }, - "type": "object" - }, { "items": { - "type": "string" + "type": "integer" }, "type": "array" }, @@ -38077,93 +39118,89 @@ "type": "null" } ], - "title": "Labels", - "description": "the labels to choose from (2 to 60): names, or {name: what it means}" + "title": "Recordings", + "description": "a fixed list instead of a filter" }, - "vocabulary": { + "shared": { + "type": "boolean", + "title": "Shared", + "default": false + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "name" + ], + "title": "CollectionCreate" + }, + "CollectionDetail": { + "properties": { + "id": { + "type": "integer", + "title": "Id" + }, + "account": { + "type": "integer", + "title": "Account" + }, + "name": { + "type": "string", + "title": "Name" + }, + "description": { "anyOf": [ { - "type": "string", - "enum": [ - "content_type", - "topic" - ] + "type": "string" }, { "type": "null" } ], - "title": "Vocabulary", - "description": "choose from Lens's content types (of the asset's kind), or the namespace's topics" + "title": "Description" }, - "namespace": { + "kind": { + "type": "string", + "enum": [ + "filter", + "fixed" + ], + "title": "Kind" + }, + "filter": { "anyOf": [ { - "type": "string" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "title": "Namespace", - "description": "whose topics, when classifying a text by topic" + "title": "Filter" }, - "question": { + "shared": { + "type": "boolean", + "title": "Shared", + "default": false + }, + "updated_at": { "anyOf": [ { - "type": "string", - "maxLength": 500 + "type": "string" }, { "type": "null" } ], - "title": "Question", - "description": "what to ask (default: which label fits best)" - }, - "apply": { - "type": "boolean", - "title": "Apply", - "description": "act on a sure answer: set the content type, suggest the topic, or add the label as a tag (editors)", - "default": false - } - }, - "additionalProperties": false, - "type": "object", - "title": "ClassifyRequest", - "description": "Give a `recording` or a `text`, and `labels` or a `vocabulary`." - }, - "ClassifyResult": { - "properties": { - "choice": { - "type": "string", - "title": "Choice", - "description": "the label that fits best" - }, - "confidence": { - "type": "number", - "title": "Confidence", - "description": "how sure, from 0 to 1" - }, - "sure": { - "type": "boolean", - "title": "Sure", - "description": "sure enough to act on without asking (decisions.act_above)" - }, - "ranked": { - "items": { - "$ref": "#/components/schemas/RankedLabel" - }, - "type": "array", - "title": "Ranked", - "description": "every label, the likeliest first" + "title": "Updated At" }, - "by": { - "type": "string", - "title": "By", - "description": "what answered: jev, laya, llm, or only option" + "count": { + "type": "integer", + "title": "Count", + "description": "assets in it you can read" }, - "vocabulary": { + "created_at": { "anyOf": [ { "type": "string" @@ -38172,30 +39209,47 @@ "type": "null" } ], - "title": "Vocabulary" + "title": "Created At" }, - "question": { - "type": "string", - "title": "Question" + "recordings": { + "items": { + "$ref": "#/components/schemas/CollectionRecording" + }, + "type": "array", + "title": "Recordings", + "description": "the newest 200 you can read" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "id", + "account", + "name", + "kind", + "count", + "recordings" + ], + "title": "CollectionDetail" + }, + "CollectionMember": { + "properties": { + "account": { + "type": "integer", + "title": "Account" }, - "applied": { + "email": { "anyOf": [ { - "type": "string", - "enum": [ - "content_type", - "topic_suggested", - "tag" - ] + "type": "string" }, { "type": "null" } ], - "title": "Applied", - "description": "what was done with a sure answer, when apply was asked" + "title": "Email" }, - "key": { + "name": { "anyOf": [ { "type": "string" @@ -38204,41 +39258,30 @@ "type": "null" } ], - "title": "Key", - "description": "content_type: the chosen content type's key" + "title": "Name" }, - "id": { + "role": { + "type": "string", + "enum": [ + "viewer", + "editor", + "admin" + ], + "title": "Role" + }, + "by": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Id", - "description": "topic: the chosen topic's id" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "choice", - "confidence", - "sure", - "ranked", - "by", - "question" - ], - "title": "ClassifyResult" - }, - "ClientRegistered": { - "properties": { - "client_id": { - "type": "string", - "title": "Client Id" + "title": "By", + "description": "who gave it" }, - "client_secret": { + "at": { "anyOf": [ { "type": "string" @@ -38247,94 +39290,31 @@ "type": "null" } ], - "title": "Client Secret", - "description": "only for apps that asked for one; shown once" - }, - "client_id_issued_at": { - "type": "integer", - "title": "Client Id Issued At" - }, - "client_secret_expires_at": { - "type": "integer", - "title": "Client Secret Expires At", - "description": "0: it doesn't expire", - "default": 0 - }, - "client_name": { - "type": "string", - "title": "Client Name" + "title": "At" }, - "client_uri": { + "inherited_from": { "anyOf": [ { - "type": "string" + "$ref": "#/components/schemas/CollectionStep" }, { "type": "null" } ], - "title": "Client Uri" - }, - "redirect_uris": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Redirect Uris" - }, - "token_endpoint_auth_method": { - "type": "string", - "title": "Token Endpoint Auth Method" - }, - "grant_types": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Grant Types", - "default": [ - "authorization_code", - "refresh_token" - ] - }, - "response_types": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Response Types", - "default": [ - "code" - ] - }, - "scope": { - "type": "string", - "title": "Scope", - "default": "read write" + "description": "given on this collection it's inside (null: on this one)" } }, "additionalProperties": true, "type": "object", "required": [ - "client_id", - "client_id_issued_at", - "client_name", - "redirect_uris", - "token_endpoint_auth_method" + "account", + "role" ], - "title": "ClientRegistered" + "title": "CollectionMember" }, - "ClientRegistration": { + "CollectionMemberSet": { "properties": { - "redirect_uris": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Redirect Uris", - "description": "https, http://localhost (any port), or the app's own scheme; 1 to 10" - }, - "client_name": { + "email": { "anyOf": [ { "type": "string" @@ -38343,125 +39323,113 @@ "type": "null" } ], - "title": "Client Name", - "description": "shown on the consent page and in the list of apps with access" + "title": "Email" }, - "client_uri": { + "account": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Client Uri" - }, - "token_endpoint_auth_method": { - "type": "string", - "title": "Token Endpoint Auth Method", - "description": "none (public apps), client_secret_post or client_secret_basic", - "default": "none" + "title": "Account" }, - "grant_types": { + "role": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array" + "type": "string", + "enum": [ + "viewer", + "editor", + "admin" + ] }, { "type": "null" } ], - "title": "Grant Types" + "title": "Role" + } + }, + "additionalProperties": false, + "type": "object", + "title": "CollectionMemberSet", + "description": "Who (by email, or by account id) and their role on the collection; a null role takes it away." + }, + "CollectionNode": { + "properties": { + "id": { + "type": "integer", + "title": "Id" }, - "response_types": { + "name": { + "type": "string", + "title": "Name" + }, + "description": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array" + "type": "string" }, { "type": "null" } ], - "title": "Response Types" + "title": "Description" }, - "scope": { + "parent": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Scope" - } - }, - "type": "object", - "required": [ - "redirect_uris" - ], - "title": "ClientRegistration", - "description": "Dynamic client registration (RFC 7591). Metadata Lens has no use for is ignored, as the RFC asks." - }, - "CloudModelProvider": { - "properties": { - "name": { - "type": "string", - "title": "Name" - }, - "base_url": { - "type": "string", - "title": "Base Url" + "title": "Parent", + "description": "the collection it's in; null: the top of its namespace" }, - "model": { - "type": "string", - "title": "Model" + "depth": { + "type": "integer", + "title": "Depth", + "description": "0 at the top", + "default": 0 }, - "models": { + "path": { "items": { "type": "string" }, "type": "array", - "title": "Models" + "title": "Path", + "description": "names from the top of the namespace down to it" }, - "key_url": { - "type": "string", - "title": "Key Url" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "name", - "base_url", - "model", - "models", - "key_url" - ], - "title": "CloudModelProvider" - }, - "Collection": { - "properties": { - "id": { + "recordings": { + "type": "integer", + "title": "Recordings", + "description": "assets it holds", + "default": 0 + }, + "total": { "type": "integer", - "title": "Id" + "title": "Total", + "description": "assets it and the collections inside it hold", + "default": 0 }, - "account": { + "children": { "type": "integer", - "title": "Account" + "title": "Children", + "description": "collections directly inside it", + "default": 0 }, - "name": { - "type": "string", - "title": "Name" + "default": { + "type": "boolean", + "title": "Default", + "description": "new assets go here when nobody says where", + "default": false }, - "description": { + "created_at": { "anyOf": [ { "type": "string" @@ -38470,32 +39438,18 @@ "type": "null" } ], - "title": "Description" - }, - "kind": { - "type": "string", - "enum": [ - "filter", - "fixed" - ], - "title": "Kind" + "title": "Created At" }, - "filter": { + "created_by": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "string" }, { "type": "null" } ], - "title": "Filter" - }, - "shared": { - "type": "boolean", - "title": "Shared", - "default": false + "title": "Created By" }, "updated_at": { "anyOf": [ @@ -38508,86 +39462,76 @@ ], "title": "Updated At" }, - "count": { - "type": "integer", - "title": "Count", - "description": "assets in it you can read" - }, - "recordings": { + "role": { "anyOf": [ { - "items": { - "type": "integer" - }, - "type": "array" + "type": "string", + "enum": [ + "viewer", + "editor", + "admin" + ] }, { "type": "null" } ], - "title": "Recordings" + "title": "Role", + "description": "your role on it: from your namespace role (an owner is an admin) or one given on it or above it" + }, + "can_change": { + "type": "boolean", + "title": "Can Change", + "description": "you may rename, describe, move or delete it, and make collections inside it", + "default": false + }, + "can_grant": { + "type": "boolean", + "title": "Can Grant", + "description": "you may give people roles on it", + "default": false } }, "additionalProperties": true, "type": "object", "required": [ "id", - "account", - "name", - "kind", - "count" + "name" ], - "title": "Collection" + "title": "CollectionNode" }, - "CollectionCreate": { + "CollectionNodeCreate": { "properties": { "name": { "type": "string", - "title": "Name" - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Description" + "maxLength": 120, + "minLength": 1, + "title": "Name", + "description": "unique among the collections next to it, ignoring case" }, - "filter": { + "parent": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "integer" }, { "type": "null" } ], - "title": "Filter", - "description": "keys: namespaces, speakers, entities, from, to, q, media, status" + "title": "Parent", + "description": "the collection to put it in; null: the top of the namespace" }, - "recordings": { + "description": { "anyOf": [ { - "items": { - "type": "integer" - }, - "type": "array" + "type": "string", + "maxLength": 2000 }, { "type": "null" } ], - "title": "Recordings", - "description": "a fixed list instead of a filter" - }, - "shared": { - "type": "boolean", - "title": "Shared", - "default": false + "title": "Description" } }, "additionalProperties": false, @@ -38595,26 +39539,28 @@ "required": [ "name" ], - "title": "CollectionCreate" + "title": "CollectionNodeCreate" }, - "CollectionDetail": { + "CollectionNodeUpdate": { "properties": { - "id": { - "type": "integer", - "title": "Id" - }, - "account": { - "type": "integer", - "title": "Account" - }, "name": { - "type": "string", + "anyOf": [ + { + "type": "string", + "maxLength": 120, + "minLength": 1 + }, + { + "type": "null" + } + ], "title": "Name" }, "description": { "anyOf": [ { - "type": "string" + "type": "string", + "maxLength": 2000 }, { "type": "null" @@ -38622,32 +39568,43 @@ ], "title": "Description" }, - "kind": { - "type": "string", - "enum": [ - "filter", - "fixed" + "parent": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } ], - "title": "Kind" + "title": "Parent", + "description": "move it inside this collection; null: to the top" }, - "filter": { + "default": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "boolean" }, { "type": "null" } ], - "title": "Filter" - }, - "shared": { - "type": "boolean", - "title": "Shared", - "default": false + "title": "Default", + "description": "true: new assets go here when nobody says where" + } + }, + "additionalProperties": false, + "type": "object", + "title": "CollectionNodeUpdate", + "description": "Send what changes: `parent` null moves it to the top; `default: true` makes it the namespace's default." + }, + "CollectionRecording": { + "properties": { + "id": { + "type": "integer", + "title": "Id" }, - "updated_at": { + "title": { "anyOf": [ { "type": "string" @@ -38656,14 +39613,9 @@ "type": "null" } ], - "title": "Updated At" - }, - "count": { - "type": "integer", - "title": "Count", - "description": "assets in it you can read" + "title": "Title" }, - "created_at": { + "recorded_at": { "anyOf": [ { "type": "string" @@ -38672,36 +39624,49 @@ "type": "null" } ], - "title": "Created At" + "title": "Recorded At" }, - "recordings": { - "items": { - "$ref": "#/components/schemas/CollectionRecording" - }, - "type": "array", - "title": "Recordings", - "description": "the newest 200 you can read" + "duration_ms": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Duration Ms" } }, "additionalProperties": true, "type": "object", "required": [ - "id", - "account", - "name", - "kind", - "count", - "recordings" + "id" ], - "title": "CollectionDetail" + "title": "CollectionRecording" }, - "CollectionMember": { + "CollectionStep": { "properties": { - "account": { + "id": { "type": "integer", - "title": "Account" + "title": "Id" }, - "email": { + "name": { + "type": "string", + "title": "Name" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "id", + "name" + ], + "title": "CollectionStep" + }, + "CollectionUpdate": { + "properties": { + "name": { "anyOf": [ { "type": "string" @@ -38710,9 +39675,9 @@ "type": "null" } ], - "title": "Email" + "title": "Name" }, - "name": { + "description": { "anyOf": [ { "type": "string" @@ -38721,74 +39686,78 @@ "type": "null" } ], - "title": "Name" - }, - "role": { - "type": "string", - "enum": [ - "viewer", - "editor", - "admin" - ], - "title": "Role" + "title": "Description" }, - "by": { + "filter": { "anyOf": [ { - "type": "string" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "title": "By", - "description": "who gave it" + "title": "Filter", + "description": "keys: namespaces, speakers, entities, from, to, q, media, status" }, - "at": { + "recordings": { "anyOf": [ { - "type": "string" + "items": { + "type": "integer" + }, + "type": "array" }, { "type": "null" } ], - "title": "At" + "title": "Recordings" }, - "inherited_from": { + "shared": { "anyOf": [ { - "$ref": "#/components/schemas/CollectionStep" + "type": "boolean" }, { "type": "null" } ], - "description": "given on this collection it's inside (null: on this one)" + "title": "Shared" } }, - "additionalProperties": true, + "additionalProperties": false, "type": "object", - "required": [ - "account", - "role" - ], - "title": "CollectionMember" + "title": "CollectionUpdate" }, - "CollectionMemberSet": { + "Comment": { "properties": { - "email": { + "id": { + "type": "integer", + "title": "Id" + }, + "recording": { + "type": "integer", + "title": "Recording" + }, + "parent": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Email" + "title": "Parent", + "description": "the comment this replies to (the thread's first); null: it starts a thread" }, - "account": { + "text": { + "type": "string", + "title": "Text" + }, + "t0": { "anyOf": [ { "type": "integer" @@ -38797,41 +39766,22 @@ "type": "null" } ], - "title": "Account" + "title": "T0", + "description": "the moment it's about, in ms from the start; null: the whole resource, or a reply" }, - "role": { + "t1": { "anyOf": [ { - "type": "string", - "enum": [ - "viewer", - "editor", - "admin" - ] + "type": "integer" }, { "type": "null" } ], - "title": "Role" - } - }, - "additionalProperties": false, - "type": "object", - "title": "CollectionMemberSet", - "description": "Who (by email, or by account id) and their role on the collection; a null role takes it away." - }, - "CollectionNode": { - "properties": { - "id": { - "type": "integer", - "title": "Id" - }, - "name": { - "type": "string", - "title": "Name" + "title": "T1", + "description": "where that moment ends, in ms" }, - "description": { + "quote": { "anyOf": [ { "type": "string" @@ -38840,59 +39790,62 @@ "type": "null" } ], - "title": "Description" + "title": "Quote", + "description": "the words picked in the text" }, - "parent": { + "resolved": { + "type": "boolean", + "title": "Resolved", + "description": "the thread is resolved (its first comment says so)", + "default": false + }, + "resolved_by": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Parent", - "description": "the collection it's in; null: the top of its namespace" - }, - "depth": { - "type": "integer", - "title": "Depth", - "description": "0 at the top", - "default": 0 - }, - "path": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Path", - "description": "names from the top of the namespace down to it" - }, - "recordings": { - "type": "integer", - "title": "Recordings", - "description": "assets it holds", - "default": 0 + "title": "Resolved By", + "description": "who resolved it: their email" }, - "total": { - "type": "integer", - "title": "Total", - "description": "assets it and the collections inside it hold", - "default": 0 + "resolved_by_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Resolved By Name" }, - "children": { - "type": "integer", - "title": "Children", - "description": "collections directly inside it", - "default": 0 + "resolved_at": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Resolved At" }, - "default": { - "type": "boolean", - "title": "Default", - "description": "new assets go here when nobody says where", - "default": false + "created_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Created By", + "description": "its writer's email" }, - "created_at": { + "created_by_name": { "anyOf": [ { "type": "string" @@ -38901,9 +39854,10 @@ "type": "null" } ], - "title": "Created At" + "title": "Created By Name", + "description": "its writer's name, when they gave one" }, - "created_by": { + "created_at": { "anyOf": [ { "type": "string" @@ -38912,7 +39866,7 @@ "type": "null" } ], - "title": "Created By" + "title": "Created At" }, "updated_at": { "anyOf": [ @@ -38925,148 +39879,293 @@ ], "title": "Updated At" }, - "role": { + "edited_at": { "anyOf": [ { - "type": "string", - "enum": [ - "viewer", - "editor", - "admin" - ] + "type": "string" }, { "type": "null" } ], - "title": "Role", - "description": "your role on it: from your namespace role (an owner is an admin) or one given on it or above it" + "title": "Edited At", + "description": "when its text last changed" }, - "can_change": { + "mine": { "type": "boolean", - "title": "Can Change", - "description": "you may rename, describe, move or delete it, and make collections inside it", - "default": false + "title": "Mine", + "description": "you wrote it: only you can change its text" }, - "can_grant": { + "can_resolve": { "type": "boolean", - "title": "Can Grant", - "description": "you may give people roles on it", - "default": false + "title": "Can Resolve", + "description": "you can resolve or reopen the thread: you started it, or you edit the resource" + }, + "can_delete": { + "type": "boolean", + "title": "Can Delete", + "description": "you wrote it, or you own the resource" } }, "additionalProperties": true, "type": "object", "required": [ "id", - "name" + "recording", + "text", + "mine", + "can_resolve", + "can_delete" ], - "title": "CollectionNode" + "title": "Comment" }, - "CollectionNodeCreate": { + "CommentCreate": { "properties": { - "name": { + "text": { "type": "string", - "maxLength": 120, + "maxLength": 5000, "minLength": 1, - "title": "Name", - "description": "unique among the collections next to it, ignoring case" + "title": "Text" + }, + "parent": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Parent", + "description": "reply on this comment's thread (its moment is the thread's)" }, - "parent": { + "t0": { "anyOf": [ { - "type": "integer" + "type": "integer", + "minimum": 0.0 }, { "type": "null" } ], - "title": "Parent", - "description": "the collection to put it in; null: the top of the namespace" + "title": "T0", + "description": "the moment it's about, in ms from the start; leave out for the whole resource" }, - "description": { + "t1": { + "anyOf": [ + { + "type": "integer", + "minimum": 0.0 + }, + { + "type": "null" + } + ], + "title": "T1", + "description": "where that moment ends, in ms (default: t0)" + }, + "quote": { "anyOf": [ { "type": "string", - "maxLength": 2000 + "maxLength": 1000 }, { "type": "null" } ], - "title": "Description" + "title": "Quote", + "description": "the words picked in the text" } }, "additionalProperties": false, "type": "object", "required": [ - "name" + "text" ], - "title": "CollectionNodeCreate" + "title": "CommentCreate" }, - "CollectionNodeUpdate": { + "CommentUpdate": { "properties": { - "name": { + "text": { "anyOf": [ { "type": "string", - "maxLength": 120, + "maxLength": 5000, "minLength": 1 }, { "type": "null" } ], - "title": "Name" + "title": "Text", + "description": "its writer only" }, - "description": { + "resolved": { "anyOf": [ { - "type": "string", - "maxLength": 2000 + "type": "boolean" }, { "type": "null" } ], - "title": "Description" + "title": "Resolved", + "description": "resolve or reopen the thread: its writer, or an editor of the resource" + } + }, + "additionalProperties": false, + "type": "object", + "title": "CommentUpdate" + }, + "CompletionChoice": { + "properties": { + "index": { + "type": "integer", + "title": "Index", + "default": 0 }, - "parent": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Parent", - "description": "move it inside this collection; null: to the top" + "message": { + "$ref": "#/components/schemas/CompletionMessage" }, - "default": { + "finish_reason": { + "type": "string", + "title": "Finish Reason", + "default": "stop" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "message" + ], + "title": "CompletionChoice" + }, + "CompletionLens": { + "properties": { + "namespace": { + "type": "string", + "title": "Namespace" + }, + "sources": { + "items": { + "$ref": "#/components/schemas/CompletionSource" + }, + "type": "array", + "title": "Sources" + }, + "steps": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array", + "title": "Steps", + "description": "the tools it looked things up with" + }, + "notice": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { "type": "null" } ], - "title": "Default", - "description": "true: new assets go here when nobody says where" + "title": "Notice" } }, - "additionalProperties": false, + "additionalProperties": true, "type": "object", - "title": "CollectionNodeUpdate", - "description": "Send what changes: `parent` null moves it to the top; `default: true` makes it the namespace's default." + "required": [ + "namespace", + "sources" + ], + "title": "CompletionLens" }, - "CollectionRecording": { + "CompletionMessage": { + "properties": { + "role": { + "type": "string", + "title": "Role", + "default": "assistant" + }, + "content": { + "type": "string", + "title": "Content" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "content" + ], + "title": "CompletionMessage" + }, + "CompletionModel": { "properties": { "id": { - "type": "integer", + "type": "string", "title": "Id" }, + "object": { + "type": "string", + "title": "Object", + "default": "model" + }, + "created": { + "type": "integer", + "title": "Created", + "default": 0 + }, + "owned_by": { + "type": "string", + "title": "Owned By", + "default": "lens" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "id" + ], + "title": "CompletionModel" + }, + "CompletionModels": { + "properties": { + "object": { + "type": "string", + "title": "Object", + "default": "list" + }, + "data": { + "items": { + "$ref": "#/components/schemas/CompletionModel" + }, + "type": "array", + "title": "Data" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "data" + ], + "title": "CompletionModels" + }, + "CompletionSource": { + "properties": { + "n": { + "type": "integer", + "title": "N", + "description": "what the answer cites it as: [n]" + }, + "recording_id": { + "type": "integer", + "title": "Recording Id", + "description": "the asset it comes from" + }, "title": { "anyOf": [ { @@ -39078,7 +40177,7 @@ ], "title": "Title" }, - "recorded_at": { + "time": { "anyOf": [ { "type": "string" @@ -39087,60 +40186,94 @@ "type": "null" } ], - "title": "Recorded At" + "title": "Time", + "description": "the moment, as \"12:34\", or a document's page, as \"p. 2\"" }, - "duration_ms": { + "speaker": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Duration Ms" + "title": "Speaker", + "description": "who spoke, in audio or video" + }, + "url": { + "type": "string", + "title": "Url", + "description": "the moment in the web app" + }, + "cited": { + "type": "boolean", + "title": "Cited", + "description": "whether the answer cites it" } }, "additionalProperties": true, "type": "object", "required": [ - "id" + "n", + "recording_id", + "url", + "cited" ], - "title": "CollectionRecording" + "title": "CompletionSource" }, - "CollectionStep": { + "Component": { "properties": { "id": { - "type": "integer", + "type": "string", "title": "Id" }, - "name": { - "type": "string", - "title": "Name" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "id", - "name" - ], - "title": "CollectionStep" - }, - "CollectionUpdate": { - "properties": { - "name": { + "label": { + "type": "string", + "title": "Label" + }, + "purpose": { + "type": "string", + "title": "Purpose" + }, + "kind": { + "type": "string", + "enum": [ + "program", + "package", + "model", + "server-model" + ], + "title": "Kind", + "description": "program: the image provides it (only checked); package and model: fetched into the data folder; server-model: pulled on the Ollama server" + }, + "steps": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Steps", + "description": "the job steps that wait for it" + }, + "size_mb": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Name" + "title": "Size Mb", + "description": "about how much it downloads" }, - "description": { + "optional": { + "type": "boolean", + "title": "Optional", + "description": "fetched only when listed in components.also", + "default": false + }, + "license": { "anyOf": [ { "type": "string" @@ -39149,36 +40282,26 @@ "type": "null" } ], - "title": "Description" + "title": "License" }, - "filter": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Filter", - "description": "keys: namespaces, speakers, entities, from, to, q, media, status" + "needed": { + "type": "boolean", + "title": "Needed", + "description": "this server's settings ask for it" }, - "recordings": { + "hint": { "anyOf": [ { - "items": { - "type": "integer" - }, - "type": "array" + "type": "string" }, { "type": "null" } ], - "title": "Recordings" + "title": "Hint", + "description": "for a program: how to get it" }, - "shared": { + "here": { "anyOf": [ { "type": "boolean" @@ -39187,64 +40310,49 @@ "type": "null" } ], - "title": "Shared" + "title": "Here", + "description": "for a program: whether the API's machine has it" } }, - "additionalProperties": false, + "additionalProperties": true, "type": "object", - "title": "CollectionUpdate" + "required": [ + "id", + "label", + "purpose", + "kind", + "needed" + ], + "title": "Component" }, - "Comment": { + "ComponentState": { "properties": { - "id": { - "type": "integer", - "title": "Id" - }, - "recording": { - "type": "integer", - "title": "Recording" - }, - "parent": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Parent", - "description": "the comment this replies to (the thread's first); null: it starts a thread" - }, - "text": { + "state": { "type": "string", - "title": "Text" - }, - "t0": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } + "enum": [ + "ready", + "waiting", + "fetching", + "later", + "failed", + "missing" ], - "title": "T0", - "description": "the moment it's about, in ms from the start; null: the whole resource, or a reply" + "title": "State", + "description": "waiting/fetching: being fetched, and the steps that need it wait; later: fetched on first use, when a job needs it; missing: needed but fetching is off" }, - "t1": { + "detail": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "T1", - "description": "where that moment ends, in ms" + "title": "Detail", + "description": "what it's doing, e.g. pulling nomic-embed-text: 40%" }, - "quote": { + "error": { "anyOf": [ { "type": "string" @@ -39253,50 +40361,135 @@ "type": "null" } ], - "title": "Quote", - "description": "the words picked in the text" + "title": "Error" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "state" + ], + "title": "ComponentState" + }, + "Components": { + "properties": { + "auto": { + "type": "boolean", + "title": "Auto", + "description": "components.auto: fetch what's needed without asking" }, - "resolved": { + "ahead": { "type": "boolean", - "title": "Resolved", - "description": "the thread is resolved (its first comment says so)", + "title": "Ahead", + "description": "components.ahead: fetch it all now, not on first use", "default": false }, - "resolved_by": { + "machine": { + "$ref": "#/components/schemas/Machine", + "description": "the API's machine" + }, + "recommended": { + "additionalProperties": true, + "type": "object", + "title": "Recommended", + "description": "the transcription settings that suit the API's machine" + }, + "components": { + "items": { + "$ref": "#/components/schemas/Component" + }, + "type": "array", + "title": "Components" + }, + "workers": { + "items": { + "$ref": "#/components/schemas/WorkerComponents" + }, + "type": "array", + "title": "Workers" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "auto", + "machine", + "recommended", + "components", + "workers" + ], + "title": "Components" + }, + "Consent": { + "properties": { + "client": { + "$ref": "#/components/schemas/ConsentClient" + }, + "redirect_uri": { + "type": "string", + "title": "Redirect Uri" + }, + "scope": { + "type": "string", + "enum": [ + "read", + "read write" + ], + "title": "Scope", + "description": "what the app asks for: read, or read and write" + }, + "granted": { "anyOf": [ { - "type": "string" + "type": "string", + "enum": [ + "read", + "read write" + ] }, { "type": "null" } ], - "title": "Resolved By", - "description": "who resolved it: their email" + "title": "Granted", + "description": "what you gave this app before, if anything" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "client", + "redirect_uri", + "scope" + ], + "title": "Consent", + "description": "What the consent page shows." + }, + "ConsentAnswer": { + "properties": { + "client_id": { + "type": "string", + "title": "Client Id" + }, + "redirect_uri": { + "type": "string", + "title": "Redirect Uri" + }, + "response_type": { + "type": "string", + "title": "Response Type", + "default": "code" }, - "resolved_by_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Resolved By Name" + "code_challenge": { + "type": "string", + "title": "Code Challenge" }, - "resolved_at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Resolved At" + "code_challenge_method": { + "type": "string", + "title": "Code Challenge Method", + "default": "S256" }, - "created_by": { + "scope": { "anyOf": [ { "type": "string" @@ -39305,44 +40498,74 @@ "type": "null" } ], - "title": "Created By", - "description": "its writer's email" + "title": "Scope" }, - "created_by_name": { + "state": { "anyOf": [ { - "type": "string" + "type": "string", + "maxLength": 2000 }, { "type": "null" } ], - "title": "Created By Name", - "description": "its writer's name, when they gave one" + "title": "State" }, - "created_at": { + "resource": { "anyOf": [ { - "type": "string" + "type": "string", + "maxLength": 500 }, { "type": "null" } ], - "title": "Created At" + "title": "Resource" }, - "updated_at": { + "approve": { + "type": "boolean", + "title": "Approve" + }, + "grant": { "anyOf": [ { - "type": "string" + "type": "string", + "enum": [ + "read", + "read write" + ] }, { "type": "null" } ], - "title": "Updated At" + "title": "Grant", + "description": "give less than was asked for (read); default: what was asked for" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "client_id", + "redirect_uri", + "code_challenge", + "approve" + ], + "title": "ConsentAnswer" + }, + "ConsentClient": { + "properties": { + "id": { + "type": "string", + "title": "Id" }, - "edited_at": { + "name": { + "type": "string", + "title": "Name" + }, + "uri": { "anyOf": [ { "type": "string" @@ -39351,285 +40574,260 @@ "type": "null" } ], - "title": "Edited At", - "description": "when its text last changed" - }, - "mine": { - "type": "boolean", - "title": "Mine", - "description": "you wrote it: only you can change its text" - }, - "can_resolve": { - "type": "boolean", - "title": "Can Resolve", - "description": "you can resolve or reopen the thread: you started it, or you edit the resource" - }, - "can_delete": { - "type": "boolean", - "title": "Can Delete", - "description": "you wrote it, or you own the resource" + "title": "Uri" } }, "additionalProperties": true, "type": "object", "required": [ "id", - "recording", - "text", - "mine", - "can_resolve", - "can_delete" + "name" ], - "title": "Comment" + "title": "ConsentClient" }, - "CommentCreate": { + "ConsentResult": { "properties": { - "text": { + "redirect_to": { "type": "string", - "maxLength": 5000, - "minLength": 1, - "title": "Text" - }, - "parent": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Parent", - "description": "reply on this comment's thread (its moment is the thread's)" - }, - "t0": { + "title": "Redirect To", + "description": "send the browser here: the app's address with its code, or with error=access_denied" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "redirect_to" + ], + "title": "ConsentResult" + }, + "ContentRules": { + "properties": { + "extensions": { "anyOf": [ { - "type": "integer", - "minimum": 0.0 + "items": { + "type": "string" + }, + "type": "array" }, { "type": "null" } ], - "title": "T0", - "description": "the moment it's about, in ms from the start; leave out for the whole resource" + "title": "Extensions", + "description": "e.g. [.srt, .vtt]" }, - "t1": { + "pattern": { "anyOf": [ { - "type": "integer", - "minimum": 0.0 + "type": "string" }, { "type": "null" } ], - "title": "T1", - "description": "where that moment ends, in ms (default: t0)" + "title": "Pattern", + "description": "a regular expression found in the file name or title" }, - "quote": { - "anyOf": [ - { - "type": "string", - "maxLength": 1000 - }, - { - "type": "null" - } - ], - "title": "Quote", - "description": "the words picked in the text" - } - }, - "additionalProperties": false, - "type": "object", - "required": [ - "text" - ], - "title": "CommentCreate" - }, - "CommentUpdate": { - "properties": { - "text": { + "min_minutes": { "anyOf": [ { - "type": "string", - "maxLength": 5000, - "minLength": 1 + "type": "number" }, { "type": "null" } ], - "title": "Text", - "description": "its writer only" + "title": "Min Minutes" }, - "resolved": { + "max_minutes": { "anyOf": [ { - "type": "boolean" + "type": "number" }, { "type": "null" } ], - "title": "Resolved", - "description": "resolve or reopen the thread: its writer, or an editor of the resource" - } - }, - "additionalProperties": false, - "type": "object", - "title": "CommentUpdate" - }, - "CompletionChoice": { - "properties": { - "index": { - "type": "integer", - "title": "Index", - "default": 0 - }, - "message": { - "$ref": "#/components/schemas/CompletionMessage" - }, - "finish_reason": { - "type": "string", - "title": "Finish Reason", - "default": "stop" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "message" - ], - "title": "CompletionChoice" - }, - "CompletionLens": { - "properties": { - "namespace": { - "type": "string", - "title": "Namespace" - }, - "sources": { - "items": { - "$ref": "#/components/schemas/CompletionSource" - }, - "type": "array", - "title": "Sources" - }, - "steps": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Steps", - "description": "the tools it looked things up with" + "title": "Max Minutes" }, - "notice": { + "forms": { "anyOf": [ { - "type": "string" + "items": { + "type": "string", + "enum": [ + "chat", + "records" + ] + }, + "type": "array" }, { "type": "null" } ], - "title": "Notice" + "title": "Forms", + "description": "what the file was found to hold, e.g. [chat]" } }, - "additionalProperties": true, + "additionalProperties": false, "type": "object", - "required": [ - "namespace", - "sources" - ], - "title": "CompletionLens" + "title": "ContentRules", + "description": "How a subtype is recognised when nobody chose it: every rule given has to hold." }, - "CompletionMessage": { + "ContentState": { "properties": { - "role": { + "content_state": { + "additionalProperties": true, + "type": "object", + "title": "Content State" + }, + "encoded": { "type": "string", - "title": "Role", - "default": "assistant" + "title": "Encoded" }, - "content": { + "link": { "type": "string", - "title": "Content" + "title": "Link" + }, + "viewers": { + "items": { + "$ref": "#/components/schemas/ViewerLink" + }, + "type": "array", + "title": "Viewers" } }, "additionalProperties": true, "type": "object", "required": [ - "content" + "content_state", + "encoded", + "link", + "viewers" ], - "title": "CompletionMessage" + "title": "ContentState" }, - "CompletionModel": { + "ContentType": { "properties": { - "id": { + "key": { "type": "string", - "title": "Id" + "title": "Key" }, - "object": { + "base": { "type": "string", - "title": "Object", - "default": "model" - }, - "created": { - "type": "integer", - "title": "Created", - "default": 0 + "enum": [ + "video", + "audio", + "image", + "text" + ], + "title": "Base" }, - "owned_by": { + "label": { "type": "string", - "title": "Owned By", - "default": "lens" + "title": "Label" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "pipeline": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Pipeline", + "description": "its pipeline; none: the namespace default runs" + }, + "rules": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Rules" + }, + "general": { + "type": "boolean", + "title": "General", + "description": "the base type's catch-all: can be renamed, not removed" + }, + "builtin": { + "type": "boolean", + "title": "Builtin", + "description": "one Lens started with" } }, "additionalProperties": true, "type": "object", "required": [ - "id" + "key", + "base", + "label", + "general", + "builtin" ], - "title": "CompletionModel" + "title": "ContentType" }, - "CompletionModels": { + "ContentTypeCatalog": { "properties": { - "object": { - "type": "string", - "title": "Object", - "default": "list" + "bases": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Bases" }, - "data": { + "types": { "items": { - "$ref": "#/components/schemas/CompletionModel" + "$ref": "#/components/schemas/ContentType" }, "type": "array", - "title": "Data" + "title": "Types" } }, "additionalProperties": true, "type": "object", "required": [ - "data" + "bases", + "types" ], - "title": "CompletionModels" + "title": "ContentTypeCatalog" }, - "CompletionSource": { + "ContentTypeCreate": { "properties": { - "n": { - "type": "integer", - "title": "N", - "description": "what the answer cites it as: [n]" + "base": { + "type": "string", + "enum": [ + "video", + "audio", + "image", + "text" + ], + "title": "Base" }, - "recording_id": { - "type": "integer", - "title": "Recording Id", - "description": "the asset it comes from" + "label": { + "type": "string", + "title": "Label" }, - "title": { + "key": { "anyOf": [ { "type": "string" @@ -39638,9 +40836,10 @@ "type": "null" } ], - "title": "Title" + "title": "Key", + "description": "lowercase letters, digits and _; made from the label if left out" }, - "time": { + "description": { "anyOf": [ { "type": "string" @@ -39649,94 +40848,52 @@ "type": "null" } ], - "title": "Time", - "description": "the moment, as \"12:34\", or a document's page, as \"p. 2\"" + "title": "Description" }, - "speaker": { + "pipeline": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Speaker", - "description": "who spoke, in audio or video" - }, - "url": { - "type": "string", - "title": "Url", - "description": "the moment in the web app" + "title": "Pipeline" }, - "cited": { - "type": "boolean", - "title": "Cited", - "description": "whether the answer cites it" + "rules": { + "anyOf": [ + { + "$ref": "#/components/schemas/ContentRules" + }, + { + "type": "null" + } + ] } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "n", - "recording_id", - "url", - "cited" - ], - "title": "CompletionSource" - }, - "Component": { - "properties": { - "id": { - "type": "string", - "title": "Id" - }, - "label": { - "type": "string", - "title": "Label" - }, - "purpose": { - "type": "string", - "title": "Purpose" - }, - "kind": { - "type": "string", - "enum": [ - "program", - "package", - "model", - "server-model" - ], - "title": "Kind", - "description": "program: the image provides it (only checked); package and model: fetched into the data folder; server-model: pulled on the Ollama server" - }, - "steps": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Steps", - "description": "the job steps that wait for it" - }, - "size_mb": { + }, + "additionalProperties": false, + "type": "object", + "required": [ + "base", + "label" + ], + "title": "ContentTypeCreate" + }, + "ContentTypeUpdate": { + "properties": { + "label": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Size Mb", - "description": "about how much it downloads" - }, - "optional": { - "type": "boolean", - "title": "Optional", - "description": "fetched only when listed in components.also", - "default": false + "title": "Label" }, - "license": { + "description": { "anyOf": [ { "type": "string" @@ -39745,65 +40902,61 @@ "type": "null" } ], - "title": "License" - }, - "needed": { - "type": "boolean", - "title": "Needed", - "description": "this server's settings ask for it" + "title": "Description" }, - "hint": { + "pipeline": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Hint", - "description": "for a program: how to get it" + "title": "Pipeline" }, - "here": { + "rules": { "anyOf": [ { - "type": "boolean" + "$ref": "#/components/schemas/ContentRules" }, { "type": "null" } - ], - "title": "Here", - "description": "for a program: whether the API's machine has it" + ] + } + }, + "additionalProperties": false, + "type": "object", + "title": "ContentTypeUpdate", + "description": "Only what you send changes; its key and base type stay." + }, + "ContentTypeUse": { + "properties": { + "namespace": { + "type": "string", + "title": "Namespace" + }, + "content_type": { + "type": "string", + "title": "Content Type" } }, "additionalProperties": true, "type": "object", "required": [ - "id", - "label", - "purpose", - "kind", - "needed" + "namespace", + "content_type" ], - "title": "Component" + "title": "ContentTypeUse" }, - "ComponentState": { + "ConversionNodeTestResult": { "properties": { - "state": { - "type": "string", - "enum": [ - "ready", - "waiting", - "fetching", - "later", - "failed", - "missing" - ], - "title": "State", - "description": "waiting/fetching: being fetched, and the steps that need it wait; later: fetched on first use, when a job needs it; missing: needed but fetching is off" + "ok": { + "type": "boolean", + "title": "Ok" }, - "detail": { + "error": { "anyOf": [ { "type": "string" @@ -39812,147 +40965,86 @@ "type": "null" } ], - "title": "Detail", - "description": "what it's doing, e.g. pulling nomic-embed-text: 40%" + "title": "Error" }, - "error": { + "ms": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Error" + "title": "Ms" } }, "additionalProperties": true, "type": "object", "required": [ - "state" + "ok" ], - "title": "ComponentState" + "title": "ConversionNodeTestResult" }, - "Components": { + "Converters": { "properties": { - "auto": { + "office": { "type": "boolean", - "title": "Auto", - "description": "components.auto: fetch what's needed without asking" + "title": "Office", + "description": "Word, PowerPoint and spreadsheet files, OpenDocument and RTF (LibreOffice)" }, - "ahead": { + "pages": { "type": "boolean", - "title": "Ahead", - "description": "components.ahead: fetch it all now, not on first use", - "default": false - }, - "machine": { - "$ref": "#/components/schemas/Machine", - "description": "the API's machine" + "title": "Pages", + "description": "text, Markdown, saved web pages and .eml emails (Chromium or LibreOffice)" }, - "recommended": { - "additionalProperties": true, - "type": "object", - "title": "Recommended", - "description": "the transcription settings that suit the API's machine" + "msg": { + "type": "boolean", + "title": "Msg", + "description": "Outlook .msg emails (those, and the extract-msg package)" }, - "components": { - "items": { - "$ref": "#/components/schemas/Component" - }, - "type": "array", - "title": "Components" + "web": { + "type": "boolean", + "title": "Web", + "description": "web pages captured from their address (Chromium; POST /import/web)", + "default": false }, - "workers": { - "items": { - "$ref": "#/components/schemas/WorkerComponents" - }, - "type": "array", - "title": "Workers" + "tika": { + "type": "boolean", + "title": "Tika", + "description": "a Tika server reads, as text, the documents nothing else here can (documents.tika_url)", + "default": false } }, "additionalProperties": true, "type": "object", "required": [ - "auto", - "machine", - "recommended", - "components", - "workers" + "office", + "pages", + "msg" ], - "title": "Components" + "title": "Converters", + "description": "What this server can make into PDFs to read as documents (docs/api.md#documents-and-images)." }, - "Consent": { + "CopyWork": { "properties": { - "client": { - "$ref": "#/components/schemas/ConsentClient" - }, - "redirect_uri": { - "type": "string", - "title": "Redirect Uri" - }, - "scope": { - "type": "string", - "enum": [ - "read", - "read write" - ], - "title": "Scope", - "description": "what the app asks for: read, or read and write" - }, - "granted": { + "running": { "anyOf": [ { "type": "string", "enum": [ - "read", - "read write" + "send", + "fetch" ] }, { "type": "null" } ], - "title": "Granted", - "description": "what you gave this app before, if anything" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "client", - "redirect_uri", - "scope" - ], - "title": "Consent", - "description": "What the consent page shows." - }, - "ConsentAnswer": { - "properties": { - "client_id": { - "type": "string", - "title": "Client Id" - }, - "redirect_uri": { - "type": "string", - "title": "Redirect Uri" - }, - "response_type": { - "type": "string", - "title": "Response Type", - "default": "code" - }, - "code_challenge": { - "type": "string", - "title": "Code Challenge" - }, - "code_challenge_method": { - "type": "string", - "title": "Code Challenge Method", - "default": "S256" + "title": "Running", + "description": "copying a backup to (send) or from (fetch) the connection" }, - "scope": { + "name": { "anyOf": [ { "type": "string" @@ -39961,74 +41053,65 @@ "type": "null" } ], - "title": "Scope" - }, - "state": { - "anyOf": [ - { - "type": "string", - "maxLength": 2000 - }, - { - "type": "null" - } - ], - "title": "State" + "title": "Name" }, - "resource": { + "error": { "anyOf": [ { - "type": "string", - "maxLength": 500 + "type": "string" }, { "type": "null" - } - ], - "title": "Resource" - }, - "approve": { - "type": "boolean", - "title": "Approve" + } + ], + "title": "Error" }, - "grant": { + "finished_at": { "anyOf": [ { - "type": "string", - "enum": [ - "read", - "read write" - ] + "type": "string" }, { "type": "null" } ], - "title": "Grant", - "description": "give less than was asked for (read); default: what was asked for" + "title": "Finished At" } }, - "additionalProperties": false, + "additionalProperties": true, + "type": "object", + "title": "CopyWork" + }, + "Created": { + "properties": { + "ok": { + "type": "boolean", + "title": "Ok", + "default": true + }, + "id": { + "type": "integer", + "title": "Id" + } + }, + "additionalProperties": true, "type": "object", "required": [ - "client_id", - "redirect_uri", - "code_challenge", - "approve" + "id" ], - "title": "ConsentAnswer" + "title": "Created" }, - "ConsentClient": { + "CustomNode": { "properties": { "id": { - "type": "string", + "type": "integer", "title": "Id" }, "name": { "type": "string", "title": "Name" }, - "uri": { + "description": { "anyOf": [ { "type": "string" @@ -40037,50 +41120,21 @@ "type": "null" } ], - "title": "Uri" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "id", - "name" - ], - "title": "ConsentClient" - }, - "ConsentResult": { - "properties": { - "redirect_to": { - "type": "string", - "title": "Redirect To", - "description": "send the browser here: the app's address with its code, or with error=access_denied" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "redirect_to" - ], - "title": "ConsentResult" - }, - "ContentRules": { - "properties": { - "extensions": { + "title": "Description" + }, + "icon": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array" + "type": "string" }, { "type": "null" } ], - "title": "Extensions", - "description": "e.g. [.srt, .vtt]" + "title": "Icon", + "description": "a lucide icon name, e.g. sparkles" }, - "pattern": { + "color": { "anyOf": [ { "type": "string" @@ -40089,108 +41143,154 @@ "type": "null" } ], - "title": "Pattern", - "description": "a regular expression found in the file name or title" + "title": "Color", + "description": "blue, green, gold, red, purple or neutral" }, - "min_minutes": { + "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" + }, + "owner_email": { "anyOf": [ { - "type": "number" + "type": "string" }, { "type": "null" } ], - "title": "Min Minutes" + "title": "Owner Email" }, - "max_minutes": { + "editable": { + "type": "boolean", + "title": "Editable", + "default": false + }, + "current": { + "type": "integer", + "title": "Current" + }, + "version": { + "type": "integer", + "title": "Version" + }, + "graph": { + "$ref": "#/components/schemas/WorkflowGraph" + }, + "params": { + "items": { + "$ref": "#/components/schemas/NodeParam" + }, + "type": "array", + "title": "Params", + "default": [] + }, + "inputs": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Inputs", + "description": "its input ports: the names of the arg nodes in its body" + }, + "outputs": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Outputs", + "description": "its output ports: the names of the return nodes in its body" + }, + "scopes": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Scopes", + "description": "the workflows it can be used in: recording, graph or both" + }, + "keeps": { + "type": "boolean", + "title": "Keeps", + "description": "whether it saves something itself", + "default": false + }, + "deleted_at": { "anyOf": [ { - "type": "number" + "type": "string" }, { "type": "null" } ], - "title": "Max Minutes" + "title": "Deleted At" }, - "forms": { + "updated_at": { "anyOf": [ { - "items": { - "type": "string", - "enum": [ - "chat", - "records" - ] - }, - "type": "array" + "type": "string" }, { "type": "null" } ], - "title": "Forms", - "description": "what the file was found to hold, e.g. [chat]" - } - }, - "additionalProperties": false, - "type": "object", - "title": "ContentRules", - "description": "How a subtype is recognised when nobody chose it: every rule given has to hold." - }, - "ContentState": { - "properties": { - "content_state": { - "additionalProperties": true, - "type": "object", - "title": "Content State" - }, - "encoded": { - "type": "string", - "title": "Encoded" - }, - "link": { - "type": "string", - "title": "Link" + "title": "Updated At" }, - "viewers": { + "history": { "items": { - "$ref": "#/components/schemas/ViewerLink" + "$ref": "#/components/schemas/WorkflowVersionInfo" }, "type": "array", - "title": "Viewers" + "title": "History", + "default": [] } }, "additionalProperties": true, "type": "object", "required": [ - "content_state", - "encoded", - "link", - "viewers" + "id", + "name", + "current", + "version", + "graph", + "inputs", + "outputs", + "scopes" ], - "title": "ContentState" + "title": "CustomNode" }, - "ContentType": { + "CustomNodeCreate": { "properties": { - "key": { + "name": { "type": "string", - "title": "Key" + "title": "Name" }, - "base": { - "type": "string", - "enum": [ - "video", - "audio", - "image", - "text" - ], - "title": "Base" + "graph": { + "$ref": "#/components/schemas/WorkflowGraph" }, - "label": { - "type": "string", - "title": "Label" + "params": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array", + "title": "Params", + "default": [] }, "description": { "anyOf": [ @@ -40203,94 +41303,58 @@ ], "title": "Description" }, - "pipeline": { + "icon": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Pipeline", - "description": "its pipeline; none: the namespace default runs" + "title": "Icon" }, - "rules": { + "color": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "string" }, { "type": "null" } ], - "title": "Rules" + "title": "Color" }, - "general": { - "type": "boolean", - "title": "General", - "description": "the base type's catch-all: can be renamed, not removed" + "visibility": { + "type": "string", + "enum": [ + "private", + "namespace", + "everyone" + ], + "title": "Visibility", + "default": "private" }, - "builtin": { - "type": "boolean", - "title": "Builtin", - "description": "one Lens started with" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "key", - "base", - "label", - "general", - "builtin" - ], - "title": "ContentType" - }, - "ContentTypeCatalog": { - "properties": { - "bases": { + "namespaces": { "items": { "type": "string" }, "type": "array", - "title": "Bases" - }, - "types": { - "items": { - "$ref": "#/components/schemas/ContentType" - }, - "type": "array", - "title": "Types" + "title": "Namespaces", + "default": [] } }, - "additionalProperties": true, + "additionalProperties": false, "type": "object", "required": [ - "bases", - "types" + "name", + "graph" ], - "title": "ContentTypeCatalog" + "title": "CustomNodeCreate" }, - "ContentTypeCreate": { + "CustomNodeUpdate": { "properties": { - "base": { - "type": "string", - "enum": [ - "video", - "audio", - "image", - "text" - ], - "title": "Base" - }, - "label": { - "type": "string", - "title": "Label" - }, - "key": { + "name": { "anyOf": [ { "type": "string" @@ -40299,8 +41363,7 @@ "type": "null" } ], - "title": "Key", - "description": "lowercase letters, digits and _; made from the label if left out" + "title": "Name" }, "description": { "anyOf": [ @@ -40313,39 +41376,7 @@ ], "title": "Description" }, - "pipeline": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Pipeline" - }, - "rules": { - "anyOf": [ - { - "$ref": "#/components/schemas/ContentRules" - }, - { - "type": "null" - } - ] - } - }, - "additionalProperties": false, - "type": "object", - "required": [ - "base", - "label" - ], - "title": "ContentTypeCreate" - }, - "ContentTypeUpdate": { - "properties": { - "label": { + "icon": { "anyOf": [ { "type": "string" @@ -40354,9 +41385,9 @@ "type": "null" } ], - "title": "Label" + "title": "Icon" }, - "description": { + "color": { "anyOf": [ { "type": "string" @@ -40365,61 +41396,58 @@ "type": "null" } ], - "title": "Description" + "title": "Color" }, - "pipeline": { + "visibility": { "anyOf": [ { - "type": "integer" + "type": "string", + "enum": [ + "private", + "namespace", + "everyone" + ] }, { "type": "null" } ], - "title": "Pipeline" + "title": "Visibility" }, - "rules": { + "namespaces": { "anyOf": [ { - "$ref": "#/components/schemas/ContentRules" + "items": { + "type": "string" + }, + "type": "array" }, { "type": "null" } - ] + ], + "title": "Namespaces" } }, "additionalProperties": false, "type": "object", - "title": "ContentTypeUpdate", - "description": "Only what you send changes; its key and base type stay." + "title": "CustomNodeUpdate" }, - "ContentTypeUse": { + "CustomNodeVersionCreate": { "properties": { - "namespace": { - "type": "string", - "title": "Namespace" + "graph": { + "$ref": "#/components/schemas/WorkflowGraph" }, - "content_type": { - "type": "string", - "title": "Content Type" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "namespace", - "content_type" - ], - "title": "ContentTypeUse" - }, - "ConversionNodeTestResult": { - "properties": { - "ok": { - "type": "boolean", - "title": "Ok" + "params": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array", + "title": "Params", + "default": [] }, - "error": { + "notes": { "anyOf": [ { "type": "string" @@ -40428,86 +41456,87 @@ "type": "null" } ], - "title": "Error" + "title": "Notes" + } + }, + "additionalProperties": false, + "type": "object", + "required": [ + "graph" + ], + "title": "CustomNodeVersionCreate" + }, + "DateList": { + "properties": { + "total": { + "type": "integer", + "title": "Total" }, - "ms": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Ms" + "items": { + "items": { + "$ref": "#/components/schemas/DateSaid" + }, + "type": "array", + "title": "Items" + }, + "reading": { + "type": "boolean", + "title": "Reading", + "description": "whether analysis reads dates (Settings \u2192 Analysis \u2192 Read dates); off, nothing new is read" } }, "additionalProperties": true, "type": "object", "required": [ - "ok" + "total", + "items", + "reading" ], - "title": "ConversionNodeTestResult" + "title": "DateList" }, - "Converters": { + "DateSaid": { "properties": { - "office": { - "type": "boolean", - "title": "Office", - "description": "Word, PowerPoint and spreadsheet files, OpenDocument and RTF (LibreOffice)" + "day": { + "type": "string", + "title": "Day", + "description": "the first day it means, YYYY-MM-DD" }, - "pages": { - "type": "boolean", - "title": "Pages", - "description": "text, Markdown, saved web pages and .eml emails (Chromium or LibreOffice)" + "until": { + "type": "string", + "title": "Until", + "description": "the last day it means: the same day for a day, the Sunday for a week, the 31st for a month" + }, + "period": { + "type": "string", + "title": "Period", + "description": "day, weekend, week, month or year" }, - "msg": { - "type": "boolean", - "title": "Msg", - "description": "Outlook .msg emails (those, and the extract-msg package)" + "said": { + "type": "string", + "title": "Said", + "description": "the words that give it, like \"next Tuesday\" or \"3 March 2024\"" }, - "web": { + "relative": { "type": "boolean", - "title": "Web", - "description": "web pages captured from their address (Chromium; POST /import/web)", - "default": false + "title": "Relative", + "description": "worked out from the asset's own date (recorded_at): a day said relative to it, or without its year" }, - "tika": { - "type": "boolean", - "title": "Tika", - "description": "a Tika server reads, as text, the documents nothing else here can (documents.tika_url)", - "default": false - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "office", - "pages", - "msg" - ], - "title": "Converters", - "description": "What this server can make into PDFs to read as documents (docs/api.md#documents-and-images)." - }, - "CopyWork": { - "properties": { - "running": { + "recording_id": { + "type": "integer", + "title": "Recording Id" + }, + "title": { "anyOf": [ { - "type": "string", - "enum": [ - "send", - "fetch" - ] + "type": "string" }, { "type": "null" } ], - "title": "Running", - "description": "copying a backup to (send) or from (fetch) the connection" + "title": "Title" }, - "name": { + "namespace": { "anyOf": [ { "type": "string" @@ -40516,9 +41545,9 @@ "type": "null" } ], - "title": "Name" + "title": "Namespace" }, - "error": { + "recorded_at": { "anyOf": [ { "type": "string" @@ -40527,54 +41556,31 @@ "type": "null" } ], - "title": "Error" + "title": "Recorded At" }, - "finished_at": { + "segment": { + "type": "integer", + "title": "Segment", + "description": "the line's id" + }, + "idx": { + "type": "integer", + "title": "Idx", + "description": "the line's place in the asset's text" + }, + "t0": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Finished At" - } - }, - "additionalProperties": true, - "type": "object", - "title": "CopyWork" - }, - "Created": { - "properties": { - "ok": { - "type": "boolean", - "title": "Ok", - "default": true - }, - "id": { - "type": "integer", - "title": "Id" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "id" - ], - "title": "Created" - }, - "CustomNode": { - "properties": { - "id": { - "type": "integer", - "title": "Id" - }, - "name": { - "type": "string", - "title": "Name" + "title": "T0", + "description": "ms" }, - "description": { + "time": { "anyOf": [ { "type": "string" @@ -40583,9 +41589,9 @@ "type": "null" } ], - "title": "Description" + "title": "Time" }, - "icon": { + "speaker": { "anyOf": [ { "type": "string" @@ -40594,10 +41600,9 @@ "type": "null" } ], - "title": "Icon", - "description": "a lucide icon name, e.g. sparkles" + "title": "Speaker" }, - "color": { + "text": { "anyOf": [ { "type": "string" @@ -40606,28 +41611,63 @@ "type": "null" } ], - "title": "Color", - "description": "blue, green, gold, red, purple or neutral" - }, - "visibility": { + "title": "Text", + "description": "the line" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "day", + "until", + "period", + "said", + "relative", + "recording_id", + "segment", + "idx" + ], + "title": "DateSaid", + "description": "A date an asset's line gives, as days on the calendar." + }, + "DaySpend": { + "properties": { + "day": { "type": "string", - "enum": [ - "private", - "namespace", - "everyone" - ], - "title": "Visibility", - "default": "private" + "title": "Day", + "description": "YYYY-MM-DD (UTC)" }, - "namespaces": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Namespaces", - "description": "who sees it, when shared with namespaces" + "cost_usd": { + "type": "number", + "title": "Cost Usd" }, - "owner_email": { + "tokens": { + "type": "integer", + "title": "Tokens" + }, + "calls": { + "type": "integer", + "title": "Calls" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "day", + "cost_usd", + "tokens", + "calls" + ], + "title": "DaySpend" + }, + "DecisionStatus": { + "properties": { + "engine": { + "type": "string", + "title": "Engine", + "description": "the setting: auto, jev, laya, llm or off" + }, + "by": { "anyOf": [ { "type": "string" @@ -40636,63 +41676,43 @@ "type": "null" } ], - "title": "Owner Email" + "title": "By", + "description": "who answers now: jev, laya, llm, or none" }, - "editable": { + "apple_silicon": { "type": "boolean", - "title": "Editable", - "default": false - }, - "current": { - "type": "integer", - "title": "Current" - }, - "version": { - "type": "integer", - "title": "Version" - }, - "graph": { - "$ref": "#/components/schemas/WorkflowGraph" - }, - "params": { - "items": { - "$ref": "#/components/schemas/NodeParam" - }, - "type": "array", - "title": "Params", - "default": [] - }, - "inputs": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Inputs", - "description": "its input ports: the names of the arg nodes in its body" + "title": "Apple Silicon", + "description": "this machine can run MLX models" }, - "outputs": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Outputs", - "description": "its output ports: the names of the return nodes in its body" + "laya": { + "$ref": "#/components/schemas/LayaStatus" }, - "scopes": { + "laya_models": { "items": { - "type": "string" + "$ref": "#/components/schemas/LayaModel" }, "type": "array", - "title": "Scopes", - "description": "the workflows it can be used in: recording, graph or both" - }, - "keeps": { + "title": "Laya Models" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "engine", + "apple_silicon", + "laya", + "laya_models" + ], + "title": "DecisionStatus", + "description": "Who takes routine decisions now, and whether a local Laya model could." + }, + "DecisionTestResult": { + "properties": { + "ok": { "type": "boolean", - "title": "Keeps", - "description": "whether it saves something itself", - "default": false + "title": "Ok" }, - "deleted_at": { + "error": { "anyOf": [ { "type": "string" @@ -40701,9 +41721,9 @@ "type": "null" } ], - "title": "Deleted At" + "title": "Error" }, - "updated_at": { + "by": { "anyOf": [ { "type": "string" @@ -40712,50 +41732,73 @@ "type": "null" } ], - "title": "Updated At" + "title": "By", + "description": "who answered: jev, laya or llm (the language model when the decision model failed)" }, - "history": { - "items": { - "$ref": "#/components/schemas/WorkflowVersionInfo" - }, - "type": "array", - "title": "History", - "default": [] + "choice": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Choice" + }, + "confidence": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Confidence" + }, + "ms": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Ms" } }, "additionalProperties": true, "type": "object", "required": [ - "id", - "name", - "current", - "version", - "graph", - "inputs", - "outputs", - "scopes" + "ok" ], - "title": "CustomNode" + "title": "DecisionTestResult" }, - "CustomNodeCreate": { + "Described": { "properties": { - "name": { - "type": "string", - "title": "Name" - }, - "graph": { - "$ref": "#/components/schemas/WorkflowGraph" + "title": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Title", + "description": "dc:title" }, - "params": { + "creators": { "items": { - "additionalProperties": true, - "type": "object" + "type": "string" }, "type": "array", - "title": "Params", - "default": [] + "title": "Creators", + "description": "dc:creator: its authors" }, - "description": { + "subject": { "anyOf": [ { "type": "string" @@ -40764,9 +41807,10 @@ "type": "null" } ], - "title": "Description" + "title": "Subject", + "description": "dc:subject" }, - "icon": { + "description": { "anyOf": [ { "type": "string" @@ -40775,9 +41819,10 @@ "type": "null" } ], - "title": "Icon" + "title": "Description", + "description": "dc:description" }, - "color": { + "publisher": { "anyOf": [ { "type": "string" @@ -40786,38 +41831,10 @@ "type": "null" } ], - "title": "Color" - }, - "visibility": { - "type": "string", - "enum": [ - "private", - "namespace", - "everyone" - ], - "title": "Visibility", - "default": "private" + "title": "Publisher", + "description": "dc:publisher" }, - "namespaces": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Namespaces", - "default": [] - } - }, - "additionalProperties": false, - "type": "object", - "required": [ - "name", - "graph" - ], - "title": "CustomNodeCreate" - }, - "CustomNodeUpdate": { - "properties": { - "name": { + "language": { "anyOf": [ { "type": "string" @@ -40826,9 +41843,10 @@ "type": "null" } ], - "title": "Name" + "title": "Language", + "description": "dc:language, a code such as en" }, - "description": { + "created": { "anyOf": [ { "type": "string" @@ -40837,9 +41855,10 @@ "type": "null" } ], - "title": "Description" + "title": "Created", + "description": "dcterms:created (ISO 8601)" }, - "icon": { + "modified": { "anyOf": [ { "type": "string" @@ -40848,69 +41867,79 @@ "type": "null" } ], - "title": "Icon" + "title": "Modified", + "description": "dcterms:modified (ISO 8601)" }, - "color": { + "pages": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Color" + "title": "Pages", + "description": "how many pages it says it has" }, - "visibility": { + "words": { "anyOf": [ { - "type": "string", - "enum": [ - "private", - "namespace", - "everyone" - ] + "type": "integer" }, { "type": "null" } ], - "title": "Visibility" + "title": "Words", + "description": "how many words it says it has" }, - "namespaces": { + "format": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array" + "type": "string" }, { "type": "null" } ], - "title": "Namespaces" + "title": "Format", + "description": "dc:format: its media type, as Tika found it" } }, - "additionalProperties": false, + "additionalProperties": true, "type": "object", - "title": "CustomNodeUpdate" + "title": "Described", + "description": "What a document says about itself, read by a Tika server (documents.tika_metadata), as Dublin Core terms." }, - "CustomNodeVersionCreate": { + "Description": { "properties": { - "graph": { - "$ref": "#/components/schemas/WorkflowGraph" + "idx": { + "type": "integer", + "title": "Idx", + "description": "the page (from 0) or the shot it describes" }, - "params": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Params", - "default": [] + "t0": { + "type": "integer", + "title": "T0", + "description": "where it starts: ms, or the page (from 0) when `paged`" }, - "notes": { + "t1": { + "type": "integer", + "title": "T1", + "description": "where it ends (not included): ms, or the page after it when `paged`" + }, + "text": { + "type": "string", + "title": "Text", + "description": "the description: a few sentences" + }, + "model": { + "type": "string", + "title": "Model", + "description": "the model that wrote it (llm.vision_model)" + }, + "frame": { "anyOf": [ { "type": "string" @@ -40919,76 +41948,37 @@ "type": "null" } ], - "title": "Notes" - } - }, - "additionalProperties": false, - "type": "object", - "required": [ - "graph" - ], - "title": "CustomNodeVersionCreate" - }, - "DateList": { - "properties": { - "total": { - "type": "integer", - "title": "Total" - }, - "items": { - "items": { - "$ref": "#/components/schemas/DateSaid" - }, - "type": "array", - "title": "Items" - }, - "reading": { - "type": "boolean", - "title": "Reading", - "description": "whether analysis reads dates (Settings \u2192 Analysis \u2192 Read dates); off, nothing new is read" + "title": "Frame", + "description": "signed link to the page's drawing or the shot's keyframe" + }, + "paged": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "Paged", + "description": "true for a document's or an image's pages" } }, "additionalProperties": true, "type": "object", "required": [ - "total", - "items", - "reading" + "idx", + "t0", + "t1", + "text", + "model" ], - "title": "DateList" + "title": "Description", + "description": "What a model that can see images said a page or a shot shows." }, - "DateSaid": { + "EmailInfo": { "properties": { - "day": { - "type": "string", - "title": "Day", - "description": "the first day it means, YYYY-MM-DD" - }, - "until": { - "type": "string", - "title": "Until", - "description": "the last day it means: the same day for a day, the Sunday for a week, the 31st for a month" - }, - "period": { - "type": "string", - "title": "Period", - "description": "day, weekend, week, month or year" - }, - "said": { - "type": "string", - "title": "Said", - "description": "the words that give it, like \"next Tuesday\" or \"3 March 2024\"" - }, - "relative": { - "type": "boolean", - "title": "Relative", - "description": "worked out from the asset's own date (recorded_at): a day said relative to it, or without its year" - }, - "recording_id": { - "type": "integer", - "title": "Recording Id" - }, - "title": { + "subject": { "anyOf": [ { "type": "string" @@ -40997,9 +41987,9 @@ "type": "null" } ], - "title": "Title" + "title": "Subject" }, - "namespace": { + "from": { "anyOf": [ { "type": "string" @@ -41008,9 +41998,10 @@ "type": "null" } ], - "title": "Namespace" + "title": "From", + "description": "who sent it" }, - "recorded_at": { + "to": { "anyOf": [ { "type": "string" @@ -41019,31 +42010,20 @@ "type": "null" } ], - "title": "Recorded At" - }, - "segment": { - "type": "integer", - "title": "Segment", - "description": "the line's id" - }, - "idx": { - "type": "integer", - "title": "Idx", - "description": "the line's place in the asset's text" + "title": "To" }, - "t0": { + "cc": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "T0", - "description": "ms" + "title": "Cc" }, - "time": { + "date": { "anyOf": [ { "type": "string" @@ -41052,20 +42032,22 @@ "type": "null" } ], - "title": "Time" + "title": "Date", + "description": "when it was sent (ISO 8601)" }, - "speaker": { + "attachments": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Speaker" + "title": "Attachments", + "description": "how many files it carried" }, - "text": { + "snippet": { "anyOf": [ { "type": "string" @@ -41074,63 +42056,37 @@ "type": "null" } ], - "title": "Text", - "description": "the line" + "title": "Snippet", + "description": "the start of its text, at most 300 characters" } }, "additionalProperties": true, "type": "object", - "required": [ - "day", - "until", - "period", - "said", - "relative", - "recording_id", - "segment", - "idx" - ], - "title": "DateSaid", - "description": "A date an asset's line gives, as days on the calendar." + "title": "EmailInfo", + "description": "An email's own description, read when it was made into a PDF." }, - "DaySpend": { + "EmbedLink": { "properties": { - "day": { + "url": { "type": "string", - "title": "Day", - "description": "YYYY-MM-DD (UTC)" - }, - "cost_usd": { - "type": "number", - "title": "Cost Usd" - }, - "tokens": { - "type": "integer", - "title": "Tokens" - }, - "calls": { - "type": "integer", - "title": "Calls" + "title": "Url", + "description": "signed link to the embeddable player" } }, "additionalProperties": true, "type": "object", "required": [ - "day", - "cost_usd", - "tokens", - "calls" + "url" ], - "title": "DaySpend" + "title": "EmbedLink" }, - "DecisionStatus": { + "EmbedTestResult": { "properties": { - "engine": { - "type": "string", - "title": "Engine", - "description": "the setting: auto, jev, laya, llm or off" + "ok": { + "type": "boolean", + "title": "Ok" }, - "by": { + "error": { "anyOf": [ { "type": "string" @@ -41139,41 +42095,80 @@ "type": "null" } ], - "title": "By", - "description": "who answers now: jev, laya, llm, or none" + "title": "Error" }, - "apple_silicon": { - "type": "boolean", - "title": "Apple Silicon", - "description": "this machine can run MLX models" + "dimension": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Dimension", + "description": "how many numbers the model's vectors have" }, - "laya": { - "$ref": "#/components/schemas/LayaStatus" + "ms": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Ms" }, - "laya_models": { - "items": { - "$ref": "#/components/schemas/LayaModel" - }, - "type": "array", - "title": "Laya Models" + "model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Model" } }, "additionalProperties": true, "type": "object", "required": [ - "engine", - "apple_silicon", - "laya", - "laya_models" + "ok" ], - "title": "DecisionStatus", - "description": "Who takes routine decisions now, and whether a local Laya model could." + "title": "EmbedTestResult" }, - "DecisionTestResult": { + "EncryptionProgress": { "properties": { - "ok": { + "running": { "type": "boolean", - "title": "Ok" + "title": "Running" + }, + "to": { + "anyOf": [ + { + "type": "string", + "enum": [ + "encrypted", + "plain" + ] + }, + { + "type": "null" + } + ], + "title": "To" + }, + "changed": { + "type": "integer", + "title": "Changed", + "default": 0 + }, + "skipped": { + "type": "integer", + "title": "Skipped", + "default": 0 }, "error": { "anyOf": [ @@ -41186,19 +42181,34 @@ ], "title": "Error" }, - "by": { + "finished_at": { "anyOf": [ { - "type": "string" + "type": "number" }, { "type": "null" } ], - "title": "By", - "description": "who answered: jev, laya or llm (the language model when the decision model failed)" + "title": "Finished At" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "running" + ], + "title": "EncryptionProgress", + "description": "Converting the files already kept after encryption.files changed: `to` \"encrypted\" or \"plain\" (vaults stay\nencrypted), how many changed and how many were skipped (a locked vault, a damaged file), and why a run stopped\nearly." + }, + "EnrichedDate": { + "properties": { + "text": { + "type": "string", + "title": "Text", + "description": "as the text says it" }, - "choice": { + "iso": { "anyOf": [ { "type": "string" @@ -41207,41 +42217,41 @@ "type": "null" } ], - "title": "Choice" - }, - "confidence": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Confidence" + "title": "Iso", + "description": "its ISO 8601 value, when the text pins one down" }, - "ms": { + "kind": { "anyOf": [ { - "type": "integer" + "type": "string", + "enum": [ + "date", + "datetime", + "time" + ] }, { "type": "null" } ], - "title": "Ms" + "title": "Kind" } }, "additionalProperties": true, "type": "object", "required": [ - "ok" + "text" ], - "title": "DecisionTestResult" + "title": "EnrichedDate", + "description": "A date or time the text gives." }, - "Described": { + "EnrichedPlace": { "properties": { - "title": { + "name": { + "type": "string", + "title": "Name" + }, + "city": { "anyOf": [ { "type": "string" @@ -41250,18 +42260,9 @@ "type": "null" } ], - "title": "Title", - "description": "dc:title" - }, - "creators": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Creators", - "description": "dc:creator: its authors" + "title": "City" }, - "subject": { + "region": { "anyOf": [ { "type": "string" @@ -41270,10 +42271,9 @@ "type": "null" } ], - "title": "Subject", - "description": "dc:subject" + "title": "Region" }, - "description": { + "country": { "anyOf": [ { "type": "string" @@ -41282,10 +42282,9 @@ "type": "null" } ], - "title": "Description", - "description": "dc:description" + "title": "Country" }, - "publisher": { + "country_code": { "anyOf": [ { "type": "string" @@ -41294,70 +42293,106 @@ "type": "null" } ], - "title": "Publisher", - "description": "dc:publisher" + "title": "Country Code" }, - "language": { + "lat": { "anyOf": [ { - "type": "string" + "type": "number" }, { "type": "null" } ], - "title": "Language", - "description": "dc:language, a code such as en" + "title": "Lat" }, - "created": { + "lon": { "anyOf": [ { - "type": "string" + "type": "number" }, { "type": "null" } ], - "title": "Created", - "description": "dcterms:created (ISO 8601)" + "title": "Lon" }, - "modified": { + "km": { "anyOf": [ { - "type": "string" + "type": "number" }, { "type": "null" } ], - "title": "Modified", - "description": "dcterms:modified (ISO 8601)" + "title": "Km", + "description": "a GPS fix: how far it is from the named place" }, - "pages": { + "from": { + "type": "string", + "enum": [ + "gps", + "text" + ], + "title": "From", + "default": "text" + }, + "said": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Pages", - "description": "how many pages it says it has" + "title": "Said", + "description": "named in the text: the words that name it" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "name" + ], + "title": "EnrichedPlace", + "description": "A place anytopdf found: named in the text, or where a photo was taken (its GPS fix, named offline)." + }, + "Enrichment": { + "properties": { + "by": { + "type": "string", + "title": "By", + "description": "anytopdf and its version" }, - "words": { + "place": { "anyOf": [ { - "type": "integer" + "$ref": "#/components/schemas/EnrichedPlace" }, { "type": "null" } ], - "title": "Words", - "description": "how many words it says it has" + "description": "a photo: where it was taken" }, - "format": { + "places": { + "items": { + "$ref": "#/components/schemas/EnrichedPlace" + }, + "type": "array", + "title": "Places", + "description": "places its text names" + }, + "dates": { + "items": { + "$ref": "#/components/schemas/EnrichedDate" + }, + "type": "array", + "title": "Dates" + }, + "at": { "anyOf": [ { "type": "string" @@ -41366,82 +42401,95 @@ "type": "null" } ], - "title": "Format", - "description": "dc:format: its media type, as Tika found it" + "title": "At", + "description": "when they were found" } }, "additionalProperties": true, "type": "object", - "title": "Described", - "description": "What a document says about itself, read by a Tika server (documents.tika_metadata), as Dublin Core terms." + "required": [ + "by" + ], + "title": "Enrichment", + "description": "The places and dates anytopdf found in an asset (analysis.anytopdf); members of its namespace only." }, - "Description": { + "EntityDefine": { "properties": { - "idx": { - "type": "integer", - "title": "Idx", - "description": "the page (from 0) or the shot it describes" - }, - "t0": { - "type": "integer", - "title": "T0", - "description": "where it starts: ms, or the page (from 0) when `paged`" - }, - "t1": { - "type": "integer", - "title": "T1", - "description": "where it ends (not included): ms, or the page after it when `paged`" - }, - "text": { + "name": { "type": "string", - "title": "Text", - "description": "the description: a few sentences" + "maxLength": 200, + "minLength": 1, + "title": "Name" }, - "model": { + "type": { "type": "string", - "title": "Model", - "description": "the model that wrote it (llm.vision_model)" + "title": "Type", + "default": "TERM" }, - "frame": { + "description": { "anyOf": [ { - "type": "string" + "type": "string", + "maxLength": 2000 }, { "type": "null" } ], - "title": "Frame", - "description": "signed link to the page's drawing or the shot's keyframe" + "title": "Description" }, - "paged": { + "aliases": { + "items": { + "type": "string" + }, + "type": "array", + "maxItems": 100, + "title": "Aliases", + "description": "other ways it's written" + }, + "collection": { "anyOf": [ { - "type": "boolean" + "type": "integer" }, { "type": "null" } ], - "title": "Paged", - "description": "true for a document's or an image's pages" + "title": "Collection", + "description": "for this collection (and those inside it) only; default: the namespace" } }, - "additionalProperties": true, + "additionalProperties": false, "type": "object", "required": [ - "idx", - "t0", - "t1", - "text", - "model" + "name" ], - "title": "Description", - "description": "What a model that can see images said a page or a shot shows." + "title": "EntityDefine" }, - "EmailInfo": { + "EntityDetail": { "properties": { - "subject": { + "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" @@ -41450,9 +42498,9 @@ "type": "null" } ], - "title": "Subject" + "title": "Description" }, - "from": { + "namespace": { "anyOf": [ { "type": "string" @@ -41461,10 +42509,32 @@ "type": "null" } ], - "title": "From", - "description": "who sent it" + "title": "Namespace" }, - "to": { + "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" @@ -41473,9 +42543,9 @@ "type": "null" } ], - "title": "To" + "title": "First" }, - "cc": { + "last": { "anyOf": [ { "type": "string" @@ -41484,9 +42554,37 @@ "type": "null" } ], - "title": "Cc" + "title": "Last" }, - "date": { + "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" @@ -41495,10 +42593,10 @@ "type": "null" } ], - "title": "Date", - "description": "when it was sent (ISO 8601)" + "title": "Builtin", + "description": "unknown or unlabeled: one of the two entities that are always there" }, - "attachments": { + "collection": { "anyOf": [ { "type": "integer" @@ -41507,10 +42605,10 @@ "type": "null" } ], - "title": "Attachments", - "description": "how many files it carried" + "title": "Collection", + "description": "a defined entity of one collection (and those inside it)" }, - "snippet": { + "page": { "anyOf": [ { "type": "string" @@ -41519,37 +42617,29 @@ "type": "null" } ], - "title": "Snippet", - "description": "the start of its text, at most 300 characters" - } - }, - "additionalProperties": true, - "type": "object", - "title": "EmailInfo", - "description": "An email's own description, read when it was made into a PDF." - }, - "EmbedLink": { - "properties": { - "url": { - "type": "string", - "title": "Url", - "description": "signed link to the embeddable player" + "title": "Page", + "description": "its page in the web app, by name: /wiki//" } }, "additionalProperties": true, "type": "object", "required": [ - "url" + "id", + "name", + "key", + "type", + "type_label" ], - "title": "EmbedLink" + "title": "EntityDetail" }, - "EmbedTestResult": { + "EntityHide": { "properties": { - "ok": { + "hidden": { "type": "boolean", - "title": "Ok" + "title": "Hidden", + "default": true }, - "error": { + "reason": { "anyOf": [ { "type": "string" @@ -41558,32 +42648,31 @@ "type": "null" } ], - "title": "Error" - }, - "dimension": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Dimension", - "description": "how many numbers the model's vectors have" + "title": "Reason" + } + }, + "additionalProperties": false, + "type": "object", + "title": "EntityHide" + }, + "EntityLink": { + "properties": { + "id": { + "type": "integer", + "title": "Id" }, - "ms": { + "name": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Ms" + "title": "Name" }, - "model": { + "namespace": { "anyOf": [ { "type": "string" @@ -41592,48 +42681,130 @@ "type": "null" } ], - "title": "Model" + "title": "Namespace" } }, "additionalProperties": true, "type": "object", "required": [ - "ok" + "id" ], - "title": "EmbedTestResult" + "title": "EntityLink" }, - "EncryptionProgress": { + "EntityLinkRequest": { "properties": { - "running": { - "type": "boolean", - "title": "Running" + "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" }, - "to": { - "anyOf": [ - { - "type": "string", - "enum": [ - "encrypted", - "plain" - ] + "items": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array", + "title": "Items" + }, + "months": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Months", + "default": [] + }, + "facets": { + "additionalProperties": { + "additionalProperties": { + "type": "integer" }, - { - "type": "null" - } - ], - "title": "To" + "type": "object" + }, + "type": "object", + "title": "Facets", + "default": {} + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "total", + "items" + ], + "title": "EntityList" + }, + "EntityMerge": { + "properties": { + "keep": { + "type": "integer", + "title": "Keep", + "default": 0 }, - "changed": { + "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": "Merge" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "merge" + ], + "title": "EntityMerged" + }, + "EntityNotSame": { + "properties": { + "a": { "type": "integer", - "title": "Changed", + "title": "A", "default": 0 }, - "skipped": { + "b": { "type": "integer", - "title": "Skipped", + "title": "B", "default": 0 - }, - "error": { + } + }, + "additionalProperties": false, + "type": "object", + "title": "EntityNotSame" + }, + "EntityRename": { + "properties": { + "name": { "anyOf": [ { "type": "string" @@ -41642,36 +42813,40 @@ "type": "null" } ], - "title": "Error" + "title": "Name" }, - "finished_at": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Finished At" + "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": true, + "additionalProperties": false, "type": "object", - "required": [ - "running" - ], - "title": "EncryptionProgress", - "description": "Converting the files already kept after encryption.files changed: `to` \"encrypted\" or \"plain\" (vaults stay\nencrypted), how many changed and how many were skipped (a locked vault, a damaged file), and why a run stopped\nearly." + "title": "EntityRename" }, - "EnrichedDate": { + "EntityRetype": { "properties": { - "text": { - "type": "string", - "title": "Text", - "description": "as the text says it" + "ids": { + "items": { + "type": "integer" + }, + "type": "array", + "title": "Ids", + "default": [] }, - "iso": { + "type": { "anyOf": [ { "type": "string" @@ -41680,52 +42855,29 @@ "type": "null" } ], - "title": "Iso", - "description": "its ISO 8601 value, when the text pins one down" - }, - "kind": { - "anyOf": [ - { - "type": "string", - "enum": [ - "date", - "datetime", - "time" - ] - }, - { - "type": "null" - } - ], - "title": "Kind" + "title": "Type" } }, - "additionalProperties": true, + "additionalProperties": false, "type": "object", - "required": [ - "text" - ], - "title": "EnrichedDate", - "description": "A date or time the text gives." + "title": "EntityRetype" }, - "EnrichedPlace": { + "EntitySetup": { "properties": { - "name": { + "mode": { "type": "string", - "title": "Name" + "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" }, - "city": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "City" + "types": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Types", + "description": "the types kept; empty: all of them" }, - "region": { + "description": { "anyOf": [ { "type": "string" @@ -41734,20 +42886,34 @@ "type": "null" } ], - "title": "Region" + "title": "Description", + "description": "what this place is about" }, - "country": { + "matching": { + "type": "string", + "title": "Matching", + "default": "rules" + }, + "collection": { "anyOf": [ { - "type": "string" + "type": "integer" }, { "type": "null" } ], - "title": "Country" + "title": "Collection", + "description": "the collection this setup is saved on; null: the namespace" }, - "country_code": { + "collection_path": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Collection Path" + }, + "updated_at": { "anyOf": [ { "type": "string" @@ -41756,144 +42922,185 @@ "type": "null" } ], - "title": "Country Code" + "title": "Updated At" }, - "lat": { + "updated_by": { "anyOf": [ { - "type": "number" + "type": "string" }, { "type": "null" } ], - "title": "Lat" + "title": "Updated By" }, - "lon": { + "can_change": { + "type": "boolean", + "title": "Can Change", + "default": false + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "mode" + ], + "title": "EntitySetup" + }, + "EntitySetupApplied": { + "properties": { + "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": "number" + "type": "integer" }, { "type": "null" } ], - "title": "Lon" - }, - "km": { + "title": "Collection", + "description": "only this collection's assets (and those inside it)" + } + }, + "additionalProperties": false, + "type": "object", + "title": "EntitySetupApply" + }, + "EntitySetupSave": { + "properties": { + "collection": { "anyOf": [ { - "type": "number" + "type": "integer" }, { "type": "null" } ], - "title": "Km", - "description": "a GPS fix: how far it is from the named place" + "title": "Collection", + "description": "save it on this collection (default: the namespace)" }, - "from": { + "mode": { "type": "string", "enum": [ - "gps", - "text" + "self", + "fixed", + "hybrid" ], - "title": "From", - "default": "text" + "title": "Mode", + "default": "self" }, - "said": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Said", - "description": "named in the text: the words that name it" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "name" - ], - "title": "EnrichedPlace", - "description": "A place anytopdf found: named in the text, or where a photo was taken (its GPS fix, named offline)." - }, - "Enrichment": { - "properties": { - "by": { - "type": "string", - "title": "By", - "description": "anytopdf and its version" + "types": { + "items": { + "type": "string" + }, + "type": "array", + "maxItems": 100, + "title": "Types" }, - "place": { + "description": { "anyOf": [ { - "$ref": "#/components/schemas/EnrichedPlace" + "type": "string", + "maxLength": 2000 }, { "type": "null" } ], - "description": "a photo: where it was taken" + "title": "Description" }, - "places": { + "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)" + }, + "saved": { + "type": "boolean", + "title": "Saved", + "description": "whether the namespace has a setup of its own" + }, + "collections": { "items": { - "$ref": "#/components/schemas/EnrichedPlace" + "$ref": "#/components/schemas/EntitySetup" }, "type": "array", - "title": "Places", - "description": "places its text names" + "title": "Collections", + "description": "collections with a setup of their own" }, - "dates": { + "types": { "items": { - "$ref": "#/components/schemas/EnrichedDate" + "$ref": "#/components/schemas/EntityTypeInfo" }, "type": "array", - "title": "Dates" + "title": "Types", + "default": [] }, - "at": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "At", - "description": "when they were found" + "can_change": { + "type": "boolean", + "title": "Can Change", + "description": "you may change the namespace's setup and types: its editors" } }, "additionalProperties": true, "type": "object", "required": [ - "by" + "namespace", + "saved", + "can_change" ], - "title": "Enrichment", - "description": "The places and dates anytopdf found in an asset (analysis.anytopdf); members of its namespace only." + "title": "EntitySetupView" }, - "EntityDefine": { + "EntityType": { "properties": { - "name": { + "type": { "type": "string", - "maxLength": 200, - "minLength": 1, - "title": "Name" + "title": "Type" }, - "type": { + "label": { "type": "string", - "title": "Type", - "default": "TERM" + "title": "Label" + }, + "quiet": { + "type": "boolean", + "title": "Quiet", + "description": "extracted but hidden unless a filter asks for it (dates, numbers)" }, "description": { "anyOf": [ { - "type": "string", - "maxLength": 2000 + "type": "string" }, { "type": "null" @@ -41901,56 +43108,60 @@ ], "title": "Description" }, - "aliases": { - "items": { - "type": "string" - }, - "type": "array", - "maxItems": 100, - "title": "Aliases", - "description": "other ways it's written" + "builtin": { + "type": "boolean", + "title": "Builtin", + "description": "one of Lens's types; false: the namespace's own", + "default": true + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "type", + "label", + "quiet" + ], + "title": "EntityType" + }, + "EntityTypeCreate": { + "properties": { + "label": { + "type": "string", + "maxLength": 40, + "minLength": 1, + "title": "Label" }, - "collection": { + "description": { "anyOf": [ { - "type": "integer" + "type": "string", + "maxLength": 2000 }, { "type": "null" } ], - "title": "Collection", - "description": "for this collection (and those inside it) only; default: the namespace" + "title": "Description" } }, "additionalProperties": false, "type": "object", "required": [ - "name" + "label" ], - "title": "EntityDefine" + "title": "EntityTypeCreate" }, - "EntityDetail": { + "EntityTypeInfo": { "properties": { - "id": { - "type": "integer", - "title": "Id" - }, - "name": { - "type": "string", - "title": "Name" - }, - "key": { - "type": "string", - "title": "Key" - }, "type": { "type": "string", - "title": "Type" + "title": "Type", + "description": "the code extractors and models use, e.g. ORG or CLIENT_TEAM" }, - "type_label": { + "label": { "type": "string", - "title": "Type Label" + "title": "Label" }, "description": { "anyOf": [ @@ -41963,91 +43174,63 @@ ], "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 + "quiet": { + "type": "boolean", + "title": "Quiet", + "description": "extracted but hidden unless a filter asks for it (dates, numbers)", + "default": false }, - "first": { + "builtin": { + "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": { "anyOf": [ { - "type": "string" + "type": "string", + "maxLength": 40, + "minLength": 1 }, { "type": "null" } ], - "title": "First" + "title": "Label" }, - "last": { + "description": { "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": { + { + "type": "string", + "maxLength": 2000 + }, + { + "type": "null" + } + ], + "title": "Description", + "description": "empty clears it" + } + }, + "additionalProperties": false, + "type": "object", + "title": "EntityTypeUpdate" + }, + "EntityUpdate": { + "properties": { + "description": { "anyOf": [ { "type": "string" @@ -42056,53 +43239,77 @@ "type": "null" } ], - "title": "Builtin", - "description": "unknown or unlabeled: one of the two entities that are always there" + "title": "Description", + "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": "a defined entity of one collection (and those inside it)" + "title": "Aliases", + "description": "the other ways it's written (these replace the ones it has)" }, - "page": { + "defined": { "anyOf": [ { - "type": "string" + "type": "boolean" }, { "type": "null" } ], - "title": "Page", - "description": "its page in the web app, by name: /wiki//" + "title": "Defined", + "description": "on the fixed list of entities (namespaces in the fixed mode map names onto it)" } }, - "additionalProperties": true, + "additionalProperties": false, "type": "object", - "required": [ - "id", - "name", - "key", - "type", - "type_label" - ], - "title": "EntityDetail" + "title": "EntityUpdate" }, - "EntityHide": { + "Estimate": { "properties": { - "hidden": { + "recordings": { + "type": "integer", + "title": "Recordings" + }, + "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": "Hidden", - "default": true + "title": "Needs Confirmation" }, - "reason": { + "confirm_text": { "anyOf": [ { "type": "string" @@ -42111,20 +43318,72 @@ "type": "null" } ], - "title": "Reason" + "title": "Confirm Text" } }, - "additionalProperties": false, + "additionalProperties": true, "type": "object", - "title": "EntityHide" + "required": [ + "recordings", + "hours", + "seconds", + "llm", + "would_replace", + "needs_confirmation" + ], + "title": "Estimate" }, - "EntityLink": { + "EventInfo": { + "properties": { + "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": [ + "type", + "label" + ], + "title": "EventInfo" + }, + "Extension": { "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" @@ -42133,9 +43392,9 @@ "type": "null" } ], - "title": "Name" + "title": "Title" }, - "namespace": { + "description": { "anyOf": [ { "type": "string" @@ -42144,130 +43403,127 @@ "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 - } - }, - "additionalProperties": false, - "type": "object", - "title": "EntityLinkRequest" - }, - "EntityList": { - "properties": { - "total": { - "type": "integer", - "title": "Total" + "title": "Description" }, - "items": { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array", - "title": "Items" + "visibility": { + "type": "string", + "enum": [ + "private", + "namespace", + "everyone" + ], + "title": "Visibility", + "default": "private" }, - "months": { + "namespaces": { "items": { "type": "string" }, "type": "array", - "title": "Months", - "default": [] + "title": "Namespaces", + "description": "who sees it, when shared with namespaces" }, - "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": "Keep", - "default": 0 + "enabled": { + "type": "boolean", + "title": "Enabled", + "description": "whether it's switched on in conversations" }, - "others": { - "items": { - "type": "integer" - }, - "type": "array", - "title": "Others", - "default": [] - } - }, - "additionalProperties": false, - "type": "object", - "title": "EntityMerge" - }, - "EntityMerged": { - "properties": { - "ok": { + "owner_email": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Owner Email" + }, + "editable": { "type": "boolean", - "title": "Ok", - "default": true + "title": "Editable", + "default": false }, - "merge": { + "current": { "type": "integer", - "title": "Merge" + "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" + }, + { + "type": "null" + } + ], + "title": "Origin", + "description": "how this version was made: code, canvas, chat or import" + }, + "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" + }, + "updated_at": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Updated At" } }, "additionalProperties": true, "type": "object", "required": [ - "merge" + "id", + "name", + "kind", + "enabled", + "current", + "version", + "spec" ], - "title": "EntityMerged" + "title": "Extension" }, - "EntityNotSame": { + "ExtensionCreate": { "properties": { - "a": { - "type": "integer", - "title": "A", - "default": 0 + "manifest": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Manifest", + "description": "{name, kind, description, ...settings}" }, - "b": { - "type": "integer", - "title": "B", - "default": 0 - } - }, - "additionalProperties": false, - "type": "object", - "title": "EntityNotSame" - }, - "EntityRename": { - "properties": { - "name": { + "text": { "anyOf": [ { "type": "string" @@ -42276,40 +43532,52 @@ "type": "null" } ], - "title": "Name" + "title": "Text", + "description": "the manifest as code: YAML, JSON, or Markdown with frontmatter" }, - "keep_alias": { + "enabled": { "type": "boolean", - "title": "Keep Alias", + "title": "Enabled", "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 + "origin": { + "type": "string", + "enum": [ + "code", + "canvas", + "chat" + ], + "title": "Origin", + "default": "code" } }, "additionalProperties": false, "type": "object", - "title": "EntityRename" + "title": "ExtensionCreate" }, - "EntityRetype": { + "ExtensionDetail": { "properties": { - "ids": { - "items": { - "type": "integer" - }, - "type": "array", - "title": "Ids", - "default": [] + "id": { + "type": "integer", + "title": "Id" }, - "type": { + "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" @@ -42318,29 +43586,43 @@ "type": "null" } ], - "title": "Type" - } - }, - "additionalProperties": false, - "type": "object", - "title": "EntityRetype" - }, - "EntitySetup": { - "properties": { - "mode": { + "title": "Title" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "visibility": { "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" + "enum": [ + "private", + "namespace", + "everyone" + ], + "title": "Visibility", + "default": "private" }, - "types": { + "namespaces": { "items": { "type": "string" }, "type": "array", - "title": "Types", - "description": "the types kept; empty: all of them" + "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" @@ -42349,45 +43631,53 @@ "type": "null" } ], - "title": "Description", - "description": "what this place is about" + "title": "Owner Email" }, - "matching": { - "type": "string", - "title": "Matching", - "default": "rules" + "editable": { + "type": "boolean", + "title": "Editable", + "default": false }, - "collection": { + "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": "integer" + "type": "string" }, { "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": "Origin", + "description": "how this version was made: code, canvas, chat or import" }, - "updated_at": { + "source": { "anyOf": [ { - "type": "string" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "title": "Updated At" + "title": "Source", + "description": "where it was imported from: a marketplace's plugin, a link or a file" }, - "updated_by": { + "updated_at": { "anyOf": [ { "type": "string" @@ -42396,237 +43686,173 @@ "type": "null" } ], - "title": "Updated By" + "title": "Updated At" }, - "can_change": { - "type": "boolean", - "title": "Can Change", - "default": false - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "mode" - ], - "title": "EntitySetup" - }, - "EntitySetupApplied": { - "properties": { - "recordings": { - "type": "integer", - "title": "Recordings", - "description": "how many assets are analysed again" + "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": [ - "recordings" + "id", + "name", + "kind", + "enabled", + "current", + "version", + "spec", + "manifest" ], - "title": "EntitySetupApplied" + "title": "ExtensionDetail" }, - "EntitySetupApply": { + "ExtensionImportArchive": { "properties": { - "collection": { + "filename": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Collection", - "description": "only this collection's assets (and those inside 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": "EntitySetupApply" + "required": [ + "data" + ], + "title": "ExtensionImportArchive" }, - "EntitySetupSave": { + "ExtensionImportLink": { "properties": { - "collection": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Collection", - "description": "save it on this collection (default: the namespace)" - }, - "mode": { + "url": { "type": "string", - "enum": [ - "self", - "fixed", - "hybrid" - ], - "title": "Mode", - "default": "self" - }, - "types": { - "items": { - "type": "string" - }, - "type": "array", - "maxItems": 100, - "title": "Types" - }, - "description": { - "anyOf": [ - { - "type": "string", - "maxLength": 2000 - }, - { - "type": "null" - } - ], - "title": "Description" + "title": "Url", + "description": "a plugin or skill: a GitHub or GitLab repository or folder, or a .zip or .tar.gz link" }, - "matching": { - "type": "string", - "enum": [ - "rules", - "model" - ], - "title": "Matching", - "default": "rules" + "preview": { + "type": "boolean", + "title": "Preview", + "description": "say what it would install, without installing it", + "default": false } }, "additionalProperties": false, "type": "object", - "title": "EntitySetupSave" + "required": [ + "url" + ], + "title": "ExtensionImportLink" }, - "EntitySetupView": { + "ExtensionImportPreview": { "properties": { - "namespace": { - "$ref": "#/components/schemas/EntitySetup", - "description": "the namespace's setup (the default when none is saved)" - }, - "saved": { - "type": "boolean", - "title": "Saved", - "description": "whether the namespace has a setup of its own" - }, - "collections": { - "items": { - "$ref": "#/components/schemas/EntitySetup" - }, - "type": "array", - "title": "Collections", - "description": "collections with a setup of their own" + "manifest": { + "additionalProperties": true, + "type": "object", + "title": "Manifest", + "description": "the plugin as Lens would install it" }, - "types": { + "skipped": { "items": { - "$ref": "#/components/schemas/EntityTypeInfo" + "$ref": "#/components/schemas/ExtensionSkipped" }, "type": "array", - "title": "Types", + "title": "Skipped", "default": [] }, - "can_change": { - "type": "boolean", - "title": "Can Change", - "description": "you may change the namespace's setup and types: its editors" + "source": { + "type": "string", + "title": "Source" } }, "additionalProperties": true, "type": "object", "required": [ - "namespace", - "saved", - "can_change" + "manifest", + "source" ], - "title": "EntitySetupView" + "title": "ExtensionImportPreview" }, - "EntityType": { + "ExtensionImported": { "properties": { - "type": { - "type": "string", - "title": "Type" - }, - "label": { - "type": "string", - "title": "Label" - }, - "quiet": { - "type": "boolean", - "title": "Quiet", - "description": "extracted but hidden unless a filter asks for it (dates, numbers)" + "id": { + "type": "integer", + "title": "Id" }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Description" + "version": { + "type": "integer", + "title": "Version" }, - "builtin": { - "type": "boolean", - "title": "Builtin", - "description": "one of Lens's types; false: the namespace's own", - "default": true + "skipped": { + "items": { + "$ref": "#/components/schemas/ExtensionSkipped" + }, + "type": "array", + "title": "Skipped", + "default": [] } }, "additionalProperties": true, "type": "object", "required": [ - "type", - "label", - "quiet" + "id", + "version" ], - "title": "EntityType" + "title": "ExtensionImported" }, - "EntityTypeCreate": { + "ExtensionSkipped": { "properties": { - "label": { + "kind": { "type": "string", - "maxLength": 40, - "minLength": 1, - "title": "Label" + "title": "Kind", + "description": "what was left out: hooks, mcp, skill, command, agent or file" }, - "description": { - "anyOf": [ - { - "type": "string", - "maxLength": 2000 - }, - { - "type": "null" - } - ], - "title": "Description" + "name": { + "type": "string", + "title": "Name" + }, + "why": { + "type": "string", + "title": "Why" } }, - "additionalProperties": false, + "additionalProperties": true, "type": "object", "required": [ - "label" + "kind", + "name", + "why" ], - "title": "EntityTypeCreate" + "title": "ExtensionSkipped" }, - "EntityTypeInfo": { + "ExtensionTest": { "properties": { - "type": { - "type": "string", - "title": "Type", - "description": "the code extractors and models use, e.g. ORG or CLIENT_TEAM" - }, - "label": { - "type": "string", - "title": "Label" - }, - "description": { + "tool": { "anyOf": [ { "type": "string" @@ -42635,64 +43861,49 @@ "type": "null" } ], - "title": "Description" + "title": "Tool", + "description": "which of a plugin's tools (a tool extension: itself)" }, - "quiet": { - "type": "boolean", - "title": "Quiet", - "description": "extracted but hidden unless a filter asks for it (dates, numbers)", - "default": false + "args": { + "additionalProperties": true, + "type": "object", + "title": "Args", + "default": {} }, - "builtin": { + "confirm": { "type": "boolean", - "title": "Builtin", - "description": "one of Lens's types; false: the namespace's own", - "default": true + "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", - "required": [ - "type", - "label" - ], - "title": "EntityTypeInfo" + "title": "ExtensionTestResult" }, - "EntityTypeUpdate": { + "ExtensionUpdate": { "properties": { - "label": { + "title": { "anyOf": [ { - "type": "string", - "maxLength": 40, - "minLength": 1 + "type": "string" }, { "type": "null" } ], - "title": "Label" + "title": "Title" }, - "description": { - "anyOf": [ - { - "type": "string", - "maxLength": 2000 - }, - { - "type": "null" - } - ], - "title": "Description", - "description": "empty clears it" - } - }, - "additionalProperties": false, - "type": "object", - "title": "EntityTypeUpdate" - }, - "EntityUpdate": { - "properties": { "description": { "anyOf": [ { @@ -42702,196 +43913,80 @@ "type": "null" } ], - "title": "Description", - "description": "what the entity is; empty clears it" + "title": "Description" }, - "aliases": { + "enabled": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array", - "maxItems": 100 + "type": "boolean" }, { "type": "null" } ], - "title": "Aliases", - "description": "the other ways it's written (these replace the ones it has)" + "title": "Enabled" }, - "defined": { + "visibility": { "anyOf": [ { - "type": "boolean" + "type": "string", + "enum": [ + "private", + "namespace", + "everyone" + ] }, { "type": "null" } ], - "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" - }, - "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" + "title": "Visibility" }, - "confirm_text": { + "namespaces": { "anyOf": [ { - "type": "string" + "items": { + "type": "string" + }, + "type": "array" }, { "type": "null" } ], - "title": "Confirm Text" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "recordings", - "hours", - "seconds", - "llm", - "would_replace", - "needs_confirmation" - ], - "title": "Estimate" - }, - "EventInfo": { - "properties": { - "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" + "title": "Namespaces" } }, - "additionalProperties": true, + "additionalProperties": false, "type": "object", - "required": [ - "type", - "label" - ], - "title": "EventInfo" + "title": "ExtensionUpdate" }, - "Extension": { + "ExtensionVersionCreate": { "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": { + "manifest": { "anyOf": [ { - "type": "string" + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "title": "Title" + "title": "Manifest" }, - "description": { + "text": { "anyOf": [ { "type": "string" }, { "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": "Text" }, - "owner_email": { + "notes": { "anyOf": [ { "type": "string" @@ -42900,26 +43995,39 @@ "type": "null" } ], - "title": "Owner Email" - }, - "editable": { - "type": "boolean", - "title": "Editable", - "default": false - }, - "current": { - "type": "integer", - "title": "Current" + "title": "Notes" }, + "origin": { + "type": "string", + "enum": [ + "code", + "canvas", + "chat" + ], + "title": "Origin", + "default": "code" + } + }, + "additionalProperties": false, + "type": "object", + "title": "ExtensionVersionCreate" + }, + "ExtensionVersionInfo": { + "properties": { "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" + "notes": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Notes" }, "origin": { "anyOf": [ @@ -42930,23 +44038,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" @@ -42955,38 +44060,56 @@ "type": "null" } ], - "title": "Updated At" + "title": "Created By" } }, "additionalProperties": true, "type": "object", "required": [ - "id", - "name", - "kind", - "enabled", - "current", - "version", - "spec" + "version" ], - "title": "Extension" + "title": "ExtensionVersionInfo" }, - "ExtensionCreate": { + "ExternalIdentity": { "properties": { - "manifest": { + "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": [ { - "additionalProperties": true, - "type": "object" + "type": "string" }, { "type": "null" } ], - "title": "Manifest", - "description": "{name, kind, description, ...settings}" + "title": "Email" }, - "text": { + "created_at": { + "type": "string", + "title": "Created At" + }, + "last_used_at": { "anyOf": [ { "type": "string" @@ -42995,327 +44118,368 @@ "type": "null" } ], - "title": "Text", - "description": "the manifest as code: YAML, JSON, or Markdown with frontmatter" - }, - "enabled": { - "type": "boolean", - "title": "Enabled", - "default": true + "title": "Last Used At" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "id", + "provider", + "label", + "kind", + "created_at" + ], + "title": "ExternalIdentity" + }, + "ExternalProvider": { + "properties": { + "key": { + "type": "string", + "title": "Key" }, - "origin": { + "kind": { "type": "string", "enum": [ - "code", - "canvas", - "chat" + "google", + "github", + "microsoft", + "oidc" ], - "title": "Origin", - "default": "code" + "title": "Kind" + }, + "label": { + "type": "string", + "title": "Label" } }, - "additionalProperties": false, + "additionalProperties": true, "type": "object", - "title": "ExtensionCreate" + "required": [ + "key", + "kind", + "label" + ], + "title": "ExternalProvider" }, - "ExtensionDetail": { + "ExternalProviderAdmin": { "properties": { - "id": { - "type": "integer", - "title": "Id" - }, - "name": { + "key": { "type": "string", - "title": "Name", - "description": "what the assistant calls it: its tool or skill name" + "title": "Key" }, "kind": { "type": "string", "enum": [ - "tool", - "skill", - "hook", - "plugin", - "mcp" + "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": { + "type": "boolean", + "title": "Enabled" + }, + "people": { + "type": "integer", + "title": "People", + "description": "Lens accounts connected through it" + }, + "callback_path": { + "type": "string", + "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", + "label", + "client_id", + "secret_set", + "signup", + "domains", + "enabled", + "people", + "callback_path" + ], + "title": "ExternalProviderAdmin" + }, + "ExternalProviderSave": { + "properties": { + "kind": { + "anyOf": [ + { + "type": "string", + "enum": [ + "google", + "github", + "microsoft", + "oidc" + ] + }, + { + "type": "null" + } ], - "title": "Kind" + "title": "Kind", + "description": "when adding one" }, - "title": { + "label": { "anyOf": [ { - "type": "string" + "type": "string", + "maxLength": 60 }, { "type": "null" } ], - "title": "Title" + "title": "Label" }, - "description": { + "client_id": { "anyOf": [ { - "type": "string" + "type": "string", + "maxLength": 500 }, { "type": "null" } ], - "title": "Description" + "title": "Client Id" }, - "visibility": { - "type": "string", - "enum": [ - "private", - "namespace", - "everyone" + "client_secret": { + "anyOf": [ + { + "type": "string", + "maxLength": 2000 + }, + { + "type": "null" + } ], - "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": "Client Secret", + "description": "leave out to keep the one kept" }, - "owner_email": { + "issuer": { "anyOf": [ { - "type": "string" + "type": "string", + "maxLength": 500 }, { "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": "Issuer" }, - "origin": { + "tenant": { "anyOf": [ { - "type": "string" + "type": "string", + "maxLength": 100 }, { "type": "null" } ], - "title": "Origin", - "description": "how this version was made: code, canvas, chat or import" + "title": "Tenant" }, - "source": { + "signup": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "boolean" }, { "type": "null" } ], - "title": "Source", - "description": "where it was imported from: a marketplace's plugin, a link or a file" + "title": "Signup" }, - "updated_at": { + "domains": { "anyOf": [ { - "type": "string" + "items": { + "type": "string" + }, + "type": "array", + "maxItems": 50 }, { "type": "null" } ], - "title": "Updated At" - }, - "manifest": { - "type": "string", - "title": "Manifest", - "description": "the extension as a manifest to read, change and import again" + "title": "Domains" }, - "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": { + "enabled": { "anyOf": [ { - "type": "string" + "type": "boolean" }, { "type": "null" } ], - "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 + "title": "Enabled" } }, "additionalProperties": false, "type": "object", - "required": [ - "data" - ], - "title": "ExtensionImportArchive" + "title": "ExternalProviderSave" }, - "ExtensionImportLink": { + "ExternalRedirect": { "properties": { "url": { "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 + "description": "the provider's sign-in page; open it in this browser" } }, - "additionalProperties": false, + "additionalProperties": true, "type": "object", "required": [ "url" ], - "title": "ExtensionImportLink" + "title": "ExternalRedirect" }, - "ExtensionImportPreview": { + "ExternalStart": { "properties": { - "manifest": { - "additionalProperties": true, - "type": "object", - "title": "Manifest", - "description": "the plugin as Lens would install it" - }, - "skipped": { - "items": { - "$ref": "#/components/schemas/ExtensionSkipped" - }, - "type": "array", - "title": "Skipped", - "default": [] - }, - "source": { + "next": { "type": "string", - "title": "Source" + "maxLength": 500, + "title": "Next", + "description": "the page to open after signing in", + "default": "/" } }, - "additionalProperties": true, + "additionalProperties": false, "type": "object", - "required": [ - "manifest", - "source" - ], - "title": "ExtensionImportPreview" + "title": "ExternalStart" }, - "ExtensionImported": { + "FaceDismiss": { "properties": { + "kind": { + "type": "string", + "title": "Kind", + "default": "face" + }, "id": { "type": "integer", - "title": "Id" - }, - "version": { + "title": "Id", + "default": 0 + } + }, + "additionalProperties": false, + "type": "object", + "title": "FaceDismiss" + }, + "FaceMerge": { + "properties": { + "into": { "type": "integer", - "title": "Version" - }, - "skipped": { - "items": { - "$ref": "#/components/schemas/ExtensionSkipped" - }, - "type": "array", - "title": "Skipped", - "default": [] + "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": [ - "id", - "version" + "merge" ], - "title": "ExtensionImported" + "title": "FaceMerged" }, - "ExtensionSkipped": { + "FaceRename": { "properties": { - "kind": { - "type": "string", - "title": "Kind", - "description": "what was left out: hooks, mcp, skill, command, agent or file" - }, "name": { "type": "string", - "title": "Name" - }, - "why": { - "type": "string", - "title": "Why" + "title": "Name", + "default": "" } }, - "additionalProperties": true, + "additionalProperties": false, "type": "object", - "required": [ - "kind", - "name", - "why" - ], - "title": "ExtensionSkipped" + "title": "FaceRename" }, - "ExtensionTest": { + "FaceSpeaker": { "properties": { - "tool": { + "speaker": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Speaker" + } + }, + "additionalProperties": false, + "type": "object", + "title": "FaceSpeaker" + }, + "FacesMode": { + "properties": { + "mode": { "anyOf": [ { "type": "string" @@ -43324,39 +44488,91 @@ "type": "null" } ], - "title": "Tool", - "description": "which of a plugin's tools (a tool extension: itself)" + "title": "Mode", + "description": "off, detect or recognize; left out, the mode stays as it is" }, - "args": { - "additionalProperties": true, - "type": "object", - "title": "Args", - "default": {} + "pixelate": { + "anyOf": [ + { + "type": "boolean" + }, + { + "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" }, - "confirm": { + "purpose": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Purpose", + "description": "why faces are recognised (required for recognize)" + }, + "reprocess": { "type": "boolean", - "title": "Confirm", - "description": "needed to try a tool that changes something: it really runs", + "title": "Reprocess", + "description": "queue face detection for this namespace's videos, documents and images", "default": false } }, "additionalProperties": false, "type": "object", - "title": "ExtensionTest" + "title": "FacesMode" }, - "ExtensionTestResult": { + "FacesModeSet": { "properties": { - "output": { - "title": "Output" + "ok": { + "type": "boolean", + "title": "Ok", + "default": true + }, + "jobs": { + "items": { + "type": "integer" + }, + "type": "array", + "title": "Jobs", + "default": [] } }, "additionalProperties": true, "type": "object", - "title": "ExtensionTestResult" + "title": "FacesModeSet" }, - "ExtensionUpdate": { + "FacetCount": { "properties": { - "title": { + "name": { + "type": "string", + "title": "Name" + }, + "count": { + "type": "integer", + "title": "Count", + "description": "matching moments" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "name", + "count" + ], + "title": "FacetCount" + }, + "FedoraStatus": { + "properties": { + "enabled": { + "type": "boolean", + "title": "Enabled" + }, + "url": { "anyOf": [ { "type": "string" @@ -43365,9 +44581,21 @@ "type": "null" } ], - "title": "Title" + "title": "Url" }, - "description": { + "root": { + "type": "string", + "title": "Root" + }, + "pending": { + "type": "integer", + "title": "Pending" + }, + "resources": { + "type": "integer", + "title": "Resources" + }, + "last_sync": { "anyOf": [ { "type": "string" @@ -43376,69 +44604,111 @@ "type": "null" } ], - "title": "Description" + "title": "Last Sync" }, - "enabled": { + "last_full": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { "type": "null" } ], - "title": "Enabled" + "title": "Last Full" }, - "visibility": { + "last_counts": { "anyOf": [ { - "type": "string", - "enum": [ - "private", - "namespace", - "everyone" - ] + "additionalProperties": true, + "type": "object" }, { "type": "null" } ], - "title": "Visibility" + "title": "Last Counts" }, - "namespaces": { + "last_error": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array" + "type": "string" }, { "type": "null" } ], - "title": "Namespaces" + "title": "Last Error" + }, + "full_requested": { + "type": "boolean", + "title": "Full Requested" } }, - "additionalProperties": false, + "additionalProperties": true, "type": "object", - "title": "ExtensionUpdate" + "required": [ + "enabled", + "root", + "pending", + "resources", + "full_requested" + ], + "title": "FedoraStatus" }, - "ExtensionVersionCreate": { + "FedoraSyncResult": { "properties": { - "manifest": { - "anyOf": [ - { - "additionalProperties": true, - "type": "object" - }, - { - "type": "null" - } - ], - "title": "Manifest" + "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" + }, + "Feed": { + "properties": { + "id": { + "type": "integer", + "title": "Id" }, - "text": { + "space": { + "type": "integer", + "title": "Space" + }, + "namespace": { "anyOf": [ { "type": "string" @@ -43447,9 +44717,21 @@ "type": "null" } ], - "title": "Text" + "title": "Namespace" }, - "notes": { + "kind": { + "type": "string", + "enum": [ + "rss", + "podcast" + ], + "title": "Kind" + }, + "title": { + "type": "string", + "title": "Title" + }, + "description": { "anyOf": [ { "type": "string" @@ -43458,30 +44740,9 @@ "type": "null" } ], - "title": "Notes" - }, - "origin": { - "type": "string", - "enum": [ - "code", - "canvas", - "chat" - ], - "title": "Origin", - "default": "code" - } - }, - "additionalProperties": false, - "type": "object", - "title": "ExtensionVersionCreate" - }, - "ExtensionVersionInfo": { - "properties": { - "version": { - "type": "integer", - "title": "Version" + "title": "Description" }, - "notes": { + "author": { "anyOf": [ { "type": "string" @@ -43490,9 +44751,9 @@ "type": "null" } ], - "title": "Notes" + "title": "Author" }, - "origin": { + "language": { "anyOf": [ { "type": "string" @@ -43501,9 +44762,9 @@ "type": "null" } ], - "title": "Origin" + "title": "Language" }, - "created_at": { + "category": { "anyOf": [ { "type": "string" @@ -43512,9 +44773,14 @@ "type": "null" } ], - "title": "Created At" + "title": "Category" }, - "created_by": { + "explicit": { + "type": "boolean", + "title": "Explicit", + "default": false + }, + "image": { "anyOf": [ { "type": "string" @@ -43523,41 +44789,33 @@ "type": "null" } ], - "title": "Created By" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "version" - ], - "title": "ExtensionVersionInfo" - }, - "ExternalIdentity": { - "properties": { - "id": { - "type": "string", - "title": "Id" + "title": "Image" }, - "provider": { + "max_items": { + "type": "integer", + "title": "Max Items" + }, + "url": { "type": "string", - "title": "Provider" + "title": "Url", + "description": "the feed's private address: anyone with it can read the feed, so share it like a password" }, - "label": { + "path": { "type": "string", - "title": "Label" + "title": "Path", + "description": "the address without the server" }, - "kind": { + "page": { "type": "string", - "enum": [ - "google", - "github", - "microsoft", - "oidc" - ], - "title": "Kind" + "title": "Page", + "description": "the feed's page in the web app" }, - "email": { + "items": { + "type": "integer", + "title": "Items", + "description": "how many items it holds" + }, + "last_item_at": { "anyOf": [ { "type": "string" @@ -43566,13 +44824,9 @@ "type": "null" } ], - "title": "Email" - }, - "created_at": { - "type": "string", - "title": "Created At" + "title": "Last Item At" }, - "last_used_at": { + "fetched_at": { "anyOf": [ { "type": "string" @@ -43581,217 +44835,118 @@ "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" - }, - "label": { - "type": "string", - "title": "Label" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "key", - "kind", - "label" - ], - "title": "ExternalProvider" - }, - "ExternalProviderAdmin": { - "properties": { - "key": { - "type": "string", - "title": "Key" + "title": "Fetched At", + "description": "when a feed reader or podcast app last read it" }, - "kind": { - "type": "string", - "enum": [ - "google", - "github", - "microsoft", - "oidc" + "created_by": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } ], - "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": { - "type": "boolean", - "title": "Enabled" - }, - "people": { - "type": "integer", - "title": "People", - "description": "Lens accounts connected through it" + "title": "Created By" }, - "callback_path": { - "type": "string", - "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", - "label", - "client_id", - "secret_set", - "signup", - "domains", - "enabled", - "people", - "callback_path" - ], - "title": "ExternalProviderAdmin" - }, - "ExternalProviderSave": { - "properties": { - "kind": { + "created_at": { "anyOf": [ { - "type": "string", - "enum": [ - "google", - "github", - "microsoft", - "oidc" - ] + "type": "string" }, { "type": "null" } ], - "title": "Kind", - "description": "when adding one" + "title": "Created At" }, - "label": { + "updated_at": { "anyOf": [ { - "type": "string", - "maxLength": 60 + "type": "string" }, { "type": "null" } ], - "title": "Label" + "title": "Updated At" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "id", + "space", + "kind", + "title", + "max_items", + "url", + "path", + "page", + "items" + ], + "title": "Feed" + }, + "FeedCreate": { + "properties": { + "title": { + "type": "string", + "maxLength": 200, + "minLength": 1, + "title": "Title" }, - "client_id": { + "description": { "anyOf": [ { "type": "string", - "maxLength": 500 + "maxLength": 2000 }, { "type": "null" } ], - "title": "Client Id" + "title": "Description" }, - "client_secret": { + "author": { "anyOf": [ { "type": "string", - "maxLength": 2000 + "maxLength": 200 }, { "type": "null" } ], - "title": "Client Secret", - "description": "leave out to keep the one kept" + "title": "Author", + "description": "who a podcast app shows it's by (default Lens)" }, - "issuer": { + "language": { "anyOf": [ { "type": "string", - "maxLength": 500 + "maxLength": 20 }, { "type": "null" } ], - "title": "Issuer" + "title": "Language", + "description": "a language tag, like en or en-GB (default en)" }, - "tenant": { + "category": { "anyOf": [ { "type": "string", - "maxLength": 100 + "maxLength": 60 }, { "type": "null" } ], - "title": "Tenant" + "title": "Category", + "description": "an Apple Podcasts category (podcast feeds; default Education)" }, - "signup": { + "explicit": { "anyOf": [ { "type": "boolean" @@ -43800,149 +44955,94 @@ "type": "null" } ], - "title": "Signup" + "title": "Explicit" }, - "domains": { + "image": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array", - "maxItems": 50 + "type": "string", + "maxLength": 2000 }, { "type": "null" } ], - "title": "Domains" + "title": "Image", + "description": "artwork: an https:// address of a square picture" }, - "enabled": { + "max_items": { "anyOf": [ { - "type": "boolean" + "type": "integer", + "maximum": 500.0, + "minimum": 1.0 }, { "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": { + "title": "Max Items", + "description": "how many items the feed lists, newest first (default 50)" + }, "kind": { "type": "string", + "enum": [ + "rss", + "podcast" + ], "title": "Kind", - "default": "face" + "default": "rss" }, - "id": { - "type": "integer", - "title": "Id", - "default": 0 + "namespace": { + "type": "string", + "title": "Namespace", + "description": "the namespace the feed belongs to: its editors manage it, its readers see it" } }, "additionalProperties": false, "type": "object", - "title": "FaceDismiss" + "required": [ + "title", + "namespace" + ], + "title": "FeedCreate" }, - "FaceMerge": { + "FeedItem": { "properties": { - "into": { + "id": { "type": "integer", - "title": "Into", - "default": 0 - } - }, - "additionalProperties": false, - "type": "object", - "title": "FaceMerge" - }, - "FaceMerged": { - "properties": { - "ok": { - "type": "boolean", - "title": "Ok", - "default": true + "title": "Id" }, - "merge": { + "feed": { "type": "integer", - "title": "Merge" - } - }, - "additionalProperties": true, - "type": "object", - "required": [ - "merge" - ], - "title": "FaceMerged" - }, - "FaceRename": { - "properties": { - "name": { + "title": "Feed" + }, + "kind": { "type": "string", - "title": "Name", - "default": "" - } - }, - "additionalProperties": false, - "type": "object", - "title": "FaceRename" - }, - "FaceSpeaker": { - "properties": { - "speaker": { + "enum": [ + "asset", + "episode", + "activity", + "text" + ], + "title": "Kind" + }, + "guid": { + "type": "string", + "title": "Guid" + }, + "title": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Speaker" - } - }, - "additionalProperties": false, - "type": "object", - "title": "FaceSpeaker" - }, - "FacesMode": { - "properties": { - "mode": { + "title": "Title" + }, + "summary": { "anyOf": [ { "type": "string" @@ -43951,22 +45051,85 @@ "type": "null" } ], - "title": "Mode", - "description": "off, detect or recognize; left out, the mode stays as it is" + "title": "Summary" + }, + "link": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Link" + }, + "published_at": { + "type": "string", + "title": "Published At" + }, + "recording": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "Recording" + }, + "activity": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Activity" + }, + "categories": { + "anyOf": [ + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Categories" + }, + "origin": { + "anyOf": [ + { + "additionalProperties": true, + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Origin", + "description": "the routine run and workflow node that added it" }, - "pixelate": { + "by": { "anyOf": [ { - "type": "boolean" + "type": "string" }, { "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": "By" }, - "purpose": { + "created_at": { "anyOf": [ { "type": "string" @@ -43975,191 +45138,287 @@ "type": "null" } ], - "title": "Purpose", - "description": "why faces are recognised (required for recognize)" + "title": "Created At" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "id", + "feed", + "kind", + "guid", + "published_at" + ], + "title": "FeedItem" + }, + "FeedPublish": { + "properties": { + "recordings": { + "items": { + "type": "integer" + }, + "type": "array", + "maxItems": 200, + "title": "Recordings", + "description": "resources (and podcast episodes) to list" }, - "reprocess": { - "type": "boolean", - "title": "Reprocess", - "description": "queue face detection for this namespace's videos, documents and images", - "default": false + "activities": { + "items": { + "type": "string" + }, + "type": "array", + "maxItems": 200, + "title": "Activities", + "description": "timeline activities to list, by id" + }, + "texts": { + "items": { + "$ref": "#/components/schemas/FeedText" + }, + "type": "array", + "maxItems": 50, + "title": "Texts", + "description": "text items" } }, "additionalProperties": false, "type": "object", - "title": "FacesMode" + "title": "FeedPublish" }, - "FacesModeSet": { + "FeedPublished": { "properties": { - "ok": { - "type": "boolean", - "title": "Ok", - "default": true - }, - "jobs": { + "added": { "items": { "type": "integer" }, "type": "array", - "title": "Jobs", - "default": [] + "title": "Added", + "description": "the new items' ids" + }, + "already": { + "type": "integer", + "title": "Already", + "description": "how many were in the feed already" + }, + "refused": { + "items": { + "$ref": "#/components/schemas/FeedRefused" + }, + "type": "array", + "title": "Refused", + "description": "what can't go in this feed, and why" } }, "additionalProperties": true, "type": "object", - "title": "FacesModeSet" + "required": [ + "added", + "already", + "refused" + ], + "title": "FeedPublished" }, - "FacetCount": { + "FeedRefused": { "properties": { - "name": { + "what": { "type": "string", - "title": "Name" + "title": "What" }, - "count": { - "type": "integer", - "title": "Count", - "description": "matching moments" + "why": { + "type": "string", + "title": "Why" } }, "additionalProperties": true, "type": "object", "required": [ - "name", - "count" + "what", + "why" ], - "title": "FacetCount" + "title": "FeedRefused" }, - "FedoraStatus": { + "FeedSettings": { "properties": { - "enabled": { - "type": "boolean", - "title": "Enabled" - }, - "url": { + "title": { "anyOf": [ { - "type": "string" + "type": "string", + "maxLength": 200 }, { "type": "null" } ], - "title": "Url" + "title": "Title" }, - "root": { - "type": "string", - "title": "Root" + "description": { + "anyOf": [ + { + "type": "string", + "maxLength": 2000 + }, + { + "type": "null" + } + ], + "title": "Description" }, - "pending": { - "type": "integer", - "title": "Pending" + "author": { + "anyOf": [ + { + "type": "string", + "maxLength": 200 + }, + { + "type": "null" + } + ], + "title": "Author", + "description": "who a podcast app shows it's by (default Lens)" }, - "resources": { - "type": "integer", - "title": "Resources" + "language": { + "anyOf": [ + { + "type": "string", + "maxLength": 20 + }, + { + "type": "null" + } + ], + "title": "Language", + "description": "a language tag, like en or en-GB (default en)" }, - "last_sync": { + "category": { "anyOf": [ { - "type": "string" + "type": "string", + "maxLength": 60 }, { "type": "null" } ], - "title": "Last Sync" + "title": "Category", + "description": "an Apple Podcasts category (podcast feeds; default Education)" }, - "last_full": { + "explicit": { "anyOf": [ { - "type": "string" + "type": "boolean" }, { "type": "null" } ], - "title": "Last Full" + "title": "Explicit" }, - "last_counts": { + "image": { "anyOf": [ { - "additionalProperties": true, - "type": "object" + "type": "string", + "maxLength": 2000 }, { "type": "null" } ], - "title": "Last Counts" + "title": "Image", + "description": "artwork: an https:// address of a square picture" }, - "last_error": { + "max_items": { "anyOf": [ { - "type": "string" + "type": "integer", + "maximum": 500.0, + "minimum": 1.0 }, { "type": "null" } ], - "title": "Last Error" + "title": "Max Items", + "description": "how many items the feed lists, newest first (default 50)" }, - "full_requested": { - "type": "boolean", - "title": "Full Requested" + "kind": { + "anyOf": [ + { + "type": "string", + "enum": [ + "rss", + "podcast" + ] + }, + { + "type": "null" + } + ], + "title": "Kind", + "description": "rss lists anything; podcast lists items with audio, with Apple Podcasts' tags" } }, - "additionalProperties": true, + "additionalProperties": false, "type": "object", - "required": [ - "enabled", - "root", - "pending", - "resources", - "full_requested" - ], - "title": "FedoraStatus" + "title": "FeedSettings" }, - "FedoraSyncResult": { + "FeedText": { "properties": { - "sent": { - "type": "integer", - "title": "Sent" - }, - "files": { - "type": "integer", - "title": "Files" - }, - "unchanged": { - "type": "integer", - "title": "Unchanged" + "title": { + "anyOf": [ + { + "type": "string", + "maxLength": 200 + }, + { + "type": "null" + } + ], + "title": "Title" }, - "deleted": { - "type": "integer", - "title": "Deleted" + "summary": { + "anyOf": [ + { + "type": "string", + "maxLength": 4000 + }, + { + "type": "null" + } + ], + "title": "Summary", + "description": "the item's text" }, - "failed": { - "type": "integer", - "title": "Failed" + "link": { + "anyOf": [ + { + "type": "string", + "maxLength": 2000 + }, + { + "type": "null" + } + ], + "title": "Link", + "description": "an http or https address" }, - "errors": { - "items": { - "type": "string" - }, - "type": "array", - "title": "Errors" + "guid": { + "anyOf": [ + { + "type": "string", + "maxLength": 120 + }, + { + "type": "null" + } + ], + "title": "Guid", + "description": "what the item is about, so the same item isn't added twice" } }, - "additionalProperties": true, + "additionalProperties": false, "type": "object", - "required": [ - "sent", - "files", - "unchanged", - "deleted", - "failed", - "errors" - ], - "title": "FedoraSyncResult" + "title": "FeedText" }, "FieldCreate": { "properties": { diff --git a/threat-model.json b/threat-model.json index c9e859ae0..6703dcccc 100644 --- a/threat-model.json +++ b/threat-model.json @@ -6,7 +6,7 @@ "scope_subpath": null, "description": "Lens is a self-hosted archive for documents, recordings, photos and messages: it reads, transcribes, indexes and publishes them, and people search and chat over them. One operator (the instance admin) runs an instance for their own people: a FastAPI API, a Next.js web app that proxies the API and holds the sign-in session, and background workers, around one SurrealDB database, with content split into namespaces and per-namespace roles. Exposing an instance to the internet behind HTTPS (reverse proxy or Cloudflare tunnel) is supported. Only the instance admin (equivalent to host code execution) and the host operator are trusted; everyone else is trusted only as far as their role.", "confidence": { - "documented": 251, + "documented": 254, "inferred": 99 }, "components": [ @@ -137,6 +137,7 @@ "name": "optional", "entry_points": [ "POST /automations/hooks/{token} (an automation's webhook)", + "GET /feeds/public/{token}, /feeds/public/{token}/items/{item}/audio (a published feed)", "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)" @@ -539,6 +540,15 @@ "provenance": "documented", "source": "docs/automations.md \"No webhook exists until an automation with such a trigger is saved\"" }, + { + "entry_point": "GET /feeds/public/{token}, /feeds/public/{token}/items/{item}/audio (a published feed)", + "parameter": "token in the path, Range, If-None-Match", + "attacker_controllable": "yes", + "component": "optional", + "caller_must_enforce": "the person shares the address as a password; Lens finds the token by its hash, stops the old address when a new one is made, and lists only what the namespace's readers can read", + "provenance": "documented", + "source": "docs/feeds.md \"Private by default\"" + }, { "entry_point": "automations' params and prompts, POST /automations/preview and /automations/variables", "parameter": "template text, a draft automation, an activity id", @@ -971,6 +981,14 @@ "provenance": "documented", "source": "docs/authentication.md \"give read-only access to one asset's player and embed\"" }, + { + "property": "P-FEEDS", + "violation_symptom": "info-leak", + "severity_tier": "security", + "conditions": "a published feed's address opens that feed alone, read-only, with no session; only an editor of the namespace makes one; it lists only items whose resource or activity the readers of the feed's namespace can read, never a vault's, and a namespace made a vault stops its feeds; the token is found by its hash, and rotating or deleting the feed stops the old address at once; text in an item cannot add markup to a reader", + "provenance": "documented", + "source": "docs/feeds.md \"Private by default\"" + }, { "property": "P-AUTH-REQ", "violation_symptom": "integrity-bypass", diff --git a/threat-model.md b/threat-model.md index e938f05aa..215a2038d 100644 --- a/threat-model.md +++ b/threat-model.md @@ -302,6 +302,7 @@ classified by gate only *(inferred, Q8)*; unread modules are listed in Q34. | Python code tools, shipped and admin-created templates, workflows, pipelines, routines | Python, Jinja source, regexes | admin only | callback/code | admin is trusted | *(maintainer, 2026-10)* | | MQTT 1883, syslog 5514, `POST /sensors/push/{token}/{stream}` | payloads, hub logins, token in the path | yes, once enabled | data, size/rate, x-credential, x-prompt-injection | admin enables; operator firewalls; readings, alert patterns and new devices reach automations as outside text (`lens.untrusted`) | *(documented, docs/sensors.md "Sensors are off until an admin turns them on")* | | `POST /automations/hooks/{token}` (an automation's webhook) | body (JSON, a form's text fields or text), query, Standard Webhooks headers, token in the path | yes, anyone given the address | data, size/rate, x-credential, x-prompt-injection | no hook exists until an automation with a webhook trigger is saved; the token is 256 random bits kept only as a hash, and revoked with its trigger; 64 KB and 60 calls a minute per hook; a signature, when sent (or required by a `signed` hook), must match the hook's sealed secret within five minutes; a retried message id is logged once; what was sent is outside text (`lens.untrusted`), wrapped as data in prompts | *(documented, docs/automations.md "No webhook exists until an automation with such a trigger is saved")* | +| `GET /feeds/public/{token}`, `/feeds/public/{token}/items/{item}/audio` (a published feed) | token in the path, `Range`, `If-None-Match` | yes, anyone given the address | x-credential, resource-name | no feed exists until an editor of a namespace makes one; the token is 256 random bits, found by its hash and sealed with the server key so the namespace's readers see the address again, and a new one stops the old at once; the address reads that feed alone, whose items are bounded by who reads its namespace (P-FEEDS), and `Range` reads only the audio of an item the feed lists | *(documented, docs/feeds.md "Private by default")* | | automations' params and prompts, `POST /automations/preview` and `/automations/variables` | template text, a draft automation, an activity id | yes, anyone signed in (preview, the picker); the namespace editors who manage an automation (its params) | callback/code (declarative), data, x-prompt-injection | rendered in the Jinja sandbox (2 MB of output, `*` and `**` guarded; Q23); previews read only activities, namespaces and automations the person may see; prompts mark outside text as data | *(documented, docs/automations.md "The variable picker and preview")* | | NFS share (port 12049 on the host, 2049 in the worker) | NFS and MOUNT RPCs, client address | yes, once enabled, from `nfs.allowed_networks` | data, x-network-source | admin enables and picks the account; operator firewalls | *(documented, docs/file-shares.md "NFS has no login")* | | SMB share (port 1445 on the host, 4445 in the worker) | SMB2 requests, NTLM sign-in with a file access key, client address | yes, once enabled, from `smb.allowed_networks` | data, x-credential, x-network-source | admin enables; operator firewalls | *(documented, docs/smb.md "What keeps it safe")* | @@ -448,6 +449,7 @@ stored text for the consumer's format. | Audit and activity log | `auth.audit`, `activity.py` | actor, action, target; never prompt or file content | completeness or tamper evidence | *(documented, docs/activity.md "aren't logged here")* | | `GET /auth/status` | Identity | whether setup is pending and passwords are on, to anyone | that an unset-up instance is hidden | *(documented, docs/authentication.md endpoint table "`GET /api/v1/auth/status`")* | | Share link failure page | `/embed`, `/s` | the same 410 for expired, revoked or missing | that a 410 says anything about the asset | *(documented, docs/authentication.md "the same whatever went wrong")* | +| Published feeds (`GET /feeds/public/{token}`: RSS and podcast XML, items' audio) | `domain/syndication.py` | titles, summaries, episode outlines and activity summaries as they are now, escaped for the XML and again for readers that render descriptions as HTML; only items whose resource or activity the feed's namespace readers can read (P-FEEDS); `itunes:block`, `podcast:locked` and `X-Robots-Tag` ask directories and crawlers to keep out | that the address stays private once shared (it is a bearer credential until rotated), or that a directory or crawler honours the request to keep out | *(documented, docs/feeds.md "Private by default")* | ## 1.9 Assumptions about dependencies @@ -514,6 +516,7 @@ Paths in the Voided by column are relative to `fastapi_backend/app/`. Searches c | P-NO-INJECTION | Request text does not inject into database queries, a shell or the processing tools. | integrity-bypass | security-critical | *(documented, SECURITY.md "injection into the database queries, the shell")* | Voided by: nothing. Shell: `grep -rnE "shell=True\|os\.system\|os\.popen" fastapi_backend/app` — one hit, a deny-list string in `domain/code_tools.py`. Database binding is per call site: `grep -rnE 'f"[^"]*(SELECT\|UPDATE\|DELETE\|CREATE\|UPSERT)[^"]*\{' fastapi_backend/app/domain fastapi_backend/app/api` — 151 hits; about 35 read, all code-built fragments (Q8). `grep -rn protocol_whitelist fastapi_backend/app` — 0 hits (Q21). | | P-MEDIA-LINK | Media, frames, documents and reports open without a session only through a link the server signed for that path, or a live share link. Text people or models write is never signed. | info-leak | security-critical | *(documented, docs/architecture.md "is never signed")* | Voided by: Knowing `ACCESS_SECRET_KEY` signs any path — `core/security.py:43`; dev compose key — `docker-compose.yml:24`. Lifetime `MEDIA_URL_EXPIRE_SECONDS` — `config.py:30`. Report pages sign every asset of the namespace — `api/pages.py:140-141`. Signing is limited to allow-listed fields — `api/media.py:25-30`. | | P-SHARE | A share link opens one asset, read-only. It expires and can be revoked. Only hashes are stored. A dead link answers the same 410 whatever went wrong. | integrity-bypass | security-critical | *(documented, docs/authentication.md "give read-only access to one asset's player and embed")* | Voided by: Liveness plus asset match only — `domain/auth.py:441-444`; `?s=` routes — `api/deps.py:252` (Q7). | +| P-FEEDS | A published feed's address opens that feed alone, read-only, with no session: the feed's XML and the audio of items it lists. Only an editor of the namespace makes a feed, and what it lists is bounded by who already reads that namespace: an item's resource or activity is in the namespace, or in one every reader of the feed's namespace reads too, never a vault's, and a namespace made a vault stops its feeds. The token is found by its hash; rotating or deleting the feed stops the old address at once. Text in an item cannot add markup to a reader. | info-leak | security-critical | *(documented, docs/feeds.md "Private by default")* | Voided by: the token is sealed with the server key, not only hashed, so the namespace's readers (and whoever holds `secret.key`) see the address again — `domain/syndication.py` `token_of`; anyone given the address reads the feed until it is rotated; editors choose what goes in, and a resource's title and summary show as they are now, so an edit after publishing shows; the fit is by namespace roles (`domain/syndication.py` `Fit`), not per-asset grants, so an asset later closed by access level still shows while its namespace fits. | | P-AUTH-REQ | A request is authenticated only if its bearer verifies and the account and session are live. Sign-out and disabling take effect at once, for every token kind. Revoking an app grant or API token ends its tokens at once. | integrity-bypass | security-critical | *(documented, docs/authentication.md "Every request checks that the account is still active")* | Voided by: Liveness checked per request — `api/deps.py:92`; JWT algorithm from `ALGORITHM` — `config.py:27`; dev secrets — `docker-compose.yml:24`. No bypass flag: `grep -rniE "disable_auth\|skip_auth\|no_auth\|auth_bypass\|AUTH_DISABLED\|ALLOW_ANON\|DEV_MODE" fastapi_backend/app nextjs-frontend/lib nextjs-frontend/auth.ts nextjs-frontend/proxy.ts docker-compose*.yml install.sh` — 0 hits. | | P-REMOVE | Removing an account ends every way it signs in at once (sessions, passkeys, sign-in links, connected accounts, API tokens, app grants, IIIF tokens) and takes every role, collection role and recording permission. Its email can make a new account, which inherits nothing. Admins only; never yourself, never the Matterbridge account, never the last passkey into a vault unless the admin says its files may be lost. | integrity-bypass | security-critical | *(documented, docs/authentication.md "Removing someone")* | Voided by: the account row stays as a marker with an `.invalid` email — `domain/auth.py` `remove_account`; shared notes, views and comments keep its id. | | P-BEARER-ONLY | `/api/v1` takes bearer tokens only, never cookies. The IIIF authorization flow and the web app's NextAuth handlers are the cookie surfaces. | integrity-bypass | security-critical | *(documented, docs/architecture.md "so there is no CSRF surface")* | Voided by: IIIF auth cookies — `api/iiif.py:232`, `api/iiif.py:333`; external-login state cookie — `api/v1/routes/external.py:34`. | diff --git a/threat-model.yaml b/threat-model.yaml index b31e307a0..33e30d6e2 100644 --- a/threat-model.yaml +++ b/threat-model.yaml @@ -2,10 +2,10 @@ # Authority order: prose > yaml > json. Regenerate whenever the prose changes. schema: threat-model-sidecar/v2 project: lens -prose_version: "threat-model.md@sha256:7914ab4b9c598440e8026ac0db1b968f42da60369831cac0884d9afc7ef42d60" +prose_version: "threat-model.md@sha256:aba4ed7e1c5f69e8ccb22b8a6a9672c1ac018a9043b1df51b7157193fef000fc" model_status: under-review triage_policy: strict -confidence: {documented: 205, maintainer: 46, inferred: 91, assumption: 8} +confidence: {documented: 208, maintainer: 46, inferred: 91, assumption: 8} generation: model: "Claude Opus 5.5 (claude-opus-5-5)" @@ -465,6 +465,16 @@ entry_points: obligation_id: keep-hook-addresses-secret caller_must_enforce: "the person keeps the address and secret to the services that call it; Lens keeps the token hashed, caps size and rate, checks signatures sent, and treats what was sent as outside text" provenance: {kind: documented, source: 'docs/automations.md "No webhook exists until an automation with such a trigger is saved"'} + - id: "GET /feeds/public/{token}, /feeds/public/{token}/items/{item}/audio (a published feed)" + component: optional + parameters: + - name: "token in the path, Range, If-None-Match" + attacker_controllable: true + x-condition: "anyone given the address, once an editor of a namespace makes a feed" + control_kinds: [x-credential, resource-name] + obligation_id: keep-feed-addresses-secret + caller_must_enforce: "the person shares the address as a password; Lens finds the token by its hash, stops the old address when a new one is made, and lists only what the namespace's readers can read" + provenance: {kind: documented, source: 'docs/feeds.md "Private by default"'} - id: "automations' params and prompts, POST /automations/preview and /automations/variables" component: optional parameters: @@ -878,6 +888,16 @@ outputs: - {id: inv-share-uniform-410, statement: "a dead link answers the same 410 whatever went wrong", property_id: P-SHARE, provenance: {kind: documented, source: 'docs/authentication.md "the same whatever went wrong"'}} downstream_must_not_assume: - {id: dmna-410-meaningful, statement: "that a 410 says anything about the asset", provenance: {kind: documented, source: 'docs/authentication.md "the same whatever went wrong"'}} + - component: optional + channel: "Published feeds (GET /feeds/public/{token}: RSS and podcast XML, items' audio; domain/syndication.py)" + taint: same-as-input + x-taint-note: "titles, summaries, episode outlines and activity summaries as they are now, escaped for the XML and again for readers that render descriptions as HTML; only items the feed's namespace readers can read; itunes:block, podcast:locked and X-Robots-Tag ask directories and crawlers to keep out" + taint_provenance: {kind: documented, source: 'docs/feeds.md "Private by default"'} + invariants: + - {id: inv-feed-bounded-by-namespace, statement: "a feed lists only what the readers of its namespace can read, never a vault's", property_id: P-FEEDS, provenance: {kind: documented, source: 'docs/feeds.md "Private by default"'}} + downstream_must_not_assume: + - {id: dmna-feed-address-private, statement: "that the address stays private once shared: it is a bearer credential until rotated", provenance: {kind: documented, source: 'docs/feeds.md "Private by default"'}} + - {id: dmna-feed-directories-keep-out, statement: "that a directory or crawler honours the request to keep out", provenance: {kind: documented, source: 'docs/feeds.md "Private by default"'}} # ---------------------------------------------------------------- §1.10 adversaries: @@ -1402,6 +1422,14 @@ properties_claimed: violation_symptoms: [integrity-bypass] x-voided-by: "liveness plus asset match only (domain/auth.py:441-444); ?s= routes (api/deps.py:252, Q7)" provenance: {kind: documented, source: 'docs/authentication.md "give read-only access to one asset''s player and embed"'} + - id: P-FEEDS + kind: confidentiality + components: [authz, optional] + tier: security-critical + conditions: "a published feed's address opens that feed alone, read-only, with no session; only an editor of the namespace makes one; it lists only items whose resource or activity the readers of the feed's namespace can read, never a vault's, and a namespace made a vault stops its feeds; the token is found by its hash, and rotating or deleting the feed stops the old address at once; text in an item cannot add markup to a reader" + violation_symptoms: [info-leak] + x-voided-by: "the token is sealed with the server key, not only hashed, so the namespace's readers and whoever holds secret.key see the address again (domain/syndication.py token_of); anyone given the address reads the feed until it is rotated; editors choose what goes in, and a resource's title and summary show as they are now; the fit is by namespace roles (domain/syndication.py Fit), not per-asset grants" + provenance: {kind: documented, source: 'docs/feeds.md "Private by default"'} - id: P-AUTH-REQ kind: authentication components: [web, identity]