@peasant-labs/fairtrade 0.0.21 → 0.0.23

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.
@@ -0,0 +1,283 @@
1
+ /**
2
+ * The collectives list: the collectives in a table, the create form, and (with
3
+ * `onSearchCollectives`) a search for others.
4
+ *
5
+ * @param {object} [props]
6
+ * @param {object} [props.data]
7
+ * @param {CollectiveRow[]} [props.data.collectives]
8
+ * @param {string[]} [props.data.linkedOrgs] - github orgs a new collective can link.
9
+ * @param {string} [props.data.title='collectives']
10
+ * @param {string} [props.data.deck]
11
+ * @param {string} [props.data.crumb] - a breadcrumb above the title.
12
+ * @param {string} [props.data.caption='collectives'] - the table caption, before the count.
13
+ * @param {string} [props.data.createLabel='new collective']
14
+ * @param {boolean} [props.data.createBusy]
15
+ * @param {PolicyChoice[]} [props.data.whoCanPublish] - the create form's join choices.
16
+ * @param {PolicyChoice[]} [props.data.whoCanRead] - the create form's read choices.
17
+ * @param {object} [props.actions]
18
+ * @param {(collective: { name: string, purpose: string, mode: string, access: string, org: string }) => void} [props.actions.onCreateCollective]
19
+ * @param {(id: string) => void} [props.actions.onOpenCollective]
20
+ * @param {(query: string) => void} [props.actions.onSearchCollectives]
21
+ */
22
+ export function CollectivesView({ data, actions }?: {
23
+ data?: {
24
+ collectives?: CollectiveRow[];
25
+ linkedOrgs?: string[];
26
+ title?: string;
27
+ deck?: string;
28
+ crumb?: string;
29
+ caption?: string;
30
+ createLabel?: string;
31
+ createBusy?: boolean;
32
+ whoCanPublish?: PolicyChoice[];
33
+ whoCanRead?: PolicyChoice[];
34
+ };
35
+ actions?: {
36
+ onCreateCollective?: (collective: {
37
+ name: string;
38
+ purpose: string;
39
+ mode: string;
40
+ access: string;
41
+ org: string;
42
+ }) => void;
43
+ onOpenCollective?: (id: string) => void;
44
+ onSearchCollectives?: (query: string) => void;
45
+ };
46
+ }): import("react").JSX.Element;
47
+ /**
48
+ * @typedef {object} CollectiveData
49
+ * @property {string} [id]
50
+ * @property {string} name - kept in its case.
51
+ * @property {string|null} [purpose]
52
+ * @property {string|null} [description] - the earlier name for `purpose`.
53
+ * @property {string|null} [linkedGithubOrg] - the earlier name for `org.login`.
54
+ * @property {string} [role] - the viewer's role; `owner` shows the settings button.
55
+ * @property {string} [whoCanRead] - the policy in words, for the collective page.
56
+ * @property {string} [whoCanPublish] - the policy in words, for the collective page.
57
+ * @property {string} [yourRole] - the viewer's role in words.
58
+ * @property {string} [mode] - the join policy value, for settings (`open`, `verified_only`, `curated`).
59
+ * @property {string} [access] - the read policy value, for settings (`members_only`, `contributors`).
60
+ * @property {string} [memberLeaves] - what happens to a leaving member's transcripts, for settings.
61
+ * @property {{ value: number|string, label: string }[]} [stats]
62
+ * @property {number} [transcriptCount] - every transcript, when `transcripts` holds one page of them.
63
+ * @property {{ login: string, linked?: number, total?: number } | null} [org] - null says nothing is linked; left out, the line is left out.
64
+ * @property {string} [memberBreakdown]
65
+ * @property {{ id: string, title: string, harness: string, turns?: number, author?: string, pullRequests?: string[], repo?: string|null, when?: string }[]} [transcripts]
66
+ * @property {{ handle: string, name?: string, role: string }[]} [members]
67
+ * @property {number} [memberCount]
68
+ */
69
+ /**
70
+ * A collective: its purpose, the boxes that say who can read, who can publish and your role, one
71
+ * stats line, its transcripts with their pull requests, and a rail with the github org and the
72
+ * members.
73
+ *
74
+ * @param {object} [props]
75
+ * @param {object} [props.data]
76
+ * @param {CollectiveData} [props.data.collective]
77
+ * @param {object[]} [props.data.owners] - RepoPicker owners, for linking repositories.
78
+ * @param {string[]} [props.data.linkedRepos]
79
+ * @param {HrefFor} [props.data.hrefFor] - where a link goes; without it links render as buttons.
80
+ * @param {object} [props.actions]
81
+ * @param {() => void} [props.actions.onSettings]
82
+ * @param {() => void} [props.actions.onContribute]
83
+ * @param {() => void} [props.actions.onReview]
84
+ * @param {(id: string) => void} [props.actions.onOpenTranscript]
85
+ * @param {(number: string) => void} [props.actions.onOpenPullRequest]
86
+ * @param {(diff: { add: string[], remove: string[] }) => void} [props.actions.onLinkRepos]
87
+ * @param {() => void} [props.actions.onShowMore] - shows the next transcripts; omit it and no button renders.
88
+ */
89
+ export function CollectiveDetailView({ data, actions }?: {
90
+ data?: {
91
+ collective?: CollectiveData;
92
+ owners?: object[];
93
+ linkedRepos?: string[];
94
+ hrefFor?: HrefFor;
95
+ };
96
+ actions?: {
97
+ onSettings?: () => void;
98
+ onContribute?: () => void;
99
+ onReview?: () => void;
100
+ onOpenTranscript?: (id: string) => void;
101
+ onOpenPullRequest?: (number: string) => void;
102
+ onLinkRepos?: (diff: {
103
+ add: string[];
104
+ remove: string[];
105
+ }) => void;
106
+ onShowMore?: () => void;
107
+ };
108
+ }): import("react").JSX.Element;
109
+ /**
110
+ * A collective's settings, saved per field. The selects show the collective's own `mode`,
111
+ * `access` and `memberLeaves` values, or `not set` when the host does not give one. Each change
112
+ * calls `onCommit` with the field it writes (`mode`, `access`, `memberLeaves`, ...) and the value.
113
+ *
114
+ * @param {object} [props]
115
+ * @param {object} [props.data]
116
+ * @param {CollectiveData} [props.data.collective]
117
+ * @param {object[]} [props.data.owners] - RepoPicker owners, for linking repositories.
118
+ * @param {string[]} [props.data.linkedRepos]
119
+ * @param {boolean} [props.data.showOnPullRequests]
120
+ * @param {PolicyChoice[]} [props.data.whoCanPublish]
121
+ * @param {PolicyChoice[]} [props.data.whoCanRead]
122
+ * @param {PolicyChoice[]} [props.data.memberLeavesChoices] - defaults to the wire's `user_choice` and `mandatory`.
123
+ * @param {HrefFor} [props.data.hrefFor]
124
+ * @param {object} [props.actions]
125
+ * @param {(key: CollectiveSettingKey, value: unknown) => Promise<unknown>} [props.actions.onCommit] - the one write per change; reject to fail.
126
+ * @param {(handle: string) => void} [props.actions.onInvite]
127
+ * @param {(handle: string) => void} [props.actions.onRemoveMember]
128
+ * @param {(handle: string, role: string) => void} [props.actions.onRoleChange]
129
+ * @param {(diff: { add: string[], remove: string[] }) => void} [props.actions.onLinkRepos]
130
+ * @param {() => void} [props.actions.onTransferOwnership]
131
+ * @param {() => void} [props.actions.onDelete]
132
+ */
133
+ export function CollectiveSettingsView({ data, actions }?: {
134
+ data?: {
135
+ collective?: CollectiveData;
136
+ owners?: object[];
137
+ linkedRepos?: string[];
138
+ showOnPullRequests?: boolean;
139
+ whoCanPublish?: PolicyChoice[];
140
+ whoCanRead?: PolicyChoice[];
141
+ memberLeavesChoices?: PolicyChoice[];
142
+ hrefFor?: HrefFor;
143
+ };
144
+ actions?: {
145
+ onCommit?: (key: CollectiveSettingKey, value: unknown) => Promise<unknown>;
146
+ onInvite?: (handle: string) => void;
147
+ onRemoveMember?: (handle: string) => void;
148
+ onRoleChange?: (handle: string, role: string) => void;
149
+ onLinkRepos?: (diff: {
150
+ add: string[];
151
+ remove: string[];
152
+ }) => void;
153
+ onTransferOwnership?: () => void;
154
+ onDelete?: () => void;
155
+ };
156
+ }): import("react").JSX.Element;
157
+ export type CollectiveData = {
158
+ id?: string;
159
+ /**
160
+ * - kept in its case.
161
+ */
162
+ name: string;
163
+ purpose?: string | null;
164
+ /**
165
+ * - the earlier name for `purpose`.
166
+ */
167
+ description?: string | null;
168
+ /**
169
+ * - the earlier name for `org.login`.
170
+ */
171
+ linkedGithubOrg?: string | null;
172
+ /**
173
+ * - the viewer's role; `owner` shows the settings button.
174
+ */
175
+ role?: string;
176
+ /**
177
+ * - the policy in words, for the collective page.
178
+ */
179
+ whoCanRead?: string;
180
+ /**
181
+ * - the policy in words, for the collective page.
182
+ */
183
+ whoCanPublish?: string;
184
+ /**
185
+ * - the viewer's role in words.
186
+ */
187
+ yourRole?: string;
188
+ /**
189
+ * - the join policy value, for settings (`open`, `verified_only`, `curated`).
190
+ */
191
+ mode?: string;
192
+ /**
193
+ * - the read policy value, for settings (`members_only`, `contributors`).
194
+ */
195
+ access?: string;
196
+ /**
197
+ * - what happens to a leaving member's transcripts, for settings.
198
+ */
199
+ memberLeaves?: string;
200
+ stats?: {
201
+ value: number | string;
202
+ label: string;
203
+ }[];
204
+ /**
205
+ * - every transcript, when `transcripts` holds one page of them.
206
+ */
207
+ transcriptCount?: number;
208
+ /**
209
+ * - null says nothing is linked; left out, the line is left out.
210
+ */
211
+ org?: {
212
+ login: string;
213
+ linked?: number;
214
+ total?: number;
215
+ } | null;
216
+ memberBreakdown?: string;
217
+ transcripts?: {
218
+ id: string;
219
+ title: string;
220
+ harness: string;
221
+ turns?: number;
222
+ author?: string;
223
+ pullRequests?: string[];
224
+ repo?: string | null;
225
+ when?: string;
226
+ }[];
227
+ members?: {
228
+ handle: string;
229
+ name?: string;
230
+ role: string;
231
+ }[];
232
+ memberCount?: number;
233
+ };
234
+ export type PolicyChoice = {
235
+ value: string;
236
+ /**
237
+ * - lowercase chrome.
238
+ */
239
+ label: string;
240
+ /**
241
+ * - one line on what the choice means.
242
+ */
243
+ help?: string;
244
+ };
245
+ export type CollectiveRow = {
246
+ id: string;
247
+ /**
248
+ * - kept in its case.
249
+ */
250
+ name: string;
251
+ /**
252
+ * - the viewer's role; empty when they only see the collective.
253
+ */
254
+ role?: string | null;
255
+ members?: number;
256
+ transcripts?: number | string;
257
+ /**
258
+ * - the linked github org; null says nothing is linked. Leave it
259
+ * undefined on every row and the github org column is left out.
260
+ */
261
+ org?: string | null;
262
+ /**
263
+ * - beside the org ("2 of 14 repos").
264
+ */
265
+ repos?: string | null;
266
+ /**
267
+ * - how members join: `open`, `verified_only` or `curated`.
268
+ */
269
+ mode?: string;
270
+ /**
271
+ * - a line under the name.
272
+ */
273
+ desc?: string | null;
274
+ /**
275
+ * - a line under the role ("member for 5mo").
276
+ */
277
+ since?: string | null;
278
+ };
279
+ export type HrefFor = (kind: "collectives" | "collective" | "transcript" | "pull-request" | "account", id?: string) => (string | undefined);
280
+ /**
281
+ * The fields a settings change writes, passed to `onCommit` with the new value.
282
+ */
283
+ export type CollectiveSettingKey = "name" | "purpose" | "mode" | "access" | "memberLeaves" | "showOnPullRequests";
@@ -31,4 +31,5 @@ export function Manage({ data, actions, demoRoleSwitcher, }?: {
31
31
  demoRoleSwitcher?: boolean;
32
32
  }): import("react").JSX.Element;
