@elevasis/ui 2.21.0 → 2.23.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 (81) hide show
  1. package/dist/app/index.js +2 -2
  2. package/dist/{chunk-DMYELNGA.js → chunk-3HEUGBOT.js} +1 -1
  3. package/dist/{chunk-EGKNRM6P.js → chunk-7PGEGSUM.js} +2 -2
  4. package/dist/{chunk-KVW56ERD.js → chunk-AXXTN44Z.js} +5 -3
  5. package/dist/{chunk-I5WRKH25.js → chunk-D3KQAABP.js} +1 -1
  6. package/dist/{chunk-S7RL77QS.js → chunk-DDZOHLHB.js} +1 -1
  7. package/dist/{chunk-EDX6WIN3.js → chunk-EPV7NU2E.js} +24 -10
  8. package/dist/{chunk-ATEHYDL3.js → chunk-FXWETLEB.js} +6 -2
  9. package/dist/{chunk-7GG6OSD7.js → chunk-GUJUK6EH.js} +2830 -2381
  10. package/dist/{chunk-GBMNCNHX.js → chunk-KVJ3LFH2.js} +3 -1
  11. package/dist/{chunk-VQESMHQV.js → chunk-LJWV4TWV.js} +1 -2
  12. package/dist/{chunk-BJWIKEQG.js → chunk-N6WLOWOD.js} +6 -14
  13. package/dist/{chunk-XLZZOFGM.js → chunk-PTUOINQ2.js} +275 -76
  14. package/dist/{chunk-CZK67OHH.js → chunk-PXGSJNBH.js} +3 -3
  15. package/dist/{chunk-TIIPYB2Z.js → chunk-QZJM3RYI.js} +1 -1
  16. package/dist/{chunk-7YQKVWSD.js → chunk-SQ5JGELM.js} +25 -5
  17. package/dist/{chunk-RX4UWZZR.js → chunk-TKAYX2SP.js} +8 -3
  18. package/dist/{chunk-Q5HC6ENG.js → chunk-XOTJNW4Q.js} +1 -1
  19. package/dist/{chunk-LQU62KHD.js → chunk-YU6MBDVO.js} +1993 -870
  20. package/dist/{chunk-ULZ2B3NC.js → chunk-ZBCTB5CA.js} +1 -1
  21. package/dist/components/index.css +85 -85
  22. package/dist/components/index.d.ts +1651 -1388
  23. package/dist/components/index.js +253 -40
  24. package/dist/components/navigation/index.css +589 -0
  25. package/dist/components/navigation/index.js +3 -3
  26. package/dist/features/auth/index.css +2 -2
  27. package/dist/features/auth/index.d.ts +188 -10
  28. package/dist/features/crm/index.css +2 -2
  29. package/dist/features/crm/index.d.ts +193 -10
  30. package/dist/features/crm/index.js +10 -10
  31. package/dist/features/dashboard/index.css +2 -2
  32. package/dist/features/dashboard/index.js +9 -9
  33. package/dist/features/delivery/index.css +85 -85
  34. package/dist/features/delivery/index.d.ts +193 -10
  35. package/dist/features/delivery/index.js +10 -10
  36. package/dist/features/lead-gen/index.css +2 -2
  37. package/dist/features/lead-gen/index.d.ts +5 -0
  38. package/dist/features/lead-gen/index.js +10 -10
  39. package/dist/features/monitoring/index.css +85 -85
  40. package/dist/features/monitoring/index.d.ts +6 -1
  41. package/dist/features/monitoring/index.js +11 -11
  42. package/dist/features/monitoring/requests/index.css +2 -2
  43. package/dist/features/monitoring/requests/index.d.ts +5 -0
  44. package/dist/features/monitoring/requests/index.js +9 -9
  45. package/dist/features/operations/index.css +2 -2
  46. package/dist/features/operations/index.d.ts +7 -4
  47. package/dist/features/operations/index.js +12 -12
  48. package/dist/features/seo/index.d.ts +5 -0
  49. package/dist/features/settings/index.css +2 -2
  50. package/dist/features/settings/index.d.ts +214 -16
  51. package/dist/features/settings/index.js +11 -11
  52. package/dist/graph/index.css +2 -2
  53. package/dist/hooks/delivery/index.css +2 -2
  54. package/dist/hooks/delivery/index.d.ts +188 -10
  55. package/dist/hooks/index.css +85 -85
  56. package/dist/hooks/index.d.ts +1843 -1538
  57. package/dist/hooks/index.js +8 -8
  58. package/dist/hooks/published.css +85 -85
  59. package/dist/hooks/published.d.ts +1843 -1538
  60. package/dist/hooks/published.js +8 -8
  61. package/dist/index.css +12 -12
  62. package/dist/index.d.ts +346 -35
  63. package/dist/index.js +9 -9
  64. package/dist/initialization/index.d.ts +188 -10
  65. package/dist/layout/index.js +2 -2
  66. package/dist/organization/index.css +589 -0
  67. package/dist/organization/index.js +1 -1
  68. package/dist/profile/index.d.ts +188 -10
  69. package/dist/provider/index.css +384 -0
  70. package/dist/provider/index.d.ts +6 -0
  71. package/dist/provider/index.js +7 -7
  72. package/dist/provider/published.css +463 -0
  73. package/dist/provider/published.d.ts +6 -0
  74. package/dist/provider/published.js +4 -4
  75. package/dist/supabase/index.d.ts +367 -20
  76. package/dist/test-utils/index.d.ts +46 -2
  77. package/dist/test-utils/index.js +102 -1
  78. package/dist/theme/index.js +2 -2
  79. package/dist/types/index.d.ts +199 -13
  80. package/package.json +4 -4
  81. /package/dist/{chunk-6GUW5GGF.js → chunk-6Z3G4U2R.js} +0 -0
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { MantineSpacing, MantineColor, MantineLoaderComponent, BadgeProps } from '@mantine/core';
3
2
  import * as React$1 from 'react';
4
- import React__default, { ComponentType, ReactNode, CSSProperties, ReactElement } from 'react';
3
+ import React__default, { ReactNode, ComponentType, CSSProperties, ReactElement } from 'react';
4
+ import { MantineSpacing, MantineColor, MantineLoaderComponent, BadgeProps } from '@mantine/core';
5
5
  import { Icon, IconCheck } from '@tabler/icons-react';
6
6
  import { Components } from 'react-markdown';
7
7
  import { z } from 'zod';
@@ -10,771 +10,383 @@ import { NodeProps, Node, EdgeProps, Edge } from '@xyflow/react';
10
10
  export { default as graphStyles } from '../graph/Graph.module.css';
11
11
  import * as _tanstack_react_query from '@tanstack/react-query';
12
12
 
13
- interface EmptyStateProps {
14
- /** Icon component to display (e.g., IconKey from @tabler/icons-react) */
15
- icon: ComponentType<{
16
- size: number;
17
- style?: React.CSSProperties;
18
- }>;
19
- /** Main title text */
20
- title: string;
21
- /** Description text shown below title */
22
- description?: string;
23
- /** Optional action button */
24
- action?: {
25
- label: string;
26
- onClick: () => void;
27
- icon?: ReactNode;
28
- };
29
- /** Vertical padding - defaults to 'xl' */
30
- py?: MantineSpacing;
31
- }
32
13
  /**
33
- * EmptyState - Reusable empty state component for lists and tables
34
- *
35
- * Consolidates the Center + Stack + Icon + Text pattern used across:
36
- * - ApiKeyList.tsx
37
- * - CredentialList.tsx
38
- * - Various other list components
39
- *
40
- * @example
41
- * ```tsx
42
- * <EmptyState
43
- * icon={IconKey}
44
- * title="No API keys yet"
45
- * description="Create your first API key to enable external integrations"
46
- * action={{ label: "Create API Key", onClick: handleCreate }}
47
- * />
48
- * ```
14
+ * Workflow-specific logging types and utilities
49
15
  */
50
- declare function EmptyState({ icon: Icon, title, description, action, py }: EmptyStateProps): react_jsx_runtime.JSX.Element;
51
16
 
