Pure rules of app attachments: threads, drafts and Send receipts.
An app attachment is a live view with the attachment placement. The engine
and the TUI apply these rules to the same engine-shaped maps, so both paint the
same threads and receipts. Every function here is pure: ids, authors and times
come from the caller.
Pure rules of app attachments: threads, drafts and Send receipts. An app attachment is a live view with the `attachment` placement. The engine and the TUI apply these rules to the same engine-shaped maps, so both paint the same threads and receipts. Every function here is pure: ids, authors and times come from the caller.
(agent-note-error view text)nil when text can be the note of view for the model, otherwise the reason.
Only an app takes a note. A blank text is valid: it removes the note.
nil when `text` can be the note of `view` for the model, otherwise the reason. Only an app takes a note. A blank text is valid: it removes the note.
(app? view)True when view is an app attachment.
True when `view` is an app attachment.
(append-log view {:keys [level at source] :as entry})App view with entry at the end of its log. The entry takes the next seq.
:at and :source come from the caller. Long texts are cut by
cut-log-texts, so an entry is never lost. The log keeps only its newest
entries.
App `view` with `entry` at the end of its log. The entry takes the next `seq`. `:at` and `:source` come from the caller. Long texts are cut by [[cut-log-texts]], so an entry is never lost. The log keeps only its newest entries.
(blank-text? text)True for nil or text with only whitespace.
True for nil or text with only whitespace.
How many receipts, threads, messages, Send values and Send comments an app holds, and the longest texts: a message body, a Send note and the note for the model.
How many receipts, threads, messages, Send values and Send comments an app holds, and the longest texts: a message body, a Send note and the note for the model.
(cut-log-texts {:keys [message detail] :as entry})Log op or entry entry with its texts inside the schema bounds. The message is
trimmed and cut at its end. A long detail loses its middle, and a blank detail
is dropped. Other values stay as they are.
Log op or entry `entry` with its texts inside the schema bounds. The message is trimmed and cut at its end. A long detail loses its middle, and a blank detail is dropped. Other values stay as they are.
(draft-op node {:keys [thread-id anchor body]} new-id)The patch operation that saves body as the draft of a thread in node, or
nil when nothing changes. action holds :thread-id, :anchor and :body.
A new thread takes new-id. Blank text removes a draft, and a new blank thread
is never created.
The patch operation that saves `body` as the draft of a thread in `node`, or nil when nothing changes. `action` holds `:thread-id`, `:anchor` and `:body`. A new thread takes `new-id`. Blank text removes a draft, and a new blank thread is never created.
(effective-surfaces view setting)The surfaces that a reader of app view gets. setting answers the value of a
setting id, or nil when the setting does not exist. apps_inline and
apps_session turn a surface off for every app. The app's own settings win
over what the app declared.
The surfaces that a reader of app `view` gets. `setting` answers the value of a setting id, or nil when the setting does not exist. `apps_inline` and `apps_session` turn a surface off for every app. The app's own settings win over what the app declared.
(find-shortcut view k)The shortcut of view that binds key k, or nil.
The shortcut of `view` that binds key `k`, or nil.
(find-submission view submission-id)Receipt submission-id of view, or nil.
Receipt `submission-id` of `view`, or nil.
(find-thread node thread-id)Thread thread-id of node node, or nil.
Thread `thread-id` of node `node`, or nil.
(global? view)True when app view belongs to no session. Only an SDK program opens one.
True when app `view` belongs to no session. Only an SDK program opens one.
(idempotency-key? k)True when k is a valid idempotency key of a Send.
True when `k` is a valid idempotency key of a Send.
(log-entry-error view {:keys [level message detail]})nil when entry can go into the log of view, otherwise the reason. Only an
app takes a log entry, and an entry needs a known level and a message.
nil when `entry` can go into the log of `view`, otherwise the reason. Only an app takes a log entry, and an entry needs a known level and a message.
How serious an app log entry can be.
How serious an app log entry can be.
Media type of the attachment row that lists an app.
Media type of the attachment row that lists an app.
(owner-thread node thread)Thread thread of an owner's thread op on node node as it lands: a message that
the host stored keeps the stored copy, found by id, and the saved draft of the human
stays. An owner never writes a draft.
Thread `thread` of an owner's thread op on node `node` as it lands: a message that the host stored keeps the stored copy, found by id, and the saved draft of the human stays. An owner never writes a draft.
(persistent? view)True when global app view comes back after a gateway restart. A session app
always comes back.
True when global app `view` comes back after a gateway restart. A session app always comes back.
Internal placement of an app attachment.
Internal placement of an app attachment.
(post-drafts nodes {:keys [author at submission-id new-id]})Post every saved draft of the thread nodes in nodes as a message. post
holds :author, :at, :submission-id and :new-id, a function that gives
one fresh message id per call. Answers {:ops [...] :comments [...]}.
Post every saved draft of the thread nodes in `nodes` as a message. `post`
holds `:author`, `:at`, `:submission-id` and `:new-id`, a function that gives
one fresh message id per call. Answers `{:ops [...] :comments [...]}`.(remove-threads node thread-ids)Diff node node without the threads in thread-ids. A missing id changes nothing.
Diff node `node` without the threads in `thread-ids`. A missing id changes nothing.
(reply-op node {:keys [thread-id anchor new-thread-id]} message)The patch operation that adds message to a thread of node. Without
:thread-id, a diff starts thread :new-thread-id at :anchor.
The patch operation that adds `message` to a thread of `node`. Without `:thread-id`, a diff starts thread `:new-thread-id` at `:anchor`.
(revision node)The reviewed revision of node node: the new_revision of a diff, else nil.
The reviewed revision of node `node`: the `new_revision` of a diff, else nil.
Who an app can belong to: its session, or no session at all.
Who an app can belong to: its session, or no session at all.
Where the session apps button can open an app, off included.
Where the session apps button can open an app, `off` included.
(set-agent-note view text)App view with text as its note for the model. The model reads the note
with the next user message. A blank text removes the note.
App `view` with `text` as its note for the model. The model reads the note with the next user message. A blank text removes the note.
(set-shortcuts view shortcuts)App view with shortcuts in place of its old list. An empty list removes
every shortcut. The shared check of the patched view owns their rules.
App `view` with `shortcuts` in place of its old list. An empty list removes every shortcut. The shared check of the patched view owns their rules.
(settings-key view)The id prefix of the settings of app view, or nil for an app without a key.
It joins the owning extension (or sandbox) and the key. A long prefix keeps
its start and ends in a hash, so two apps never share one.
The id prefix of the settings of app `view`, or nil for an app without a key. It joins the owning extension (or `sandbox`) and the key. A long prefix keeps its start and ends in a hash, so two apps never share one.
Stages after which a receipt no longer changes.
Stages after which a receipt no longer changes.
The valid shortcut keys, as one sentence part that a refusal can quote.
The valid shortcut keys, as one sentence part that a refusal can quote.
(shortcut-key? k)True when k is a key that an app shortcut can bind.
True when `k` is a key that an app shortcut can bind.
Named keys that an app shortcut can bind, besides one printable character.
Named keys that an app shortcut can bind, besides one printable character.
(submission-for-key view k)The receipt that idempotency key k made in view, or nil.
The receipt that idempotency key `k` made in `view`, or nil.
Delivery stages of a Send, in order.
Delivery stages of a Send, in order.
The surfaces of an app that declares none: {:inline true :session "sidebar"}.
The surfaces of an app that declares none: `{:inline true :session "sidebar"}`.
(threads node)The threads of node node: every thread of a diff, or the thread node itself.
The threads of node `node`: every thread of a diff, or the thread node itself.
(upsert-submission view submission)View view with receipt submission in place. When the view holds too many
receipts, the oldest settled receipt goes first, then the oldest receipt.
View `view` with receipt `submission` in place. When the view holds too many receipts, the oldest settled receipt goes first, then the oldest receipt.
(upsert-thread node thread)Diff or thread node node with thread in place. A diff replaces the thread
with the same id or adds it. A thread node takes the messages, draft, anchor and
resolution. The patch target table and the node check of the host own the rules.
Diff or thread node `node` with `thread` in place. A diff replaces the thread with the same id or adds it. A thread node takes the messages, draft, anchor and resolution. The patch target table and the node check of the host own the rules.
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 |