33
33
  export { PROVIDER_LABEL, formatProvider, providerLabel } from "./providers.js";
34
- export { PublishView, CollectivesView, CollectiveDetailView, CollectiveSettingsView, ContributeView } from "../../mockups/inuse/CommonsManage.jsx";
34
+ export { PublishView, ContributeView } from "../../mockups/inuse/CommonsManage.jsx";
35
+ export { CollectivesView, CollectiveDetailView, CollectiveSettingsView } from "./Collectives.jsx";
@@ -71,7 +71,7 @@ export type FlowGraph = import("../transcript/graph/engine/index.js").FlowGraph;
71
71
  export { default as CodeMap, codeMapPayloadToMapData } from "./CodeMap.jsx";
72
72
  export { default as CodeMapComposition, DefaultMapLegend } from "./CodeMapComposition.jsx";
73
73
  export { CODE_MAP_STATE_VERSION, CODE_MAP_VIEWPORT_SCALE, isCodeMapViewportScale, codeMapStatesEqual, createCodeMapState, reduceCodeMapState, deriveCodeMapView, deriveTimelineHighlight, resolveEscapeAction } from "./codeMapState.js";
74
- export { GraphAppShell, GraphSectionNav, GRAPH_APP_SECTIONS } from "../inuse/InUseShell.jsx";
74
+ export { GraphAppShell, GraphSectionNav, LOCAL_APP_SECTIONS, GRAPH_APP_SECTIONS } from "../inuse/InUseShell.jsx";
75
75
  export { buildChangesGraph, humanizeAge } from "./changeGraph.js";
