@semiont/react-ui 0.4.13 → 0.4.15

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 (52) hide show
  1. package/README.md +18 -12
  2. package/dist/KnowledgeBaseSessionContext-CpYaCbnC.d.mts +174 -0
  3. package/dist/{PdfAnnotationCanvas.client-CW6SKH2U.mjs → PdfAnnotationCanvas.client-CHDCGQBR.mjs} +3 -3
  4. package/dist/{chunk-HNZOXH4L.mjs → chunk-OZICDVH7.mjs} +5 -3
  5. package/dist/chunk-OZICDVH7.mjs.map +1 -0
  6. package/dist/chunk-R2U7P4TK.mjs +865 -0
  7. package/dist/chunk-R2U7P4TK.mjs.map +1 -0
  8. package/dist/{chunk-BQJWOK4C.mjs → chunk-VN5NY4SN.mjs} +9 -8
  9. package/dist/chunk-VN5NY4SN.mjs.map +1 -0
  10. package/dist/index.d.mts +147 -171
  11. package/dist/index.mjs +2215 -1961
  12. package/dist/index.mjs.map +1 -1
  13. package/dist/test-utils.d.mts +13 -62
  14. package/dist/test-utils.mjs +40 -21
  15. package/dist/test-utils.mjs.map +1 -1
  16. package/package.json +5 -3
  17. package/src/components/ProtectedErrorBoundary.tsx +95 -0
  18. package/src/components/Toolbar.tsx +13 -13
  19. package/src/components/__tests__/ProtectedErrorBoundary.test.tsx +197 -0
  20. package/src/components/modals/PermissionDeniedModal.tsx +140 -0
  21. package/src/components/modals/ReferenceWizardModal.tsx +3 -2
  22. package/src/components/modals/SessionExpiredModal.tsx +101 -0
  23. package/src/components/modals/__tests__/PermissionDeniedModal.test.tsx +150 -0
  24. package/src/components/modals/__tests__/SessionExpiredModal.test.tsx +115 -0
  25. package/src/components/resource/AnnotationHistory.tsx +5 -6
  26. package/src/components/resource/HistoryEvent.tsx +7 -7
  27. package/src/components/resource/__tests__/AnnotationHistory.test.tsx +33 -34
  28. package/src/components/resource/__tests__/HistoryEvent.test.tsx +17 -19
  29. package/src/components/resource/__tests__/event-formatting.test.ts +70 -94
  30. package/src/components/resource/event-formatting.ts +56 -56
  31. package/src/components/resource/panels/CollaborationPanel.tsx +9 -1
  32. package/src/components/resource/panels/ReferenceEntry.tsx +7 -5
  33. package/src/components/resource/panels/ResourceInfoPanel.tsx +8 -6
  34. package/src/components/resource/panels/__tests__/ReferenceEntry.test.tsx +12 -12
  35. package/src/components/resource/panels/__tests__/ResourceInfoPanel.test.tsx +1 -0
  36. package/src/features/resource-viewer/__tests__/AnnotationCreationPending.test.tsx +1 -1
  37. package/src/features/resource-viewer/__tests__/AnnotationDeletionIntegration.test.tsx +4 -4
  38. package/src/features/resource-viewer/__tests__/AnnotationProgressDismissal.test.tsx +5 -10
  39. package/src/features/resource-viewer/__tests__/BindFlowIntegration.test.tsx +23 -54
  40. package/src/features/resource-viewer/__tests__/DetectionFlowBug.test.tsx +6 -6
  41. package/src/features/resource-viewer/__tests__/DetectionFlowIntegration.test.tsx +7 -19
  42. package/src/features/resource-viewer/__tests__/ToastNotifications.test.tsx +1 -1
  43. package/src/features/resource-viewer/__tests__/YieldFlowIntegration.test.tsx +18 -44
  44. package/src/features/resource-viewer/__tests__/annotation-progress-flow.test.tsx +6 -6
  45. package/src/features/resource-viewer/components/ResourceViewerPage.tsx +31 -26
  46. package/src/styles/patterns/panels-base.css +12 -0
  47. package/dist/TranslationManager-CudgH3gw.d.mts +0 -107
  48. package/dist/chunk-BQJWOK4C.mjs.map +0 -1
  49. package/dist/chunk-HNZOXH4L.mjs.map +0 -1
  50. package/dist/chunk-OL5UST25.mjs +0 -413
  51. package/dist/chunk-OL5UST25.mjs.map +0 -1
  52. /package/dist/{PdfAnnotationCanvas.client-CW6SKH2U.mjs.map → PdfAnnotationCanvas.client-CHDCGQBR.mjs.map} +0 -0
package/dist/index.d.mts CHANGED
@@ -1,13 +1,13 @@
1
1
  import * as _semiont_core from '@semiont/core';
2
- import { components, ResourceId, Selector, AnnotationId, ResourceEvent, EventBus, EventMap, MarkProgress, StoredEventLike, paths, GatheredContext, Motivation as Motivation$9, YieldProgress } from '@semiont/core';
2
+ import { components, ResourceId, Selector, AnnotationId, PersistedEvent, EventBus, EventMap, MarkProgress, StoredEventLike, paths, GatheredContext, Motivation as Motivation$9, YieldProgress } from '@semiont/core';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as React$1 from 'react';
5
5
  import React__default, { ComponentType, ReactNode, KeyboardEvent as KeyboardEvent$1, Component, ErrorInfo, Ref } from 'react';
6
- import { O as OpenResourcesManager, S as SessionManager, T as TranslationManager, a as OpenResource } from './TranslationManager-CudgH3gw.mjs';
7
- export { b as SessionState } from './TranslationManager-CudgH3gw.mjs';
6
+ import { O as OpenResourcesManager, K as KbSessionStatus, a as KnowledgeBase, T as TranslationManager, b as OpenResource } from './KnowledgeBaseSessionContext-CpYaCbnC.mjs';
7
+ export { A as AuthSession, c as KnowledgeBaseSessionContext, d as KnowledgeBaseSessionProvider, e as KnowledgeBaseSessionValue, N as NewKnowledgeBase, u as useKnowledgeBaseSession } from './KnowledgeBaseSessionContext-CpYaCbnC.mjs';
8
8
  import * as _tanstack_react_query from '@tanstack/react-query';
