@peasant-labs/fairtrade 0.0.49 → 0.0.51

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-CVKibszh.js";
3
+ import { c, l, t as u } from "./adapter-VlAohr64.js";
4
4
  import { jsx as d, jsxs as f } from "react/jsx-runtime";
5
5
  //#region public/tokens.json
6
6
  var p = {
@@ -1,10 +1,11 @@
1
- export default function Collapsible({ open, children, className, id, keepMounted, animateSize, as: Tag, "aria-label": ariaLabel }: {
1
+ export default function Collapsible({ open, children, className, id, keepMounted, animateSize, startOnFrame, as: Tag, "aria-label": ariaLabel }: {
2
2
  open: any;
3
3
  children: any;
4
4
  className?: string;
5
5
  id: any;
6
6
  keepMounted?: boolean;
7
7
  animateSize?: boolean;
8
+ startOnFrame?: boolean;
8
9
  as?: string;
9
10
  "aria-label": any;
10
11
  }): import("react").JSX.Element;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @param {object} props
3
+ * @param {number} [props.headingLevel=2] the panel heading's level, one under the viewer title
4
+ * @param {boolean} [props.folded=false] the host has folded the badge out of view; an open panel closes
5
+ */
6
+ export default function IntegrityBadge({ headingLevel, folded }: {
7
+ headingLevel?: number;
8
+ folded?: boolean;
9
+ }): import("react").JSX.Element;
10
+ /**
11
+ * The flagged-turn mark: the warning glyph and a word. On a turn head or a system row the heading
12
+ * carries the accessible name, so the mark is `aria-hidden`; in a work group, which has no heading
13
+ * of its own, it stays readable.
14
+ * @param {object} props
15
+ * @param {string} [props.text] the word beside the glyph
16
+ * @param {boolean} [props.decorative=true] hide the whole mark from assistive technology
17
+ */
18
+ export function IntegrityMark({ text, decorative }: {
19
+ text?: string;
20
+ decorative?: boolean;
21
+ }): import("react").JSX.Element;
@@ -13,3 +13,4 @@ export default function Markdown({ text, source }: {
13
13
  text?: string;
14
14
  source?: string;
15
15
  }): import("react").JSX.Element;
16
+ export const MemoMarkdown: import("react").MemoExoticComponent<typeof Markdown>;
@@ -0,0 +1,7 @@
1
+ export default function SearchHighlights({ scrollRef, query, enabled, revision, selected }: {
2
+ scrollRef: any;
3
+ query: any;
4
+ enabled: any;
5
+ revision: any;
6
+ selected: any;
7
+ }): any;
@@ -5,4 +5,5 @@
5
5
  export default function ToolBody({ tool }: {
6
6
  tool?: ToolCallVM;
7
7
  }): import("react").JSX.Element;
8
+ export const MemoToolBody: import("react").MemoExoticComponent<typeof ToolBody>;
8
9
  export type ToolCallVM = import("./view-model.js").ToolCallVM;
@@ -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, 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, breadcrumbContext, beforeHeader, LinkComponent, renderTurnPanel, renderTurnActions, anchorHref, headerActions, utilityActions, streamPrelude, showTail, showOutcome, showSearchTrigger, footer, presentation, subtitle, pullRequests, headingLevel, }: TranscriptViewerProps): import("react").JSX.Element;
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, breadcrumbContext, beforeHeader, LinkComponent, renderTurnPanel, renderTurnActions, anchorHref, headerActions, utilityActions, streamPrelude, showTail, showOutcome, showSearchTrigger, footer, presentation, subtitle, pullRequests, headingLevel, integrity, transcriptContentHash, contentHash, }: TranscriptViewerProps): import("react").JSX.Element;
5
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;
@@ -16,6 +16,10 @@
16
16
  * @param {number} [props.revealRequest] explicit search navigation sequence
17
17
  * @param {number} [props.headingLevel=4] the turn heading's level: h4 under a viewer whose title is an h2, h3 under one
18
18
  * whose title is the page's h1
