zidane-ui 9.2.3 → 9.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/live.d.ts +6 -0
- package/dist/adapters/live.js +16 -8
- package/dist/adapters/server-composer-host.js +22 -9
- package/dist/adapters/server-host.js +143 -18
- package/dist/adapters/server-media.d.ts +9 -1
- package/dist/adapters/server-media.js +14 -1
- package/dist/chat/HostTranscript.d.ts +0 -12
- package/dist/chat/HostTranscript.js +6 -1
- package/dist/chat/SessionStreamsProvider.d.ts +8 -0
- package/dist/chat/SessionStreamsProvider.js +11 -2
- package/dist/chat/Transcript.d.ts +20 -11
- package/dist/chat/Transcript.js +326 -160
- package/dist/chat/composer/ComposerEditor.js +1 -1
- package/dist/chat/headless/host.d.ts +43 -7
- package/dist/chat/headless/index.d.ts +7 -6
- package/dist/chat/headless/index.js +10 -9
- package/dist/chat/headless/labels.d.ts +17 -0
- package/dist/chat/headless/labels.js +17 -0
- package/dist/chat/headless/markdown-chunks.d.ts +2 -1
- package/dist/chat/headless/markdown-chunks.js +12 -20
- package/dist/chat/headless/markdown-scan.d.ts +66 -0
- package/dist/chat/headless/markdown-scan.js +124 -0
- package/dist/chat/headless/markdown-stream.d.ts +64 -0
- package/dist/chat/headless/markdown-stream.js +143 -0
- package/dist/chat/headless/output-pager.d.ts +68 -0
- package/dist/chat/headless/output-pager.js +113 -0
- package/dist/chat/headless/session-list.d.ts +10 -0
- package/dist/chat/headless/sidebar/activity.d.ts +14 -0
- package/dist/chat/headless/sidebar/activity.js +32 -0
- package/dist/chat/headless/sidebar/directory.d.ts +9 -1
- package/dist/chat/headless/sidebar/directory.js +10 -50
- package/dist/chat/headless/sidebar/labels.d.ts +11 -1
- package/dist/chat/headless/sidebar/prewarm.d.ts +68 -0
- package/dist/chat/headless/sidebar/prewarm.js +114 -0
- package/dist/chat/headless/streams/actions.d.ts +2 -0
- package/dist/chat/headless/streams/actions.js +1 -0
- package/dist/chat/headless/streams/event-bytes.d.ts +6 -0
- package/dist/chat/headless/streams/event-bytes.js +34 -0
- package/dist/chat/headless/streams/live-events.d.ts +25 -1
- package/dist/chat/headless/streams/live-events.js +53 -2
- package/dist/chat/headless/streams/selectors.d.ts +3 -0
- package/dist/chat/headless/streams/selectors.js +8 -1
- package/dist/chat/headless/streams/session-streams.d.ts +15 -3
- package/dist/chat/headless/streams/session-streams.js +31 -3
- package/dist/chat/headless/streams/store.d.ts +24 -1
- package/dist/chat/headless/streams/store.js +51 -26
- package/dist/chat/headless/streams/transcript-map.d.ts +57 -0
- package/dist/chat/headless/streams/transcript-map.js +88 -0
- package/dist/chat/headless/streams/transcript.d.ts +4 -2
- package/dist/chat/headless/streams/transcript.js +19 -7
- package/dist/chat/headless/transcript/batch.js +5 -1
- package/dist/chat/headless/transcript/blob-media.d.ts +15 -0
- package/dist/chat/headless/transcript/blob-media.js +23 -0
- package/dist/chat/headless/transcript/collapse.d.ts +10 -0
- package/dist/chat/headless/transcript/collapse.js +32 -6
- package/dist/chat/headless/transcript/derive.d.ts +98 -0
- package/dist/chat/headless/transcript/derive.js +89 -0
- package/dist/chat/headless/transcript/exchange-media.d.ts +3 -1
- package/dist/chat/headless/transcript/exchange-media.js +8 -5
- package/dist/chat/headless/transcript/fold-attachments.d.ts +2 -0
- package/dist/chat/headless/transcript/fold-attachments.js +3 -2
- package/dist/chat/headless/transcript/fold.d.ts +2 -1
- package/dist/chat/headless/transcript/fold.js +16 -6
- package/dist/chat/headless/transcript/incremental.d.ts +53 -0
- package/dist/chat/headless/transcript/incremental.js +181 -0
- package/dist/chat/headless/transcript/index.d.ts +2 -2
- package/dist/chat/headless/transcript/index.js +2 -2
- package/dist/chat/headless/transcript/nesting.js +2 -1
- package/dist/chat/headless/transcript/rail.d.ts +50 -1
- package/dist/chat/headless/transcript/rail.js +165 -23
- package/dist/chat/headless/transcript/rows.d.ts +5 -1
- package/dist/chat/headless/transcript/run-failures.js +2 -1
- package/dist/chat/headless/transcript/seams.d.ts +78 -0
- package/dist/chat/headless/transcript/seams.js +116 -0
- package/dist/chat/headless/transcript/tool-media.d.ts +6 -7
- package/dist/chat/headless/transcript/tool-media.js +27 -9
- package/dist/chat/index.d.ts +8 -7
- package/dist/chat/index.js +17 -16
- package/dist/chat/sidebar/SidebarFooter.d.ts +8 -5
- package/dist/chat/sidebar/SidebarFooter.js +6 -6
- package/dist/chat/testing/contract.d.ts +5 -3
- package/dist/chat/testing/contract.js +66 -1
- package/dist/chat/transcript/DiffLines.d.ts +6 -1
- package/dist/chat/transcript/DiffLines.js +35 -20
- package/dist/chat/transcript/EditDiffBlock.d.ts +5 -1
- package/dist/chat/transcript/EditDiffBlock.js +89 -30
- package/dist/chat/transcript/LazyRow.d.ts +40 -40
- package/dist/chat/transcript/LazyRow.js +101 -149
- package/dist/chat/transcript/MermaidDiagram.js +2 -1
- package/dist/chat/transcript/SubagentBlock.js +3 -2
- package/dist/chat/transcript/TranscriptRail.d.ts +25 -2
- package/dist/chat/transcript/TranscriptRail.js +175 -17
- package/dist/chat/transcript/TranscriptRow.d.ts +4 -7
- package/dist/chat/transcript/TranscriptRow.js +4 -3
- package/dist/chat/transcript/actions.d.ts +37 -1
- package/dist/chat/transcript/actions.js +27 -1
- package/dist/chat/transcript/clipped-output.d.ts +58 -0
- package/dist/chat/transcript/clipped-output.js +131 -0
- package/dist/chat/transcript/fold-attachments.js +10 -5
- package/dist/chat/transcript/fold-worker.js +3 -2
- package/dist/chat/transcript/fold.js +2 -1
- package/dist/chat/transcript/index.d.ts +10 -9
- package/dist/chat/transcript/index.js +9 -8
- package/dist/chat/transcript/markdown-cache.d.ts +7 -1
- package/dist/chat/transcript/markdown-cache.js +12 -1
- package/dist/chat/transcript/markdown.js +116 -54
- package/dist/chat/transcript/media-gallery.d.ts +3 -2
- package/dist/chat/transcript/media-gallery.js +10 -7
- package/dist/chat/transcript/notices.js +2 -1
- package/dist/chat/transcript/prompt.js +6 -4
- package/dist/chat/transcript/prose.js +2 -1
- package/dist/chat/transcript/root-items.d.ts +96 -0
- package/dist/chat/transcript/root-items.js +180 -0
- package/dist/chat/transcript/row-mount.d.ts +165 -0
- package/dist/chat/transcript/row-mount.js +498 -0
- package/dist/chat/transcript/row-parking.d.ts +125 -0
- package/dist/chat/transcript/row-parking.js +135 -0
- package/dist/chat/transcript/row-ui-state.d.ts +37 -0
- package/dist/chat/transcript/row-ui-state.js +53 -0
- package/dist/chat/transcript/run-rows.js +3 -2
- package/dist/chat/transcript/script-input.d.ts +1 -1
- package/dist/chat/transcript/tasks.js +3 -2
- package/dist/chat/transcript/tool-media.d.ts +4 -2
- package/dist/chat/transcript/tool-media.js +15 -7
- package/dist/chat/transcript/tool-parts.d.ts +27 -4
- package/dist/chat/transcript/tool-parts.js +31 -5
- package/dist/chat/transcript/tool-payload.js +26 -11
- package/dist/chat/transcript/tool-row.d.ts +2 -1
- package/dist/chat/transcript/tool-row.js +38 -19
- package/dist/chat/transcript/use-transcript-rows.d.ts +24 -7
- package/dist/chat/transcript/use-transcript-rows.js +28 -46
- package/dist/chat/transcript/useStickToBottom.js +2 -3
- package/dist/chat/transcript/useTranscriptSearch.js +30 -14
- package/dist/chat/transcript/view-scope.d.ts +26 -6
- package/dist/chat/transcript/view-scope.js +106 -20
- package/dist/dist/{index-E1Z0aPmi.d.ts → index-C6-t1SS9.d.ts} +2 -1
- package/dist/dist/index.d.ts +1 -1
- package/dist/session/SessionHeader.js +1 -0
- package/dist/settings/headless/fixture-performance.js +4 -2
- package/dist/settings/headless/performance.d.ts +4 -0
- package/dist/settings/headless/search.d.ts +1 -1
- package/dist/settings/sections/performance/PerformanceSection.js +8 -1
- package/dist/settings/sections/performance/labels.d.ts +2 -0
- package/dist/settings/sections/performance/labels.js +2 -0
- package/dist/styles.css +33 -2
- package/dist/views/headless/answers.d.ts +8 -2
- package/dist/views/headless/answers.js +58 -1
- package/dist/views/headless/placement.d.ts +78 -0
- package/dist/views/headless/placement.js +154 -44
- package/package.json +2 -2
- package/src/styles/transcript.css +33 -2
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { LoadError } from "../../components/LoadError.js";
|
|
2
|
+
import { createToolOutputPager, toolOutputPagerDone } from "../headless/output-pager.js";
|
|
3
|
+
import { constant, useReadable } from "../headless/store.js";
|
|
4
|
+
import { useChatLabels } from "../useChatLabels.js";
|
|
5
|
+
import { useTranscriptActions } from "./actions.js";
|
|
6
|
+
import { LoadFullOutputButton, useFullOutput } from "./tool-parts.js";
|
|
7
|
+
import { useMemo, useState } from "react";
|
|
8
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { formatBytes } from "zidane/chat/pure";
|
|
10
|
+
// src/chat/transcript/clipped-output.tsx
|
|
11
|
+
const IDLE = constant({
|
|
12
|
+
text: "",
|
|
13
|
+
total: null,
|
|
14
|
+
missing: false,
|
|
15
|
+
loading: false,
|
|
16
|
+
error: null
|
|
17
|
+
});
|
|
18
|
+
/**
|
|
19
|
+
* The rest of a clipped result, read through the transcript's actions: paged
|
|
20
|
+
* with `toolOutputRange`, whole with `toolOutput` only.
|
|
21
|
+
*
|
|
22
|
+
* @param tool - The clipped tool row. Its `callId` (and `turnId`, a hint) address the result.
|
|
23
|
+
*/
|
|
24
|
+
function useClippedOutput(tool) {
|
|
25
|
+
const { sessionId, toolOutputRange } = useTranscriptActions();
|
|
26
|
+
const whole = useFullOutput(tool);
|
|
27
|
+
const { callId, turnId, resultClipped } = tool;
|
|
28
|
+
const pager = useMemo(() => toolOutputRange && sessionId && callId && resultClipped ? createToolOutputPager((range) => toolOutputRange(callId, range, turnId)) : null, [
|
|
29
|
+
toolOutputRange,
|
|
30
|
+
sessionId,
|
|
31
|
+
callId,
|
|
32
|
+
turnId,
|
|
33
|
+
resultClipped
|
|
34
|
+
]);
|
|
35
|
+
const state = useReadable(pager ?? IDLE);
|
|
36
|
+
const [running, setRunning] = useState(null);
|
|
37
|
+
const [last, setLast] = useState("more");
|
|
38
|
+
if (!pager) return {
|
|
39
|
+
text: typeof whole.full === "string" ? whole.full : null,
|
|
40
|
+
available: whole.available,
|
|
41
|
+
ready: whole.ready,
|
|
42
|
+
paged: null,
|
|
43
|
+
whole: {
|
|
44
|
+
full: whole.full,
|
|
45
|
+
load: whole.load
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const run = (what) => {
|
|
49
|
+
setRunning(what);
|
|
50
|
+
setLast(what);
|
|
51
|
+
(what === "all" ? pager.loadAll() : pager.loadMore()).finally(() => setRunning(null));
|
|
52
|
+
};
|
|
53
|
+
return {
|
|
54
|
+
text: state.total !== null && !state.missing ? state.text : null,
|
|
55
|
+
available: true,
|
|
56
|
+
ready: true,
|
|
57
|
+
paged: {
|
|
58
|
+
...state,
|
|
59
|
+
running: state.loading ? running : null,
|
|
60
|
+
run,
|
|
61
|
+
retry: () => run(last)
|
|
62
|
+
},
|
|
63
|
+
whole: {
|
|
64
|
+
full: whole.full,
|
|
65
|
+
load: whole.load
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* "Load full output" over a clipped result; once a page shows, how much is
|
|
71
|
+
* loaded with "Load more" and "Load all", and a failed read with Retry.
|
|
72
|
+
*
|
|
73
|
+
* @param props - The result's state, `className` and `style`.
|
|
74
|
+
*/
|
|
75
|
+
function ClippedOutputControls({ output, className = "", style }) {
|
|
76
|
+
const labels = useChatLabels();
|
|
77
|
+
const { paged, whole } = output;
|
|
78
|
+
if (!output.available) return null;
|
|
79
|
+
if (!paged) {
|
|
80
|
+
if (typeof whole.full === "string") return null;
|
|
81
|
+
return /* @__PURE__ */ jsx(LoadFullOutputButton, {
|
|
82
|
+
loading: whole.full === "loading",
|
|
83
|
+
disabled: !output.ready,
|
|
84
|
+
onClick: whole.load,
|
|
85
|
+
className,
|
|
86
|
+
...style ? { style } : {}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
if (paged.missing || toolOutputPagerDone(paged) && paged.error === null) return null;
|
|
90
|
+
const failed = paged.error !== null && /* @__PURE__ */ jsx(LoadError, {
|
|
91
|
+
detail: paged.error,
|
|
92
|
+
onRetry: paged.retry,
|
|
93
|
+
children: labels.outputLoadFailed
|
|
94
|
+
});
|
|
95
|
+
if (paged.total === null) return /* @__PURE__ */ jsxs("div", {
|
|
96
|
+
className: `flex flex-col items-start gap-1.5 ${className}`,
|
|
97
|
+
style,
|
|
98
|
+
children: [/* @__PURE__ */ jsx(LoadFullOutputButton, {
|
|
99
|
+
loading: paged.loading,
|
|
100
|
+
disabled: false,
|
|
101
|
+
onClick: () => paged.run("more"),
|
|
102
|
+
className: ""
|
|
103
|
+
}), failed]
|
|
104
|
+
});
|
|
105
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
106
|
+
className: `flex flex-col items-start gap-1.5 ${className}`,
|
|
107
|
+
style,
|
|
108
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
109
|
+
className: "flex flex-wrap items-baseline gap-3",
|
|
110
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
111
|
+
className: "zg-meta",
|
|
112
|
+
children: labels.outputLoaded(formatBytes(paged.text.length), formatBytes(paged.total))
|
|
113
|
+
}), !toolOutputPagerDone(paged) && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(LoadFullOutputButton, {
|
|
114
|
+
loading: paged.running === "more",
|
|
115
|
+
disabled: paged.loading,
|
|
116
|
+
onClick: () => paged.run("more"),
|
|
117
|
+
className: "",
|
|
118
|
+
label: labels.loadMoreOutput,
|
|
119
|
+
loadingLabel: labels.loadingOutput
|
|
120
|
+
}), /* @__PURE__ */ jsx(LoadFullOutputButton, {
|
|
121
|
+
loading: paged.running === "all",
|
|
122
|
+
disabled: paged.loading,
|
|
123
|
+
onClick: () => paged.run("all"),
|
|
124
|
+
className: "",
|
|
125
|
+
label: labels.loadAllOutput,
|
|
126
|
+
loadingLabel: labels.loadingOutput
|
|
127
|
+
})] })]
|
|
128
|
+
}), failed]
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
export { ClippedOutputControls, useClippedOutput };
|
|
@@ -3,7 +3,7 @@ import { Grow, GrowPresence } from "../../motion/grow.js";
|
|
|
3
3
|
import { RollingText } from "../../motion/roll.js";
|
|
4
4
|
import { mediumKey } from "../headless/transcript/exchange-media.js";
|
|
5
5
|
import { useChatLabels } from "../useChatLabels.js";
|
|
6
|
-
import { useTranscriptActions } from "./actions.js";
|
|
6
|
+
import { toolMediaSrcOf, useTranscriptActions } from "./actions.js";
|
|
7
7
|
import { useMediaGallery } from "./media-gallery.js";
|
|
8
8
|
import { useThumbnail } from "./thumbnails.js";
|
|
9
9
|
import { memo, useMemo, useState } from "react";
|
|
@@ -41,7 +41,7 @@ function stripLayout(images) {
|
|
|
41
41
|
*/
|
|
42
42
|
const FoldAttachments = memo(({ attachments, className, style }) => {
|
|
43
43
|
const labels = useChatLabels();
|
|
44
|
-
const
|
|
44
|
+
const actions = useTranscriptActions();
|
|
45
45
|
const lightbox = useLightbox();
|
|
46
46
|
const mediaGallery = useMediaGallery();
|
|
47
47
|
const [failed, setFailed] = useState(NO_FAILURES);
|
|
@@ -49,9 +49,14 @@ const FoldAttachments = memo(({ attachments, className, style }) => {
|
|
|
49
49
|
keys: new Set(attachments.map((a) => a.key)),
|
|
50
50
|
counted: attachments.length > STRIP_SIZE
|
|
51
51
|
}));
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
const servable = (a) => toolMediaSrcOf(actions, a.callId, a) !== void 0;
|
|
53
|
+
const { tiles, hidden } = useMemo(() => stripLayout(attachments.filter((a) => !failed.has(a.key) && toolMediaSrcOf(actions, a.callId, a) !== void 0)), [
|
|
54
|
+
attachments,
|
|
55
|
+
failed,
|
|
56
|
+
actions
|
|
57
|
+
]);
|
|
58
|
+
if (tiles.length === 0 || !servable(tiles[0])) return null;
|
|
59
|
+
const src = (a) => toolMediaSrcOf(actions, a.callId, a);
|
|
55
60
|
const fail = (a) => {
|
|
56
61
|
mediaGallery?.failed(mediumKey.tool(a.callId, a.index));
|
|
57
62
|
setFailed((prev) => new Set(prev).add(a.key));
|
|
@@ -5,7 +5,8 @@ import { useChatLabels } from "../useChatLabels.js";
|
|
|
5
5
|
import { useModelName } from "./actions.js";
|
|
6
6
|
import { Caret } from "./frame.js";
|
|
7
7
|
import { useTranscriptRenderers } from "./renderers.js";
|
|
8
|
-
import {
|
|
8
|
+
import { useRowPartKey, useRowUiState } from "./row-ui-state.js";
|
|
9
|
+
import { useMemo } from "react";
|
|
9
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
11
|
// src/chat/transcript/fold-worker.tsx
|
|
11
12
|
/**
|
|
@@ -64,7 +65,7 @@ function TaskStep({ task, model, type, resume, system }) {
|
|
|
64
65
|
const labels = useChatLabels();
|
|
65
66
|
const modelName = useModelName();
|
|
66
67
|
const { Markdown } = useTranscriptRenderers();
|
|
67
|
-
const [open, setOpen] =
|
|
68
|
+
const [open, setOpen] = useRowUiState(useRowPartKey("worker-task"), false);
|
|
68
69
|
const mounted = useStaysMounted(open);
|
|
69
70
|
const first = task.split("\n").find((line) => line.trim()) ?? "";
|
|
70
71
|
const settings = [
|
|
@@ -14,6 +14,7 @@ import { Caret, Dot, RowFrame } from "./frame.js";
|
|
|
14
14
|
import { CompactMeta } from "./receipt-parts.js";
|
|
15
15
|
import { createRecentMap } from "./recent-map.js";
|
|
16
16
|
import { useTranscriptRenderers } from "./renderers.js";
|
|
17
|
+
import { useRowUiState } from "./row-ui-state.js";
|
|
17
18
|
import { ToolDetails } from "./tool-details.js";
|
|
18
19
|
import { ToolTiming } from "./tool-parts.js";
|
|
19
20
|
import { ModelVerdict } from "./tool-row.js";
|
|
@@ -57,7 +58,7 @@ const ExchangeFoldRow = memo(({ row, renderRows, status: runStatus, showAttachme
|
|
|
57
58
|
const labels = useChatLabels();
|
|
58
59
|
const [openState, setOpenState] = useState(() => FOLD_OPEN_STATE.get(row.id) ?? false);
|
|
59
60
|
const [setupOpened] = useState(() => new Set(openSetupIds(row.rows)));
|
|
60
|
-
const [openIds, setOpenIds] =
|
|
61
|
+
const [openIds, setOpenIds] = useRowUiState(`fold-steps:${row.id}`, setupOpened.size > 0 ? new Set(setupOpened) : NO_OPEN_IDS);
|
|
61
62
|
const setOpen = (next) => {
|
|
62
63
|
FOLD_OPEN_STATE.set(row.id, next);
|
|
63
64
|
setOpenState(next);
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* slots (`TranscriptRenderersProvider`) and actions (`TranscriptActionsProvider`).
|
|
4
4
|
* `Transcript` / `HostTranscript` themselves are in `zidane-ui/chat`.
|
|
5
5
|
*/
|
|
6
|
-
import { TranscriptAccounts, TranscriptActions, TranscriptActionsProvider, TranscriptActionsProviderProps, useModelName, useTranscriptActions } from "./actions.js";
|
|
7
|
-
import { TranscriptRenderersProvider, TranscriptRenderersProviderProps } from "./renderer-slots.js";
|
|
6
|
+
import { TranscriptAccounts, TranscriptActions, TranscriptActionsProvider, TranscriptActionsProviderProps, attachmentSrcOf, toolMediaSrcOf, useModelName, useTranscriptActions } from "./actions.js";
|
|
8
7
|
import { AnsiSpans, AnsiSpansProps, AnsiText, AnsiTextProps } from "./AnsiText.js";
|
|
9
|
-
import {
|
|
8
|
+
import { TranscriptRenderersProvider, TranscriptRenderersProviderProps } from "./renderer-slots.js";
|
|
10
9
|
import { AuthFailureCard, AuthFailureCardProps } from "./AuthFailureCard.js";
|
|
10
|
+
import { ToolMediaItem, parseToolMedia } from "../headless/transcript/tool-media.js";
|
|
11
11
|
import { BadgeEffectContext, BadgeMenuBrowser, BadgeMenuComposer, BadgeMenuProvider, BadgeMenuProviderProps, BadgeMenuSystem, OpenBadgeMenu, useBadgeMenu } from "./BadgeMenu.js";
|
|
12
12
|
import { BADGE_GLYPH, FileBadgeIcon, FileBadgeIconProps, LinkBadge, LinkBadgeProps, LinkIcon, LinkIconProps, fileBadgeName, fileBadgeSpec, linkGlyph, siteIconValue } from "./badges.js";
|
|
13
13
|
import { CardMarkdown, CardMarkdownProps } from "./CardMarkdown.js";
|
|
@@ -27,7 +27,7 @@ import { Caret, CaretProps, Dot, DotProps, FailedMark, FailedMarkProps, GUTTER_S
|
|
|
27
27
|
import { ImageGenerationBlock, ImageGenerationBlockProps, drawsImageGeneration, imageRequestsOf, savedPaths } from "./ImageGenerationBlock.js";
|
|
28
28
|
import { InlineChipText, InlineChipTextProps } from "./InlineChipText.js";
|
|
29
29
|
import { InteractionTool, InteractionToolBody, InteractionToolBodyProps, hasInteractionBody } from "./InteractionToolBody.js";
|
|
30
|
-
import { CvRow, CvRowProps, LazyRow, LazyRowProps, TranscriptSettling, holdForceMountRows,
|
|
30
|
+
import { CvRow, CvRowProps, ForcedRows, LazyRow, LazyRowProps, TranscriptSettling, holdForceMountRows, useBackgroundMount, useForceMountRows, useForcedRows } from "./LazyRow.js";
|
|
31
31
|
import { LiveOutput, LiveOutputProps } from "./LiveOutput.js";
|
|
32
32
|
import { Markdown, MarkdownDiagrams, MarkdownDiagramsProps, MarkdownImageProps, MarkdownLinkProps, MarkdownProps } from "./markdown.js";
|
|
33
33
|
import { ChipOpener, CommandScope, CommandScopeContext, INLINE_CODE_CLASS, MarkdownContext, MarkdownContextValue, OpenSessionContext } from "./markdown-context.js";
|
|
@@ -44,27 +44,28 @@ import { ReferenceChip, ReferenceChipProps, ReferenceText, ReferenceTextProps }
|
|
|
44
44
|
import { ParsedReferenceUrl, parseReferenceUrl, referenceUrl, remarkReferences } from "./remark-references.js";
|
|
45
45
|
import { ParsedRef, RefMatch, classifyInlineRef, findRefs, numberRef, parseRefUrl, refHref, remarkRefs } from "./remark-refs.js";
|
|
46
46
|
import { AttachmentLabelParts, CodeBlockSlotProps, DEFAULT_TRANSCRIPT_RENDERERS, DefaultInlineText, DefaultInlineTextProps, DefaultMarkdown, DefaultMarkdownProps, DefaultPrompt, DefaultPromptProps, DefaultSessionTitle, DefaultSessionTitleProps, InlineTextSlotProps, MarkdownSlotProps, PromptSlotProps, SessionTitleSlotProps, TextPreviewSlotProps, ToolBodySlotProps, TranscriptRenderers, defaultAttachmentLabel, useTranscriptRenderers } from "./renderers.js";
|
|
47
|
+
import { revealRow } from "./row-mount.js";
|
|
47
48
|
import { CompactSummaryRow, CompactSummaryRowProps, RunReceiptInline, RunReceiptInlineProps, RunSummaryRow, RunSummaryRowProps } from "./run-rows.js";
|
|
48
49
|
import { SelectCursor, SelectCursorProps } from "./SelectCursor.js";
|
|
49
50
|
import { SelectTurnExit, SelectTurnHintKeys, SelectTurnHintKeysProps } from "./SelectTurnHint.js";
|
|
50
51
|
import { SelectTurnCommands, SelectTurnProvider, SelectTurnProviderProps, SelectTurnState, SelectTurnValue, useSelectTurn } from "./SelectTurnProvider.js";
|
|
51
52
|
import { RunnableCodeBlock, ShellBlockProvider, ShellBlockProviderProps } from "./shell-block.js";
|
|
52
|
-
import { RunnableCodeBlockProps, ShellBlockScope, useShellBlockScope } from "./shell-block-scope.js";
|
|
53
53
|
import { useSiteIcon } from "./site-icons.js";
|
|
54
|
+
import { RunnableCodeBlockProps, ShellBlockScope, useShellBlockScope } from "./shell-block-scope.js";
|
|
54
55
|
import { SubagentBlock, SubagentBlockProps } from "./SubagentBlock.js";
|
|
55
56
|
import { TaskBatchRow, TaskBatchRowProps, TaskRow, TaskRowProps } from "./tasks.js";
|
|
56
57
|
import { ToolBatchRow, ToolBatchRowProps } from "./tool-batch.js";
|
|
57
58
|
import { ToolDetails, ToolDetailsProps } from "./tool-details.js";
|
|
58
59
|
import { ToolMedia, ToolMediaProps, useToolMedia } from "./tool-media.js";
|
|
59
|
-
import { CODE_PANEL, LoadFullOutputButton, LoadFullOutputButtonProps, ReadFileBlock, ReadFileBlockProps, ToolGlyph, ToolGlyphProps, ToolInput, ToolInputProps, ToolTiming, ToolTimingProps, useFullOutput } from "./tool-parts.js";
|
|
60
|
+
import { CODE_PANEL, LoadFullOutputButton, LoadFullOutputButtonProps, ReadFileBlock, ReadFileBlockProps, ToolGlyph, ToolGlyphProps, ToolInput, ToolInputProps, ToolTiming, ToolTimingProps, useFullOutput, useFullToolCall } from "./tool-parts.js";
|
|
60
61
|
import { ModelVerdict, ModelVerdictProps, NestedToolCalls, NestedToolCallsProps, ToolRow, ToolRowProps } from "./tool-row.js";
|
|
61
|
-
import { TranscriptRail, TranscriptRailProps, TranscriptRailProvider, TranscriptRailProviderProps, useTranscriptRailStore } from "./TranscriptRail.js";
|
|
62
|
+
import { TranscriptRail, TranscriptRailProps, TranscriptRailProvider, TranscriptRailProviderProps, useRailOutline, useTranscriptRailStore } from "./TranscriptRail.js";
|
|
62
63
|
import { RowContext, SlotEntry, TranscriptRow, TranscriptRowProps, TranscriptRowSlot, TranscriptRowSlotProps, TranscriptTurnMenu, TurnMenuTarget, isHiddenRow } from "./TranscriptRow.js";
|
|
63
64
|
import { TranscriptSearch, TranscriptSearchProps } from "./TranscriptSearch.js";
|
|
64
65
|
import { TurnCommands, TurnCommandsOptions, createTurnCommands, turnViewsOf, useTurnCommands } from "./turn-commands.js";
|
|
65
66
|
import { TurnMenuActions, useTurnMenu } from "./TurnMenu.js";
|
|
66
67
|
import { HostTurnMenuOptions, useHostTurnMenu } from "./use-host-turn-menu.js";
|
|
67
|
-
import { TranscriptRows, TranscriptRowsInput, useSelectStops, useTranscriptRows } from "./use-transcript-rows.js";
|
|
68
|
+
import { TranscriptRows, TranscriptRowsInput, TranscriptSource, useSelectStops, useTranscriptRows } from "./use-transcript-rows.js";
|
|
68
69
|
import { ComposerSearch, useComposerSearch } from "./useComposerSearch.js";
|
|
69
70
|
import { UserBashRow, UserBashRowProps } from "./user-bash.js";
|
|
70
71
|
import { SelectTurnKeysOptions, useSelectTurnKeys } from "./useSelectTurnKeys.js";
|
|
@@ -77,4 +78,4 @@ import { MAX_MATCHES, SearchHighlightStyle, TranscriptSearchOptions, TranscriptS
|
|
|
77
78
|
import { useTranscriptSelectionCopy } from "./useTranscriptSelectionCopy.js";
|
|
78
79
|
import { useWheelHoverPause } from "./useWheelHoverPause.js";
|
|
79
80
|
import { MarkdownViews, MarkdownViewsProps } from "./view-scope.js";
|
|
80
|
-
export { AUTO_FILL_PAGES, AnsiSpans, type AnsiSpansProps, AnsiText, type AnsiTextProps, AttachmentIcon, AttachmentIconProps, AttachmentLabelParts, AuthFailureCard, AuthFailureCardProps, BADGE_GLYPH, BadgeEffectContext, BadgeMenuBrowser, BadgeMenuComposer, BadgeMenuProvider, BadgeMenuProviderProps, BadgeMenuSystem, CHIP_CARD_WIDTH, CODE_PANEL, COMMAND_DETAIL_LINE, CardMarkdown, CardMarkdownProps, Caret, CaretProps, ChipCard, ChipCardProps, ChipHover, ChipHoverProps, ChipOpener, CodeBlockSlotProps, CodemodeScript, type CodemodeScriptProps, CommandCard, CommandCardProps, CommandDetailRow, CommandDetailRowProps, CommandNoteRow, CommandNoteRowProps, CommandScope, CommandScopeContext, CommitCard, CommitCardProps, CompactSummaryRow, CompactSummaryRowProps, ComposerSearch, CvRow, CvRowProps, DEFAULT_TRANSCRIPT_RENDERERS, DefaultInlineText, DefaultInlineTextProps, DefaultMarkdown, DefaultMarkdownProps, DefaultPrompt, DefaultPromptProps, DefaultSessionTitle, DefaultSessionTitleProps, DiffLines, DiffLinesProps, Dot, DotProps, EditDiffBlock, EditDiffBlockProps, EnvironmentSetupDetails, EnvironmentSetupDetailsProps, EnvironmentSetupRow, EnvironmentSetupRowProps, ErrorRow, ErrorRowProps, ExchangeFoldRow, ExchangeFoldRowProps, FILL_MIN_PROMPTS, FailedMark, FailedMarkProps, FailureRow, FailureRowProps, FileBadgeIcon, FileBadgeIconProps, FoldHeader, FoldHeaderProps, GUTTER_STEP_PX, HostTurnMenuOptions, INLINE_CODE_CLASS, ImageGenerationBlock, ImageGenerationBlockProps, InfoRow, InfoRowProps, InlineChipText, InlineChipTextProps, InlineCode, InlineCodeProps, InlineTextSlotProps, InteractionTool, InteractionToolBody, InteractionToolBodyProps, LazyRow, LazyRowProps, LineState, LinkBadge, LinkBadgeProps, LinkIcon, LinkIconProps, LiveOutput, type LiveOutputProps, LiveScriptsContext, LoadEarlierRow, LoadEarlierRowProps, LoadFullOutputButton, LoadFullOutputButtonProps, MAX_MATCHES, Markdown, MarkdownContext, MarkdownContextValue, MarkdownDiagrams, MarkdownDiagramsProps, MarkdownImageProps, MarkdownLinkProps, MarkdownProps, MarkdownSlotProps, MarkdownViews, type MarkdownViewsProps, MermaidDiagram, type MermaidDiagramProps, MessageGroupRow, MessageGroupRowProps, ModelVerdict, ModelVerdictProps, NestedToolCalls, NestedToolCallsProps, NoticeRow, NoticeRowProps, OpenBadgeMenu, OpenSessionContext, ParsedRef, ParsedReferenceUrl, PromptEcho, PromptEchoProps, PromptLines, PromptLinesProps, PromptSlotProps, ProseMarkdown, ProseMarkdownProps, ReadFileBlock, ReadFileBlockProps, RefChip, RefChipProps, RefMatch, ReferenceChip, ReferenceChipProps, ReferenceText, ReferenceTextProps, RepairedRow, RepairedRowProps, RowContext, RowFrame, RowFrameProps, RowIconsContext, RowPlace, RunReceiptInline, RunReceiptInlineProps, RunSummaryRow, RunSummaryRowProps, RunnableCodeBlock, type RunnableCodeBlockProps, ScrollPosition, SearchHighlightStyle, SelectCursor, SelectCursorProps, SelectTurnCommands, SelectTurnExit, SelectTurnHintKeys, SelectTurnHintKeysProps, SelectTurnKeysOptions, SelectTurnProvider, SelectTurnProviderProps, SelectTurnState, SelectTurnValue, SessionCard, SessionCardProps, SessionEventRow, SessionEventRowProps, SessionTitleSlotProps, ShellBlockProvider, type ShellBlockProviderProps, type ShellBlockScope, SkillCard, SkillCardProps, SkillGroupCard, SkillGroupCardProps, SlotEntry, SpawnEndRow, SpawnEndRowProps, SpawnStartRow, SpawnStartRowProps, StickToBottomOptions, SubagentBlock, SubagentBlockProps, TaskBatchRow, TaskBatchRowProps, TaskRow, TaskRowProps, TextPreviewSlotProps, TextRow, TextRowProps, ThinkingBatchRow, ThinkingBatchRowProps, ThinkingRow, ThinkingRowProps, ToolBatchRow, ToolBatchRowProps, ToolBodySlotProps, ToolDetails, ToolDetailsProps, ToolGlyph, ToolGlyphProps, ToolInput, ToolInputProps, ToolMedia, type ToolMediaItem, ToolMediaProps, ToolRow, ToolRowProps, ToolTiming, ToolTimingProps, TranscriptAccounts, TranscriptActions, TranscriptActionsProvider, TranscriptActionsProviderProps, TranscriptFind, TranscriptFindKeyOptions, TranscriptFindOptions, TranscriptFindTarget, TranscriptRail, type TranscriptRailProps, TranscriptRailProvider, type TranscriptRailProviderProps, TranscriptRenderers, TranscriptRenderersProvider, type TranscriptRenderersProviderProps, TranscriptRow, TranscriptRowProps, TranscriptRowSlot, TranscriptRowSlotProps, TranscriptRows, TranscriptRowsInput, TranscriptScrollInputs, TranscriptSearch, TranscriptSearchOptions, TranscriptSearchProps, TranscriptSearchState, TranscriptSettling, TranscriptTurnMenu, TurnCommands, TurnCommandsOptions, TurnMenuActions, TurnMenuTarget, UserBashRow, UserBashRowProps, UserPromptAttachments, UserPromptAttachmentsProps, UserPromptRow, UserPromptRowProps, WorkerDetails, WorkerDetailsProps, classifyInlineRef, copyPromptLines, createTurnCommands, defaultAttachmentLabel, drawsImageGeneration, fileBadgeName, fileBadgeSpec, findRefs, hasInteractionBody, holdForceMountRows, imageRequestsOf, isHiddenRow, lineStateOf, linkGlyph,
|
|
81
|
+
export { AUTO_FILL_PAGES, AnsiSpans, type AnsiSpansProps, AnsiText, type AnsiTextProps, AttachmentIcon, AttachmentIconProps, AttachmentLabelParts, AuthFailureCard, AuthFailureCardProps, BADGE_GLYPH, BadgeEffectContext, BadgeMenuBrowser, BadgeMenuComposer, BadgeMenuProvider, BadgeMenuProviderProps, BadgeMenuSystem, CHIP_CARD_WIDTH, CODE_PANEL, COMMAND_DETAIL_LINE, CardMarkdown, CardMarkdownProps, Caret, CaretProps, ChipCard, ChipCardProps, ChipHover, ChipHoverProps, ChipOpener, CodeBlockSlotProps, CodemodeScript, type CodemodeScriptProps, CommandCard, CommandCardProps, CommandDetailRow, CommandDetailRowProps, CommandNoteRow, CommandNoteRowProps, CommandScope, CommandScopeContext, CommitCard, CommitCardProps, CompactSummaryRow, CompactSummaryRowProps, ComposerSearch, CvRow, CvRowProps, DEFAULT_TRANSCRIPT_RENDERERS, DefaultInlineText, DefaultInlineTextProps, DefaultMarkdown, DefaultMarkdownProps, DefaultPrompt, DefaultPromptProps, DefaultSessionTitle, DefaultSessionTitleProps, DiffLines, DiffLinesProps, Dot, DotProps, EditDiffBlock, EditDiffBlockProps, EnvironmentSetupDetails, EnvironmentSetupDetailsProps, EnvironmentSetupRow, EnvironmentSetupRowProps, ErrorRow, ErrorRowProps, ExchangeFoldRow, ExchangeFoldRowProps, FILL_MIN_PROMPTS, FailedMark, FailedMarkProps, FailureRow, FailureRowProps, FileBadgeIcon, FileBadgeIconProps, FoldHeader, FoldHeaderProps, ForcedRows, GUTTER_STEP_PX, HostTurnMenuOptions, INLINE_CODE_CLASS, ImageGenerationBlock, ImageGenerationBlockProps, InfoRow, InfoRowProps, InlineChipText, InlineChipTextProps, InlineCode, InlineCodeProps, InlineTextSlotProps, InteractionTool, InteractionToolBody, InteractionToolBodyProps, LazyRow, LazyRowProps, LineState, LinkBadge, LinkBadgeProps, LinkIcon, LinkIconProps, LiveOutput, type LiveOutputProps, LiveScriptsContext, LoadEarlierRow, LoadEarlierRowProps, LoadFullOutputButton, LoadFullOutputButtonProps, MAX_MATCHES, Markdown, MarkdownContext, MarkdownContextValue, MarkdownDiagrams, MarkdownDiagramsProps, MarkdownImageProps, MarkdownLinkProps, MarkdownProps, MarkdownSlotProps, MarkdownViews, type MarkdownViewsProps, MermaidDiagram, type MermaidDiagramProps, MessageGroupRow, MessageGroupRowProps, ModelVerdict, ModelVerdictProps, NestedToolCalls, NestedToolCallsProps, NoticeRow, NoticeRowProps, OpenBadgeMenu, OpenSessionContext, ParsedRef, ParsedReferenceUrl, PromptEcho, PromptEchoProps, PromptLines, PromptLinesProps, PromptSlotProps, ProseMarkdown, ProseMarkdownProps, ReadFileBlock, ReadFileBlockProps, RefChip, RefChipProps, RefMatch, ReferenceChip, ReferenceChipProps, ReferenceText, ReferenceTextProps, RepairedRow, RepairedRowProps, RowContext, RowFrame, RowFrameProps, RowIconsContext, RowPlace, RunReceiptInline, RunReceiptInlineProps, RunSummaryRow, RunSummaryRowProps, RunnableCodeBlock, type RunnableCodeBlockProps, ScrollPosition, SearchHighlightStyle, SelectCursor, SelectCursorProps, SelectTurnCommands, SelectTurnExit, SelectTurnHintKeys, SelectTurnHintKeysProps, SelectTurnKeysOptions, SelectTurnProvider, SelectTurnProviderProps, SelectTurnState, SelectTurnValue, SessionCard, SessionCardProps, SessionEventRow, SessionEventRowProps, SessionTitleSlotProps, ShellBlockProvider, type ShellBlockProviderProps, type ShellBlockScope, SkillCard, SkillCardProps, SkillGroupCard, SkillGroupCardProps, SlotEntry, SpawnEndRow, SpawnEndRowProps, SpawnStartRow, SpawnStartRowProps, StickToBottomOptions, SubagentBlock, SubagentBlockProps, TaskBatchRow, TaskBatchRowProps, TaskRow, TaskRowProps, TextPreviewSlotProps, TextRow, TextRowProps, ThinkingBatchRow, ThinkingBatchRowProps, ThinkingRow, ThinkingRowProps, ToolBatchRow, ToolBatchRowProps, ToolBodySlotProps, ToolDetails, ToolDetailsProps, ToolGlyph, ToolGlyphProps, ToolInput, ToolInputProps, ToolMedia, type ToolMediaItem, ToolMediaProps, ToolRow, ToolRowProps, ToolTiming, ToolTimingProps, TranscriptAccounts, TranscriptActions, TranscriptActionsProvider, TranscriptActionsProviderProps, TranscriptFind, TranscriptFindKeyOptions, TranscriptFindOptions, TranscriptFindTarget, TranscriptRail, type TranscriptRailProps, TranscriptRailProvider, type TranscriptRailProviderProps, TranscriptRenderers, TranscriptRenderersProvider, type TranscriptRenderersProviderProps, TranscriptRow, TranscriptRowProps, TranscriptRowSlot, TranscriptRowSlotProps, TranscriptRows, TranscriptRowsInput, TranscriptScrollInputs, TranscriptSearch, TranscriptSearchOptions, TranscriptSearchProps, TranscriptSearchState, TranscriptSettling, TranscriptSource, TranscriptTurnMenu, TurnCommands, TurnCommandsOptions, TurnMenuActions, TurnMenuTarget, UserBashRow, UserBashRowProps, UserPromptAttachments, UserPromptAttachmentsProps, UserPromptRow, UserPromptRowProps, WorkerDetails, WorkerDetailsProps, attachmentSrcOf, classifyInlineRef, copyPromptLines, createTurnCommands, defaultAttachmentLabel, drawsImageGeneration, fileBadgeName, fileBadgeSpec, findRefs, hasInteractionBody, holdForceMountRows, imageRequestsOf, isHiddenRow, lineStateOf, linkGlyph, numberRef, parseRefUrl, parseReferenceUrl, parseToolMedia, refHref, referenceUrl, remarkReferences, remarkRefs, revealRow, savedPaths, siteIconValue, toolMediaSrcOf, turnViewsOf, useBackgroundMount, useBadgeMenu, useChipResolution, useCommand, useCommitInfo, useComposerSearch, useFillViewportScrollback, useForceMountRows, useForcedRows, useFullOutput, useFullToolCall, useHostTurnMenu, useModelName, useRailOutline, useReferenceMatches, useReferenceProviders, useReferenceView, useReferencedSession, useResolveChipNow, useRowIcons, useSelectStops, useSelectTurn, useSelectTurnKeys, useSettledReveal, useShellBlockScope, useSiteIcon, useSkill, useStickToBottom, useToolMedia, useTranscriptActions, useTranscriptFind, useTranscriptFindKey, useTranscriptRailStore, useTranscriptRenderers, useTranscriptRows, useTranscriptScroll, useTranscriptSearch, useTranscriptSelectionCopy, useTurnCommands, useTurnMenu, useWheelHoverPause };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TranscriptActionsProvider, useModelName, useTranscriptActions } from "./actions.js";
|
|
1
|
+
import { TranscriptActionsProvider, attachmentSrcOf, toolMediaSrcOf, useModelName, useTranscriptActions } from "./actions.js";
|
|
2
2
|
import { AnsiSpans, AnsiText } from "./AnsiText.js";
|
|
3
3
|
import { AuthFailureCard } from "./AuthFailureCard.js";
|
|
4
4
|
import { BadgeMenuProvider, useBadgeMenu } from "./BadgeMenu.js";
|
|
@@ -13,22 +13,22 @@ import { DiffLines } from "./DiffLines.js";
|
|
|
13
13
|
import { AUTO_FILL_PAGES, FILL_MIN_PROMPTS, LoadEarlierRow, useFillViewportScrollback } from "./EarlierHistory.js";
|
|
14
14
|
import { EditDiffBlock } from "./EditDiffBlock.js";
|
|
15
15
|
import { EnvironmentSetupDetails, EnvironmentSetupRow } from "./environment-setup.js";
|
|
16
|
-
import { useShellBlockScope } from "./shell-block-scope.js";
|
|
17
16
|
import { InlineCode, RefChip } from "./FileChip.js";
|
|
17
|
+
import { useShellBlockScope } from "./shell-block-scope.js";
|
|
18
18
|
import { ExchangeFoldRow, FoldHeader, LiveScriptsContext } from "./fold.js";
|
|
19
|
-
import { parseToolMedia } from "../headless/transcript/tool-media.js";
|
|
20
19
|
import { WorkerDetails } from "./fold-worker.js";
|
|
20
|
+
import { parseToolMedia } from "../headless/transcript/tool-media.js";
|
|
21
21
|
import { Caret, Dot, FailedMark, GUTTER_STEP_PX, RowFrame, RowIconsContext, lineStateOf, useRowIcons } from "./frame.js";
|
|
22
22
|
import { ImageGenerationBlock, drawsImageGeneration, imageRequestsOf, savedPaths } from "./ImageGenerationBlock.js";
|
|
23
23
|
import { InlineChipText } from "./InlineChipText.js";
|
|
24
24
|
import { InteractionToolBody, hasInteractionBody } from "./InteractionToolBody.js";
|
|
25
|
-
import { CvRow, LazyRow, TranscriptSettling, holdForceMountRows,
|
|
25
|
+
import { CvRow, LazyRow, TranscriptSettling, holdForceMountRows, useBackgroundMount, useForceMountRows, useForcedRows } from "./LazyRow.js";
|
|
26
26
|
import { LiveOutput } from "./LiveOutput.js";
|
|
27
27
|
import { Markdown, MarkdownDiagrams } from "./markdown.js";
|
|
28
28
|
import { CommandScopeContext, INLINE_CODE_CLASS, MarkdownContext, OpenSessionContext } from "./markdown-context.js";
|
|
29
29
|
import { MermaidDiagram } from "./MermaidDiagram.js";
|
|
30
|
-
import { TranscriptRenderersProvider } from "./renderer-slots.js";
|
|
31
30
|
import { MessageGroupRow } from "./messages.js";
|
|
31
|
+
import { TranscriptRenderersProvider } from "./renderer-slots.js";
|
|
32
32
|
import { COMMAND_DETAIL_LINE, CommandDetailRow, CommandNoteRow, ErrorRow, FailureRow, InfoRow, NoticeRow, RepairedRow, SessionEventRow, SpawnEndRow, SpawnStartRow } from "./notices.js";
|
|
33
33
|
import { AttachmentIcon, UserPromptAttachments, UserPromptRow } from "./prompt.js";
|
|
34
34
|
import { PromptLines, copyPromptLines } from "./prompt-lines.js";
|
|
@@ -40,6 +40,7 @@ import { ReferenceChip, ReferenceText } from "./ReferenceText.js";
|
|
|
40
40
|
import { parseReferenceUrl, referenceUrl, remarkReferences } from "./remark-references.js";
|
|
41
41
|
import { classifyInlineRef, findRefs, numberRef, parseRefUrl, refHref, remarkRefs } from "./remark-refs.js";
|
|
42
42
|
import { DEFAULT_TRANSCRIPT_RENDERERS, DefaultInlineText, DefaultMarkdown, DefaultPrompt, DefaultSessionTitle, defaultAttachmentLabel, useTranscriptRenderers } from "./renderers.js";
|
|
43
|
+
import { revealRow } from "./row-mount.js";
|
|
43
44
|
import { CompactSummaryRow, RunReceiptInline, RunSummaryRow } from "./run-rows.js";
|
|
44
45
|
import { SelectCursor } from "./SelectCursor.js";
|
|
45
46
|
import { SelectTurnExit, SelectTurnHintKeys } from "./SelectTurnHint.js";
|
|
@@ -51,9 +52,9 @@ import { TaskBatchRow, TaskRow } from "./tasks.js";
|
|
|
51
52
|
import { ToolBatchRow } from "./tool-batch.js";
|
|
52
53
|
import { ToolDetails } from "./tool-details.js";
|
|
53
54
|
import { ToolMedia, useToolMedia } from "./tool-media.js";
|
|
54
|
-
import { CODE_PANEL, LoadFullOutputButton, ReadFileBlock, ToolGlyph, ToolInput, ToolTiming, useFullOutput } from "./tool-parts.js";
|
|
55
|
+
import { CODE_PANEL, LoadFullOutputButton, ReadFileBlock, ToolGlyph, ToolInput, ToolTiming, useFullOutput, useFullToolCall } from "./tool-parts.js";
|
|
55
56
|
import { ModelVerdict, NestedToolCalls, ToolRow } from "./tool-row.js";
|
|
56
|
-
import { TranscriptRail, TranscriptRailProvider, useTranscriptRailStore } from "./TranscriptRail.js";
|
|
57
|
+
import { TranscriptRail, TranscriptRailProvider, useRailOutline, useTranscriptRailStore } from "./TranscriptRail.js";
|
|
57
58
|
import { TranscriptRow, TranscriptRowSlot, isHiddenRow } from "./TranscriptRow.js";
|
|
58
59
|
import { TranscriptSearch } from "./TranscriptSearch.js";
|
|
59
60
|
import { createTurnCommands, turnViewsOf, useTurnCommands } from "./turn-commands.js";
|
|
@@ -72,4 +73,4 @@ import { MAX_MATCHES, SearchHighlightStyle, useTranscriptSearch } from "./useTra
|
|
|
72
73
|
import { useTranscriptSelectionCopy } from "./useTranscriptSelectionCopy.js";
|
|
73
74
|
import { useWheelHoverPause } from "./useWheelHoverPause.js";
|
|
74
75
|
import { MarkdownViews } from "./view-scope.js";
|
|
75
|
-
export { AUTO_FILL_PAGES, AnsiSpans, AnsiText, AttachmentIcon, AuthFailureCard, BADGE_GLYPH, BadgeMenuProvider, CHIP_CARD_WIDTH, CODE_PANEL, COMMAND_DETAIL_LINE, CardMarkdown, Caret, ChipCard, ChipHover, CodemodeScript, CommandCard, CommandDetailRow, CommandNoteRow, CommandScopeContext, CommitCard, CompactSummaryRow, CvRow, DEFAULT_TRANSCRIPT_RENDERERS, DefaultInlineText, DefaultMarkdown, DefaultPrompt, DefaultSessionTitle, DiffLines, Dot, EditDiffBlock, EnvironmentSetupDetails, EnvironmentSetupRow, ErrorRow, ExchangeFoldRow, FILL_MIN_PROMPTS, FailedMark, FailureRow, FileBadgeIcon, FoldHeader, GUTTER_STEP_PX, INLINE_CODE_CLASS, ImageGenerationBlock, InfoRow, InlineChipText, InlineCode, InteractionToolBody, LazyRow, LinkBadge, LinkIcon, LiveOutput, LiveScriptsContext, LoadEarlierRow, LoadFullOutputButton, MAX_MATCHES, Markdown, MarkdownContext, MarkdownDiagrams, MarkdownViews, MermaidDiagram, MessageGroupRow, ModelVerdict, NestedToolCalls, NoticeRow, OpenSessionContext, PromptEcho, PromptLines, ProseMarkdown, ReadFileBlock, RefChip, ReferenceChip, ReferenceText, RepairedRow, RowFrame, RowIconsContext, RunReceiptInline, RunSummaryRow, RunnableCodeBlock, SearchHighlightStyle, SelectCursor, SelectTurnExit, SelectTurnHintKeys, SelectTurnProvider, SessionCard, SessionEventRow, ShellBlockProvider, SkillCard, SkillGroupCard, SpawnEndRow, SpawnStartRow, SubagentBlock, TaskBatchRow, TaskRow, TextRow, ThinkingBatchRow, ThinkingRow, ToolBatchRow, ToolDetails, ToolGlyph, ToolInput, ToolMedia, ToolRow, ToolTiming, TranscriptActionsProvider, TranscriptRail, TranscriptRailProvider, TranscriptRenderersProvider, TranscriptRow, TranscriptRowSlot, TranscriptSearch, TranscriptSettling, UserBashRow, UserPromptAttachments, UserPromptRow, WorkerDetails, classifyInlineRef, copyPromptLines, createTurnCommands, defaultAttachmentLabel, drawsImageGeneration, fileBadgeName, fileBadgeSpec, findRefs, hasInteractionBody, holdForceMountRows, imageRequestsOf, isHiddenRow, lineStateOf, linkGlyph,
|
|
76
|
+
export { AUTO_FILL_PAGES, AnsiSpans, AnsiText, AttachmentIcon, AuthFailureCard, BADGE_GLYPH, BadgeMenuProvider, CHIP_CARD_WIDTH, CODE_PANEL, COMMAND_DETAIL_LINE, CardMarkdown, Caret, ChipCard, ChipHover, CodemodeScript, CommandCard, CommandDetailRow, CommandNoteRow, CommandScopeContext, CommitCard, CompactSummaryRow, CvRow, DEFAULT_TRANSCRIPT_RENDERERS, DefaultInlineText, DefaultMarkdown, DefaultPrompt, DefaultSessionTitle, DiffLines, Dot, EditDiffBlock, EnvironmentSetupDetails, EnvironmentSetupRow, ErrorRow, ExchangeFoldRow, FILL_MIN_PROMPTS, FailedMark, FailureRow, FileBadgeIcon, FoldHeader, GUTTER_STEP_PX, INLINE_CODE_CLASS, ImageGenerationBlock, InfoRow, InlineChipText, InlineCode, InteractionToolBody, LazyRow, LinkBadge, LinkIcon, LiveOutput, LiveScriptsContext, LoadEarlierRow, LoadFullOutputButton, MAX_MATCHES, Markdown, MarkdownContext, MarkdownDiagrams, MarkdownViews, MermaidDiagram, MessageGroupRow, ModelVerdict, NestedToolCalls, NoticeRow, OpenSessionContext, PromptEcho, PromptLines, ProseMarkdown, ReadFileBlock, RefChip, ReferenceChip, ReferenceText, RepairedRow, RowFrame, RowIconsContext, RunReceiptInline, RunSummaryRow, RunnableCodeBlock, SearchHighlightStyle, SelectCursor, SelectTurnExit, SelectTurnHintKeys, SelectTurnProvider, SessionCard, SessionEventRow, ShellBlockProvider, SkillCard, SkillGroupCard, SpawnEndRow, SpawnStartRow, SubagentBlock, TaskBatchRow, TaskRow, TextRow, ThinkingBatchRow, ThinkingRow, ToolBatchRow, ToolDetails, ToolGlyph, ToolInput, ToolMedia, ToolRow, ToolTiming, TranscriptActionsProvider, TranscriptRail, TranscriptRailProvider, TranscriptRenderersProvider, TranscriptRow, TranscriptRowSlot, TranscriptSearch, TranscriptSettling, UserBashRow, UserPromptAttachments, UserPromptRow, WorkerDetails, attachmentSrcOf, classifyInlineRef, copyPromptLines, createTurnCommands, defaultAttachmentLabel, drawsImageGeneration, fileBadgeName, fileBadgeSpec, findRefs, hasInteractionBody, holdForceMountRows, imageRequestsOf, isHiddenRow, lineStateOf, linkGlyph, numberRef, parseRefUrl, parseReferenceUrl, parseToolMedia, refHref, referenceUrl, remarkReferences, remarkRefs, revealRow, savedPaths, siteIconValue, toolMediaSrcOf, turnViewsOf, useBackgroundMount, useBadgeMenu, useChipResolution, useCommand, useCommitInfo, useComposerSearch, useFillViewportScrollback, useForceMountRows, useForcedRows, useFullOutput, useFullToolCall, useHostTurnMenu, useModelName, useRailOutline, useReferenceMatches, useReferenceProviders, useReferenceView, useReferencedSession, useResolveChipNow, useRowIcons, useSelectStops, useSelectTurn, useSelectTurnKeys, useSettledReveal, useShellBlockScope, useSiteIcon, useSkill, useStickToBottom, useToolMedia, useTranscriptActions, useTranscriptFind, useTranscriptFindKey, useTranscriptRailStore, useTranscriptRenderers, useTranscriptRows, useTranscriptScroll, useTranscriptSearch, useTranscriptSelectionCopy, useTurnCommands, useTurnMenu, useWheelHoverPause };
|
|
@@ -31,4 +31,10 @@ export interface MarkdownParseKey {
|
|
|
31
31
|
*/
|
|
32
32
|
export declare function cachedMarkdown(text: string, key: MarkdownParseKey, parse: () => ReactElement): ReactElement;
|
|
33
33
|
/** Empties the cache (tests). */
|
|
34
|
-
export declare function clearMarkdownCache(): void;
|
|
34
|
+
export declare function clearMarkdownCache(): void;
|
|
35
|
+
/** What the cache holds, and how many parses it took in since it was last emptied (tests, benches). */
|
|
36
|
+
export declare function markdownCacheStats(): {
|
|
37
|
+
entries: number;
|
|
38
|
+
chars: number;
|
|
39
|
+
inserts: number;
|
|
40
|
+
};
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
const MAX_CHARS = 4e5;
|
|
4
4
|
const entries = /* @__PURE__ */ new Map();
|
|
5
5
|
let chars = 0;
|
|
6
|
+
let inserts = 0;
|
|
6
7
|
const ids = /* @__PURE__ */ new WeakMap();
|
|
7
8
|
let nextId = 1;
|
|
8
9
|
function idOf(value) {
|
|
@@ -37,6 +38,7 @@ function cachedMarkdown(text, key, parse) {
|
|
|
37
38
|
chars -= hit.text.length;
|
|
38
39
|
}
|
|
39
40
|
const element = parse();
|
|
41
|
+
inserts++;
|
|
40
42
|
entries.set(id, {
|
|
41
43
|
element,
|
|
42
44
|
text
|
|
@@ -53,5 +55,14 @@ function cachedMarkdown(text, key, parse) {
|
|
|
53
55
|
function clearMarkdownCache() {
|
|
54
56
|
entries.clear();
|
|
55
57
|
chars = 0;
|
|
58
|
+
inserts = 0;
|
|
56
59
|
}
|
|
57
|
-
|
|
60
|
+
/** What the cache holds, and how many parses it took in since it was last emptied (tests, benches). */
|
|
61
|
+
function markdownCacheStats() {
|
|
62
|
+
return {
|
|
63
|
+
entries: entries.size,
|
|
64
|
+
chars,
|
|
65
|
+
inserts
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export { cachedMarkdown, clearMarkdownCache, markdownCacheStats };
|
|
@@ -3,13 +3,14 @@ import { CodeFrame } from "../../components/CodeFrame.js";
|
|
|
3
3
|
import { useExtensionItems } from "../../extensions/ExtensionsProvider.js";
|
|
4
4
|
import { renderersFor } from "../../extensions/headless/select.js";
|
|
5
5
|
import { useLinkRouter } from "../../extensions/links.js";
|
|
6
|
-
import {
|
|
6
|
+
import { splitMarkdown } from "../headless/markdown-chunks.js";
|
|
7
|
+
import { MarkdownStream } from "../headless/markdown-stream.js";
|
|
7
8
|
import { DiagramsContext } from "./diagrams-scope.js";
|
|
8
9
|
import { useBackgroundMount, useForceMountRows } from "./LazyRow.js";
|
|
9
10
|
import { cachedMarkdown } from "./markdown-cache.js";
|
|
10
11
|
import { useShellBlockRunner } from "./shell-block-scope.js";
|
|
11
12
|
import { ChunkFencesContext, ChunkFencesScope, ViewFencePart, chunkFencesFor, fenceIndexIn, preloadViews, useViewTurn, useViewsEnabled, viewFenceStarts } from "./view-scope.js";
|
|
12
|
-
import {
|
|
13
|
+
import { Suspense, createContext, lazy, memo, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
13
14
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
14
15
|
import { isShellFence, mayHoldViewFence } from "zidane/chat/pure";
|
|
15
16
|
import ReactMarkdown, { defaultUrlTransform } from "react-markdown";
|
|
@@ -246,16 +247,55 @@ const documentComponents = {
|
|
|
246
247
|
em: ({ children }) => /* @__PURE__ */ jsx("em", { children })
|
|
247
248
|
};
|
|
248
249
|
const REMARK_PLUGINS = [remarkGfm];
|
|
249
|
-
|
|
250
|
-
document
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
250
|
+
function sameParseKey(a, b) {
|
|
251
|
+
return a.document === b.document && a.plugins === b.plugins && a.urlTransform === b.urlTransform;
|
|
252
|
+
}
|
|
253
|
+
const MarkdownChunk = memo(({ text, document, plugins, urlTransform, live = false }) => {
|
|
254
|
+
const key = {
|
|
255
|
+
document: Boolean(document),
|
|
256
|
+
plugins: plugins ?? void 0,
|
|
257
|
+
urlTransform
|
|
258
|
+
};
|
|
259
|
+
const last = useRef(null);
|
|
260
|
+
const parse = () => ReactMarkdown({
|
|
261
|
+
remarkPlugins: plugins,
|
|
262
|
+
components: document ? documentComponents : components,
|
|
263
|
+
...urlTransform ? { urlTransform } : {},
|
|
264
|
+
children: text
|
|
265
|
+
});
|
|
266
|
+
const held = last.current;
|
|
267
|
+
const element = live ? parse() : cachedMarkdown(text, key, () => held && held.text === text && sameParseKey(held.key, key) ? held.element : parse());
|
|
268
|
+
last.current = {
|
|
269
|
+
text,
|
|
270
|
+
key,
|
|
271
|
+
element
|
|
272
|
+
};
|
|
273
|
+
return element;
|
|
274
|
+
});
|
|
275
|
+
/** One chunk: its parse, in its view fences' scope with views on. */
|
|
276
|
+
function ChunkPart({ text, fences, document, plugins, urlTransform, live = false }) {
|
|
277
|
+
const parsed = /* @__PURE__ */ jsx(MarkdownChunk, {
|
|
278
|
+
text,
|
|
279
|
+
document,
|
|
280
|
+
plugins,
|
|
281
|
+
urlTransform,
|
|
282
|
+
live
|
|
283
|
+
});
|
|
284
|
+
return fences ? /* @__PURE__ */ jsx(ChunkFencesScope, {
|
|
285
|
+
base: fences.base,
|
|
286
|
+
starts: fences.starts,
|
|
287
|
+
children: parsed
|
|
288
|
+
}) : parsed;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* The chunks that no longer change, as siblings in the prose box. It renders again only when one more closes (the
|
|
292
|
+
* stream keeps the array until then), so a frame of a long streaming reply reconciles its tail, not every chunk.
|
|
293
|
+
*/
|
|
294
|
+
const SettledChunks = memo(({ chunks, count, fences, ...rest }) => /* @__PURE__ */ jsx(Fragment$1, { children: chunks.slice(0, count).map((chunk, i) => /* @__PURE__ */ jsx(ChunkPart, {
|
|
295
|
+
text: chunk,
|
|
296
|
+
fences: fences?.[i],
|
|
297
|
+
...rest
|
|
298
|
+
}, i)) }));
|
|
259
299
|
/** Chunks rendered in a long text's first commit, then per frame until all are in. */
|
|
260
300
|
const CHUNKS_PER_FRAME = 2;
|
|
261
301
|
/**
|
|
@@ -270,16 +310,35 @@ const CHUNKS_PER_FRAME = 2;
|
|
|
270
310
|
* @param props - The {@link MarkdownProps}.
|
|
271
311
|
*/
|
|
272
312
|
const Markdown = memo(({ children, className, style, document, streaming = false, remarkPlugins = REMARK_PLUGINS, urlTransform, CodeBlock = HighlightedCode, Link = PlainLink, InlineCode, Image }) => {
|
|
273
|
-
const
|
|
274
|
-
if (streaming)
|
|
275
|
-
const fine = streamed.current;
|
|
313
|
+
const stream = useRef(null);
|
|
314
|
+
if (streaming) stream.current ??= new MarkdownStream();
|
|
276
315
|
const views = useViewsEnabled();
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
316
|
+
const { closed, tail, fence } = useMemo(() => {
|
|
317
|
+
if (!stream.current) {
|
|
318
|
+
const chunks = splitMarkdown(children);
|
|
319
|
+
return {
|
|
320
|
+
closed: chunks.slice(0, -1),
|
|
321
|
+
tail: chunks.at(-1),
|
|
322
|
+
fence: null
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
return stream.current.frame(children, streaming);
|
|
326
|
+
}, [children, streaming]);
|
|
327
|
+
const fencesMemo = useRef(null);
|
|
328
|
+
const closedFences = useMemo(() => {
|
|
329
|
+
if (!views) return null;
|
|
330
|
+
const fences = chunkFencesFor(closed, fencesMemo.current);
|
|
331
|
+
fencesMemo.current = {
|
|
332
|
+
chunks: closed,
|
|
333
|
+
fences
|
|
334
|
+
};
|
|
335
|
+
return fences;
|
|
336
|
+
}, [closed, views]);
|
|
337
|
+
const lastFences = closedFences?.at(-1);
|
|
338
|
+
const tailFences = views ? {
|
|
339
|
+
base: lastFences ? lastFences.base + lastFences.starts.length : 0,
|
|
340
|
+
starts: viewFenceStarts(tail)
|
|
341
|
+
} : null;
|
|
283
342
|
const parts = useMemo(() => ({
|
|
284
343
|
CodeBlock,
|
|
285
344
|
Link,
|
|
@@ -291,16 +350,16 @@ const Markdown = memo(({ children, className, style, document, streaming = false
|
|
|
291
350
|
InlineCode,
|
|
292
351
|
Image
|
|
293
352
|
]);
|
|
294
|
-
const tail = streaming ? openFenceOf(chunks[chunks.length - 1]) : null;
|
|
295
353
|
const searching = useForceMountRows();
|
|
296
354
|
const renderers = useExtensionItems("renderer");
|
|
297
355
|
const diagrams = useContext(DiagramsContext) && !claimsLanguage(renderers, "mermaid");
|
|
298
|
-
if (views && streaming && mayHoldViewFence(
|
|
356
|
+
if (views && streaming && mayHoldViewFence(tail) && !claimsLanguage(renderers, "view")) preloadViews();
|
|
299
357
|
const background = useBackgroundMount();
|
|
300
358
|
const [shown, setShown] = useState(CHUNKS_PER_FRAME);
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
|
|
359
|
+
const total = closed.length + 1;
|
|
360
|
+
const complete = useRef(!background || total <= CHUNKS_PER_FRAME);
|
|
361
|
+
if (searching || shown >= total) complete.current = true;
|
|
362
|
+
const visible = complete.current ? total : shown;
|
|
304
363
|
useEffect(() => {
|
|
305
364
|
if (complete.current) return void 0;
|
|
306
365
|
let timer = 0;
|
|
@@ -312,38 +371,41 @@ const Markdown = memo(({ children, className, style, document, streaming = false
|
|
|
312
371
|
window.clearTimeout(timer);
|
|
313
372
|
};
|
|
314
373
|
}, [visible]);
|
|
374
|
+
const plugins = remarkPlugins;
|
|
375
|
+
const transform = Image ? withMediaSources(urlTransform) : urlTransform;
|
|
376
|
+
const tailText = fence ? fence.before : tail;
|
|
377
|
+
const tailShown = closed.length < visible;
|
|
315
378
|
return /* @__PURE__ */ jsx(PartsContext.Provider, {
|
|
316
379
|
value: parts,
|
|
317
|
-
children: /* @__PURE__ */
|
|
380
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
318
381
|
className: `zg-md${views ? " zg-md-views" : ""} ${className ?? ""}`,
|
|
319
382
|
style,
|
|
320
|
-
children:
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
})
|
|
383
|
+
children: [/* @__PURE__ */ jsx(SettledChunks, {
|
|
384
|
+
chunks: closed,
|
|
385
|
+
count: Math.min(visible, closed.length),
|
|
386
|
+
fences: closedFences,
|
|
387
|
+
document,
|
|
388
|
+
plugins,
|
|
389
|
+
urlTransform: transform
|
|
390
|
+
}), tailShown ? /* @__PURE__ */ jsxs(Fragment$1, { children: [tailText ? /* @__PURE__ */ jsx(ChunkPart, {
|
|
391
|
+
text: tailText,
|
|
392
|
+
fences: tailFences,
|
|
393
|
+
document,
|
|
394
|
+
plugins,
|
|
395
|
+
urlTransform: transform,
|
|
396
|
+
live: streaming
|
|
397
|
+
}) : null, fence ? diagrams && fence.language === "mermaid" && fence.code.trim() ? /* @__PURE__ */ jsx(DiagramFence, {
|
|
398
|
+
code: fence.code,
|
|
399
|
+
streaming: true
|
|
400
|
+
}) : views && fence.language === "view" ? /* @__PURE__ */ jsx(ViewFenceBlock, {
|
|
401
|
+
code: fence.code,
|
|
402
|
+
index: (tailFences?.base ?? 0) + viewFenceStarts(fence.before).length,
|
|
403
|
+
streaming: true,
|
|
404
|
+
CodeBlock
|
|
405
|
+
}) : /* @__PURE__ */ jsx(CodeBlock, {
|
|
406
|
+
code: fence.code,
|
|
407
|
+
language: fence.language
|
|
408
|
+
}) : null] }) : null]
|
|
347
409
|
})
|
|
348
410
|
});
|
|
349
411
|
});
|