Session API over the turn engine.
Creates, opens, sends to, closes and deletes sessions, and manages projects, session groups and read marks.
Session API over the turn engine. Creates, opens, sends to, closes and deletes sessions, and manages projects, session groups and read marks.
(archived-session-group-ids)The ids (strings) of every archived group, across every project. One read backs the whole sessions listing: a group's archive hides its sessions without stamping them.
The ids (strings) of every archived group, across every project. One read backs the whole sessions listing: a group's archive hides its sessions without stamping them.
(assign-project! session-id project-id)Assign the session soul to project-id (nil clears / removes from project).
Assign the session soul to `project-id` (nil clears / removes from project).
(assign-session-group! session-id group-id)File the session soul under group-id (nil leaves it ungrouped). Joining a
group of another project adopts the session into that project as well.
File the session soul under `group-id` (nil leaves it ungrouped). Joining a group of another project adopts the session into that project as well.
(by-id id)Return the session record (UUID :id) or nil.
Return the session record (UUID `:id`) or nil.
(create! channel)(create! channel {:keys [title external-id workspace-id]})Create a brand-new session.
Opts (all optional): :title display title :external-id channel-specific external id :workspace-id pre-spawned workspace to pin the new session to. When omitted, a trunk workspace is auto-minted in create-environment.
Create a brand-new session.
Opts (all optional):
:title display title
:external-id channel-specific external id
:workspace-id pre-spawned workspace to pin the new session to.
When omitted, a trunk workspace is auto-minted in
create-environment.(create-session-group! project-id opts)Create a group inside project-id. opts: :name (required, unique in the
project), :color (palette token, defaults to "slate"), :position.
Create a group inside `project-id`. `opts`: :name (required, unique in the project), :color (palette token, defaults to "slate"), :position.
(db-info)Return the process-wide shared DB connection bound to
(config/resolve-db-spec). Thin wrapper over
persistance.core/db-shared-connection! that fills in the default db-spec
so frontend callers stay clear of config resolution.
Return the process-wide shared DB connection bound to `(config/resolve-db-spec)`. Thin wrapper over `persistance.core/db-shared-connection!` that fills in the default db-spec so frontend callers stay clear of config resolution.
(db-sweep-orphaned-running-turns! db)(db-sweep-orphaned-running-turns! db live-turn-ids)Mark every :running turn as :interrupted, except the turns named in
live-turn-ids. Run at process start to clean up turns that crashed or
were killed mid-write so the next turn's handover digest renders the right
outcome instead of guessing. A sibling vis process on the same database may
still run a turn: without its id here the sweep settles that turn under its
owner, which then has every checkpoint and terminal write refused.
Returns the number of turns swept.
Mark every `:running` turn as `:interrupted`, except the turns named in `live-turn-ids`. Run at process start to clean up turns that crashed or were killed mid-write so the next turn's handover digest renders the right outcome instead of guessing. A sibling vis process on the same database may still run a turn: without its id here the sweep settles that turn under its owner, which then has every checkpoint and terminal write refused. Returns the number of turns swept.
(delete-session-group! group-id)Delete a group. Its sessions stay in the project, ungrouped.
Delete a group. Its sessions stay in the project, ungrouped.
(ensure-project-for-root! root)(ensure-project-for-root! owner-id root name)Get-or-create the project bound to canonical workspace root (a project IS a
tab set). Race-safe: on a UNIQUE(owner_id, workspace_root) collision from a
creator the insert throws and we re-read. name seeds a freshly created
project (falls back to the folder name).
Get-or-create the project bound to canonical workspace `root` (a project IS a tab set). Race-safe: on a UNIQUE(owner_id, workspace_root) collision from a creator the insert throws and we re-read. `name` seeds a freshly created project (falls back to the folder name).
(get-project-by-root root)(get-project-by-root owner-id root)Project bound to canonical workspace root for owner-id (default
"local"), or nil.
Project bound to canonical workspace `root` for `owner-id` (default "local"), or nil.
(mark-session-read! reader-id session-id seen-answers)Advance reader-id's watermark on session-id to seen-answers settled
answers. Never moves backwards. Returns the watermark the store now holds.
Advance `reader-id`'s watermark on `session-id` to `seen-answers` settled answers. Never moves backwards. Returns the watermark the store now holds.
(project-session-ids project-id)Ids of every session soul belonging to project-id, across channels, in the
project's own tab order.
This is MEMBERSHIP, not a client's visible list: an untitled or empty conversation is a member too, and a caller that fans out over what it can see would delete the visible rows and silently keep the rest. One indexed read - membership is a WHERE clause, never a walk of the whole store.
Ids of every session soul belonging to `project-id`, across channels, in the project's own tab order. This is MEMBERSHIP, not a client's visible list: an untitled or empty conversation is a member too, and a caller that fans out over what it can see would delete the visible rows and silently keep the rest. One indexed read - membership is a WHERE clause, never a walk of the whole store.
(projects)(projects opts)List projects (cross-channel). opts: :owner-id (default "local"),
:archived (:exclude, :include or :only). Each carries a live :session-count.
List projects (cross-channel). `opts`: :owner-id (default "local"), :archived (:exclude, :include or :only). Each carries a live :session-count.
(register-client-extensions! id owner payload live?)Install application-owned declarations under the session's one-turn lock.
Install application-owned declarations under the session's one-turn lock.
(reorder-project-sessions! project-id session-ids)Atomically adopt any loose named session into project-id, then persist the
manual order. Guests owned by another project are never stolen.
Atomically adopt any loose named session into `project-id`, then persist the manual order. Guests owned by another project are never stolen.
(seed-session-read-marks! reader-id marks)Write a FIRST-SIGHT watermark for every {session-id seen-answers} of marks
this reader holds no mark for, leaving the marks they already have alone.
Returns the ids seeded.
Write a FIRST-SIGHT watermark for every `{session-id seen-answers}` of `marks`
this reader holds no mark for, leaving the marks they already have alone.
Returns the ids seeded.(session-group-session-ids group-id)Ids of every session soul filed under group-id, across channels, newest first.
MEMBERSHIP, like project-session-ids: an untitled conversation counts too,
and the group's own index answers it.
Ids of every session soul filed under `group-id`, across channels, newest first. MEMBERSHIP, like `project-session-ids`: an untitled conversation counts too, and the group's own index answers it.
(session-groups project-id)(session-groups project-id opts)List the groups of project-id, in their manual order, each with a live
:session-count. opts: :archived (:exclude, :include or :only). [] when
the project has none.
List the groups of `project-id`, in their manual order, each with a live :session-count. `opts`: :archived (:exclude, :include or :only). `[]` when the project has none.
(session-read-marks reader-id)How far reader-id has read each conversation, as {session-id-string seen-answers} - one indexed read of that reader's own rows. An id ABSENT from
the map has never been shown to this reader, which is what separates a first
sight from an unread answer.
How far `reader-id` has read each conversation, as `{session-id-string
seen-answers}` - one indexed read of that reader's own rows. An id ABSENT from
the map has never been shown to this reader, which is what separates a first
sight from an unread answer.(set-archived! session-id archived?)Archive (true) or unarchive (false) the session soul. Returns the stamp it
now carries, or nil once it is unarchived.
Archive (`true`) or unarchive (`false`) the session soul. Returns the stamp it now carries, or nil once it is unarchived.
(set-favorite! session-id is-favorite)Star (true) or unstar (false) the session soul. Returns the rank it now
holds, or nil once it is unstarred.
Star (`true`) or unstar (`false`) the session soul. Returns the rank it now holds, or nil once it is unstarred.
(set-title! id title)Host-driven title change. Resolves the live env (if any) so the
in-memory atom + listener fan-out stay in sync; falls back to a
plain DB write when no env is live for this session (e.g.
vis-agent sessions rename ops).
Host-driven title change. Resolves the live env (if any) so the in-memory atom + listener fan-out stay in sync; falls back to a plain DB write when no env is live for this session (e.g. `vis-agent sessions` rename ops).
(update-project! project-id opts)Patch a project (see db-update-project!). A new :workspace-root must name an
existing directory that no other project of the same owner uses. The project's
sessions move with it.
Patch a project (see `db-update-project!`). A new `:workspace-root` must name an existing directory that no other project of the same owner uses. The project's sessions move with it.
(update-session-group! group-id opts)Patch a group: :name, :color, :position and/or :archived?.
Patch a group: :name, :color, :position and/or :archived?.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |