@peasant-labs/fairtrade 0.0.36 → 0.0.38

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.
@@ -5,11 +5,17 @@
5
5
  * @param {object} props
6
6
  * @param {string} props.command - the literal shell command (case preserved — never lowercased).
7
7
  * @param {string} [props.label] - an accessible name for the copy button; defaults to the command.
8
+ * @param {boolean} [props.wrap=false] - wrap a long command at spaces (and break a long URL anywhere)
9
+ * instead of scrolling it sideways. Copying is unaffected: the command is copied whole.
10
+ * @param {boolean} [props.compact=false] - an icon-only copy button (its name stays "copy <command>"),
11
+ * for a narrow column.
8
12
  * @param {string} [props.className] - extra classes appended to the root.
9
13
  */
10
- export function CommandBlock({ command, label, className, ...rest }: {
14
+ export function CommandBlock({ command, label, wrap, compact, className, ...rest }: {
11
15
  command: string;
12
16
  label?: string;
17
+ wrap?: boolean;
18
+ compact?: boolean;
13
19
  className?: string;
14
20
  }): import("react").JSX.Element;
15
21
  /**
@@ -108,16 +108,19 @@ export function CollectivePicker({ suggestions, onAdd, query: queryProp, onQuery
108
108
  * @param {string} props.title - the session title, kept in its case.
109
109
  * @param {'publish'|'update'} [props.mode='publish']
110
110
  * @param {PublishDialogState} props.state - one of PUBLISH_DIALOG_STATES.
111
- * @param {{ matches?: import('./Redaction.jsx').RedactionMatch[], matchCount?: number, total?: number, failure?: string }} [props.scan] - the host's scan result. `matchCount` is the full occurrence count when `matches` contains only examples. Until it carries a
111
+ * @param {{ matches?: import('./Redaction.jsx').RedactionMatch[], matchCount?: number, total?: number, failure?: string, failureDetail?: string, failureAction?: { label: string, onSelect: () => void, busy?: boolean } }} [props.scan] - the host's scan result. `failure` is one plain line; `failureAction` is a button in the failure box (the one action that fixes it); `failureDetail`, the actionable detail (what, why, where, the fix), shows as pre-wrapped mono text behind a "details" disclosure in the failure box. `matchCount` is the full occurrence count when `matches` contains only examples. Until it carries a
112
112
  * `matches` list, the popup says the transcript is not scanned and keeps publish off. A match with `kept: true` leaves un-redacted, and the
113
113
  * popup says so and opens the matches.
114
114
  * @param {() => void} [props.onRescan]
115
+ * @param {{ stage: string, note?: string, progress?: { done: number, total: number } }} [props.checking] - while state is
116
+ * 'checking': the step being done (replaces "checking for sensitive content"), a quiet note on why publish waits
117
+ * when a step runs long, and a determinate count ("120 of 468"). All of it sits in the status region.
115
118
  * @param {{ summary: string }} [props.changes] - update mode: what changed since the last publish.
116
119
  * @param {AccessItem[]} [props.access] - who can read it after this publish.
117
120
  * @param {(id: string) => void} [props.onRemove]
118
121
  * @param {(id: string) => void} [props.onRestore]
119
122
  * @param {object} [props.picker] - CollectivePicker props (suggestions, onAdd, query, onQueryChange).
120
- * @param {{ checked: boolean, onChange: (checked: boolean) => void, hint?: string }} [props.autoPublish] - hint replaces only the unchecked line; checked consent is always component-owned.
123
+ * @param {{ checked: boolean, onChange: (checked: boolean) => void, hint?: string }} [props.autoPublish] - hint is the unchecked line, shown only when given; checked consent is always component-owned.
121
124
  * @param {string} [props.accessSummary] - update mode: the access change in words ("adds ML Reading Group, removes nothing").
122
125
  * @param {string} [props.primaryLabel] - replaces the derived primary label.
123
126
  * @param {() => void} [props.onPublish]
@@ -128,7 +131,7 @@ export function CollectivePicker({ suggestions, onAdd, query: queryProp, onQuery
128
131
  * @param {() => void} [props.onRetry] - stopped-state actual publication retry; requires a valid review and audience. Mutually exclusive with onRecover.
129
132
  * @param {{ url: string, collectives: string[], pending?: string[], pullRequest?: { number: number, branch: string, href?: string } }} [props.done]
130
133
  */
131
- export function PublishDialog({ open, onClose, title, mode, state, scan, onRescan, changes, access, onRemove, onRestore, picker, autoPublish, accessSummary, primaryLabel, onPublish, onConnect, joinHref, stoppedAt, onRecover, onRetry, done, }: {
134
+ export function PublishDialog({ open, onClose, title, mode, state, scan, onRescan, checking, changes, access, onRemove, onRestore, picker, autoPublish, accessSummary, primaryLabel, onPublish, onConnect, joinHref, stoppedAt, onRecover, onRetry, done, }: {
132
135
  open: boolean;
133
136
  onClose: () => void;
134
137
  title: string;
@@ -139,8 +142,22 @@ export function PublishDialog({ open, onClose, title, mode, state, scan, onResca
139
142
  matchCount?: number;
140
143
  total?: number;
141
144
  failure?: string;
145
+ failureDetail?: string;
146
+ failureAction?: {
147
+ label: string;
148
+ onSelect: () => void;
149
+ busy?: boolean;
150
+ };
142
151
  };
143
152
  onRescan?: () => void;
153
+ checking?: {
154
+ stage: string;
155
+ note?: string;
156
+ progress?: {
157
+ done: number;
158
+ total: number;
159
+ };
160
+ };
144
161
  changes?: {
145
162
  summary: string;
146
163
  };
@@ -17,9 +17,11 @@ export function SettingStatus({ children }: {
17
17
  * @param {(next: boolean|string) => Promise<void>|void} props.onCommit - the one write; reject to fail.
18
18
  * @param {string} [props.tag] - a note on the row, shown on a Chip ("not in peasant config").
19
19
  * @param {boolean} [props.disabled]
20
+ * @param {boolean} [props.stack] - put the value under the label (at its left edge) instead of beside
21
+ * it. Defaults to on for a text value longer than one short line (a description).
20
22
  * @param {string} [props.className]
21
23
  */
22
- export function SettingRow({ label, help, control, value, options, onCommit, tag, disabled, className, ...rest }: {
24
+ export function SettingRow({ label, help, control, value, options, onCommit, tag, disabled, stack, className, ...rest }: {
23
25
  label: import("react").ReactNode;
24
26
  help?: import("react").ReactNode;
25
27
  control: "switch" | "select" | "checkbox" | "text";
@@ -32,6 +34,7 @@ export function SettingRow({ label, help, control, value, options, onCommit, tag
32
34
  onCommit: (next: boolean | string) => Promise<void> | void;
33
35
  tag?: string;
34
36
  disabled?: boolean;
37
+ stack?: boolean;
35
38
  className?: string;
36
39
  }): import("react").JSX.Element;
37
40
  /**
@@ -1,4 +1,4 @@
1
- /** Human-readable ms duration: "4.2s", "42s", "2m 14s", "1.5h". Tabular-friendly, no leading zeros. */
1
+ /** Human-readable ms duration in the one transcript format: "820ms", "4.2s", "2m 14s", "1h 12m"; zero or unknown reads as nothing. */
2
2
  export function formatDuration(ms: any): string;
3
3
  /**
4
4
  * @typedef {object} Task
@@ -13,8 +13,9 @@
13
13
  * @param {() => void} [props.onShare] the "share … conversations" exit (host owns share UX)
14
14
  * @param {() => void} [props.onCopyRecap] the "copy recap" exit (host owns the clipboard recap)
15
15
  * @param {Record<string, boolean>} [props.initialOpenFiles] files open on first render (path → open?)
16
+ * @param {import('react').ReactNode} [props.headerActions] the host's own controls for the head row, at the crumb's end (a docs link, say)
16
17
  */
17
- export default function ChangeDetail({ payload, getDiff, title, annotation, onSaveAnnotation, onRemoveAnnotation, onOpenMap, onShare, onCopyRecap, initialOpenFiles, }: {
18
+ export default function ChangeDetail({ payload, getDiff, title, annotation, onSaveAnnotation, onRemoveAnnotation, onOpenMap, onShare, onCopyRecap, initialOpenFiles, headerActions, }: {
18
19
  payload: import("./types.js").ChangeDetailPayload;
19
20
  getDiff?: (file: import("./types.js").FileChangePayload) => import("./types.js").ChangeDiffPayload | null | undefined;
20
21
  title?: string;
@@ -25,4 +26,5 @@ export default function ChangeDetail({ payload, getDiff, title, annotation, onSa
25
26
  onShare?: () => void;
26
27
  onCopyRecap?: () => void;
27
28
  initialOpenFiles?: Record<string, boolean>;
29
+ headerActions?: import("react").ReactNode;
28
30
  }): import("react").JSX.Element;
@@ -10,8 +10,9 @@
10
10
  * @param {() => void} [props.onShowOlder] deprecated legacy pagination callback; use onNavigate.
11
11
  * @param {(sessionId: string) => void} [props.onOpenSession] deprecated legacy session callback; use onNavigate.
12
12
  * @param {number} [props.nowMs] pins relative-time humanisation (default Date.now()); the harness fixes it for byte-stable captures
13
+ * @param {import('react').ReactNode} [props.headerActions] the host's own controls for the head row, beside "open the map" (a docs link, say)
13
14
  */
14
- export default function Changes({ payload, projectLabel, selectedId, onNavigate, onSelectChange, onOpenMap, hasMore, onShowOlder, onOpenSession, nowMs, }: {
15
+ export default function Changes({ payload, projectLabel, selectedId, onNavigate, onSelectChange, onOpenMap, hasMore, onShowOlder, onOpenSession, nowMs, headerActions, }: {
15
16
  payload: import("./types.js").ChangesPayload;
16
17
  projectLabel?: string;
17
18
  selectedId?: string;
@@ -22,4 +23,5 @@ export default function Changes({ payload, projectLabel, selectedId, onNavigate,
22
23
  onShowOlder?: () => void;
23
24
  onOpenSession?: (sessionId: string) => void;
24
25
  nowMs?: number;
26
+ headerActions?: import("react").ReactNode;
25
27
  }): import("react").JSX.Element;
@@ -1,3 +1,10 @@
1
+ /**
2
+ * Is this wire turn one of Claude Code's session metadata records rather than conversation?
3
+ * @param {TurnDetail} turn
4
+ * @param {string | undefined} harness the session's harness
5
+ * @returns {boolean}
6
+ */
7
+ export function isSessionMetadataTurn(turn: TurnDetail, harness: string | undefined): boolean;
1
8
  /**
2
9
  * Default turn prefilter the adapter applies independently per partition:
3
10
  * preserve normalized evidence, including unknown provenance and folded refs.
@@ -72,9 +72,9 @@ export type PhaseVM = import("./view-model.js").PhaseVM;
72
72
  export type ScorecardBandVM = import("./view-model.js").ScorecardBandVM;
73
73
  export type TranscriptAnalyticsVM = import("./view-model.js").TranscriptAnalyticsVM;
74
74
  export { ROLES, ENTRY_TYPES, TOOL_CALL_KINDS, STOP_REASONS, SESSION_OUTCOMES, HARNESSES } from "./wire-types.js";
75
- export { adaptTranscript, prefilterTurns, diffLines } from "./adapter.js";
75
+ export { adaptTranscript, prefilterTurns, isSessionMetadataTurn, diffLines } from "./adapter.js";
76
76
  export { computeTasks, computeTurnLabels, buildTaskWaterfall, annotateTranscript, computePersonalMedians, detectPhases, assessScorecard, computeAnalytics, computeTaskGroups, phaseLabel } from "./analytics.js";
77
- export { formatRelative, formatDurationMins, formatDateLong } from "./time.js";
77
+ export { formatRelative, formatDurationMins, formatDurationMs, formatDurationSeconds, formatDateLong, isKnownTime } from "./time.js";
78
78
  export { summarizePrompt, composeSessionTitle, projectLabel } from "./title.js";
79
79
  export { default as TranscriptDiffEntryCard, DiffHunks as TranscriptDiffHunks } from "./DiffEntryCard.jsx";
80
80
  export { advanceTranscriptInitialPositionConsumption, normalizeTranscriptInitialPosition, resolveTranscriptInitialPosition, shouldApplyTranscriptInitialPosition, transcriptInitialPositionReadiness, transcriptInitialPositionToken } from "./initial-position.js";
@@ -1,5 +1,14 @@
1
1
  /**
2
- * Human-readable relative time: "3m ago", "2h ago", "4d ago", "Jan 12".
2
+ * Is this a real recorded time? A missing, unparseable, zero, epoch or Go zero-time value
3
+ * ("0001-01-01T00:00:00Z") is unknown: nothing may render it, and no "ago" math runs on it.
4
+ *
5
+ * @param {string | null | undefined} iso
6
+ * @returns {boolean}
7
+ */
8
+ export function isKnownTime(iso: string | null | undefined): boolean;
9
+ /**
10
+ * Human-readable relative time: "just now", "3m ago", "2h ago", "4d ago"; past a week it reads as
11
+ * a date ("oct 14", or "oct 14, 2025" in another year). An unknown time reads as nothing.
3
12
  *
4
13
  * @param {string} iso an ISO 8601 timestamp
5
14
  * @param {number} [now] reference "now" in epoch millis (defaults to `Date.now()`; pass explicitly for deterministic tests)
@@ -7,12 +16,28 @@
7
16
  */
8
17
  export function formatRelative(iso: string, now?: number): string;
9
18
  /**
10
- * A duration expressed in minutes → "1h 16m" / "9m" / "42s".
19
+ * The one duration format: human and short. "12s", "4m 30s", "4m", "1h 12m", "1h"; under a
20
+ * second "<1s"; zero, negative or unknown reads as nothing, so a caller hides the figure.
21
+ *
22
+ * @param {number | null | undefined} seconds
23
+ * @returns {string}
24
+ */
25
+ export function formatDurationSeconds(seconds: number | null | undefined): string;
26
+ /**
27
+ * A duration in minutes, in the one format: 4.5 -> "4m 30s", 76 -> "1h 16m", 0 -> "".
28
+ *
29
+ * @param {number | null | undefined} mins
30
+ * @returns {string}
31
+ */
32
+ export function formatDurationMins(mins: number | null | undefined): string;
33
+ /**
34
+ * A duration in milliseconds: a tool call reads "820ms" or "1.4s" while short, then the one
35
+ * format ("1m 15s"); zero or unknown reads as nothing.
11
36
  *
12
- * @param {number | undefined} mins
37
+ * @param {number | null | undefined} ms
13
38
  * @returns {string}
14
39
  */
15
- export function formatDurationMins(mins: number | undefined): string;
40
+ export function formatDurationMs(ms: number | null | undefined): string;
16
41
  /**
17
42
  * "Jan 12, 4:23 PM" — long datetime for tooltips.
18
43
  *