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
|
@@ -11,6 +11,15 @@
|
|
|
11
11
|
* closes it. A click, or the previous / next message keys, glides the prompt
|
|
12
12
|
* to the top; next past the last prompt glides to the end of its answer.
|
|
13
13
|
*
|
|
14
|
+
* Every prompt of the session has a tick, loaded or not: the transcript's
|
|
15
|
+
* host gives the session's outline (`Transcript.outline`), and a tick whose
|
|
16
|
+
* history is not loaded yet loads up to it (`Transcript.loadThrough`) when
|
|
17
|
+
* picked, pulsing meanwhile, then lands there.
|
|
18
|
+
*
|
|
19
|
+
* A tick is 8px tall. Past `RAIL_MAX_TICKS` of them (or the view's height,
|
|
20
|
+
* less `RAIL_FIT_INSET_PX` above and below) the list scrolls: the edges with
|
|
21
|
+
* more ticks fade, and the tick in view is kept in sight.
|
|
22
|
+
*
|
|
14
23
|
* The rail floats over that space: showing, hiding or growing it never moves
|
|
15
24
|
* the layout. It hides with fewer than two prompts, where the space has no
|
|
16
25
|
* room for it, and on touch screens.
|
|
@@ -27,9 +36,11 @@
|
|
|
27
36
|
* The transcript under the provider publishes its exchanges to it; one
|
|
28
37
|
* provider holds one transcript.
|
|
29
38
|
*/
|
|
39
|
+
import { Transcript } from "../headless/host.js";
|
|
30
40
|
import { Cluster, Row } from "../headless/transcript/rows.js";
|
|
31
41
|
import { TranscriptRailStore } from "../headless/transcript/rail.js";
|
|
32
42
|
import "../headless/transcript/index.js";
|
|
43
|
+
import { TranscriptRowsSlice } from "../headless/transcript/incremental.js";
|
|
33
44
|
import { CSSProperties, ReactNode, RefObject } from "react";
|
|
34
45
|
import { RunReceipt } from "zidane/chat/pure";
|
|
35
46
|
/** Props for {@link TranscriptRailProvider}. */
|
|
@@ -49,12 +60,24 @@ export declare function useTranscriptRailStore(): TranscriptRailStore | null;
|
|
|
49
60
|
* The transcript's side of the rail: publishes its exchanges and the cursor's exchange to the provider's store.
|
|
50
61
|
* Outside a provider it computes nothing.
|
|
51
62
|
*
|
|
52
|
-
* @param clusters - The root clusters the transcript paints.
|
|
63
|
+
* @param clusters - The root clusters the transcript paints, or their settled and open parts (the settled ones fold once).
|
|
53
64
|
* @param isHidden - Whether a row paints nothing.
|
|
54
65
|
* @param receipts - The receipts docked on reply rows.
|
|
55
66
|
* @param selectedTurn - Select-turn mode's selected stop (a turn id), or `null`.
|
|
56
67
|
*/
|
|
57
|
-
export declare function useRailPublish(clusters: readonly Cluster[]
|
|
68
|
+
export declare function useRailPublish(clusters: readonly Cluster[] | {
|
|
69
|
+
settled: TranscriptRowsSlice;
|
|
70
|
+
open: TranscriptRowsSlice;
|
|
71
|
+
}, isHidden: (row: Row) => boolean, receipts: ReadonlyMap<string, RunReceipt>, selectedTurn: string | null): TranscriptRailStore | null;
|
|
72
|
+
/**
|
|
73
|
+
* The transcript host's side of the rail: hands it the session's prompt outline while part of the history is not
|
|
74
|
+
* loaded, and how to load up to one of them. Read again when the session changes, when more history becomes
|
|
75
|
+
* loadable, and when the outline no longer matches the loaded rows (the history was rewritten).
|
|
76
|
+
*
|
|
77
|
+
* @param transcript - The session's transcript, from its host.
|
|
78
|
+
* @param hasEarlier - Older history is not loaded yet.
|
|
79
|
+
*/
|
|
80
|
+
export declare function useRailOutline(transcript: Transcript, hasEarlier: boolean): void;
|
|
58
81
|
/** Props for {@link RailTint}. */
|
|
59
82
|
interface RailTintProps {
|
|
60
83
|
store: TranscriptRailStore;
|
|
@@ -3,11 +3,11 @@ import "../../components/floating/hover-delay.js";
|
|
|
3
3
|
import { useKeyCommands } from "../../keybindings/KeyCommands.js";
|
|
4
4
|
import { useReducedMotion } from "../../motion/reduced.js";
|
|
5
5
|
import { constant, useReadable } from "../headless/store.js";
|
|
6
|
-
import { EMPTY_RAIL, computeRailModel, createTranscriptRailStore, dataRowSelector } from "../headless/transcript/rail.js";
|
|
6
|
+
import { EMPTY_RAIL, computeRailModel, computeRailModelParts, createTranscriptRailStore, dataRowSelector, railWithOutline } from "../headless/transcript/rail.js";
|
|
7
7
|
import { useChatLabels } from "../useChatLabels.js";
|
|
8
8
|
import { useModelName } from "./actions.js";
|
|
9
|
-
import { mountRowNow } from "./LazyRow.js";
|
|
10
9
|
import { RUN_RECEIPT_TINT, ReceiptValue } from "./receipt-parts.js";
|
|
10
|
+
import { revealRow } from "./row-mount.js";
|
|
11
11
|
import { SelectCursor } from "./SelectCursor.js";
|
|
12
12
|
import { createContext, memo, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
13
13
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -20,6 +20,12 @@ const RAIL_WIDTH_PX = 16;
|
|
|
20
20
|
* once that space is wider than twice this, it stays this far from the edge, clear of the conversation.
|
|
21
21
|
*/
|
|
22
22
|
const RAIL_EDGE_INSET_PX = 16;
|
|
23
|
+
/** A tick's height: its hit area. */
|
|
24
|
+
const TICK_PX = 8;
|
|
25
|
+
/** How far the list's scrolling edges fade (`.zg-prompt-rail-ticks[data-fade-*]`). */
|
|
26
|
+
const FADE_PX = 24;
|
|
27
|
+
/** The space kept above and below the rail when its ticks fill the view's height. */
|
|
28
|
+
const RAIL_FIT_INSET_PX = 24;
|
|
23
29
|
/** Where a jump puts the prompt: this far below the view's top. */
|
|
24
30
|
const JUMP_MARGIN_PX = 16;
|
|
25
31
|
/** The exchange in view is the last one starting above this line: this share of the view down, at most `SPY_LINE_MAX_PX`. */
|
|
@@ -57,14 +63,17 @@ function useTranscriptRailStore() {
|
|
|
57
63
|
* The transcript's side of the rail: publishes its exchanges and the cursor's exchange to the provider's store.
|
|
58
64
|
* Outside a provider it computes nothing.
|
|
59
65
|
*
|
|
60
|
-
* @param clusters - The root clusters the transcript paints.
|
|
66
|
+
* @param clusters - The root clusters the transcript paints, or their settled and open parts (the settled ones fold once).
|
|
61
67
|
* @param isHidden - Whether a row paints nothing.
|
|
62
68
|
* @param receipts - The receipts docked on reply rows.
|
|
63
69
|
* @param selectedTurn - Select-turn mode's selected stop (a turn id), or `null`.
|
|
64
70
|
*/
|
|
65
71
|
function useRailPublish(clusters, isHidden, receipts, selectedTurn) {
|
|
66
72
|
const store = useContext(RailContext);
|
|
67
|
-
const model = useMemo(() => store ? computeRailModel(clusters, {
|
|
73
|
+
const model = useMemo(() => store ? Array.isArray(clusters) ? computeRailModel(clusters, {
|
|
74
|
+
isHidden,
|
|
75
|
+
receipts
|
|
76
|
+
}) : computeRailModelParts(clusters, {
|
|
68
77
|
isHidden,
|
|
69
78
|
receipts
|
|
70
79
|
}) : null, [
|
|
@@ -83,6 +92,73 @@ function useRailPublish(clusters, isHidden, receipts, selectedTurn) {
|
|
|
83
92
|
}, [store, selected]);
|
|
84
93
|
return store;
|
|
85
94
|
}
|
|
95
|
+
/** How long a jump to an unloaded prompt waits for its rows to be painted once its history is in. */
|
|
96
|
+
const LANDING_WAIT_MS = 3e3;
|
|
97
|
+
/**
|
|
98
|
+
* The transcript host's side of the rail: hands it the session's prompt outline while part of the history is not
|
|
99
|
+
* loaded, and how to load up to one of them. Read again when the session changes, when more history becomes
|
|
100
|
+
* loadable, and when the outline no longer matches the loaded rows (the history was rewritten).
|
|
101
|
+
*
|
|
102
|
+
* @param transcript - The session's transcript, from its host.
|
|
103
|
+
* @param hasEarlier - Older history is not loaded yet.
|
|
104
|
+
*/
|
|
105
|
+
function useRailOutline(transcript, hasEarlier) {
|
|
106
|
+
const store = useContext(RailContext);
|
|
107
|
+
const read = transcript.outline;
|
|
108
|
+
const loadThrough = transcript.loadThrough ?? null;
|
|
109
|
+
const [stale, setStale] = useState(0);
|
|
110
|
+
useEffect(() => {
|
|
111
|
+
if (!store || !read || !hasEarlier) {
|
|
112
|
+
store?.publishOutline(null, null);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
let cancelled = false;
|
|
116
|
+
read().then((outline) => {
|
|
117
|
+
if (!cancelled) store.publishOutline(outline && outline.prompts.length > 0 ? outline.prompts : null, loadThrough);
|
|
118
|
+
}).catch(() => {
|
|
119
|
+
if (!cancelled) store.publishOutline(null, null);
|
|
120
|
+
});
|
|
121
|
+
return () => {
|
|
122
|
+
cancelled = true;
|
|
123
|
+
};
|
|
124
|
+
}, [
|
|
125
|
+
store,
|
|
126
|
+
read,
|
|
127
|
+
loadThrough,
|
|
128
|
+
hasEarlier,
|
|
129
|
+
stale
|
|
130
|
+
]);
|
|
131
|
+
useEffect(() => {
|
|
132
|
+
if (!store) return void 0;
|
|
133
|
+
let checked = null;
|
|
134
|
+
return store.subscribe(() => {
|
|
135
|
+
const { outline, exchanges, exchangeOfTurn } = store.get();
|
|
136
|
+
if (!outline || exchanges.length === 0 || checked === outline) return;
|
|
137
|
+
checked = outline;
|
|
138
|
+
if (!outline.some((p) => exchangeOfTurn.has(p.turnId))) setStale((n) => n + 1);
|
|
139
|
+
});
|
|
140
|
+
}, [store]);
|
|
141
|
+
useEffect(() => store ? () => store.publishOutline(null, null) : void 0, [store]);
|
|
142
|
+
}
|
|
143
|
+
/** The id of the exchange holding `turnId` once the transcript paints it, or `null` past {@link LANDING_WAIT_MS}. */
|
|
144
|
+
function exchangeOnceLoaded(store, turnId) {
|
|
145
|
+
const now = store.get().exchangeOfTurn.get(turnId);
|
|
146
|
+
if (now) return Promise.resolve(now);
|
|
147
|
+
return new Promise((resolve) => {
|
|
148
|
+
let timer = 0;
|
|
149
|
+
const off = store.subscribe(() => {
|
|
150
|
+
const id = store.get().exchangeOfTurn.get(turnId);
|
|
151
|
+
if (!id) return;
|
|
152
|
+
window.clearTimeout(timer);
|
|
153
|
+
off();
|
|
154
|
+
resolve(id);
|
|
155
|
+
});
|
|
156
|
+
timer = window.setTimeout(() => {
|
|
157
|
+
off();
|
|
158
|
+
resolve(null);
|
|
159
|
+
}, LANDING_WAIT_MS);
|
|
160
|
+
});
|
|
161
|
+
}
|
|
86
162
|
/**
|
|
87
163
|
* The hovered exchange's tint, behind the transcript's rows (the select cursor's element, without following).
|
|
88
164
|
*
|
|
@@ -110,6 +186,36 @@ RailTint.displayName = "RailTint";
|
|
|
110
186
|
function promptRow(scroller, id) {
|
|
111
187
|
return scroller.querySelector(dataRowSelector(id));
|
|
112
188
|
}
|
|
189
|
+
/** The rail's height: its ticks, at most `RAIL_MAX_TICKS` of them and whole ones that fit in `room`. */
|
|
190
|
+
function railHeight(ticks, room) {
|
|
191
|
+
return Math.min(ticks * TICK_PX, 320, Math.floor(room / TICK_PX) * TICK_PX);
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Where the rail's middle goes in its offset parent. Centred on the view when the view is at its tallest yet (or moved);
|
|
195
|
+
* as the view only gets shorter (the composer grows), it stays where it was while it fits between the view's edges
|
|
196
|
+
* (less `RAIL_FIT_INSET_PX`), and moves as little as it must when it doesn't.
|
|
197
|
+
*
|
|
198
|
+
* @param home - The kept centre, and the view it was taken in.
|
|
199
|
+
* @param viewTop - The view's top in the offset parent.
|
|
200
|
+
* @param viewHeight - The view's height.
|
|
201
|
+
* @param height - The rail's height.
|
|
202
|
+
*/
|
|
203
|
+
function holdTop(home, viewTop, viewHeight, height) {
|
|
204
|
+
const kept = home.current;
|
|
205
|
+
if (!kept || kept.viewTop !== viewTop || viewHeight >= kept.viewHeight) home.current = {
|
|
206
|
+
center: viewTop + viewHeight / 2,
|
|
207
|
+
viewTop,
|
|
208
|
+
viewHeight
|
|
209
|
+
};
|
|
210
|
+
const center = home.current.center;
|
|
211
|
+
const lowest = viewTop + RAIL_FIT_INSET_PX + height / 2;
|
|
212
|
+
const highest = viewTop + viewHeight - RAIL_FIT_INSET_PX - height / 2;
|
|
213
|
+
return lowest > highest ? viewTop + viewHeight / 2 : Math.min(Math.max(center, lowest), highest);
|
|
214
|
+
}
|
|
215
|
+
/** The exchanges whose rows are loaded: the ones the view can be in. */
|
|
216
|
+
function loadedOnly(exchanges) {
|
|
217
|
+
return exchanges.length > 0 && exchanges[0].unloaded ? exchanges.filter((e) => !e.unloaded) : exchanges;
|
|
218
|
+
}
|
|
113
219
|
/** A tick's accessible name: the prompt, past `TICK_LABEL_CHARS` cut at a word boundary with an ellipsis. */
|
|
114
220
|
function tickLabel(prompt) {
|
|
115
221
|
if (prompt.length <= TICK_LABEL_CHARS) return prompt;
|
|
@@ -143,12 +249,24 @@ function spyExchange(scroller, exchanges) {
|
|
|
143
249
|
*/
|
|
144
250
|
function TranscriptRail({ scroller, keys = false, className, style }) {
|
|
145
251
|
const store = useContext(RailContext);
|
|
146
|
-
const { exchanges, hovered, selected } = useReadable(store ?? NO_RAIL);
|
|
252
|
+
const { exchanges: loaded, exchangeOfTurn, hovered, selected, outline, loadThrough } = useReadable(store ?? NO_RAIL);
|
|
253
|
+
const exchanges = useMemo(() => railWithOutline({
|
|
254
|
+
exchanges: loaded,
|
|
255
|
+
exchangeOfTurn
|
|
256
|
+
}, outline), [
|
|
257
|
+
loaded,
|
|
258
|
+
exchangeOfTurn,
|
|
259
|
+
outline
|
|
260
|
+
]);
|
|
261
|
+
const [pending, setPending] = useState(null);
|
|
147
262
|
const labels = useChatLabels();
|
|
148
263
|
const reduced = useReducedMotion();
|
|
149
264
|
const root = useRef(null);
|
|
150
265
|
const list = useRef(null);
|
|
151
266
|
const [place, setPlace] = useState(null);
|
|
267
|
+
const home = useRef(null);
|
|
268
|
+
const tickCount = useRef(exchanges.length);
|
|
269
|
+
tickCount.current = exchanges.length;
|
|
152
270
|
const any = exchanges.length > 0;
|
|
153
271
|
useLayoutEffect(() => {
|
|
154
272
|
const el = scroller.current;
|
|
@@ -171,10 +289,12 @@ function TranscriptRail({ scroller, keys = false, className, style }) {
|
|
|
171
289
|
}
|
|
172
290
|
const base = parent.getBoundingClientRect();
|
|
173
291
|
const left = Math.round(edge + Math.min((room - RAIL_WIDTH_PX) / 2, RAIL_EDGE_INSET_PX) - base.left);
|
|
174
|
-
const
|
|
175
|
-
|
|
292
|
+
const height = Math.max(16, el.clientHeight - 48);
|
|
293
|
+
const top = Math.round(holdTop(home, view.top - base.top, el.clientHeight, railHeight(tickCount.current, height)));
|
|
294
|
+
setPlace((prev) => prev && prev.left === left && prev.top === top && prev.room === height ? prev : {
|
|
176
295
|
left,
|
|
177
|
-
top
|
|
296
|
+
top,
|
|
297
|
+
room: height
|
|
178
298
|
});
|
|
179
299
|
};
|
|
180
300
|
measure();
|
|
@@ -195,7 +315,7 @@ function TranscriptRail({ scroller, keys = false, className, style }) {
|
|
|
195
315
|
let frame = 0;
|
|
196
316
|
const read = () => {
|
|
197
317
|
frame = 0;
|
|
198
|
-
if (!jumping.current) setSpied(spyExchange(el, exchangesRef.current));
|
|
318
|
+
if (!jumping.current) setSpied(spyExchange(el, loadedOnly(exchangesRef.current)));
|
|
199
319
|
};
|
|
200
320
|
const onScroll = () => {
|
|
201
321
|
const jump = jumping.current;
|
|
@@ -251,19 +371,30 @@ function TranscriptRail({ scroller, keys = false, className, style }) {
|
|
|
251
371
|
};
|
|
252
372
|
aimFrame.current = requestAnimationFrame(aim);
|
|
253
373
|
};
|
|
254
|
-
const
|
|
374
|
+
const land = (id) => {
|
|
255
375
|
const el = scroller.current;
|
|
256
|
-
const row = el ?
|
|
376
|
+
const row = el ? revealRow(el, id) : null;
|
|
257
377
|
if (!el || !row) return;
|
|
258
|
-
mountRowNow(row);
|
|
259
378
|
glide(el, id, false, () => el.scrollTop + row.getBoundingClientRect().top - el.getBoundingClientRect().top - JUMP_MARGIN_PX);
|
|
260
379
|
};
|
|
380
|
+
const reach = async (id, unloaded) => {
|
|
381
|
+
if (!store || !loadThrough || pending === id) return;
|
|
382
|
+
setPending(id);
|
|
383
|
+
const landing = await loadThrough(unloaded.index).catch(() => false) ? await exchangeOnceLoaded(store, unloaded.turnId) : null;
|
|
384
|
+
setPending((at) => at === id ? null : at);
|
|
385
|
+
if (landing) land(landing);
|
|
386
|
+
};
|
|
387
|
+
const jump = (id) => {
|
|
388
|
+
const unloaded = exchangesRef.current.find((e) => e.id === id)?.unloaded;
|
|
389
|
+
if (unloaded) reach(id, unloaded);
|
|
390
|
+
else land(id);
|
|
391
|
+
};
|
|
261
392
|
const step = (dir) => {
|
|
262
393
|
const el = scroller.current;
|
|
263
394
|
const all = exchangesRef.current;
|
|
264
395
|
if (!el || all.length === 0) return;
|
|
265
396
|
const inFlight = selected === null ? jumping.current : null;
|
|
266
|
-
const current = selected ?? inFlight?.id ?? spyExchange(el, all);
|
|
397
|
+
const current = selected ?? inFlight?.id ?? spyExchange(el, loadedOnly(all));
|
|
267
398
|
let at = all.findIndex((e) => e.id === current);
|
|
268
399
|
if (dir > 0) at++;
|
|
269
400
|
else if (inFlight) {
|
|
@@ -305,13 +436,34 @@ function TranscriptRail({ scroller, keys = false, className, style }) {
|
|
|
305
436
|
window.clearTimeout(cardTimer.current);
|
|
306
437
|
cardTimer.current = window.setTimeout(showCard, 150, null);
|
|
307
438
|
}, [store, showCard]);
|
|
439
|
+
const [edges, setEdges] = useState({
|
|
440
|
+
top: false,
|
|
441
|
+
bottom: false
|
|
442
|
+
});
|
|
443
|
+
const readEdges = useCallback(() => {
|
|
444
|
+
const box = list.current;
|
|
445
|
+
const next = box ? {
|
|
446
|
+
top: box.scrollTop > 1,
|
|
447
|
+
bottom: box.scrollTop + box.clientHeight < box.scrollHeight - 1
|
|
448
|
+
} : {
|
|
449
|
+
top: false,
|
|
450
|
+
bottom: false
|
|
451
|
+
};
|
|
452
|
+
setEdges((prev) => prev.top === next.top && prev.bottom === next.bottom ? prev : next);
|
|
453
|
+
}, []);
|
|
454
|
+
useLayoutEffect(readEdges, [
|
|
455
|
+
readEdges,
|
|
456
|
+
exchanges.length,
|
|
457
|
+
place
|
|
458
|
+
]);
|
|
308
459
|
useEffect(() => {
|
|
309
460
|
const box = list.current;
|
|
310
461
|
const tick = active ? [...box?.querySelectorAll("[data-exchange]") ?? []].find((el) => el.dataset.exchange === active) : null;
|
|
311
462
|
if (!box || !tick) return;
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
463
|
+
const margin = Math.min(FADE_PX, box.clientHeight / 4);
|
|
464
|
+
if (tick.offsetTop < box.scrollTop + margin || tick.offsetTop + tick.offsetHeight > box.scrollTop + box.clientHeight - margin) box.scrollTop = tick.offsetTop + tick.offsetHeight / 2 - box.clientHeight / 2;
|
|
465
|
+
readEdges();
|
|
466
|
+
}, [active, readEdges]);
|
|
315
467
|
const onKeyDown = (e) => {
|
|
316
468
|
if (e.key === "Escape") {
|
|
317
469
|
if (!cardOpen.current && hovered === null) return;
|
|
@@ -354,6 +506,10 @@ function TranscriptRail({ scroller, keys = false, className, style }) {
|
|
|
354
506
|
"aria-orientation": "vertical",
|
|
355
507
|
"aria-label": labels.promptRail,
|
|
356
508
|
className: "zg-prompt-rail-ticks",
|
|
509
|
+
style: place ? { maxHeight: Math.min(320, Math.floor(place.room / TICK_PX) * TICK_PX) } : void 0,
|
|
510
|
+
"data-fade-top": edges.top ? "" : void 0,
|
|
511
|
+
"data-fade-bottom": edges.bottom ? "" : void 0,
|
|
512
|
+
onScroll: readEdges,
|
|
357
513
|
onPointerLeave: leave,
|
|
358
514
|
onBlur: (e) => {
|
|
359
515
|
if (!e.currentTarget.contains(e.relatedTarget)) leave();
|
|
@@ -364,6 +520,8 @@ function TranscriptRail({ scroller, keys = false, className, style }) {
|
|
|
364
520
|
className: "zg-prompt-rail-tick",
|
|
365
521
|
"data-exchange": exchange.id,
|
|
366
522
|
"data-hover": exchange.id === hovered ? "" : void 0,
|
|
523
|
+
"data-pending": exchange.id === pending ? "" : void 0,
|
|
524
|
+
"aria-busy": exchange.id === pending || void 0,
|
|
367
525
|
"aria-label": tickLabel(exchange.prompt),
|
|
368
526
|
"aria-current": exchange.id === active ? "location" : void 0,
|
|
369
527
|
tabIndex: exchange.id === tabStop ? 0 : -1,
|
|
@@ -418,4 +576,4 @@ function RailCard({ exchange }) {
|
|
|
418
576
|
]
|
|
419
577
|
});
|
|
420
578
|
}
|
|
421
|
-
export { RailTint, TranscriptRail, TranscriptRailProvider, useRailPublish, useTranscriptRailStore };
|
|
579
|
+
export { RailTint, TranscriptRail, TranscriptRailProvider, useRailOutline, useRailPublish, useTranscriptRailStore };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* One transcript row: the switch from a pipeline `Row` to its component,
|
|
3
|
-
* and the
|
|
3
|
+
* and the slot a root row mounts through. `TranscriptRow` is memoized
|
|
4
4
|
* on the row's own inputs plus ONE shared `RowContext` per transcript, so a
|
|
5
5
|
* render (a stream tick, a page of history arriving) builds one element per
|
|
6
|
-
* row and bails out for every row that did not change.
|
|
6
|
+
* row and bails out for every row that did not change. A root row renders in
|
|
7
|
+
* its lazy wrapper (`TranscriptRowSlot`, `LazyRow`).
|
|
7
8
|
*/
|
|
8
9
|
import { Cluster, Row } from "../headless/transcript/rows.js";
|
|
9
10
|
import "../headless/transcript/index.js";
|
|
@@ -86,10 +87,6 @@ export interface SlotEntry {
|
|
|
86
87
|
}
|
|
87
88
|
/** Props for {@link TranscriptRowSlot}: the {@link TranscriptRowProps} of its row, plus its lazy wrapper's. */
|
|
88
89
|
export interface TranscriptRowSlotProps extends Omit<TranscriptRowProps, 'className' | 'style'> {
|
|
89
|
-
/** Mounts the row at once instead of waiting for it to approach (the transcript's tail). */
|
|
90
|
-
eager: boolean;
|
|
91
|
-
/** Height in pixels of the placeholder box before the row mounts. */
|
|
92
|
-
estimatePx: number;
|
|
93
90
|
/** Inline style for the row's wrapper, usually its content-visibility sizing. */
|
|
94
91
|
style: CSSProperties;
|
|
95
92
|
/** The select-turn stop the row belongs to; set only in select mode. */
|
|
@@ -102,4 +99,4 @@ export interface TranscriptRowSlotProps extends Omit<TranscriptRowProps, 'classN
|
|
|
102
99
|
/** Renders one transcript row by switching on its `kind`: prompts, replies, thinking, tool calls, notices, folds, and groups. */
|
|
103
100
|
export declare const TranscriptRow: import("react").MemoExoticComponent<({ row, showCaret, receipt, resumable, ctx, renderRows, status, className, style }: TranscriptRowProps) => import("react").JSX.Element | null>;
|
|
104
101
|
/** One root transcript row in its lazy wrapper, memoised on the row's own inputs. */
|
|
105
|
-
export declare const TranscriptRowSlot: import("react").MemoExoticComponent<({
|
|
102
|
+
export declare const TranscriptRowSlot: import("react").MemoExoticComponent<({ style, stop, sel, className, ...row }: TranscriptRowSlotProps) => import("react").JSX.Element>;
|
|
@@ -9,6 +9,7 @@ import { COMMAND_DETAIL_LINE, CommandDetailRow, CommandNoteRow, ErrorRow, Failur
|
|
|
9
9
|
import { UserPromptRow } from "./prompt.js";
|
|
10
10
|
import { PromptOriginLabel } from "./PromptOriginLabel.js";
|
|
11
11
|
import { TextRow, ThinkingBatchRow, ThinkingRow } from "./prose.js";
|
|
12
|
+
import { rowEstimatePx } from "./row-estimate.js";
|
|
12
13
|
import { CompactSummaryRow, RunReceiptInline, RunSummaryRow } from "./run-rows.js";
|
|
13
14
|
import { ShellBlockProvider } from "./shell-block.js";
|
|
14
15
|
import { TaskBatchRow, TaskRow } from "./tasks.js";
|
|
@@ -221,11 +222,11 @@ const TranscriptRow = memo(({ row, showCaret, receipt, resumable, ctx, renderRow
|
|
|
221
222
|
});
|
|
222
223
|
TranscriptRow.displayName = "TranscriptRow";
|
|
223
224
|
/** One root transcript row in its lazy wrapper, memoised on the row's own inputs. */
|
|
224
|
-
const TranscriptRowSlot = memo(({
|
|
225
|
+
const TranscriptRowSlot = memo(({ style, stop, sel, className, ...row }) => {
|
|
225
226
|
return /* @__PURE__ */ jsx(LazyRow, {
|
|
226
227
|
className,
|
|
227
|
-
|
|
228
|
-
estimatePx,
|
|
228
|
+
itemKey: row.row.id,
|
|
229
|
+
estimatePx: rowEstimatePx(row.row),
|
|
229
230
|
style,
|
|
230
231
|
"data-stop": stop,
|
|
231
232
|
"data-sel": sel,
|
|
@@ -14,9 +14,12 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import { SettingsMcpHost } from "../../settings/headless/mcp.js";
|
|
16
16
|
import { SettingsProvidersHost } from "../../settings/headless/providers.js";
|
|
17
|
+
import { ChatAttachment } from "../headless/host.js";
|
|
18
|
+
import { ToolOutputRange } from "../headless/output-pager.js";
|
|
17
19
|
import { AuthSettingsTarget } from "../headless/transcript/auth-failure.js";
|
|
18
20
|
import { ReactNode } from "react";
|
|
19
|
-
import { ModelNamer } from "zidane/chat/pure";
|
|
21
|
+
import { ModelNamer, ToolCallDetail } from "zidane/chat/pure";
|
|
22
|
+
import { ToolResultSlice } from "zidane/chat";
|
|
20
23
|
/**
|
|
21
24
|
* The accounts of the host that holds a session's credentials, for the card
|
|
22
25
|
* a run stopped by a failed sign-in shows (`AuthFailureCard`). Each member is
|
|
@@ -45,6 +48,10 @@ export interface TranscriptActions {
|
|
|
45
48
|
sessionId: string | null;
|
|
46
49
|
/** The whole text of a tool result that was clipped for transport (`ChatHost.toolOutput`). `turnId`: the call's turn, a hint where to look first. */
|
|
47
50
|
toolOutput?: (callId: string, turnId?: string) => Promise<string | null>;
|
|
51
|
+
/** One range of a clipped tool result (`ChatHost.toolOutputRange`): with it, "Load full output" pages through the result instead of reading it whole. */
|
|
52
|
+
toolOutputRange?: (callId: string, range: ToolOutputRange, turnId?: string) => Promise<ToolResultSlice | null>;
|
|
53
|
+
/** The whole of a tool call whose row went out lean: its input, every hunk of its edit (`ChatHost.toolCall`). `turnId`: the call's turn, a hint where to look first. */
|
|
54
|
+
toolCall?: (callId: string, turnId?: string) => Promise<ToolCallDetail | null>;
|
|
48
55
|
/** Stops a running call (`ChatHost.cancelTool`). */
|
|
49
56
|
cancelTool?: (callId: string) => void;
|
|
50
57
|
/**
|
|
@@ -63,6 +70,13 @@ export interface TranscriptActions {
|
|
|
63
70
|
* inline instead of `[image: …]` stand-ins.
|
|
64
71
|
*/
|
|
65
72
|
toolMediaUrl?: (callId: string, index: number) => string;
|
|
73
|
+
/**
|
|
74
|
+
* The address of a medium the session store holds by content hash (a prompt's attachment, a tool result's media
|
|
75
|
+
* block held as `attachment://<hash>`). The same bytes for good: a page caches it for good. With it, such media
|
|
76
|
+
* load by hash; media still inline in their turn keep `toolMediaUrl` (and a prompt's own preview). `name` only ends
|
|
77
|
+
* the address. `undefined`: not served now (the older address stands).
|
|
78
|
+
*/
|
|
79
|
+
blobMediaUrl?: (hash: string, name?: string) => string | undefined;
|
|
66
80
|
/**
|
|
67
81
|
* Where a message's media loads from (`` in a reply or a
|
|
68
82
|
* prompt): `src` as written, or the app's address for a local file;
|
|
@@ -115,5 +129,27 @@ export interface TranscriptActionsProviderProps {
|
|
|
115
129
|
export declare function TranscriptActionsProvider({ value, children }: TranscriptActionsProviderProps): import("react").JSX.Element;
|
|
116
130
|
/** Returns the {@link TranscriptActions} from the nearest {@link TranscriptActionsProvider}. Without one it returns an object with no session and no actions. */
|
|
117
131
|
export declare function useTranscriptActions(): TranscriptActions;
|
|
132
|
+
/**
|
|
133
|
+
* Where a prompt's attachment loads from: its own preview (`dataUrl`), else its blob's address when the store holds
|
|
134
|
+
* it by hash and the app serves blobs.
|
|
135
|
+
*
|
|
136
|
+
* @param actions - The transcript's actions.
|
|
137
|
+
* @param att - The attachment.
|
|
138
|
+
*/
|
|
139
|
+
export declare function attachmentSrcOf(actions: Pick<TranscriptActions, 'blobMediaUrl'>, att: ChatAttachment): string | undefined;
|
|
140
|
+
/**
|
|
141
|
+
* Where a tool result's `index`-th media block loads from: by hash when the store holds it so and the app serves
|
|
142
|
+
* blobs, else by its call and position (`toolMediaUrl`); `undefined` when the app serves neither.
|
|
143
|
+
*
|
|
144
|
+
* @param actions - The transcript's actions.
|
|
145
|
+
* @param callId - The call that returned it.
|
|
146
|
+
* @param item - The block's position, and its hash when held by one.
|
|
147
|
+
* @param item.index - Its position among the result's media blocks.
|
|
148
|
+
* @param item.hash - Its blob hash, when held by one.
|
|
149
|
+
*/
|
|
150
|
+
export declare function toolMediaSrcOf(actions: Pick<TranscriptActions, 'toolMediaUrl' | 'blobMediaUrl'>, callId: string, item: {
|
|
151
|
+
index: number;
|
|
152
|
+
hash?: string;
|
|
153
|
+
}): string | undefined;
|
|
118
154
|
/** How the transcript names a model: the app's `modelName`, else from the id. */
|
|
119
155
|
export declare function useModelName(): ModelNamer;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { blobHashOf } from "../headless/transcript/blob-media.js";
|
|
1
2
|
import { createContext, useContext } from "react";
|
|
2
3
|
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
import { nameFromModelId } from "zidane/chat/pure";
|
|
@@ -18,8 +19,33 @@ function TranscriptActionsProvider({ value, children }) {
|
|
|
18
19
|
function useTranscriptActions() {
|
|
19
20
|
return useContext(TranscriptActionsContext);
|
|
20
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Where a prompt's attachment loads from: its own preview (`dataUrl`), else its blob's address when the store holds
|
|
24
|
+
* it by hash and the app serves blobs.
|
|
25
|
+
*
|
|
26
|
+
* @param actions - The transcript's actions.
|
|
27
|
+
* @param att - The attachment.
|
|
28
|
+
*/
|
|
29
|
+
function attachmentSrcOf(actions, att) {
|
|
30
|
+
if (att.dataUrl !== void 0) return att.dataUrl;
|
|
31
|
+
const hash = blobHashOf(att.ref);
|
|
32
|
+
return hash && actions.blobMediaUrl ? actions.blobMediaUrl(hash, att.name) : void 0;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Where a tool result's `index`-th media block loads from: by hash when the store holds it so and the app serves
|
|
36
|
+
* blobs, else by its call and position (`toolMediaUrl`); `undefined` when the app serves neither.
|
|
37
|
+
*
|
|
38
|
+
* @param actions - The transcript's actions.
|
|
39
|
+
* @param callId - The call that returned it.
|
|
40
|
+
* @param item - The block's position, and its hash when held by one.
|
|
41
|
+
* @param item.index - Its position among the result's media blocks.
|
|
42
|
+
* @param item.hash - Its blob hash, when held by one.
|
|
43
|
+
*/
|
|
44
|
+
function toolMediaSrcOf(actions, callId, item) {
|
|
45
|
+
return (item.hash ? actions.blobMediaUrl?.(item.hash) : void 0) ?? actions.toolMediaUrl?.(callId, item.index);
|
|
46
|
+
}
|
|
21
47
|
/** How the transcript names a model: the app's `modelName`, else from the id. */
|
|
22
48
|
function useModelName() {
|
|
23
49
|
return useContext(TranscriptActionsContext).modelName ?? nameFromModelId;
|
|
24
50
|
}
|
|
25
|
-
export { TranscriptActionsProvider, useModelName, useTranscriptActions };
|
|
51
|
+
export { TranscriptActionsProvider, attachmentSrcOf, toolMediaSrcOf, useModelName, useTranscriptActions };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The rest of a tool result the host clipped for the wire. With
|
|
3
|
+
* `TranscriptActions.toolOutputRange` it pages: "Load full output" reads the
|
|
4
|
+
* first page (`TOOL_OUTPUT_PAGE_SIZE`), which replaces the clipped preview,
|
|
5
|
+
* then "Load more" and "Load all" read on, under a line that says how much is
|
|
6
|
+
* loaded. With `toolOutput` only, it reads the whole text in one go.
|
|
7
|
+
* Internal to the transcript: the tool rows use it.
|
|
8
|
+
*/
|
|
9
|
+
import { ToolOutputPagerState } from "../headless/output-pager.js";
|
|
10
|
+
import { ToolRowModel } from "../headless/transcript/rows.js";
|
|
11
|
+
import "../headless/transcript/index.js";
|
|
12
|
+
import { CSSProperties } from "react";
|
|
13
|
+
/** A clipped result's loaded text and the way to load more, from {@link useClippedOutput}. */
|
|
14
|
+
export interface ClippedOutput {
|
|
15
|
+
/** The text that replaces the clipped preview; `null` while none is loaded. */
|
|
16
|
+
text: string | null;
|
|
17
|
+
/** The app can load the result: without it the row offers no control. */
|
|
18
|
+
available: boolean;
|
|
19
|
+
/** The call can be addressed (a session and a call id). */
|
|
20
|
+
ready: boolean;
|
|
21
|
+
/** The pages loaded, when the app reads ranges; `null` when it reads the whole text. */
|
|
22
|
+
paged: (ToolOutputPagerState & {
|
|
23
|
+
/** The read in flight, as the user asked it. */
|
|
24
|
+
running: 'more' | 'all' | null;
|
|
25
|
+
/** Reads the next page (`more`) or the rest (`all`). */
|
|
26
|
+
run: (what: 'more' | 'all') => void;
|
|
27
|
+
/** Runs the last read again, from where it stopped. */
|
|
28
|
+
retry: () => void;
|
|
29
|
+
}) | null;
|
|
30
|
+
/** Reads the whole text in one go (an app without ranges), and its state. */
|
|
31
|
+
whole: {
|
|
32
|
+
full: string | 'loading' | null;
|
|
33
|
+
load: () => void;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The rest of a clipped result, read through the transcript's actions: paged
|
|
38
|
+
* with `toolOutputRange`, whole with `toolOutput` only.
|
|
39
|
+
*
|
|
40
|
+
* @param tool - The clipped tool row. Its `callId` (and `turnId`, a hint) address the result.
|
|
41
|
+
*/
|
|
42
|
+
export declare function useClippedOutput(tool: ToolRowModel): ClippedOutput;
|
|
43
|
+
/** Props for {@link ClippedOutputControls}. */
|
|
44
|
+
export interface ClippedOutputControlsProps {
|
|
45
|
+
/** The result's state, from {@link useClippedOutput}. */
|
|
46
|
+
output: ClippedOutput;
|
|
47
|
+
/** Extra classes on the root element. */
|
|
48
|
+
className?: string;
|
|
49
|
+
/** Inline styles on the root element. */
|
|
50
|
+
style?: CSSProperties;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* "Load full output" over a clipped result; once a page shows, how much is
|
|
54
|
+
* loaded with "Load more" and "Load all", and a failed read with Retry.
|
|
55
|
+
*
|
|
56
|
+
* @param props - The result's state, `className` and `style`.
|
|
57
|
+
*/
|
|
58
|
+
export declare function ClippedOutputControls({ output, className, style }: ClippedOutputControlsProps): import("react").JSX.Element | null;
|