Liking cljdoc? Tell your friends :D

com.blockether.vis.internal.gateway.transcript-export

Render a session as a standalone HTML file that draws its transcript with the SAME components as the Companion session screen.

npm run build:web writes transcript-export.html into the web bundle. That page holds all its code, styles and fonts, and one empty data element. This namespace copies the page and writes the session's JSON into that element: the gateway's own transcript rows (state/transcript-page), the session title, agent name and workspace, the ids of the session's subagents, the team rows of the turns that started them and the bytes of each artifact that the steps name. Under descendants, the JSON holds the same document for each subagent session below the session, so a subagent row of the page opens its conversation. The page needs no gateway and no network when it opens.

The steps of the turns and the artifact bytes are most of an export, so they are not in the JSON. Each one is in its own chunk element after the data element (chunk-prefix): the steps of a turn as raw DEFLATE in base64, an artifact or an image of a request as its bytes in base64. The JSON names the chunk of each turn (iterations_chunk), of each artifact and of each request image (chunk). Equal texts share one chunk. Thus the page parses only a small JSON when it opens, reads the steps of a turn when the reader comes near it, and no single string of the page grows with the session.

The bundle is found through VIS_WEB_DIR ([[web/configured-root]]), the folder the gateway serves the web app from. Without it, an export fails with a message that says how to build it; there is no second renderer to fall back to.

md writes the same document as Markdown, as the Compact mode of the session screen shows it. digest-summary writes each digest row with the words and counts of that screen.

Render a session as a standalone HTML file that draws its transcript with the SAME
components as the Companion session screen.

`npm run build:web` writes `transcript-export.html` into the web bundle. That page holds
all its code, styles and fonts, and one empty data element. This namespace copies the page
and writes the session's JSON into that element: the gateway's own transcript rows
(`state/transcript-page`), the session title, agent name and workspace, the ids of the
session's subagents, the team rows of the turns that started them and the bytes of each
artifact that the steps name. Under `descendants`, the JSON holds the same document for each
subagent session below the session, so a subagent row of the page opens its conversation.
The page needs no gateway and no network when it opens.

The steps of the turns and the artifact bytes are most of an export, so they are not in the
JSON. Each one is in its own chunk element after the data element ([[chunk-prefix]]): the
steps of a turn as raw DEFLATE in base64, an artifact or an image of a request as its bytes in
base64. The JSON names the chunk of each turn (`iterations_chunk`), of each artifact and of each
request image (`chunk`). Equal texts share one chunk. Thus the page
parses only a small JSON when it opens, reads the steps of a turn when the reader comes near
it, and no single string of the page grows with the session.

The bundle is found through `VIS_WEB_DIR` ([[web/configured-root]]), the folder the
gateway serves the web app from. Without it, an export fails with a message that says how
to build it; there is no second renderer to fall back to.

[[md]] writes the same document as Markdown, as the Compact mode of the session screen shows
it. [[digest-summary]] writes each digest row with the words and counts of that screen.
raw docstring

chunk-prefixclj

The id prefix of the chunk elements of an export page. The page reads <prefix><n>.

The id prefix of the chunk elements of an export page. The page reads `<prefix><n>`.
sourceraw docstring

data-elementclj

The empty data element of the export page. The page reads its JSON from this element.

The empty data element of the export page. The page reads its JSON from this element.
sourceraw docstring

deflate-base64clj

(deflate-base64 text)

text in UTF-8, compressed as raw DEFLATE (the deflate-raw format of the browser's DecompressionStream), in base64. The default level: transcript JSON is most of a large export, and this level makes it about a fifth smaller than the fastest level does.

`text` in UTF-8, compressed as raw DEFLATE (the `deflate-raw` format of the browser's
`DecompressionStream`), in base64. The default level: transcript JSON is most of a large
export, and this level makes it about a fifth smaller than the fastest level does.
sourceraw docstring

digest-summaryclj

(digest-summary forms)

The digest row of the steps of one note, as the session screen's Compact mode writes it: the Activity tally (3 mutations · 5 observations), then the failed and cancelled counts. Without Activity it says RAW EXECUTION, or THINKING when no step ran code. The measured time of the forms follows.

The digest row of the steps of one note, as the session screen's Compact mode writes it:
the Activity tally (`3 mutations · 5 observations`), then the failed and cancelled counts.
Without Activity it says `RAW EXECUTION`, or `THINKING` when no step ran code. The measured
time of the forms follows.
sourceraw docstring

export-dataclj

(export-data sid)

The JSON document of session sid for an export, or nil when no session has that id. The turns are the complete rows of the session screen: no window and no step limit. The agents are the team rows of those turns.

The JSON document of session `sid` for an export, or nil when no session has that id. The
turns are the complete rows of the session screen: no window and no step limit. The agents
are the team rows of those turns.
sourceraw docstring

failed-tool-callsclj

(failed-tool-calls turns)

The failed tool calls of turns, in order: the turn, the step (scope), the first line of the error, the code and its language. A call fails when it names a tool and returns an error, which is the rule of tool_failure_count, so the list and the count agree. The Failed tools list of both exports shows these rows.

The failed tool calls of `turns`, in order: the turn, the step (`scope`), the first line of the
error, the code and its language. A call fails when it names a tool and returns an error, which
is the rule of `tool_failure_count`, so the list and the count agree. The Failed tools list of
both exports shows these rows.
sourceraw docstring

failed-tools-markdownclj

(failed-tools-markdown turns)

The closed Failed tools section of a Markdown export, or an empty string when no call failed. Each failed call shows its step, the first line of its error and its code.

The closed Failed tools section of a Markdown export, or an empty string when no call failed.
Each failed call shows its step, the first line of its error and its code.
sourceraw docstring

fillclj

(fill template data)
(fill template data chunks)

The export page template with data written into its data element, and chunks, the chunk elements, after it. Throws when the page has no data element or more than one, because then the page is not an export page.

The export page `template` with `data` written into its data element, and `chunks`, the
chunk elements, after it. Throws when the page has no data element or more than one, because
then the page is not an export page.
sourceraw docstring

htmlclj

(html sid)

The standalone HTML export of session sid, or nil when no session has that id. Throws with a build hint when the web bundle holds no export page.

The standalone HTML export of session `sid`, or nil when no session has that id. Throws
with a build hint when the web bundle holds no export page.
sourceraw docstring

markdownclj

(markdown data)

The Markdown export of the export document data: each turn as Compact mode shows it. A run of steps is its note, then one closed digest that holds the thinking, code and Activity of its steps. Artifacts are named, not inlined.

The Markdown export of the export document `data`: each turn as Compact mode shows it. A
run of steps is its note, then one closed digest that holds the thinking, code and
Activity of its steps. Artifacts are named, not inlined.
sourceraw docstring

mdclj

(md sid)

The Markdown export of session sid, or nil when no session has that id.

The Markdown export of session `sid`, or nil when no session has that id.
sourceraw docstring

metrics-markdownclj

(metrics-markdown session usage)

The closed Metrics section of a Markdown export: the numbers and labels of the metrics panel under the METRICS row of the HTML export. usage is the session's usage rollup, or nil.

The closed Metrics section of a Markdown export: the numbers and labels of the metrics panel
under the METRICS row of the HTML export. `usage` is the session's usage rollup, or nil.
sourceraw docstring

page-nameclj

The export page inside the web bundle.

The export page inside the web bundle.
sourceraw docstring

template-fileclj

(template-file)
(template-file dir)

The export page of the web bundle in dir (VIS_WEB_DIR by default), or nil.

The export page of the web bundle in `dir` (`VIS_WEB_DIR` by default), or nil.
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