@lincyaw/aegis-ui 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/README.md +81 -5
  2. package/dist/agent/AgentProvider.d.ts +4 -0
  3. package/dist/agent/AskOverlay.d.ts +0 -1
  4. package/dist/agent/AskPanel.d.ts +0 -1
  5. package/dist/agent/agentContext.d.ts +6 -2
  6. package/dist/agent/agentmChannelClient.d.ts +1 -0
  7. package/dist/agent/runtime.d.ts +6 -1
  8. package/dist/agent/usePrimitiveSurface.d.ts +30 -0
  9. package/dist/commands/CommandProvider.d.ts +3 -3
  10. package/dist/commands/commandContext.d.ts +2 -2
  11. package/dist/components/ui/AgentPanel.d.ts +3 -10
  12. package/dist/components/ui/AuthLayout.d.ts +1 -1
  13. package/dist/components/ui/Avatar.d.ts +6 -13
  14. package/dist/components/ui/BlastRadiusBar.d.ts +6 -13
  15. package/dist/components/ui/Breadcrumb.d.ts +1 -1
  16. package/dist/components/ui/BucketCard.d.ts +1 -1
  17. package/dist/components/ui/ChatComposer.d.ts +1 -1
  18. package/dist/components/ui/ChatMessage.d.ts +7 -14
  19. package/dist/components/ui/ChatMessageList.d.ts +3 -10
  20. package/dist/components/ui/ChatSessionList.d.ts +0 -1
  21. package/dist/components/ui/Chip.d.ts +3 -10
  22. package/dist/components/ui/CodeBlock.d.ts +8 -14
  23. package/dist/components/ui/CodeEditor.d.ts +6 -13
  24. package/dist/components/ui/CommandInvocationCard.d.ts +7 -14
  25. package/dist/components/ui/CommandPalette.d.ts +0 -1
  26. package/dist/components/ui/ContentInspectorContent.d.ts +14 -0
  27. package/dist/components/ui/ContentInspectorDialog.d.ts +15 -0
  28. package/dist/components/ui/ControlListItem.d.ts +1 -1
  29. package/dist/components/ui/DangerZone.d.ts +1 -1
  30. package/dist/components/ui/DataList.d.ts +3 -11
  31. package/dist/components/ui/DataTable.d.ts +27 -11
  32. package/dist/components/ui/DiffViewer.d.ts +6 -13
  33. package/dist/components/ui/DropdownMenu.d.ts +6 -2
  34. package/dist/components/ui/EmptyState.d.ts +1 -1
  35. package/dist/components/ui/EnvironmentSwitcher.d.ts +0 -1
  36. package/dist/components/ui/ErrorState.d.ts +8 -2
  37. package/dist/components/ui/EventTable.d.ts +0 -1
  38. package/dist/components/ui/FileDropzone.d.ts +1 -1
  39. package/dist/components/ui/FilePreview.d.ts +8 -15
  40. package/dist/components/ui/FolderDropzone.d.ts +0 -1
  41. package/dist/components/ui/ForgotPasswordForm.d.ts +1 -1
  42. package/dist/components/ui/FormRow.d.ts +1 -1
  43. package/dist/components/ui/InboxPage.d.ts +3 -10
  44. package/dist/components/ui/KeyValueList.d.ts +3 -10
  45. package/dist/components/ui/LoginForm.d.ts +1 -1
  46. package/dist/components/ui/Markdown.d.ts +9 -3
  47. package/dist/components/ui/MetadataList.d.ts +0 -1
  48. package/dist/components/ui/MetricCard.d.ts +7 -14
  49. package/dist/components/ui/MetricLabel.d.ts +1 -1
  50. package/dist/components/ui/MonoValue.d.ts +3 -10
  51. package/dist/components/ui/NotificationBell.d.ts +1 -1
  52. package/dist/components/ui/ObjectBrowser.d.ts +1 -1
  53. package/dist/components/ui/ObjectInspector.d.ts +0 -1
  54. package/dist/components/ui/PageHeader.d.ts +1 -1
  55. package/dist/components/ui/PageSizeSelect.d.ts +8 -2
  56. package/dist/components/ui/Panel.d.ts +3 -10
  57. package/dist/components/ui/PanelTitle.d.ts +1 -1
  58. package/dist/components/ui/ParquetViewer.d.ts +8 -15
  59. package/dist/components/ui/PasswordField.d.ts +1 -1
  60. package/dist/components/ui/ProjectSelector.d.ts +8 -2
  61. package/dist/components/ui/QueryAutocomplete.d.ts +0 -1
  62. package/dist/components/ui/RegisterForm.d.ts +1 -1
  63. package/dist/components/ui/ResizableSidePanel.d.ts +17 -2
  64. package/dist/components/ui/SavedQueryBar.d.ts +0 -1
  65. package/dist/components/ui/SearchInput.d.ts +0 -1
  66. package/dist/components/ui/SectionDivider.d.ts +1 -1
  67. package/dist/components/ui/SessionRunView.d.ts +50 -0
  68. package/dist/components/ui/SettingsSection.d.ts +1 -1
  69. package/dist/components/ui/ShareLinkDialog.d.ts +1 -1
  70. package/dist/components/ui/SparkLine.d.ts +3 -10
  71. package/dist/components/ui/StatBlock.d.ts +7 -14
  72. package/dist/components/ui/StatusDot.d.ts +1 -1
  73. package/dist/components/ui/Tabs.d.ts +1 -1
  74. package/dist/components/ui/Terminal.d.ts +3 -10
  75. package/dist/components/ui/TextField.d.ts +1 -1
  76. package/dist/components/ui/TimeDisplay.d.ts +3 -3
  77. package/dist/components/ui/TimeRangePicker.d.ts +0 -1
  78. package/dist/components/ui/Timeline.d.ts +3 -10
  79. package/dist/components/ui/ToolCallCard.d.ts +3 -10
  80. package/dist/components/ui/Toolbar.d.ts +0 -1
  81. package/dist/components/ui/TraceSpanInspector.d.ts +12 -0
  82. package/dist/components/ui/TraceTree.d.ts +9 -11
  83. package/dist/components/ui/TrajectoryStep.d.ts +3 -10
  84. package/dist/components/ui/TrajectoryTimeline.d.ts +2 -10
  85. package/dist/components/ui/UploadQueue.d.ts +1 -1
  86. package/dist/components/ui/index.d.ts +10 -1
  87. package/dist/components/ui/relativeTime.d.ts +1 -1
  88. package/dist/components/ui/traceFormat.d.ts +5 -0
  89. package/dist/hooks/useCopyToClipboard.d.ts +8 -0
  90. package/dist/hooks/useMenuPopover.d.ts +27 -0
  91. package/dist/hooks/useResizable.d.ts +9 -0
  92. package/dist/index.cjs +12 -1
  93. package/dist/index.cjs.map +1 -1
  94. package/dist/index.d.ts +4 -3
  95. package/dist/index.js +9848 -124
  96. package/dist/index.js.map +1 -1
  97. package/dist/layouts/shell/AegisShell.d.ts +1 -1
  98. package/dist/layouts/shell/AuthRequiredCard.d.ts +2 -2
  99. package/dist/layouts/shell/TopHeader.d.ts +5 -1
  100. package/dist/layouts/shell/paths.d.ts +8 -0
  101. package/dist/layouts/shell/types.d.ts +21 -13
  102. package/dist/lib/format.d.ts +2 -0
  103. package/dist/lib/id.d.ts +2 -0
  104. package/dist/lib/storage.d.ts +12 -0
  105. package/dist/style.css +1 -1
  106. package/dist/theme/antdTheme.d.ts +2 -3
  107. package/package.json +24 -17
  108. package/dist/index-6WZzHI2Z.cjs +0 -1151
  109. package/dist/index-6WZzHI2Z.cjs.map +0 -1
  110. package/dist/index-CZ_qegBG.js +0 -6736
  111. package/dist/index-CZ_qegBG.js.map +0 -1
  112. package/dist/index-DLXAAlfH.cjs +0 -15
  113. package/dist/index-DLXAAlfH.cjs.map +0 -1
  114. package/dist/index-DtgBxtmy.js +0 -56284
  115. package/dist/index-DtgBxtmy.js.map +0 -1
  116. package/dist/styles/fonts.d.ts +0 -0
  117. package/dist/workerBundle-D52AeOj1.js +0 -76
  118. package/dist/workerBundle-D52AeOj1.js.map +0 -1
  119. package/dist/workerBundle-FGNDqtbW.cjs +0 -73
  120. package/dist/workerBundle-FGNDqtbW.cjs.map +0 -1
