@elevasis/ui 2.28.0 → 2.29.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 (72) hide show
  1. package/dist/api/index.js +2 -2
  2. package/dist/app/index.d.ts +6 -12
  3. package/dist/app/index.js +4 -4
  4. package/dist/charts/index.js +3 -3
  5. package/dist/{chunk-OHXU5WWK.js → chunk-3DUOPXOJ.js} +146 -9
  6. package/dist/{chunk-LWKZ3BCC.js → chunk-5CW2HXQA.js} +4 -4
  7. package/dist/{chunk-JKBGDFX2.js → chunk-65RQE3XF.js} +378 -254
  8. package/dist/{chunk-XZSEPJZQ.js → chunk-6NHCE7JM.js} +49 -28
  9. package/dist/{chunk-RIFTUOPE.js → chunk-6WXDE5LZ.js} +1 -1
  10. package/dist/{chunk-SGS4CQ2B.js → chunk-7E3FUTND.js} +1 -1
  11. package/dist/{chunk-UPMX5GJI.js → chunk-A7R2URMV.js} +88 -26
  12. package/dist/{chunk-UY5I2KOZ.js → chunk-AK5E6ILJ.js} +9 -8
  13. package/dist/{chunk-G26INIF3.js → chunk-CEHUFNAL.js} +1 -1
  14. package/dist/{chunk-ONFKASZI.js → chunk-CLUP5H3C.js} +7 -10
  15. package/dist/{chunk-MYEOTM7D.js → chunk-CN2HC4D4.js} +5 -1
  16. package/dist/chunk-FFDAE2QI.js +330 -0
  17. package/dist/{chunk-WUVR4QY6.js → chunk-FGDUK74A.js} +4 -4
  18. package/dist/{chunk-YHBPR67D.js → chunk-HNFQCOD2.js} +4 -4
  19. package/dist/{chunk-QD4X4H5A.js → chunk-HXZQWMKE.js} +2 -3
  20. package/dist/{chunk-KEFWANZY.js → chunk-JCGD4GM6.js} +5 -1
  21. package/dist/{chunk-YO2YORW4.js → chunk-OHGNCWJP.js} +3 -3
  22. package/dist/{chunk-JPGX3533.js → chunk-OIMPGKDB.js} +2 -2
  23. package/dist/{chunk-W2ZTLH7Y.js → chunk-OWESKPTJ.js} +85 -26
  24. package/dist/{chunk-G66QFZXD.js → chunk-QNL7UI5G.js} +15 -9
  25. package/dist/{chunk-OGXKOMUT.js → chunk-SZWXQHKO.js} +2 -2
  26. package/dist/{chunk-ZFLM2YVW.js → chunk-Y3YJKKEB.js} +1 -1
  27. package/dist/components/index.d.ts +16 -14
  28. package/dist/components/index.js +26 -26
  29. package/dist/features/auth/index.d.ts +6 -12
  30. package/dist/features/auth/index.js +1 -0
  31. package/dist/features/crm/index.d.ts +16 -14
  32. package/dist/features/crm/index.js +9 -9
  33. package/dist/features/dashboard/index.d.ts +16 -3
  34. package/dist/features/dashboard/index.js +10 -10
  35. package/dist/features/delivery/index.d.ts +6 -12
  36. package/dist/features/delivery/index.js +9 -9
  37. package/dist/features/knowledge/index.js +42 -20
  38. package/dist/features/lead-gen/index.d.ts +187 -24
  39. package/dist/features/lead-gen/index.js +10 -10
  40. package/dist/features/monitoring/index.js +11 -11
  41. package/dist/features/monitoring/requests/index.js +8 -8
  42. package/dist/features/operations/index.d.ts +16 -3
  43. package/dist/features/operations/index.js +15 -15
  44. package/dist/features/settings/index.d.ts +6 -12
  45. package/dist/features/settings/index.js +9 -9
  46. package/dist/hooks/delivery/index.d.ts +6 -12
  47. package/dist/hooks/delivery/index.js +2 -2
  48. package/dist/hooks/index.d.ts +110 -28
  49. package/dist/hooks/index.js +8 -8
  50. package/dist/hooks/published.d.ts +110 -28
  51. package/dist/hooks/published.js +8 -8
  52. package/dist/index.d.ts +149 -31
  53. package/dist/index.js +8 -8
  54. package/dist/initialization/index.d.ts +6 -12
  55. package/dist/knowledge/index.d.ts +44 -1
  56. package/dist/knowledge/index.js +149 -12
  57. package/dist/profile/index.d.ts +6 -12
  58. package/dist/provider/index.d.ts +44 -12
  59. package/dist/provider/index.js +6 -6
  60. package/dist/provider/published.d.ts +44 -12
  61. package/dist/provider/published.js +5 -5
  62. package/dist/supabase/index.d.ts +12 -24
  63. package/dist/test-utils/index.js +2 -2
  64. package/dist/typeform/index.d.ts +5 -1
  65. package/dist/typeform/index.js +52 -7
  66. package/dist/types/index.d.ts +7 -13
  67. package/dist/utils/index.d.ts +1 -3
  68. package/dist/utils/index.js +1 -1
  69. package/dist/vite/index.js +2 -2
  70. package/dist/vite-plugin-knowledge/index.js +1 -1
  71. package/package.json +5 -5
  72. package/dist/chunk-4KTLOK7K.js +0 -230
