@elevasis/ui 2.70.0 → 2.71.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 (57) hide show
  1. package/dist/app/index.d.ts +26 -0
  2. package/dist/app/index.js +5 -5
  3. package/dist/auth/index.js +1 -1
  4. package/dist/charts/index.js +1 -1
  5. package/dist/{chunk-LWYLZUUV.js → chunk-3BLYJT5L.js} +2 -2
  6. package/dist/{chunk-QDMIFD6F.js → chunk-AIOV5NM7.js} +1 -1
  7. package/dist/{chunk-TJMZUL6E.js → chunk-BM2WKRAQ.js} +1 -1
  8. package/dist/{chunk-DUEGHF7A.js → chunk-CPBT6Z2G.js} +2 -2
  9. package/dist/{chunk-SMH6SQQE.js → chunk-DCMFNSJ6.js} +1 -1
  10. package/dist/{chunk-GJQF3S2Q.js → chunk-DH2MO5DX.js} +1 -1
  11. package/dist/{chunk-5C62IRKS.js → chunk-H3SDGC5F.js} +2 -2
  12. package/dist/{chunk-XKUEO4HG.js → chunk-JTSNU6KA.js} +2 -2
  13. package/dist/{chunk-LY3IKYTZ.js → chunk-LL5H7J4N.js} +1 -1
  14. package/dist/{chunk-AGX2CY2O.js → chunk-TB2PM2OU.js} +1 -1
  15. package/dist/{chunk-CCZJ4OWY.js → chunk-TCQZ4AJI.js} +1 -1
  16. package/dist/{chunk-GZADST64.js → chunk-TVFSVTRG.js} +5 -5
  17. package/dist/{chunk-6TT3FQEZ.js → chunk-UZ7MSORW.js} +101 -4
  18. package/dist/{chunk-MFCV4JMQ.js → chunk-VHPHWTX7.js} +2 -2
  19. package/dist/{chunk-JA2XDMAE.js → chunk-VRRIHA3S.js} +1 -1
  20. package/dist/components/index.d.ts +59 -3
  21. package/dist/components/index.js +19 -19
  22. package/dist/components/navigation/index.js +2 -2
  23. package/dist/features/auth/index.d.ts +26 -0
  24. package/dist/features/auth/index.js +3 -3
  25. package/dist/features/clients/index.js +2 -2
  26. package/dist/features/content/index.d.ts +95 -78
  27. package/dist/features/content/index.js +61 -19
  28. package/dist/features/crm/index.d.ts +26 -0
  29. package/dist/features/crm/index.js +3 -3
  30. package/dist/features/dashboard/index.js +3 -3
  31. package/dist/features/delivery/index.d.ts +26 -0
  32. package/dist/features/delivery/index.js +2 -2
  33. package/dist/features/knowledge/index.js +1 -1
  34. package/dist/features/lead-gen/index.js +3 -3
  35. package/dist/features/monitoring/index.d.ts +33 -3
  36. package/dist/features/monitoring/index.js +4 -4
  37. package/dist/features/monitoring/requests/index.js +2 -2
  38. package/dist/features/operations/index.js +6 -6
  39. package/dist/features/settings/index.d.ts +26 -0
  40. package/dist/features/settings/index.js +3 -3
  41. package/dist/hooks/access/index.js +1 -1
  42. package/dist/hooks/delivery/index.d.ts +26 -0
  43. package/dist/hooks/index.d.ts +301 -12
  44. package/dist/hooks/index.js +1 -1
  45. package/dist/hooks/published.d.ts +301 -12
  46. package/dist/hooks/published.js +1 -1
  47. package/dist/initialization/index.d.ts +26 -0
  48. package/dist/knowledge/index.js +5 -5
  49. package/dist/layout/index.js +4 -4
  50. package/dist/profile/index.d.ts +26 -0
  51. package/dist/provider/index.d.ts +26 -0
  52. package/dist/provider/index.js +1 -1
  53. package/dist/provider/published.d.ts +26 -0
  54. package/dist/provider/published.js +1 -1
  55. package/dist/supabase/index.d.ts +50 -0
  56. package/dist/types/index.d.ts +59 -3
  57. package/package.json +4 -4
@@ -1,8 +1,8 @@
1
1
  import { PageContainer } from '../../chunk-BZZCNLT6.js';
2
2
  import '../../chunk-TUMSNGTX.js';
3
3
  import { FilterBar } from '../../chunk-PDHTXPSF.js';
4
- import { CustomModal, useContentItems, useContentDistributions, useContentConfig, SubshellContentContainer, PageTitleCaption, CenteredErrorState, EmptyState, StatCard, getContentItemIdentity, usePaginationState, useContentItem, useContentItemAttempts, useUpdateContentItem, useReviewContentItem, useContentDistribution, useUpdateContentDistribution, useContentPipelineSummary, deriveContentBoard, useExecutions } from '../../chunk-6TT3FQEZ.js';
5
- export { CONTENT_ITEMS, ContentSidebar, ContentSidebarMiddle, DEFAULT_CONTENT_VOCABULARY, MyReviewQueuePanel, contentManifest, deriveContentBoard, getContentItemIdentity, resolveContentStepResource, resolveContentVocabulary, useContentConfig } from '../../chunk-6TT3FQEZ.js';
4
+ import { CustomModal, useContentItems, useContentDistributions, useContentConfig, SubshellContentContainer, PageTitleCaption, CenteredErrorState, EmptyState, StatCard, getContentItemIdentity, usePaginationState, useContentItem, useContentItemAttempts, useUpdateContentItem, useReviewContentItem, getOpenContentReviewGates, useContentDistribution, useUpdateContentDistribution, useContentPipelineSummary, deriveContentBoard, useExecutions } from '../../chunk-UZ7MSORW.js';
5
+ export { CONTENT_ITEMS, ContentSidebar, ContentSidebarMiddle, DEFAULT_CONTENT_VOCABULARY, MyReviewQueuePanel, contentManifest, deriveContentBoard, getContentItemIdentity, resolveContentStepResource, resolveContentVocabulary, useContentConfig } from '../../chunk-UZ7MSORW.js';
6
6
  import '../../chunk-R6NMRXNO.js';
