Full session transcript - DATA first, presentation second.
transcript returns one canonical Clojure map with every turn,
every iteration, every executed block plus the LLM-side context
(system prompt, message envelope, reasoning trace, top-level
provider error, per-iteration vars, answer-form pointer,
returned-empty-blocks flag) and the per-block forensic detail
(code, comment, stdout, error, duration, timeout?, repaired?).
Pure data. The agent can pattern-match on it; the CLI
renders Markdown on top; a future TUI screen, JSON exporter, or
analytics extension consumes the same shape.
Lives in foundation because it's an introspection surface, not host
plumbing. The sandbox-visible public surface is (session-state) for data
(including compact usage) and (sessions) for metadata lookup; this namespace
owns the transcript portion behind that deeper interface.
Public Clojure surface:
(transcript db-info session-id) -> transcript data map
(transcript->md data) -> Markdown string
(transcript-md db-info session-id) -> DB lookup + Markdown string
(session->markdown db-info session-id) -> summary card + conversation export
Canonical data shape:
{:session {:id :title :channel :model :provider :created-at} :totals {:turns N :iterations N :tokens {:input :output :reasoning :cached} :cost-usd D} :timeline [{:kind :ref :turn-id :iteration-id :content :code :status :duration-ms}] :turns [{:id :status :prior-outcome :provider :model :user-request ; or :request-kind :council with attributed :council input :iteration-count :failure-count :tokens :cost-usd :content :iterations [{:id :position :status :duration-ms :provider :model :thinking :error :tokens :cost-usd :answer-position :returned-empty-blocks? :vars [{:name :code :value :version}] :attachments [{:id :source :tool-call-id :position :kind :media-type :filename :version :size :stored}] :blocks [{:position :code :comment :stdout :error :duration-ms :timeout? :repaired?}]}]}]}
The Markdown renderer renders thinking, iteration-level errors, vars, per-block forensic previews, and final answer text. Large fields are bounded so reports stay safe to open.
Full session transcript - DATA first, presentation second.
`transcript` returns one canonical Clojure map with every turn,
every iteration, every executed block plus the LLM-side context
(system prompt, message envelope, reasoning trace, top-level
provider error, per-iteration vars, answer-form pointer,
returned-empty-blocks flag) and the per-block forensic detail
(code, comment, stdout, error, duration, timeout?, repaired?).
Pure data. The agent can pattern-match on it; the CLI
renders Markdown on top; a future TUI screen, JSON exporter, or
analytics extension consumes the same shape.
Lives in foundation because it's an introspection surface, not host
plumbing. The sandbox-visible public surface is `(session-state)` for data
(including compact usage) and `(sessions)` for metadata lookup; this namespace
owns the transcript portion behind that deeper interface.
Public Clojure surface:
`(transcript db-info session-id)` -> transcript data map
`(transcript->md data)` -> Markdown string
`(transcript-md db-info session-id)` -> DB lookup + Markdown string
`(session->markdown db-info session-id)` -> summary card + conversation export
Canonical data shape:
{:session {:id :title :channel :model :provider :created-at}
:totals {:turns N :iterations N
:tokens {:input :output :reasoning :cached}
:cost-usd D}
:timeline [{:kind :ref :turn-id :iteration-id :content :code
:status :duration-ms}]
:turns
[{:id :status :prior-outcome :provider :model
:user-request ; or :request-kind :council with attributed :council input
:iteration-count :failure-count
:tokens :cost-usd :content
:iterations
[{:id :position :status :duration-ms
:provider :model :thinking :error
:tokens :cost-usd
:answer-position :returned-empty-blocks?
:vars
[{:name :code :value :version}]
:attachments
[{:id :source :tool-call-id :position :kind
:media-type :filename :version :size :stored}]
:blocks
[{:position :code :comment :stdout :error
:duration-ms :timeout? :repaired?}]}]}]}
The Markdown renderer renders thinking, iteration-level errors,
vars, per-block forensic previews, and final answer text. Large
fields are bounded so reports stay safe to open.(build-model-turn db-info position turn)Build block and attachment data only for the requested iteration.
Build block and attachment data only for the requested iteration.
(request-fields turn user-request)Keep a person's request or attributed Council input. Never use the Council instruction as input.
Keep a person's request or attributed Council input. Never use the Council instruction as input.
(resolve-session-ref db-info session-ref)Resolve one transcript/session reference to the canonical UUID.
Accepted shapes:
Returns nil on miss or ambiguous prefix. Unlike
db-resolve-session-id, this helper is existence-aware - a
well-formed but unknown UUID string must not masquerade as a real
session.
Resolve one transcript/session reference to the canonical UUID. Accepted shapes: - UUID => returned only when it exists - full UUID str => parsed, then existence-checked - unique prefix => scanned across every channel and expanded Returns nil on miss or ambiguous prefix. Unlike `db-resolve-session-id`, this helper is existence-aware - a well-formed but unknown UUID string must not masquerade as a real session.
(session->markdown db-info session-ref)(session->markdown db-info session-ref opts)Project a full session as a Markdown document on top of the IR pipeline.
Project a full session as a Markdown document on top of the IR pipeline.
(session-summary {:keys [session totals turns]})Grouped [[group-label [[key value mono?] ...]] ...] rows shared by the
Markdown summary and the HTML summary card. Pure over the transcript
data map - one canonical summary shape for every surface.
Grouped [[group-label [[key value mono?] ...]] ...] rows shared by the Markdown summary and the HTML summary card. Pure over the `transcript` data map - one canonical summary shape for every surface.
(session-summary-md db-info session-id)Canonical Markdown session-summary block (title heading + grouped facts) for a session - the SAME summary the HTML card renders. DB lookup + render; returns "" (no throw) on a missing id so shell pipelines and headers degrade cleanly.
Canonical Markdown session-summary block (title heading + grouped facts) for a session - the SAME summary the HTML card renders. DB lookup + render; returns "" (no throw) on a missing id so shell pipelines and headers degrade cleanly.
(transcript db-info session-id)Full session transcript as one Clojure data map. See ns docstring for the canonical shape. Returns nil when the session id does not resolve.
session-id accepts either the canonical UUID or an
unambiguous string prefix.
Pure with respect to the database - no writes, no logging.
(:db-info env) is the standard handle; the sandbox-bound symbol
variant uses the live env automatically.
Full session transcript as one Clojure data map. See ns docstring for the canonical shape. Returns nil when the session id does not resolve. `session-id` accepts either the canonical UUID or an unambiguous string prefix. Pure with respect to the database - no writes, no logging. `(:db-info env)` is the standard handle; the sandbox-bound symbol variant uses the live env automatically.
(transcript->md data)(transcript->md data {:keys [mode] :or {mode :full}})Render transcript data as Markdown. Pure transformation over
transcript's canonical data shape. Returns a string.
Modes:
:full - bounded diagnostic report (default).:dialog - user/assistant dialog only.Render transcript data as Markdown. Pure transformation over `transcript`'s canonical data shape. Returns a string. Modes: - `:full` - bounded diagnostic report (default). - `:dialog` - user/assistant dialog only.
(transcript-md db-info session-id)(transcript-md db-info session-id opts)Render the session as Markdown. Single transformation over
transcript's data. Returns a string; returns
"Session not found: <id>\n" (no throw) on a missing id so
shell pipelines stay clean.
Render the session as Markdown. Single transformation over `transcript`'s data. Returns a string; returns `"Session not found: <id>\n"` (no throw) on a missing id so shell pipelines stay clean.
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 |