package/README.md CHANGED
@@ -1,9 +1,12 @@
1
1
  # @lincyaw/aegis-ui
2
2
 
3
- AegisLab shared design system: tokens, primitives, layout, AntD theme.
3
+ Design system and multi-app shell for AegisLab front ends: design tokens,
4
+ presentational React components, `PageWrapper`, the router-aware
5
+ `AegisShell`, and an Ant Design theme that follows the same tokens.
4
6
 
5
- See the [repository root README](../../README.md) for project documentation,
6
- conventions, and the AegisApp contract.
7
+ The package contains no API clients, business state or pages. Applications
8
+ provide their own data and plug into the shell through the `AegisApp`
9
+ contract.
7
10
 
8
11
  ## Install
9
12
 
@@ -11,7 +14,80 @@ conventions, and the AegisApp contract.
11
14
  pnpm add @lincyaw/aegis-ui
12
15
  ```
13
16
 
14
- ```ts
15
- import { PageWrapper, Panel } from '@lincyaw/aegis-ui';
17
+ Peer dependencies: `react` 18, `react-dom` 18, `react-router-dom` 6,
18
+ `antd` 5.25 or later, `@ant-design/icons` 5.
19
+
20
+ Fonts are not bundled. Install `@fontsource-variable/geist`,
21
+ `@fontsource-variable/inter` and `@fontsource-variable/jetbrains-mono`, and
22
+ import all three once in the app entry.
23
+
24
+ ## Usage
25
+
26
+ ```tsx
27
+ import {
28
+ type AegisApp,
29
+ AegisShell,
30
+ ThemeProvider,
31
+ getAegisTheme,
32
+ useTheme,
33
+ } from '@lincyaw/aegis-ui';
16
34
  import '@lincyaw/aegis-ui/style.css';
35
+ import { ConfigProvider } from 'antd';
36
+ import { BrowserRouter } from 'react-router-dom';
37
+
38
+ const containersApp: AegisApp = {
39
+ id: 'containers',
40
+ label: 'Containers',
41
+ icon: <HddOutlined />,
42
+ basePath: '/containers',
43
+ sidebar: [{ items: [{ to: '', label: 'List', end: true }] }],
44
+ routes: [{ path: '', element: <ContainerList /> }],
45
+ };
46
+
47
+ function Root() {
48
+ const { resolved } = useTheme();
49
+ return (
50
+ <ConfigProvider theme={getAegisTheme(resolved)}>
51
+ <BrowserRouter>
52
+ <AegisShell
53
+ brand={{ name: 'AegisLab', href: '/' }}
54
+ apps={[containersApp]}
55
+ fallbackPath="/containers"
56
+ />
57
+ </BrowserRouter>
58
+ </ConfigProvider>
59
+ );
60
+ }
61
+
62
+ export function App() {
63
+ return (
64
+ <ThemeProvider>
65
+ <Root />
66
+ </ThemeProvider>
67
+ );
68
+ }
17
69
  ```
