@xemahq/ui-kernel 0.11.1 → 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 (234) hide show
  1. package/package.json +1 -2
  2. package/src/index.ts +0 -17
  3. package/src/lib/biome-host/agent-validation.ts +0 -239
  4. package/src/lib/biome-host/biome-builders.ts +0 -112
  5. package/src/lib/biome-host/biome-mode.ts +0 -6
  6. package/src/lib/biome-host/biome-navigation.ts +0 -37
  7. package/src/lib/biome-host/biome-registry.ts +0 -299
  8. package/src/lib/biome-host/biome-scope-hooks.ts +0 -41
  9. package/src/lib/biome-host/biome-scope.tsx +0 -52
  10. package/src/lib/biome-host/biome-scoped-query.ts +0 -134
  11. package/src/lib/biome-host/create-biome-orval-config.ts +0 -82
  12. package/src/lib/biome-host/define-web-biome.spec.ts +0 -221
  13. package/src/lib/biome-host/define-web-biome.ts +0 -222
  14. package/src/lib/biome-host/errors.ts +0 -220
  15. package/src/lib/biome-host/frontend-biome.ts +0 -256
  16. package/src/lib/biome-host/host-bridge.ts +0 -281
  17. package/src/lib/biome-host/host-sources.ts +0 -54
  18. package/src/lib/biome-host/i18n-hooks.ts +0 -51
  19. package/src/lib/biome-host/i18n-port.test.ts +0 -50
  20. package/src/lib/biome-host/i18n-port.ts +0 -96
  21. package/src/lib/biome-host/index.ts +0 -35
  22. package/src/lib/biome-host/realtime-hooks.ts +0 -75
  23. package/src/lib/biome-host/realtime-port.ts +0 -115
  24. package/src/lib/biome-host/session-contributions.ts +0 -296
  25. package/src/lib/biome-host/use-mutation-with-error-toast.ts +0 -90
  26. package/src/lib/biome-host/use-page-state.ts +0 -248
  27. package/src/lib/capabilities/capability-context.ts +0 -25
  28. package/src/lib/capabilities/capability-provider.tsx +0 -73
  29. package/src/lib/capabilities/index.ts +0 -17
  30. package/src/lib/capabilities/types.ts +0 -69
  31. package/src/lib/capabilities/use-capability.ts +0 -79
  32. package/src/lib/contribution-registry/contribution-registry.spec.ts +0 -141
  33. package/src/lib/contribution-registry/contribution-registry.ts +0 -204
  34. package/src/lib/contribution-registry/index.ts +0 -9
  35. package/src/lib/contribution-registry/renderable-registry.ts +0 -142
  36. package/src/lib/system-bus/capability-invoke.ts +0 -92
  37. package/src/lib/system-bus/deeplink.ts +0 -210
  38. package/src/lib/system-bus/enums.ts +0 -86
  39. package/src/lib/system-bus/host-ports.ts +0 -93
  40. package/src/lib/system-bus/index.ts +0 -16
  41. package/src/lib/system-bus/intent-registry.ts +0 -109
  42. package/src/lib/system-bus/intents.ts +0 -113
  43. package/src/lib/system-bus/palette.ts +0 -78
  44. package/src/lib/system-bus/system-bus-builder.ts +0 -159
  45. package/src/lib/system-bus/system-bus.ts +0 -37
  46. package/src/lib/system-bus/windows.ts +0 -51
  47. package/src/offline/id.ts +0 -16
  48. package/src/offline/index.ts +0 -54
  49. package/src/offline/mutation.ts +0 -75
  50. package/src/offline/offline-status-badge.tsx +0 -51
  51. package/src/offline/online-controller.ts +0 -105
  52. package/src/offline/outbox.test.ts +0 -172
  53. package/src/offline/outbox.ts +0 -348
  54. package/src/offline/react-hooks.ts +0 -40
  55. package/src/offline/react.tsx +0 -32
  56. package/src/offline/storage.ts +0 -112
  57. package/src/offline/types.ts +0 -77
  58. package/src/org-db/components/DbResultTable.tsx +0 -176
  59. package/src/org-db/index.ts +0 -1
  60. package/src/pdf/index.ts +0 -11
  61. package/src/registry/index.ts +0 -9
  62. package/src/registry/lib/agent-validation-host.ts +0 -36
  63. package/src/registry/lib/biome-slot.tsx +0 -50
  64. package/src/registry/lib/biomes-enabled-context.ts +0 -20
  65. package/src/registry/lib/extension-points.ts +0 -134
  66. package/src/registry/lib/primitives/SessionEventCard.tsx +0 -164
  67. package/src/registry/lib/primitives/SessionEventTimeline.tsx +0 -95
  68. package/src/registry/lib/primitives/SessionMutationBar.tsx +0 -76
  69. package/src/registry/lib/primitives/SessionTabbedDrawer.tsx +0 -165
  70. package/src/registry/lib/primitives/index.ts +0 -18
  71. package/src/registry/lib/session-context-builder.ts +0 -84
  72. package/src/registry/lib/session-context-provider.tsx +0 -33
  73. package/src/registry/lib/session-context.ts +0 -21
  74. package/src/registry/lib/session-selectors.ts +0 -272
  75. package/src/session/comments/CommentRail.tsx +0 -164
  76. package/src/session/index.ts +0 -3
  77. package/src/session/lib/cn.ts +0 -11
  78. package/src/session/shell/SessionWorkspaceShell.tsx +0 -147
  79. package/src/session-kit/approvals/ApprovalButton.tsx +0 -89
  80. package/src/session-kit/approvals/ApprovalCard.tsx +0 -341
  81. package/src/session-kit/approvals/ApprovalsCenter.tsx +0 -336
  82. package/src/session-kit/approvals/CapabilityApprovalStickyBar.tsx +0 -118
  83. package/src/session-kit/approvals/Obligation.tsx +0 -111
  84. package/src/session-kit/approvals/ScopedBody.tsx +0 -392
  85. package/src/session-kit/approvals/approval-icons.ts +0 -31
  86. package/src/session-kit/approvals/approval-model.ts +0 -204
  87. package/src/session-kit/approvals/index.ts +0 -22
  88. package/src/session-kit/approvals/obligation-display.ts +0 -100
  89. package/src/session-kit/approvals/risk-accent.ts +0 -47
  90. package/src/session-kit/approvals/scope-icons.ts +0 -19
  91. package/src/session-kit/combobox/Combobox.tsx +0 -358
  92. package/src/session-kit/combobox/use-click-outside.ts +0 -21
  93. package/src/session-kit/display/ContextHeader.tsx +0 -148
  94. package/src/session-kit/display/FileDiffCard.tsx +0 -140
  95. package/src/session-kit/display/MD.tsx +0 -162
  96. package/src/session-kit/display/MessageTurn.tsx +0 -157
  97. package/src/session-kit/display/ThinkingPanel.tsx +0 -81
  98. package/src/session-kit/display/TodoChecklist.tsx +0 -120
  99. package/src/session-kit/display/TokenMeter.tsx +0 -89
  100. package/src/session-kit/display/ToolStrip.tsx +0 -278
  101. package/src/session-kit/display/TypingDots.tsx +0 -24
  102. package/src/session-kit/index.ts +0 -44
  103. package/src/session-kit/lib/enums.ts +0 -66
  104. package/src/session-kit/lib/portal-accent.ts +0 -30
  105. package/src/session-kit/lib/status-dot.ts +0 -68
  106. package/src/session-kit/primitives/Avatar.tsx +0 -44
  107. package/src/session-kit/primitives/PortalGlyph.tsx +0 -51
  108. package/src/session-kit/primitives/RiskPill.tsx +0 -95
  109. package/src/session-kit/primitives/ScopeDot.tsx +0 -47
  110. package/src/session-kit/primitives/Segmented.tsx +0 -71
  111. package/src/ui/branding/app-branding-context.ts +0 -20
  112. package/src/ui/branding/app-branding-provider.tsx +0 -123
  113. package/src/ui/branding/sanitize.ts +0 -89
  114. package/src/ui/breakpoints.ts +0 -14
  115. package/src/ui/capture/document-preview.tsx +0 -166
  116. package/src/ui/capture/field-spec-to-zod.test.ts +0 -81
  117. package/src/ui/capture/field-spec-to-zod.ts +0 -174
  118. package/src/ui/capture/field-spec-validate.ts +0 -236
  119. package/src/ui/capture/field-spec.test.ts +0 -49
  120. package/src/ui/capture/field-spec.ts +0 -274
  121. package/src/ui/capture/index.ts +0 -51
  122. package/src/ui/capture/schema-field-input.tsx +0 -620
  123. package/src/ui/capture/schema-form.tsx +0 -149
  124. package/src/ui/capture/submit-values.test.ts +0 -70
  125. package/src/ui/capture/submit-values.ts +0 -63
  126. package/src/ui/capture/use-prefill.ts +0 -186
  127. package/src/ui/capture/use-schema-validation.ts +0 -145
  128. package/src/ui/capture/use-wizard.ts +0 -180
  129. package/src/ui/capture/value-format.ts +0 -32
  130. package/src/ui/capture/wizard.tsx +0 -105
  131. package/src/ui/charts/bar-chart.tsx +0 -139
  132. package/src/ui/charts/chart-frame.tsx +0 -125
  133. package/src/ui/charts/chart-types.ts +0 -52
  134. package/src/ui/charts/chart-utils.ts +0 -190
  135. package/src/ui/charts/charts.test.tsx +0 -204
  136. package/src/ui/charts/donut-chart.tsx +0 -129
  137. package/src/ui/charts/index.ts +0 -27
  138. package/src/ui/charts/line-chart.tsx +0 -202
  139. package/src/ui/charts/sparkline.tsx +0 -109
  140. package/src/ui/chrome/AsyncBoundary.tsx +0 -74
  141. package/src/ui/chrome/EmptyState.tsx +0 -257
  142. package/src/ui/chrome/ErrorCard.tsx +0 -63
  143. package/src/ui/chrome/LoadingState.tsx +0 -61
  144. package/src/ui/chrome/PageHeader.tsx +0 -137
  145. package/src/ui/chrome/RecordCardList.tsx +0 -98
  146. package/src/ui/chrome/StateCard.tsx +0 -150
  147. package/src/ui/chrome/confirm-delete-dialog.tsx +0 -59
  148. package/src/ui/chrome/page-shell.spec.tsx +0 -117
  149. package/src/ui/chrome/page-shell.tsx +0 -221
  150. package/src/ui/chrome/scope-badge.tsx +0 -40
  151. package/src/ui/chrome/status-badge.tsx +0 -79
  152. package/src/ui/cn.ts +0 -32
  153. package/src/ui/design-tokens.ts +0 -372
  154. package/src/ui/hooks/use-debounced-value.ts +0 -16
  155. package/src/ui/hooks/use-is-mobile.ts +0 -28
  156. package/src/ui/index.ts +0 -110
  157. package/src/ui/pdf/pdf-preview.tsx +0 -122
  158. package/src/ui/primitives/alert-dialog.tsx +0 -104
  159. package/src/ui/primitives/async-combobox.tsx +0 -182
  160. package/src/ui/primitives/badge-variants.ts +0 -21
  161. package/src/ui/primitives/badge.tsx +0 -25
  162. package/src/ui/primitives/button-variants.ts +0 -31
  163. package/src/ui/primitives/button.tsx +0 -29
  164. package/src/ui/primitives/card.tsx +0 -43
  165. package/src/ui/primitives/checkbox.tsx +0 -26
  166. package/src/ui/primitives/collapsible.tsx +0 -9
  167. package/src/ui/primitives/dialog.tsx +0 -103
  168. package/src/ui/primitives/dropdown-menu.tsx +0 -179
  169. package/src/ui/primitives/form-stepper.tsx +0 -94
  170. package/src/ui/primitives/form-stepper.types.ts +0 -15
  171. package/src/ui/primitives/input.tsx +0 -22
  172. package/src/ui/primitives/label.tsx +0 -17
  173. package/src/ui/primitives/overflow-tabs.tsx +0 -331
  174. package/src/ui/primitives/popover.tsx +0 -33
  175. package/src/ui/primitives/preview-device-frame.tsx +0 -213
  176. package/src/ui/primitives/radio-group.tsx +0 -36
  177. package/src/ui/primitives/resizable.tsx +0 -67
  178. package/src/ui/primitives/scroll-area.tsx +0 -38
  179. package/src/ui/primitives/select.tsx +0 -143
  180. package/src/ui/primitives/separator.tsx +0 -20
  181. package/src/ui/primitives/sheet.tsx +0 -107
  182. package/src/ui/primitives/skeleton.tsx +0 -99
  183. package/src/ui/primitives/switch.tsx +0 -27
  184. package/src/ui/primitives/table.tsx +0 -72
  185. package/src/ui/primitives/tabs.tsx +0 -53
  186. package/src/ui/primitives/tag-multi-select.tsx +0 -261
  187. package/src/ui/primitives/textarea.tsx +0 -21
  188. package/src/ui/primitives/tooltip.tsx +0 -30
  189. package/src/ui/primitives/url-preview-chrome.tsx +0 -103
  190. package/src/vista/GenericCatalogueSurface.tsx +0 -179
  191. package/src/vista/SurfaceFallbackCard.tsx +0 -109
  192. package/src/vista/VistaPanel.tsx +0 -163
  193. package/src/vista/form-payload.spec.ts +0 -139
  194. package/src/vista/html/CustomUiFrame.spec.tsx +0 -127
  195. package/src/vista/html/CustomUiFrame.tsx +0 -206
  196. package/src/vista/html/custom-ui-frame-bridge.spec.ts +0 -191
  197. package/src/vista/html/custom-ui-frame-bridge.ts +0 -98
  198. package/src/vista/html/custom-ui-frame-contract.ts +0 -88
  199. package/src/vista/html/custom-ui-intents.spec.ts +0 -135
  200. package/src/vista/html/custom-ui-intents.ts +0 -155
  201. package/src/vista/html/custom-ui-srcdoc.spec.ts +0 -151
  202. package/src/vista/html/custom-ui-srcdoc.ts +0 -193
  203. package/src/vista/html/index.ts +0 -13
  204. package/src/vista/index.ts +0 -52
  205. package/src/vista/surface-catalogue.spec.ts +0 -140
  206. package/src/vista/surface-catalogue.ts +0 -90
  207. package/src/vista/surface-icons.ts +0 -57
  208. package/src/vista/surface-registry.ts +0 -56
  209. package/src/vista/surfaces/ChartSurface.tsx +0 -34
  210. package/src/vista/surfaces/FilesSurface.tsx +0 -202
  211. package/src/vista/surfaces/FormSurface.tsx +0 -380
  212. package/src/vista/surfaces/HtmlSurface.tsx +0 -43
  213. package/src/vista/surfaces/TableSurface.tsx +0 -100
  214. package/src/vista/surfaces/UrlSurface.tsx +0 -40
  215. package/src/vista/surfaces/blob-surfaces.tsx +0 -139
  216. package/src/vista/surfaces/elicitation-transport.spec.ts +0 -369
  217. package/src/vista/surfaces/elicitation-transport.ts +0 -367
  218. package/src/vista/surfaces/file-surface-utils.ts +0 -69
  219. package/src/vista/surfaces/index.ts +0 -24
  220. package/src/vista/surfaces/register-surfaces.tsx +0 -139
  221. package/src/vista/surfaces/text-surfaces.tsx +0 -132
  222. package/src/vista/use-vista-tabs.ts +0 -196
  223. package/src/vista/vista-code-renderer-context.ts +0 -16
  224. package/src/vista/vista-code-renderer.tsx +0 -35
  225. package/src/vista/vista-file-context.ts +0 -14
  226. package/src/vista/vista-file-source.tsx +0 -141
  227. package/src/vista/vista-form-context.ts +0 -20
  228. package/src/vista/vista-form-host.tsx +0 -48
  229. package/src/vista/vista-model.ts +0 -137
  230. package/src/vista/vista-open-context.tsx +0 -27
  231. package/src/vista/vista-open-state.ts +0 -11
  232. package/src/vista/vista-payloads.ts +0 -635
  233. package/src/vista/vista-tabs-manifest.ts +0 -138
  234. package/src/vista/vista-tools.ts +0 -232
