@kontourai/survey 7.0.0 → 8.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +2 -1
  3. package/dist/src/calibration.d.ts +15 -0
  4. package/dist/src/calibration.js +11 -0
  5. package/dist/src/canonical-reviewed-trust-input.d.ts +10 -0
  6. package/dist/src/canonical-reviewed-trust-input.js +15 -0
  7. package/dist/src/console/review-console-server.d.ts +20 -0
  8. package/dist/src/console/review-console-server.js +75 -4
  9. package/dist/src/decision-carry-forward.d.ts +157 -0
  10. package/dist/src/decision-carry-forward.js +295 -0
  11. package/dist/src/extraction-envelope.d.ts +4 -3
  12. package/dist/src/extraction-envelope.js +3 -3
  13. package/dist/src/field-states.d.ts +100 -0
  14. package/dist/src/field-states.js +169 -0
  15. package/dist/src/index.d.ts +3 -1
  16. package/dist/src/index.js +2 -0
  17. package/dist/src/mcp/review-mcp.js +44 -13
  18. package/dist/src/review-resource.d.ts +29 -0
  19. package/dist/src/review-session-file.d.ts +6 -0
  20. package/dist/src/review-session-file.js +2 -0
  21. package/dist/src/review-workbench/audit-sample.d.ts +32 -0
  22. package/dist/src/review-workbench/audit-sample.js +53 -0
  23. package/dist/src/review-workbench/extraction-inspector.d.ts +1 -1
  24. package/dist/src/review-workbench/extraction-inspector.js +1 -1
  25. package/dist/src/review-workbench/field-state-view.d.ts +15 -0
  26. package/dist/src/review-workbench/field-state-view.js +84 -0
  27. package/dist/src/review-workbench/review-queue-session.d.ts +46 -1
  28. package/dist/src/review-workbench/review-queue-session.js +74 -3
  29. package/dist/src/review-workbench/review-session-replay.d.ts +1 -1
  30. package/dist/src/review-workbench/review-session-replay.js +15 -1
  31. package/dist/src/review-workbench/review-workbench-css.generated.d.ts +9 -0
  32. package/dist/src/review-workbench/review-workbench-css.generated.js +453 -43
  33. package/dist/src/review-workbench/review-workbench-element.js +68 -212
  34. package/dist/src/review-workbench/review-workbench.css +386 -42
  35. package/dist/src/review-workbench/review-workbench.d.ts +13 -1
  36. package/dist/src/review-workbench/review-workbench.js +41 -15
  37. package/dist/src/review-workbench/review-workbench.standalone.css +37 -23
  38. package/dist/src/review-workbench/vendor/kontourai-ui/tokens/themes.css +189 -10
  39. package/dist/src/review-workbench/vendor/kontourai-ui/tokens/tokens.css +156 -5
  40. package/package.json +13 -8
@@ -19,12 +19,23 @@
19
19
  /* text */
20
20
  --k-text: #eef3f8;
21
21
  --k-text-muted: #aebccb;
22
- --k-text-faint: #72869b;
22
+ --k-text-faint: #75889d;
23
23
 
24
- /* brand */
24
+ /* brand — the product identity slot (eyebrows, accents, the progress sweep).
25
+ A product theme or a white-label deployment may override it; nothing
26
+ interactive reads it, so a brand that fails contrast cannot break a
27
+ button or a focus ring. */
25
28
  --k-brand: #5ce0c6;
26
29
  --k-brand-contrast: #06080b;
27
30
 
31
+ /* interaction roles — primary actions and keyboard focus. They hold their
32
+ own values instead of var(--k-brand): an alias would make every brand
33
+ override repaint buttons whether or not the new color can carry text.
34
+ Each theme and mode sets its action and focus beside its brand. */
35
+ --k-action: #5ce0c6;
36
+ --k-action-contrast: #06080b;
37
+ --k-focus: #5ce0c6;
38
+
28
39
  /* semantic status scale */
29
40
  --k-positive: #34d399;
30
41
  --k-caution: #f3b14b;
@@ -35,6 +46,51 @@
35
46
  --k-caution-soft: color-mix(in oklab, var(--k-caution) 14%, transparent);
36
47
  --k-negative-soft: color-mix(in oklab, var(--k-negative) 14%, transparent);
37
48
  --k-active-soft: color-mix(in oklab, var(--k-active) 14%, transparent);
