@peasant-labs/fairtrade 0.0.50 → 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/{adapter-CVKibszh.js → adapter-VlAohr64.js} +107 -102
- package/dist/lib/commons.js +1 -1
- package/dist/lib/components.css +1 -1
- package/dist/lib/share.js +1 -1
- package/dist/lib/types/transcript/IntegrityBadge.d.ts +21 -0
- package/dist/lib/types/transcript/TranscriptViewer.d.ts +1 -1
- package/dist/lib/types/transcript/TurnCard.d.ts +7 -1
- package/dist/lib/types/transcript/WorkGroup.d.ts +3 -1
- package/dist/lib/types/transcript/integrity.d.ts +36 -0
- package/dist/lib/types/transcript/state-capabilities.d.ts +12 -0
- package/dist/lib/types/transcript/view-model.d.ts +4 -0
- package/dist/lib/types/transcript/work-summary.d.ts +9 -0
- package/dist/lib/types/ui/transcript/view-model.d.ts +4 -0
- package/dist/lib/{ui-BOGaFxV-.js → ui-Do7A_I-0.js} +2409 -2217
- package/dist/lib/ui.js +2 -2
- package/package.json +8 -4
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-
|
|
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 = {
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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
|
*/
|