76
76
  export { DOI_WEIGHTS, DEBT_VIEWED, COVERAGE_CAP, RECENCY_HALF_LIFE_DAYS, RANK_FLOOR, RANK_CAP, SCENT_TAGS, debtState, debt, coverage, hunkClears, partialReadHoverText, debtHoverText, scentTagsFor, rankMapNodesIntrinsic, deriveRankedRows, rankMapNodes, gateRankedRows } from "./ranking.js";
77
77
  export { assertChangeDetailPayloadEnums, assertChangeDiffPayloadEnums, assertCodeMapPayloadEnums, MAP_NODE_KINDS, CHANGE_BINDINGS, EDGE_VIOLATION_KINDS, FILE_CHANGE_STATUSES, DIFF_LINE_KINDS } from "./types.js";
@@ -23,6 +23,10 @@ export { default as PromptDigest } from "./PromptDigest.jsx";
23
23
  export { default as ToolCallRenderer } from "./ToolRenderers.jsx";
24
24
  export { default as Tour } from "./Tour.jsx";
25
25
  export { default as FacetRail } from "./FacetRail.jsx";
26
+ export { default as StatsStrip } from "./StatsStrip.jsx";
27
+ export { default as CopyIconButton } from "./CopyIconButton.jsx";
28
+ export { default as OverflowList } from "./OverflowList.jsx";
29
+ export { default as RepoPicker } from "./RepoPicker.jsx";
26
30
  export * from "./transcript/index.js";
