@peasant-labs/fairtrade 0.0.6 → 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/InUseShell-VRWaysXY.js +2488 -0
- 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/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/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/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-CKqVB4x2.js} +3395 -3401
- package/dist/lib/ui.js +4 -4
- package/package.json +51 -26
- package/dist/lib/InUseShell-CjtqHauP.js +0 -1532
|
@@ -1,414 +1,122 @@
|
|
|
1
|
+
/** @param {CodeMapPayload} payload */
|
|
2
|
+
export function assertCodeMapPayloadEnums(payload: CodeMapPayload): void;
|
|
3
|
+
/** @param {ChangeDetailPayload} payload */
|
|
4
|
+
export function assertChangeDetailPayloadEnums(payload: ChangeDetailPayload): void;
|
|
5
|
+
/** @param {ChangeDiffPayload} payload */
|
|
6
|
+
export function assertChangeDiffPayloadEnums(payload: ChangeDiffPayload): void;
|
|
1
7
|
/**
|
|
2
8
|
* Classification of a map node within the path-derived tree.
|
|
3
|
-
*
|
|
4
|
-
* @typedef {'module' | 'package' | 'file'} MapNodeKind
|
|
9
|
+
* @typedef {import('@peasant-labs/schema').MapNodeKind} MapNodeKind
|
|
5
10
|
*/
|
|
6
11
|
/** Canonical MapNodeKind values, in schema order. @type {readonly MapNodeKind[]} */
|
|
7
12
|
export const MAP_NODE_KINDS: readonly MapNodeKind[];
|
|
8
13
|
/**
|
|
9
14
|
* How strongly a recorded session is bound to a change.
|
|
10
|
-
*
|
|
11
|
-
* @typedef {'bound' | 'candidate'} ChangeBinding
|
|
15
|
+
* @typedef {import('@peasant-labs/schema').ChangeBinding} ChangeBinding
|
|
12
16
|
*/
|
|
13
17
|
/** Canonical ChangeBinding values. @type {readonly ChangeBinding[]} */
|
|
14
18
|
export const CHANGE_BINDINGS: readonly ChangeBinding[];
|
|
15
19
|
/**
|
|
16
20
|
* Kind of structural violation on the map.
|
|
17
|
-
*
|
|
18
|
-
* @typedef {'cycle' | 'wrong_way'} EdgeViolationKind
|
|
21
|
+
* @typedef {import('@peasant-labs/schema').EdgeViolationKind} EdgeViolationKind
|
|
19
22
|
*/
|
|
20
23
|
/** Canonical EdgeViolationKind values. @type {readonly EdgeViolationKind[]} */
|
|
21
24
|
export const EDGE_VIOLATION_KINDS: readonly EdgeViolationKind[];
|
|
22
25
|
/**
|
|
23
26
|
* Per-file change status (branch vs merge-base). Git rename detection strips the
|
|
24
27
|
* similarity score, so "R100"/"R087" normalize to "R".
|
|
25
|
-
*
|
|
26
|
-
* ("M"/"A"/"D"/"R"); carried verbatim onto FileChange.Status / ChangeDiffPayload.Status
|
|
27
|
-
* in pkg/schema/map_api.go.
|
|
28
|
-
* @typedef {'M' | 'A' | 'D' | 'R'} FileChangeStatus
|
|
28
|
+
* @typedef {import('@peasant-labs/schema').FileChangeStatus} FileChangeStatus
|
|
29
29
|
*/
|
|
30
30
|
/** Canonical FileChangeStatus values, in schema order. @type {readonly FileChangeStatus[]} */
|
|
31
31
|
export const FILE_CHANGE_STATUSES: readonly FileChangeStatus[];
|
|
32
32
|
/**
|
|
33
33
|
* Classification of one line within a unified-diff hunk.
|
|
34
|
-
*
|
|
35
|
-
* ("context"/"add"/"del"); carried onto DiffLine.Kind in pkg/schema/map_api.go.
|
|
36
|
-
* @typedef {'context' | 'add' | 'del'} DiffLineKind
|
|
34
|
+
* @typedef {import('@peasant-labs/schema').DiffLineKind} DiffLineKind
|
|
37
35
|
*/
|
|
38
36
|
/** Canonical DiffLineKind values, in schema order. @type {readonly DiffLineKind[]} */
|
|
39
37
|
export const DIFF_LINE_KINDS: readonly DiffLineKind[];
|
|
40
38
|
/**
|
|
41
|
-
*
|
|
42
|
-
* pkg/schema/map_api.go — MapNodeKind constants.
|
|
39
|
+
* Lightweight commit reference used in the timeline.
|
|
43
40
|
*/
|
|
44
|
-
export type
|
|
41
|
+
export type CommitRefPayload = import("@peasant-labs/schema").CommitRef;
|
|
45
42
|
/**
|
|
46
|
-
*
|
|
47
|
-
* pkg/schema/map_api.go — ChangeBinding constants.
|
|
48
|
-
*/
|
|
49
|
-
export type ChangeBinding = "bound" | "candidate";
|
|
50
|
-
/**
|
|
51
|
-
* Kind of structural violation on the map.
|
|
52
|
-
* pkg/schema/map_api.go — EdgeViolationKind constants.
|
|
43
|
+
* A recorded session available to annotate the Git timeline.
|
|
53
44
|
*/
|
|
54
|
-
export type
|
|
45
|
+
export type TimelineSessionPayload = import("@peasant-labs/schema").TimelineSessionRef;
|
|
55
46
|
/**
|
|
56
|
-
*
|
|
57
|
-
* similarity score, so "R100"/"R087" normalize to "R".
|
|
58
|
-
* Grounded in internal/gitops/repo.go — FileStatus{Modified,Added,Deleted,Renamed}
|
|
59
|
-
* ("M"/"A"/"D"/"R"); carried verbatim onto FileChange.Status / ChangeDiffPayload.Status
|
|
60
|
-
* in pkg/schema/map_api.go.
|
|
47
|
+
* A structure dependency edge.
|
|
61
48
|
*/
|
|
62
|
-
export type
|
|
49
|
+
export type MapEdgePayload = import("@peasant-labs/schema").MapEdge;
|
|
63
50
|
/**
|
|
64
|
-
*
|
|
65
|
-
* Grounded in internal/gitops/repo.go — DiffLine{Context,Added,Removed}
|
|
66
|
-
* ("context"/"add"/"del"); carried onto DiffLine.Kind in pkg/schema/map_api.go.
|
|
51
|
+
* A co-edit observation edge.
|
|
67
52
|
*/
|
|
68
|
-
export type
|
|
53
|
+
export type ActivityEdgePayload = import("@peasant-labs/schema").ActivityEdge;
|
|
69
54
|
/**
|
|
70
|
-
*
|
|
71
|
-
* Mirrors CommitRef from pkg/schema/map_api.go.
|
|
55
|
+
* The generated wire currently widens kind; the cooked boundary narrows it.
|
|
72
56
|
*/
|
|
73
|
-
export type
|
|
74
|
-
/**
|
|
75
|
-
* commit SHA
|
|
76
|
-
*/
|
|
77
|
-
hash: string;
|
|
78
|
-
/**
|
|
79
|
-
* first line of the commit message
|
|
80
|
-
*/
|
|
81
|
-
subject: string;
|
|
82
|
-
/**
|
|
83
|
-
* committer date, Unix millis; absent when unknown
|
|
84
|
-
*/
|
|
85
|
-
timeMs?: number | null;
|
|
86
|
-
/**
|
|
87
|
-
* true when a recorded session is bound to this commit
|
|
88
|
-
*/
|
|
89
|
-
hasSession: boolean;
|
|
90
|
-
};
|
|
91
|
-
/**
|
|
92
|
-
* A structure (import) dependency edge between two map nodes.
|
|
93
|
-
* Mirrors MapEdge from pkg/schema/map_api.go.
|
|
94
|
-
*/
|
|
95
|
-
export type MapEdgePayload = {
|
|
96
|
-
/**
|
|
97
|
-
* source node ID (repo-relative path)
|
|
98
|
-
*/
|
|
99
|
-
from: string;
|
|
100
|
-
/**
|
|
101
|
-
* target node ID
|
|
102
|
-
*/
|
|
103
|
-
to: string;
|
|
104
|
-
/**
|
|
105
|
-
* underlying import count (aggregated)
|
|
106
|
-
*/
|
|
107
|
-
count: number;
|
|
108
|
-
};
|
|
109
|
-
/**
|
|
110
|
-
* A co-edit (activity) observation edge: two nodes repeatedly edited by the
|
|
111
|
-
* same tasks. DISTINCT from MapEdgePayload — the count channel is `taskCount`
|
|
112
|
-
* (distinct tasks that edited both endpoints), NOT the import `count`.
|
|
113
|
-
* Mirrors ActivityEdge from pkg/schema/map_api.go.
|
|
114
|
-
*/
|
|
115
|
-
export type ActivityEdgePayload = {
|
|
116
|
-
/**
|
|
117
|
-
* source node ID
|
|
118
|
-
*/
|
|
119
|
-
from: string;
|
|
120
|
-
/**
|
|
121
|
-
* target node ID
|
|
122
|
-
*/
|
|
123
|
-
to: string;
|
|
124
|
-
/**
|
|
125
|
-
* distinct tasks that edited both endpoints
|
|
126
|
-
*/
|
|
127
|
-
taskCount: number;
|
|
128
|
-
};
|
|
129
|
-
/**
|
|
130
|
-
* A structural violation — a cycle or wrong-way import — on the map.
|
|
131
|
-
* Mirrors EdgeViolation from pkg/schema/map_api.go.
|
|
132
|
-
*/
|
|
133
|
-
export type EdgeViolationPayload = {
|
|
57
|
+
export type EdgeViolationPayload = Omit<import("@peasant-labs/schema").EdgeViolation, "kind"> & {
|
|
134
58
|
kind: EdgeViolationKind;
|
|
135
|
-
/**
|
|
136
|
-
* source node ID
|
|
137
|
-
*/
|
|
138
|
-
from: string;
|
|
139
|
-
/**
|
|
140
|
-
* target node ID
|
|
141
|
-
*/
|
|
142
|
-
to: string;
|
|
143
59
|
};
|
|
144
60
|
/**
|
|
145
|
-
*
|
|
146
|
-
* lifted <CodeMap> component derives pixel positions from layer/order using
|
|
147
|
-
* layout.ts internally; consumers supply raw topology.
|
|
148
|
-
* Mirrors MapNode from pkg/schema/map_api.go (field-for-field).
|
|
61
|
+
* Topology-only map node with the generated kind narrowed canonically.
|
|
149
62
|
*/
|
|
150
|
-
export type MapNodePayload = {
|
|
151
|
-
/**
|
|
152
|
-
* repo-relative path, e.g. "internal/ingest" or "web/src/lib/api.ts"
|
|
153
|
-
*/
|
|
154
|
-
id: string;
|
|
155
|
-
/**
|
|
156
|
-
* ID of parent node; absent for top-level modules
|
|
157
|
-
*/
|
|
158
|
-
parent?: string;
|
|
63
|
+
export type MapNodePayload = Omit<import("@peasant-labs/schema").MapNode, "kind"> & {
|
|
159
64
|
kind: MapNodeKind;
|
|
160
|
-
/**
|
|
161
|
-
* display leaf, e.g. "ingest"
|
|
162
|
-
*/
|
|
163
|
-
name: string;
|
|
164
|
-
/**
|
|
165
|
-
* e.g. "go" or "typescript"; absent for activity-only nodes
|
|
166
|
-
*/
|
|
167
|
-
language?: string;
|
|
168
|
-
/**
|
|
169
|
-
* 0 = top row; deterministic, server-assigned
|
|
170
|
-
*/
|
|
171
|
-
layer: number;
|
|
172
|
-
/**
|
|
173
|
-
* stable sort within layer; server-assigned
|
|
174
|
-
*/
|
|
175
|
-
order: number;
|
|
176
|
-
/**
|
|
177
|
-
* size metric (lines of code)
|
|
178
|
-
*/
|
|
179
|
-
loc: number;
|
|
180
|
-
/**
|
|
181
|
-
* 1 for file nodes
|
|
182
|
-
*/
|
|
183
|
-
fileCount: number;
|
|
184
|
-
/**
|
|
185
|
-
* files whose last edit traces to a recorded session
|
|
186
|
-
*/
|
|
187
|
-
recordedFiles: number;
|
|
188
|
-
totalFiles: number;
|
|
189
|
-
/**
|
|
190
|
-
* recorded edits in the activity window (activity size metric)
|
|
191
|
-
*/
|
|
192
|
-
touchCount: number;
|
|
193
|
-
/**
|
|
194
|
-
* 0..1 per-file re-edit/error density rollup (0 when unknown)
|
|
195
|
-
*/
|
|
196
|
-
effortDensity: number;
|
|
197
65
|
};
|
|
198
66
|
/**
|
|
199
|
-
*
|
|
200
|
-
* layer/order preserved from the full map. Used inside ChangeDetailPayload.
|
|
201
|
-
* Mirrors MapSlice from pkg/schema/map_api.go.
|
|
67
|
+
* Cooked sub-map with normalized non-null arrays.
|
|
202
68
|
*/
|
|
203
|
-
export type MapSlicePayload = {
|
|
204
|
-
/**
|
|
205
|
-
* topology-only; layer/order from the full map
|
|
206
|
-
*/
|
|
69
|
+
export type MapSlicePayload = Omit<import("@peasant-labs/schema").MapSlice, "nodes" | "structureEdges" | "activityEdges"> & {
|
|
207
70
|
nodes: MapNodePayload[];
|
|
208
|
-
/**
|
|
209
|
-
* parsed import edges within the slice (count = import count)
|
|
210
|
-
*/
|
|
211
71
|
structureEdges: MapEdgePayload[];
|
|
212
|
-
/**
|
|
213
|
-
* co-edit observations within the slice (taskCount, NOT count)
|
|
214
|
-
*/
|
|
215
72
|
activityEdges: ActivityEdgePayload[];
|
|
216
73
|
};
|
|
217
74
|
/**
|
|
218
75
|
* One row in the Changes list: a local branch measured against the default
|
|
219
76
|
* branch. Graph anchors (baseHash/tipCommitMs/mergeCommitHash) tie this row
|
|
220
77
|
* to the time strip lane.
|
|
221
|
-
* Mirrors ChangeSummary from
|
|
78
|
+
* Mirrors ChangeSummary from github.com/peasant-labs/schema.
|
|
222
79
|
*/
|
|
223
|
-
export type ChangeSummaryPayload =
|
|
224
|
-
branch: string;
|
|
225
|
-
/**
|
|
226
|
-
* commits ahead of the default branch
|
|
227
|
-
*/
|
|
228
|
-
aheadCount: number;
|
|
229
|
-
behindCount: number;
|
|
230
|
-
filesChanged: number;
|
|
231
|
-
/**
|
|
232
|
-
* recorded sessions bound to this change
|
|
233
|
-
*/
|
|
234
|
-
sessionCount: number;
|
|
235
|
-
/**
|
|
236
|
-
* distinct tasks across bound sessions
|
|
237
|
-
*/
|
|
238
|
-
taskCount: number;
|
|
239
|
-
/**
|
|
240
|
-
* new import edges introduced
|
|
241
|
-
*/
|
|
242
|
-
newEdges: number;
|
|
243
|
-
removedEdges: number;
|
|
244
|
-
/**
|
|
245
|
-
* count of structural violations introduced
|
|
246
|
-
*/
|
|
247
|
-
violations: number;
|
|
248
|
-
/**
|
|
249
|
-
* most-recent recorded-session activity, Unix millis
|
|
250
|
-
*/
|
|
251
|
-
lastWorkMs?: number | null;
|
|
252
|
-
merged: boolean;
|
|
253
|
-
mergedAtMs?: number | null;
|
|
254
|
-
/**
|
|
255
|
-
* true when this merged change was later git-reverted
|
|
256
|
-
*/
|
|
257
|
-
reverted?: boolean;
|
|
258
|
-
/**
|
|
259
|
-
* graph anchor: merge-base commit hash (fork point; open branches)
|
|
260
|
-
*/
|
|
261
|
-
baseHash?: string;
|
|
262
|
-
/**
|
|
263
|
-
* graph anchor: branch tip committer time (row position; open branches)
|
|
264
|
-
*/
|
|
265
|
-
tipCommitMs?: number | null;
|
|
266
|
-
/**
|
|
267
|
-
* graph anchor: merge commit hash (join point; merged rows)
|
|
268
|
-
*/
|
|
269
|
-
mergeCommitHash?: string;
|
|
270
|
-
};
|
|
80
|
+
export type ChangeSummaryPayload = import("@peasant-labs/schema").ChangeSummary;
|
|
271
81
|
/**
|
|
272
82
|
* The Changes surface prop payload. The adapter maps ReviewListPayload (CLEAN)
|
|
273
83
|
* onto this shape — field-for-field, no reshaping required.
|
|
274
84
|
*/
|
|
275
|
-
export type ChangesPayload =
|
|
276
|
-
/**
|
|
277
|
-
* false when the project root is not a git repo
|
|
278
|
-
*/
|
|
279
|
-
repoFound: boolean;
|
|
280
|
-
defaultBranch?: string;
|
|
281
|
-
/**
|
|
282
|
-
* open branches first, then merged (reverse-chron within each)
|
|
283
|
-
*/
|
|
284
|
-
changes: ChangeSummaryPayload[];
|
|
285
|
-
/**
|
|
286
|
-
* default-branch commits for the time strip, cap 200
|
|
287
|
-
*/
|
|
288
|
-
recentCommits: CommitRefPayload[];
|
|
289
|
-
};
|
|
85
|
+
export type ChangesPayload = Omit<import("@peasant-labs/schema").ReviewListPayload, "projectHash">;
|
|
290
86
|
/**
|
|
291
87
|
* One task within a change's bound sessions.
|
|
292
|
-
* Mirrors TaskSummary from
|
|
88
|
+
* Mirrors TaskSummary from github.com/peasant-labs/schema.
|
|
293
89
|
*/
|
|
294
|
-
export type TaskSummaryPayload = {
|
|
295
|
-
sessionId: string;
|
|
296
|
-
/**
|
|
297
|
-
* depth-0 user-turn index (task identity)
|
|
298
|
-
*/
|
|
299
|
-
entryIndex: number;
|
|
300
|
-
/**
|
|
301
|
-
* first ~80 chars of the user turn
|
|
302
|
-
*/
|
|
303
|
-
title: string;
|
|
304
|
-
/**
|
|
305
|
-
* task start, Unix millis
|
|
306
|
-
*/
|
|
307
|
-
startMs?: number | null;
|
|
308
|
-
/**
|
|
309
|
-
* session-level outcome string
|
|
310
|
-
*/
|
|
311
|
-
outcome?: string;
|
|
312
|
-
/**
|
|
313
|
-
* repo-relative paths touched by this task
|
|
314
|
-
*/
|
|
90
|
+
export type TaskSummaryPayload = Omit<import("@peasant-labs/schema").TaskSummary, "editedFiles" | "labels"> & {
|
|
315
91
|
editedFiles: string[];
|
|
316
|
-
/**
|
|
317
|
-
* reads within this task's range
|
|
318
|
-
*/
|
|
319
|
-
readCount: number;
|
|
320
|
-
/**
|
|
321
|
-
* true when an error streak ≥2 occurs inside this task
|
|
322
|
-
*/
|
|
323
|
-
retryLoop: boolean;
|
|
324
|
-
/**
|
|
325
|
-
* effective auto/manual annotation values
|
|
326
|
-
*/
|
|
327
92
|
labels: string[];
|
|
328
93
|
};
|
|
329
94
|
/**
|
|
330
95
|
* One recorded session bound to a change, with its tasks.
|
|
331
|
-
* Mirrors ChangeSession from
|
|
96
|
+
* Mirrors ChangeSession from github.com/peasant-labs/schema.
|
|
332
97
|
*/
|
|
333
|
-
export type ChangeSessionPayload = {
|
|
334
|
-
sessionId: string;
|
|
335
|
-
title: string;
|
|
336
|
-
harness: string;
|
|
337
|
-
startMs?: number | null;
|
|
338
|
-
/**
|
|
339
|
-
* "bound" = commit-in-branch AND file overlap; "candidate" = one arm only
|
|
340
|
-
*/
|
|
98
|
+
export type ChangeSessionPayload = Omit<import("@peasant-labs/schema").ChangeSession, "binding" | "harness" | "tasks"> & {
|
|
341
99
|
binding: ChangeBinding;
|
|
100
|
+
harness: import("@peasant-labs/schema").Harness;
|
|
342
101
|
tasks: TaskSummaryPayload[];
|
|
343
102
|
};
|
|
344
103
|
/**
|
|
345
104
|
* One neutral rate-elevation observation: a metric that runs above the project
|
|
346
105
|
* baseline for this change. Factual, never a grade.
|
|
347
|
-
* Mirrors UnusualSignal from
|
|
106
|
+
* Mirrors UnusualSignal from github.com/peasant-labs/schema.
|
|
348
107
|
*/
|
|
349
|
-
export type UnusualSignalPayload =
|
|
350
|
-
/**
|
|
351
|
-
* stable slug, e.g. "retryLoops"
|
|
352
|
-
*/
|
|
353
|
-
kind: string;
|
|
354
|
-
/**
|
|
355
|
-
* plain, neutral description
|
|
356
|
-
*/
|
|
357
|
-
label: string;
|
|
358
|
-
/**
|
|
359
|
-
* this change's per-conversation rate
|
|
360
|
-
*/
|
|
361
|
-
perChange: number;
|
|
362
|
-
/**
|
|
363
|
-
* project baseline rate
|
|
364
|
-
*/
|
|
365
|
-
perProject: number;
|
|
366
|
-
};
|
|
108
|
+
export type UnusualSignalPayload = import("@peasant-labs/schema").UnusualSignal;
|
|
367
109
|
/**
|
|
368
110
|
* A neutral count of a recurring friction signal keyed to a file.
|
|
369
|
-
* Mirrors FrictionCluster from
|
|
111
|
+
* Mirrors FrictionCluster from github.com/peasant-labs/schema.
|
|
370
112
|
*/
|
|
371
|
-
export type FrictionClusterPayload =
|
|
372
|
-
/**
|
|
373
|
-
* signal slug, e.g. "retryLoop"
|
|
374
|
-
*/
|
|
375
|
-
kind: string;
|
|
376
|
-
/**
|
|
377
|
-
* plain, neutral, e.g. "retry loops"
|
|
378
|
-
*/
|
|
379
|
-
label: string;
|
|
380
|
-
/**
|
|
381
|
-
* repo-relative path
|
|
382
|
-
*/
|
|
383
|
-
file: string;
|
|
384
|
-
/**
|
|
385
|
-
* occurrences (retry-loop tasks touching this file)
|
|
386
|
-
*/
|
|
387
|
-
count: number;
|
|
388
|
-
/**
|
|
389
|
-
* distinct conversations the occurrences span
|
|
390
|
-
*/
|
|
391
|
-
sessions: number;
|
|
392
|
-
};
|
|
113
|
+
export type FrictionClusterPayload = import("@peasant-labs/schema").FrictionCluster;
|
|
393
114
|
/**
|
|
394
115
|
* One changed file within a branch (branch vs its merge-base).
|
|
395
|
-
* Mirrors FileChange from
|
|
116
|
+
* Mirrors FileChange from github.com/peasant-labs/schema.
|
|
396
117
|
*/
|
|
397
|
-
export type FileChangePayload = {
|
|
398
|
-
path: string;
|
|
399
|
-
/**
|
|
400
|
-
* modified / added / deleted / renamed
|
|
401
|
-
*/
|
|
118
|
+
export type FileChangePayload = Omit<import("@peasant-labs/schema").FileChange, "status"> & {
|
|
402
119
|
status: FileChangeStatus;
|
|
403
|
-
/**
|
|
404
|
-
* present for renames
|
|
405
|
-
*/
|
|
406
|
-
oldPath?: string | null;
|
|
407
|
-
/**
|
|
408
|
-
* 0 for binary files or when numstat is unavailable
|
|
409
|
-
*/
|
|
410
|
-
linesAdded: number;
|
|
411
|
-
linesRemoved: number;
|
|
412
120
|
};
|
|
413
121
|
/**
|
|
414
122
|
* The ChangeDetail surface prop payload. The adapter maps the wire
|
|
@@ -416,132 +124,43 @@ export type FileChangePayload = {
|
|
|
416
124
|
* The lazy per-file diff (ChangeDiffPayload) is fetched separately and wired
|
|
417
125
|
* via a callback/slot on the ChangeDetail surface; it is NOT embedded here.
|
|
418
126
|
*/
|
|
419
|
-
export type ChangeDetailPayload = {
|
|
420
|
-
branch: string;
|
|
421
|
-
/**
|
|
422
|
-
* merge-base commit hash
|
|
423
|
-
*/
|
|
424
|
-
baseRef: string;
|
|
425
|
-
defaultBranch: string;
|
|
426
|
-
/**
|
|
427
|
-
* changed files (branch vs merge-base)
|
|
428
|
-
*/
|
|
127
|
+
export type ChangeDetailPayload = Omit<import("@peasant-labs/schema").ChangeDetailPayload, "files" | "slice" | "newEdges" | "removedEdges" | "newNodes" | "removedNodes" | "violations" | "work" | "unrecordedCommits" | "unusual" | "frictions"> & {
|
|
429
128
|
files: FileChangePayload[];
|
|
430
|
-
/**
|
|
431
|
-
* touched nodes + 1-hop neighborhood
|
|
432
|
-
*/
|
|
433
129
|
slice: MapSlicePayload;
|
|
434
|
-
/**
|
|
435
|
-
* new import edges introduced
|
|
436
|
-
*/
|
|
437
130
|
newEdges: MapEdgePayload[];
|
|
438
131
|
removedEdges: MapEdgePayload[];
|
|
439
|
-
/**
|
|
440
|
-
* new node IDs
|
|
441
|
-
*/
|
|
442
132
|
newNodes: string[];
|
|
443
133
|
removedNodes: string[];
|
|
444
|
-
/**
|
|
445
|
-
* structural violations INTRODUCED by this change
|
|
446
|
-
*/
|
|
447
134
|
violations: EdgeViolationPayload[];
|
|
448
|
-
/**
|
|
449
|
-
* bound sessions, with tasks (each = one "conversation"; count = work.length)
|
|
450
|
-
*/
|
|
451
135
|
work: ChangeSessionPayload[];
|
|
452
|
-
/**
|
|
453
|
-
* commits on the branch with no recorded session
|
|
454
|
-
*/
|
|
455
136
|
unrecordedCommits: CommitRefPayload[];
|
|
456
|
-
/**
|
|
457
|
-
* neutral rate-elevation observations
|
|
458
|
-
*/
|
|
459
137
|
unusual: UnusualSignalPayload[];
|
|
460
|
-
/**
|
|
461
|
-
* neutral recurring-friction counts
|
|
462
|
-
*/
|
|
463
138
|
frictions: FrictionClusterPayload[];
|
|
464
|
-
/**
|
|
465
|
-
* authoritative changed-file count (from the matching ChangeSummary; files[] may be capped)
|
|
466
|
-
*/
|
|
467
139
|
filesChanged: number;
|
|
468
|
-
linesAdded: number;
|
|
469
|
-
linesRemoved: number;
|
|
470
|
-
/**
|
|
471
|
-
* SUM of output_tokens over bound sessions (the "ai wrote ≈N tokens" stat)
|
|
472
|
-
*/
|
|
473
|
-
outputTokens: number;
|
|
474
|
-
costUsd?: number | null;
|
|
475
140
|
};
|
|
476
141
|
/**
|
|
477
142
|
* One line within a diff hunk. `kind` uses the unified-diff convention.
|
|
478
|
-
* Mirrors DiffLine from
|
|
143
|
+
* Mirrors DiffLine from github.com/peasant-labs/schema.
|
|
479
144
|
*/
|
|
480
|
-
export type DiffLinePayload = {
|
|
481
|
-
/**
|
|
482
|
-
* context / add / del
|
|
483
|
-
*/
|
|
145
|
+
export type DiffLinePayload = Omit<import("@peasant-labs/schema").DiffLine, "kind"> & {
|
|
484
146
|
kind: DiffLineKind;
|
|
485
|
-
/**
|
|
486
|
-
* line text, WITHOUT the leading +/-/space marker
|
|
487
|
-
*/
|
|
488
|
-
text: string;
|
|
489
147
|
};
|
|
490
148
|
/**
|
|
491
149
|
* One unified-diff hunk (the `-old +new` range line). May carry conversation
|
|
492
150
|
* attribution when the hunk's added lines trace to a recorded session via git blame.
|
|
493
|
-
* Mirrors DiffHunk from
|
|
151
|
+
* Mirrors DiffHunk from github.com/peasant-labs/schema.
|
|
494
152
|
*/
|
|
495
|
-
export type DiffHunkPayload = {
|
|
496
|
-
oldStart: number;
|
|
497
|
-
oldLines: number;
|
|
498
|
-
newStart: number;
|
|
499
|
-
newLines: number;
|
|
500
|
-
/**
|
|
501
|
-
* hunk range header line, when present
|
|
502
|
-
*/
|
|
503
|
-
header?: string;
|
|
153
|
+
export type DiffHunkPayload = Omit<import("@peasant-labs/schema").DiffHunk, "lines"> & {
|
|
504
154
|
lines: DiffLinePayload[];
|
|
505
|
-
/**
|
|
506
|
-
* conversation attribution: recorded session that wrote most of the hunk's new lines
|
|
507
|
-
*/
|
|
508
|
-
sessionId?: string;
|
|
509
|
-
sessionTitle?: string;
|
|
510
155
|
};
|
|
511
156
|
/**
|
|
512
157
|
* The lazy per-file diff payload — fetched on demand when the user opens a
|
|
513
158
|
* file's diff inside the ChangeDetail surface. Adapter maps the wire
|
|
514
159
|
* ChangeDiffPayload (CLEAN) onto this shape — field-for-field.
|
|
515
160
|
*/
|
|
516
|
-
export type ChangeDiffPayload = {
|
|
517
|
-
branch: string;
|
|
518
|
-
/**
|
|
519
|
-
* the new (or only) file path
|
|
520
|
-
*/
|
|
521
|
-
file: string;
|
|
522
|
-
/**
|
|
523
|
-
* present for renames
|
|
524
|
-
*/
|
|
525
|
-
oldPath?: string | null;
|
|
526
|
-
/**
|
|
527
|
-
* modified / added / deleted / renamed
|
|
528
|
-
*/
|
|
161
|
+
export type ChangeDiffPayload = Omit<import("@peasant-labs/schema").ChangeDiffPayload, "status" | "hunks"> & {
|
|
529
162
|
status: FileChangeStatus;
|
|
530
|
-
/**
|
|
531
|
-
* true for binary files (no hunks)
|
|
532
|
-
*/
|
|
533
|
-
binary: boolean;
|
|
534
|
-
/**
|
|
535
|
-
* true when the file exceeds the size cap
|
|
536
|
-
*/
|
|
537
|
-
truncated: boolean;
|
|
538
163
|
hunks: DiffHunkPayload[];
|
|
539
|
-
/**
|
|
540
|
-
* HOST-SIDE error sentinel — NOT a wire field. The adapter
|
|
541
|
-
* must never map this from the REST payload; the host sets it
|
|
542
|
-
* (with empty `hunks`) when its lazy diff fetch FAILED, so the
|
|
543
|
-
* surface renders an error row instead of a perpetual spinner.
|
|
544
|
-
*/
|
|
545
164
|
error?: string;
|
|
546
165
|
};
|
|
547
166
|
/**
|
|
@@ -559,21 +178,29 @@ export type ChangeDiffPayload = {
|
|
|
559
178
|
* Review changed-slice overlays, effort overlay, keyboard) are component-level
|
|
560
179
|
* props defined in the surface slice, not data fields in this payload.
|
|
561
180
|
*/
|
|
562
|
-
export type CodeMapPayload = {
|
|
563
|
-
/**
|
|
564
|
-
* false when the project root is not a git repo; the component degrades to activity-only
|
|
565
|
-
*/
|
|
566
|
-
repoFound: boolean;
|
|
567
|
-
/**
|
|
568
|
-
* topology nodes for all zoom levels; parent links form the tree
|
|
569
|
-
*/
|
|
181
|
+
export type CodeMapPayload = Omit<import("@peasant-labs/schema").MapGraphPayload, "projectHash" | "repoPath" | "parsedLanguages" | "generatedAtMs" | "atCommit" | "activityEdges" | "nodes" | "structureEdges" | "violations"> & {
|
|
570
182
|
nodes: MapNodePayload[];
|
|
571
|
-
/**
|
|
572
|
-
* parsed import edges (aggregated per node pair)
|
|
573
|
-
*/
|
|
574
183
|
structureEdges: MapEdgePayload[];
|
|
575
|
-
/**
|
|
576
|
-
* structural violations (cycles + wrong-way imports)
|
|
577
|
-
*/
|
|
578
184
|
violations: EdgeViolationPayload[];
|
|
579
185
|
};
|
|
186
|
+
/**
|
|
187
|
+
* Classification of a map node within the path-derived tree.
|
|
188
|
+
*/
|
|
189
|
+
export type MapNodeKind = import("@peasant-labs/schema").MapNodeKind;
|
|
190
|
+
/**
|
|
191
|
+
* How strongly a recorded session is bound to a change.
|
|
192
|
+
*/
|
|
193
|
+
export type ChangeBinding = import("@peasant-labs/schema").ChangeBinding;
|
|
194
|
+
/**
|
|
195
|
+
* Kind of structural violation on the map.
|
|
196
|
+
*/
|
|
197
|
+
export type EdgeViolationKind = import("@peasant-labs/schema").EdgeViolationKind;
|
|
198
|
+
/**
|
|
199
|
+
* Per-file change status (branch vs merge-base). Git rename detection strips the
|
|
200
|
+
* similarity score, so "R100"/"R087" normalize to "R".
|
|
201
|
+
*/
|
|
202
|
+
export type FileChangeStatus = import("@peasant-labs/schema").FileChangeStatus;
|
|
203
|
+
/**
|
|
204
|
+
* Classification of one line within a unified-diff hunk.
|
|
205
|
+
*/
|
|
206
|
+
export type DiffLineKind = import("@peasant-labs/schema").DiffLineKind;
|
|
@@ -23,6 +23,7 @@ export { default as Tour } from "./Tour.jsx";
|
|
|
23
23
|
export { default as FacetRail } from "./FacetRail.jsx";
|
|
24
24
|
export * from "./transcript/index.js";
|
|
25
25
|
export * from "./transcript/graph/index.js";
|
|
26
|
+
export type TimelineNavigationAction = import("./graph/timelineNavigation.js").TimelineNavigationAction;
|
|
26
27
|
export { default as Button, ButtonGroup, Segmented } from "./Button.jsx";
|
|
27
28
|
export { default as Input, Textarea, Select, Field } from "./Input.jsx";
|
|
28
29
|
export { default as Checkbox, Radio, RadioGroup } from "./Checkbox.jsx";
|
|
@@ -32,6 +33,7 @@ export { default as Breadcrumb, Steps } from "./Breadcrumb.jsx";
|
|
|
32
33
|
export { default as Tooltip, Popover } from "./Tooltip.jsx";
|
|
33
34
|
export { Avatar, AvatarGroup, Kbd, KbdChord, Tag } from "./Avatar.jsx";
|
|
34
35
|
export { default as BrandMark, resolveBrand } from "./BrandMark.jsx";
|
|
36
|
+
export { providerAccent, providerDisplayName } from "./provider-policy.js";
|
|
35
37
|
export { Skeleton, Progress, Spinner, Toast, FeedbackPanel } from "./Feedback.jsx";
|
|
36
38
|
export { default as Timeline, TimelineItem, ToolCall, ThinkingBlock } from "./Timeline.jsx";
|
|
37
39
|
export { default as ToastProvider, useToast } from "./ToastHost.jsx";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validate an untrusted provider value before it enters canonical display APIs.
|
|
3
|
+
* @param {unknown} harness
|
|
4
|
+
* @param {string} operation
|
|
5
|
+
* @returns {asserts harness is Harness}
|
|
6
|
+
*/
|
|
7
|
+
export function assertHarness(harness: unknown, operation: string): asserts harness is Harness;
|
|
8
|
+
/** @param {Harness} harness @returns {string} */
|
|
9
|
+
export function providerDisplayName(harness: Harness): string;
|
|
10
|
+
/** @param {Harness} harness @returns {ProviderBrand} */
|
|
11
|
+
export function providerBrand(harness: Harness): ProviderBrand;
|
|
12
|
+
/** @param {Harness} harness @returns {ProviderAccent} */
|
|
13
|
+
export function providerAccent(harness: Harness): ProviderAccent;
|
|
14
|
+
/** @typedef {import('@peasant-labs/schema').Harness} Harness */
|
|
15
|
+
/** @typedef {'claude'|'gemini'|'openai'|'opencode'|'cursor'} ProviderBrand */
|
|
16
|
+
/** @typedef {'amber'|'teal'|'olive'|'mauve'|'clay'} ProviderAccent */
|
|
17
|
+
/** @type {readonly Harness[]} */
|
|
18
|
+
export const PROVIDER_HARNESSES: readonly Harness[];
|
|
19
|
+
/** @type {Readonly<Record<Harness, string>>} */
|
|
20
|
+
export const PROVIDER_DISPLAY_NAMES: Readonly<Record<Harness, string>>;
|
|
21
|
+
/** @type {Readonly<Record<Harness, ProviderBrand>>} */
|
|
22
|
+
export const PROVIDER_BRANDS: Readonly<Record<Harness, ProviderBrand>>;
|
|
23
|
+
/** @type {Readonly<Record<Harness, ProviderAccent>>} */
|
|
24
|
+
export const PROVIDER_ACCENTS: Readonly<Record<Harness, ProviderAccent>>;
|
|
25
|
+
export type Harness = import("@peasant-labs/schema").Harness;
|
|
26
|
+
export type ProviderBrand = "claude" | "gemini" | "openai" | "opencode" | "cursor";
|
|
27
|
+
export type ProviderAccent = "amber" | "teal" | "olive" | "mauve" | "clay";
|