7
7
  import '../../chunk-RBGVNPA6.js';
8
8
  import '../../chunk-MKH2KOAO.js';
@@ -29,7 +29,7 @@ import '../../chunk-TVTSASST.js';
29
29
  import '../../chunk-BRJ3QZ4E.js';
30
30
  import '../../chunk-Q7DJKLEN.js';
31
31
  import '../../chunk-I2KLQ2HA.js';
32
- import { Stack, Group, Text, Badge, Button, Textarea, Box, Loader, Accordion, Card, Alert, List, Paper, Center, SimpleGrid, Table, TextInput, Select, Pagination, Title, Tabs, Anchor, Divider, Progress, Checkbox, TagsInput, Image, Tooltip, ActionIcon, UnstyledButton, ScrollArea } from '@mantine/core';
32
+ import { Stack, Group, Text, Badge, Button, Textarea, Box, Loader, Accordion, Tooltip, Card, Alert, List, Paper, Center, SimpleGrid, Table, TextInput, Select, Pagination, Title, Tabs, Anchor, Divider, Progress, Checkbox, TagsInput, Image, ActionIcon, UnstyledButton, ScrollArea } from '@mantine/core';
33
33
  import { IconAlertTriangle, IconShieldCheck, IconShieldX, IconArticle, IconArrowRight, IconClock, IconSend, IconSearch, IconFileText, IconListDetails, IconAlertCircle, IconLayoutGrid, IconShare, IconPlayerPlay, IconExternalLink, IconMaximize, IconCopy, IconDownload, IconTrash, IconArrowLeft, IconArrowsExchange, IconCheck, IconX, IconChecklist, IconRoute, IconInfoCircle, IconClockHour4 } from '@tabler/icons-react';
34
34
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
35
35
  import { useState, useMemo, Fragment as Fragment$1, useCallback, useEffect } from 'react';
