@peasant-labs/fairtrade 0.0.2 → 0.0.4
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/lib/ChartLine-Dlp6-CLL.js +264 -0
- package/dist/lib/InUseShell-DZvmRdj-.js +1532 -0
- package/dist/lib/analytics.css +1 -0
- package/dist/lib/analytics.js +1052 -0
- package/dist/lib/base.css +7 -1
- package/dist/lib/commons.css +1 -0
- package/dist/lib/commons.js +3275 -0
- package/dist/lib/components.css +1 -1
- package/dist/lib/graph.css +1 -0
- package/dist/lib/graph.js +823 -0
- package/dist/lib/types/Intensity.d.ts +3 -3
- package/dist/lib/types/MapCanvas.d.ts +37 -5
- package/dist/lib/types/RoleRoster.d.ts +12 -1
- package/dist/lib/types/analytics/ChartCard.d.ts +18 -0
- package/dist/lib/types/analytics/ContributorTable.d.ts +16 -0
- package/dist/lib/types/analytics/ProjectOverview.d.ts +40 -0
- package/dist/lib/types/analytics/format.d.ts +48 -0
- package/dist/lib/types/analytics/index.d.ts +24 -0
- package/dist/lib/types/analytics/metrics.d.ts +130 -0
- package/dist/lib/types/analytics/stats.d.ts +23 -0
- package/dist/lib/types/analytics/time.d.ts +32 -0
- package/dist/lib/types/analytics/types.d.ts +453 -0
- package/dist/lib/types/commons/Explore.d.ts +6 -0
- package/dist/lib/types/commons/Manage.d.ts +34 -0
- package/dist/lib/types/commons/index.d.ts +24 -0
- package/dist/lib/types/commons/providers.d.ts +8 -0
- package/dist/lib/types/commons/types.d.ts +356 -0
- package/dist/lib/types/graph/ChangeDetail.d.ts +28 -0
- package/dist/lib/types/graph/Changes.d.ts +21 -0
- package/dist/lib/types/graph/CodeMap.d.ts +49 -0
- package/dist/lib/types/graph/CodeMapComposition.d.ts +85 -0
- package/dist/lib/types/graph/changeGraph.d.ts +106 -0
- package/dist/lib/types/graph/index.d.ts +30 -0
- package/dist/lib/types/graph/types.d.ts +579 -0
- package/dist/lib/types/index.d.ts +3 -0
- package/dist/lib/types/inuse/InUseShell.d.ts +50 -0
- package/dist/lib/types/transcript/CheckRow.d.ts +15 -0
- package/dist/lib/types/transcript/DiffEntryCard.d.ts +27 -0
- package/dist/lib/types/transcript/FilterSection.d.ts +11 -0
- package/dist/lib/types/transcript/FiltersRail.d.ts +41 -0
- package/dist/lib/types/transcript/LabelPopover.d.ts +14 -0
- package/dist/lib/types/transcript/Markdown.d.ts +7 -0
- package/dist/lib/types/transcript/OutlineRail.d.ts +13 -0
- package/dist/lib/types/transcript/Scorecard.d.ts +8 -0
- package/dist/lib/types/transcript/Scrubber.d.ts +17 -0
- package/dist/lib/types/transcript/TaskBody.d.ts +8 -0
- package/dist/lib/types/transcript/Thinking.d.ts +9 -0
- package/dist/lib/types/transcript/ToolBody.d.ts +8 -0
- package/dist/lib/types/transcript/ToolCall.d.ts +12 -0
- package/dist/lib/types/transcript/TranscriptViewer.d.ts +6 -0
- package/dist/lib/types/transcript/TurnCard.d.ts +31 -0
- package/dist/lib/types/transcript/ViewSwitch.d.ts +11 -0
- package/dist/lib/types/transcript/adapter.d.ts +90 -0
- package/dist/lib/types/transcript/adapter.parse.d.ts +75 -0
- package/dist/lib/types/transcript/analytics.d.ts +216 -0
- package/dist/lib/types/transcript/graph/GraphLegend.d.ts +49 -0
- package/dist/lib/types/transcript/graph/GraphSubagentBranch.d.ts +24 -0
- package/dist/lib/types/transcript/graph/GraphToolNode.d.ts +56 -0
- package/dist/lib/types/transcript/graph/GraphTurnNode.d.ts +76 -0
- package/dist/lib/types/transcript/graph/index.d.ts +10 -0
- package/dist/lib/types/transcript/index.d.ts +69 -0
- package/dist/lib/types/transcript/state-capabilities.d.ts +161 -0
- package/dist/lib/types/transcript/view-model.d.ts +563 -0
- package/dist/lib/types/transcript/wire-types.d.ts +325 -0
- package/dist/lib/ui-oBFnHPFe.js +11146 -0
- package/dist/lib/ui.js +4 -8736
- package/package.json +42 -6
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The trajectory-graph tool-cluster pill visual.
|
|
3
|
+
* @param {GraphToolNodeProps} props
|
|
4
|
+
* @returns {JSX.Element}
|
|
5
|
+
*/
|
|
6
|
+
export function GraphToolNode({ tools, totalDurationMs, hasError, isFilteredOut, max, className, }: GraphToolNodeProps): JSX.Element;
|
|
7
|
+
export default GraphToolNode;
|
|
8
|
+
/**
|
|
9
|
+
* One cooked tool entry for the cluster. A strict presentational subset of
|
|
10
|
+
* ToolCallVM — note the absence of any raw wire `arguments`/`result` string, by
|
|
11
|
+
* design, so the visual cannot parse wire JSON.
|
|
12
|
+
*/
|
|
13
|
+
export type GraphToolItem = {
|
|
14
|
+
id: string;
|
|
15
|
+
/**
|
|
16
|
+
* display name (e.g. "Read", "Bash")
|
|
17
|
+
*/
|
|
18
|
+
name: string;
|
|
19
|
+
/**
|
|
20
|
+
* tool kind (decorative grouping hint)
|
|
21
|
+
*/
|
|
22
|
+
kind?: string;
|
|
23
|
+
/**
|
|
24
|
+
* cooked path; basename is the preview fallback
|
|
25
|
+
*/
|
|
26
|
+
filePath?: string;
|
|
27
|
+
/**
|
|
28
|
+
* cooked one-line arg summary (NEVER parsed here)
|
|
29
|
+
*/
|
|
30
|
+
preview?: string;
|
|
31
|
+
isError?: boolean;
|
|
32
|
+
exitCode?: number;
|
|
33
|
+
};
|
|
34
|
+
export type GraphToolNodeProps = {
|
|
35
|
+
/**
|
|
36
|
+
* the cooked tool calls for this turn
|
|
37
|
+
*/
|
|
38
|
+
tools: GraphToolItem[];
|
|
39
|
+
/**
|
|
40
|
+
* summed duration → header badge
|
|
41
|
+
*/
|
|
42
|
+
totalDurationMs?: number;
|
|
43
|
+
/**
|
|
44
|
+
* cluster carries a failed call
|
|
45
|
+
*/
|
|
46
|
+
hasError?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* engine: dimmed by an active filter
|
|
49
|
+
*/
|
|
50
|
+
isFilteredOut?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* rows before collapsing to "+ N more" (default 4)
|
|
53
|
+
*/
|
|
54
|
+
max?: number;
|
|
55
|
+
className?: string;
|
|
56
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The trajectory-graph turn card visual.
|
|
3
|
+
* @param {GraphTurnNodeProps} props
|
|
4
|
+
* @returns {JSX.Element}
|
|
5
|
+
*/
|
|
6
|
+
export function GraphTurnNode({ role, agentName, turnNumber, contentPreview, toolCount, totalTokens, tokensIn, tokensOut, hasError, hasRetry, hasRevert, isSearchMatch, isFilteredOut, isSelected, provider, className, }: GraphTurnNodeProps): JSX.Element;
|
|
7
|
+
export default GraphTurnNode;
|
|
8
|
+
export type Role = import("../wire-types.js").Role;
|
|
9
|
+
/**
|
|
10
|
+
* Cooked, engine-agnostic props for one trajectory-graph turn card. Every field
|
|
11
|
+
* is a finished display value — the component does no parsing, truncation, or
|
|
12
|
+
* data derivation beyond choosing the accent token and chrome label.
|
|
13
|
+
*/
|
|
14
|
+
export type GraphTurnNodeProps = {
|
|
15
|
+
/**
|
|
16
|
+
* canonical role; selects the chrome label + base accent
|
|
17
|
+
*/
|
|
18
|
+
role: Role;
|
|
19
|
+
/**
|
|
20
|
+
* subagent name; PRESENT ⇒ render as a subagent (mauve)
|
|
21
|
+
*/
|
|
22
|
+
agentName?: string;
|
|
23
|
+
/**
|
|
24
|
+
* the display number shown as "#…"
|
|
25
|
+
*/
|
|
26
|
+
turnNumber: string | number;
|
|
27
|
+
/**
|
|
28
|
+
* one-line, already-truncated preview (may be empty)
|
|
29
|
+
*/
|
|
30
|
+
contentPreview: string;
|
|
31
|
+
/**
|
|
32
|
+
* tool-call count for the footer ("N tools")
|
|
33
|
+
*/
|
|
34
|
+
toolCount: number;
|
|
35
|
+
/**
|
|
36
|
+
* total tokens for the footer badge
|
|
37
|
+
*/
|
|
38
|
+
totalTokens: number;
|
|
39
|
+
/**
|
|
40
|
+
* optional split, surfaced via title for hover detail
|
|
41
|
+
*/
|
|
42
|
+
tokensIn?: number;
|
|
43
|
+
tokensOut?: number;
|
|
44
|
+
/**
|
|
45
|
+
* clay accent + error flag (highest-priority flag)
|
|
46
|
+
*/
|
|
47
|
+
hasError?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* "retry" flag (when not an error)
|
|
50
|
+
*/
|
|
51
|
+
hasRetry?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* "re-edit" flag (when not an error or retry)
|
|
54
|
+
*/
|
|
55
|
+
hasRevert?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* engine: highlighted as a search hit
|
|
58
|
+
*/
|
|
59
|
+
isSearchMatch?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* engine: dimmed because a filter excludes it
|
|
62
|
+
*/
|
|
63
|
+
isFilteredOut?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* engine: the active/selected node
|
|
66
|
+
*/
|
|
67
|
+
isSelected?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* harness key (e.g. "claude-code") → assistant accent
|
|
70
|
+
*/
|
|
71
|
+
provider?: string;
|
|
72
|
+
/**
|
|
73
|
+
* extra classes appended after the base
|
|
74
|
+
*/
|
|
75
|
+
className?: string;
|
|
76
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { GraphTurnNode } from "./GraphTurnNode.jsx";
|
|
2
|
+
export { GraphToolNode } from "./GraphToolNode.jsx";
|
|
3
|
+
export { GraphSubagentBranch } from "./GraphSubagentBranch.jsx";
|
|
4
|
+
export type GraphTurnNodeProps = import("./GraphTurnNode.jsx").GraphTurnNodeProps;
|
|
5
|
+
export type GraphToolNodeProps = import("./GraphToolNode.jsx").GraphToolNodeProps;
|
|
6
|
+
export type GraphToolItem = import("./GraphToolNode.jsx").GraphToolItem;
|
|
7
|
+
export type GraphSubagentBranchProps = import("./GraphSubagentBranch.jsx").GraphSubagentBranchProps;
|
|
8
|
+
export type GraphLegendProps = import("./GraphLegend.jsx").GraphLegendProps;
|
|
9
|
+
export type GraphLegendItem = import("./GraphLegend.jsx").GraphLegendItem;
|
|
10
|
+
export { GraphLegend, GRAPH_LEGEND_ITEMS } from "./GraphLegend.jsx";
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export { TOOL_GROUPS } from "./view-model.js";
|
|
2
|
+
export { default as TranscriptTurnCard } from "./TurnCard.jsx";
|
|
3
|
+
export { default as TranscriptThinking } from "./Thinking.jsx";
|
|
4
|
+
export { default as TranscriptMarkdown } from "./Markdown.jsx";
|
|
5
|
+
export { default as TranscriptToolCall } from "./ToolCall.jsx";
|
|
6
|
+
export { default as TranscriptToolBody } from "./ToolBody.jsx";
|
|
7
|
+
export { default as TranscriptTaskBody } from "./TaskBody.jsx";
|
|
8
|
+
export { default as TranscriptViewer } from "./TranscriptViewer.jsx";
|
|
9
|
+
export { default as TranscriptOutlineRail } from "./OutlineRail.jsx";
|
|
10
|
+
export { default as TranscriptFiltersRail } from "./FiltersRail.jsx";
|
|
11
|
+
export { default as TranscriptFilterSection } from "./FilterSection.jsx";
|
|
12
|
+
export { default as TranscriptCheckRow } from "./CheckRow.jsx";
|
|
13
|
+
export { default as TranscriptViewSwitch } from "./ViewSwitch.jsx";
|
|
14
|
+
export { default as TranscriptScrubber } from "./Scrubber.jsx";
|
|
15
|
+
export { default as TranscriptScorecard } from "./Scorecard.jsx";
|
|
16
|
+
export { default as TranscriptLabelPopover } from "./LabelPopover.jsx";
|
|
17
|
+
export type TaskGroup = import("./analytics.js").TaskGroup;
|
|
18
|
+
export type WaterfallSegment = import("./analytics.js").WaterfallSegment;
|
|
19
|
+
export type TranscriptAnnotation = import("./analytics.js").TranscriptAnnotation;
|
|
20
|
+
export type PersonalMedians = import("./analytics.js").PersonalMedians;
|
|
21
|
+
export type PersonalMedianSession = import("./analytics.js").PersonalMedianSession;
|
|
22
|
+
export type PhaseType = import("./analytics.js").PhaseType;
|
|
23
|
+
export type Role = import("./wire-types.js").Role;
|
|
24
|
+
export type EntryType = import("./wire-types.js").EntryType;
|
|
25
|
+
export type ToolCallKind = import("./wire-types.js").ToolCallKind;
|
|
26
|
+
export type StopReason = import("./wire-types.js").StopReason;
|
|
27
|
+
export type SessionOutcome = import("./wire-types.js").SessionOutcome;
|
|
28
|
+
export type Harness = import("./wire-types.js").Harness;
|
|
29
|
+
export type ToolCallDetail = import("./wire-types.js").ToolCallDetail;
|
|
30
|
+
export type TurnDetail = import("./wire-types.js").TurnDetail;
|
|
31
|
+
export type ChildSessionRef = import("./wire-types.js").ChildSessionRef;
|
|
32
|
+
export type SessionScorecard = import("./wire-types.js").SessionScorecard;
|
|
33
|
+
export type CommitInfo = import("./wire-types.js").CommitInfo;
|
|
34
|
+
export type GitContext = import("./wire-types.js").GitContext;
|
|
35
|
+
export type AnnotationSummary = import("./wire-types.js").AnnotationSummary;
|
|
36
|
+
export type SessionDetailPayload = import("./wire-types.js").SessionDetailPayload;
|
|
37
|
+
export type TranscriptWireInput = import("./wire-types.js").TranscriptWireInput;
|
|
38
|
+
export type TranscriptViewerProps = import("./state-capabilities.js").TranscriptViewerProps;
|
|
39
|
+
export type ViewerCapabilities = import("./state-capabilities.js").ViewerCapabilities;
|
|
40
|
+
export type ViewerCallbacks = import("./state-capabilities.js").ViewerCallbacks;
|
|
41
|
+
export type GraphSlotContext = import("./state-capabilities.js").GraphSlotContext;
|
|
42
|
+
export type TranscriptFilters = import("./state-capabilities.js").TranscriptFilters;
|
|
43
|
+
export type SavedLabel = import("./state-capabilities.js").SavedLabel;
|
|
44
|
+
export type Theme = import("./state-capabilities.js").Theme;
|
|
45
|
+
export type TranscriptTab = import("./state-capabilities.js").TranscriptTab;
|
|
46
|
+
export type ViewMode = import("./state-capabilities.js").ViewMode;
|
|
47
|
+
export type TranscriptViewModel = import("./view-model.js").TranscriptViewModel;
|
|
48
|
+
export type SessionVM = import("./view-model.js").SessionVM;
|
|
49
|
+
export type SessionGitVM = import("./view-model.js").SessionGitVM;
|
|
50
|
+
export type CommitVM = import("./view-model.js").CommitVM;
|
|
51
|
+
export type TurnVM = import("./view-model.js").TurnVM;
|
|
52
|
+
export type ThinkingVM = import("./view-model.js").ThinkingVM;
|
|
53
|
+
export type ToolCallVM = import("./view-model.js").ToolCallVM;
|
|
54
|
+
export type ToolGroup = import("./view-model.js").ToolGroup;
|
|
55
|
+
export type DiffLineVM = import("./view-model.js").DiffLineVM;
|
|
56
|
+
export type DiffHunkVM = import("./view-model.js").DiffHunkVM;
|
|
57
|
+
export type DiffEntryVM = import("./view-model.js").DiffEntryVM;
|
|
58
|
+
export type FileEntryVM = import("./view-model.js").FileEntryVM;
|
|
59
|
+
export type TaskGroupVM = import("./view-model.js").TaskGroupVM;
|
|
60
|
+
export type HighlightVM = import("./view-model.js").HighlightVM;
|
|
61
|
+
export type AnnotationVM = import("./view-model.js").AnnotationVM;
|
|
62
|
+
export type FilterIndexVM = import("./view-model.js").FilterIndexVM;
|
|
63
|
+
export type PhaseVM = import("./view-model.js").PhaseVM;
|
|
64
|
+
export type ScorecardBandVM = import("./view-model.js").ScorecardBandVM;
|
|
65
|
+
export type TranscriptAnalyticsVM = import("./view-model.js").TranscriptAnalyticsVM;
|
|
66
|
+
export { ROLES, ENTRY_TYPES, TOOL_CALL_KINDS, STOP_REASONS, SESSION_OUTCOMES, HARNESSES } from "./wire-types.js";
|
|
67
|
+
export { adaptTranscript, prefilterTurns, diffLines } from "./adapter.js";
|
|
68
|
+
export { computeTasks, computeTurnLabels, buildTaskWaterfall, annotateTranscript, computePersonalMedians, detectPhases, assessScorecard, computeAnalytics, computeTaskGroups, phaseLabel } from "./analytics.js";
|
|
69
|
+
export { default as TranscriptDiffEntryCard, DiffHunks as TranscriptDiffHunks } from "./DiffEntryCard.jsx";
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The five session views. `highlights` is backed by `vm.highlights`; the rest
|
|
3
|
+
* read their cooked slices off the same `TranscriptViewModel`.
|
|
4
|
+
*/
|
|
5
|
+
export type TranscriptTab = "highlights" | "trace" | "diffs" | "files" | "annotations";
|
|
6
|
+
/**
|
|
7
|
+
* The trace canvas render mode: the lifted turn-card list, or the graph slot.
|
|
8
|
+
*/
|
|
9
|
+
export type ViewMode = "list" | "graph";
|
|
10
|
+
/**
|
|
11
|
+
* The optional theme; defaults to `dark` when unset.
|
|
12
|
+
*/
|
|
13
|
+
export type Theme = "dark" | "light";
|
|
14
|
+
/**
|
|
15
|
+
* A per-turn saved label (the LabelPopover's output). `outcome` is the verdict
|
|
16
|
+
* band; `flag` is an optional friction tag. Keyed by turn index in `savedLabels`.
|
|
17
|
+
*/
|
|
18
|
+
export type SavedLabel = {
|
|
19
|
+
outcome: "good" | "neutral" | "bad";
|
|
20
|
+
flag?: string;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* The cooked filter state the FiltersRail drives. Categories gate turn KINDS;
|
|
24
|
+
* `toolGroups` gate tool-call groups (keyed by the cooked `ToolGroup` ids);
|
|
25
|
+
* `tags` gate semantic friction tags; `views` are display toggles; `checkpoint`
|
|
26
|
+
* scopes the trace to a commit (`'all'` = unscoped).
|
|
27
|
+
*/
|
|
28
|
+
export type TranscriptFilters = {
|
|
29
|
+
categories: {
|
|
30
|
+
prompts: boolean;
|
|
31
|
+
responses: boolean;
|
|
32
|
+
thinking: boolean;
|
|
33
|
+
toolcalls: boolean;
|
|
34
|
+
};
|
|
35
|
+
toolGroups: Partial<Record<import("./view-model.js").ToolGroup, boolean>>;
|
|
36
|
+
tags: {
|
|
37
|
+
errors: boolean;
|
|
38
|
+
retries: boolean;
|
|
39
|
+
revert: boolean;
|
|
40
|
+
};
|
|
41
|
+
views: {
|
|
42
|
+
hidden: boolean;
|
|
43
|
+
expandAll: boolean;
|
|
44
|
+
compact: boolean;
|
|
45
|
+
};
|
|
46
|
+
checkpoint: string;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* The consumer/auth-derived permission surface — REQUIRED on TranscriptViewer
|
|
50
|
+
* (no default). Every flag is required (not optional) so a consumer cannot pass
|
|
51
|
+
* a partial surface and silently leave a permission unset; the host decides each
|
|
52
|
+
* one explicitly. The composite gates each capability's affordance + callback on
|
|
53
|
+
* its flag, so a `false` capability removes the affordance entirely.
|
|
54
|
+
*/
|
|
55
|
+
export type ViewerCapabilities = {
|
|
56
|
+
/**
|
|
57
|
+
* show the "edit" action + wire `onEdit`
|
|
58
|
+
*/
|
|
59
|
+
canEdit: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* show the per-turn "label" affordance + the LabelPopover
|
|
62
|
+
*/
|
|
63
|
+
canLabel: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* show the "contribute" share action + wire `onContribute`
|
|
66
|
+
*/
|
|
67
|
+
canContribute: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* show the visibility control + wire `onChangeVisibility`
|
|
70
|
+
*/
|
|
71
|
+
canChangeVisibility: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* show the download (json/jsonl/markdown) actions + wire `onExport`
|
|
74
|
+
*/
|
|
75
|
+
canExport: boolean;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* The host callbacks. All optional; each is wired ONLY when its matching
|
|
79
|
+
* capability is true (see ViewerCapabilities). `onLabel` carries the popover's
|
|
80
|
+
* cooked result; `onExport` carries the requested format. The viewer never
|
|
81
|
+
* mutates the host's data — it reports intent through these.
|
|
82
|
+
*/
|
|
83
|
+
export type ViewerCallbacks = {
|
|
84
|
+
onEdit?: () => void;
|
|
85
|
+
onLabel?: (turnIndex: number, label: SavedLabel) => void;
|
|
86
|
+
onContribute?: () => void;
|
|
87
|
+
onCopyLink?: () => void;
|
|
88
|
+
onChangeVisibility?: () => void;
|
|
89
|
+
onExport?: (format: "json" | "jsonl" | "markdown") => void;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* What the `graphSlot` render-prop receives. The composite owns NO graph engine
|
|
93
|
+
* (no `@xyflow` dependency); in `viewMode: 'graph'` it hands the consumer this
|
|
94
|
+
* cooked context and renders whatever the consumer returns (TB plugs its
|
|
95
|
+
*/
|
|
96
|
+
export type GraphSlotContext = {
|
|
97
|
+
viewModel: import("./view-model.js").TranscriptViewModel;
|
|
98
|
+
activeTurn: number;
|
|
99
|
+
onSelectTurn: (turnIndex: number) => void;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Every TranscriptViewer prop. `viewModel` + `capabilities` are the only required
|
|
103
|
+
* props; everything else is optional with a sane internal default, so
|
|
104
|
+
* `<TranscriptViewer viewModel={vm} capabilities={caps} />` renders the whole
|
|
105
|
+
* surface unmanaged. Each view-state prop is the `value?` half of a controllable
|
|
106
|
+
* pair whose `onChange?` half sits beside it (React's controlled-component
|
|
107
|
+
* convention): pass neither ⇒ internal default; pass both ⇒ fully controlled.
|
|
108
|
+
*/
|
|
109
|
+
export type TranscriptViewerProps = {
|
|
110
|
+
/**
|
|
111
|
+
* the cooked VM (the adapter's output)
|
|
112
|
+
*/
|
|
113
|
+
viewModel: import("./view-model.js").TranscriptViewModel;
|
|
114
|
+
/**
|
|
115
|
+
* REQUIRED — no default
|
|
116
|
+
*/
|
|
117
|
+
capabilities: ViewerCapabilities;
|
|
118
|
+
callbacks?: ViewerCallbacks;
|
|
119
|
+
/**
|
|
120
|
+
* optional; defaults to 'dark'
|
|
121
|
+
*/
|
|
122
|
+
theme?: Theme;
|
|
123
|
+
/**
|
|
124
|
+
* render-prop for the graph engine
|
|
125
|
+
*/
|
|
126
|
+
graphSlot?: (ctx: GraphSlotContext) => unknown;
|
|
127
|
+
activeTab?: TranscriptTab;
|
|
128
|
+
onTabChange?: (tab: TranscriptTab) => void;
|
|
129
|
+
viewMode?: ViewMode;
|
|
130
|
+
onViewModeChange?: (mode: ViewMode) => void;
|
|
131
|
+
leftRailOpen?: boolean;
|
|
132
|
+
onLeftRailOpenChange?: (open: boolean) => void;
|
|
133
|
+
rightRailOpen?: boolean;
|
|
134
|
+
onRightRailOpenChange?: (open: boolean) => void;
|
|
135
|
+
/**
|
|
136
|
+
* tool id → open?
|
|
137
|
+
*/
|
|
138
|
+
openTools?: Record<string, boolean>;
|
|
139
|
+
onOpenToolsChange?: (openTools: Record<string, boolean>) => void;
|
|
140
|
+
activeTurn?: number;
|
|
141
|
+
onActiveTurnChange?: (turnIndex: number) => void;
|
|
142
|
+
search?: string;
|
|
143
|
+
onSearchChange?: (query: string) => void;
|
|
144
|
+
filters?: TranscriptFilters;
|
|
145
|
+
onFiltersChange?: (filters: TranscriptFilters) => void;
|
|
146
|
+
/**
|
|
147
|
+
* turn index → saved label
|
|
148
|
+
*/
|
|
149
|
+
savedLabels?: Record<number, SavedLabel>;
|
|
150
|
+
onSavedLabelsChange?: (savedLabels: Record<number, SavedLabel>) => void;
|
|
151
|
+
/**
|
|
152
|
+
* share action-menu disclosure (default closed)
|
|
153
|
+
*/
|
|
154
|
+
shareOpen?: boolean;
|
|
155
|
+
onShareOpenChange?: (open: boolean) => void;
|
|
156
|
+
/**
|
|
157
|
+
* more action-menu disclosure (default closed)
|
|
158
|
+
*/
|
|
159
|
+
moreOpen?: boolean;
|
|
160
|
+
onMoreOpenChange?: (open: boolean) => void;
|
|
161
|
+
};
|