@lax-wp/editor 0.4.13 → 0.4.15-beta.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.
Files changed (160) hide show
  1. package/README.md +25 -0
  2. package/dist/api/audit.d.ts +79 -0
  3. package/dist/api/derivedRulebook.d.ts +470 -0
  4. package/dist/api/documentVersions.d.ts +519 -0
  5. package/dist/api/effectiveRules.d.ts +372 -0
  6. package/dist/api/methodology.d.ts +62 -0
  7. package/dist/api/playbook.d.ts +604 -0
  8. package/dist/api/promotions.d.ts +1432 -0
  9. package/dist/api/r1.d.ts +1097 -0
  10. package/dist/api/r1.fixtures.d.ts +111 -0
  11. package/dist/api/redlineJobs.d.ts +377 -0
  12. package/dist/api/redlineStream.d.ts +2979 -0
  13. package/dist/api/redlines.d.ts +504 -0
  14. package/dist/api/regsync.d.ts +2355 -0
  15. package/dist/api/ruleAuthoring.d.ts +305 -0
  16. package/dist/api/ruleBuilder.d.ts +1009 -0
  17. package/dist/api/ruleOverrides.d.ts +31 -0
  18. package/dist/api/ruleStats.d.ts +84 -0
  19. package/dist/api/rulesCatalog.d.ts +234 -0
  20. package/dist/api/versions.d.ts +76 -0
  21. package/dist/api/workspace.d.ts +41 -0
  22. package/dist/components/EditorSidebar.d.ts +4 -1
  23. package/dist/components/audit/AuditView.d.ts +8 -0
  24. package/dist/components/capturededits/AddAsRuleModal.d.ts +8 -0
  25. package/dist/components/capturededits/CapturedEditCard.d.ts +15 -0
  26. package/dist/components/capturededits/CapturedEditsTray.d.ts +4 -0
  27. package/dist/components/capturededits/capturedEditIntent.d.ts +23 -0
  28. package/dist/components/common/EscDropdown.d.ts +2 -0
  29. package/dist/components/compliance/MethodologyPanel.d.ts +14 -0
  30. package/dist/components/compliance/RegSyncPanel.d.ts +18 -0
  31. package/dist/components/compliance/index.d.ts +8 -0
  32. package/dist/components/compliance/primitives.d.ts +41 -0
  33. package/dist/components/documents/DocumentVersionHistory.d.ts +12 -0
  34. package/dist/components/documents/documentDiff.d.ts +68 -0
  35. package/dist/components/documents/index.d.ts +4 -0
  36. package/dist/components/flowdown/FlowdownPanel.d.ts +28 -0
  37. package/dist/components/flowdown/FlowdownRowCard.d.ts +27 -0
  38. package/dist/components/flowdown/flowdownModel.d.ts +150 -0
  39. package/dist/components/history/PlaybookVersionHistory.d.ts +10 -0
  40. package/dist/components/history/versionDiff.d.ts +14 -0
  41. package/dist/components/playbook/AllPlaybooksView.d.ts +41 -0
  42. package/dist/components/playbook/DerivedRulebookView.d.ts +9 -0
  43. package/dist/components/playbook/DraftedRulePreview.d.ts +17 -0
  44. package/dist/components/playbook/EffectiveRulesView.d.ts +11 -0
  45. package/dist/components/playbook/NewRuleDrawer.d.ts +11 -0
  46. package/dist/components/playbook/PlaybookCard.d.ts +13 -0
  47. package/dist/components/playbook/PlaybookPage.d.ts +29 -0
  48. package/dist/components/playbook/PlaybookPanel.d.ts +73 -0
  49. package/dist/components/playbook/PromotionSuggestions.d.ts +1 -0
  50. package/dist/components/playbook/ReprioritizeDialog.d.ts +16 -0
  51. package/dist/components/playbook/RuleDetail.d.ts +27 -0
  52. package/dist/components/playbook/RuleEditorFields.d.ts +42 -0
  53. package/dist/components/playbook/RuleEditorModal.d.ts +27 -0
  54. package/dist/components/playbook/RulePerformancePanel.d.ts +4 -0
  55. package/dist/components/playbook/RuleRow.d.ts +26 -0
  56. package/dist/components/playbook/ThisDocumentView.d.ts +45 -0
  57. package/dist/components/playbook/ViewTabs.d.ts +8 -0
  58. package/dist/components/playbook/index.d.ts +14 -0
  59. package/dist/components/playbook/predicateSummary.d.ts +10 -0
  60. package/dist/components/playbook/primitives.d.ts +82 -0
  61. package/dist/components/playbook/useFocusTrap.d.ts +6 -0
  62. package/dist/components/playbook/usePlaybookData.d.ts +161 -0
  63. package/dist/components/playbook/usePlaybookLabel.d.ts +18 -0
  64. package/dist/components/r1/ApprovalPanel.d.ts +10 -0
  65. package/dist/components/r1/CandidateRuleCard.d.ts +8 -0
  66. package/dist/components/r1/ExecSummaryPanel.d.ts +23 -0
  67. package/dist/components/r1/PrimeUploadPanel.d.ts +8 -0
  68. package/dist/components/r1/ReviewStartControls.d.ts +24 -0
  69. package/dist/components/r1/ReviewSummaryTab.d.ts +38 -0
  70. package/dist/components/r1/index.d.ts +13 -0
  71. package/dist/components/r1/primitives.d.ts +59 -0
  72. package/dist/components/redline/AiReviewPanel.d.ts +194 -0
  73. package/dist/components/redline/RedlineHoverCard.d.ts +13 -0
  74. package/dist/components/redline/RedlineItem.d.ts +12 -0
  75. package/dist/components/redline/ReviewCard.d.ts +49 -0
  76. package/dist/components/redline/index.d.ts +6 -0
  77. package/dist/components/redline/reviewItems.d.ts +49 -0
  78. package/dist/components/redline/reviewPrefs.d.ts +18 -0
  79. package/dist/components/redline/useRunScopedCards.d.ts +16 -0
  80. package/dist/components/rulebuilder/AuthorForms.d.ts +28 -0
  81. package/dist/components/rulebuilder/CandidateQueue.d.ts +21 -0
  82. package/dist/components/rulebuilder/DraftPane.d.ts +12 -0
  83. package/dist/components/rulebuilder/RuleBuilderPanel.d.ts +6 -0
  84. package/dist/components/rulebuilder/RuleCard.d.ts +16 -0
  85. package/dist/components/rulebuilder/TestBench.d.ts +10 -0
  86. package/dist/components/rulebuilder/VocabularyPanel.d.ts +26 -0
  87. package/dist/components/rulebuilder/index.d.ts +13 -0
  88. package/dist/components/rulebuilder/primitives.d.ts +54 -0
  89. package/dist/components/rulebuilder/useRuleBuilder.d.ts +291 -0
  90. package/dist/components/sidebar/ExpandableSidebar.d.ts +2 -0
  91. package/dist/components/sidebar/WorkspaceRetentionPanel.d.ts +18 -0
  92. package/dist/components/sidebar/content/TrackChangesContent.d.ts +8 -0
  93. package/dist/components/sidebar/content/anonymization-page/PIIAnonymization.d.ts +1 -1
  94. package/dist/components/sidebar/content/anonymization-page/PiiIdleView.d.ts +12 -0
  95. package/dist/components/sidebar/content/anonymization-page/PiiRecoveryView.d.ts +16 -0
  96. package/dist/components/sidebar/content/anonymization-page/PiiSummaryView.d.ts +34 -0
  97. package/dist/components/sidebar/content/anonymization-page/PiiUnavailableView.d.ts +1 -0
  98. package/dist/components/sidebar/content/anonymization-page/RestoreConfirmDialog.d.ts +9 -0
  99. package/dist/components/sidebar/content/anonymization-page/anonymizationUtils.d.ts +38 -17
  100. package/dist/components/sidebar/content/anonymization-page/piiVault.d.ts +18 -0
  101. package/dist/components/sidebar/content/index.d.ts +0 -1
  102. package/dist/components/toolbar/AutocompletionToggle.d.ts +1 -0
  103. package/dist/components/trackChanges/TrackChangesCards.d.ts +1 -0
  104. package/dist/components/trackChanges/index.d.ts +2 -0
  105. package/dist/components/trackChanges/utils.d.ts +5 -0
  106. package/dist/config/EditorConfig.d.ts +197 -73
  107. package/dist/constants/Extensions.d.ts +12 -0
  108. package/dist/constants/playbook.d.ts +108 -0
  109. package/dist/contexts/CapturedEditsContext.d.ts +56 -0
  110. package/dist/contexts/EditorShellContext.d.ts +4 -1
  111. package/dist/editor.css +1 -1
  112. package/dist/extensions/AnonymizedText.d.ts +31 -2
  113. package/dist/extensions/VariableText.d.ts +20 -0
  114. package/dist/extensions/index.d.ts +1 -1
  115. package/dist/extensions/plugins/CapturedEditsPlugin.d.ts +90 -0
  116. package/dist/extensions/plugins/MarkHighlightPlugin.d.ts +0 -1
  117. package/dist/extensions/plugins/RedlinePlugin.d.ts +9 -0
  118. package/dist/extensions/redline/changeTypes.d.ts +70 -0
  119. package/dist/extensions/redline/constants.d.ts +25 -0
  120. package/dist/extensions/redline/engine/blockNodes.d.ts +31 -0
  121. package/dist/extensions/redline/engine/clipboard.d.ts +16 -0
  122. package/dist/extensions/redline/engine/deletion.d.ts +34 -0
  123. package/dist/extensions/redline/engine/formatSplit.d.ts +16 -0
  124. package/dist/extensions/redline/engine/insertion.d.ts +26 -0
  125. package/dist/extensions/redline/engine/predicates.d.ts +73 -0
  126. package/dist/extensions/redline/engine/textReplace.d.ts +19 -0
  127. package/dist/extensions/redline/id.d.ts +7 -0
  128. package/dist/extensions/redline/index.d.ts +36 -0
  129. package/dist/extensions/redline/plugin.d.ts +34 -0
  130. package/dist/extensions/redline/query/scan.d.ts +52 -0
  131. package/dist/extensions/redline/review/applyChange.d.ts +25 -0
  132. package/dist/extensions/redline/review/index.d.ts +1 -0
  133. package/dist/extensions/redline/review/nodeResolvers.d.ts +29 -0
  134. package/dist/extensions/redline/review/pairedNodes.d.ts +38 -0
  135. package/dist/extensions/redline/review/structuralRevert.d.ts +20 -0
  136. package/dist/extensions/redline/review/textResolver.d.ts +9 -0
  137. package/dist/extensions/redline/schema/marks.d.ts +65 -0
  138. package/dist/extensions/redline/schema/shared.d.ts +34 -0
  139. package/dist/extensions/redline/session.d.ts +71 -0
  140. package/dist/extensions/redline/types.d.ts +24 -0
  141. package/dist/extensions/trackedChanges/TrackedChanges.d.ts +64 -0
  142. package/dist/extensions/trackedChanges/constants.d.ts +34 -0
  143. package/dist/extensions/trackedChanges/engine.d.ts +32 -0
  144. package/dist/extensions/trackedChanges/index.d.ts +13 -0
  145. package/dist/extensions/trackedChanges/marks.d.ts +20 -0
  146. package/dist/extensions/trackedChanges/normalize.d.ts +2 -0
  147. package/dist/extensions/trackedChanges/plugin.d.ts +32 -0
  148. package/dist/extensions/trackedChanges/query.d.ts +3 -0
  149. package/dist/extensions/trackedChanges/review.d.ts +34 -0
  150. package/dist/extensions/trackedChanges/types.d.ts +72 -0
  151. package/dist/extensions/trackedChanges/utils.d.ts +20 -0
  152. package/dist/hooks/useMediaQuery.d.ts +2 -0
  153. package/dist/hooks/useRedlineHover.d.ts +17 -0
  154. package/dist/hooks/useRedlineReview.d.ts +83 -0
  155. package/dist/index.d.ts +46 -0
  156. package/dist/index.es.js +38491 -22189
  157. package/dist/index.umd.js +224 -125
  158. package/dist/utils/cdts.d.ts +37 -0
  159. package/dist/utils/groundingAdapter.d.ts +36 -0
  160. package/package.json +39 -33
