Liking cljdoc? Tell your friends :D

com.blockether.vis.internal.loop

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.
raw docstring

archived-session-group-idsclj

(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.
sourceraw docstring

assign-project!clj

(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).
sourceraw docstring

assign-session-group!clj

(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.
sourceraw docstring

by-channelclj

(by-channel channel)
source

by-idclj

(by-id id)

Return the session record (UUID :id) or nil.

Return the session record (UUID `:id`) or nil.
sourceraw docstring

close!clj

(close! id)
source

close-all!clj

(close-all!)
source

create!clj

(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.
sourceraw docstring

create-project!clj

(create-project! opts)
source

create-session-group!clj

(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.
sourceraw docstring

db-infoclj

(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.
sourceraw docstring

db-sweep-orphaned-running-turns!clj

(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.
sourceraw docstring

delete!clj

(delete! id)
source

delete-project!clj

(delete-project! project-id)
source

delete-session-group!clj

(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.
sourceraw docstring

ensure-project-for-root!clj

(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).
sourceraw docstring

env-forclj

(env-for id)
source

get-projectclj

(get-project project-id)
source

get-project-by-rootclj

(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.
sourceraw docstring

get-session-groupclj

(get-session-group group-id)
source

mark-session-read!clj

(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.
sourceraw docstring

project-session-idsclj

(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.
sourceraw docstring

projectsclj

(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.
sourceraw docstring

register-client-extensions!clj

(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.
sourceraw docstring

reorder-project-sessions!clj

(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.
sourceraw docstring

seed-session-read-marks!clj

(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.
sourceraw docstring

send!clj

(send! id messages)
(send! id messages opts)
source

session-group-session-idsclj

(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.
sourceraw docstring

session-groupsclj

(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.
sourceraw docstring

session-read-marksclj

(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.
sourceraw docstring

set-archived!clj

(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.
sourceraw docstring

set-favorite!clj

(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.
sourceraw docstring

set-title!clj

(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).
sourceraw docstring

update-project!clj

(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.
sourceraw docstring

update-session-group!clj

(update-session-group! group-id opts)

Patch a group: :name, :color, :position and/or :archived?.

Patch a group: :name, :color, :position and/or :archived?.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close