27
31
  export * from "./transcript/graph/index.js";
28
32
  export type TimelineNavigationAction = import("./graph/timelineNavigation.js").TimelineNavigationAction;
@@ -53,9 +57,11 @@ export { default as RailShell, RailSection, SplitRail } from "./RailShell.jsx";
53
57
  export { default as ProviderIcon, ProviderTag, ProviderName, AccentLegend, PROVIDER_ACCENT } from "./ProviderIcon.jsx";
54
58
  export { default as EvidenceCaption, EvidenceTarget } from "./EvidenceCaption.jsx";
55
59
  export { PhaseDivider, Phase, TaskBoundary, CheckpointMarker, TurnContextBar } from "./TranscriptMarkers.jsx";
56
- export { default as ConnectionPill, DataState, TeachingEmptyState } from "./ConnectionState.jsx";
60
+ export { default as ConnectionPill, DataState, TeachingEmptyState, LocalOfflineBanner } from "./ConnectionState.jsx";
57
61
  export { default as SignInProviders, HandleClaim, OnboardingCard } from "./SignIn.jsx";
58
62
  export { default as CliSteps, CommandBlock, GettingStarted } from "./CliOnboard.jsx";
59
63
  export { StatTile, StatGrid, GovTile, ProviderBars } from "./StatTiles.jsx";