49
+ /* Text on a filled status tone (tone badges, status-toned buttons). Its own
50
+ role so a white-label --k-brand-contrast cannot recolor status text. */
51
+ --k-status-contrast: #06080b;
52
+
53
+ /* trust states — Surface's claim statuses (TRUST_STATUSES, in Surface's
54
+ order), shown as presentation states: separate from the five status
55
+ tones and from the product accents. Each state has its own ink (label,
56
+ glyph, border), fill (the chip's own background, so its text pair does
57
+ not depend on the container) and line style (the non-color cue borders
58
+ and chart strokes reuse). Values are literal, never aliases: an alias
59
+ declared here resolves here, so a light or themed scope would inherit
60
+ this scope's hue (ui#78). */
61
+ --k-trust-unknown: #a2acb7;
62
+ --k-trust-unknown-fill: #252d39;
63
+ --k-trust-unknown-line: dotted;
64
+ --k-trust-proposed: #87b1fd;
65
+ --k-trust-proposed-fill: #222d42;
66
+ --k-trust-proposed-line: dashed;
67
+ --k-trust-assumed: #c4a4fe;
68
+ --k-trust-assumed-fill: #2a2c43;
69
+ --k-trust-assumed-line: dashed;
70
+ --k-trust-verified: #50d492;
71
+ --k-trust-verified-fill: #1a3233;
72
+ --k-trust-verified-line: solid;
73
+ --k-trust-stale: #f6b84d;
74
+ --k-trust-stale-fill: #312e2a;
75
+ --k-trust-stale-line: dotted;
76
+ --k-trust-disputed: #ec81c0;
77
+ --k-trust-disputed-fill: #30273a;
78
+ --k-trust-disputed-line: double;
79
+ --k-trust-superseded: #6bc8d3;
80
+ --k-trust-superseded-fill: #1e313d;
81
+ --k-trust-superseded-line: dotted;
82
+ --k-trust-rejected: #f66d67;
83
+ --k-trust-rejected-fill: #31242d;
84
+ --k-trust-rejected-line: solid;
85
+ --k-trust-revoked: #fdc2a2;
86
+ --k-trust-revoked-fill: #323036;
87
+ --k-trust-revoked-line: dotted;
88
+
89
+ /* trust basis — the line after a trust-state chip. Caveat facets
90
+ (Model-derived, not evaluated, cited only, contradicts, failed) are
91
+ underlined with a dashed line in the text's own color: a line-style cue,
92
+ never a hue. Names no color, so it inherits the rated muted text. */
93
+ --k-basis-caveat-decoration: underline dashed 1px;
38
94
 
39
95
  /* spacing */
40
96
  --k-space-1: 4px;
@@ -85,8 +141,11 @@
85
141
  --k-tracking-wide: 0.08em;
86
142
 
87
143
  /* focus — one ring contract so every interactive primitive (controls,
88
- buttons, links) shows the same keyboard-focus affordance. */
89
- --k-focus-ring: var(--k-brand);
144
+ buttons, links) shows the same keyboard-focus affordance. The ring color
145
+ is the --k-focus role; --k-focus-ring is kept as a compatibility alias for
146
+ consumer styles. Primitives read --k-focus directly, so an override of
147
+ --k-focus on any element reaches them. */
148
+ --k-focus-ring: var(--k-focus);
90
149
  --k-focus-ring-width: 2px;
91
150
  --k-focus-ring-offset: 2px;
92
151
 
@@ -102,6 +161,63 @@
102
161
  --k-z-toast: 1400;
103
162
  }
104
163
 
