@peasant-labs/fairtrade 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/ChartLine-Dlp6-CLL.js +264 -0
- package/dist/lib/InUseShell-DZvmRdj-.js +1532 -0
- package/dist/lib/analytics.css +1 -0
- package/dist/lib/analytics.js +1052 -0
- package/dist/lib/base.css +7 -1
- package/dist/lib/commons.css +1 -0
- package/dist/lib/commons.js +3275 -0
- package/dist/lib/components.css +1 -1
- package/dist/lib/graph.css +1 -0
- package/dist/lib/graph.js +823 -0
- package/dist/lib/types/Intensity.d.ts +3 -3
- package/dist/lib/types/MapCanvas.d.ts +37 -5
- package/dist/lib/types/RoleRoster.d.ts +12 -1
- package/dist/lib/types/analytics/ChartCard.d.ts +18 -0
- package/dist/lib/types/analytics/ContributorTable.d.ts +16 -0
- package/dist/lib/types/analytics/ProjectOverview.d.ts +40 -0
- package/dist/lib/types/analytics/format.d.ts +48 -0
- package/dist/lib/types/analytics/index.d.ts +24 -0
- package/dist/lib/types/analytics/metrics.d.ts +130 -0
- package/dist/lib/types/analytics/stats.d.ts +23 -0
- package/dist/lib/types/analytics/time.d.ts +32 -0
- package/dist/lib/types/analytics/types.d.ts +453 -0
- package/dist/lib/types/commons/Explore.d.ts +6 -0
- package/dist/lib/types/commons/Manage.d.ts +34 -0
- package/dist/lib/types/commons/index.d.ts +24 -0
- package/dist/lib/types/commons/providers.d.ts +8 -0
- package/dist/lib/types/commons/types.d.ts +356 -0
- package/dist/lib/types/graph/ChangeDetail.d.ts +28 -0
- package/dist/lib/types/graph/Changes.d.ts +21 -0
- package/dist/lib/types/graph/CodeMap.d.ts +49 -0
- package/dist/lib/types/graph/CodeMapComposition.d.ts +85 -0
- package/dist/lib/types/graph/changeGraph.d.ts +106 -0
- package/dist/lib/types/graph/index.d.ts +30 -0
- package/dist/lib/types/graph/types.d.ts +579 -0
- package/dist/lib/types/index.d.ts +3 -0
- package/dist/lib/types/inuse/InUseShell.d.ts +50 -0
- package/dist/lib/types/transcript/CheckRow.d.ts +15 -0
- package/dist/lib/types/transcript/DiffEntryCard.d.ts +27 -0
- package/dist/lib/types/transcript/FilterSection.d.ts +11 -0
- package/dist/lib/types/transcript/FiltersRail.d.ts +41 -0
- package/dist/lib/types/transcript/LabelPopover.d.ts +14 -0
- package/dist/lib/types/transcript/Markdown.d.ts +7 -0
- package/dist/lib/types/transcript/OutlineRail.d.ts +13 -0
- package/dist/lib/types/transcript/Scorecard.d.ts +8 -0
- package/dist/lib/types/transcript/Scrubber.d.ts +17 -0
- package/dist/lib/types/transcript/TaskBody.d.ts +8 -0
- package/dist/lib/types/transcript/Thinking.d.ts +9 -0
- package/dist/lib/types/transcript/ToolBody.d.ts +8 -0
- package/dist/lib/types/transcript/ToolCall.d.ts +12 -0
- package/dist/lib/types/transcript/TranscriptViewer.d.ts +6 -0
- package/dist/lib/types/transcript/TurnCard.d.ts +31 -0
- package/dist/lib/types/transcript/ViewSwitch.d.ts +11 -0
- package/dist/lib/types/transcript/adapter.d.ts +90 -0
- package/dist/lib/types/transcript/adapter.parse.d.ts +75 -0
- package/dist/lib/types/transcript/analytics.d.ts +216 -0
- package/dist/lib/types/transcript/graph/GraphLegend.d.ts +49 -0
- package/dist/lib/types/transcript/graph/GraphSubagentBranch.d.ts +24 -0
- package/dist/lib/types/transcript/graph/GraphToolNode.d.ts +56 -0
- package/dist/lib/types/transcript/graph/GraphTurnNode.d.ts +76 -0
- package/dist/lib/types/transcript/graph/index.d.ts +10 -0
- package/dist/lib/types/transcript/index.d.ts +69 -0
- package/dist/lib/types/transcript/state-capabilities.d.ts +161 -0
- package/dist/lib/types/transcript/view-model.d.ts +563 -0
- package/dist/lib/types/transcript/wire-types.d.ts +325 -0
- package/dist/lib/ui-oBFnHPFe.js +11146 -0
- package/dist/lib/ui.js +4 -8736
- package/package.json +42 -6
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a recorded session ended.
|
|
3
|
+
* @typedef {'resolved' | 'partial' | 'failed'} AnalyticsSessionOutcome
|
|
4
|
+
*/
|
|
5
|
+
/** Canonical AnalyticsSessionOutcome values. @type {readonly AnalyticsSessionOutcome[]} */
|
|
6
|
+
export const ANALYTICS_SESSION_OUTCOMES: readonly AnalyticsSessionOutcome[];
|
|
7
|
+
/**
|
|
8
|
+
* One recorded agent session, as the analytics dashboard consumes it. This is
|
|
9
|
+
* the fairtrade-owned record shape — apps map their own wire types onto it.
|
|
10
|
+
* Only the fields the dashboard actually reads are part of the contract.
|
|
11
|
+
* @typedef {object} AnalyticsSessionRecord
|
|
12
|
+
* @property {string} [id] Stable session id (not read by the dashboard; kept
|
|
13
|
+
* for adapter round-tripping and keying host-side lists).
|
|
14
|
+
* @property {string} startTime ISO-8601 timestamp; all week/day bucketing is
|
|
15
|
+
* done in UTC against this.
|
|
16
|
+
* @property {string} projectKey Opaque project key (repo, collective, …).
|
|
17
|
+
* @property {string} contributorId Opaque contributor key; empty ids are
|
|
18
|
+
* skipped by the contributor metrics.
|
|
19
|
+
* @property {number} durationMins Session duration in minutes.
|
|
20
|
+
* @property {number} totalTokens Total tokens across the session.
|
|
21
|
+
* @property {number} turnCount Conversation turns.
|
|
22
|
+
* @property {number} toolCallCount Tool invocations.
|
|
23
|
+
* @property {AnalyticsSessionOutcome} [outcome] Unset buckets as "unknown".
|
|
24
|
+
* @property {boolean} [hasCommit] Fallback commit flag when `commitCount` is
|
|
25
|
+
* absent.
|
|
26
|
+
* @property {number} [commitCount] Preferred commit linkage; `> 0` wins over
|
|
27
|
+
* `hasCommit`.
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* One bucket of the per-week session-count series (`week` = Monday-of-week UTC
|
|
31
|
+
* date key, `YYYY-MM-DD`).
|
|
32
|
+
* @typedef {object} WeekCount
|
|
33
|
+
* @property {string} week
|
|
34
|
+
* @property {number} count
|
|
35
|
+
*/
|
|
36
|
+
/**
|
|
37
|
+
* One bucket of the per-week unique-contributor series.
|
|
38
|
+
* @typedef {object} WeekContributors
|
|
39
|
+
* @property {string} week
|
|
40
|
+
* @property {number} contributors Distinct contributor ids active that week.
|
|
41
|
+
*/
|
|
42
|
+
/**
|
|
43
|
+
* Result of the returning-contributor calculation.
|
|
44
|
+
* @typedef {object} ReturningContributorRate
|
|
45
|
+
* @property {number} total Distinct contributors with ≥1 session.
|
|
46
|
+
* @property {number} returning Distinct contributors active in ≥2 distinct weeks.
|
|
47
|
+
* @property {number} rate returning / total, in [0, 1]; 0 when no contributors.
|
|
48
|
+
*/
|
|
49
|
+
/**
|
|
50
|
+
* Result of a streak calculation.
|
|
51
|
+
* @typedef {object} LongestStreak
|
|
52
|
+
* @property {number} weeks Length of the longest run of consecutive active weeks.
|
|
53
|
+
* @property {string | null} startWeek First Monday-key of that run, or null.
|
|
54
|
+
* @property {string | null} endWeek Last Monday-key of that run, or null.
|
|
55
|
+
*/
|
|
56
|
+
/**
|
|
57
|
+
* One bucket of the new-contributor series.
|
|
58
|
+
* @typedef {object} WeekNewContributors
|
|
59
|
+
* @property {string} week
|
|
60
|
+
* @property {number} newContributors Contributors whose FIRST-EVER session
|
|
61
|
+
* falls in this week.
|
|
62
|
+
*/
|
|
63
|
+
/**
|
|
64
|
+
* Result of the session→commit calculation.
|
|
65
|
+
* @typedef {object} SessionToCommitRate
|
|
66
|
+
* @property {number} total Total sessions considered.
|
|
67
|
+
* @property {number} withCommit Sessions that produced ≥1 commit.
|
|
68
|
+
* @property {number} rate withCommit / total, in [0, 1]; 0 when no sessions.
|
|
69
|
+
*/
|
|
70
|
+
/**
|
|
71
|
+
* One bucket of the per-active-week average-duration series.
|
|
72
|
+
* @typedef {object} WeekAvgDuration
|
|
73
|
+
* @property {string} week
|
|
74
|
+
* @property {number} avgDurationMins Mean session duration (minutes) that week.
|
|
75
|
+
* @property {number} sessions Number of sessions that fed the average.
|
|
76
|
+
*/
|
|
77
|
+
/**
|
|
78
|
+
* Distribution of session outcomes; the four buckets always sum to `total`
|
|
79
|
+
* (sessions with no `outcome` bucket under `unknown`).
|
|
80
|
+
* @typedef {object} OutcomeDistribution
|
|
81
|
+
* @property {number} resolved
|
|
82
|
+
* @property {number} partial
|
|
83
|
+
* @property {number} failed
|
|
84
|
+
* @property {number} unknown
|
|
85
|
+
* @property {number} total
|
|
86
|
+
*/
|
|
87
|
+
/**
|
|
88
|
+
* Median + 90th-percentile pair for a numeric distribution.
|
|
89
|
+
* @typedef {object} MedianP90
|
|
90
|
+
* @property {number} count Number of (finite) samples that fed the statistic.
|
|
91
|
+
* @property {number | null} median 50th percentile; null for an empty input.
|
|
92
|
+
* @property {number | null} p90 90th percentile; null for an empty input.
|
|
93
|
+
*/
|
|
94
|
+
/**
|
|
95
|
+
* Median + p90 for the four core numeric session fields ("typical vs. tail").
|
|
96
|
+
* @typedef {object} SessionStats
|
|
97
|
+
* @property {MedianP90} durationMins
|
|
98
|
+
* @property {MedianP90} totalTokens
|
|
99
|
+
* @property {MedianP90} turnCount
|
|
100
|
+
* @property {MedianP90} toolCallCount
|
|
101
|
+
*/
|
|
102
|
+
/**
|
|
103
|
+
* Per-contributor rolled-up summary (one contributor-table row).
|
|
104
|
+
* @typedef {object} ContributorBreakdown
|
|
105
|
+
* @property {string} contributorId
|
|
106
|
+
* @property {number} sessions Total sessions by this contributor.
|
|
107
|
+
* @property {number} activeWeeks Distinct ISO weeks this contributor was active.
|
|
108
|
+
* @property {number} totalTokens
|
|
109
|
+
* @property {number} totalDurationMins
|
|
110
|
+
* @property {number} totalTurns
|
|
111
|
+
* @property {number} totalToolCalls
|
|
112
|
+
* @property {number} sessionsWithCommit Sessions that produced ≥1 commit.
|
|
113
|
+
* @property {number} totalCommits Total linked commits (sum of `commitCount`;
|
|
114
|
+
* a session carrying only `hasCommit: true` counts as 1, so this is a lower
|
|
115
|
+
* bound when the host exposes the flag but not the count).
|
|
116
|
+
* @property {OutcomeDistribution} outcomes Outcome tally for this contributor.
|
|
117
|
+
* @property {string | null} firstSeen Earliest session day-key (`YYYY-MM-DD`).
|
|
118
|
+
* @property {string | null} lastSeen Latest session day-key (`YYYY-MM-DD`).
|
|
119
|
+
*/
|
|
120
|
+
/**
|
|
121
|
+
* The fully-computed analytics bundle. `ProjectOverview` accepts either this
|
|
122
|
+
* (pre-computed by the host) or raw `AnalyticsSessionRecord[]` it computes
|
|
123
|
+
* itself via `computeProjectAnalytics`.
|
|
124
|
+
* @typedef {object} ProjectAnalytics
|
|
125
|
+
* @property {number} totalSessions Distinct sessions considered.
|
|
126
|
+
* @property {number} totalContributors Distinct contributors.
|
|
127
|
+
* @property {number} totalProjects Distinct projects (`projectKey` values).
|
|
128
|
+
* @property {WeekCount[]} sessionsPerWeek
|
|
129
|
+
* @property {WeekContributors[]} weeklyActiveContributors
|
|
130
|
+
* @property {ReturningContributorRate} returningContributorRate
|
|
131
|
+
* @property {LongestStreak} longestStreak
|
|
132
|
+
* @property {WeekNewContributors[]} newContributorVelocity
|
|
133
|
+
* @property {SessionToCommitRate} sessionToCommitRate
|
|
134
|
+
* @property {WeekAvgDuration[]} avgDurationPerActiveWeek
|
|
135
|
+
* @property {OutcomeDistribution} outcomeDistribution
|
|
136
|
+
* @property {SessionStats} sessionStats
|
|
137
|
+
* @property {ContributorBreakdown[]} perContributorBreakdown
|
|
138
|
+
*/
|
|
139
|
+
/**
|
|
140
|
+
* The cooked payload `<ProjectOverview payload={…}>` consumes. Provide exactly
|
|
141
|
+
* one of the two fields; `analytics` wins when both are given.
|
|
142
|
+
* @typedef {object} AnalyticsOverviewPayload
|
|
143
|
+
* @property {AnalyticsSessionRecord[]} [sessions] Raw path — the surface
|
|
144
|
+
* computes every metric itself.
|
|
145
|
+
* @property {ProjectAnalytics} [analytics] Pre-computed path (host computed
|
|
146
|
+
* the bundle, e.g. server-side).
|
|
147
|
+
*/
|
|
148
|
+
/**
|
|
149
|
+
* The dashboard's toggleable sections.
|
|
150
|
+
* @typedef {'summary' | 'sessionsPerWeek' | 'weeklyActiveContributors'
|
|
151
|
+
* | 'newContributorVelocity' | 'avgDurationPerActiveWeek'
|
|
152
|
+
* | 'outcomeDistribution' | 'sessionStats' | 'contributorTable'
|
|
153
|
+
* } ProjectOverviewSectionKey
|
|
154
|
+
*/
|
|
155
|
+
/**
|
|
156
|
+
* The dashboard's sections: canonical keys paired with their visible chip
|
|
157
|
+
* labels, in render order. Single source of truth — the KEYS array below and
|
|
158
|
+
* the component's chip row both derive from this, so key set, order and
|
|
159
|
+
* labels cannot drift apart.
|
|
160
|
+
* @type {ReadonlyArray<{ key: ProjectOverviewSectionKey, label: string }>}
|
|
161
|
+
*/
|
|
162
|
+
export const PROJECT_OVERVIEW_SECTION_DEFS: ReadonlyArray<{
|
|
163
|
+
key: ProjectOverviewSectionKey;
|
|
164
|
+
label: string;
|
|
165
|
+
}>;
|
|
166
|
+
/** Canonical section keys, in render order (derived). @type {readonly ProjectOverviewSectionKey[]} */
|
|
167
|
+
export const PROJECT_OVERVIEW_SECTION_KEYS: readonly ProjectOverviewSectionKey[];
|
|
168
|
+
/**
|
|
169
|
+
* How a recorded session ended.
|
|
170
|
+
*/
|
|
171
|
+
export type AnalyticsSessionOutcome = "resolved" | "partial" | "failed";
|
|
172
|
+
/**
|
|
173
|
+
* One recorded agent session, as the analytics dashboard consumes it. This is
|
|
174
|
+
* the fairtrade-owned record shape — apps map their own wire types onto it.
|
|
175
|
+
* Only the fields the dashboard actually reads are part of the contract.
|
|
176
|
+
*/
|
|
177
|
+
export type AnalyticsSessionRecord = {
|
|
178
|
+
/**
|
|
179
|
+
* Stable session id (not read by the dashboard; kept
|
|
180
|
+
* for adapter round-tripping and keying host-side lists).
|
|
181
|
+
*/
|
|
182
|
+
id?: string;
|
|
183
|
+
/**
|
|
184
|
+
* ISO-8601 timestamp; all week/day bucketing is
|
|
185
|
+
* done in UTC against this.
|
|
186
|
+
*/
|
|
187
|
+
startTime: string;
|
|
188
|
+
/**
|
|
189
|
+
* Opaque project key (repo, collective, …).
|
|
190
|
+
*/
|
|
191
|
+
projectKey: string;
|
|
192
|
+
/**
|
|
193
|
+
* Opaque contributor key; empty ids are
|
|
194
|
+
* skipped by the contributor metrics.
|
|
195
|
+
*/
|
|
196
|
+
contributorId: string;
|
|
197
|
+
/**
|
|
198
|
+
* Session duration in minutes.
|
|
199
|
+
*/
|
|
200
|
+
durationMins: number;
|
|
201
|
+
/**
|
|
202
|
+
* Total tokens across the session.
|
|
203
|
+
*/
|
|
204
|
+
totalTokens: number;
|
|
205
|
+
/**
|
|
206
|
+
* Conversation turns.
|
|
207
|
+
*/
|
|
208
|
+
turnCount: number;
|
|
209
|
+
/**
|
|
210
|
+
* Tool invocations.
|
|
211
|
+
*/
|
|
212
|
+
toolCallCount: number;
|
|
213
|
+
/**
|
|
214
|
+
* Unset buckets as "unknown".
|
|
215
|
+
*/
|
|
216
|
+
outcome?: AnalyticsSessionOutcome;
|
|
217
|
+
/**
|
|
218
|
+
* Fallback commit flag when `commitCount` is
|
|
219
|
+
* absent.
|
|
220
|
+
*/
|
|
221
|
+
hasCommit?: boolean;
|
|
222
|
+
/**
|
|
223
|
+
* Preferred commit linkage; `> 0` wins over
|
|
224
|
+
* `hasCommit`.
|
|
225
|
+
*/
|
|
226
|
+
commitCount?: number;
|
|
227
|
+
};
|
|
228
|
+
/**
|
|
229
|
+
* One bucket of the per-week session-count series (`week` = Monday-of-week UTC
|
|
230
|
+
* date key, `YYYY-MM-DD`).
|
|
231
|
+
*/
|
|
232
|
+
export type WeekCount = {
|
|
233
|
+
week: string;
|
|
234
|
+
count: number;
|
|
235
|
+
};
|
|
236
|
+
/**
|
|
237
|
+
* One bucket of the per-week unique-contributor series.
|
|
238
|
+
*/
|
|
239
|
+
export type WeekContributors = {
|
|
240
|
+
week: string;
|
|
241
|
+
/**
|
|
242
|
+
* Distinct contributor ids active that week.
|
|
243
|
+
*/
|
|
244
|
+
contributors: number;
|
|
245
|
+
};
|
|
246
|
+
/**
|
|
247
|
+
* Result of the returning-contributor calculation.
|
|
248
|
+
*/
|
|
249
|
+
export type ReturningContributorRate = {
|
|
250
|
+
/**
|
|
251
|
+
* Distinct contributors with ≥1 session.
|
|
252
|
+
*/
|
|
253
|
+
total: number;
|
|
254
|
+
/**
|
|
255
|
+
* Distinct contributors active in ≥2 distinct weeks.
|
|
256
|
+
*/
|
|
257
|
+
returning: number;
|
|
258
|
+
/**
|
|
259
|
+
* returning / total, in [0, 1]; 0 when no contributors.
|
|
260
|
+
*/
|
|
261
|
+
rate: number;
|
|
262
|
+
};
|
|
263
|
+
/**
|
|
264
|
+
* Result of a streak calculation.
|
|
265
|
+
*/
|
|
266
|
+
export type LongestStreak = {
|
|
267
|
+
/**
|
|
268
|
+
* Length of the longest run of consecutive active weeks.
|
|
269
|
+
*/
|
|
270
|
+
weeks: number;
|
|
271
|
+
/**
|
|
272
|
+
* First Monday-key of that run, or null.
|
|
273
|
+
*/
|
|
274
|
+
startWeek: string | null;
|
|
275
|
+
/**
|
|
276
|
+
* Last Monday-key of that run, or null.
|
|
277
|
+
*/
|
|
278
|
+
endWeek: string | null;
|
|
279
|
+
};
|
|
280
|
+
/**
|
|
281
|
+
* One bucket of the new-contributor series.
|
|
282
|
+
*/
|
|
283
|
+
export type WeekNewContributors = {
|
|
284
|
+
week: string;
|
|
285
|
+
/**
|
|
286
|
+
* Contributors whose FIRST-EVER session
|
|
287
|
+
* falls in this week.
|
|
288
|
+
*/
|
|
289
|
+
newContributors: number;
|
|
290
|
+
};
|
|
291
|
+
/**
|
|
292
|
+
* Result of the session→commit calculation.
|
|
293
|
+
*/
|
|
294
|
+
export type SessionToCommitRate = {
|
|
295
|
+
/**
|
|
296
|
+
* Total sessions considered.
|
|
297
|
+
*/
|
|
298
|
+
total: number;
|
|
299
|
+
/**
|
|
300
|
+
* Sessions that produced ≥1 commit.
|
|
301
|
+
*/
|
|
302
|
+
withCommit: number;
|
|
303
|
+
/**
|
|
304
|
+
* withCommit / total, in [0, 1]; 0 when no sessions.
|
|
305
|
+
*/
|
|
306
|
+
rate: number;
|
|
307
|
+
};
|
|
308
|
+
/**
|
|
309
|
+
* One bucket of the per-active-week average-duration series.
|
|
310
|
+
*/
|
|
311
|
+
export type WeekAvgDuration = {
|
|
312
|
+
week: string;
|
|
313
|
+
/**
|
|
314
|
+
* Mean session duration (minutes) that week.
|
|
315
|
+
*/
|
|
316
|
+
avgDurationMins: number;
|
|
317
|
+
/**
|
|
318
|
+
* Number of sessions that fed the average.
|
|
319
|
+
*/
|
|
320
|
+
sessions: number;
|
|
321
|
+
};
|
|
322
|
+
/**
|
|
323
|
+
* Distribution of session outcomes; the four buckets always sum to `total`
|
|
324
|
+
* (sessions with no `outcome` bucket under `unknown`).
|
|
325
|
+
*/
|
|
326
|
+
export type OutcomeDistribution = {
|
|
327
|
+
resolved: number;
|
|
328
|
+
partial: number;
|
|
329
|
+
failed: number;
|
|
330
|
+
unknown: number;
|
|
331
|
+
total: number;
|
|
332
|
+
};
|
|
333
|
+
/**
|
|
334
|
+
* Median + 90th-percentile pair for a numeric distribution.
|
|
335
|
+
*/
|
|
336
|
+
export type MedianP90 = {
|
|
337
|
+
/**
|
|
338
|
+
* Number of (finite) samples that fed the statistic.
|
|
339
|
+
*/
|
|
340
|
+
count: number;
|
|
341
|
+
/**
|
|
342
|
+
* 50th percentile; null for an empty input.
|
|
343
|
+
*/
|
|
344
|
+
median: number | null;
|
|
345
|
+
/**
|
|
346
|
+
* 90th percentile; null for an empty input.
|
|
347
|
+
*/
|
|
348
|
+
p90: number | null;
|
|
349
|
+
};
|
|
350
|
+
/**
|
|
351
|
+
* Median + p90 for the four core numeric session fields ("typical vs. tail").
|
|
352
|
+
*/
|
|
353
|
+
export type SessionStats = {
|
|
354
|
+
durationMins: MedianP90;
|
|
355
|
+
totalTokens: MedianP90;
|
|
356
|
+
turnCount: MedianP90;
|
|
357
|
+
toolCallCount: MedianP90;
|
|
358
|
+
};
|
|
359
|
+
/**
|
|
360
|
+
* Per-contributor rolled-up summary (one contributor-table row).
|
|
361
|
+
*/
|
|
362
|
+
export type ContributorBreakdown = {
|
|
363
|
+
contributorId: string;
|
|
364
|
+
/**
|
|
365
|
+
* Total sessions by this contributor.
|
|
366
|
+
*/
|
|
367
|
+
sessions: number;
|
|
368
|
+
/**
|
|
369
|
+
* Distinct ISO weeks this contributor was active.
|
|
370
|
+
*/
|
|
371
|
+
activeWeeks: number;
|
|
372
|
+
totalTokens: number;
|
|
373
|
+
totalDurationMins: number;
|
|
374
|
+
totalTurns: number;
|
|
375
|
+
totalToolCalls: number;
|
|
376
|
+
/**
|
|
377
|
+
* Sessions that produced ≥1 commit.
|
|
378
|
+
*/
|
|
379
|
+
sessionsWithCommit: number;
|
|
380
|
+
/**
|
|
381
|
+
* Total linked commits (sum of `commitCount`;
|
|
382
|
+
* a session carrying only `hasCommit: true` counts as 1, so this is a lower
|
|
383
|
+
* bound when the host exposes the flag but not the count).
|
|
384
|
+
*/
|
|
385
|
+
totalCommits: number;
|
|
386
|
+
/**
|
|
387
|
+
* Outcome tally for this contributor.
|
|
388
|
+
*/
|
|
389
|
+
outcomes: OutcomeDistribution;
|
|
390
|
+
/**
|
|
391
|
+
* Earliest session day-key (`YYYY-MM-DD`).
|
|
392
|
+
*/
|
|
393
|
+
firstSeen: string | null;
|
|
394
|
+
/**
|
|
395
|
+
* Latest session day-key (`YYYY-MM-DD`).
|
|
396
|
+
*/
|
|
397
|
+
lastSeen: string | null;
|
|
398
|
+
};
|
|
399
|
+
/**
|
|
400
|
+
* The fully-computed analytics bundle. `ProjectOverview` accepts either this
|
|
401
|
+
* (pre-computed by the host) or raw `AnalyticsSessionRecord[]` it computes
|
|
402
|
+
* itself via `computeProjectAnalytics`.
|
|
403
|
+
*/
|
|
404
|
+
export type ProjectAnalytics = {
|
|
405
|
+
/**
|
|
406
|
+
* Distinct sessions considered.
|
|
407
|
+
*/
|
|
408
|
+
totalSessions: number;
|
|
409
|
+
/**
|
|
410
|
+
* Distinct contributors.
|
|
411
|
+
*/
|
|
412
|
+
totalContributors: number;
|
|
413
|
+
/**
|
|
414
|
+
* Distinct projects (`projectKey` values).
|
|
415
|
+
*/
|
|
416
|
+
totalProjects: number;
|
|
417
|
+
sessionsPerWeek: WeekCount[];
|
|
418
|
+
weeklyActiveContributors: WeekContributors[];
|
|
419
|
+
returningContributorRate: ReturningContributorRate;
|
|
420
|
+
longestStreak: LongestStreak;
|
|
421
|
+
newContributorVelocity: WeekNewContributors[];
|
|
422
|
+
sessionToCommitRate: SessionToCommitRate;
|
|
423
|
+
avgDurationPerActiveWeek: WeekAvgDuration[];
|
|
424
|
+
outcomeDistribution: OutcomeDistribution;
|
|
425
|
+
sessionStats: SessionStats;
|
|
426
|
+
perContributorBreakdown: ContributorBreakdown[];
|
|
427
|
+
};
|
|
428
|
+
/**
|
|
429
|
+
* The cooked payload `<ProjectOverview payload={…}>` consumes. Provide exactly
|
|
430
|
+
* one of the two fields; `analytics` wins when both are given.
|
|
431
|
+
*/
|
|
432
|
+
export type AnalyticsOverviewPayload = {
|
|
433
|
+
/**
|
|
434
|
+
* Raw path — the surface
|
|
435
|
+
* computes every metric itself.
|
|
436
|
+
*/
|
|
437
|
+
sessions?: AnalyticsSessionRecord[];
|
|
438
|
+
/**
|
|
439
|
+
* Pre-computed path (host computed
|
|
440
|
+
* the bundle, e.g. server-side).
|
|
441
|
+
*/
|
|
442
|
+
analytics?: ProjectAnalytics;
|
|
443
|
+
};
|
|
444
|
+
/**
|
|
445
|
+
* The dashboard's toggleable sections.
|
|
446
|
+
*/
|
|
447
|
+
export type ProjectOverviewSectionKey = "summary" | "sessionsPerWeek" | "weeklyActiveContributors" | "newContributorVelocity" | "avgDurationPerActiveWeek" | "outcomeDistribution" | "sessionStats" | "contributorTable";
|
|
448
|
+
/**
|
|
449
|
+
* Host-level section visibility. Every flag defaults to ON; set one to `false`
|
|
450
|
+
* to hide that section. The built-in visible-section control can hide sections
|
|
451
|
+
* at runtime, but it cannot re-enable a host-hidden section.
|
|
452
|
+
*/
|
|
453
|
+
export type ProjectOverviewSections = Partial<Record<ProjectOverviewSectionKey, boolean>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import('./types.js').ExploreSurfaceProps} ExploreSurfaceProps
|
|
3
|
+
*/
|
|
4
|
+
/** @param {ExploreSurfaceProps} props */
|
|
5
|
+
export default function Explore({ data, className, onFiltersChange, onOpenTranscript, onOpenProfile, onOpenCollective, transcriptHref, profileHref, collectiveHref, }: ExploreSurfaceProps): any;
|
|
6
|
+
export type ExploreSurfaceProps = import("./types.js").ExploreSurfaceProps;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export function Manage({ data, actions, demoRoleSwitcher, }?: {
|
|
2
|
+
data?: {
|
|
3
|
+
collective: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: any;
|
|
6
|
+
linkedGithubOrg: any;
|
|
7
|
+
acceptanceMode: string;
|
|
8
|
+
dataAccess: string;
|
|
9
|
+
role: string;
|
|
10
|
+
memberSince: any;
|
|
11
|
+
};
|
|
12
|
+
providerShare: any[];
|
|
13
|
+
pendingReview: any[];
|
|
14
|
+
members: any[];
|
|
15
|
+
redactions: any[];
|
|
16
|
+
browseRows: any[];
|
|
17
|
+
roleOptions: any[];
|
|
18
|
+
initialRole: string;
|
|
19
|
+
initialShowRedaction: boolean;
|
|
20
|
+
initialBrowseGated: boolean;
|
|
21
|
+
stats: {
|
|
22
|
+
transcripts: string;
|
|
23
|
+
projects: string;
|
|
24
|
+
tokens: string;
|
|
25
|
+
turns: string;
|
|
26
|
+
contributors: string;
|
|
27
|
+
hours: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
actions?: {};
|
|
31
|
+
demoRoleSwitcher?: boolean;
|
|
32
|
+
}): any;
|
|
33
|
+
export { PROVIDER_LABEL, formatProvider, providerLabel } from "./providers.js";
|
|
34
|
+
export { PublishView, CollectivesView, CollectiveDetailView, CollectiveSettingsView, ContributeView } from "../../mockups/inuse/CommonsManage.jsx";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export { default as Explore } from "./Explore.jsx";
|
|
2
|
+
export type TranscriptVisibility = import("./types.js").TranscriptVisibility;
|
|
3
|
+
export type AcceptanceMode = import("./types.js").AcceptanceMode;
|
|
4
|
+
export type DataAccessPolicy = import("./types.js").DataAccessPolicy;
|
|
5
|
+
export type TranscriptDeletionPolicy = import("./types.js").TranscriptDeletionPolicy;
|
|
6
|
+
export type CollectiveRole = import("./types.js").CollectiveRole;
|
|
7
|
+
export type ViewerRole = import("./types.js").ViewerRole;
|
|
8
|
+
export type ExploreSurfaceProps = import("./types.js").ExploreSurfaceProps;
|
|
9
|
+
export type TagPayload = import("./types.js").TagPayload;
|
|
10
|
+
export type ExploreOwnerPayload = import("./types.js").ExploreOwnerPayload;
|
|
11
|
+
export type ExploreTranscriptPayload = import("./types.js").ExploreTranscriptPayload;
|
|
12
|
+
export type ExploreTranscriptListPayload = import("./types.js").ExploreTranscriptListPayload;
|
|
13
|
+
export type CollectiveResultPayload = import("./types.js").CollectiveResultPayload;
|
|
14
|
+
export type PopularTagPayload = import("./types.js").PopularTagPayload;
|
|
15
|
+
export type ExplorePayload = import("./types.js").ExplorePayload;
|
|
16
|
+
export type CollectiveMemberPayload = import("./types.js").CollectiveMemberPayload;
|
|
17
|
+
export type CollectiveTranscriptPayload = import("./types.js").CollectiveTranscriptPayload;
|
|
18
|
+
export type CollectiveStatsPayload = import("./types.js").CollectiveStatsPayload;
|
|
19
|
+
export type CollectiveModelBreakdownPayload = import("./types.js").CollectiveModelBreakdownPayload;
|
|
20
|
+
export type CollectiveContributorPayload = import("./types.js").CollectiveContributorPayload;
|
|
21
|
+
export type CollectivePayload = import("./types.js").CollectivePayload;
|
|
22
|
+
export type ManagePayload = import("./types.js").ManagePayload;
|
|
23
|
+
export { TRANSCRIPT_VISIBILITIES, ACCEPTANCE_MODES, DATA_ACCESS_POLICIES, TRANSCRIPT_DELETION_POLICIES, COLLECTIVE_ROLES } from "./types.js";
|
|
24
|
+
export { Manage, PublishView, CollectivesView, CollectiveDetailView, CollectiveSettingsView, ContributeView } from "./Manage.jsx";
|