@@ -1,77 +0,0 @@
1
- // ═══════════════════════════════════════════════════════════════════════════
2
- // @xemahq/ui-kernel/offline — types
3
- //
4
- // A generic offline field-capture kit: an IndexedDB-backed outbox that queues
5
- // mutations while disconnected and drains them (with retry + idempotency) on
6
- // reconnect. Provider-agnostic — any mutation (an app-forge record submit, a
7
- // status change, …) is enqueued by a stable `kind` whose executor is registered
8
- // once. The motivating case is field/trade-fair capture with no signal.
9
- // ═══════════════════════════════════════════════════════════════════════════
10
-
11
- /** Lifecycle of a queued mutation. */
12
- export enum OutboxEntryStatus {
13
- /** Waiting to be sent (offline, or not yet attempted). */
14
- Pending = 'pending',
15
- /** Currently being sent. */
16
- Inflight = 'inflight',
17
- /** Failed transiently; will be retried (attempts < maxAttempts). */
18
- Retrying = 'retrying',
19
- /** Exhausted retries — needs manual retry or discard (dead-letter). */
20
- Failed = 'failed',
21
- }
22
-
23
- /** One queued mutation. `payload` is opaque to the outbox; the executor for
24
- * `kind` interprets it. */
25
- export interface OutboxEntry<TPayload = unknown> {
26
- /** Stable entry id (also the default idempotency key). */
27
- id: string;
28
- /** Registered executor key (e.g. "app-forge:create-record"). */
29
- kind: string;
30
- payload: TPayload;
31
- /** Sent to the backend so a redelivered mutation is not double-applied. */
32
- idempotencyKey: string;
33
- status: OutboxEntryStatus;
34
- attempts: number;
35
- createdAt: number;
36
- updatedAt: number;
37
- /** Last error message (for the dead-letter UI). */
38
- lastError?: string;
39
- /** Optional human label for the pending-items UI. */
40
- label?: string;
41
- }
42
-
43
- /** Persistence backend for the outbox. IndexedDB in the browser; in-memory for
44
- * SSR / tests. */
45
- export interface OutboxStorage {
46
- getAll(): Promise<OutboxEntry[]>;
47
- put(entry: OutboxEntry): Promise<void>;
48
- delete(id: string): Promise<void>;
49
- clear(): Promise<void>;
50
- }
51
-
52
- /** Context passed to an executor when a queued mutation is sent. */
53
- export interface OutboxExecuteContext {
54
- /** Pass to the backend (e.g. as an `Idempotency-Key` header). */
55
- idempotencyKey: string;
56
- /** How many times this entry has now been attempted (1-based). */
57
- attempt: number;
58
- entryId: string;
59
- }
60
-
61
- /** Sends one queued mutation. Throwing schedules a retry (see
62
- * {@link OutboxOptions.isRetriable}). */
63
- export type OutboxExecutor<TPayload = unknown> = (
64
- payload: TPayload,
65
- ctx: OutboxExecuteContext,
66
- ) => Promise<void>;
67
-
68
- /** Snapshot of outbox state for UI (offline badge, pending count, dead-letter). */
69
- export interface OutboxSnapshot {
70
- entries: OutboxEntry[];
71
- pendingCount: number;
72
- failedCount: number;
73
- /** True while a drain is in progress. */
74
- draining: boolean;
75
- /** Current connectivity (from the outbox's online controller). */
76
- online: boolean;
77
- }
@@ -1,176 +0,0 @@
1
- import { useMemo } from 'react';
2
-
3
- export interface DbResultTableProps {
4
- columns: Array<{ name: string; type?: string }>;
5
- rows: unknown[][];
6
- rowCount: number;
7
- truncated: boolean;
8
- durationMs?: number;
9
- statement?: string;
10
- }
11
-
12
- function toDisplayValue(value: unknown): string {
13
- if (value === null || value === undefined) {
14
- return '';
15
- }
16
- if (typeof value === 'string') {
17
- return value;
18
- }
19
- if (
20
- typeof value === 'number' ||
21
- typeof value === 'boolean' ||
22
- typeof value === 'bigint'
23
- ) {
24
- return String(value);
25
- }
26
- if (value instanceof Date) {
27
- return value.toISOString();
28
- }
29
- try {
30
- return JSON.stringify(value);
31
- } catch {
32
- return String(value);
33
- }
34
- }
35
-
36
- function escapeCsvValue(value: string): string {
37
- if (value.includes('"') || value.includes(',') || value.includes('\n')) {
38
- return `"${value.replace(/"/g, '""')}"`;
39
- }
40
- return value;
41
- }
42
-
43
- export function DbResultTable(props: DbResultTableProps) {
44
- const { columns, rows, rowCount, truncated, durationMs, statement } = props;
45
-
46
- const csvContent = useMemo(() => {
47
- const header = columns
48
- .map((column) => escapeCsvValue(column.name))
49
- .join(',');
50
- const dataLines = rows.map((row) =>
51
- row
52
- .map((cell) => {
53
- const printable =
54
- cell === null || cell === undefined ? '' : toDisplayValue(cell);
55
- return escapeCsvValue(printable);
56
- })
57
- .join(','),
58
- );
59
- return [header, ...dataLines].join('\n');
60
- }, [columns, rows]);
61
-
62
- const displayedCount = rows.length;
63
-
64
- const handleDownloadCsv = () => {
65
- const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' });
66
- const url = URL.createObjectURL(blob);
67
- const link = document.createElement('a');
68
- link.href = url;
69
- link.download = 'query-results.csv';
70
- document.body.appendChild(link);
71
- link.click();
72
- document.body.removeChild(link);
73
- URL.revokeObjectURL(url);
74
- };
75
-
76
- return (
77
- <section className="rounded-lg border border-border bg-card text-card-foreground">
78
- {statement ? (
79
- <details className="border-b border-border px-4 py-3">
80
- <summary className="cursor-pointer text-sm font-medium text-foreground">
81
- SQL statement
82
- </summary>
83
- <pre className="mt-3 overflow-x-auto rounded-md bg-muted p-3 text-xs leading-6 text-muted-foreground">
84
- <code>{statement}</code>
85
- </pre>
86
- </details>
87
- ) : null}
88
-
89
- {truncated ? (
90
- <div className="border-b border-amber-300/60 bg-amber-100/60 px-4 py-3 text-sm text-amber-900">
91
- Showing first {displayedCount} rows of {rowCount} total - download CSV
92
- for full results.
93
- </div>
94
- ) : null}
95
-
96
- <div className="flex items-center justify-between gap-3 border-b border-border px-4 py-3">
97
- <div className="text-sm text-muted-foreground">
98
- {rowCount === 0
99
- ? 'No rows returned'
100
- : `${displayedCount} row${displayedCount === 1 ? '' : 's'} shown`}
101
- </div>
102
- <button
103
- type="button"
104
- className="inline-flex items-center rounded-md border border-input bg-background px-3 py-1.5 text-xs font-medium text-foreground hover:bg-accent"
105
- onClick={handleDownloadCsv}
106
- >
107
- Download CSV
108
- </button>
109
- </div>
110
-
111
- {rowCount === 0 ? (
112
- <div className="px-4 py-8 text-center text-sm text-muted-foreground">
113
- No rows returned
114
- </div>
115
- ) : (
116
- <div className="overflow-x-auto">
117
- <table className="min-w-full border-collapse text-sm">
118
- <thead>
119
- <tr className="border-b border-border bg-muted/40">
120
- {columns.map((column) => (
121
- <th
122
- key={column.name}
123
- className="px-4 py-3 text-left font-medium text-foreground"
124
- >
125
- <div className="flex flex-wrap items-center gap-2">
126
- <span>{column.name}</span>
127
- {column.type ? (
128
- <span className="rounded-full border border-border bg-background px-2 py-0.5 text-[11px] font-normal uppercase tracking-wide text-muted-foreground">
129
- {column.type}
130
- </span>
131
- ) : null}
132
- </div>
133
- </th>
134
- ))}
135
- </tr>
136
- </thead>
137
- <tbody>
138
- {rows.map((row, rowIndex) => (
139
- <tr
140
- key={`row-${rowIndex}`}
141
- className="border-b border-border/70 align-top"
142
- >
143
- {columns.map((column, colIndex) => {
144
- const cell = row[colIndex];
145
- return (
146
- <td
147
- key={`${column.name}-${rowIndex}`}
148
- className="px-4 py-2 text-muted-foreground"
149
- >
150
- {cell === null || cell === undefined ? (
151
- <span className="italic text-muted-foreground">
152
- null
153
- </span>
154
- ) : (
155
- <span className="break-all text-foreground">
156
- {toDisplayValue(cell)}
157
- </span>
158
- )}
159
- </td>
160
- );
161
- })}
162
- </tr>
163
- ))}
164
- </tbody>
165
- </table>
166
- </div>
167
- )}
168
-
169
- {typeof durationMs === 'number' ? (
170
- <footer className="border-t border-border px-4 py-2 text-xs text-muted-foreground">
171
- Query ran in {Math.max(0, Math.round(durationMs))} ms
172
- </footer>
173
- ) : null}
174
- </section>
175
- );
176
- }
@@ -1 +0,0 @@
1
- export { DbResultTable, type DbResultTableProps } from './components/DbResultTable';
package/src/pdf/index.ts DELETED
@@ -1,11 +0,0 @@
1
- // ═══════════════════════════════════════════════════════════════════════════
2
- // @xemahq/ui-kernel/pdf — canvas-rendered PDF preview surface
3
- //
4
- // Split into a DEDICATED subpath (out of the `/ui` barrel) because it pulls in
5
- // `react-pdf` → `pdfjs-dist` (~1.9 MB). Keeping it here lets `@xemahq/ui-kernel/ui`
6
- // (and therefore `@xemahq/app-ui`'s AppShell) stay tree-shakeable: a consumer
7
- // that never renders a PDF never bundles pdf.js. Import from this subpath only
8
- // when you actually need the viewer.
9
- // ═══════════════════════════════════════════════════════════════════════════
10
-
11
- export { PdfPreview, type PdfPreviewProps } from '../ui/pdf/pdf-preview';
@@ -1,9 +0,0 @@
1
- export * from './lib/extension-points';
2
- export * from './lib/agent-validation-host';
3
- export * from './lib/biome-slot';
4
- export * from './lib/biomes-enabled-context';
5
- export * from './lib/session-selectors';
6
- export * from './lib/session-context-builder';
7
- export * from './lib/session-context';
8
- export * from './lib/session-context-provider';
9
- export * from './lib/primitives';
@@ -1,36 +0,0 @@
1
- /**
2
- * Host-slot-aware composition validation.
3
- *
4
- * The kernel's `validateBiomeComposition` is host-agnostic: it takes the
5
- * set of known slot ids as input. This thin wrapper binds it to the host
6
- * shell's actual slot catalog (`HostExtensionSlots`) so callers don't have
7
- * to assemble the set themselves. It is the function the host bootstrap
8
- * calls after every enabled biome has registered.
9
- */
10
-
11
- import { HostExtensionSlots } from './extension-points';
12
- import {
13
- type CompositionDiagnostic,
14
- type FrontendBiome,
15
- validateBiomeComposition,
16
- } from '../../index';
17
-
18
- /**
19
- * Every slot id the host shell renders a `<BiomeSlot>` for. A panel
20
- * targeting anything outside this set (and not a `<owner>/<name>`
21
- * biome-owned slot) is flagged as unknown.
22
- */
23
- const HOST_SLOT_IDS: ReadonlySet<string> = new Set(
24
- Object.values(HostExtensionSlots),
25
- );
26
-
27
- /**
28
- * Validate the merged composition of the given biomes against the host
29
- * slot catalog. Returns structured diagnostics; never throws, never logs
30
- * (the caller owns the fail-fast / surface policy).
31
- */
32
- export function validateHostBiomeComposition(
33
- biomes: readonly FrontendBiome[],
34
- ): readonly CompositionDiagnostic[] {
35
- return validateBiomeComposition(biomes, { knownSlots: HOST_SLOT_IDS });
36
- }
@@ -1,50 +0,0 @@
1
- import { Fragment, type ReactElement } from 'react';
2
-
3
- import { useBiomesEnabled } from './biomes-enabled-context';
4
- import { biomeRegistry, useBiomeRegistryRevision } from '../../index';
5
-
6
- export interface BiomeSlotProps {
7
- /** Slot name biomes target via `PanelContribution.slot`. */
8
- readonly name: string;
9
- /** Optional fallback rendered when no biome contributes to this slot. */
10
- readonly fallback?: ReactElement | null;
11
- }
12
-
13
- /**
14
- * Renders every biome-contributed panel registered for `name`, sorted
15
- * by `weight`. When no biome contributes, renders `fallback` (or null).
16
- *
17
- * Reactive: subscribes to the biome registry's revision counter via
18
- * `useBiomeRegistryRevision()`, so the slot re-renders automatically
19
- * when a biome registers or unregisters (i.e. when `bootstrapBiomes()`
20
- * finishes after the host shell has already painted, or when the admin
21
- * UI disables a biome at runtime).
22
- *
23
- * Master-disable: if the surrounding host wraps the tree in
24
- * `<BiomeHostProvider biomes="disabled">`, this slot short-circuits
25
- * to its fallback regardless of registry state.
26
- *
27
- * Bridge access: biome panels reach host services via `useHostBridge()`,
28
- * which reads from `HostBridgeContext`. The host shell mounts the
29
- * provider above the route tree once; `<BiomeSlot>` does not own the
30
- * provider so a host can place slots anywhere without nesting providers.
31
- */
32
- export function BiomeSlot(props: BiomeSlotProps): ReactElement | null {
33
- // Subscribe so this slot re-renders when biomes register/change.
34
- useBiomeRegistryRevision();
35
- const enabled = useBiomesEnabled();
36
- if (!enabled) {
37
- return props.fallback ?? null;
38
- }
39
- const panels = biomeRegistry.panelsForSlot(props.name);
40
- if (panels.length === 0) {
41
- return props.fallback ?? null;
42
- }
43
- return (
44
- <Fragment>
45
- {panels.map((panel) => (
46
- <Fragment key={panel.id}>{panel.render()}</Fragment>
47
- ))}
48
- </Fragment>
49
- );
50
- }
@@ -1,20 +0,0 @@
1
- import { createContext, useContext } from 'react';
2
-
3
- /**
4
- * React-side mirror of `biomeRegistry.isEnabled()`. Hosts that embed
5
- * `@xemahq/ui-kernel/registry` without participating in Xema's biome
6
- * ecosystem flip this to `false` via
7
- * `<BiomeHostProvider biomes="disabled">`. `BiomeSlot` and
8
- * `useBiomeRoutes` consult this context for cheap render-time
9
- * short-circuit; the singleton registry's `isEnabled()` flag covers the
10
- * imperative paths (`bootstrapBiomes`, `register`, `unregister`).
11
- *
12
- * Default is `true` — a host that mounts no provider gets the standard
13
- * biome-enabled surface. Embedding hosts opt out explicitly.
14
- */
15
- export const BiomesEnabledContext = createContext<boolean>(true);
16
- BiomesEnabledContext.displayName = 'BiomesEnabledContext';
17
-
18
- export function useBiomesEnabled(): boolean {
19
- return useContext(BiomesEnabledContext);
20
- }
@@ -1,134 +0,0 @@
1
- /**
2
- * Catalog of frontend extension points the host shell exposes to biomes.
3
- *
4
- * The host renders `<BiomeSlot name="…">` boundaries at the call sites
5
- * below; biomes register `panels` against the same slot id in their
6
- * `FrontendBiome` contribution, and the registry stitches the two
7
- * together at runtime. The host itself is biome-agnostic — it knows
8
- * nothing about which biome (if any) fills a given slot.
9
- *
10
- * Routes work the same way: biomes push `RouteContribution`s and the
11
- * host calls `useBiomeRoutes()` to mount them. Nav items merge into
12
- * `getNavSections()` likewise.
13
- *
14
- * ── Adding a new host extension point ────────────────────────────────
15
- * 1. Add a new entry to `HostExtensionSlots` below with a JSDoc that
16
- * describes WHERE the slot is rendered, WHAT biomes should put in
17
- * it, and any in-scope CONTEXT (e.g., "run-detail page — runId is
18
- * readable via the host bridge's location").
19
- * 2. Mount `<BiomeSlot name={HostExtensionSlots.X} />` in the host
20
- * page.
21
- * 3. Document the slot in the xema-docs repo (`content/biomes/04-frontend-extensions.md`).
22
- *
23
- * Removing a host slot is a breaking change — bump the kernel package
24
- * major version.
25
- *
26
- * ── Biome-owned extension points (cross-biome extension) ────────────
27
- * Biomes can ALSO expose their own slots so OTHER biomes can extend
28
- * THEM. The convention is to namespace biome-owned slot ids as
29
- * `<biome-id>/<slot-name>` (e.g., `software-dev/page-actions`)
30
- * and to publish the typed catalog from the biome's own package
31
- * alongside its `FrontendBiomeFactory`. Other biomes import the
32
- * exported constants directly. Result: the host doesn't see biome
33
- * internals, biomes don't import each other's source — they meet at
34
- * the slot-id strings, which are typed by the publishing biome.
35
- *
36
- * Slot-name collisions are caught at runtime by the registry's
37
- * fail-fast duplicate-key guard, so two biomes can't shadow each
38
- * other accidentally.
39
- */
40
- export const HostExtensionSlots = {
41
- // ── Org-level shell ────────────────────────────────────────────────
42
- /**
43
- * Top-bar actions to the right of the org switcher. Visible on every
44
- * authenticated page. Use for org-wide quick actions or status
45
- * indicators (e.g., catalog instance health, Slack-notifier badge).
46
- */
47
- OrgHeaderActions: 'org-header-actions',
48
-
49
- /**
50
- * Cards on the public Biomes-overview page. Use for biome authors
51
- * to advertise capabilities outside the authenticated app shell.
52
- * (Reserved — host wiring may land later; safe to register today.)
53
- */
54
- BiomesOverviewCards: 'biomes-overview-cards',
55
-
56
- // ── Project home ───────────────────────────────────────────────────
57
- /**
58
- * Cards on the project home dashboard, between the SetupChecklist
59
- * and the ActivityTimeline. Use for biome-shipped status cards or
60
- * quick-launch tiles. `bridge.auth.getProjectId()` is in scope.
61
- */
62
- ProjectOverviewCards: 'project-overview-cards',
63
-
64
- /**
65
- * Secondary cards on the project home, rendered below the activity
66
- * timeline. Use for less prominent biome surfaces (recent runs,
67
- * insights, recommendations).
68
- */
69
- ProjectOverviewSecondary: 'project-overview-secondary',
70
-
71
- /**
72
- * CTAs rendered into the dashboard's empty-state row when the project
73
- * has no recent activity. Biomes can suggest "first run" actions.
74
- */
75
- DashboardEmptyState: 'dashboard-empty-state',
76
-
77
- // ── Run detail ─────────────────────────────────────────────────────
78
- /**
79
- * Header chip row on the workflow run-detail page, alongside the
80
- * status badge. Use for biome-shipped meta-actions (open in
81
- * external system, copy entity ref, …).
82
- */
83
- RunDetailActions: 'run-detail-actions',
84
-
85
- /**
86
- * Side-panel cards on the workflow run-detail page, under the
87
- * `ActivitySidebar`. Use for run-context biome surfaces (extracted
88
- * entity refs, diff stats, biome-side telemetry). The current
89
- * `runId` is readable from `bridge.navigation.useLocation()`.
90
- */
91
- RunDetailSidePanel: 'run-detail-side-panel',
92
-
93
- // ── Interactive sessions ───────────────────────────────────────────
94
- /**
95
- * Action chips in the session detail page, alongside session controls.
96
- * Use for biome shortcuts that are meaningful inside a session
97
- * (open repo, open catalog entity, post to Slack, …).
98
- */
99
- SessionActions: 'session-actions',
100
-
101
- /**
102
- * Side-panel cards on the session detail page. Use for biome-driven
103
- * context (related catalog entities, recent commits, …).
104
- */
105
- SessionSidePanel: 'session-side-panel',
106
-
107
- /**
108
- * Right-pane header strip in the session workspace (sessions +
109
- * design-system-builder sessions). Sits to the LEFT of the host's hardcoded
110
- * KB · Attachments · More · ActionsMenu icons. Use for compact
111
- * icon-button actions tied to the preview surface — e.g.
112
- * software-dev-web's Git commit/push/PR icons, a Slack "share
113
- * preview" button, a catalog "open entity" link.
114
- */
115
- SessionRightHeader: 'session-right-header',
116
-
117
- // ── Settings ───────────────────────────────────────────────────────
118
- /**
119
- * Tabs on the project Settings page. Each biome that contributes a
120
- * panel here is rendered as a tab section under "Biomes". Use for
121
- * per-project biome configuration (catalog instance URL +
122
- * credentials ref, Slack channel mapping, …).
123
- */
124
- SettingsTabs: 'settings-tabs',
125
- } as const;
126
-
127
- /**
128
- * Union of every host-defined slot id. Biome authors can use this in
129
- * their `panels[].slot` field for compile-time spell-checking — but
130
- * the runtime accepts any string, so biome-owned slots (`<biome-id>/x`)
131
- * stay valid without modifying this catalog.
132
- */
133
- export type HostExtensionSlot =
134
- (typeof HostExtensionSlots)[keyof typeof HostExtensionSlots];
@@ -1,164 +0,0 @@
1
- /**
2
- * Generic event-row primitive a biome can use as the rendered form of
3
- * a `SessionActivityEvent` it owns. Matches the host's built-in
4
- * console row visually (time gutter + icon chip + title + detail) so
5
- * biome-rendered events sit inside the host timeline without looking
6
- * grafted on.
7
- *
8
- * Biomes compose this when they register an `ActivityRendererContribution`:
9
- *
10
- * render: ({ event }) => (
11
- * <SessionEventCard
12
- * time={event.createdAt}
13
- * icon={<JiraIcon />}
14
- * title={event.title}
15
- * detail={event.detail}
16
- * tone={event.status === 'error' ? 'error' : 'default'}
17
- * />
18
- * )
19
- *
20
- * Inline-styled with CSS-variable tokens for the same portability
21
- * reasons as `SessionMutationBar`.
22
- */
23
- import { type CSSProperties, type ReactNode, type ReactElement } from 'react';
24
-
25
- export type SessionEventCardTone =
26
- | 'default'
27
- | 'pending'
28
- | 'success'
29
- | 'error'
30
- | 'info';
31
-
32
- const TONE_DOT: Record<SessionEventCardTone, string> = {
33
- default: 'hsl(var(--ink-4, 228 6% 58%))',
34
- pending: 'hsl(var(--info, 220 70% 50%))',
35
- success: 'hsl(var(--success, 152 50% 35%))',
36
- error: 'hsl(var(--destructive, 8 70% 50%))',
37
- info: 'hsl(var(--info, 220 70% 50%))',
38
- };
39
-
40
- const TONE_BG: Record<SessionEventCardTone, string> = {
41
- default: 'hsl(var(--paper-elev, 0 0% 100%))',
42
- pending: 'hsl(var(--info, 220 70% 50%) / 0.08)',
43
- success: 'hsl(var(--success, 152 50% 35%) / 0.08)',
44
- error: 'hsl(var(--destructive, 8 70% 50%) / 0.10)',
45
- info: 'hsl(var(--info, 220 70% 50%) / 0.08)',
46
- };
47
-
48
- export interface SessionEventCardProps {
49
- /** ISO timestamp; the primitive renders HH:MM:SS in the gutter. */
50
- readonly time: string;
51
- readonly icon?: ReactNode;
52
- readonly title: ReactNode;
53
- readonly detail?: ReactNode;
54
- /** Optional inline body (collapsible content, code block, …). */
55
- readonly children?: ReactNode;
56
- readonly tone?: SessionEventCardTone;
57
- readonly style?: CSSProperties;
58
- readonly className?: string;
59
- }
60
-
61
- function formatTime(iso: string): string {
62
- const date = new Date(iso);
63
- if (Number.isNaN(date.getTime())) {
64
- return '—';
65
- }
66
- return date.toLocaleTimeString([], {
67
- hour: '2-digit',
68
- minute: '2-digit',
69
- second: '2-digit',
70
- });
71
- }
72
-
73
- export function SessionEventCard({
74
- time,
75
- icon,
76
- title,
77
- detail,
78
- children,
79
- tone = 'default',
80
- style,
81
- className,
82
- }: SessionEventCardProps): ReactElement {
83
- return (
84
- <div
85
- className={className}
86
- style={{
87
- display: 'flex',
88
- gap: 10,
89
- padding: '4px 8px',
90
- borderRadius: 6,
91
- fontSize: 12,
92
- ...style,
93
- }}
94
- >
95
- <span
96
- style={{
97
- width: 56,
98
- flexShrink: 0,
99
- fontFamily: 'var(--font-mono, ui-monospace, monospace)',
100
- fontSize: 11,
101
- color: 'hsl(var(--ink-4, 228 6% 58%))',
102
- fontVariantNumeric: 'tabular-nums',
103
- }}
104
- >
105
- {formatTime(time)}
106
- </span>
107
- <div
108
- style={{
109
- width: 20,
110
- height: 20,
111
- flexShrink: 0,
112
- display: 'flex',
113
- alignItems: 'center',
114
- justifyContent: 'center',
115
- borderRadius: 4,
116
- background: TONE_BG[tone],
117
- }}
118
- >
119
- {icon ?? (
120
- <span
121
- style={{
122
- width: 6,
123
- height: 6,
124
- borderRadius: '50%',
125
- background: TONE_DOT[tone],
126
- }}
127
- />
128
- )}
129
- </div>
130
- <div style={{ minWidth: 0, flex: 1 }}>
131
- <div
132
- style={{
133
- display: 'flex',
134
- gap: 6,
135
- alignItems: 'baseline',
136
- flexWrap: 'wrap',
137
- }}
138
- >
139
- <span
140
- style={{
141
- color: 'hsl(var(--ink, 228 14% 11%))',
142
- wordBreak: 'break-word',
143
- }}
144
- >
145
- {title}
146
- </span>
147
- {detail !== null && detail !== undefined && (
148
- <span
149
- style={{
150
- color: 'hsl(var(--ink-3, 228 6% 40%))',
151
- wordBreak: 'break-word',
152
- }}
153
- >
154
- {detail}
155
- </span>
156
- )}
157
- </div>
158
- {children !== null && children !== undefined && (
159
- <div style={{ marginTop: 4 }}>{children}</div>
160
- )}
161
- </div>
162
- </div>
163
- );
164
- }