@peasant-labs/fairtrade 0.0.6 → 0.0.9
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/InUseShell-ClWg74-v.js +3388 -0
- package/dist/lib/commons.js +803 -838
- package/dist/lib/components.css +1 -1
- package/dist/lib/graph.css +1 -1
- package/dist/lib/graph.js +871 -276
- package/dist/lib/tokens.css +4 -0
- package/dist/lib/tokens.json +16 -0
- package/dist/lib/types/CommitGraph.d.ts +50 -3
- package/dist/lib/types/MapCanvas.d.ts +45 -2
- package/dist/lib/types/ProviderIcon.d.ts +23 -20
- 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/GhostCommitNode.d.ts +20 -0
- package/dist/lib/types/graph/GhostGroup.d.ts +21 -0
- package/dist/lib/types/graph/HighlightEdge.d.ts +16 -0
- package/dist/lib/types/graph/InsightPanel.d.ts +25 -0
- package/dist/lib/types/graph/RankModeControl.d.ts +13 -0
- package/dist/lib/types/graph/RankedRow.d.ts +15 -0
- package/dist/lib/types/graph/ScentTag.d.ts +15 -0
- package/dist/lib/types/graph/SessionLane.d.ts +29 -0
- package/dist/lib/types/graph/SessionOverflowDisclosure.d.ts +23 -0
- package/dist/lib/types/graph/TouchedFileCluster.d.ts +17 -0
- package/dist/lib/types/graph/changeGraph.d.ts +12 -0
- package/dist/lib/types/graph/codeMapState.d.ts +240 -0
- package/dist/lib/types/graph/graphContractPolicy.d.ts +24 -0
- package/dist/lib/types/graph/index.d.ts +35 -1
- package/dist/lib/types/graph/ranking.d.ts +222 -0
- 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/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 +3 -1
- package/dist/lib/types/transcript/initial-position.d.ts +80 -0
- package/dist/lib/types/transcript/state-capabilities.d.ts +22 -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-TG4XLhWL.js → ui-FKKOy92_.js} +3295 -3455
- package/dist/lib/ui.js +4 -4
- package/package.json +66 -26
- package/dist/lib/InUseShell-CjtqHauP.js +0 -1532
package/dist/lib/tokens.css
CHANGED
|
@@ -20,6 +20,10 @@
|
|
|
20
20
|
--ic-lg: 18px;
|
|
21
21
|
--bd: 1px solid var(--rule);
|
|
22
22
|
--bd-strong: 1px solid var(--rule-strong);
|
|
23
|
+
--stroke-hairline: 1px;
|
|
24
|
+
--stroke-emphasis: 2px;
|
|
25
|
+
--focus-ring-width: 3px;
|
|
26
|
+
--ghost-node-size: 9px;
|
|
23
27
|
--control-h: 36px;
|
|
24
28
|
--control-h-sm: 28px;
|
|
25
29
|
--nav-h: 56px;
|
package/dist/lib/tokens.json
CHANGED
|
@@ -570,6 +570,22 @@
|
|
|
570
570
|
"$type": "other",
|
|
571
571
|
"$value": "1px solid var(--rule-strong)"
|
|
572
572
|
},
|
|
573
|
+
"stroke-hairline": {
|
|
574
|
+
"$type": "other",
|
|
575
|
+
"$value": "1px"
|
|
576
|
+
},
|
|
577
|
+
"stroke-emphasis": {
|
|
578
|
+
"$type": "other",
|
|
579
|
+
"$value": "2px"
|
|
580
|
+
},
|
|
581
|
+
"focus-ring-width": {
|
|
582
|
+
"$type": "other",
|
|
583
|
+
"$value": "3px"
|
|
584
|
+
},
|
|
585
|
+
"ghost-node-size": {
|
|
586
|
+
"$type": "other",
|
|
587
|
+
"$value": "9px"
|
|
588
|
+
},
|
|
573
589
|
"dialog-w": {
|
|
574
590
|
"$type": "other",
|
|
575
591
|
"$value": "420px"
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* @property {string} message - the commit subject (USER CONTENT — case preserved)
|
|
7
7
|
* @property {string} [branch] - branch name for the chip (USER CONTENT — case preserved)
|
|
8
8
|
* @property {boolean} [session] - a recorded AI session sits behind this commit (-> filled + sparkle)
|
|
9
|
+
* @property {import('./graph/types.js').TimelineSessionPayload[]} [sessionRefs] - named sessions bound to this commit
|
|
9
10
|
* @property {boolean} [merged] - this commit merged a branch back in (-> merged chip)
|
|
10
11
|
* @property {boolean} [tip] - this commit is a branch tip (-> small tip affordance)
|
|
11
12
|
* @property {string} [time] - relative time label (e.g. "8m ago") — already humanised by the caller
|
|
@@ -16,20 +17,62 @@
|
|
|
16
17
|
* @param {object} props
|
|
17
18
|
* @param {Commit[]} props.commits - the history, newest first; lane 0 is the main line.
|
|
18
19
|
* @param {string} [props.selectedId] - id of the active/selected row (the scarce amber treatment).
|
|
19
|
-
* @param {(
|
|
20
|
+
* @param {(action: import('./graph/timelineNavigation.js').TimelineNavigationAction) => void} [props.onNavigate] - canonical semantic action callback; when present, legacy callbacks do not fire.
|
|
21
|
+
* @param {(commit: Commit) => void} [props.onSelect] - deprecated legacy row callback; use onNavigate.
|
|
22
|
+
* @param {(sessionId: string) => void} [props.onOpenSession] - deprecated legacy session callback; use onNavigate.
|
|
20
23
|
* @param {boolean} [props.hasMore=false] - more history exists below the window -> show the "show older" ghost.
|
|
21
|
-
* @param {() => void} [props.onShowOlder] -
|
|
24
|
+
* @param {() => void} [props.onShowOlder] - deprecated legacy pagination callback; use onNavigate.
|
|
22
25
|
* @param {string} [props.label='commit history'] - accessible name for the list (lowercase chrome).
|
|
23
26
|
* @param {string} [props.className] - extra classes appended to the root.
|
|
27
|
+
* @param {Array<{sessionId:string, title:string, harness?:import('@peasant-labs/schema').Harness}>} [props.sessionLanes] - the timeline's session spine gutter (the session spine gutter). Omit to keep the pre-timeline layout unchanged.
|
|
28
|
+
* @param {string|null} [props.hoveredSessionId] - drives the SessionLane hover state + secondary highlight weight.
|
|
29
|
+
* @param {string|null} [props.selectedSessionId] - drives the SessionLane selected state + primary highlight weight.
|
|
30
|
+
* @param {(sessionId: string|null) => void} [props.onHoverSession]
|
|
31
|
+
* @param {(sessionId: string) => void} [props.onSelectSession]
|
|
32
|
+
* @param {import('./graph/codeMapState.js').TimelineHighlight} [props.highlightSelected] - `deriveTimelineHighlight(...).selected` commit ids to render at primary (amber) weight.
|
|
33
|
+
* @param {import('./graph/codeMapState.js').TimelineHighlight} [props.highlightHovered] - `deriveTimelineHighlight(...).hovered` commit ids to render at secondary weight.
|
|
34
|
+
* @param {Record<string, Array<{ghostHash:string, subject?:string, resolution:string, method:string, confidence:string}>>} [props.ghostGroupsByCommit] - keyed by the successor commit id; each renders a `GhostGroup` row directly beneath it.
|
|
35
|
+
* @param {string[]|Set<string>} [props.expandedGhostGroups] - successor hashes with their ghost group open; controlled by the caller's `toggle-ghost-group` reducer state.
|
|
36
|
+
* @param {(successorHash: string) => void} [props.onToggleGhostGroup]
|
|
37
|
+
* @param {string[]|Set<string>} [props.expandedCommitSessions] - commit hashes with the `+N more` session disclosure open; controlled by the caller's `toggle-commit-sessions` reducer state.
|
|
38
|
+
* @param {(commitHash: string) => void} [props.onToggleCommitSessions]
|
|
39
|
+
* @param {Record<string, string[]>} [props.touchedFilesByCommit] - deterministically ordered file paths keyed by commit id.
|
|
40
|
+
* @param {(file: string) => void} [props.onOpenTouchedFile]
|
|
24
41
|
*/
|
|
25
|
-
export default function CommitGraph({ commits, selectedId, onSelect, hasMore, onShowOlder, label, className, ...rest }: {
|
|
42
|
+
export default function CommitGraph({ commits, selectedId, onNavigate, onSelect, onOpenSession, hasMore, onShowOlder, label, className, sessionLanes, hoveredSessionId, selectedSessionId, onHoverSession, onSelectSession, highlightSelected, highlightHovered, ghostGroupsByCommit, expandedGhostGroups, onToggleGhostGroup, expandedCommitSessions, onToggleCommitSessions, touchedFilesByCommit, onOpenTouchedFile, ...rest }: {
|
|
26
43
|
commits: Commit[];
|
|
27
44
|
selectedId?: string;
|
|
45
|
+
onNavigate?: (action: import("./graph/timelineNavigation.js").TimelineNavigationAction) => void;
|
|
28
46
|
onSelect?: (commit: Commit) => void;
|
|
47
|
+
onOpenSession?: (sessionId: string) => void;
|
|
29
48
|
hasMore?: boolean;
|
|
30
49
|
onShowOlder?: () => void;
|
|
31
50
|
label?: string;
|
|
32
51
|
className?: string;
|
|
52
|
+
sessionLanes?: Array<{
|
|
53
|
+
sessionId: string;
|
|
54
|
+
title: string;
|
|
55
|
+
harness?: import("@peasant-labs/schema").Harness;
|
|
56
|
+
}>;
|
|
57
|
+
hoveredSessionId?: string | null;
|
|
58
|
+
selectedSessionId?: string | null;
|
|
59
|
+
onHoverSession?: (sessionId: string | null) => void;
|
|
60
|
+
onSelectSession?: (sessionId: string) => void;
|
|
61
|
+
highlightSelected?: import("./graph/codeMapState.js").TimelineHighlight;
|
|
62
|
+
highlightHovered?: import("./graph/codeMapState.js").TimelineHighlight;
|
|
63
|
+
ghostGroupsByCommit?: Record<string, Array<{
|
|
64
|
+
ghostHash: string;
|
|
65
|
+
subject?: string;
|
|
66
|
+
resolution: string;
|
|
67
|
+
method: string;
|
|
68
|
+
confidence: string;
|
|
69
|
+
}>>;
|
|
70
|
+
expandedGhostGroups?: string[] | Set<string>;
|
|
71
|
+
onToggleGhostGroup?: (successorHash: string) => void;
|
|
72
|
+
expandedCommitSessions?: string[] | Set<string>;
|
|
73
|
+
onToggleCommitSessions?: (commitHash: string) => void;
|
|
74
|
+
touchedFilesByCommit?: Record<string, string[]>;
|
|
75
|
+
onOpenTouchedFile?: (file: string) => void;
|
|
33
76
|
}): any;
|
|
34
77
|
export type Commit = {
|
|
35
78
|
/**
|
|
@@ -56,6 +99,10 @@ export type Commit = {
|
|
|
56
99
|
* - a recorded AI session sits behind this commit (-> filled + sparkle)
|
|
57
100
|
*/
|
|
58
101
|
session?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* - named sessions bound to this commit
|
|
104
|
+
*/
|
|
105
|
+
sessionRefs?: import("./graph/types.js").TimelineSessionPayload[];
|
|
59
106
|
/**
|
|
60
107
|
* - this commit merged a branch back in (-> merged chip)
|
|
61
108
|
*/
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
*/
|
|
24
24
|
/**
|
|
25
25
|
* MapCanvas — an interactive code-structure map. Pan (drag), zoom (square controls /
|
|
26
|
-
* +/- keys
|
|
26
|
+
* +/- keys / ctrl-or-cmd+wheel — a plain wheel always just scrolls the page),
|
|
27
|
+
* semantic zoom (overview / folders / files) with edge
|
|
27
28
|
* ancestor-lifting, a minimap, and a node search combobox. Square metric-encoded
|
|
28
29
|
* nodes (width ∝ LOC, monochrome coverage fill, folder/file icon, amber selection +
|
|
29
30
|
* marker, clay violation badge) and square orthogonal edges (solid structure /
|
|
@@ -34,6 +35,8 @@
|
|
|
34
35
|
* @param {{nodes: MapNode[], edges?: MapEdge[]}} [props.data] the graph
|
|
35
36
|
* @param {'overview'|'folders'|'files'} [props.grain='folders'] initial semantic zoom
|
|
36
37
|
* @param {Iterable<string>} [props.expandedIds] expanded node ids
|
|
38
|
+
* @param {Iterable<string>} [props.visibleIds] canonical derived visible node ids
|
|
39
|
+
* @param {import('./graph/codeMapState.js').CodeMapHierarchy} [props.hierarchy] canonical validated hierarchy
|
|
37
40
|
* @param {string|null} [props.selectedId] selected node id
|
|
38
41
|
* @param {Iterable<string>} [props.highlightedIds] host hover/relay ids
|
|
39
42
|
* @param {Record<string,'new'|'removed'>} [props.nodeDeltas] per-node review deltas
|
|
@@ -45,14 +48,42 @@
|
|
|
45
48
|
* @param {number|string} [props.height=520] canvas height
|
|
46
49
|
* @param {string} [props.ariaLabel='code map'] application label
|
|
47
50
|
* @param {string} [props.className] extra container class
|
|
51
|
+
* @param {{scale:number, panX:number, panY:number}|null} [props.viewport] controlled/restorable spatial viewport.
|
|
52
|
+
* In `canonicalControlled` mode this is the SOLE source of truth once a
|
|
53
|
+
* gesture ends: MapCanvas renders it directly and does not keep its own
|
|
54
|
+
* copy. CONTRACT: when a pan/zoom gesture ends, MapCanvas calls
|
|
55
|
+
* `onViewportChange`/`onStateAction` with the proposed viewport, and the
|
|
56
|
+
* owner is expected to feed that value straight back through this prop
|
|
57
|
+
* PROMPTLY (a same-tick/next-render `useState` update, as peasant's real
|
|
58
|
+
* integration does, is the reference case — not a debounce, network
|
|
59
|
+
* round-trip, or anything else that can take an unbounded amount of time).
|
|
60
|
+
* During the gesture itself MapCanvas tracks the pointer locally so the
|
|
61
|
+
* drag/zoom stays smooth without waiting on this round-trip; it holds that
|
|
62
|
+
* local preview for up to ~500ms after the gesture ends waiting for
|
|
63
|
+
* `viewport` to reflect (or nearly reflect — the owner may legitimately
|
|
64
|
+
* clamp scale/pan bounds) the proposal, THEN falls back to whatever this
|
|
65
|
+
* prop says. An owner that never updates `viewport` in response (rejects
|
|
66
|
+
* the change, or simply never wires the callback) will see the gesture
|
|
67
|
+
* held for that ~500ms window and then discarded — a visible snap-back to
|
|
68
|
+
* the pre-gesture position, not a smooth revert. An owner that reconciles
|
|
69
|
+
* slower than ~500ms (e.g. a debounce or a network-backed proposal) will
|
|
70
|
+
* see the SAME snap-back-then-jump-to-late-value symptom the pointer-drag
|
|
71
|
+
* fix in this file exists to prevent — reconcile synchronously.
|
|
72
|
+
* @param {(viewport:{scale:number, panX:number, panY:number})=>void} [props.onViewportChange]
|
|
73
|
+
* @param {(action:import('./graph/codeMapState.js').CodeMapAction)=>void} [props.onStateAction] one semantic canvas gesture
|
|
74
|
+
* @param {boolean} [props.canonicalControlled=false] canonical values render directly; gestures emit proposals only.
|
|
75
|
+
* See the `viewport` prop doc above for the synchronous-reconciliation
|
|
76
|
+
* contract this mode requires of its owner.
|
|
48
77
|
*/
|
|
49
|
-
export default function MapCanvas({ data, grain: grainProp, expandedIds, selectedId: selectedIdProp, highlightedIds, nodeDeltas, edgeDeltas, onSelect, onGrainChange, onExpandedIdsChange, onExpand, height, ariaLabel, className, }: {
|
|
78
|
+
export default function MapCanvas({ data, grain: grainProp, expandedIds, visibleIds: canonicalVisibleIds, hierarchy: canonicalHierarchy, selectedId: selectedIdProp, highlightedIds, nodeDeltas, edgeDeltas, onSelect, onGrainChange, onExpandedIdsChange, onExpand, height, ariaLabel, className, viewport, onViewportChange, onStateAction, canonicalControlled, }: {
|
|
50
79
|
data?: {
|
|
51
80
|
nodes: MapNode[];
|
|
52
81
|
edges?: MapEdge[];
|
|
53
82
|
};
|
|
54
83
|
grain?: "overview" | "folders" | "files";
|
|
55
84
|
expandedIds?: Iterable<string>;
|
|
85
|
+
visibleIds?: Iterable<string>;
|
|
86
|
+
hierarchy?: import("./graph/codeMapState.js").CodeMapHierarchy;
|
|
56
87
|
selectedId?: string | null;
|
|
57
88
|
highlightedIds?: Iterable<string>;
|
|
58
89
|
nodeDeltas?: Record<string, "new" | "removed">;
|
|
@@ -64,6 +95,18 @@ export default function MapCanvas({ data, grain: grainProp, expandedIds, selecte
|
|
|
64
95
|
height?: number | string;
|
|
65
96
|
ariaLabel?: string;
|
|
66
97
|
className?: string;
|
|
98
|
+
viewport?: {
|
|
99
|
+
scale: number;
|
|
100
|
+
panX: number;
|
|
101
|
+
panY: number;
|
|
102
|
+
} | null;
|
|
103
|
+
onViewportChange?: (viewport: {
|
|
104
|
+
scale: number;
|
|
105
|
+
panX: number;
|
|
106
|
+
panY: number;
|
|
107
|
+
}) => void;
|
|
108
|
+
onStateAction?: (action: import("./graph/codeMapState.js").CodeMapAction) => void;
|
|
109
|
+
canonicalControlled?: boolean;
|
|
67
110
|
}): any;
|
|
68
111
|
export type MapNode = {
|
|
69
112
|
/**
|
|
@@ -7,20 +7,20 @@
|
|
|
7
7
|
* the surrounding text color — but remember the accent is never the sole signal.
|
|
8
8
|
*
|
|
9
9
|
* @param {object} props
|
|
10
|
-
* @param {
|
|
10
|
+
* @param {Harness} props.harness
|
|
11
11
|
* @param {number} [props.size] explicit px; omit to inherit the contextual icon size.
|
|
12
12
|
* @param {boolean} [props.accent] tint with PROVIDER_ACCENT[harness] (default: currentColor).
|
|
13
13
|
* @param {boolean|string} [props.label] true → the provider name as aria-label; a string overrides.
|
|
14
14
|
* @param {string} [props.className] extra classes appended after `pv-icon`.
|
|
15
|
-
* @returns {JSX.Element
|
|
15
|
+
* @returns {JSX.Element}
|
|
16
16
|
*/
|
|
17
17
|
export function ProviderIcon({ harness, size, accent, label, className, ...rest }: {
|
|
18
|
-
harness:
|
|
18
|
+
harness: Harness;
|
|
19
19
|
size?: number;
|
|
20
20
|
accent?: boolean;
|
|
21
21
|
label?: boolean | string;
|
|
22
22
|
className?: string;
|
|
23
|
-
}): JSX.Element
|
|
23
|
+
}): JSX.Element;
|
|
24
24
|
/**
|
|
25
25
|
* ProviderTag — a square hairline chip: the real mark + the lowercase harness slug.
|
|
26
26
|
*
|
|
@@ -29,16 +29,16 @@ export function ProviderIcon({ harness, size, accent, label, className, ...rest
|
|
|
29
29
|
* monochrome it names the provider in words. pass `accent` to tint the mark.
|
|
30
30
|
*
|
|
31
31
|
* @param {object} props
|
|
32
|
-
* @param {
|
|
32
|
+
* @param {Harness} props.harness
|
|
33
33
|
* @param {boolean} [props.accent] tint the mark with the provider accent (default: ink).
|
|
34
34
|
* @param {string} [props.className]
|
|
35
|
-
* @returns {JSX.Element
|
|
35
|
+
* @returns {JSX.Element}
|
|
36
36
|
*/
|
|
37
37
|
export function ProviderTag({ harness, accent, className, ...rest }: {
|
|
38
|
-
harness:
|
|
38
|
+
harness: Harness;
|
|
39
39
|
accent?: boolean;
|
|
40
40
|
className?: string;
|
|
41
|
-
}): JSX.Element
|
|
41
|
+
}): JSX.Element;
|
|
42
42
|
/**
|
|
43
43
|
* ProviderName — mark + the harness slug as a plain inline label (no chip border).
|
|
44
44
|
*
|
|
@@ -47,16 +47,16 @@ export function ProviderTag({ harness, accent, className, ...rest }: {
|
|
|
47
47
|
* non-color cue regardless — it is real text, so it is readable mono-color too).
|
|
48
48
|
*
|
|
49
49
|
* @param {object} props
|
|
50
|
-
* @param {
|
|
50
|
+
* @param {Harness} props.harness
|
|
51
51
|
* @param {boolean} [props.accent] tint mark + label with the provider accent.
|
|
52
52
|
* @param {string} [props.className]
|
|
53
|
-
* @returns {JSX.Element
|
|
53
|
+
* @returns {JSX.Element}
|
|
54
54
|
*/
|
|
55
55
|
export function ProviderName({ harness, accent, className, ...rest }: {
|
|
56
|
-
harness:
|
|
56
|
+
harness: Harness;
|
|
57
57
|
accent?: boolean;
|
|
58
58
|
className?: string;
|
|
59
|
-
}): JSX.Element
|
|
59
|
+
}): JSX.Element;
|
|
60
60
|
/**
|
|
61
61
|
* AccentLegend — the per-provider accent map, documented as a UI.
|
|
62
62
|
*
|
|
@@ -73,12 +73,15 @@ export function ProviderName({ harness, accent, className, ...rest }: {
|
|
|
73
73
|
export function AccentLegend({ className, ...rest }: {
|
|
74
74
|
className?: string;
|
|
75
75
|
}): JSX.Element;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
76
|
+
/** ProviderIcon — the real brand mark for a harness, single-color via currentColor. */
|
|
77
|
+
/** @typedef {import('@peasant-labs/schema').Harness} Harness */
|
|
78
|
+
/** @type {readonly Harness[]} */
|
|
79
|
+
export const HARNESSES: readonly Harness[];
|
|
80
|
+
/**
|
|
81
|
+
* @deprecated Use providerAccent(harness), which validates present values at
|
|
82
|
+
* the canonical schema boundary before returning an accent.
|
|
83
|
+
* @type {Readonly<Record<Harness, 'amber'|'teal'|'olive'|'mauve'|'clay'>>}
|
|
84
|
+
*/
|
|
85
|
+
export const PROVIDER_ACCENT: Readonly<Record<Harness, "amber" | "teal" | "olive" | "mauve" | "clay">>;
|
|
84
86
|
export default ProviderIcon;
|
|
87
|
+
export type Harness = import("@peasant-labs/schema").Harness;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
1
|
+
/** Format explicitly non-Harness prose. Never use this as a Harness fallback.
|
|
2
|
+
* @param {unknown} provider
|
|
3
|
+
*/
|
|
4
|
+
export function formatProvider(provider: unknown): string;
|
|
5
|
+
/** @param {import('@peasant-labs/schema').Harness} provider */
|
|
6
|
+
export function providerLabel(provider: import("@peasant-labs/schema").Harness): string;
|
|
7
|
+
export const PROVIDER_LABEL: Readonly<Record<"cursor" | "claude-code" | "gemini-cli" | "codex" | "opencode" | "antigravity", string>>;
|
|
@@ -129,10 +129,7 @@ export type ExploreTranscriptPayload = {
|
|
|
129
129
|
id: string;
|
|
130
130
|
title: string | null;
|
|
131
131
|
visibility: TranscriptVisibility;
|
|
132
|
-
|
|
133
|
-
* e.g. "claude-code", "opencode"
|
|
134
|
-
*/
|
|
135
|
-
modelProvider: string;
|
|
132
|
+
modelProvider: import("@peasant-labs/schema").Harness;
|
|
136
133
|
modelName: string | null;
|
|
137
134
|
harnessVersion: string | null;
|
|
138
135
|
/**
|
|
@@ -241,7 +238,7 @@ export type CollectiveTranscriptPayload = {
|
|
|
241
238
|
id: string;
|
|
242
239
|
title: string | null;
|
|
243
240
|
visibility: TranscriptVisibility;
|
|
244
|
-
modelProvider:
|
|
241
|
+
modelProvider: import("@peasant-labs/schema").Harness;
|
|
245
242
|
modelName: string | null;
|
|
246
243
|
/**
|
|
247
244
|
* ISO-8601 datetime or null
|
|
@@ -268,7 +265,7 @@ export type CollectiveStatsPayload = {
|
|
|
268
265
|
* Mirrors GroupModelBreakdown from frontend/src/lib/types.ts.
|
|
269
266
|
*/
|
|
270
267
|
export type CollectiveModelBreakdownPayload = {
|
|
271
|
-
modelProvider:
|
|
268
|
+
modelProvider: import("@peasant-labs/schema").Harness;
|
|
272
269
|
transcriptCount: number;
|
|
273
270
|
};
|
|
274
271
|
/**
|
|
@@ -3,19 +3,23 @@
|
|
|
3
3
|
* @param {import('./types.js').ChangesPayload} props.payload the cooked changes payload (adapter output)
|
|
4
4
|
* @param {string} [props.projectLabel] the head label (e.g. "peasant-labs/peasant"); host-supplied (not a payload field)
|
|
5
5
|
* @param {string} [props.selectedId] id of the active commit/tip row (the scarce amber treatment)
|
|
6
|
-
* @param {(
|
|
7
|
-
* @param {() => void} [props.
|
|
6
|
+
* @param {(action: import('./timelineNavigation.js').TimelineNavigationAction) => void} [props.onNavigate] canonical semantic action callback; when present, legacy callbacks do not fire
|
|
7
|
+
* @param {(commit: import('./changeGraph.js').CommitGraphRow) => void} [props.onSelectChange] deprecated legacy row callback; use onNavigate.
|
|
8
|
+
* @param {() => void} [props.onOpenMap] deprecated legacy map callback; use onNavigate.
|
|
8
9
|
* @param {boolean} [props.hasMore] more history exists below the window (→ "show older")
|
|
9
|
-
* @param {() => void} [props.onShowOlder]
|
|
10
|
+
* @param {() => void} [props.onShowOlder] deprecated legacy pagination callback; use onNavigate.
|
|
11
|
+
* @param {(sessionId: string) => void} [props.onOpenSession] deprecated legacy session callback; use onNavigate.
|
|
10
12
|
* @param {number} [props.nowMs] pins relative-time humanisation (default Date.now()); the harness fixes it for byte-stable captures
|
|
11
13
|
*/
|
|
12
|
-
export default function Changes({ payload, projectLabel, selectedId, onSelectChange, onOpenMap, hasMore, onShowOlder, nowMs, }: {
|
|
14
|
+
export default function Changes({ payload, projectLabel, selectedId, onNavigate, onSelectChange, onOpenMap, hasMore, onShowOlder, onOpenSession, nowMs, }: {
|
|
13
15
|
payload: import("./types.js").ChangesPayload;
|
|
14
16
|
projectLabel?: string;
|
|
15
17
|
selectedId?: string;
|
|
18
|
+
onNavigate?: (action: import("./timelineNavigation.js").TimelineNavigationAction) => void;
|
|
16
19
|
onSelectChange?: (commit: import("./changeGraph.js").CommitGraphRow) => void;
|
|
17
20
|
onOpenMap?: () => void;
|
|
18
21
|
hasMore?: boolean;
|
|
19
22
|
onShowOlder?: () => void;
|
|
23
|
+
onOpenSession?: (sessionId: string) => void;
|
|
20
24
|
nowMs?: number;
|
|
21
25
|
}): any;
|
|
@@ -18,8 +18,12 @@
|
|
|
18
18
|
* @param {number|string} [props.height]
|
|
19
19
|
* @param {string} [props.ariaLabel]
|
|
20
20
|
* @param {string} [props.className]
|
|
21
|
+
* @param {{scale:number, panX:number, panY:number}|null} [props.viewport]
|
|
22
|
+
* @param {(viewport:{scale:number, panX:number, panY:number})=>void} [props.onViewportChange]
|
|
23
|
+
* @param {import('./codeMapState.js').CodeMapState} [props.state]
|
|
24
|
+
* @param {(state:import('./codeMapState.js').CodeMapState)=>void} [props.onStateChange]
|
|
21
25
|
*/
|
|
22
|
-
export default function CodeMap({ payload, zoom, onZoomChange, selectedId, onSelect, onExpand, highlightedIds, nodeDeltas, structureEdgeDeltas, height, ariaLabel, className, }: {
|
|
26
|
+
export default function CodeMap({ payload, zoom, onZoomChange, selectedId, onSelect, onExpand, highlightedIds, nodeDeltas, structureEdgeDeltas, height, ariaLabel, className, viewport, onViewportChange, state, onStateChange, }: {
|
|
23
27
|
payload: import("./types.js").CodeMapPayload;
|
|
24
28
|
zoom?: {
|
|
25
29
|
level: "project" | "package" | "file";
|
|
@@ -38,6 +42,18 @@ export default function CodeMap({ payload, zoom, onZoomChange, selectedId, onSel
|
|
|
38
42
|
height?: number | string;
|
|
39
43
|
ariaLabel?: string;
|
|
40
44
|
className?: string;
|
|
45
|
+
viewport?: {
|
|
46
|
+
scale: number;
|
|
47
|
+
panX: number;
|
|
48
|
+
panY: number;
|
|
49
|
+
} | null;
|
|
50
|
+
onViewportChange?: (viewport: {
|
|
51
|
+
scale: number;
|
|
52
|
+
panX: number;
|
|
53
|
+
panY: number;
|
|
54
|
+
}) => void;
|
|
55
|
+
state?: import("./codeMapState.js").CodeMapState;
|
|
56
|
+
onStateChange?: (state: import("./codeMapState.js").CodeMapState) => void;
|
|
41
57
|
}): any;
|
|
42
58
|
/**
|
|
43
59
|
* @param {import('./types.js').CodeMapPayload | undefined} payload
|
|
@@ -45,8 +45,16 @@
|
|
|
45
45
|
* @param {React.CSSProperties} [props.canvasWrapperStyle] inline style on the canvas region wrapper
|
|
46
46
|
* (e.g. a host's own responsive height clamp)
|
|
47
47
|
* @param {string} [props.className] extra class on the root
|
|
48
|
+
* @param {'canvas'|'navigator'} [props.presentation='canvas'] additive presentation switch; omitted preserves the historical canvas DOM
|
|
49
|
+
* @param {React.ReactNode} [props.navigatorSlot] host-controlled navigator content
|
|
50
|
+
* @param {(presentation:'canvas'|'navigator')=>void} [props.onPresentationChange] when present, renders the canonical browse/map switch
|
|
51
|
+
* @param {{scale:number, panX:number, panY:number}} [props.viewport]
|
|
52
|
+
* @param {(viewport:{scale:number, panX:number, panY:number})=>void} [props.onViewportChange]
|
|
53
|
+
* @param {import('./codeMapState.js').CodeMapState} [props.state] canonical controlled state
|
|
54
|
+
* @param {Partial<import('./codeMapState.js').CodeMapState>} [props.defaultState] initial canonical uncontrolled state
|
|
55
|
+
* @param {(state:import('./codeMapState.js').CodeMapState)=>void} [props.onStateChange]
|
|
48
56
|
*/
|
|
49
|
-
export default function CodeMapComposition({ payload, zoom, onZoomChange, selectedId, onSelect, onExpand, highlightedIds, nodeDeltas, structureEdgeDeltas, height, ariaLabel, canvasSlot, rail, toolbar, sheetTitle, sheetMeta, railSide, legend, canvasWrapperClassName, canvasWrapperStyle, className, }: {
|
|
57
|
+
export default function CodeMapComposition({ payload, zoom, onZoomChange, selectedId, onSelect, onExpand, highlightedIds, nodeDeltas, structureEdgeDeltas, height, ariaLabel, canvasSlot, rail, toolbar, sheetTitle, sheetMeta, railSide, legend, canvasWrapperClassName, canvasWrapperStyle, className, presentation, navigatorSlot, onPresentationChange, viewport, onViewportChange, state, defaultState, onStateChange, }: {
|
|
50
58
|
payload?: import("./types.js").CodeMapPayload;
|
|
51
59
|
zoom?: {
|
|
52
60
|
level: "project" | "package" | "file";
|
|
@@ -74,6 +82,22 @@ export default function CodeMapComposition({ payload, zoom, onZoomChange, select
|
|
|
74
82
|
canvasWrapperClassName?: string;
|
|
75
83
|
canvasWrapperStyle?: React.CSSProperties;
|
|
76
84
|
className?: string;
|
|
85
|
+
presentation?: "canvas" | "navigator";
|
|
86
|
+
navigatorSlot?: React.ReactNode;
|
|
87
|
+
onPresentationChange?: (presentation: "canvas" | "navigator") => void;
|
|
88
|
+
viewport?: {
|
|
89
|
+
scale: number;
|
|
90
|
+
panX: number;
|
|
91
|
+
panY: number;
|
|
92
|
+
};
|
|
93
|
+
onViewportChange?: (viewport: {
|
|
94
|
+
scale: number;
|
|
95
|
+
panX: number;
|
|
96
|
+
panY: number;
|
|
97
|
+
}) => void;
|
|
98
|
+
state?: import("./codeMapState.js").CodeMapState;
|
|
99
|
+
defaultState?: Partial<import("./codeMapState.js").CodeMapState>;
|
|
100
|
+
onStateChange?: (state: import("./codeMapState.js").CodeMapState) => void;
|
|
77
101
|
}): any;
|
|
78
102
|
/**
|
|
79
103
|
* The persistent legend explaining the canvas's four orthogonal visual channels
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CodeMapNavigator presents the code tree as a readable, keyboard-operable
|
|
3
|
+
* starting point. Hosts keep selection, expansion, focus, and filter state so
|
|
4
|
+
* a transition to the spatial canvas and back is lossless.
|
|
5
|
+
*
|
|
6
|
+
* @param {object} props
|
|
7
|
+
* @param {import('./types.js').CodeMapPayload} props.payload
|
|
8
|
+
* @param {'project'|'package'|'file'} [props.grain='package']
|
|
9
|
+
* @param {Iterable<string>} [props.expandedIds]
|
|
10
|
+
* @param {(ids:string[])=>void} [props.onExpandedIdsChange]
|
|
11
|
+
* @param {string|null} [props.selectedId]
|
|
12
|
+
* @param {(id:string|null, node:import('./types.js').MapNodePayload|null)=>void} [props.onSelect]
|
|
13
|
+
* @param {string|null} [props.focusedId]
|
|
14
|
+
* @param {(id:string|null)=>void} [props.onFocusChange]
|
|
15
|
+
* @param {string} [props.filter='']
|
|
16
|
+
* @param {(filter:string)=>void} [props.onFilterChange]
|
|
17
|
+
* @param {(id:string)=>void} [props.onOpenMap]
|
|
18
|
+
* @param {(action:import('./codeMapState.js').CodeMapAction)=>void} [props.onStateAction]
|
|
19
|
+
* @param {string} [props.ariaLabel='code map navigator']
|
|
20
|
+
*/
|
|
21
|
+
export default function CodeMapNavigator({ payload, grain, expandedIds, onExpandedIdsChange, selectedId, onSelect, focusedId, onFocusChange, filter, onFilterChange, onOpenMap, onStateAction, ariaLabel, }: {
|
|
22
|
+
payload: import("./types.js").CodeMapPayload;
|
|
23
|
+
grain?: "project" | "package" | "file";
|
|
24
|
+
expandedIds?: Iterable<string>;
|
|
25
|
+
onExpandedIdsChange?: (ids: string[]) => void;
|
|
26
|
+
selectedId?: string | null;
|
|
27
|
+
onSelect?: (id: string | null, node: import("./types.js").MapNodePayload | null) => void;
|
|
28
|
+
focusedId?: string | null;
|
|
29
|
+
onFocusChange?: (id: string | null) => void;
|
|
30
|
+
filter?: string;
|
|
31
|
+
onFilterChange?: (filter: string) => void;
|
|
32
|
+
onOpenMap?: (id: string) => void;
|
|
33
|
+
onStateAction?: (action: import("./codeMapState.js").CodeMapAction) => void;
|
|
34
|
+
ariaLabel?: string;
|
|
35
|
+
}): any;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {object} props
|
|
3
|
+
* @param {string} props.ghostHash
|
|
4
|
+
* @param {string} [props.subject] - '' when unrecorded.
|
|
5
|
+
* @param {RewriteResolution} props.resolution
|
|
6
|
+
* @param {RewriteMethod} props.method
|
|
7
|
+
* @param {Confidence} props.confidence
|
|
8
|
+
* @param {string} [props.className]
|
|
9
|
+
*/
|
|
10
|
+
export default function GhostCommitNode({ ghostHash, subject, resolution, method, confidence, className, ...rest }: {
|
|
11
|
+
ghostHash: string;
|
|
12
|
+
subject?: string;
|
|
13
|
+
resolution: RewriteResolution;
|
|
14
|
+
method: RewriteMethod;
|
|
15
|
+
confidence: Confidence;
|
|
16
|
+
className?: string;
|
|
17
|
+
}): any;
|
|
18
|
+
export type RewriteResolution = "live" | "rewritten" | "unresolved";
|
|
19
|
+
export type RewriteMethod = "hash" | "patch_id" | "author_identity" | "message_embedded" | "temporal" | "none";
|
|
20
|
+
export type Confidence = "high" | "medium" | "low";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {object} props
|
|
3
|
+
* @param {string} props.successorHash
|
|
4
|
+
* @param {Array<{ghostHash:string, subject?:string, resolution:string, method:string, confidence:string}>} props.ghosts
|
|
5
|
+
* @param {boolean} props.expanded
|
|
6
|
+
* @param {(successorHash: string) => void} props.onToggle
|
|
7
|
+
* @param {string} [props.className]
|
|
8
|
+
*/
|
|
9
|
+
export default function GhostGroup({ successorHash, ghosts, expanded, onToggle, className, ...rest }: {
|
|
10
|
+
successorHash: string;
|
|
11
|
+
ghosts: Array<{
|
|
12
|
+
ghostHash: string;
|
|
13
|
+
subject?: string;
|
|
14
|
+
resolution: string;
|
|
15
|
+
method: string;
|
|
16
|
+
confidence: string;
|
|
17
|
+
}>;
|
|
18
|
+
expanded: boolean;
|
|
19
|
+
onToggle: (successorHash: string) => void;
|
|
20
|
+
className?: string;
|
|
21
|
+
}): any;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {object} props
|
|
3
|
+
* @param {'primary'|'secondary'} props.weight - selection (primary) vs hover (secondary, subordinate to a lingering selection).
|
|
4
|
+
* @param {{x1:number, y1:number, x2:number, y2:number}} props.geometry
|
|
5
|
+
* @param {string} [props.className]
|
|
6
|
+
*/
|
|
7
|
+
export default function HighlightEdge({ weight, geometry, className, ...rest }: {
|
|
8
|
+
weight: "primary" | "secondary";
|
|
9
|
+
geometry: {
|
|
10
|
+
x1: number;
|
|
11
|
+
y1: number;
|
|
12
|
+
x2: number;
|
|
13
|
+
y2: number;
|
|
14
|
+
};
|
|
15
|
+
className?: string;
|
|
16
|
+
}): any;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** @typedef {import('@peasant-labs/schema').InsightKind} InsightKind */
|
|
2
|
+
/** @typedef {import('@peasant-labs/schema').InsightProvenance} InsightProvenance */
|
|
3
|
+
/**
|
|
4
|
+
* @param {object} props
|
|
5
|
+
* @param {Array<{kind:InsightKind, provenance:InsightProvenance, title:string, summary?:string, evidence:Array<{sessionId:string, file?:string}>, onOpenEvidence?: Function}>} props.insights
|
|
6
|
+
* @param {(sessionId: string) => void} [props.onOpenEvidence]
|
|
7
|
+
* @param {string} [props.className]
|
|
8
|
+
*/
|
|
9
|
+
export default function InsightPanel({ insights, onOpenEvidence, className, ...rest }: {
|
|
10
|
+
insights: Array<{
|
|
11
|
+
kind: InsightKind;
|
|
12
|
+
provenance: InsightProvenance;
|
|
13
|
+
title: string;
|
|
14
|
+
summary?: string;
|
|
15
|
+
evidence: Array<{
|
|
16
|
+
sessionId: string;
|
|
17
|
+
file?: string;
|
|
18
|
+
}>;
|
|
19
|
+
onOpenEvidence?: Function;
|
|
20
|
+
}>;
|
|
21
|
+
onOpenEvidence?: (sessionId: string) => void;
|
|
22
|
+
className?: string;
|
|
23
|
+
}): any;
|
|
24
|
+
export type InsightKind = import("@peasant-labs/schema").InsightKind;
|
|
25
|
+
export type InsightProvenance = import("@peasant-labs/schema").InsightProvenance;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {object} props
|
|
3
|
+
* @param {'relevance'|'debt'|'churn'} props.rankMode
|
|
4
|
+
* @param {(rankMode: 'relevance'|'debt'|'churn') => void} props.onChange
|
|
5
|
+
* @param {string} [props.className]
|
|
6
|
+
*/
|
|
7
|
+
export default function RankModeControl({ rankMode, onChange, className, ...rest }: {
|
|
8
|
+
rankMode: "relevance" | "debt" | "churn";
|
|
9
|
+
onChange: (rankMode: "relevance" | "debt" | "churn") => void;
|
|
10
|
+
className?: string;
|
|
11
|
+
}): any;
|
|
12
|
+
export { MODES as RANK_MODE_CONTROL_MODES };
|
|
13
|
+
declare const MODES: readonly ["relevance", "debt", "churn"];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {object} props
|
|
3
|
+
* @param {import('./ranking.js').RankedRow} props.row
|
|
4
|
+
* @param {number} props.loc - lines of code, feeds the reused `MapNode` size class.
|
|
5
|
+
* @param {boolean} [props.selected]
|
|
6
|
+
* @param {(id: string) => void} [props.onSelect]
|
|
7
|
+
* @param {string} [props.className]
|
|
8
|
+
*/
|
|
9
|
+
export default function RankedRow({ row, loc, selected, onSelect, className, ...rest }: {
|
|
10
|
+
row: import("./ranking.js").RankedRow;
|
|
11
|
+
loc: number;
|
|
12
|
+
selected?: boolean;
|
|
13
|
+
onSelect?: (id: string) => void;
|
|
14
|
+
className?: string;
|
|
15
|
+
}): any;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {object} props
|
|
3
|
+
* @param {string} props.tag - a `SCENT_TAGS` member.
|
|
4
|
+
* @param {string} [props.hoverText] - the path-conditioned hover copy for `partial-read` rows.
|
|
5
|
+
* @param {boolean} [props.active] - when interactive, whether this tag is the active filter.
|
|
6
|
+
* @param {(tag: string|null) => void} [props.onToggle] - present -> renders as an interactive filter toggle; absent -> a plain decorative label.
|
|
7
|
+
* @param {string} [props.className]
|
|
8
|
+
*/
|
|
9
|
+
export default function ScentTag({ tag, hoverText, active, onToggle, className, ...rest }: {
|
|
10
|
+
tag: string;
|
|
11
|
+
hoverText?: string;
|
|
12
|
+
active?: boolean;
|
|
13
|
+
onToggle?: (tag: string | null) => void;
|
|
14
|
+
className?: string;
|
|
15
|
+
}): any;
|