Skip to content
Merged
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
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,9 @@ listed under [In progress](#in-progress), and what comes next under [Planned](#p
more than what set it off asks first, until you let it run on its own: on the Approvals page or, for a change inside
Lens, with a yes in the chat it told you in; agents can decline an approval but never give one. Each automation has
limits and budgets, and agents make, try and run them over MCP and in the assistant, or draft one from a sentence. An
automation's workflow is drawn and tried on the workflow canvas, with its actions in the palette; the studio's
builder is planned. ([Processing](docs/processing.md#workflows-and-the-canvas),
automation's workflow is drawn and tried on the workflow canvas, with its actions in the palette, and the studio
lists your automations and builds one in When, If and Then, tested on a recent activity before you save it.
([Processing](docs/processing.md#workflows-and-the-canvas),
[converting assets](docs/processing.md#converting-assets), [notifications](docs/notifications.md),
[automations](docs/automations.md), [approvals](docs/automations.md#approvals), [schedules](docs/schedules.md),
[timeline](docs/timeline.md); [checks](docs/requirements.md#automate-it))
Expand Down Expand Up @@ -269,7 +270,7 @@ These are open pull requests, not yet part of Lens:

Next, and not in a pull request yet; each links to where it is tracked:

- **The automations studio:** a When, If and Then builder for automations, with their runs and costs, in the web app
- **The automations studio:** each automation's runs, what's coming up, its variables and its costs, in tabs
([automations](docs/automations.md)).
- **Timeline:** what each item caused, and Approve and Decline on waiting approvals ([timeline](docs/timeline.md)).
- **Notes:** nesting a note under its project or area without a click, pages in the graph, and wiki addresses for
Expand Down
4 changes: 2 additions & 2 deletions ci/clicks/journeys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,8 @@ export const JOURNEYS = [
from: "/",
async run(ctx) {
const { page, meter } = ctx;
// routines are on the Schedules page (everything on a clock), which has New routine for admins
await go(ctx, "Schedules");
// routines open from Automations (and its Schedules tab), which has New routine at the top for admins
await go(ctx, "Automations");
await meter.click(page.getByRole("main").getByRole("link", { name: "New routine" }), "New routine");
await page.getByRole("textbox", { name: "Name" }).waitFor(); // named for you
await page.waitForFunction(() => document.activeElement?.tagName === "INPUT");
Expand Down
37 changes: 36 additions & 1 deletion docs/automations.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,40 @@ merged is called built.
| Running automations: following the stream, limits, budgets, runs as `automation.ran`, trying and running now, the API (`app/domain/automations.py`) | built |
| Automations for agents: the MCP tools and the assistant's, switching on and running now by approval | built |
| Describing an automation in words: a draft from a sentence (`POST /api/v1/automations/draft`) | built |
| The studio | planned |
| The studio: the list at `/automations` and the When, If and Then builder, with a test panel ([The studio](#the-studio)) | built |
| The studio's tabs for an automation's runs, what's coming up, its variables and its costs | planned |

## The studio

Automations (under Automate in the nav) lists every automation you can see. [Schedules](schedules.md), everything
that runs on a clock, is its other tab, so both share one row in the nav; for admins, Routines and New routine are at
the top of both. Each row reads its triggers in words
(“Email received”, where the subject contains “trip”), and shows how its last run went, its runs today, the actions
waiting for your pick (a link to Approvals), what it cost this month and when it runs next. The switch turns it on
or off. Its menu has Run now, Duplicate (a copy, switched off) and Delete, which you undo from its toast rather than
confirm first.

New automation opens the builder, with the cursor in **Describe it in words**: type a sentence ("when an email about
a school trip arrives, tell me") and press Enter, and the model fills the builder in, saying what it left out. Or
build it yourself:

- **When**: one card per trigger. An activity kind has **Only when** rows (a field, a test that suits its type and
a value); a schedule has presets or a cron line, its time zone and its next few times; a time is a date and time;
a webhook's address shows once you save. With two or more triggers, the join line says whether any one of them
starts it or it waits for all of them.
- **If**: rows tested on what happened, all or any of them, with the fields of the variable catalog to pick from.
- **Then**: one card per action, in order. Each card's settings come from the action's params; typing `{{` in a
text field opens the variable picker (arrow keys, Enter or Tab to put one in, Esc to close). A badge says whether
the action runs on its own or asks you first, **Wait first** delays it, and once the automation is saved **Let it
run on its own** stops an outside action asking (`POST /api/v1/automations/{id}/policy`).

Enter in a row's last field adds a row. **Test** runs the draft on a recent activity, or on a kind's sample, and
lists what each action would do; nothing is changed. **Save and turn on** saves it switched on, **Save** keeps it as
it is (a new one stays off), and Ctrl or Cmd+Enter saves from anywhere. The API's problems show next to the trigger,
row or action they are about.

An automation whose workflow branches (a Decide node, or an action after a condition) can't be read as a list:
the builder says so and opens it in the [canvas](#on-the-canvas), where When and If still edit.

## Contract

Expand Down Expand Up @@ -1302,6 +1335,8 @@ held run until you pick.
also a Lens account as that person; a timeline page of others' private messages is read and left out, up to five
source pages, so narrow it by account if that proves slow.
- Deleted automations kept for a time, then removed with their runs (today they stay until restored).
- The studio: dragging actions and rows to reorder them (today the arrows move an action); sharing an automation as a
file; a builder laid out for phones first.
- Credentials in the headers of a saved event workflow an automation follows (`workflow`) sealed too (today only a
graph saved with the automation is; the workflow's are sent as written).
- Webhook triggers: a trigger option for a hook that takes only signed calls (`token_for(..., signed=True)`), and a
Expand Down
11 changes: 6 additions & 5 deletions docs/frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ nextjs-frontend/

The nav rail (`components/app-shell/nav-config.ts`) is in four groups, each named above its first item (a line when
the rail is collapsed to icons): what people use every day (Home, Library, Search, Chat, Notes), **Explore** what Lens
found (Timeline, Entities, Topics, Graph, Podcasts, Reports), **Automate** what runs by itself (Pipelines, Schedules,
Extensions, Sensors, or Sources for people who aren't admins), and **Manage** Lens (Costs, Analytics, Settings,
Admin). Every page stays one click from Home; ⌘K reaches every page, recording and setting by name. The nav fits a
phone screen without a swipe (`ci/clicks` counts one), so a new page shares a row rather than adding one: the Routines
page opens from Schedules, and workflows, templates and content types are tabs of Pipelines.
found (Timeline, Entities, Topics, Graph, Podcasts, Reports), **Automate** what runs by itself (Approvals while
something waits, Automations, Pipelines, Extensions, Sensors, or Sources for people who aren't admins), and
**Manage** Lens (Costs, Analytics, Settings, Admin). Every page stays one click from Home; ⌘K reaches every page,
recording and setting by name. The nav fits a phone screen without a swipe (`ci/clicks` counts one), so a new page
shares a row rather than adding one: Schedules is a tab of Automations and the Routines page opens from both (New
routine is at the top of each), and workflows, templates and content types are tabs of Pipelines.

## Design system

Expand Down
1 change: 1 addition & 0 deletions docs/requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ request, to another check that proves the same thing; loosening a requirement or
| Each automation has limits and budgets | [test_automation_runs.py](https://github.com/adeelahmad/lense/blob/main/fastapi_backend/tests/domain/test_automation_runs.py) `test_the_if_limits_and_dry_runs`, `test_a_run_over_budget_is_held_for_the_persons_pick` |
| Agents make, try and run automations over MCP and in the assistant, or draft one from a sentence | [test_automation_tools.py](https://github.com/adeelahmad/lense/blob/main/fastapi_backend/tests/api/test_automation_tools.py) `test_agents_save_try_and_run_automations_over_mcp`, `test_the_assistant_saves_at_once_and_asks_to_switch_on_or_run`; [test_automations.py](https://github.com/adeelahmad/lense/blob/main/fastapi_backend/tests/api/test_automations.py) `test_an_automation_is_drafted_from_a_sentence` |
| An automation's workflow is drawn and tried on the canvas: its actions in the palette, their settings drawn from each action's params, Decide's ports and the leaf rule | [workflow-canvas.test.ts](https://github.com/adeelahmad/lense/blob/main/nextjs-frontend/__tests__/workflow-canvas.test.ts) `give a decide node a port per option, then unsure`, `keep the leaf rule: nothing after an action that reaches outside Lens or waits`, `say what the backend would reject in their settings`; [automation-nodes-ui.test.tsx](https://github.com/adeelahmad/lense/blob/main/nextjs-frontend/__tests__/automation-nodes-ui.test.tsx) `sets an action up from the catalog, its params drawn from its schema`; [schema-form.test.tsx](https://github.com/adeelahmad/lense/blob/main/nextjs-frontend/__tests__/schema-form.test.tsx) `opens the variable picker on {{ and puts the pick in with Enter` |
| In the web app, automations are listed with what sets each off in words, and built in When, If and Then with a test on a recent activity, problems next to their fields | [automations-ui.test.tsx](https://github.com/adeelahmad/lense/blob/main/nextjs-frontend/__tests__/automations-ui.test.tsx) `the list reads each automation, and Delete is undone from its toast`, `the builder adds a trigger with a condition and an action, then saves it switched off`, `the test panel runs the draft on a recent activity and says what it would do`, `API problems go next to what they are about`; [test_automations.py](https://github.com/adeelahmad/lense/blob/main/fastapi_backend/tests/api/test_automations.py) `test_lists_read_the_triggers_in_words_and_say_when_it_runs_next` |

## See what it costs

Expand Down
10 changes: 5 additions & 5 deletions docs/schedules.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Schedules

Status: built. The Schedules page (Automate → Schedules) is Lens's crontab: everything that runs on a clock, in one
list, soonest first, with a switch, Run now and a way to change when it runs. Agents get the same list and the same
changes over the API and MCP. It has the place Routines had in the nav, so the nav still fits a phone screen: for
admins, the [Routines](processing.md#routines) page (the list, proposed graph changes and history) and New routine
are at the top of it.
Status: built. The Schedules page (Automate › Automations › Schedules) is Lens's crontab: everything that runs on a
clock, in one list, soonest first, with a switch, Run now and a way to change when it runs. Agents get the same list and
the same changes over the API and MCP. It is a tab of Automations, which has the one nav row for both (and where
Routines was), so the nav still fits a phone screen; for admins, the [Routines](processing.md#routines) page (the list,
proposed graph changes and history) and New routine are at the top of both tabs.

## What is on it

Expand Down
Loading
Loading