@peasant-labs/fairtrade 0.0.47 → 0.0.48

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/share.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { _ as e, c as t, g as n, h as r, m as i, p as a, v as o } from "./time-CpVBzcqQ.js";
2
2
  import { r as s } from "./format-B3uT2wzU.js";
3
- import { c, l, t as u } from "./adapter-Dulh38C2.js";
3
+ import { c, l, t as u } from "./adapter-DnCl_ddK.js";
4
4
  import { jsx as d, jsxs as f } from "react/jsx-runtime";
5
5
  //#region public/tokens.json
6
6
  var p = {
@@ -0,0 +1,10 @@
1
+ export default function Collapsible({ open, children, className, id, keepMounted, animateSize, as: Tag, "aria-label": ariaLabel }: {
2
+ open: any;
3
+ children: any;
4
+ className?: string;
5
+ id: any;
6
+ keepMounted?: boolean;
7
+ animateSize?: boolean;
8
+ as?: string;
9
+ "aria-label": any;
10
+ }): import("react").JSX.Element;
@@ -6,6 +6,7 @@ export default function FiltersRail({ tab, filters, onFiltersChange, counts, che
6
6
  responses: boolean;
7
7
  thinking: boolean;
8
8
  toolcalls: boolean;
9
+ system: boolean;
9
10
  };
10
11
  toolGroups: {};
11
12
  tags: {
@@ -3,7 +3,7 @@
3
3
  * @param {object} props
4
4
  * @param {ThinkingVM} [props.block] cooked thinking (e.g. `TurnVM.thinking`)
5
5
  */
6
- export default function Thinking({ block }: {
6
+ export default function Thinking({ block, actionRef, revealRequest }: {
7
7
  block?: ThinkingVM;
8
8
  }): import("react").JSX.Element;
9
9
  export type ThinkingVM = import("./view-model.js").ThinkingVM;
@@ -4,7 +4,7 @@
4
4
  * @param {boolean} [props.open]
5
5
  * @param {() => void} [props.onToggle]
6
6
  */
7
- export default function ToolCall({ tool, open, onToggle, showChevron }: {
7
+ export default function ToolCall({ tool, open, onToggle, showChevron, actionRef }: {
8
8
  tool?: ToolCallVM;
9
9
  open?: boolean;
10
10
  onToggle?: () => void;
@@ -2,7 +2,7 @@
2
2
  * @param {TranscriptViewerProps} props
3
3
  */
4
4
  export default function TranscriptViewer({ viewModel, capabilities, callbacks, theme: themeProp, onThemeChange, graphSlot, activeTab: activeTabProp, onTabChange, viewMode: viewModeProp, onViewModeChange, sidebarLayout: sidebarLayoutProp, onSidebarLayoutChange, zen: zenProp, onZenChange, readerWidth: readerWidthProp, onReaderWidthChange, 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, footer, presentation, subtitle, pullRequests, headingLevel, }: TranscriptViewerProps): import("react").JSX.Element;
5
- export const READER_SNAPS: readonly number[];
5
+ export const READER_FULL: "full";
6
6
  export type TranscriptViewerProps = import("./state-capabilities.js").TranscriptViewerProps;
7
7
  export type TranscriptFilters = import("./state-capabilities.js").TranscriptFilters;
8
8
  export type TraceReadingSnapshot = {
@@ -2,6 +2,7 @@
2
2
  * @param {object} props
3
3
  * @param {TurnVM} [props.turn]
4
4
  * @param {boolean} [props.active]
5
+ * @param {(turnIndex: number) => void} [props.onSelect] select the prose card without scrolling
5
6
  * @param {Record<string, boolean>} [props.openTools] tool id → open?
6
7
  * @param {(id: string) => void} [props.toggleTool]
7
8
  * @param {(turnIndex: number) => void} [props.onCopyAnchor]
@@ -24,9 +25,10 @@
24
25
  * `renderActions` and `renderTurnPanel` keep rendering on every role, so a host extension is never
25
26
  * dropped by the presentation switch.
26
27
  */
27
- export default function TurnCard({ turn, active, openTools, toggleTool, onCopyAnchor, copied, registerRef, onLabel, renderActions, savedLabel, compact, expandAll, revealRequest, headingLevel, presentation, }: {
28
+ export default function TurnCard({ turn, active, onSelect, openTools, toggleTool, onCopyAnchor, copied, registerRef, onLabel, renderActions, savedLabel, compact, expandAll, revealRequest, headingLevel, modelActions, actionReveal, registerActionRef, suppressWork, presentation, }: {
28
29
  turn?: TurnVM;
29
30
  active?: boolean;
31
+ onSelect?: (turnIndex: number) => void;
30
32
  openTools?: Record<string, boolean>;
31
33
  toggleTool?: (id: string) => void;
32
34
  onCopyAnchor?: (turnIndex: number) => void;
@@ -12,4 +12,13 @@ export default function TranscriptWorkGroup({ tools, thinking, openTools, onTogg
12
12
  onToggle?: (id: string) => void;
13
13
  expandAll?: boolean;
14
14
  }): import("react").JSX.Element;
15
+ export function ModelActions({ turns, openTools, onToggle, expandAll, compact, reveal, registerActionRef }: {
16
+ turns?: any[];
17
+ openTools?: {};
18
+ onToggle?: () => void;
19
+ expandAll?: boolean;
20
+ compact?: boolean;
21
+ reveal: any;
22
+ registerActionRef?: () => void;
23
+ }): import("react").JSX.Element;
15
24
  export type ToolCallVM = import("./view-model.js").ToolCallVM;
@@ -0,0 +1,9 @@
1
+ /** Stable source user boundaries, followed by visibility projection. No hidden part is restored.
2
+ * @param {import('./view-model.js').TurnVM[]} turns
3
+ * @param {import('./view-model.js').TurnVM[]} visibleTurns
4
+ */
5
+ export function actionGroups(turns: import("./view-model.js").TurnVM[], visibleTurns: import("./view-model.js").TurnVM[]): {
6
+ groups: Map<any, any>;
7
+ folded: Set<any>;
8
+ locations: Map<any, any>;
9
+ };
@@ -1,3 +1,15 @@
1
+ /**
2
+ * The time a standalone thinking entry took. A harness records a thinking entry when the thinking
3
+ * ends, so it is the gap from the end of the event before it: the previous turn at the same depth,
4
+ * plus the tools that turn ran, whose results come back after it. The wire records each tool's
5
+ * duration but not when it started, so the tools' durations are summed: when they ran in parallel
6
+ * this undercounts the thinking or leaves it out, and never reports more time than it took.
7
+ * Undefined when either time is unknown or the gap is not positive.
8
+ * @param {TurnDetail | undefined} previous
9
+ * @param {TurnDetail} turn
10
+ * @returns {number | undefined}
11
+ */
12
+ export function thinkingDurationMs(previous: TurnDetail | undefined, turn: TurnDetail): number | undefined;
1
13
  /**
2
14
  * Is this wire turn one of Claude Code's session metadata records rather than conversation?
3
15
  * @param {TurnDetail} turn
@@ -1,10 +1,10 @@
1
1
  /** @typedef {import('./view-model.js').TurnVM} TurnVM */
2
2
  /** @typedef {import('./view-model.js').ToolGroup} ToolGroup */
3
3
  /** @typedef {import('./state-capabilities.js').TranscriptFilters} TranscriptFilters */
4
- /** @typedef {'prompts' | 'responses' | 'thinking' | 'toolcalls'} Category */
4
+ /** @typedef {'prompts' | 'responses' | 'thinking' | 'toolcalls' | 'system'} Category */
5
5
  /**
6
6
  * Every part kind a cooked turn carries, in rail order. Empty for turns no
7
- * category governs (system notices). A turn with text and tool calls reports
7
+ * category governs. A turn with text and tool calls reports
8
8
  * both; the rail badges count turns per kind from this.
9
9
  *
10
10
  * @param {TurnVM} turn
@@ -31,8 +31,8 @@ export function passesTags(turn: TurnVM, tags: {
31
31
  * The per-turn projection: the turn with every hidden part removed, or `null`
32
32
  * when nothing would be left to render. Tags narrow at the turn level, the
33
33
  * checkpoint anchor scopes to a prefix, and then each part is kept or dropped
34
- * by its own category (tool calls also by their group). System turns carry no
35
- * governed parts and pass the category stage untouched.
34
+ * by its own category (tool calls also by their group). System turns are governed
35
+ * by their own category, enabled unless explicitly false.
36
36
  *
37
37
  * The returned object keeps `index`, `role`, labels and annotations, so
38
38
  * anchors, jumps and the outline resolve against it exactly as against the
@@ -124,4 +124,4 @@ export function setToolCalls(filters: TranscriptFilters, next: boolean): Transcr
124
124
  export type TurnVM = import("./view-model.js").TurnVM;
125
125
  export type ToolGroup = import("./view-model.js").ToolGroup;
126
126
  export type TranscriptFilters = import("./state-capabilities.js").TranscriptFilters;
127
- export type Category = "prompts" | "responses" | "thinking" | "toolcalls";
127
+ export type Category = "prompts" | "responses" | "thinking" | "toolcalls" | "system";
@@ -82,5 +82,5 @@ export { computeTasks, computeTurnLabels, buildTaskWaterfall, annotateTranscript
82
82
  export { formatRelative, formatDurationMins, formatDurationMs, formatDurationSeconds, formatDateLong, isKnownTime } from "./time.js";
83
83
  export { summarizePrompt, composeSessionTitle, projectLabel, cleanSessionTitle, unwrapUserQuery } from "./title.js";
84
84
  export { default as TranscriptDiffEntryCard, DiffHunks as TranscriptDiffHunks } from "./DiffEntryCard.jsx";
85
- export { default as TranscriptViewer, READER_SNAPS } from "./TranscriptViewer.jsx";
85
+ export { default as TranscriptViewer, READER_FULL } from "./TranscriptViewer.jsx";
86
86
  export { advanceTranscriptInitialPositionConsumption, normalizeTranscriptInitialPosition, resolveTranscriptInitialPosition, shouldApplyTranscriptInitialPosition, transcriptInitialPositionReadiness, transcriptInitialPositionToken } from "./initial-position.js";
@@ -55,11 +55,15 @@ export type TranscriptSidebarLayout = {
55
55
  * scopes the trace to a commit (`'all'` = unscoped).
56
56
  */
57
57
  export type TranscriptFilters = {
58
+ /**
59
+ * system defaults to true when absent from saved or host-controlled state
60
+ */
58
61
  categories: {
59
62
  prompts: boolean;
60
63
  responses: boolean;
61
64
  thinking: boolean;
62
65
  toolcalls: boolean;
66
+ system?: boolean;
63
67
  };
64
68
  toolGroups: Partial<Record<import("./view-model.js").ToolGroup, boolean>>;
65
69
  tags: {
@@ -191,10 +195,13 @@ export type TranscriptViewerProps = {
191
195
  zen?: boolean;
192
196
  onZenChange?: (zen: boolean) => void;
193
197
  /**
194
- * ledger only: the reader column width in CSS pixels. A supplied value is normalised at the boundary (clamped to 600..936 and snapped to the nearest of the exported `READER_SNAPS`), so the column and `aria-valuenow` always report a supported width; defaults 840
198
+ * ledger only: the reader column width in CSS pixels, or `'full'` (exported as `READER_FULL`), the stream's whole measured content width, which follows the space as it changes. There are no snaps: a supplied number renders clamped to 600..full, so the column and `aria-valuenow` always report a width the column can draw; defaults 840
199
+ */
200
+ readerWidth?: number | "full";
201
+ /**
202
+ * a drag or a key reports pixel widths, and `'full'` once the column reaches the end
195
203
  */
196
- readerWidth?: number;
197
- onReaderWidthChange?: (width: number) => void;
204
+ onReaderWidthChange?: (width: number | "full") => void;
198
205
  /**
199
206
  * alias for `sidebarLayout.outline`; when supplied it wins for that rail and still calls `onLeftRailOpenChange`
200
207
  */
@@ -285,6 +285,11 @@ export type ThinkingVM = {
285
285
  * precomputed word count for the toggle badge
286
286
  */
287
287
  words?: number;
288
+ /**
289
+ * time spent thinking, derived from the turn timestamps
290
+ * (absent when it cannot be derived)
291
+ */
292
+ durationMs?: number;
288
293
  };
289
294
  /**
290
295
  * One cooked turn. `toolCalls` here are the same `ToolCallVM` objects indexed in
@@ -11,6 +11,14 @@ export function workSummary(tools?: ToolCallVM[]): WorkSummary;
11
11
  * @returns {string}
12
12
  */
13
13
  export function workCountLabel(summary?: Partial<WorkSummary>): string;
14
+ /**
15
+ * The ledger action block's header: "6 actions: 4 commands, 3 files, 1 edit, 29s". It counts the
16
+ * block's tool runs as actions, then the counted parts and the recorded duration; zero parts and
17
+ * an unrecorded duration are left out, so a block of searches reads "2 actions, 1.2s".
18
+ * @param {Partial<WorkSummary>} [summary]
19
+ * @returns {string}
20
+ */
21
+ export function workActionsLabel(summary?: Partial<WorkSummary>): string;
14
22
  /**
15
23
  * The panel's trailing meta: "8 calls, 1 failed, 29s". The failure count is omitted when zero and
16
24
  * the duration is omitted when nothing was recorded. The leading call count is omitted when the
@@ -1,3 +1,15 @@
1
+ /**
2
+ * The time a standalone thinking entry took. A harness records a thinking entry when the thinking
3
+ * ends, so it is the gap from the end of the event before it: the previous turn at the same depth,
4
+ * plus the tools that turn ran, whose results come back after it. The wire records each tool's
5
+ * duration but not when it started, so the tools' durations are summed: when they ran in parallel
6
+ * this undercounts the thinking or leaves it out, and never reports more time than it took.
7
+ * Undefined when either time is unknown or the gap is not positive.
8
+ * @param {TurnDetail | undefined} previous
9
+ * @param {TurnDetail} turn
10
+ * @returns {number | undefined}
11
+ */
12
+ export function thinkingDurationMs(previous: TurnDetail | undefined, turn: TurnDetail): number | undefined;
1
13
  /**
2
14
  * Is this wire turn one of Claude Code's session metadata records rather than conversation?
3
15
  * @param {TurnDetail} turn
@@ -285,6 +285,11 @@ export type ThinkingVM = {
285
285
  * precomputed word count for the toggle badge
286
286
  */
287
287
  words?: number;
288
+ /**
289
+ * time spent thinking, derived from the turn timestamps
290
+ * (absent when it cannot be derived)
291
+ */
292
+ durationMs?: number;
288
293
  };
289
294
  /**
290
295
  * One cooked turn. `toolCalls` here are the same `ToolCallVM` objects indexed in