{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/patricia-app/json-schema/patricia-app-asset-summary-schema.json",
  "title": "AssetSummary",
  "description": "One library entry as a listing row (metadata only).",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/patricia-app-openapi.json#/components/schemas/AssetSummary",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
    },
    "name": {
      "type": "string",
      "title": "Name",
      "description": "The workspace's handle for the file. UNTRUSTED text: render escaped."
    },
    "category": {
      "type": "string",
      "enum": [
        "document",
        "media",
        "app"
      ],
      "title": "Category",
      "description": "Which library this file lives in: 'document' or 'media'."
    },
    "kind": {
      "type": "string",
      "enum": [
        "app",
        "audio",
        "deck",
        "docx",
        "file",
        "html",
        "image",
        "markdown",
        "pdf",
        "slides",
        "spreadsheet",
        "video"
      ],
      "title": "Kind",
      "description": "What sort of file this is."
    },
    "content_type": {
      "type": "string",
      "title": "Content Type",
      "description": "The current version's media type, e.g. 'application/pdf'."
    },
    "byte_size": {
      "type": "integer",
      "title": "Byte Size",
      "description": "The current version's size in bytes."
    },
    "current_version": {
      "type": "integer",
      "title": "Current Version",
      "description": "The newest version number (versions count from 1)."
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At",
      "description": "When the file last changed (UTC)."
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Description",
      "description": "What the file is for, as its editors wrote it; shown on a dashboard's card. UNTRUSTED text: render escaped. Null when nobody described it."
    },
    "created_by_run_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "title": "Created By Run Id",
      "description": "The Patricia run that created this file. Null when no run is recorded for it: a person uploaded it, or it was stored before Patricia began recording runs. Later versions can come from other runs, so read each version's own created_by_run_id for those."
    },
    "favorite": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Favorite",
      "description": "Whether the workspace marked this file a favourite (the Liked filter shows these). The server always sends it; the default exists for the same temporary fixture-compatibility reason the module docstring records for created_by_run_id."
    },
    "thumbnail_status": {
      "type": "string",
      "enum": [
        "ready",
        "pending",
        "unavailable"
      ],
      "title": "Thumbnail Status",
      "description": "Whether this file has a grid preview. 'ready' means GET /assets/{id}/thumbnail serves it; 'pending' means one is being prepared, ask again shortly; 'unavailable' means the type icon is the answer (no preview exists for this file type, or this file could not be rendered).",
      "default": "unavailable"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At",
      "description": "When the file was first added to the workspace (UTC)."
    },
    "author": {
      "$ref": "#/$defs/AssetAuthor",
      "description": "Who made this file: the 'Made by' column."
    },
    "owner": {
      "$ref": "#/$defs/AssetOwner",
      "description": "Who owns this file and decides who can open it. It is the creator until the owner hands the file to a teammate. 'author' stays the creator."
    },
    "folder": {
      "anyOf": [
        {
          "$ref": "#/$defs/AssetFolderRef"
        },
        {
          "type": "null"
        }
      ],
      "description": "The folder this file is filed under, or null when it is not filed into one."
    },
    "is_owner": {
      "type": "boolean",
      "title": "Is Owner",
      "description": "Whether the caller is the person who owns this file.",
      "default": false
    },
    "requires_access_acknowledgement": {
      "type": "boolean",
      "title": "Requires Access Acknowledgement",
      "description": "Whether opening this file requires an access_acknowledgement UUID and a durable audit receipt.",
      "default": false
    },
    "visibility": {
      "type": "string",
      "enum": [
        "private",
        "team",
        "external"
      ],
      "title": "Visibility",
      "description": "Who can read this file. 'private' — only the owner, plus workspace admins. 'team' — everyone in the workspace (the default). 'external' — everyone in the workspace, and it may also be shared outside through a link. A file you can see at all is one you may read; the level tells you who ELSE can.",
      "default": "team"
    },
    "workspace_role": {
      "type": "string",
      "enum": [
        "view",
        "edit"
      ],
      "title": "Workspace Role",
      "description": "What everyone in the workspace may do with this file or dashboard while it is open to the workspace or to anyone with the link: 'view' reads it, 'edit' also changes it. A Workspace Viewer can only view, whatever this says."
    },
    "shared_via_folder_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Shared Via Folder Name",
      "description": "The name of the folder making this file reachable beyond its own visibility level, when a live folder share link is why — for a private file, why anybody else in the workspace can read it; for any file, why anybody outside the workspace holding that folder's link can too. Null when no folder link is why this file is reachable."
    },
    "can_edit": {
      "type": "boolean",
      "title": "Can Edit",
      "description": "Whether YOU may change this file: save a new version, restore an older one, rename it, or move it to another folder. Computed server-side by the same may_mutate rule every mutation route enforces, so a control enabled by this flag is never refused by that request. A shared folder can make a private file READABLE without making it EDITABLE, so this answers the write question on its own — never inferred from visibility or from shared_via_folder_name.",
      "default": false
    },
    "app_overview": {
      "anyOf": [
        {
          "$ref": "#/$defs/AppOverview"
        },
        {
          "type": "null"
        }
      ],
      "description": "Set only on dashboard rows of the library list (GET /assets); null on every other file and on every other response that returns this summary. It carries the field names and meanings of the dashboard read (GET /apps/{id}). Null for a dashboard whose read would refuse this caller or whose inputs cannot be read, so a card never shows more than that read would."
    },
    "can_open_in_canva": {
      "type": "boolean",
      "title": "Can Open In Canva",
      "description": "Whether YOU may open this media file as a Canva design. Requires edit access to THIS file, a supported image type, a live Canva connection, and the Canva provider in this deployment. Edit access is the same per-file rule this row reports as `can_edit`, because sending a file out to a third-party account is an export. Computed server-side by the same rule POST /assets/{id}/canva-design enforces, so a menu item enabled by this flag is never refused by that request.",
      "default": false
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "id",
    "name",
    "category",
    "kind",
    "content_type",
    "byte_size",
    "current_version",
    "updated_at",
    "workspace_role"
  ],
  "$defs": {
    "AppOverview": {
      "properties": {
        "source": {
          "type": "string",
          "title": "Source"
        },
        "source_label": {
          "type": "string",
          "title": "Source Label"
        },
        "result": {
          "anyOf": [
            {
              "$ref": "#/$defs/AppOverviewResult"
            },
            {
              "type": "null"
            }
          ]
        },
        "fetched_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Fetched At"
        },
        "result_availability": {
          "type": "string",
          "enum": [
            "available",
            "missing",
            "needs_reconnecting"
          ],
          "title": "Result Availability"
        },
        "content_availability": {
          "type": "string",
          "enum": [
            "available",
            "missing",
            "deleted",
            "unknown"
          ],
          "title": "Content Availability"
        },
        "updating": {
          "type": "boolean",
          "title": "Updating"
        },
        "sources": {
          "items": {
            "$ref": "#/$defs/AppOverviewSource"
          },
          "type": "array",
          "title": "Sources"
        }
      },
      "type": "object",
      "required": [
        "source",
        "source_label",
        "result",
        "fetched_at",
        "result_availability",
        "content_availability",
        "updating",
        "sources"
      ],
      "title": "AppOverview",
      "description": "What a dashboard card shows, with the field names and meanings of ``AppMetadata``.\n\nIt holds no result data, actions or settings, and a listed row carries none where the dashboard read refuses."
    },
    "AppOverviewConnection": {
      "properties": {
        "app_label": {
          "type": "string",
          "title": "App Label"
        }
      },
      "type": "object",
      "required": [
        "app_label"
      ],
      "title": "AppOverviewConnection"
    },
    "AppOverviewResult": {
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "succeeded",
            "partial",
            "failed",
            "uncertain"
          ],
          "title": "Status"
        }
      },
      "type": "object",
      "required": [
        "status"
      ],
      "title": "AppOverviewResult"
    },
    "AppOverviewSource": {
      "properties": {
        "name": {
          "type": "string",
          "title": "Name"
        },
        "status": {
          "type": "string",
          "enum": [
            "available",
            "missing",
            "updating",
            "waiting_approval",
            "failed",
            "needs_reconnecting",
            "too_large"
          ],
          "title": "Status"
        },
        "fetched_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Fetched At"
        },
        "provider_key": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Provider Key"
        },
        "provider_label": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Provider Label"
        },
        "connection": {
          "anyOf": [
            {
              "$ref": "#/$defs/AppOverviewConnection"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "type": "object",
      "required": [
        "name",
        "status"
      ],
      "title": "AppOverviewSource"
    },
    "AssetAuthor": {
      "properties": {
        "actor_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "Actor Id",
          "description": "The workspace member credited with this file. The key the author filter takes; null when no person is recorded (an API-key upload, or a run with no requester)."
        },
        "display_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Display Name",
          "description": "That member's name. Null when nothing resolves — render 'Patricia' or 'Someone'."
        },
        "made_by_patricia": {
          "type": "boolean",
          "title": "Made By Patricia",
          "description": "Whether a Patricia run created this file. True with a display_name reads 'Patricia for <name>'; true without one reads 'Patricia'; false reads the name alone.",
          "default": false
        }
      },
      "additionalProperties": false,
      "type": "object",
      "title": "AssetAuthor",
      "description": "Who made a file, as a person reads it — the designs' \"Made by\" column and detail row.\n\nTwo fields answer two different questions and neither substitutes for the other.\n``display_name`` is WHOSE work this is; ``made_by_patricia`` is whether Patricia's hands did it.\nA file Patricia generated because Ricardo asked her to carries both — the dashboard renders\n\"Patricia for Ricardo\" — and that is the ordinary case, not an edge one.\n\n``display_name`` is ``null`` only when nothing resolves: an API-key upload (not a person), a\nheadless cron run with no requester, or a workspace member whose chat profile was never\nenriched. It is NEVER a raw platform id — it comes from\n:meth:`~repositories.actor.ActorRepository.resolve_actor_displays`, the one resolver every\nhuman-facing render site shares, which humanizes a placeholder id back into ``null`` here."
    },
    "AssetFolderRef": {
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "name": {
          "type": "string",
          "title": "Name",
          "description": "The folder's label. UNTRUSTED text: render escaped."
        },
        "path": {
          "type": "string",
          "title": "Path",
          "description": "The folder's full path (e.g. 'Clients/Acme'). UNTRUSTED text: render escaped. The detail panel shows this rather than the bare name, because several folders can share a name.",
          "default": ""
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "title": "AssetFolderRef",
      "description": "The folder a file is filed under — id to navigate to, name and path to show."
    },
    "AssetOwner": {
      "properties": {
        "actor_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "Actor Id",
          "description": "The workspace member who owns this file. Null when no person is recorded."
        },
        "display_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Display Name",
          "description": "That member's name. Null when nothing resolves."
        }
      },
      "additionalProperties": false,
      "type": "object",
      "title": "AssetOwner",
      "description": "Who owns a file: the person who decides who can open it. Not always the person who made it."
    }
  }
}