@@ -0,0 +1,26 @@
1
+ import { type Rule } from "@/api/playbook";
2
+ import { type FiredState } from "./primitives";
3
+ export interface RuleRowProps {
4
+ rule: Rule;
5
+ /** Owning playbook is a bundled (read-only) library playbook (REQ-R4). */
6
+ bundled: boolean;
7
+ fired: FiredState;
8
+ expanded: boolean;
9
+ onToggle: () => void;
10
+ /** Cross-link + edit affordances forwarded to RuleDetail (REQ-R3/R4). */
11
+ onEdit?: (rule: Rule) => void;
12
+ onDuplicate?: (rule: Rule) => void;
13
+ onShowSuggestions?: (ruleId: string) => void;
14
+ /** Extra highlight for a just-saved / cross-link-focused rule. */
15
+ highlighted?: boolean;
16
+ /** Dismissed for this document only — dims the row, swaps the meta chip. */
17
+ dismissed?: boolean;
18
+ onDismiss?: (rule: Rule) => void;
19
+ onRestore?: (ruleId: string) => void;
20
+ onDelete?: (rule: Rule) => void;
21
+ /** Ignored workspace-wide (rule-overrides) — dims the row, "Ignored" badge. */
22
+ ignored?: boolean;
23
+ onIgnore?: (rule: Rule) => void;
24
+ onUnignore?: (ruleId: string) => void;
25
+ }
26
+ export declare const RuleRow: import("react").ForwardRefExoticComponent<RuleRowProps & import("react").RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,45 @@
1
+ import { type Rule } from "@/api/playbook";
2
+ import { type RuleFilter } from "@/constants/playbook";
3
+ import { type CdtsScope } from "@/utils/cdts";
4
+ import type { FetchState, RuleGroup } from "./usePlaybookData";
5
+ export interface ThisDocumentViewProps {
6
+ docScope: CdtsScope;
7
+ workspaceName?: string;
8
+ regimeLabels?: string[];
9
+ groupsState: FetchState<RuleGroup[]>;
10
+ onRetry: () => void;
11
+ search: string;
12
+ onSearchChange: (query: string) => void;
13
+ filter: RuleFilter;
14
+ onFilterChange: (filter: RuleFilter) => void;
15
+ firedCounts: ReadonlyMap<string, number> | null;
16
+ justSavedRuleIds: ReadonlySet<string>;
17
+ expandedRuleId: string | null;
18
+ onToggleRule: (ruleId: string) => void;
19
+ focusedRuleId?: string | null;
20
+ onEditRule: (rule: Rule) => void;
21
+ onDuplicateRule: (rule: Rule, group: RuleGroup) => void;
22
+ onShowSuggestions?: (ruleId: string) => void;
23
+ onNewRule: () => void;
24
+ registerRowRef: (ruleId: string, el: HTMLButtonElement | null) => void;
25
+ /** Rules dismissed for this document only (client-side, reversible). */
26
+ dismissedRuleIds: ReadonlySet<string>;
27
+ onDismissRule: (rule: Rule) => void;
28
+ onRestoreRule: (ruleId: string) => void;
29
+ onDeleteRule?: (rule: Rule) => void;
30
+ /** Rules ignored workspace-wide (durable rule-overrides). */
31
+ ignoredRuleIds?: ReadonlySet<string>;
32
+ onIgnoreRule?: (rule: Rule) => void;
33
+ onUnignoreRule?: (ruleId: string) => void;
34
+ /** Rule the escalation nudge is currently offered for (3rd dismissal). */
35
+ nudgeRuleId?: string | null;
36
+ onNudgeSuggestRemoval?: (ruleId: string) => void;
37
+ onNudgeDismiss?: (ruleId: string) => void;
38
+ /** How many documents the nudged rule has been dismissed on. */
39
+ nudgeCount?: number;
40
+ playbookOwnerName?: string;
41
+ /** Playbooks deselected for this session/run (client-side, per-run only). */
42
+ mutedPlaybookIds: ReadonlySet<string>;
43
+ onTogglePlaybook: (playbookId: string, ruleIds: string[]) => void;
44
+ }
45
+ export declare const ThisDocumentView: (props: ThisDocumentViewProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ export type PlaybookView = "this-document" | "all-playbooks";
2
+ export interface ViewTabsProps {
3
+ active: PlaybookView;
4
+ onChange: (view: PlaybookView) => void;
5
+ thisDocumentCount: number | null;
6
+ allPlaybooksCount: number | null;
7
+ }
8
+ export declare const ViewTabs: ({ active, onChange, thisDocumentCount, allPlaybooksCount, }: ViewTabsProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ export { PlaybookPanel } from "./PlaybookPanel";
2
+ export type { PlaybookPanelProps, RuleDismissalRecord, SaveAsRulePrefill, } from "./PlaybookPanel";
3
+ export type { RuleEditorSession } from "./RuleEditorModal";
4
+ export { PlaybookPage } from "./PlaybookPage";
5
+ export type { PlaybookPageProps } from "./PlaybookPage";
6
+ export { NewRuleDrawer } from "./NewRuleDrawer";
7
+ export type { NewRuleDrawerProps } from "./NewRuleDrawer";
8
+ export { DerivedRulebookView } from "./DerivedRulebookView";
9
+ export type { DerivedRulebookViewProps } from "./DerivedRulebookView";
10
+ export { EffectiveRulesView } from "./EffectiveRulesView";
11
+ export type { EffectiveRulesViewProps } from "./EffectiveRulesView";
12
+ export { PromotionSuggestions } from "./PromotionSuggestions";
13
+ export { RulePerformancePanel } from "./RulePerformancePanel";
14
+ export type { RulePerformancePanelProps } from "./RulePerformancePanel";
@@ -0,0 +1,10 @@
1
+ /**
2
+ * One-line predicate summary for drafted-rule previews (Captured Edits modal,
3
+ * Candidate Rules queue): kind plus the one or two salient params, recursing
4
+ * one level into composites.
5
+ *
6
+ * semantic_similarity_above · threshold 0.62
7
+ * all(semantic_similarity_above, contains_phrase)
8
+ */
9
+ import type { PredicateNode } from "@/api/ruleBuilder";
10
+ export declare const predicateSummary: (predicate: PredicateNode | undefined) => string;
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Small shared presentational pieces for the playbook panel.
3
+ * Tokens + Tailwind only (REQ-S3); all text renders as text, never HTML.
4
+ */
5
+ import type { ReactNode } from "react";
6
+ export declare const Chip: ({ className, children, title, }: {
7
+ className?: string;
8
+ children: ReactNode;
9
+ title?: string;
10
+ }) => import("react/jsx-runtime").JSX.Element;
11
+ /**
12
+ * The one severity chip (REQ-R1: tinted bg, no border). Renders the canonical
13
+ * critical/high/medium/low vocabulary; unknown wire values fall back to medium.
14
+ */
15
+ export declare const SeverityChip: ({ severity, className, }: {
16
+ severity: string;
17
+ className?: string;
18
+ }) => import("react/jsx-runtime").JSX.Element;
19
+ export type FiredState = {
20
+ kind: "pre-run";
21
+ } | {
22
+ kind: "count";
23
+ count: number;
24
+ } | {
25
+ kind: "applies-next-run";
26
+ };
27
+ export declare const FiredBadge: ({ state }: {
28
+ state: FiredState;
29
+ }) => import("react/jsx-runtime").JSX.Element;
30
+ export declare const CountBadge: ({ count }: {
31
+ count: number;
32
+ }) => import("react/jsx-runtime").JSX.Element;
33
+ /** 3 shimmer rule rows under real group headers — never a full-panel spinner. */
34
+ export declare const SkeletonRuleRows: () => import("react/jsx-runtime").JSX.Element;
35
+ export declare const SkeletonPlaybookCards: () => import("react/jsx-runtime").JSX.Element;
36
+ /** Inline error strip + Retry — never a blocking dialog (§5). */
37
+ export declare const InlineErrorStrip: ({ message, onRetry, }: {
38
+ message: string;
39
+ onRetry?: () => void;
40
+ }) => import("react/jsx-runtime").JSX.Element;
41
+ /** EmptyState anatomy: illustration + title + one reassurance line (§5). */
42
+ export declare const EmptyState: ({ title, reassurance, children, }: {
43
+ title: string;
44
+ reassurance: string;
45
+ children?: ReactNode;
46
+ }) => import("react/jsx-runtime").JSX.Element;
47
+ /**
48
+ * Zero-results row with a one-tap reset chip (§5).
49
+ *
50
+ * `reason` distinguishes an empty search from an empty *filter* — filtering to
51
+ * a set with no members used to render `No matches for “”`, a dead end that
52
+ * named neither the cause nor the control that would undo it.
53
+ */
54
+ export declare const ZeroResults: ({ query, onClear, reason, message, }: {
55
+ query: string;
56
+ onClear: () => void;
57
+ reason?: "search" | "filter";
58
+ /** Overrides the default line; use to name the active filter. */
59
+ message?: string;
60
+ }) => import("react/jsx-runtime").JSX.Element;
61
+ export interface FilterOption<T extends string> {
62
+ id: T;
63
+ label: string;
64
+ count: number;
65
+ }
66
+ /**
67
+ * Single-select filter chip row. Sits under SearchField on both list views;
68
+ * filtering is client-side over already-fetched data, so switching chips never
69
+ * refetches and needs no loading state of its own.
70
+ */
71
+ export declare const FilterChips: <T extends string>({ options, active, onChange, label, }: {
72
+ options: readonly FilterOption<T>[];
73
+ active: T;
74
+ onChange: (id: T) => void;
75
+ label: string;
76
+ }) => import("react/jsx-runtime").JSX.Element;
77
+ export declare const SearchField: ({ value, onChange, placeholder, label, }: {
78
+ value: string;
79
+ onChange: (value: string) => void;
80
+ placeholder: string;
81
+ label: string;
82
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * WAI-ARIA Dialog focus management (REQ-A1): traps Tab inside the container,
3
+ * focuses the first focusable on open, and restores focus to the invoking
4
+ * element on close.
5
+ */
6
+ export declare const useFocusTrap: <T extends HTMLElement>() => import("react").MutableRefObject<T | null>;
@@ -0,0 +1,161 @@
1
+ import { type Playbook, type Rule } from "@/api/playbook";
2
+ import { type CdtsScope } from "@/utils/cdts";
3
+ export type FetchState<T> = {
4
+ status: "loading";
5
+ } | {
6
+ status: "error";
7
+ message: string;
8
+ } | {
9
+ status: "ready";
10
+ data: T;
11
+ };
12
+ export interface RuleGroup {
13
+ playbook: Playbook;
14
+ rules: Rule[];
15
+ bundled: boolean;
16
+ }
17
+ /**
18
+ * This-document view: one `?cdts=` round-trip (REQ-D2) whose response carries
19
+ * each chain playbook's rules inline; playbooks arriving without inline rules
20
+ * (the degraded client-filter path) lazy-fetch via listRules. Groups sort in
21
+ * CDTS walk-up order — specific → generic (REQ-P3).
22
+ */
23
+ export declare const useThisDocumentRules: (docScope: CdtsScope) => {
24
+ state: FetchState<RuleGroup[]>;
25
+ retry: () => void;
26
+ ruleCount: number | null;
27
+ };
28
+ /** All-playbooks view: unfiltered list (REQ-D3). */
29
+ export declare const useAllPlaybooks: () => {
30
+ state: FetchState<import("zod").objectOutputType<{
31
+ id: import("zod").ZodString;
32
+ workspace_id: import("zod").ZodOptional<import("zod").ZodString>;
33
+ name: import("zod").ZodString;
34
+ regime: import("zod").ZodOptional<import("zod").ZodString>;
35
+ kind: import("zod").ZodOptional<import("zod").ZodString>;
36
+ scope: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodObject<{
37
+ category: import("zod").ZodOptional<import("zod").ZodString>;
38
+ domain: import("zod").ZodOptional<import("zod").ZodString>;
39
+ type: import("zod").ZodOptional<import("zod").ZodString>;
40
+ subtype: import("zod").ZodOptional<import("zod").ZodString>;
41
+ }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
42
+ category: import("zod").ZodOptional<import("zod").ZodString>;
43
+ domain: import("zod").ZodOptional<import("zod").ZodString>;
44
+ type: import("zod").ZodOptional<import("zod").ZodString>;
45
+ subtype: import("zod").ZodOptional<import("zod").ZodString>;
46
+ }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
47
+ category: import("zod").ZodOptional<import("zod").ZodString>;
48
+ domain: import("zod").ZodOptional<import("zod").ZodString>;
49
+ type: import("zod").ZodOptional<import("zod").ZodString>;
50
+ subtype: import("zod").ZodOptional<import("zod").ZodString>;
51
+ }, import("zod").ZodTypeAny, "passthrough">>>>;
52
+ version: import("zod").ZodOptional<import("zod").ZodNumber>;
53
+ effective_from: import("zod").ZodOptional<import("zod").ZodString>;
54
+ read_only: import("zod").ZodOptional<import("zod").ZodBoolean>;
55
+ bundled: import("zod").ZodOptional<import("zod").ZodBoolean>;
56
+ rules: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
57
+ id: import("zod").ZodString;
58
+ playbook_id: import("zod").ZodString;
59
+ workspace_id: import("zod").ZodOptional<import("zod").ZodString>;
60
+ name: import("zod").ZodOptional<import("zod").ZodString>;
61
+ category: import("zod").ZodString;
62
+ default_severity: import("zod").ZodString;
63
+ verbatim_excerpt: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
64
+ standard_position: import("zod").ZodOptional<import("zod").ZodObject<{
65
+ text: import("zod").ZodOptional<import("zod").ZodString>;
66
+ }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
67
+ text: import("zod").ZodOptional<import("zod").ZodString>;
68
+ }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
69
+ text: import("zod").ZodOptional<import("zod").ZodString>;
70
+ }, import("zod").ZodTypeAny, "passthrough">>>;
71
+ rationale: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
72
+ suggested_text: import("zod").ZodOptional<import("zod").ZodString>;
73
+ authority: import("zod").ZodOptional<import("zod").ZodString>;
74
+ mandatory: import("zod").ZodOptional<import("zod").ZodBoolean>;
75
+ read_only: import("zod").ZodOptional<import("zod").ZodBoolean>;
76
+ source: import("zod").ZodOptional<import("zod").ZodString>;
77
+ }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
78
+ id: import("zod").ZodString;
79
+ playbook_id: import("zod").ZodString;
80
+ workspace_id: import("zod").ZodOptional<import("zod").ZodString>;
81
+ name: import("zod").ZodOptional<import("zod").ZodString>;
82
+ category: import("zod").ZodString;
83
+ default_severity: import("zod").ZodString;
84
+ verbatim_excerpt: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
85
+ standard_position: import("zod").ZodOptional<import("zod").ZodObject<{
86
+ text: import("zod").ZodOptional<import("zod").ZodString>;
87
+ }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
88
+ text: import("zod").ZodOptional<import("zod").ZodString>;
89
+ }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
90
+ text: import("zod").ZodOptional<import("zod").ZodString>;
91
+ }, import("zod").ZodTypeAny, "passthrough">>>;
92
+ rationale: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
93
+ suggested_text: import("zod").ZodOptional<import("zod").ZodString>;
94
+ authority: import("zod").ZodOptional<import("zod").ZodString>;
95
+ mandatory: import("zod").ZodOptional<import("zod").ZodBoolean>;
96
+ read_only: import("zod").ZodOptional<import("zod").ZodBoolean>;
97
+ source: import("zod").ZodOptional<import("zod").ZodString>;
98
+ }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
99
+ id: import("zod").ZodString;
100
+ playbook_id: import("zod").ZodString;
101
+ workspace_id: import("zod").ZodOptional<import("zod").ZodString>;
102
+ name: import("zod").ZodOptional<import("zod").ZodString>;
103
+ category: import("zod").ZodString;
104
+ default_severity: import("zod").ZodString;
105
+ verbatim_excerpt: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
106
+ standard_position: import("zod").ZodOptional<import("zod").ZodObject<{
107
+ text: import("zod").ZodOptional<import("zod").ZodString>;
108
+ }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
109
+ text: import("zod").ZodOptional<import("zod").ZodString>;
110
+ }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
111
+ text: import("zod").ZodOptional<import("zod").ZodString>;
112
+ }, import("zod").ZodTypeAny, "passthrough">>>;
113
+ rationale: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
114
+ suggested_text: import("zod").ZodOptional<import("zod").ZodString>;
115
+ authority: import("zod").ZodOptional<import("zod").ZodString>;
116
+ mandatory: import("zod").ZodOptional<import("zod").ZodBoolean>;
117
+ read_only: import("zod").ZodOptional<import("zod").ZodBoolean>;
118
+ source: import("zod").ZodOptional<import("zod").ZodString>;
119
+ }, import("zod").ZodTypeAny, "passthrough">>, "many">>;
120
+ }, import("zod").ZodTypeAny, "passthrough">[]>;
121
+ retry: () => void;
122
+ count: number | null;
123
+ };
124
+ /**
125
+ * Workspace rule overrides ("ignore rule everywhere"). The list is durable
126
+ * server state (GET /v1/rule-overrides); ignore/unignore write through and
127
+ * update the local set on success, so no refetch per toggle.
128
+ */
129
+ export declare const useRuleOverrides: () => {
130
+ state: FetchState<string[]>;
131
+ ignored: ReadonlySet<string>;
132
+ ignore: (family: string) => Promise<void>;
133
+ unignore: (family: string) => Promise<void>;
134
+ retry: () => void;
135
+ };
136
+ /** Per-playbook rule list, lazy-loaded on drill-in (REQ-D3). */
137
+ export declare const usePlaybookRules: (playbook: Playbook | null) => {
138
+ state: FetchState<import("zod").objectOutputType<{
139
+ id: import("zod").ZodString;
140
+ playbook_id: import("zod").ZodString;
141
+ workspace_id: import("zod").ZodOptional<import("zod").ZodString>;
142
+ name: import("zod").ZodOptional<import("zod").ZodString>;
143
+ category: import("zod").ZodString;
144
+ default_severity: import("zod").ZodString;
145
+ verbatim_excerpt: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
146
+ standard_position: import("zod").ZodOptional<import("zod").ZodObject<{
147
+ text: import("zod").ZodOptional<import("zod").ZodString>;
148
+ }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
149
+ text: import("zod").ZodOptional<import("zod").ZodString>;
150
+ }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
151
+ text: import("zod").ZodOptional<import("zod").ZodString>;
152
+ }, import("zod").ZodTypeAny, "passthrough">>>;
153
+ rationale: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
154
+ suggested_text: import("zod").ZodOptional<import("zod").ZodString>;
155
+ authority: import("zod").ZodOptional<import("zod").ZodString>;
156
+ mandatory: import("zod").ZodOptional<import("zod").ZodBoolean>;
157
+ read_only: import("zod").ZodOptional<import("zod").ZodBoolean>;
158
+ source: import("zod").ZodOptional<import("zod").ZodString>;
159
+ }, import("zod").ZodTypeAny, "passthrough">[]>;
160
+ retry: () => void;
161
+ };
@@ -0,0 +1,18 @@
1
+ import { type Playbook, type PlaybookApiConfig } from "@/api/playbook";
2
+ import { type CdtsScope } from "@/utils/cdts";
3
+ export interface ReviewedPlaybookInfo {
4
+ id: string;
5
+ name: string;
6
+ scopeLabel: string;
7
+ ruleCount?: number;
8
+ bundled: boolean;
9
+ /** The full playbook, for handing to PlaybookPage. */
10
+ playbook: Playbook;
11
+ }
12
+ export interface PlaybookLabelResult {
13
+ /** "Cost Accounting … +17 more", or `fallback` before/without data. */
14
+ label: string | undefined;
15
+ /** Chain in walk-up order (most specific first); empty until loaded. */
16
+ playbooks: ReviewedPlaybookInfo[];
17
+ }
18
+ export declare const usePlaybookLabel: (scope: CdtsScope | undefined, fallback: string | undefined, api?: PlaybookApiConfig) => PlaybookLabelResult;
@@ -0,0 +1,10 @@
1
+ import { type RulebookStatus } from "@/api/r1";
2
+ export interface ApprovalPanelProps {
3
+ /** The derived playbook whose candidates are being disposed. */
4
+ playbookId: string;
5
+ /** Approver identity to display; defaults to the client-config approver. */
6
+ approver?: string;
7
+ /** Notified whenever the rulebook status changes (e.g. becomes active). */
8
+ onStatusChange?: (status: RulebookStatus) => void;
9
+ }
10
+ export declare const ApprovalPanel: ({ playbookId, approver, onStatusChange }: ApprovalPanelProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import type { CandidateRule } from "@/api/r1";
2
+ export interface CandidateRuleCardProps {
3
+ rule: CandidateRule;
4
+ busy?: boolean;
5
+ onApprove: (id: string, editedText?: string) => void;
6
+ onReject: (id: string) => void;
7
+ }
8
+ export declare const CandidateRuleCard: ({ rule, busy, onApprove, onReject }: CandidateRuleCardProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * ExecSummaryPanel — post-review executive summary: finding counts by
3
+ * provenance (Prime vs CDTS), severity mix, missing-flowdown count,
4
+ * escalations, and suppressed minor deviations. Purely presentational; the
5
+ * parent fetches the summary via src/api/r1.ts getReviewSummary().
6
+ */
7
+ import type { ReviewSummary } from "@/api/r1";
8
+ export interface ExecSummaryPanelProps {
9
+ summary?: ReviewSummary | null;
10
+ loading?: boolean;
11
+ error?: string | null;
12
+ onRetry?: () => void;
13
+ /**
14
+ * The review stream ended without both a `summary` and a `done` frame. The
15
+ * backend cannot currently distinguish truncation from completion, so any
16
+ * counts below are a floor, not a total — say so rather than presenting
17
+ * them as a finished review.
18
+ */
19
+ incomplete?: boolean;
20
+ /** Label for the retry/refresh action (default "Retry"). */
21
+ retryLabel?: string;
22
+ }
23
+ export declare const ExecSummaryPanel: ({ summary, loading, error, onRetry, incomplete, retryLabel, }: ExecSummaryPanelProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { type DerivationJob } from "@/api/r1";
2
+ export interface PrimeUploadPanelProps {
3
+ /** Called when a derivation completes with candidates to review. */
4
+ onDerived?: (job: DerivationJob) => void;
5
+ /** Poll interval for job status (ms). */
6
+ pollIntervalMs?: number;
7
+ }
8
+ export declare const PrimeUploadPanel: ({ onDerived, pollIntervalMs }: PrimeUploadPanelProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Review-start + workspace-settings controls for GovCon mode:
3
+ *
4
+ * - GovConToggle — the simple workspace-settings flag that enables
5
+ * prime-flowdown behavior.
6
+ * - CounterpartyTypeSelector — segmented selector shown on review start
7
+ * (commercial sub / noncommercial / unknown), feeding
8
+ * R1EvaluateExtras.counterparty_type.
9
+ *
10
+ * Both are controlled, presentational components.
11
+ */
12
+ import type { CounterpartyType } from "@/api/r1";
13
+ export interface GovConToggleProps {
14
+ enabled: boolean;
15
+ onChange: (enabled: boolean) => void;
16
+ disabled?: boolean;
17
+ }
18
+ export declare const GovConToggle: ({ enabled, onChange, disabled }: GovConToggleProps) => import("react/jsx-runtime").JSX.Element;
19
+ export interface CounterpartyTypeSelectorProps {
20
+ value: CounterpartyType;
21
+ onChange: (value: CounterpartyType) => void;
22
+ disabled?: boolean;
23
+ }
24
+ export declare const CounterpartyTypeSelector: ({ value, onChange, disabled }: CounterpartyTypeSelectorProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,38 @@
1
+ /** The counters ReviewSummary is derived from — the stream's `summary` frame. */
2
+ export interface StreamSummaryCounters {
3
+ /**
4
+ * The run's own id, carried by every `summary` frame. Not used to derive any
5
+ * count — it is how a host keys review-scoped exports (the CPSR packet) off
6
+ * a run it has just watched, without holding a separate re-hydration id.
7
+ */
8
+ review_id?: string;
9
+ severity_mix?: Record<string, number>;
10
+ finding_provenance?: Record<string, number>;
11
+ missing_flowdowns?: number;
12
+ escalations?: number;
13
+ suppressed?: number;
14
+ }
15
+ export interface ReviewSummaryTabProps {
16
+ /** The last run's `summary` frame; null/undefined before any run. */
17
+ payload?: StreamSummaryCounters | null;
18
+ /** Both `summary` and `done` arrived — only then is the run finished. */
19
+ complete?: boolean;
20
+ /** The run was cancelled by the reviewer — not a truncated review. */
21
+ cancelled?: boolean;
22
+ /** A review is streaming right now. */
23
+ running?: boolean;
24
+ /**
25
+ * The last run raised a mid-stream `error` frame (which is also how a close
26
+ * without `done` reaches the host). Covers the truncation that cuts the
27
+ * stream off BEFORE the `summary` frame — there are no counts to show, but
28
+ * the tab must still not read as "no review has run".
29
+ */
30
+ streamErrored?: boolean;
31
+ /**
32
+ * Re-hydration only: a completed review's id whose stream this session did
33
+ * not see. Fetched through GET /v1/reviews/{id}/summary. Omit it (the
34
+ * default) and no request is ever made.
35
+ */
36
+ reviewId?: string | null;
37
+ }
38
+ export declare const ReviewSummaryTab: ({ payload, complete, cancelled, running, streamErrored, reviewId, }: ReviewSummaryTabProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ export { PrimeUploadPanel } from "./PrimeUploadPanel";
2
+ export type { PrimeUploadPanelProps } from "./PrimeUploadPanel";
3
+ export { ApprovalPanel } from "./ApprovalPanel";
4
+ export type { ApprovalPanelProps } from "./ApprovalPanel";
5
+ export { CandidateRuleCard } from "./CandidateRuleCard";
6
+ export type { CandidateRuleCardProps } from "./CandidateRuleCard";
7
+ export { ExecSummaryPanel } from "./ExecSummaryPanel";
8
+ export type { ExecSummaryPanelProps } from "./ExecSummaryPanel";
9
+ export { ReviewSummaryTab } from "./ReviewSummaryTab";
10
+ export type { ReviewSummaryTabProps } from "./ReviewSummaryTab";
11
+ export { GovConToggle, CounterpartyTypeSelector } from "./ReviewStartControls";
12
+ export type { GovConToggleProps, CounterpartyTypeSelectorProps } from "./ReviewStartControls";
13
+ export { ProvenanceBadge, ProvenanceBlock, ClassificationBadge, PositionsBlock } from "./primitives";
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Shared presentational pieces for the R1 (prime flowdown) screens.
3
+ *
4
+ * Skinned entirely via src/styles/tokens.css design tokens (no hardcoded
5
+ * colors), same idiom as components/redline/ReviewCard.tsx: inline styles on
6
+ * CSS custom properties plus one shared CSS string.
7
+ */
8
+ import { type ReactNode } from "react";
9
+ import type { CandidateClassification, R1Provenance, SuggestionPositions } from "@/api/r1";
10
+ export declare const R1_CSS = "\n.r1-root{box-sizing:border-box;font-family:var(--font-ui);color:var(--pb-text-primary)}\n.r1-root *{box-sizing:border-box}\n.r1-btn{font-family:var(--font-ui);border-radius:var(--radius-control);cursor:pointer;font-weight:600;font-size:12px;transition:background .15s ease, border-color .15s ease}\n.r1-btn:disabled{opacity:.55;cursor:default}\n.r1-primary{background:var(--action);color:var(--action-on);border:none;box-shadow:0 1px 2px 0 rgba(0,0,0,.05)}\n.r1-primary:hover:not(:disabled){background:var(--action-hover)}\n.r1-secondary{background:var(--pb-panel);color:var(--pb-text-secondary);border:1px solid var(--pb-border-strong);box-shadow:0 1px 2px 0 rgba(0,0,0,.05)}\n.r1-secondary:hover:not(:disabled){background:var(--pb-card)}\n.dark .r1-primary,.dark .r1-secondary{box-shadow:0 1px 3px rgba(0,0,0,.4)}\n.r1-link{background:none;border:none;padding:0;cursor:pointer;font-family:var(--font-ui);color:var(--action-link);font-weight:600}\n.r1-link:hover{text-decoration:underline}\n.r1-card{transition:border-color .15s ease, box-shadow .15s ease, background .15s ease}\n.r1-prov{cursor:pointer;border:none}\n.r1-prov:hover{text-decoration:underline}\n.r1-scroll{scrollbar-width:thin}\n.r1-textarea{width:100%;font-family:var(--font-document);font-size:12.5px;line-height:1.5;color:var(--pb-text-body);background:var(--pb-panel);border:1px solid var(--pb-border-strong);border-radius:var(--radius-control);padding:8px 10px;resize:vertical;min-height:72px}\n.r1-textarea:focus{outline:none;border-color:var(--action);box-shadow:0 0 0 2px var(--action-tint)}\n";
11
+ export declare const CLASSIFICATION: {
12
+ readonly mandatory: {
13
+ readonly label: "MANDATORY";
14
+ readonly text: "var(--sev-t1-text)";
15
+ readonly bg: "var(--sev-t1-bg)";
16
+ };
17
+ readonly conditionally_mandatory: {
18
+ readonly label: "CONDITIONAL";
19
+ readonly text: "var(--sev-t2-text)";
20
+ readonly bg: "var(--sev-t2-bg)";
21
+ };
22
+ readonly discretionary: {
23
+ readonly label: "DISCRETIONARY";
24
+ readonly text: "var(--sev-t3-text)";
25
+ readonly bg: "var(--sev-t3-bg)";
26
+ };
27
+ };
28
+ export declare const ClassificationBadge: ({ classification, }: {
29
+ classification: CandidateClassification;
30
+ }) => import("react/jsx-runtime").JSX.Element;
31
+ export declare const CitationChip: ({ citation }: {
32
+ citation: string;
33
+ }) => import("react/jsx-runtime").JSX.Element;
34
+ /** The badge alone (no click-through) — "Prime §X" blue ref vs "CDTS" gray. */
35
+ export declare const ProvenanceBadge: ({ provenance, onClick, }: {
36
+ provenance: R1Provenance;
37
+ onClick?: () => void;
38
+ }) => import("react/jsx-runtime").JSX.Element;
39
+ /**
40
+ * Badge + expandable provenance detail: click-through to the verbatim source
41
+ * excerpt, plus the superseded-by-regulatory note when the rule fired but is
42
+ * ignored.
43
+ */
44
+ export declare const ProvenanceBlock: ({ provenance }: {
45
+ provenance: R1Provenance;
46
+ }) => import("react/jsx-runtime").JSX.Element;
47
+ export declare const PositionsBlock: ({ positions }: {
48
+ positions: SuggestionPositions;
49
+ }) => import("react/jsx-runtime").JSX.Element;
50
+ export declare const ErrorStrip: ({ message, action, }: {
51
+ message: string;
52
+ action?: ReactNode;
53
+ }) => import("react/jsx-runtime").JSX.Element;
54
+ export declare const ProgressBar: ({ pct }: {
55
+ pct: number;
56
+ }) => import("react/jsx-runtime").JSX.Element;
57
+ export declare const SectionLabel: ({ children }: {
58
+ children: ReactNode;
59
+ }) => import("react/jsx-runtime").JSX.Element;