@@ -4,13 +4,13 @@ import { SubshellNavItem } from './chunk-X4WBGKJQ.js';
4
4
  import { SubshellSidebarSection } from './chunk-IIMU5YAJ.js';
5
5
  import { FilterBar } from './chunk-PDHTXPSF.js';
6
6
  import { CustomModal } from './chunk-KVJ3LFH2.js';
7
- import { useDealTasksDue, useDealsLookup, useCreateDealTask, useDealsSummary, useDeleteDeal, usePaginationState, useDeals, useTableSort, sortData, useTableSelection, useDealDetail, useCompany, dealKeys, useExecuteAction } from './chunk-YHBPR67D.js';
8
- import { showApiErrorNotification, showSuccessNotification } from './chunk-G26INIF3.js';
9
- import { CenteredErrorState, CardHeader, StatCard, PageTitleCaption, EmptyState, ActivityTimeline } from './chunk-RIFTUOPE.js';
10
- import { useCrmActions, DEFAULT_CRM_PRIORITY_RULE_CONFIG, deriveActions, CRM_PRIORITY_BUCKETS } from './chunk-W2ZTLH7Y.js';
7
+ import { useDealTasksDue, useDealsLookup, useCreateDealTask, useDealsSummary, useDeleteDeal, usePaginationState, useDeals, useTableSort, sortData, useTableSelection, useDealDetail, useCompany, dealKeys, useExecuteAction } from './chunk-HNFQCOD2.js';
8
+ import { showApiErrorNotification, showSuccessNotification } from './chunk-CEHUFNAL.js';
9
+ import { CenteredErrorState, CardHeader, StatCard, PageTitleCaption, EmptyState, ActivityTimeline } from './chunk-6WXDE5LZ.js';
10
+ import { CRM_PIPELINE_DEFINITION, useCrmActions, DEFAULT_CRM_PRIORITY_RULE_CONFIG, deriveActions, CRM_PRIORITY_BUCKETS } from './chunk-OWESKPTJ.js';
11
11
  import { SubshellContentContainer } from './chunk-TKAYX2SP.js';
12
12
  import { useRouterContext } from './chunk-Q7DJKLEN.js';
13
- import { PAGE_SIZE_DEFAULT, formatTimeAgo } from './chunk-QD4X4H5A.js';
13
+ import { PAGE_SIZE_DEFAULT, formatTimeAgo } from './chunk-HXZQWMKE.js';
14
14
  import { useElevasisServices } from './chunk-5WWZXCS5.js';
15
15
  import { Box, Stack, Group, Text, Badge, Center, Loader, UnstyledButton, Button, Modal, Title, Select, TextInput, Textarea, Paper, Alert, Table, SimpleGrid, Tabs, Checkbox, Tooltip, Pagination, Code, Card, Switch, NumberInput, ColorSwatch, Popover, ActionIcon, CopyButton, Divider } from '@mantine/core';
16
16
  import { IconLayoutGrid, IconColumns, IconFileInvoice, IconAddressBook, IconTrophy, IconClockExclamation, IconUser, IconPlus, IconChecklist, IconHistory, IconAlertCircle, IconCurrencyDollar, IconChartBar, IconBriefcase, IconSearch, IconTargetArrow, IconAlertTriangle, IconMessages, IconArrowLeft, IconFileText, IconInbox, IconBolt, IconBuilding, IconSettings, IconRestore, IconInfoCircle, IconMailForward, IconCheckbox, IconCalendar, IconMail, IconPhone, IconArrowRight, IconNote, IconCheck, IconCopy } from '@tabler/icons-react';
@@ -47,6 +47,43 @@ var SAVED_VIEW_PRESETS = [
47
47
  }
48
48
  ];
49
49
 
50
+ // src/lib/crm/pipeline.ts
51
+ function getCrmStageOptions() {
52
+ return CRM_PIPELINE_DEFINITION.stages.map((stage) => ({
53
+ value: stage.stageKey,
54
+ label: stage.label
55
+ }));
56
+ }
57
+ function getCrmStageColors() {
58
+ return CRM_PIPELINE_DEFINITION.stages.reduce((colors, stage) => {
59
+ if (stage.color) colors[stage.stageKey] = stage.color;
60
+ return colors;
61
+ }, {});
62
+ }
63
+ function getCrmStageLabel(stageKey) {
64
+ const normalized = normalizeCatalogKey(stageKey);
65
+ if (!normalized) return "Unknown";
66
+ return CRM_PIPELINE_DEFINITION.stages.find((stage) => stage.stageKey.toLowerCase() === normalized.toLowerCase())?.label ?? formatReadableKey(normalized);
67
+ }
68
+ function getCrmStateLabel(stateKey) {
69
+ const normalized = normalizeCatalogKey(stateKey);
70
+ if (!normalized) return "Unknown";
71
+ for (const stage of CRM_PIPELINE_DEFINITION.stages) {
72
+ const state = stage.states.find((candidate) => candidate.stateKey.toLowerCase() === normalized.toLowerCase());
73
+ if (state) return state.label;
74
+ }
75
+ return formatReadableKey(normalized);
76
+ }
77
+ function normalizeCatalogKey(value) {
78
+ const normalized = value?.trim();
79
+ return normalized ? normalized : null;
80
+ }
81
+ function formatReadableKey(value) {
82
+ const words = value.split("_").map((word) => word.trim().toLowerCase()).filter(Boolean);
83
+ if (!words.length) return "Unknown";
84
+ return words.map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
85
+ }
86
+
50
87
  // src/features/crm/pages/shared.ts
