@kontourai/survey 0.4.6 → 0.4.8

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,71 @@
1
+ import { type ReviewQueueSessionState, type ReviewWorkbenchDecision, type ReviewWorkbenchState } from "./review-queue-session.js";
2
+ import { type ReviewCandidate, type ReviewDecision, type ReviewSession, type ReviewSessionEvent } from "../review-resource.js";
3
+ export { buildReviewSessionEvents, buildReviewSessionEvent, buildReviewSessionResource, candidateForDecision, currentReviewItem, currentReviewWorkbenchState, defaultReviewSessionName, deriveQueueRowStatus, initialReviewQueueSessionState, initialReviewWorkbenchState, nextUnresolvedItemName, replayReviewSessionEvents, reviewSessionSummary, reviewWorkbenchSessionStorageKey, selectedCandidateRole, workbenchDecisionDefinitions, type ReviewQueueRowStatus, type ReviewQueueSessionState, type ReviewSessionSummary, type ReviewWorkbenchDecision, type ReviewWorkbenchState, } from "./review-queue-session.js";
4
+ export { buildSurfaceProjectionPreview, type PreviewAuthorityTrace, type PreviewCandidateHistory, type PreviewClaim, type PreviewIntegrityPosture, type PreviewReviewEvent, type PreviewSourceAuthority, type PreviewSourceEvidence, type SurfaceProjectionPreview, } from "./review-surface-preview.js";
5
+ export declare function buildReviewDecision(state: ReviewWorkbenchState): ReviewDecision | undefined;
6
+ export interface ReviewWorkbenchSessionExport {
7
+ readonly session: ReviewSession;
8
+ readonly events: readonly ReviewSessionEvent[];
9
+ readonly decisions: readonly ReviewDecision[];
10
+ readonly results: readonly ReviewWorkbenchResult[];
11
+ }
12
+ export interface ReviewSessionEventStore {
13
+ load(session: ReviewQueueSessionState): readonly ReviewSessionEvent[] | undefined;
14
+ save(session: ReviewQueueSessionState, events: readonly ReviewSessionEvent[]): void;
15
+ }
16
+ export type ReviewSessionPersistenceStatus = "idle" | "saving" | "saved" | "error";
17
+ export interface ReviewSessionPersistenceState {
18
+ readonly status: ReviewSessionPersistenceStatus;
19
+ readonly events: readonly ReviewSessionEvent[];
20
+ readonly error?: unknown;
21
+ }
22
+ export interface ReviewSessionPersistenceRequest {
23
+ readonly session: ReviewQueueSessionState;
24
+ readonly events: readonly ReviewSessionEvent[];
25
+ readonly expectedEventCount: number;
26
+ }
27
+ export interface ReviewSessionPersistenceResult {
28
+ readonly eventCount?: number;
29
+ }
30
+ export interface PersistentReviewSessionEventStoreOptions {
31
+ readonly initialEvents?: readonly ReviewSessionEvent[];
32
+ readonly persist: (request: ReviewSessionPersistenceRequest) => Promise<ReviewSessionPersistenceResult | void>;
33
+ readonly onStatusChange?: (state: ReviewSessionPersistenceState) => void;
34
+ }
35
+ export interface MountReviewWorkbenchOptions {
36
+ readonly eventStore?: ReviewSessionEventStore;
37
+ }
38
+ export interface BrowserReviewWorkbenchConfig {
39
+ readonly startState?: ReviewQueueSessionState | ReviewWorkbenchState;
40
+ }
41
+ export interface ReviewWorkbenchResult {
42
+ readonly reviewItemName: string;
43
+ readonly decision: ReviewWorkbenchDecision;
44
+ readonly selectedCandidate: ReviewCandidate;
45
+ readonly selectedCandidateId: string;
46
+ readonly selectedCandidateRole?: ReviewCandidate["role"];
47
+ readonly selectedValue: unknown;
48
+ readonly selectedDisplayValue: string;
49
+ readonly unselectedCandidates: readonly ReviewCandidate[];
50
+ readonly reviewDecision: ReviewDecision;
51
+ readonly status: ReviewDecision["spec"]["status"];
52
+ readonly rationale?: string;
53
+ }
54
+ export declare function buildReviewDecisionsFromSession(session: ReviewQueueSessionState): ReviewDecision[];
55
+ export declare function buildReviewWorkbenchResultsFromSession(session: ReviewQueueSessionState): ReviewWorkbenchResult[];
56
+ export declare function buildReviewWorkbenchSessionExport(session: ReviewQueueSessionState, events?: readonly ReviewSessionEvent[]): ReviewWorkbenchSessionExport;
57
+ export declare function createInMemoryReviewSessionEventStore(initialEvents?: readonly ReviewSessionEvent[]): ReviewSessionEventStore & {
58
+ events(): readonly ReviewSessionEvent[];
59
+ };
60
+ export declare function createLocalStorageReviewSessionEventStore(storage: Pick<Storage, "getItem" | "setItem">, keyPrefix?: string): ReviewSessionEventStore;
61
+ export declare function createPersistentReviewSessionEventStore(options: PersistentReviewSessionEventStoreOptions): ReviewSessionEventStore & {
62
+ events(): readonly ReviewSessionEvent[];
63
+ };
64
+ export declare function renderReviewWorkbenchHtml(state: ReviewWorkbenchState | ReviewQueueSessionState, events?: readonly ReviewSessionEvent[]): string;
65
+ export declare function mountReviewWorkbench(root: HTMLElement, startState?: ReviewQueueSessionState | ReviewWorkbenchState, options?: MountReviewWorkbenchOptions): void;
66
+ export declare function browserReviewWorkbenchStartState(): ReviewQueueSessionState | ReviewWorkbenchState | undefined;
67
+ declare global {
68
+ interface Window {
69
+ kontourSurveyReviewWorkbench?: BrowserReviewWorkbenchConfig | ReviewQueueSessionState | ReviewWorkbenchState;
70
+ }
71
+ }