@xemahq/ui-kernel 0.11.0 → 0.11.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.
Files changed (237) hide show
  1. package/dist/ui/chrome/page-shell.d.ts +1 -1
  2. package/dist/ui/chrome/page-shell.d.ts.map +1 -1
  3. package/dist/ui/chrome/page-shell.js +9 -4
  4. package/dist/ui/chrome/page-shell.js.map +1 -1
  5. package/package.json +6 -4
  6. package/src/index.ts +0 -17
  7. package/src/lib/biome-host/agent-validation.ts +0 -239
  8. package/src/lib/biome-host/biome-builders.ts +0 -112
  9. package/src/lib/biome-host/biome-mode.ts +0 -6
  10. package/src/lib/biome-host/biome-navigation.ts +0 -37
  11. package/src/lib/biome-host/biome-registry.ts +0 -299
  12. package/src/lib/biome-host/biome-scope-hooks.ts +0 -41
  13. package/src/lib/biome-host/biome-scope.tsx +0 -52
  14. package/src/lib/biome-host/biome-scoped-query.ts +0 -134
  15. package/src/lib/biome-host/create-biome-orval-config.ts +0 -82
  16. package/src/lib/biome-host/define-web-biome.spec.ts +0 -221
  17. package/src/lib/biome-host/define-web-biome.ts +0 -222
  18. package/src/lib/biome-host/errors.ts +0 -220
  19. package/src/lib/biome-host/frontend-biome.ts +0 -256
  20. package/src/lib/biome-host/host-bridge.ts +0 -281
  21. package/src/lib/biome-host/host-sources.ts +0 -54
  22. package/src/lib/biome-host/i18n-hooks.ts +0 -51
  23. package/src/lib/biome-host/i18n-port.test.ts +0 -50
  24. package/src/lib/biome-host/i18n-port.ts +0 -96
  25. package/src/lib/biome-host/index.ts +0 -35
  26. package/src/lib/biome-host/realtime-hooks.ts +0 -75
  27. package/src/lib/biome-host/realtime-port.ts +0 -115
  28. package/src/lib/biome-host/session-contributions.ts +0 -296
  29. package/src/lib/biome-host/use-mutation-with-error-toast.ts +0 -90
  30. package/src/lib/biome-host/use-page-state.ts +0 -248
  31. package/src/lib/capabilities/capability-context.ts +0 -25
  32. package/src/lib/capabilities/capability-provider.tsx +0 -73
  33. package/src/lib/capabilities/index.ts +0 -17
  34. package/src/lib/capabilities/types.ts +0 -69
  35. package/src/lib/capabilities/use-capability.ts +0 -79
  36. package/src/lib/contribution-registry/contribution-registry.spec.ts +0 -141
  37. package/src/lib/contribution-registry/contribution-registry.ts +0 -204
  38. package/src/lib/contribution-registry/index.ts +0 -9
  39. package/src/lib/contribution-registry/renderable-registry.ts +0 -142
  40. package/src/lib/system-bus/capability-invoke.ts +0 -92
  41. package/src/lib/system-bus/deeplink.ts +0 -210
  42. package/src/lib/system-bus/enums.ts +0 -86
  43. package/src/lib/system-bus/host-ports.ts +0 -93
  44. package/src/lib/system-bus/index.ts +0 -16
  45. package/src/lib/system-bus/intent-registry.ts +0 -109
  46. package/src/lib/system-bus/intents.ts +0 -113
  47. package/src/lib/system-bus/palette.ts +0 -78
  48. package/src/lib/system-bus/system-bus-builder.ts +0 -159
  49. package/src/lib/system-bus/system-bus.ts +0 -37
  50. package/src/lib/system-bus/windows.ts +0 -51
  51. package/src/offline/id.ts +0 -16
  52. package/src/offline/index.ts +0 -54
  53. package/src/offline/mutation.ts +0 -75
  54. package/src/offline/offline-status-badge.tsx +0 -51
  55. package/src/offline/online-controller.ts +0 -105
  56. package/src/offline/outbox.test.ts +0 -172
  57. package/src/offline/outbox.ts +0 -348
  58. package/src/offline/react-hooks.ts +0 -40
  59. package/src/offline/react.tsx +0 -32
  60. package/src/offline/storage.ts +0 -112
  61. package/src/offline/types.ts +0 -77
  62. package/src/org-db/components/DbResultTable.tsx +0 -176
  63. package/src/org-db/index.ts +0 -1
  64. package/src/pdf/index.ts +0 -11
  65. package/src/registry/index.ts +0 -9
  66. package/src/registry/lib/agent-validation-host.ts +0 -36
  67. package/src/registry/lib/biome-slot.tsx +0 -50
  68. package/src/registry/lib/biomes-enabled-context.ts +0 -20
  69. package/src/registry/lib/extension-points.ts +0 -134
  70. package/src/registry/lib/primitives/SessionEventCard.tsx +0 -164
  71. package/src/registry/lib/primitives/SessionEventTimeline.tsx +0 -95
  72. package/src/registry/lib/primitives/SessionMutationBar.tsx +0 -76
  73. package/src/registry/lib/primitives/SessionTabbedDrawer.tsx +0 -165
  74. package/src/registry/lib/primitives/index.ts +0 -18
  75. package/src/registry/lib/session-context-builder.ts +0 -84
  76. package/src/registry/lib/session-context-provider.tsx +0 -33
  77. package/src/registry/lib/session-context.ts +0 -21
  78. package/src/registry/lib/session-selectors.ts +0 -272
  79. package/src/session/comments/CommentRail.tsx +0 -164
  80. package/src/session/index.ts +0 -3
  81. package/src/session/lib/cn.ts +0 -11
  82. package/src/session/shell/SessionWorkspaceShell.tsx +0 -147
  83. package/src/session-kit/approvals/ApprovalButton.tsx +0 -89
  84. package/src/session-kit/approvals/ApprovalCard.tsx +0 -341
  85. package/src/session-kit/approvals/ApprovalsCenter.tsx +0 -336
  86. package/src/session-kit/approvals/CapabilityApprovalStickyBar.tsx +0 -118
  87. package/src/session-kit/approvals/Obligation.tsx +0 -111
  88. package/src/session-kit/approvals/ScopedBody.tsx +0 -392
  89. package/src/session-kit/approvals/approval-icons.ts +0 -31
  90. package/src/session-kit/approvals/approval-model.ts +0 -204
  91. package/src/session-kit/approvals/index.ts +0 -22
  92. package/src/session-kit/approvals/obligation-display.ts +0 -100
  93. package/src/session-kit/approvals/risk-accent.ts +0 -47
  94. package/src/session-kit/approvals/scope-icons.ts +0 -19
  95. package/src/session-kit/combobox/Combobox.tsx +0 -358
  96. package/src/session-kit/combobox/use-click-outside.ts +0 -21
  97. package/src/session-kit/display/ContextHeader.tsx +0 -148
  98. package/src/session-kit/display/FileDiffCard.tsx +0 -140
  99. package/src/session-kit/display/MD.tsx +0 -162
  100. package/src/session-kit/display/MessageTurn.tsx +0 -157
  101. package/src/session-kit/display/ThinkingPanel.tsx +0 -81
  102. package/src/session-kit/display/TodoChecklist.tsx +0 -120
  103. package/src/session-kit/display/TokenMeter.tsx +0 -89
  104. package/src/session-kit/display/ToolStrip.tsx +0 -278
  105. package/src/session-kit/display/TypingDots.tsx +0 -24
  106. package/src/session-kit/index.ts +0 -44
  107. package/src/session-kit/lib/enums.ts +0 -66
  108. package/src/session-kit/lib/portal-accent.ts +0 -30
  109. package/src/session-kit/lib/status-dot.ts +0 -68
  110. package/src/session-kit/primitives/Avatar.tsx +0 -44
  111. package/src/session-kit/primitives/PortalGlyph.tsx +0 -51
  112. package/src/session-kit/primitives/RiskPill.tsx +0 -95
  113. package/src/session-kit/primitives/ScopeDot.tsx +0 -47
  114. package/src/session-kit/primitives/Segmented.tsx +0 -71
  115. package/src/ui/branding/app-branding-context.ts +0 -20
  116. package/src/ui/branding/app-branding-provider.tsx +0 -123
  117. package/src/ui/branding/sanitize.ts +0 -89
  118. package/src/ui/breakpoints.ts +0 -14
  119. package/src/ui/capture/document-preview.tsx +0 -166
  120. package/src/ui/capture/field-spec-to-zod.test.ts +0 -81
  121. package/src/ui/capture/field-spec-to-zod.ts +0 -174
  122. package/src/ui/capture/field-spec-validate.ts +0 -236
  123. package/src/ui/capture/field-spec.test.ts +0 -49
  124. package/src/ui/capture/field-spec.ts +0 -274
  125. package/src/ui/capture/index.ts +0 -51
  126. package/src/ui/capture/schema-field-input.tsx +0 -620
  127. package/src/ui/capture/schema-form.tsx +0 -149
  128. package/src/ui/capture/submit-values.test.ts +0 -70
  129. package/src/ui/capture/submit-values.ts +0 -63
  130. package/src/ui/capture/use-prefill.ts +0 -186
  131. package/src/ui/capture/use-schema-validation.ts +0 -145
  132. package/src/ui/capture/use-wizard.ts +0 -180
  133. package/src/ui/capture/value-format.ts +0 -32
  134. package/src/ui/capture/wizard.tsx +0 -105
  135. package/src/ui/charts/bar-chart.tsx +0 -139
  136. package/src/ui/charts/chart-frame.tsx +0 -125
  137. package/src/ui/charts/chart-types.ts +0 -52
  138. package/src/ui/charts/chart-utils.ts +0 -190
  139. package/src/ui/charts/charts.test.tsx +0 -204
  140. package/src/ui/charts/donut-chart.tsx +0 -129
  141. package/src/ui/charts/index.ts +0 -27
  142. package/src/ui/charts/line-chart.tsx +0 -202
  143. package/src/ui/charts/sparkline.tsx +0 -109
  144. package/src/ui/chrome/AsyncBoundary.tsx +0 -74
  145. package/src/ui/chrome/EmptyState.tsx +0 -257
  146. package/src/ui/chrome/ErrorCard.tsx +0 -63
  147. package/src/ui/chrome/LoadingState.tsx +0 -61
  148. package/src/ui/chrome/PageHeader.tsx +0 -137
  149. package/src/ui/chrome/RecordCardList.tsx +0 -98
  150. package/src/ui/chrome/StateCard.tsx +0 -150
  151. package/src/ui/chrome/confirm-delete-dialog.tsx +0 -59
  152. package/src/ui/chrome/page-shell.tsx +0 -189
  153. package/src/ui/chrome/scope-badge.tsx +0 -40
  154. package/src/ui/chrome/status-badge.tsx +0 -79
  155. package/src/ui/cn.ts +0 -32
  156. package/src/ui/design-tokens.ts +0 -372
  157. package/src/ui/hooks/use-debounced-value.ts +0 -16
  158. package/src/ui/hooks/use-is-mobile.ts +0 -28
  159. package/src/ui/index.ts +0 -110
  160. package/src/ui/pdf/pdf-preview.tsx +0 -122
  161. package/src/ui/primitives/alert-dialog.tsx +0 -104
  162. package/src/ui/primitives/async-combobox.tsx +0 -182
  163. package/src/ui/primitives/badge-variants.ts +0 -21
  164. package/src/ui/primitives/badge.tsx +0 -25
  165. package/src/ui/primitives/button-variants.ts +0 -31
  166. package/src/ui/primitives/button.tsx +0 -29
  167. package/src/ui/primitives/card.tsx +0 -43
  168. package/src/ui/primitives/checkbox.tsx +0 -26
  169. package/src/ui/primitives/collapsible.tsx +0 -9
  170. package/src/ui/primitives/dialog.tsx +0 -103
  171. package/src/ui/primitives/dropdown-menu.tsx +0 -179
  172. package/src/ui/primitives/form-stepper.tsx +0 -94
  173. package/src/ui/primitives/form-stepper.types.ts +0 -15
  174. package/src/ui/primitives/input.tsx +0 -22
  175. package/src/ui/primitives/label.tsx +0 -17
  176. package/src/ui/primitives/overflow-tabs.tsx +0 -331
  177. package/src/ui/primitives/popover.tsx +0 -33
  178. package/src/ui/primitives/preview-device-frame.tsx +0 -213
  179. package/src/ui/primitives/radio-group.tsx +0 -36
  180. package/src/ui/primitives/resizable.tsx +0 -67
  181. package/src/ui/primitives/scroll-area.tsx +0 -38
  182. package/src/ui/primitives/select.tsx +0 -143
  183. package/src/ui/primitives/separator.tsx +0 -20
  184. package/src/ui/primitives/sheet.tsx +0 -107
  185. package/src/ui/primitives/skeleton.tsx +0 -99
  186. package/src/ui/primitives/switch.tsx +0 -27
  187. package/src/ui/primitives/table.tsx +0 -72
  188. package/src/ui/primitives/tabs.tsx +0 -53
  189. package/src/ui/primitives/tag-multi-select.tsx +0 -261
  190. package/src/ui/primitives/textarea.tsx +0 -21
  191. package/src/ui/primitives/tooltip.tsx +0 -30
  192. package/src/ui/primitives/url-preview-chrome.tsx +0 -103
  193. package/src/vista/GenericCatalogueSurface.tsx +0 -179
  194. package/src/vista/SurfaceFallbackCard.tsx +0 -109
  195. package/src/vista/VistaPanel.tsx +0 -163
  196. package/src/vista/form-payload.spec.ts +0 -139
  197. package/src/vista/html/CustomUiFrame.spec.tsx +0 -127
  198. package/src/vista/html/CustomUiFrame.tsx +0 -206
  199. package/src/vista/html/custom-ui-frame-bridge.spec.ts +0 -191
  200. package/src/vista/html/custom-ui-frame-bridge.ts +0 -98
  201. package/src/vista/html/custom-ui-frame-contract.ts +0 -88
  202. package/src/vista/html/custom-ui-intents.spec.ts +0 -135
  203. package/src/vista/html/custom-ui-intents.ts +0 -155
  204. package/src/vista/html/custom-ui-srcdoc.spec.ts +0 -151
  205. package/src/vista/html/custom-ui-srcdoc.ts +0 -193
  206. package/src/vista/html/index.ts +0 -13
  207. package/src/vista/index.ts +0 -52
  208. package/src/vista/surface-catalogue.spec.ts +0 -140
  209. package/src/vista/surface-catalogue.ts +0 -90
  210. package/src/vista/surface-icons.ts +0 -57
  211. package/src/vista/surface-registry.ts +0 -56
  212. package/src/vista/surfaces/ChartSurface.tsx +0 -34
  213. package/src/vista/surfaces/FilesSurface.tsx +0 -202
  214. package/src/vista/surfaces/FormSurface.tsx +0 -380
  215. package/src/vista/surfaces/HtmlSurface.tsx +0 -43
  216. package/src/vista/surfaces/TableSurface.tsx +0 -100
  217. package/src/vista/surfaces/UrlSurface.tsx +0 -40
  218. package/src/vista/surfaces/blob-surfaces.tsx +0 -139
  219. package/src/vista/surfaces/elicitation-transport.spec.ts +0 -369
  220. package/src/vista/surfaces/elicitation-transport.ts +0 -367
  221. package/src/vista/surfaces/file-surface-utils.ts +0 -69
  222. package/src/vista/surfaces/index.ts +0 -24
  223. package/src/vista/surfaces/register-surfaces.tsx +0 -139
  224. package/src/vista/surfaces/text-surfaces.tsx +0 -132
  225. package/src/vista/use-vista-tabs.ts +0 -196
  226. package/src/vista/vista-code-renderer-context.ts +0 -16
  227. package/src/vista/vista-code-renderer.tsx +0 -35
  228. package/src/vista/vista-file-context.ts +0 -14
  229. package/src/vista/vista-file-source.tsx +0 -141
  230. package/src/vista/vista-form-context.ts +0 -20
  231. package/src/vista/vista-form-host.tsx +0 -48
  232. package/src/vista/vista-model.ts +0 -137
  233. package/src/vista/vista-open-context.tsx +0 -27
  234. package/src/vista/vista-open-state.ts +0 -11
  235. package/src/vista/vista-payloads.ts +0 -635
  236. package/src/vista/vista-tabs-manifest.ts +0 -138
  237. package/src/vista/vista-tools.ts +0 -232