164
+ /* The dark contract again, for a data-theme="dark" element below a light
165
+ element (ui#80). It sets exactly the tokens the light block sets, with the
166
+ :root values; check:contrast fails if either drifts. Mode-independent
167
+ tokens (spacing, type, radii, fonts) are not reset, so a theme's own values
168
+ for them survive a mode switch. With no light ancestor there is nothing to
169
+ reset, so it does not match and a dark element simply inherits. */
170
+ [data-theme="dark"]:where([data-theme="light"] *) {
171
+ color-scheme: dark;
172
+ --k-bg: #0a0e13;
173
+ --k-panel: #111824;
174
+ --k-panel-raised: #16202d;
175
+ --k-line: rgba(150, 180, 210, 0.12);
176
+ --k-line-strong: rgba(150, 180, 210, 0.22);
177
+ --k-shadow: 0 26px 60px -42px rgba(0, 0, 0, 0.95);
178
+ --k-elevation-overlay:
179
+ 0 1px 2px rgba(0, 0, 0, 0.35),
180
+ 0 12px 32px rgba(0, 0, 0, 0.45),
181
+ 0 24px 56px rgba(0, 0, 0, 0.4);
182
+ --k-text: #eef3f8;
183
+ --k-text-muted: #aebccb;
184
+ --k-text-faint: #75889d;
185
+ --k-brand: #5ce0c6;
186
+ --k-brand-contrast: #06080b;
187
+ --k-action: #5ce0c6;
188
+ --k-action-contrast: #06080b;
189
+ --k-focus: #5ce0c6;
190
+ --k-positive: #34d399;
191
+ --k-caution: #f3b14b;
192
+ --k-negative: #ff6f6f;
193
+ --k-neutral: #6f8095;
194
+ --k-active: #7aa2ff;
195
+ --k-status-contrast: #06080b;
196
+ --k-trust-unknown: #a2acb7;
197
+ --k-trust-unknown-fill: #252d39;
198
+ --k-trust-proposed: #87b1fd;
199
+ --k-trust-proposed-fill: #222d42;
200
+ --k-trust-assumed: #c4a4fe;
201
+ --k-trust-assumed-fill: #2a2c43;
202
+ --k-trust-verified: #50d492;
203
+ --k-trust-verified-fill: #1a3233;
204
+ --k-trust-stale: #f6b84d;
205
+ --k-trust-stale-fill: #312e2a;
206
+ --k-trust-disputed: #ec81c0;
207
+ --k-trust-disputed-fill: #30273a;
208
+ --k-trust-superseded: #6bc8d3;
209
+ --k-trust-superseded-fill: #1e313d;
210
+ --k-trust-rejected: #f66d67;
211
+ --k-trust-rejected-fill: #31242d;
212
+ --k-trust-revoked: #fdc2a2;
213
+ --k-trust-revoked-fill: #323036;
214
+ --k-focus-ring: var(--k-focus);
215
+ --k-positive-soft: color-mix(in oklab, var(--k-positive) 14%, transparent);
216
+ --k-caution-soft: color-mix(in oklab, var(--k-caution) 14%, transparent);
217
+ --k-negative-soft: color-mix(in oklab, var(--k-negative) 14%, transparent);
218
+ --k-active-soft: color-mix(in oklab, var(--k-active) 14%, transparent);
219
+ }
220
+
105
221
  [data-theme="light"] {
106
222
  color-scheme: light;
107
223
  --k-bg: #f5f4ef;
@@ -116,16 +232,51 @@
116
232
  0 18px 48px rgba(0, 0, 0, 0.08);
117
233
  --k-text: #202124;
118
234
  --k-text-muted: #5b626b;
119
- --k-text-faint: #707782;
235
+ --k-text-faint: #6a707b;
120
236
  /* The dark-mode brand (#5ce0c6) is too light to carry white text or read as
121
237
  text on the light canvas (~1.6:1). Darken it for light mode: #0e7c64 holds
122
238
  the teal hue while clearing WCAG AA both as a button fill (white text,
123
239
  5.1:1) and as text on --k-bg (4.7:1). */
124
240
  --k-brand: #0e7c64;
125
241
  --k-brand-contrast: #ffffff;
242
+ --k-action: #0e7c64;
243
+ --k-action-contrast: #ffffff;
244
+ --k-focus: #0e7c64;
126
245
  --k-positive: #168257;
127
246
  --k-caution: #8a5a00;
128
247
  --k-negative: #c83b3b;
129
248
  --k-neutral: #5f6975;
130
249
  --k-active: #3f6fd6;
250
+ --k-status-contrast: #ffffff;
251
+
252
+ /* Light trust inks are dark enough that each label clears AA on its own
253
+ tinted fill; check:contrast rates every pair. */
254
+ --k-trust-unknown: #535c66;
255
+ --k-trust-unknown-fill: #eeeff0;
256
+ --k-trust-proposed: #2855ad;
257
+ --k-trust-proposed-fill: #eaeef7;
258
+ --k-trust-assumed: #6938a7;
259
+ --k-trust-assumed-fill: #f0ebf6;
260
+ --k-trust-verified: #006d42;
261
+ --k-trust-verified-fill: #e6f0ec;
262
+ --k-trust-stale: #855a00;
263
+ --k-trust-stale-fill: #f3efe6;
264
+ --k-trust-disputed: #94296f;
265
+ --k-trust-disputed-fill: #f4eaf1;
266
+ --k-trust-superseded: #016770;
267
+ --k-trust-superseded-fill: #e6f0f1;
268
+ --k-trust-rejected: #a12628;
269
+ --k-trust-rejected-fill: #f6e9ea;
270
+ --k-trust-revoked: #713408;
271
+ --k-trust-revoked-fill: #f1ebe6;
272
+
273
+ /* Tokens derived with var() resolve on the element that declares them and
274
+ are inherited as computed values, so each scope that changes an input
275
+ redeclares them. Without this, data-theme on a descendant of <html> would
276
+ keep the dark default's ring and soft fills. */
277
+ --k-focus-ring: var(--k-focus);
278
+ --k-positive-soft: color-mix(in oklab, var(--k-positive) 14%, transparent);
279
+ --k-caution-soft: color-mix(in oklab, var(--k-caution) 14%, transparent);
280
+ --k-negative-soft: color-mix(in oklab, var(--k-negative) 14%, transparent);
281
+ --k-active-soft: color-mix(in oklab, var(--k-active) 14%, transparent);
131
282
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontourai/survey",
3
- "version": "7.0.0",
3
+ "version": "8.1.0",
4
4
  "description": "Producer-side source, extraction, candidate, and review contracts for projecting verified claims into Surface.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -35,7 +35,11 @@
35
35
  "./example-data/public-field-review": "./dist/example-data/public-field-review.js",
36
36
  "./example-data/corrected-document-candidates": "./dist/example-data/corrected-document-candidates.js",
37
37
  "./example-data/public-directory-review-resource": "./dist/example-data/public-directory-review-resource.js",
38
- "./example-data/regulated-document-review-resource": "./dist/example-data/regulated-document-review-resource.js"
38
+ "./example-data/regulated-document-review-resource": "./dist/example-data/regulated-document-review-resource.js",
39
+ "./review-console": {
40
+ "types": "./dist/src/console/review-console-server.d.ts",
41
+ "default": "./dist/src/console/review-console-server.js"
42
+ }
39
43
  },