51
88
  var DEAL_REFERRER_STORAGE_KEY = "crm:dealReferrer";
52
89
  function setDealReferrer(referrer) {
@@ -65,22 +102,11 @@ function getDealReferrer() {
65
102
  return "deals";
66
103
  }
67
104
  }
68
- var DEAL_STAGE_COLORS = {
69
- interested: "blue",
70
- proposal: "yellow",
71
- closing: "orange",
72
- closed_won: "green",
73
- closed_lost: "red",
74
- nurturing: "grape"
75
- };
76
- var DEAL_STAGE_OPTIONS = [
77
- { value: "interested", label: "Interested" },
78
- { value: "proposal", label: "Proposal" },
79
- { value: "closing", label: "Closing" },
80
- { value: "closed_won", label: "Closed Won" },
81
- { value: "closed_lost", label: "Closed Lost" },
82
- { value: "nurturing", label: "Nurturing" }
83
- ];
105
+ var DEAL_STAGE_COLORS = getCrmStageColors();
106
+ var DEAL_STAGE_OPTIONS = getCrmStageOptions().map((option) => ({
107
+ value: option.value,
108
+ label: option.label
109
+ }));
84
110
  var DEAL_PRIORITY_OPTIONS = [
85
111
  { value: "needs_response", label: "Needs response" },
86
112
  { value: "follow_up_due", label: "Follow-up due" },
@@ -101,15 +127,10 @@ function compareDealsByPriorityThenUpdated(a, b, direction = "asc") {
101
127
  return getUpdatedTimestamp(b) - getUpdatedTimestamp(a);
102
128
  }
103
129
  function formatDealStageLabel(stage) {
104
- return formatDealWorkflowLabel(stage);
130
+ return getCrmStageLabel(stage);
105
131
  }
106
132
  function formatDealStateLabel(state) {
107
- return formatDealWorkflowLabel(state);
108
- }
109
- function formatDealWorkflowLabel(value) {
110
- const words = value?.trim().split("_").map((word) => word.trim().toLowerCase()).filter(Boolean);
111
- if (!words?.length) return "Unknown";
112
- return words.map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
133
+ return getCrmStateLabel(state);
113
134
  }
114
135
  function comparePriorityRank(a, b, direction) {
115
136
  const comparison = a.rank - b.rank;
@@ -1,6 +1,6 @@
1
1
  import { StyledMarkdown } from './chunk-3KMDHCAR.js';
2
2
  import { useRouterContext } from './chunk-Q7DJKLEN.js';
3
- import { getErrorInfo, getErrorTitle, getResourceIcon, formatTimeAgo } from './chunk-QD4X4H5A.js';
3
+ import { getErrorInfo, getErrorTitle, getResourceIcon, formatTimeAgo } from './chunk-HXZQWMKE.js';
4
4
  import { ResourceStatusColors } from './chunk-KRWALB24.js';
5
5
  import { useAuthContext } from './chunk-BRJ3QZ4E.js';
6
6
  import { Center, Stack, Title, Text, Button, Box, Loader, Badge, Group, Collapse, ScrollArea, Card, Select, Alert, Code, ThemeIcon, Paper, Grid, Timeline, Space } from '@mantine/core';
@@ -1,4 +1,4 @@
1
- import { APIClientError } from './chunk-QD4X4H5A.js';
1
+ import { APIClientError } from './chunk-HXZQWMKE.js';
2
2
  import { OrganizationContext } from './chunk-DD3CCMCZ.js';
3
3
  import { createContext, useContext, useMemo, useCallback } from 'react';
4
4
  import { jsx } from 'react/jsx-runtime';
@@ -2,12 +2,13 @@ import { AppShellLoader } from './chunk-RYTEQBAO.js';
2
2
  import { FilterBar } from './chunk-PDHTXPSF.js';
3
3
  import { CustomModal } from './chunk-KVJ3LFH2.js';
4
4
  import { useAvailablePresets } from './chunk-XBMCDGHA.js';
5
- import { useDeleteCredential, useCreateCredential, useCredentials, MEMBERSHIP_STATUS_COLORS, transformMembershipToTableRow, useUserMemberships, useUpdateWebhookEndpoint, useResources, useDeleteWebhookEndpoint, useCreateWebhookEndpoint, useListWebhookEndpoints, useOrgRoles, useAssignRole, useRevokeRole, useHasPermission, useUpdateMemberConfig, useOrganizationMembers, useUpdateCredential, CredentialSchemas } from './chunk-YHBPR67D.js';
6
- import { showApiErrorNotification, showErrorNotification, showSuccessNotification } from './chunk-G26INIF3.js';
7
- import { ListSkeleton, EmptyState, PageTitleCaption, CardHeader, APIErrorAlert, StatCard } from './chunk-RIFTUOPE.js';
5
+ import { useDeleteCredential, useCreateCredential, useCredentials, MEMBERSHIP_STATUS_COLORS, transformMembershipToTableRow, useUserMemberships, useUpdateWebhookEndpoint, useResources, useDeleteWebhookEndpoint, useCreateWebhookEndpoint, useListWebhookEndpoints, useOrgRoles, useAssignRole, useRevokeRole, useHasPermission, useUpdateMemberConfig, useOrganizationMembers, useUpdateCredential, CredentialSchemas } from './chunk-HNFQCOD2.js';
6
+ import { showApiErrorNotification, showErrorNotification, showSuccessNotification } from './chunk-CEHUFNAL.js';
7
+ import { ListSkeleton, EmptyState, PageTitleCaption, CardHeader, APIErrorAlert, StatCard } from './chunk-6WXDE5LZ.js';
8
8
  import { RoleBadge } from './chunk-GESXCQWY.js';
9
- import { isAPIClientError, formatDateTime, OAUTH_POPUP_CHECK_INTERVAL, OAUTH_FLOW_TIMEOUT } from './chunk-QD4X4H5A.js';
9
+ import { isAPIClientError, formatDateTime, OAUTH_FLOW_TIMEOUT } from './chunk-HXZQWMKE.js';
10
10
  import { useInitialization } from './chunk-WKJ47GIW.js';
11
+ import { useOrganization } from './chunk-DD3CCMCZ.js';
11
12
  import { useElevasisServices } from './chunk-5WWZXCS5.js';
12
13
  import { createUseExternalEvents, Text, Table, Group, Tooltip, ActionIcon, Stack, Title, Button, Select, TextInput, Alert, PasswordInput, Anchor, Paper, Card, Switch, Badge, Center, Loader, Box, Code, CopyButton, ThemeIcon, SimpleGrid, UnstyledButton, Divider, Textarea, Tabs, MultiSelect } from '@mantine/core';
13
14
  import { IconSettings, IconShieldOff, IconKey, IconCalendar, IconPencil, IconTrash, IconAlertTriangle, IconInfoCircle, IconExclamationMark, IconPlus, IconAlertCircle, IconUsers, IconSearch, IconBuilding, IconWebhook, IconCheck, IconCopy, IconUser, IconMail, IconRefresh, IconPalette, IconEye, IconSparkles, IconTrendingUp, IconClock, IconPlayerPause, IconPlayerPlay, IconActivity, IconShieldLock, IconAdjustments, IconBrandDropbox, IconBrandGoogleDrive, IconPlug, IconEdit, IconUserX, IconUserCheck } from '@tabler/icons-react';
@@ -36,6 +37,20 @@ var OAUTH_PROVIDERS = {
36
37
  tokenExchange: "form-encoded",
37
38
  scopes: ["https://www.googleapis.com/auth/spreadsheets"]
38
39
  },
40
+ "google-calendar": {
41
+ id: "google-calendar",
42
+ name: "Google Calendar",
43
+ authUrl: "https://accounts.google.com/o/oauth2/v2/auth",
44
+ tokenUrl: "https://oauth2.googleapis.com/token",
45
+ authParams: {
46
+ access_type: "offline",
47
+ // Required for refresh token
48
+ prompt: "consent"
49
+ // Force consent to get refresh token on reconnect
50
+ },
51
+ tokenExchange: "form-encoded",
52
+ scopes: ["https://www.googleapis.com/auth/calendar.readonly"]
53
+ },
39
54
  dropbox: {
40
55
  id: "dropbox",
41
56
  name: "Dropbox",
@@ -1859,10 +1874,13 @@ function MemberConfigModal({ opened, onClose, member }) {
1859
1874
  ] })
1860
1875
  ] }) });
