@kontourai/survey 1.11.0 → 1.13.0

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.
@@ -1,7 +1,7 @@
1
1
  import { type ReviewQueueSessionState, type ReviewWorkbenchDecision, type ReviewWorkbenchState } from "./review-queue-session.js";
2
2
  import { type ReviewSessionReplayIssue } from "./review-session-replay.js";
3
3
  import { type ReviewPresentationAdapter } from "./review-presentation.js";
4
- import { type ReviewCandidate, type ReviewDecision, type ReviewItem, type ReviewSession, type ReviewSessionEvent } from "../review-resource.js";
4
+ import { type ReviewCandidate, type ReviewDecision, type ReviewItem, type ReviewSession, type ReviewSessionEvent, type ReviewValueDescriptor } from "../review-resource.js";
5
5
  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";
6
6
  export { buildReviewCandidatePresentation, buildReviewItemPresentation, buildReviewResultPresentation, humanizeIdentifier, type ReviewCandidatePresentation, type ReviewCandidatePresentationContext, type ReviewItemPresentation, type ReviewItemPresentationContext, type ReviewPresentationAdapter, type ReviewPresentationLink, type ReviewResultPresentation, type ReviewTracePresentationContext, type ReviewTraceRef, type ReviewValuePresentationContext, } from "./review-presentation.js";
7
7
  export { buildSurfaceProjectionPreview, type PreviewAuthorityTrace, type PreviewCandidateHistory, type PreviewClaim, type PreviewIntegrityPosture, type PreviewReviewEvent, type PreviewSourceAuthority, type PreviewSourceEvidence, type SurfaceProjectionPreview, } from "./review-surface-preview.js";
@@ -92,8 +92,18 @@ export interface ReviewWorkbenchResult {
92
92
  readonly selectedCandidate: ReviewCandidate;
93
93
  readonly selectedCandidateId: string;
94
94
  readonly selectedCandidateRole?: ReviewCandidate["role"];
95
+ /** The selected candidate's original value, unaffected by any reviewer edit. Used
96
+ * for candidate-identity matching (see `matchingSelectedCandidate`); consumers who
97
+ * want the reviewer's edited value should read `effectiveValue` instead. */
95
98
  readonly selectedValue: unknown;
96
99
  readonly selectedDisplayValue: string;
100
+ /** Reviewer-edited override captured for an accept-proposed decision, if the
101
+ * reviewer changed the proposed value before applying it. Additive/optional. */
102
+ readonly editedValue?: unknown;
103
+ /** The value that should actually be applied: `editedValue` when present (and the
104
+ * decision selects the proposed candidate), otherwise `selectedValue`. */
105
+ readonly effectiveValue: unknown;
106
+ readonly effectiveDisplayValue: string;
97
107
  readonly unselectedCandidates: readonly ReviewCandidate[];
98
108
  readonly reviewDecision: ReviewDecision;
99
109
  readonly status: ReviewDecision["spec"]["status"];
@@ -166,9 +176,19 @@ export declare function persistReviewSessionEvents(options: PersistReviewSession
166
176
  export declare function createPersistentReviewSessionEventStore(options: PersistentReviewSessionEventStoreOptions): ReviewSessionEventStore & {
167
177
  events(): readonly ReviewSessionEvent[];
168
178
  };
169
- export declare function renderReviewWorkbenchHtml(state: ReviewWorkbenchState | ReviewQueueSessionState, events?: readonly ReviewSessionEvent[], options?: {
179
+ export declare function renderReviewWorkbenchHtml(state: ReviewWorkbenchState | ReviewQueueSessionState, _events?: readonly ReviewSessionEvent[], options?: {
170
180
  readonly presentationAdapter?: ReviewPresentationAdapter;
171
181
  }): string;
182
+ /**
183
+ * Validates a reviewer's raw (string) edit of a proposed value against the
184
+ * field's neutral {@link ReviewValueDescriptor}, returning a human-readable
185
+ * error message when the value violates the declared type/enum constraint, or
186
+ * `undefined` when it is acceptable — including when there is no descriptor or
187
+ * the type carries no single-line constraint (string/array/object). This is a
188
+ * FORMAT check only: it never coerces or rewrites the value (the workbench
189
+ * stores the reviewer's string edit unchanged, as it did before typed editors).
190
+ */
191
+ export declare function validateProposedValue(descriptor: ReviewValueDescriptor | undefined, rawValue: string): string | undefined;
172
192
  export declare function mountReviewWorkbench(root: HTMLElement, startState?: ReviewQueueSessionState | ReviewWorkbenchState, options?: MountReviewWorkbenchOptions): void;
173
193
  export declare function browserReviewWorkbenchStartState(): ReviewQueueSessionState | ReviewWorkbenchState | undefined;
174
194
  declare global {