Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export default defineConfig({
{ label: 'Cells', slug: 'reference/cells' },
{ label: 'Layers', slug: 'reference/layers' },
{ label: 'Variables', slug: 'reference/variables' },
{ label: 'Undo / Redo', slug: 'reference/undo-redo' },
{ label: 'Assets & Content Resources', slug: 'reference/content-resources' },
{ label: 'Proof of Genesis Backups', slug: 'reference/proof-of-genesis' },
{ label: 'Trigger + Poll a Generation', slug: 'reference/generations' },
Expand Down
14 changes: 14 additions & 0 deletions public/llms-full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,20 @@ POST /v1/vidsheet/{id}/import_global_variables?agent_id={id} (multipart XLS
GET /v1/vidsheet/global_variables_template (XLSX template download)
```

## Undo / Redo (change-set history)

Every grouped write to a vidsheet (rows/columns/cells/layers edited in one request) is
recorded as a change set on an undo/redo stack. List recent change sets, see the next-to-undo
one, and undo/redo. Pass `change_set_id` to target a specific change set instead of the most
recent one. `409 conflict` = the sheet changed underneath you β€” re-fetch and retry.

```
GET /v1/vidsheet/{id}/operations?agent_id={id}&limit={1-100}&include_undone={bool} β†’ { change_sets: [...] } newest first
GET /v1/vidsheet/{id}/operations/last?agent_id={id} β†’ { change_set: {...}|null }
POST /v1/vidsheet/{id}/operations/undo?agent_id={id} body { change_set_id? } β†’ { change_set_id, undone:[...], next_undoable } (422 nothing_to_undo)
POST /v1/vidsheet/{id}/operations/redo?agent_id={id} body { change_set_id? } β†’ { change_set_id, redone:[...], next_undoable } (422 nothing_to_redo)
```

## Content Resources (upload and manage assets)

```
Expand Down
6 changes: 6 additions & 0 deletions public/llms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,12 @@ GET /v1/vidsheet/:id/global_variables?agent_id=
POST /v1/vidsheet/:id/import_global_variables?agent_id= (XLSX)
GET /v1/vidsheet/global_variables_template (download template)

# Undo / Redo (change-set history β€” undo/redo a grouped edit)
GET /v1/vidsheet/:id/operations?agent_id=&limit=&include_undone= β€” recent undoable change sets (newest first)
GET /v1/vidsheet/:id/operations/last?agent_id= β€” next-to-undo change set (or null)
POST /v1/vidsheet/:id/operations/undo?agent_id= β€” undo last (or {change_set_id}); 422 nothing_to_undo, 409 undo_conflict
POST /v1/vidsheet/:id/operations/redo?agent_id= β€” redo last undone (or {change_set_id}); 422 nothing_to_redo, 409 redo_conflict

# Content Resources & Assets
GET /v1/content_resources?agent_id=&type=&page=
POST /v1/content_resources?agent_id= (multipart)
Expand Down
221 changes: 221 additions & 0 deletions public/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1581,6 +1581,205 @@ paths:
type: string
format: binary

# ── Undo / redo (change-set history) ───────────────────────
/vidsheet/{sheet_id}/operations:
get:
operationId: listVidsheetOperations
x-phase: edit
summary: List undo/redo change sets
description: |
Returns the recent undoable change sets for a vidsheet (the undo/redo history),
newest-first. Each change set is a grouped, atomic write (rows/columns/cells/layers
edited together in one request). Set `include_undone=true` to also list change sets
that have already been undone.
tags: [Sheets]
parameters:
- $ref: '#/components/parameters/AgentId'
- $ref: '#/components/parameters/SheetId'
- name: limit
in: query
required: false
schema:
type: integer
minimum: 1
maximum: 100
default: 20
description: Max change sets to return (1-100, default 20).
- name: include_undone
in: query
required: false
schema:
type: boolean
default: false
description: Include already-undone change sets (default false).
responses:
'200':
description: Recent change sets
content:
application/json:
schema:
type: object
properties:
change_sets:
type: array
items:
$ref: '#/components/schemas/ChangeSet'
'401':
$ref: '#/components/responses/Unauthorized'
'422':
description: Project not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'

/vidsheet/{sheet_id}/operations/last:
get:
operationId: getLastVidsheetOperation
x-phase: edit
summary: Get the next-to-undo change set
description: |
Returns the single next-to-undo change set for a vidsheet β€” what the undo
button would take back. `{change_set: null}` when the undo stack is empty.
Cheaper than `GET /operations` when you only need the top of the undo stack.
tags: [Sheets]
parameters:
- $ref: '#/components/parameters/AgentId'
- $ref: '#/components/parameters/SheetId'
responses:
'200':
description: Next-to-undo change set (or null)
content:
application/json:
schema:
type: object
properties:
change_set:
allOf:
- $ref: '#/components/schemas/ChangeSet'
nullable: true
'401':
$ref: '#/components/responses/Unauthorized'
'422':
description: Project not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'

/vidsheet/{sheet_id}/operations/undo:
post:
operationId: undoVidsheetOperation
x-phase: edit
summary: Undo the last change set
description: |
Undoes the most recent undoable change set (or a specific one by `change_set_id`).
Returns the operations that were undone plus the new next-to-undo change set.
`nothing_to_undo` (422) when the stack is empty; `undo_conflict` (409) means the
vidsheet changed underneath you β€” refresh the engine and retry.
tags: [Sheets]
parameters:
- $ref: '#/components/parameters/AgentId'
- $ref: '#/components/parameters/SheetId'
requestBody:
required: false
content:
application/json:
schema:
type: object
properties:
change_set_id:
type: string
description: Undo this specific change set instead of the most recent undoable one.
responses:
'200':
description: Change set undone
content:
application/json:
schema:
type: object
properties:
change_set_id:
type: string
undone:
type: array
items:
$ref: '#/components/schemas/ChangeSet'
next_undoable:
allOf:
- $ref: '#/components/schemas/ChangeSet'
nullable: true
'401':
$ref: '#/components/responses/Unauthorized'
'409':
description: Undo conflict β€” refresh the engine and retry
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'422':
description: Nothing to undo, or project not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'

/vidsheet/{sheet_id}/operations/redo:
post:
operationId: redoVidsheetOperation
x-phase: edit
summary: Redo the last undone change set
description: |
Redoes the most recently undone change set (or a specific one by `change_set_id`).
Re-applies something just undone. `nothing_to_redo` (422) when there is nothing to
redo; `redo_conflict` (409) β€” refresh the engine and retry.
tags: [Sheets]
parameters:
- $ref: '#/components/parameters/AgentId'
- $ref: '#/components/parameters/SheetId'
requestBody:
required: false
content:
application/json:
schema:
type: object
properties:
change_set_id:
type: string
description: Redo this specific change set instead of the most recently undone one.
responses:
'200':
description: Change set redone
content:
application/json:
schema:
type: object
properties:
change_set_id:
type: string
redone:
type: array
items:
$ref: '#/components/schemas/ChangeSet'
next_undoable:
allOf:
- $ref: '#/components/schemas/ChangeSet'
nullable: true
'401':
$ref: '#/components/responses/Unauthorized'
'409':
description: Redo conflict β€” refresh the engine and retry
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'422':
description: Nothing to redo, or project not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'

# ── Automation ─────────────────────────────────────────────
/agents/{agent_id}/automation_config:
get:
Expand Down Expand Up @@ -4968,6 +5167,28 @@ components:
type: string
description: Machine-readable error code.

ChangeSet:
type: object
description: |
A grouped, atomic vidsheet change set on the undo/redo stack. Each change set
bundles the operations (row/column/cell/layer writes) from a single request so
they can be walked back or re-applied together.
properties:
change_set_id:
type: string
description: Stable ID of this change set. Pass to undo/redo to target a specific one.
undone:
type: boolean
description: Whether this change set has been undone (true) or is still applied (false).
summary:
type: string
description: Short human-readable label for the change set (e.g. "Updated 3 cells").
operations:
type: array
description: The individual operations grouped in this change set.
items:
type: object

# ── Agent Core schemas ──────────────────────────────────
# Flat schema β€” every field name mirrors the public Agent Core setup fields.
AgentCore:
Expand Down
9 changes: 9 additions & 0 deletions src/content/docs/reference/endpoints-index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,15 @@ All endpoints authenticate with `X-API-Key: <your-PAT>` or `Authorization: Beare
| POST | /v1/vidsheet/:id/import_global_variables | edit |
| GET | /v1/vidsheet/global_variables_template | edit |

## Undo / Redo

| Method | Path | Phase |
|--------|------|-------|
| GET | /v1/vidsheet/:id/operations | edit |
| GET | /v1/vidsheet/:id/operations/last | edit |
| POST | /v1/vidsheet/:id/operations/undo | edit |
| POST | /v1/vidsheet/:id/operations/redo | edit |

## Content Resources & Assets

| Method | Path | Phase |
Expand Down
Loading