@@ -335,7 +335,7 @@ function ReviewActionBar({ actions, onAction, pending = false }) {
335
335
  /* @__PURE__ */ jsx(Group, { gap: "xs", children: actions.map((action) => {
336
336
  const Icon = action.icon;
337
337
  const irreversible = isIrreversible(action);
338
- return /* @__PURE__ */ jsx(
338
+ const button = /* @__PURE__ */ jsx(
339
339
  Button,
340
340
  {
341
341
  variant: irreversible ? "filled" : "light",
@@ -343,15 +343,15 @@ function ReviewActionBar({ actions, onAction, pending = false }) {
343
343
  color: resolveActionColor(action),
344
344
  leftSection: Icon ? /* @__PURE__ */ jsx(Icon, { size: 16 }) : void 0,
345
345
  loading: pending,
346
- disabled: pending,
346
+ disabled: pending || action.disabled,
347
347
  onClick: () => openAction(action),
348
348
  size: "xs",
349
349
  radius: "xs",
350
350
  "data-testid": `content-review-action-${action.id}`,
351
351
  children: action.label
352
- },
353
- action.id
352
+ }
354
353
  );
354
+ return action.disabled && action.disabledReason ? /* @__PURE__ */ jsx(Tooltip, { label: action.disabledReason, withArrow: true, position: "top", children: /* @__PURE__ */ jsx("span", { children: button }) }, action.id) : /* @__PURE__ */ jsx("span", { children: button }, action.id);
355
355
  }) }),
356
356
  /* @__PURE__ */ jsx(CustomModal, { opened: !!confirmAction, onClose: () => setConfirmAction(null), size: "sm", children: /* @__PURE__ */ jsxs(Stack, { children: [
357
357
  /* @__PURE__ */ jsx(Text, { fw: 600, children: confirmAction?.label }),
@@ -832,15 +832,20 @@ function ContentItemsPage({ headerActions } = {}) {
832
832
  // src/lib/content/processing-state.ts
833
833
  function mapContentStepStatus(status) {
834
834
  if (status === void 0) return "pending";
835
+ if (status === "running") return "in_progress";
835
836
  if (status === "error") return "failed";
836
837
  return "completed";
837
838
  }
838
839
  function getContentProcessingSteps(processingState, pipelineSteps) {
839
- return pipelineSteps.map((step) => ({
840
- key: step.key,
841
- label: step.label,
842
- status: mapContentStepStatus(processingState?.[step.key]?.status)
843
- }));
840
+ return pipelineSteps.map((step) => {
841
+ const entry = processingState?.[step.key];
842
+ return {
843
+ key: step.key,
844
+ label: step.label,
845
+ status: mapContentStepStatus(entry?.status),
846
+ executionId: entry ? entry.executionId : void 0
847
+ };
848
+ });
844
849
  }
845
850
 
846
851
  // src/lib/content/payload-text.ts
@@ -873,7 +878,9 @@ function toPayloadDisplayFields(fields, payload) {
873
878
  return fields.filter((field) => field.key in payloadRecord).map((field) => ({ key: field.key, label: field.label, kind: toDisplayKind(field.type) }));
874
879
  }
875
880
  var REVIEW_QUEUE_FETCH_LIMIT = 100;
876
- function buildReviewActions(isTerminalPipeline) {
881
+ function buildReviewActions(isTerminalPipeline, gate, reason) {
882
+ const gateLabel = gate?.step.label;
883
+ const disabled = !gate;
877
884
  return [
878
885
  {
879
886
  id: "approved",
@@ -887,8 +894,10 @@ function buildReviewActions(isTerminalPipeline) {
887
894
  requiresFeedback: true,
888
895
  feedbackLabel: "Note (optional)",
889
896
  feedbackPlaceholder: "Anything the next step or a later reader should know?",
890
- confirmationMessage: isTerminalPipeline ? "Approve this item? There is no further pipeline step -- this is the last internal gate before it is published." : "Approve this item? It moves on to the next pipeline step.",
891
- consequence: isTerminalPipeline ? "irreversible" : "standard"
897
+ confirmationMessage: gateLabel ? isTerminalPipeline ? `Approve "${gateLabel}"? There is no further pipeline step -- this is the last internal gate before it is published.` : `Approve "${gateLabel}"? It moves on to the next pipeline step.` : void 0,
898
+ consequence: isTerminalPipeline ? "irreversible" : "standard",
899
+ disabled,
900
+ disabledReason: reason
892
901
  },
893
902
  {
894
903
  id: "rejected",
@@ -898,7 +907,10 @@ function buildReviewActions(isTerminalPipeline) {
898
907
  requiresFeedback: true,
899
908
  feedbackLabel: "Reason for rejection",
900
909
  feedbackPlaceholder: "What needs to change before this can go out?",
901
- feedbackRequired: true
910
+ feedbackRequired: true,
911
+ confirmationMessage: gateLabel ? `Reject "${gateLabel}"? This sends it back for changes.` : void 0,
912
+ disabled,
913
+ disabledReason: reason
902
914
  }
903
915
  ];
904
916
  }
@@ -930,7 +942,21 @@ function ContentItemReviewPage({ itemId, headerActions }) {
930
942
  const pipeline = item ? contentConfig.pipelines.find((candidate) => candidate.id === item.pipelineId) : void 0;
931
943
  const pipelineSteps = useMemo(() => pipeline?.steps ?? [], [pipeline]);
932
944
  const isTerminalPipeline = pipelineSteps.length <= 1;
933
- const reviewActions = useMemo(() => buildReviewActions(isTerminalPipeline), [isTerminalPipeline]);
945
+ const openGates = useMemo(
946
+ () => getOpenContentReviewGates(item?.processingState ?? {}, pipelineSteps),
947
+ [item?.processingState, pipelineSteps]
948
+ );
949
+ const earliestOpenGate = openGates[0];
950
+ const reviewDisabledReason = useMemo(() => {
951
+ if (earliestOpenGate) return void 0;
952
+ if (!item?.pipelineId) return "This item has no pipeline, so there is no review gate to clear.";
953
+ if (!pipeline) return `Unknown pipeline "${item.pipelineId}" -- there is no review gate to clear.`;
954
+ return "No open review gate on this item. Every queued step has already been reviewed, or the current step is still running.";
955
+ }, [earliestOpenGate, item?.pipelineId, pipeline]);
956
+ const reviewActions = useMemo(
957
+ () => buildReviewActions(isTerminalPipeline, earliestOpenGate, reviewDisabledReason),
958
+ [isTerminalPipeline, earliestOpenGate, reviewDisabledReason]
959
+ );
934
960
  const pipelinePayloadFields = useMemo(() => getPipelinePayloadFields(pipelineSteps), [pipelineSteps]);
935
961
  const primaryTextField = useMemo(() => getPrimaryPayloadTextField(pipelinePayloadFields), [pipelinePayloadFields]);
936
962
  const originalBody = item ? getPayloadText(item.payload, primaryTextField?.key) : "";
@@ -1039,16 +1065,21 @@ function ContentItemReviewPage({ itemId, headerActions }) {
1039
1065
  showSuccessNotification("Saved");
1040
1066
  };
1041
1067
  const handleAction = async (actionId, feedback) => {
1068
+ if (!earliestOpenGate) return;
1069
+ const stepKey = earliestOpenGate.stepKey;
1042
1070
  await persistBodyIfDirty();
1043
1071
  if (actionId === "approved") {
1044
1072
  const note = feedback?.trim();
1045
1073
  await reviewItem.mutateAsync({
1046
1074
  itemId: item.id,
1047
- review: { decision: "approved", reviewerFeedback: note ? note : void 0 }
1075
+ review: { decision: "approved", stepKey, reviewerFeedback: note ? note : void 0 }
1048
1076
  });
1049
1077
  showSuccessNotification("Item approved");
1050
1078
  } else if (actionId === "rejected") {
1051
- await reviewItem.mutateAsync({ itemId: item.id, review: { decision: "rejected", rejectReason: feedback ?? "" } });
1079
+ await reviewItem.mutateAsync({
1080
+ itemId: item.id,
1081
+ review: { decision: "rejected", stepKey, rejectReason: feedback ?? "" }
1082
+ });
1052
1083
  showSuccessNotification("Item rejected");
1053
1084
  }
1054
1085
  goToNextInQueue();
@@ -1082,6 +1113,17 @@ function ContentItemReviewPage({ itemId, headerActions }) {
1082
1113
  backButton
1083
1114
  ] })
1084
1115
  ] }),
1116
+ reviewDisabledReason && /* @__PURE__ */ jsx(
1117
+ Alert,
1118
+ {
1119
+ icon: /* @__PURE__ */ jsx(IconAlertTriangle, { size: 16 }),
1120
+ color: "var(--color-warning)",
1121
+ variant: "light",
1122
+ title: "Nothing to review right now",
1123
+ "data-testid": "content-review-no-open-gate",
1124
+ children: /* @__PURE__ */ jsx(Text, { size: "sm", children: reviewDisabledReason })
1125
+ }
1126
+ ),
1085
1127
  /* @__PURE__ */ jsx(
1086
1128
  ContentReviewCard,
1087
1129
  {
@@ -1090,6 +1090,7 @@ type Database = {
1090
1090
  activities: {
1091
1091
  Row: {
1092
1092
  activity_type: string;
1093
+ actor_api_key_id: string | null;
1093
1094
  actor_id: string | null;
1094
1095
  actor_type: string | null;
1095
1096
  created_at: string;
@@ -1106,6 +1107,7 @@ type Database = {
1106
1107
  };
1107
1108
  Insert: {
1108
1109
  activity_type: string;
1110
+ actor_api_key_id?: string | null;
1109
1111
  actor_id?: string | null;
1110
1112
  actor_type?: string | null;
1111
1113
  created_at?: string;
@@ -1122,6 +1124,7 @@ type Database = {
1122
1124
  };
1123
1125
  Update: {
1124
1126
  activity_type?: string;
1127
+ actor_api_key_id?: string | null;
1125
1128
  actor_id?: string | null;
1126
1129
  actor_type?: string | null;
1127
1130
  created_at?: string;
@@ -1137,6 +1140,13 @@ type Database = {
1137
1140
  title?: string;
1138
1141
  };
1139
1142
  Relationships: [
1143
+ {
1144
+ foreignKeyName: "activities_actor_api_key_id_fkey";
1145
+ columns: ["actor_api_key_id"];
1146
+ isOneToOne: false;
1147
+ referencedRelation: "api_keys";
1148
+ referencedColumns: ["id"];
1149
+ },
1140
1150
  {
1141
1151
  foreignKeyName: "activities_actor_id_fkey";
1142
1152
  columns: ["actor_id"];
@@ -1224,6 +1234,7 @@ type Database = {
1224
1234
  api_keys: {
1225
1235
  Row: {
1226
1236
  created_at: string | null;
1237
+ created_by: string | null;
1227
1238
  id: string;
1228
1239
  key_hash: string;
1229
1240
  last_used_at: string | null;
@@ -1232,6 +1243,7 @@ type Database = {
1232
1243
  };
1233
1244
  Insert: {
1234
1245
  created_at?: string | null;
1246
+ created_by?: string | null;
1235
1247
  id?: string;
1236
1248
  key_hash: string;
1237
1249
  last_used_at?: string | null;
@@ -1240,6 +1252,7 @@ type Database = {
1240
1252
  };
1241
1253
  Update: {
1242
1254
  created_at?: string | null;
1255
+ created_by?: string | null;
1243
1256
  id?: string;
1244
1257
  key_hash?: string;
1245
1258
  last_used_at?: string | null;
@@ -1247,6 +1260,13 @@ type Database = {
1247
1260
  organization_id?: string;
1248
1261
  };
1249
1262
  Relationships: [
1263
+ {
1264
+ foreignKeyName: "api_keys_created_by_fkey";
1265
+ columns: ["created_by"];
1266
+ isOneToOne: false;
1267
+ referencedRelation: "users";
1268
+ referencedColumns: ["id"];
1269
+ },
1250
1270
  {
1251
1271
  foreignKeyName: "api_keys_organization_id_fkey";
1252
1272
  columns: ["organization_id"];
@@ -1574,6 +1594,7 @@ type Database = {
1574
1594
  organization_id: string;
1575
1595
  payload: Json;
1576
1596
  source_execution_id: string | null;
1597
+ status: string;
1577
1598
  step_key: string | null;
1578
1599
  };
1579
1600
  Insert: {
@@ -1585,6 +1606,7 @@ type Database = {
1585
1606
  organization_id: string;
1586
1607
  payload?: Json;
1587
1608
  source_execution_id?: string | null;
1609
+ status: string;
1588
1610
  step_key?: string | null;
1589
1611
  };
1590
1612
  Update: {
@@ -1596,6 +1618,7 @@ type Database = {
1596
1618
  organization_id?: string;
1597
1619
  payload?: Json;
1598
1620
  source_execution_id?: string | null;
1621
+ status?: string;
1599
1622
  step_key?: string | null;
1600
1623
  };
1601
1624
  Relationships: [
@@ -1747,6 +1770,7 @@ type Database = {
1747
1770
  kind: string;
1748
1771
  metadata: Json;
1749
1772
  organization_id: string;
1773
+ payload: Json;
1750
1774
  processing_state: Json;
1751
1775
  storage_path: string | null;
1752
1776
  title: string;
@@ -1760,6 +1784,7 @@ type Database = {
1760
1784
  kind: string;
1761
1785
  metadata?: Json;
1762
1786
  organization_id: string;
1787
+ payload?: Json;
1763
1788
  processing_state?: Json;
1764
1789
  storage_path?: string | null;
1765
1790
  title: string;
@@ -1773,6 +1798,7 @@ type Database = {
1773
1798
  kind?: string;
1774
1799
  metadata?: Json;
1775
1800
  organization_id?: string;
1801
+ payload?: Json;
1776
1802
  processing_state?: Json;
1777
1803
  storage_path?: string | null;
1778
1804
  title?: string;
@@ -1,9 +1,9 @@
1
- export { ActivityFeedWidget, CompanyDetailPage, ContactDetailPage, ConversationThread, CrmOverview, CrmSettingsPage, CrmSidebar, CrmSidebarTop, DealDetailPage, DealsListPage, MetricsStrip, PIPELINE_FUNNEL_ORDER, PipelineFunnelWidget, crmPrioritySettingsKeys, getCrmApiInterfaceReadiness, useCrmPipelineConfig, useCrmPipelineSummary, useCrmPrioritySettings, useCrmQuickMetrics, useRecentCrmActivity, useResetCrmPrioritySettings, useUpdateCrmPrioritySettings } from '../../chunk-MFCV4JMQ.js';
2
- import '../../chunk-LY3IKYTZ.js';
1
+ export { ActivityFeedWidget, CompanyDetailPage, ContactDetailPage, ConversationThread, CrmOverview, CrmSettingsPage, CrmSidebar, CrmSidebarTop, DealDetailPage, DealsListPage, MetricsStrip, PIPELINE_FUNNEL_ORDER, PipelineFunnelWidget, crmPrioritySettingsKeys, getCrmApiInterfaceReadiness, useCrmPipelineConfig, useCrmPipelineSummary, useCrmPrioritySettings, useCrmQuickMetrics, useRecentCrmActivity, useResetCrmPrioritySettings, useUpdateCrmPrioritySettings } from '../../chunk-VHPHWTX7.js';
2
+ import '../../chunk-LL5H7J4N.js';
3
3
  import '../../chunk-BZZCNLT6.js';
4
4
  import '../../chunk-TUMSNGTX.js';
5
5
  import '../../chunk-PDHTXPSF.js';
6
- export { CRM_ITEMS, CrmSidebarMiddle, MyTasksPanel, QuickCreateActions, SAVED_VIEW_PRESETS, SavedViewsPanel, crmManifest } from '../../chunk-6TT3FQEZ.js';
6
+ export { CRM_ITEMS, CrmSidebarMiddle, MyTasksPanel, QuickCreateActions, SAVED_VIEW_PRESETS, SavedViewsPanel, crmManifest } from '../../chunk-UZ7MSORW.js';
7
7
  import '../../chunk-R6NMRXNO.js';
8
8
  import '../../chunk-RBGVNPA6.js';
9
9
  import '../../chunk-MKH2KOAO.js';
@@ -1,9 +1,9 @@
1
- export { Dashboard, DashboardOperationsOverview, OperationsOverview, RecentExecutionsByResource, ResourceOverview, UnresolvedErrorsTeaser } from '../../chunk-XKUEO4HG.js';
1
+ export { Dashboard, DashboardOperationsOverview, OperationsOverview, RecentExecutionsByResource, ResourceOverview, UnresolvedErrorsTeaser } from '../../chunk-JTSNU6KA.js';
2
2
  import '../../chunk-3MEXPLWT.js';
3
3
  import '../../chunk-LGKLC5MG.js';
4
4
  import '../../chunk-HENXLGVD.js';
5
- import '../../chunk-SMH6SQQE.js';
6
- import '../../chunk-6TT3FQEZ.js';
5
+ import '../../chunk-DCMFNSJ6.js';
6
+ import '../../chunk-UZ7MSORW.js';
7
7
  import '../../chunk-R6NMRXNO.js';
8
8
  import '../../chunk-RBGVNPA6.js';
9
9
  import '../../chunk-MKH2KOAO.js';
@@ -1041,6 +1041,7 @@ type Database = {
1041
1041
  activities: {
1042
1042
  Row: {
1043
1043
  activity_type: string;
1044
+ actor_api_key_id: string | null;
1044
1045
  actor_id: string | null;
1045
1046
  actor_type: string | null;
1046
1047
  created_at: string;
@@ -1057,6 +1058,7 @@ type Database = {
1057
1058
  };
1058
1059
  Insert: {
1059
1060
  activity_type: string;
1061
+ actor_api_key_id?: string | null;
1060
1062
  actor_id?: string | null;
1061
1063
  actor_type?: string | null;
1062
1064
  created_at?: string;
@@ -1073,6 +1075,7 @@ type Database = {
1073
1075
  };
1074
1076
  Update: {
1075
1077
  activity_type?: string;
1078
+ actor_api_key_id?: string | null;
1076
1079
  actor_id?: string | null;
1077
1080
  actor_type?: string | null;
1078
1081
  created_at?: string;
@@ -1088,6 +1091,13 @@ type Database = {
1088
1091
  title?: string;
1089
1092
  };
1090
1093
  Relationships: [
1094
+ {
1095
+ foreignKeyName: "activities_actor_api_key_id_fkey";
1096
+ columns: ["actor_api_key_id"];
1097
+ isOneToOne: false;
1098
+ referencedRelation: "api_keys";
1099
+ referencedColumns: ["id"];
1100
+ },
1091
1101
  {
1092
1102
  foreignKeyName: "activities_actor_id_fkey";
1093
1103
  columns: ["actor_id"];
@@ -1175,6 +1185,7 @@ type Database = {
1175
1185
  api_keys: {
1176
1186
  Row: {
1177
1187
  created_at: string | null;
1188
+ created_by: string | null;
1178
1189
  id: string;
1179
1190
  key_hash: string;
1180
1191
  last_used_at: string | null;
@@ -1183,6 +1194,7 @@ type Database = {
1183
1194
  };
1184
1195
  Insert: {
1185
1196
  created_at?: string | null;
1197
+ created_by?: string | null;
1186
1198
  id?: string;
1187
1199
  key_hash: string;
1188
1200
  last_used_at?: string | null;
@@ -1191,6 +1203,7 @@ type Database = {
1191
1203
  };
1192
1204
  Update: {
1193
1205
  created_at?: string | null;
1206
+ created_by?: string | null;
1194
1207
  id?: string;
1195
1208
  key_hash?: string;
1196
1209
  last_used_at?: string | null;
@@ -1198,6 +1211,13 @@ type Database = {
1198
1211
  organization_id?: string;
1199
1212
  };
1200
1213
  Relationships: [
1214
+ {
1215
+ foreignKeyName: "api_keys_created_by_fkey";
1216
+ columns: ["created_by"];
1217
+ isOneToOne: false;
1218
+ referencedRelation: "users";
1219
+ referencedColumns: ["id"];
1220
+ },
1201
1221
  {
1202
1222
  foreignKeyName: "api_keys_organization_id_fkey";
1203
1223
  columns: ["organization_id"];
@@ -1525,6 +1545,7 @@ type Database = {
1525
1545
  organization_id: string;
1526
1546
  payload: Json;
1527
1547
  source_execution_id: string | null;
1548
+ status: string;
1528
1549
  step_key: string | null;
1529
1550
  };
1530
1551
  Insert: {
@@ -1536,6 +1557,7 @@ type Database = {
1536
1557
  organization_id: string;
1537
1558
  payload?: Json;
1538
1559
  source_execution_id?: string | null;
1560
+ status: string;
1539
1561
  step_key?: string | null;
1540
1562
  };
1541
1563
  Update: {
@@ -1547,6 +1569,7 @@ type Database = {
1547
1569
  organization_id?: string;
1548
1570
  payload?: Json;
1549
1571
  source_execution_id?: string | null;
1572
+ status?: string;
1550
1573
  step_key?: string | null;
1551
1574
  };
1552
1575
  Relationships: [
@@ -1698,6 +1721,7 @@ type Database = {
1698
1721
  kind: string;
1699
1722
  metadata: Json;
1700
1723
  organization_id: string;
1724
+ payload: Json;
1701
1725
  processing_state: Json;
1702
1726
  storage_path: string | null;
1703
1727
  title: string;
@@ -1711,6 +1735,7 @@ type Database = {
1711
1735
  kind: string;
1712
1736
  metadata?: Json;
1713
1737
  organization_id: string;
1738
+ payload?: Json;
1714
1739
  processing_state?: Json;
1715
1740
  storage_path?: string | null;
1716
1741
  title: string;
@@ -1724,6 +1749,7 @@ type Database = {
1724
1749
  kind?: string;
1725
1750
  metadata?: Json;
1726
1751
  organization_id?: string;
1752
+ payload?: Json;
1727
1753
  processing_state?: Json;
1728
1754
  storage_path?: string | null;
1729
1755
  title?: string;
@@ -1,9 +1,9 @@
1
- export { AllTasksPage, Checklist, CreateDeliveryEntityModal, DELIVERY_COMMUNICATION_ITEMS, DELIVERY_PROJECT_ITEMS, DELIVERY_WORK_ITEMS, HealthStatusCard, MilestoneTimeline, ProjectDetailPage, ProjectsListPage, ProjectsSidebar, ProjectsSidebarMiddle, ProjectsSidebarTop, TaskCard, UpcomingMilestonesPage } from '../../chunk-TJMZUL6E.js';
1
+ export { AllTasksPage, Checklist, CreateDeliveryEntityModal, DELIVERY_COMMUNICATION_ITEMS, DELIVERY_PROJECT_ITEMS, DELIVERY_WORK_ITEMS, HealthStatusCard, MilestoneTimeline, ProjectDetailPage, ProjectsListPage, ProjectsSidebar, ProjectsSidebarMiddle, ProjectsSidebarTop, TaskCard, UpcomingMilestonesPage } from '../../chunk-BM2WKRAQ.js';
2
2
  export { calculateProgress, formatStatusLabel, milestoneStatusColors, noteTypeColors, projectStatusColors, taskStatusColors, taskTypeColors } from '../../chunk-DLR4SDZW.js';
3
3
  import '../../chunk-BZZCNLT6.js';
4
4
  import '../../chunk-TUMSNGTX.js';
5
5
  import '../../chunk-PDHTXPSF.js';
6
- export { deliveryManifest } from '../../chunk-6TT3FQEZ.js';
6
+ export { deliveryManifest } from '../../chunk-UZ7MSORW.js';
7
7
  import '../../chunk-R6NMRXNO.js';
8
8
  import '../../chunk-RBGVNPA6.js';
9
9
  import '../../chunk-MKH2KOAO.js';
@@ -1,4 +1,4 @@
1
- export { knowledgeManifest } from '../../chunk-6TT3FQEZ.js';
1
+ export { knowledgeManifest } from '../../chunk-UZ7MSORW.js';
2
2
  import '../../chunk-R6NMRXNO.js';
3
3
  import '../../chunk-RBGVNPA6.js';
4
4
  import '../../chunk-MKH2KOAO.js';
@@ -1,10 +1,10 @@
1
- export { LEAD_GEN_ROUTE_LINKS, LeadGenCompaniesPage, LeadGenContactsPage, LeadGenListDetailPage, LeadGenListsPage, LeadGenOverviewPage, LeadGenReadinessAlert, LeadGenRouteShell, LeadGenSidebar, LeadGenSidebarTop, ListBuilderIndexPage, ListBuilderPage, ORPHAN_STAGE_ORDER, deriveBusinessProgress, formatDate, getEnrichmentColor, getEnrichmentStatus, getLeadGenApiInterfaceReadiness, getLeadGenExportWorkflowId, getStateKeyColor, getStatusColor, getStepActionLabel, isLeadGenExportAction, resolveBuildPlanSteps, resolveBuildState, sortStageKeys, useDeleteLists, useLeadGenConfig } from '../../chunk-5C62IRKS.js';
2
- import '../../chunk-LY3IKYTZ.js';
1
+ export { LEAD_GEN_ROUTE_LINKS, LeadGenCompaniesPage, LeadGenContactsPage, LeadGenListDetailPage, LeadGenListsPage, LeadGenOverviewPage, LeadGenReadinessAlert, LeadGenRouteShell, LeadGenSidebar, LeadGenSidebarTop, ListBuilderIndexPage, ListBuilderPage, ORPHAN_STAGE_ORDER, deriveBusinessProgress, formatDate, getEnrichmentColor, getEnrichmentStatus, getLeadGenApiInterfaceReadiness, getLeadGenExportWorkflowId, getStateKeyColor, getStatusColor, getStepActionLabel, isLeadGenExportAction, resolveBuildPlanSteps, resolveBuildState, sortStageKeys, useDeleteLists, useLeadGenConfig } from '../../chunk-H3SDGC5F.js';
2
+ import '../../chunk-LL5H7J4N.js';
3
3
  import '../../chunk-3MEXPLWT.js';
4
4
  import '../../chunk-BZZCNLT6.js';
5
5
  import '../../chunk-TUMSNGTX.js';
6
6
  import '../../chunk-PDHTXPSF.js';
7
- export { EMPTY_LIST_ACTIONS, LEAD_GEN_ITEMS, LeadGenSidebarMiddle, ListActionsProvider, companyKeys as acquisitionCompanyKeys, contactKeys as acquisitionContactKeys, companyKeys, contactKeys, findListActionByAction, getListActionWorkflowId, leadGenArtifactKeys, leadGenListCompanyKeys, leadGenListMemberKeys, leadGenManifest, useArtifacts, useCompanies, useCompany, useCompanyFacets, useContact, useContacts, useCreateArtifact, useCreateCompany, useCreateContact, useDeleteCompanies, useDeleteContacts, useDeriveActions, useLeadGenActionRegistry, useLeadGenBulkActions, useLeadGenHeaderActions, useLeadGenRowActions, useListActions, useListMember, useListMembers, useListProgress, useTransitionListCompany, useTransitionListMember, useUpdateCompany, useUpdateContact, useUpdateListStatus } from '../../chunk-6TT3FQEZ.js';
7
+ export { EMPTY_LIST_ACTIONS, LEAD_GEN_ITEMS, LeadGenSidebarMiddle, ListActionsProvider, companyKeys as acquisitionCompanyKeys, contactKeys as acquisitionContactKeys, companyKeys, contactKeys, findListActionByAction, getListActionWorkflowId, leadGenArtifactKeys, leadGenListCompanyKeys, leadGenListMemberKeys, leadGenManifest, useArtifacts, useCompanies, useCompany, useCompanyFacets, useContact, useContacts, useCreateArtifact, useCreateCompany, useCreateContact, useDeleteCompanies, useDeleteContacts, useDeriveActions, useLeadGenActionRegistry, useLeadGenBulkActions, useLeadGenHeaderActions, useLeadGenRowActions, useListActions, useListMember, useListMembers, useListProgress, useTransitionListCompany, useTransitionListMember, useUpdateCompany, useUpdateContact, useUpdateListStatus } from '../../chunk-UZ7MSORW.js';
8
8
  import '../../chunk-R6NMRXNO.js';
9
9
  import '../../chunk-RBGVNPA6.js';
10
10
  import '../../chunk-MKH2KOAO.js';
@@ -6,8 +6,34 @@ import { ComponentType } from 'react';
6
6
  */
7
7
  type TimeRange = '1h' | '24h' | '7d' | '30d';
8
8
 
9
- type ActivityType = 'workflow_execution' | 'agent_run' | 'hitl_action' | 'webhook_received' | 'webhook_executed' | 'webhook_failed' | 'credential_change' | 'credential_read' | 'api_key_change' | 'agent_access_grant_change' | 'deployment_change' | 'membership_change';
10
- type ActivityStatus = 'success' | 'failure' | 'pending' | 'approved' | 'rejected' | 'completed';
9
+ /**
10
+ * Every kind of activity the platform records.
11
+ *
12
+ * This array is the single TypeScript-side source for the catalog: `ActivityType` is
13
+ * derived from it, and `ActivityTypeSchema` in `api-schemas.ts` builds its Zod enum
14
+ * from it rather than repeating the list. It is also what the database CHECK constraint
15
+ * `activities_activity_type_check` must match exactly.
16
+ *
17
+ * A value here that the constraint does not allow raises `23514` on every write, and
18
+ * because activity writes are best-effort the rejection is silent. That is not
19
+ * hypothetical: `credential_read` and `agent_access_grant_change` were both in this list
20
+ * and absent from the constraint, so neither had ever recorded a single row on either
21
+ * database. `activity-catalog-sync.integration.test.ts` is the gate that now catches it.
22
+ */
23
+ declare const ACTIVITY_TYPES: readonly ["workflow_execution", "agent_run", "hitl_action", "webhook_received", "webhook_executed", "webhook_failed", "credential_change", "credential_read", "api_key_change", "agent_access_grant_change", "deployment_change", "membership_change"];
24
+ type ActivityType = (typeof ACTIVITY_TYPES)[number];
25
+ /** Mirrors the `activities_status_check` constraint; same two-place risk as ACTIVITY_TYPES. */
26
+ declare const ACTIVITY_STATUSES: readonly ["success", "failure", "pending", "approved", "rejected", "completed"];
27
+ type ActivityStatus = (typeof ACTIVITY_STATUSES)[number];
28
+ /**
29
+ * What kind of actor performed an action.
30
+ *
31
+ * `'user'` reads `actorId` (FK to users), `'api_key'` reads `actorApiKeyId` (FK to api_keys),
32
+ * and `'system'` reads neither. The two id columns are deliberately separate rather than one
33
+ * polymorphic column, so the database keeps checking both referents.
34
+ */
35
+ declare const ACTOR_TYPES: readonly ["user", "system", "api_key"];
36
+ type ActorType = (typeof ACTOR_TYPES)[number];
11
37
  interface Activity {
12
38
  id: string;
13
39
  organizationId: string;
@@ -19,8 +45,12 @@ interface Activity {
19
45
  entityId: string;
20
46
  entityName: string | null;
21
47
  metadata: Record<string, unknown> | null;
48
+ /** Set when actorType is 'user'. FK to users(id). */
22
49
  actorId: string | null;
23
- actorType: string | null;
50
+ /** Set when actorType is 'api_key'. FK to api_keys(id). */
51
+ actorApiKeyId: string | null;
52
+ /** Discriminator saying which of the two id fields above to read. */
53
+ actorType: ActorType | null;
24
54
  occurredAt: Date;
25
55
  createdAt: Date;
26
56
  }
@@ -1,9 +1,9 @@
1
- export { ActivityFeed, ActivityLog, CostAnalytics, ErrorDetailsModal, ExecutionHealth, ExecutionLogsPage, NotificationCenter } from '../../chunk-LWYLZUUV.js';
2
- import '../../chunk-JA2XDMAE.js';
1
+ export { ActivityFeed, ActivityLog, CostAnalytics, ErrorDetailsModal, ExecutionHealth, ExecutionLogsPage, NotificationCenter } from '../../chunk-3BLYJT5L.js';
2
+ import '../../chunk-VRRIHA3S.js';
3
3
  import '../../chunk-LGKLC5MG.js';
4
- import '../../chunk-SMH6SQQE.js';
4
+ import '../../chunk-DCMFNSJ6.js';
5
5
  import '../../chunk-PDHTXPSF.js';
6
- export { monitoringManifest } from '../../chunk-6TT3FQEZ.js';
6
+ export { monitoringManifest } from '../../chunk-UZ7MSORW.js';
7
7
  import '../../chunk-R6NMRXNO.js';
8
8
  import '../../chunk-RBGVNPA6.js';
9
9
  import '../../chunk-MKH2KOAO.js';
@@ -1,7 +1,7 @@
1
1
  import { TableSelectionToolbar } from '../../../chunk-TUMSNGTX.js';
2
2
  import { FilterBar } from '../../../chunk-PDHTXPSF.js';
3
- import { ConfirmationModal, RequestModal, usePaginationState, useRequestsList, useUpdateRequestStatus, useDeleteRequest, useTableSelection, PageTitleCaption, CustomModal, useRequest, ContextViewer, JsonViewer } from '../../../chunk-6TT3FQEZ.js';
4
- export { RequestActionIcon, RequestModal, requestTopbarActionManifest, submittedRequestsManifest } from '../../../chunk-6TT3FQEZ.js';
3
+ import { ConfirmationModal, RequestModal, usePaginationState, useRequestsList, useUpdateRequestStatus, useDeleteRequest, useTableSelection, PageTitleCaption, CustomModal, useRequest, ContextViewer, JsonViewer } from '../../../chunk-UZ7MSORW.js';
4
+ export { RequestActionIcon, RequestModal, requestTopbarActionManifest, submittedRequestsManifest } from '../../../chunk-UZ7MSORW.js';
5
5
  import '../../../chunk-R6NMRXNO.js';
6
6
  import '../../../chunk-RBGVNPA6.js';
7
7
  import '../../../chunk-MKH2KOAO.js';
@@ -1,15 +1,15 @@
1
- export { AgentExecutionPanel, AgentSessionGroup, CommandQueueDetailPage, CommandQueuePage, CommandQueueShell, CommandViewPage, ExecuteWorkflowModal, ExecutionPanel, OrganizationGraphPage, ResourceDetailPage, ResourcesPage, SessionChatArea, SessionChatInterface, SessionChatPage, SessionConversationView, SessionDetailsPanel, SessionExecutionLogs, SessionHeader, SessionsPage, SystemOpsView, WorkflowExecutionPanel } from '../../chunk-GZADST64.js';
1
+ export { AgentExecutionPanel, AgentSessionGroup, CommandQueueDetailPage, CommandQueuePage, CommandQueueShell, CommandViewPage, ExecuteWorkflowModal, ExecutionPanel, OrganizationGraphPage, ResourceDetailPage, ResourcesPage, SessionChatArea, SessionChatInterface, SessionChatPage, SessionConversationView, SessionDetailsPanel, SessionExecutionLogs, SessionHeader, SessionsPage, SystemOpsView, WorkflowExecutionPanel } from '../../chunk-TVFSVTRG.js';
2
2
  import '../../chunk-6ZAP3FOA.js';
3
- import '../../chunk-QDMIFD6F.js';
4
- export { DashboardOperationsOverview, OperationsOverview } from '../../chunk-XKUEO4HG.js';
3
+ import '../../chunk-AIOV5NM7.js';
4
+ export { DashboardOperationsOverview, OperationsOverview } from '../../chunk-JTSNU6KA.js';
5
5
  import '../../chunk-3MEXPLWT.js';
6
6
  import '../../chunk-SNZDFCOQ.js';
7
- import '../../chunk-JA2XDMAE.js';
7
+ import '../../chunk-VRRIHA3S.js';
8
8
  import '../../chunk-LGKLC5MG.js';
9
9
  import '../../chunk-HENXLGVD.js';
10
- import '../../chunk-SMH6SQQE.js';
10
+ import '../../chunk-DCMFNSJ6.js';
11
11
  import '../../chunk-BZZCNLT6.js';
12
- export { OperationsSidebar, OperationsSidebarMiddle, OperationsSidebarTop, ResourcesSidebar, SessionListItem, SessionsSidebar, aggregateSystemMetrics, formatResourceAttribution, operationsManifest } from '../../chunk-6TT3FQEZ.js';
12
+ export { OperationsSidebar, OperationsSidebarMiddle, OperationsSidebarTop, ResourcesSidebar, SessionListItem, SessionsSidebar, aggregateSystemMetrics, formatResourceAttribution, operationsManifest } from '../../chunk-UZ7MSORW.js';
13
13
  import '../../chunk-R6NMRXNO.js';
14
14
  import '../../chunk-RBGVNPA6.js';
15
15
  import '../../chunk-MKH2KOAO.js';