@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.
- package/README.md +25 -0
- package/dist/api/audit.d.ts +79 -0
- package/dist/api/derivedRulebook.d.ts +470 -0
- package/dist/api/documentVersions.d.ts +519 -0
- package/dist/api/effectiveRules.d.ts +372 -0
- package/dist/api/methodology.d.ts +62 -0
- package/dist/api/playbook.d.ts +604 -0
- package/dist/api/promotions.d.ts +1432 -0
- package/dist/api/r1.d.ts +1097 -0
- package/dist/api/r1.fixtures.d.ts +111 -0
- package/dist/api/redlineJobs.d.ts +377 -0
- package/dist/api/redlineStream.d.ts +2979 -0
- package/dist/api/redlines.d.ts +504 -0
- package/dist/api/regsync.d.ts +2355 -0
- package/dist/api/ruleAuthoring.d.ts +305 -0
- package/dist/api/ruleBuilder.d.ts +1009 -0
- package/dist/api/ruleOverrides.d.ts +31 -0
- package/dist/api/ruleStats.d.ts +84 -0
- package/dist/api/rulesCatalog.d.ts +234 -0
- package/dist/api/versions.d.ts +76 -0
- package/dist/api/workspace.d.ts +41 -0
- package/dist/components/EditorSidebar.d.ts +4 -1
- package/dist/components/audit/AuditView.d.ts +8 -0
- package/dist/components/capturededits/AddAsRuleModal.d.ts +8 -0
- package/dist/components/capturededits/CapturedEditCard.d.ts +15 -0
- package/dist/components/capturededits/CapturedEditsTray.d.ts +4 -0
- package/dist/components/capturededits/capturedEditIntent.d.ts +23 -0
- package/dist/components/common/EscDropdown.d.ts +2 -0
- package/dist/components/compliance/MethodologyPanel.d.ts +14 -0
- package/dist/components/compliance/RegSyncPanel.d.ts +18 -0
- package/dist/components/compliance/index.d.ts +8 -0
- package/dist/components/compliance/primitives.d.ts +41 -0
- package/dist/components/documents/DocumentVersionHistory.d.ts +12 -0
- package/dist/components/documents/documentDiff.d.ts +68 -0
- package/dist/components/documents/index.d.ts +4 -0
- package/dist/components/flowdown/FlowdownPanel.d.ts +28 -0
- package/dist/components/flowdown/FlowdownRowCard.d.ts +27 -0
- package/dist/components/flowdown/flowdownModel.d.ts +150 -0
- package/dist/components/history/PlaybookVersionHistory.d.ts +10 -0
- package/dist/components/history/versionDiff.d.ts +14 -0
- package/dist/components/playbook/AllPlaybooksView.d.ts +41 -0
- package/dist/components/playbook/DerivedRulebookView.d.ts +9 -0
- package/dist/components/playbook/DraftedRulePreview.d.ts +17 -0
- package/dist/components/playbook/EffectiveRulesView.d.ts +11 -0
- package/dist/components/playbook/NewRuleDrawer.d.ts +11 -0
- package/dist/components/playbook/PlaybookCard.d.ts +13 -0
- package/dist/components/playbook/PlaybookPage.d.ts +29 -0
- package/dist/components/playbook/PlaybookPanel.d.ts +73 -0
- package/dist/components/playbook/PromotionSuggestions.d.ts +1 -0
- package/dist/components/playbook/ReprioritizeDialog.d.ts +16 -0
- package/dist/components/playbook/RuleDetail.d.ts +27 -0
- package/dist/components/playbook/RuleEditorFields.d.ts +42 -0
- package/dist/components/playbook/RuleEditorModal.d.ts +27 -0
- package/dist/components/playbook/RulePerformancePanel.d.ts +4 -0
- package/dist/components/playbook/RuleRow.d.ts +26 -0
- package/dist/components/playbook/ThisDocumentView.d.ts +45 -0
- package/dist/components/playbook/ViewTabs.d.ts +8 -0
- package/dist/components/playbook/index.d.ts +14 -0
- package/dist/components/playbook/predicateSummary.d.ts +10 -0
- package/dist/components/playbook/primitives.d.ts +82 -0
- package/dist/components/playbook/useFocusTrap.d.ts +6 -0
- package/dist/components/playbook/usePlaybookData.d.ts +161 -0
- package/dist/components/playbook/usePlaybookLabel.d.ts +18 -0
- package/dist/components/r1/ApprovalPanel.d.ts +10 -0
- package/dist/components/r1/CandidateRuleCard.d.ts +8 -0
- package/dist/components/r1/ExecSummaryPanel.d.ts +23 -0
- package/dist/components/r1/PrimeUploadPanel.d.ts +8 -0
- package/dist/components/r1/ReviewStartControls.d.ts +24 -0
- package/dist/components/r1/ReviewSummaryTab.d.ts +38 -0
- package/dist/components/r1/index.d.ts +13 -0
- package/dist/components/r1/primitives.d.ts +59 -0
- package/dist/components/redline/AiReviewPanel.d.ts +194 -0
- package/dist/components/redline/RedlineHoverCard.d.ts +13 -0
- package/dist/components/redline/RedlineItem.d.ts +12 -0
- package/dist/components/redline/ReviewCard.d.ts +49 -0
- package/dist/components/redline/index.d.ts +6 -0
- package/dist/components/redline/reviewItems.d.ts +49 -0
- package/dist/components/redline/reviewPrefs.d.ts +18 -0
- package/dist/components/redline/useRunScopedCards.d.ts +16 -0
- package/dist/components/rulebuilder/AuthorForms.d.ts +28 -0
- package/dist/components/rulebuilder/CandidateQueue.d.ts +21 -0
- package/dist/components/rulebuilder/DraftPane.d.ts +12 -0
- package/dist/components/rulebuilder/RuleBuilderPanel.d.ts +6 -0
- package/dist/components/rulebuilder/RuleCard.d.ts +16 -0
- package/dist/components/rulebuilder/TestBench.d.ts +10 -0
- package/dist/components/rulebuilder/VocabularyPanel.d.ts +26 -0
- package/dist/components/rulebuilder/index.d.ts +13 -0
- package/dist/components/rulebuilder/primitives.d.ts +54 -0
- package/dist/components/rulebuilder/useRuleBuilder.d.ts +291 -0
- package/dist/components/sidebar/ExpandableSidebar.d.ts +2 -0
- package/dist/components/sidebar/WorkspaceRetentionPanel.d.ts +18 -0
- package/dist/components/sidebar/content/TrackChangesContent.d.ts +8 -0
- package/dist/components/sidebar/content/anonymization-page/PIIAnonymization.d.ts +1 -1
- package/dist/components/sidebar/content/anonymization-page/PiiIdleView.d.ts +12 -0
- package/dist/components/sidebar/content/anonymization-page/PiiRecoveryView.d.ts +16 -0
- package/dist/components/sidebar/content/anonymization-page/PiiSummaryView.d.ts +34 -0
- package/dist/components/sidebar/content/anonymization-page/PiiUnavailableView.d.ts +1 -0
- package/dist/components/sidebar/content/anonymization-page/RestoreConfirmDialog.d.ts +9 -0
- package/dist/components/sidebar/content/anonymization-page/anonymizationUtils.d.ts +38 -17
- package/dist/components/sidebar/content/anonymization-page/piiVault.d.ts +18 -0
- package/dist/components/sidebar/content/index.d.ts +0 -1
- package/dist/components/toolbar/AutocompletionToggle.d.ts +1 -0
- package/dist/components/trackChanges/TrackChangesCards.d.ts +1 -0
- package/dist/components/trackChanges/index.d.ts +2 -0
- package/dist/components/trackChanges/utils.d.ts +5 -0
- package/dist/config/EditorConfig.d.ts +197 -73
- package/dist/constants/Extensions.d.ts +12 -0
- package/dist/constants/playbook.d.ts +108 -0
- package/dist/contexts/CapturedEditsContext.d.ts +56 -0
- package/dist/contexts/EditorShellContext.d.ts +4 -1
- package/dist/editor.css +1 -1
- package/dist/extensions/AnonymizedText.d.ts +31 -2
- package/dist/extensions/VariableText.d.ts +20 -0
- package/dist/extensions/index.d.ts +1 -1
- package/dist/extensions/plugins/CapturedEditsPlugin.d.ts +90 -0
- package/dist/extensions/plugins/MarkHighlightPlugin.d.ts +0 -1
- package/dist/extensions/plugins/RedlinePlugin.d.ts +9 -0
- package/dist/extensions/redline/changeTypes.d.ts +70 -0
- package/dist/extensions/redline/constants.d.ts +25 -0
- package/dist/extensions/redline/engine/blockNodes.d.ts +31 -0
- package/dist/extensions/redline/engine/clipboard.d.ts +16 -0
- package/dist/extensions/redline/engine/deletion.d.ts +34 -0
- package/dist/extensions/redline/engine/formatSplit.d.ts +16 -0
- package/dist/extensions/redline/engine/insertion.d.ts +26 -0
- package/dist/extensions/redline/engine/predicates.d.ts +73 -0
- package/dist/extensions/redline/engine/textReplace.d.ts +19 -0
- package/dist/extensions/redline/id.d.ts +7 -0
- package/dist/extensions/redline/index.d.ts +36 -0
- package/dist/extensions/redline/plugin.d.ts +34 -0
- package/dist/extensions/redline/query/scan.d.ts +52 -0
- package/dist/extensions/redline/review/applyChange.d.ts +25 -0
- package/dist/extensions/redline/review/index.d.ts +1 -0
- package/dist/extensions/redline/review/nodeResolvers.d.ts +29 -0
- package/dist/extensions/redline/review/pairedNodes.d.ts +38 -0
- package/dist/extensions/redline/review/structuralRevert.d.ts +20 -0
- package/dist/extensions/redline/review/textResolver.d.ts +9 -0
- package/dist/extensions/redline/schema/marks.d.ts +65 -0
- package/dist/extensions/redline/schema/shared.d.ts +34 -0
- package/dist/extensions/redline/session.d.ts +71 -0
- package/dist/extensions/redline/types.d.ts +24 -0
- package/dist/extensions/trackedChanges/TrackedChanges.d.ts +64 -0
- package/dist/extensions/trackedChanges/constants.d.ts +34 -0
- package/dist/extensions/trackedChanges/engine.d.ts +32 -0
- package/dist/extensions/trackedChanges/index.d.ts +13 -0
- package/dist/extensions/trackedChanges/marks.d.ts +20 -0
- package/dist/extensions/trackedChanges/normalize.d.ts +2 -0
- package/dist/extensions/trackedChanges/plugin.d.ts +32 -0
- package/dist/extensions/trackedChanges/query.d.ts +3 -0
- package/dist/extensions/trackedChanges/review.d.ts +34 -0
- package/dist/extensions/trackedChanges/types.d.ts +72 -0
- package/dist/extensions/trackedChanges/utils.d.ts +20 -0
- package/dist/hooks/useMediaQuery.d.ts +2 -0
- package/dist/hooks/useRedlineHover.d.ts +17 -0
- package/dist/hooks/useRedlineReview.d.ts +83 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.es.js +38491 -22189
- package/dist/index.umd.js +224 -125
- package/dist/utils/cdts.d.ts +37 -0
- package/dist/utils/groundingAdapter.d.ts +36 -0
- package/package.json +39 -33
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ruleAuthoring.ts — the "say what you want in English, get a rule" half of
|
|
3
|
+
* the no-code rule builder (plan §P2).
|
|
4
|
+
*
|
|
5
|
+
* POST /v1/rules/author/from-text RULE_AUTHORING_ENABLED
|
|
6
|
+
* POST /v1/rules/author/from-examples RULE_AUTHORING_ENABLED
|
|
7
|
+
* POST /v1/rules/{id}/author/revise RULE_AUTHORING_ENABLED
|
|
8
|
+
*
|
|
9
|
+
* All three are DRAFT-FIRST (`internal/playbook-engine/api/rules_author.go`):
|
|
10
|
+
* they return a validated rule plus warnings and write NOTHING unless
|
|
11
|
+
* `commit: true`, which lands through the same single mutation path
|
|
12
|
+
* `POST /v1/rules` uses. The builder leans on that hard — a lawyer sees the
|
|
13
|
+
* drafted rule, revises it, and only then commits.
|
|
14
|
+
*
|
|
15
|
+
* Two response facts the UI depends on and that are easy to get wrong:
|
|
16
|
+
* - `warnings` is always present (possibly empty) — field-catalog warnings,
|
|
17
|
+
* never a rejection.
|
|
18
|
+
* - `changes` is the revise endpoint's field-level diff and is `omitempty`:
|
|
19
|
+
* an instruction the model decided changed nothing returns NO `changes`
|
|
20
|
+
* key at all. "Absent" means "nothing changed", not "unknown", and the
|
|
21
|
+
* revise UI says so rather than showing an empty diff as a failure.
|
|
22
|
+
*
|
|
23
|
+
* A 422 means the drafted rule failed validation even after the server's one
|
|
24
|
+
* repair round-trip — the fix is to the user's phrasing, so it gets its own
|
|
25
|
+
* error type and its own "rephrase and try again" affordance. A 503 is the
|
|
26
|
+
* LLM gateway, not the request, and gets a retry instead.
|
|
27
|
+
*/
|
|
28
|
+
import { z } from "zod";
|
|
29
|
+
import { type CdtsScope } from "./playbook";
|
|
30
|
+
import { type BuilderRule, type CapabilityStatus } from "./ruleBuilder";
|
|
31
|
+
/** One entry of the revise diff. `before`/`after` are `any` server-side. */
|
|
32
|
+
export declare const ruleFieldChangeSchema: z.ZodObject<{
|
|
33
|
+
field: z.ZodString;
|
|
34
|
+
before: z.ZodUnknown;
|
|
35
|
+
after: z.ZodUnknown;
|
|
36
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
37
|
+
field: z.ZodString;
|
|
38
|
+
before: z.ZodUnknown;
|
|
39
|
+
after: z.ZodUnknown;
|
|
40
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
41
|
+
field: z.ZodString;
|
|
42
|
+
before: z.ZodUnknown;
|
|
43
|
+
after: z.ZodUnknown;
|
|
44
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
45
|
+
export type RuleFieldChange = z.infer<typeof ruleFieldChangeSchema>;
|
|
46
|
+
/** The shared `authorRuleResponse` shape of all three endpoints. */
|
|
47
|
+
export declare const authorRuleResponseSchema: z.ZodObject<{
|
|
48
|
+
rule: z.ZodObject<{
|
|
49
|
+
id: z.ZodString;
|
|
50
|
+
playbook_id: z.ZodString;
|
|
51
|
+
workspace_id: z.ZodOptional<z.ZodString>;
|
|
52
|
+
predicate: z.ZodOptional<z.ZodType<import("./ruleBuilder").PredicateNode, z.ZodTypeDef, import("./ruleBuilder").PredicateNode>>;
|
|
53
|
+
action: z.ZodOptional<z.ZodString>;
|
|
54
|
+
default_severity: z.ZodOptional<z.ZodString>;
|
|
55
|
+
category: z.ZodOptional<z.ZodString>;
|
|
56
|
+
rationale: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
57
|
+
semantic_intent: z.ZodOptional<z.ZodString>;
|
|
58
|
+
source: z.ZodOptional<z.ZodString>;
|
|
59
|
+
read_only: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
+
mandatory: z.ZodOptional<z.ZodBoolean>;
|
|
61
|
+
authority: z.ZodOptional<z.ZodString>;
|
|
62
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
63
|
+
standard_position: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
64
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
65
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
66
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
67
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
68
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
69
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
70
|
+
fallback_condition: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
71
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
72
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
73
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
74
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
75
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
76
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
77
|
+
walkaway_condition: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
78
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
79
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
80
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
81
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
82
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
83
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
84
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
85
|
+
id: z.ZodString;
|
|
86
|
+
playbook_id: z.ZodString;
|
|
87
|
+
workspace_id: z.ZodOptional<z.ZodString>;
|
|
88
|
+
predicate: z.ZodOptional<z.ZodType<import("./ruleBuilder").PredicateNode, z.ZodTypeDef, import("./ruleBuilder").PredicateNode>>;
|
|
89
|
+
action: z.ZodOptional<z.ZodString>;
|
|
90
|
+
default_severity: z.ZodOptional<z.ZodString>;
|
|
91
|
+
category: z.ZodOptional<z.ZodString>;
|
|
92
|
+
rationale: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
93
|
+
semantic_intent: z.ZodOptional<z.ZodString>;
|
|
94
|
+
source: z.ZodOptional<z.ZodString>;
|
|
95
|
+
read_only: z.ZodOptional<z.ZodBoolean>;
|
|
96
|
+
mandatory: z.ZodOptional<z.ZodBoolean>;
|
|
97
|
+
authority: z.ZodOptional<z.ZodString>;
|
|
98
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
99
|
+
standard_position: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
100
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
101
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
102
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
103
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
104
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
105
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
106
|
+
fallback_condition: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
107
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
108
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
109
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
110
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
111
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
112
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
113
|
+
walkaway_condition: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
114
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
115
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
116
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
117
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
118
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
119
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
120
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
121
|
+
id: z.ZodString;
|
|
122
|
+
playbook_id: z.ZodString;
|
|
123
|
+
workspace_id: z.ZodOptional<z.ZodString>;
|
|
124
|
+
predicate: z.ZodOptional<z.ZodType<import("./ruleBuilder").PredicateNode, z.ZodTypeDef, import("./ruleBuilder").PredicateNode>>;
|
|
125
|
+
action: z.ZodOptional<z.ZodString>;
|
|
126
|
+
default_severity: z.ZodOptional<z.ZodString>;
|
|
127
|
+
category: z.ZodOptional<z.ZodString>;
|
|
128
|
+
rationale: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
129
|
+
semantic_intent: z.ZodOptional<z.ZodString>;
|
|
130
|
+
source: z.ZodOptional<z.ZodString>;
|
|
131
|
+
read_only: z.ZodOptional<z.ZodBoolean>;
|
|
132
|
+
mandatory: z.ZodOptional<z.ZodBoolean>;
|
|
133
|
+
authority: z.ZodOptional<z.ZodString>;
|
|
134
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
135
|
+
standard_position: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
136
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
137
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
138
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
139
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
140
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
141
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
142
|
+
fallback_condition: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
143
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
144
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
145
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
146
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
147
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
148
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
149
|
+
walkaway_condition: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
150
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
151
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
152
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
153
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
154
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
155
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
156
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
157
|
+
warnings: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>, string[], string[] | null | undefined>;
|
|
158
|
+
committed: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
159
|
+
/** Absent on from-text / from-examples, and on a no-op revise. */
|
|
160
|
+
changes: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
161
|
+
field: z.ZodString;
|
|
162
|
+
before: z.ZodUnknown;
|
|
163
|
+
after: z.ZodUnknown;
|
|
164
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
165
|
+
field: z.ZodString;
|
|
166
|
+
before: z.ZodUnknown;
|
|
167
|
+
after: z.ZodUnknown;
|
|
168
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
169
|
+
field: z.ZodString;
|
|
170
|
+
before: z.ZodUnknown;
|
|
171
|
+
after: z.ZodUnknown;
|
|
172
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>>, z.objectOutputType<{
|
|
173
|
+
field: z.ZodString;
|
|
174
|
+
before: z.ZodUnknown;
|
|
175
|
+
after: z.ZodUnknown;
|
|
176
|
+
}, z.ZodTypeAny, "passthrough">[], z.objectInputType<{
|
|
177
|
+
field: z.ZodString;
|
|
178
|
+
before: z.ZodUnknown;
|
|
179
|
+
after: z.ZodUnknown;
|
|
180
|
+
}, z.ZodTypeAny, "passthrough">[] | null | undefined>;
|
|
181
|
+
}, "strip", z.ZodTypeAny, {
|
|
182
|
+
changes: z.objectOutputType<{
|
|
183
|
+
field: z.ZodString;
|
|
184
|
+
before: z.ZodUnknown;
|
|
185
|
+
after: z.ZodUnknown;
|
|
186
|
+
}, z.ZodTypeAny, "passthrough">[];
|
|
187
|
+
rule: {
|
|
188
|
+
id: string;
|
|
189
|
+
playbook_id: string;
|
|
190
|
+
rationale: string;
|
|
191
|
+
category?: string | undefined;
|
|
192
|
+
workspace_id?: string | undefined;
|
|
193
|
+
default_severity?: string | undefined;
|
|
194
|
+
standard_position?: z.objectOutputType<{
|
|
195
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
196
|
+
}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
197
|
+
authority?: string | undefined;
|
|
198
|
+
mandatory?: boolean | undefined;
|
|
199
|
+
read_only?: boolean | undefined;
|
|
200
|
+
source?: string | undefined;
|
|
201
|
+
action?: string | undefined;
|
|
202
|
+
semantic_intent?: string | undefined;
|
|
203
|
+
predicate?: import("./ruleBuilder").PredicateNode | undefined;
|
|
204
|
+
effort?: string | undefined;
|
|
205
|
+
fallback_condition?: z.objectOutputType<{
|
|
206
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
207
|
+
}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
208
|
+
walkaway_condition?: z.objectOutputType<{
|
|
209
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
210
|
+
}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
211
|
+
} & {
|
|
212
|
+
[k: string]: unknown;
|
|
213
|
+
};
|
|
214
|
+
warnings: string[];
|
|
215
|
+
committed: boolean;
|
|
216
|
+
}, {
|
|
217
|
+
rule: {
|
|
218
|
+
id: string;
|
|
219
|
+
playbook_id: string;
|
|
220
|
+
category?: string | undefined;
|
|
221
|
+
workspace_id?: string | undefined;
|
|
222
|
+
default_severity?: string | undefined;
|
|
223
|
+
standard_position?: z.objectInputType<{
|
|
224
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
225
|
+
}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
226
|
+
rationale?: string | undefined;
|
|
227
|
+
authority?: string | undefined;
|
|
228
|
+
mandatory?: boolean | undefined;
|
|
229
|
+
read_only?: boolean | undefined;
|
|
230
|
+
source?: string | undefined;
|
|
231
|
+
action?: string | undefined;
|
|
232
|
+
semantic_intent?: string | undefined;
|
|
233
|
+
predicate?: import("./ruleBuilder").PredicateNode | undefined;
|
|
234
|
+
effort?: string | undefined;
|
|
235
|
+
fallback_condition?: z.objectInputType<{
|
|
236
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
237
|
+
}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
238
|
+
walkaway_condition?: z.objectInputType<{
|
|
239
|
+
text: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
240
|
+
}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
241
|
+
} & {
|
|
242
|
+
[k: string]: unknown;
|
|
243
|
+
};
|
|
244
|
+
changes?: z.objectInputType<{
|
|
245
|
+
field: z.ZodString;
|
|
246
|
+
before: z.ZodUnknown;
|
|
247
|
+
after: z.ZodUnknown;
|
|
248
|
+
}, z.ZodTypeAny, "passthrough">[] | null | undefined;
|
|
249
|
+
warnings?: string[] | null | undefined;
|
|
250
|
+
committed?: boolean | undefined;
|
|
251
|
+
}>;
|
|
252
|
+
export type AuthoredRuleDraft = z.infer<typeof authorRuleResponseSchema>;
|
|
253
|
+
/**
|
|
254
|
+
* A 422 from an authoring route: the draft could not be validated even after
|
|
255
|
+
* the server's repair round. Distinct from a transport failure because the
|
|
256
|
+
* remedy is different — rephrase, do not retry.
|
|
257
|
+
*/
|
|
258
|
+
export declare class RuleAuthoringValidationError extends Error {
|
|
259
|
+
constructor(message: string);
|
|
260
|
+
}
|
|
261
|
+
export interface AuthorExample {
|
|
262
|
+
text: string;
|
|
263
|
+
label: "accept" | "reject";
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Handler-side bounds (`validateExamples`), enforced locally too so the form
|
|
267
|
+
* can disable Draft with a reason instead of round-tripping a certain 400.
|
|
268
|
+
*/
|
|
269
|
+
export declare const EXAMPLE_BOUNDS: {
|
|
270
|
+
readonly min: 3;
|
|
271
|
+
readonly max: 10;
|
|
272
|
+
readonly maxTextBytes: 2048;
|
|
273
|
+
};
|
|
274
|
+
/** Returns the blocking reason for an example set, or "" when it is valid. */
|
|
275
|
+
export declare const validateExamples: (examples: AuthorExample[]) => string;
|
|
276
|
+
export interface AuthorFromTextInput {
|
|
277
|
+
playbookId: string;
|
|
278
|
+
text: string;
|
|
279
|
+
/** Steers the prompt only; a rule inherits its playbook's scope. */
|
|
280
|
+
scope?: CdtsScope;
|
|
281
|
+
commit?: boolean;
|
|
282
|
+
}
|
|
283
|
+
/** POST /v1/rules/author/from-text — one plain-English position → one rule. */
|
|
284
|
+
export declare const authorRuleFromText: (input: AuthorFromTextInput) => Promise<AuthoredRuleDraft>;
|
|
285
|
+
export interface AuthorFromExamplesInput {
|
|
286
|
+
playbookId: string;
|
|
287
|
+
examples: AuthorExample[];
|
|
288
|
+
guidance?: string;
|
|
289
|
+
commit?: boolean;
|
|
290
|
+
}
|
|
291
|
+
/** POST /v1/rules/author/from-examples — labelled clauses → one induced rule. */
|
|
292
|
+
export declare const authorRuleFromExamples: (input: AuthorFromExamplesInput) => Promise<AuthoredRuleDraft>;
|
|
293
|
+
export interface ReviseRuleInput {
|
|
294
|
+
instruction: string;
|
|
295
|
+
commit?: boolean;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* POST /v1/rules/{id}/author/revise — an instruction against an EXISTING
|
|
299
|
+
* (stored) rule. The draft returned by from-text/from-examples has no stored
|
|
300
|
+
* identity until it is committed, so revise only applies to a saved rule; the
|
|
301
|
+
* builder gates the control on that rather than 404-ing the user.
|
|
302
|
+
*/
|
|
303
|
+
export declare const reviseRule: (ruleId: string, input: ReviseRuleInput) => Promise<AuthoredRuleDraft>;
|
|
304
|
+
export declare const probeRuleAuthoring: () => Promise<CapabilityStatus>;
|
|
305
|
+
export type { BuilderRule };
|