@@ -1,278 +0,0 @@
1
- /**
2
- * Tool-call strip — a collapsed summary chip that expands into a row of
3
- * per-tool chips. Tool icons and the summary stat icons are
4
- * host-supplied; the dot/stat colours come from the authoritative
5
- * status-dot map so every surface agrees on "amber pending / green done
6
- * / red error".
7
- */
8
- import { useState, type ReactElement, type ReactNode } from 'react';
9
-
10
- import { SessionSkin, ToolStatus } from '../lib/enums';
11
- import { toolStatusColor } from '../lib/status-dot';
12
-
13
- export interface ToolCall {
14
- /** Tool label (e.g. "Read", "Shell"). */
15
- readonly label: string;
16
- /** Optional host-supplied tool icon. */
17
- readonly icon?: ReactNode;
18
- /** Primary argument shown in mono after the label. */
19
- readonly arg?: string;
20
- readonly status: ToolStatus;
21
- /** Expandable raw detail; chip is only clickable when present. */
22
- readonly detail?: string;
23
- /** Repeat count badge (e.g. ×3) when the same call ran multiple times. */
24
- readonly count?: number;
25
- }
26
-
27
- /** Host-supplied icons used by the collapsed-summary and per-chip UI. */
28
- export interface ToolStripIcons {
29
- /** Leading glyph on the collapsed summary (e.g. a zap). */
30
- readonly summary?: ReactNode;
31
- /** Chevron on the collapsed summary. */
32
- readonly chevron?: ReactNode;
33
- /** Done stat icon. */
34
- readonly done?: ReactNode;
35
- /** Pending stat icon (rendered spinning via `xk-spin`). */
36
- readonly pending?: ReactNode;
37
- /** Error stat icon. */
38
- readonly error?: ReactNode;
39
- /** Per-chip pending spinner. */
40
- readonly chipSpinner?: ReactNode;
41
- }
42
-
43
- export interface ToolStripProps {
44
- readonly tools: ReadonlyArray<ToolCall>;
45
- readonly skin?: SessionSkin;
46
- readonly icons?: ToolStripIcons;
47
- /** Collapse threshold; above this the strip starts collapsed. */
48
- readonly collapseAbove?: number;
49
- }
50
-
51
- function Stat({
52
- icon,
53
- n,
54
- color,
55
- spin,
56
- }: {
57
- readonly icon: ReactNode;
58
- readonly n: number;
59
- readonly color: string;
60
- readonly spin?: boolean;
61
- }): ReactElement {
62
- return (
63
- <span
64
- className="mono"
65
- style={{
66
- display: 'inline-flex',
67
- alignItems: 'center',
68
- gap: 3,
69
- fontSize: 11,
70
- color,
71
- }}
72
- >
73
- <span className={spin ? 'xk-spin' : ''} style={{ display: 'inline-flex' }}>
74
- {icon}
75
- </span>
76
- {n}
77
- </span>
78
- );
79
- }
80
-
81
- export function ToolChip({
82
- tool,
83
- skin = SessionSkin.Minimal,
84
- spinnerIcon,
85
- }: {
86
- readonly tool: ToolCall;
87
- readonly skin?: SessionSkin;
88
- readonly spinnerIcon?: ReactNode;
89
- }): ReactElement {
90
- const [expanded, setExpanded] = useState(false);
91
- const dotColor = toolStatusColor(tool.status);
92
- const tint = skin === SessionSkin.Functional;
93
- const isError = tool.status === ToolStatus.Error;
94
- return (
95
- <div style={{ display: 'inline-flex', flexDirection: 'column' }}>
96
- <button
97
- type="button"
98
- onClick={() => tool.detail && setExpanded((v) => !v)}
99
- style={{
100
- display: 'inline-flex',
101
- alignItems: 'center',
102
- gap: 7,
103
- padding: '5px 10px',
104
- borderRadius: 8,
105
- border: `1px solid ${tint && isError ? 'hsl(var(--destructive, var(--danger)) / 0.3)' : 'hsl(var(--rule))'}`,
106
- background:
107
- tint && isError
108
- ? 'hsl(var(--destructive, var(--danger)) / 0.05)'
109
- : 'hsl(var(--paper-elev))',
110
- cursor: tool.detail ? 'pointer' : 'default',
111
- maxWidth: 320,
112
- }}
113
- >
114
- <span
115
- style={{
116
- width: 6,
117
- height: 6,
118
- borderRadius: '50%',
119
- background: dotColor,
120
- flexShrink: 0,
121
- }}
122
- />
123
- {tool.icon && (
124
- <span style={{ display: 'inline-flex', color: 'hsl(var(--ink-3))' }}>
125
- {tool.icon}
126
- </span>
127
- )}
128
- <span style={{ fontSize: 12.5, fontWeight: 500, color: 'hsl(var(--ink-2))' }}>
129
- {tool.label}
130
- </span>
131
- {tool.arg && (
132
- <span
133
- className="mono"
134
- style={{
135
- fontSize: 11,
136
- color: 'hsl(var(--ink-3))',
137
- overflow: 'hidden',
138
- textOverflow: 'ellipsis',
139
- whiteSpace: 'nowrap',
140
- maxWidth: 180,
141
- }}
142
- >
143
- {tool.arg}
144
- </span>
145
- )}
146
- {tool.status === ToolStatus.Pending && spinnerIcon && (
147
- <span className="xk-spin" style={{ display: 'inline-flex', color: 'hsl(var(--warning))' }}>
148
- {spinnerIcon}
149
- </span>
150
- )}
151
- {tool.count !== undefined && tool.count > 1 && (
152
- <span
153
- className="mono"
154
- style={{
155
- fontSize: 10,
156
- color: 'hsl(var(--ink-3))',
157
- padding: '0 5px',
158
- background: 'hsl(var(--muted))',
159
- borderRadius: 6,
160
- }}
161
- >
162
- ×{tool.count}
163
- </span>
164
- )}
165
- </button>
166
- {expanded && tool.detail && (
167
- <pre
168
- className="mono"
169
- style={{
170
- margin: '5px 0 0',
171
- padding: '9px 11px',
172
- background: 'hsl(var(--paper-sunk))',
173
- border: '1px solid hsl(var(--rule))',
174
- borderRadius: 8,
175
- fontSize: 11,
176
- lineHeight: 1.55,
177
- color: 'hsl(var(--ink-2))',
178
- maxWidth: 460,
179
- overflowX: 'auto',
180
- whiteSpace: 'pre-wrap',
181
- }}
182
- >
183
- {tool.detail}
184
- </pre>
185
- )}
186
- </div>
187
- );
188
- }
189
-
190
- export function ToolStrip({
191
- tools,
192
- skin = SessionSkin.Minimal,
193
- icons,
194
- collapseAbove = 4,
195
- }: ToolStripProps): ReactElement {
196
- const [open, setOpen] = useState(false);
197
- const many = tools.length > collapseAbove;
198
- const done = tools.filter((t) => t.status === ToolStatus.Done).length;
199
- const error = tools.filter((t) => t.status === ToolStatus.Error).length;
200
- const pending = tools.filter((t) => t.status === ToolStatus.Pending).length;
201
-
202
- if (!many || open) {
203
- return (
204
- <div style={{ display: 'flex', flexWrap: 'wrap', gap: 6, marginTop: 9 }}>
205
- {many && (
206
- <button
207
- type="button"
208
- onClick={() => setOpen(false)}
209
- style={{
210
- fontSize: 11,
211
- color: 'hsl(var(--ink-3))',
212
- padding: '4px 8px',
213
- borderRadius: 7,
214
- border: '1px solid hsl(var(--rule))',
215
- background: 'hsl(var(--paper-elev))',
216
- }}
217
- >
218
- ‹ collapse
219
- </button>
220
- )}
221
- {tools.map((tool, index) => (
222
- <ToolChip
223
- key={index}
224
- tool={tool}
225
- skin={skin}
226
- spinnerIcon={icons?.chipSpinner}
227
- />
228
- ))}
229
- </div>
230
- );
231
- }
232
-
233
- return (
234
- <button
235
- type="button"
236
- onClick={() => setOpen(true)}
237
- style={{
238
- marginTop: 9,
239
- display: 'flex',
240
- alignItems: 'center',
241
- gap: 9,
242
- width: '100%',
243
- padding: '7px 11px',
244
- borderRadius: 9,
245
- border: '1px solid hsl(var(--rule))',
246
- background:
247
- skin === SessionSkin.Functional
248
- ? 'hsl(var(--muted))'
249
- : 'hsl(var(--paper-elev))',
250
- textAlign: 'left',
251
- }}
252
- >
253
- {icons?.summary && (
254
- <span style={{ display: 'inline-flex', color: 'hsl(var(--primary))' }}>
255
- {icons.summary}
256
- </span>
257
- )}
258
- <span style={{ fontSize: 12.5, fontWeight: 500, color: 'hsl(var(--ink-2))' }}>
259
- {tools.length} tool calls
260
- </span>
261
- <span style={{ flex: 1 }} />
262
- {done > 0 && icons?.done && (
263
- <Stat icon={icons.done} n={done} color={toolStatusColor(ToolStatus.Done)} />
264
- )}
265
- {pending > 0 && icons?.pending && (
266
- <Stat icon={icons.pending} n={pending} color={toolStatusColor(ToolStatus.Pending)} spin />
267
- )}
268
- {error > 0 && icons?.error && (
269
- <Stat icon={icons.error} n={error} color={toolStatusColor(ToolStatus.Error)} />
270
- )}
271
- {icons?.chevron && (
272
- <span style={{ display: 'inline-flex', color: 'hsl(var(--ink-4))' }}>
273
- {icons.chevron}
274
- </span>
275
- )}
276
- </button>
277
- );
278
- }
@@ -1,24 +0,0 @@
1
- /**
2
- * Three bouncing dots — the agent "typing"/streaming indicator.
3
- * Animation = the namespaced `xk-dot-bounce` keyframe (host stylesheet).
4
- */
5
- import type { ReactElement } from 'react';
6
-
7
- export function TypingDots(): ReactElement {
8
- return (
9
- <span style={{ display: 'inline-flex', gap: 3, alignItems: 'center' }}>
10
- {[0, 1, 2].map((i) => (
11
- <span
12
- key={i}
13
- style={{
14
- width: 5,
15
- height: 5,
16
- borderRadius: '50%',
17
- background: 'hsl(var(--primary))',
18
- animation: `xk-dot-bounce 1.1s ${i * 0.15}s infinite`,
19
- }}
20
- />
21
- ))}
22
- </span>
23
- );
24
- }
@@ -1,44 +0,0 @@
1
- /**
2
- * `@xemahq/ui-kernel/session-kit` — the thin, prop-driven generic
3
- * component substrate for agent-session surfaces and the Portals
4
- * chrome.
5
- *
6
- * Everything here is presentational and icon-agnostic: components take
7
- * data + host-supplied icon nodes and emit inline-styled markup against
8
- * the CSS-variable design tokens. No data fetching, no registry
9
- * subscriptions, no framework imports — so the same kit renders inside
10
- * the host shell and inside a biome's own surfaces.
11
- *
12
- * Host shells consume these via `import { … } from '@xemahq/ui-kernel/session-kit'`.
13
- */
14
-
15
- // Closed-set enums + the authoritative status-dot map.
16
- export * from './lib/enums';
17
- export * from './lib/status-dot';
18
- export * from './lib/portal-accent';
19
-
20
- // Shared display primitives.
21
- export * from './primitives/RiskPill';
22
- export * from './primitives/ScopeDot';
23
- export * from './primitives/PortalGlyph';
24
- export * from './primitives/Avatar';
25
- export * from './primitives/Segmented';
26
-
27
- // Session display components.
28
- export * from './display/MD';
29
- export * from './display/TypingDots';
30
- export * from './display/TokenMeter';
31
- export * from './display/ContextHeader';
32
- export * from './display/MessageTurn';
33
- export * from './display/ToolStrip';
34
- export * from './display/ThinkingPanel';
35
- export * from './display/FileDiffCard';
36
- export * from './display/TodoChecklist';
37
-
38
- // Generic searchable picker.
39
- export * from './combobox/Combobox';
40
- export * from './combobox/use-click-outside';
41
-
42
- // Approvals primitive — generic frame + scoped bodies + sticky
43
- // bar + cross-portal Approvals Center).
44
- export * from './approvals';
@@ -1,66 +0,0 @@
1
- /**
2
- * Closed-set enums for the session-kit. Every variant a component
3
- * branches on is a real enum value (no free-form string literals), so
4
- * the kit stays type-safe and the colour/icon maps below can be
5
- * exhaustive.
6
- *
7
- * Risk tier is NOT redefined here — it is owned by the kernel
8
- * (`CapabilityRiskTier`, low/medium/high/critical) and re-exported from
9
- * `../primitives/RiskPill` so consumers import one canonical enum.
10
- */
11
-
12
- /** Running status of a single tool call in the transcript. */
13
- export enum ToolStatus {
14
- Pending = 'pending',
15
- Done = 'done',
16
- Error = 'error',
17
- }
18
-
19
- /**
20
- * The four authoritative transcript status-dot states.
21
- * `Narration` is the hollow dot used by a `say` event — it is not a
22
- * tool, so it sits outside `ToolStatus`.
23
- */
24
- export enum SessionDotState {
25
- Pending = 'pending',
26
- Done = 'done',
27
- Error = 'error',
28
- Narration = 'narration',
29
- }
30
-
31
- /** Visual treatment of a status dot. */
32
- export enum SessionDotKind {
33
- /** Solid fill in the token colour. */
34
- Solid = 'solid',
35
- /** Hollow ring (paper fill + rule border) — narration. */
36
- Hollow = 'hollow',
37
- }
38
-
39
- /** A todo/plan checklist item's state. */
40
- export enum TodoState {
41
- Todo = 'todo',
42
- Active = 'active',
43
- Done = 'done',
44
- }
45
-
46
- /** Biome provenance scope (drives the ScopeDot colour). */
47
- export enum BiomeScope {
48
- System = 'system',
49
- Platform = 'platform',
50
- Community = 'community',
51
- }
52
-
53
- /**
54
- * Look-and-feel variant. The kit defaults to `Minimal` (the thin/clean
55
- * look the design converged on); `Functional` adds tinted surfaces.
56
- */
57
- export enum SessionSkin {
58
- Minimal = 'minimal',
59
- Functional = 'functional',
60
- }
61
-
62
- /** A message turn's author role. */
63
- export enum TurnRole {
64
- User = 'user',
65
- Agent = 'agent',
66
- }
@@ -1,30 +0,0 @@
1
- /**
2
- * Per-portal accent token helper. A portal stores its accent as a CSS
3
- * custom-property reference (`var(--p-finance)`, …); these helpers turn
4
- * that into a concrete `hsl(...)` expression, with the brand `--primary`
5
- * as the no-portal fallback.
6
- *
7
- * The token VALUES live in the host stylesheet (`--p-finance`, …). This
8
- * module only composes the colour expression — it never hard-codes a
9
- * hue, so re-skinning happens entirely in CSS.
10
- */
11
-
12
- /** A portal's CSS accent variable, e.g. `var(--p-finance)`. */
13
- export type PortalAccentVar = `var(--${string})`;
14
-
15
- const PRIMARY = '--primary';
16
-
17
- /**
18
- * Resolve a portal accent to an `hsl(...)` expression.
19
- *
20
- * @param accentVar the portal's `var(--p-*)` reference, or undefined for
21
- * "no active portal" (falls back to the brand `--primary`).
22
- * @param alpha optional 0–1 alpha applied via the HSL `/ a` syntax.
23
- */
24
- export function portalAccent(
25
- accentVar: PortalAccentVar | undefined,
26
- alpha?: number,
27
- ): string {
28
- const inner = accentVar ?? `var(${PRIMARY})`;
29
- return alpha !== undefined ? `hsl(${inner} / ${alpha})` : `hsl(${inner})`;
30
- }
@@ -1,68 +0,0 @@
1
- /**
2
- * Authoritative transcript status-dot colour map.
3
- *
4
- * pending / running → amber, PULSING (--warning)
5
- * done / success → green (--success)
6
- * error → red (--danger / --destructive)
7
- * narration (`say`) → hollow ring (--paper-elev fill + --rule-2 border)
8
- *
9
- * Encoded once here so every surface (rail dot, tool chip, tool-strip
10
- * summary stat) reads from a single typed source instead of scattering
11
- * the colour choices across components.
12
- *
13
- * Note on the danger token: host-web names it `--destructive`; the
14
- * design names it `--danger`. We emit `--destructive` and fall back to
15
- * `--danger` so the kit renders correctly under either token set.
16
- */
17
- import { SessionDotKind, SessionDotState, ToolStatus } from './enums';
18
-
19
- export interface SessionDotStyle {
20
- /** CSS colour expression for a solid dot. */
21
- readonly color: string;
22
- /** Solid vs hollow. */
23
- readonly kind: SessionDotKind;
24
- /** Whether the dot animates with the `xk-pulse-soft` keyframe. */
25
- readonly pulsing: boolean;
26
- }
27
-
28
- const DANGER = 'hsl(var(--destructive, var(--danger)))';
29
-
30
- export const SESSION_DOT_STYLE: Record<SessionDotState, SessionDotStyle> = {
31
- [SessionDotState.Pending]: {
32
- color: 'hsl(var(--warning))',
33
- kind: SessionDotKind.Solid,
34
- pulsing: true,
35
- },
36
- [SessionDotState.Done]: {
37
- color: 'hsl(var(--success))',
38
- kind: SessionDotKind.Solid,
39
- pulsing: false,
40
- },
41
- [SessionDotState.Error]: {
42
- color: DANGER,
43
- kind: SessionDotKind.Solid,
44
- pulsing: false,
45
- },
46
- [SessionDotState.Narration]: {
47
- color: 'hsl(var(--paper-elev))',
48
- kind: SessionDotKind.Hollow,
49
- pulsing: false,
50
- },
51
- };
52
-
53
- /** Map a tool's running status onto its dot state. */
54
- export function dotStateForTool(status: ToolStatus): SessionDotState {
55
- switch (status) {
56
- case ToolStatus.Pending:
57
- return SessionDotState.Pending;
58
- case ToolStatus.Done:
59
- return SessionDotState.Done;
60
- case ToolStatus.Error:
61
- return SessionDotState.Error;
62
- }
63
- }
64
-
65
- /** Resolve the solid colour for a tool status (chips, summary stats). */
66
- export function toolStatusColor(status: ToolStatus): string {
67
- return SESSION_DOT_STYLE[dotStateForTool(status)].color;
68
- }
@@ -1,44 +0,0 @@
1
- /**
2
- * Circular initials avatar. Mono initials on a soft accent fill.
3
- */
4
- import type { CSSProperties, ReactElement } from 'react';
5
-
6
- export interface AvatarProps {
7
- readonly initials: string;
8
- readonly size?: number;
9
- /** Background fill. Defaults to the soft accent tint. */
10
- readonly color?: string;
11
- /** Initials colour. Defaults to the accent ink. */
12
- readonly ink?: string;
13
- readonly style?: CSSProperties;
14
- }
15
-
16
- export function Avatar({
17
- initials,
18
- size = 26,
19
- color = 'hsl(var(--accent-2, var(--accent-tint)))',
20
- ink = 'hsl(var(--primary-ink, var(--accent-ink)))',
21
- style,
22
- }: AvatarProps): ReactElement {
23
- return (
24
- <span
25
- className="mono"
26
- style={{
27
- width: size,
28
- height: size,
29
- borderRadius: '50%',
30
- flexShrink: 0,
31
- display: 'grid',
32
- placeItems: 'center',
33
- background: color,
34
- color: ink,
35
- fontSize: size * 0.4,
36
- fontWeight: 600,
37
- letterSpacing: '-0.02em',
38
- ...style,
39
- }}
40
- >
41
- {initials}
42
- </span>
43
- );
44
- }
@@ -1,51 +0,0 @@
1
- /**
2
- * Portal glyph — a rounded-square badge tinted with the portal's accent
3
- * token. The glyph icon itself is supplied by the host as a `ReactNode`
4
- * (the kit carries no icon set), matching the icon-agnostic convention
5
- * used elsewhere in ui-kernel.
6
- */
7
- import { portalAccent, type PortalAccentVar } from '../lib/portal-accent';
8
-
9
- import type { CSSProperties, ReactElement, ReactNode } from 'react';
10
-
11
-
12
- export interface PortalGlyphProps {
13
- /** The portal's accent token, e.g. `var(--p-finance)`. Omit for the brand accent. */
14
- readonly accentVar?: PortalAccentVar;
15
- /** The portal's glyph (host-supplied icon node). */
16
- readonly icon: ReactNode;
17
- readonly size?: number;
18
- readonly radius?: number;
19
- /** Emphasised border + ring when the portal is the active one. */
20
- readonly active?: boolean;
21
- readonly style?: CSSProperties;
22
- }
23
-
24
- export function PortalGlyph({
25
- accentVar,
26
- icon,
27
- size = 34,
28
- radius = 9,
29
- active = false,
30
- style,
31
- }: PortalGlyphProps): ReactElement {
32
- return (
33
- <span
34
- style={{
35
- width: size,
36
- height: size,
37
- borderRadius: radius,
38
- flexShrink: 0,
39
- display: 'grid',
40
- placeItems: 'center',
41
- background: portalAccent(accentVar, 0.13),
42
- color: portalAccent(accentVar),
43
- border: `1px solid ${portalAccent(accentVar, active ? 0.5 : 0.22)}`,
44
- boxShadow: active ? `0 0 0 1px ${portalAccent(accentVar, 0.25)}` : 'none',
45
- ...style,
46
- }}
47
- >
48
- {icon}
49
- </span>
50
- );
51
- }