9
9
  import { UseQueryOptions } from '@tanstack/react-query';
10
- import { SemiontApiClient, ValidationResult } from '@semiont/api-client';
10
+ import { SemiontApiClient, ValidationResult, TokenRefresher } from '@semiont/api-client';
11
11
  import * as _codemirror_state from '@codemirror/state';
12
12
  import { HighlightStyle } from '@codemirror/language';
13
13
  import { WidgetType } from '@codemirror/view';
@@ -362,21 +362,7 @@ declare function useResources(): {
362
362
  };
363
363
  events: {
364
364
  useQuery: (id: ResourceId) => _tanstack_react_query.UseQueryResult<{
365
- events: {
366
- event: {
367
- id: string;
368
- type: string;
369
- timestamp: string;
370
- userId: string;
371
- resourceId: string;
372
- payload?: unknown;
373
- };
374
- metadata: {
375
- sequenceNumber: number;
376
- prevEventHash?: string;
377
- checksum?: string;
378
- };
379
- }[];
365
+ events: _semiont_core.components["schemas"]["StoredEventResponse"][];
380
366
  total: number;
381
367
  resourceId: string;
382
368
  }, Error>;
@@ -478,51 +464,7 @@ declare function useAnnotations(): {
478
464
  };
479
465
  history: {
480
466
  useQuery: (resourceId: ResourceId, annotationId: AnnotationId) => _tanstack_react_query.UseQueryResult<{
481
- events: {
482
- id: string;
483
- type: string;
484
- timestamp: string;
485
- userId: string;
486
- resourceId: string;
487
- payload: {
488
- name: string;
489
- format: _semiont_core.components["schemas"]["ContentFormat"];
490
- contentChecksum: string;
491
- creationMethod: "api" | "upload" | "ui" | "reference" | "clone" | "generated";
492
- entityTypes?: string[];
493
- metadata?: {
494
- [key: string]: unknown;
495
- };
496
- } | {
497
- name: string;
498
- format: _semiont_core.components["schemas"]["ContentFormat"];
499
- contentChecksum: string;
500
- parentResourceId: string;
501
- creationMethod: "api" | "upload" | "ui" | "reference" | "clone" | "generated";
502
- entityTypes?: string[];
503
- metadata?: {
504
- [key: string]: unknown;
505
- };
506
- } | {
507
- reason?: string;
508
- } | Record<string, never> | {
509
- annotation: _semiont_core.components["schemas"]["Annotation"];
510
- } | {
511
- annotationId: string;
512
- } | {
513
- annotationId: string;
514
- targetResourceId: string;
515
- } | {
516
- entityType: string;
517
- } | {
518
- entityType: string;
519
- };
520
- metadata: {
521
- sequenceNumber: number;
522
- prevEventHash?: string;
523
- checksum?: string;
524
- };
525
- }[];
467
+ events: _semiont_core.components["schemas"]["StoredEventResponse"][];
526
468
  total: number;
527
469
  annotationId: string;
528
470
  resourceId: string;
@@ -543,7 +485,9 @@ declare function useAnnotations(): {
543
485
  }, unknown>;
544
486
  };
545
487
  updateBody: {
546
- useMutation: () => _tanstack_react_query.UseMutationResult<void, Error, {
488
+ useMutation: () => _tanstack_react_query.UseMutationResult<{
489
+ correlationId: string;
490
+ }, Error, {
547
491
  resourceId: ResourceId;
548
492
  annotationId: AnnotationId;
549
493
  data: Parameters<SemiontApiClient["bindAnnotation"]>[2];
@@ -762,41 +706,11 @@ declare function useHealth(): {
762
706
  };
763
707
  message: string;
764
708
  authenticatedAs?: string;
709
+ projectName?: string;
765
710
  }, Error>;
766
711
  };
767
712
  };
768
713
 
769
- /**
770
- * Global authentication event system for coordinating auth state across components
771
- */
772
- declare const AUTH_EVENTS: {
773
- readonly UNAUTHORIZED: "auth:unauthorized";
774
- readonly FORBIDDEN: "auth:forbidden";
775
- readonly SESSION_EXPIRED: "auth:session-expired";
776
- };
777
- type AuthEventType = typeof AUTH_EVENTS[keyof typeof AUTH_EVENTS];
778
- interface AuthEventDetail {
779
- message?: string;
780
- statusCode?: number;
781
- timestamp: number;
782
- }
783
- /**
784
- * Dispatch an authentication event
785
- */
786
- declare function dispatchAuthEvent(type: AuthEventType, detail?: Partial<AuthEventDetail>): void;
787
- /**
788
- * Listen for authentication events
789
- */
790
- declare function onAuthEvent(type: AuthEventType, handler: (event: CustomEvent<AuthEventDetail>) => void): () => void;
791
- /**
792
- * Dispatch a 401 Unauthorized event
793
- */
794
- declare function dispatch401Error(message?: string): void;
795
- /**
796
- * Dispatch a 403 Forbidden event
797
- */
798
- declare function dispatch403Error(message?: string): void;
799
-
800
714
  /**
801
715
  * Centralized button styles matching Figma design
802
716
  * Two primary styles from authenticated home page:
@@ -1317,27 +1231,27 @@ storageKey }?: UsePanelWidthOptions): {
1317
1231
  type StreamStatus = 'disconnected' | 'connecting' | 'connected' | 'error';
1318
1232
  interface UseResourceEventsOptions {
1319
1233
  rUri: ResourceId;
1320
- onEvent?: (event: ResourceEvent) => void;
1321
- onAnnotationAdded?: (event: Extract<ResourceEvent, {
1322
- type: 'annotation.added';
1234
+ onEvent?: (event: PersistedEvent) => void;
1235
+ onAnnotationAdded?: (event: Extract<PersistedEvent, {
1236
+ type: 'mark:added';
1323
1237
  }>) => void;
1324
- onAnnotationRemoved?: (event: Extract<ResourceEvent, {
1325
- type: 'annotation.removed';
1238
+ onAnnotationRemoved?: (event: Extract<PersistedEvent, {
1239
+ type: 'mark:removed';
1326
1240
  }>) => void;
1327
- onAnnotationBodyUpdated?: (event: Extract<ResourceEvent, {
1328
- type: 'annotation.body.updated';
1241
+ onAnnotationBodyUpdated?: (event: Extract<PersistedEvent, {
1242
+ type: 'mark:body-updated';
1329
1243
  }>) => void;
1330
- onEntityTagAdded?: (event: Extract<ResourceEvent, {
1331
- type: 'entitytag.added';
1244
+ onEntityTagAdded?: (event: Extract<PersistedEvent, {
1245
+ type: 'mark:entity-tag-added';
1332
1246
  }>) => void;
1333
- onEntityTagRemoved?: (event: Extract<ResourceEvent, {
1334
- type: 'entitytag.removed';
1247
+ onEntityTagRemoved?: (event: Extract<PersistedEvent, {
1248
+ type: 'mark:entity-tag-removed';
1335
1249
  }>) => void;
1336
- onDocumentArchived?: (event: Extract<ResourceEvent, {
1337
- type: 'resource.archived';
1250
+ onDocumentArchived?: (event: Extract<PersistedEvent, {
1251
+ type: 'mark:archived';
1338
1252
  }>) => void;
1339
- onDocumentUnarchived?: (event: Extract<ResourceEvent, {
1340
- type: 'resource.unarchived';
1253
+ onDocumentUnarchived?: (event: Extract<PersistedEvent, {
1254
+ type: 'mark:unarchived';
1341
1255
  }>) => void;
1342
1256
  onError?: (error: string) => void;
1343
1257
  autoConnect?: boolean;
@@ -1359,7 +1273,7 @@ interface UseResourceEventsOptions {
1359
1273
  */
1360
1274
  declare function useResourceEvents({ rUri, onEvent, onAnnotationAdded, onAnnotationRemoved, onAnnotationBodyUpdated, onEntityTagAdded, onEntityTagRemoved, onDocumentArchived, onDocumentUnarchived, onError, autoConnect, }: UseResourceEventsOptions): {
1361
1275
  status: StreamStatus;
1362
- lastEvent: ResourceEvent | null;
1276
+ lastEvent: PersistedEvent | null;
1363
1277
  eventCount: number;
1364
1278
  connect: () => void;
1365
1279
  disconnect: () => void;
@@ -1400,6 +1314,11 @@ declare function useRovingTabIndex<T extends HTMLElement>(itemCount: number, opt
1400
1314
  focusItem: (index: number) => void;
1401
1315
  };
1402
1316
 
1317
+ /**
1318
+ * Tracks the time remaining on the active KB session's JWT and whether it's
1319
+ * expiring soon (< 5 minutes). Re-derives once per second from the
1320
+ * KnowledgeBaseSession context.
1321
+ */
1403
1322
  declare function useSessionExpiry(): {
1404
1323
  timeRemaining: number | null;
1405
1324
  isExpiringSoon: boolean;
@@ -1507,6 +1426,13 @@ declare function useAnnotationManager(): AnnotationManager;
1507
1426
 
1508
1427
  interface ApiClientProviderProps {
1509
1428
  baseUrl: string;
1429
+ /**
1430
+ * Optional 401-recovery hook. If provided, the api-client will retry
1431
+ * requests once with a fresh token when a 401 is encountered. The
1432
+ * frontend's protected layouts pass `useKnowledgeBaseSession().refreshActive`
1433
+ * here so the api-client can transparently recover from expired access tokens.
1434
+ */
1435
+ tokenRefresher?: TokenRefresher;
1510
1436
  children: ReactNode;
1511
1437
  }
1512
1438
  /**
@@ -1515,7 +1441,7 @@ interface ApiClientProviderProps {
1515
1441
  * The EventBus is taken from EventBusContext so client and UI components
1516
1442
  * share the same workspace-scoped bus.
1517
1443
  */
1518
- declare function ApiClientProvider({ baseUrl: url, children, }: ApiClientProviderProps): react_jsx_runtime.JSX.Element;
1444
+ declare function ApiClientProvider({ baseUrl: url, tokenRefresher, children, }: ApiClientProviderProps): react_jsx_runtime.JSX.Element;
1519
1445
  /**
1520
1446
  * Hook to access the stateless API client singleton
1521
1447
  * Must be used within an ApiClientProvider
@@ -1635,7 +1561,7 @@ declare function useEventBus(): EventBus;
1635
1561
  *
1636
1562
  * @example
1637
1563
  * ```tsx
1638
- * useEventSubscription('mark:created', ({ annotation }) => {
1564
+ * useEventSubscription('mark:create-ok', ({ annotationId }) => {
1639
1565
  * // This always uses the latest props/state
1640
1566
  * triggerSparkleAnimation(annotation.id);
1641
1567
  * });
@@ -1648,8 +1574,8 @@ declare function useEventSubscription<K extends keyof EventMap>(eventName: K, ha
1648
1574
  * @example
1649
1575
  * ```tsx
1650
1576
  * useEventSubscriptions({
1651
- * 'mark:created': ({ annotation }) => setNewAnnotation(annotation),
1652
- * 'mark:deleted': ({ annotationId }) => removeAnnotation(annotationId),
1577
+ * 'mark:create-ok': ({ annotationId }) => handleCreated(annotationId),
1578
+ * 'mark:delete-ok': ({ annotationId }) => removeAnnotation(annotationId),
1653
1579
  * });
1654
1580
  * ```
1655
1581
  */
@@ -1754,31 +1680,38 @@ interface RouteBuilder {
1754
1680
  }
1755
1681
 
1756
1682
  /**
1757
- * Provider Pattern: Accepts SessionManager implementation as prop
1758
- * and makes it available to child components via Context.
1759
- *
1760
- * Apps provide their own implementation (next-auth, custom auth, etc.)
1761
- * and pass it to this provider at the root level.
1683
+ * Pure helpers for the KnowledgeBaseSession provider.
1762
1684
  *
1763
- * @example
1764
- * ```tsx
1765
- * // In app root
1766
- * const sessionManager = useSessionManager(); // App's implementation
1685
+ * Contains:
1686
+ * - localStorage shape and read/write helpers for KB list, active KB id,
1687
+ * and per-KB sessions
1688
+ * - JWT expiry parsing and "is expired" check
1689
+ * - URL/protocol helpers for KB instances
1690
+ * - The public `getKbSessionStatus(kbId)` helper that the KB-list UI uses
1691
+ * to color status dots without subscribing to context changes
1767
1692
  *
1768
- * <SessionProvider sessionManager={sessionManager}>
1769
- * <App />
1770
- * </SessionProvider>
1771
- * ```
1693
+ * No React imports, no module-scoped state, no side effects beyond
1694
+ * localStorage. Splitting these out of the provider file makes them
1695
+ * unit-testable in isolation and keeps the React provider focused on
1696
+ * lifecycle and state.
1772
1697
  */
1773
- declare function SessionProvider({ sessionManager, children }: {
1774
- sessionManager: SessionManager;
1775
- children: ReactNode;
1776
- }): react_jsx_runtime.JSX.Element;
1698
+
1699
+ /** The shape persisted to localStorage per KB. */
1700
+ interface StoredSession {
1701
+ access: string;
1702
+ refresh: string;
1703
+ }
1704
+ declare function defaultProtocol(host: string): 'http' | 'https';
1705
+ declare function kbBackendUrl(kb: KnowledgeBase): string;
1777
1706
  /**
1778
- * Hook to access SessionManager from Context
1779
- * Components use this hook to access session state and expiry information
1707
+ * Read the locally-stored credential status for a KB. Pure / synchronous —
1708
+ * does not subscribe to context changes. Used by KB-list UI to color status
1709
+ * dots without requiring re-renders on every tick.
1780
1710
  */
1781
- declare function useSessionContext(): SessionManager;
1711
+ declare function getKbSessionStatus(kbId: string): KbSessionStatus;
1712
+
1713
+ declare function notifySessionExpired(message?: string): void;
1714
+ declare function notifyPermissionDenied(message?: string): void;
1782
1715
 
1783
1716
  declare const AVAILABLE_LOCALES: readonly ["ar", "bn", "cs", "da", "de", "el", "en", "es", "fa", "fi", "fr", "he", "hi", "id", "it", "ja", "ko", "ms", "nl", "no", "pl", "pt", "ro", "sv", "th", "tr", "uk", "vi", "zh"];
1784
1717
  type AvailableLocale = typeof AVAILABLE_LOCALES[number];
@@ -1906,6 +1839,31 @@ declare function AsyncErrorBoundary({ children }: {
1906
1839
  children: ReactNode;
1907
1840
  }): react_jsx_runtime.JSX.Element;
1908
1841
 
1842
+ interface ProtectedErrorBoundaryProps {
1843
+ children: React__default.ReactNode;
1844
+ /**
1845
+ * Values that, when any change, reset the boundary back to its non-error
1846
+ * state. Apps typically pass `[location.pathname]` so navigating away from
1847
+ * a crashed page automatically recovers.
1848
+ */
1849
+ resetKeys?: unknown[];
1850
+ }
1851
+ /**
1852
+ * Error boundary for protected (authenticated) routes.
1853
+ *
1854
+ * Catches unexpected render-time crashes inside the protected tree and
1855
+ * shows a generic "something went wrong" fallback with a refresh option.
1856
+ *
1857
+ * NOT auth-specific. Auth state changes (sign-in, sign-out, expiry) flow
1858
+ * through the KnowledgeBaseSession context, not exceptions — so this
1859
+ * boundary will never catch an "auth error" in normal operation. Its job
1860
+ * is purely to keep a render bug from blanking the screen.
1861
+ *
1862
+ * The optional `resetKeys` prop lets callers wire automatic recovery on
1863
+ * navigation (e.g. `resetKeys={[location.pathname]}`).
1864
+ */
1865
+ declare function ProtectedErrorBoundary({ children, resetKeys, }: ProtectedErrorBoundaryProps): react_jsx_runtime.JSX.Element;
1866
+
1909
1867
  type Annotation$f = components['schemas']['Annotation'];
1910
1868
  interface LiveRegionContextType {
1911
1869
  announce: (message: string, priority?: 'polite' | 'assertive') => void;
@@ -2123,6 +2081,18 @@ interface KeyboardShortcutsHelpModalProps {
2123
2081
  }
2124
2082
  declare function KeyboardShortcutsHelpModal({ isOpen, onClose }: KeyboardShortcutsHelpModalProps): react_jsx_runtime.JSX.Element;
2125
2083
 
2084
+ /**
2085
+ * Modal that surfaces when a 403 forbidden error is reported via
2086
+ * `notifyPermissionDenied` (called from QueryCache.onError).
2087
+ *
2088
+ * Reads `permissionDeniedAt` and `permissionDeniedMessage` from
2089
+ * KnowledgeBaseSessionContext. The provider clears the flag when the user
2090
+ * dismisses the modal.
2091
+ *
2092
+ * Must be mounted inside KnowledgeBaseSessionProvider.
2093
+ */
2094
+ declare function PermissionDeniedModal(): react_jsx_runtime.JSX.Element;
2095
+
2126
2096
  interface ProposeEntitiesModalProps {
2127
2097
  isOpen: boolean;
2128
2098
  onConfirm: (selectedTypes: string[]) => void;
@@ -2130,6 +2100,18 @@ interface ProposeEntitiesModalProps {
2130
2100
  }
2131
2101
  declare function ProposeEntitiesModal({ isOpen, onConfirm, onCancel }: ProposeEntitiesModalProps): react_jsx_runtime.JSX.Element;
2132
2102
 
2103
+ /**
2104
+ * Modal that surfaces when the active KB's session expires (a 401 from
2105
+ * either the provider's own JWT validation or from any React Query call
2106
+ * via the QueryCache.onError handler).
2107
+ *
2108
+ * Reads `sessionExpiredAt` from KnowledgeBaseSessionContext. When the user
2109
+ * dismisses the modal, the provider clears the flag.
2110
+ *
2111
+ * Must be mounted inside KnowledgeBaseSessionProvider.
2112
+ */
2113
+ declare function SessionExpiredModal(): react_jsx_runtime.JSX.Element;
2114
+
2133
2115
  interface Props$8 {
2134
2116
  content: string;
2135
2117
  mimeType?: string;
@@ -2293,8 +2275,9 @@ interface Props$3 {
2293
2275
  isConnected: boolean;
2294
2276
  eventCount: number;
2295
2277
  lastEventTimestamp?: string;
2278
+ knowledgeBaseName?: string;
2296
2279
  }
2297
- declare function CollaborationPanel({ isConnected, eventCount, lastEventTimestamp }: Props$3): react_jsx_runtime.JSX.Element;
2280
+ declare function CollaborationPanel({ isConnected, eventCount, lastEventTimestamp, knowledgeBaseName }: Props$3): react_jsx_runtime.JSX.Element;
2298
2281
 
2299
2282
  type Annotation$9 = components['schemas']['Annotation'];
2300
2283
  interface CommentEntryProps {
@@ -2475,6 +2458,7 @@ declare function ReferencesPanel({ annotations, isAssisting, progress, annotateM
2475
2458
 
2476
2459
  type Agent = components['schemas']['Agent'];
2477
2460
  interface Props {
2461
+ resourceId: string;
2478
2462
  documentEntityTypes: string[];
2479
2463
  documentLocale?: string | undefined;
2480
2464
  primaryMediaType?: string | undefined;
@@ -2490,11 +2474,11 @@ interface Props {
2490
2474
  /**
2491
2475
  * Panel for displaying resource metadata and management actions
2492
2476
  *
2493
- * @emits yield:clone - Clone this resource. Payload: undefined
2494
- * @emits mark:unarchive - Unarchive this resource. Payload: undefined
2495
- * @emits mark:archive - Archive this resource. Payload: undefined
2477
+ * @emits yield:clone - Clone this resource
2478
+ * @emits mark:unarchive - Unarchive this resource
2479
+ * @emits mark:archive - Archive this resource
2496
2480
  */
2497
- declare function ResourceInfoPanel({ documentEntityTypes, documentLocale, primaryMediaType, primaryByteSize, isArchived, dateCreated, dateModified, creationMethod, wasAttributedTo, wasDerivedFrom, generator, }: Props): react_jsx_runtime.JSX.Element;
2481
+ declare function ResourceInfoPanel({ resourceId, documentEntityTypes, documentLocale, primaryMediaType, primaryByteSize, isArchived, dateCreated, dateModified, creationMethod, wasAttributedTo, wasDerivedFrom, generator, }: Props): react_jsx_runtime.JSX.Element;
2498
2482
 
2499
2483
  type Annotation$3 = components['schemas']['Annotation'];
2500
2484
  interface StatisticsPanelProps {
@@ -4009,6 +3993,10 @@ interface ResourceViewerPageProps {
4009
3993
  * SSE attention stream connection status for the active workspace
4010
3994
  */
4011
3995
  streamStatus: StreamStatus;
3996
+ /**
3997
+ * Name of the active knowledge base (for display in panels)
3998
+ */
3999
+ knowledgeBaseName?: string | undefined;
4012
4000
  }
4013
4001
  /**
4014
4002
  * ResourceViewerPage - Main component
@@ -4037,7 +4025,7 @@ interface ResourceViewerPageProps {
4037
4025
  * @subscribes browse:reference-navigate - Navigate to a referenced document
4038
4026
  * @subscribes browse:entity-type-clicked - Navigate filtered by entity type
4039
4027
  */
4040
- declare function ResourceViewerPage({ resource, rUri, locale, Link, routes, ToolbarPanels, refetchDocument, streamStatus, }: ResourceViewerPageProps): react_jsx_runtime.JSX.Element;
4028
+ declare function ResourceViewerPage({ resource, rUri, locale, Link, routes, ToolbarPanels, refetchDocument, streamStatus, knowledgeBaseName, }: ResourceViewerPageProps): react_jsx_runtime.JSX.Element;
4041
4029
 
4042
4030
  /**
4043
4031
  * useBeckonFlow — Annotation attention / pointer coordination hook
@@ -4113,14 +4101,14 @@ declare function useAttentionStream(): {
4113
4101
  /**
4114
4102
  * useMarkFlow - Annotation state management hook
4115
4103
  *
4116
- * Activates mark orchestration (CRUD + AI assist) by delegating to
4117
- * client.flows.mark(). Manages UI state (pendingAnnotation, assistingMotivation,
4104
+ * Bridges EventBus commands to namespace API methods for annotation CRUD
4105
+ * and AI assist. Manages UI state (pendingAnnotation, assistingMotivation,
4118
4106
  * progress) via EventBus subscriptions — the React-specific portion.
4119
4107
  *
4120
- * @subscribes mark:submit, mark:delete, mark:assist-request, job:cancel-requested
4121
- * @subscribes mark:requested, mark:select-*, mark:cancel-pending
4122
- * @subscribes mark:progress, mark:assist-finished, mark:assist-failed
4123
- * @returns Annotation flow state
4108
+ * The FlowEngine's HTTP bridging role is replaced by namespace methods:
4109
+ * - mark:submit semiont.mark.annotation()
4110
+ * - mark:delete semiont.mark.delete()
4111
+ * - mark:assist-request semiont.mark.assist() (Observable)
4124
4112
  */
4125
4113
 
4126
4114
  interface PendingAnnotation {
@@ -4174,13 +4162,9 @@ declare function usePanelBrowse(): PanelBrowseState;
4174
4162
  /**
4175
4163
  * useYieldFlow - Document generation flow hook
4176
4164
  *
4177
- * Activates yield orchestration by delegating to client.flows.yield().
4178
- * Manages generation progress state (React-specific) via EventBus subscriptions.
4179
- *
4180
- * @subscribes yield:request - Triggers SSE call to yieldResource
4181
- * @subscribes job:cancel-requested - Cancels in-flight generation stream
4182
- * @subscribes yield:progress, yield:finished, yield:failed
4183
- * @returns Generation flow state
4165
+ * Triggers yield.fromAnnotation() on the namespace API.
4166
+ * Manages generation progress state (React-specific) via EventBus subscriptions
4167
+ * from the events-stream auto-router.
4184
4168
  */
4185
4169
 
4186
4170
  interface YieldFlowState {
@@ -4201,15 +4185,10 @@ declare function useYieldFlow(locale: string, resourceId: string, clearNewAnnota
4201
4185
  /**
4202
4186
  * useContextGatherFlow - Context gather capability hook
4203
4187
  *
4204
- * Activates gather orchestration for a resource by delegating to
4205
- * client.flows.gatherContext(). Manages UI state (gatherContext, gatherLoading,
4206
- * gatherError, gatherAnnotationId) via EventBus subscriptions the
4207
- * React-specific portion.
4208
- *
4209
- * @subscribes gather:requested - Triggers loading state
4210
- * @subscribes gather:complete - Sets gathered context
4211
- * @subscribes gather:failed - Sets error state
4212
- * @returns Gather flow state
4188
+ * Manages UI state for context gathering. The actual gather trigger
4189
+ * comes from components emitting gather:requested on the EventBus.
4190
+ * This hook bridges to semiont.gather.annotation() and manages the
4191
+ * React state (loading, context, error).
4213
4192
  */
4214
4193
 
4215
4194
  interface ContextGatherFlowConfig {
@@ -4227,14 +4206,11 @@ declare function useContextGatherFlow(config: ContextGatherFlowConfig): ContextG
4227
4206
  /**
4228
4207
  * useBindFlow - Reference resolution flow hook
4229
4208
  *
4230
- * Activates bind + search orchestration for a resource by delegating to
4231
- * client.flows.bind(). All subscription logic lives in FlowEngine (api-client).
4209
+ * Bridges EventBus commands to namespace API methods.
4210
+ * Components emit bind:update-body / match:search-requested on the EventBus;
4211
+ * this hook calls semiont.bind.body() / semiont.match.search() in response.
4232
4212
  *
4233
4213
  * Toast notifications for resolution errors remain here (React-specific).
4234
- *
4235
- * @subscribes bind:update-body - Update annotation body via API
4236
- * @subscribes match:search-requested - Bridge to backend Matcher via SSE
4237
- * @emits bind:body-updated, bind:body-update-failed
4238
4214
  */
4239
4215
 
4240
4216
  declare function useBindFlow(rUri: ResourceId): void;
@@ -4264,4 +4240,4 @@ declare function useObservable<T>(obs$: Observable<T>): T | undefined;
4264
4240
  */
4265
4241
  declare function useStoreTokenSync(): void;
4266
4242
 
4267
- export { ANNOTATORS, AUTH_EVENTS, AVAILABLE_LOCALES, AdminDevOpsPage, type AdminDevOpsPageProps, AdminExchangePage, type AdminExchangePageProps, type AdminExchangePageTranslations, AdminSecurityPage, type AdminSecurityPageProps, type AdminUser, type AdminUserStats, AdminUsersPage, type AdminUsersPageProps, AnnotateReferencesProgressWidget, AnnotateToolbar, AnnotateView, type Annotation$k as Annotation, type AnnotationConfig, type AnnotationCreationHandler, type AnnotationHandlers, AnnotationHistory, type AnnotationManager, AnnotationOverlay, AnnotationProvider, type AnnotationProviderProps, type AnnotationUIState, type AnnotationsCollection, type Annotator, ApiClientProvider, type ApiClientProviderProps, AssessmentEntry, AssessmentPanel, AssistSection, AsyncErrorBoundary, AuthErrorDisplay, type AuthErrorDisplayProps, type AuthEventDetail, type AuthEventType, AuthTokenProvider, type AuthTokenProviderProps, type AvailableLocale, type BeckonFlowState, type BorderRadiusToken, BrowseView, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, COMMON_PANELS, type CacheManager, CacheProvider, type CacheProviderProps, type ClickAction, CodeMirrorRenderer, CollaborationPanel, CollapsibleResourceNavigation, type CollapsibleResourceNavigationProps, type ColorToken, CommentEntry, CommentsPanel, ComposeLoadingState, type ComposeLoadingStateProps, type ContextGatherFlowConfig, type ContextGatherFlowState, type CreateAnnotationParams, type CreateConfig, type DeleteAnnotationParams, type DetectionConfig, type DevOpsFeature, type DrawingMode, EntityTagsPage, type EntityTagsPageProps, EntityTypeBadges, ErrorBoundary, EventBusProvider, type EventBusProviderProps, ExportCard, type ExportCardProps, type ExportCardTranslations, Footer, HOVER_DELAY_MS, HighlightEntry, HighlightPanel, HistoryEvent, type HoverEmitterProps, type HoverHandlers, ImageURLSchema, ImageViewer, ImportCard, type ImportCardProps, type ImportCardTranslations, type ImportPreview, ImportProgress, type ImportProgressProps, type ImportProgressTranslations, JsonLdPanel, JsonLdView, type KeyboardShortcut, KeyboardShortcutsHelpModal, LeftSidebar, type LinkComponentProps, LinkedDataPage, type LinkedDataPageProps, type LinkedDataPageTranslations, LiveRegionProvider, type MarkFlowState, type Motivation$8 as Motivation, type NavigationItem, NavigationMenu, type NavigationMenuHelper, type NavigationProps, type OAuthProvider, type OAuthUser, OAuthUserSchema, ObservableLink, type ObservableLinkProps, OpenResource, OpenResourcesManager, OpenResourcesProvider, type OverlayAnnotation, PageLayout, type PanelBrowseState, PanelHeader, PopupContainer, PopupHeader, ProposeEntitiesModal, QUERY_KEYS, RESOURCE_PANELS, RecentDocumentsPage, type RecentDocumentsPageProps, ReferenceEntry, ReferenceResolutionWidget, ReferenceWizardModal, type ReferenceWizardModalProps, ReferencesPanel, ResizeHandle, type ResolvedTheme, ResourceAnnotationsProvider, ResourceCard, type ResourceCardProps, ResourceComposePage, type ResourceComposePageProps, ResourceDiscoveryPage, type ResourceDiscoveryPageProps, ResourceErrorState, type ResourceErrorStateProps, ResourceInfoPanel, ResourceLoadingState, ResourceSearchModal, type ResourceSearchModalProps, ResourceTagsInline, ResourceViewer, ResourceViewerPage, type ResourceViewerPageProps, type RouteBuilder, type SaveResourceParams, SearchModal, type SearchModalProps, SelectedTextDisplay, type SelectionMotivation, type SelectorType, SemiontBranding, SemiontFavicon, type SemiontResource$4 as SemiontResource, SessionExpiryBanner, SessionManager, SessionProvider, SessionTimer, SettingsPanel, type ShadowToken, type ShapeType, SignInForm, type SignInFormProps, SignUpForm, type SignUpFormProps, SimpleNavigation, type SimpleNavigationItem, type SimpleNavigationProps, SkipLinks, SortableResourceTab, type SortableResourceTabProps, type SpacingToken, StatisticsPanel, StatusDisplay, type StreamStatus, SvgDrawingCanvas, TagEntry, TagSchemasPage, type TagSchemasPageProps, TaggingPanel, type TextSegment, type TextSelection, type Theme, ThemeProvider, ToastContainer, type ToastMessage, ToastProvider, type ToastType, Toolbar, type ToolbarPanelType, type TransitionToken, TranslationManager, TranslationProvider, type TranslationProviderProps, type TypographyToken, type UICreateAnnotationParams, UnifiedAnnotationsPanel, UnifiedHeader, type UseResourceContentResult, UserMenuSkeleton, WelcomePage, type WelcomePageProps, type YieldFlowState, applyHighlights, buildSourceToRenderedMap, buildTextNodeIndex, buttonStyles, clearHighlights, createHoverHandlers, cssVariables, dispatch401Error, dispatch403Error, dispatchAuthEvent, faviconPaths, formatTime, generateCSSVariables, getResourceIcon, getSelectedShapeForSelectorType, getSelectorType, getShortcutDisplay, getSupportedShapes, hideWidgetPreview, isShapeSupported, jsonLightHighlightStyle, jsonLightTheme, onAuthEvent, resolveAnnotationRanges, sanitizeImageURL, saveSelectedShapeForSelectorType, showWidgetPreview, supportsDetection, toOverlayAnnotations, tokens, useAdmin, useAnnotationManager, useAnnotations, useApiClient, useAttentionStream, useAuthApi, useAuthToken, useBeckonFlow, useBindFlow, useCacheManager, useContextGatherFlow, useDebounce, useDebouncedCallback, useDocumentAnnouncements, useDoubleKeyPress, useDropdown, useEntityTypes, useEventBus, useEventSubscription, useEventSubscriptions, useFormAnnouncements, useGlobalEvents, useHealth, useHoverDelay, useHoverEmitter, useIsTyping, useKeyboardShortcuts, useLanguageChangeAnnouncements, useLineNumbers, useLiveRegion, useLoadingState, useLocalStorage, useMarkFlow, useModeration, useObservable, useObservableExternalNavigation, useObservableRouter, useOpenResources, usePanelBrowse, usePanelWidth, usePreloadTranslations, useResourceAnnotations, useResourceContent, useResourceEvents, useResourceLoadingAnnouncements, useResources, useRovingTabIndex, useSearchAnnouncements, useSessionContext, useSessionExpiry, useStoreTokenSync, useTheme, useToast, useTranslations, useYieldFlow };
4243
+ export { ANNOTATORS, AVAILABLE_LOCALES, AdminDevOpsPage, type AdminDevOpsPageProps, AdminExchangePage, type AdminExchangePageProps, type AdminExchangePageTranslations, AdminSecurityPage, type AdminSecurityPageProps, type AdminUser, type AdminUserStats, AdminUsersPage, type AdminUsersPageProps, AnnotateReferencesProgressWidget, AnnotateToolbar, AnnotateView, type Annotation$k as Annotation, type AnnotationConfig, type AnnotationCreationHandler, type AnnotationHandlers, AnnotationHistory, type AnnotationManager, AnnotationOverlay, AnnotationProvider, type AnnotationProviderProps, type AnnotationUIState, type AnnotationsCollection, type Annotator, ApiClientProvider, type ApiClientProviderProps, AssessmentEntry, AssessmentPanel, AssistSection, AsyncErrorBoundary, AuthErrorDisplay, type AuthErrorDisplayProps, AuthTokenProvider, type AuthTokenProviderProps, type AvailableLocale, type BeckonFlowState, type BorderRadiusToken, BrowseView, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, COMMON_PANELS, type CacheManager, CacheProvider, type CacheProviderProps, type ClickAction, CodeMirrorRenderer, CollaborationPanel, CollapsibleResourceNavigation, type CollapsibleResourceNavigationProps, type ColorToken, CommentEntry, CommentsPanel, ComposeLoadingState, type ComposeLoadingStateProps, type ContextGatherFlowConfig, type ContextGatherFlowState, type CreateAnnotationParams, type CreateConfig, type DeleteAnnotationParams, type DetectionConfig, type DevOpsFeature, type DrawingMode, EntityTagsPage, type EntityTagsPageProps, EntityTypeBadges, ErrorBoundary, EventBusProvider, type EventBusProviderProps, ExportCard, type ExportCardProps, type ExportCardTranslations, Footer, HOVER_DELAY_MS, HighlightEntry, HighlightPanel, HistoryEvent, type HoverEmitterProps, type HoverHandlers, ImageURLSchema, ImageViewer, ImportCard, type ImportCardProps, type ImportCardTranslations, type ImportPreview, ImportProgress, type ImportProgressProps, type ImportProgressTranslations, JsonLdPanel, JsonLdView, KbSessionStatus, type KeyboardShortcut, KeyboardShortcutsHelpModal, KnowledgeBase, LeftSidebar, type LinkComponentProps, LinkedDataPage, type LinkedDataPageProps, type LinkedDataPageTranslations, LiveRegionProvider, type MarkFlowState, type Motivation$8 as Motivation, type NavigationItem, NavigationMenu, type NavigationMenuHelper, type NavigationProps, type OAuthProvider, type OAuthUser, OAuthUserSchema, ObservableLink, type ObservableLinkProps, OpenResource, OpenResourcesManager, OpenResourcesProvider, type OverlayAnnotation, PageLayout, type PanelBrowseState, PanelHeader, PermissionDeniedModal, PopupContainer, PopupHeader, ProposeEntitiesModal, ProtectedErrorBoundary, QUERY_KEYS, RESOURCE_PANELS, RecentDocumentsPage, type RecentDocumentsPageProps, ReferenceEntry, ReferenceResolutionWidget, ReferenceWizardModal, type ReferenceWizardModalProps, ReferencesPanel, ResizeHandle, type ResolvedTheme, ResourceAnnotationsProvider, ResourceCard, type ResourceCardProps, ResourceComposePage, type ResourceComposePageProps, ResourceDiscoveryPage, type ResourceDiscoveryPageProps, ResourceErrorState, type ResourceErrorStateProps, ResourceInfoPanel, ResourceLoadingState, ResourceSearchModal, type ResourceSearchModalProps, ResourceTagsInline, ResourceViewer, ResourceViewerPage, type ResourceViewerPageProps, type RouteBuilder, type SaveResourceParams, SearchModal, type SearchModalProps, SelectedTextDisplay, type SelectionMotivation, type SelectorType, SemiontBranding, SemiontFavicon, type SemiontResource$4 as SemiontResource, SessionExpiredModal, SessionExpiryBanner, SessionTimer, SettingsPanel, type ShadowToken, type ShapeType, SignInForm, type SignInFormProps, SignUpForm, type SignUpFormProps, SimpleNavigation, type SimpleNavigationItem, type SimpleNavigationProps, SkipLinks, SortableResourceTab, type SortableResourceTabProps, type SpacingToken, StatisticsPanel, StatusDisplay, type StoredSession, type StreamStatus, SvgDrawingCanvas, TagEntry, TagSchemasPage, type TagSchemasPageProps, TaggingPanel, type TextSegment, type TextSelection, type Theme, ThemeProvider, ToastContainer, type ToastMessage, ToastProvider, type ToastType, Toolbar, type ToolbarPanelType, type TransitionToken, TranslationManager, TranslationProvider, type TranslationProviderProps, type TypographyToken, type UICreateAnnotationParams, UnifiedAnnotationsPanel, UnifiedHeader, type UseResourceContentResult, UserMenuSkeleton, WelcomePage, type WelcomePageProps, type YieldFlowState, applyHighlights, buildSourceToRenderedMap, buildTextNodeIndex, buttonStyles, clearHighlights, createHoverHandlers, cssVariables, defaultProtocol, faviconPaths, formatTime, generateCSSVariables, getKbSessionStatus, getResourceIcon, getSelectedShapeForSelectorType, getSelectorType, getShortcutDisplay, getSupportedShapes, hideWidgetPreview, isShapeSupported, jsonLightHighlightStyle, jsonLightTheme, kbBackendUrl, notifyPermissionDenied, notifySessionExpired, resolveAnnotationRanges, sanitizeImageURL, saveSelectedShapeForSelectorType, showWidgetPreview, supportsDetection, toOverlayAnnotations, tokens, useAdmin, useAnnotationManager, useAnnotations, useApiClient, useAttentionStream, useAuthApi, useAuthToken, useBeckonFlow, useBindFlow, useCacheManager, useContextGatherFlow, useDebounce, useDebouncedCallback, useDocumentAnnouncements, useDoubleKeyPress, useDropdown, useEntityTypes, useEventBus, useEventSubscription, useEventSubscriptions, useFormAnnouncements, useGlobalEvents, useHealth, useHoverDelay, useHoverEmitter, useIsTyping, useKeyboardShortcuts, useLanguageChangeAnnouncements, useLineNumbers, useLiveRegion, useLoadingState, useLocalStorage, useMarkFlow, useModeration, useObservable, useObservableExternalNavigation, useObservableRouter, useOpenResources, usePanelBrowse, usePanelWidth, usePreloadTranslations, useResourceAnnotations, useResourceContent, useResourceEvents, useResourceLoadingAnnouncements, useResources, useRovingTabIndex, useSearchAnnouncements, useSessionExpiry, useStoreTokenSync, useTheme, useToast, useTranslations, useYieldFlow };