@azx-pbc/axiom-builder 0.0.0-stage → 0.0.6
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/LICENSE +21 -0
- package/README.md +648 -2
- package/dist/cards/selectors.d.ts +70 -0
- package/dist/cards/selectors.d.ts.map +1 -0
- package/dist/cards/selectors.js +194 -0
- package/dist/cards/selectors.js.map +1 -0
- package/dist/definition.d.ts +36 -0
- package/dist/definition.d.ts.map +1 -0
- package/dist/definition.js +48 -0
- package/dist/definition.js.map +1 -0
- package/dist/evidence/cases.d.ts +44 -0
- package/dist/evidence/cases.d.ts.map +1 -0
- package/dist/evidence/cases.js +578 -0
- package/dist/evidence/cases.js.map +1 -0
- package/dist/evidence/repairs.d.ts +99 -0
- package/dist/evidence/repairs.d.ts.map +1 -0
- package/dist/evidence/repairs.js +181 -0
- package/dist/evidence/repairs.js.map +1 -0
- package/dist/evidence/summary.d.ts +35 -0
- package/dist/evidence/summary.d.ts.map +1 -0
- package/dist/evidence/summary.js +38 -0
- package/dist/evidence/summary.js.map +1 -0
- package/dist/i18n/gaps.d.ts +3 -0
- package/dist/i18n/gaps.d.ts.map +1 -0
- package/dist/i18n/gaps.js +2 -0
- package/dist/i18n/gaps.js.map +1 -0
- package/dist/i18n/message-slots.d.ts +19 -0
- package/dist/i18n/message-slots.d.ts.map +1 -0
- package/dist/i18n/message-slots.js +101 -0
- package/dist/i18n/message-slots.js.map +1 -0
- package/dist/i18n/text-locale.d.ts +13 -0
- package/dist/i18n/text-locale.d.ts.map +1 -0
- package/dist/i18n/text-locale.js +14 -0
- package/dist/i18n/text-locale.js.map +1 -0
- package/dist/i18n/translations.d.ts +56 -0
- package/dist/i18n/translations.d.ts.map +1 -0
- package/dist/i18n/translations.js +103 -0
- package/dist/i18n/translations.js.map +1 -0
- package/dist/impact/references.d.ts +143 -0
- package/dist/impact/references.d.ts.map +1 -0
- package/dist/impact/references.js +429 -0
- package/dist/impact/references.js.map +1 -0
- package/dist/index.d.ts +86 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +58 -0
- package/dist/index.js.map +1 -0
- package/dist/preview/compile-preview.d.ts +67 -0
- package/dist/preview/compile-preview.d.ts.map +1 -0
- package/dist/preview/compile-preview.js +286 -0
- package/dist/preview/compile-preview.js.map +1 -0
- package/dist/preview/handle.d.ts +119 -0
- package/dist/preview/handle.d.ts.map +1 -0
- package/dist/preview/handle.js +2 -0
- package/dist/preview/handle.js.map +1 -0
- package/dist/preview/held.d.ts +39 -0
- package/dist/preview/held.d.ts.map +1 -0
- package/dist/preview/held.js +15 -0
- package/dist/preview/held.js.map +1 -0
- package/dist/preview/measurement.d.ts +5 -0
- package/dist/preview/measurement.d.ts.map +1 -0
- package/dist/preview/measurement.js +18 -0
- package/dist/preview/measurement.js.map +1 -0
- package/dist/publish/build.d.ts +33 -0
- package/dist/publish/build.d.ts.map +1 -0
- package/dist/publish/build.js +15 -0
- package/dist/publish/build.js.map +1 -0
- package/dist/publish/diff.d.ts +208 -0
- package/dist/publish/diff.d.ts.map +1 -0
- package/dist/publish/diff.js +227 -0
- package/dist/publish/diff.js.map +1 -0
- package/dist/publish/review.d.ts +41 -0
- package/dist/publish/review.d.ts.map +1 -0
- package/dist/publish/review.js +22 -0
- package/dist/publish/review.js.map +1 -0
- package/dist/schema/dataset-input.d.ts +30 -0
- package/dist/schema/dataset-input.d.ts.map +1 -0
- package/dist/schema/dataset-input.js +58 -0
- package/dist/schema/dataset-input.js.map +1 -0
- package/dist/schema/dataset.d.ts +166 -0
- package/dist/schema/dataset.d.ts.map +1 -0
- package/dist/schema/dataset.js +281 -0
- package/dist/schema/dataset.js.map +1 -0
- package/dist/schema/declarations.d.ts +15 -0
- package/dist/schema/declarations.d.ts.map +1 -0
- package/dist/schema/declarations.js +47 -0
- package/dist/schema/declarations.js.map +1 -0
- package/dist/schema/document.d.ts +504 -0
- package/dist/schema/document.d.ts.map +1 -0
- package/dist/schema/document.js +337 -0
- package/dist/schema/document.js.map +1 -0
- package/dist/schema/error.d.ts +15 -0
- package/dist/schema/error.d.ts.map +1 -0
- package/dist/schema/error.js +18 -0
- package/dist/schema/error.js.map +1 -0
- package/dist/schema/field-id.d.ts +8 -0
- package/dist/schema/field-id.d.ts.map +1 -0
- package/dist/schema/field-id.js +47 -0
- package/dist/schema/field-id.js.map +1 -0
- package/dist/schema/layout.d.ts +118 -0
- package/dist/schema/layout.d.ts.map +1 -0
- package/dist/schema/layout.js +101 -0
- package/dist/schema/layout.js.map +1 -0
- package/dist/schema/palette.d.ts +103 -0
- package/dist/schema/palette.d.ts.map +1 -0
- package/dist/schema/palette.js +140 -0
- package/dist/schema/palette.js.map +1 -0
- package/dist/schema/read.d.ts +49 -0
- package/dist/schema/read.d.ts.map +1 -0
- package/dist/schema/read.js +942 -0
- package/dist/schema/read.js.map +1 -0
- package/dist/store/apply-dataset.d.ts +14 -0
- package/dist/store/apply-dataset.d.ts.map +1 -0
- package/dist/store/apply-dataset.js +513 -0
- package/dist/store/apply-dataset.js.map +1 -0
- package/dist/store/apply.d.ts +37 -0
- package/dist/store/apply.d.ts.map +1 -0
- package/dist/store/apply.js +2269 -0
- package/dist/store/apply.js.map +1 -0
- package/dist/store/candidate.d.ts +37 -0
- package/dist/store/candidate.d.ts.map +1 -0
- package/dist/store/candidate.js +178 -0
- package/dist/store/candidate.js.map +1 -0
- package/dist/store/commands/coverage.d.ts +58 -0
- package/dist/store/commands/coverage.d.ts.map +1 -0
- package/dist/store/commands/coverage.js +354 -0
- package/dist/store/commands/coverage.js.map +1 -0
- package/dist/store/commands/dataset.d.ts +26 -0
- package/dist/store/commands/dataset.d.ts.map +1 -0
- package/dist/store/commands/dataset.js +368 -0
- package/dist/store/commands/dataset.js.map +1 -0
- package/dist/store/commands/document.d.ts +21 -0
- package/dist/store/commands/document.d.ts.map +1 -0
- package/dist/store/commands/document.js +160 -0
- package/dist/store/commands/document.js.map +1 -0
- package/dist/store/commands/field.d.ts +32 -0
- package/dist/store/commands/field.d.ts.map +1 -0
- package/dist/store/commands/field.js +572 -0
- package/dist/store/commands/field.js.map +1 -0
- package/dist/store/commands/layout.d.ts +16 -0
- package/dist/store/commands/layout.d.ts.map +1 -0
- package/dist/store/commands/layout.js +70 -0
- package/dist/store/commands/layout.js.map +1 -0
- package/dist/store/commands/parse.d.ts +19 -0
- package/dist/store/commands/parse.d.ts.map +1 -0
- package/dist/store/commands/parse.js +328 -0
- package/dist/store/commands/parse.js.map +1 -0
- package/dist/store/commands/readers.d.ts +198 -0
- package/dist/store/commands/readers.d.ts.map +1 -0
- package/dist/store/commands/readers.js +711 -0
- package/dist/store/commands/readers.js.map +1 -0
- package/dist/store/commands/rule.d.ts +24 -0
- package/dist/store/commands/rule.d.ts.map +1 -0
- package/dist/store/commands/rule.js +379 -0
- package/dist/store/commands/rule.js.map +1 -0
- package/dist/store/commands/shapes.d.ts +900 -0
- package/dist/store/commands/shapes.d.ts.map +1 -0
- package/dist/store/commands/shapes.js +166 -0
- package/dist/store/commands/shapes.js.map +1 -0
- package/dist/store/commands/suggestions.d.ts +37 -0
- package/dist/store/commands/suggestions.d.ts.map +1 -0
- package/dist/store/commands/suggestions.js +177 -0
- package/dist/store/commands/suggestions.js.map +1 -0
- package/dist/store/commands.d.ts +16 -0
- package/dist/store/commands.d.ts.map +1 -0
- package/dist/store/commands.js +13 -0
- package/dist/store/commands.js.map +1 -0
- package/dist/store/dataset-candidate.d.ts +33 -0
- package/dist/store/dataset-candidate.d.ts.map +1 -0
- package/dist/store/dataset-candidate.js +31 -0
- package/dist/store/dataset-candidate.js.map +1 -0
- package/dist/store/dataset-pin.d.ts +93 -0
- package/dist/store/dataset-pin.d.ts.map +1 -0
- package/dist/store/dataset-pin.js +86 -0
- package/dist/store/dataset-pin.js.map +1 -0
- package/dist/store/dataset-store.d.ts +96 -0
- package/dist/store/dataset-store.d.ts.map +1 -0
- package/dist/store/dataset-store.js +112 -0
- package/dist/store/dataset-store.js.map +1 -0
- package/dist/store/history.d.ts +149 -0
- package/dist/store/history.d.ts.map +1 -0
- package/dist/store/history.js +173 -0
- package/dist/store/history.js.map +1 -0
- package/dist/store/measurement.d.ts +5 -0
- package/dist/store/measurement.d.ts.map +1 -0
- package/dist/store/measurement.js +20 -0
- package/dist/store/measurement.js.map +1 -0
- package/dist/store/notify.d.ts +11 -0
- package/dist/store/notify.d.ts.map +1 -0
- package/dist/store/notify.js +26 -0
- package/dist/store/notify.js.map +1 -0
- package/dist/store/published.d.ts +50 -0
- package/dist/store/published.d.ts.map +1 -0
- package/dist/store/published.js +27 -0
- package/dist/store/published.js.map +1 -0
- package/dist/store/refusals.d.ts +175 -0
- package/dist/store/refusals.d.ts.map +1 -0
- package/dist/store/refusals.js +160 -0
- package/dist/store/refusals.js.map +1 -0
- package/dist/store/steps.d.ts +14 -0
- package/dist/store/steps.d.ts.map +1 -0
- package/dist/store/steps.js +124 -0
- package/dist/store/steps.js.map +1 -0
- package/dist/store/store.d.ts +142 -0
- package/dist/store/store.d.ts.map +1 -0
- package/dist/store/store.js +136 -0
- package/dist/store/store.js.map +1 -0
- package/dist/store/unchanged.d.ts +12 -0
- package/dist/store/unchanged.d.ts.map +1 -0
- package/dist/store/unchanged.js +35 -0
- package/dist/store/unchanged.js.map +1 -0
- package/dist/visual/emit.d.ts +21 -0
- package/dist/visual/emit.d.ts.map +1 -0
- package/dist/visual/emit.js +133 -0
- package/dist/visual/emit.js.map +1 -0
- package/dist/visual/parse.d.ts +32 -0
- package/dist/visual/parse.d.ts.map +1 -0
- package/dist/visual/parse.js +330 -0
- package/dist/visual/parse.js.map +1 -0
- package/dist/visual/project.d.ts +40 -0
- package/dist/visual/project.d.ts.map +1 -0
- package/dist/visual/project.js +349 -0
- package/dist/visual/project.js.map +1 -0
- package/dist/visual/represent.d.ts +50 -0
- package/dist/visual/represent.d.ts.map +1 -0
- package/dist/visual/represent.js +66 -0
- package/dist/visual/represent.js.map +1 -0
- package/dist/visual/vocabulary.d.ts +121 -0
- package/dist/visual/vocabulary.d.ts.map +1 -0
- package/dist/visual/vocabulary.js +32 -0
- package/dist/visual/vocabulary.js.map +1 -0
- package/package.json +52 -3
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
import { parseExpr, readLayout } from '@azx-pbc/axiom-compiler';
|
|
2
|
+
import { assertNever, collectReadRefs } from '@azx-pbc/axiom-runtime';
|
|
3
|
+
import { documentIndex } from '../schema/declarations.js';
|
|
4
|
+
/** The class of value a slot held, named the way a host would say it to an author. */
|
|
5
|
+
function heldValue(value) {
|
|
6
|
+
if (value === null)
|
|
7
|
+
return 'null';
|
|
8
|
+
if (value === undefined)
|
|
9
|
+
return 'no value';
|
|
10
|
+
if (Array.isArray(value))
|
|
11
|
+
return 'an array';
|
|
12
|
+
return typeof value === 'object' ? 'an object' : `a ${typeof value}`;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* One slot as the draft holds it: its text, or the reason it states no Expr v1 source.
|
|
16
|
+
*
|
|
17
|
+
* Every slot the walk enumerates passes through here, so a rule member and a layout member cannot
|
|
18
|
+
* disagree about what an unreadable value is — one records the slot, the other never drops it.
|
|
19
|
+
*/
|
|
20
|
+
function expressionSlot(source, sourceId, path, value) {
|
|
21
|
+
return typeof value === 'string'
|
|
22
|
+
? { source, sourceId, path, sourceText: value }
|
|
23
|
+
: {
|
|
24
|
+
source,
|
|
25
|
+
sourceId,
|
|
26
|
+
path,
|
|
27
|
+
refusal: `the slot holds ${heldValue(value)} where Expr v1 source belongs`,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Every expression slot one rule states, in the order the artifact declares them.
|
|
32
|
+
*
|
|
33
|
+
* The slot list is the builder's reading of the authoring document, and it is pinned against the
|
|
34
|
+
* runtime's own `ruleExpressions` by a test: the two must enumerate the same trees for the same
|
|
35
|
+
* rule, so a slot the compiler reads cannot go unreported here. That is why `reasons` is read only
|
|
36
|
+
* for `kind: 'screen'`: the runtime folds another kind's reasons into no expression at all, and a
|
|
37
|
+
* malformed draft that states one reads nothing.
|
|
38
|
+
*/
|
|
39
|
+
export function ruleExpressionSlots(rule, base) {
|
|
40
|
+
const slots = [];
|
|
41
|
+
const slot = (path, value) => {
|
|
42
|
+
slots.push(expressionSlot('rule', rule.ruleId, path, value));
|
|
43
|
+
};
|
|
44
|
+
slot(`${base}.expr`, rule.expr);
|
|
45
|
+
if (rule.referWhen !== undefined)
|
|
46
|
+
slot(`${base}.referWhen`, rule.referWhen);
|
|
47
|
+
for (const [name, source] of Object.entries(rule.params ?? {})) {
|
|
48
|
+
slot(`${base}.params.${name}`, source);
|
|
49
|
+
}
|
|
50
|
+
for (const [index, reason] of (rule.kind === 'screen' ? (rule.reasons ?? []) : []).entries()) {
|
|
51
|
+
slot(`${base}.reasons[${String(index)}].when`, reason.when);
|
|
52
|
+
for (const [name, source] of Object.entries(reason.params ?? {})) {
|
|
53
|
+
slot(`${base}.reasons[${String(index)}].params.${name}`, source);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if (rule.gate?.activeWhen !== undefined)
|
|
57
|
+
slot(`${base}.gate.activeWhen`, rule.gate.activeWhen);
|
|
58
|
+
for (const [index, item] of (rule.gate?.items ?? []).entries()) {
|
|
59
|
+
slot(`${base}.gate.items[${String(index)}].expr`, item.expr);
|
|
60
|
+
for (const [name, source] of Object.entries(item.params ?? {})) {
|
|
61
|
+
slot(`${base}.gate.items[${String(index)}].params.${name}`, source);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
suggestionSlots(rule.suggests ?? [], `${base}.suggests`, slot);
|
|
65
|
+
return slots;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The expression slots one list of alternatives states.
|
|
69
|
+
*
|
|
70
|
+
* A `value` operation's expression and an `append` row template's members are Expr v1 source in an
|
|
71
|
+
* authored draft, so a field either of them reads is not safe to remove. A `null`, `remove` or
|
|
72
|
+
* `removeRow` operation holds no expression and contributes no slot.
|
|
73
|
+
*/
|
|
74
|
+
function suggestionSlots(suggestions, base, slot) {
|
|
75
|
+
for (const [index, suggestion] of suggestions.entries()) {
|
|
76
|
+
for (const [position, operation] of suggestion.operations.entries()) {
|
|
77
|
+
const at = `${base}[${String(index)}].operations[${String(position)}]`;
|
|
78
|
+
switch (operation.kind) {
|
|
79
|
+
case 'value':
|
|
80
|
+
slot(`${at}.value`, operation.value);
|
|
81
|
+
break;
|
|
82
|
+
case 'append':
|
|
83
|
+
for (const [member, source] of Object.entries(operation.row)) {
|
|
84
|
+
slot(`${at}.row.${member}`, source);
|
|
85
|
+
}
|
|
86
|
+
break;
|
|
87
|
+
case 'null':
|
|
88
|
+
case 'remove':
|
|
89
|
+
case 'removeRow':
|
|
90
|
+
break;
|
|
91
|
+
default:
|
|
92
|
+
assertNever(operation);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Every expression slot the layout states, in declaration order.
|
|
99
|
+
*
|
|
100
|
+
* A chrome node's `visibleWhen`, its message `params` and a summary readout's value are Expr v1
|
|
101
|
+
* source in an authored document, and C11 lets a chrome condition read a declared field, so a
|
|
102
|
+
* field one of them names is not safe to delete either. A member the node does not state is
|
|
103
|
+
* absent rather than unreadable and contributes no slot; a member it states as something other
|
|
104
|
+
* than text is a slot the report names instead of dropping.
|
|
105
|
+
*/
|
|
106
|
+
function layoutExpressionSlots(nodes, slots = []) {
|
|
107
|
+
for (const node of nodes) {
|
|
108
|
+
const slot = (path, value) => {
|
|
109
|
+
if (value === undefined)
|
|
110
|
+
return;
|
|
111
|
+
slots.push(expressionSlot('layout', node.path, path, value));
|
|
112
|
+
};
|
|
113
|
+
slot(`${node.path}.visibleWhen`, node.visibleWhen);
|
|
114
|
+
for (const [name, source] of Object.entries(node.params ?? {})) {
|
|
115
|
+
slot(`${node.path}.params.${name}`, source);
|
|
116
|
+
}
|
|
117
|
+
for (const [index, readout] of node.readouts.entries()) {
|
|
118
|
+
slot(`${node.path}.readouts[${String(index)}].value`, readout.value);
|
|
119
|
+
}
|
|
120
|
+
layoutExpressionSlots(node.children, slots);
|
|
121
|
+
}
|
|
122
|
+
return slots;
|
|
123
|
+
}
|
|
124
|
+
/** Every declaration at any nesting level, with its own `$.fields[…]` path and row scope. */
|
|
125
|
+
function placedFields(fields, path, placed = [], itemFieldId) {
|
|
126
|
+
for (const [index, field] of fields.entries()) {
|
|
127
|
+
const here = `${path}[${String(index)}]`;
|
|
128
|
+
placed.push({ field, path: here, ...(itemFieldId === undefined ? {} : { itemFieldId }) });
|
|
129
|
+
if (field.fields !== undefined) {
|
|
130
|
+
// Only an array's direct members read `$it` as that array's row. A record nested in the row
|
|
131
|
+
// has members of its own, not the array's direct row scope.
|
|
132
|
+
placedFields(field.fields, `${here}.fields`, placed, field.primitive === 'array' ? field.fieldId : undefined);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return placed;
|
|
136
|
+
}
|
|
137
|
+
/** The message keys one declaration names, in declaration order, without repeats. */
|
|
138
|
+
function declarationMessageKeys(field) {
|
|
139
|
+
const keys = new Set();
|
|
140
|
+
for (const key of [field.labelKey, field.descriptionKey, field.placeholderKey]) {
|
|
141
|
+
if (key !== undefined)
|
|
142
|
+
keys.add(key);
|
|
143
|
+
}
|
|
144
|
+
for (const option of field.options ?? []) {
|
|
145
|
+
keys.add(option.labelKey);
|
|
146
|
+
if (option.unavailableMessageKey !== undefined)
|
|
147
|
+
keys.add(option.unavailableMessageKey);
|
|
148
|
+
for (const suggestion of option.suggests ?? [])
|
|
149
|
+
keys.add(suggestion.labelKey);
|
|
150
|
+
}
|
|
151
|
+
return [...keys];
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Every reference a draft holds to one field, and every expression slot it could not read.
|
|
155
|
+
*
|
|
156
|
+
* A field id may sit inside a container — a row member is named by `targetFieldId` in an item
|
|
157
|
+
* rule, by a layout leaf under the array, and by a signature's coverage — so the walk covers the
|
|
158
|
+
* whole declaration tree rather than the top level only.
|
|
159
|
+
*
|
|
160
|
+
* One pass answers every field. The document is immutable by contract and the store rebuilds the
|
|
161
|
+
* declarations a command touched, so the answer is held against the document's identity: the
|
|
162
|
+
* first question parses each slot once and the next five hundred read that answer, rather than
|
|
163
|
+
* parsing the document once per field. An in-place mutation would break the same immutability the
|
|
164
|
+
* history's structural sharing relies on, so it is outside this contract by construction.
|
|
165
|
+
*/
|
|
166
|
+
export function referencesOf(document, fieldId) {
|
|
167
|
+
const held = documentReferencesOf(document);
|
|
168
|
+
// Fresh arrays per answer: the index is shared, and the caller's list is the caller's to hold.
|
|
169
|
+
return {
|
|
170
|
+
fieldId,
|
|
171
|
+
dependencyReads: [...(held.dependencyReads.get(fieldId) ?? [])],
|
|
172
|
+
references: [...(held.references.get(fieldId) ?? [])],
|
|
173
|
+
messageKeys: [...(held.messageKeys.get(fieldId) ?? [])],
|
|
174
|
+
unparseable: [...held.unparseable],
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
/** Answers keyed by the document object the walk read. */
|
|
178
|
+
const documentReferences = new WeakMap();
|
|
179
|
+
/** The expression slots this process has parsed; a measurement hook, never an input. */
|
|
180
|
+
let slotParses = 0;
|
|
181
|
+
/** The expression slots the impact walk has parsed since the process started. */
|
|
182
|
+
export function expressionSlotParses() {
|
|
183
|
+
return slotParses;
|
|
184
|
+
}
|
|
185
|
+
/** Adds one reference to the list keyed by the field it names. */
|
|
186
|
+
function pushReference(references, fieldId, reference) {
|
|
187
|
+
const held = references.get(fieldId);
|
|
188
|
+
if (held === undefined)
|
|
189
|
+
references.set(fieldId, [reference]);
|
|
190
|
+
else
|
|
191
|
+
held.push(reference);
|
|
192
|
+
}
|
|
193
|
+
/** Adds one read to the list keyed by the field it read. */
|
|
194
|
+
function pushRead(reads, fieldId, read) {
|
|
195
|
+
const held = reads.get(fieldId);
|
|
196
|
+
if (held === undefined)
|
|
197
|
+
reads.set(fieldId, [read]);
|
|
198
|
+
else
|
|
199
|
+
held.push(read);
|
|
200
|
+
}
|
|
201
|
+
/** Adds one message key to the list the declaration it belongs to names. */
|
|
202
|
+
function pushMessageKey(keys, fieldId, key) {
|
|
203
|
+
const held = keys.get(fieldId);
|
|
204
|
+
if (held === undefined)
|
|
205
|
+
keys.set(fieldId, [key]);
|
|
206
|
+
else
|
|
207
|
+
held.push(key);
|
|
208
|
+
}
|
|
209
|
+
/** Reads every slot the draft states, recording each read under the field it read. */
|
|
210
|
+
function readSlots(slots, itemFieldId, index, dependencyReads, unparseable) {
|
|
211
|
+
for (const slot of slots) {
|
|
212
|
+
if ('refusal' in slot) {
|
|
213
|
+
unparseable.push({
|
|
214
|
+
source: slot.source,
|
|
215
|
+
sourceId: slot.sourceId,
|
|
216
|
+
path: slot.path,
|
|
217
|
+
detail: slot.refusal,
|
|
218
|
+
});
|
|
219
|
+
continue;
|
|
220
|
+
}
|
|
221
|
+
slotParses += 1;
|
|
222
|
+
const parsed = parseExpr(slot.sourceText);
|
|
223
|
+
if (!parsed.ok) {
|
|
224
|
+
unparseable.push({
|
|
225
|
+
source: slot.source,
|
|
226
|
+
sourceId: slot.sourceId,
|
|
227
|
+
path: slot.path,
|
|
228
|
+
detail: parsed.diagnostics[0]?.detail ?? 'the expression does not parse',
|
|
229
|
+
});
|
|
230
|
+
continue;
|
|
231
|
+
}
|
|
232
|
+
// One slot at a time rather than one batch per rule: the report names the slot a read came
|
|
233
|
+
// from, and a batch walk merges the slots' reads into one set with no way back.
|
|
234
|
+
for (const read of collectReadRefs([parsed.node], index, itemFieldId).reads) {
|
|
235
|
+
pushRead(dependencyReads, read.fieldId, {
|
|
236
|
+
source: slot.source,
|
|
237
|
+
sourceId: slot.sourceId,
|
|
238
|
+
path: slot.path,
|
|
239
|
+
rowScoped: read.rowScoped,
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
/** Builds, or returns, one document's whole read answer. */
|
|
245
|
+
function documentReferencesOf(document) {
|
|
246
|
+
const cached = documentReferences.get(document);
|
|
247
|
+
if (cached !== undefined)
|
|
248
|
+
return cached;
|
|
249
|
+
const index = documentIndex(document);
|
|
250
|
+
const dependencyReads = new Map();
|
|
251
|
+
const references = new Map();
|
|
252
|
+
const messageKeys = new Map();
|
|
253
|
+
const unparseable = [];
|
|
254
|
+
const add = (target, reference) => pushReference(references, target, reference);
|
|
255
|
+
for (const [position, rule] of (document.rules ?? []).entries()) {
|
|
256
|
+
const base = `$.rules[${String(position)}]`;
|
|
257
|
+
readSlots(ruleExpressionSlots(rule, base), rule.scope === 'item' ? rule.fieldId : undefined, index, dependencyReads, unparseable);
|
|
258
|
+
addRuleFieldReferences(rule, base, add);
|
|
259
|
+
}
|
|
260
|
+
const layout = readLayout(document);
|
|
261
|
+
readSlots(layoutExpressionSlots(layout), undefined, index, dependencyReads, unparseable);
|
|
262
|
+
addLayoutFieldReferences(layout, add);
|
|
263
|
+
for (const { field, path, itemFieldId } of placedFields(document.fields, '$.fields')) {
|
|
264
|
+
addDeclarationFieldReferences(field, path, add);
|
|
265
|
+
// An array's `rowsFrom` is Expr v1 source in an authored draft, so a field it reads is not
|
|
266
|
+
// safe to remove either. It evaluates in the array's scope rather than an item's, so the read
|
|
267
|
+
// is not row-scoped.
|
|
268
|
+
if (field.rowsFrom !== undefined) {
|
|
269
|
+
readSlots([expressionSlot('field', field.fieldId, `${path}.rowsFrom`, field.rowsFrom)], undefined, index, dependencyReads, unparseable);
|
|
270
|
+
}
|
|
271
|
+
// An option's availability and the alternatives it offers are authored source too, so a read
|
|
272
|
+
// through one is a read the author cannot delete the field behind.
|
|
273
|
+
for (const [position, option] of (field.options ?? []).entries()) {
|
|
274
|
+
const at = `${path}.options[${String(position)}]`;
|
|
275
|
+
const slots = [];
|
|
276
|
+
const slot = (slotPath, value) => {
|
|
277
|
+
slots.push(expressionSlot('field', field.fieldId, slotPath, value));
|
|
278
|
+
};
|
|
279
|
+
if (option.availableWhen !== undefined)
|
|
280
|
+
slot(`${at}.availableWhen`, option.availableWhen);
|
|
281
|
+
for (const [name, source] of Object.entries(option.unavailableParams ?? {})) {
|
|
282
|
+
slot(`${at}.unavailableParams.${name}`, source);
|
|
283
|
+
}
|
|
284
|
+
suggestionSlots(option.suggests ?? [], `${at}.suggests`, slot);
|
|
285
|
+
readSlots(slots, itemFieldId, index, dependencyReads, unparseable);
|
|
286
|
+
}
|
|
287
|
+
// A declaration's conditions compile into rules, but the authored draft holds the source on
|
|
288
|
+
// the declaration. A field a `visibleWhen`/`requiredWhen` reads is as dependent as a field a
|
|
289
|
+
// declared rule reads; omitting these slots let a remove leave `UNKNOWN_IDENTIFIER` behind.
|
|
290
|
+
for (const member of ['visibleWhen', 'requiredWhen']) {
|
|
291
|
+
const source = field[member];
|
|
292
|
+
if (source === undefined)
|
|
293
|
+
continue;
|
|
294
|
+
readSlots([expressionSlot('field', field.fieldId, `${path}.${member}`, source)], itemFieldId, index, dependencyReads, unparseable);
|
|
295
|
+
}
|
|
296
|
+
for (const key of declarationMessageKeys(field)) {
|
|
297
|
+
pushMessageKey(messageKeys, field.fieldId, key);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
const built = { dependencyReads, references, messageKeys, unparseable };
|
|
301
|
+
documentReferences.set(document, built);
|
|
302
|
+
return built;
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* The field one access rule's match names, or `undefined` for a section rule.
|
|
306
|
+
*
|
|
307
|
+
* A match spells three ways: the exact id, `id.*` for a container, and `id@…` for a row or a
|
|
308
|
+
* template. None of the three is a second field id, so the reference belongs to the base the
|
|
309
|
+
* match starts with — which is the id a delete question asks about.
|
|
310
|
+
*/
|
|
311
|
+
function accessMatchFieldId(rule) {
|
|
312
|
+
if (rule.kind === 'section')
|
|
313
|
+
return undefined;
|
|
314
|
+
const at = rule.match.indexOf('@');
|
|
315
|
+
const base = at === -1 ? rule.match : rule.match.slice(0, at);
|
|
316
|
+
return base.endsWith('.*') ? base.slice(0, -2) : base;
|
|
317
|
+
}
|
|
318
|
+
/** One reference a rule member states, filed under the field it names. */
|
|
319
|
+
function ruleReference(rule, kind, path) {
|
|
320
|
+
return { kind, path, ruleId: rule.ruleId };
|
|
321
|
+
}
|
|
322
|
+
/** Files the rule members that name a field without holding an expression. */
|
|
323
|
+
function addRuleFieldReferences(rule, base, add) {
|
|
324
|
+
if (rule.fieldId !== undefined)
|
|
325
|
+
add(rule.fieldId, ruleReference(rule, 'rule_field', `${base}.fieldId`));
|
|
326
|
+
for (const [index, target] of (rule.fieldIds ?? []).entries()) {
|
|
327
|
+
add(target, ruleReference(rule, 'rule_field_ids', `${base}.fieldIds[${String(index)}]`));
|
|
328
|
+
}
|
|
329
|
+
if (rule.targetFieldId !== undefined) {
|
|
330
|
+
add(rule.targetFieldId, ruleReference(rule, 'rule_target', `${base}.targetFieldId`));
|
|
331
|
+
}
|
|
332
|
+
if (rule.overrideFieldId !== undefined) {
|
|
333
|
+
add(rule.overrideFieldId, ruleReference(rule, 'rule_override', `${base}.overrideFieldId`));
|
|
334
|
+
}
|
|
335
|
+
for (const [index, testCase] of (rule.testCases ?? []).entries()) {
|
|
336
|
+
const at = `${base}.testCases[${String(index)}]`;
|
|
337
|
+
for (const key of Object.keys(testCase.values ?? {})) {
|
|
338
|
+
add(key, ruleReference(rule, 'rule_case', `${at}.values.${key}`));
|
|
339
|
+
}
|
|
340
|
+
for (const member of ['redacted', 'sessionWrites']) {
|
|
341
|
+
for (const [refIndex, reference] of (testCase[member] ?? []).entries()) {
|
|
342
|
+
add(reference.fieldId, ruleReference(rule, 'rule_case', `${at}.${member}[${String(refIndex)}].fieldId`));
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
const overlay = testCase.accessOverlay;
|
|
346
|
+
for (const [allowIndex, allowed] of (overlay?.allowMaskedRead ?? []).entries()) {
|
|
347
|
+
add(allowed, ruleReference(rule, 'rule_case', `${at}.accessOverlay.allowMaskedRead[${String(allowIndex)}]`));
|
|
348
|
+
}
|
|
349
|
+
for (const [ruleIndex, accessRule] of (overlay?.rules ?? []).entries()) {
|
|
350
|
+
const named = accessMatchFieldId(accessRule);
|
|
351
|
+
if (named === undefined)
|
|
352
|
+
continue;
|
|
353
|
+
add(named, ruleReference(rule, 'rule_case', `${at}.accessOverlay.rules[${String(ruleIndex)}].match`));
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
addSuggestionReferences(rule.suggests ?? [], `${base}.suggests`, 'rule_suggestion', add, rule.ruleId);
|
|
357
|
+
}
|
|
358
|
+
/** Files the fields one list of alternatives writes, including each member an append template states. */
|
|
359
|
+
function addSuggestionReferences(suggestions, base, kind, add, ruleId, sourceFieldId) {
|
|
360
|
+
const reference = (path) => ({
|
|
361
|
+
kind,
|
|
362
|
+
path,
|
|
363
|
+
...(ruleId === undefined ? {} : { ruleId }),
|
|
364
|
+
...(sourceFieldId === undefined ? {} : { sourceFieldId }),
|
|
365
|
+
});
|
|
366
|
+
for (const [index, suggestion] of suggestions.entries()) {
|
|
367
|
+
for (const [position, operation] of suggestion.operations.entries()) {
|
|
368
|
+
const at = `${base}[${String(index)}].operations[${String(position)}]`;
|
|
369
|
+
switch (operation.kind) {
|
|
370
|
+
case 'value':
|
|
371
|
+
case 'null':
|
|
372
|
+
case 'remove':
|
|
373
|
+
add(operation.ref.fieldId, reference(`${at}.ref.fieldId`));
|
|
374
|
+
break;
|
|
375
|
+
case 'append':
|
|
376
|
+
add(operation.fieldId, reference(`${at}.fieldId`));
|
|
377
|
+
for (const member of Object.keys(operation.row)) {
|
|
378
|
+
add(member, reference(`${at}.row.${member}`));
|
|
379
|
+
}
|
|
380
|
+
break;
|
|
381
|
+
case 'removeRow':
|
|
382
|
+
add(operation.fieldId, reference(`${at}.fieldId`));
|
|
383
|
+
break;
|
|
384
|
+
default:
|
|
385
|
+
assertNever(operation);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
/** Files the layout slots that place or list a field. */
|
|
391
|
+
function addLayoutFieldReferences(nodes, add) {
|
|
392
|
+
const visit = (node) => {
|
|
393
|
+
if (node.fieldId !== undefined) {
|
|
394
|
+
add(node.fieldId, { kind: 'layout_field', path: `${node.path}.fieldId` });
|
|
395
|
+
}
|
|
396
|
+
for (const [index, name] of node.fields.entries()) {
|
|
397
|
+
add(name, { kind: 'layout_field', path: `${node.path}.fields[${String(index)}]` });
|
|
398
|
+
}
|
|
399
|
+
for (const child of node.children)
|
|
400
|
+
visit(child);
|
|
401
|
+
};
|
|
402
|
+
for (const node of nodes)
|
|
403
|
+
visit(node);
|
|
404
|
+
}
|
|
405
|
+
/** Files the declaration members that name another field. */
|
|
406
|
+
function addDeclarationFieldReferences(field, path, add) {
|
|
407
|
+
if (field.rowKey?.mode === 'natural' && field.rowKey.fieldId !== undefined) {
|
|
408
|
+
add(field.rowKey.fieldId, { kind: 'row_key', path: `${path}.rowKey.fieldId` });
|
|
409
|
+
}
|
|
410
|
+
for (const [index, covered] of (field.covers ?? []).entries()) {
|
|
411
|
+
add(covered, { kind: 'signature_cover', path: `${path}.covers[${String(index)}]` });
|
|
412
|
+
}
|
|
413
|
+
const optionSource = field.optionSource;
|
|
414
|
+
if (optionSource?.kind === 'field') {
|
|
415
|
+
add(optionSource.fieldId, { kind: 'option_source', path: `${path}.optionSource.fieldId` });
|
|
416
|
+
}
|
|
417
|
+
if (optionSource?.kind === 'host') {
|
|
418
|
+
for (const [index, depended] of (optionSource.dependsOn ?? []).entries()) {
|
|
419
|
+
add(depended, {
|
|
420
|
+
kind: 'option_source',
|
|
421
|
+
path: `${path}.optionSource.dependsOn[${String(index)}]`,
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
for (const [index, option] of (field.options ?? []).entries()) {
|
|
426
|
+
addSuggestionReferences(option.suggests ?? [], `${path}.options[${String(index)}].suggests`, 'option_suggestion', add, undefined, field.fieldId);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
//# sourceMappingURL=references.js.map
|
|
@@ -0,0 +1 @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IAAI,YAAY,MAAM,CAAC,KAAK,CAAC,YAAY,EAC5C,mBAAmB,EACnB,GAAG,EACH,SAAS,EACT,KAAK,CAAC,OAAO,CACd,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import { parseExpr, readLayout } from '@azx-pbc/axiom-compiler';\nimport type { RawLayoutNode } from '@azx-pbc/axiom-compiler';\nimport { assertNever, collectReadRefs } from '@azx-pbc/axiom-runtime';\nimport type { AccessOverlayRule, RecordIndex } from '@azx-pbc/axiom-runtime';\nimport { documentIndex } from '../schema/declarations.js';\nimport type {\n AuthoringDocument,\n AuthoringField,\n AuthoringRule,\n AuthoringSuggestion,\n} from '../schema/document.js';\n\n/**\n * What a draft says about one field, read without compiling it.\n *\n * A builder must answer \"what happens if I delete this field?\" while the draft is still\n * unfinished, so the answer cannot come from a compiled artifact. It comes from the same walk the\n * compiler's own dependency report uses — the runtime's `collectReadRefs` over `parseExpr` trees —\n * and from the document members that name a field without holding an expression.\n *\n * The report separates the halves because they answer different questions:\n *\n * - `dependencyReads` is expression reads, the half a compiled artifact also reports. Its\n * rule-sourced entries are exactly what `ruleReads` reports for that rule in an artifact\n * compiled from the same document, so \"safe to delete\" cannot disagree with the compiled\n * dependency report; layout reads and an array's `rowsFrom` reads are reported only here, and\n * `inspectDeps` carries neither layout reads nor `rowScoped`.\n * - `references` is every non-expression slot that names the field: a rule target, a layout\n * placement, a signature's bound coverage, an option source's key field, a test case's inputs\n * and access references, and a natural row key's member.\n * - `messageKeys` is the message keys the declaration itself names. They are cleanup candidates,\n * not proof of disuse: another declaration or layout node may share a key. They are not\n * references to the field, so they stay out of `references`.\n * - `unparseable` is every expression slot the draft holds that the parser refused, and every slot\n * that holds no text at all. Either could read any field, so while this list is non-empty no\n * field is proven unreferenced: the caller repairs or reads the named slots before deleting.\n *\n * A rule that parses but names an undeclared field is *not* unparseable. The parser does not\n * typecheck, so its path still reports as a read of that name — which is what a typo looks like\n * from here, and is the useful answer while the author is still typing.\n *\n * Cost: one parse and one read walk per expression slot for the whole document, and one layout\n * read, held against the document's identity until the document object changes. A call is a\n * lookup plus a copy of one field's list, so reporting on every field of a large draft shares the\n * one pass instead of walking the document once per field.\n */\n\n/**\n * One expression slot a draft states: the text to read, or the reason it holds no Expr v1 source.\n *\n * A document a host loads is only as well typed as the file it came from, so a slot can hold\n * `null`, a number or an object. A slot is still a slot — naming it unparseable is what keeps the\n * report honest — but it never reaches the parser, which expects text.\n */\nexport type ExpressionSlot =\n | {\n readonly source: 'rule' | 'layout' | 'field';\n /** The rule's id, the layout node's document path, or the declaring field's id. */\n readonly sourceId: string;\n /** The slot's location in the draft, in the compiler's diagnostic path spelling. */\n readonly path: string;\n readonly sourceText: string;\n }\n | {\n readonly source: 'rule' | 'layout' | 'field';\n readonly sourceId: string;\n readonly path: string;\n /** Why this slot holds no Expr v1 source text. */\n readonly refusal: string;\n };\n\n/** One field read through an expression, with the slot that read it. */\nexport interface DependencyRead {\n readonly source: 'rule' | 'layout' | 'field';\n /** The rule's id, the layout node's document path, or the declaring field's id. */\n readonly sourceId: string;\n /** The expression slot that read the field. */\n readonly path: string;\n /** Whether the read happened through the rule's own item scope. */\n readonly rowScoped: boolean;\n}\n\n/** The kinds of non-expression slot that can name a field. */\nexport type FieldReferenceKind =\n /** A rule's `fieldId`: the field it targets, or the array an item rule addresses. */\n | 'rule_field'\n /** One entry of a rule's `fieldIds`, the targets a multi-target rule decides. */\n | 'rule_field_ids'\n /** A rule's `targetFieldId`: the row member an item rule writes or constrains. */\n | 'rule_target'\n /** A `defaultCompute` rule's `overrideFieldId`: the companion field it stores overrides in. */\n | 'rule_override'\n /** A field one of a rule's alternatives writes, `RULES-6.1.1`. */\n | 'rule_suggestion'\n /** A field one of an option's alternatives writes, `RULES-7.1.4`. */\n | 'option_suggestion'\n /** A field a rule's embedded test case supplies, redacts, writes or grants access to. */\n | 'rule_case'\n /** A layout node that places the field, or lists it among a summary's fields. */\n | 'layout_field'\n /** One entry of a `signature_capture` field's `covers`. */\n | 'signature_cover'\n /** A `dependsOn` entry, or the source field, of another field's `optionSource`. */\n | 'option_source'\n /** The member a record array's natural `rowKey` names. */\n | 'row_key';\n\n/** One non-expression slot that names the field. */\nexport interface FieldReference {\n readonly kind: FieldReferenceKind;\n /** The slot's location in the draft, in the compiler's diagnostic path spelling. */\n readonly path: string;\n /** The rule the slot belongs to, for the slots that belong to one. */\n readonly ruleId?: string;\n /** The declaration the slot belongs to, for a slot owned by a field rather than a rule. */\n readonly sourceFieldId?: string;\n}\n\n/** One expression slot the parser refused. */\nexport interface UnparseableExpression {\n readonly source: 'rule' | 'layout' | 'field';\n readonly sourceId: string;\n readonly path: string;\n /** The parser's own reason, kept verbatim so a host shows the author what it said. */\n readonly detail: string;\n}\n\n/** The class of value a slot held, named the way a host would say it to an author. */\nfunction heldValue(value: unknown): string {\n if (value === null) return 'null';\n if (value === undefined) return 'no value';\n if (Array.isArray(value)) return 'an array';\n return typeof value === 'object' ? 'an object' : `a ${typeof value}`;\n}\n\n/**\n * One slot as the draft holds it: its text, or the reason it states no Expr v1 source.\n *\n * Every slot the walk enumerates passes through here, so a rule member and a layout member cannot\n * disagree about what an unreadable value is — one records the slot, the other never drops it.\n */\nfunction expressionSlot(\n source: 'rule' | 'layout' | 'field',\n sourceId: string,\n path: string,\n value: unknown,\n): ExpressionSlot {\n return typeof value === 'string'\n ? { source, sourceId, path, sourceText: value }\n : {\n source,\n sourceId,\n path,\n refusal: `the slot holds ${heldValue(value)} where Expr v1 source belongs`,\n };\n}\n\n/** Everything one draft says about one field. */\nexport interface FieldReferences {\n readonly fieldId: string;\n readonly dependencyReads: readonly DependencyRead[];\n readonly references: readonly FieldReference[];\n readonly messageKeys: readonly string[];\n readonly unparseable: readonly UnparseableExpression[];\n}\n\n/**\n * Every expression slot one rule states, in the order the artifact declares them.\n *\n * The slot list is the builder's reading of the authoring document, and it is pinned against the\n * runtime's own `ruleExpressions` by a test: the two must enumerate the same trees for the same\n * rule, so a slot the compiler reads cannot go unreported here. That is why `reasons` is read only\n * for `kind: 'screen'`: the runtime folds another kind's reasons into no expression at all, and a\n * malformed draft that states one reads nothing.\n */\nexport function ruleExpressionSlots(rule: AuthoringRule, base: string): readonly ExpressionSlot[] {\n const slots: ExpressionSlot[] = [];\n const slot = (path: string, value: unknown): void => {\n slots.push(expressionSlot('rule', rule.ruleId, path, value));\n };\n slot(`${base}.expr`, rule.expr);\n if (rule.referWhen !== undefined) slot(`${base}.referWhen`, rule.referWhen);\n for (const [name, source] of Object.entries(rule.params ?? {})) {\n slot(`${base}.params.${name}`, source);\n }\n for (const [index, reason] of (rule.kind === 'screen' ? (rule.reasons ?? []) : []).entries()) {\n slot(`${base}.reasons[${String(index)}].when`, reason.when);\n for (const [name, source] of Object.entries(reason.params ?? {})) {\n slot(`${base}.reasons[${String(index)}].params.${name}`, source);\n }\n }\n if (rule.gate?.activeWhen !== undefined) slot(`${base}.gate.activeWhen`, rule.gate.activeWhen);\n for (const [index, item] of (rule.gate?.items ?? []).entries()) {\n slot(`${base}.gate.items[${String(index)}].expr`, item.expr);\n for (const [name, source] of Object.entries(item.params ?? {})) {\n slot(`${base}.gate.items[${String(index)}].params.${name}`, source);\n }\n }\n suggestionSlots(rule.suggests ?? [], `${base}.suggests`, slot);\n return slots;\n}\n\n/**\n * The expression slots one list of alternatives states.\n *\n * A `value` operation's expression and an `append` row template's members are Expr v1 source in an\n * authored draft, so a field either of them reads is not safe to remove. A `null`, `remove` or\n * `removeRow` operation holds no expression and contributes no slot.\n */\nfunction suggestionSlots(\n suggestions: readonly AuthoringSuggestion[],\n base: string,\n slot: (path: string, value: unknown) => void,\n): void {\n for (const [index, suggestion] of suggestions.entries()) {\n for (const [position, operation] of suggestion.operations.entries()) {\n const at = `${base}[${String(index)}].operations[${String(position)}]`;\n switch (operation.kind) {\n case 'value':\n slot(`${at}.value`, operation.value);\n break;\n case 'append':\n for (const [member, source] of Object.entries(operation.row)) {\n slot(`${at}.row.${member}`, source);\n }\n break;\n case 'null':\n case 'remove':\n case 'removeRow':\n break;\n default:\n assertNever(operation);\n }\n }\n }\n}\n\n/**\n * Every expression slot the layout states, in declaration order.\n *\n * A chrome node's `visibleWhen`, its message `params` and a summary readout's value are Expr v1\n * source in an authored document, and C11 lets a chrome condition read a declared field, so a\n * field one of them names is not safe to delete either. A member the node does not state is\n * absent rather than unreadable and contributes no slot; a member it states as something other\n * than text is a slot the report names instead of dropping.\n */\nfunction layoutExpressionSlots(\n nodes: readonly RawLayoutNode[],\n slots: ExpressionSlot[] = [],\n): readonly ExpressionSlot[] {\n for (const node of nodes) {\n const slot = (path: string, value: unknown): void => {\n if (value === undefined) return;\n slots.push(expressionSlot('layout', node.path, path, value));\n };\n slot(`${node.path}.visibleWhen`, node.visibleWhen);\n for (const [name, source] of Object.entries(node.params ?? {})) {\n slot(`${node.path}.params.${name}`, source);\n }\n for (const [index, readout] of node.readouts.entries()) {\n slot(`${node.path}.readouts[${String(index)}].value`, readout.value);\n }\n layoutExpressionSlots(node.children, slots);\n }\n return slots;\n}\n\n/** One field declaration with the location the draft places it at. */\ninterface PlacedField {\n readonly field: AuthoringField;\n readonly path: string;\n /** The array whose direct row member this is, which puts `$it` in scope for its expressions. */\n readonly itemFieldId?: string;\n}\n\n/** Every declaration at any nesting level, with its own `$.fields[…]` path and row scope. */\nfunction placedFields(\n fields: readonly AuthoringField[],\n path: string,\n placed: PlacedField[] = [],\n itemFieldId?: string,\n): readonly PlacedField[] {\n for (const [index, field] of fields.entries()) {\n const here = `${path}[${String(index)}]`;\n placed.push({ field, path: here, ...(itemFieldId === undefined ? {} : { itemFieldId }) });\n if (field.fields !== undefined) {\n // Only an array's direct members read `$it` as that array's row. A record nested in the row\n // has members of its own, not the array's direct row scope.\n placedFields(\n field.fields,\n `${here}.fields`,\n placed,\n field.primitive === 'array' ? field.fieldId : undefined,\n );\n }\n }\n return placed;\n}\n\n/** The message keys one declaration names, in declaration order, without repeats. */\nfunction declarationMessageKeys(field: AuthoringField): readonly string[] {\n const keys = new Set<string>();\n for (const key of [field.labelKey, field.descriptionKey, field.placeholderKey]) {\n if (key !== undefined) keys.add(key);\n }\n for (const option of field.options ?? []) {\n keys.add(option.labelKey);\n if (option.unavailableMessageKey !== undefined) keys.add(option.unavailableMessageKey);\n for (const suggestion of option.suggests ?? []) keys.add(suggestion.labelKey);\n }\n return [...keys];\n}\n\n/**\n * Every reference a draft holds to one field, and every expression slot it could not read.\n *\n * A field id may sit inside a container — a row member is named by `targetFieldId` in an item\n * rule, by a layout leaf under the array, and by a signature's coverage — so the walk covers the\n * whole declaration tree rather than the top level only.\n *\n * One pass answers every field. The document is immutable by contract and the store rebuilds the\n * declarations a command touched, so the answer is held against the document's identity: the\n * first question parses each slot once and the next five hundred read that answer, rather than\n * parsing the document once per field. An in-place mutation would break the same immutability the\n * history's structural sharing relies on, so it is outside this contract by construction.\n */\nexport function referencesOf(document: AuthoringDocument, fieldId: string): FieldReferences {\n const held = documentReferencesOf(document);\n // Fresh arrays per answer: the index is shared, and the caller's list is the caller's to hold.\n return {\n fieldId,\n dependencyReads: [...(held.dependencyReads.get(fieldId) ?? [])],\n references: [...(held.references.get(fieldId) ?? [])],\n messageKeys: [...(held.messageKeys.get(fieldId) ?? [])],\n unparseable: [...held.unparseable],\n };\n}\n\n/** One document's whole read answer, built once and shared by every field's question. */\ninterface DocumentReferences {\n readonly dependencyReads: ReadonlyMap<string, readonly DependencyRead[]>;\n readonly references: ReadonlyMap<string, readonly FieldReference[]>;\n readonly messageKeys: ReadonlyMap<string, readonly string[]>;\n readonly unparseable: readonly UnparseableExpression[];\n}\n\n/** Answers keyed by the document object the walk read. */\nconst documentReferences = new WeakMap<AuthoringDocument, DocumentReferences>();\n\n/** The expression slots this process has parsed; a measurement hook, never an input. */\nlet slotParses = 0;\n\n/** The expression slots the impact walk has parsed since the process started. */\nexport function expressionSlotParses(): number {\n return slotParses;\n}\n\n/** Adds one reference to the list keyed by the field it names. */\nfunction pushReference(\n references: Map<string, FieldReference[]>,\n fieldId: string,\n reference: FieldReference,\n): void {\n const held = references.get(fieldId);\n if (held === undefined) references.set(fieldId, [reference]);\n else held.push(reference);\n}\n\n/** Adds one read to the list keyed by the field it read. */\nfunction pushRead(\n reads: Map<string, DependencyRead[]>,\n fieldId: string,\n read: DependencyRead,\n): void {\n const held = reads.get(fieldId);\n if (held === undefined) reads.set(fieldId, [read]);\n else held.push(read);\n}\n\n/** Adds one message key to the list the declaration it belongs to names. */\nfunction pushMessageKey(keys: Map<string, string[]>, fieldId: string, key: string): void {\n const held = keys.get(fieldId);\n if (held === undefined) keys.set(fieldId, [key]);\n else held.push(key);\n}\n\n/** Reads every slot the draft states, recording each read under the field it read. */\nfunction readSlots(\n slots: readonly ExpressionSlot[],\n itemFieldId: string | undefined,\n index: RecordIndex,\n dependencyReads: Map<string, DependencyRead[]>,\n unparseable: UnparseableExpression[],\n): void {\n for (const slot of slots) {\n if ('refusal' in slot) {\n unparseable.push({\n source: slot.source,\n sourceId: slot.sourceId,\n path: slot.path,\n detail: slot.refusal,\n });\n continue;\n }\n slotParses += 1;\n const parsed = parseExpr(slot.sourceText);\n if (!parsed.ok) {\n unparseable.push({\n source: slot.source,\n sourceId: slot.sourceId,\n path: slot.path,\n detail: parsed.diagnostics[0]?.detail ?? 'the expression does not parse',\n });\n continue;\n }\n // One slot at a time rather than one batch per rule: the report names the slot a read came\n // from, and a batch walk merges the slots' reads into one set with no way back.\n for (const read of collectReadRefs([parsed.node], index, itemFieldId).reads) {\n pushRead(dependencyReads, read.fieldId, {\n source: slot.source,\n sourceId: slot.sourceId,\n path: slot.path,\n rowScoped: read.rowScoped,\n });\n }\n }\n}\n\n/** Builds, or returns, one document's whole read answer. */\nfunction documentReferencesOf(document: AuthoringDocument): DocumentReferences {\n const cached = documentReferences.get(document);\n if (cached !== undefined) return cached;\n\n const index = documentIndex(document);\n const dependencyReads = new Map<string, DependencyRead[]>();\n const references = new Map<string, FieldReference[]>();\n const messageKeys = new Map<string, string[]>();\n const unparseable: UnparseableExpression[] = [];\n const add = (target: string, reference: FieldReference): void =>\n pushReference(references, target, reference);\n\n for (const [position, rule] of (document.rules ?? []).entries()) {\n const base = `$.rules[${String(position)}]`;\n readSlots(\n ruleExpressionSlots(rule, base),\n rule.scope === 'item' ? rule.fieldId : undefined,\n index,\n dependencyReads,\n unparseable,\n );\n addRuleFieldReferences(rule, base, add);\n }\n\n const layout = readLayout(document);\n readSlots(layoutExpressionSlots(layout), undefined, index, dependencyReads, unparseable);\n addLayoutFieldReferences(layout, add);\n\n for (const { field, path, itemFieldId } of placedFields(document.fields, '$.fields')) {\n addDeclarationFieldReferences(field, path, add);\n // An array's `rowsFrom` is Expr v1 source in an authored draft, so a field it reads is not\n // safe to remove either. It evaluates in the array's scope rather than an item's, so the read\n // is not row-scoped.\n if (field.rowsFrom !== undefined) {\n readSlots(\n [expressionSlot('field', field.fieldId, `${path}.rowsFrom`, field.rowsFrom)],\n undefined,\n index,\n dependencyReads,\n unparseable,\n );\n }\n // An option's availability and the alternatives it offers are authored source too, so a read\n // through one is a read the author cannot delete the field behind.\n for (const [position, option] of (field.options ?? []).entries()) {\n const at = `${path}.options[${String(position)}]`;\n const slots: ExpressionSlot[] = [];\n const slot = (slotPath: string, value: unknown): void => {\n slots.push(expressionSlot('field', field.fieldId, slotPath, value));\n };\n if (option.availableWhen !== undefined) slot(`${at}.availableWhen`, option.availableWhen);\n for (const [name, source] of Object.entries(option.unavailableParams ?? {})) {\n slot(`${at}.unavailableParams.${name}`, source);\n }\n suggestionSlots(option.suggests ?? [], `${at}.suggests`, slot);\n readSlots(slots, itemFieldId, index, dependencyReads, unparseable);\n }\n // A declaration's conditions compile into rules, but the authored draft holds the source on\n // the declaration. A field a `visibleWhen`/`requiredWhen` reads is as dependent as a field a\n // declared rule reads; omitting these slots let a remove leave `UNKNOWN_IDENTIFIER` behind.\n for (const member of ['visibleWhen', 'requiredWhen'] as const) {\n const source = field[member];\n if (source === undefined) continue;\n readSlots(\n [expressionSlot('field', field.fieldId, `${path}.${member}`, source)],\n itemFieldId,\n index,\n dependencyReads,\n unparseable,\n );\n }\n for (const key of declarationMessageKeys(field)) {\n pushMessageKey(messageKeys, field.fieldId, key);\n }\n }\n\n const built: DocumentReferences = { dependencyReads, references, messageKeys, unparseable };\n documentReferences.set(document, built);\n return built;\n}\n\n/**\n * The field one access rule's match names, or `undefined` for a section rule.\n *\n * A match spells three ways: the exact id, `id.*` for a container, and `id@…` for a row or a\n * template. None of the three is a second field id, so the reference belongs to the base the\n * match starts with — which is the id a delete question asks about.\n */\nfunction accessMatchFieldId(rule: AccessOverlayRule): string | undefined {\n if (rule.kind === 'section') return undefined;\n const at = rule.match.indexOf('@');\n const base = at === -1 ? rule.match : rule.match.slice(0, at);\n return base.endsWith('.*') ? base.slice(0, -2) : base;\n}\n\n/** One reference a rule member states, filed under the field it names. */\nfunction ruleReference(\n rule: AuthoringRule,\n kind: FieldReferenceKind,\n path: string,\n): FieldReference {\n return { kind, path, ruleId: rule.ruleId };\n}\n\n/** Files the rule members that name a field without holding an expression. */\nfunction addRuleFieldReferences(\n rule: AuthoringRule,\n base: string,\n add: (fieldId: string, reference: FieldReference) => void,\n): void {\n if (rule.fieldId !== undefined)\n add(rule.fieldId, ruleReference(rule, 'rule_field', `${base}.fieldId`));\n for (const [index, target] of (rule.fieldIds ?? []).entries()) {\n add(target, ruleReference(rule, 'rule_field_ids', `${base}.fieldIds[${String(index)}]`));\n }\n if (rule.targetFieldId !== undefined) {\n add(rule.targetFieldId, ruleReference(rule, 'rule_target', `${base}.targetFieldId`));\n }\n if (rule.overrideFieldId !== undefined) {\n add(rule.overrideFieldId, ruleReference(rule, 'rule_override', `${base}.overrideFieldId`));\n }\n for (const [index, testCase] of (rule.testCases ?? []).entries()) {\n const at = `${base}.testCases[${String(index)}]`;\n for (const key of Object.keys(testCase.values ?? {})) {\n add(key, ruleReference(rule, 'rule_case', `${at}.values.${key}`));\n }\n for (const member of ['redacted', 'sessionWrites'] as const) {\n for (const [refIndex, reference] of (testCase[member] ?? []).entries()) {\n add(\n reference.fieldId,\n ruleReference(rule, 'rule_case', `${at}.${member}[${String(refIndex)}].fieldId`),\n );\n }\n }\n const overlay = testCase.accessOverlay;\n for (const [allowIndex, allowed] of (overlay?.allowMaskedRead ?? []).entries()) {\n add(\n allowed,\n ruleReference(\n rule,\n 'rule_case',\n `${at}.accessOverlay.allowMaskedRead[${String(allowIndex)}]`,\n ),\n );\n }\n for (const [ruleIndex, accessRule] of (overlay?.rules ?? []).entries()) {\n const named = accessMatchFieldId(accessRule);\n if (named === undefined) continue;\n add(\n named,\n ruleReference(rule, 'rule_case', `${at}.accessOverlay.rules[${String(ruleIndex)}].match`),\n );\n }\n }\n addSuggestionReferences(\n rule.suggests ?? [],\n `${base}.suggests`,\n 'rule_suggestion',\n add,\n rule.ruleId,\n );\n}\n\n/** Files the fields one list of alternatives writes, including each member an append template states. */\nfunction addSuggestionReferences(\n suggestions: readonly AuthoringSuggestion[],\n base: string,\n kind: 'rule_suggestion' | 'option_suggestion',\n add: (fieldId: string, reference: FieldReference) => void,\n ruleId?: string,\n sourceFieldId?: string,\n): void {\n const reference = (path: string): FieldReference => ({\n kind,\n path,\n ...(ruleId === undefined ? {} : { ruleId }),\n ...(sourceFieldId === undefined ? {} : { sourceFieldId }),\n });\n for (const [index, suggestion] of suggestions.entries()) {\n for (const [position, operation] of suggestion.operations.entries()) {\n const at = `${base}[${String(index)}].operations[${String(position)}]`;\n switch (operation.kind) {\n case 'value':\n case 'null':\n case 'remove':\n add(operation.ref.fieldId, reference(`${at}.ref.fieldId`));\n break;\n case 'append':\n add(operation.fieldId, reference(`${at}.fieldId`));\n for (const member of Object.keys(operation.row)) {\n add(member, reference(`${at}.row.${member}`));\n }\n break;\n case 'removeRow':\n add(operation.fieldId, reference(`${at}.fieldId`));\n break;\n default:\n assertNever(operation);\n }\n }\n }\n}\n\n/** Files the layout slots that place or list a field. */\nfunction addLayoutFieldReferences(\n nodes: readonly RawLayoutNode[],\n add: (fieldId: string, reference: FieldReference) => void,\n): void {\n const visit = (node: RawLayoutNode): void => {\n if (node.fieldId !== undefined) {\n add(node.fieldId, { kind: 'layout_field', path: `${node.path}.fieldId` });\n }\n for (const [index, name] of node.fields.entries()) {\n add(name, { kind: 'layout_field', path: `${node.path}.fields[${String(index)}]` });\n }\n for (const child of node.children) visit(child);\n };\n for (const node of nodes) visit(node);\n}\n\n/** Files the declaration members that name another field. */\nfunction addDeclarationFieldReferences(\n field: AuthoringField,\n path: string,\n add: (fieldId: string, reference: FieldReference) => void,\n): void {\n if (field.rowKey?.mode === 'natural' && field.rowKey.fieldId !== undefined) {\n add(field.rowKey.fieldId, { kind: 'row_key', path: `${path}.rowKey.fieldId` });\n }\n for (const [index, covered] of (field.covers ?? []).entries()) {\n add(covered, { kind: 'signature_cover', path: `${path}.covers[${String(index)}]` });\n }\n const optionSource = field.optionSource;\n if (optionSource?.kind === 'field') {\n add(optionSource.fieldId, { kind: 'option_source', path: `${path}.optionSource.fieldId` });\n }\n if (optionSource?.kind === 'host') {\n for (const [index, depended] of (optionSource.dependsOn ?? []).entries()) {\n add(depended, {\n kind: 'option_source',\n path: `${path}.optionSource.dependsOn[${String(index)}]`,\n });\n }\n }\n for (const [index, option] of (field.options ?? []).entries()) {\n addSuggestionReferences(\n option.suggests ?? [],\n `${path}.options[${String(index)}].suggests`,\n 'option_suggestion',\n add,\n undefined,\n field.fieldId,\n );\n }\n}\n"]}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@azx-pbc/axiom-builder` — the headless authoring store.
|
|
3
|
+
*
|
|
4
|
+
* A host that authors a closed schema document needs the document contract outside its own UI
|
|
5
|
+
* code. This package supplies it: every edit is a command over an immutable snapshot, so undo,
|
|
6
|
+
* redo, preview and diff read the same history. It carries no React, no DOM, no clock, no
|
|
7
|
+
* randomness and no business domain: a starter template here would be one client's vocabulary
|
|
8
|
+
* shipped to every client.
|
|
9
|
+
*
|
|
10
|
+
* The store refuses what the compiler refuses. Its hard refusals are the compiler's own
|
|
11
|
+
* predicates: the closed metaschema, the layout grammar and C11, and the structural codes of the
|
|
12
|
+
* compile's verdict. Everything the compile still reports (an unfinished expression, an unresolved
|
|
13
|
+
* reference, a cycle, a missing translation) is accepted as a draft with diagnostics attached.
|
|
14
|
+
* Keeping those drafts instead of refusing them is what lets an author type mid-expression.
|
|
15
|
+
*
|
|
16
|
+
* `compilePreview` states the other half: a live preview is opaque by construction, compiled from
|
|
17
|
+
* a closure-scoped multi-locale fallback copy (or a single-locale fast path when every entry
|
|
18
|
+
* already declares the requested locale) where borrowed text stays filed under its authored source
|
|
19
|
+
* locale for CLDR plural checking, so nothing a UI can read is a deployable artifact or a report
|
|
20
|
+
* hash. A build compiles the document the author holds, strictly, through
|
|
21
|
+
* `@azx-pbc/axiom-compiler`.
|
|
22
|
+
*/
|
|
23
|
+
export { AuthoringError, createEmptySchema, duplicateDocument, serializeDocument, } from './schema/document.js';
|
|
24
|
+
export { DefinitionError, defineDocument } from './definition.js';
|
|
25
|
+
export { readDocument } from './schema/read.js';
|
|
26
|
+
export type { DocumentRead } from './schema/read.js';
|
|
27
|
+
export { createDatasetTable, datasetDigest, readDatasetDocument } from './schema/dataset.js';
|
|
28
|
+
export type { AuthoredDatasetBinding, AuthoredDatasetDocument, AuthoredDatasetIdentity, AuthoredDecisionRow, AuthoredDecisionTable, AuthoredHitPolicy, AuthoredLookupRow, AuthoredLookupTable, AuthoredSetTable, CreateDatasetOptions, DatasetDocumentRead, } from './schema/dataset.js';
|
|
29
|
+
export type { AuthoringAnnotations, AuthoringCatalogue, AuthoringContext, AuthoringDatasetReference, AuthoringDocument, AuthoringField, AuthoringGate, AuthoringGateItem, AuthoringItem, AuthoringLayoutNode, AuthoringOption, AuthoringRowKey, AuthoringRule, AuthoringScreenReason, AuthoringSuggestedRef, AuthoringSuggestion, AuthoringSuggestionOperation, AuthoringTestCase, CreateSchemaOptions, ScalarPrimitive, } from './schema/document.js';
|
|
30
|
+
export { documentIndex } from './schema/declarations.js';
|
|
31
|
+
export { layoutIndex } from './schema/layout.js';
|
|
32
|
+
export type { IndexedLayoutNode, IndexedReadout, LayoutIndex, LayoutKind, LayoutPlacement, } from './schema/layout.js';
|
|
33
|
+
export { suggestFieldId } from './schema/field-id.js';
|
|
34
|
+
export { FIELD_PALETTE } from './schema/palette.js';
|
|
35
|
+
export type { FieldPaletteEntry, PaletteDeclaration, PaletteNeeds } from './schema/palette.js';
|
|
36
|
+
export { COMMAND_KINDS, DATASET_COMMAND_KINDS, DATASET_COMMAND_KIND_SET, parseCommand, parseDatasetCommand, MAX_MEMBER_NESTING, } from './store/commands.js';
|
|
37
|
+
export type { AddDatasetRowCommand, AddFieldSpec, AddOptionSpec, AddRecordArraySpec, AddRuleSpec, AddRuleTestCaseCommand, AuthoringCommand, AuthoringRuleKind, CommandParse, ContextRootSpec, DatasetCellInput, DatasetCommand, DatasetCommandParse, DatasetPinSpec, DatasetRowSpec, DeprecateOptionCommand, EditFieldCommand, EditFieldSpec, EditLayoutNodeCommand, EditRuleCommand, EditRuleSpec, FieldDeclarationSpec, FieldPrimitiveSpec, GateEditSpec, GateItemSpec, GateSpec, LayoutPath, MemberFieldSpec, MemberSpec, MoveLayoutNodeCommand, OptionAvailabilitySpec, PinDatasetCommand, PlaceFieldCommand, RemoveContextRootCommand, RemoveDatasetRowCommand, RemoveFieldCommand, RemoveLayoutNodeCommand, RemoveRuleCommand, ReplaceDatasetRowCommand, ScreenReasonSpec, SetContextRootCommand, SetDatasetCellCommand, SetDatasetColumnsCommand, SetDatasetEffectiveRangeCommand, SetDatasetHitPolicyCommand, SetDatasetValuesCommand, SetDocumentTitleCommand, SetFieldDeclarationCommand, SetFieldPrimitiveCommand, SetLocalesCommand, SetOnHideCommand, SetOptionAvailabilityCommand, SetPrimaryCommand, SetRuleExprCommand, SetRuleSuggestsCommand, SetSignatureCoversCommand, SuggestionOperationSpec, SuggestionSpec, TestCaseSpec, UnpinDatasetCommand, } from './store/commands.js';
|
|
38
|
+
export { createAuthoringStore } from './store/store.js';
|
|
39
|
+
export type { AuthoringStore, AuthoringStoreOptions, DispatchContext, DispatchEffects, DispatchOutcome, HistoryOutcome, HistoryRefusal, } from './store/store.js';
|
|
40
|
+
export { createDatasetStore } from './store/dataset-store.js';
|
|
41
|
+
export type { DatasetDispatchEffects, DatasetDispatchOutcome, DatasetHistoryOutcome, DatasetState, DatasetStore, DatasetStoreOptions, } from './store/dataset-store.js';
|
|
42
|
+
export { checkDatasetPin, datasetPinChecks, publishDataset, } from './store/dataset-pin.js';
|
|
43
|
+
export type { DatasetPin, DatasetPinCheck, DatasetPublication, } from './store/dataset-pin.js';
|
|
44
|
+
export type { AuthoringState, HistoryStep } from './store/history.js';
|
|
45
|
+
export { HISTORY_LIMIT } from './store/history.js';
|
|
46
|
+
export type { ClampedField } from './store/apply.js';
|
|
47
|
+
export { AUTHORING_REFUSAL_CODES, AUTHORING_REFUSAL_REPAIRS, authoringRefusal, } from './store/refusals.js';
|
|
48
|
+
export type { AuthoringRefusal, AuthoringRefusalCode } from './store/refusals.js';
|
|
49
|
+
export type { PublishedBaseline } from './store/published.js';
|
|
50
|
+
export { declaredEvidenceRepairs, notCausalRepairs } from './evidence/repairs.js';
|
|
51
|
+
export type { EvidenceAssertion, EvidenceRepair, NotCausalRepair, SuggestedCase, VerifiedEvidence, } from './evidence/repairs.js';
|
|
52
|
+
export { evidenceSummary } from './evidence/summary.js';
|
|
53
|
+
export type { EvidenceSummary } from './evidence/summary.js';
|
|
54
|
+
export { translationGaps } from './i18n/gaps.js';
|
|
55
|
+
export type { TranslationGap } from './i18n/gaps.js';
|
|
56
|
+
export { exportMissingTranslations, importTranslations, } from './i18n/translations.js';
|
|
57
|
+
export type { MissingTranslation, TranslationEntry, TranslationImport, } from './i18n/translations.js';
|
|
58
|
+
export { compilePreview } from './preview/compile-preview.js';
|
|
59
|
+
export type { PreviewOptions } from './preview/compile-preview.js';
|
|
60
|
+
export type { PreviewCandidate, PreviewCandidateDelta, PreviewCompileResult, PreviewEngine, PreviewEngineConfig, PreviewFailure, PreviewFieldExplanation, PreviewFormState, PreviewProposal, PreviewReportFacts, PreviewSuccess, } from './preview/handle.js';
|
|
61
|
+
export { diagnosticCardField, fieldCards, unattachedDiagnostics } from './cards/selectors.js';
|
|
62
|
+
export type { CardContext, FieldCard } from './cards/selectors.js';
|
|
63
|
+
export { projectRule, toVisual } from './visual/project.js';
|
|
64
|
+
export { emitVisual, visualSource } from './visual/emit.js';
|
|
65
|
+
export { representVisual } from './visual/represent.js';
|
|
66
|
+
export type { VisualRefusal, VisualRefusalReason, VisualRepresentation, } from './visual/represent.js';
|
|
67
|
+
export { MAX_VISUAL_NESTING, parseVisual } from './visual/parse.js';
|
|
68
|
+
export type { VisualParse } from './visual/parse.js';
|
|
69
|
+
export { DATE_SPANS, FORMAT_CHECKS, ORDERED_COMPARISONS, PRESENCE_CHECKS, TEXT_MATCH_OPERATORS, } from './visual/vocabulary.js';
|
|
70
|
+
export type { DateSpan, FormatCheck, OrderedComparison, PresenceCheck, RuleExpression, ScalarVisualValue, TextMatchOperator, VisualExpr, VisualList, VisualValue, } from './visual/vocabulary.js';
|
|
71
|
+
export { referencesOf, ruleExpressionSlots } from './impact/references.js';
|
|
72
|
+
export type { DependencyRead, ExpressionSlot, FieldReference, FieldReferenceKind, FieldReferences, UnparseableExpression, } from './impact/references.js';
|
|
73
|
+
/**
|
|
74
|
+
* What publishing a draft would mean against the revision a host published: a presentation-only
|
|
75
|
+
* edit, a behaviour change a version bump carries, what the revision still needs of recorded
|
|
76
|
+
* values, or a refusal the revision contract states. The classification is the compiler's, so
|
|
77
|
+
* `axiom-cli diff` and an authoring host agree about whether behaviour moved.
|
|
78
|
+
*/
|
|
79
|
+
export { buildDocument } from './publish/build.js';
|
|
80
|
+
export type { BuildDocumentOptions } from './publish/build.js';
|
|
81
|
+
export { diffAgainstCompiled, diffAgainstPublished } from './publish/diff.js';
|
|
82
|
+
export type { DiffAgainstCompiledOptions, DiffAgainstPublishedOptions, PublishedDiff, PublishedDiffResult, RevisionRefusal, RevisionVerdict, } from './publish/diff.js';
|
|
83
|
+
export { reviewDocument } from './publish/review.js';
|
|
84
|
+
export type { DocumentReview, ReviewDocumentOptions } from './publish/review.js';
|
|
85
|
+
export type { DatasetInput, DatasetSource } from './schema/dataset-input.js';
|
|
86
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC7F,YAAY,EACV,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,yBAAyB,EACzB,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,aAAa,EACb,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,4BAA4B,EAC5B,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,GAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EA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