70
+
71
+ The shell wraps each route in `PageWrapper`, so pages render content only:
72
+
73
+ ```tsx
74
+ import { DataTable, PageHeader, Panel } from '@lincyaw/aegis-ui';
75
+
76
+ export function ContainerList() {
77
+ return (
78
+ <>
79
+ <PageHeader title="Containers" />
80
+ <Panel>
81
+ <DataTable columns={columns} data={rows} rowKey={(row) => row.id} />
82
+ </Panel>
83
+ </>
84
+ );
85
+ }
86
+ ```
87
+
88
+ ## Documentation
89
+
90
+ The [repository README](https://github.com/Lincyaw/aegis-ui#readme) covers the
91
+ full contents of the package, the development workflow and the release
92
+ process. The [component gallery](https://profile.aoyangfang.top/aegis-ui/)
93
+ shows every component with its variants, in light and dark themes.
@@ -8,6 +8,10 @@ interface AgentProviderProps {
8
8
  * Thin context wrapper. The library deliberately holds no agent state —
9
9
  * the host owns the LLM round-trip, tool-call dispatch, and message
10
10
  * history, and feeds the resulting value in.
11
+ *
12
+ * The one piece of UI state it can hold is `panelOpen`: when the host
13
+ * leaves it undefined, the provider keeps it (starting closed) and still
14
+ * forwards changes to the host's `setPanelOpen`, if any.
11
15
  */
12
16
  export declare function AgentProvider({ value, children, }: AgentProviderProps): ReactElement;
13
17
  export {};
@@ -1,3 +1,2 @@
1
1
  import { ReactElement } from 'react';
2
2
  export declare function AskOverlay(): ReactElement | null;
3
- export default AskOverlay;
@@ -16,4 +16,3 @@ export interface AskPanelProps {
16
16
  popover?: boolean;
17
17
  }
18
18
  export declare function AskPanel({ context, tools, anchorRect, anchorPoint, onClose, popover, }: AskPanelProps): ReactElement;
19
- export default AskPanel;
@@ -43,9 +43,13 @@ export interface AgentContextValue {
43
43
  send: (content: string) => Promise<void> | void;
44
44
  /** Optional: clear the current thread. */
45
45
  clear?: () => void;
46
- /** Optional: panel open/closed (panel controls). Persisted by host. */
46
+ /**
47
+ * Optional: whether AegisShell's `agentPanel` is shown. Pass it with
48
+ * `setPanelOpen` to own the state; leave it undefined and
49
+ * <AgentProvider/> keeps it instead.
50
+ */
47
51
  panelOpen?: boolean;
48
- /** Optional: toggle panel. */
52
+ /** Optional: open or close the agent panel (AegisShell's header toggle). */
49
53
  setPanelOpen?: (open: boolean) => void;
50
54
  }
51
55
  export declare const defaultAgentContextValue: AgentContextValue;
@@ -30,6 +30,7 @@ export interface AgentmChannelClientOptions {
30
30
  /** If false, do not auto-reconnect after close. Default true. */
31
31
  autoReconnect?: boolean;
32
32
  }
33
+ export declare const RECONNECT_BACKOFF_MS: number[];
33
34
  export type Listener<T> = (value: T) => void;
34
35
  interface ConnectResult {
35
36
  welcome: Envelope;
@@ -1,4 +1,4 @@
1
- import { ActionSource, AegisAction, AegisActionDescriptor, AegisEvent, AegisInspectResult, AegisRef, AegisSearchResult, AegisSnapshot, AskContext, AskRequest, DispatchResult, EntityRef, InvocationSource, McpToolDefinition, SearchProvider, ShellSnapshot, SurfaceKind, SurfaceSnapshot } from './types';
1
+ import { ActionSource, AegisAction, AegisActionDescriptor, AegisEvent, AegisInspectResult, AegisRef, AegisSearchResult, AegisSnapshot, AskContext, AskRequest, DispatchResult, EntityProjection, EntityRef, InvocationSource, McpToolDefinition, SearchProvider, ShellSnapshot, SurfaceKind, SurfaceSnapshot } from './types';
2
2
  export interface RegisteredAction {
3
3
  action: AegisAction<unknown, unknown>;
4
4
  source: ActionSource;
@@ -62,4 +62,9 @@ export interface RuntimeDeps {
62
62
  navigate?: (to: string) => void;
63
63
  toast?: (msg: string, level?: 'info' | 'warn' | 'error') => void;
64
64
  }
65
+ export declare function defaultShellSnapshot(currentAppId?: string | null): ShellSnapshot;
66
+ export declare function findSurfaceContaining(surfaces: SurfaceSnapshot[], entityId: string): {
67
+ surface: SurfaceSnapshot;
68
+ entity: EntityProjection;
69
+ } | null;
65
70
  export declare function createAegisRuntime(deps?: RuntimeDeps): AegisRuntime;
@@ -0,0 +1,30 @@
1
+ import { RefObject } from 'react';
2
+ import { SurfaceKind, SurfaceSnapshot } from './types';
3
+ type SurfaceProjection = Pick<SurfaceSnapshot, 'entities' | 'fields'>;
4
+ interface PrimitiveSurfaceBase {
5
+ id: string;
6
+ kind?: SurfaceKind;
7
+ label?: string;
8
+ askSuggestions?: string[];
9
+ /** When false, AskOverlay skips this surface (per docs §7.1). */
10
+ ask?: boolean;
11
+ }
12
+ /** `surface` prop shape for primitives that project their own data. */
13
+ export interface PrimitiveSurface<T> extends PrimitiveSurfaceBase {
14
+ project: (data: T) => SurfaceProjection;
15
+ }
16
+ /** `surface` prop shape for containers (Panel, AgentPanel) with no data. */
17
+ export interface ContainerSurface extends PrimitiveSurfaceBase {
18
+ project?: () => SurfaceProjection;
19
+ }
20
+ export interface PrimitiveSurfaceAttrs {
21
+ 'data-agent-surface-id': string | undefined;
22
+ 'data-agent-ask': 'off' | undefined;
23
+ }
24
+ /**
25
+ * Registers a primitive's optional `surface` prop with the agent runtime
26
+ * and returns the `data-agent-*` attributes for its root element. A no-op
27
+ * registration when `surface` is undefined.
28
+ */
29
+ export declare function usePrimitiveSurface<T>(surface: PrimitiveSurface<T> | ContainerSurface | undefined, data: T, defaultKind: SurfaceKind, ref: RefObject<HTMLElement | null>): PrimitiveSurfaceAttrs;
30
+ export {};
@@ -4,9 +4,9 @@ interface CommandProviderProps {
4
4
  }
5
5
  /**
6
6
  * Owns the command registry, the palette open-state, and the global
7
- * `mod+k` opener. Apps inside register commands via
8
- * `useRegisterCommands`; AegisShell flips the active scope as the user
9
- * navigates between sub-apps.
7
+ * `mod+k` opener. Components register commands via
8
+ * `useRegisterCommands`; AegisShell registers each `AegisApp.commands`
9
+ * and flips the active scope as the user navigates between sub-apps.
10
10
  */
11
11
  export declare function CommandProvider({ children, }: CommandProviderProps): ReactElement;
12
12
  export {};
@@ -28,9 +28,9 @@ export interface Command<TArgs = unknown> {
28
28
  schema?: Record<string, unknown>;
29
29
  /** The actual side-effect. */
30
30
  handler: (args?: TArgs) => void | Promise<void>;
31
- /** Optional undo callback — UI will surface an Undo affordance. */
31
+ /** Optional undo callback for hosts that offer Undo; CommandPalette never calls it. */
32
32
  undo?: () => void | Promise<void>;
33
- /** Optional aegis-ui agent action — fired alongside handler from the palette. */
33
+ /** Optional aegis-ui agent action, registered while the palette row is rendered. */
34
34
  action?: AegisAction<void, unknown>;
35
35
  }
36
36
  /**
@@ -1,13 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
- import { SurfaceKind, SurfaceSnapshot } from '../../agent/types';
3
- export interface AgentPanelSurface {
4
- id: string;
5
- kind?: SurfaceKind;
6
- label?: string;
7
- project?: () => Pick<SurfaceSnapshot, 'entities' | 'fields'>;
8
- askSuggestions?: string[];
9
- ask?: boolean;
10
- }
2
+ import { ContainerSurface } from '../../agent/usePrimitiveSurface';
3
+ export type AgentPanelSurface = ContainerSurface;
11
4
  interface AgentPanelProps {
12
5
  title?: ReactNode;
13
6
  /** Header right-side slot (e.g. close button). */
@@ -20,4 +13,4 @@ interface AgentPanelProps {
20
13
  surface?: AgentPanelSurface;
21
14
  }
22
15
  export declare function AgentPanel({ title, headerActions, children, footer, className, surface, }: AgentPanelProps): import("react/jsx-runtime").JSX.Element;
23
- export default AgentPanel;
16
+ export {};
@@ -8,4 +8,4 @@ interface AuthLayoutProps {
8
8
  className?: string;
9
9
  }
10
10
  export declare function AuthLayout({ brand, title, description, children, footer, className, }: AuthLayoutProps): import("react/jsx-runtime").JSX.Element;
11
- export default AuthLayout;
11
+ export {};
@@ -1,18 +1,11 @@
1
1
  import { ReactNode } from 'react';
2
- import { SurfaceKind, SurfaceSnapshot } from '../../agent/types';
2
+ import { PrimitiveSurface } from '../../agent/usePrimitiveSurface';
3
3
  type AvatarSize = 'sm' | 'md' | 'lg';
4
4
  type AvatarStatus = 'online' | 'offline' | 'busy' | 'away';
5
- export interface AvatarSurface {
6
- id: string;
7
- kind?: SurfaceKind;
8
- label?: string;
9
- project: (data: {
10
- name: string;
11
- status?: AvatarStatus;
12
- }) => Pick<SurfaceSnapshot, 'entities' | 'fields'>;
13
- askSuggestions?: string[];
14
- ask?: boolean;
15
- }
5
+ export type AvatarSurface = PrimitiveSurface<{
6
+ name: string;
7
+ status?: AvatarStatus;
8
+ }>;
16
9
  interface AvatarProps {
17
10
  name: string;
18
11
  src?: string;
@@ -23,4 +16,4 @@ interface AvatarProps {
23
16
  surface?: AvatarSurface;
24
17
  }
25
18
  export declare function Avatar({ name, src, size, status, icon, className, surface, }: AvatarProps): import("react/jsx-runtime").JSX.Element;
26
- export default Avatar;
19
+ export {};
@@ -1,15 +1,8 @@
1
- import { SurfaceKind, SurfaceSnapshot } from '../../agent/types';
2
- export interface BlastRadiusBarSurface {
3
- id: string;
4
- kind?: SurfaceKind;
5
- label?: string;
6
- project: (data: {
7
- value: number;
8
- centerLabel?: string;
9
- }) => Pick<SurfaceSnapshot, 'entities' | 'fields'>;
10
- askSuggestions?: string[];
11
- ask?: boolean;
12
- }
1
+ import { PrimitiveSurface } from '../../agent/usePrimitiveSurface';
2
+ export type BlastRadiusBarSurface = PrimitiveSurface<{
3
+ value: number;
4
+ centerLabel?: string;
5
+ }>;
13
6
  interface BlastRadiusBarProps {
14
7
  /** 0 – 100 */
15
8
  value: number;
@@ -21,4 +14,4 @@ interface BlastRadiusBarProps {
21
14
  surface?: BlastRadiusBarSurface;
22
15
  }
23
16
  export declare function BlastRadiusBar({ value, centerLabel, hideTicks, className, surface, }: BlastRadiusBarProps): import("react/jsx-runtime").JSX.Element;
24
- export default BlastRadiusBar;
17
+ export {};
@@ -26,4 +26,4 @@ interface BreadcrumbProps {
26
26
  linkComponent?: BreadcrumbLinkComponent;
27
27
  }
28
28
  export declare function Breadcrumb({ items, className, linkComponent, }: BreadcrumbProps): ReactElement;
29
- export default Breadcrumb;
29
+ export {};
@@ -21,4 +21,4 @@ interface BucketCardProps {
21
21
  className?: string;
22
22
  }
23
23
  export declare function BucketCard({ name, driver, maxObjectBytes, retentionDays, publicRead, objectCount, totalBytes, quickActions, onClick, className, }: BucketCardProps): import("react/jsx-runtime").JSX.Element;
24
- export default BucketCard;
24
+ export {};
@@ -7,4 +7,4 @@ interface ChatComposerProps {
7
7
  className?: string;
8
8
  }
9
9
  export declare function ChatComposer({ onSend, sending, placeholder, disabledReason, className, }: ChatComposerProps): import("react/jsx-runtime").JSX.Element;
10
- export default ChatComposer;
10
+ export {};
@@ -1,18 +1,11 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { AgentMessageRole } from '../../agent/agentContext';
3
- import { SurfaceKind, SurfaceSnapshot } from '../../agent/types';
4
- export interface ChatMessageSurface {
5
- id: string;
6
- kind?: SurfaceKind;
7
- label?: string;
8
- project: (data: {
9
- role: AgentMessageRole;
10
- content: ReactNode;
11
- timestamp?: string;
12
- }) => Pick<SurfaceSnapshot, 'entities' | 'fields'>;
13
- askSuggestions?: string[];
14
- ask?: boolean;
15
- }
3
+ import { PrimitiveSurface } from '../../agent/usePrimitiveSurface';
4
+ export type ChatMessageSurface = PrimitiveSurface<{
5
+ role: AgentMessageRole;
6
+ content: ReactNode;
7
+ timestamp?: string;
8
+ }>;
16
9
  interface ChatMessageProps {
17
10
  role: AgentMessageRole;
18
11
  content: ReactNode;
@@ -28,4 +21,4 @@ interface ChatMessageProps {
28
21
  surface?: ChatMessageSurface;
29
22
  }
30
23
  export declare function ChatMessage({ role, content, timestamp, avatar, senderName, footer, className, surface, }: ChatMessageProps): import("react/jsx-runtime").JSX.Element;
31
- export default ChatMessage;
24
+ export {};
@@ -1,13 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
- import { SurfaceKind, SurfaceSnapshot } from '../../agent/types';
3
- export interface ChatMessageListSurface {
4
- id: string;
5
- kind?: SurfaceKind;
6
- label?: string;
7
- project: (count: number) => Pick<SurfaceSnapshot, 'entities' | 'fields'>;
8
- askSuggestions?: string[];
9
- ask?: boolean;
10
- }
2
+ import { PrimitiveSurface } from '../../agent/usePrimitiveSurface';
3
+ export type ChatMessageListSurface = PrimitiveSurface<number>;
11
4
  interface ChatMessageListProps {
12
5
  children: ReactNode;
13
6
  /** Auto-scroll to bottom on children change. Default: true. */
@@ -20,4 +13,4 @@ interface ChatMessageListProps {
20
13
  surface?: ChatMessageListSurface;
21
14
  }
22
15
  export declare function ChatMessageList({ children, autoScroll, header, footer, className, surface, }: ChatMessageListProps): import("react/jsx-runtime").JSX.Element;
23
- export default ChatMessageList;
16
+ export {};
@@ -19,4 +19,3 @@ export interface ChatSessionListProps {
19
19
  className?: string;
20
20
  }
21
21
  export declare function ChatSessionList({ items, onSelect, onRename, onDelete, density, emptyState, className, }: ChatSessionListProps): ReactElement;
22
- export default ChatSessionList;
@@ -1,13 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
- import { SurfaceKind, SurfaceSnapshot } from '../../agent/types';
3
- export interface ChipSurface {
4
- id: string;
5
- kind?: SurfaceKind;
6
- label?: string;
7
- project: (children: ReactNode) => Pick<SurfaceSnapshot, 'entities' | 'fields'>;
8
- askSuggestions?: string[];
9
- ask?: boolean;
10
- }
2
+ import { PrimitiveSurface } from '../../agent/usePrimitiveSurface';
3
+ export type ChipSurface = PrimitiveSurface<ReactNode>;
11
4
  interface ChipProps {
12
5
  children: ReactNode;
13
6
  /** Visual treatment. */
@@ -19,4 +12,4 @@ interface ChipProps {
19
12
  surface?: ChipSurface;
20
13
  }
21
14
  export declare function Chip({ children, tone, leading, className, onClick, surface, }: ChipProps): import("react/jsx-runtime").JSX.Element;
22
- export default Chip;
15
+ export {};
@@ -1,21 +1,15 @@
1
- import { SurfaceKind, SurfaceSnapshot } from '../../agent/types';
2
- export interface CodeBlockSurface {
3
- id: string;
4
- kind?: SurfaceKind;
5
- label?: string;
6
- project: (data: {
7
- code: string;
8
- language: string;
9
- }) => Pick<SurfaceSnapshot, 'entities' | 'fields'>;
10
- askSuggestions?: string[];
11
- ask?: boolean;
12
- }
1
+ import { PrimitiveSurface } from '../../agent/usePrimitiveSurface';
2
+ export type CodeBlockSurface = PrimitiveSurface<{
3
+ code: string;
4
+ language: string;
5
+ }>;
13
6
  interface CodeBlockProps {
14
7
  code: string;
15
- language?: 'json' | 'yaml' | 'sql' | 'bash' | 'text';
8
+ /** Shown as the header label, e.g. `json`, `typescript`, `python`. */
9
+ language?: string;
16
10
  showLineNumbers?: boolean;
17
11
  className?: string;
18
12
  surface?: CodeBlockSurface;
19
13
  }
20
14
  export declare function CodeBlock({ code, language, showLineNumbers, className, surface, }: CodeBlockProps): import("react/jsx-runtime").JSX.Element;
21
- export default CodeBlock;
15
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties } from 'react';
2
- import { SurfaceKind, SurfaceSnapshot } from '../../agent/types';
2
+ import { PrimitiveSurface } from '../../agent/usePrimitiveSurface';
3
3
  export type CodeEditorLanguage = 'json' | 'yaml' | 'sql' | 'text';
4
4
  /** Schema hint for SQL autocompletion. */
5
5
  export interface CodeEditorField {
@@ -7,17 +7,10 @@ export interface CodeEditorField {
7
7
  /** Optional ClickHouse type ('UInt64', 'Map(String,String)', …) shown alongside the suggestion. */
8
8
  type?: string;
9
9
  }
10
- export interface CodeEditorSurface {
11
- id: string;
12
- kind?: SurfaceKind;
13
- label?: string;
14
- project: (data: {
15
- value: string;
16
- language: CodeEditorLanguage;
17
- }) => Pick<SurfaceSnapshot, 'entities' | 'fields'>;
18
- askSuggestions?: string[];
19
- ask?: boolean;
20
- }
10
+ export type CodeEditorSurface = PrimitiveSurface<{
11
+ value: string;
12
+ language: CodeEditorLanguage;
13
+ }>;
21
14
  interface CodeEditorProps {
22
15
  value: string;
23
16
  onChange?: (value: string) => void;
@@ -39,4 +32,4 @@ interface CodeEditorProps {
39
32
  onSubmit?: (value: string) => void;
40
33
  }
41
34
  export declare function CodeEditor({ value, onChange, language, readOnly, theme, placeholder, height, className, style, surface, fields, tables, onSubmit, }: CodeEditorProps): import("react/jsx-runtime").JSX.Element;
42
- export default CodeEditor;
35
+ export {};
@@ -1,16 +1,9 @@
1
- import { SurfaceKind, SurfaceSnapshot } from '../../agent/types';
2
- export interface CommandInvocationCardSurface {
3
- id: string;
4
- kind?: SurfaceKind;
5
- label?: string;
6
- project: (data: {
7
- commandId: string;
8
- args?: unknown;
9
- status: 'pending' | 'success' | 'error';
10
- }) => Pick<SurfaceSnapshot, 'entities' | 'fields'>;
11
- askSuggestions?: string[];
12
- ask?: boolean;
13
- }
1
+ import { PrimitiveSurface } from '../../agent/usePrimitiveSurface';
2
+ export type CommandInvocationCardSurface = PrimitiveSurface<{
3
+ commandId: string;
4
+ args?: unknown;
5
+ status: 'pending' | 'success' | 'error';
6
+ }>;
14
7
  interface CommandInvocationCardProps {
15
8
  commandId: string;
16
9
  args?: unknown;
@@ -21,4 +14,4 @@ interface CommandInvocationCardProps {
21
14
  surface?: CommandInvocationCardSurface;
22
15
  }
23
16
  export declare function CommandInvocationCard({ commandId, args, status, error, onUndo, className, surface, }: CommandInvocationCardProps): import("react/jsx-runtime").JSX.Element;
24
- export default CommandInvocationCard;
17
+ export {};
@@ -1,3 +1,2 @@
1
1
  import { ReactElement } from 'react';
2
2
  export declare function CommandPalette(): ReactElement | null;
3
- export default CommandPalette;
@@ -0,0 +1,14 @@
1
+ export type InspectableContentKind = 'json' | 'markdown' | 'sql' | 'text';
2
+ export interface InspectableContent {
3
+ title: string;
4
+ value: unknown;
5
+ kind?: InspectableContentKind;
6
+ }
7
+ export interface PreparedInspectableContent {
8
+ kind: InspectableContentKind;
9
+ text: string;
10
+ rawText: string;
11
+ value: unknown;
12
+ }
13
+ export declare function normalizeInspectableText(text: string): string;
14
+ export declare function prepareInspectableContent(content: InspectableContent): PreparedInspectableContent;
@@ -0,0 +1,15 @@
1
+ import { ReactElement } from 'react';
2
+ import { InspectableContent } from './ContentInspectorContent';
3
+ export interface ContentPreviewProps {
4
+ content: InspectableContent;
5
+ className?: string;
6
+ expanded?: boolean;
7
+ }
8
+ export interface ContentInspectorDialogProps {
9
+ open: boolean;
10
+ content: InspectableContent | null;
11
+ onClose: () => void;
12
+ width?: number | string;
13
+ }
14
+ export declare function ContentPreview({ content, className, expanded, }: ContentPreviewProps): ReactElement;
15
+ export declare function ContentInspectorDialog({ open, content, onClose, width, }: ContentInspectorDialogProps): ReactElement | null;
@@ -15,4 +15,4 @@ interface ControlListItemProps {
15
15
  style?: CSSProperties;
16
16
  }
17
17
  export declare function ControlListItem({ left, right, active, onClick, action, className, style, }: ControlListItemProps): import("react/jsx-runtime").JSX.Element;
18
- export default ControlListItem;
18
+ export {};
@@ -6,4 +6,4 @@ interface DangerZoneProps {
6
6
  className?: string;
7
7
  }
8
8
  export declare function DangerZone({ title, description, children, className, }: DangerZoneProps): import("react/jsx-runtime").JSX.Element;
9
- export default DangerZone;
9
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { SurfaceKind, SurfaceSnapshot } from '../../agent/types';
2
+ import { PrimitiveSurface } from '../../agent/usePrimitiveSurface';
3
3
  export interface DataListColumn<T> {
4
4
  key: string;
5
5
  label: ReactNode;
@@ -8,15 +8,7 @@ export interface DataListColumn<T> {
8
8
  export interface DataListItem {
9
9
  id: string;
10
10
  }
11
- export interface DataListSurface<T> {
12
- id: string;
13
- kind?: SurfaceKind;
14
- label?: string;
15
- project: (rows: T[]) => Pick<SurfaceSnapshot, 'entities' | 'fields'>;
16
- askSuggestions?: string[];
17
- /** When false, AskOverlay skips this surface (per docs §7.1). */
18
- ask?: boolean;
19
- }
11
+ export type DataListSurface<T> = PrimitiveSurface<T[]>;
20
12
  interface DataListProps<T extends DataListItem> {
21
13
  items: T[];
22
14
  columns: Array<DataListColumn<T>>;
@@ -27,4 +19,4 @@ interface DataListProps<T extends DataListItem> {
27
19
  className?: string;
28
20
  }
29
21
  export declare function DataList<T extends DataListItem>({ items, columns, selectedId, onSelect, surface, emptyText, className, }: DataListProps<T>): import("react/jsx-runtime").JSX.Element;
30
- export default DataList;
22
+ export {};
@@ -1,13 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
- import { SurfaceKind, SurfaceSnapshot } from '../../agent/types';
3
- export interface DataTableSurface<T> {
4
- id: string;
5
- kind?: SurfaceKind;
6
- label?: string;
7
- project: (rows: T[]) => Pick<SurfaceSnapshot, 'entities' | 'fields'>;
8
- askSuggestions?: string[];
9
- ask?: boolean;
10
- }
2
+ import { PrimitiveSurface } from '../../agent/usePrimitiveSurface';
3
+ export type DataTableSurface<T> = PrimitiveSurface<T[]>;
11
4
  export interface DataTableColumn<T> {
12
5
  key: string;
13
6
  header: ReactNode;
@@ -26,8 +19,29 @@ export interface DataTableColumn<T> {
26
19
  truncate?: boolean;
27
20
  /** Allow dragging the right edge of this column to resize. Default false. */
28
21
  resizable?: boolean;
22
+ /**
23
+ * `'actions'` lays the cell out as a right-aligned, gapped, wrapping row of
24
+ * controls — return them straight from `render`. Overrides `align` and
25
+ * `truncate`.
26
+ */
27
+ kind?: 'actions';
29
28
  render: (row: T, index: number) => ReactNode;
30
29
  }
30
+ /** Server-side pagination: `data` is the current page, never sliced here. */
31
+ export interface DataTablePagination {
32
+ /** 1-based. */
33
+ page: number;
34
+ pageSize: number;
35
+ /**
36
+ * Rows across all pages. Omit when the backend doesn't count them: the
37
+ * range label drops "of N" and Next stays enabled while the page is full.
38
+ */
39
+ total?: number;
40
+ /** Changing the page size always resets to page 1. */
41
+ onChange: (page: number, pageSize: number) => void;
42
+ /** Renders a "Rows per page" select offering these sizes. */
43
+ pageSizeOptions?: number[];
44
+ }
31
45
  interface DataTableProps<T> {
32
46
  columns: Array<DataTableColumn<T>>;
33
47
  data: T[];
@@ -42,7 +56,9 @@ interface DataTableProps<T> {
42
56
  * `aegis-data-table:<persistKey>`. Use a stable key per table.
43
57
  */
44
58
  persistKey?: string;
59
+ /** Renders a footer with page navigation under the table. */
60
+ pagination?: DataTablePagination;
45
61
  surface?: DataTableSurface<T>;
46
62
  }
47
- export declare function DataTable<T>({ columns, data, rowKey, loading, emptyTitle, emptyDescription, emptyAction, className, persistKey, surface, }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
48
- export default DataTable;
63
+ export declare function DataTable<T>({ columns, data, rowKey, loading, emptyTitle, emptyDescription, emptyAction, className, persistKey, pagination, surface, }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
64
+ export {};