@tangle-network/sandbox-ui 2.0.6 → 2.0.7

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/README.md CHANGED
@@ -26,6 +26,10 @@ declarations. Interface 4.x, 5.0.x, and 5.1.x are not admitted. New majors requi
26
26
  qualification before the peer range is extended.
27
27
  Optional peers are required only by the subpaths that use them; see [package.json](./package.json). `/editor` needs its tiptap, `yjs` and `@hocuspocus/provider` peers only when it renders an editor, and the `@tangle-network/ui` README holds the table of which surface needs which. `/files` needs `pdfjs-dist` only for `PdfViewer`, which `FilePreview` uses for PDFs; without it the viewer says so and falls back to the browser's own PDF viewer. The `ui` README covers its worker and asset setup through `configurePdfViewer`.
28
28
 
29
+ ### Retained conversations
30
+
31
+ `Conversation`, `indexRecord` and `withPrompts` from `@tangle-network/sandbox-ui/run` render retained agent events in one virtualized chat column. Import the shared stylesheet. Producers validate their record format before passing presentation data; this component does not install a parser or interpret absent captures as successful work. Source ids, prompt reconstruction, pending tool receipts, collapsed idle polls, source callbacks and assessment flags remain available.
32
+
29
33
  ## Usage
30
34
 
31
35
  ```tsx
@@ -4,7 +4,7 @@ import * as React$1 from "react";
4
4
  import { createPortal } from "react-dom";
5
5
  import { Bot, Brain, Check, ChevronDown, Lock, Pencil, Plus, Send, Sparkles, Square, Trash2, X } from "lucide-react";
6
6
  import { focusField, focusRing } from "@tangle-network/ui/utils";
7
- import { AgentTimeline as AgentTimeline$1, AgentTimelineColumn, AgentTimelineStep, ChatContainer as ChatContainer$1, ChatMessage, ChatMessage as ChatMessage$1, MessageAuthor, MessageList, SpeakerHeader, TRANSCRIPT_TEXT, ThinkingIndicator, UserMessage, agentTimelineStepKind, foldSummary, isViewerMessage, partitionBySpeaker } from "@tangle-network/ui/chat";
7
+ import { AgentTimeline as AgentTimeline$1, AgentTimelineColumn as AgentTimelineColumn$1, AgentTimelineStep as AgentTimelineStep$1, ChatContainer as ChatContainer$1, ChatMessage, ChatMessage as ChatMessage$1, MessageAuthor, MessageList, SpeakerHeader as SpeakerHeader$1, TRANSCRIPT_TEXT, ThinkingIndicator, UserMessage, agentTimelineStepKind as agentTimelineStepKind$1, foldSummary, isViewerMessage, partitionBySpeaker } from "@tangle-network/ui/chat";
8
8
  import { modelProvider, reasoningLadder, snapHarnessToModel } from "@tangle-network/agent-interface";
9
9
  import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
10
10
  // src/chat/reasoning-level-picker.tsx
@@ -862,4 +862,4 @@ function ArtifactAgentDock({ scope, open, onOpenChange, transport, defaultPrompt
862
862
  ]
863
863
  });
864
864
  }
865
- export { ReasoningLevelPicker as S, modelProvider as _, ChatMessage$1 as a, DEFAULT_REASONING_LEVEL_OPTIONS as b, SpeakerHeader as c, UserMessage as d, agentTimelineStepKind as f, ArtifactAgentDock as g, partitionBySpeaker as h, ChatContainer$1 as i, TRANSCRIPT_TEXT as l, isViewerMessage as m, AgentTimelineColumn as n, MessageAuthor as o, foldSummary as p, AgentTimelineStep as r, MessageList as s, AgentTimeline$1 as t, ThinkingIndicator as u, snapHarnessToModel as v, HARNESS_REASONING_OPTIONS as x, AgentProfilePicker as y };
865
+ export { ReasoningLevelPicker as S, modelProvider as _, ChatMessage$1 as a, DEFAULT_REASONING_LEVEL_OPTIONS as b, SpeakerHeader$1 as c, UserMessage as d, agentTimelineStepKind$1 as f, ArtifactAgentDock as g, partitionBySpeaker as h, ChatContainer$1 as i, TRANSCRIPT_TEXT as l, isViewerMessage as m, AgentTimelineColumn$1 as n, MessageAuthor as o, foldSummary as p, AgentTimelineStep$1 as r, MessageList as s, AgentTimeline$1 as t, ThinkingIndicator as u, snapHarnessToModel as v, HARNESS_REASONING_OPTIONS as x, AgentProfilePicker as y };
package/dist/chat.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as AgentProfilePicker, A as SpeakerSection, B as partitionBySpeaker, C as MessageList, D as SpeakerHeader, E as Speaker, F as UserMessage, G as ArtifactDockStreamEvent, H as ArtifactAgentDockProps, I as UserMessageProps, J as modelProvider, K as ArtifactKind, L as agentTimelineStepKind, M as TRANSCRIPT_TEXT, N as ThinkingIndicator, O as SpeakerHeaderProps, P as ThinkingIndicatorProps, Q as AgentProfileOption, R as foldSummary, S as MessageAuthorProps, T as MessageRole, U as ArtifactAgentDockTransport, V as ArtifactAgentDock, W as ArtifactDockMessage, X as AgentProfileCapability, Y as snapHarnessToModel, Z as AgentProfileDraft, _ as ChatContainer, a as AgentTimelineFoldItem, at as ReasoningLevelPicker, b as ChatMessageProps, c as AgentTimelineProps, d as AgentTimelineStepKind, et as AgentProfilePickerProps, f as AgentTimelineStepProps, g as ChatAuthor, h as AgentTimelineToolItem, i as AgentTimelineCustomItem, it as ReasoningLevelOption, j as SpeakerState, k as SpeakerPart, l as AgentTimelineStatusItem, m as AgentTimelineToolGroupItem, n as AgentTimelineArtifactItem, nt as HARNESS_REASONING_OPTIONS, o as AgentTimelineItem, ot as ReasoningLevelPickerProps, p as AgentTimelineTone, q as ArtifactScope, r as AgentTimelineColumn, rt as ReasoningLevel, s as AgentTimelineMessageItem, t as AgentTimeline, tt as DEFAULT_REASONING_LEVEL_OPTIONS, u as AgentTimelineStep, v as ChatContainerProps, w as MessageListProps, x as MessageAuthor, y as ChatMessage, z as isViewerMessage } from "./index-5zOVKgDT.js";
1
+ import { $ as AgentProfilePicker, A as SpeakerSection, B as partitionBySpeaker, C as MessageList, D as SpeakerHeader, E as Speaker, F as UserMessage, G as ArtifactDockStreamEvent, H as ArtifactAgentDockProps, I as UserMessageProps, J as modelProvider, K as ArtifactKind, L as agentTimelineStepKind, M as TRANSCRIPT_TEXT, N as ThinkingIndicator, O as SpeakerHeaderProps, P as ThinkingIndicatorProps, Q as AgentProfileOption, R as foldSummary, S as MessageAuthorProps, T as MessageRole, U as ArtifactAgentDockTransport, V as ArtifactAgentDock, W as ArtifactDockMessage, X as AgentProfileCapability, Y as snapHarnessToModel, Z as AgentProfileDraft, _ as ChatContainer, a as AgentTimelineFoldItem, at as ReasoningLevelPicker, b as ChatMessageProps, c as AgentTimelineProps, d as AgentTimelineStepKind, et as AgentProfilePickerProps, f as AgentTimelineStepProps, g as ChatAuthor, h as AgentTimelineToolItem, i as AgentTimelineCustomItem, it as ReasoningLevelOption, j as SpeakerState, k as SpeakerPart, l as AgentTimelineStatusItem, m as AgentTimelineToolGroupItem, n as AgentTimelineArtifactItem, nt as HARNESS_REASONING_OPTIONS, o as AgentTimelineItem, ot as ReasoningLevelPickerProps, p as AgentTimelineTone, q as ArtifactScope, r as AgentTimelineColumn, rt as ReasoningLevel, s as AgentTimelineMessageItem, t as AgentTimeline, tt as DEFAULT_REASONING_LEVEL_OPTIONS, u as AgentTimelineStep, v as ChatContainerProps, w as MessageListProps, x as MessageAuthor, y as ChatMessage, z as isViewerMessage } from "./index-Due7tY0w.js";
2
2
  export { type AgentProfileCapability, type AgentProfileDraft, type AgentProfileOption, AgentProfilePicker, type AgentProfilePickerProps, AgentTimeline, type AgentTimelineArtifactItem, AgentTimelineColumn, type AgentTimelineCustomItem, type AgentTimelineFoldItem, type AgentTimelineItem, type AgentTimelineMessageItem, type AgentTimelineProps, type AgentTimelineStatusItem, AgentTimelineStep, type AgentTimelineStepKind, type AgentTimelineStepProps, type AgentTimelineTone, type AgentTimelineToolGroupItem, type AgentTimelineToolItem, ArtifactAgentDock, type ArtifactAgentDockProps, type ArtifactAgentDockTransport, type ArtifactDockMessage, type ArtifactDockStreamEvent, type ArtifactKind, type ArtifactScope, type ChatAuthor, ChatContainer, type ChatContainerProps, ChatMessage, type ChatMessageProps, DEFAULT_REASONING_LEVEL_OPTIONS, HARNESS_REASONING_OPTIONS, MessageAuthor, type MessageAuthorProps, MessageList, type MessageListProps, type MessageRole, type ReasoningLevel, type ReasoningLevelOption, ReasoningLevelPicker, type ReasoningLevelPickerProps, type Speaker, SpeakerHeader, type SpeakerHeaderProps, type SpeakerPart, type SpeakerSection, type SpeakerState, TRANSCRIPT_TEXT, ThinkingIndicator, type ThinkingIndicatorProps, UserMessage, type UserMessageProps, agentTimelineStepKind, foldSummary, isViewerMessage, modelProvider, partitionBySpeaker, snapHarnessToModel };
package/dist/chat.js CHANGED
@@ -1 +1 @@
1
- export { y as AgentProfilePicker, t as AgentTimeline, n as AgentTimelineColumn, r as AgentTimelineStep, g as ArtifactAgentDock, i as ChatContainer, a as ChatMessage, b as DEFAULT_REASONING_LEVEL_OPTIONS, x as HARNESS_REASONING_OPTIONS, o as MessageAuthor, s as MessageList, S as ReasoningLevelPicker, c as SpeakerHeader, l as TRANSCRIPT_TEXT, u as ThinkingIndicator, d as UserMessage, f as agentTimelineStepKind, p as foldSummary, m as isViewerMessage, _ as modelProvider, h as partitionBySpeaker, v as snapHarnessToModel } from "./chat-BrlLa4rg.js";
1
+ export { y as AgentProfilePicker, t as AgentTimeline, n as AgentTimelineColumn, r as AgentTimelineStep, g as ArtifactAgentDock, i as ChatContainer, a as ChatMessage, b as DEFAULT_REASONING_LEVEL_OPTIONS, x as HARNESS_REASONING_OPTIONS, o as MessageAuthor, s as MessageList, S as ReasoningLevelPicker, c as SpeakerHeader, l as TRANSCRIPT_TEXT, u as ThinkingIndicator, d as UserMessage, f as agentTimelineStepKind, p as foldSummary, m as isViewerMessage, _ as modelProvider, h as partitionBySpeaker, v as snapHarnessToModel } from "./chat-BU39pb2j.js";
package/dist/globals.css CHANGED
@@ -9602,6 +9602,175 @@
9602
9602
  min-width: 44px;
9603
9603
  }
9604
9604
  }
9605
+ .record-conversation {
9606
+ height: 29rem;
9607
+ overflow: auto;
9608
+ scroll-behavior: auto;
9609
+ overscroll-behavior: contain;
9610
+ }
9611
+ .record-conversation .virtual-row {
9612
+ display: flow-root;
9613
+ overflow-anchor: auto;
9614
+ }
9615
+ .record-conversation .chat-empty {
9616
+ padding: 1rem;
9617
+ font: var(--font-size-base)/1.5 var(--font-sans);
9618
+ color: hsl(var(--muted-foreground));
9619
+ }
9620
+ .record-conversation .chat-row.selected {
9621
+ box-shadow: -10px 0 0 -8px var(--accent-text);
9622
+ }
9623
+ .record-conversation .chat-row.flagged {
9624
+ box-shadow: -10px 0 0 -8px hsl(var(--muted-foreground));
9625
+ }
9626
+ .record-conversation .chat-row > :is(.publication-note, .clip-note, .event-flags) {
9627
+ margin: 4px 0 8px;
9628
+ }
9629
+ .record-conversation .ar-prompt-more {
9630
+ display: flex;
9631
+ justify-content: flex-end;
9632
+ margin: 4px 0 0;
9633
+ }
9634
+ .record-conversation .tool-note {
9635
+ font: var(--font-size-sm)/20px var(--font-sans);
9636
+ color: hsl(var(--muted-foreground));
9637
+ white-space: nowrap;
9638
+ }
9639
+ .record-conversation .lifecycle-note {
9640
+ display: flex;
9641
+ gap: 8px;
9642
+ align-items: baseline;
9643
+ margin: 8px 0;
9644
+ padding: 0 12px;
9645
+ font: var(--font-size-sm)/1.5 var(--font-sans);
9646
+ color: hsl(var(--muted-foreground));
9647
+ }
9648
+ .record-conversation .lifecycle-note b {
9649
+ color: hsl(var(--foreground));
9650
+ font-weight: 600;
9651
+ }
9652
+ .record-conversation .lifecycle-note > span {
9653
+ min-width: 0;
9654
+ overflow-wrap: anywhere;
9655
+ }
9656
+ .record-conversation .poll-calls {
9657
+ margin: 0;
9658
+ padding: 4px 12px 8px;
9659
+ list-style: none;
9660
+ max-height: 18rem;
9661
+ overflow: auto;
9662
+ }
9663
+ .record-conversation .poll-calls li {
9664
+ display: flex;
9665
+ gap: 12px;
9666
+ padding: 2px 0;
9667
+ font: var(--font-size-sm)/1.5 var(--font-sans);
9668
+ color: hsl(var(--muted-foreground));
9669
+ }
9670
+ .record-conversation .poll-calls .mono {
9671
+ min-width: 0;
9672
+ overflow: hidden;
9673
+ text-overflow: ellipsis;
9674
+ white-space: nowrap;
9675
+ font-family: var(--font-mono);
9676
+ }
9677
+ .record-conversation .transcript-edge {
9678
+ display: flex;
9679
+ justify-content: center;
9680
+ gap: 16px;
9681
+ margin: 8px 0 0;
9682
+ }
9683
+ .record-conversation .publication-note {
9684
+ font: var(--font-size-sm)/1.4 var(--font-sans);
9685
+ color: hsl(var(--muted-foreground));
9686
+ overflow-wrap: anywhere;
9687
+ }
9688
+ .record-conversation .publication-note:empty {
9689
+ display: none;
9690
+ }
9691
+ .record-conversation .clip-note {
9692
+ display: flex;
9693
+ flex-wrap: wrap;
9694
+ gap: 8px;
9695
+ align-items: center;
9696
+ font: var(--font-size-sm)/1.5 var(--font-sans);
9697
+ color: hsl(var(--muted-foreground));
9698
+ }
9699
+ .record-conversation .event-flags {
9700
+ display: inline-flex;
9701
+ gap: 4px;
9702
+ margin-left: 8px;
9703
+ }
9704
+ .record-conversation .event-flag {
9705
+ padding: 0 4px;
9706
+ min-height: 0;
9707
+ border: 0;
9708
+ border-radius: var(--radius-control);
9709
+ font: 600 var(--font-size-sm)/1.6 var(--font-sans);
9710
+ cursor: pointer;
9711
+ }
9712
+ .record-conversation .event-flag.polarity-good {
9713
+ color: var(--accent-text);
9714
+ background: var(--accent-text);
9715
+ @supports (color: color-mix(in lab, red, red)) {
9716
+ background: color-mix(in srgb, var(--accent-text) 14%, transparent);
9717
+ }
9718
+ }
9719
+ .record-conversation .event-flag.polarity-bad {
9720
+ color: hsl(var(--muted-foreground));
9721
+ background: hsl(var(--muted-foreground));
9722
+ @supports (color: color-mix(in lab, red, red)) {
9723
+ background: color-mix(in srgb, hsl(var(--muted-foreground)) 14%, transparent);
9724
+ }
9725
+ }
9726
+ .record-conversation .event-flag.polarity-neutral {
9727
+ color: hsl(var(--foreground));
9728
+ background: hsl(var(--muted));
9729
+ }
9730
+ .record-conversation .event-flag:is(.polarity-unknown, .polarity-uncalibrated) {
9731
+ color: hsl(var(--muted-foreground));
9732
+ background: transparent;
9733
+ box-shadow: inset 0 0 0 1px hsl(var(--border));
9734
+ border-style: dashed;
9735
+ }
9736
+ .record-conversation .event-flag.polarity-none {
9737
+ color: hsl(var(--muted-foreground));
9738
+ background: transparent;
9739
+ }
9740
+ .record-conversation .link-button {
9741
+ display: inline;
9742
+ min-height: 0;
9743
+ padding: 0;
9744
+ border: 0;
9745
+ background: none;
9746
+ color: var(--accent-text);
9747
+ font: inherit;
9748
+ cursor: pointer;
9749
+ }
9750
+ .record-conversation .link-button:hover, .record-conversation .link-button:focus-visible {
9751
+ text-decoration: underline;
9752
+ }
9753
+ .record-conversation .ar-turn {
9754
+ display: flex;
9755
+ align-items: center;
9756
+ justify-content: space-between;
9757
+ gap: 16px;
9758
+ margin: 20px 0 8px;
9759
+ padding-top: 12px;
9760
+ border-top: 1px solid hsl(var(--border));
9761
+ }
9762
+ .record-conversation .ar-turn time, .record-conversation .ar-idle-event time {
9763
+ flex: none;
9764
+ color: hsl(var(--muted-foreground));
9765
+ font: var(--font-size-sm)/1.5 var(--font-sans);
9766
+ }
9767
+ .record-conversation .ar-idle-event {
9768
+ display: grid;
9769
+ grid-template-columns: auto minmax(0, 1fr);
9770
+ align-items: baseline;
9771
+ gap: 16px;
9772
+ padding: 4px 0;
9773
+ }
9605
9774
  @property --tw-translate-x {
9606
9775
  syntax: "*";
9607
9776
  inherits: false;
@@ -0,0 +1,308 @@
1
+ import { d as AgentGraphNode, n as AgentGraphProps } from "./AgentGraph-DzdpPFEI.js";
2
+ import { ReactNode } from "react";
3
+ import { ApprovalCard, ApprovalCardProps, ApprovalDiffFile, ApprovalDiffSummary, ApprovalPlanStep, ExpandedToolDetail, ExpandedToolDetailProps, FeedSegment, InlineThinkingItem as InlineThinkingItem$1, InlineThinkingItemProps, InlineToolItem, InlineToolItemProps, LiveDuration, RunGroup, RunGroupProps, RunPhase, RunPhaseList, RunRowShell as RunRowShell$1, RunRowShellProps, RunRowStatus, RunRowStatusDot, RunStatus, RunStatusIcon as RunStatusIcon$1, RunStatusIconProps, StatusMeta, TaskList, TaskListItem, TaskListProps, TaskStatus, ToolCallData, ToolCallData as ToolCallData$1, ToolCallFeed, ToolCallFeedProps, ToolCallStatus, ToolCallType, parseToolEvent, runStatus as runStatus$1, showsTaskPriority, statusMeta as statusMeta$1, taskProgress, taskStatus } from "@tangle-network/ui/run";
4
+ import { FlowWaterfallProps } from "@tangle-network/charts/react";
5
+ import { FlowMarker, FlowSpan, FlowTrace } from "@tangle-network/charts";
6
+ /** Agent and model spans show their lab/host mark; tool spans show their provider's mark. Unknown keeps the kind glyph. */
7
+ declare function traceSpanMark(span: FlowSpan): ReactNode;
8
+ type TraceWaterfallProps = FlowWaterfallProps;
9
+ /**
10
+ * The run inspector: the agent timeline (`defaultView="agents"`) and the span waterfall over one clock, from
11
+ * `@tangle-network/charts`, with Sandbox UI's brand marks. Feed it `otlpFlowTrace(spans)` from the
12
+ * `traces convert` contract. Import `@tangle-network/charts/react/flow-waterfall.css` once.
13
+ */
14
+ declare function TraceWaterfall({ renderIcon, ...props }: TraceWaterfallProps): import("react").JSX.Element;
15
+ /** A moment on the run's event track: a release, a check verdict, a spawn, a crash or a steer. */
16
+ interface TraceEvent extends FlowMarker {}
17
+ interface TraceWorkspaceProps extends Omit<TraceWaterfallProps, "trace" | "markers" | "onSelect" | "onTimeChange" | "selectedId" | "onDeselect" | "graph" | "latestEvents"> {
18
+ trace: FlowTrace;
19
+ /** The selected agent's message stream (Server-Sent Events: rows, reset, end; reconnects with ?after=lastSeq). */
20
+ streamUrl?: (agentId: string) => string;
21
+ events?: TraceEvent[];
22
+ /** The time the reader moved to, in trace ms; null while following live or showing the whole run. */
23
+ onTimeChange?: (t: number | null) => void;
24
+ /**
25
+ * The code workspace as of the cursor and scoped to the selected agent, usually a WorkspaceFilesPane: the page answers
26
+ * the as-of query. It spans the full width and at least 70% of the viewport. Keep its key on the commit so a scrub
27
+ * keeps its state.
28
+ */
29
+ files?: ReactNode;
30
+ /** The scoreboard as of the cursor, under the code workspace; omitted when not given. */
31
+ scoreboard?: ReactNode;
32
+ selectedAgentId?: string;
33
+ /** Called with the agent the reader selected, or undefined when they close its drawer or press Escape. */
34
+ onSelectAgent?: (agentId: string | undefined) => void;
35
+ /**
36
+ * What the trace cannot say about a live agent, by agent id: its activity, thinking line, latest events, commits or
37
+ * result. Timed agents follow the trace cursor. Workers without recorded timing retain their live identity and metadata.
38
+ */
39
+ agentCards?: Readonly<Record<string, Partial<AgentGraphNode>>>;
40
+ /** Existing graph layouts and recorded edges/tools; node identity and clock stay with this workspace. */
41
+ agentGraph?: Partial<Pick<AgentGraphProps, "edges" | "tools" | "calls" | "you" | "direction" | "title" | "className">> & {
42
+ defaultLayout?: AgentGraphProps["layout"];
43
+ };
44
+ className?: string;
45
+ }
46
+ /**
47
+ * The run workspace: the agent timeline and span waterfall over one clock, the selected agent's conversation
48
+ * streaming in a right-hand drawer, and the page's code workspace and scoreboard following the time cursor. Scrubbing is time travel:
49
+ * every panel shows what was true at the cursor, and the conversation shows what had been said by then.
50
+ */
51
+ declare function TraceWorkspace({ trace, streamUrl, events, onTimeChange, files, scoreboard, selectedAgentId, onSelectAgent, agentCards, agentGraph, className, ...waterfall }: TraceWorkspaceProps): import("react").JSX.Element;
52
+ /** One row of an agent's message stream (tangle-tools `/api/discovery/runs/<run>/agents/<agent>/stream`). */
53
+ interface AgentStreamRow {
54
+ seq: number;
55
+ /** ISO time the event happened. */
56
+ at: string;
57
+ stream?: string;
58
+ attempt?: number;
59
+ event: {
60
+ kind: "text" | "reasoning" | "tool-call" | "tool-result" | "user" | "notice" | (string & {});
61
+ text?: string;
62
+ /** A notice's origin: the agent's `delegated-input`, its `recorded-result`, or a capture fact such as `capture-unavailable`. */
63
+ provenance?: string;
64
+ toolCallId?: string;
65
+ toolName?: string;
66
+ args?: unknown;
67
+ result?: unknown;
68
+ };
69
+ }
70
+ /** A transcript entry with the time it began, so a time cursor can show the conversation as of any moment. */
71
+ type AgentTranscriptEntry = {
72
+ id: string;
73
+ at: number;
74
+ kind: "message";
75
+ role: "assistant" | "user";
76
+ content: string;
77
+ sealed?: true;
78
+ } | {
79
+ id: string;
80
+ at: number;
81
+ kind: "reasoning";
82
+ text: string;
83
+ } | {
84
+ id: string;
85
+ at: number;
86
+ kind: "tool";
87
+ call: ToolCallData;
88
+ } | {
89
+ id: string;
90
+ at: number;
91
+ kind: "notice";
92
+ text: string;
93
+ };
94
+ interface AgentStreamState {
95
+ generation?: string | number;
96
+ entries: AgentTranscriptEntry[];
97
+ lastSeq: number;
98
+ /** The agent is still producing output. */
99
+ alive: boolean;
100
+ /** Why the stream shows nothing new; a reconnect that delivers rows clears it. */
101
+ error?: string;
102
+ }
103
+ /** Fold stream rows into transcript entries: text of one turn merges, a tool call becomes a row its result completes. */
104
+ declare function foldAgentRows(entries: AgentTranscriptEntry[], rows: readonly AgentStreamRow[]): AgentTranscriptEntry[];
105
+ /**
106
+ * Follow one agent's message stream over Server-Sent Events: `rows`, `reset` and `end` events, reconnecting with
107
+ * `?after=<lastSeq>` when the server closes the connection, so a long turn streams without gaps or repeats.
108
+ */
109
+ declare function useAgentStream(url: string | undefined): AgentStreamState;
110
+ interface LatestEventsProps {
111
+ agents: readonly AgentGraphNode[];
112
+ n?: number;
113
+ now?: number;
114
+ /** Observe incoming status changes. Disable when scrubbing a trace without an epoch. */
115
+ live?: boolean;
116
+ selectedId?: string | null;
117
+ onSelect?: (id: string) => void;
118
+ }
119
+ /** Recorded events and locally observed state changes. Hover or focus holds the reading position. */
120
+ declare function LatestEvents({ agents, n, now, live, selectedId, onSelect }: LatestEventsProps): import("react").JSX.Element;
121
+ /** Presentation inputs, not a wire schema. Producers validate retained data before rendering it. */
122
+ interface ConversationNode {
123
+ id: string;
124
+ label: string;
125
+ parent: string | null;
126
+ kind: string;
127
+ role?: string;
128
+ assignment?: string;
129
+ model?: string | null;
130
+ servedModel?: string | null;
131
+ start?: string;
132
+ status?: string;
133
+ nativeSessionId?: string;
134
+ agentId?: string;
135
+ joinBasis?: string;
136
+ joinProof?: Record<string, unknown>;
137
+ capture?: {
138
+ status: string;
139
+ };
140
+ [field: string]: unknown;
141
+ }
142
+ interface ConversationEvent {
143
+ id: string;
144
+ node: string;
145
+ at: string;
146
+ end?: string;
147
+ kind: string;
148
+ category: string;
149
+ label: string;
150
+ source?: {
151
+ path: string;
152
+ sha256?: string;
153
+ line?: number;
154
+ pointer?: string;
155
+ [field: string]: unknown;
156
+ } | null;
157
+ detail: {
158
+ role?: string;
159
+ publicText?: string;
160
+ publicationNote?: string | null;
161
+ contentOmitted?: string;
162
+ publicToolCalls?: {
163
+ id: string;
164
+ name: string;
165
+ input?: string;
166
+ publicationNote?: string | null;
167
+ }[];
168
+ toolCallIds?: string[];
169
+ toolNames?: string[];
170
+ toolCallId?: string;
171
+ isError?: boolean;
172
+ responseStatus?: string;
173
+ recordedClaim?: string;
174
+ assessment?: string;
175
+ usage?: {
176
+ input?: number;
177
+ output?: number;
178
+ cacheRead?: number;
179
+ cacheWrite?: number;
180
+ [field: string]: unknown;
181
+ } | null;
182
+ reasoning?: string;
183
+ reasoningOmitted?: number;
184
+ reasoningRedacted?: number;
185
+ durationMs?: number;
186
+ costListUsd?: number;
187
+ clip?: {
188
+ bytes: number;
189
+ sha256: string | null;
190
+ };
191
+ [field: string]: unknown;
192
+ };
193
+ [field: string]: unknown;
194
+ }
195
+ interface ConversationRecord {
196
+ runId: string;
197
+ nodes: ConversationNode[];
198
+ events: ConversationEvent[];
199
+ }
200
+ declare namespace model_d_exports {
201
+ export { RecordIndex, ToolCall, TooltipSection, agentState, callsOf, compact, eventMatches, eventSource, fmt, hostless, hoverLines, indexRecord, interval, measuredUsage, modelIdentity, ms, preview, roleOf, textOf, toolKey, tooltipSections, utcTime };
202
+ }
203
+ interface ToolCall {
204
+ id: string;
205
+ name: string;
206
+ input?: string;
207
+ publicationNote?: string | null;
208
+ }
209
+ declare const ms: (value: string) => number;
210
+ /** Normalize labels to UTC without rewriting the source timestamp. */
211
+ declare function utcTime(value: string, includeDate?: boolean): string;
212
+ declare const compact: (value: string) => string;
213
+ declare function hostless(text: string): string;
214
+ declare function hostless(text: string | undefined): string | undefined;
215
+ declare const fmt: (value: number) => string;
216
+ declare const interval: (value: number) => string;
217
+ declare const roleOf: (node?: ConversationNode) => string;
218
+ declare const textOf: (event: ConversationEvent) => string;
219
+ declare const toolKey: (node: string, id: string) => string;
220
+ declare function callsOf(event: ConversationEvent): ToolCall[];
221
+ /** A tool call's subject: its command, path or question, never its JSON. */
222
+ declare function preview(call: ToolCall): string;
223
+ /** Identity is established by the importer, never inferred from labels or timestamps. */
224
+ declare function indexRecord<R extends ConversationRecord>(record: R): {
225
+ nodes: Map<string, ConversationNode>;
226
+ canonical: (id: string) => string;
227
+ actors: ConversationNode[];
228
+ events: ConversationEvent[];
229
+ byEvent: Map<string, ConversationEvent>;
230
+ recordedOrder: Map<string, number>;
231
+ byActor: Map<string, R["events"][number][]>;
232
+ calls: Map<string, {
233
+ event: R["events"][number];
234
+ call: ToolCall;
235
+ }[]>;
236
+ results: Map<string, R["events"][number][]>;
237
+ start: number;
238
+ end: number;
239
+ };
240
+ type RecordIndex<R extends ConversationRecord = ConversationRecord> = ReturnType<typeof indexRecord<R>>;
241
+ /** Whether any event of this agent recorded token usage or a list price: a status alone measures nothing. */
242
+ declare function measuredUsage(index: RecordIndex, id: string): boolean;
243
+ /** An agent's recorded state, qualified when nothing about it was measured or captured. A live agent has no terminal
244
+ * state yet: `live` is its state while the run runs (Runtime's progress document), and it reads as working. */
245
+ declare function agentState(node: ConversationNode | undefined, measured: boolean, live?: string | null): string;
246
+ declare function eventMatches(event: ConversationEvent, index: RecordIndex, query: string, category: string): boolean;
247
+ declare function eventSource(event: ConversationEvent, record: ConversationRecord, index: RecordIndex): {
248
+ path?: string | undefined;
249
+ sha256?: string;
250
+ line?: number;
251
+ pointer?: string;
252
+ runId: string;
253
+ at: string;
254
+ observedNodeId: string;
255
+ agentId: string | null;
256
+ nativeSessionId: string | null;
257
+ joinBasis: string | null;
258
+ joinProof: Record<string, unknown> | null;
259
+ };
260
+ declare function hoverLines(event: ConversationEvent, index: RecordIndex, cutoff: number): string[];
261
+ /** A declared model is configuration; only response metadata shows which model served. */
262
+ declare function modelIdentity(node: ConversationNode | undefined, record: ConversationRecord): string | null;
263
+ interface TooltipSection {
264
+ kind: 'header' | 'body' | 'usage' | 'status' | 'note';
265
+ label?: string;
266
+ value: string;
267
+ tone?: 'default' | 'error' | 'ok' | 'warn' | 'muted' | 'accent';
268
+ }
269
+ declare function tooltipSections(event: ConversationEvent, index: RecordIndex, cutoff: number): {
270
+ title: string;
271
+ category: string;
272
+ tone: string;
273
+ sections: TooltipSection[];
274
+ };
275
+ interface EventFlag {
276
+ dimension: string;
277
+ label: string;
278
+ polarity: string;
279
+ title: string;
280
+ }
281
+ interface ConversationProps {
282
+ index: RecordIndex;
283
+ actor: string;
284
+ cutoff: number;
285
+ query: string;
286
+ category: string;
287
+ selected?: string;
288
+ /** Open the full text of a clipped body by its source hash. */
289
+ openSource?: (sha256: string, event: ConversationEvent) => void;
290
+ /** Assessment labels that cite an event, drawn in the message gutter. */
291
+ flags?: ReadonlyMap<string, readonly EventFlag[]>;
292
+ onFlag?: (flag: EventFlag, event: ConversationEvent) => void;
293
+ /** Show lifecycle events (spawn, pause, settle) between messages. */
294
+ lifecycle?: boolean;
295
+ /** The agent can still act: a call without a result is pending, not uncaptured. */
296
+ live?: boolean;
297
+ /** Suspend following while the reader browses earlier pages of a live agent. */
298
+ follow?: boolean;
299
+ /** The prompt the agent was started with, when its record holds no prompt of its own (a root's run input). */
300
+ opening?: {
301
+ text: string;
302
+ at: string;
303
+ };
304
+ }
305
+ declare function Conversation({ index, actor, cutoff, query, category, selected, openSource, flags, onFlag, lifecycle, live, follow, opening }: ConversationProps): import("react").JSX.Element;
306
+ /** The conversation needs an opening prompt even when the provider did not retain its first user turn. */
307
+ declare function withPrompts<T extends ConversationRecord>(record: T): T;
308
+ export { AgentStreamRow as $, ToolCallData$1 as A, taskStatus as B, RunStatusIcon$1 as C, TaskListItem as D, TaskList as E, parseToolEvent as F, RecordIndex as G, Conversation as H, runStatus$1 as I, ConversationEvent as J, indexRecord as K, showsTaskPriority as L, ToolCallFeedProps as M, ToolCallStatus as N, TaskListProps as O, ToolCallType as P, LatestEventsProps as Q, statusMeta$1 as R, RunStatus as S, StatusMeta as T, ConversationProps as U, withPrompts as V, EventFlag as W, ConversationRecord as X, ConversationNode as Y, LatestEvents as Z, RunPhaseList as _, ApprovalPlanStep as a, TraceWorkspace as at, RunRowStatus as b, FeedSegment as c, TraceWaterfallProps as ct, InlineToolItem as d, AgentStreamState as et, InlineToolItemProps as f, RunPhase as g, RunGroupProps as h, ApprovalDiffSummary as i, TraceEvent as it, ToolCallFeed as j, TaskStatus as k, InlineThinkingItem$1 as l, traceSpanMark as lt, RunGroup as m, ApprovalCardProps as n, foldAgentRows as nt, ExpandedToolDetail as o, TraceWorkspaceProps as ot, LiveDuration as p, model_d_exports as q, ApprovalDiffFile as r, useAgentStream as rt, ExpandedToolDetailProps as s, TraceWaterfall as st, ApprovalCard as t, AgentTranscriptEntry as tt, InlineThinkingItemProps as u, RunRowShell$1 as v, RunStatusIconProps as w, RunRowStatusDot as x, RunRowShellProps as y, taskProgress as z };
@@ -1,5 +1,5 @@
1
1
  import * as React$1 from "react";
2
- import { AgentTimeline as AgentTimeline$1, AgentTimelineArtifactItem, AgentTimelineColumn, AgentTimelineCustomItem, AgentTimelineFoldItem, AgentTimelineItem, AgentTimelineMessageItem, AgentTimelineProps, AgentTimelineStatusItem, AgentTimelineStep, AgentTimelineStepKind, AgentTimelineStepProps, AgentTimelineTone, AgentTimelineToolGroupItem, AgentTimelineToolItem, ChatAuthor, ChatContainer as ChatContainer$1, ChatContainerProps as ChatContainerProps$1, ChatMessage as ChatMessage$1, ChatMessageProps, MessageAuthor, MessageAuthorProps, MessageList, MessageListProps, MessageRole, MessageRole as MessageRole$1, Speaker, SpeakerHeader, SpeakerHeaderProps, SpeakerPart, SpeakerSection, SpeakerState, TRANSCRIPT_TEXT, ThinkingIndicator, ThinkingIndicatorProps, UserMessage, UserMessageProps, agentTimelineStepKind, foldSummary, isViewerMessage, partitionBySpeaker } from "@tangle-network/ui/chat";
2
+ import { AgentTimeline as AgentTimeline$1, AgentTimelineArtifactItem, AgentTimelineColumn as AgentTimelineColumn$1, AgentTimelineCustomItem, AgentTimelineFoldItem, AgentTimelineItem, AgentTimelineMessageItem, AgentTimelineProps, AgentTimelineStatusItem, AgentTimelineStep as AgentTimelineStep$1, AgentTimelineStepKind, AgentTimelineStepProps, AgentTimelineTone, AgentTimelineToolGroupItem, AgentTimelineToolItem, ChatAuthor, ChatContainer as ChatContainer$1, ChatContainerProps as ChatContainerProps$1, ChatMessage as ChatMessage$1, ChatMessageProps, MessageAuthor, MessageAuthorProps, MessageList, MessageListProps, MessageRole, MessageRole as MessageRole$1, Speaker, SpeakerHeader as SpeakerHeader$1, SpeakerHeaderProps, SpeakerPart, SpeakerSection, SpeakerState, TRANSCRIPT_TEXT, ThinkingIndicator, ThinkingIndicatorProps, UserMessage, UserMessageProps, agentTimelineStepKind as agentTimelineStepKind$1, foldSummary, isViewerMessage, partitionBySpeaker } from "@tangle-network/ui/chat";
3
3
  import { HarnessType, ReasoningEffort, modelProvider, snapHarnessToModel } from "@tangle-network/agent-interface";
4
4
  import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
5
5
  /**
@@ -210,4 +210,4 @@ interface ArtifactAgentDockProps {
210
210
  * consumer's job on whatever button toggles `open`.
211
211
  */
212
212
  declare function ArtifactAgentDock({ scope, open, onOpenChange, transport, defaultPrompt, onError, className }: ArtifactAgentDockProps): React$1.JSX.Element | null;
213
- export { AgentProfilePicker as $, SpeakerSection as A, partitionBySpeaker as B, MessageList as C, SpeakerHeader as D, Speaker as E, UserMessage as F, ArtifactDockStreamEvent as G, ArtifactAgentDockProps as H, UserMessageProps as I, modelProvider as J, ArtifactKind as K, agentTimelineStepKind as L, TRANSCRIPT_TEXT as M, ThinkingIndicator as N, SpeakerHeaderProps as O, ThinkingIndicatorProps as P, AgentProfileOption as Q, foldSummary as R, MessageAuthorProps as S, MessageRole$1 as T, ArtifactAgentDockTransport as U, ArtifactAgentDock as V, ArtifactDockMessage as W, AgentProfileCapability as X, snapHarnessToModel as Y, AgentProfileDraft as Z, ChatContainer$1 as _, AgentTimelineFoldItem as a, ReasoningLevelPicker as at, ChatMessageProps as b, AgentTimelineProps as c, AgentTimelineStepKind as d, AgentProfilePickerProps as et, AgentTimelineStepProps as f, ChatAuthor as g, AgentTimelineToolItem as h, AgentTimelineCustomItem as i, ReasoningLevelOption as it, SpeakerState as j, SpeakerPart as k, AgentTimelineStatusItem as l, AgentTimelineToolGroupItem as m, AgentTimelineArtifactItem as n, HARNESS_REASONING_OPTIONS as nt, AgentTimelineItem as o, ReasoningLevelPickerProps as ot, AgentTimelineTone as p, ArtifactScope as q, AgentTimelineColumn as r, ReasoningLevel as rt, AgentTimelineMessageItem as s, AgentTimeline$1 as t, DEFAULT_REASONING_LEVEL_OPTIONS as tt, AgentTimelineStep as u, ChatContainerProps$1 as v, MessageListProps as w, MessageAuthor as x, ChatMessage$1 as y, isViewerMessage as z };
213
+ export { AgentProfilePicker as $, SpeakerSection as A, partitionBySpeaker as B, MessageList as C, SpeakerHeader$1 as D, Speaker as E, UserMessage as F, ArtifactDockStreamEvent as G, ArtifactAgentDockProps as H, UserMessageProps as I, modelProvider as J, ArtifactKind as K, agentTimelineStepKind$1 as L, TRANSCRIPT_TEXT as M, ThinkingIndicator as N, SpeakerHeaderProps as O, ThinkingIndicatorProps as P, AgentProfileOption as Q, foldSummary as R, MessageAuthorProps as S, MessageRole$1 as T, ArtifactAgentDockTransport as U, ArtifactAgentDock as V, ArtifactDockMessage as W, AgentProfileCapability as X, snapHarnessToModel as Y, AgentProfileDraft as Z, ChatContainer$1 as _, AgentTimelineFoldItem as a, ReasoningLevelPicker as at, ChatMessageProps as b, AgentTimelineProps as c, AgentTimelineStepKind as d, AgentProfilePickerProps as et, AgentTimelineStepProps as f, ChatAuthor as g, AgentTimelineToolItem as h, AgentTimelineCustomItem as i, ReasoningLevelOption as it, SpeakerState as j, SpeakerPart as k, AgentTimelineStatusItem as l, AgentTimelineToolGroupItem as m, AgentTimelineArtifactItem as n, HARNESS_REASONING_OPTIONS as nt, AgentTimelineItem as o, ReasoningLevelPickerProps as ot, AgentTimelineTone as p, ArtifactScope as q, AgentTimelineColumn$1 as r, ReasoningLevel as rt, AgentTimelineMessageItem as s, AgentTimeline$1 as t, DEFAULT_REASONING_LEVEL_OPTIONS as tt, AgentTimelineStep$1 as u, ChatContainerProps$1 as v, MessageListProps as w, MessageAuthor as x, ChatMessage$1 as y, isViewerMessage as z };