64
+ export { PublishStateLabel, PublishBar, AccessList, CollectivePicker, PublishDialog, PUBLISH_STATES, PUBLISH_DIALOG_STATES } from "./Publish.jsx";
65
+ export { SettingRow, SettingGroup, SETTING_ROW_STATES } from "./Settings.jsx";
60
66
  export { default as VisibilitySegmented, VisibilityEye, ScopeChip, FocusedModeToggle } from "./VisibilityControl.jsx";
61
- export { default as InUseShell, GraphAppShell, GraphSectionNav, IN_USE_APPS, GRAPH_APP_SECTIONS } from "./inuse/InUseShell.jsx";
67
+ export { default as InUseShell, GraphAppShell, GraphSectionNav, IN_USE_APPS, LOCAL_APP_SECTIONS, GRAPH_APP_SECTIONS } from "./inuse/InUseShell.jsx";
@@ -1,3 +1,4 @@
1
+ export function navSectionsOf(sections: any): any;
1
2
  export default function InUseShell({ apps, defaultApp, activeApp, onAppChange, renderApp, brand, ariaLabel, }: {
2
3
  apps?: readonly {
3
4
  id: string;
@@ -11,24 +12,19 @@ export default function InUseShell({ apps, defaultApp, activeApp, onAppChange, r
11
12
  brand?: string;
12
13
  ariaLabel?: string;
13
14
  }): import("react").JSX.Element;
14
- export function GraphAppShell({ sections, activeId, activePrimaryId, onSectionChange, backTo, onBack, children, ariaLabel, }: {
15
- sections?: readonly {
16
- id: string;
17
- label: string;
18
- }[];
15
+ export function GraphAppShell({ sections, activeId, activePrimaryId, onSectionChange, backTo, onBack, notice, children, ariaLabel, }: {
16
+ sections?: readonly Readonly<AppSection>[];
19
17
  activeId: any;
20
18
  activePrimaryId: any;
21
19
  onSectionChange: any;
22
20
  backTo: any;
23
21
  onBack: any;
22
+ notice?: any;
24
23
  children: any;
25
24
  ariaLabel?: string;
26
25
  }): import("react").JSX.Element;
27
26
  export function GraphSectionNav({ sections, activeId, hrefFor, LinkComponent, onSectionChange, className, itemClassName, activeItemClassName, activeMarker, ariaLabel, }: {
28
- sections?: readonly {
29
- id: string;
30
- label: string;
31
- }[];
27
+ sections?: readonly Readonly<AppSection>[];
32
28
  activeId?: any;
33
29
  hrefFor?: any;
34
30
  LinkComponent?: any;
@@ -44,7 +40,28 @@ export const IN_USE_APPS: readonly {
44
40
  mark: string;
45
41
  icon: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
46
42
  }[];
43
+ /**
44
+ * One entry of a section list. `inNav: false` keeps a section out of the section navigation; an
45
+ * entry without `inNav` is listed. A consumer's own list may carry more fields (an `href`).
46
+ * @typedef {{ id: string, label: string, inNav?: boolean, title?: string }} AppSection
47
+ */
48
+ /** @type {ReadonlyArray<Readonly<AppSection>>} */
49
+ export const LOCAL_APP_SECTIONS: ReadonlyArray<Readonly<AppSection>>;
50
+ /**
51
+ * @deprecated use LOCAL_APP_SECTIONS. The earlier three-section registry, kept with its original
52
+ * value so a consumer on the old shape keeps working until it re-pins.
53
+ */
47
54
  export const GRAPH_APP_SECTIONS: readonly {
48
55
  id: string;
49
56
  label: string;
50
57
  }[];
58
+ /**
59
+ * One entry of a section list. `inNav: false` keeps a section out of the section navigation; an
60
+ * entry without `inNav` is listed. A consumer's own list may carry more fields (an `href`).
61
+ */
62
+ export type AppSection = {
63
+ id: string;
64
+ label: string;
65
+ inNav?: boolean;
66
+ title?: string;
67
+ };
@@ -0,0 +1 @@
1
+ export function matchesQuery(text: any, query: any): boolean;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @param {TranscriptViewerProps} props
3
3
  */
4
- export default function TranscriptViewer({ viewModel, capabilities, callbacks, theme: themeProp, onThemeChange, graphSlot, activeTab: activeTabProp, onTabChange, viewMode: viewModeProp, onViewModeChange, leftRailOpen: leftRailOpenProp, onLeftRailOpenChange, rightRailOpen: rightRailOpenProp, onRightRailOpenChange, openTools: openToolsProp, onOpenToolsChange, earlierHistoryOpen: earlierHistoryOpenProp, onEarlierHistoryOpenChange, initialPosition: initialPositionProp, activeTurn: activeTurnProp, onActiveTurnChange, search: searchProp, onSearchChange, filters: filtersProp, onFiltersChange, savedLabels: savedLabelsProp, onSavedLabelsChange, shareOpen: shareOpenProp, onShareOpenChange, moreOpen: moreOpenProp, onMoreOpenChange, breadcrumb, LinkComponent, renderTurnPanel, renderTurnActions, anchorHref, headerActions, streamPrelude, }: TranscriptViewerProps): import("react").JSX.Element;
4
+ export default function TranscriptViewer({ viewModel, capabilities, callbacks, theme: themeProp, onThemeChange, graphSlot, activeTab: activeTabProp, onTabChange, viewMode: viewModeProp, onViewModeChange, leftRailOpen: leftRailOpenProp, onLeftRailOpenChange, rightRailOpen: rightRailOpenProp, onRightRailOpenChange, openTools: openToolsProp, onOpenToolsChange, earlierHistoryOpen: earlierHistoryOpenProp, onEarlierHistoryOpenChange, initialPosition: initialPositionProp, activeTurn: activeTurnProp, onActiveTurnChange, search: searchProp, onSearchChange, filters: filtersProp, onFiltersChange, savedLabels: savedLabelsProp, onSavedLabelsChange, shareOpen: shareOpenProp, onShareOpenChange, moreOpen: moreOpenProp, onMoreOpenChange, breadcrumb, LinkComponent, renderTurnPanel, renderTurnActions, anchorHref, headerActions, streamPrelude, showTail, showOutcome, showSearchTrigger, pullRequests, }: TranscriptViewerProps): import("react").JSX.Element;
5
5
  export type TranscriptViewerProps = import("./state-capabilities.js").TranscriptViewerProps;
6
6
  export type TranscriptFilters = import("./state-capabilities.js").TranscriptFilters;
7
7
  export type TraceReadingSnapshot = {
@@ -218,6 +218,22 @@ export type TranscriptViewerProps = {
218
218
  * host controls or context rendered at the start of the list-mode transcript scroller; omitted in graph mode
219
219
  */
220
220
  streamPrelude?: unknown;
221
+ /**
222
+ * default true: render the composite's share and more menus after `headerActions`; false removes both so the host's own actions stand alone
223
+ */
224
+ showTail?: boolean;
225
+ /**
226
+ * default true: render the session outcome chip in the meta row when the session carries an outcome
227
+ */
228
+ showOutcome?: boolean;
229
+ /**
230
+ * default false: render a `search this transcript` button at the end of the tab strip that opens search exactly as ⌘F does; independent of `showTail`
231
+ */
232
+ showSearchTrigger?: boolean;
233
+ /**
234
+ * host-owned node rendered under the meta row (a pull request list and its own "show all" control); omitted renders nothing
235
+ */
236
+ pullRequests?: unknown;
221
237
  };
222
238
  /**
223
239
  * One breadcrumb segment. The last item renders as the current page (no link).