40
44
  "files": [
41
45
  "bin/",
@@ -53,7 +57,7 @@
53
57
  "test:package-smoke": "npm run build && node --test dist/tests/package-smoke/*.test.js",
54
58
  "test:browser": "playwright test",
55
59
  "test:browser:concurrent": "npm run build && node scripts/test-playwright-concurrency.mjs",
56
- "verify": "npm run check:content-boundary && npm run check:decisions && npm run typecheck && npm test && npm run test:package-smoke && npm run check:review-workbench-assets && npm run check:review-workbench && npm run test:browser && npm run test:browser:concurrent",
60
+ "verify": "npm run check:ui-token-drift && npm run check:content-boundary && npm run check:decisions && npm run typecheck && npm test && npm run test:package-smoke && npm run check:review-workbench && npm run test:browser && npm run test:browser:concurrent",
57
61
  "check:content-boundary": "node --test tests/content-boundary-script.test.cjs && node scripts/check-content-boundary.cjs",
58
62
  "check:decisions": "node scripts/check-decisions.cjs check",
59
63
  "check:guards": "node scripts/check-guards.mjs",
@@ -65,9 +69,11 @@
65
69
  "check:review-workbench:static": "npm run build && node scripts/check-review-workbench.cjs",
66
70
  "setup:repo-hooks": "node scripts/setup-repo-hooks.cjs",
67
71
  "validate:repo-hooks": "node scripts/validate-repo-hooks.cjs",
68
- "docs:build": "npm run build --silent && node scripts/docs-site/build.ts",
69
- "docs:check": "npm run docs:build && node scripts/docs-site/check-links.ts",
72
+ "docs:build": "npx -y github:kontourai/docs-kit#efe0bfe4ad247861ef661c907f6354d6167fa3be docs-kit build",
73
+ "docs:check": "npx -y github:kontourai/docs-kit#efe0bfe4ad247861ef661c907f6354d6167fa3be docs-kit check",
74
+ "docs:demo": "npm run build && node scripts/build-demo.mjs",
70
75
  "check:generated-css": "node scripts/copy-review-workbench-package-assets.cjs --check",
76
+ "check:ui-token-drift": "npm run check:generated-css && npm run check:review-workbench-assets",
71
77
  "workflow:sidecar": "flow-agents-workflow-sidecar",
72
78
  "workflow:validate-artifacts": "flow-agents-validate-artifacts"
73
79
  },
@@ -86,11 +92,10 @@
86
92
  },
87
93
  "devDependencies": {
88
94
  "@kontourai/flow-agents": "5.10.0",
89
- "@kontourai/traverse": "^0.25.0",
90
- "@kontourai/ui": "^1.1.0",
95
+ "@kontourai/traverse": "^3.0.1",
96
+ "@kontourai/ui": "^1.18.0",
91
97
  "@playwright/test": "^1.62.0",
92
98
  "@types/node": "^26.1.2",
93
- "marked": "^18.0.7",
94
99
  "typescript": "^7.0.2"
95
100
  },
96
101
  "engines": {