1861
1876
  }
1877
+ var OAUTH_COMPLETION_CHANNEL = "elevasis-oauth";
1878
+ var OAUTH_COMPLETION_STORAGE_KEY = "elevasis:oauth-complete";
1862
1879
  function useOAuthFlow({ apiUrl }) {
1863
1880
  const [isAuthorizing, setIsAuthorizing] = useState(false);
1864
1881
  const [error, setError] = useState(null);
1865
- const { organizationId, isReady } = useElevasisServices();
1882
+ const { isReady } = useElevasisServices();
1883
+ const { currentSupabaseOrganizationId: organizationId } = useOrganization();
1866
1884
  const authorize = useCallback(
1867
1885
  async (provider, credentialName) => {
1868
1886
  if (!isReady || !organizationId) {
@@ -1887,15 +1905,15 @@ function useOAuthFlow({ apiUrl }) {
1887
1905
  if (!popup) {
1888
1906
  throw new Error("popup_blocked");
1889
1907
  }
1890
- await waitForOAuthCallback(popup);
1908
+ await waitForOAuthCallback(popup, Date.now());
1891
1909
  } catch (err) {
1892
1910
  const rawError = err instanceof Error ? err.message : "unknown";
1893
1911
  if (rawError.includes("popup_blocked")) {
1894
1912
  setError("Please enable popups and try again");
1895
- } else if (rawError.includes("cancelled")) {
1896
- setError("Authorization cancelled");
1897
1913
  } else if (rawError.includes("timeout")) {
1898
1914
  setError("Authorization timed out. Please try again.");
1915
+ } else if (rawError.includes("popup_closed")) {
1916
+ setError("Authorization was cancelled.");
1899
1917
  } else if (rawError.includes("token_exchange_failed")) {
1900
1918
  setError("Failed to obtain access token. Please try again.");
1901
1919
  } else if (rawError.includes("invalid_state")) {
@@ -1912,43 +1930,76 @@ function useOAuthFlow({ apiUrl }) {
1912
1930
  },
1913
1931
  [isReady, organizationId, apiUrl]
1914
1932
  );
1915
- const waitForOAuthCallback = (popup) => {
1933
+ const waitForOAuthCallback = (popup, startedAt) => {
1916
1934
  return new Promise((resolve, reject) => {
1917
- const messageHandler = (event) => {
1918
- const expectedOrigin = window.location.origin;
1919
- if (event.origin !== expectedOrigin) {
1920
- return;
1935
+ let broadcastChannel = null;
1936
+ const complete = (data) => {
1937
+ const payload = parseOAuthCompletionPayload(data, startedAt);
1938
+ if (!payload) return;
1939
+ cleanup();
1940
+ if (payload.status === "success") {
1941
+ resolve();
1942
+ } else {
1943
+ reject(new Error(payload.error || "oauth_failed"));
1921
1944
  }
1922
- if (event.data.type === "oauth-complete") {
1923
- cleanup();
1924
- if (event.data.status === "success") {
1925
- resolve();
1926
- } else {
1927
- reject(new Error(event.data.error || "oauth_failed"));
1928
- }
1945
+ };
1946
+ const messageHandler = (event) => {
1947
+ if (!isTrustedCallbackOrigin(event.origin)) return;
1948
+ complete(event.data);
1949
+ };
1950
+ const storageHandler = (event) => {
1951
+ if (event.key !== OAUTH_COMPLETION_STORAGE_KEY || !event.newValue) return;
1952
+ try {
1953
+ complete(JSON.parse(event.newValue));
1954
+ } catch {
1929
1955
  }
1930
1956
  };
1931
- window.addEventListener("message", messageHandler);
1932
- const checkClosed = setInterval(() => {
1957
+ const rejectIfPopupClosed = () => {
1933
1958
  if (popup.closed) {
1934
1959
  cleanup();
1935
- reject(new Error("cancelled"));
1960
+ reject(new Error("popup_closed"));
1936
1961
  }
1937
- }, OAUTH_POPUP_CHECK_INTERVAL);
1962
+ };
1963
+ window.addEventListener("message", messageHandler);
1964
+ window.addEventListener("storage", storageHandler);
1965
+ window.addEventListener("focus", rejectIfPopupClosed);
1966
+ if ("BroadcastChannel" in window) {
1967
+ broadcastChannel = new BroadcastChannel(OAUTH_COMPLETION_CHANNEL);
1968
+ broadcastChannel.onmessage = (event) => complete(event.data);
1969
+ }
1938
1970
  const timeout = setTimeout(() => {
1939
1971
  cleanup();
1940
- popup.close();
1941
1972
  reject(new Error("timeout"));
1942
1973
  }, OAUTH_FLOW_TIMEOUT);
1943
1974
  const cleanup = () => {
1944
- clearInterval(checkClosed);
1945
1975
  clearTimeout(timeout);
1976
+ broadcastChannel?.close();
1977
+ window.removeEventListener("focus", rejectIfPopupClosed);
1978
+ window.removeEventListener("storage", storageHandler);
1946
1979
  window.removeEventListener("message", messageHandler);
1947
1980
  };
1948
1981
  });
1949
1982
  };
1950
1983
  return { authorize, isAuthorizing, error };
1951
1984
  }
1985
+ function parseOAuthCompletionPayload(data, startedAt) {
1986
+ if (!data || typeof data !== "object") return null;
1987
+ const payload = data;
1988
+ if (payload.type !== "oauth-complete") return null;
1989
+ if (payload.completedAt && payload.completedAt < startedAt) return null;
1990
+ return payload;
1991
+ }
1992
+ function isTrustedCallbackOrigin(origin) {
1993
+ if (origin === window.location.origin || origin === "https://app.elevasis.io") {
1994
+ return true;
1995
+ }
1996
+ try {
1997
+ const url = new URL(origin);
1998
+ return url.protocol === "http:" && ["localhost", "127.0.0.1", "[::1]"].includes(url.hostname);
1999
+ } catch {
2000
+ return false;
2001
+ }
2002
+ }
1952
2003
  function EditCredentialModal({ apiUrl, credential, onClose }) {
1953
2004
  const [credentialName, setCredentialName] = useState("");
1954
2005
  const [nameError, setNameError] = useState(null);
@@ -2141,6 +2192,17 @@ function OAuthIntegrationsCard({ apiUrl }) {
2141
2192
  setSelectedProviderId(providerId);
2142
2193
  setModalOpened(true);
2143
2194
  };
2195
+ useEffect(() => {
2196
+ const params = new URLSearchParams(window.location.search);
2197
+ const requested = params.get("connect");
2198
+ if (requested && OAUTH_PROVIDERS[requested]) {
2199
+ handleOpenModal(requested);
2200
+ params.delete("connect");
2201
+ const remaining = params.toString();
2202
+ const newUrl = window.location.pathname + (remaining ? `?${remaining}` : "") + window.location.hash;
2203
+ window.history.replaceState({}, "", newUrl);
2204
+ }
2205
+ }, []);
2144
2206
  const providers = Object.values(OAUTH_PROVIDERS);
2145
2207
  const selectedProvider = selectedProviderId ? OAUTH_PROVIDERS[selectedProviderId] : null;
2146
2208
  return /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -1,11 +1,11 @@
1
1
  import { ChatHeader, ChatSidebar } from './chunk-ROSMICXG.js';
2
- import { getOrganizationGraphLensConfig, useOrganizationGraphFilters, createOrganizationGraphFilters, buildOrganizationGraph, filterOrganizationGraph, getCommandViewVisibilityProjection, resolveOrganizationGraphPathTrace, getCommandViewOperationalOverview, getCommandViewSelectionOperationalSummary, buildCommandViewDrillDownSections, expandAroundGraph, getConnectedHiddenResourceIds, FilterPanel, OrganizationGraphDetailPanel, ExpandAroundPanel, CommandViewSidebarContent, getOrganizationGraphTraceNodeOptions, formatOrganizationGraphTraceNodeOptionLabel } from './chunk-OHXU5WWK.js';
2
+ import { getOrganizationGraphLensConfig, useOrganizationGraphFilters, createOrganizationGraphFilters, buildOrganizationGraph, filterOrganizationGraph, getCommandViewVisibilityProjection, resolveOrganizationGraphPathTrace, getCommandViewOperationalOverview, getCommandViewSelectionOperationalSummary, buildCommandViewDrillDownSections, expandAroundGraph, getConnectedHiddenResourceIds, FilterPanel, OrganizationGraphDetailPanel, ExpandAroundPanel, CommandViewSidebarContent, getOrganizationGraphTraceNodeOptions, formatOrganizationGraphTraceNodeOptionLabel } from './chunk-3DUOPXOJ.js';
3
3
  import { SubshellLoader } from './chunk-JDNEWB5F.js';
4
- import { resolveSemanticIconComponent } from './chunk-KEFWANZY.js';
4
+ import { resolveSemanticIconComponent } from './chunk-JCGD4GM6.js';
5
5
  import { SubshellSidebarLoader } from './chunk-XQQEKWTL.js';
6
- import { BaseNode, useGraphTheme, BaseEdge, ExecutionStats, UnifiedWorkflowGraph, WorkflowExecutionTimeline, AgentExecutionVisualizer, AgentExecutionTimeline, GraphBackground, GraphFitViewButton, GraphFitViewHandler } from './chunk-G66QFZXD.js';
6
+ import { BaseNode, useGraphTheme, BaseEdge, ExecutionStats, UnifiedWorkflowGraph, WorkflowExecutionTimeline, AgentExecutionVisualizer, AgentExecutionTimeline, GraphBackground, GraphFitViewButton, GraphFitViewHandler } from './chunk-QNL7UI5G.js';
7
7
  import { FormFieldRenderer } from './chunk-3MEXPLWT.js';
8
- import { ResourceHealthPanel } from './chunk-YO2YORW4.js';
8
+ import { ResourceHealthPanel } from './chunk-OHGNCWJP.js';
9
9
  import { useCyberColors, CyberDonut } from './chunk-CW3UNAF2.js';
10
10
  import { AppShellLoader } from './chunk-RYTEQBAO.js';
11
11
  import { PageContainer } from './chunk-BZZCNLT6.js';
@@ -13,10 +13,10 @@ import { SubshellSidebarSection } from './chunk-IIMU5YAJ.js';
13
13
  import { CustomModal, ConfirmationModal } from './chunk-KVJ3LFH2.js';
14
14
  import { useGraphHighlighting, calculateGraphHeight, Graph_module_css_default, GRAPH_CONSTANTS } from './chunk-22UVE3RA.js';
15
15
  import { getResourceStatusColor, useTimelineData, useAgentIterationData, getStatusIcon } from './chunk-E4WQGJNS.js';
16
- import { useErrorDetail, useExecution, useArchivedLogs, useDeleteExecution, useRetryExecution, useCancelExecution, useCommandQueueTotals, useStatusFilter, useResourceSearch, useResourcesDomainFilters, usePaginationState, useResources, useRecentExecutionsByResource, filterByDomainFilters, collectResourceFilterFacets, useResourceDefinition, isSessionCapable, useDeleteTask, useCommandQueue, useSubmitAction, useCommandViewData, useCommandViewStats, useCommandViewStore, useResourceExecutions, useCheckpointTasks, COMMAND_VIEW_VISUALIZATION_MODES, useExecutionPanelState, useDeleteSession, useCreateSession, useSessions, useSessionExecutions, useSession, useBulkDeleteExecutions, getCommandViewGraphPositions } from './chunk-YHBPR67D.js';
17
- import { showApiErrorNotification, showSuccessNotification } from './chunk-G26INIF3.js';
16
+ import { useErrorDetail, useExecution, useArchivedLogs, useDeleteExecution, useRetryExecution, useCancelExecution, useCommandQueueTotals, useStatusFilter, useResourceSearch, useResourcesDomainFilters, usePaginationState, useResources, useRecentExecutionsByResource, filterByDomainFilters, collectResourceFilterFacets, useResourceDefinition, isSessionCapable, useDeleteTask, useCommandQueue, useSubmitAction, useCommandViewData, useCommandViewStats, useCommandViewStore, useResourceExecutions, useCheckpointTasks, COMMAND_VIEW_VISUALIZATION_MODES, useExecutionPanelState, useDeleteSession, useCreateSession, useSessions, useSessionExecutions, useSession, useBulkDeleteExecutions, getCommandViewGraphPositions } from './chunk-HNFQCOD2.js';
17
+ import { showApiErrorNotification, showSuccessNotification } from './chunk-CEHUFNAL.js';
18
18
  import { useMergedExecution } from './chunk-3ZMAGTWF.js';
19
- import { JsonViewer, CardHeader, PageTitleCaption, CollapsibleSection, TabCountBadge, ResourceCard, ContextViewer, EmptyState, APIErrorAlert } from './chunk-RIFTUOPE.js';
19
+ import { JsonViewer, CardHeader, PageTitleCaption, CollapsibleSection, TabCountBadge, ResourceCard, ContextViewer, EmptyState, APIErrorAlert } from './chunk-6WXDE5LZ.js';
20
20
  import { StyledMarkdown } from './chunk-3KMDHCAR.js';
21
21
  import { useOptionalElevasisFeatures, useElevasisFeatures } from './chunk-V3HUIZJX.js';
22
22
  import { SubshellContentContainer } from './chunk-TKAYX2SP.js';
@@ -24,7 +24,7 @@ import { NavigationButton } from './chunk-NYBEU5TE.js';
24
24
  import { useRouterContext } from './chunk-Q7DJKLEN.js';
25
25
  import { useAppearance } from './chunk-E565XMTQ.js';
26
26
  import { topbarHeight } from './chunk-DT3QYZVU.js';
27
- import { getErrorInfo, formatErrorMessage, getResourceIcon, formatRelativeTime, PAGE_SIZE_DEFAULT, debounce } from './chunk-QD4X4H5A.js';
27
+ import { getErrorInfo, formatErrorMessage, getResourceIcon, formatRelativeTime, PAGE_SIZE_DEFAULT, debounce } from './chunk-HXZQWMKE.js';
28
28
  import { ResourceStatusColors, toWorkflowLogMessages } from './chunk-KRWALB24.js';
29
29
  import { useInitialization } from './chunk-WKJ47GIW.js';
30
30
  import { useOrganization } from './chunk-DD3CCMCZ.js';
@@ -3826,6 +3826,7 @@ function getNodeThemeByKind(tokens) {
3826
3826
  surface: mixColors(tokens.primary, tokens.success, 0.48),
3827
3827
  entity: mixColors(tokens.primary, tokens.error, 0.4),
3828
3828
  capability: mixColors(tokens.primary, tokens.success, 0.72),
3829
+ stage: mixColors(tokens.primary, tokens.warning, 0.32),
3829
3830
  resource: mixColors(tokens.primary, tokens.warning, 0.58),
3830
3831
  knowledge: mixColors(tokens.primary, tokens.text, 0.6)
3831
3832
  };
@@ -1,4 +1,4 @@
1
- import { getErrorInfo, formatErrorMessage, getErrorTitle } from './chunk-QD4X4H5A.js';
1
+ import { getErrorInfo, formatErrorMessage, getErrorTitle } from './chunk-HXZQWMKE.js';
2
2
  import { useElevasisServices } from './chunk-5WWZXCS5.js';
3
3
  import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
4
4
  import { notifications } from '@mantine/notifications';
@@ -1,4 +1,4 @@
1
- import { SemanticIcon } from './chunk-KEFWANZY.js';
1
+ import { SemanticIcon } from './chunk-JCGD4GM6.js';
2
2
  import { Stack, Group, Title, Text, Box, Divider, useTree, Tree, UnstyledButton, TextInput } from '@mantine/core';
3
3
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
4
  import { useMemo, useState, useRef, useEffect } from 'react';
@@ -332,6 +332,7 @@ var FEATURE_PREFIX = "feat:";
332
332
  var LEAF_PREFIX = "leaf:";
333
333
  var FOLDER_PREFIX = "folder:";
334
334
  var GROUP_THRESHOLD = 8;
335
+ var SIDEBAR_TREE_ACCENT_COLOR = "var(--color-primary)";
335
336
  var FOLDER_ORDER = [
336
337
  "campaigns",
337
338
  "pipeline",
@@ -641,9 +642,7 @@ function KnowledgeLeafRow({ elementProps, knowledgeNode, isActive, onSelectNode
641
642
  token: getKnowledgeIconToken(knowledgeNode),
642
643
  fallbackKind: knowledgeNode.kind,
643
644
  size: 15,
644
- style: {
645
- color: isActive ? "var(--color-primary)" : hovered ? "var(--color-text)" : "var(--color-text-subtle)"
646
- }
645
+ style: { color: SIDEBAR_TREE_ACCENT_COLOR }
647
646
  }
648
647
  ),
649
648
  /* @__PURE__ */ jsx(
@@ -717,7 +716,7 @@ function DirectoryRow({
717
716
  justifyContent: "center",
718
717
  width: 12,
719
718
  height: 12,
720
- color: "var(--color-text-subtle)",
719
+ color: SIDEBAR_TREE_ACCENT_COLOR,
721
720
  flexShrink: 0
722
721
  },
723
722
  children: expanded ? /* @__PURE__ */ jsx(IconChevronDown, { size: 12, stroke: 2 }) : /* @__PURE__ */ jsx(IconChevronRight, { size: 12, stroke: 2 })
@@ -729,9 +728,7 @@ function DirectoryRow({
729
728
  token: iconToken,
730
729
  fallbackKind: "feature",
731
730
  size: 14,
732
- style: {
733
- color: isActive ? "var(--color-primary)" : hovered ? "var(--color-text)" : "var(--color-text-subtle)"
734
- }
731
+ style: { color: SIDEBAR_TREE_ACCENT_COLOR }
735
732
  }
736
733
  ),
737
734
  /* @__PURE__ */ jsx(
@@ -769,7 +766,7 @@ function TrailingCopySlot({ count, command, label, showCopy }) {
769
766
  height: 22,
770
767
  flexShrink: 0
771
768
  },
772
- children: showCopy && command ? /* @__PURE__ */ jsx(CopyCommandControl, { command, label, visible: true }) : count > 0 ? /* @__PURE__ */ jsx(KindChip, { kind: String(count), tone: "muted" }) : null
769
+ children: showCopy && command ? /* @__PURE__ */ jsx(CopyCommandControl, { command, label, visible: true }) : count > 0 ? /* @__PURE__ */ jsx(KindChip, { kind: String(count), tone: "primary" }) : null
773
770
  }
774
771
  );
775
772
  }
@@ -2001,4 +1998,4 @@ function KnowledgeSearchBar({
2001
1998
  );
2002
1999
  }
2003
2000
 
2004
- export { EdgeRelationshipGroup, KNOWLEDGE_ICON_TOKEN_BY_KIND, KeyField, KindChip, KnowledgeSearchBar, KnowledgeTree, NodeDescribeShell, NodeHeader, NodeMetadataFooter, RelatedKnowledgeSection, byKind, getKnowledgeIconToken };
2001
+ export { EdgeChip, EdgeGroup, EdgeRelationshipGroup, KNOWLEDGE_ICON_TOKEN_BY_KIND, KeyField, KindChip, KnowledgeSearchBar, KnowledgeTree, NodeDescribeShell, NodeHeader, NodeMetadataFooter, RelatedKnowledgeSection, byKind, getKnowledgeIconToken };
@@ -1,7 +1,6 @@
1
1
  import { existsSync } from 'fs';
2
2
  import { resolve } from 'path';
3
3
  import { spawnSync } from 'child_process';
4
- import { runKnowledgeCodegen } from '@elevasis/sdk/node';
5
4
 
6
5
  // src/vite-plugin-knowledge/index.ts
7
6
  function detectLayout(viteRoot) {
@@ -58,6 +57,11 @@ function knowledgePlugin() {
58
57
  }
59
58
  return;
60
59
  }
60
+ const sdkNodeSpecifier = "@elevasis/sdk/node";
61
+ const { runKnowledgeCodegen } = await import(
62
+ /* @vite-ignore */
63
+ sdkNodeSpecifier
64
+ );
61
65
  await runKnowledgeCodegen(layout);
62
66
  }
63
67
  return {