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