@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,372 @@
1
+ /**
2
+ * Resolved-effective rulebook + enforcement modes — `FE_INTEGRATION_R2.md`
3
+ * §4 and §6.
4
+ *
5
+ * `GET /v1/playbooks/effective` answers the panel's real question — "what
6
+ * actually applies to this document, and why" — WITHOUT running a review. It
7
+ * runs the same precedence ladder as evaluate (shared code, golden-pinned), so
8
+ * the preview can't drift from what a run would actually do.
9
+ *
10
+ * Enforcement modes are the GitHub-Rulesets dry-run: `evaluate` mode lets
11
+ * rules report as `would_fire` without ever becoming document redlines.
12
+ */
13
+ import { z } from "zod";
14
+ import { type CdtsScope } from "./playbook";
15
+ /**
16
+ * A PlaybookRule as it appears in `effective`. Passthrough: the wire carries
17
+ * the full rule and the doc only enumerates what FE consumes.
18
+ */
19
+ export declare const effectiveRuleSchema: z.ZodObject<{
20
+ id: z.ZodString;
21
+ playbook_id: z.ZodOptional<z.ZodString>;
22
+ workspace_id: z.ZodOptional<z.ZodString>;
23
+ category: z.ZodOptional<z.ZodString>;
24
+ default_severity: z.ZodOptional<z.ZodString>;
25
+ verbatim_excerpt: z.ZodOptional<z.ZodString>;
26
+ rationale: z.ZodOptional<z.ZodString>;
27
+ authority: z.ZodOptional<z.ZodString>;
28
+ source: z.ZodOptional<z.ZodString>;
29
+ mandatory: z.ZodOptional<z.ZodBoolean>;
30
+ prime_contract_id: z.ZodOptional<z.ZodString>;
31
+ prime_section_ref: z.ZodOptional<z.ZodString>;
32
+ /** §6 evaluate-mode dry run: reports but never becomes a redline. */
33
+ would_fire: z.ZodOptional<z.ZodBoolean>;
34
+ merged_from: z.ZodOptional<z.ZodArray<z.ZodObject<{
35
+ playbook_id: z.ZodOptional<z.ZodString>;
36
+ playbook_scope: z.ZodOptional<z.ZodObject<{
37
+ category: z.ZodOptional<z.ZodString>;
38
+ domain: z.ZodOptional<z.ZodString>;
39
+ type: z.ZodOptional<z.ZodString>;
40
+ subtype: z.ZodOptional<z.ZodString>;
41
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
42
+ category: z.ZodOptional<z.ZodString>;
43
+ domain: z.ZodOptional<z.ZodString>;
44
+ type: z.ZodOptional<z.ZodString>;
45
+ subtype: z.ZodOptional<z.ZodString>;
46
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
47
+ category: z.ZodOptional<z.ZodString>;
48
+ domain: z.ZodOptional<z.ZodString>;
49
+ type: z.ZodOptional<z.ZodString>;
50
+ subtype: z.ZodOptional<z.ZodString>;
51
+ }, z.ZodTypeAny, "passthrough">>>;
52
+ rule_id: z.ZodOptional<z.ZodString>;
53
+ verbatim_excerpt: z.ZodOptional<z.ZodString>;
54
+ authority: z.ZodOptional<z.ZodString>;
55
+ source: z.ZodOptional<z.ZodString>;
56
+ prime_contract_id: z.ZodOptional<z.ZodString>;
57
+ prime_section_ref: z.ZodOptional<z.ZodString>;
58
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
59
+ playbook_id: z.ZodOptional<z.ZodString>;
60
+ playbook_scope: z.ZodOptional<z.ZodObject<{
61
+ category: z.ZodOptional<z.ZodString>;
62
+ domain: z.ZodOptional<z.ZodString>;
63
+ type: z.ZodOptional<z.ZodString>;
64
+ subtype: z.ZodOptional<z.ZodString>;
65
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
66
+ category: z.ZodOptional<z.ZodString>;
67
+ domain: z.ZodOptional<z.ZodString>;
68
+ type: z.ZodOptional<z.ZodString>;
69
+ subtype: z.ZodOptional<z.ZodString>;
70
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
71
+ category: z.ZodOptional<z.ZodString>;
72
+ domain: z.ZodOptional<z.ZodString>;
73
+ type: z.ZodOptional<z.ZodString>;
74
+ subtype: z.ZodOptional<z.ZodString>;
75
+ }, z.ZodTypeAny, "passthrough">>>;
76
+ rule_id: z.ZodOptional<z.ZodString>;
77
+ verbatim_excerpt: z.ZodOptional<z.ZodString>;
78
+ authority: z.ZodOptional<z.ZodString>;
79
+ source: z.ZodOptional<z.ZodString>;
80
+ prime_contract_id: z.ZodOptional<z.ZodString>;
81
+ prime_section_ref: z.ZodOptional<z.ZodString>;
82
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
83
+ playbook_id: z.ZodOptional<z.ZodString>;
84
+ playbook_scope: z.ZodOptional<z.ZodObject<{
85
+ category: z.ZodOptional<z.ZodString>;
86
+ domain: z.ZodOptional<z.ZodString>;
87
+ type: z.ZodOptional<z.ZodString>;
88
+ subtype: z.ZodOptional<z.ZodString>;
89
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
90
+ category: z.ZodOptional<z.ZodString>;
91
+ domain: z.ZodOptional<z.ZodString>;
92
+ type: z.ZodOptional<z.ZodString>;
93
+ subtype: z.ZodOptional<z.ZodString>;
94
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
95
+ category: z.ZodOptional<z.ZodString>;
96
+ domain: z.ZodOptional<z.ZodString>;
97
+ type: z.ZodOptional<z.ZodString>;
98
+ subtype: z.ZodOptional<z.ZodString>;
99
+ }, z.ZodTypeAny, "passthrough">>>;
100
+ rule_id: z.ZodOptional<z.ZodString>;
101
+ verbatim_excerpt: z.ZodOptional<z.ZodString>;
102
+ authority: z.ZodOptional<z.ZodString>;
103
+ source: z.ZodOptional<z.ZodString>;
104
+ prime_contract_id: z.ZodOptional<z.ZodString>;
105
+ prime_section_ref: z.ZodOptional<z.ZodString>;
106
+ }, z.ZodTypeAny, "passthrough">>, "many">>;
107
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
108
+ id: z.ZodString;
109
+ playbook_id: z.ZodOptional<z.ZodString>;
110
+ workspace_id: z.ZodOptional<z.ZodString>;
111
+ category: z.ZodOptional<z.ZodString>;
112
+ default_severity: z.ZodOptional<z.ZodString>;
113
+ verbatim_excerpt: z.ZodOptional<z.ZodString>;
114
+ rationale: z.ZodOptional<z.ZodString>;
115
+ authority: z.ZodOptional<z.ZodString>;
116
+ source: z.ZodOptional<z.ZodString>;
117
+ mandatory: z.ZodOptional<z.ZodBoolean>;
118
+ prime_contract_id: z.ZodOptional<z.ZodString>;
119
+ prime_section_ref: z.ZodOptional<z.ZodString>;
120
+ /** §6 evaluate-mode dry run: reports but never becomes a redline. */
121
+ would_fire: z.ZodOptional<z.ZodBoolean>;
122
+ merged_from: z.ZodOptional<z.ZodArray<z.ZodObject<{
123
+ playbook_id: z.ZodOptional<z.ZodString>;
124
+ playbook_scope: z.ZodOptional<z.ZodObject<{
125
+ category: z.ZodOptional<z.ZodString>;
126
+ domain: z.ZodOptional<z.ZodString>;
127
+ type: z.ZodOptional<z.ZodString>;
128
+ subtype: z.ZodOptional<z.ZodString>;
129
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
130
+ category: z.ZodOptional<z.ZodString>;
131
+ domain: z.ZodOptional<z.ZodString>;
132
+ type: z.ZodOptional<z.ZodString>;
133
+ subtype: z.ZodOptional<z.ZodString>;
134
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
135
+ category: z.ZodOptional<z.ZodString>;
136
+ domain: z.ZodOptional<z.ZodString>;
137
+ type: z.ZodOptional<z.ZodString>;
138
+ subtype: z.ZodOptional<z.ZodString>;
139
+ }, z.ZodTypeAny, "passthrough">>>;
140
+ rule_id: z.ZodOptional<z.ZodString>;
141
+ verbatim_excerpt: z.ZodOptional<z.ZodString>;
142
+ authority: z.ZodOptional<z.ZodString>;
143
+ source: z.ZodOptional<z.ZodString>;
144
+ prime_contract_id: z.ZodOptional<z.ZodString>;
145
+ prime_section_ref: z.ZodOptional<z.ZodString>;
146
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
147
+ playbook_id: z.ZodOptional<z.ZodString>;
148
+ playbook_scope: z.ZodOptional<z.ZodObject<{
149
+ category: z.ZodOptional<z.ZodString>;
150
+ domain: z.ZodOptional<z.ZodString>;
151
+ type: z.ZodOptional<z.ZodString>;
152
+ subtype: z.ZodOptional<z.ZodString>;
153
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
154
+ category: z.ZodOptional<z.ZodString>;
155
+ domain: z.ZodOptional<z.ZodString>;
156
+ type: z.ZodOptional<z.ZodString>;
157
+ subtype: z.ZodOptional<z.ZodString>;
158
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
159
+ category: z.ZodOptional<z.ZodString>;
160
+ domain: z.ZodOptional<z.ZodString>;
161
+ type: z.ZodOptional<z.ZodString>;
162
+ subtype: z.ZodOptional<z.ZodString>;
163
+ }, z.ZodTypeAny, "passthrough">>>;
164
+ rule_id: z.ZodOptional<z.ZodString>;
165
+ verbatim_excerpt: z.ZodOptional<z.ZodString>;
166
+ authority: z.ZodOptional<z.ZodString>;
167
+ source: z.ZodOptional<z.ZodString>;
168
+ prime_contract_id: z.ZodOptional<z.ZodString>;
169
+ prime_section_ref: z.ZodOptional<z.ZodString>;
170
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
171
+ playbook_id: z.ZodOptional<z.ZodString>;
172
+ playbook_scope: z.ZodOptional<z.ZodObject<{
173
+ category: z.ZodOptional<z.ZodString>;
174
+ domain: z.ZodOptional<z.ZodString>;
175
+ type: z.ZodOptional<z.ZodString>;
176
+ subtype: z.ZodOptional<z.ZodString>;
177
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
178
+ category: z.ZodOptional<z.ZodString>;
179
+ domain: z.ZodOptional<z.ZodString>;
180
+ type: z.ZodOptional<z.ZodString>;
181
+ subtype: z.ZodOptional<z.ZodString>;
182
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
183
+ category: z.ZodOptional<z.ZodString>;
184
+ domain: z.ZodOptional<z.ZodString>;
185
+ type: z.ZodOptional<z.ZodString>;
186
+ subtype: z.ZodOptional<z.ZodString>;
187
+ }, z.ZodTypeAny, "passthrough">>>;
188
+ rule_id: z.ZodOptional<z.ZodString>;
189
+ verbatim_excerpt: z.ZodOptional<z.ZodString>;
190
+ authority: z.ZodOptional<z.ZodString>;
191
+ source: z.ZodOptional<z.ZodString>;
192
+ prime_contract_id: z.ZodOptional<z.ZodString>;
193
+ prime_section_ref: z.ZodOptional<z.ZodString>;
194
+ }, z.ZodTypeAny, "passthrough">>, "many">>;
195
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
196
+ id: z.ZodString;
197
+ playbook_id: z.ZodOptional<z.ZodString>;
198
+ workspace_id: z.ZodOptional<z.ZodString>;
199
+ category: z.ZodOptional<z.ZodString>;
200
+ default_severity: z.ZodOptional<z.ZodString>;
201
+ verbatim_excerpt: z.ZodOptional<z.ZodString>;
202
+ rationale: z.ZodOptional<z.ZodString>;
203
+ authority: z.ZodOptional<z.ZodString>;
204
+ source: z.ZodOptional<z.ZodString>;
205
+ mandatory: z.ZodOptional<z.ZodBoolean>;
206
+ prime_contract_id: z.ZodOptional<z.ZodString>;
207
+ prime_section_ref: z.ZodOptional<z.ZodString>;
208
+ /** §6 evaluate-mode dry run: reports but never becomes a redline. */
209
+ would_fire: z.ZodOptional<z.ZodBoolean>;
210
+ merged_from: z.ZodOptional<z.ZodArray<z.ZodObject<{
211
+ playbook_id: z.ZodOptional<z.ZodString>;
212
+ playbook_scope: z.ZodOptional<z.ZodObject<{
213
+ category: z.ZodOptional<z.ZodString>;
214
+ domain: z.ZodOptional<z.ZodString>;
215
+ type: z.ZodOptional<z.ZodString>;
216
+ subtype: z.ZodOptional<z.ZodString>;
217
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
218
+ category: z.ZodOptional<z.ZodString>;
219
+ domain: z.ZodOptional<z.ZodString>;
220
+ type: z.ZodOptional<z.ZodString>;
221
+ subtype: z.ZodOptional<z.ZodString>;
222
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
223
+ category: z.ZodOptional<z.ZodString>;
224
+ domain: z.ZodOptional<z.ZodString>;
225
+ type: z.ZodOptional<z.ZodString>;
226
+ subtype: z.ZodOptional<z.ZodString>;
227
+ }, z.ZodTypeAny, "passthrough">>>;
228
+ rule_id: z.ZodOptional<z.ZodString>;
229
+ verbatim_excerpt: z.ZodOptional<z.ZodString>;
230
+ authority: z.ZodOptional<z.ZodString>;
231
+ source: z.ZodOptional<z.ZodString>;
232
+ prime_contract_id: z.ZodOptional<z.ZodString>;
233
+ prime_section_ref: z.ZodOptional<z.ZodString>;
234
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
235
+ playbook_id: z.ZodOptional<z.ZodString>;
236
+ playbook_scope: z.ZodOptional<z.ZodObject<{
237
+ category: z.ZodOptional<z.ZodString>;
238
+ domain: z.ZodOptional<z.ZodString>;
239
+ type: z.ZodOptional<z.ZodString>;
240
+ subtype: z.ZodOptional<z.ZodString>;
241
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
242
+ category: z.ZodOptional<z.ZodString>;
243
+ domain: z.ZodOptional<z.ZodString>;
244
+ type: z.ZodOptional<z.ZodString>;
245
+ subtype: z.ZodOptional<z.ZodString>;
246
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
247
+ category: z.ZodOptional<z.ZodString>;
248
+ domain: z.ZodOptional<z.ZodString>;
249
+ type: z.ZodOptional<z.ZodString>;
250
+ subtype: z.ZodOptional<z.ZodString>;
251
+ }, z.ZodTypeAny, "passthrough">>>;
252
+ rule_id: z.ZodOptional<z.ZodString>;
253
+ verbatim_excerpt: z.ZodOptional<z.ZodString>;
254
+ authority: z.ZodOptional<z.ZodString>;
255
+ source: z.ZodOptional<z.ZodString>;
256
+ prime_contract_id: z.ZodOptional<z.ZodString>;
257
+ prime_section_ref: z.ZodOptional<z.ZodString>;
258
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
259
+ playbook_id: z.ZodOptional<z.ZodString>;
260
+ playbook_scope: z.ZodOptional<z.ZodObject<{
261
+ category: z.ZodOptional<z.ZodString>;
262
+ domain: z.ZodOptional<z.ZodString>;
263
+ type: z.ZodOptional<z.ZodString>;
264
+ subtype: z.ZodOptional<z.ZodString>;
265
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
266
+ category: z.ZodOptional<z.ZodString>;
267
+ domain: z.ZodOptional<z.ZodString>;
268
+ type: z.ZodOptional<z.ZodString>;
269
+ subtype: z.ZodOptional<z.ZodString>;
270
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
271
+ category: z.ZodOptional<z.ZodString>;
272
+ domain: z.ZodOptional<z.ZodString>;
273
+ type: z.ZodOptional<z.ZodString>;
274
+ subtype: z.ZodOptional<z.ZodString>;
275
+ }, z.ZodTypeAny, "passthrough">>>;
276
+ rule_id: z.ZodOptional<z.ZodString>;
277
+ verbatim_excerpt: z.ZodOptional<z.ZodString>;
278
+ authority: z.ZodOptional<z.ZodString>;
279
+ source: z.ZodOptional<z.ZodString>;
280
+ prime_contract_id: z.ZodOptional<z.ZodString>;
281
+ prime_section_ref: z.ZodOptional<z.ZodString>;
282
+ }, z.ZodTypeAny, "passthrough">>, "many">>;
283
+ }, z.ZodTypeAny, "passthrough">>;
284
+ export declare const supersededRuleSchema: z.ZodObject<{
285
+ rule_id: z.ZodString;
286
+ playbook_id: z.ZodOptional<z.ZodString>;
287
+ winner_rule_id: z.ZodOptional<z.ZodString>;
288
+ reason: z.ZodOptional<z.ZodString>;
289
+ authority: z.ZodOptional<z.ZodString>;
290
+ source: z.ZodOptional<z.ZodString>;
291
+ prime_contract_id: z.ZodOptional<z.ZodString>;
292
+ prime_section_ref: z.ZodOptional<z.ZodString>;
293
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
294
+ rule_id: z.ZodString;
295
+ playbook_id: z.ZodOptional<z.ZodString>;
296
+ winner_rule_id: z.ZodOptional<z.ZodString>;
297
+ reason: z.ZodOptional<z.ZodString>;
298
+ authority: z.ZodOptional<z.ZodString>;
299
+ source: z.ZodOptional<z.ZodString>;
300
+ prime_contract_id: z.ZodOptional<z.ZodString>;
301
+ prime_section_ref: z.ZodOptional<z.ZodString>;
302
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
303
+ rule_id: z.ZodString;
304
+ playbook_id: z.ZodOptional<z.ZodString>;
305
+ winner_rule_id: z.ZodOptional<z.ZodString>;
306
+ reason: z.ZodOptional<z.ZodString>;
307
+ authority: z.ZodOptional<z.ZodString>;
308
+ source: z.ZodOptional<z.ZodString>;
309
+ prime_contract_id: z.ZodOptional<z.ZodString>;
310
+ prime_section_ref: z.ZodOptional<z.ZodString>;
311
+ }, z.ZodTypeAny, "passthrough">>;
312
+ export type EffectiveRule = z.infer<typeof effectiveRuleSchema>;
313
+ export type SupersededRule = z.infer<typeof supersededRuleSchema>;
314
+ export interface EffectiveRulebook {
315
+ effective: EffectiveRule[];
316
+ superseded: SupersededRule[];
317
+ }
318
+ export interface EffectiveRulesOptions {
319
+ /** Union in this prime's derived playbooks. */
320
+ primeContractId?: string;
321
+ /** Explicit derived playbook ids. */
322
+ derivedPlaybookIds?: readonly string[];
323
+ /**
324
+ * CDTS coordinate for the walk. Omit entirely for the workspace's full
325
+ * playbook union (the broadest view) — that is a deliberate mode, not a
326
+ * missing-parameter error.
327
+ */
328
+ scope?: CdtsScope;
329
+ }
330
+ /**
331
+ * Read-only; needs no approval role. A foreign workspace/prime is
332
+ * indistinguishable from nonexistent (404), per the isolation posture.
333
+ */
334
+ export declare const getEffectiveRules: (options?: EffectiveRulesOptions) => Promise<EffectiveRulebook>;
335
+ /**
336
+ * - `active` — enforced (also the unset default).
337
+ * - `evaluate` — dry run: rules report as `would_fire`, never become redlines.
338
+ * - `disabled` — the playbook vanishes from every selection; rules and
339
+ * approvals survive, so re-enabling restores it.
340
+ */
341
+ export type EnforcementMode = "active" | "evaluate" | "disabled";
342
+ /**
343
+ * The mode the backend currently has stored — a kill-switch nobody can read is
344
+ * a kill-switch nobody can trust.
345
+ *
346
+ * There is NO endpoint that reports it directly: the derived-rulebook status
347
+ * DTO (`…/derived/{prime}/status`) drops the header's `mode` column, so the
348
+ * only readable copy is the SERVING playbook the activation projection writes
349
+ * (`store.projectRulebook` stamps `Mode` onto `derived:{prime}`). That
350
+ * projection exists only once the rulebook is ACTIVE, so a draft rulebook
351
+ * answers 404 — which means "not projected yet", NOT "active". The three
352
+ * results are distinguished by the caller; collapsing the third into `active`
353
+ * would assert enforcement is on when nobody knows.
354
+ */
355
+ export type EnforcementModeRead = {
356
+ known: true;
357
+ mode: EnforcementMode;
358
+ }
359
+ /** No serving projection yet (rulebook not active) — the stored mode is unreadable. */
360
+ | {
361
+ known: false;
362
+ reason: "not_projected";
363
+ };
364
+ export declare const getDerivedEnforcementMode: (prime: string) => Promise<EnforcementModeRead>;
365
+ /**
366
+ * Approval-role gated. Persists across restarts and applies immediately — no
367
+ * re-approval, no restart.
368
+ */
369
+ export declare const setDerivedEnforcementMode: (prime: string, mode: EnforcementMode) => Promise<{
370
+ primeContractId: string;
371
+ mode: string;
372
+ }>;
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Review-methodology API module — `GET /v1/skill/methodology`.
3
+ *
4
+ * The backend serves the contract-review methodology prompt VERBATIM as
5
+ * `text/markdown; charset=utf-8` (internal/playbook-engine/api/methodology.go)
6
+ * — deliberately NOT JSON-wrapped, so every consumer gets it unescaped. It is
7
+ * read-only and workspace-independent: the methodology ships with the binary
8
+ * and is identical for every tenant.
9
+ *
10
+ * It cannot ride `request()` from ./playbook, which JSON.parses every body and
11
+ * would reject markdown as a parse error. Hence the small fetch core below —
12
+ * the same shape redlines.ts / redlineStream.ts each carry.
13
+ *
14
+ * Base URL: this is a playbook-engine route, so it defaults to
15
+ * VITE_LAX_AI_PLAYBOOK_URL. A host that calls `configurePlaybookApi({baseUrl})`
16
+ * at runtime should also call `configureMethodologyApi({baseUrl})` — the
17
+ * playbook module's resolved config is module-private and cannot be read here.
18
+ */
19
+ export interface MethodologyApiConfig {
20
+ baseUrl?: string;
21
+ workspaceId?: string;
22
+ getAuthToken?: () => string | undefined | Promise<string | undefined>;
23
+ }
24
+ /** Configure once from the consumer (App.tsx / lax-web-portal). */
25
+ export declare const configureMethodologyApi: (next: MethodologyApiConfig) => void;
26
+ export declare class MethodologyApiError extends Error {
27
+ readonly status?: number;
28
+ constructor(message: string, status?: number);
29
+ }
30
+ /** The methodology prompt, as markdown source. */
31
+ export declare const getMethodology: (opts?: {
32
+ signal?: AbortSignal;
33
+ }) => Promise<string>;
34
+ /**
35
+ * One ATX-heading-delimited section of the methodology.
36
+ *
37
+ * The document is ~10KB of prose. A reviewer asking "why was this flagged?"
38
+ * wants the paragraph that governs their case, not the whole prompt — so the
39
+ * panel navigates by section. Parsing here (rather than pulling in a markdown
40
+ * renderer) keeps the package's zero-new-dependency posture; `react-markdown`
41
+ * is only a PEER dependency of this package and is used nowhere in src/.
42
+ */
43
+ export interface MethodologySection {
44
+ /** Heading depth: 1 for `#`, 2 for `##`, ... */
45
+ level: number;
46
+ title: string;
47
+ /** Body text under the heading, excluding the heading line itself. */
48
+ body: string;
49
+ }
50
+ /**
51
+ * Split markdown into sections at ATX headings. Content before the first
52
+ * heading (HTML comments, license banners) is dropped — it is provenance, not
53
+ * methodology. Fenced code blocks are respected so a `#` comment inside one
54
+ * cannot fake a heading.
55
+ */
56
+ export declare const parseMethodologySections: (markdown: string) => MethodologySection[];
57
+ /**
58
+ * Sections whose title or body mentions every term in the query
59
+ * (case-insensitive). Empty query returns everything, so the panel can use one
60
+ * code path for "browse" and "search".
61
+ */
62
+ export declare const filterMethodologySections: (sections: MethodologySection[], query: string) => MethodologySection[];