19
+ * @param {boolean} [props.flagged=false] the integrity check marked this turn: the article takes `is-flagged`, the
20
+ * heading gains a hidden suffix naming the flag, and a visible mark shows in the head (or the system row's
21
+ * trailing cluster, or the start of a ledger detail turn's work block)
22
+ * @param {ReadonlySet<number>} [props.flaggedPositions] source positions marked in a work group this card renders
19
23
  * @param {'classic' | 'ledger'} [props.presentation='classic'] chrome presentation. `ledger` leads with a
20
24
  * square role well and the role word, groups the turn's tool calls into one work panel, and renders a
21
25
  * system turn as a compact row; absent, the classic card renders exactly as before. In ledger the head
@@ -25,7 +29,7 @@
25
29
  * `renderActions` and `renderTurnPanel` keep rendering on every role, so a host extension is never
26
30
  * dropped by the presentation switch.
27
31
  */
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, }: {
32
+ export default function TurnCard({ turn, active, onSelect, openTools, toggleTool, onCopyAnchor, copied, registerRef, onLabel, renderActions, savedLabel, compact, expandAll, revealRequest, headingLevel, modelActions, actionReveal, registerActionRef, suppressWork, presentation, flagged, flaggedPositions, }: {
29
33
  turn?: TurnVM;
30
34
  active?: boolean;
31
35
  onSelect?: (turnIndex: number) => void;
@@ -44,6 +48,8 @@ export default function TurnCard({ turn, active, onSelect, openTools, toggleTool
44
48
  expandAll?: boolean;
45
49
  revealRequest?: number;
46
50
  headingLevel?: number;
51
+ flagged?: boolean;
52
+ flaggedPositions?: ReadonlySet<number>;
47
53
  presentation?: "classic" | "ledger";
48
54
  }): import("react").JSX.Element;
49
55
  export type TurnVM = import("./view-model.js").TurnVM;
@@ -12,12 +12,14 @@ 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 }: {
15
+ export function ModelActions({ turns, openTools, onToggle, expandAll, compact, flaggedPositions, cardTurn, reveal, registerActionRef }: {
16
16
  turns?: any[];
17
17
  openTools?: {};
18
18
  onToggle?: () => void;
19
19
  expandAll?: boolean;
20
20
  compact?: boolean;
21
+ flaggedPositions: any;
22
+ cardTurn: any;
21
23
  reveal: any;
22
24
  registerActionRef?: () => void;
23
25
  }): import("react").JSX.Element;
@@ -0,0 +1,36 @@
1
+ /**
2
+ * @param {unknown} integrity the served integrity value; its presence is the flag
3
+ * @param {unknown} transcriptContentHash the detail response's transcript content hash
4
+ * @param {unknown} contentHash the hash of the rendered content, when the host has one
5
+ * @returns {{ positions: ReadonlySet<number> } | null} null draws nothing; otherwise the badge
6
+ * draws, and positions are marked only when both hashes are non-empty and equal
7
+ */
8
+ export function integrityView(integrity: unknown, transcriptContentHash: unknown, contentHash: unknown): {
9
+ positions: ReadonlySet<number>;
10
+ } | null;
11
+ /**
12
+ * Pure view of a transcript's served integrity flag. The host passes the served value as it
13
+ * arrived, the detail response's content hash, and the content hash of the rendered content.
14
+ * Nothing here knows how the flag was decided.
15
+ */
16
+ /** @typedef {import('@peasant-labs/schema').VillageTranscriptIntegrity} VillageTranscriptIntegrity */
17
+ /**
18
+ * Every string the integrity badge, its help panel and the flagged-turn mark show. This object is
19
+ * the single place to edit that wording: change a value here and every surface follows. The tests
20
+ * read the strings from this object rather than repeating them, so a reworded value needs no test
21
+ * edit. They do guard that the key set stays the same, that no value names a rule, a field or the
22
+ * service behind the check, and that no value uses an em dash or a middle dot. The badge's
23
+ * accessible name (helpName) must contain its visible label (badgeLabel).
24
+ */
25
+ export const INTEGRITY_COPY: Readonly<{
26
+ badgeLabel: "suspicious transcript";
27
+ helpName: "what does suspicious transcript mean?";
28
+ panelHeading: "about this flag";
29
+ panelBody: "This transcript has likely been edited after it was recorded, according to our automated detection systems.";
30
+ panelOtherTools: "Custom tools, plugins or hooks used during the session can create false positives.";
31
+ statusText: "This transcript has been flagged by an automated check and was likely modified after initially recorded.";
32
+ turnMark: "flagged";
33
+ turnName: ", flagged by an automated check";
34
+ groupMark: "includes a flagged turn";
35
+ }>;
36
+ export type VillageTranscriptIntegrity = import("@peasant-labs/schema").VillageTranscriptIntegrity;
@@ -0,0 +1,2 @@
1
+ export function searchExpression(query: any): RegExp;
2
+ export function renderedSearchRanges(root: any, query: any): any[];
@@ -323,6 +323,18 @@ export type TranscriptViewerBaseProps = {
323
323
  * host-owned node rendered under the meta row (a pull request list and its own "show all" control); omitted renders nothing
324
324
  */
325
325
  pullRequests?: unknown;
326
+ /**
327
+ * the served integrity value, passed through untouched. Present and well formed means flagged: the header shows the badge in every presentation and width. Absent, null or malformed renders nothing
328
+ */
329
+ integrity?: import("@peasant-labs/schema").VillageTranscriptIntegrity | null;
330
+ /**
331
+ * the detail response's `transcript.content_hash`, the content `integrity.flagged_turns` refer to
332
+ */
333
+ transcriptContentHash?: string | null;
334
+ /**
335
+ * the bare hash of the content `viewModel` was cooked from (the content route's `Village-Content-Hash` header). Turns are marked only when it equals `transcriptContentHash` and both are non-empty
336
+ */
337
+ contentHash?: string | null;
326
338
  };
327
339
  /**
328
340
  * The full legacy trail and the ancestor-only context are alternative contracts.
@@ -311,6 +311,10 @@ export type TurnVM = {
311
311
  * whether this index is unambiguous in its partition
312
312
  */
313
313
  sourceIndexUnique?: boolean;
314
+ /**
315
+ * position in payload.turns, the value VillageTranscriptIntegrity.flagged_turns refers to; main turns only
316
+ */
317
+ sourcePosition?: number;
314
318
  /**
315
319
  * partition-scoped stable rendering key
316
320
  */
@@ -1,3 +1,12 @@
1
+ /**
2
+ * True when a turn has words of its own, so it draws a card (a turn that is only work is inline detail).
3
+ * @param {{ displayContent?: unknown, content?: unknown } | null | undefined} turn
4
+ * @returns {boolean}
5
+ */
6
+ export function turnHasProse(turn: {
7
+ displayContent?: unknown;
8
+ content?: unknown;
9
+ } | null | undefined): boolean;
1
10
  /**
2
11
  * Summarize one turn's tool calls.
3
12
  * @param {ToolCallVM[]} [tools]
@@ -311,6 +311,10 @@ export type TurnVM = {
311
311
  * whether this index is unambiguous in its partition
312
312
  */
313
313
  sourceIndexUnique?: boolean;
314
+ /**
315
+ * position in payload.turns, the value VillageTranscriptIntegrity.flagged_turns refers to; main turns only
316
+ */
317
+ sourcePosition?: number;
314
318
  /**
315
319
  * partition-scoped stable rendering key
316
320
  */