@contractspec/lib.surface-runtime 0.3.0 → 0.3.3
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/dist/adapters/ai-sdk-stub.js +1 -6
- package/dist/adapters/blocknote-stub.js +3 -8
- package/dist/adapters/dnd-kit-adapter.js +6 -11
- package/dist/adapters/dnd-kit-stub.js +1 -6
- package/dist/adapters/floating-ui-stub.js +4 -9
- package/dist/adapters/index.js +7 -176
- package/dist/adapters/interfaces.js +0 -1
- package/dist/adapters/motion-stub.js +2 -7
- package/dist/adapters/resizable-panels-stub.js +7 -12
- package/dist/browser/adapters/ai-sdk-stub.js +1 -5
- package/dist/browser/adapters/blocknote-stub.js +3 -7
- package/dist/browser/adapters/dnd-kit-adapter.js +6 -10
- package/dist/browser/adapters/dnd-kit-stub.js +1 -5
- package/dist/browser/adapters/floating-ui-stub.js +4 -8
- package/dist/browser/adapters/index.js +7 -175
- package/dist/browser/adapters/motion-stub.js +2 -6
- package/dist/browser/adapters/resizable-panels-stub.js +5 -9
- package/dist/browser/evals/golden-harness.js +4 -825
- package/dist/browser/examples/pm-workbench.bundle.js +2 -316
- package/dist/browser/i18n/catalogs/en.js +1 -5
- package/dist/browser/i18n/catalogs/es.js +1 -5
- package/dist/browser/i18n/catalogs/fr.js +1 -5
- package/dist/browser/i18n/catalogs/index.js +3 -133
- package/dist/browser/i18n/index.js +3 -168
- package/dist/browser/i18n/keys.js +1 -5
- package/dist/browser/i18n/messages.js +6 -137
- package/dist/browser/index.js +4 -2470
- package/dist/browser/react/BundleProvider.js +12 -19
- package/dist/browser/react/BundleRenderer.js +15 -662
- package/dist/browser/react/OverlayConflictResolver.js +12 -180
- package/dist/browser/react/PatchProposalCard.js +9 -177
- package/dist/browser/react/RegionRenderer.js +14 -60
- package/dist/browser/react/SlotRenderer.js +15 -58
- package/dist/browser/react/WidgetPalette.js +6 -10
- package/dist/browser/react/index.js +14 -794
- package/dist/browser/runtime/apply-surface-patch.js +3 -208
- package/dist/browser/runtime/audit-events.js +8 -19
- package/dist/browser/runtime/build-context.js +2 -6
- package/dist/browser/runtime/extension-registry.js +3 -9
- package/dist/browser/runtime/field-renderer-registry.js +5 -11
- package/dist/browser/runtime/index.js +54 -1487
- package/dist/browser/runtime/overlay-alignment.js +8 -19
- package/dist/browser/runtime/overlay-signer.js +2 -7
- package/dist/browser/runtime/override-store.js +3 -9
- package/dist/browser/runtime/planner-prompt.js +2 -6
- package/dist/browser/runtime/planner-tools.js +3 -9
- package/dist/browser/runtime/policy-eval.js +3 -135
- package/dist/browser/runtime/preference-adapter.js +2 -62
- package/dist/browser/runtime/resolve-bundle.js +10 -447
- package/dist/browser/runtime/resolve-preferences.js +3 -7
- package/dist/browser/runtime/rollback.js +2 -325
- package/dist/browser/runtime/widget-registry.js +1 -5
- package/dist/browser/spec/define-module-bundle.js +2 -67
- package/dist/browser/spec/index.js +9 -317
- package/dist/browser/spec/validate-bundle.js +3 -8
- package/dist/browser/spec/validate-surface-patch.js +5 -11
- package/dist/browser/telemetry/index.js +4 -16
- package/dist/browser/telemetry/surface-metrics.js +7 -16
- package/dist/evals/golden-context.js +0 -1
- package/dist/evals/golden-harness.js +4 -826
- package/dist/examples/pm-workbench.bundle.js +2 -317
- package/dist/i18n/catalogs/en.js +1 -6
- package/dist/i18n/catalogs/es.js +1 -6
- package/dist/i18n/catalogs/fr.js +1 -6
- package/dist/i18n/catalogs/index.js +3 -134
- package/dist/i18n/index.js +3 -169
- package/dist/i18n/keys.js +1 -6
- package/dist/i18n/messages.js +6 -138
- package/dist/index.js +4 -2471
- package/dist/node/adapters/ai-sdk-stub.js +1 -5
- package/dist/node/adapters/blocknote-stub.js +3 -7
- package/dist/node/adapters/dnd-kit-adapter.js +6 -10
- package/dist/node/adapters/dnd-kit-stub.js +1 -5
- package/dist/node/adapters/floating-ui-stub.js +4 -8
- package/dist/node/adapters/index.js +7 -175
- package/dist/node/adapters/motion-stub.js +2 -6
- package/dist/node/adapters/resizable-panels-stub.js +5 -9
- package/dist/node/evals/golden-harness.js +4 -825
- package/dist/node/examples/pm-workbench.bundle.js +2 -316
- package/dist/node/i18n/catalogs/en.js +1 -5
- package/dist/node/i18n/catalogs/es.js +1 -5
- package/dist/node/i18n/catalogs/fr.js +1 -5
- package/dist/node/i18n/catalogs/index.js +3 -133
- package/dist/node/i18n/index.js +3 -168
- package/dist/node/i18n/keys.js +1 -5
- package/dist/node/i18n/messages.js +6 -137
- package/dist/node/index.js +4 -2470
- package/dist/node/react/BundleProvider.js +12 -19
- package/dist/node/react/BundleRenderer.js +15 -662
- package/dist/node/react/OverlayConflictResolver.js +12 -180
- package/dist/node/react/PatchProposalCard.js +9 -177
- package/dist/node/react/RegionRenderer.js +14 -60
- package/dist/node/react/SlotRenderer.js +15 -58
- package/dist/node/react/WidgetPalette.js +6 -10
- package/dist/node/react/index.js +14 -794
- package/dist/node/runtime/apply-surface-patch.js +3 -208
- package/dist/node/runtime/audit-events.js +8 -19
- package/dist/node/runtime/build-context.js +2 -6
- package/dist/node/runtime/extension-registry.js +3 -9
- package/dist/node/runtime/field-renderer-registry.js +5 -11
- package/dist/node/runtime/index.js +54 -1487
- package/dist/node/runtime/overlay-alignment.js +8 -19
- package/dist/node/runtime/overlay-signer.js +2 -7
- package/dist/node/runtime/override-store.js +3 -9
- package/dist/node/runtime/planner-prompt.js +2 -6
- package/dist/node/runtime/planner-tools.js +3 -9
- package/dist/node/runtime/policy-eval.js +3 -135
- package/dist/node/runtime/preference-adapter.js +2 -62
- package/dist/node/runtime/resolve-bundle.js +10 -447
- package/dist/node/runtime/resolve-preferences.js +3 -7
- package/dist/node/runtime/rollback.js +2 -325
- package/dist/node/runtime/widget-registry.js +1 -5
- package/dist/node/spec/define-module-bundle.js +2 -67
- package/dist/node/spec/index.js +9 -317
- package/dist/node/spec/validate-bundle.js +3 -8
- package/dist/node/spec/validate-surface-patch.js +5 -11
- package/dist/node/telemetry/index.js +4 -16
- package/dist/node/telemetry/surface-metrics.js +7 -16
- package/dist/react/BundleProvider.js +12 -20
- package/dist/react/BundleRenderer.js +15 -663
- package/dist/react/OverlayConflictResolver.js +12 -181
- package/dist/react/PatchProposalCard.js +9 -178
- package/dist/react/RegionRenderer.js +14 -61
- package/dist/react/SlotRenderer.js +15 -59
- package/dist/react/WidgetPalette.js +6 -11
- package/dist/react/index.js +14 -795
- package/dist/runtime/apply-surface-patch.js +3 -209
- package/dist/runtime/audit-events.js +8 -20
- package/dist/runtime/build-context.js +2 -7
- package/dist/runtime/extension-registry.js +3 -10
- package/dist/runtime/field-renderer-registry.js +9 -16
- package/dist/runtime/index.js +54 -1488
- package/dist/runtime/overlay-alignment.js +8 -20
- package/dist/runtime/overlay-signer.js +2 -8
- package/dist/runtime/override-store.js +3 -10
- package/dist/runtime/planner-prompt.js +11 -9
- package/dist/runtime/planner-tools.js +4 -11
- package/dist/runtime/policy-eval.js +3 -136
- package/dist/runtime/preference-adapter.js +2 -63
- package/dist/runtime/resolve-bundle.js +10 -448
- package/dist/runtime/resolve-preferences.js +3 -8
- package/dist/runtime/rollback.js +2 -326
- package/dist/runtime/widget-registry.js +1 -6
- package/dist/spec/define-module-bundle.js +2 -68
- package/dist/spec/index.js +9 -318
- package/dist/spec/types.js +0 -1
- package/dist/spec/validate-bundle.js +3 -9
- package/dist/spec/validate-surface-patch.js +5 -12
- package/dist/spec/verification-snapshot-types.js +0 -1
- package/dist/telemetry/index.js +4 -17
- package/dist/telemetry/surface-metrics.js +7 -17
- package/package.json +7 -7
|
@@ -1,208 +1,6 @@
|
|
|
1
|
-
// src/spec/validate-surface-patch.ts
|
|
2
|
-
var VALID_OPS = [
|
|
3
|
-
"insert-node",
|
|
4
|
-
"replace-node",
|
|
5
|
-
"remove-node",
|
|
6
|
-
"move-node",
|
|
7
|
-
"resize-panel",
|
|
8
|
-
"set-layout",
|
|
9
|
-
"reveal-field",
|
|
10
|
-
"hide-field",
|
|
11
|
-
"promote-action",
|
|
12
|
-
"set-focus"
|
|
13
|
-
];
|
|
14
|
-
var VALID_NODE_KINDS = [
|
|
15
|
-
"metric-strip",
|
|
16
|
-
"data-view",
|
|
17
|
-
"entity-card",
|
|
18
|
-
"entity-header",
|
|
19
|
-
"entity-summary",
|
|
20
|
-
"entity-section",
|
|
21
|
-
"entity-field",
|
|
22
|
-
"entity-activity",
|
|
23
|
-
"entity-relations",
|
|
24
|
-
"entity-timeline",
|
|
25
|
-
"entity-comments",
|
|
26
|
-
"entity-attachments",
|
|
27
|
-
"entity-view-switcher",
|
|
28
|
-
"entity-automation-panel",
|
|
29
|
-
"rich-doc",
|
|
30
|
-
"chat-thread",
|
|
31
|
-
"assistant-panel",
|
|
32
|
-
"action-bar",
|
|
33
|
-
"timeline",
|
|
34
|
-
"board",
|
|
35
|
-
"table",
|
|
36
|
-
"calendar",
|
|
37
|
-
"form",
|
|
38
|
-
"chart",
|
|
39
|
-
"relation-graph",
|
|
40
|
-
"custom-widget"
|
|
41
|
-
];
|
|
42
|
-
function validateSurfaceNode(node, path) {
|
|
43
|
-
if (!node.nodeId || typeof node.nodeId !== "string") {
|
|
44
|
-
throw new Error(`${path}: nodeId must be a non-empty string`);
|
|
45
|
-
}
|
|
46
|
-
if (!node.kind || !VALID_NODE_KINDS.includes(node.kind)) {
|
|
47
|
-
throw new Error(`${path}: kind must be one of ${VALID_NODE_KINDS.join(", ")}`);
|
|
48
|
-
}
|
|
49
|
-
if (node.children) {
|
|
50
|
-
for (let i = 0;i < node.children.length; i++) {
|
|
51
|
-
const child = node.children[i];
|
|
52
|
-
if (child)
|
|
53
|
-
validateSurfaceNode(child, `${path}.children[${i}]`);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
function validateSurfacePatchOp(op, index) {
|
|
58
|
-
const path = `ops[${index}]`;
|
|
59
|
-
if (!op || typeof op !== "object" || !("op" in op)) {
|
|
60
|
-
throw new Error(`${path}: must be an object with op field`);
|
|
61
|
-
}
|
|
62
|
-
const opType = op.op;
|
|
63
|
-
if (!VALID_OPS.includes(opType)) {
|
|
64
|
-
throw new Error(`${path}: op must be one of ${VALID_OPS.join(", ")}`);
|
|
65
|
-
}
|
|
66
|
-
switch (op.op) {
|
|
67
|
-
case "insert-node":
|
|
68
|
-
if (!op.slotId || typeof op.slotId !== "string") {
|
|
69
|
-
throw new Error(`${path}: insert-node requires slotId string`);
|
|
70
|
-
}
|
|
71
|
-
if (!op.node) {
|
|
72
|
-
throw new Error(`${path}: insert-node requires node`);
|
|
73
|
-
}
|
|
74
|
-
validateSurfaceNode(op.node, `${path}.node`);
|
|
75
|
-
if (op.index !== undefined && typeof op.index !== "number") {
|
|
76
|
-
throw new Error(`${path}: insert-node index must be number if present`);
|
|
77
|
-
}
|
|
78
|
-
break;
|
|
79
|
-
case "replace-node":
|
|
80
|
-
if (!op.nodeId || typeof op.nodeId !== "string") {
|
|
81
|
-
throw new Error(`${path}: replace-node requires nodeId string`);
|
|
82
|
-
}
|
|
83
|
-
if (!op.node) {
|
|
84
|
-
throw new Error(`${path}: replace-node requires node`);
|
|
85
|
-
}
|
|
86
|
-
validateSurfaceNode(op.node, `${path}.node`);
|
|
87
|
-
break;
|
|
88
|
-
case "remove-node":
|
|
89
|
-
if (!op.nodeId || typeof op.nodeId !== "string") {
|
|
90
|
-
throw new Error(`${path}: remove-node requires nodeId string`);
|
|
91
|
-
}
|
|
92
|
-
break;
|
|
93
|
-
case "move-node":
|
|
94
|
-
if (!op.nodeId || typeof op.nodeId !== "string") {
|
|
95
|
-
throw new Error(`${path}: move-node requires nodeId string`);
|
|
96
|
-
}
|
|
97
|
-
if (!op.toSlotId || typeof op.toSlotId !== "string") {
|
|
98
|
-
throw new Error(`${path}: move-node requires toSlotId string`);
|
|
99
|
-
}
|
|
100
|
-
if (op.index !== undefined && typeof op.index !== "number") {
|
|
101
|
-
throw new Error(`${path}: move-node index must be number if present`);
|
|
102
|
-
}
|
|
103
|
-
break;
|
|
104
|
-
case "resize-panel":
|
|
105
|
-
if (!op.persistKey || typeof op.persistKey !== "string") {
|
|
106
|
-
throw new Error(`${path}: resize-panel requires persistKey string`);
|
|
107
|
-
}
|
|
108
|
-
if (!Array.isArray(op.sizes) || op.sizes.some((s) => typeof s !== "number")) {
|
|
109
|
-
throw new Error(`${path}: resize-panel requires sizes number[]`);
|
|
110
|
-
}
|
|
111
|
-
break;
|
|
112
|
-
case "set-layout":
|
|
113
|
-
if (!op.layoutId || typeof op.layoutId !== "string") {
|
|
114
|
-
throw new Error(`${path}: set-layout requires layoutId string`);
|
|
115
|
-
}
|
|
116
|
-
break;
|
|
117
|
-
case "reveal-field":
|
|
118
|
-
case "hide-field":
|
|
119
|
-
if (!op.fieldId || typeof op.fieldId !== "string") {
|
|
120
|
-
throw new Error(`${path}: ${op.op} requires fieldId string`);
|
|
121
|
-
}
|
|
122
|
-
break;
|
|
123
|
-
case "promote-action": {
|
|
124
|
-
if (!op.actionId || typeof op.actionId !== "string") {
|
|
125
|
-
throw new Error(`${path}: promote-action requires actionId string`);
|
|
126
|
-
}
|
|
127
|
-
const validPlacements = ["header", "inline", "context", "assistant"];
|
|
128
|
-
if (!op.placement || !validPlacements.includes(op.placement)) {
|
|
129
|
-
throw new Error(`${path}: promote-action placement must be one of ${validPlacements.join(", ")}`);
|
|
130
|
-
}
|
|
131
|
-
break;
|
|
132
|
-
}
|
|
133
|
-
case "set-focus":
|
|
134
|
-
if (!op.targetId || typeof op.targetId !== "string") {
|
|
135
|
-
throw new Error(`${path}: set-focus requires targetId string`);
|
|
136
|
-
}
|
|
137
|
-
break;
|
|
138
|
-
default:
|
|
139
|
-
throw new Error(`${path}: unknown op "${opType}"`);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
function validateSurfacePatch(ops) {
|
|
143
|
-
if (!Array.isArray(ops)) {
|
|
144
|
-
throw new Error("Patch ops must be an array");
|
|
145
|
-
}
|
|
146
|
-
for (let i = 0;i < ops.length; i++) {
|
|
147
|
-
const op = ops[i];
|
|
148
|
-
if (op)
|
|
149
|
-
validateSurfacePatchOp(op, i);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
function validateSurfaceNodeAgainstKinds(node, allowedKinds, path) {
|
|
153
|
-
if (!allowedKinds.includes(node.kind)) {
|
|
154
|
-
throw new Error(`${path}: kind "${node.kind}" not in allowed list [${allowedKinds.join(", ")}]`);
|
|
155
|
-
}
|
|
156
|
-
if (node.children) {
|
|
157
|
-
for (let i = 0;i < node.children.length; i++) {
|
|
158
|
-
const child = node.children[i];
|
|
159
|
-
if (child)
|
|
160
|
-
validateSurfaceNodeAgainstKinds(child, allowedKinds, `${path}.children[${i}]`);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
function validatePatchProposal(ops, constraints) {
|
|
165
|
-
if (!Array.isArray(ops)) {
|
|
166
|
-
throw new Error("Patch ops must be an array");
|
|
167
|
-
}
|
|
168
|
-
const { allowedOps, allowedSlots, allowedNodeKinds } = constraints;
|
|
169
|
-
for (let i = 0;i < ops.length; i++) {
|
|
170
|
-
const op = ops[i];
|
|
171
|
-
if (!op)
|
|
172
|
-
continue;
|
|
173
|
-
const path = `ops[${i}]`;
|
|
174
|
-
if (!allowedOps.includes(op.op)) {
|
|
175
|
-
throw new Error(`${path}: op "${op.op}" not in allowed list [${allowedOps.join(", ")}]`);
|
|
176
|
-
}
|
|
177
|
-
switch (op.op) {
|
|
178
|
-
case "insert-node":
|
|
179
|
-
if (!allowedSlots.includes(op.slotId)) {
|
|
180
|
-
throw new Error(`${path}: slotId "${op.slotId}" not in allowed slots [${allowedSlots.join(", ")}]`);
|
|
181
|
-
}
|
|
182
|
-
if (op.node) {
|
|
183
|
-
validateSurfaceNodeAgainstKinds(op.node, allowedNodeKinds, `${path}.node`);
|
|
184
|
-
}
|
|
185
|
-
break;
|
|
186
|
-
case "move-node":
|
|
187
|
-
if (!allowedSlots.includes(op.toSlotId)) {
|
|
188
|
-
throw new Error(`${path}: toSlotId "${op.toSlotId}" not in allowed slots [${allowedSlots.join(", ")}]`);
|
|
189
|
-
}
|
|
190
|
-
break;
|
|
191
|
-
case "replace-node":
|
|
192
|
-
if (op.node) {
|
|
193
|
-
validateSurfaceNodeAgainstKinds(op.node, allowedNodeKinds, `${path}.node`);
|
|
194
|
-
}
|
|
195
|
-
break;
|
|
196
|
-
default:
|
|
197
|
-
break;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
validateSurfacePatch(ops);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
// src/runtime/apply-surface-patch.ts
|
|
204
1
|
import { Logger } from "@contractspec/lib.observability";
|
|
205
|
-
|
|
2
|
+
const logger = new Logger("@contractspec/lib.surface-runtime");
|
|
3
|
+
import { validateSurfacePatch } from "../spec/validate-surface-patch";
|
|
206
4
|
function findNode(nodes, nodeId) {
|
|
207
5
|
for (const n of nodes) {
|
|
208
6
|
if (n.nodeId === nodeId)
|
|
@@ -261,7 +59,7 @@ function produceInverse(op, plan) {
|
|
|
261
59
|
return null;
|
|
262
60
|
}
|
|
263
61
|
}
|
|
264
|
-
function applySurfacePatch(plan, ops) {
|
|
62
|
+
export function applySurfacePatch(plan, ops) {
|
|
265
63
|
if (ops.length === 0)
|
|
266
64
|
return { plan, inverseOps: [] };
|
|
267
65
|
validateSurfacePatch(ops);
|
|
@@ -317,6 +115,3 @@ function applySurfacePatch(plan, ops) {
|
|
|
317
115
|
});
|
|
318
116
|
return result;
|
|
319
117
|
}
|
|
320
|
-
export {
|
|
321
|
-
applySurfacePatch
|
|
322
|
-
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
// src/runtime/audit-events.ts
|
|
2
1
|
function generateEventId() {
|
|
3
2
|
return `evt_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
|
|
4
3
|
}
|
|
5
|
-
function emitPatchProposed(audit, args) {
|
|
4
|
+
export function emitPatchProposed(audit, args) {
|
|
6
5
|
audit.emit({
|
|
7
6
|
eventId: generateEventId(),
|
|
8
7
|
at: new Date().toISOString(),
|
|
@@ -18,7 +17,7 @@ function emitPatchProposed(audit, args) {
|
|
|
18
17
|
}
|
|
19
18
|
});
|
|
20
19
|
}
|
|
21
|
-
function emitPatchApproved(audit, args) {
|
|
20
|
+
export function emitPatchApproved(audit, args) {
|
|
22
21
|
audit.emit({
|
|
23
22
|
eventId: generateEventId(),
|
|
24
23
|
at: new Date().toISOString(),
|
|
@@ -35,7 +34,7 @@ function emitPatchApproved(audit, args) {
|
|
|
35
34
|
}
|
|
36
35
|
});
|
|
37
36
|
}
|
|
38
|
-
function emitPatchRejected(audit, args) {
|
|
37
|
+
export function emitPatchRejected(audit, args) {
|
|
39
38
|
audit.emit({
|
|
40
39
|
eventId: generateEventId(),
|
|
41
40
|
at: new Date().toISOString(),
|
|
@@ -52,7 +51,7 @@ function emitPatchRejected(audit, args) {
|
|
|
52
51
|
}
|
|
53
52
|
});
|
|
54
53
|
}
|
|
55
|
-
function emitOverlaySaved(audit, args) {
|
|
54
|
+
export function emitOverlaySaved(audit, args) {
|
|
56
55
|
audit.emit({
|
|
57
56
|
eventId: generateEventId(),
|
|
58
57
|
at: new Date().toISOString(),
|
|
@@ -67,7 +66,7 @@ function emitOverlaySaved(audit, args) {
|
|
|
67
66
|
}
|
|
68
67
|
});
|
|
69
68
|
}
|
|
70
|
-
function emitOverlayApplied(audit, args) {
|
|
69
|
+
export function emitOverlayApplied(audit, args) {
|
|
71
70
|
audit.emit({
|
|
72
71
|
eventId: generateEventId(),
|
|
73
72
|
at: new Date().toISOString(),
|
|
@@ -81,7 +80,7 @@ function emitOverlayApplied(audit, args) {
|
|
|
81
80
|
}
|
|
82
81
|
});
|
|
83
82
|
}
|
|
84
|
-
function emitOverlayFailed(audit, args) {
|
|
83
|
+
export function emitOverlayFailed(audit, args) {
|
|
85
84
|
audit.emit({
|
|
86
85
|
eventId: generateEventId(),
|
|
87
86
|
at: new Date().toISOString(),
|
|
@@ -95,7 +94,7 @@ function emitOverlayFailed(audit, args) {
|
|
|
95
94
|
}
|
|
96
95
|
});
|
|
97
96
|
}
|
|
98
|
-
function emitPolicyDenied(audit, args) {
|
|
97
|
+
export function emitPolicyDenied(audit, args) {
|
|
99
98
|
audit.emit({
|
|
100
99
|
eventId: generateEventId(),
|
|
101
100
|
at: new Date().toISOString(),
|
|
@@ -110,7 +109,7 @@ function emitPolicyDenied(audit, args) {
|
|
|
110
109
|
}
|
|
111
110
|
});
|
|
112
111
|
}
|
|
113
|
-
function emitPolicyRedacted(audit, args) {
|
|
112
|
+
export function emitPolicyRedacted(audit, args) {
|
|
114
113
|
audit.emit({
|
|
115
114
|
eventId: generateEventId(),
|
|
116
115
|
at: new Date().toISOString(),
|
|
@@ -125,13 +124,3 @@ function emitPolicyRedacted(audit, args) {
|
|
|
125
124
|
}
|
|
126
125
|
});
|
|
127
126
|
}
|
|
128
|
-
export {
|
|
129
|
-
emitPolicyRedacted,
|
|
130
|
-
emitPolicyDenied,
|
|
131
|
-
emitPatchRejected,
|
|
132
|
-
emitPatchProposed,
|
|
133
|
-
emitPatchApproved,
|
|
134
|
-
emitOverlaySaved,
|
|
135
|
-
emitOverlayFailed,
|
|
136
|
-
emitOverlayApplied
|
|
137
|
-
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var DEFAULT_PREFERENCES = {
|
|
1
|
+
const DEFAULT_PREFERENCES = {
|
|
3
2
|
guidance: "hints",
|
|
4
3
|
density: "standard",
|
|
5
4
|
dataDepth: "detailed",
|
|
@@ -8,7 +7,7 @@ var DEFAULT_PREFERENCES = {
|
|
|
8
7
|
pace: "balanced",
|
|
9
8
|
narrative: "top-down"
|
|
10
9
|
};
|
|
11
|
-
function buildContext(params) {
|
|
10
|
+
export function buildContext(params) {
|
|
12
11
|
const {
|
|
13
12
|
route,
|
|
14
13
|
params: routeParams = {},
|
|
@@ -50,6 +49,3 @@ function buildContext(params) {
|
|
|
50
49
|
featureFlags
|
|
51
50
|
};
|
|
52
51
|
}
|
|
53
|
-
export {
|
|
54
|
-
buildContext
|
|
55
|
-
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
function createActionRegistry() {
|
|
1
|
+
export function createActionRegistry() {
|
|
3
2
|
const entries = new Map;
|
|
4
3
|
return {
|
|
5
4
|
register(entry) {
|
|
@@ -16,7 +15,7 @@ function createActionRegistry() {
|
|
|
16
15
|
}
|
|
17
16
|
};
|
|
18
17
|
}
|
|
19
|
-
function createCommandRegistry() {
|
|
18
|
+
export function createCommandRegistry() {
|
|
20
19
|
const entries = new Map;
|
|
21
20
|
return {
|
|
22
21
|
register(entry) {
|
|
@@ -33,7 +32,7 @@ function createCommandRegistry() {
|
|
|
33
32
|
}
|
|
34
33
|
};
|
|
35
34
|
}
|
|
36
|
-
function createBundleExtensionRegistry(options) {
|
|
35
|
+
export function createBundleExtensionRegistry(options) {
|
|
37
36
|
const actionRegistry = options.actionRegistry ?? createActionRegistry();
|
|
38
37
|
const commandRegistry = options.commandRegistry ?? createCommandRegistry();
|
|
39
38
|
return {
|
|
@@ -51,8 +50,3 @@ function createBundleExtensionRegistry(options) {
|
|
|
51
50
|
}
|
|
52
51
|
};
|
|
53
52
|
}
|
|
54
|
-
export {
|
|
55
|
-
createCommandRegistry,
|
|
56
|
-
createBundleExtensionRegistry,
|
|
57
|
-
createActionRegistry
|
|
58
|
-
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var CORE_FIELD_KINDS = {
|
|
1
|
+
export const FALLBACK_FIELD_KIND = "text";
|
|
2
|
+
const CORE_FIELD_KINDS = {
|
|
4
3
|
text: {
|
|
5
4
|
fieldKind: "text",
|
|
6
5
|
viewer: "text-viewer",
|
|
@@ -47,7 +46,7 @@ var CORE_FIELD_KINDS = {
|
|
|
47
46
|
validators: ["required"]
|
|
48
47
|
}
|
|
49
48
|
};
|
|
50
|
-
|
|
49
|
+
const STUB_FIELD_KINDS = {
|
|
51
50
|
relation: {
|
|
52
51
|
fieldKind: "relation",
|
|
53
52
|
viewer: "relation-viewer-stub",
|
|
@@ -95,7 +94,7 @@ var STUB_FIELD_KINDS = {
|
|
|
95
94
|
validators: ["required", "regex"]
|
|
96
95
|
}
|
|
97
96
|
};
|
|
98
|
-
function createFieldRendererRegistry() {
|
|
97
|
+
export function createFieldRendererRegistry() {
|
|
99
98
|
const all = { ...CORE_FIELD_KINDS, ...STUB_FIELD_KINDS };
|
|
100
99
|
const fallback = CORE_FIELD_KINDS[FALLBACK_FIELD_KIND];
|
|
101
100
|
if (!fallback) {
|
|
@@ -113,7 +112,7 @@ function createFieldRendererRegistry() {
|
|
|
113
112
|
}
|
|
114
113
|
};
|
|
115
114
|
}
|
|
116
|
-
function createMutableFieldRendererRegistry() {
|
|
115
|
+
export function createMutableFieldRendererRegistry() {
|
|
117
116
|
const base = { ...CORE_FIELD_KINDS, ...STUB_FIELD_KINDS };
|
|
118
117
|
const custom = new Map;
|
|
119
118
|
const fallback = CORE_FIELD_KINDS[FALLBACK_FIELD_KIND];
|
|
@@ -138,8 +137,3 @@ function createMutableFieldRendererRegistry() {
|
|
|
138
137
|
}
|
|
139
138
|
};
|
|
140
139
|
}
|
|
141
|
-
export {
|
|
142
|
-
createMutableFieldRendererRegistry,
|
|
143
|
-
createFieldRendererRegistry,
|
|
144
|
-
FALLBACK_FIELD_KIND
|
|
145
|
-
};
|