52
- interface TabCountBadgeProps {
53
- count: number;
54
- isLoading?: boolean;
17
+ interface WorkflowExecutionContext {
18
+ type: 'workflow';
19
+ contextType: 'workflow-execution';
20
+ executionId: string;
21
+ workflowId: string;
22
+ workflowName?: string;
23
+ organizationId: string;
24
+ executionPath?: string[];
25
+ }
26
+ interface WorkflowFailureContext {
27
+ type: 'workflow';
28
+ contextType: 'workflow-failure';
29
+ executionId: string;
30
+ workflowId: string;
31
+ error: string;
32
+ }
33
+ interface StepStartedContext {
34
+ type: 'workflow';
35
+ contextType: 'step-started';
36
+ stepId: string;
37
+ stepStatus: 'started';
38
+ input: unknown;
39
+ startTime: number;
40
+ }
41
+ interface StepCompletedContext {
42
+ type: 'workflow';
43
+ contextType: 'step-completed';
44
+ stepId: string;
45
+ stepStatus: 'completed';
46
+ output: unknown;
47
+ duration: number;
48
+ isTerminal: boolean;
49
+ startTime: number;
50
+ endTime: number;
51
+ }
52
+ interface StepFailedContext {
53
+ type: 'workflow';
54
+ contextType: 'step-failed';
55
+ stepId: string;
56
+ stepStatus: 'failed';
57
+ error: string;
58
+ duration: number;
59
+ startTime: number;
60
+ endTime: number;
61
+ }
62
+ interface ConditionalRouteContext {
63
+ type: 'workflow';
64
+ contextType: 'conditional-route';
65
+ stepId: string;
66
+ target: string;
67
+ error?: string;
68
+ }
69
+ interface ExecutionPathContext {
70
+ type: 'workflow';
71
+ contextType: 'execution-path';
72
+ executionPath: string[];
73
+ }
74
+ type WorkflowLogContext = WorkflowExecutionContext | WorkflowFailureContext | StepStartedContext | StepCompletedContext | StepFailedContext | ConditionalRouteContext | ExecutionPathContext;
75
+ interface WorkflowLogMessage {
76
+ level: ExecutionLogLevel;
77
+ message: string;
78
+ timestamp: number;
79
+ context?: WorkflowLogContext;
55
80
  }
81
+
56
82
  /**
57
- * A badge that displays a count in tabs with consistent sizing.
58
- * Uses a fixed-width container to prevent layout shift when switching
59
- * between the loading spinner and the count badge.
83
+ * Agent-specific logging types
84
+ * Simplified 2-event model: lifecycle, iteration
85
+ *
86
+ * Design Philosophy:
87
+ * - LIFECYCLE EVENTS: Structural checkpoints (initialization, iteration, completion)
88
+ * - ITERATION EVENTS: Execution activities (reasoning, actions during iterations)
60
89
  */
61
- declare function TabCountBadge({ count, isLoading }: TabCountBadgeProps): react_jsx_runtime.JSX.Element;
62
90
 
63
91
  /**
64
- * TrendIndicator - Reusable component for showing percentage change trends
65
- * Displays up/down/flat arrow with colored badge
92
+ * Agent lifecycle stages
93
+ * Universal checkpoints that apply to all agent executions
66
94
  */
67
- interface TrendIndicatorProps {
68
- /** Current value */
69
- current: number;
70
- /** Previous value to compare against */
71
- previous: number;
72
- /** Optional formatter for the value (not used in display but kept for API compatibility) */
73
- formatter?: (value: number) => string;
74
- /** If true, negative change is considered positive (e.g., for costs) */
75
- inverse?: boolean;
76
- }
95
+ type AgentLifecycle = 'initialization' | 'iteration' | 'completion';
77
96
  /**
78
- * Shows a trend indicator with arrow icon and percentage change badge
79
- *
80
- * @example
81
- * // Positive trend (green when going up)
82
- * <TrendIndicator current={100} previous={80} />
83
- *
84
- * @example
85
- * // Inverse trend (green when going down, useful for costs)
86
- * <TrendIndicator current={100} previous={120} inverse />
97
+ * Iteration event types
98
+ * Activities that occur during agent iterations
87
99
  */
88
- declare function TrendIndicator({ current, previous, inverse }: TrendIndicatorProps): react_jsx_runtime.JSX.Element;
89
-
90
- interface CollapsibleSectionProps {
91
- title: string | ReactNode;
92
- count?: number;
93
- countLabel?: string;
94
- children: ReactNode;
95
- emptyMessage?: string;
96
- defaultExpanded?: boolean;
97
- maxHeight?: number;
100
+ type IterationEventType = 'reasoning' | 'action' | 'tool-call';
101
+ /**
102
+ * Base fields shared by all lifecycle events
103
+ */
104
+ interface AgentLifecycleEventBase {
105
+ type: 'agent';
106
+ agentId: string;
107
+ lifecycle: AgentLifecycle;
108
+ sessionId?: string;
98
109
  }
99
110
  /**
100
- * Reusable collapsible section with header, badge, and scroll area
101
- * Used for expandable content like memory sections, logs, etc.
111
+ * Lifecycle started event - emitted when a phase begins
112
+ * REQUIRED: startTime (phase has started, no end yet)
102
113
  */
103
- declare function CollapsibleSection({ title, count, countLabel, children, emptyMessage, defaultExpanded, maxHeight }: CollapsibleSectionProps): react_jsx_runtime.JSX.Element;
104
-
105
- interface PageTitleCaptionProps {
106
- title: string;
107
- caption?: string;
108
- rightSection?: ReactNode;
114
+ interface AgentLifecycleStartedEvent extends AgentLifecycleEventBase {
115
+ stage: 'started';
116
+ startTime: number;
117
+ iteration?: number;
109
118
  }
110
- declare const PageTitleCaption: ({ title, caption, rightSection }: PageTitleCaptionProps) => react_jsx_runtime.JSX.Element;
111
-
112
- interface StatsCardSkeletonProps {
113
- /** Height of the loader area - defaults to 200 */
114
- chartHeight?: number;
115
- /** Kept for API compat, unused */
116
- withChart?: boolean;
117
- /** Kept for API compat, unused */
118
- statCount?: 2 | 3;
119
+ /**
120
+ * Lifecycle completed event - emitted when a phase succeeds
121
+ * REQUIRED: startTime, endTime, duration (phase has finished successfully)
122
+ */
123
+ interface AgentLifecycleCompletedEvent extends AgentLifecycleEventBase {
124
+ stage: 'completed';
125
+ startTime: number;
126
+ endTime: number;
127
+ duration: number;
128
+ iteration?: number;
129
+ attempts?: number;
130
+ memorySize?: {
131
+ sessionMemoryKeys: number;
132
+ historyEntries: number;
133
+ };
119
134
  }
120
135
  /**
121
- * StatsCardSkeleton - Loading state for dashboard metric cards
122
- *
123
- * Used across:
124
- * - ExecutionHealthCard.tsx
125
- * - CostMetricsCard.tsx
126
- * - ThroughputCard.tsx
127
- * - BusinessImpactCard.tsx
136
+ * Lifecycle failed event - emitted when a phase fails
137
+ * REQUIRED: startTime, endTime, duration, error (phase has finished with error)
128
138
  */
129
- declare function StatsCardSkeleton({ chartHeight }: StatsCardSkeletonProps): react_jsx_runtime.JSX.Element;
130
- interface ListSkeletonProps {
131
- /** Number of rows (used to calculate height) - defaults to 3 */
132
- rows?: number;
133
- /** Height of each row - defaults to 50 */
134
- rowHeight?: number;
139
+ interface AgentLifecycleFailedEvent extends AgentLifecycleEventBase {
140
+ stage: 'failed';
141
+ startTime: number;
142
+ endTime: number;
143
+ duration: number;
144
+ error: string;
145
+ iteration?: number;
135
146
  }
136
147
  /**
137
- * ListSkeleton - Loading state for table/list content
138
- *
139
- * Used across:
140
- * - ApiKeyList.tsx
141
- * - CredentialList.tsx
142
- * - DeploymentList.tsx
143
- * - WebhookEndpointList.tsx
148
+ * Union type for all lifecycle events
149
+ * Discriminated by 'stage' field for type narrowing
144
150
  */
145
- declare function ListSkeleton({ rows, rowHeight }: ListSkeletonProps): react_jsx_runtime.JSX.Element;
146
- interface DetailCardSkeletonProps {
147
- /** Number of detail rows (used to calculate height) - defaults to 3 */
148
- rows?: number;
151
+ type AgentLifecycleEvent = AgentLifecycleStartedEvent | AgentLifecycleCompletedEvent | AgentLifecycleFailedEvent;
152
+ /**
153
+ * Placeholder data for MVP
154
+ * Will be typed per actionType in future
155
+ */
156
+ interface ActionPlaceholderData {
157
+ message: string;
149
158
  }
150
159
  /**
151
- * DetailCardSkeleton - Loading state for cards with list of detail items
152
- *
153
- * Used for cards like CostBreakdownCard
160
+ * Iteration event - captures activities during agent iterations
161
+ * Consolidates reasoning (LLM thought process) and actions (tool use, memory ops, etc.)
154
162
  */
155
- declare function DetailCardSkeleton({ rows }: DetailCardSkeletonProps): react_jsx_runtime.JSX.Element;
156
-
157
- interface NavigationButtonProps {
158
- /** Icon component to display */
159
- icon: React__default.ComponentType<{
160
- size?: number;
161
- stroke?: number;
162
- }>;
163
- /** Button label text */
164
- label: string;
165
- /** Whether the button is in collapsed state (hides text) */
166
- isCollapsed?: boolean;
167
- /** Whether this button has sub-items/links */
168
- hasSubItems?: boolean;
169
- /** Whether sub-items are expanded (controls chevron rotation) */
170
- isExpanded?: boolean;
171
- /** Whether the icon and text should be styled as active */
172
- isActive?: boolean;
173
- /** Whether the background should be styled as active */
174
- hasActiveBackground?: boolean;
175
- /** Click handler */
176
- onClick?: () => void;
177
- /** Additional styles for the button container */
178
- style?: React__default.CSSProperties;
179
- /** Custom transition duration in ms */
180
- transitionDuration?: number;
163
+ interface AgentIterationEvent {
164
+ type: 'agent';
165
+ agentId: string;
166
+ lifecycle: 'iteration';
167
+ eventType: IterationEventType;
168
+ iteration: number;
169
+ sessionId?: string;
170
+ startTime: number;
171
+ endTime: number;
172
+ duration: number;
173
+ output?: string;
174
+ actionType?: string;
175
+ data?: ActionPlaceholderData;
181
176
  }
182
- declare const NavigationButton: React__default.FC<NavigationButtonProps>;
183
-
184
- interface CustomSelectorProps {
185
- value: string | null;
186
- onChange: (value: string | null) => void;
187
- data: {
188
- value: string;
189
- label: string;
190
- }[] | readonly {
191
- value: string;
192
- label: string;
193
- }[];
194
- leftSection?: ReactNode;
195
- placeholder?: string;
196
- w?: number | string;
197
- withCheckIcon?: boolean;
198
- disabled?: boolean;
177
+ /**
178
+ * Tool call event - captures individual tool executions during iterations
179
+ * Provides granular timing for each tool invocation
180
+ */
181
+ interface AgentToolCallEvent {
182
+ type: 'agent';
183
+ agentId: string;
184
+ lifecycle: 'iteration';
185
+ eventType: 'tool-call';
186
+ iteration: number;
187
+ sessionId?: string;
188
+ toolName: string;
189
+ startTime: number;
190
+ endTime: number;
191
+ duration: number;
192
+ success: boolean;
193
+ error?: string;
194
+ input?: Record<string, unknown>;
195
+ output?: unknown;
199
196
  }
200
- declare function CustomSelector({ value, onChange, data, leftSection, placeholder, w, withCheckIcon, disabled }: CustomSelectorProps): react_jsx_runtime.JSX.Element;
197
+ /**
198
+ * Union type for all agent log contexts
199
+ * 3 event types total (lifecycle, iteration, tool-call)
200
+ */
201
+ type AgentLogContext = AgentLifecycleEvent | AgentIterationEvent | AgentToolCallEvent;
201
202
 
202
- interface APIErrorAlertProps {
203
- /**
204
- * The error to display. Can be an APIClientError, generic Error, or any unknown value.
205
- */
206
- error: unknown;
207
- /**
208
- * Optional title override. If not provided, uses getErrorTitle() based on error code.
209
- */
210
- title?: string;
211
- /**
212
- * Whether to show the request ID (if available). Defaults to true.
213
- */
214
- showRequestId?: boolean;
215
- /**
216
- * Optional custom icon. Defaults to IconAlertCircle.
217
- */
218
- icon?: React.ReactNode;
219
- /**
220
- * Alert color. Defaults to 'red'.
221
- */
222
- color?: string;
223
- }
224
203
  /**
225
- * Alert component for displaying API errors with type-safe error handling.
226
- *
227
- * Automatically extracts error message, code, and request ID from APIClientError
228
- * or falls back to generic Error handling.
229
- *
230
- * @example
231
- * ```tsx
232
- * const { data, error } = useQuery(...)
233
- *
234
- * if (error) {
235
- * return <APIErrorAlert error={error} />
236
- * }
237
- * ```
238
- *
239
- * @example With custom title
240
- * ```tsx
241
- * <APIErrorAlert
242
- * error={error}
243
- * title="Failed to load resources"
244
- * />
245
- * ```
246
- *
247
- * @example Without request ID
248
- * ```tsx
249
- * <APIErrorAlert
250
- * error={error}
251
- * showRequestId={false}
252
- * />
253
- * ```
204
+ * Base execution logger for Execution Engine
254
205
  */
255
- declare function APIErrorAlert({ error, title, showRequestId, icon, color }: APIErrorAlertProps): react_jsx_runtime.JSX.Element;
206
+ type ExecutionLogLevel = 'debug' | 'info' | 'warn' | 'error';
256
207
 
257
- interface CenteredErrorStateProps {
258
- error: unknown;
259
- title?: string;
260
- /** Minimum height of the centering container. Defaults to 300. */
261
- h?: number | string;
262
- /** Vertical padding (used when h is not set). */
263
- py?: MantineSpacing;
208
+ type LogContext = WorkflowLogContext | AgentLogContext;
209
+ interface ExecutionLogMessage {
210
+ level: ExecutionLogLevel;
211
+ message: string;
212
+ timestamp: number;
213
+ context?: LogContext;
264
214
  }
215
+
265
216
  /**
266
- * CenteredErrorState - Displays an error centered inside its container.
267
- *
268
- * The caller is responsible for providing the container (e.g. `<Paper withBorder>`).
269
- * This component only handles centering + rendering the error alert.
270
- *
271
- * @example
272
- * ```tsx
273
- * if (error) {
274
- * return (
275
- * <Paper withBorder>
276
- * <CenteredErrorState error={error} title="Failed to load trends" />
277
- * </Paper>
278
- * )
279
- * }
280
- * ```
217
+ * Shared form field types for dynamic form generation
218
+ * Used by: Command Queue, Execution Runner UI, future form-based features
281
219
  */
282
- declare function CenteredErrorState({ error, title, h, py }: CenteredErrorStateProps): react_jsx_runtime.JSX.Element;
283
-
284
- interface StatCardBaseProps {
285
- /** The label/description text */
220
+ /**
221
+ * Supported form field types for action payloads
222
+ * Maps to Mantine form components
223
+ */
224
+ type FormFieldType = 'text' | 'textarea' | 'number' | 'select' | 'checkbox' | 'radio' | 'richtext';
225
+ /**
226
+ * Form field definition
227
+ */
228
+ interface FormField {
229
+ /** Field key in payload object */
230
+ name: string;
231
+ /** Field label for UI */
286
232
  label: string;
287
- /** The value to display (number or formatted string) */
288
- value: string | number;
289
- /** Tabler icon component */
290
- icon: Icon;
291
- /** Optional extra content rendered below the label */
292
- children?: ReactNode;
293
- }
294
- interface StatCardDefaultProps extends StatCardBaseProps {
295
- variant?: 'default';
296
- /** Theme color for the icon (defaults to theme primary) */
297
- color?: MantineColor;
298
- isLoading?: never;
299
- valueColor?: never;
233
+ /** Field type (determines UI component) */
234
+ type: FormFieldType;
235
+ /** Default value */
236
+ defaultValue?: unknown;
237
+ /** Required field */
238
+ required?: boolean;
239
+ /** Placeholder text */
240
+ placeholder?: string;
241
+ /** Help text */
242
+ description?: string;
243
+ /** Options for select/radio */
244
+ options?: Array<{
245
+ label: string;
246
+ value: string | number;
247
+ }>;
248
+ /** Min/max for number */
249
+ min?: number;
250
+ max?: number;
251
+ /** Path to context value for pre-filling (dot notation, e.g., 'proposal.summary') */
252
+ defaultValueFromContext?: string;
300
253
  }
301
- interface StatCardHeroProps extends StatCardBaseProps {
302
- variant: 'hero';
303
- /** Whether data is loading */
304
- isLoading?: boolean;
305
- /** Custom color for the value text */
306
- valueColor?: string;
307
- /** Card sizing — 'sm' (default) for compact layouts, 'md' for spacious layouts */
308
- size?: 'sm' | 'md';
309
- color?: never;
254
+ /**
255
+ * Form schema for action payload collection
256
+ */
257
+ interface FormSchema {
258
+ /** Form title */
259
+ title?: string;
260
+ /** Form description */
261
+ description?: string;
262
+ /** Form fields */
263
+ fields: FormField[];
310
264
  }
311
- type StatCardProps = StatCardDefaultProps | StatCardHeroProps;
265
+
312
266
  /**
313
- * StatCard - Stat display card with icon, label, and value.
314
- *
315
- * Supports two variants:
316
- * - `default`: Compact card with ThemeIcon (used in admin overviews)
317
- * - `hero`: Glass card with glowing icon ring (used on dashboards)
318
- *
319
- * @example
320
- * ```tsx
321
- * // Default variant
322
- * <StatCard label="Total Executions" value={150} icon={IconPlayerPlay} color="blue" />
267
+ * Serialized Registry Types
323
268
  *
324
- * // Hero variant
325
- * <StatCard variant="hero" label="Executions" value={43} icon={IconPlayerPlay} isLoading={false} />
326
- * ```
269
+ * Pre-computed JSON-safe types for API responses and Command View.
270
+ * Serialization happens once at API startup, enabling instant response times.
327
271
  */
328
- declare function StatCard(props: StatCardProps): react_jsx_runtime.JSX.Element;
272
+
329
273
  /**
330
- * StatCardSkeleton - Loading skeleton for StatCard (default variant)
274
+ * Serialized form field for API responses
331
275
  */
332
- declare function StatCardSkeleton(): react_jsx_runtime.JSX.Element;
333
-
334
- interface StyledMarkdownProps {
335
- /** Markdown content to render */
336
- children: string;
337
- /** Custom component overrides */
338
- components?: Partial<Components>;
339
- /** Additional class name */
340
- className?: string;
341
- /** Inline styles for the wrapper div */
342
- style?: React.CSSProperties;
276
+ interface SerializedFormField {
277
+ name: string;
278
+ label: string;
279
+ type: FormFieldType;
280
+ defaultValue?: unknown;
281
+ required?: boolean;
282
+ placeholder?: string;
283
+ description?: string;
284
+ options?: Array<{
285
+ label: string;
286
+ value: string | number;
287
+ }>;
288
+ min?: number;
289
+ max?: number;
343
290
  }
344
291
  /**
345
- * Styled markdown renderer with Mantine components and syntax highlighting
346
- *
347
- * Features:
348
- * - Colored headings using theme primary color
349
- * - Syntax-highlighted code blocks (oneDark theme, no token backgrounds)
350
- * - Styled inline code with Mantine Code component
351
- * - Styled blockquotes with left border
352
- * - Proper list styling
353
- *
354
- * @example
355
- * ```tsx
356
- * import { StyledMarkdown } from '@repo/ui'
357
- *
358
- * <StyledMarkdown>{markdownContent}</StyledMarkdown>
359
- * ```
292
+ * Serialized form schema for API responses
360
293
  */
361
- declare function StyledMarkdown({ children, components, className, style }: StyledMarkdownProps): react_jsx_runtime.JSX.Element;
362
-
363
- interface JsonViewerProps {
364
- /** JSON data to display (will be stringified) or pre-formatted JSON string */
365
- data: unknown;
366
- /** Maximum height with scroll (e.g., '300px'). If not set, expands to content */
367
- maxHeight?: string | number;
368
- /** Font size override */
369
- fontSize?: string | number;
294
+ interface SerializedFormSchema {
295
+ title?: string;
296
+ description?: string;
297
+ fields: SerializedFormField[];
298
+ layout?: 'vertical' | 'horizontal' | 'grid';
370
299
  }
371
300
  /**
372
- * Syntax-highlighted JSON viewer component
373
- *
374
- * @example
375
- * ```tsx
376
- * import { JsonViewer } from '@repo/ui'
377
- *
378
- * <JsonViewer data={{ foo: 'bar', count: 42 }} />
379
- * <JsonViewer data={apiResponse} maxHeight={300} />
380
- * ```
301
+ * Serialized execution form schema for API responses
381
302
  */
382
- declare function JsonViewer({ data, maxHeight, fontSize }: JsonViewerProps): react_jsx_runtime.JSX.Element;
383
-
384
- interface ContextViewerProps {
385
- /** Any JSON-serializable data to display in a human-readable format */
386
- data: unknown;
303
+ interface SerializedExecutionFormSchema extends SerializedFormSchema {
304
+ fieldMappings?: Record<string, string>;
305
+ submitButton?: {
306
+ label?: string;
307
+ loadingLabel?: string;
308
+ confirmMessage?: string;
309
+ };
387
310
  }
388
311
  /**
389
- * Auto-formats any JSON context into a human-readable layout.
390
- *
391
- * - Strings → rendered as markdown (supports formatting, lists, tables)
392
- * - Flat key-value objects → labeled field list
393
- * - Nested objects → indented subsections with left border
394
- * - Arrays → bulleted lists or bordered cards
395
- * - null/undefined/boolean/number → inline text
396
- *
397
- * No display configuration needed — the component infers layout from data shape.
398
- */
399
- declare function ContextViewer({ data }: ContextViewerProps): react_jsx_runtime.JSX.Element;
400
-
401
- /**
402
- * Workflow-specific logging types and utilities
312
+ * Serialized schedule config for API responses
403
313
  */
404
-
405
- interface WorkflowExecutionContext {
406
- type: 'workflow';
407
- contextType: 'workflow-execution';
408
- executionId: string;
409
- workflowId: string;
410
- workflowName?: string;
411
- organizationId: string;
412
- executionPath?: string[];
413
- }
414
- interface WorkflowFailureContext {
415
- type: 'workflow';
416
- contextType: 'workflow-failure';
417
- executionId: string;
418
- workflowId: string;
419
- error: string;
420
- }
421
- interface StepStartedContext {
422
- type: 'workflow';
423
- contextType: 'step-started';
424
- stepId: string;
425
- stepStatus: 'started';
426
- input: unknown;
427
- startTime: number;
428
- }
429
- interface StepCompletedContext {
430
- type: 'workflow';
431
- contextType: 'step-completed';
432
- stepId: string;
433
- stepStatus: 'completed';
434
- output: unknown;
435
- duration: number;
436
- isTerminal: boolean;
437
- startTime: number;
438
- endTime: number;
439
- }
440
- interface StepFailedContext {
441
- type: 'workflow';
442
- contextType: 'step-failed';
443
- stepId: string;
444
- stepStatus: 'failed';
445
- error: string;
446
- duration: number;
447
- startTime: number;
448
- endTime: number;
449
- }
450
- interface ConditionalRouteContext {
451
- type: 'workflow';
452
- contextType: 'conditional-route';
453
- stepId: string;
454
- target: string;
455
- error?: string;
456
- }
457
- interface ExecutionPathContext {
458
- type: 'workflow';
459
- contextType: 'execution-path';
460
- executionPath: string[];
461
- }
462
- type WorkflowLogContext = WorkflowExecutionContext | WorkflowFailureContext | StepStartedContext | StepCompletedContext | StepFailedContext | ConditionalRouteContext | ExecutionPathContext;
463
- interface WorkflowLogMessage {
464
- level: ExecutionLogLevel;
465
- message: string;
466
- timestamp: number;
467
- context?: WorkflowLogContext;
314
+ interface SerializedScheduleConfig {
315
+ enabled: boolean;
316
+ defaultSchedule?: string;
317
+ allowedPatterns?: string[];
468
318
  }
469
-
470
- /**
471
- * Agent-specific logging types
472
- * Simplified 2-event model: lifecycle, iteration
473
- *
474
- * Design Philosophy:
475
- * - LIFECYCLE EVENTS: Structural checkpoints (initialization, iteration, completion)
476
- * - ITERATION EVENTS: Execution activities (reasoning, actions during iterations)
477
- */
478
-
479
319
  /**
480
- * Agent lifecycle stages
481
- * Universal checkpoints that apply to all agent executions
482
- */
483
- type AgentLifecycle = 'initialization' | 'iteration' | 'completion';
484
- /**
485
- * Iteration event types
486
- * Activities that occur during agent iterations
487
- */
488
- type IterationEventType = 'reasoning' | 'action' | 'tool-call';
489
- /**
490
- * Base fields shared by all lifecycle events
320
+ * Serialized webhook config for API responses
491
321
  */
492
- interface AgentLifecycleEventBase {
493
- type: 'agent';
494
- agentId: string;
495
- lifecycle: AgentLifecycle;
496
- sessionId?: string;
322
+ interface SerializedWebhookConfig {
323
+ enabled: boolean;
324
+ payloadSchema?: unknown;
497
325
  }
498
326
  /**
499
- * Lifecycle started event - emitted when a phase begins
500
- * REQUIRED: startTime (phase has started, no end yet)
327
+ * Serialized execution interface for API responses
501
328
  */
502
- interface AgentLifecycleStartedEvent extends AgentLifecycleEventBase {
503
- stage: 'started';
504
- startTime: number;
505
- iteration?: number;
329
+ interface SerializedExecutionInterface {
330
+ form: SerializedExecutionFormSchema;
331
+ schedule?: SerializedScheduleConfig;
332
+ webhook?: SerializedWebhookConfig;
506
333
  }
507
334
  /**
508
- * Lifecycle completed event - emitted when a phase succeeds
509
- * REQUIRED: startTime, endTime, duration (phase has finished successfully)
335
+ * Serialized agent definition (JSON-safe)
336
+ * Result of serializeDefinition(AgentDefinition)
510
337
  */
511
- interface AgentLifecycleCompletedEvent extends AgentLifecycleEventBase {
512
- stage: 'completed';
513
- startTime: number;
514
- endTime: number;
515
- duration: number;
516
- iteration?: number;
517
- attempts?: number;
518
- memorySize?: {
519
- sessionMemoryKeys: number;
520
- historyEntries: number;
338
+ interface SerializedAgentDefinition {
339
+ config: {
340
+ resourceId: string;
341
+ name: string;
342
+ description: string;
343
+ version: string;
344
+ type: 'agent';
345
+ status: 'dev' | 'prod';
346
+ links?: ResourceLink[];
347
+ category?: ResourceCategory;
348
+ /** Whether this resource is archived and should be excluded from registration and deployment */
349
+ archived?: boolean;
350
+ systemPrompt: string;
351
+ constraints?: {
352
+ maxIterations?: number;
353
+ timeout?: number;
354
+ maxSessionMemoryKeys?: number;
355
+ maxMemoryTokens?: number;
356
+ };
357
+ sessionCapable?: boolean;
358
+ memoryPreferences?: string;
359
+ };
360
+ modelConfig: {
361
+ provider: string;
362
+ model: string;
363
+ apiKey: string;
364
+ temperature: number;
365
+ maxOutputTokens: number;
366
+ topP?: number;
367
+ modelOptions?: Record<string, unknown>;
368
+ };
369
+ contract: {
370
+ inputSchema: object;
371
+ outputSchema?: object;
372
+ };
373
+ tools: Array<{
374
+ name: string;
375
+ description: string;
376
+ inputSchema?: object;
377
+ outputSchema?: object;
378
+ }>;
379
+ knowledgeMap?: {
380
+ nodeCount: number;
381
+ nodes: Array<{
382
+ id: string;
383
+ description: string;
384
+ loaded: boolean;
385
+ hasPrompt: boolean;
386
+ }>;
521
387
  };
522
- }
523
- /**
524
- * Lifecycle failed event - emitted when a phase fails
525
- * REQUIRED: startTime, endTime, duration, error (phase has finished with error)
526
- */
527
- interface AgentLifecycleFailedEvent extends AgentLifecycleEventBase {
528
- stage: 'failed';
529
- startTime: number;
530
- endTime: number;
531
- duration: number;
532
- error: string;
533
- iteration?: number;
534
- }
535
- /**
536
- * Union type for all lifecycle events
537
- * Discriminated by 'stage' field for type narrowing
538
- */
539
- type AgentLifecycleEvent = AgentLifecycleStartedEvent | AgentLifecycleCompletedEvent | AgentLifecycleFailedEvent;
540
- /**
541
- * Placeholder data for MVP
542
- * Will be typed per actionType in future
543
- */
544
- interface ActionPlaceholderData {
545
- message: string;
546
- }
547
- /**
548
- * Iteration event - captures activities during agent iterations
549
- * Consolidates reasoning (LLM thought process) and actions (tool use, memory ops, etc.)
550
- */
551
- interface AgentIterationEvent {
552
- type: 'agent';
553
- agentId: string;
554
- lifecycle: 'iteration';
555
- eventType: IterationEventType;
556
- iteration: number;
557
- sessionId?: string;
558
- startTime: number;
559
- endTime: number;
560
- duration: number;
561
- output?: string;
562
- actionType?: string;
563
- data?: ActionPlaceholderData;
564
- }
565
- /**
566
- * Tool call event - captures individual tool executions during iterations
567
- * Provides granular timing for each tool invocation
568
- */
569
- interface AgentToolCallEvent {
570
- type: 'agent';
571
- agentId: string;
572
- lifecycle: 'iteration';
573
- eventType: 'tool-call';
574
- iteration: number;
575
- sessionId?: string;
576
- toolName: string;
577
- startTime: number;
578
- endTime: number;
579
- duration: number;
580
- success: boolean;
581
- error?: string;
582
- input?: Record<string, unknown>;
583
- output?: unknown;
584
- }
585
- /**
586
- * Union type for all agent log contexts
587
- * 3 event types total (lifecycle, iteration, tool-call)
588
- */
589
- type AgentLogContext = AgentLifecycleEvent | AgentIterationEvent | AgentToolCallEvent;
590
-
591
- /**
592
- * Base execution logger for Execution Engine
593
- */
594
- type ExecutionLogLevel = 'debug' | 'info' | 'warn' | 'error';
595
-
596
- type LogContext = WorkflowLogContext | AgentLogContext;
597
- interface ExecutionLogMessage {
598
- level: ExecutionLogLevel;
599
- message: string;
600
- timestamp: number;
601
- context?: LogContext;
602
- }
603
-
604
- /**
605
- * Shared form field types for dynamic form generation
606
- * Used by: Command Queue, Execution Runner UI, future form-based features
607
- */
608
- /**
609
- * Supported form field types for action payloads
610
- * Maps to Mantine form components
611
- */
612
- type FormFieldType = 'text' | 'textarea' | 'number' | 'select' | 'checkbox' | 'radio' | 'richtext';
613
- /**
614
- * Form field definition
615
- */
616
- interface FormField {
617
- /** Field key in payload object */
618
- name: string;
619
- /** Field label for UI */
620
- label: string;
621
- /** Field type (determines UI component) */
622
- type: FormFieldType;
623
- /** Default value */
624
- defaultValue?: unknown;
625
- /** Required field */
626
- required?: boolean;
627
- /** Placeholder text */
628
- placeholder?: string;
629
- /** Help text */
630
- description?: string;
631
- /** Options for select/radio */
632
- options?: Array<{
633
- label: string;
634
- value: string | number;
635
- }>;
636
- /** Min/max for number */
637
- min?: number;
638
- max?: number;
639
- /** Path to context value for pre-filling (dot notation, e.g., 'proposal.summary') */
640
- defaultValueFromContext?: string;
641
- }
642
- /**
643
- * Form schema for action payload collection
644
- */
645
- interface FormSchema {
646
- /** Form title */
647
- title?: string;
648
- /** Form description */
649
- description?: string;
650
- /** Form fields */
651
- fields: FormField[];
652
- }
653
-
654
- /**
655
- * Serialized Registry Types
656
- *
657
- * Pre-computed JSON-safe types for API responses and Command View.
658
- * Serialization happens once at API startup, enabling instant response times.
659
- */
660
-
661
- /**
662
- * Serialized form field for API responses
663
- */
664
- interface SerializedFormField {
665
- name: string;
666
- label: string;
667
- type: FormFieldType;
668
- defaultValue?: unknown;
669
- required?: boolean;
670
- placeholder?: string;
671
- description?: string;
672
- options?: Array<{
673
- label: string;
674
- value: string | number;
675
- }>;
676
- min?: number;
677
- max?: number;
678
- }
679
- /**
680
- * Serialized form schema for API responses
681
- */
682
- interface SerializedFormSchema {
683
- title?: string;
684
- description?: string;
685
- fields: SerializedFormField[];
686
- layout?: 'vertical' | 'horizontal' | 'grid';
687
- }
688
- /**
689
- * Serialized execution form schema for API responses
690
- */
691
- interface SerializedExecutionFormSchema extends SerializedFormSchema {
692
- fieldMappings?: Record<string, string>;
693
- submitButton?: {
694
- label?: string;
695
- loadingLabel?: string;
696
- confirmMessage?: string;
697
- };
698
- }
699
- /**
700
- * Serialized schedule config for API responses
701
- */
702
- interface SerializedScheduleConfig {
703
- enabled: boolean;
704
- defaultSchedule?: string;
705
- allowedPatterns?: string[];
706
- }
707
- /**
708
- * Serialized webhook config for API responses
709
- */
710
- interface SerializedWebhookConfig {
711
- enabled: boolean;
712
- payloadSchema?: unknown;
713
- }
714
- /**
715
- * Serialized execution interface for API responses
716
- */
717
- interface SerializedExecutionInterface {
718
- form: SerializedExecutionFormSchema;
719
- schedule?: SerializedScheduleConfig;
720
- webhook?: SerializedWebhookConfig;
721
- }
722
- /**
723
- * Serialized agent definition (JSON-safe)
724
- * Result of serializeDefinition(AgentDefinition)
725
- */
726
- interface SerializedAgentDefinition {
727
- config: {
728
- resourceId: string;
729
- name: string;
730
- description: string;
731
- version: string;
732
- type: 'agent';
733
- status: 'dev' | 'prod';
734
- links?: ResourceLink[];
735
- category?: ResourceCategory;
736
- /** Whether this resource is archived and should be excluded from registration and deployment */
737
- archived?: boolean;
738
- systemPrompt: string;
739
- constraints?: {
740
- maxIterations?: number;
741
- timeout?: number;
742
- maxSessionMemoryKeys?: number;
743
- maxMemoryTokens?: number;
744
- };
745
- sessionCapable?: boolean;
746
- memoryPreferences?: string;
747
- };
748
- modelConfig: {
749
- provider: string;
750
- model: string;
751
- apiKey: string;
752
- temperature: number;
753
- maxOutputTokens: number;
754
- topP?: number;
755
- modelOptions?: Record<string, unknown>;
756
- };
757
- contract: {
758
- inputSchema: object;
759
- outputSchema?: object;
760
- };
761
- tools: Array<{
762
- name: string;
763
- description: string;
764
- inputSchema?: object;
765
- outputSchema?: object;
766
- }>;
767
- knowledgeMap?: {
768
- nodeCount: number;
769
- nodes: Array<{
770
- id: string;
771
- description: string;
772
- loaded: boolean;
773
- hasPrompt: boolean;
774
- }>;
775
- };
776
- metricsConfig?: object;
777
- interface?: SerializedExecutionInterface;
388
+ metricsConfig?: object;
389
+ interface?: SerializedExecutionInterface;
778
390
  }
779
391
  /**
780
392
  * Serialized workflow definition (JSON-safe)
@@ -1293,7 +905,6 @@ type Database = {
1293
905
  acq_deals: {
1294
906
  Row: {
1295
907
  activity_log: Json;
1296
- cached_stage: string | null;
1297
908
  closed_lost_at: string | null;
1298
909
  closed_lost_reason: string | null;
1299
910
  contact_email: string;
@@ -1308,6 +919,7 @@ type Database = {
1308
919
  organization_id: string;
1309
920
  payment_link_sent_at: string | null;
1310
921
  payment_received_at: string | null;
922
+ pipeline_key: string;
1311
923
  proposal_data: Json | null;
1312
924
  proposal_generated_at: string | null;
1313
925
  proposal_pdf_url: string | null;
@@ -1315,10 +927,11 @@ type Database = {
1315
927
  proposal_reviewed_by: string | null;
1316
928
  proposal_sent_at: string | null;
1317
929
  proposal_signed_at: string | null;
1318
- proposal_status: string | null;
1319
930
  signature_envelope_id: string | null;
1320
931
  source_list_id: string | null;
1321
932
  source_type: string | null;
933
+ stage_key: string | null;
934
+ state_key: string | null;
1322
935
  stripe_payment_id: string | null;
1323
936
  stripe_payment_link: string | null;
1324
937
  stripe_payment_link_id: string | null;
@@ -1327,7 +940,6 @@ type Database = {
1327
940
  };
1328
941
  Insert: {
1329
942
  activity_log?: Json;
1330
- cached_stage?: string | null;
1331
943
  closed_lost_at?: string | null;
1332
944
  closed_lost_reason?: string | null;
1333
945
  contact_email: string;
@@ -1342,6 +954,7 @@ type Database = {
1342
954
  organization_id: string;
1343
955
  payment_link_sent_at?: string | null;
1344
956
  payment_received_at?: string | null;
957
+ pipeline_key?: string;
1345
958
  proposal_data?: Json | null;
1346
959
  proposal_generated_at?: string | null;
1347
960
  proposal_pdf_url?: string | null;
@@ -1349,10 +962,11 @@ type Database = {
1349
962
  proposal_reviewed_by?: string | null;
1350
963
  proposal_sent_at?: string | null;
1351
964
  proposal_signed_at?: string | null;
1352
- proposal_status?: string | null;
1353
965
  signature_envelope_id?: string | null;
1354
966
  source_list_id?: string | null;
1355
967
  source_type?: string | null;
968
+ stage_key?: string | null;
969
+ state_key?: string | null;
1356
970
  stripe_payment_id?: string | null;
1357
971
  stripe_payment_link?: string | null;
1358
972
  stripe_payment_link_id?: string | null;
@@ -1361,7 +975,6 @@ type Database = {
1361
975
  };
1362
976
  Update: {
1363
977
  activity_log?: Json;
1364
- cached_stage?: string | null;
1365
978
  closed_lost_at?: string | null;
1366
979
  closed_lost_reason?: string | null;
1367
980
  contact_email?: string;
@@ -1376,6 +989,7 @@ type Database = {
1376
989
  organization_id?: string;
1377
990
  payment_link_sent_at?: string | null;
1378
991
  payment_received_at?: string | null;
992
+ pipeline_key?: string;
1379
993
  proposal_data?: Json | null;
1380
994
  proposal_generated_at?: string | null;
1381
995
  proposal_pdf_url?: string | null;
@@ -1383,10 +997,11 @@ type Database = {
1383
997
  proposal_reviewed_by?: string | null;
1384
998
  proposal_sent_at?: string | null;
1385
999
  proposal_signed_at?: string | null;
1386
- proposal_status?: string | null;
1387
1000
  signature_envelope_id?: string | null;
1388
1001
  source_list_id?: string | null;
1389
1002
  source_type?: string | null;
1003
+ stage_key?: string | null;
1004
+ state_key?: string | null;
1390
1005
  stripe_payment_id?: string | null;
1391
1006
  stripe_payment_link?: string | null;
1392
1007
  stripe_payment_link_id?: string | null;
@@ -2555,6 +2170,7 @@ type Database = {
2555
2170
  Row: {
2556
2171
  config: Json;
2557
2172
  created_at: string | null;
2173
+ effective_permissions: string[];
2558
2174
  id: string;
2559
2175
  membership_status: string | null;
2560
2176
  organization_id: string;
@@ -2566,6 +2182,7 @@ type Database = {
2566
2182
  Insert: {
2567
2183
  config?: Json;
2568
2184
  created_at?: string | null;
2185
+ effective_permissions?: string[];
2569
2186
  id?: string;
2570
2187
  membership_status?: string | null;
2571
2188
  organization_id: string;
@@ -2577,6 +2194,7 @@ type Database = {
2577
2194
  Update: {
2578
2195
  config?: Json;
2579
2196
  created_at?: string | null;
2197
+ effective_permissions?: string[];
2580
2198
  id?: string;
2581
2199
  membership_status?: string | null;
2582
2200
  organization_id?: string;
@@ -2602,6 +2220,147 @@ type Database = {
2602
2220
  }
2603
2221
  ];
2604
2222
  };
2223
+ org_rol_assignments: {
2224
+ Row: {
2225
+ granted_at: string;
2226
+ granted_by: string | null;
2227
+ membership_id: string;
2228
+ role_id: string;
2229
+ };
2230
+ Insert: {
2231
+ granted_at?: string;
2232
+ granted_by?: string | null;
2233
+ membership_id: string;
2234
+ role_id: string;
2235
+ };
2236
+ Update: {
2237
+ granted_at?: string;
2238
+ granted_by?: string | null;
2239
+ membership_id?: string;
2240
+ role_id?: string;
2241
+ };
2242
+ Relationships: [
2243
+ {
2244
+ foreignKeyName: "org_rol_assignments_granted_by_fkey";
2245
+ columns: ["granted_by"];
2246
+ isOneToOne: false;
2247
+ referencedRelation: "users";
2248
+ referencedColumns: ["id"];
2249
+ },
2250
+ {
2251
+ foreignKeyName: "org_rol_assignments_membership_id_fkey";
2252
+ columns: ["membership_id"];
2253
+ isOneToOne: false;
2254
+ referencedRelation: "org_memberships";
2255
+ referencedColumns: ["id"];
2256
+ },
2257
+ {
2258
+ foreignKeyName: "org_rol_assignments_role_id_fkey";
2259
+ columns: ["role_id"];
2260
+ isOneToOne: false;
2261
+ referencedRelation: "org_rol_definitions";
2262
+ referencedColumns: ["id"];
2263
+ }
2264
+ ];
2265
+ };
2266
+ org_rol_definitions: {
2267
+ Row: {
2268
+ created_at: string;
2269
+ description: string | null;
2270
+ id: string;
2271
+ is_system: boolean;
2272
+ name: string;
2273
+ organization_id: string | null;
2274
+ slug: string;
2275
+ updated_at: string;
2276
+ };
2277
+ Insert: {
2278
+ created_at?: string;
2279
+ description?: string | null;
2280
+ id?: string;
2281
+ is_system?: boolean;
2282
+ name: string;
2283
+ organization_id?: string | null;
2284
+ slug: string;
2285
+ updated_at?: string;
2286
+ };
2287
+ Update: {
2288
+ created_at?: string;
2289
+ description?: string | null;
2290
+ id?: string;
2291
+ is_system?: boolean;
2292
+ name?: string;
2293
+ organization_id?: string | null;
2294
+ slug?: string;
2295
+ updated_at?: string;
2296
+ };
2297
+ Relationships: [
2298
+ {
2299
+ foreignKeyName: "org_rol_definitions_organization_id_fkey";
2300
+ columns: ["organization_id"];
2301
+ isOneToOne: false;
2302
+ referencedRelation: "organizations";
2303
+ referencedColumns: ["id"];
2304
+ }
2305
+ ];
2306
+ };
2307
+ org_rol_grants: {
2308
+ Row: {
2309
+ granted_at: string;
2310
+ permission_key: string;
2311
+ role_id: string;
2312
+ };
2313
+ Insert: {
2314
+ granted_at?: string;
2315
+ permission_key: string;
2316
+ role_id: string;
2317
+ };
2318
+ Update: {
2319
+ granted_at?: string;
2320
+ permission_key?: string;
2321
+ role_id?: string;
2322
+ };
2323
+ Relationships: [
2324
+ {
2325
+ foreignKeyName: "org_rol_grants_permission_key_fkey";
2326
+ columns: ["permission_key"];
2327
+ isOneToOne: false;
2328
+ referencedRelation: "org_rol_permissions";
2329
+ referencedColumns: ["key"];
2330
+ },
2331
+ {
2332
+ foreignKeyName: "org_rol_grants_role_id_fkey";
2333
+ columns: ["role_id"];
2334
+ isOneToOne: false;
2335
+ referencedRelation: "org_rol_definitions";
2336
+ referencedColumns: ["id"];
2337
+ }
2338
+ ];
2339
+ };
2340
+ org_rol_permissions: {
2341
+ Row: {
2342
+ created_at: string;
2343
+ description: string;
2344
+ is_org_grantable: boolean;
2345
+ key: string;
2346
+ updated_at: string;
2347
+ };
2348
+ Insert: {
2349
+ created_at?: string;
2350
+ description: string;
2351
+ is_org_grantable?: boolean;
2352
+ key: string;
2353
+ updated_at?: string;
2354
+ };
2355
+ Update: {
2356
+ created_at?: string;
2357
+ description?: string;
2358
+ is_org_grantable?: boolean;
2359
+ key?: string;
2360
+ updated_at?: string;
2361
+ };
2362
+ Relationships: [];
2363
+ };
2605
2364
  organizations: {
2606
2365
  Row: {
2607
2366
  config: Json;
@@ -3359,7 +3118,8 @@ type Database = {
3359
3118
  created_at: string;
3360
3119
  description: string | null;
3361
3120
  id: string;
3362
- key: string;
3121
+ key_hash: string;
3122
+ key_prefix: string | null;
3363
3123
  last_triggered_at: string | null;
3364
3124
  name: string;
3365
3125
  organization_id: string;
@@ -3372,7 +3132,8 @@ type Database = {
3372
3132
  created_at?: string;
3373
3133
  description?: string | null;
3374
3134
  id?: string;
3375
- key: string;
3135
+ key_hash: string;
3136
+ key_prefix?: string | null;
3376
3137
  last_triggered_at?: string | null;
3377
3138
  name: string;
3378
3139
  organization_id: string;
@@ -3385,7 +3146,8 @@ type Database = {
3385
3146
  created_at?: string;
3386
3147
  description?: string | null;
3387
3148
  id?: string;
3388
- key?: string;
3149
+ key_hash?: string;
3150
+ key_prefix?: string | null;
3389
3151
  last_triggered_at?: string | null;
3390
3152
  name?: string;
3391
3153
  organization_id?: string;
@@ -3431,6 +3193,13 @@ type Database = {
3431
3193
  Args: never;
3432
3194
  Returns: string;
3433
3195
  };
3196
+ can_assign_role_in_org: {
3197
+ Args: {
3198
+ p_role_id: string;
3199
+ p_target_membership_id: string;
3200
+ };
3201
+ Returns: boolean;
3202
+ };
3434
3203
  current_user_is_platform_admin: {
3435
3204
  Args: never;
3436
3205
  Returns: boolean;
@@ -3460,6 +3229,10 @@ type Database = {
3460
3229
  user_id: string;
3461
3230
  }[];
3462
3231
  };
3232
+ get_platform_credential_kek: {
3233
+ Args: never;
3234
+ Returns: string;
3235
+ };
3463
3236
  get_storage_org_id: {
3464
3237
  Args: {
3465
3238
  file_path: string;
@@ -3470,9 +3243,10 @@ type Database = {
3470
3243
  Args: never;
3471
3244
  Returns: string;
3472
3245
  };
3473
- is_org_admin: {
3246
+ has_org_permission: {
3474
3247
  Args: {
3475
3248
  org_id: string;
3249
+ perm_key: string;
3476
3250
  };
3477
3251
  Returns: boolean;
3478
3252
  };
@@ -3502,6 +3276,22 @@ type Database = {
3502
3276
  Args: never;
3503
3277
  Returns: Json;
3504
3278
  };
3279
+ recompute_all_memberships: {
3280
+ Args: never;
3281
+ Returns: undefined;
3282
+ };
3283
+ sync_all_memberships_with_role: {
3284
+ Args: {
3285
+ p_role_id: string;
3286
+ };
3287
+ Returns: undefined;
3288
+ };
3289
+ sync_one_membership: {
3290
+ Args: {
3291
+ p_membership_id: string;
3292
+ };
3293
+ Returns: undefined;
3294
+ };
3505
3295
  upsert_user_profile: {
3506
3296
  Args: never;
3507
3297
  Returns: {
@@ -3555,787 +3345,1254 @@ interface SubActivity {
3555
3345
  details: AgentIterationEvent | AgentToolCallEvent;
3556
3346
  }
3557
3347
  /**
3558
- * Agent iteration state
3559
- * Aggregates lifecycle events and sub-activities for a single iteration
3348
+ * Agent iteration state
3349
+ * Aggregates lifecycle events and sub-activities for a single iteration
3350
+ */
3351
+ interface AgentIteration {
3352
+ iterationNumber: number;
3353
+ status: 'running' | 'completed' | 'failed' | 'pending';
3354
+ iterationEvents: AgentIterationEvent[];
3355
+ duration?: number;
3356
+ timestamp: number;
3357
+ subActivities: SubActivity[];
3358
+ startTime?: number;
3359
+ endTime?: number;
3360
+ }
3361
+ /**
3362
+ * Agent lifecycle node state
3363
+ * Represents initialization or completion phase
3364
+ */
3365
+ interface AgentLifecycleNode {
3366
+ type: 'initialization' | 'completion';
3367
+ status: 'running' | 'completed' | 'failed' | 'pending';
3368
+ duration?: number;
3369
+ timestamp?: number;
3370
+ startTime?: number;
3371
+ endTime?: number;
3372
+ }
3373
+ /**
3374
+ * Complete agent execution data for timeline visualization
3375
+ * Parsed from execution logs
3376
+ */
3377
+ interface AgentIterationData {
3378
+ initialization: AgentLifecycleNode;
3379
+ iterations: AgentIteration[];
3380
+ completion: AgentLifecycleNode;
3381
+ currentIteration: number | null;
3382
+ totalIterations: number;
3383
+ totalDuration?: number;
3384
+ status: 'running' | 'completed' | 'failed' | 'warning';
3385
+ }
3386
+
3387
+ /** Raw database row type for acq_deals table */
3388
+ type AcqDealRow = Database['public']['Tables']['acq_deals']['Row'];
3389
+ type DealStage = 'interested' | 'proposal' | 'closing' | 'closed_won' | 'closed_lost' | 'nurturing';
3390
+ interface KanbanStageConfig {
3391
+ color: string;
3392
+ label?: string;
3393
+ }
3394
+ type KanbanBoardConfig = Partial<Record<DealStage, KanbanStageConfig>>;
3395
+ interface DealContact {
3396
+ id: string;
3397
+ first_name: string | null;
3398
+ last_name: string | null;
3399
+ email: string;
3400
+ title: string | null;
3401
+ headline: string | null;
3402
+ linkedin_url: string | null;
3403
+ pipeline_status: Record<string, unknown> | null;
3404
+ enrichment_data: Record<string, unknown> | null;
3405
+ company: {
3406
+ id: string;
3407
+ name: string;
3408
+ domain: string | null;
3409
+ website: string | null;
3410
+ linkedin_url: string | null;
3411
+ segment: string | null;
3412
+ category: string | null;
3413
+ num_employees: number | null;
3414
+ } | null;
3415
+ }
3416
+ interface DealFilters {
3417
+ stage?: DealStage;
3418
+ search?: string;
3419
+ limit?: number;
3420
+ offset?: number;
3421
+ }
3422
+ /** Deal list item with joined contact and company data */
3423
+ interface DealListItem extends AcqDealRow {
3424
+ contact: DealContact | null;
3425
+ }
3426
+ type DealDetail = DealListItem;
3427
+
3428
+ /**
3429
+ * Action configuration for HITL tasks
3430
+ * Defines available user actions and their behavior
3431
+ */
3432
+ interface ActionConfig {
3433
+ /** Unique action identifier (e.g., 'approve', 'retry', 'escalate') */
3434
+ id: string;
3435
+ /** Display label for UI button */
3436
+ label: string;
3437
+ /** Button variant/style */
3438
+ type: 'primary' | 'secondary' | 'danger' | 'outline';
3439
+ /** Tabler icon name (e.g., 'IconCheck', 'IconRefresh') */
3440
+ icon?: string;
3441
+ /** Button color (Mantine theme colors) */
3442
+ color?: string;
3443
+ /** Button variant (Mantine button variant, e.g., 'light', 'filled', 'outline') */
3444
+ variant?: string;
3445
+ /** Execution target (agent/workflow to invoke) */
3446
+ target?: {
3447
+ resourceType: 'agent' | 'workflow';
3448
+ resourceId: string;
3449
+ /**
3450
+ * Optional session ID for agent continuation.
3451
+ * If provided, invokes a new turn on the existing session instead of standalone execution.
3452
+ * Only valid when resourceType is 'agent'.
3453
+ */
3454
+ sessionId?: string;
3455
+ };
3456
+ /** Form schema for collecting action-specific data */
3457
+ form?: FormSchema;
3458
+ /** Payload template for pre-filling forms */
3459
+ payloadTemplate?: unknown;
3460
+ /** Requires confirmation dialog */
3461
+ requiresConfirmation?: boolean;
3462
+ /** Confirmation message */
3463
+ confirmationMessage?: string;
3464
+ /** Help text / tooltip */
3465
+ description?: string;
3466
+ }
3467
+
3468
+ /**
3469
+ * Origin resource type - where an execution/task originated from.
3470
+ * Used for audit trails and tracking execution lineage.
3471
+ */
3472
+ type OriginResourceType = 'agent' | 'workflow' | 'scheduler' | 'api';
3473
+ /**
3474
+ * Origin tracking metadata - who/what created this execution/task.
3475
+ * Used by both TaskScheduler and CommandQueue for complete audit trails.
3476
+ */
3477
+ interface OriginTracking {
3478
+ originExecutionId: string;
3479
+ originResourceType: OriginResourceType;
3480
+ originResourceId: string;
3481
+ }
3482
+
3483
+ /**
3484
+ * Command queue task with flexible action system
3485
+ */
3486
+ interface Task extends OriginTracking {
3487
+ id: string;
3488
+ organizationId: string;
3489
+ actions: ActionConfig[];
3490
+ context: unknown;
3491
+ selectedAction?: string;
3492
+ actionPayload?: unknown;
3493
+ description?: string;
3494
+ priority: number;
3495
+ /** Optional checkpoint identifier for grouping related human approval tasks */
3496
+ humanCheckpoint?: string;
3497
+ status: QueueTaskStatus;
3498
+ /**
3499
+ * Target resource tracking — mirrors origin columns.
3500
+ * Set when task is created; patchable to redirect execution to a different resource.
3501
+ */
3502
+ targetResourceId?: string;
3503
+ targetResourceType?: 'agent' | 'workflow';
3504
+ /**
3505
+ * Execution ID for the action that runs AFTER user approval.
3506
+ * NULL until execution starts.
3507
+ *
3508
+ * Naming distinction:
3509
+ * - originExecutionId = Parent execution that CREATED the HITL task
3510
+ * - targetExecutionId = Child execution that RUNS AFTER user approval
3511
+ */
3512
+ targetExecutionId?: string;
3513
+ createdAt: Date;
3514
+ completedAt?: Date;
3515
+ completedBy?: string;
3516
+ expiresAt?: Date;
3517
+ idempotencyKey?: string | null;
3518
+ }
3519
+ /**
3520
+ * Task status values
3521
+ * - pending: awaiting action
3522
+ * - processing: execution in progress after user approval
3523
+ * - completed: action was taken and execution succeeded
3524
+ * - failed: execution failed, task can be retried
3525
+ * - expired: timed out before action
3526
+ */
3527
+ type QueueTaskStatus = 'pending' | 'processing' | 'completed' | 'failed' | 'expired';
3528
+
3529
+ /**
3530
+ * Target for schedule execution - identifies what resource to execute.
3531
+ * Unlike ExecutionTarget, payload is NOT included here because schedules
3532
+ * store payload in the scheduleConfig (varies per step/item).
3533
+ */
3534
+ interface ScheduleTarget {
3535
+ resourceType: 'agent' | 'workflow';
3536
+ resourceId: string;
3537
+ }
3538
+ /**
3539
+ * Optional origin tracking for schedules.
3540
+ * Unlike OriginTracking (which is required), these fields are all optional
3541
+ * for schedules created directly via API (not triggered by another resource).
3542
+ */
3543
+ interface ScheduleOriginTracking {
3544
+ originExecutionId?: string;
3545
+ originResourceType?: OriginResourceType;
3546
+ originResourceId?: string;
3547
+ }
3548
+ type TaskScheduleConfig = RecurringScheduleConfig | RelativeScheduleConfig | AbsoluteScheduleConfig;
3549
+ interface RecurringScheduleConfig {
3550
+ type: 'recurring';
3551
+ cron?: string;
3552
+ interval?: 'daily' | 'weekly' | 'monthly';
3553
+ time?: string;
3554
+ timezone: string;
3555
+ payload: Record<string, unknown>;
3556
+ endAt?: string | null;
3557
+ overduePolicy?: 'skip' | 'execute';
3558
+ }
3559
+ interface RelativeScheduleConfig {
3560
+ type: 'relative';
3561
+ anchorAt: string;
3562
+ anchorLabel?: string;
3563
+ items: RelativeScheduleItem[];
3564
+ overduePolicy?: 'skip' | 'execute';
3565
+ }
3566
+ interface RelativeScheduleItem {
3567
+ offset: string;
3568
+ payload: Record<string, unknown>;
3569
+ label?: string;
3570
+ }
3571
+ interface AbsoluteScheduleConfig {
3572
+ type: 'absolute';
3573
+ items: AbsoluteScheduleItem[];
3574
+ overduePolicy?: 'skip' | 'execute';
3575
+ }
3576
+ interface AbsoluteScheduleItem {
3577
+ runAt: string;
3578
+ payload: Record<string, unknown>;
3579
+ label?: string;
3580
+ }
3581
+ interface TaskSchedule extends ScheduleOriginTracking {
3582
+ id: string;
3583
+ organizationId: string;
3584
+ name: string;
3585
+ description?: string;
3586
+ target: ScheduleTarget;
3587
+ scheduleConfig: TaskScheduleConfig;
3588
+ nextRunAt?: Date;
3589
+ currentStep: number;
3590
+ status: 'active' | 'paused' | 'completed' | 'cancelled';
3591
+ lastRunAt?: Date;
3592
+ lastExecutionId?: string;
3593
+ maxRetries: number;
3594
+ idempotencyKey?: string;
3595
+ createdAt: Date;
3596
+ updatedAt: Date;
3597
+ }
3598
+
3599
+ /**
3600
+ * Wire-format DTO for notification API responses.
3601
+ * Dates are ISO 8601 strings (not Date objects like the domain Notification type).
3602
+ * Used by frontend hooks that consume /api/notifications.
3603
+ */
3604
+ interface NotificationDTO {
3605
+ id: string;
3606
+ userId: string;
3607
+ organizationId: string;
3608
+ category: string;
3609
+ title: string;
3610
+ message: string;
3611
+ actionUrl: string | null;
3612
+ read: boolean;
3613
+ readAt: string | null;
3614
+ createdAt: string;
3615
+ }
3616
+
3617
+ type MilestoneRow = Database['public']['Tables']['prj_milestones']['Row'];
3618
+ type TaskRow = Database['public']['Tables']['prj_tasks']['Row'];
3619
+
3620
+ /**
3621
+ * Full ListConfig shape. `qualification` is required; everything else optional.
3622
+ * Matches `acq_lists.config` jsonb and ListConfig type in types.ts.
3623
+ */
3624
+ declare const ListConfigSchema: z.ZodObject<{
3625
+ qualification: z.ZodObject<{
3626
+ targetDescription: z.ZodString;
3627
+ minReviewCount: z.ZodNumber;
3628
+ minRating: z.ZodNumber;
3629
+ excludeFranchises: z.ZodBoolean;
3630
+ customRules: z.ZodString;
3631
+ }, z.core.$strip>;
3632
+ enrichment: z.ZodOptional<z.ZodObject<{
3633
+ emailDiscovery: z.ZodOptional<z.ZodObject<{
3634
+ primary: z.ZodEnum<{
3635
+ tomba: "tomba";
3636
+ anymailfinder: "anymailfinder";
3637
+ }>;
3638
+ credentialName: z.ZodOptional<z.ZodString>;
3639
+ }, z.core.$strip>>;
3640
+ emailVerification: z.ZodOptional<z.ZodObject<{
3641
+ provider: z.ZodLiteral<"millionverifier">;
3642
+ threshold: z.ZodOptional<z.ZodEnum<{
3643
+ ok: "ok";
3644
+ "ok+catch_all": "ok+catch_all";
3645
+ }>>;
3646
+ }, z.core.$strip>>;
3647
+ }, z.core.$strip>>;
3648
+ personalization: z.ZodOptional<z.ZodObject<{
3649
+ industryContext: z.ZodOptional<z.ZodString>;
3650
+ emailBody: z.ZodOptional<z.ZodString>;
3651
+ creativeDirection: z.ZodOptional<z.ZodString>;
3652
+ exclusionRules: z.ZodOptional<z.ZodArray<z.ZodString>>;
3653
+ }, z.core.$strip>>;
3654
+ pipeline: z.ZodOptional<z.ZodObject<{
3655
+ steps: z.ZodArray<z.ZodObject<{
3656
+ key: z.ZodString;
3657
+ label: z.ZodString;
3658
+ resourceId: z.ZodString;
3659
+ inputTemplate: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3660
+ enabled: z.ZodBoolean;
3661
+ order: z.ZodNumber;
3662
+ }, z.core.$strip>>;
3663
+ }, z.core.$strip>>;
3664
+ }, z.core.$strip>;
3665
+ type ListConfigInput = z.infer<typeof ListConfigSchema>;
3666
+
3667
+ declare const GetRecentActivityResponseSchema: z.ZodObject<{
3668
+ entries: z.ZodArray<z.ZodObject<{
3669
+ id: z.ZodString;
3670
+ kind: z.ZodEnum<{
3671
+ note: "note";
3672
+ stage_change: "stage_change";
3673
+ deal_created: "deal_created";
3674
+ }>;
3675
+ dealId: z.ZodString;
3676
+ occurredAt: z.ZodString;
3677
+ description: z.ZodString;
3678
+ contactName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3679
+ companyName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3680
+ stage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3681
+ }, z.core.$strip>>;
3682
+ }, z.core.$strip>;
3683
+ type GetRecentActivityResponse = z.infer<typeof GetRecentActivityResponseSchema>;
3684
+
3685
+ /**
3686
+ * Multi-tenancy configuration types
3687
+ *
3688
+ * Config is stored in dedicated `config` columns (NOT nested in metadata):
3689
+ * - organizations.config: Org-level config (no feature toggles -- all features available by default)
3690
+ * - org_memberships.config: Per-user-per-org feature overrides
3691
+ * - users.config: User-global config
3692
+ */
3693
+ /**
3694
+ * Per-user-per-org config (stored in org_memberships.config)
3695
+ * Controls which features a specific member can access within their org.
3696
+ * Keys are feature IDs from the organization model (e.g. crm, lead-gen, projects, seo).
3697
+ */
3698
+ interface MembershipFeatureConfig {
3699
+ features?: Record<string, boolean>;
3700
+ }
3701
+
3702
+ /**
3703
+ * Memberships Domain - Zod Validation Schemas
3704
+ *
3705
+ * Validation schemas for membership management endpoints.
3706
+ * Includes request bodies, query params, and path params.
3707
+ *
3708
+ * Security:
3709
+ * - All schemas use .strict() to prevent mass assignment attacks
3710
+ * - UUID validation prevents invalid references
3711
+ * - Role enum validation prevents privilege escalation
3712
+ * - organizationId never accepted in body (from JWT when needed)
3713
+ */
3714
+
3715
+ /**
3716
+ * Membership status validation
3717
+ * Note: Database constraint only allows 'active' | 'inactive'
3718
+ */
3719
+ declare const MembershipStatusSchema: z.ZodEnum<{
3720
+ active: "active";
3721
+ inactive: "inactive";
3722
+ }>;
3723
+ type MembershipStatus = z.infer<typeof MembershipStatusSchema>;
3724
+
3725
+ /**
3726
+ * Organization Membership types based on WorkOS API
3727
+ */
3728
+ interface OrganizationMembership {
3729
+ object: 'organization_membership';
3730
+ id: string;
3731
+ userId: string;
3732
+ organizationId: string;
3733
+ role: {
3734
+ slug: string;
3735
+ };
3736
+ status: 'active' | 'inactive';
3737
+ createdAt: string;
3738
+ updatedAt: string;
3739
+ }
3740
+ /**
3741
+ * Extended membership with user and organization details for UI
3742
+ */
3743
+ interface MembershipWithDetails extends OrganizationMembership {
3744
+ user?: {
3745
+ id: string;
3746
+ email: string;
3747
+ firstName?: string;
3748
+ lastName?: string;
3749
+ profilePictureUrl?: string;
3750
+ };
3751
+ organization?: {
3752
+ id: string;
3753
+ name: string;
3754
+ workos_org_id: string;
3755
+ primaryDomain?: string;
3756
+ is_test?: boolean;
3757
+ status?: string;
3758
+ metadata?: Record<string, unknown>;
3759
+ config?: Record<string, unknown>;
3760
+ };
3761
+ config?: MembershipFeatureConfig;
3762
+ }
3763
+
3764
+ interface OAuthToken extends Record<string, unknown> {
3765
+ provider: string;
3766
+ accessToken: string;
3767
+ refreshToken: string;
3768
+ expiresAt: string;
3769
+ tokenType: 'Bearer';
3770
+ scope?: string;
3771
+ }
3772
+ interface OAuthProviderConfig {
3773
+ id: string;
3774
+ name: string;
3775
+ authUrl: string;
3776
+ tokenUrl: string;
3777
+ scopes?: string[];
3778
+ authParams?: Record<string, string>;
3779
+ tokenExchange: 'basic-auth' | 'form-encoded' | 'json-body';
3780
+ usePKCE?: boolean;
3781
+ customAuthFlow?: (config: OAuthProviderConfig, state: OAuthState) => URL;
3782
+ customTokenExchange?: (code: string, config: OAuthProviderConfig) => Promise<OAuthToken>;
3783
+ }
3784
+ interface OAuthState {
3785
+ organizationId: string;
3786
+ nonce: string;
3787
+ timestamp: number;
3788
+ credentialName: string;
3789
+ provider: string;
3790
+ }
3791
+
3792
+ /**
3793
+ * Time range selector for dashboard metrics
3794
+ */
3795
+ type TimeRange = '1h' | '24h' | '7d' | '30d';
3796
+ /**
3797
+ * Execution health metrics response
3798
+ * Success rate, P95 duration, execution counts, and trend data
3799
+ * trendData includes executionCount for throughput visualization (eliminates separate API call)
3800
+ */
3801
+ interface ExecutionHealthMetrics {
3802
+ successRate: number;
3803
+ p95Duration: number;
3804
+ totalExecutions: number;
3805
+ trendData: Array<{
3806
+ time: string;
3807
+ rate: number;
3808
+ successCount: number;
3809
+ errorCount: number;
3810
+ warningCount: number;
3811
+ executionCount: number;
3812
+ }>;
3813
+ statusCounts: {
3814
+ success: number;
3815
+ failed: number;
3816
+ pending: number;
3817
+ warning: number;
3818
+ };
3819
+ peakPeriod: string;
3820
+ granularity: 'hour' | 'day';
3821
+ }
3822
+ /**
3823
+ * Error analysis metrics response
3824
+ * Error categories and top failing resources
3560
3825
  */
3561
- interface AgentIteration {
3562
- iterationNumber: number;
3563
- status: 'running' | 'completed' | 'failed' | 'pending';
3564
- iterationEvents: AgentIterationEvent[];
3565
- duration?: number;
3566
- timestamp: number;
3567
- subActivities: SubActivity[];
3568
- startTime?: number;
3569
- endTime?: number;
3826
+ interface ErrorAnalysisMetrics {
3827
+ totalErrors: number;
3828
+ errorsByCategory: Array<{
3829
+ category: string;
3830
+ count: number;
3831
+ percentage: number;
3832
+ }>;
3833
+ topFailingResources: Array<{
3834
+ resourceId: string;
3835
+ name: string;
3836
+ errorCount: number;
3837
+ failureRate: number;
3838
+ }>;
3570
3839
  }
3571
3840
  /**
3572
- * Agent lifecycle node state
3573
- * Represents initialization or completion phase
3841
+ * Business impact metrics response
3842
+ * ROI, labor savings, and cost analysis
3574
3843
  */
3575
- interface AgentLifecycleNode {
3576
- type: 'initialization' | 'completion';
3577
- status: 'running' | 'completed' | 'failed' | 'pending';
3578
- duration?: number;
3579
- timestamp?: number;
3580
- startTime?: number;
3581
- endTime?: number;
3844
+ interface BusinessImpactMetrics {
3845
+ totalSavingsUsd: number;
3846
+ totalCostUsd: number;
3847
+ netSavingsUsd: number;
3848
+ roi: number;
3582
3849
  }
3583
3850
  /**
3584
- * Complete agent execution data for timeline visualization
3585
- * Parsed from execution logs
3851
+ * Cost breakdown metrics response
3852
+ * Per-resource cost analysis
3586
3853
  */
3587
- interface AgentIterationData {
3588
- initialization: AgentLifecycleNode;
3589
- iterations: AgentIteration[];
3590
- completion: AgentLifecycleNode;
3591
- currentIteration: number | null;
3592
- totalIterations: number;
3593
- totalDuration?: number;
3594
- status: 'running' | 'completed' | 'failed' | 'warning';
3595
- }
3596
-
3597
- /** Raw database row type for acq_deals table */
3598
- type AcqDealRow = Database['public']['Tables']['acq_deals']['Row'];
3599
- type DealStage = 'interested' | 'proposal' | 'closing' | 'closed_won' | 'closed_lost' | 'nurturing';
3600
- interface KanbanStageConfig {
3601
- color: string;
3602
- label?: string;
3854
+ interface CostBreakdownMetrics {
3855
+ resources: Array<{
3856
+ resourceId: string;
3857
+ totalCostUsd: number;
3858
+ executionCount: number;
3859
+ avgCostUsd: number;
3860
+ }>;
3603
3861
  }
3604
- type KanbanBoardConfig = Partial<Record<DealStage, KanbanStageConfig>>;
3605
- interface DealContact {
3606
- id: string;
3607
- first_name: string | null;
3608
- last_name: string | null;
3609
- email: string;
3610
- title: string | null;
3611
- headline: string | null;
3612
- linkedin_url: string | null;
3613
- pipeline_status: Record<string, unknown> | null;
3614
- enrichment_data: Record<string, unknown> | null;
3615
- company: {
3616
- id: string;
3617
- name: string;
3618
- domain: string | null;
3619
- website: string | null;
3620
- linkedin_url: string | null;
3621
- segment: string | null;
3622
- category: string | null;
3623
- num_employees: number | null;
3624
- } | null;
3862
+ /** Time-bucketed health data point */
3863
+ interface ResourceHealthDataPoint {
3864
+ time: string;
3865
+ success: number;
3866
+ failure: number;
3867
+ warning: number;
3868
+ rate: number;
3625
3869
  }
3626
- interface DealFilters {
3627
- stage?: DealStage;
3628
- search?: string;
3629
- limit?: number;
3630
- offset?: number;
3870
+ /** Health data for a single resource */
3871
+ interface ResourceHealth {
3872
+ entityType: string;
3873
+ entityId: string;
3874
+ entityName: string | null;
3875
+ trendData: ResourceHealthDataPoint[];
3876
+ summary: {
3877
+ total: number;
3878
+ successRate: number;
3879
+ };
3631
3880
  }
3632
- /** Deal list item with joined contact and company data */
3633
- interface DealListItem extends AcqDealRow {
3634
- contact: DealContact | null;
3881
+ /**
3882
+ * Cost trend data point for time-series charts
3883
+ * Represents a single time bucket (hour or day)
3884
+ */
3885
+ interface CostTrendDataPoint {
3886
+ time: string;
3887
+ totalCostUsd: number;
3888
+ executionCount: number;
3889
+ avgCostPerExecution: number;
3635
3890
  }
3636
- type DealDetail = DealListItem;
3637
-
3638
3891
  /**
3639
- * Action configuration for HITL tasks
3640
- * Defines available user actions and their behavior
3892
+ * Cost trends response (time-series data)
3641
3893
  */
3642
- interface ActionConfig {
3643
- /** Unique action identifier (e.g., 'approve', 'retry', 'escalate') */
3644
- id: string;
3645
- /** Display label for UI button */
3646
- label: string;
3647
- /** Button variant/style */
3648
- type: 'primary' | 'secondary' | 'danger' | 'outline';
3649
- /** Tabler icon name (e.g., 'IconCheck', 'IconRefresh') */
3650
- icon?: string;
3651
- /** Button color (Mantine theme colors) */
3652
- color?: string;
3653
- /** Button variant (Mantine button variant, e.g., 'light', 'filled', 'outline') */
3654
- variant?: string;
3655
- /** Execution target (agent/workflow to invoke) */
3656
- target?: {
3657
- resourceType: 'agent' | 'workflow';
3658
- resourceId: string;
3659
- /**
3660
- * Optional session ID for agent continuation.
3661
- * If provided, invokes a new turn on the existing session instead of standalone execution.
3662
- * Only valid when resourceType is 'agent'.
3663
- */
3664
- sessionId?: string;
3665
- };
3666
- /** Form schema for collecting action-specific data */
3667
- form?: FormSchema;
3668
- /** Payload template for pre-filling forms */
3669
- payloadTemplate?: unknown;
3670
- /** Requires confirmation dialog */
3671
- requiresConfirmation?: boolean;
3672
- /** Confirmation message */
3673
- confirmationMessage?: string;
3674
- /** Help text / tooltip */
3675
- description?: string;
3894
+ interface CostTrendsResponse {
3895
+ trendData: CostTrendDataPoint[];
3896
+ granularity: 'hour' | 'day';
3897
+ totalCostUsd: number;
3898
+ totalExecutions: number;
3676
3899
  }
3677
-
3678
3900
  /**
3679
- * Origin resource type - where an execution/task originated from.
3680
- * Used for audit trails and tracking execution lineage.
3901
+ * Cost summary response with MTD and projections
3681
3902
  */
3682
- type OriginResourceType = 'agent' | 'workflow' | 'scheduler' | 'api';
3903
+ interface CostSummaryResponse {
3904
+ current: {
3905
+ totalCostUsd: number;
3906
+ executionCount: number;
3907
+ };
3908
+ previous: {
3909
+ totalCostUsd: number;
3910
+ executionCount: number;
3911
+ };
3912
+ mtd: {
3913
+ totalCostUsd: number;
3914
+ daysElapsed: number;
3915
+ };
3916
+ projection: {
3917
+ monthlyCostUsd: number;
3918
+ confidence: 'low' | 'medium' | 'high';
3919
+ };
3920
+ trend: {
3921
+ changePercent: number;
3922
+ direction: 'up' | 'down' | 'flat';
3923
+ };
3924
+ }
3683
3925
  /**
3684
- * Origin tracking metadata - who/what created this execution/task.
3685
- * Used by both TaskScheduler and CommandQueue for complete audit trails.
3926
+ * Cost by model data for model-level breakdown
3686
3927
  */
3687
- interface OriginTracking {
3688
- originExecutionId: string;
3689
- originResourceType: OriginResourceType;
3690
- originResourceId: string;
3928
+ interface CostByModelData {
3929
+ model: string;
3930
+ totalCostUsd: number;
3931
+ callCount: number;
3932
+ totalInputTokens: number;
3933
+ totalOutputTokens: number;
3934
+ avgCostPerCall: number;
3691
3935
  }
3692
-
3693
3936
  /**
3694
- * Command queue task with flexible action system
3937
+ * Cost by model response
3695
3938
  */
3696
- interface Task extends OriginTracking {
3697
- id: string;
3698
- organizationId: string;
3699
- actions: ActionConfig[];
3700
- context: unknown;
3701
- selectedAction?: string;
3702
- actionPayload?: unknown;
3703
- description?: string;
3704
- priority: number;
3705
- /** Optional checkpoint identifier for grouping related human approval tasks */
3706
- humanCheckpoint?: string;
3707
- status: QueueTaskStatus;
3708
- /**
3709
- * Target resource tracking — mirrors origin columns.
3710
- * Set when task is created; patchable to redirect execution to a different resource.
3711
- */
3712
- targetResourceId?: string;
3713
- targetResourceType?: 'agent' | 'workflow';
3714
- /**
3715
- * Execution ID for the action that runs AFTER user approval.
3716
- * NULL until execution starts.
3717
- *
3718
- * Naming distinction:
3719
- * - originExecutionId = Parent execution that CREATED the HITL task
3720
- * - targetExecutionId = Child execution that RUNS AFTER user approval
3721
- */
3722
- targetExecutionId?: string;
3723
- createdAt: Date;
3724
- completedAt?: Date;
3725
- completedBy?: string;
3726
- expiresAt?: Date;
3727
- idempotencyKey?: string | null;
3939
+ interface CostByModelResponse {
3940
+ models: CostByModelData[];
3941
+ totalCostUsd: number;
3942
+ totalCallCount: number;
3728
3943
  }
3944
+
3729
3945
  /**
3730
- * Task status values
3731
- * - pending: awaiting action
3732
- * - processing: execution in progress after user approval
3733
- * - completed: action was taken and execution succeeded
3734
- * - failed: execution failed, task can be retried
3735
- * - expired: timed out before action
3946
+ * Base Execution Engine type definitions
3947
+ * Core types shared across all Execution Engine resources
3736
3948
  */
3737
- type QueueTaskStatus = 'pending' | 'processing' | 'completed' | 'failed' | 'expired';
3738
3949
 
3739
3950
  /**
3740
- * Target for schedule execution - identifies what resource to execute.
3741
- * Unlike ExecutionTarget, payload is NOT included here because schedules
3742
- * store payload in the scheduleConfig (varies per step/item).
3951
+ * NOTE: AIResource interface has been removed and replaced with ResourceDefinition
3952
+ * from registry/types.ts. All resources (executable and non-executable) now extend
3953
+ * the unified ResourceDefinition base interface.
3954
+ *
3955
+ * AgentConfig and WorkflowConfig now extend ResourceDefinition directly.
3956
+ * See packages/core/src/registry/types.ts for the base interface definition.
3743
3957
  */
3744
- interface ScheduleTarget {
3745
- resourceType: 'agent' | 'workflow';
3746
- resourceId: string;
3747
- }
3958
+ type AIResourceDefinition = SerializedWorkflowDefinition | SerializedAgentDefinition;
3959
+
3748
3960
  /**
3749
- * Optional origin tracking for schedules.
3750
- * Unlike OriginTracking (which is required), these fields are all optional
3751
- * for schedules created directly via API (not triggered by another resource).
3961
+ * Resource Registry type definitions
3752
3962
  */
3753
- interface ScheduleOriginTracking {
3754
- originExecutionId?: string;
3755
- originResourceType?: OriginResourceType;
3756
- originResourceId?: string;
3757
- }
3758
- type TaskScheduleConfig = RecurringScheduleConfig | RelativeScheduleConfig | AbsoluteScheduleConfig;
3759
- interface RecurringScheduleConfig {
3760
- type: 'recurring';
3761
- cron?: string;
3762
- interval?: 'daily' | 'weekly' | 'monthly';
3763
- time?: string;
3764
- timezone: string;
3765
- payload: Record<string, unknown>;
3766
- endAt?: string | null;
3767
- overduePolicy?: 'skip' | 'execute';
3768
- }
3769
- interface RelativeScheduleConfig {
3770
- type: 'relative';
3771
- anchorAt: string;
3772
- anchorLabel?: string;
3773
- items: RelativeScheduleItem[];
3774
- overduePolicy?: 'skip' | 'execute';
3775
- }
3776
- interface RelativeScheduleItem {
3777
- offset: string;
3778
- payload: Record<string, unknown>;
3779
- label?: string;
3780
- }
3781
- interface AbsoluteScheduleConfig {
3782
- type: 'absolute';
3783
- items: AbsoluteScheduleItem[];
3784
- overduePolicy?: 'skip' | 'execute';
3785
- }
3786
- interface AbsoluteScheduleItem {
3787
- runAt: string;
3788
- payload: Record<string, unknown>;
3789
- label?: string;
3790
- }
3791
- interface TaskSchedule extends ScheduleOriginTracking {
3792
- id: string;
3793
- organizationId: string;
3794
- name: string;
3795
- description?: string;
3796
- target: ScheduleTarget;
3797
- scheduleConfig: TaskScheduleConfig;
3798
- nextRunAt?: Date;
3799
- currentStep: number;
3800
- status: 'active' | 'paused' | 'completed' | 'cancelled';
3801
- lastRunAt?: Date;
3802
- lastExecutionId?: string;
3803
- maxRetries: number;
3804
- idempotencyKey?: string;
3805
- createdAt: Date;
3806
- updatedAt: Date;
3807
- }
3808
3963
 
3809
3964
  /**
3810
- * Wire-format DTO for notification API responses.
3811
- * Dates are ISO 8601 strings (not Date objects like the domain Notification type).
3812
- * Used by frontend hooks that consume /api/notifications.
3965
+ * Environment/deployment status for resources
3813
3966
  */
3814
- interface NotificationDTO {
3967
+ type ResourceStatus = 'dev' | 'prod';
3968
+ /**
3969
+ * All resource types in the platform
3970
+ * Used as the discriminator field in ResourceDefinition
3971
+ */
3972
+ type ResourceType = 'agent' | 'workflow' | 'trigger' | 'integration' | 'external' | 'human';
3973
+ /**
3974
+ * Base interface for ALL platform resources
3975
+ * Shared by both executable (agents, workflows) and non-executable (triggers, integrations, etc.) resources
3976
+ */
3977
+ interface ResourceDefinition {
3978
+ /** Unique resource identifier */
3979
+ resourceId: string;
3980
+ /** Display name */
3981
+ name: string;
3982
+ /** Purpose and functionality description */
3983
+ description: string;
3984
+ /** Version for change tracking and evolution */
3985
+ version: string;
3986
+ /** Resource type discriminator */
3987
+ type: ResourceType;
3988
+ /** Environment/deployment status */
3989
+ status: ResourceStatus;
3990
+ /** Graph links to Organization Model nodes */
3991
+ links?: ResourceLink[];
3992
+ /** Infrastructure category for filtering */
3993
+ category?: ResourceCategory;
3994
+ /** Whether the agent supports multi-turn sessions (agents only) */
3995
+ sessionCapable?: boolean;
3996
+ /** Whether the resource is local (monorepo) or remote (externally deployed) */
3997
+ origin?: 'local' | 'remote';
3998
+ /** Whether this resource is archived and should be excluded from registration and deployment */
3999
+ archived?: boolean;
4000
+ }
4001
+
4002
+ declare const LinkSchema: z.ZodObject<{
4003
+ nodeId: z.ZodString;
4004
+ kind: z.ZodEnum<{
4005
+ contains: "contains";
4006
+ references: "references";
4007
+ exposes: "exposes";
4008
+ maps_to: "maps_to";
4009
+ "operates-on": "operates-on";
4010
+ uses: "uses";
4011
+ }>;
4012
+ }, z.core.$strip>;
4013
+ type Link = z.infer<typeof LinkSchema>;
4014
+
4015
+ declare const ResourceCategorySchema: z.ZodEnum<{
4016
+ production: "production";
4017
+ diagnostic: "diagnostic";
4018
+ internal: "internal";
4019
+ testing: "testing";
4020
+ }>;
4021
+ type ResourceCategory = z.infer<typeof ResourceCategorySchema>;
4022
+ type ResourceLink = Link;
4023
+
4024
+ type ExecutionStatus = 'pending' | 'running' | 'completed' | 'failed' | 'warning';
4025
+ interface APIExecutionSummary {
3815
4026
  id: string;
3816
- userId: string;
3817
- organizationId: string;
3818
- category: string;
3819
- title: string;
3820
- message: string;
3821
- actionUrl: string | null;
3822
- read: boolean;
3823
- readAt: string | null;
3824
- createdAt: string;
4027
+ status: ExecutionStatus;
4028
+ startTime: number;
4029
+ endTime?: number;
4030
+ resourceStatus?: ResourceStatus;
4031
+ }
4032
+ interface APIExecutionDetail extends APIExecutionSummary {
4033
+ executionLogs: ExecutionLogMessage[];
4034
+ input?: unknown;
4035
+ result?: unknown;
4036
+ error?: string;
4037
+ resourceStatus: ResourceStatus;
4038
+ apiVersion?: string | null;
4039
+ resourceVersion?: string | null;
4040
+ sdkVersion?: string | null;
4041
+ isArchived?: boolean;
4042
+ archivedLogCount?: number;
3825
4043
  }
3826
4044
 
3827
- type MilestoneRow = Database['public']['Tables']['prj_milestones']['Row'];
3828
- type TaskRow = Database['public']['Tables']['prj_tasks']['Row'];
4045
+ /**
4046
+ * Resource Type Metadata
4047
+ *
4048
+ * Centralized metadata for ResourceDefinition types including icon names and colors.
4049
+ * Icon names reference @tabler/icons-react - UI layer maps these to actual components.
4050
+ */
3829
4051
 
3830
4052
  /**
3831
- * Full ListConfig shape. `qualification` is required; everything else optional.
3832
- * Matches `acq_lists.config` jsonb and ListConfig type in types.ts.
4053
+ * Node color types for graph visualization
4054
+ * Used by both @repo/core (metadata) and @repo/ui (components)
3833
4055
  */
3834
- declare const ListConfigSchema: z.ZodObject<{
3835
- qualification: z.ZodObject<{
3836
- targetDescription: z.ZodString;
3837
- minReviewCount: z.ZodNumber;
3838
- minRating: z.ZodNumber;
3839
- excludeFranchises: z.ZodBoolean;
3840
- customRules: z.ZodString;
3841
- }, z.core.$strip>;
3842
- enrichment: z.ZodOptional<z.ZodObject<{
3843
- emailDiscovery: z.ZodOptional<z.ZodObject<{
3844
- primary: z.ZodEnum<{
3845
- tomba: "tomba";
3846
- anymailfinder: "anymailfinder";
3847
- }>;
3848
- credentialName: z.ZodOptional<z.ZodString>;
3849
- }, z.core.$strip>>;
3850
- emailVerification: z.ZodOptional<z.ZodObject<{
3851
- provider: z.ZodLiteral<"millionverifier">;
3852
- threshold: z.ZodOptional<z.ZodEnum<{
3853
- ok: "ok";
3854
- "ok+catch_all": "ok+catch_all";
3855
- }>>;
3856
- }, z.core.$strip>>;
3857
- }, z.core.$strip>>;
3858
- personalization: z.ZodOptional<z.ZodObject<{
3859
- industryContext: z.ZodOptional<z.ZodString>;
3860
- emailBody: z.ZodOptional<z.ZodString>;
3861
- creativeDirection: z.ZodOptional<z.ZodString>;
3862
- exclusionRules: z.ZodOptional<z.ZodArray<z.ZodString>>;
3863
- }, z.core.$strip>>;
3864
- pipeline: z.ZodOptional<z.ZodObject<{
3865
- steps: z.ZodArray<z.ZodObject<{
3866
- key: z.ZodString;
3867
- label: z.ZodString;
3868
- resourceId: z.ZodString;
3869
- inputTemplate: z.ZodRecord<z.ZodString, z.ZodUnknown>;
3870
- enabled: z.ZodBoolean;
3871
- order: z.ZodNumber;
3872
- }, z.core.$strip>>;
3873
- }, z.core.$strip>>;
3874
- }, z.core.$strip>;
3875
- type ListConfigInput = z.infer<typeof ListConfigSchema>;
4056
+ type NodeColorType = 'violet' | 'blue' | 'orange' | 'teal' | 'gray' | 'yellow';
3876
4057
 
3877
- declare const GetRecentActivityResponseSchema: z.ZodObject<{
3878
- entries: z.ZodArray<z.ZodObject<{
3879
- id: z.ZodString;
3880
- kind: z.ZodEnum<{
3881
- note: "note";
3882
- stage_change: "stage_change";
3883
- deal_created: "deal_created";
3884
- }>;
3885
- dealId: z.ZodString;
3886
- occurredAt: z.ZodString;
3887
- description: z.ZodString;
3888
- contactName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3889
- companyName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3890
- stage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3891
- }, z.core.$strip>>;
3892
- }, z.core.$strip>;
3893
- type GetRecentActivityResponse = z.infer<typeof GetRecentActivityResponseSchema>;
4058
+ type ActivityType = 'workflow_execution' | 'agent_run' | 'hitl_action' | 'webhook_received' | 'webhook_executed' | 'webhook_failed' | 'credential_change' | 'credential_read' | 'api_key_change' | 'deployment_change' | 'membership_change';
4059
+ type ActivityStatus = 'success' | 'failure' | 'pending' | 'approved' | 'rejected' | 'completed';
4060
+ interface Activity {
4061
+ id: string;
4062
+ organizationId: string;
4063
+ activityType: ActivityType;
4064
+ status: ActivityStatus;
4065
+ title: string;
4066
+ description: string | null;
4067
+ entityType: string;
4068
+ entityId: string;
4069
+ entityName: string | null;
4070
+ metadata: Record<string, unknown> | null;
4071
+ actorId: string | null;
4072
+ actorType: string | null;
4073
+ occurredAt: Date;
4074
+ createdAt: Date;
4075
+ }
3894
4076
 
3895
4077
  /**
3896
- * Multi-tenancy configuration types
4078
+ * Canonical permission catalog.
3897
4079
  *
3898
- * Config is stored in dedicated `config` columns (NOT nested in metadata):
3899
- * - organizations.config: Org-level config (no feature toggles -- all features available by default)
3900
- * - org_memberships.config: Per-user-per-org feature overrides
3901
- * - users.config: User-global config
3902
- */
4080
+ * Source of truth for the permission keys used by:
4081
+ * - RLS policies in Supabase (via has_org_permission(org_id, key))
4082
+ * - API middleware (via requireOrganizationPermission(key))
4083
+ * - UI hooks (via useOrganizationPermissions().hasPermission(key))
4084
+ *
4085
+ * The DB table `org_rol_permissions` mirrors this constant. Reconciliation
4086
+ * runs at API boot (insert-or-update only — never auto-delete; see the
4087
+ * deletion runbook in the auth-role-system doc -- review/auth-role-system/).
4088
+ *
4089
+ * Adding a permission:
4090
+ * 1. Add an entry below.
4091
+ * 2. Add a row to the migration / via reconcilePermissionCatalog at boot.
4092
+ * 3. Reference it in RLS / middleware as needed.
4093
+ * 4. Optionally grant it to one or more system roles in org_rol_grants.
4094
+ *
4095
+ * Removing a permission: follow the deletion runbook — never just delete
4096
+ * the entry. Existing role grants and policy references must be cleared first.
4097
+ */
4098
+ declare const PERMISSIONS: {
4099
+ readonly ORG_READ: "org.read";
4100
+ readonly ORG_MANAGE: "org.manage";
4101
+ readonly ORG_DELETE: "org.delete";
4102
+ readonly MEMBERS_MANAGE: "members.manage";
4103
+ readonly ROLES_MANAGE: "roles.manage";
4104
+ readonly SECRETS_MANAGE: "secrets.manage";
4105
+ readonly OPERATIONS_READ: "operations.read";
4106
+ readonly OPERATIONS_MANAGE: "operations.manage";
4107
+ readonly ACQUISITION_MANAGE: "acquisition.manage";
4108
+ readonly PROJECTS_MANAGE: "projects.manage";
4109
+ };
4110
+ type PermissionKey = (typeof PERMISSIONS)[keyof typeof PERMISSIONS];
3903
4111
  /**
3904
- * Per-user-per-org config (stored in org_memberships.config)
3905
- * Controls which features a specific member can access within their org.
3906
- * Keys are feature IDs from the organization model (e.g. crm, lead-gen, projects, seo).
4112
+ * Static metadata for each permission. Mirrored into org_rol_permissions on
4113
+ * boot reconciliation. is_org_grantable=false means the permission is reserved
4114
+ * to system roles only custom roles cannot include it (privilege-escalation guard).
3907
4115
  */
3908
- interface MembershipFeatureConfig {
3909
- features?: Record<string, boolean>;
4116
+ interface PermissionDescriptor {
4117
+ key: PermissionKey;
4118
+ description: string;
4119
+ isOrgGrantable: boolean;
3910
4120
  }
3911
4121
 
3912
4122
  /**
3913
- * Memberships Domain - Zod Validation Schemas
3914
- *
3915
- * Validation schemas for membership management endpoints.
3916
- * Includes request bodies, query params, and path params.
4123
+ * Execution Runner Types
3917
4124
  *
3918
- * Security:
3919
- * - All schemas use .strict() to prevent mass assignment attacks
3920
- * - UUID validation prevents invalid references
3921
- * - Role enum validation prevents privilege escalation
3922
- * - organizationId never accepted in body (from JWT when needed)
4125
+ * Shared types for the Execution Runner UI feature.
4126
+ * Used by both API (apps/api) and frontend (apps/command-center).
3923
4127
  */
3924
4128
 
3925
- /**
3926
- * Membership status validation
3927
- * Note: Database constraint only allows 'active' | 'inactive'
3928
- */
3929
- declare const MembershipStatusSchema: z.ZodEnum<{
3930
- active: "active";
3931
- inactive: "inactive";
3932
- }>;
3933
- type MembershipStatus = z.infer<typeof MembershipStatusSchema>;
4129
+ interface ExecutionRunnerCatalogItem {
4130
+ resourceId: string;
4131
+ resourceName: string;
4132
+ resourceType: 'workflow' | 'agent';
4133
+ description?: string;
4134
+ status: 'dev' | 'prod';
4135
+ version: string;
4136
+ interface: SerializedExecutionInterface;
4137
+ }
3934
4138
 
3935
4139
  /**
3936
- * Organization Membership types based on WorkOS API
4140
+ * Deployment types browser-safe
4141
+ *
4142
+ * Canonical API response types for the deployment resource.
4143
+ * The API's transformRow converts snake_case DB columns to these camelCase fields.
3937
4144
  */
3938
- interface OrganizationMembership {
3939
- object: 'organization_membership';
4145
+ type DeploymentStatus = 'deploying' | 'active' | 'failed' | 'rolled_back' | 'stopped';
4146
+ interface Deployment {
3940
4147
  id: string;
3941
- userId: string;
3942
4148
  organizationId: string;
3943
- role: {
3944
- slug: string;
3945
- };
3946
- status: 'active' | 'inactive';
4149
+ status: DeploymentStatus;
4150
+ sdkVersion: string;
4151
+ deploymentVersion: string | null;
4152
+ port: number | null;
4153
+ pid: number | null;
4154
+ tarballPath: string | null;
4155
+ errorMessage: string | null;
3947
4156
  createdAt: string;
3948
4157
  updatedAt: string;
3949
4158
  }
4159
+
3950
4160
  /**
3951
- * Extended membership with user and organization details for UI
4161
+ * GET /api/credentials - List credentials
3952
4162
  */
3953
- interface MembershipWithDetails extends OrganizationMembership {
3954
- user?: {
3955
- id: string;
3956
- email: string;
3957
- firstName?: string;
3958
- lastName?: string;
3959
- profilePictureUrl?: string;
3960
- };
3961
- organization?: {
3962
- id: string;
3963
- name: string;
3964
- workos_org_id: string;
3965
- primaryDomain?: string;
3966
- is_test?: boolean;
3967
- status?: string;
3968
- metadata?: Record<string, unknown>;
3969
- config?: Record<string, unknown>;
3970
- };
3971
- config?: MembershipFeatureConfig;
3972
- }
4163
+ declare const ListCredentialsResponseSchema: z.ZodObject<{
4164
+ credentials: z.ZodArray<z.ZodObject<{
4165
+ id: z.ZodString;
4166
+ name: z.ZodString;
4167
+ type: z.ZodString;
4168
+ provider: z.ZodNullable<z.ZodString>;
4169
+ createdAt: z.ZodString;
4170
+ }, z.core.$strip>>;
4171
+ }, z.core.$strip>;
4172
+ /** API response type for a single credential list item */
4173
+ type CredentialListItem = z.infer<typeof ListCredentialsResponseSchema>['credentials'][number];
3973
4174
 
3974
- interface OAuthToken extends Record<string, unknown> {
3975
- provider: string;
3976
- accessToken: string;
3977
- refreshToken: string;
3978
- expiresAt: string;
3979
- tokenType: 'Bearer';
3980
- scope?: string;
3981
- }
3982
- interface OAuthProviderConfig {
3983
- id: string;
4175
+ type Props$2 = {
4176
+ permission: PermissionKey | string;
4177
+ fallback?: ReactNode;
4178
+ children: ReactNode;
4179
+ };
4180
+ declare function Can({ permission, fallback, children }: Props$2): react_jsx_runtime.JSX.Element | null;
4181
+
4182
+ type Props$1 = {
4183
+ slug: string;
3984
4184
  name: string;
3985
- authUrl: string;
3986
- tokenUrl: string;
3987
- scopes?: string[];
3988
- authParams?: Record<string, string>;
3989
- tokenExchange: 'basic-auth' | 'form-encoded' | 'json-body';
3990
- usePKCE?: boolean;
3991
- customAuthFlow?: (config: OAuthProviderConfig, state: OAuthState) => URL;
3992
- customTokenExchange?: (code: string, config: OAuthProviderConfig) => Promise<OAuthToken>;
3993
- }
3994
- interface OAuthState {
3995
- organizationId: string;
3996
- nonce: string;
3997
- timestamp: number;
3998
- credentialName: string;
3999
- provider: string;
4000
- }
4185
+ isSystem: boolean;
4186
+ };
4187
+ declare function RoleBadge({ name, isSystem }: Props$1): react_jsx_runtime.JSX.Element;
4188
+
4189
+ type PermissionRow = PermissionDescriptor;
4190
+ type Props = {
4191
+ catalog: PermissionRow[];
4192
+ selectedKeys: string[];
4193
+ onChange?: (keys: string[]) => void;
4194
+ systemLocked?: boolean;
4195
+ };
4196
+ declare function PermissionMatrix({ catalog, selectedKeys, onChange, systemLocked }: Props): react_jsx_runtime.JSX.Element;
4001
4197
 
4002
- /**
4003
- * Time range selector for dashboard metrics
4004
- */
4005
- type TimeRange = '1h' | '24h' | '7d' | '30d';
4006
- /**
4007
- * Execution health metrics response
4008
- * Success rate, P95 duration, execution counts, and trend data
4009
- * trendData includes executionCount for throughput visualization (eliminates separate API call)
4010
- */
4011
- interface ExecutionHealthMetrics {
4012
- successRate: number;
4013
- p95Duration: number;
4014
- totalExecutions: number;
4015
- trendData: Array<{
4016
- time: string;
4017
- rate: number;
4018
- successCount: number;
4019
- errorCount: number;
4020
- warningCount: number;
4021
- executionCount: number;
4022
- }>;
4023
- statusCounts: {
4024
- success: number;
4025
- failed: number;
4026
- pending: number;
4027
- warning: number;
4028
- };
4029
- peakPeriod: string;
4030
- granularity: 'hour' | 'day';
4031
- }
4032
- /**
4033
- * Error analysis metrics response
4034
- * Error categories and top failing resources
4035
- */
4036
- interface ErrorAnalysisMetrics {
4037
- totalErrors: number;
4038
- errorsByCategory: Array<{
4039
- category: string;
4040
- count: number;
4041
- percentage: number;
4042
- }>;
4043
- topFailingResources: Array<{
4044
- resourceId: string;
4045
- name: string;
4046
- errorCount: number;
4047
- failureRate: number;
4048
- }>;
4049
- }
4050
- /**
4051
- * Business impact metrics response
4052
- * ROI, labor savings, and cost analysis
4053
- */
4054
- interface BusinessImpactMetrics {
4055
- totalSavingsUsd: number;
4056
- totalCostUsd: number;
4057
- netSavingsUsd: number;
4058
- roi: number;
4059
- }
4060
- /**
4061
- * Cost breakdown metrics response
4062
- * Per-resource cost analysis
4063
- */
4064
- interface CostBreakdownMetrics {
4065
- resources: Array<{
4066
- resourceId: string;
4067
- totalCostUsd: number;
4068
- executionCount: number;
4069
- avgCostUsd: number;
4198
+ declare function NoAccessState(): react_jsx_runtime.JSX.Element;
4199
+
4200
+ type CreateRoleModalProps = {
4201
+ opened: boolean;
4202
+ onClose: () => void;
4203
+ onCreated?: (roleId: string) => void;
4204
+ };
4205
+ declare function CreateRoleModal({ opened, onClose, onCreated }: CreateRoleModalProps): react_jsx_runtime.JSX.Element;
4206
+
4207
+ declare function showAuthError(error: unknown): void;
4208
+
4209
+ interface EmptyStateProps {
4210
+ /** Icon component to display (e.g., IconKey from @tabler/icons-react) */
4211
+ icon: ComponentType<{
4212
+ size: number;
4213
+ style?: React.CSSProperties;
4070
4214
  }>;
4071
- }
4072
- /** Time-bucketed health data point */
4073
- interface ResourceHealthDataPoint {
4074
- time: string;
4075
- success: number;
4076
- failure: number;
4077
- warning: number;
4078
- rate: number;
4079
- }
4080
- /** Health data for a single resource */
4081
- interface ResourceHealth {
4082
- entityType: string;
4083
- entityId: string;
4084
- entityName: string | null;
4085
- trendData: ResourceHealthDataPoint[];
4086
- summary: {
4087
- total: number;
4088
- successRate: number;
4215
+ /** Main title text */
4216
+ title: string;
4217
+ /** Description text shown below title */
4218
+ description?: string;
4219
+ /** Optional action button */
4220
+ action?: {
4221
+ label: string;
4222
+ onClick: () => void;
4223
+ icon?: ReactNode;
4089
4224
  };
4225
+ /** Vertical padding - defaults to 'xl' */
4226
+ py?: MantineSpacing;
4090
4227
  }
4091
4228
  /**
4092
- * Cost trend data point for time-series charts
4093
- * Represents a single time bucket (hour or day)
4229
+ * EmptyState - Reusable empty state component for lists and tables
4230
+ *
4231
+ * Consolidates the Center + Stack + Icon + Text pattern used across:
4232
+ * - ApiKeyList.tsx
4233
+ * - CredentialList.tsx
4234
+ * - Various other list components
4235
+ *
4236
+ * @example
4237
+ * ```tsx
4238
+ * <EmptyState
4239
+ * icon={IconKey}
4240
+ * title="No API keys yet"
4241
+ * description="Create your first API key to enable external integrations"
4242
+ * action={{ label: "Create API Key", onClick: handleCreate }}
4243
+ * />
4244
+ * ```
4094
4245
  */
4095
- interface CostTrendDataPoint {
4096
- time: string;
4097
- totalCostUsd: number;
4098
- executionCount: number;
4099
- avgCostPerExecution: number;
4246
+ declare function EmptyState({ icon: Icon, title, description, action, py }: EmptyStateProps): react_jsx_runtime.JSX.Element;
4247
+
4248
+ interface TabCountBadgeProps {
4249
+ count: number;
4250
+ isLoading?: boolean;
4100
4251
  }
4101
4252
  /**
4102
- * Cost trends response (time-series data)
4253
+ * A badge that displays a count in tabs with consistent sizing.
4254
+ * Uses a fixed-width container to prevent layout shift when switching
4255
+ * between the loading spinner and the count badge.
4103
4256
  */
4104
- interface CostTrendsResponse {
4105
- trendData: CostTrendDataPoint[];
4106
- granularity: 'hour' | 'day';
4107
- totalCostUsd: number;
4108
- totalExecutions: number;
4109
- }
4257
+ declare function TabCountBadge({ count, isLoading }: TabCountBadgeProps): react_jsx_runtime.JSX.Element;
4258
+
4110
4259
  /**
4111
- * Cost summary response with MTD and projections
4260
+ * TrendIndicator - Reusable component for showing percentage change trends
4261
+ * Displays up/down/flat arrow with colored badge
4112
4262
  */
4113
- interface CostSummaryResponse {
4114
- current: {
4115
- totalCostUsd: number;
4116
- executionCount: number;
4117
- };
4118
- previous: {
4119
- totalCostUsd: number;
4120
- executionCount: number;
4121
- };
4122
- mtd: {
4123
- totalCostUsd: number;
4124
- daysElapsed: number;
4125
- };
4126
- projection: {
4127
- monthlyCostUsd: number;
4128
- confidence: 'low' | 'medium' | 'high';
4129
- };
4130
- trend: {
4131
- changePercent: number;
4132
- direction: 'up' | 'down' | 'flat';
4133
- };
4263
+ interface TrendIndicatorProps {
4264
+ /** Current value */
4265
+ current: number;
4266
+ /** Previous value to compare against */
4267
+ previous: number;
4268
+ /** Optional formatter for the value (not used in display but kept for API compatibility) */
4269
+ formatter?: (value: number) => string;
4270
+ /** If true, negative change is considered positive (e.g., for costs) */
4271
+ inverse?: boolean;
4134
4272
  }
4135
4273
  /**
4136
- * Cost by model data for model-level breakdown
4274
+ * Shows a trend indicator with arrow icon and percentage change badge
4275
+ *
4276
+ * @example
4277
+ * // Positive trend (green when going up)
4278
+ * <TrendIndicator current={100} previous={80} />
4279
+ *
4280
+ * @example
4281
+ * // Inverse trend (green when going down, useful for costs)
4282
+ * <TrendIndicator current={100} previous={120} inverse />
4137
4283
  */
4138
- interface CostByModelData {
4139
- model: string;
4140
- totalCostUsd: number;
4141
- callCount: number;
4142
- totalInputTokens: number;
4143
- totalOutputTokens: number;
4144
- avgCostPerCall: number;
4284
+ declare function TrendIndicator({ current, previous, inverse }: TrendIndicatorProps): react_jsx_runtime.JSX.Element;
4285
+
4286
+ interface CollapsibleSectionProps {
4287
+ title: string | ReactNode;
4288
+ count?: number;
4289
+ countLabel?: string;
4290
+ children: ReactNode;
4291
+ emptyMessage?: string;
4292
+ defaultExpanded?: boolean;
4293
+ maxHeight?: number;
4145
4294
  }
4146
4295
  /**
4147
- * Cost by model response
4296
+ * Reusable collapsible section with header, badge, and scroll area
4297
+ * Used for expandable content like memory sections, logs, etc.
4148
4298
  */
4149
- interface CostByModelResponse {
4150
- models: CostByModelData[];
4151
- totalCostUsd: number;
4152
- totalCallCount: number;
4299
+ declare function CollapsibleSection({ title, count, countLabel, children, emptyMessage, defaultExpanded, maxHeight }: CollapsibleSectionProps): react_jsx_runtime.JSX.Element;
4300
+
4301
+ interface PageTitleCaptionProps {
4302
+ title: string;
4303
+ caption?: string;
4304
+ rightSection?: ReactNode;
4153
4305
  }
4306
+ declare const PageTitleCaption: ({ title, caption, rightSection }: PageTitleCaptionProps) => react_jsx_runtime.JSX.Element;
4154
4307
 
4308
+ interface StatsCardSkeletonProps {
4309
+ /** Height of the loader area - defaults to 200 */
4310
+ chartHeight?: number;
4311
+ /** Kept for API compat, unused */
4312
+ withChart?: boolean;
4313
+ /** Kept for API compat, unused */
4314
+ statCount?: 2 | 3;
4315
+ }
4155
4316
  /**
4156
- * Base Execution Engine type definitions
4157
- * Core types shared across all Execution Engine resources
4317
+ * StatsCardSkeleton - Loading state for dashboard metric cards
4318
+ *
4319
+ * Used across:
4320
+ * - ExecutionHealthCard.tsx
4321
+ * - CostMetricsCard.tsx
4322
+ * - ThroughputCard.tsx
4323
+ * - BusinessImpactCard.tsx
4158
4324
  */
4159
-
4325
+ declare function StatsCardSkeleton({ chartHeight }: StatsCardSkeletonProps): react_jsx_runtime.JSX.Element;
4326
+ interface ListSkeletonProps {
4327
+ /** Number of rows (used to calculate height) - defaults to 3 */
4328
+ rows?: number;
4329
+ /** Height of each row - defaults to 50 */
4330
+ rowHeight?: number;
4331
+ }
4160
4332
  /**
4161
- * NOTE: AIResource interface has been removed and replaced with ResourceDefinition
4162
- * from registry/types.ts. All resources (executable and non-executable) now extend
4163
- * the unified ResourceDefinition base interface.
4333
+ * ListSkeleton - Loading state for table/list content
4164
4334
  *
4165
- * AgentConfig and WorkflowConfig now extend ResourceDefinition directly.
4166
- * See packages/core/src/registry/types.ts for the base interface definition.
4335
+ * Used across:
4336
+ * - ApiKeyList.tsx
4337
+ * - CredentialList.tsx
4338
+ * - DeploymentList.tsx
4339
+ * - WebhookEndpointList.tsx
4167
4340
  */
4168
- type AIResourceDefinition = SerializedWorkflowDefinition | SerializedAgentDefinition;
4169
-
4341
+ declare function ListSkeleton({ rows, rowHeight }: ListSkeletonProps): react_jsx_runtime.JSX.Element;
4342
+ interface DetailCardSkeletonProps {
4343
+ /** Number of detail rows (used to calculate height) - defaults to 3 */
4344
+ rows?: number;
4345
+ }
4170
4346
  /**
4171
- * Resource Registry type definitions
4347
+ * DetailCardSkeleton - Loading state for cards with list of detail items
4348
+ *
4349
+ * Used for cards like CostBreakdownCard
4172
4350
  */
4351
+ declare function DetailCardSkeleton({ rows }: DetailCardSkeletonProps): react_jsx_runtime.JSX.Element;
4173
4352
 
4353
+ interface NavigationButtonProps {
4354
+ /** Icon component to display */
4355
+ icon: React__default.ComponentType<{
4356
+ size?: number;
4357
+ stroke?: number;
4358
+ }>;
4359
+ /** Button label text */
4360
+ label: string;
4361
+ /** Whether the button is in collapsed state (hides text) */
4362
+ isCollapsed?: boolean;
4363
+ /** Whether this button has sub-items/links */
4364
+ hasSubItems?: boolean;
4365
+ /** Whether sub-items are expanded (controls chevron rotation) */
4366
+ isExpanded?: boolean;
4367
+ /** Whether the icon and text should be styled as active */
4368
+ isActive?: boolean;
4369
+ /** Whether the background should be styled as active */
4370
+ hasActiveBackground?: boolean;
4371
+ /** Click handler */
4372
+ onClick?: () => void;
4373
+ /** Additional styles for the button container */
4374
+ style?: React__default.CSSProperties;
4375
+ /** Custom transition duration in ms */
4376
+ transitionDuration?: number;
4377
+ }
4378
+ declare const NavigationButton: React__default.FC<NavigationButtonProps>;
4379
+
4380
+ interface CustomSelectorProps {
4381
+ value: string | null;
4382
+ onChange: (value: string | null) => void;
4383
+ data: {
4384
+ value: string;
4385
+ label: string;
4386
+ }[] | readonly {
4387
+ value: string;
4388
+ label: string;
4389
+ }[];
4390
+ leftSection?: ReactNode;
4391
+ placeholder?: string;
4392
+ w?: number | string;
4393
+ withCheckIcon?: boolean;
4394
+ disabled?: boolean;
4395
+ }
4396
+ declare function CustomSelector({ value, onChange, data, leftSection, placeholder, w, withCheckIcon, disabled }: CustomSelectorProps): react_jsx_runtime.JSX.Element;
4397
+
4398
+ interface APIErrorAlertProps {
4399
+ /**
4400
+ * The error to display. Can be an APIClientError, generic Error, or any unknown value.
4401
+ */
4402
+ error: unknown;
4403
+ /**
4404
+ * Optional title override. If not provided, uses getErrorTitle() based on error code.
4405
+ */
4406
+ title?: string;
4407
+ /**
4408
+ * Whether to show the request ID (if available). Defaults to true.
4409
+ */
4410
+ showRequestId?: boolean;
4411
+ /**
4412
+ * Optional custom icon. Defaults to IconAlertCircle.
4413
+ */
4414
+ icon?: React.ReactNode;
4415
+ /**
4416
+ * Alert color. Defaults to 'red'.
4417
+ */
4418
+ color?: string;
4419
+ }
4174
4420
  /**
4175
- * Environment/deployment status for resources
4176
- */
4177
- type ResourceStatus = 'dev' | 'prod';
4178
- /**
4179
- * All resource types in the platform
4180
- * Used as the discriminator field in ResourceDefinition
4421
+ * Alert component for displaying API errors with type-safe error handling.
4422
+ *
4423
+ * Automatically extracts error message, code, and request ID from APIClientError
4424
+ * or falls back to generic Error handling.
4425
+ *
4426
+ * @example
4427
+ * ```tsx
4428
+ * const { data, error } = useQuery(...)
4429
+ *
4430
+ * if (error) {
4431
+ * return <APIErrorAlert error={error} />
4432
+ * }
4433
+ * ```
4434
+ *
4435
+ * @example With custom title
4436
+ * ```tsx
4437
+ * <APIErrorAlert
4438
+ * error={error}
4439
+ * title="Failed to load resources"
4440
+ * />
4441
+ * ```
4442
+ *
4443
+ * @example Without request ID
4444
+ * ```tsx
4445
+ * <APIErrorAlert
4446
+ * error={error}
4447
+ * showRequestId={false}
4448
+ * />
4449
+ * ```
4181
4450
  */
4182
- type ResourceType = 'agent' | 'workflow' | 'trigger' | 'integration' | 'external' | 'human';
4451
+ declare function APIErrorAlert({ error, title, showRequestId, icon, color }: APIErrorAlertProps): react_jsx_runtime.JSX.Element;
4452
+
4453
+ interface CenteredErrorStateProps {
4454
+ error: unknown;
4455
+ title?: string;
4456
+ /** Minimum height of the centering container. Defaults to 300. */
4457
+ h?: number | string;
4458
+ /** Vertical padding (used when h is not set). */
4459
+ py?: MantineSpacing;
4460
+ }
4183
4461
  /**
4184
- * Base interface for ALL platform resources
4185
- * Shared by both executable (agents, workflows) and non-executable (triggers, integrations, etc.) resources
4462
+ * CenteredErrorState - Displays an error centered inside its container.
4463
+ *
4464
+ * The caller is responsible for providing the container (e.g. `<Paper withBorder>`).
4465
+ * This component only handles centering + rendering the error alert.
4466
+ *
4467
+ * @example
4468
+ * ```tsx
4469
+ * if (error) {
4470
+ * return (
4471
+ * <Paper withBorder>
4472
+ * <CenteredErrorState error={error} title="Failed to load trends" />
4473
+ * </Paper>
4474
+ * )
4475
+ * }
4476
+ * ```
4186
4477
  */
4187
- interface ResourceDefinition {
4188
- /** Unique resource identifier */
4189
- resourceId: string;
4190
- /** Display name */
4191
- name: string;
4192
- /** Purpose and functionality description */
4193
- description: string;
4194
- /** Version for change tracking and evolution */
4195
- version: string;
4196
- /** Resource type discriminator */
4197
- type: ResourceType;
4198
- /** Environment/deployment status */
4199
- status: ResourceStatus;
4200
- /** Graph links to Organization Model nodes */
4201
- links?: ResourceLink[];
4202
- /** Infrastructure category for filtering */
4203
- category?: ResourceCategory;
4204
- /** Whether the agent supports multi-turn sessions (agents only) */
4205
- sessionCapable?: boolean;
4206
- /** Whether the resource is local (monorepo) or remote (externally deployed) */
4207
- origin?: 'local' | 'remote';
4208
- /** Whether this resource is archived and should be excluded from registration and deployment */
4209
- archived?: boolean;
4210
- }
4211
-
4212
- declare const LinkSchema: z.ZodObject<{
4213
- nodeId: z.ZodString;
4214
- kind: z.ZodEnum<{
4215
- contains: "contains";
4216
- references: "references";
4217
- exposes: "exposes";
4218
- maps_to: "maps_to";
4219
- "operates-on": "operates-on";
4220
- uses: "uses";
4221
- }>;
4222
- }, z.core.$strip>;
4223
- type Link = z.infer<typeof LinkSchema>;
4224
-
4225
- declare const ResourceCategorySchema: z.ZodEnum<{
4226
- production: "production";
4227
- diagnostic: "diagnostic";
4228
- internal: "internal";
4229
- testing: "testing";
4230
- }>;
4231
- type ResourceCategory = z.infer<typeof ResourceCategorySchema>;
4232
- type ResourceLink = Link;
4478
+ declare function CenteredErrorState({ error, title, h, py }: CenteredErrorStateProps): react_jsx_runtime.JSX.Element;
4233
4479
 
4234
- type ExecutionStatus = 'pending' | 'running' | 'completed' | 'failed' | 'warning';
4235
- interface APIExecutionSummary {
4236
- id: string;
4237
- status: ExecutionStatus;
4238
- startTime: number;
4239
- endTime?: number;
4240
- resourceStatus?: ResourceStatus;
4480
+ interface StatCardBaseProps {
4481
+ /** The label/description text */
4482
+ label: string;
4483
+ /** The value to display (number or formatted string) */
4484
+ value: string | number;
4485
+ /** Tabler icon component */
4486
+ icon: Icon;
4487
+ /** Optional extra content rendered below the label */
4488
+ children?: ReactNode;
4241
4489
  }
4242
- interface APIExecutionDetail extends APIExecutionSummary {
4243
- executionLogs: ExecutionLogMessage[];
4244
- input?: unknown;
4245
- result?: unknown;
4246
- error?: string;
4247
- resourceStatus: ResourceStatus;
4248
- apiVersion?: string | null;
4249
- resourceVersion?: string | null;
4250
- sdkVersion?: string | null;
4251
- isArchived?: boolean;
4252
- archivedLogCount?: number;
4490
+ interface StatCardDefaultProps extends StatCardBaseProps {
4491
+ variant?: 'default';
4492
+ /** Theme color for the icon (defaults to theme primary) */
4493
+ color?: MantineColor;
4494
+ isLoading?: never;
4495
+ valueColor?: never;
4253
4496
  }
4254
-
4497
+ interface StatCardHeroProps extends StatCardBaseProps {
4498
+ variant: 'hero';
4499
+ /** Whether data is loading */
4500
+ isLoading?: boolean;
4501
+ /** Custom color for the value text */
4502
+ valueColor?: string;
4503
+ /** Card sizing — 'sm' (default) for compact layouts, 'md' for spacious layouts */
4504
+ size?: 'sm' | 'md';
4505
+ color?: never;
4506
+ }
4507
+ type StatCardProps = StatCardDefaultProps | StatCardHeroProps;
4255
4508
  /**
4256
- * Resource Type Metadata
4509
+ * StatCard - Stat display card with icon, label, and value.
4257
4510
  *
4258
- * Centralized metadata for ResourceDefinition types including icon names and colors.
4259
- * Icon names reference @tabler/icons-react - UI layer maps these to actual components.
4511
+ * Supports two variants:
4512
+ * - `default`: Compact card with ThemeIcon (used in admin overviews)
4513
+ * - `hero`: Glass card with glowing icon ring (used on dashboards)
4514
+ *
4515
+ * @example
4516
+ * ```tsx
4517
+ * // Default variant
4518
+ * <StatCard label="Total Executions" value={150} icon={IconPlayerPlay} color="blue" />
4519
+ *
4520
+ * // Hero variant
4521
+ * <StatCard variant="hero" label="Executions" value={43} icon={IconPlayerPlay} isLoading={false} />
4522
+ * ```
4260
4523
  */
4261
-
4524
+ declare function StatCard(props: StatCardProps): react_jsx_runtime.JSX.Element;
4262
4525
  /**
4263
- * Node color types for graph visualization
4264
- * Used by both @repo/core (metadata) and @repo/ui (components)
4526
+ * StatCardSkeleton - Loading skeleton for StatCard (default variant)
4265
4527
  */
4266
- type NodeColorType = 'violet' | 'blue' | 'orange' | 'teal' | 'gray' | 'yellow';
4528
+ declare function StatCardSkeleton(): react_jsx_runtime.JSX.Element;
4267
4529
 
4268
- type ActivityType = 'workflow_execution' | 'agent_run' | 'hitl_action' | 'webhook_received' | 'webhook_executed' | 'webhook_failed' | 'credential_change' | 'api_key_change' | 'deployment_change' | 'membership_change';
4269
- type ActivityStatus = 'success' | 'failure' | 'pending' | 'approved' | 'rejected' | 'completed';
4270
- interface Activity {
4271
- id: string;
4272
- organizationId: string;
4273
- activityType: ActivityType;
4274
- status: ActivityStatus;
4275
- title: string;
4276
- description: string | null;
4277
- entityType: string;
4278
- entityId: string;
4279
- entityName: string | null;
4280
- metadata: Record<string, unknown> | null;
4281
- actorId: string | null;
4282
- actorType: string | null;
4283
- occurredAt: Date;
4284
- createdAt: Date;
4530
+ interface StyledMarkdownProps {
4531
+ /** Markdown content to render */
4532
+ children: string;
4533
+ /** Custom component overrides */
4534
+ components?: Partial<Components>;
4535
+ /** Additional class name */
4536
+ className?: string;
4537
+ /** Inline styles for the wrapper div */
4538
+ style?: React.CSSProperties;
4285
4539
  }
4286
-
4287
4540
  /**
4288
- * Execution Runner Types
4541
+ * Styled markdown renderer with Mantine components and syntax highlighting
4289
4542
  *
4290
- * Shared types for the Execution Runner UI feature.
4291
- * Used by both API (apps/api) and frontend (apps/command-center).
4543
+ * Features:
4544
+ * - Colored headings using theme primary color
4545
+ * - Syntax-highlighted code blocks (oneDark theme, no token backgrounds)
4546
+ * - Styled inline code with Mantine Code component
4547
+ * - Styled blockquotes with left border
4548
+ * - Proper list styling
4549
+ *
4550
+ * @example
4551
+ * ```tsx
4552
+ * import { StyledMarkdown } from '@repo/ui'
4553
+ *
4554
+ * <StyledMarkdown>{markdownContent}</StyledMarkdown>
4555
+ * ```
4292
4556
  */
4557
+ declare function StyledMarkdown({ children, components, className, style }: StyledMarkdownProps): react_jsx_runtime.JSX.Element;
4293
4558
 
4294
- interface ExecutionRunnerCatalogItem {
4295
- resourceId: string;
4296
- resourceName: string;
4297
- resourceType: 'workflow' | 'agent';
4298
- description?: string;
4299
- status: 'dev' | 'prod';
4300
- version: string;
4301
- interface: SerializedExecutionInterface;
4559
+ interface JsonViewerProps {
4560
+ /** JSON data to display (will be stringified) or pre-formatted JSON string */
4561
+ data: unknown;
4562
+ /** Maximum height with scroll (e.g., '300px'). If not set, expands to content */
4563
+ maxHeight?: string | number;
4564
+ /** Font size override */
4565
+ fontSize?: string | number;
4302
4566
  }
4303
-
4304
4567
  /**
4305
- * Deployment types browser-safe
4568
+ * Syntax-highlighted JSON viewer component
4306
4569
  *
4307
- * Canonical API response types for the deployment resource.
4308
- * The API's transformRow converts snake_case DB columns to these camelCase fields.
4570
+ * @example
4571
+ * ```tsx
4572
+ * import { JsonViewer } from '@repo/ui'
4573
+ *
4574
+ * <JsonViewer data={{ foo: 'bar', count: 42 }} />
4575
+ * <JsonViewer data={apiResponse} maxHeight={300} />
4576
+ * ```
4309
4577
  */
4310
- type DeploymentStatus = 'deploying' | 'active' | 'failed' | 'rolled_back' | 'stopped';
4311
- interface Deployment {
4312
- id: string;
4313
- organizationId: string;
4314
- status: DeploymentStatus;
4315
- sdkVersion: string;
4316
- deploymentVersion: string | null;
4317
- port: number | null;
4318
- pid: number | null;
4319
- tarballPath: string | null;
4320
- errorMessage: string | null;
4321
- createdAt: string;
4322
- updatedAt: string;
4323
- }
4578
+ declare function JsonViewer({ data, maxHeight, fontSize }: JsonViewerProps): react_jsx_runtime.JSX.Element;
4324
4579
 
4580
+ interface ContextViewerProps {
4581
+ /** Any JSON-serializable data to display in a human-readable format */
4582
+ data: unknown;
4583
+ }
4325
4584
  /**
4326
- * GET /api/credentials - List credentials
4585
+ * Auto-formats any JSON context into a human-readable layout.
4586
+ *
4587
+ * - Strings → rendered as markdown (supports formatting, lists, tables)
4588
+ * - Flat key-value objects → labeled field list
4589
+ * - Nested objects → indented subsections with left border
4590
+ * - Arrays → bulleted lists or bordered cards
4591
+ * - null/undefined/boolean/number → inline text
4592
+ *
4593
+ * No display configuration needed — the component infers layout from data shape.
4327
4594
  */
4328
- declare const ListCredentialsResponseSchema: z.ZodObject<{
4329
- credentials: z.ZodArray<z.ZodObject<{
4330
- id: z.ZodString;
4331
- name: z.ZodString;
4332
- type: z.ZodString;
4333
- provider: z.ZodNullable<z.ZodString>;
4334
- createdAt: z.ZodString;
4335
- }, z.core.$strip>>;
4336
- }, z.core.$strip>;
4337
- /** API response type for a single credential list item */
4338
- type CredentialListItem = z.infer<typeof ListCredentialsResponseSchema>['credentials'][number];
4595
+ declare function ContextViewer({ data }: ContextViewerProps): react_jsx_runtime.JSX.Element;
4339
4596
 
4340
4597
  interface TimeRangeSelectorProps {
4341
4598
  value: TimeRange;
@@ -4446,7 +4703,7 @@ interface ICustomModalProps {
4446
4703
  children: React__default.ReactNode | React__default.ReactNode[] | string;
4447
4704
  loading?: boolean;
4448
4705
  style?: React__default.CSSProperties;
4449
- size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
4706
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full' | string;
4450
4707
  }
4451
4708
  declare const CustomModal: ({ children, opened, onClose, loading, style, size }: ICustomModalProps) => react_jsx_runtime.JSX.Element;
4452
4709
 
@@ -4633,7 +4890,8 @@ interface CreateCredentialResponse {
4633
4890
  declare const WebhookEndpointResponseSchema: z.ZodObject<{
4634
4891
  id: z.ZodString;
4635
4892
  organizationId: z.ZodString;
4636
- key: z.ZodString;
4893
+ key: z.ZodOptional<z.ZodString>;
4894
+ keyPrefix: z.ZodNullable<z.ZodString>;
4637
4895
  name: z.ZodString;
4638
4896
  description: z.ZodNullable<z.ZodString>;
4639
4897
  resourceId: z.ZodNullable<z.ZodString>;
@@ -6296,6 +6554,9 @@ type FeatureIconComponent = ComponentType<{
6296
6554
  size?: number;
6297
6555
  stroke?: number;
6298
6556
  }>;
6557
+ type FeatureSidebarWidthResolver = number | ((context: {
6558
+ currentPath: string;
6559
+ }) => number);
6299
6560
  interface FeatureModule {
6300
6561
  /** Unique stable identifier for this feature module. */
6301
6562
  key: string;
@@ -6307,6 +6568,8 @@ interface FeatureModule {
6307
6568
  icon?: FeatureIconComponent;
6308
6569
  /** Sidebar component rendered when this feature's subtree route is active. */
6309
6570
  sidebar?: FeatureSidebarComponent;
6571
+ /** Optional shell sidebar width override. Defaults to 250px. */
6572
+ sidebarWidth?: FeatureSidebarWidthResolver;
6310
6573
  /** Operations-only bridge connecting this feature to the organization graph node. */
6311
6574
  organizationGraph?: OrganizationGraphFeatureBridge;
6312
6575
  }
@@ -6476,5 +6739,5 @@ declare const OperationsSidebarMiddle: () => react_jsx_runtime.JSX.Element;
6476
6739
 
6477
6740
  declare const operationsManifest: FeatureModule;
6478
6741
 
6479
- export { APIErrorAlert, AbsoluteScheduleForm, ActionModal, ActivityCard, ActivityFeedWidget, ActivityFilters as ActivityFiltersBar, ActivityTable, ActivityTimeline, AgentDefinitionDisplay, AgentExecutionLogs, AgentExecutionTimeline, AgentExecutionVisualizer, AgentIterationEdge, AgentIterationNode, AllTasksPage, ApiKeyDisplayModal, ApiKeyList, ApiKeySettings, BaseEdge, BaseExecutionLogs, BaseExecutionLogsHeader, BaseExecutionLogsStates, BaseNode, Breadcrumbs, BusinessImpactCard, CONTAINER_CONSTANTS, CardHeader, CenteredErrorState, CheckpointGroup, CollapsibleJsonSection, CollapsibleSection, CommandQueueSidebar, CommandQueueSidebarMiddle, CommandQueueSidebarTop, CommandQueueTaskRow, CommandViewEdge, CommandViewGraph, CommandViewNode, ConfigCard, ConfirmationInputModal, ConfirmationModal, ContentSections, ContextUsageBadge, ContextViewer, ContractDisplay, CostBreakdownCard, CostByModelTable, CostMetricsCard, CrashErrorFallback, CreateApiKeyModal, CreateCredentialModal, CreateScheduleModal, CredentialList, CredentialSettings, CrmOverview, CrmSidebar, CrmSidebarMiddle, CrmSidebarTop, CustomModal, CustomSelector, DEAL_STAGES, DEFAULT_KANBAN_CONFIG, DealDetailPage, DealDrawer, DealKanbanCard, DealsListPage, DeleteScheduleModal, DeploymentDetailModal, DeploymentList, DeploymentSettings, DeploymentStatusBadge, DetailCardSkeleton, EditApiKeyModal, ElevasisLoader, EmptyState, EmptyVisualizer, ErrorAnalysisCard, ErrorBreakdownTable, ErrorReportCard, ExecutionBreakdownTable, ExecutionErrorSection, ExecutionHealthCard, ExecutionLogsFilters as ExecutionLogsFilterBar, ExecutionLogsTable, ExecutionStats, ExecutionStatusBadge, FeatureUnavailableState, FilterBar, FormFieldRenderer, GlowDot, GraphBackground, GraphContainer, GraphFitViewButton, GraphFitViewHandler, GraphLegend, HealthStatusCard, JsonViewer, KanbanBoard, LEAD_GEN_ROUTE_LINKS, LIST_TEMPLATE_OPTIONS, LeadGenCompaniesPage, LeadGenContactsPage, LeadGenListDetailPage, LeadGenListsPage, LeadGenOverviewPage, LeadGenRouteShell, LeadGenSidebar, LeadGenSidebarMiddle, LeadGenSidebarTop, ListSkeleton, LogEntry, LogGroup, MdxRenderer, MembershipFeaturePanel, MembershipStatusBadge, MetricsStrip, MilestoneTimeline, MyTasksPanel, NavigationButton, NewKnowledgeMapEdge, NewKnowledgeMapGraph, NewKnowledgeMapNode, NotificationBell, NotificationItem, NotificationList, NotificationPanel, OAuthConnectModal, OperationsSidebar, OperationsSidebarMiddle, OperationsSidebarTop, OrganizationMembershipsList, PIPELINE_FUNNEL_ORDER, PageNotFound, PageTitleCaption, PipelineFunnelWidget, ProjectDetailPage, ProjectsListPage, ProjectsSidebar, ProjectsSidebarMiddle, ProjectsSidebarTop, QuickCreateActions, RecurringScheduleForm, RelativeScheduleForm, ResourceCard, ResourceDefinitionSection, ResourceErrorState, ResourceFilter, ResourceHeader, ResourceHealthChart, ResourceHealthPanel, ResourceNotFoundState, RichTextEditor, RunResourceButton, SAVED_VIEW_PRESETS, SEOSidebar, SEOSidebarMiddle, SEOSidebarTop, SHARED_VIZ_CONSTANTS, SavedViewsPanel, ScheduleCard, ScheduleDetailModal, ScheduleTypeSelector, SessionMemory, SortableHeader, StatCard, StatCardSkeleton, StatsCardSkeleton, StatusBadge, StyledMarkdown, TabCountBadge, TableSelectionToolbar, TaskCard, TaskScheduler, TasksDueWidget, TimeRangeSelector, TimelineAxis, TimelineBar, TimelineContainer, TimelineRow, ToolsListDisplay, TrendIndicator, UnifiedWorkflowEdge, UnifiedWorkflowGraph, UnifiedWorkflowNode, UpcomingMilestonesPage, VisualizerContainer, WebhookUrlDisplayModal, WorkflowDefinitionDisplay, WorkflowExecutionLogs, WorkflowExecutionTimeline, ZodFormRenderer, buildErrorReport, buildListConfig, calculateProgress, catalogItemToResourceDefinition, crmManifest, deliveryManifest, formatStatusLabel, getEnrichmentColor, getExecutionStatusConfig, getGraphBackgroundStyles, getHealthColor, getIcon, getLogLevelConfig, getStatusColor, iconMap, leadGenManifest, mdxComponents, milestoneStatusColors, monitoringManifest, noteTypeColors, operationsManifest, projectStatusColors, seoManifest, settingsManifest, showApiErrorNotification, showErrorNotification, showInfoNotification, showSuccessNotification, showWarningNotification, taskStatusColors, taskTypeColors, useCrmPipelineSummary, useCrmQuickMetrics, useDeleteLists, useGraphBackgroundStyles, useGraphTheme, useNewKnowledgeMapLayout, useRecentCrmActivity };
6480
- export type { ActivityEntry, ActivityFiltersProps, ActivityTableProps, BaseEdgeProps, BaseExecutionLogsProps, BreadcrumbsProps, CommandViewGraphRef, ContextViewerProps, CostByModelTableProps, CrashErrorFallbackProps, CrmOverviewProps, DealDrawerProps, DealKanbanCardProps, ErrorAnalysisCardProps, ErrorReportCardProps, ExecutionBreakdownTableProps, ExecutionHealthCardProps, ExecutionLogEntry, ExecutionLogsFiltersProps, ExecutionLogsTableProps, FeatureUnavailableStateProps, FitViewButtonVariant, FormFieldRendererProps, GraphFitViewHandlerProps, JsonViewerProps, KanbanBoardProps, KnowledgeMapEdgeData, KnowledgeMapNodeData, LogLevel, MdxRendererProps, NavigationButtonProps, ProjectsSidebarMiddleProps, ResourceHealthPanelProps, RichTextEditorProps, RunResourceButtonProps, RunResourceInputResolver, SavedViewPreset, ScheduleType, SerializedKnowledgeMap, SerializedKnowledgeNode, StatCardProps, StyledMarkdownProps, TaskFilterStatus, TrendIndicatorProps, ZodFormRendererProps };
6742
+ export { APIErrorAlert, AbsoluteScheduleForm, ActionModal, ActivityCard, ActivityFeedWidget, ActivityFilters as ActivityFiltersBar, ActivityTable, ActivityTimeline, AgentDefinitionDisplay, AgentExecutionLogs, AgentExecutionTimeline, AgentExecutionVisualizer, AgentIterationEdge, AgentIterationNode, AllTasksPage, ApiKeyDisplayModal, ApiKeyList, ApiKeySettings, BaseEdge, BaseExecutionLogs, BaseExecutionLogsHeader, BaseExecutionLogsStates, BaseNode, Breadcrumbs, BusinessImpactCard, CONTAINER_CONSTANTS, Can, CardHeader, CenteredErrorState, CheckpointGroup, CollapsibleJsonSection, CollapsibleSection, CommandQueueSidebar, CommandQueueSidebarMiddle, CommandQueueSidebarTop, CommandQueueTaskRow, CommandViewEdge, CommandViewGraph, CommandViewNode, ConfigCard, ConfirmationInputModal, ConfirmationModal, ContentSections, ContextUsageBadge, ContextViewer, ContractDisplay, CostBreakdownCard, CostByModelTable, CostMetricsCard, CrashErrorFallback, CreateApiKeyModal, CreateCredentialModal, CreateRoleModal, CreateScheduleModal, CredentialList, CredentialSettings, CrmOverview, CrmSidebar, CrmSidebarMiddle, CrmSidebarTop, CustomModal, CustomSelector, DEAL_STAGES, DEFAULT_KANBAN_CONFIG, DealDetailPage, DealDrawer, DealKanbanCard, DealsListPage, DeleteScheduleModal, DeploymentDetailModal, DeploymentList, DeploymentSettings, DeploymentStatusBadge, DetailCardSkeleton, EditApiKeyModal, ElevasisLoader, EmptyState, EmptyVisualizer, ErrorAnalysisCard, ErrorBreakdownTable, ErrorReportCard, ExecutionBreakdownTable, ExecutionErrorSection, ExecutionHealthCard, ExecutionLogsFilters as ExecutionLogsFilterBar, ExecutionLogsTable, ExecutionStats, ExecutionStatusBadge, FeatureUnavailableState, FilterBar, FormFieldRenderer, GlowDot, GraphBackground, GraphContainer, GraphFitViewButton, GraphFitViewHandler, GraphLegend, HealthStatusCard, JsonViewer, KanbanBoard, LEAD_GEN_ROUTE_LINKS, LIST_TEMPLATE_OPTIONS, LeadGenCompaniesPage, LeadGenContactsPage, LeadGenListDetailPage, LeadGenListsPage, LeadGenOverviewPage, LeadGenRouteShell, LeadGenSidebar, LeadGenSidebarMiddle, LeadGenSidebarTop, ListSkeleton, LogEntry, LogGroup, MdxRenderer, MembershipFeaturePanel, MembershipStatusBadge, MetricsStrip, MilestoneTimeline, MyTasksPanel, NavigationButton, NewKnowledgeMapEdge, NewKnowledgeMapGraph, NewKnowledgeMapNode, NoAccessState, NotificationBell, NotificationItem, NotificationList, NotificationPanel, OAuthConnectModal, OperationsSidebar, OperationsSidebarMiddle, OperationsSidebarTop, OrganizationMembershipsList, PIPELINE_FUNNEL_ORDER, PageNotFound, PageTitleCaption, PermissionMatrix, PipelineFunnelWidget, ProjectDetailPage, ProjectsListPage, ProjectsSidebar, ProjectsSidebarMiddle, ProjectsSidebarTop, QuickCreateActions, RecurringScheduleForm, RelativeScheduleForm, ResourceCard, ResourceDefinitionSection, ResourceErrorState, ResourceFilter, ResourceHeader, ResourceHealthChart, ResourceHealthPanel, ResourceNotFoundState, RichTextEditor, RoleBadge, RunResourceButton, SAVED_VIEW_PRESETS, SEOSidebar, SEOSidebarMiddle, SEOSidebarTop, SHARED_VIZ_CONSTANTS, SavedViewsPanel, ScheduleCard, ScheduleDetailModal, ScheduleTypeSelector, SessionMemory, SortableHeader, StatCard, StatCardSkeleton, StatsCardSkeleton, StatusBadge, StyledMarkdown, TabCountBadge, TableSelectionToolbar, TaskCard, TaskScheduler, TasksDueWidget, TimeRangeSelector, TimelineAxis, TimelineBar, TimelineContainer, TimelineRow, ToolsListDisplay, TrendIndicator, UnifiedWorkflowEdge, UnifiedWorkflowGraph, UnifiedWorkflowNode, UpcomingMilestonesPage, VisualizerContainer, WebhookUrlDisplayModal, WorkflowDefinitionDisplay, WorkflowExecutionLogs, WorkflowExecutionTimeline, ZodFormRenderer, buildErrorReport, buildListConfig, calculateProgress, catalogItemToResourceDefinition, crmManifest, deliveryManifest, formatStatusLabel, getEnrichmentColor, getExecutionStatusConfig, getGraphBackgroundStyles, getHealthColor, getIcon, getLogLevelConfig, getStatusColor, iconMap, leadGenManifest, mdxComponents, milestoneStatusColors, monitoringManifest, noteTypeColors, operationsManifest, projectStatusColors, seoManifest, settingsManifest, showApiErrorNotification, showAuthError, showErrorNotification, showInfoNotification, showSuccessNotification, showWarningNotification, taskStatusColors, taskTypeColors, useCrmPipelineSummary, useCrmQuickMetrics, useDeleteLists, useGraphBackgroundStyles, useGraphTheme, useNewKnowledgeMapLayout, useRecentCrmActivity };
6743
+ export type { ActivityEntry, ActivityFiltersProps, ActivityTableProps, BaseEdgeProps, BaseExecutionLogsProps, BreadcrumbsProps, CommandViewGraphRef, ContextViewerProps, CostByModelTableProps, CrashErrorFallbackProps, CreateRoleModalProps, CrmOverviewProps, DealDrawerProps, DealKanbanCardProps, ErrorAnalysisCardProps, ErrorReportCardProps, ExecutionBreakdownTableProps, ExecutionHealthCardProps, ExecutionLogEntry, ExecutionLogsFiltersProps, ExecutionLogsTableProps, FeatureUnavailableStateProps, FitViewButtonVariant, FormFieldRendererProps, GraphFitViewHandlerProps, JsonViewerProps, KanbanBoardProps, KnowledgeMapEdgeData, KnowledgeMapNodeData, LogLevel, MdxRendererProps, NavigationButtonProps, PermissionRow, ProjectsSidebarMiddleProps, ResourceHealthPanelProps, RichTextEditorProps, RunResourceButtonProps, RunResourceInputResolver, SavedViewPreset, ScheduleType, SerializedKnowledgeMap, SerializedKnowledgeNode, StatCardProps, StyledMarkdownProps, TaskFilterStatus, TrendIndicatorProps, ZodFormRendererProps };