@peasant-labs/fairtrade 0.0.5 → 0.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/LICENSE +202 -21
- package/dist/lib/{ChartLine-Dlp6-CLL.js → ChartLine-Cycmpjep.js} +45 -39
- package/dist/lib/InUseShell-VRWaysXY.js +2488 -0
- package/dist/lib/analytics.js +1 -1
- package/dist/lib/commons.js +801 -836
- package/dist/lib/components.css +1 -1
- package/dist/lib/graph.css +1 -1
- package/dist/lib/graph.js +684 -285
- package/dist/lib/types/ChartBar.d.ts +3 -1
- package/dist/lib/types/ChartLine.d.ts +3 -1
- package/dist/lib/types/CommitGraph.d.ts +12 -3
- package/dist/lib/types/MapCanvas.d.ts +45 -2
- package/dist/lib/types/ProviderIcon.d.ts +23 -20
- package/dist/lib/types/chart-shared.d.ts +1 -0
- package/dist/lib/types/commons/providers.d.ts +7 -8
- package/dist/lib/types/commons/types.d.ts +3 -6
- package/dist/lib/types/graph/Changes.d.ts +8 -4
- package/dist/lib/types/graph/CodeMap.d.ts +17 -1
- package/dist/lib/types/graph/CodeMapComposition.d.ts +25 -1
- package/dist/lib/types/graph/CodeMapNavigator.d.ts +35 -0
- package/dist/lib/types/graph/changeGraph.d.ts +12 -0
- package/dist/lib/types/graph/codeMapState.d.ts +136 -0
- package/dist/lib/types/graph/index.d.ts +15 -1
- package/dist/lib/types/graph/timelineNavigation.d.ts +33 -0
- package/dist/lib/types/graph/types.d.ts +67 -440
- package/dist/lib/types/index.d.ts +2 -0
- package/dist/lib/types/provider-policy.d.ts +27 -0
- package/dist/lib/types/transcript/TranscriptViewer.d.ts +1 -1
- package/dist/lib/types/transcript/TurnCard.d.ts +3 -1
- package/dist/lib/types/transcript/adapter.d.ts +5 -40
- package/dist/lib/types/transcript/graph/GraphLegend.d.ts +3 -3
- package/dist/lib/types/transcript/graph/GraphTurnNode.d.ts +2 -2
- package/dist/lib/types/transcript/index.d.ts +4 -1
- package/dist/lib/types/transcript/initial-position.d.ts +80 -0
- package/dist/lib/types/transcript/state-capabilities.d.ts +53 -1
- package/dist/lib/types/transcript/useTranscriptInitialPosition.d.ts +26 -0
- package/dist/lib/types/transcript/view-model.d.ts +16 -16
- package/dist/lib/types/transcript/wire-types.d.ts +46 -308
- package/dist/lib/{ui-oBFnHPFe.js → ui-CKqVB4x2.js} +3592 -3584
- package/dist/lib/ui.js +4 -4
- package/package.json +51 -26
- package/dist/lib/InUseShell-DZvmRdj-.js +0 -1532
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @param {TranscriptViewerProps} props
|
|
3
3
|
*/
|
|
4
|
-
export default function TranscriptViewer({ viewModel, capabilities, callbacks, theme: themeProp, onThemeChange, graphSlot, activeTab: activeTabProp, onTabChange, viewMode: viewModeProp, onViewModeChange, leftRailOpen: leftRailOpenProp, onLeftRailOpenChange, rightRailOpen: rightRailOpenProp, onRightRailOpenChange, openTools: openToolsProp, onOpenToolsChange, activeTurn: activeTurnProp, onActiveTurnChange, search: searchProp, onSearchChange, filters: filtersProp, onFiltersChange, savedLabels: savedLabelsProp, onSavedLabelsChange, shareOpen: shareOpenProp, onShareOpenChange, moreOpen: moreOpenProp, onMoreOpenChange, }: TranscriptViewerProps): any;
|
|
4
|
+
export default function TranscriptViewer({ viewModel, capabilities, callbacks, theme: themeProp, onThemeChange, graphSlot, activeTab: activeTabProp, onTabChange, viewMode: viewModeProp, onViewModeChange, leftRailOpen: leftRailOpenProp, onLeftRailOpenChange, rightRailOpen: rightRailOpenProp, onRightRailOpenChange, openTools: openToolsProp, onOpenToolsChange, initialPosition: initialPositionProp, activeTurn: activeTurnProp, onActiveTurnChange, search: searchProp, onSearchChange, filters: filtersProp, onFiltersChange, savedLabels: savedLabelsProp, onSavedLabelsChange, shareOpen: shareOpenProp, onShareOpenChange, moreOpen: moreOpenProp, onMoreOpenChange, breadcrumb, LinkComponent, renderTurnPanel, renderTurnActions, anchorHref, headerActions, streamPrelude, }: TranscriptViewerProps): any;
|
|
5
5
|
export type TranscriptViewerProps = import("./state-capabilities.js").TranscriptViewerProps;
|
|
6
6
|
export type TranscriptFilters = import("./state-capabilities.js").TranscriptFilters;
|
|
@@ -8,11 +8,12 @@
|
|
|
8
8
|
* @param {boolean} [props.copied]
|
|
9
9
|
* @param {(turnIndex: number, el: HTMLElement | null) => void} [props.registerRef]
|
|
10
10
|
* @param {(turnIndex: number) => void} [props.onLabel] omit to hide the "label" affordance
|
|
11
|
+
* @param {(turn: object) => unknown} [props.renderActions] host-owned per-turn actions; replaces the built-in label button (hosts with their own label models render their own popover)
|
|
11
12
|
* @param {{ outcome: string, flag?: string }} [props.savedLabel]
|
|
12
13
|
* @param {boolean} [props.compact]
|
|
13
14
|
* @param {boolean} [props.expandAll]
|
|
14
15
|
*/
|
|
15
|
-
export default function TurnCard({ turn, active, openTools, toggleTool, onCopyAnchor, copied, registerRef, onLabel, savedLabel, compact, expandAll, }: {
|
|
16
|
+
export default function TurnCard({ turn, active, openTools, toggleTool, onCopyAnchor, copied, registerRef, onLabel, renderActions, savedLabel, compact, expandAll, }: {
|
|
16
17
|
turn?: TurnVM;
|
|
17
18
|
active?: boolean;
|
|
18
19
|
openTools?: Record<string, boolean>;
|
|
@@ -21,6 +22,7 @@ export default function TurnCard({ turn, active, openTools, toggleTool, onCopyAn
|
|
|
21
22
|
copied?: boolean;
|
|
22
23
|
registerRef?: (turnIndex: number, el: HTMLElement | null) => void;
|
|
23
24
|
onLabel?: (turnIndex: number) => void;
|
|
25
|
+
renderActions?: (turn: object) => unknown;
|
|
24
26
|
savedLabel?: {
|
|
25
27
|
outcome: string;
|
|
26
28
|
flag?: string;
|
|
@@ -21,9 +21,9 @@ export function diffLines(oldText: string, newText: string): DiffLineVM[];
|
|
|
21
21
|
/**
|
|
22
22
|
* Project the canonical wire payload (folded turns) into the cooked
|
|
23
23
|
* `TranscriptViewModel` every dumb transcript component renders. The SOLE
|
|
24
|
-
* wire-parse + git
|
|
24
|
+
* wire-parse + legacy-git normalisation site.
|
|
25
25
|
*
|
|
26
|
-
* @param {TranscriptWireInput} payload canonical wire
|
|
26
|
+
* @param {TranscriptWireInput} payload canonical wire plus legacy git compatibility
|
|
27
27
|
* @param {AnnotationSummary[]} [annotations] separately-fetched entry annotations
|
|
28
28
|
* @param {TranscriptAnalyticsVM} [analytics] precomputed analytics; else derived on demand
|
|
29
29
|
* @returns {TranscriptViewModel}
|
|
@@ -34,6 +34,9 @@ export type SessionDetailPayload = import("./wire-types.js").SessionDetailPayloa
|
|
|
34
34
|
export type TurnDetail = import("./wire-types.js").TurnDetail;
|
|
35
35
|
export type ToolCallDetail = import("./wire-types.js").ToolCallDetail;
|
|
36
36
|
export type AnnotationSummary = import("./wire-types.js").AnnotationSummary;
|
|
37
|
+
export type CommitInfo = import("./wire-types.js").CommitInfo;
|
|
38
|
+
export type LegacyCommit = import("./wire-types.js").LegacyCommit;
|
|
39
|
+
export type LegacyGitContext = import("./wire-types.js").LegacyGitContext;
|
|
37
40
|
export type TranscriptViewModel = import("./view-model.js").TranscriptViewModel;
|
|
38
41
|
export type TranscriptAnalyticsVM = import("./view-model.js").TranscriptAnalyticsVM;
|
|
39
42
|
export type SessionVM = import("./view-model.js").SessionVM;
|
|
@@ -50,41 +53,3 @@ export type AnnotationVM = import("./view-model.js").AnnotationVM;
|
|
|
50
53
|
export type HighlightVM = import("./view-model.js").HighlightVM;
|
|
51
54
|
export type FilterIndexVM = import("./view-model.js").FilterIndexVM;
|
|
52
55
|
export type PhaseVM = import("./view-model.js").PhaseVM;
|
|
53
|
-
export type WireGitLike = {
|
|
54
|
-
branch?: string | null;
|
|
55
|
-
remote?: string | null;
|
|
56
|
-
/**
|
|
57
|
-
* TS-drift author (transcript.ts)
|
|
58
|
-
*/
|
|
59
|
-
user?: string;
|
|
60
|
-
commits?: unknown[];
|
|
61
|
-
};
|
|
62
|
-
export type WireCommitLike = {
|
|
63
|
-
hash?: string;
|
|
64
|
-
message?: string;
|
|
65
|
-
/**
|
|
66
|
-
* Go shape (metadata.go)
|
|
67
|
-
*/
|
|
68
|
-
authorName?: string;
|
|
69
|
-
/**
|
|
70
|
-
* Go shape, Unix millis
|
|
71
|
-
*/
|
|
72
|
-
commitTime?: number;
|
|
73
|
-
/**
|
|
74
|
-
* TS-drift shape (transcript.ts)
|
|
75
|
-
*/
|
|
76
|
-
timestamp?: string;
|
|
77
|
-
/**
|
|
78
|
-
* TS-drift per-commit churn
|
|
79
|
-
*/
|
|
80
|
-
filesChanged?: number;
|
|
81
|
-
/**
|
|
82
|
-
* TS-drift per-commit churn
|
|
83
|
-
*/
|
|
84
|
-
insertions?: number;
|
|
85
|
-
/**
|
|
86
|
-
* TS-drift per-commit churn
|
|
87
|
-
*/
|
|
88
|
-
deletions?: number;
|
|
89
|
-
session?: boolean;
|
|
90
|
-
};
|
|
@@ -10,7 +10,7 @@ export function GraphLegend({ items, className }: GraphLegendProps): JSX.Element
|
|
|
10
10
|
* @property {'user' | 'assistant' | 'subagent' | 'tool' | 'error' | (string & {})} kind
|
|
11
11
|
* the node kind this swatch stands for; selects the accent
|
|
12
12
|
* @property {string} label the lowercase word shown beside the swatch
|
|
13
|
-
* @property {
|
|
13
|
+
* @property {import('@peasant-labs/schema').Harness} [provider] canonical harness → assistant swatch accent
|
|
14
14
|
*/
|
|
15
15
|
/**
|
|
16
16
|
* @typedef {object} GraphLegendProps
|
|
@@ -36,9 +36,9 @@ export type GraphLegendItem = {
|
|
|
36
36
|
*/
|
|
37
37
|
label: string;
|
|
38
38
|
/**
|
|
39
|
-
* harness
|
|
39
|
+
* canonical harness → assistant swatch accent
|
|
40
40
|
*/
|
|
41
|
-
provider?:
|
|
41
|
+
provider?: import("@peasant-labs/schema").Harness;
|
|
42
42
|
};
|
|
43
43
|
export type GraphLegendProps = {
|
|
44
44
|
/**
|
|
@@ -66,9 +66,9 @@ export type GraphTurnNodeProps = {
|
|
|
66
66
|
*/
|
|
67
67
|
isSelected?: boolean;
|
|
68
68
|
/**
|
|
69
|
-
* harness
|
|
69
|
+
* canonical harness → assistant accent
|
|
70
70
|
*/
|
|
71
|
-
provider?:
|
|
71
|
+
provider?: import("@peasant-labs/schema").Harness;
|
|
72
72
|
/**
|
|
73
73
|
* extra classes appended after the base
|
|
74
74
|
*/
|
|
@@ -14,6 +14,7 @@ export { default as TranscriptViewSwitch } from "./ViewSwitch.jsx";
|
|
|
14
14
|
export { default as TranscriptScrubber } from "./Scrubber.jsx";
|
|
15
15
|
export { default as TranscriptScorecard } from "./Scorecard.jsx";
|
|
16
16
|
export { default as TranscriptLabelPopover } from "./LabelPopover.jsx";
|
|
17
|
+
export { default as useTranscriptInitialPosition } from "./useTranscriptInitialPosition.jsx";
|
|
17
18
|
export type TaskGroup = import("./analytics.js").TaskGroup;
|
|
18
19
|
export type WaterfallSegment = import("./analytics.js").WaterfallSegment;
|
|
19
20
|
export type TranscriptAnnotation = import("./analytics.js").TranscriptAnnotation;
|
|
@@ -31,11 +32,12 @@ export type TurnDetail = import("./wire-types.js").TurnDetail;
|
|
|
31
32
|
export type ChildSessionRef = import("./wire-types.js").ChildSessionRef;
|
|
32
33
|
export type SessionScorecard = import("./wire-types.js").SessionScorecard;
|
|
33
34
|
export type CommitInfo = import("./wire-types.js").CommitInfo;
|
|
34
|
-
export type GitContext = import("./wire-types.js").GitContext;
|
|
35
35
|
export type AnnotationSummary = import("./wire-types.js").AnnotationSummary;
|
|
36
36
|
export type SessionDetailPayload = import("./wire-types.js").SessionDetailPayload;
|
|
37
37
|
export type TranscriptWireInput = import("./wire-types.js").TranscriptWireInput;
|
|
38
38
|
export type TranscriptViewerProps = import("./state-capabilities.js").TranscriptViewerProps;
|
|
39
|
+
export type TranscriptInitialPosition = import("./state-capabilities.js").TranscriptInitialPosition;
|
|
40
|
+
export type BreadcrumbItem = import("./state-capabilities.js").BreadcrumbItem;
|
|
39
41
|
export type ViewerCapabilities = import("./state-capabilities.js").ViewerCapabilities;
|
|
40
42
|
export type ViewerCallbacks = import("./state-capabilities.js").ViewerCallbacks;
|
|
41
43
|
export type GraphSlotContext = import("./state-capabilities.js").GraphSlotContext;
|
|
@@ -67,3 +69,4 @@ export { ROLES, ENTRY_TYPES, TOOL_CALL_KINDS, STOP_REASONS, SESSION_OUTCOMES, HA
|
|
|
67
69
|
export { adaptTranscript, prefilterTurns, diffLines } from "./adapter.js";
|
|
68
70
|
export { computeTasks, computeTurnLabels, buildTaskWaterfall, annotateTranscript, computePersonalMedians, detectPhases, assessScorecard, computeAnalytics, computeTaskGroups, phaseLabel } from "./analytics.js";
|
|
69
71
|
export { default as TranscriptDiffEntryCard, DiffHunks as TranscriptDiffHunks } from "./DiffEntryCard.jsx";
|
|
72
|
+
export { advanceTranscriptInitialPositionConsumption, normalizeTranscriptInitialPosition, resolveTranscriptInitialPosition, shouldApplyTranscriptInitialPosition, transcriptInitialPositionReadiness, transcriptInitialPositionToken } from "./initial-position.js";
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fail-closed normalization for the public one-time positioning contract.
|
|
3
|
+
* Only exact own-key shapes are accepted.
|
|
4
|
+
*
|
|
5
|
+
* @param {unknown} value
|
|
6
|
+
* @returns {TranscriptInitialPosition | null}
|
|
7
|
+
*/
|
|
8
|
+
export function normalizeTranscriptInitialPosition(value: unknown): TranscriptInitialPosition | null;
|
|
9
|
+
/**
|
|
10
|
+
* Pure precedence transition used by the React hook. Keeping this outside the
|
|
11
|
+
* hook makes explicit/fallback/legacy ownership executable without copying the
|
|
12
|
+
* controller into consumer tests.
|
|
13
|
+
*
|
|
14
|
+
* @param {{
|
|
15
|
+
* initialPosition: unknown,
|
|
16
|
+
* fallbackInitialPosition: unknown,
|
|
17
|
+
* legacyInitialPosition: unknown,
|
|
18
|
+
* explicitUsed: boolean,
|
|
19
|
+
* fallbackUsed: boolean,
|
|
20
|
+
* }} input
|
|
21
|
+
* @returns {{explicitUsed: boolean, fallbackUsed: boolean, position: TranscriptInitialPosition | null}}
|
|
22
|
+
*/
|
|
23
|
+
export function resolveTranscriptInitialPosition(input: {
|
|
24
|
+
initialPosition: unknown;
|
|
25
|
+
fallbackInitialPosition: unknown;
|
|
26
|
+
legacyInitialPosition: unknown;
|
|
27
|
+
explicitUsed: boolean;
|
|
28
|
+
fallbackUsed: boolean;
|
|
29
|
+
}): {
|
|
30
|
+
explicitUsed: boolean;
|
|
31
|
+
fallbackUsed: boolean;
|
|
32
|
+
position: TranscriptInitialPosition | null;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Pure authoritative/readiness decision shared by both transcript viewers.
|
|
36
|
+
* Side effects remain in each renderer, but only this function decides when a
|
|
37
|
+
* request is pending, terminally absent, or ready to apply.
|
|
38
|
+
*
|
|
39
|
+
* @param {TranscriptInitialPosition} position
|
|
40
|
+
* @param {{
|
|
41
|
+
* authoritativeTurnIndices: readonly number[],
|
|
42
|
+
* renderedTurnIndices: readonly number[],
|
|
43
|
+
* viewReady: boolean,
|
|
44
|
+
* scrollerReady: boolean,
|
|
45
|
+
* targetReady: boolean,
|
|
46
|
+
* }} state
|
|
47
|
+
* @returns {TranscriptInitialPositionResult}
|
|
48
|
+
*/
|
|
49
|
+
export function transcriptInitialPositionReadiness(position: TranscriptInitialPosition, state: {
|
|
50
|
+
authoritativeTurnIndices: readonly number[];
|
|
51
|
+
renderedTurnIndices: readonly number[];
|
|
52
|
+
viewReady: boolean;
|
|
53
|
+
scrollerReady: boolean;
|
|
54
|
+
targetReady: boolean;
|
|
55
|
+
}): TranscriptInitialPositionResult;
|
|
56
|
+
/**
|
|
57
|
+
* @param {string | undefined} sessionId
|
|
58
|
+
* @param {TranscriptInitialPosition | null} position
|
|
59
|
+
* @returns {string | null}
|
|
60
|
+
*/
|
|
61
|
+
export function transcriptInitialPositionToken(sessionId: string | undefined, position: TranscriptInitialPosition | null): string | null;
|
|
62
|
+
/**
|
|
63
|
+
* @param {unknown} result
|
|
64
|
+
* @returns {asserts result is TranscriptInitialPositionResult}
|
|
65
|
+
*/
|
|
66
|
+
export function assertTranscriptInitialPositionResult(result: unknown): asserts result is TranscriptInitialPositionResult;
|
|
67
|
+
/**
|
|
68
|
+
* @param {string | null} consumedToken
|
|
69
|
+
* @param {string | null} nextToken
|
|
70
|
+
*/
|
|
71
|
+
export function shouldApplyTranscriptInitialPosition(consumedToken: string | null, nextToken: string | null): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* @param {string | null} consumedToken
|
|
74
|
+
* @param {string | null} nextToken
|
|
75
|
+
* @param {TranscriptInitialPositionResult} result
|
|
76
|
+
* @returns {string | null}
|
|
77
|
+
*/
|
|
78
|
+
export function advanceTranscriptInitialPositionConsumption(consumedToken: string | null, nextToken: string | null, result: TranscriptInitialPositionResult): string | null;
|
|
79
|
+
export type TranscriptInitialPosition = import("./state-capabilities.js").TranscriptInitialPosition;
|
|
80
|
+
export type TranscriptInitialPositionResult = "pending" | "applied" | "discarded";
|
|
@@ -91,13 +91,26 @@ export type ViewerCallbacks = {
|
|
|
91
91
|
/**
|
|
92
92
|
* What the `graphSlot` render-prop receives. The composite owns NO graph engine
|
|
93
93
|
* (no `@xyflow` dependency); in `viewMode: 'graph'` it hands the consumer this
|
|
94
|
-
* cooked context and renders whatever the consumer returns (
|
|
94
|
+
* cooked context and renders whatever the consumer returns (transcript-browser plugs its
|
|
95
95
|
*/
|
|
96
96
|
export type GraphSlotContext = {
|
|
97
97
|
viewModel: import("./view-model.js").TranscriptViewModel;
|
|
98
98
|
activeTurn: number;
|
|
99
99
|
onSelectTurn: (turnIndex: number) => void;
|
|
100
100
|
};
|
|
101
|
+
/**
|
|
102
|
+
* A one-time position applied when a transcript target is first presented.
|
|
103
|
+
* This is deliberately separate from `activeTurn`, which represents ongoing
|
|
104
|
+
* selection while the user reads or navigates the transcript.
|
|
105
|
+
*/
|
|
106
|
+
export type TranscriptInitialPosition = {
|
|
107
|
+
kind: "top";
|
|
108
|
+
requestKey?: string;
|
|
109
|
+
} | {
|
|
110
|
+
kind: "turn";
|
|
111
|
+
turnIndex: number;
|
|
112
|
+
requestKey?: string;
|
|
113
|
+
};
|
|
101
114
|
/**
|
|
102
115
|
* Every TranscriptViewer prop. `viewModel` + `capabilities` are the only required
|
|
103
116
|
* props; everything else is optional with a sane internal default, so
|
|
@@ -137,6 +150,10 @@ export type TranscriptViewerProps = {
|
|
|
137
150
|
*/
|
|
138
151
|
openTools?: Record<string, boolean>;
|
|
139
152
|
onOpenToolsChange?: (openTools: Record<string, boolean>) => void;
|
|
153
|
+
/**
|
|
154
|
+
* one-time position; null clears, and session/target/requestKey changes rearm
|
|
155
|
+
*/
|
|
156
|
+
initialPosition?: TranscriptInitialPosition | null;
|
|
140
157
|
activeTurn?: number;
|
|
141
158
|
onActiveTurnChange?: (turnIndex: number) => void;
|
|
142
159
|
search?: string;
|
|
@@ -158,4 +175,39 @@ export type TranscriptViewerProps = {
|
|
|
158
175
|
*/
|
|
159
176
|
moreOpen?: boolean;
|
|
160
177
|
onMoreOpenChange?: (open: boolean) => void;
|
|
178
|
+
/**
|
|
179
|
+
* host-routable trail; omit for the demo's static crumb
|
|
180
|
+
*/
|
|
181
|
+
breadcrumb?: BreadcrumbItem[];
|
|
182
|
+
/**
|
|
183
|
+
* router link for crumb items (e.g. next/link); defaults to 'a'
|
|
184
|
+
*/
|
|
185
|
+
LinkComponent?: any;
|
|
186
|
+
/**
|
|
187
|
+
* host per-turn extension rendered under each turn card
|
|
188
|
+
*/
|
|
189
|
+
renderTurnPanel?: (turn: import("./view-model.js").TurnVM) => unknown;
|
|
190
|
+
/**
|
|
191
|
+
* host-owned per-turn actions; replaces the built-in label affordance (hosts with typed label models keep their own popovers)
|
|
192
|
+
*/
|
|
193
|
+
renderTurnActions?: (turn: import("./view-model.js").TurnVM) => unknown;
|
|
194
|
+
/**
|
|
195
|
+
* host permalink for a turn's copy-anchor action; a root-relative return is absolutized against the page origin. Omitted, the demo copies its bare '#turn-N' placeholder
|
|
196
|
+
*/
|
|
197
|
+
anchorHref?: (turnIndex: number) => string;
|
|
198
|
+
/**
|
|
199
|
+
* host session-level actions rendered at the head of the hero action row (attest etc.); the composite's own actions stay the shared tail
|
|
200
|
+
*/
|
|
201
|
+
headerActions?: unknown;
|
|
202
|
+
/**
|
|
203
|
+
* host controls or context rendered at the start of the list-mode transcript scroller; omitted in graph mode
|
|
204
|
+
*/
|
|
205
|
+
streamPrelude?: unknown;
|
|
206
|
+
};
|
|
207
|
+
/**
|
|
208
|
+
* One breadcrumb segment. The last item renders as the current page (no link).
|
|
209
|
+
*/
|
|
210
|
+
export type BreadcrumbItem = {
|
|
211
|
+
label: string;
|
|
212
|
+
href?: string;
|
|
161
213
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical layout consumer for transcript initial positions. It owns the
|
|
3
|
+
* legacy mount snapshot, explicit-contract latch, null reset, token, consumed
|
|
4
|
+
* state, StrictMode replay guard, readiness retries, and terminal consumption.
|
|
5
|
+
*
|
|
6
|
+
* @param {{
|
|
7
|
+
* sessionId?: string,
|
|
8
|
+
* initialPosition?: import('./state-capabilities.js').TranscriptInitialPosition | null,
|
|
9
|
+
* fallbackInitialPosition?: import('./state-capabilities.js').TranscriptInitialPosition | null,
|
|
10
|
+
* legacyInitialPosition?: import('./state-capabilities.js').TranscriptInitialPosition | null,
|
|
11
|
+
* readiness: readonly unknown[],
|
|
12
|
+
* apply: (position: import('./state-capabilities.js').TranscriptInitialPosition) => 'pending' | 'applied' | 'discarded',
|
|
13
|
+
* }} options
|
|
14
|
+
* @returns {{position: import('./state-capabilities.js').TranscriptInitialPosition | null, token: string | null}}
|
|
15
|
+
*/
|
|
16
|
+
export default function useTranscriptInitialPosition(options: {
|
|
17
|
+
sessionId?: string;
|
|
18
|
+
initialPosition?: import("./state-capabilities.js").TranscriptInitialPosition | null;
|
|
19
|
+
fallbackInitialPosition?: import("./state-capabilities.js").TranscriptInitialPosition | null;
|
|
20
|
+
legacyInitialPosition?: import("./state-capabilities.js").TranscriptInitialPosition | null;
|
|
21
|
+
readiness: readonly unknown[];
|
|
22
|
+
apply: (position: import("./state-capabilities.js").TranscriptInitialPosition) => "pending" | "applied" | "discarded";
|
|
23
|
+
}): {
|
|
24
|
+
position: import("./state-capabilities.js").TranscriptInitialPosition | null;
|
|
25
|
+
token: string | null;
|
|
26
|
+
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Cooked git chrome for the session header. Produced by the adapter from
|
|
3
|
-
* whichever wire shape is present — flat
|
|
3
|
+
* whichever wire shape is present — canonical flat git fields OR retired nested
|
|
4
4
|
* `gitContext` (see TranscriptWireInput in wire-types.js). Absent on the model
|
|
5
5
|
* ⇒ the git chips are omitted entirely (clean degrade). Every field is optional
|
|
6
|
-
* because the
|
|
7
|
-
* only via
|
|
6
|
+
* because the canonical session-detail wire carries only branch + remote today;
|
|
7
|
+
* the rest arrive only via legacy inputs and fixtures.
|
|
8
8
|
*
|
|
9
9
|
* @typedef {object} SessionGitVM
|
|
10
10
|
* @property {string} [branch]
|
|
11
11
|
* @property {string} [remote]
|
|
12
|
-
* @property {string} [author] cooked from
|
|
12
|
+
* @property {string} [author] cooked from legacy gitContext.user; absent on the canonical flat wire
|
|
13
13
|
* @property {CommitVM[]} [commits]
|
|
14
14
|
* @property {number} [filesChanged]
|
|
15
15
|
* @property {number} [insertions]
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
/**
|
|
19
19
|
* A cooked commit for the git chrome / commit chips. Mirrors CommitInfo
|
|
20
20
|
* (wire-types.js) with display-ready fields. The churn (`adds`/`dels`/`files`)
|
|
21
|
-
* and `turn` anchor are render-when-present:
|
|
21
|
+
* and `turn` anchor are render-when-present: canonical CommitInfo carries
|
|
22
22
|
* no churn and commits are not on the session_detail payload (the deferred
|
|
23
|
-
* backend follow-up), so these light up from fixtures / the
|
|
24
|
-
* and from the wire when that follow-up lands.
|
|
23
|
+
* backend follow-up), so these light up from fixtures / the retired nested shape now
|
|
24
|
+
* and from the canonical wire when that follow-up lands.
|
|
25
25
|
*
|
|
26
26
|
* @typedef {object} CommitVM
|
|
27
27
|
* @property {string} hash
|
|
@@ -70,17 +70,17 @@
|
|
|
70
70
|
export const TOOL_GROUPS: readonly ToolGroup[];
|
|
71
71
|
/**
|
|
72
72
|
* Cooked git chrome for the session header. Produced by the adapter from
|
|
73
|
-
* whichever wire shape is present — flat
|
|
73
|
+
* whichever wire shape is present — canonical flat git fields OR retired nested
|
|
74
74
|
* `gitContext` (see TranscriptWireInput in wire-types.js). Absent on the model
|
|
75
75
|
* ⇒ the git chips are omitted entirely (clean degrade). Every field is optional
|
|
76
|
-
* because the
|
|
77
|
-
* only via
|
|
76
|
+
* because the canonical session-detail wire carries only branch + remote today;
|
|
77
|
+
* the rest arrive only via legacy inputs and fixtures.
|
|
78
78
|
*/
|
|
79
79
|
export type SessionGitVM = {
|
|
80
80
|
branch?: string;
|
|
81
81
|
remote?: string;
|
|
82
82
|
/**
|
|
83
|
-
* cooked from
|
|
83
|
+
* cooked from legacy gitContext.user; absent on the canonical flat wire
|
|
84
84
|
*/
|
|
85
85
|
author?: string;
|
|
86
86
|
commits?: CommitVM[];
|
|
@@ -91,10 +91,10 @@ export type SessionGitVM = {
|
|
|
91
91
|
/**
|
|
92
92
|
* A cooked commit for the git chrome / commit chips. Mirrors CommitInfo
|
|
93
93
|
* (wire-types.js) with display-ready fields. The churn (`adds`/`dels`/`files`)
|
|
94
|
-
* and `turn` anchor are render-when-present:
|
|
94
|
+
* and `turn` anchor are render-when-present: canonical CommitInfo carries
|
|
95
95
|
* no churn and commits are not on the session_detail payload (the deferred
|
|
96
|
-
* backend follow-up), so these light up from fixtures / the
|
|
97
|
-
* and from the wire when that follow-up lands.
|
|
96
|
+
* backend follow-up), so these light up from fixtures / the retired nested shape now
|
|
97
|
+
* and from the canonical wire when that follow-up lands.
|
|
98
98
|
*/
|
|
99
99
|
export type CommitVM = {
|
|
100
100
|
hash: string;
|
|
@@ -268,9 +268,9 @@ export type TurnVM = {
|
|
|
268
268
|
*/
|
|
269
269
|
depth: number;
|
|
270
270
|
/**
|
|
271
|
-
* provider
|
|
271
|
+
* canonical provider identity for a top-level assistant turn
|
|
272
272
|
*/
|
|
273
|
-
|
|
273
|
+
provider?: import("@peasant-labs/schema").Harness;
|
|
274
274
|
/**
|
|
275
275
|
* subagent name when depth > 0
|
|
276
276
|
*/
|