@iblai/iblai-js 1.20.0 → 1.20.2
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.
|
@@ -3,11 +3,11 @@ import React__default, { useRef, useEffect, useState, useCallback, useLayoutEffe
|
|
|
3
3
|
import { useDispatch, useSelector } from 'react-redux';
|
|
4
4
|
import { selectSessionId, selectActiveChatMessages, useCachedSessionId, chatActions, LOCAL_STORAGE_KEYS, TimeTracker, getInitials, useTenantMetadata, WithPermissions, useStripeUpgrade, CHAT_AREA_SIZE, isAlphaNumeric32, checkRbacPermission, getTimeAgo, REQUIRED_ACTIONS_FOR_GROUPS, formatRelativeTime as formatRelativeTime$2, ANONYMOUS_USERNAME, combineCSVData, redirectToAuthSpaJoinTenant, redirectToAuthSpa, getAuthSpaJoinUrl, useOS, selectNumberOfActiveChatMessages, useUsername, selectStreaming, isLoggedIn, TOOLS, isSafariBrowser, useShowAttachment, useShowVoiceCall, useShowVoiceRecorder, useMentorSettings, selectShowingSharedChat, selectRbacPermissions, useShowFreeTrialDialog, useEmbedMode, chatInputSliceSelectors, useResponsive, useAccessingPublicRoute, useVisitingTenant, useModelFileUploadCapabilities, useChatFileUpload, useVoiceChat, selectAttachedFiles, MENTOR_CHAT_DOCUMENTS_EXTENSIONS, removeFile, chatInputSliceActions, WithFormPermissions, MENTOR_VISIBILITY } from '@iblai/web-utils';
|
|
5
5
|
import { useGetTenantChatPrivacyConfigQuery, useGetChatPrivacyEffectiveQuery, useCreateSessionIdMutation, useUpdateSessionDisableChathistoryMutation, chatPrivacyApiSlice, useTimeTrackingMutation, useGetUserMetadataQuery, useGetUserMetadataEdxQuery, useUpdateUserMetadataMutation, useUpdateUserMetadataEdxMutation, useUploadProfileImageMutation, useResetPasswordMutation, useSelfRetireMutation, useCreateUserInstitutionMutation, useGetUserInstitutionsQuery, useCreateUserEducationMutation, useUpdateUserEducationMutation, useDeleteUserEducationMutation, useGetUserEducationQuery, useCreateUserCompanyMutation, useGetUserCompaniesQuery, useCreateUserExperienceMutation, useUpdateUserExperienceMutation, useDeleteUserExperienceMutation, useGetUserExperienceQuery, useGetUserResumeQuery, useCreateUserResumeMutation, useGetMySubscriptionsQuery, useGetItemSubscriptionQuery, useCancelSubscriptionMutation, useCreateGlobalMemoryMutation, useGetMemsearchStatusQuery, useGetUserMemorySettingsQuery, useUpdateUserMemorySettingsMutation, useGetGlobalMemoriesQuery, useDeleteGlobalMemoryMutation, ChatPrivacyModeEnum, useGetUserChatPrivacySettingsQuery, useUpdateUserChatPrivacySettingsMutation, CHAT_PRIVACY_MODES, useInviteUserMutation, usePlatformInvitationsQuery, useCreateCatalogInvitationCourseBulkMutation, useGetCatalogInvitationsCourseQuery, useLazyPlatformUsersQuery, useLazyPlatformUserGroupsQuery, useGetPersonnalizedSearchQuery, useCreateCatalogInvitationProgramBulkMutation, useGetCatalogInvitationsProgramQuery, useUpdateUserRoleMutation, useUpdateUserStatusMutation, useUpdatePlatformUserRoleWithPoliciesMutation, usePlatformUsersQuery, isPoliciesResponse, platformApiSlice, featureTags, useLazyGetRbacTeamsAccessListQuery, useCreateRbacTeamsAccessMutation, useGetRbacGroupsQuery, usePlatformUserGroupsQuery, useCreateRbacGroupMutation, useUpdateRbacGroupMutation, useDeleteRbacGroupMutation, useCreatePlatformUserGroupMutation, useUpdatePlatformUserGroupMutation, useDeletePlatformUserGroupMutation, useGetRbacGroupDetailsQuery, useGetPlatformUserGroupDetailsQuery, useGetRbacPermissionsMutation, useGetRbacRolesQuery, useCreateRbacRoleMutation, useUpdateRbacRoleMutation, useDeleteRbacRoleMutation, useGetRbacRoleDetailsQuery, useGetRbacActionsDefinitionQuery, useGetRbacPoliciesQuery, useCreateRbacPolicyMutation, useUpdateRbacPolicyMutation, useDeleteRbacPolicyMutation, useGetRbacPolicyDetailsQuery, useGetWatchedGroupsQuery, useCreateWatchedGroupMutation, useUpdateWatchedGroupMutation, useDeleteWatchedGroupMutation, useAddWatchedUserMutation, useRemoveWatchedUserMutation, useAddWatcherMutation, useUpdateWatcherMutation, useDeleteWatcherMutation, useGetWatchedUsersQuery, useGetWatchersQuery, WATCHER_NOTIFICATION_EVENTS, WATCHER_NOTIFICATION_EVENT_LABELS, useDeleteApiKeyMutation, useGetApiKeysQuery, useCreateApiKeyMutation, useCreateLLMCredentialMutation, useGetCredentialsSchemaQuery, useGetMaskedLLMCredentialsQuery, useGetLlmsQuery, useDeleteIntegrationCredentialMutation, useDeleteCredentialMutation, useCreateIntegrationCredentialMutation, useGetIntegrationCredentialsSchemaQuery, useGetMaskedIntegrationCredentialsQuery, useGetAccountBillingInfoQuery, useUpdateAutoRechargeInfoMutation, useTriggerAutoRechargeMutation, useCreateStripeCustomerPortalMutation, useSetPlatformConfigurationsMutation, useGetPlatformConfigurationsQuery, useUpdatePlatformMembershipMutation, useGetPlatformMembershipQuery, useGetCustomDomainsQuery, useCreateCustomDomainMutation, useDeleteCustomDomainMutation, useGetStudentMentorCreationStatusQuery, useSetStudentMentorCreationStatusMutation, coreApiSlice, recommendationPromptTypeEnum, useGetRecommendedPromptsListQuery, useCreateRecommendedPromptMutation, useUpdateRecommendedPromptMutation, useDeleteRecommendedPromptMutation, useLazyGetPublicPlatformImageAssetFileUrlQuery, useUpdateTenantMetadataMutation, useCreatePlatformImageAssetMutation, useGetProviderConfigQuery, useCreateProviderConfigMutation, useDeleteProviderConfigMutation, useGetExternalMappingQuery, useGetCredentialsListQuery, useCreateExternalMappingMutation, useDeleteExternalMappingMutation, useGetMemsearchConfigQuery, useUpdateMemsearchConfigMutation, useUpdateTenantChatPrivacyConfigMutation, useGetCustomMentorsQuery, useGetStripeConnectStatusQuery, useStartStripeConnectOnboardingMutation, useLazyGetStripeConnectDashboardQuery, useGetAiSearchMentorsQuery, useListPaywallsQuery, useListPricesQuery, useCreatePriceMutation, useUpdatePriceMutation, useDeletePriceMutation, useGetPaywallConfigQuery, useEnablePaywallMutation, useUpdatePaywallMutation, useGetNotificationsCountQuery, useLazyGetNotificationsQuery, useMarkAllAsReadMutation, useCreateNotificationPreviewMutation, useSendNotificationMutation, useGetMentorsQuery, useUpdateTemplateMutation, useGetTemplateDetailsQuery, useGetTemplatesQuery, useLazyGetTemplateDetailsQuery, useToggleTemplateMutation, useGetTopicsStatsQuery, useGetUsersStatsQuery, useGetSessionStatsQuery, useGetTopicsDetailsStatsQuery, useGetAccessTimeHeatmapQuery, useGetUserDetailsStatsQuery, useGetTranscriptsConversationHeadlineQuery, useGetAverageRatingQuery, useGetFinancialStatsQuery, useGetDetailedFinancialStatsQuery, useGetTranscriptsMessagesDetailsQuery, useGetTranscriptsMessagesQuery, useGetReportDetailQuery, useLazyGetDownloadReportFromURLQuery, useGetReportsQuery, useCreateReportMutation, useGetMentorPublicSettingsQuery, useGetContentAnalyticsQuery, useGetContentAnalyticsDetailsQuery, useGetRevenueQuery, useListSubscribersQuery, useGetAuditLogsQuery, useLazyGetCourseMetaDataQuery, useLazyGetCourseCompletionOutlinesQuery, useLazyGetCourseEligibilityQuery, useLazyGetUserEnrolledCoursesQuery, useLazyGetUserAssignedCoursesQuery, useLazyGetUserCredentialsQuery, useLazyGetOverTimeActivityQuery, useLazyGetCatalogSearchQuery, useGetUserEarnedSkillsQuery, useGetUserReportedSkillsQuery, useGetUserDesiredSkillsQuery, useCreateOrUpdateUserReportedSkillMutation, useCreateOrUpdateUserDesiredSkillMutation, useLazyGetPathwayListQuery, useLazyGetUserAssignedPathwaysQuery, useLazyGetUserEnrolledPathwaysQuery, useLazyGetPathwayCompletionQuery, useLazyGetProgramListQuery, useLazyGetProgramCompletionQuery, useLazyGetUserEnrolledProgramsQuery, useLazyGetAssignedProgramsQuery, useLazyGetUserSkillsPointsQuery, useLazyGetUserReportedSkillsQuery, useLazyGetUserDesiredSkillsQuery, useLazyGetUserCatalogPathwaysQuery, useLazyGetPerLearnerInfoQuery, useLazyGetEdxSSOTokenQuery, useCreateCourseEnrollmentMutation, useCreateStripeCheckoutSessionMutation, useLazyGetCourseProgressQuery, useLazyGetCourseCompletionQuery, useLazyGetPersonnalizedSearchQuery, useUpdateExamAttemptMutation, useStartExamMutation, useLazyGetExamInfoQuery, useGetClawMentorConfigQuery, useGetClawInstancesQuery, useGetAgentConfigQuery, useUpdateClawMentorConfigMutation, useCreateClawMentorConfigMutation, useDeleteClawMentorConfigMutation, usePushClawConfigMutation, useCreateClawInstanceMutation, useDeleteClawInstanceMutation, useUpdateAgentConfigMutation, useHealthCheckClawInstanceMutation, useTestConnectivityClawInstanceMutation, useUpdateClawInstanceMutation, useGetAgentSkillsQuery, useGetMentorSkillAssignmentsQuery, useCreateMentorSkillAssignmentMutation, useUpdateMentorSkillAssignmentMutation, useDeleteMentorSkillAssignmentMutation, useCreateAgentSkillMutation, useUpdateAgentSkillMutation, useDeleteAgentSkillMutation, useCreateCheckoutMutation, useGetUserProjectsQuery, useUpdateUserProjectMutation, useGetTrainingDocumentsQuery, useGetVectorDocumentsQuery, useGetMentorMemoriesListQuery, useGetMemoryCategoriesAdminQuery, useDeleteMentorMemoryMutation, useUpdateMentorMemoryMutation, useCreateMentorMemoryMutation, useLazyGetConnectedServiceAuthUrlQuery, useGetPublicMentorsQuery, useCreateUserProjectMutation, useDeleteUserProjectMutation, useGetUserProjectDetailsQuery, useEditTrainingDocumentMutation, useAddTrainingDocumentMutation, useLazyGetCredentialsQuery, useGetMentorSettingsQuery, useEditMentorMutation, useGetMentorCategoriesQuery, useCreateMentorMutation, useUpdateUserPlatformMetadataMutation, useGetPromptCategoriesQuery, useCreatePromptMutation, useDeletePromptMutation, useGetPromptsSearchQuery, useUpdatePromptMutation, useDeleteTrainingDocumentMutation, useGetTrainingDocumentRetrainScheduleQuery, useCreateTrainingDocumentRetrainScheduleMutation } from '@iblai/data-layer';
|
|
6
|
-
import { toast
|
|
6
|
+
import { toast } from 'sonner';
|
|
7
7
|
import { jsx, Fragment as Fragment$1, jsxs } from 'react/jsx-runtime';
|
|
8
8
|
import * as ReactDOM from 'react-dom';
|
|
9
9
|
import ReactDOM__default from 'react-dom';
|
|
10
|
-
import { z
|
|
10
|
+
import { z } from 'zod';
|
|
11
11
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
12
12
|
import { createDialogScope } from '@radix-ui/react-dialog';
|
|
13
13
|
import { NotificationSourceTypeEnum, StateEnum, MentorVisibilityEnum, PromptVisibilityEnum } from '@iblai/iblai-api';
|
|
@@ -60048,8 +60048,8 @@ function useForm(opts) {
|
|
|
60048
60048
|
const FACEBOOK_URL_PREFIX = 'https://facebook.com/';
|
|
60049
60049
|
const X_URL_PREFIX = 'https://x.com/';
|
|
60050
60050
|
const LINKEDIN_URL_PREFIX = 'https://linkedin.com/in/';
|
|
60051
|
-
const socialFormSchema = z
|
|
60052
|
-
facebook: z
|
|
60051
|
+
const socialFormSchema = z.object({
|
|
60052
|
+
facebook: z.string().refine((val) => {
|
|
60053
60053
|
if (!val || val === '')
|
|
60054
60054
|
return true;
|
|
60055
60055
|
// Extract username from full URL and validate
|
|
@@ -60058,7 +60058,7 @@ const socialFormSchema = z$1.object({
|
|
|
60058
60058
|
}, {
|
|
60059
60059
|
message: 'Username can only contain letters, numbers, hyphens, and periods',
|
|
60060
60060
|
}),
|
|
60061
|
-
linkedIn: z
|
|
60061
|
+
linkedIn: z.string().refine((val) => {
|
|
60062
60062
|
if (!val || val === '')
|
|
60063
60063
|
return true;
|
|
60064
60064
|
// Extract username from full URL and validate
|
|
@@ -60067,7 +60067,7 @@ const socialFormSchema = z$1.object({
|
|
|
60067
60067
|
}, {
|
|
60068
60068
|
message: 'Username must be at least 5 characters long and can only contain letters, numbers, and periods.',
|
|
60069
60069
|
}),
|
|
60070
|
-
x: z
|
|
60070
|
+
x: z.string().refine((val) => {
|
|
60071
60071
|
if (!val || val === '')
|
|
60072
60072
|
return true;
|
|
60073
60073
|
// Extract username from full URL and validate
|
|
@@ -60294,20 +60294,6 @@ const useProfile = (username) => {
|
|
|
60294
60294
|
};
|
|
60295
60295
|
};
|
|
60296
60296
|
|
|
60297
|
-
var M=(e,i,s,u,m,a,l,h)=>{let d=document.documentElement,w=["light","dark"];function p(n){(Array.isArray(e)?e:[e]).forEach(y=>{let k=y==="class",S=k&&a?m.map(f=>a[f]||f):m;k?(d.classList.remove(...S),d.classList.add(a&&a[n]?a[n]:n)):d.setAttribute(y,n);}),R(n);}function R(n){h&&w.includes(n)&&(d.style.colorScheme=n);}function c(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(u)p(u);else try{let n=localStorage.getItem(i)||s,y=l&&n==="system"?c():n;p(y);}catch(n){}};var x$1=React.createContext(void 0),U$1={setTheme:e=>{},themes:[]},z=()=>{var e;return (e=React.useContext(x$1))!=null?e:U$1};React.memo(({forcedTheme:e,storageKey:i,attribute:s,enableSystem:u,enableColorScheme:m,defaultTheme:a,value:l,themes:h,nonce:d,scriptProps:w})=>{let p=JSON.stringify([s,i,a,e,h,l,u,m]).slice(1,-1);return React.createElement("script",{...w,suppressHydrationWarning:true,nonce:typeof window=="undefined"?d:"",dangerouslySetInnerHTML:{__html:`(${M.toString()})(${p})`}})});
|
|
60298
|
-
|
|
60299
|
-
const Toaster = ({ ...props }) => {
|
|
60300
|
-
const { theme = "system" } = z();
|
|
60301
|
-
return (jsx(Toaster$1, { theme: theme, className: "toaster group", toastOptions: {
|
|
60302
|
-
classNames: {
|
|
60303
|
-
toast: "group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
|
|
60304
|
-
description: "group-[.toast]:text-muted-foreground",
|
|
60305
|
-
actionButton: "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
|
|
60306
|
-
cancelButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",
|
|
60307
|
-
},
|
|
60308
|
-
}, ...props }));
|
|
60309
|
-
};
|
|
60310
|
-
|
|
60311
60297
|
const Dialog = DialogPrimitive.Root;
|
|
60312
60298
|
const DialogTrigger = DialogPrimitive.Trigger;
|
|
60313
60299
|
const DialogPortal = DialogPrimitive.Portal;
|
|
@@ -60376,7 +60362,7 @@ const Security = ({ email, onAccountDeleted, }) => {
|
|
|
60376
60362
|
setDeleting(false);
|
|
60377
60363
|
}
|
|
60378
60364
|
};
|
|
60379
|
-
return (jsxs(Fragment$1, { children: [jsxs("div", { className: "border border-gray-200 rounded-lg p-6", children: [jsxs("div", { className: "max-w-md mx-auto text-center py-12", children: [jsx("div", { className: "text-gray-400 dark:text-gray-500 mb-6", children: jsx(Shield, { className: "h-20 w-20 mx-auto" }) }), jsx("h4", { className: "text-xl font-semibold text-gray-900 dark:text-gray-100 mb-4", children: "Security Settings" }), jsx("p", { className: "text-gray-600 dark:text-gray-400 mb-8", children: "Click to reset your password." }), jsx(Button$1, { className: "w-full bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white", onClick: handleResetPasswordLink, disabled: processing, children: processing ? 'Sending Password Reset Link...' : 'Send Password Reset Link' })] }), jsx("div", { className: "flex justify-end", children: jsx("button", { type: "button", className: "text-sm text-gray-400 hover:text-[#2563EB] hover:underline transition-colors", onClick: () => setIsConfirmOpen(true), children: "Delete account" }) })] }), jsx(Dialog, { open: isConfirmOpen, onOpenChange: setIsConfirmOpen, children: jsxs(DialogContent, { children: [jsxs(DialogHeader, { children: [jsx(DialogTitle, { children: "Are you sure?" }), jsx(DialogDescription, { children: "This will permanently delete your account and all associated data. This action cannot be undone. You will be logged out upon successful deletion." })] }), jsxs(DialogFooter, { children: [jsx(Button$1, { variant: "outline", onClick: () => setIsConfirmOpen(false), disabled: deleting, children: "Cancel" }), jsx(Button$1, { className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white", onClick: handleDeleteAccount, disabled: deleting, children: deleting ? 'Deleting...' : 'Yes, Delete My Account' })] })] }) })
|
|
60365
|
+
return (jsxs(Fragment$1, { children: [jsxs("div", { className: "border border-gray-200 rounded-lg p-6", children: [jsxs("div", { className: "max-w-md mx-auto text-center py-12", children: [jsx("div", { className: "text-gray-400 dark:text-gray-500 mb-6", children: jsx(Shield, { className: "h-20 w-20 mx-auto" }) }), jsx("h4", { className: "text-xl font-semibold text-gray-900 dark:text-gray-100 mb-4", children: "Security Settings" }), jsx("p", { className: "text-gray-600 dark:text-gray-400 mb-8", children: "Click to reset your password." }), jsx(Button$1, { className: "w-full bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white", onClick: handleResetPasswordLink, disabled: processing, children: processing ? 'Sending Password Reset Link...' : 'Send Password Reset Link' })] }), jsx("div", { className: "flex justify-end", children: jsx("button", { type: "button", className: "text-sm text-gray-400 hover:text-[#2563EB] hover:underline transition-colors", onClick: () => setIsConfirmOpen(true), children: "Delete account" }) })] }), jsx(Dialog, { open: isConfirmOpen, onOpenChange: setIsConfirmOpen, children: jsxs(DialogContent, { children: [jsxs(DialogHeader, { children: [jsx(DialogTitle, { children: "Are you sure?" }), jsx(DialogDescription, { children: "This will permanently delete your account and all associated data. This action cannot be undone. You will be logged out upon successful deletion." })] }), jsxs(DialogFooter, { children: [jsx(Button$1, { variant: "outline", onClick: () => setIsConfirmOpen(false), disabled: deleting, children: "Cancel" }), jsx(Button$1, { className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white", onClick: handleDeleteAccount, disabled: deleting, children: deleting ? 'Deleting...' : 'Yes, Delete My Account' })] })] }) })] }));
|
|
60380
60366
|
};
|
|
60381
60367
|
|
|
60382
60368
|
function Skeleton({ className, ...props }) {
|
|
@@ -86714,7 +86700,7 @@ function PurchasesTab({ org, username }) {
|
|
|
86714
86700
|
refetch();
|
|
86715
86701
|
} }));
|
|
86716
86702
|
}
|
|
86717
|
-
return (jsxs("div", { className: "max-w-2xl space-y-4", children: [jsxs("div", { className: "relative", children: [jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }), jsx(Input, { value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), placeholder: "Search purchases...", className: "pl-9" }), isFetching && !isLoading && (jsx(LoaderCircle, { className: "absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 animate-spin text-gray-400" }))] }), jsxs("div", { className: "flex flex-col sm:flex-row gap-2", children: [jsxs(Select$1, { value: statusFilter, onValueChange: setStatusFilter, children: [jsx(SelectTrigger, { className: "w-full sm:w-[160px]", children: jsx(SelectValue, { placeholder: "Status" }) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "all", children: "All Statuses" }), jsx(SelectItem, { value: "active", children: "Active" }), jsx(SelectItem, { value: "trialing", children: "Trialing" }), jsx(SelectItem, { value: "canceled", children: "Canceled" }), jsx(SelectItem, { value: "past_due", children: "Past Due" })] })] }), jsxs(Select$1, { value: typeFilter, onValueChange: setTypeFilter, children: [jsx(SelectTrigger, { className: "w-full sm:w-[160px]", children: jsx(SelectValue, { placeholder: "Item Type" }) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "all", children: "All Types" }), jsx(SelectItem, { value: "mentor", children: "
|
|
86703
|
+
return (jsxs("div", { className: "max-w-2xl space-y-4", children: [jsxs("div", { className: "relative", children: [jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }), jsx(Input, { value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), placeholder: "Search purchases...", className: "pl-9" }), isFetching && !isLoading && (jsx(LoaderCircle, { className: "absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 animate-spin text-gray-400" }))] }), jsxs("div", { className: "flex flex-col sm:flex-row gap-2", children: [jsxs(Select$1, { value: statusFilter, onValueChange: setStatusFilter, children: [jsx(SelectTrigger, { className: "w-full sm:w-[160px]", children: jsx(SelectValue, { placeholder: "Status" }) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "all", children: "All Statuses" }), jsx(SelectItem, { value: "active", children: "Active" }), jsx(SelectItem, { value: "trialing", children: "Trialing" }), jsx(SelectItem, { value: "canceled", children: "Canceled" }), jsx(SelectItem, { value: "past_due", children: "Past Due" })] })] }), jsxs(Select$1, { value: typeFilter, onValueChange: setTypeFilter, children: [jsx(SelectTrigger, { className: "w-full sm:w-[160px]", children: jsx(SelectValue, { placeholder: "Item Type" }) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "all", children: "All Types" }), jsx(SelectItem, { value: "mentor", children: "Agent" }), jsx(SelectItem, { value: "course", children: "Course" }), jsx(SelectItem, { value: "program", children: "Program" }), jsx(SelectItem, { value: "pathway", children: "Pathway" })] })] }), data && (jsxs("span", { className: "text-xs text-gray-400 self-center ml-auto", children: [data.count, " purchase", data.count !== 1 ? 's' : ''] }))] }), isLoading ? (jsx("div", { className: "space-y-2", children: [1, 2, 3].map((i) => (jsx(Skeleton, { className: "h-24 w-full" }, i))) })) : (data === null || data === void 0 ? void 0 : data.results) && data.results.length > 0 ? (jsxs(Fragment$1, { children: [jsx("div", { className: "space-y-2", children: data.results.map((sub) => (jsx(SubscriptionCard, { sub: sub, onClick: () => setSelectedSubscription(sub) }, sub.unique_id))) }), (data.previous_page !== null || data.next_page !== null) && (jsxs("div", { className: "flex items-center justify-between pt-2", children: [jsxs("span", { className: "text-xs text-gray-400", children: [data.count, " total"] }), jsxs("div", { className: "flex items-center gap-2", children: [jsx(Button$1, { variant: "outline", size: "sm", disabled: data.previous_page === null, onClick: () => data.previous_page !== null && setPage(data.previous_page), className: "h-7 text-xs cursor-pointer", children: "Previous" }), jsxs("span", { className: "text-xs text-gray-500", children: ["Page ", page] }), jsx(Button$1, { variant: "outline", size: "sm", disabled: data.next_page === null, onClick: () => data.next_page !== null && setPage(data.next_page), className: "h-7 text-xs cursor-pointer", children: "Next" })] })] }))] })) : (jsx(Card, { className: "shadow-sm border border-dashed", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-8 text-center", children: [jsx(ShoppingBag, { className: "h-10 w-10 mx-auto text-gray-300 mb-3" }), jsx("p", { className: "text-sm text-gray-400", children: debouncedSearch.trim() ? 'No purchases match your search.' : 'No purchases found.' })] }) }))] }));
|
|
86718
86704
|
}
|
|
86719
86705
|
|
|
86720
86706
|
function AddMemoryDialog({ open, onOpenChange, org, username }) {
|
|
@@ -90886,7 +90872,7 @@ const TabDescription = ({ icon, title, children }) => {
|
|
|
90886
90872
|
return (jsxs("div", { className: "flex gap-3 items-start border rounded-lg p-4 bg-blue-50/60 border-blue-100", children: [jsx("div", { className: "shrink-0 w-9 h-9 rounded-md flex items-center justify-center bg-blue-100 text-blue-600", children: icon }), jsxs("div", { className: "flex-1 min-w-0", children: [jsx("h3", { className: "text-sm font-semibold mb-1 text-blue-900 hidden sm:block", children: title }), jsx("p", { className: `text-sm text-gray-600 leading-relaxed sm:line-clamp-none! ${expanded ? '' : 'line-clamp-2'}`, children: children }), jsx("button", { type: "button", onClick: () => setExpanded((prev) => !prev), className: "mt-1 text-xs font-medium text-blue-700 hover:text-blue-800 sm:hidden", children: expanded ? 'Read less' : 'Read more' })] })] }));
|
|
90887
90873
|
};
|
|
90888
90874
|
const Admin = ({ tenant, onInviteClick, hasUserTabPermission = false, hasGroupsTabPermission = false, hasRolesTabPermission = false, hasPoliciesTabPermission = false, hasTeamsTabPermission = false, hasAlertsTabPermission = false, hasInviteUserPermission = false, hasCreateTeamPermission = false, onLoadGroupPermissions, rbacPermissions = {}, enableRbac = false, }) => {
|
|
90889
|
-
return (jsx("div", { className: "border border-gray-200 rounded-lg p-6", children: jsxs(Tabs, { defaultValue: "users", "aria-label": "RBAC Management Tabs", children: [jsxs(TabsList, { "aria-label": "Management tabs", className: "max-w-full overflow-x-auto justify-start px-1", children: [hasUserTabPermission && jsx(TabsTrigger, { value: "users", children: "Users" }), hasGroupsTabPermission && jsx(TabsTrigger, { value: "groups", children: "Groups" }), hasRolesTabPermission && jsx(TabsTrigger, { value: "roles", children: "Roles" }), hasPoliciesTabPermission && jsx(TabsTrigger, { value: "policies", children: "Policies" }), hasTeamsTabPermission && jsx(TabsTrigger, { value: "teams", children: "Teams" }), hasAlertsTabPermission && jsx(TabsTrigger, { value: "alerts", children: "Alerts" })] }), hasUserTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "users", children: [jsx(TabDescription, { icon: jsx(Users, { className: "w-5 h-5" }), title: "Users", children: "Manage platform-wide users and their predefined roles. Admins have the highest level of permissions; Users can optionally be granted limited policies." }), jsx(UsersTab, { tenant: tenant, onInviteClick: onInviteClick })] })), hasGroupsTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "groups", children: [jsx(TabDescription, { icon: jsx(UsersRound, { className: "w-5 h-5" }), title: "Groups", children: "RBAC groups bundle users so a single policy assignment grants permissions to all of them. The same group can be reused across policies." }), jsx(GroupsTab, { tenant: tenant })] })), hasRolesTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "roles", children: [jsx(TabDescription, { icon: jsx(UserCog, { className: "w-5 h-5" }), title: "Roles", children: "An RBAC role is a named bundle of permissions (actions applied to resources in policies)." }), jsx(RolesTab, { tenant: tenant })] })), hasPoliciesTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "policies", children: [jsxs(TabDescription, { icon: jsx(ScrollText, { className: "w-5 h-5" }), title: "Policies", children: ["An RBAC policy grants a role's permissions to a set of users or groups on a set of resources. Resources are hierarchical: granting on /platforms/", '{pk}', "/mentors/ covers every
|
|
90875
|
+
return (jsx("div", { className: "border border-gray-200 rounded-lg p-6", children: jsxs(Tabs, { defaultValue: "users", "aria-label": "RBAC Management Tabs", children: [jsxs(TabsList, { "aria-label": "Management tabs", className: "max-w-full overflow-x-auto justify-start px-1", children: [hasUserTabPermission && jsx(TabsTrigger, { value: "users", children: "Users" }), hasGroupsTabPermission && jsx(TabsTrigger, { value: "groups", children: "Groups" }), hasRolesTabPermission && jsx(TabsTrigger, { value: "roles", children: "Roles" }), hasPoliciesTabPermission && jsx(TabsTrigger, { value: "policies", children: "Policies" }), hasTeamsTabPermission && jsx(TabsTrigger, { value: "teams", children: "Teams" }), hasAlertsTabPermission && jsx(TabsTrigger, { value: "alerts", children: "Alerts" })] }), hasUserTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "users", children: [jsx(TabDescription, { icon: jsx(Users, { className: "w-5 h-5" }), title: "Users", children: "Manage platform-wide users and their predefined roles. Admins have the highest level of permissions; Users can optionally be granted limited policies." }), jsx(UsersTab, { tenant: tenant, onInviteClick: onInviteClick })] })), hasGroupsTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "groups", children: [jsx(TabDescription, { icon: jsx(UsersRound, { className: "w-5 h-5" }), title: "Groups", children: "RBAC groups bundle users so a single policy assignment grants permissions to all of them. The same group can be reused across policies." }), jsx(GroupsTab, { tenant: tenant })] })), hasRolesTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "roles", children: [jsx(TabDescription, { icon: jsx(UserCog, { className: "w-5 h-5" }), title: "Roles", children: "An RBAC role is a named bundle of permissions (actions applied to resources in policies)." }), jsx(RolesTab, { tenant: tenant })] })), hasPoliciesTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "policies", children: [jsxs(TabDescription, { icon: jsx(ScrollText, { className: "w-5 h-5" }), title: "Policies", children: ["An RBAC policy grants a role's permissions to a set of users or groups on a set of resources. Resources are hierarchical: granting on /platforms/", '{pk}', "/mentors/ covers every agent, while /platforms/", '{pk}', "/mentors/", '{pk}', "/ scopes to one."] }), jsx(PoliciesTab, { tenant: tenant })] })), hasTeamsTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "teams", children: [jsx(TabDescription, { icon: jsx(Shield, { className: "w-5 h-5" }), title: "Teams", children: "A team is a curated set of users that you can share with others \u2014 e.g., grant another user permission to view the team's analytics or send notifications to them." }), jsx(GroupsTab, { tenant: tenant, isTeam: true, onInviteClick: onInviteClick, hasInviteUserPermission: hasInviteUserPermission, hasCreateTeamPermission: hasCreateTeamPermission, onLoadGroupPermissions: onLoadGroupPermissions, rbacPermissions: rbacPermissions, enableRbac: enableRbac })] })), hasAlertsTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "alerts", children: [jsx(TabDescription, { icon: jsx(BellRing, { className: "w-5 h-5" }), title: "Alerts", children: "An alert pairs a team of watched users with one or more watchers who get notified when monitored events occur for a watched user. Each watcher subscribes to its own subset of events." }), jsx(AlertsTab$1, { tenant: tenant })] }))] }) }));
|
|
90890
90876
|
};
|
|
90891
90877
|
|
|
90892
90878
|
function DeleteApiModal({ isOpen, onClose, apiKey, tenantKey }) {
|
|
@@ -94672,12 +94658,12 @@ function CalendarDayButton({ className, day, modifiers, ...props }) {
|
|
|
94672
94658
|
!modifiers.range_middle, "data-range-start": modifiers.range_start, "data-range-end": modifiers.range_end, "data-range-middle": modifiers.range_middle, className: cn('data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70', defaultClassNames.day, className), ...props }));
|
|
94673
94659
|
}
|
|
94674
94660
|
|
|
94675
|
-
const createApiFormSchema = z
|
|
94676
|
-
name: z
|
|
94661
|
+
const createApiFormSchema = z.object({
|
|
94662
|
+
name: z
|
|
94677
94663
|
.string()
|
|
94678
94664
|
.min(1, 'API Key name is required')
|
|
94679
94665
|
.regex(/^[a-zA-Z0-9_-]+$/, 'can only contain letters, numbers, and hyphens'),
|
|
94680
|
-
expiration_date: z
|
|
94666
|
+
expiration_date: z.date().nullable(),
|
|
94681
94667
|
});
|
|
94682
94668
|
const createApiFormDefaultValues = {
|
|
94683
94669
|
name: '',
|
|
@@ -94749,14 +94735,14 @@ function CreateApiModal({ isOpen, onClose, tenantKey, username }) {
|
|
|
94749
94735
|
// Dynamic schema based on selected provider
|
|
94750
94736
|
const createDynamicSchema$1 = (schemaFields) => {
|
|
94751
94737
|
const schemaObj = {
|
|
94752
|
-
provider: z
|
|
94738
|
+
provider: z.string().min(1, 'Provider is required'),
|
|
94753
94739
|
};
|
|
94754
94740
|
schemaFields.forEach((field) => {
|
|
94755
|
-
schemaObj[field] = z
|
|
94741
|
+
schemaObj[field] = z
|
|
94756
94742
|
.string()
|
|
94757
94743
|
.min(1, `${field.replace(/_/g, ' ').replace(/\b\w/g, (l) => l.toUpperCase())} is required`);
|
|
94758
94744
|
});
|
|
94759
|
-
return z
|
|
94745
|
+
return z.object(schemaObj);
|
|
94760
94746
|
};
|
|
94761
94747
|
const createExternalProviderFormDefaultValues = {
|
|
94762
94748
|
provider: '',
|
|
@@ -95074,14 +95060,14 @@ function IntegrationLLMsTab({ tenantKey }) {
|
|
|
95074
95060
|
// Dynamic schema based on selected provider
|
|
95075
95061
|
const createDynamicSchema = (schemaFields) => {
|
|
95076
95062
|
const schemaObj = {
|
|
95077
|
-
provider: z
|
|
95063
|
+
provider: z.string().min(1, 'Provider is required'),
|
|
95078
95064
|
};
|
|
95079
95065
|
schemaFields.forEach((field) => {
|
|
95080
|
-
schemaObj[field.name] = z
|
|
95066
|
+
schemaObj[field.name] = z
|
|
95081
95067
|
.string()
|
|
95082
95068
|
.min(1, `${field.name.replace(/_/g, ' ').replace(/\b\w/g, (l) => l.toUpperCase())} is required`);
|
|
95083
95069
|
});
|
|
95084
|
-
return z
|
|
95070
|
+
return z.object(schemaObj);
|
|
95085
95071
|
};
|
|
95086
95072
|
const createDataSourceFormDefaultValues = {
|
|
95087
95073
|
provider: '',
|
|
@@ -95980,17 +95966,17 @@ const StudentMentorCreationContent = ({ platformKey, }) => {
|
|
|
95980
95966
|
dispatch(coreApiSlice.util.updateQueryData('getStudentMentorCreationStatus', { platformKey }, (draft) => {
|
|
95981
95967
|
draft.allow_students_to_create_mentors = checked;
|
|
95982
95968
|
}));
|
|
95983
|
-
toast.success('User
|
|
95969
|
+
toast.success('User agent creation setting updated successfully');
|
|
95984
95970
|
}
|
|
95985
95971
|
catch (error) {
|
|
95986
95972
|
console.error(JSON.stringify(error));
|
|
95987
|
-
toast.error('Failed to update user
|
|
95973
|
+
toast.error('Failed to update user agent creation setting');
|
|
95988
95974
|
}
|
|
95989
95975
|
};
|
|
95990
95976
|
if (isLoadingStudentMentorCreationStatus) {
|
|
95991
95977
|
return (jsx("div", { className: "rounded-lg border px-6 py-6", style: { borderColor: 'oklch(.922 0 0)' }, children: jsx("div", { className: "animate-pulse", children: jsxs("div", { className: "flex items-center justify-between", children: [jsx("div", { className: "h-4 bg-gray-200 rounded w-1/3" }), jsx("div", { className: "h-6 w-11 bg-gray-200 rounded" })] }) }) }));
|
|
95992
95978
|
}
|
|
95993
|
-
return (jsxs("div", { className: "flex items-center justify-between rounded-lg border px-6 py-6", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: "User
|
|
95979
|
+
return (jsxs("div", { className: "flex items-center justify-between rounded-lg border px-6 py-6", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: "User Agent Creation" }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { "aria-label": "More info about public registration", className: "hidden sm:block", children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "rounded-lg bg-gray-700 px-3 py-2 text-sm font-medium whitespace-nowrap text-white shadow-sm transition-opacity duration-300 z-50", children: jsx("p", { children: "Allow users to create agents in the agent platform" }) })] }) })] }), jsxs("div", { className: "flex items-center gap-2", children: [jsx(Switch, { checked: studentMentorCreationStatus === null || studentMentorCreationStatus === void 0 ? void 0 : studentMentorCreationStatus.allow_students_to_create_mentors, onCheckedChange: handleToggleStudentMentorCreation, disabled: isUpdatingStudentMentorCreationStatus, "aria-label": `User agent creation ${(studentMentorCreationStatus === null || studentMentorCreationStatus === void 0 ? void 0 : studentMentorCreationStatus.allow_students_to_create_mentors) ? 'enabled' : 'disabled'}`, className: "cursor-pointer data-[state=checked]:bg-blue-500" }), isUpdatingStudentMentorCreationStatus && (jsx("div", { className: "w-4 h-4 border-2 border-blue-500 border-t-transparent rounded-full animate-spin" }))] })] }));
|
|
95994
95980
|
};
|
|
95995
95981
|
|
|
95996
95982
|
const RecommendationSystemPromptsContent = ({ platformKey, currentSPA, }) => {
|
|
@@ -96136,11 +96122,11 @@ const RecommendationSystemPromptsContent = ({ platformKey, currentSPA, }) => {
|
|
|
96136
96122
|
.sort((a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime())
|
|
96137
96123
|
.map((prompt, index) => (jsx("div", { className: `py-4 ${index !== promptsList.length - 1 ? 'border-b border-gray-200' : ''}`, children: jsxs("div", { className: "flex items-start justify-between gap-4", children: [jsxs("div", { className: "flex-1 min-w-0", children: [jsxs("div", { className: "flex items-center gap-2 mb-2", children: [jsxs("h4", { className: "text-sm font-medium text-[#646464]", children: [prompt.recommendation_type === recommendationPromptTypeEnum.catalog
|
|
96138
96124
|
? 'Catalog'
|
|
96139
|
-
: '
|
|
96125
|
+
: 'Agent', ' ', "Prompt"] }), prompt.id === null ? (jsx("span", { className: "px-2 py-0.5 text-xs rounded bg-gray-100 text-gray-600", children: "Default" })) : (jsx("span", { className: `px-2 py-0.5 text-xs rounded ${prompt.active
|
|
96140
96126
|
? 'bg-blue-100 text-blue-800'
|
|
96141
96127
|
: 'bg-gray-100 text-gray-600'}`, children: prompt.active ? 'Active' : 'Inactive' }))] }), jsx("p", { className: "text-sm text-gray-700 line-clamp-2", children: prompt.prompt_text })] }), jsxs("div", { className: "flex items-center gap-2 flex-shrink-0", children: [jsx(Button$1, { variant: "ghost", size: "sm", onClick: () => handleOpenDialog(prompt), disabled: prompt.id && deletingPromptId === prompt.id, "aria-label": prompt.id === null ? 'Create custom prompt from default' : 'Edit prompt', children: jsx(Pen, { className: "h-4 w-4", "aria-hidden": "true" }) }), prompt.id !== null && (jsx(Button$1, { variant: "ghost", size: "sm", onClick: () => handleDelete(prompt.id), className: "text-red-600 hover:text-red-700", disabled: deletingPromptId === prompt.id, "aria-label": "Delete prompt", children: deletingPromptId === prompt.id ? (jsx(LoaderCircle, { className: "h-4 w-4 animate-spin", "aria-hidden": "true" })) : (jsx(Trash2, { className: "h-4 w-4", "aria-hidden": "true" })) }))] })] }) }, prompt.id === null ? 'default-prompt' : prompt.id))) })) })), jsx(Dialog, { open: isDialogOpen, onOpenChange: setIsDialogOpen, children: jsxs(DialogContent, { className: "sm:max-w-[600px]", children: [jsxs(DialogHeader, { children: [jsx(DialogTitle, { children: editingPrompt ? 'Edit Prompt' : 'Add New Prompt' }), jsx(DialogDescription, { children: editingPrompt
|
|
96142
96128
|
? 'Update the recommendation system prompt details.'
|
|
96143
|
-
: `Create a new ${recommendationType === recommendationPromptTypeEnum.catalog ? 'catalog' : '
|
|
96129
|
+
: `Create a new ${recommendationType === recommendationPromptTypeEnum.catalog ? 'catalog' : 'agents'} recommendation prompt.` })] }), jsx("div", { className: "space-y-4", children: jsxs("div", { children: [jsx("label", { className: "text-sm font-medium text-gray-700 mb-1 block", children: "Prompt Text *" }), jsx(Textarea, { value: formData.prompt_text, onChange: (e) => handleInputChange('prompt_text', e.target.value), placeholder: "Enter the prompt text that will guide users to relevant recommendations", className: "w-full min-h-[120px]", rows: 8 })] }) }), jsxs("div", { className: "flex justify-end gap-2 mt-4", children: [jsx(Button$1, { type: "button", variant: "outline", onClick: handleCloseDialog, disabled: isSubmitting, children: "Cancel" }), jsxs(Button$1, { className: "bg-gradient-to-r from-blue-500 to-blue-600 text-white hover:opacity-90", type: "button", onClick: handleSubmit, disabled: isSubmitting || !formData.prompt_text.trim(), children: [isSubmitting && jsx(LoaderCircle, { className: "h-4 w-4 animate-spin mr-2" }), editingPrompt ? 'Update' : 'Save'] })] })] }) })] }));
|
|
96144
96130
|
};
|
|
96145
96131
|
|
|
96146
96132
|
const getMetadataKey = (spa) => {
|
|
@@ -97419,7 +97405,7 @@ function AdvancedTab({ platformKey, username, currentSPA, authURL, currentPlatfo
|
|
|
97419
97405
|
};
|
|
97420
97406
|
// Set mentor to null and disable sidebar display
|
|
97421
97407
|
await updateMultipleOrganizationMetadata(updatedMetadata, () => {
|
|
97422
|
-
toast.success('
|
|
97408
|
+
toast.success('Agent setting updated successfully');
|
|
97423
97409
|
});
|
|
97424
97410
|
return;
|
|
97425
97411
|
}
|
|
@@ -97437,7 +97423,7 @@ function AdvancedTab({ platformKey, username, currentSPA, authURL, currentPlatfo
|
|
|
97437
97423
|
enable_sidebar_ai_mentor_display: true,
|
|
97438
97424
|
};
|
|
97439
97425
|
await updateMultipleOrganizationMetadata(updatedMetadata, () => {
|
|
97440
|
-
toast.success('
|
|
97426
|
+
toast.success('Agent setting updated successfully');
|
|
97441
97427
|
});
|
|
97442
97428
|
};
|
|
97443
97429
|
const handleMentorSearch = (query) => {
|
|
@@ -97491,7 +97477,7 @@ function AdvancedTab({ platformKey, username, currentSPA, authURL, currentPlatfo
|
|
|
97491
97477
|
: ((_a = metadataItem.value) !== null && _a !== void 0 ? _a : metadataItem.defaultValue);
|
|
97492
97478
|
const isMentorSetting = metadataItem.slug === 'overall_default_mentor';
|
|
97493
97479
|
const isStringSetting = typeof metadataItem.defaultValue === 'string' && !isMentorSetting;
|
|
97494
|
-
return (jsxs("div", { className: `flex items-center justify-between rounded-lg border px-6 ${isMentorSetting || isStringSetting ? 'py-4' : 'py-6'}`, style: { borderColor: 'oklch(.922 0 0)' }, children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: metadataItem.label }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { "aria-label": `More info about ${metadataItem.label}`, className: "hidden sm:block", children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "rounded-lg bg-gray-700 px-3 py-2 text-sm font-medium whitespace-nowrap text-white shadow-sm transition-opacity duration-300 z-50", children: jsx("p", { children: metadataItem.description || 'No description available' }) })] }) })] }), jsx("div", { className: "flex items-center gap-2", children: isMentorSetting ? (jsxs("div", { className: "flex items-center gap-2", children: [jsxs(Select$1, { value: currentValue || '', onValueChange: (value) => handleMentorSelection(metadataItem.slug, value), disabled: isUpdatingTenantMetadata, children: [jsx(SelectTrigger, { className: "max-w-[240px] w-[110px] sm:w-[230px] font-medium text-[#646464]", children: jsx(SelectValue, { placeholder: "Select
|
|
97480
|
+
return (jsxs("div", { className: `flex items-center justify-between rounded-lg border px-6 ${isMentorSetting || isStringSetting ? 'py-4' : 'py-6'}`, style: { borderColor: 'oklch(.922 0 0)' }, children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: metadataItem.label }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { "aria-label": `More info about ${metadataItem.label}`, className: "hidden sm:block", children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "rounded-lg bg-gray-700 px-3 py-2 text-sm font-medium whitespace-nowrap text-white shadow-sm transition-opacity duration-300 z-50", children: jsx("p", { children: metadataItem.description || 'No description available' }) })] }) })] }), jsx("div", { className: "flex items-center gap-2", children: isMentorSetting ? (jsxs("div", { className: "flex items-center gap-2", children: [jsxs(Select$1, { value: currentValue || '', onValueChange: (value) => handleMentorSelection(metadataItem.slug, value), disabled: isUpdatingTenantMetadata, children: [jsx(SelectTrigger, { className: "max-w-[240px] w-[110px] sm:w-[230px] font-medium text-[#646464]", children: jsx(SelectValue, { placeholder: "Select agent", children: currentValue ? getMentorName(currentValue) : '' }) }), jsxs(SelectContent, { className: "font-medium text-[#646464]", children: [jsx("div", { className: "p-2", children: jsx(Input, { placeholder: "Search agents...", value: mentorSearchQuery, onChange: (e) => handleMentorSearch(e.target.value), className: "mb-2 font-medium text-[#646464]" }) }), jsx(SelectItem, { value: "none", children: "None" }), isMentorsLoading ? (jsx(SelectItem, { "aria-label": "Loading agents...", value: "loading", disabled: true, children: "Loading agents..." })) : ((_b = mentorsData === null || mentorsData === void 0 ? void 0 : mentorsData.results) === null || _b === void 0 ? void 0 : _b.length) ? (mentorsData.results.map((mentor) => (jsx(SelectItem, { value: mentor.unique_id, children: mentor.name }, mentor.unique_id)))) : (jsx(SelectItem, { value: "no-results", disabled: true, children: "No agents found" }))] })] }), isUpdatingTenantMetadata && (jsx("div", { "aria-label": "Updating agent selection...", role: "status", className: "w-4 h-4 border-2 border-blue-500 border-t-transparent rounded-full animate-spin" }))] })) : isStringSetting ? (jsx(StringSettingInput, { value: currentValue, defaultValue: metadataItem.defaultValue, disabled: isUpdatingTenantMetadata, onSave: (value) => handleStringSettingUpdate(metadataItem.slug, value) })) : (jsxs(Fragment$1, { children: [jsx(Switch, { checked: currentValue, onCheckedChange: async () => {
|
|
97495
97481
|
await handleToggleSetting(metadataItem.slug, currentValue);
|
|
97496
97482
|
}, disabled: isUpdatingTenantMetadata, "aria-label": `${metadataItem.label} ${currentValue ? 'enabled' : 'disabled'}`, className: "cursor-pointer data-[state=checked]:bg-blue-500" }), isUpdatingTenantMetadata && (jsx("div", { className: "w-4 h-4 border-2 border-blue-500 border-t-transparent rounded-full animate-spin" }))] })) })] }, metadataItem.slug));
|
|
97497
97483
|
}) })) : (
|
|
@@ -97510,7 +97496,7 @@ function AdvancedTab({ platformKey, username, currentSPA, authURL, currentPlatfo
|
|
|
97510
97496
|
const currentValue = (_a = metadataItem.value) !== null && _a !== void 0 ? _a : metadataItem.defaultValue;
|
|
97511
97497
|
const isMentorSetting = metadataItem.slug === 'overall_default_mentor';
|
|
97512
97498
|
const isStringSetting = typeof metadataItem.defaultValue === 'string' && !isMentorSetting;
|
|
97513
|
-
return (jsxs("div", { className: `flex items-center justify-between rounded-lg border px-6 ${isMentorSetting || isStringSetting ? 'py-4' : 'py-6'}`, style: { borderColor: 'oklch(.922 0 0)' }, children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: metadataItem.label }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { "aria-label": `More info about ${metadataItem.label}`, className: "hidden sm:block", children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "ibl-tooltip-content", children: jsx("p", { children: metadataItem.description || 'No description available' }) })] }) })] }), jsx("div", { className: "flex items-center gap-2", children: isMentorSetting ? (jsxs("div", { className: "flex items-center gap-2", children: [jsxs(Select$1, { value: currentValue || '', onValueChange: (value) => handleMentorSelection(metadataItem.slug, value), disabled: isUpdatingTenantMetadata, children: [jsx(SelectTrigger, { className: "max-w-[240px] w-[230px] sm:w-[150px] font-medium text-[#646464]", children: jsx(SelectValue, { placeholder: "Select
|
|
97499
|
+
return (jsxs("div", { className: `flex items-center justify-between rounded-lg border px-6 ${isMentorSetting || isStringSetting ? 'py-4' : 'py-6'}`, style: { borderColor: 'oklch(.922 0 0)' }, children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: metadataItem.label }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { "aria-label": `More info about ${metadataItem.label}`, className: "hidden sm:block", children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "ibl-tooltip-content", children: jsx("p", { children: metadataItem.description || 'No description available' }) })] }) })] }), jsx("div", { className: "flex items-center gap-2", children: isMentorSetting ? (jsxs("div", { className: "flex items-center gap-2", children: [jsxs(Select$1, { value: currentValue || '', onValueChange: (value) => handleMentorSelection(metadataItem.slug, value), disabled: isUpdatingTenantMetadata, children: [jsx(SelectTrigger, { className: "max-w-[240px] w-[230px] sm:w-[150px] font-medium text-[#646464]", children: jsx(SelectValue, { placeholder: "Select agent", children: currentValue ? getMentorName(currentValue) : '' }) }), jsxs(SelectContent, { className: "font-medium text-[#646464]", children: [jsx("div", { className: "p-2", children: jsx(Input, { placeholder: "Search agents...", value: mentorSearchQuery, onChange: (e) => handleMentorSearch(e.target.value), className: "mb-2 font-medium text-[#646464]" }) }), jsx(SelectItem, { value: "none", children: "None" }), isMentorsLoading ? (jsx(SelectItem, { value: "loading", disabled: true, children: "Loading agents..." })) : ((_b = mentorsData === null || mentorsData === void 0 ? void 0 : mentorsData.results) === null || _b === void 0 ? void 0 : _b.length) ? (mentorsData.results.map((mentor) => (jsx(SelectItem, { value: mentor.unique_id, children: mentor.name }, mentor.unique_id)))) : (jsx(SelectItem, { value: "no-results", disabled: true, children: "No agents found" }))] })] }), isUpdatingTenantMetadata && (jsx("div", { className: "w-4 h-4 border-2 border-blue-500 border-t-transparent rounded-full animate-spin" }))] })) : isStringSetting ? (jsx(StringSettingInput, { value: currentValue, defaultValue: metadataItem.defaultValue, disabled: isUpdatingTenantMetadata, onSave: (value) => handleStringSettingUpdate(metadataItem.slug, value) })) : (jsxs(Fragment$1, { children: [jsx(Switch, { checked: currentValue, onCheckedChange: async () => {
|
|
97514
97500
|
await handleToggleSetting(metadataItem.slug, currentValue);
|
|
97515
97501
|
}, disabled: isUpdatingTenantMetadata, "aria-label": `${metadataItem.label} ${currentValue ? 'enabled' : 'disabled'}`, className: "cursor-pointer data-[state=checked]:bg-blue-500" }), isUpdatingTenantMetadata && (jsx("div", { className: "w-4 h-4 border-2 border-blue-500 border-t-transparent rounded-full animate-spin" }))] })) })] }, metadataItem.slug));
|
|
97516
97502
|
}) })] }, spa)));
|
|
@@ -128479,7 +128465,7 @@ function MentorPromptDialog({ open, onOpenChange, mentor, initialPrompt, onSave,
|
|
|
128479
128465
|
}
|
|
128480
128466
|
onOpenChange(nextOpen);
|
|
128481
128467
|
};
|
|
128482
|
-
return (jsx(Dialog, { open: open, onOpenChange: handleOpenChange, children: jsxs(DialogContent, { className: "sm:max-w-md", children: [jsxs(DialogHeader, { children: [jsx(DialogTitle, { children: "Edit
|
|
128468
|
+
return (jsx(Dialog, { open: open, onOpenChange: handleOpenChange, children: jsxs(DialogContent, { className: "sm:max-w-md", children: [jsxs(DialogHeader, { children: [jsx(DialogTitle, { children: "Edit Agent Prompt" }), jsx(DialogDescription, { children: "Provide an optional prompt that will be associated with this agent for proactive outreach." })] }), jsxs("div", { className: "space-y-3", children: [jsxs("div", { children: [jsx(Label$2, { htmlFor: "mentor-prompt-mentor-name", className: "text-sm font-medium text-gray-700", children: "Agent" }), jsx(Input, { id: "mentor-prompt-mentor-name", value: (_a = mentor === null || mentor === void 0 ? void 0 : mentor.name) !== null && _a !== void 0 ? _a : '', disabled: true, className: "bg-gray-50" })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$2, { htmlFor: "mentor-prompt", className: "text-sm font-medium text-gray-700", children: "Prompt" }), jsx(Textarea, { id: "mentor-prompt", value: promptDraft, onChange: (event) => setPromptDraft(event.target.value), placeholder: "Enter an agent prompt...", rows: 5 }), jsx("p", { className: "text-xs text-gray-500", children: "This prompt is saved with the agent" })] })] }), jsxs(DialogFooter, { className: "pt-2", children: [jsx(Button$1, { variant: "outline", onClick: () => onOpenChange(false), children: "Cancel" }), jsx(Button$1, { className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white", onClick: handleSave, disabled: !mentor, children: "Save Prompt" })] })] }) }));
|
|
128483
128469
|
}
|
|
128484
128470
|
|
|
128485
128471
|
function PolicyConfigDialog({ open, onOpenChange, config, onSave, }) {
|
|
@@ -128626,10 +128612,10 @@ function ProactiveSettingsSection({ platformKey, username, isSaving, userLocalTi
|
|
|
128626
128612
|
const isExecutionTimeMissing = periodicFrequency === 'CUSTOM' && !periodicExecutionTime.trim();
|
|
128627
128613
|
const isProactiveInvalid = isCustomIntervalMissing || isExecutionTimeMissing;
|
|
128628
128614
|
const renderTimezoneNotice = (intro) => (jsxs("div", { className: "flex flex-col gap-1 text-xs text-gray-500 sm:flex-row sm:items-center sm:justify-between", children: [jsxs("span", { children: [intro, " Notifications use the ", periodicTimezone, " timezone."] }), showUseLocalTimezone && (jsxs(Button$1, { type: "button", variant: "link", size: "sm", className: "px-0", onClick: handleUseLocalTimezone, children: ["Use local timezone (", userLocalTimezone, ")"] }))] }));
|
|
128629
|
-
return (jsxs(Fragment$1, { children: [jsxs("div", { className: "space-y-4 border-t border-gray-200 pt-4", children: [jsxs("div", { className: "space-y-1", children: [jsx("h3", { className: "text-sm font-semibold text-gray-900", children: "Periodic Delivery Settings" }), jsx("p", { className: "text-xs text-gray-500", children: "Configure
|
|
128615
|
+
return (jsxs(Fragment$1, { children: [jsxs("div", { className: "space-y-4 border-t border-gray-200 pt-4", children: [jsxs("div", { className: "space-y-1", children: [jsx("h3", { className: "text-sm font-semibold text-gray-900", children: "Periodic Delivery Settings" }), jsx("p", { className: "text-xs text-gray-500", children: "Configure agent outreach cadence for proactive learner notifications." })] }), jsxs("div", { className: "grid gap-4 md:grid-cols-2", children: [jsxs("div", { className: "space-y-2", children: [jsx(Label$2, { htmlFor: "periodic-learner-scope", className: "text-sm font-medium text-gray-700", children: "Learner Scope" }), jsxs(Select$1, { value: periodicLearnerScope, onValueChange: (value) => onLearnerScopeChange(value), disabled: isSaving, children: [jsx(SelectTrigger, { id: "periodic-learner-scope", "aria-label": "Select learner scope", children: jsx(SelectValue, { placeholder: "Select learner scope" }) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "ALL_LEARNERS", children: "All Learners" }), jsx(SelectItem, { value: "ACTIVE_LEARNERS", children: "Active Learners" })] })] })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$2, { htmlFor: "periodic-frequency", className: "text-sm font-medium text-gray-700", children: "Frequency" }), jsxs(Select$1, { value: periodicFrequency, onValueChange: (value) => onFrequencyChange(value), disabled: isSaving, children: [jsx(SelectTrigger, { id: "periodic-frequency", "aria-label": "Select frequency", children: jsx(SelectValue, { placeholder: "Select frequency" }) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "DAILY", children: "Daily" }), jsx(SelectItem, { value: "WEEKLY", children: "Weekly" }), jsx(SelectItem, { value: "MONTHLY", children: "Monthly" }), jsx(SelectItem, { value: "CUSTOM", children: "Custom" })] })] })] })] }), periodicFrequency === 'CUSTOM' && (jsxs("div", { className: "grid gap-4 md:grid-cols-2", children: [jsxs("div", { className: "space-y-2", children: [jsx(Label$2, { htmlFor: "periodic-custom-interval", className: "text-sm font-medium text-gray-700", children: "Custom Interval (days)" }), jsxs(Select$1, { value: periodicCustomIntervalDays, onValueChange: onCustomIntervalChange, disabled: isSaving, children: [jsx(SelectTrigger, { id: "periodic-custom-interval", "aria-label": "Select custom interval in days", "aria-invalid": isCustomIntervalMissing, "aria-describedby": isCustomIntervalMissing ? customIntervalErrorId : undefined, children: jsx(SelectValue, { placeholder: "Select days" }) }), jsx(SelectContent, { children: Array.from({ length: 30 }, (_, index) => {
|
|
128630
128616
|
const value = String(index + 1);
|
|
128631
128617
|
return (jsx(SelectItem, { value: value, children: value }, value));
|
|
128632
|
-
}) })] })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$2, { htmlFor: "periodic-execution-time", className: "text-sm font-medium text-gray-700", children: "Execution Time" }), jsx(Input, { id: "periodic-execution-time", type: "time", value: periodicExecutionTime, onChange: (event) => onExecutionTimeChange(event.target.value), disabled: isSaving, "aria-invalid": isExecutionTimeMissing, "aria-describedby": isExecutionTimeMissing ? executionTimeErrorId : undefined }), renderTimezoneNotice('Choose when the notification should be sent.')] })] })), periodicFrequency !== 'CUSTOM' && (jsxs("div", { className: "space-y-2", children: [jsx(Label$2, { htmlFor: "periodic-execution-time", className: "text-sm font-medium text-gray-700", children: "Execution Time" }), jsx(Input, { id: "periodic-execution-time", type: "time", value: periodicExecutionTime, onChange: (event) => onExecutionTimeChange(event.target.value), disabled: isSaving }), renderTimezoneNotice('Optional. Choose when the notification should be sent.')] })), isProactiveInvalid && (jsxs("div", { className: "space-y-1", "aria-live": "polite", children: [isCustomIntervalMissing && (jsx("p", { id: customIntervalErrorId, className: "text-sm text-red-600", role: "alert", children: "Select a custom interval in days when using the custom frequency." })), isExecutionTimeMissing && (jsx("p", { id: executionTimeErrorId, className: "text-sm text-red-600", role: "alert", children: "Specify the execution time for custom frequency notifications." }))] })), jsxs("div", { className: "space-y-2", children: [jsx(Label$2, { className: "text-sm font-medium text-gray-700", htmlFor: "periodic-mentors", children: "Periodic
|
|
128618
|
+
}) })] })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$2, { htmlFor: "periodic-execution-time", className: "text-sm font-medium text-gray-700", children: "Execution Time" }), jsx(Input, { id: "periodic-execution-time", type: "time", value: periodicExecutionTime, onChange: (event) => onExecutionTimeChange(event.target.value), disabled: isSaving, "aria-invalid": isExecutionTimeMissing, "aria-describedby": isExecutionTimeMissing ? executionTimeErrorId : undefined }), renderTimezoneNotice('Choose when the notification should be sent.')] })] })), periodicFrequency !== 'CUSTOM' && (jsxs("div", { className: "space-y-2", children: [jsx(Label$2, { htmlFor: "periodic-execution-time", className: "text-sm font-medium text-gray-700", children: "Execution Time" }), jsx(Input, { id: "periodic-execution-time", type: "time", value: periodicExecutionTime, onChange: (event) => onExecutionTimeChange(event.target.value), disabled: isSaving }), renderTimezoneNotice('Optional. Choose when the notification should be sent.')] })), isProactiveInvalid && (jsxs("div", { className: "space-y-1", "aria-live": "polite", children: [isCustomIntervalMissing && (jsx("p", { id: customIntervalErrorId, className: "text-sm text-red-600", role: "alert", children: "Select a custom interval in days when using the custom frequency." })), isExecutionTimeMissing && (jsx("p", { id: executionTimeErrorId, className: "text-sm text-red-600", role: "alert", children: "Specify the execution time for custom frequency notifications." }))] })), jsxs("div", { className: "space-y-2", children: [jsx(Label$2, { className: "text-sm font-medium text-gray-700", htmlFor: "periodic-mentors", children: "Periodic Agents" }), jsx(SearchableMultiSelect, { items: mentorOptions, selectedItems: selectedMentors, onSelectionChange: handleMentorSelectionChange, searchQuery: mentorSearch, onSearchChange: setMentorSearch, isLoading: isMentorsLoading, placeholder: "Search agents by name...", getItemValue: (mentor) => mentor.unique_id, getItemLabel: (mentor) => mentor.name ? `${mentor.name} (${mentor.unique_id})` : mentor.unique_id, onSelectedItemAction: handleEditMentorPrompt, selectedItemActionIcon: jsx(SquarePen, { className: "h-3 w-3", "aria-hidden": "true" }), selectedItemActionAriaLabel: "Edit agent prompt", inputId: "periodic-mentors", ariaDescribedBy: "periodic-mentors-help", className: "max-w-full" }), jsx("p", { id: "periodic-mentors-help", className: "text-xs text-gray-500", children: "Optional. Select agents to include in the proactive outreach rotation." })] })] }), jsx(MentorPromptDialog, { open: isPromptDialogOpen, onOpenChange: setIsPromptDialogOpen, mentor: activePromptMentor, initialPrompt: activePromptMentor ? ((_b = mentorPrompts[activePromptMentor.id]) !== null && _b !== void 0 ? _b : '') : '', onSave: handlePromptSave })] }));
|
|
128633
128619
|
}
|
|
128634
128620
|
|
|
128635
128621
|
function useDebouncedValue$1(value, delay) {
|
|
@@ -128767,9 +128753,9 @@ function useDebouncedValue(value, delay) {
|
|
|
128767
128753
|
return debouncedValue;
|
|
128768
128754
|
}
|
|
128769
128755
|
const RECIPIENT_MODE_OPTIONS = [
|
|
128770
|
-
{ value: 'platform_admins_and_mentor_owner', label: 'Platform Admins &
|
|
128756
|
+
{ value: 'platform_admins_and_mentor_owner', label: 'Platform Admins & Agent Owner' },
|
|
128771
128757
|
{ value: 'platform_admins_only', label: 'Platform Admins Only' },
|
|
128772
|
-
{ value: 'mentor_owner_only', label: '
|
|
128758
|
+
{ value: 'mentor_owner_only', label: 'Agent Owner Only' },
|
|
128773
128759
|
{ value: 'custom', label: 'Custom' },
|
|
128774
128760
|
];
|
|
128775
128761
|
const formatUserSelections = (recipients, userList) => {
|
|
@@ -192321,7 +192307,7 @@ function AnalyticsTranscriptsStats({ tenantKey, mentorId, selectedMentorId, user
|
|
|
192321
192307
|
/* Error or no data state */
|
|
192322
192308
|
jsx("div", { className: "flex items-center justify-center h-full text-gray-400", children: jsxs("div", { className: "text-center", children: [jsx(X$1, { className: "h-6 w-6 mx-auto mb-2 text-red-400" }), jsx("p", { children: "No transcript details available" }), jsx("p", { className: "text-sm mt-1", children: "Unable to load transcript for this conversation." })] }) })) : (
|
|
192323
192309
|
/* Data loaded successfully */
|
|
192324
|
-
jsxs(Fragment$1, { children: [jsxs("div", { className: "mb-4 flex-shrink-0", children: [jsx("h2", { className: "text-lg font-semibold mb-2", children: "Conversation Transcript" }), jsxs("div", { className: "text-sm text-gray-500", children: [jsxs("div", { children: ["Full Name: ", ((_a = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.summary) === null || _a === void 0 ? void 0 : _a.name) || '-'] }), jsxs("div", { children: ["Username: ", ((_b = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.summary) === null || _b === void 0 ? void 0 : _b.username) || '-'] }), jsxs("div", { children: ["
|
|
192310
|
+
jsxs(Fragment$1, { children: [jsxs("div", { className: "mb-4 flex-shrink-0", children: [jsx("h2", { className: "text-lg font-semibold mb-2", children: "Conversation Transcript" }), jsxs("div", { className: "text-sm text-gray-500", children: [jsxs("div", { children: ["Full Name: ", ((_a = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.summary) === null || _a === void 0 ? void 0 : _a.name) || '-'] }), jsxs("div", { children: ["Username: ", ((_b = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.summary) === null || _b === void 0 ? void 0 : _b.username) || '-'] }), jsxs("div", { children: ["Agent: ", ((_c = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.summary) === null || _c === void 0 ? void 0 : _c.mentor) || '-'] }), jsxs("div", { children: ["Model: ", ((_d = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.summary) === null || _d === void 0 ? void 0 : _d.model) || '-'] })] })] }), jsx("div", { className: "flex-1 overflow-y-auto space-y-4 min-h-0", children: ((_e = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.messages) === null || _e === void 0 ? void 0 : _e.length) > 0 ? ((_f = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.messages) === null || _f === void 0 ? void 0 : _f.map((message, index) => (jsxs(React__default.Fragment, { children: [(message === null || message === void 0 ? void 0 : message.human) && (jsxs("div", { className: `p-3 rounded-lg bg-blue-100 ml-4`, children: [jsx("div", { className: "flex justify-between items-start mb-1", children: jsx("span", { className: "font-medium text-sm", children: "User" }) }), jsx("p", { className: "text-sm", children: getMessageContent(message.human) })] }, `${index}-human`)), (message === null || message === void 0 ? void 0 : message.ai) && (jsxs("div", { className: `p-3 rounded-lg bg-white mr-4`, children: [jsx("div", { className: "flex justify-between items-start mb-1", children: jsx("span", { className: "font-medium text-sm", children: "Agent" }) }), jsx(Markdown, { children: getMessageContent(message.ai) })] }, `${index}-ai`))] }, index)))) : (jsx("div", { className: "text-center text-gray-500 py-8", children: jsx("p", { children: "No messages in this conversation." }) })) })] })) }));
|
|
192325
192311
|
};
|
|
192326
192312
|
return (jsxs("div", { className: "space-y-8", children: [jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 mb-6", children: [jsx(StatCard, { title: "Average number of messages per conversation", value: ((_a = transcriptsConversationHeadlineData === null || transcriptsConversationHeadlineData === void 0 ? void 0 : transcriptsConversationHeadlineData.avg_messages_per_conversation) === null || _a === void 0 ? void 0 : _a.value) || 0, percentage: ((_b = transcriptsConversationHeadlineData === null || transcriptsConversationHeadlineData === void 0 ? void 0 : transcriptsConversationHeadlineData.avg_messages_per_conversation) === null || _b === void 0 ? void 0 : _b.percentage_change) ||
|
|
192327
192313
|
undefined, loading: isLoadingTranscriptsConversationHeadlineData }), jsx(StatCard, { title: "Average cost per conversation", value: Number(((_c = transcriptsConversationHeadlineData === null || transcriptsConversationHeadlineData === void 0 ? void 0 : transcriptsConversationHeadlineData.avg_cost_per_conversation) === null || _c === void 0 ? void 0 : _c.value) || 0).toFixed(2), percentage: ((_d = transcriptsConversationHeadlineData === null || transcriptsConversationHeadlineData === void 0 ? void 0 : transcriptsConversationHeadlineData.avg_cost_per_conversation) === null || _d === void 0 ? void 0 : _d.percentage_change) ||
|
|
@@ -192342,7 +192328,7 @@ function AnalyticsTranscriptsStats({ tenantKey, mentorId, selectedMentorId, user
|
|
|
192342
192328
|
? 'Negative'
|
|
192343
192329
|
: transcript.sentiment === 'positive'
|
|
192344
192330
|
? 'Positive'
|
|
192345
|
-
: 'Neutral', ' ', "User Sentiment"] })] }) }), jsxs("div", { className: "flex flex-wrap gap-x-6 gap-y-2 text-xs text-gray-500 mb-2", children: [jsxs("div", { children: ["User: ", (transcript === null || transcript === void 0 ? void 0 : transcript.name) || (transcript === null || transcript === void 0 ? void 0 : transcript.username) || '-'] }), jsxs("div", { children: ["
|
|
192331
|
+
: 'Neutral', ' ', "User Sentiment"] })] }) }), jsxs("div", { className: "flex flex-wrap gap-x-6 gap-y-2 text-xs text-gray-500 mb-2", children: [jsxs("div", { children: ["User: ", (transcript === null || transcript === void 0 ? void 0 : transcript.name) || (transcript === null || transcript === void 0 ? void 0 : transcript.username) || '-'] }), jsxs("div", { children: ["Agent: ", (transcript === null || transcript === void 0 ? void 0 : transcript.mentor) || '-'] })] }), jsxs("div", { className: "flex flex-wrap gap-x-6 gap-y-2 text-xs text-gray-500 mb-2", children: [jsxs("div", { children: ["model: ", (transcript === null || transcript === void 0 ? void 0 : transcript.model) || '-'] }), jsxs("div", { children: ["user_id: ", (transcript === null || transcript === void 0 ? void 0 : transcript.username) || '-'] })] }), jsxs("div", { className: "flex flex-wrap gap-x-6 gap-y-2 text-xs text-gray-500", children: [jsxs("div", { children: [transcript.message_count, " messages"] }), jsx("div", { children: "\u2022" }), jsxs("div", { children: ["$", Number((transcript === null || transcript === void 0 ? void 0 : transcript.cost) || 0).toFixed(2), " estimated cost"] }), (transcript === null || transcript === void 0 ? void 0 : transcript.created_at) && (jsxs(Fragment$1, { children: [jsx("div", { children: "\u2022" }), jsxs("div", { children: ["Created ", formatRelativeTime(transcript.created_at)] })] }))] })] }, transcript.session));
|
|
192346
192332
|
})) : (
|
|
192347
192333
|
// Empty state
|
|
192348
192334
|
jsx("div", { className: "text-center py-12", children: jsx("p", { className: "text-gray-500", children: filters.topicSearch || filters.userSearch || filters.rating
|
|
@@ -192361,7 +192347,7 @@ function AnalyticsTranscriptsStats({ tenantKey, mentorId, selectedMentorId, user
|
|
|
192361
192347
|
/* Error or no data state */
|
|
192362
192348
|
jsx("div", { className: "flex items-center justify-center h-full text-gray-400", children: jsxs("div", { className: "text-center", children: [jsx(X$1, { className: "h-6 w-6 mx-auto mb-2 text-red-400" }), jsx("p", { children: "No transcript details available" }), jsx("p", { className: "text-sm mt-1", children: "Unable to load transcript for this conversation." })] }) })) : (
|
|
192363
192349
|
/* Data loaded successfully */
|
|
192364
|
-
jsxs("div", { className: "space-y-4", children: [jsx("div", { className: "mb-4", children: jsxs("div", { className: "text-sm text-gray-500 space-y-1", children: [jsxs("div", { children: ["Full Name: ", ((_g = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.summary) === null || _g === void 0 ? void 0 : _g.name) || '-'] }), jsxs("div", { children: ["Username: ", ((_h = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.summary) === null || _h === void 0 ? void 0 : _h.username) || '-'] }), jsxs("div", { children: ["
|
|
192350
|
+
jsxs("div", { className: "space-y-4", children: [jsx("div", { className: "mb-4", children: jsxs("div", { className: "text-sm text-gray-500 space-y-1", children: [jsxs("div", { children: ["Full Name: ", ((_g = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.summary) === null || _g === void 0 ? void 0 : _g.name) || '-'] }), jsxs("div", { children: ["Username: ", ((_h = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.summary) === null || _h === void 0 ? void 0 : _h.username) || '-'] }), jsxs("div", { children: ["Agent: ", ((_j = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.summary) === null || _j === void 0 ? void 0 : _j.mentor) || '-'] }), jsxs("div", { children: ["Model: ", ((_k = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.summary) === null || _k === void 0 ? void 0 : _k.model) || '-'] })] }) }), jsx("div", { className: "space-y-4 pb-4", children: ((_l = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.messages) === null || _l === void 0 ? void 0 : _l.length) > 0 ? ((_m = transcriptsMessagesDetailsData === null || transcriptsMessagesDetailsData === void 0 ? void 0 : transcriptsMessagesDetailsData.messages) === null || _m === void 0 ? void 0 : _m.map((message, index) => (jsxs(React__default.Fragment, { children: [(message === null || message === void 0 ? void 0 : message.human) && (jsxs("div", { className: "p-3 rounded-lg bg-blue-100 ml-4", children: [jsx("div", { className: "flex justify-between items-start mb-1", children: jsx("span", { className: "font-medium text-sm", children: "User" }) }), jsx("p", { className: "text-sm", children: getMessageContent(message.human) })] })), (message === null || message === void 0 ? void 0 : message.ai) && (jsxs("div", { className: "p-3 rounded-lg bg-white mr-4 border", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx("div", { className: "flex justify-between items-start mb-1", children: jsx("span", { className: "font-medium text-sm", children: "Agent" }) }), jsx(Markdown, { children: getMessageContent(message.ai) })] }))] }, index)))) : (jsx("div", { className: "text-center text-gray-500 py-8", children: jsx("p", { children: "No messages in this conversation." }) })) })] })) })] }) }))] }));
|
|
192365
192351
|
}
|
|
192366
192352
|
|
|
192367
192353
|
const phaseConfig = {
|
|
@@ -194048,7 +194034,7 @@ function AnalyticsMonetizationStats({ tenantKey }) {
|
|
|
194048
194034
|
setSubscriberPage(subscribersData.next_page), children: "Next" })] })] }))] }) }), jsx(Card, { className: "w-full bg-white rounded-lg border border-gray-100 overflow-hidden shadow-sm", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-4", "aria-label": "Paywalls table card", children: [jsx("div", { className: "mb-4", children: jsxs("div", { className: "flex items-center justify-between", children: [jsxs("h3", { className: "text-base font-medium text-gray-700", children: ["Configured Paywalls (", (_h = paywallsData === null || paywallsData === void 0 ? void 0 : paywallsData.count) !== null && _h !== void 0 ? _h : 0, ")"] }), jsxs(Select$1, { value: paywallTypeFilter, onValueChange: (v) => {
|
|
194049
194035
|
setPaywallTypeFilter(v);
|
|
194050
194036
|
setPaywallPage(1);
|
|
194051
|
-
}, children: [jsx(SelectTrigger, { className: "w-[130px]", children: jsx(SelectValue, {}) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "all", children: "All Types" }), jsx(SelectItem, { value: "mentor", children: "
|
|
194037
|
+
}, children: [jsx(SelectTrigger, { className: "w-[130px]", children: jsx(SelectValue, {}) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "all", children: "All Types" }), jsx(SelectItem, { value: "mentor", children: "Agent" }), jsx(SelectItem, { value: "course", children: "Course" })] })] })] }) }), jsx("div", { className: "rounded-md overflow-auto", style: { borderColor: 'oklch(.922 0 0)', borderWidth: '1px' }, children: jsxs(Table, { children: [jsx(TableHeader, { children: jsxs(TableRow, { className: "h-[48px]", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx(TableHead, { className: "w-[250px]", children: "Item" }), jsx(TableHead, { className: "w-[100px]", children: "Type" }), jsx(TableHead, { className: "w-[100px]", children: "Prices" }), jsx(TableHead, { className: "text-right", children: "Status" })] }) }), jsx(TableBody, { children: (_j = paywallsData === null || paywallsData === void 0 ? void 0 : paywallsData.results) === null || _j === void 0 ? void 0 : _j.map((pw, index) => {
|
|
194052
194038
|
var _a, _b;
|
|
194053
194039
|
return (jsxs(TableRow, { className: cn(index % 2 === 0 ? 'bg-gray-50' : '', 'h-[48px]'), style: { borderColor: 'oklch(.922 0 0)' }, children: [jsx(TableCell, { className: "font-medium", children: pw.item_name || pw.item_id }), jsx(TableCell, { children: jsx(Badge, { variant: "secondary", className: "text-xs capitalize", children: pw.item_type }) }), jsxs(TableCell, { children: [(_b = (_a = pw.prices) === null || _a === void 0 ? void 0 : _a.filter((p) => p.is_active).length) !== null && _b !== void 0 ? _b : 0, " active"] }), jsx(TableCell, { className: "text-right", children: jsx(Badge, { className: pw.is_enabled
|
|
194054
194040
|
? 'bg-blue-100 text-blue-700 border-blue-200 hover:bg-blue-100'
|
|
@@ -194141,7 +194127,7 @@ const ACTION_FILTER_OPTIONS = [
|
|
|
194141
194127
|
// We keep the full UUID so mentors with the same name stay distinguishable.
|
|
194142
194128
|
const TRAILING_UUID_RE = /\s*\(([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\)\s*$/i;
|
|
194143
194129
|
const RESOURCE_TYPE_LABELS = {
|
|
194144
|
-
mentorsettings: '
|
|
194130
|
+
mentorsettings: 'agent settings',
|
|
194145
194131
|
};
|
|
194146
194132
|
function humanizeResourceType(type) {
|
|
194147
194133
|
var _a;
|
|
@@ -194161,7 +194147,7 @@ function splitReprAndUniqueId(repr) {
|
|
|
194161
194147
|
// Raw field names like `enable_multi_query_rag` or `llm_name` read poorly
|
|
194162
194148
|
// when just underscore-replaced, so we map the common ones explicitly.
|
|
194163
194149
|
const FIELD_LABELS = {
|
|
194164
|
-
align_mentor_bubble: '
|
|
194150
|
+
align_mentor_bubble: 'agent bubble alignment',
|
|
194165
194151
|
allow_anonymous: 'anonymous access',
|
|
194166
194152
|
can_use_tools: 'tools',
|
|
194167
194153
|
display_name: 'display name',
|
|
@@ -194175,7 +194161,7 @@ const FIELD_LABELS = {
|
|
|
194175
194161
|
is_lti_accessible: 'LTI access',
|
|
194176
194162
|
llm_name: 'LLM model',
|
|
194177
194163
|
llm_provider: 'LLM provider',
|
|
194178
|
-
mentor_bubble_color: '
|
|
194164
|
+
mentor_bubble_color: 'agent bubble color',
|
|
194179
194165
|
mentor_visibility: 'visibility',
|
|
194180
194166
|
profile_image: 'profile image',
|
|
194181
194167
|
system_prompt: 'system prompt',
|
|
@@ -198073,7 +198059,7 @@ function AgentSkills({ platformKey, mentorUniqueId }) {
|
|
|
198073
198059
|
const assignment = assignmentsBySkillUniqueId.get(skill.unique_id);
|
|
198074
198060
|
const isEnabled = (_a = assignment === null || assignment === void 0 ? void 0 : assignment.enabled) !== null && _a !== void 0 ? _a : false;
|
|
198075
198061
|
return (jsxs("div", { className: "flex items-center justify-between rounded-lg border p-6", children: [jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [jsx("span", { className: "text-sm font-medium text-gray-700", children: skill.name }), skill.description && (jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { "aria-label": `More info about ${skill.name}`, children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "ibl-tooltip-content", children: jsx("p", { children: skill.description }) })] }) })), jsxs("span", { className: "hidden sm:inline text-xs text-gray-400", children: ["v", skill.version] })] }), jsxs("div", { className: "flex items-center gap-2", children: [jsx(Switch, { checked: isEnabled, onCheckedChange: (checked) => handleToggle(skill, checked), disabled: isTogglingMentorSkill, className: "cursor-pointer data-[state=checked]:bg-blue-500", "aria-label": `${skill.name} ${isEnabled ? 'enabled' : 'disabled'}` }), jsxs(DropdownMenu, { children: [jsx(DropdownMenuTrigger, { asChild: true, children: jsx(Button$1, { variant: "ghost", size: "sm", "aria-label": `${skill.name} actions`, children: jsx(Ellipsis, { className: "h-4 w-4" }) }) }), jsxs(DropdownMenuContent, { align: "end", children: [jsxs(DropdownMenuItem, { className: "cursor-pointer", onClick: () => openEditSkillDialog(skill), children: [jsx(Pen, { className: "mr-2 h-4 w-4" }), "Edit"] }), jsxs(DropdownMenuItem, { variant: "destructive", className: "cursor-pointer", onClick: () => setDeletingSkill(skill), children: [jsx(Trash2, { className: "mr-2 h-4 w-4" }), "Delete"] })] })] })] })] }, skill.id));
|
|
198076
|
-
}) })), jsxs(OverlayModal, { open: showNewDialog, onClose: closeAllDialogs, title: "New Skill", className: "max-w-2xl", children: [jsx(SkillForm, { form: form, onChange: setForm }), jsxs("div", { className: "flex justify-end gap-2 pt-2", children: [jsx(Button$1, { variant: "outline", onClick: closeAllDialogs, children: "Cancel" }), jsx(Button$1, { onClick: handleCreateSkill, disabled: isCreatingSkill || !form.name || !form.slug, className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", children: isCreatingSkill ? 'Creating...' : 'Create' })] })] }), jsxs(OverlayModal, { open: !!editingSkill, onClose: closeAllDialogs, title: "Edit Skill", className: "max-w-2xl", children: [jsx(SkillForm, { form: form, onChange: setForm }), jsxs("div", { className: "flex justify-end gap-2 pt-2", children: [jsx(Button$1, { variant: "outline", onClick: closeAllDialogs, children: "Cancel" }), jsx(Button$1, { onClick: handleUpdateSkill, disabled: isUpdatingSkill || !form.name || !form.slug, className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", children: isUpdatingSkill ? 'Saving...' : 'Save' })] })] }), jsxs(OverlayModal, { open: !!deletingSkill, onClose: () => setDeletingSkill(null), title: "Delete Skill", className: "max-w-md", children: [jsxs("p", { className: "mt-2 text-sm text-gray-600", children: ["Are you sure you want to delete ", jsx("strong", { children: deletingSkill === null || deletingSkill === void 0 ? void 0 : deletingSkill.name }), "? This action cannot be undone and will remove the skill from all
|
|
198062
|
+
}) })), jsxs(OverlayModal, { open: showNewDialog, onClose: closeAllDialogs, title: "New Skill", className: "max-w-2xl", children: [jsx(SkillForm, { form: form, onChange: setForm }), jsxs("div", { className: "flex justify-end gap-2 pt-2", children: [jsx(Button$1, { variant: "outline", onClick: closeAllDialogs, children: "Cancel" }), jsx(Button$1, { onClick: handleCreateSkill, disabled: isCreatingSkill || !form.name || !form.slug, className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", children: isCreatingSkill ? 'Creating...' : 'Create' })] })] }), jsxs(OverlayModal, { open: !!editingSkill, onClose: closeAllDialogs, title: "Edit Skill", className: "max-w-2xl", children: [jsx(SkillForm, { form: form, onChange: setForm }), jsxs("div", { className: "flex justify-end gap-2 pt-2", children: [jsx(Button$1, { variant: "outline", onClick: closeAllDialogs, children: "Cancel" }), jsx(Button$1, { onClick: handleUpdateSkill, disabled: isUpdatingSkill || !form.name || !form.slug, className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", children: isUpdatingSkill ? 'Saving...' : 'Save' })] })] }), jsxs(OverlayModal, { open: !!deletingSkill, onClose: () => setDeletingSkill(null), title: "Delete Skill", className: "max-w-md", children: [jsxs("p", { className: "mt-2 text-sm text-gray-600", children: ["Are you sure you want to delete ", jsx("strong", { children: deletingSkill === null || deletingSkill === void 0 ? void 0 : deletingSkill.name }), "? This action cannot be undone and will remove the skill from all agents."] }), jsxs("div", { className: "flex justify-end gap-2 pt-2", children: [jsx(Button$1, { variant: "outline", onClick: () => setDeletingSkill(null), children: "Cancel" }), jsx(Button$1, { onClick: handleDeleteSkill, disabled: isDeletingSkill, className: "bg-red-600 text-white hover:bg-red-700", children: isDeletingSkill ? 'Deleting...' : 'Delete' })] })] })] }));
|
|
198077
198063
|
}
|
|
198078
198064
|
// ── Shared Skill Form ────────────────────────────────────────────────────────
|
|
198079
198065
|
function SkillForm({ form, onChange, }) {
|
|
@@ -198238,7 +198224,7 @@ const defaultSections = [
|
|
|
198238
198224
|
{
|
|
198239
198225
|
title: 'Core',
|
|
198240
198226
|
items: [
|
|
198241
|
-
{ id: 'mentor', label: '
|
|
198227
|
+
{ id: 'mentor', label: 'Agent' },
|
|
198242
198228
|
{ id: 'end', label: 'End' },
|
|
198243
198229
|
{ id: 'note', label: 'Note' },
|
|
198244
198230
|
],
|
|
@@ -200893,7 +200879,7 @@ const AGENT_DATASETS_TAB_LABELS = {
|
|
|
200893
200879
|
},
|
|
200894
200880
|
trainOrDeleteModal: {
|
|
200895
200881
|
title: 'What would you like to do?',
|
|
200896
|
-
description: "This dataset is currently untrained. You can train it to make it available for your
|
|
200882
|
+
description: "This dataset is currently untrained. You can train it to make it available for your agent, or permanently delete it if it's no longer needed.",
|
|
200897
200883
|
delete: 'Delete',
|
|
200898
200884
|
train: 'Train',
|
|
200899
200885
|
training: 'Training...',
|
|
@@ -201137,7 +201123,7 @@ function GithubFileUploadModal() {
|
|
|
201137
201123
|
const handleSubmit = async () => {
|
|
201138
201124
|
try {
|
|
201139
201125
|
if (!mentorId) {
|
|
201140
|
-
toast.error('
|
|
201126
|
+
toast.error('Agent not found');
|
|
201141
201127
|
return;
|
|
201142
201128
|
}
|
|
201143
201129
|
await addTrainingDocument({
|
|
@@ -202950,13 +202936,13 @@ function AddPromptModal({ isOpen, onClose, mentorId, tenantKey }) {
|
|
|
202950
202936
|
} }), jsx("div", { className: "flex justify-end", children: jsx(form.Subscribe, { selector: (state) => ({ isFormValue: state.canSubmit }), children: ({ isFormValue }) => (jsx(Button$1, { type: "submit", className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", disabled: isDisabled || !isFormValue, children: isCreatingPrompt ? 'Submitting...' : 'Submit' })) }) })] })] }) }), isModalOpen && FreeTrialDialog && (jsx(FreeTrialDialog, { isOpen: isModalOpen, onClose: closeModal }))] }));
|
|
202951
202937
|
}
|
|
202952
202938
|
|
|
202953
|
-
const systemPromptSchema = z
|
|
202954
|
-
prompt: z
|
|
202939
|
+
const systemPromptSchema = z.object({
|
|
202940
|
+
prompt: z.string().min(1, 'Prompt is required'),
|
|
202955
202941
|
});
|
|
202956
|
-
const nonSystemPromptSchema = z
|
|
202957
|
-
category: z
|
|
202958
|
-
prompt: z
|
|
202959
|
-
promptVisibility: z
|
|
202942
|
+
const nonSystemPromptSchema = z.object({
|
|
202943
|
+
category: z.string().min(1, 'Category is required'),
|
|
202944
|
+
prompt: z.string().min(1, 'Prompt is required'),
|
|
202945
|
+
promptVisibility: z.nativeEnum(PromptVisibilityEnum),
|
|
202960
202946
|
});
|
|
202961
202947
|
function EditPromptModal({ isOpen, onClose, selectedPrompt, handleSave, isEditing, tenantKey, }) {
|
|
202962
202948
|
var _a;
|
|
@@ -4,13 +4,13 @@ import React__default, { useState, useEffect, forwardRef, createElement as creat
|
|
|
4
4
|
import { useGetUserMetadataQuery, useGetUserMetadataEdxQuery, useUpdateUserMetadataMutation, useUpdateUserMetadataEdxMutation, useUploadProfileImageMutation, useResetPasswordMutation, useSelfRetireMutation, useCreateUserInstitutionMutation, useGetUserInstitutionsQuery, useCreateUserEducationMutation, useUpdateUserEducationMutation, useDeleteUserEducationMutation, useGetUserEducationQuery, useCreateUserCompanyMutation, useGetUserCompaniesQuery, useCreateUserExperienceMutation, useUpdateUserExperienceMutation, useDeleteUserExperienceMutation, useGetUserExperienceQuery, useGetUserResumeQuery, useCreateUserResumeMutation, useGetMySubscriptionsQuery, useGetItemSubscriptionQuery, useCancelSubscriptionMutation, useCreateGlobalMemoryMutation, useGetMemsearchStatusQuery, useGetUserMemorySettingsQuery, useUpdateUserMemorySettingsMutation, useGetGlobalMemoriesQuery, useDeleteGlobalMemoryMutation, ChatPrivacyModeEnum, useGetUserChatPrivacySettingsQuery, useUpdateUserChatPrivacySettingsMutation, CHAT_PRIVACY_MODES, useGetTenantChatPrivacyConfigQuery, useInviteUserMutation, usePlatformInvitationsQuery, useCreateCatalogInvitationCourseBulkMutation, useGetCatalogInvitationsCourseQuery, useLazyPlatformUsersQuery, useLazyPlatformUserGroupsQuery, useGetPersonnalizedSearchQuery, useCreateCatalogInvitationProgramBulkMutation, useGetCatalogInvitationsProgramQuery, useUpdateUserRoleMutation, useUpdateUserStatusMutation, useUpdatePlatformUserRoleWithPoliciesMutation, usePlatformUsersQuery, isPoliciesResponse, platformApiSlice, featureTags, useLazyGetRbacTeamsAccessListQuery, useCreateRbacTeamsAccessMutation, useGetRbacGroupsQuery, usePlatformUserGroupsQuery, useCreateRbacGroupMutation, useUpdateRbacGroupMutation, useDeleteRbacGroupMutation, useCreatePlatformUserGroupMutation, useUpdatePlatformUserGroupMutation, useDeletePlatformUserGroupMutation, useGetRbacGroupDetailsQuery, useGetPlatformUserGroupDetailsQuery, useGetRbacPermissionsMutation, useGetRbacRolesQuery, useCreateRbacRoleMutation, useUpdateRbacRoleMutation, useDeleteRbacRoleMutation, useGetRbacRoleDetailsQuery, useGetRbacActionsDefinitionQuery, useGetRbacPoliciesQuery, useCreateRbacPolicyMutation, useUpdateRbacPolicyMutation, useDeleteRbacPolicyMutation, useGetRbacPolicyDetailsQuery, useGetWatchedGroupsQuery, useCreateWatchedGroupMutation, useUpdateWatchedGroupMutation, useDeleteWatchedGroupMutation, useAddWatchedUserMutation, useRemoveWatchedUserMutation, useAddWatcherMutation, useUpdateWatcherMutation, useDeleteWatcherMutation, useGetWatchedUsersQuery, useGetWatchersQuery, WATCHER_NOTIFICATION_EVENTS, WATCHER_NOTIFICATION_EVENT_LABELS, useDeleteApiKeyMutation, useGetApiKeysQuery, useCreateApiKeyMutation, useCreateLLMCredentialMutation, useGetCredentialsSchemaQuery, useGetMaskedLLMCredentialsQuery, useGetLlmsQuery, useDeleteIntegrationCredentialMutation, useDeleteCredentialMutation, useCreateIntegrationCredentialMutation, useGetIntegrationCredentialsSchemaQuery, useGetMaskedIntegrationCredentialsQuery, useGetAccountBillingInfoQuery, useUpdateAutoRechargeInfoMutation, useTriggerAutoRechargeMutation, useCreateStripeCustomerPortalMutation, useSetPlatformConfigurationsMutation, useGetPlatformConfigurationsQuery, useUpdatePlatformMembershipMutation, useGetPlatformMembershipQuery, useGetCustomDomainsQuery, useCreateCustomDomainMutation, useDeleteCustomDomainMutation, useGetStudentMentorCreationStatusQuery, useSetStudentMentorCreationStatusMutation, coreApiSlice, recommendationPromptTypeEnum, useGetRecommendedPromptsListQuery, useCreateRecommendedPromptMutation, useUpdateRecommendedPromptMutation, useDeleteRecommendedPromptMutation, useLazyGetPublicPlatformImageAssetFileUrlQuery, useUpdateTenantMetadataMutation, useCreatePlatformImageAssetMutation, useGetProviderConfigQuery, useCreateProviderConfigMutation, useDeleteProviderConfigMutation, useGetExternalMappingQuery, useGetCredentialsListQuery, useCreateExternalMappingMutation, useDeleteExternalMappingMutation, useGetMemsearchConfigQuery, useUpdateMemsearchConfigMutation, useUpdateTenantChatPrivacyConfigMutation, useGetCustomMentorsQuery, useGetStripeConnectStatusQuery, useStartStripeConnectOnboardingMutation, useLazyGetStripeConnectDashboardQuery, useGetAiSearchMentorsQuery, useListPaywallsQuery, useListPricesQuery, useCreatePriceMutation, useUpdatePriceMutation, useDeletePriceMutation, useGetPaywallConfigQuery, useEnablePaywallMutation, useUpdatePaywallMutation, useLazyGetCourseMetaDataQuery, useLazyGetCourseCompletionOutlinesQuery, useLazyGetCourseEligibilityQuery, useLazyGetEdxSSOTokenQuery, useCreateCourseEnrollmentMutation, useCreateStripeCheckoutSessionMutation, useLazyGetCourseProgressQuery, useLazyGetCourseCompletionQuery, useUpdateExamAttemptMutation, useStartExamMutation, useLazyGetExamInfoQuery, useUpdateUserProjectMutation, useGetTrainingDocumentsQuery, useGetVectorDocumentsQuery, useGetMentorMemoriesListQuery, useGetMemoryCategoriesAdminQuery, useDeleteMentorMemoryMutation, useUpdateMentorMemoryMutation, useCreateMentorMemoryMutation, useLazyGetConnectedServiceAuthUrlQuery, useGetMentorsQuery, useGetPublicMentorsQuery, useCreateUserProjectMutation, useDeleteUserProjectMutation, useGetUserProjectDetailsQuery, useEditTrainingDocumentMutation, useAddTrainingDocumentMutation, useLazyGetCredentialsQuery, useGetMentorSettingsQuery, useEditMentorMutation, useUploadLightLogoMutation, useUploadDarkLogoMutation, useUpdatePlatformInfoMutation, LOGO_ENDPOINTS, useGetUserProjectsQuery, useCreateSessionIdMutation, useGetMentorCategoriesQuery, useDeleteMentorMutation, useForkMentorMutation, useGetToolsQuery, useLazyGetMCPServersQuery, useOauthFindMutation, useLazyStartOAuthFlowQuery, useCreateMCPServerMutation, usePartialUpdateMCPServerMutation, useCreateMCPServerConnectionMutation, usePatchMCPServerConnectionMutation, useGetConnectedServicesQuery, useGetMCPServersQuery, useGetMCPServerConnectionsQuery, useUpdateMCPServerMutation, useDeleteMCPServerMutation, useEditMentorJsonMutation, useDisconnectServiceMutation, useGetPromptCategoriesQuery, PRIVACY_ACTIONS, PRIVACY_ENTITY_TYPES, useGetVoicesQuery, useGetVoiceQuery, useGetCallConfigurationsQuery, useCreateCallConfigurationMutation, useUpdateCallConfigurationMutation, useGetMentorPublicSettingsQuery, useGetChatHistoryFilterQuery, useGetChatHistoryQuery, useGetMentorSummariesQuery, useGetConversationMemoriesQuery, useCreatePromptMutation, useGetPromptsSearchQuery, useUpdatePromptMutation, useCreateRedirectTokenMutation, useGetShareableLinkQuery, useCreateShareableLinkMutation, useUpdateShareableLinkMutation, useCreateDisclaimerMutation, useUpdateDisclaimerMutation, useGetDisclaimersQuery, useUpdateRbacMentorAccessMutation, useGetRbacMentorAccessListQuery, useStarMentorMutation, useUnstarMentorMutation, useGetPersonnalizedMentorsQuery, useCreateCallCredentialsMutation, useGetGuidedPromptsQuery, useUpdateChatSessionSharedMutation, useUpdateMessageFeedbackMutation, useLazyGetPromptsSearchQuery, useLazyGetGuidedPromptsQuery, useGetPeriodicAgentsQuery, useGetPeriodicAgentLogsListQuery, useCreatePeriodicAgentMutation, useDeletePeriodicAgentMutation, useDeletePromptMutation, useDeleteTrainingDocumentMutation, useGetTrainingDocumentRetrainScheduleQuery, useCreateTrainingDocumentRetrainScheduleMutation, useCreateMemoryCategoryMutation, useUpdateMemoryCategoryMutation, useDeleteMemoryCategoryMutation, useUpdateArtifactMutation, useLazyGetArtifactVersionQuery, useLazyListArtifactVersionsQuery, useSetCurrentVersionMutation, useListArtifactVersionsQuery, useLazyGetArtifactQuery, useLazyListArtifactsQuery, useEditSessionMutation } from '@iblai/data-layer';
|
|
5
5
|
import { getInitials, useTenantMetadata, WithPermissions, useStripeUpgrade, CHAT_AREA_SIZE, isAlphaNumeric32, checkRbacPermission, selectNumberOfActiveChatMessages, useUsername, selectStreaming, isLoggedIn, TOOLS, isSafariBrowser, useShowAttachment, useShowVoiceCall, useShowVoiceRecorder, useMentorSettings, selectShowingSharedChat, selectRbacPermissions, useShowFreeTrialDialog, useEmbedMode, chatInputSliceSelectors, useResponsive, useAccessingPublicRoute, useVisitingTenant, useModelFileUploadCapabilities, useChatFileUpload, useVoiceChat, selectAttachedFiles, MENTOR_CHAT_DOCUMENTS_EXTENSIONS, removeFile, chatInputSliceActions, chatActions, WithFormPermissions, useTenantContext, TimeTracker, advancedTabsProperties, defaultSessionIds, ANONYMOUS_USERNAME as ANONYMOUS_USERNAME$2, redirectToAuthSpaJoinTenant, selectActiveTab, useAxdToken, useWelcomeMessage, markdownToPlainText, useCachedSessionId, use402ErrorCheck, selectTokenEnabled, selectToken, useServiceWorker, useUserAgreement, useAdvancedChat, sendMessageToParentWebsite, useMentorTools, useFileDragDrop, eventBus, RemoteEvents, selectEnableChatActionsPopup, advancedTabs, isInIframe, getAuthSpaJoinUrl, addMessage, clearFiles, MENTOR_VISIBILITY } from '@iblai/web-utils';
|
|
6
6
|
import { useDispatch, useSelector } from 'react-redux';
|
|
7
|
-
import { toast
|
|
7
|
+
import { toast } from 'sonner';
|
|
8
8
|
import { useSearchParams, useParams, usePathname } from 'next/navigation';
|
|
9
9
|
import Image$4 from 'next/image';
|
|
10
10
|
import Link$2 from 'next/link';
|
|
11
11
|
import * as ReactDOM from 'react-dom';
|
|
12
12
|
import ReactDOM__default from 'react-dom';
|
|
13
|
-
import { z as z$
|
|
13
|
+
import { z as z$2 } from 'zod';
|
|
14
14
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
15
15
|
import { createDialogScope } from '@radix-ui/react-dialog';
|
|
16
16
|
import { MentorVisibilityEnum, TransportEnum, PromptVisibilityEnum } from '@iblai/iblai-api';
|
|
@@ -86893,7 +86893,7 @@ const __iconNode$5 = [
|
|
|
86893
86893
|
];
|
|
86894
86894
|
const X$2 = createLucideIcon("x", __iconNode$5);
|
|
86895
86895
|
|
|
86896
|
-
var x$
|
|
86896
|
+
var x$2 = /*#__PURE__*/Object.freeze({
|
|
86897
86897
|
__proto__: null,
|
|
86898
86898
|
__iconNode: __iconNode$5,
|
|
86899
86899
|
default: X$2
|
|
@@ -98149,8 +98149,8 @@ function useForm(opts) {
|
|
|
98149
98149
|
const FACEBOOK_URL_PREFIX = 'https://facebook.com/';
|
|
98150
98150
|
const X_URL_PREFIX = 'https://x.com/';
|
|
98151
98151
|
const LINKEDIN_URL_PREFIX = 'https://linkedin.com/in/';
|
|
98152
|
-
const socialFormSchema = z$
|
|
98153
|
-
facebook: z$
|
|
98152
|
+
const socialFormSchema = z$2.object({
|
|
98153
|
+
facebook: z$2.string().refine((val) => {
|
|
98154
98154
|
if (!val || val === '')
|
|
98155
98155
|
return true;
|
|
98156
98156
|
// Extract username from full URL and validate
|
|
@@ -98159,7 +98159,7 @@ const socialFormSchema = z$3.object({
|
|
|
98159
98159
|
}, {
|
|
98160
98160
|
message: 'Username can only contain letters, numbers, hyphens, and periods',
|
|
98161
98161
|
}),
|
|
98162
|
-
linkedIn: z$
|
|
98162
|
+
linkedIn: z$2.string().refine((val) => {
|
|
98163
98163
|
if (!val || val === '')
|
|
98164
98164
|
return true;
|
|
98165
98165
|
// Extract username from full URL and validate
|
|
@@ -98168,7 +98168,7 @@ const socialFormSchema = z$3.object({
|
|
|
98168
98168
|
}, {
|
|
98169
98169
|
message: 'Username must be at least 5 characters long and can only contain letters, numbers, and periods.',
|
|
98170
98170
|
}),
|
|
98171
|
-
x: z$
|
|
98171
|
+
x: z$2.string().refine((val) => {
|
|
98172
98172
|
if (!val || val === '')
|
|
98173
98173
|
return true;
|
|
98174
98174
|
// Extract username from full URL and validate
|
|
@@ -98395,20 +98395,6 @@ const useProfile = (username) => {
|
|
|
98395
98395
|
};
|
|
98396
98396
|
};
|
|
98397
98397
|
|
|
98398
|
-
var M$1=(e,i,s,u,m,a,l,h)=>{let d=document.documentElement,w=["light","dark"];function p(n){(Array.isArray(e)?e:[e]).forEach(y=>{let k=y==="class",S=k&&a?m.map(f=>a[f]||f):m;k?(d.classList.remove(...S),d.classList.add(a&&a[n]?a[n]:n)):d.setAttribute(y,n);}),R(n);}function R(n){h&&w.includes(n)&&(d.style.colorScheme=n);}function c(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(u)p(u);else try{let n=localStorage.getItem(i)||s,y=l&&n==="system"?c():n;p(y);}catch(n){}};var x$2=React.createContext(void 0),U$3={setTheme:e=>{},themes:[]},z$2=()=>{var e;return (e=React.useContext(x$2))!=null?e:U$3};React.memo(({forcedTheme:e,storageKey:i,attribute:s,enableSystem:u,enableColorScheme:m,defaultTheme:a,value:l,themes:h,nonce:d,scriptProps:w})=>{let p=JSON.stringify([s,i,a,e,h,l,u,m]).slice(1,-1);return React.createElement("script",{...w,suppressHydrationWarning:true,nonce:typeof window=="undefined"?d:"",dangerouslySetInnerHTML:{__html:`(${M$1.toString()})(${p})`}})});
|
|
98399
|
-
|
|
98400
|
-
const Toaster = ({ ...props }) => {
|
|
98401
|
-
const { theme = "system" } = z$2();
|
|
98402
|
-
return (jsx(Toaster$1, { theme: theme, className: "toaster group", toastOptions: {
|
|
98403
|
-
classNames: {
|
|
98404
|
-
toast: "group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
|
|
98405
|
-
description: "group-[.toast]:text-muted-foreground",
|
|
98406
|
-
actionButton: "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
|
|
98407
|
-
cancelButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",
|
|
98408
|
-
},
|
|
98409
|
-
}, ...props }));
|
|
98410
|
-
};
|
|
98411
|
-
|
|
98412
98398
|
const Dialog = DialogPrimitive.Root;
|
|
98413
98399
|
const DialogTrigger = DialogPrimitive.Trigger;
|
|
98414
98400
|
const DialogPortal = DialogPrimitive.Portal;
|
|
@@ -98477,7 +98463,7 @@ const Security = ({ email, onAccountDeleted, }) => {
|
|
|
98477
98463
|
setDeleting(false);
|
|
98478
98464
|
}
|
|
98479
98465
|
};
|
|
98480
|
-
return (jsxs(Fragment$1, { children: [jsxs("div", { className: "border border-gray-200 rounded-lg p-6", children: [jsxs("div", { className: "max-w-md mx-auto text-center py-12", children: [jsx("div", { className: "text-gray-400 dark:text-gray-500 mb-6", children: jsx(Shield, { className: "h-20 w-20 mx-auto" }) }), jsx("h4", { className: "text-xl font-semibold text-gray-900 dark:text-gray-100 mb-4", children: "Security Settings" }), jsx("p", { className: "text-gray-600 dark:text-gray-400 mb-8", children: "Click to reset your password." }), jsx(Button$1, { className: "w-full bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white", onClick: handleResetPasswordLink, disabled: processing, children: processing ? 'Sending Password Reset Link...' : 'Send Password Reset Link' })] }), jsx("div", { className: "flex justify-end", children: jsx("button", { type: "button", className: "text-sm text-gray-400 hover:text-[#2563EB] hover:underline transition-colors", onClick: () => setIsConfirmOpen(true), children: "Delete account" }) })] }), jsx(Dialog, { open: isConfirmOpen, onOpenChange: setIsConfirmOpen, children: jsxs(DialogContent, { children: [jsxs(DialogHeader, { children: [jsx(DialogTitle, { children: "Are you sure?" }), jsx(DialogDescription, { children: "This will permanently delete your account and all associated data. This action cannot be undone. You will be logged out upon successful deletion." })] }), jsxs(DialogFooter, { children: [jsx(Button$1, { variant: "outline", onClick: () => setIsConfirmOpen(false), disabled: deleting, children: "Cancel" }), jsx(Button$1, { className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white", onClick: handleDeleteAccount, disabled: deleting, children: deleting ? 'Deleting...' : 'Yes, Delete My Account' })] })] }) })
|
|
98466
|
+
return (jsxs(Fragment$1, { children: [jsxs("div", { className: "border border-gray-200 rounded-lg p-6", children: [jsxs("div", { className: "max-w-md mx-auto text-center py-12", children: [jsx("div", { className: "text-gray-400 dark:text-gray-500 mb-6", children: jsx(Shield, { className: "h-20 w-20 mx-auto" }) }), jsx("h4", { className: "text-xl font-semibold text-gray-900 dark:text-gray-100 mb-4", children: "Security Settings" }), jsx("p", { className: "text-gray-600 dark:text-gray-400 mb-8", children: "Click to reset your password." }), jsx(Button$1, { className: "w-full bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white", onClick: handleResetPasswordLink, disabled: processing, children: processing ? 'Sending Password Reset Link...' : 'Send Password Reset Link' })] }), jsx("div", { className: "flex justify-end", children: jsx("button", { type: "button", className: "text-sm text-gray-400 hover:text-[#2563EB] hover:underline transition-colors", onClick: () => setIsConfirmOpen(true), children: "Delete account" }) })] }), jsx(Dialog, { open: isConfirmOpen, onOpenChange: setIsConfirmOpen, children: jsxs(DialogContent, { children: [jsxs(DialogHeader, { children: [jsx(DialogTitle, { children: "Are you sure?" }), jsx(DialogDescription, { children: "This will permanently delete your account and all associated data. This action cannot be undone. You will be logged out upon successful deletion." })] }), jsxs(DialogFooter, { children: [jsx(Button$1, { variant: "outline", onClick: () => setIsConfirmOpen(false), disabled: deleting, children: "Cancel" }), jsx(Button$1, { className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white", onClick: handleDeleteAccount, disabled: deleting, children: deleting ? 'Deleting...' : 'Yes, Delete My Account' })] })] }) })] }));
|
|
98481
98467
|
};
|
|
98482
98468
|
|
|
98483
98469
|
var md5 = {exports: {}};
|
|
@@ -124811,7 +124797,7 @@ function PurchasesTab({ org, username }) {
|
|
|
124811
124797
|
refetch();
|
|
124812
124798
|
} }));
|
|
124813
124799
|
}
|
|
124814
|
-
return (jsxs("div", { className: "max-w-2xl space-y-4", children: [jsxs("div", { className: "relative", children: [jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }), jsx(Input, { value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), placeholder: "Search purchases...", className: "pl-9" }), isFetching && !isLoading && (jsx(LoaderCircle, { className: "absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 animate-spin text-gray-400" }))] }), jsxs("div", { className: "flex flex-col sm:flex-row gap-2", children: [jsxs(Select$1, { value: statusFilter, onValueChange: setStatusFilter, children: [jsx(SelectTrigger, { className: "w-full sm:w-[160px]", children: jsx(SelectValue, { placeholder: "Status" }) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "all", children: "All Statuses" }), jsx(SelectItem, { value: "active", children: "Active" }), jsx(SelectItem, { value: "trialing", children: "Trialing" }), jsx(SelectItem, { value: "canceled", children: "Canceled" }), jsx(SelectItem, { value: "past_due", children: "Past Due" })] })] }), jsxs(Select$1, { value: typeFilter, onValueChange: setTypeFilter, children: [jsx(SelectTrigger, { className: "w-full sm:w-[160px]", children: jsx(SelectValue, { placeholder: "Item Type" }) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "all", children: "All Types" }), jsx(SelectItem, { value: "mentor", children: "
|
|
124800
|
+
return (jsxs("div", { className: "max-w-2xl space-y-4", children: [jsxs("div", { className: "relative", children: [jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400" }), jsx(Input, { value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), placeholder: "Search purchases...", className: "pl-9" }), isFetching && !isLoading && (jsx(LoaderCircle, { className: "absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 animate-spin text-gray-400" }))] }), jsxs("div", { className: "flex flex-col sm:flex-row gap-2", children: [jsxs(Select$1, { value: statusFilter, onValueChange: setStatusFilter, children: [jsx(SelectTrigger, { className: "w-full sm:w-[160px]", children: jsx(SelectValue, { placeholder: "Status" }) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "all", children: "All Statuses" }), jsx(SelectItem, { value: "active", children: "Active" }), jsx(SelectItem, { value: "trialing", children: "Trialing" }), jsx(SelectItem, { value: "canceled", children: "Canceled" }), jsx(SelectItem, { value: "past_due", children: "Past Due" })] })] }), jsxs(Select$1, { value: typeFilter, onValueChange: setTypeFilter, children: [jsx(SelectTrigger, { className: "w-full sm:w-[160px]", children: jsx(SelectValue, { placeholder: "Item Type" }) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "all", children: "All Types" }), jsx(SelectItem, { value: "mentor", children: "Agent" }), jsx(SelectItem, { value: "course", children: "Course" }), jsx(SelectItem, { value: "program", children: "Program" }), jsx(SelectItem, { value: "pathway", children: "Pathway" })] })] }), data && (jsxs("span", { className: "text-xs text-gray-400 self-center ml-auto", children: [data.count, " purchase", data.count !== 1 ? 's' : ''] }))] }), isLoading ? (jsx("div", { className: "space-y-2", children: [1, 2, 3].map((i) => (jsx(Skeleton, { className: "h-24 w-full" }, i))) })) : (data === null || data === void 0 ? void 0 : data.results) && data.results.length > 0 ? (jsxs(Fragment$1, { children: [jsx("div", { className: "space-y-2", children: data.results.map((sub) => (jsx(SubscriptionCard, { sub: sub, onClick: () => setSelectedSubscription(sub) }, sub.unique_id))) }), (data.previous_page !== null || data.next_page !== null) && (jsxs("div", { className: "flex items-center justify-between pt-2", children: [jsxs("span", { className: "text-xs text-gray-400", children: [data.count, " total"] }), jsxs("div", { className: "flex items-center gap-2", children: [jsx(Button$1, { variant: "outline", size: "sm", disabled: data.previous_page === null, onClick: () => data.previous_page !== null && setPage(data.previous_page), className: "h-7 text-xs cursor-pointer", children: "Previous" }), jsxs("span", { className: "text-xs text-gray-500", children: ["Page ", page] }), jsx(Button$1, { variant: "outline", size: "sm", disabled: data.next_page === null, onClick: () => data.next_page !== null && setPage(data.next_page), className: "h-7 text-xs cursor-pointer", children: "Next" })] })] }))] })) : (jsx(Card, { className: "shadow-sm border border-dashed", style: { borderColor: 'oklch(.922 0 0)' }, children: jsxs(CardContent, { className: "p-8 text-center", children: [jsx(ShoppingBag, { className: "h-10 w-10 mx-auto text-gray-300 mb-3" }), jsx("p", { className: "text-sm text-gray-400", children: debouncedSearch.trim() ? 'No purchases match your search.' : 'No purchases found.' })] }) }))] }));
|
|
124815
124801
|
}
|
|
124816
124802
|
|
|
124817
124803
|
function AddMemoryDialog({ open, onOpenChange, org, username }) {
|
|
@@ -128651,7 +128637,7 @@ const TabDescription = ({ icon, title, children }) => {
|
|
|
128651
128637
|
return (jsxs("div", { className: "flex gap-3 items-start border rounded-lg p-4 bg-blue-50/60 border-blue-100", children: [jsx("div", { className: "shrink-0 w-9 h-9 rounded-md flex items-center justify-center bg-blue-100 text-blue-600", children: icon }), jsxs("div", { className: "flex-1 min-w-0", children: [jsx("h3", { className: "text-sm font-semibold mb-1 text-blue-900 hidden sm:block", children: title }), jsx("p", { className: `text-sm text-gray-600 leading-relaxed sm:line-clamp-none! ${expanded ? '' : 'line-clamp-2'}`, children: children }), jsx("button", { type: "button", onClick: () => setExpanded((prev) => !prev), className: "mt-1 text-xs font-medium text-blue-700 hover:text-blue-800 sm:hidden", children: expanded ? 'Read less' : 'Read more' })] })] }));
|
|
128652
128638
|
};
|
|
128653
128639
|
const Admin = ({ tenant, onInviteClick, hasUserTabPermission = false, hasGroupsTabPermission = false, hasRolesTabPermission = false, hasPoliciesTabPermission = false, hasTeamsTabPermission = false, hasAlertsTabPermission = false, hasInviteUserPermission = false, hasCreateTeamPermission = false, onLoadGroupPermissions, rbacPermissions = {}, enableRbac = false, }) => {
|
|
128654
|
-
return (jsx("div", { className: "border border-gray-200 rounded-lg p-6", children: jsxs(Tabs, { defaultValue: "users", "aria-label": "RBAC Management Tabs", children: [jsxs(TabsList, { "aria-label": "Management tabs", className: "max-w-full overflow-x-auto justify-start px-1", children: [hasUserTabPermission && jsx(TabsTrigger, { value: "users", children: "Users" }), hasGroupsTabPermission && jsx(TabsTrigger, { value: "groups", children: "Groups" }), hasRolesTabPermission && jsx(TabsTrigger, { value: "roles", children: "Roles" }), hasPoliciesTabPermission && jsx(TabsTrigger, { value: "policies", children: "Policies" }), hasTeamsTabPermission && jsx(TabsTrigger, { value: "teams", children: "Teams" }), hasAlertsTabPermission && jsx(TabsTrigger, { value: "alerts", children: "Alerts" })] }), hasUserTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "users", children: [jsx(TabDescription, { icon: jsx(Users, { className: "w-5 h-5" }), title: "Users", children: "Manage platform-wide users and their predefined roles. Admins have the highest level of permissions; Users can optionally be granted limited policies." }), jsx(UsersTab, { tenant: tenant, onInviteClick: onInviteClick })] })), hasGroupsTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "groups", children: [jsx(TabDescription, { icon: jsx(UsersRound, { className: "w-5 h-5" }), title: "Groups", children: "RBAC groups bundle users so a single policy assignment grants permissions to all of them. The same group can be reused across policies." }), jsx(GroupsTab, { tenant: tenant })] })), hasRolesTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "roles", children: [jsx(TabDescription, { icon: jsx(UserCog, { className: "w-5 h-5" }), title: "Roles", children: "An RBAC role is a named bundle of permissions (actions applied to resources in policies)." }), jsx(RolesTab, { tenant: tenant })] })), hasPoliciesTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "policies", children: [jsxs(TabDescription, { icon: jsx(ScrollText, { className: "w-5 h-5" }), title: "Policies", children: ["An RBAC policy grants a role's permissions to a set of users or groups on a set of resources. Resources are hierarchical: granting on /platforms/", '{pk}', "/mentors/ covers every
|
|
128640
|
+
return (jsx("div", { className: "border border-gray-200 rounded-lg p-6", children: jsxs(Tabs, { defaultValue: "users", "aria-label": "RBAC Management Tabs", children: [jsxs(TabsList, { "aria-label": "Management tabs", className: "max-w-full overflow-x-auto justify-start px-1", children: [hasUserTabPermission && jsx(TabsTrigger, { value: "users", children: "Users" }), hasGroupsTabPermission && jsx(TabsTrigger, { value: "groups", children: "Groups" }), hasRolesTabPermission && jsx(TabsTrigger, { value: "roles", children: "Roles" }), hasPoliciesTabPermission && jsx(TabsTrigger, { value: "policies", children: "Policies" }), hasTeamsTabPermission && jsx(TabsTrigger, { value: "teams", children: "Teams" }), hasAlertsTabPermission && jsx(TabsTrigger, { value: "alerts", children: "Alerts" })] }), hasUserTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "users", children: [jsx(TabDescription, { icon: jsx(Users, { className: "w-5 h-5" }), title: "Users", children: "Manage platform-wide users and their predefined roles. Admins have the highest level of permissions; Users can optionally be granted limited policies." }), jsx(UsersTab, { tenant: tenant, onInviteClick: onInviteClick })] })), hasGroupsTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "groups", children: [jsx(TabDescription, { icon: jsx(UsersRound, { className: "w-5 h-5" }), title: "Groups", children: "RBAC groups bundle users so a single policy assignment grants permissions to all of them. The same group can be reused across policies." }), jsx(GroupsTab, { tenant: tenant })] })), hasRolesTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "roles", children: [jsx(TabDescription, { icon: jsx(UserCog, { className: "w-5 h-5" }), title: "Roles", children: "An RBAC role is a named bundle of permissions (actions applied to resources in policies)." }), jsx(RolesTab, { tenant: tenant })] })), hasPoliciesTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "policies", children: [jsxs(TabDescription, { icon: jsx(ScrollText, { className: "w-5 h-5" }), title: "Policies", children: ["An RBAC policy grants a role's permissions to a set of users or groups on a set of resources. Resources are hierarchical: granting on /platforms/", '{pk}', "/mentors/ covers every agent, while /platforms/", '{pk}', "/mentors/", '{pk}', "/ scopes to one."] }), jsx(PoliciesTab, { tenant: tenant })] })), hasTeamsTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "teams", children: [jsx(TabDescription, { icon: jsx(Shield, { className: "w-5 h-5" }), title: "Teams", children: "A team is a curated set of users that you can share with others \u2014 e.g., grant another user permission to view the team's analytics or send notifications to them." }), jsx(GroupsTab, { tenant: tenant, isTeam: true, onInviteClick: onInviteClick, hasInviteUserPermission: hasInviteUserPermission, hasCreateTeamPermission: hasCreateTeamPermission, onLoadGroupPermissions: onLoadGroupPermissions, rbacPermissions: rbacPermissions, enableRbac: enableRbac })] })), hasAlertsTabPermission && (jsxs(TabsContent, { className: "mt-4", value: "alerts", children: [jsx(TabDescription, { icon: jsx(BellRing, { className: "w-5 h-5" }), title: "Alerts", children: "An alert pairs a team of watched users with one or more watchers who get notified when monitored events occur for a watched user. Each watcher subscribes to its own subset of events." }), jsx(AlertsTab, { tenant: tenant })] }))] }) }));
|
|
128655
128641
|
};
|
|
128656
128642
|
|
|
128657
128643
|
function DeleteApiModal$1({ isOpen, onClose, apiKey, tenantKey }) {
|
|
@@ -132437,12 +132423,12 @@ function CalendarDayButton({ className, day, modifiers, ...props }) {
|
|
|
132437
132423
|
!modifiers.range_middle, "data-range-start": modifiers.range_start, "data-range-end": modifiers.range_end, "data-range-middle": modifiers.range_middle, className: cn('data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70', defaultClassNames.day, className), ...props }));
|
|
132438
132424
|
}
|
|
132439
132425
|
|
|
132440
|
-
const createApiFormSchema = z$
|
|
132441
|
-
name: z$
|
|
132426
|
+
const createApiFormSchema = z$2.object({
|
|
132427
|
+
name: z$2
|
|
132442
132428
|
.string()
|
|
132443
132429
|
.min(1, 'API Key name is required')
|
|
132444
132430
|
.regex(/^[a-zA-Z0-9_-]+$/, 'can only contain letters, numbers, and hyphens'),
|
|
132445
|
-
expiration_date: z$
|
|
132431
|
+
expiration_date: z$2.date().nullable(),
|
|
132446
132432
|
});
|
|
132447
132433
|
const createApiFormDefaultValues$1 = {
|
|
132448
132434
|
name: '',
|
|
@@ -132514,14 +132500,14 @@ function CreateApiModal$1({ isOpen, onClose, tenantKey, username }) {
|
|
|
132514
132500
|
// Dynamic schema based on selected provider
|
|
132515
132501
|
const createDynamicSchema$1 = (schemaFields) => {
|
|
132516
132502
|
const schemaObj = {
|
|
132517
|
-
provider: z$
|
|
132503
|
+
provider: z$2.string().min(1, 'Provider is required'),
|
|
132518
132504
|
};
|
|
132519
132505
|
schemaFields.forEach((field) => {
|
|
132520
|
-
schemaObj[field] = z$
|
|
132506
|
+
schemaObj[field] = z$2
|
|
132521
132507
|
.string()
|
|
132522
132508
|
.min(1, `${field.replace(/_/g, ' ').replace(/\b\w/g, (l) => l.toUpperCase())} is required`);
|
|
132523
132509
|
});
|
|
132524
|
-
return z$
|
|
132510
|
+
return z$2.object(schemaObj);
|
|
132525
132511
|
};
|
|
132526
132512
|
const createExternalProviderFormDefaultValues = {
|
|
132527
132513
|
provider: '',
|
|
@@ -132839,14 +132825,14 @@ function IntegrationLLMsTab({ tenantKey }) {
|
|
|
132839
132825
|
// Dynamic schema based on selected provider
|
|
132840
132826
|
const createDynamicSchema = (schemaFields) => {
|
|
132841
132827
|
const schemaObj = {
|
|
132842
|
-
provider: z$
|
|
132828
|
+
provider: z$2.string().min(1, 'Provider is required'),
|
|
132843
132829
|
};
|
|
132844
132830
|
schemaFields.forEach((field) => {
|
|
132845
|
-
schemaObj[field.name] = z$
|
|
132831
|
+
schemaObj[field.name] = z$2
|
|
132846
132832
|
.string()
|
|
132847
132833
|
.min(1, `${field.name.replace(/_/g, ' ').replace(/\b\w/g, (l) => l.toUpperCase())} is required`);
|
|
132848
132834
|
});
|
|
132849
|
-
return z$
|
|
132835
|
+
return z$2.object(schemaObj);
|
|
132850
132836
|
};
|
|
132851
132837
|
const createDataSourceFormDefaultValues = {
|
|
132852
132838
|
provider: '',
|
|
@@ -133745,17 +133731,17 @@ const StudentMentorCreationContent = ({ platformKey, }) => {
|
|
|
133745
133731
|
dispatch(coreApiSlice.util.updateQueryData('getStudentMentorCreationStatus', { platformKey }, (draft) => {
|
|
133746
133732
|
draft.allow_students_to_create_mentors = checked;
|
|
133747
133733
|
}));
|
|
133748
|
-
toast.success('User
|
|
133734
|
+
toast.success('User agent creation setting updated successfully');
|
|
133749
133735
|
}
|
|
133750
133736
|
catch (error) {
|
|
133751
133737
|
console.error(JSON.stringify(error));
|
|
133752
|
-
toast.error('Failed to update user
|
|
133738
|
+
toast.error('Failed to update user agent creation setting');
|
|
133753
133739
|
}
|
|
133754
133740
|
};
|
|
133755
133741
|
if (isLoadingStudentMentorCreationStatus) {
|
|
133756
133742
|
return (jsx("div", { className: "rounded-lg border px-6 py-6", style: { borderColor: 'oklch(.922 0 0)' }, children: jsx("div", { className: "animate-pulse", children: jsxs("div", { className: "flex items-center justify-between", children: [jsx("div", { className: "h-4 bg-gray-200 rounded w-1/3" }), jsx("div", { className: "h-6 w-11 bg-gray-200 rounded" })] }) }) }));
|
|
133757
133743
|
}
|
|
133758
|
-
return (jsxs("div", { className: "flex items-center justify-between rounded-lg border px-6 py-6", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: "User
|
|
133744
|
+
return (jsxs("div", { className: "flex items-center justify-between rounded-lg border px-6 py-6", style: { borderColor: 'oklch(.922 0 0)' }, children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: "User Agent Creation" }), jsx(TooltipProvider, { children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { "aria-label": "More info about public registration", className: "hidden sm:block", children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "rounded-lg bg-gray-700 px-3 py-2 text-sm font-medium whitespace-nowrap text-white shadow-sm transition-opacity duration-300 z-50", children: jsx("p", { children: "Allow users to create agents in the agent platform" }) })] }) })] }), jsxs("div", { className: "flex items-center gap-2", children: [jsx(Switch, { checked: studentMentorCreationStatus === null || studentMentorCreationStatus === void 0 ? void 0 : studentMentorCreationStatus.allow_students_to_create_mentors, onCheckedChange: handleToggleStudentMentorCreation, disabled: isUpdatingStudentMentorCreationStatus, "aria-label": `User agent creation ${(studentMentorCreationStatus === null || studentMentorCreationStatus === void 0 ? void 0 : studentMentorCreationStatus.allow_students_to_create_mentors) ? 'enabled' : 'disabled'}`, className: "cursor-pointer data-[state=checked]:bg-blue-500" }), isUpdatingStudentMentorCreationStatus && (jsx("div", { className: "w-4 h-4 border-2 border-blue-500 border-t-transparent rounded-full animate-spin" }))] })] }));
|
|
133759
133745
|
};
|
|
133760
133746
|
|
|
133761
133747
|
const RecommendationSystemPromptsContent = ({ platformKey, currentSPA, }) => {
|
|
@@ -133901,11 +133887,11 @@ const RecommendationSystemPromptsContent = ({ platformKey, currentSPA, }) => {
|
|
|
133901
133887
|
.sort((a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime())
|
|
133902
133888
|
.map((prompt, index) => (jsx("div", { className: `py-4 ${index !== promptsList.length - 1 ? 'border-b border-gray-200' : ''}`, children: jsxs("div", { className: "flex items-start justify-between gap-4", children: [jsxs("div", { className: "flex-1 min-w-0", children: [jsxs("div", { className: "flex items-center gap-2 mb-2", children: [jsxs("h4", { className: "text-sm font-medium text-[#646464]", children: [prompt.recommendation_type === recommendationPromptTypeEnum.catalog
|
|
133903
133889
|
? 'Catalog'
|
|
133904
|
-
: '
|
|
133890
|
+
: 'Agent', ' ', "Prompt"] }), prompt.id === null ? (jsx("span", { className: "px-2 py-0.5 text-xs rounded bg-gray-100 text-gray-600", children: "Default" })) : (jsx("span", { className: `px-2 py-0.5 text-xs rounded ${prompt.active
|
|
133905
133891
|
? 'bg-blue-100 text-blue-800'
|
|
133906
133892
|
: 'bg-gray-100 text-gray-600'}`, children: prompt.active ? 'Active' : 'Inactive' }))] }), jsx("p", { className: "text-sm text-gray-700 line-clamp-2", children: prompt.prompt_text })] }), jsxs("div", { className: "flex items-center gap-2 flex-shrink-0", children: [jsx(Button$1, { variant: "ghost", size: "sm", onClick: () => handleOpenDialog(prompt), disabled: prompt.id && deletingPromptId === prompt.id, "aria-label": prompt.id === null ? 'Create custom prompt from default' : 'Edit prompt', children: jsx(Pen, { className: "h-4 w-4", "aria-hidden": "true" }) }), prompt.id !== null && (jsx(Button$1, { variant: "ghost", size: "sm", onClick: () => handleDelete(prompt.id), className: "text-red-600 hover:text-red-700", disabled: deletingPromptId === prompt.id, "aria-label": "Delete prompt", children: deletingPromptId === prompt.id ? (jsx(LoaderCircle, { className: "h-4 w-4 animate-spin", "aria-hidden": "true" })) : (jsx(Trash2, { className: "h-4 w-4", "aria-hidden": "true" })) }))] })] }) }, prompt.id === null ? 'default-prompt' : prompt.id))) })) })), jsx(Dialog, { open: isDialogOpen, onOpenChange: setIsDialogOpen, children: jsxs(DialogContent, { className: "sm:max-w-[600px]", children: [jsxs(DialogHeader, { children: [jsx(DialogTitle, { children: editingPrompt ? 'Edit Prompt' : 'Add New Prompt' }), jsx(DialogDescription, { children: editingPrompt
|
|
133907
133893
|
? 'Update the recommendation system prompt details.'
|
|
133908
|
-
: `Create a new ${recommendationType === recommendationPromptTypeEnum.catalog ? 'catalog' : '
|
|
133894
|
+
: `Create a new ${recommendationType === recommendationPromptTypeEnum.catalog ? 'catalog' : 'agents'} recommendation prompt.` })] }), jsx("div", { className: "space-y-4", children: jsxs("div", { children: [jsx("label", { className: "text-sm font-medium text-gray-700 mb-1 block", children: "Prompt Text *" }), jsx(Textarea, { value: formData.prompt_text, onChange: (e) => handleInputChange('prompt_text', e.target.value), placeholder: "Enter the prompt text that will guide users to relevant recommendations", className: "w-full min-h-[120px]", rows: 8 })] }) }), jsxs("div", { className: "flex justify-end gap-2 mt-4", children: [jsx(Button$1, { type: "button", variant: "outline", onClick: handleCloseDialog, disabled: isSubmitting, children: "Cancel" }), jsxs(Button$1, { className: "bg-gradient-to-r from-blue-500 to-blue-600 text-white hover:opacity-90", type: "button", onClick: handleSubmit, disabled: isSubmitting || !formData.prompt_text.trim(), children: [isSubmitting && jsx(LoaderCircle, { className: "h-4 w-4 animate-spin mr-2" }), editingPrompt ? 'Update' : 'Save'] })] })] }) })] }));
|
|
133909
133895
|
};
|
|
133910
133896
|
|
|
133911
133897
|
const getMetadataKey = (spa) => {
|
|
@@ -135184,7 +135170,7 @@ function AdvancedTab({ platformKey, username, currentSPA, authURL, currentPlatfo
|
|
|
135184
135170
|
};
|
|
135185
135171
|
// Set mentor to null and disable sidebar display
|
|
135186
135172
|
await updateMultipleOrganizationMetadata(updatedMetadata, () => {
|
|
135187
|
-
toast.success('
|
|
135173
|
+
toast.success('Agent setting updated successfully');
|
|
135188
135174
|
});
|
|
135189
135175
|
return;
|
|
135190
135176
|
}
|
|
@@ -135202,7 +135188,7 @@ function AdvancedTab({ platformKey, username, currentSPA, authURL, currentPlatfo
|
|
|
135202
135188
|
enable_sidebar_ai_mentor_display: true,
|
|
135203
135189
|
};
|
|
135204
135190
|
await updateMultipleOrganizationMetadata(updatedMetadata, () => {
|
|
135205
|
-
toast.success('
|
|
135191
|
+
toast.success('Agent setting updated successfully');
|
|
135206
135192
|
});
|
|
135207
135193
|
};
|
|
135208
135194
|
const handleMentorSearch = (query) => {
|
|
@@ -135256,7 +135242,7 @@ function AdvancedTab({ platformKey, username, currentSPA, authURL, currentPlatfo
|
|
|
135256
135242
|
: ((_a = metadataItem.value) !== null && _a !== void 0 ? _a : metadataItem.defaultValue);
|
|
135257
135243
|
const isMentorSetting = metadataItem.slug === 'overall_default_mentor';
|
|
135258
135244
|
const isStringSetting = typeof metadataItem.defaultValue === 'string' && !isMentorSetting;
|
|
135259
|
-
return (jsxs("div", { className: `flex items-center justify-between rounded-lg border px-6 ${isMentorSetting || isStringSetting ? 'py-4' : 'py-6'}`, style: { borderColor: 'oklch(.922 0 0)' }, children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: metadataItem.label }), jsx(TooltipProvider, { children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { "aria-label": `More info about ${metadataItem.label}`, className: "hidden sm:block", children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "rounded-lg bg-gray-700 px-3 py-2 text-sm font-medium whitespace-nowrap text-white shadow-sm transition-opacity duration-300 z-50", children: jsx("p", { children: metadataItem.description || 'No description available' }) })] }) })] }), jsx("div", { className: "flex items-center gap-2", children: isMentorSetting ? (jsxs("div", { className: "flex items-center gap-2", children: [jsxs(Select$1, { value: currentValue || '', onValueChange: (value) => handleMentorSelection(metadataItem.slug, value), disabled: isUpdatingTenantMetadata, children: [jsx(SelectTrigger, { className: "max-w-[240px] w-[110px] sm:w-[230px] font-medium text-[#646464]", children: jsx(SelectValue, { placeholder: "Select
|
|
135245
|
+
return (jsxs("div", { className: `flex items-center justify-between rounded-lg border px-6 ${isMentorSetting || isStringSetting ? 'py-4' : 'py-6'}`, style: { borderColor: 'oklch(.922 0 0)' }, children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: metadataItem.label }), jsx(TooltipProvider, { children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { "aria-label": `More info about ${metadataItem.label}`, className: "hidden sm:block", children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "rounded-lg bg-gray-700 px-3 py-2 text-sm font-medium whitespace-nowrap text-white shadow-sm transition-opacity duration-300 z-50", children: jsx("p", { children: metadataItem.description || 'No description available' }) })] }) })] }), jsx("div", { className: "flex items-center gap-2", children: isMentorSetting ? (jsxs("div", { className: "flex items-center gap-2", children: [jsxs(Select$1, { value: currentValue || '', onValueChange: (value) => handleMentorSelection(metadataItem.slug, value), disabled: isUpdatingTenantMetadata, children: [jsx(SelectTrigger, { className: "max-w-[240px] w-[110px] sm:w-[230px] font-medium text-[#646464]", children: jsx(SelectValue, { placeholder: "Select agent", children: currentValue ? getMentorName(currentValue) : '' }) }), jsxs(SelectContent, { className: "font-medium text-[#646464]", children: [jsx("div", { className: "p-2", children: jsx(Input, { placeholder: "Search agents...", value: mentorSearchQuery, onChange: (e) => handleMentorSearch(e.target.value), className: "mb-2 font-medium text-[#646464]" }) }), jsx(SelectItem, { value: "none", children: "None" }), isMentorsLoading ? (jsx(SelectItem, { "aria-label": "Loading agents...", value: "loading", disabled: true, children: "Loading agents..." })) : ((_b = mentorsData === null || mentorsData === void 0 ? void 0 : mentorsData.results) === null || _b === void 0 ? void 0 : _b.length) ? (mentorsData.results.map((mentor) => (jsx(SelectItem, { value: mentor.unique_id, children: mentor.name }, mentor.unique_id)))) : (jsx(SelectItem, { value: "no-results", disabled: true, children: "No agents found" }))] })] }), isUpdatingTenantMetadata && (jsx("div", { "aria-label": "Updating agent selection...", role: "status", className: "w-4 h-4 border-2 border-blue-500 border-t-transparent rounded-full animate-spin" }))] })) : isStringSetting ? (jsx(StringSettingInput, { value: currentValue, defaultValue: metadataItem.defaultValue, disabled: isUpdatingTenantMetadata, onSave: (value) => handleStringSettingUpdate(metadataItem.slug, value) })) : (jsxs(Fragment$1, { children: [jsx(Switch, { checked: currentValue, onCheckedChange: async () => {
|
|
135260
135246
|
await handleToggleSetting(metadataItem.slug, currentValue);
|
|
135261
135247
|
}, disabled: isUpdatingTenantMetadata, "aria-label": `${metadataItem.label} ${currentValue ? 'enabled' : 'disabled'}`, className: "cursor-pointer data-[state=checked]:bg-blue-500" }), isUpdatingTenantMetadata && (jsx("div", { className: "w-4 h-4 border-2 border-blue-500 border-t-transparent rounded-full animate-spin" }))] })) })] }, metadataItem.slug));
|
|
135262
135248
|
}) })) : (
|
|
@@ -135275,7 +135261,7 @@ function AdvancedTab({ platformKey, username, currentSPA, authURL, currentPlatfo
|
|
|
135275
135261
|
const currentValue = (_a = metadataItem.value) !== null && _a !== void 0 ? _a : metadataItem.defaultValue;
|
|
135276
135262
|
const isMentorSetting = metadataItem.slug === 'overall_default_mentor';
|
|
135277
135263
|
const isStringSetting = typeof metadataItem.defaultValue === 'string' && !isMentorSetting;
|
|
135278
|
-
return (jsxs("div", { className: `flex items-center justify-between rounded-lg border px-6 ${isMentorSetting || isStringSetting ? 'py-4' : 'py-6'}`, style: { borderColor: 'oklch(.922 0 0)' }, children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: metadataItem.label }), jsx(TooltipProvider, { children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { "aria-label": `More info about ${metadataItem.label}`, className: "hidden sm:block", children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "ibl-tooltip-content", children: jsx("p", { children: metadataItem.description || 'No description available' }) })] }) })] }), jsx("div", { className: "flex items-center gap-2", children: isMentorSetting ? (jsxs("div", { className: "flex items-center gap-2", children: [jsxs(Select$1, { value: currentValue || '', onValueChange: (value) => handleMentorSelection(metadataItem.slug, value), disabled: isUpdatingTenantMetadata, children: [jsx(SelectTrigger, { className: "max-w-[240px] w-[230px] sm:w-[150px] font-medium text-[#646464]", children: jsx(SelectValue, { placeholder: "Select
|
|
135264
|
+
return (jsxs("div", { className: `flex items-center justify-between rounded-lg border px-6 ${isMentorSetting || isStringSetting ? 'py-4' : 'py-6'}`, style: { borderColor: 'oklch(.922 0 0)' }, children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: metadataItem.label }), jsx(TooltipProvider, { children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { "aria-label": `More info about ${metadataItem.label}`, className: "hidden sm:block", children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "ibl-tooltip-content", children: jsx("p", { children: metadataItem.description || 'No description available' }) })] }) })] }), jsx("div", { className: "flex items-center gap-2", children: isMentorSetting ? (jsxs("div", { className: "flex items-center gap-2", children: [jsxs(Select$1, { value: currentValue || '', onValueChange: (value) => handleMentorSelection(metadataItem.slug, value), disabled: isUpdatingTenantMetadata, children: [jsx(SelectTrigger, { className: "max-w-[240px] w-[230px] sm:w-[150px] font-medium text-[#646464]", children: jsx(SelectValue, { placeholder: "Select agent", children: currentValue ? getMentorName(currentValue) : '' }) }), jsxs(SelectContent, { className: "font-medium text-[#646464]", children: [jsx("div", { className: "p-2", children: jsx(Input, { placeholder: "Search agents...", value: mentorSearchQuery, onChange: (e) => handleMentorSearch(e.target.value), className: "mb-2 font-medium text-[#646464]" }) }), jsx(SelectItem, { value: "none", children: "None" }), isMentorsLoading ? (jsx(SelectItem, { value: "loading", disabled: true, children: "Loading agents..." })) : ((_b = mentorsData === null || mentorsData === void 0 ? void 0 : mentorsData.results) === null || _b === void 0 ? void 0 : _b.length) ? (mentorsData.results.map((mentor) => (jsx(SelectItem, { value: mentor.unique_id, children: mentor.name }, mentor.unique_id)))) : (jsx(SelectItem, { value: "no-results", disabled: true, children: "No agents found" }))] })] }), isUpdatingTenantMetadata && (jsx("div", { className: "w-4 h-4 border-2 border-blue-500 border-t-transparent rounded-full animate-spin" }))] })) : isStringSetting ? (jsx(StringSettingInput, { value: currentValue, defaultValue: metadataItem.defaultValue, disabled: isUpdatingTenantMetadata, onSave: (value) => handleStringSettingUpdate(metadataItem.slug, value) })) : (jsxs(Fragment$1, { children: [jsx(Switch, { checked: currentValue, onCheckedChange: async () => {
|
|
135279
135265
|
await handleToggleSetting(metadataItem.slug, currentValue);
|
|
135280
135266
|
}, disabled: isUpdatingTenantMetadata, "aria-label": `${metadataItem.label} ${currentValue ? 'enabled' : 'disabled'}`, className: "cursor-pointer data-[state=checked]:bg-blue-500" }), isUpdatingTenantMetadata && (jsx("div", { className: "w-4 h-4 border-2 border-blue-500 border-t-transparent rounded-full animate-spin" }))] })) })] }, metadataItem.slug));
|
|
135281
135267
|
}) })] }, spa)));
|
|
@@ -204639,7 +204625,7 @@ const AGENT_DATASETS_TAB_LABELS = {
|
|
|
204639
204625
|
},
|
|
204640
204626
|
trainOrDeleteModal: {
|
|
204641
204627
|
title: 'What would you like to do?',
|
|
204642
|
-
description: "This dataset is currently untrained. You can train it to make it available for your
|
|
204628
|
+
description: "This dataset is currently untrained. You can train it to make it available for your agent, or permanently delete it if it's no longer needed.",
|
|
204643
204629
|
delete: 'Delete',
|
|
204644
204630
|
train: 'Train',
|
|
204645
204631
|
training: 'Training...',
|
|
@@ -204883,7 +204869,7 @@ function GithubFileUploadModal() {
|
|
|
204883
204869
|
const handleSubmit = async () => {
|
|
204884
204870
|
try {
|
|
204885
204871
|
if (!mentorId) {
|
|
204886
|
-
toast.error('
|
|
204872
|
+
toast.error('Agent not found');
|
|
204887
204873
|
return;
|
|
204888
204874
|
}
|
|
204889
204875
|
await addTrainingDocument({
|
|
@@ -206236,7 +206222,7 @@ function OrganizationTab({ platformKey, setOrganizationLogoFromOutside, tenant,
|
|
|
206236
206222
|
}
|
|
206237
206223
|
}, children: [organizationLogo ? (jsxs("div", { className: "relative h-full w-full", children: [jsx(Image$4, { src: typeof organizationLogo === 'string'
|
|
206238
206224
|
? organizationLogo
|
|
206239
|
-
: URL.createObjectURL(organizationLogo), alt: "
|
|
206225
|
+
: URL.createObjectURL(organizationLogo), alt: "Agent", className: "h-full w-full rounded-lg object-contain", height: 200, width: 200, onClick: (event) => {
|
|
206240
206226
|
event.stopPropagation();
|
|
206241
206227
|
}, onError: (event) => {
|
|
206242
206228
|
event.stopPropagation();
|
|
@@ -206262,7 +206248,7 @@ function OrganizationTab({ platformKey, setOrganizationLogoFromOutside, tenant,
|
|
|
206262
206248
|
}
|
|
206263
206249
|
}, children: [organizationDarkLogo ? (jsxs("div", { className: "relative h-full w-full", children: [jsx(Image$4, { src: typeof organizationDarkLogo === 'string'
|
|
206264
206250
|
? organizationDarkLogo
|
|
206265
|
-
: URL.createObjectURL(organizationDarkLogo), alt: "
|
|
206251
|
+
: URL.createObjectURL(organizationDarkLogo), alt: "Agent", className: "h-full w-full rounded-lg object-contain", height: 200, width: 200, onClick: (event) => {
|
|
206266
206252
|
event.stopPropagation();
|
|
206267
206253
|
}, onError: (event) => {
|
|
206268
206254
|
event.stopPropagation();
|
|
@@ -209035,7 +209021,7 @@ const dynamicIconImports = {
|
|
|
209035
209021
|
"worm": () => Promise.resolve().then(function () { return worm; }),
|
|
209036
209022
|
"wrap-text": () => Promise.resolve().then(function () { return wrapText; }),
|
|
209037
209023
|
"wrench": () => Promise.resolve().then(function () { return wrench; }),
|
|
209038
|
-
"x": () => Promise.resolve().then(function () { return x$
|
|
209024
|
+
"x": () => Promise.resolve().then(function () { return x$2; }),
|
|
209039
209025
|
"youtube": () => Promise.resolve().then(function () { return youtube; }),
|
|
209040
209026
|
"zap-off": () => Promise.resolve().then(function () { return zapOff; }),
|
|
209041
209027
|
"zap": () => Promise.resolve().then(function () { return zap; }),
|
|
@@ -209400,7 +209386,7 @@ function AppSidebar({ logo, contentItems, footerItems, showProjects = false, sho
|
|
|
209400
209386
|
}
|
|
209401
209387
|
|
|
209402
209388
|
function NavBar({ username, isAuthenticated = false, onNewChat, onSettings, onLogout, onLogin, mentorName, showMentorDropdown = false, additionalMenuItems = [], }) {
|
|
209403
|
-
return (jsxs("header", { className: "flex h-20 shrink-0 items-center gap-2 bg-white px-4 border-b border-[#D0E0FF]", children: [jsx(SidebarTrigger, { className: "-ml-1" }), mentorName && !showMentorDropdown && (jsx("div", { className: "flex items-center gap-2 ml-4", children: jsx("h1", { className: "text-lg font-semibold text-gray-900", children: mentorName }) })), mentorName && showMentorDropdown && (jsxs(DropdownMenu, { children: [jsx(DropdownMenuTrigger, { asChild: true, children: jsxs(Button$1, { variant: "ghost", className: "gap-2 text-gray-900 hover:bg-gray-100 ml-4", children: [jsx("span", { className: "font-semibold", children: mentorName }), jsx(ChevronDown, { className: "h-4 w-4" })] }) }), jsxs(DropdownMenuContent, { align: "start", className: "w-[200px]", children: [jsx(DropdownMenuItem, { children: "Switch
|
|
209389
|
+
return (jsxs("header", { className: "flex h-20 shrink-0 items-center gap-2 bg-white px-4 border-b border-[#D0E0FF]", children: [jsx(SidebarTrigger, { className: "-ml-1" }), mentorName && !showMentorDropdown && (jsx("div", { className: "flex items-center gap-2 ml-4", children: jsx("h1", { className: "text-lg font-semibold text-gray-900", children: mentorName }) })), mentorName && showMentorDropdown && (jsxs(DropdownMenu, { children: [jsx(DropdownMenuTrigger, { asChild: true, children: jsxs(Button$1, { variant: "ghost", className: "gap-2 text-gray-900 hover:bg-gray-100 ml-4", children: [jsx("span", { className: "font-semibold", children: mentorName }), jsx(ChevronDown, { className: "h-4 w-4" })] }) }), jsxs(DropdownMenuContent, { align: "start", className: "w-[200px]", children: [jsx(DropdownMenuItem, { children: "Switch Agent" }), jsx(DropdownMenuItem, { children: "Explore Agents" })] })] })), jsxs("div", { className: "flex items-center gap-2 ml-auto", children: [onNewChat && (jsxs(Button$1, { variant: "ghost", size: "sm", onClick: onNewChat, className: "gap-2 text-[#646464] hover:text-[#484848] hover:bg-transparent", children: [jsx(MessageSquare, { className: "h-4 w-4" }), jsx("span", { className: "hidden sm:inline", children: "New Chat" })] })), isAuthenticated ? (jsxs(DropdownMenu, { children: [jsx(DropdownMenuTrigger, { asChild: true, children: jsxs(Button$1, { variant: "ghost", size: "sm", className: "gap-2 text-[#646464] hover:text-[#484848] hover:bg-transparent", children: [jsxs(Avatar, { className: "h-6 w-6", children: [jsx(AvatarImage, { src: `https://api.dicebear.com/7.x/initials/svg?seed=${username}` }), jsx(AvatarFallback, { children: username === null || username === void 0 ? void 0 : username.charAt(0).toUpperCase() })] }), jsx("span", { className: "hidden sm:inline", children: username })] }) }), jsxs(DropdownMenuContent, { align: "end", className: "w-[180px] rounded-md border border-gray-200 bg-white p-2 shadow-lg", children: [additionalMenuItems.map((item, index) => (jsxs(React__default.Fragment, { children: [item.separator && jsx(DropdownMenuSeparator, {}), jsxs(DropdownMenuItem, { onClick: item.onClick, className: "flex cursor-pointer items-center rounded-md px-3 py-2 text-sm text-gray-700 hover:bg-gray-100", children: [jsx(item.icon, { className: "mr-3 h-4 w-4 text-gray-600" }), item.label] })] }, item.label))), onSettings && (jsxs(DropdownMenuItem, { onClick: onSettings, className: "flex cursor-pointer items-center rounded-md px-3 py-2 text-sm text-gray-700 hover:bg-gray-100", children: [jsx(Settings$1, { className: "mr-3 h-4 w-4 text-gray-600" }), "Settings"] })), onLogout && (jsxs(Fragment$1, { children: [jsx(DropdownMenuSeparator, {}), jsxs(DropdownMenuItem, { onClick: onLogout, className: "flex cursor-pointer items-center rounded-md px-3 py-2 text-sm text-gray-700 hover:bg-gray-100", children: [jsx(LogOut, { className: "mr-3 h-4 w-4 text-gray-600" }), "Logout"] })] }))] })] })) : (onLogin && (jsxs(Button$1, { onClick: onLogin, size: "sm", className: "gap-2", children: [jsx(LogIn, { className: "h-4 w-4" }), "Login"] })))] })] }));
|
|
209404
209390
|
}
|
|
209405
209391
|
|
|
209406
209392
|
function useTimeTracker(config) {
|
|
@@ -212137,7 +212123,7 @@ function ConnectorDialogs({ open, onClose, onAddConnector, editingServer, editin
|
|
|
212137
212123
|
resetForm();
|
|
212138
212124
|
onClose();
|
|
212139
212125
|
}, [isSubmitting, resetForm, onClose]);
|
|
212140
|
-
return (jsx(Dialog, { open: open, onOpenChange: handleClose, children: jsxs(DialogContent, { className: "bg-card flex max-h-[90vh] flex-col overflow-hidden p-0 sm:max-w-[600px]", onClick: (e) => e.stopPropagation(), onMouseDown: (e) => e.stopPropagation(), children: [jsx(DialogHeader, { className: "border-border flex-shrink-0 border-b px-6 py-4", children: jsx(DialogTitle, { className: "text-foreground text-xl font-semibold", children: editingServer ? 'Edit MCP Connector' : 'Add MCP Connector' }) }), jsx("div", { className: "flex-1 overflow-y-auto p-6", children: jsxs("div", { className: "mx-auto max-w-2xl space-y-4", children: [jsxs("div", { className: "flex items-center gap-4", children: [jsxs("div", { className: "group relative", children: [jsx("input", { ref: fileInputRef, type: "file", accept: "image/*", onChange: handleImageUpload, className: "hidden", "aria-label": "Upload connector image" }), jsx("div", { onClick: () => { var _a; return (_a = fileInputRef.current) === null || _a === void 0 ? void 0 : _a.click(); }, className: "group relative flex h-16 w-16 cursor-pointer items-center justify-center overflow-hidden rounded-lg transition-colors", children: connectorImage ? (jsxs(Fragment$1, { children: [jsx("img", { src: connectorImage, alt: "Connector thumbnail", className: "h-full w-full object-cover" }), jsx("div", { className: "absolute right-1 bottom-1 flex h-6 w-6 items-center justify-center rounded-full bg-[#38A1E5] opacity-0 transition-opacity group-hover:opacity-100", children: jsx(Image$3, { className: "h-3 w-3 text-white" }) })] })) : (jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-[#38A1E5]", children: jsx(Image$3, { className: "h-6 w-6 text-white" }) })) })] }), jsxs("div", { className: "flex flex-1 flex-col gap-2", children: [jsxs(Label, { className: "text-base font-medium", children: ["Connector Name", jsx("span", { className: "text-red-500", children: "*" })] }), jsx(Input, { value: connectorName, onChange: (e) => setConnectorName(e.target.value), placeholder: "Enter connector name", className: "bg-muted border-border", disabled: isSubmitting })] })] }), jsxs("div", { className: "flex flex-col gap-2", children: [jsxs(Label, { className: "text-base font-medium", children: ["Connector Server", jsx("span", { className: "text-red-500", children: "*" })] }), jsx(Input, { value: connectorServer, onChange: (e) => setConnectorServer(e.target.value), placeholder: "https://api.example.com/mcp", className: `bg-muted border-border ${oauthUrlError ? 'border-red-500' : ''}`, disabled: isSubmitting }), oauthUrlError && jsx("p", { className: "text-xs text-red-500", children: oauthUrlError })] }), jsxs("div", { className: "flex flex-col gap-2", children: [jsxs("div", { className: "flex items-center justify-between", children: [jsx(Label, { className: "text-base font-medium", children: "Description" }), jsx("span", { className: "text-muted-foreground text-sm", children: "Optional" })] }), jsx(Textarea, { value: connectorDescription, onChange: (e) => setConnectorDescription(e.target.value), placeholder: "Describe what this connector does...", className: "bg-muted border-border min-h-[100px]", disabled: isSubmitting })] }), jsxs("div", { className: "flex flex-col gap-2", children: [jsx(Label, { className: "text-base font-medium", children: "Connector Scope" }), jsxs(RadioGroup, { value: connectorScope, onValueChange: (value) => setConnectorScope(value), disabled: isSubmitting, children: [jsxs("div", { className: "flex items-center space-x-2", children: [jsx(RadioGroupItem, { value: "tenant", id: "scope-tenant" }), jsx(Label, { htmlFor: "scope-tenant", className: "cursor-pointer font-normal", children: "All
|
|
212126
|
+
return (jsx(Dialog, { open: open, onOpenChange: handleClose, children: jsxs(DialogContent, { className: "bg-card flex max-h-[90vh] flex-col overflow-hidden p-0 sm:max-w-[600px]", onClick: (e) => e.stopPropagation(), onMouseDown: (e) => e.stopPropagation(), children: [jsx(DialogHeader, { className: "border-border flex-shrink-0 border-b px-6 py-4", children: jsx(DialogTitle, { className: "text-foreground text-xl font-semibold", children: editingServer ? 'Edit MCP Connector' : 'Add MCP Connector' }) }), jsx("div", { className: "flex-1 overflow-y-auto p-6", children: jsxs("div", { className: "mx-auto max-w-2xl space-y-4", children: [jsxs("div", { className: "flex items-center gap-4", children: [jsxs("div", { className: "group relative", children: [jsx("input", { ref: fileInputRef, type: "file", accept: "image/*", onChange: handleImageUpload, className: "hidden", "aria-label": "Upload connector image" }), jsx("div", { onClick: () => { var _a; return (_a = fileInputRef.current) === null || _a === void 0 ? void 0 : _a.click(); }, className: "group relative flex h-16 w-16 cursor-pointer items-center justify-center overflow-hidden rounded-lg transition-colors", children: connectorImage ? (jsxs(Fragment$1, { children: [jsx("img", { src: connectorImage, alt: "Connector thumbnail", className: "h-full w-full object-cover" }), jsx("div", { className: "absolute right-1 bottom-1 flex h-6 w-6 items-center justify-center rounded-full bg-[#38A1E5] opacity-0 transition-opacity group-hover:opacity-100", children: jsx(Image$3, { className: "h-3 w-3 text-white" }) })] })) : (jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-[#38A1E5]", children: jsx(Image$3, { className: "h-6 w-6 text-white" }) })) })] }), jsxs("div", { className: "flex flex-1 flex-col gap-2", children: [jsxs(Label, { className: "text-base font-medium", children: ["Connector Name", jsx("span", { className: "text-red-500", children: "*" })] }), jsx(Input, { value: connectorName, onChange: (e) => setConnectorName(e.target.value), placeholder: "Enter connector name", className: "bg-muted border-border", disabled: isSubmitting })] })] }), jsxs("div", { className: "flex flex-col gap-2", children: [jsxs(Label, { className: "text-base font-medium", children: ["Connector Server", jsx("span", { className: "text-red-500", children: "*" })] }), jsx(Input, { value: connectorServer, onChange: (e) => setConnectorServer(e.target.value), placeholder: "https://api.example.com/mcp", className: `bg-muted border-border ${oauthUrlError ? 'border-red-500' : ''}`, disabled: isSubmitting }), oauthUrlError && jsx("p", { className: "text-xs text-red-500", children: oauthUrlError })] }), jsxs("div", { className: "flex flex-col gap-2", children: [jsxs("div", { className: "flex items-center justify-between", children: [jsx(Label, { className: "text-base font-medium", children: "Description" }), jsx("span", { className: "text-muted-foreground text-sm", children: "Optional" })] }), jsx(Textarea, { value: connectorDescription, onChange: (e) => setConnectorDescription(e.target.value), placeholder: "Describe what this connector does...", className: "bg-muted border-border min-h-[100px]", disabled: isSubmitting })] }), jsxs("div", { className: "flex flex-col gap-2", children: [jsx(Label, { className: "text-base font-medium", children: "Connector Scope" }), jsxs(RadioGroup, { value: connectorScope, onValueChange: (value) => setConnectorScope(value), disabled: isSubmitting, children: [jsxs("div", { className: "flex items-center space-x-2", children: [jsx(RadioGroupItem, { value: "tenant", id: "scope-tenant" }), jsx(Label, { htmlFor: "scope-tenant", className: "cursor-pointer font-normal", children: "All Agents" })] }), jsxs("div", { className: "flex items-center space-x-2", children: [jsx(RadioGroupItem, { value: "this-mentor", id: "scope-this-mentor" }), jsx(Label, { htmlFor: "scope-this-mentor", className: "cursor-pointer font-normal", children: "This Agent" })] })] }), connectorScope === 'tenant' && (jsx("p", { className: "text-muted-foreground text-xs", children: "This MCP will be available for all agents." })), connectorScope === 'this-mentor' && (jsx("p", { className: "text-muted-foreground text-xs", children: "This MCP will only be available for this agent." }))] }), jsxs("div", { className: "flex flex-col gap-2", children: [jsx(Label, { className: "text-base font-medium", children: "Transport" }), jsxs(Select$1, { value: transport, onValueChange: (value) => setTransport(normalizeTransportValue$1(value)), disabled: isSubmitting, children: [jsx(SelectTrigger, { className: "bg-muted border-border", children: jsx(SelectValue, {}) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: TransportEnum.SSE, children: "SSE" }), jsx(SelectItem, { value: TransportEnum.WEBSOCKET, children: "Websocket" }), jsx(SelectItem, { value: TransportEnum.STREAMABLE_HTTP, children: "Streamable Http" })] })] })] }), jsxs("div", { className: "flex flex-col gap-2", children: [jsx(Label, { className: "text-base font-medium", children: "Authentication Method" }), jsxs(Select$1, { value: authMethod, onValueChange: setAuthMethod, disabled: isSubmitting, children: [jsx(SelectTrigger, { className: "bg-muted border-border", children: jsx(SelectValue, {}) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "no-auth", children: "No Authentication" }), jsx(SelectItem, { value: "api-key", children: "API Key" }), jsx(SelectItem, { value: "oauth", children: "OAuth" })] })] })] }), authMethod === 'oauth' && (jsxs("div", { className: "flex flex-col gap-2", children: [jsx(Label, { className: "text-base font-medium", children: "Authentication Scope" }), jsxs(Select$1, { value: authScope, onValueChange: setAuthScope, disabled: isSubmitting, children: [jsx(SelectTrigger, { className: "bg-muted border-border", children: jsx(SelectValue, {}) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: AUTH_SCOPE.TENANT, children: "Tenant" }), jsx(SelectItem, { value: AUTH_SCOPE.MENTOR, children: "Agent" }), jsx(SelectItem, { value: AUTH_SCOPE.USER, children: "User" })] })] }), authScope === AUTH_SCOPE.TENANT && (jsx("p", { className: "text-muted-foreground text-xs", children: "OAuth connection will be available for all agents in this tenant." })), authScope === AUTH_SCOPE.MENTOR && (jsx("div", { className: "flex items-center gap-1.5", children: jsx("p", { className: "text-muted-foreground text-xs", children: "OAuth connection will only be available for this agent." }) })), authScope === AUTH_SCOPE.USER && (jsx("p", { className: "text-muted-foreground text-xs", children: "Each user will need to authenticate individually when chatting." }))] })), authMethod === 'api-key' && (jsxs("div", { className: "space-y-4 pt-2", children: [jsxs("div", { className: "flex flex-col gap-2", children: [jsx(Label, { className: "text-base font-medium", children: "Token Type" }), jsxs(Select$1, { value: tokenType, onValueChange: setTokenType, disabled: isSubmitting, children: [jsx(SelectTrigger, { className: "bg-background border-border", children: jsx(SelectValue, {}) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "Bearer", children: "Bearer" }), jsx(SelectItem, { value: "Basic", children: "Basic" }), jsx(SelectItem, { value: "API-Key", children: "API-Key" }), jsx(SelectItem, { value: "API-Token", children: "API-Token" }), jsx(SelectItem, { value: "Token", children: "Token" }), jsx(SelectItem, { value: "Other", children: "Other" })] })] })] }), tokenType === 'Other' && (jsxs("div", { className: "flex flex-col gap-2", children: [jsx(Label, { className: "text-base font-medium", children: "Custom Token Type" }), jsx(Input, { value: customTokenType, onChange: (e) => setCustomTokenType(e.target.value), placeholder: "e.g. X-Custom-Auth", className: "bg-background border-border", disabled: isSubmitting, maxLength: 50 }), jsx("p", { className: "text-muted-foreground text-xs", children: "Alphanumeric characters and hyphens only. Max 50 characters." })] })), jsxs("div", { className: "flex flex-col gap-2", children: [jsx(Label, { className: "text-base font-medium", children: "Token" }), jsxs("div", { className: "relative", children: [jsx(Lock, { className: "text-muted-foreground absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2" }), jsx(Input, { value: tokenValue, onChange: (e) => setTokenValue(e.target.value), placeholder: "Enter your token", type: "password", className: "bg-background border-border pl-10", disabled: isSubmitting })] }), credentialsMasked && (jsx("p", { className: "text-muted-foreground text-xs", children: "Existing token is hidden. Enter a new token to replace it, or leave as is to keep the current token." }))] })] })), jsx("div", { className: "flex justify-end", children: jsx(Button$1, { onClick: handleSubmit, disabled: !connectorName.trim() ||
|
|
212141
212127
|
!connectorServer.trim() ||
|
|
212142
212128
|
isSubmitting ||
|
|
212143
212129
|
(authMethod === 'oauth' && !!oauthUrlError) ||
|
|
@@ -213106,7 +213092,7 @@ function ConnectorManagementContent({ tenantKey, username, mentorId, rbacPermiss
|
|
|
213106
213092
|
return (jsxs("div", { className: "flex flex-col overflow-hidden rounded-lg border border-gray-200 bg-gray-50", children: [jsxs("div", { className: "flex items-center justify-between gap-2 border-b border-gray-200 p-4", children: [jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [jsx("div", { className: "flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-lg border border-gray-100 bg-white", children: (oauthData === null || oauthData === void 0 ? void 0 : oauthData.image) || server.image ? (jsx("img", { src: (oauthData === null || oauthData === void 0 ? void 0 : oauthData.image) || server.image, alt: displayName, className: "h-6 w-6 object-contain" })) : (jsx(Plug, { className: "h-5 w-5 text-gray-400" })) }), jsx("h4", { className: "truncate text-sm font-medium text-gray-900", children: displayName })] }), jsx("div", { className: "flex flex-shrink-0 items-center gap-2", children: needsOAuthConnection ? (jsx("span", { className: "whitespace-nowrap text-xs text-gray-600", children: "Not Connected" })) : (jsx(WithFormPermissions, { name: "mcp_servers", permissions: fieldPermissions !== null && fieldPermissions !== void 0 ? fieldPermissions : {}, children: ({ disabled }) => disabled ? null : (jsxs(Fragment$1, { children: [jsx("span", { className: "whitespace-nowrap text-xs text-gray-600", children: isActive ? 'Active' : 'Inactive' }), jsx(Switch, { checked: isActive, onCheckedChange: (checked) => handleToggleConnector(server.id, displayName, checked), disabled: togglingServerIds.has(server.id), "aria-label": `${displayName} ${isActive ? 'enabled' : 'disabled'}` })] })) })) })] }), jsxs("div", { className: "flex flex-1 flex-col p-4", children: [jsx("div", { className: "mb-3 max-h-20 overflow-y-auto text-sm text-gray-600", children: (oauthData === null || oauthData === void 0 ? void 0 : oauthData.description) || server.description || server.url }), jsxs("div", { className: "mb-3 flex flex-wrap items-center gap-2", children: [isOAuth2 && (jsx("span", { className: "rounded bg-blue-100 px-2 py-1 text-xs text-blue-600", children: "OAuth" })), isOAuth2 && server.auth_scope && (jsx("span", { className: "rounded bg-amber-100 px-2 py-1 text-xs text-amber-700", children: server.auth_scope === 'user'
|
|
213107
213093
|
? 'User'
|
|
213108
213094
|
: server.auth_scope === 'mentor'
|
|
213109
|
-
? '
|
|
213095
|
+
? 'Agent'
|
|
213110
213096
|
: 'Tenant' })), isToken && (jsx("span", { className: "rounded bg-purple-100 px-2 py-1 text-xs text-purple-600", children: "Token" })), isFeatured && (oauthData === null || oauthData === void 0 ? void 0 : oauthData.oauth_provider) && (jsx("span", { className: "rounded bg-gray-100 px-2 py-1 text-xs text-gray-600", children: oauthData.oauth_provider })), !isFeatured && (jsx("span", { className: "rounded bg-gray-100 px-2 py-1 text-xs text-gray-600", children: getTransportLabel(server.transport) }))] }), jsx("div", { className: "mt-auto", children: !isFeatured ? (
|
|
213111
213097
|
// Custom (non-featured) servers: Show Edit/Delete based on object permissions, and Connect/Disconnect if OAuth
|
|
213112
213098
|
jsxs("div", { className: "space-y-2", children: [isOAuth2 && (jsx(Fragment$1, { children: isConnected && connectedServiceId ? (jsx(Button$1, { variant: "outline", size: "sm", className: "h-8 w-full text-red-600 hover:bg-red-50 hover:text-red-700", onClick: () => handleDisconnectOAuth(server), disabled: isDisconnecting, children: isDisconnecting ? (jsxs(Fragment$1, { children: [jsx(Spinner, { className: "mr-2 h-4 w-4" }), "Disconnecting..."] })) : (jsxs(Fragment$1, { children: [jsx(Unlink, { className: "mr-2 h-4 w-4" }), "Disconnect"] })) })) : /* istanbul ignore next -- @preserve JSX branch */ needsOAuthConnection ? (jsx(Button$1, { variant: "outline", size: "sm", className: "h-8 w-full border-[#38A1E5] bg-[#38A1E5] text-white hover:bg-[#2d8bc7] hover:text-white", onClick: () => handleConnectOAuth(server), disabled: isConnecting, children: isConnecting ? (jsxs(Fragment$1, { children: [jsx(Spinner, { className: "mr-2 h-4 w-4" }), "Connecting..."] })) : (jsxs(Fragment$1, { children: [jsx(Link2, { className: "mr-2 h-4 w-4" }), "Connect"] })) })) : null })), jsxs("div", { className: "flex gap-2", children: [jsx(WithFormPermissions, { name: MCP_SERVER_PERMISSION_NAME, permissions: {
|
|
@@ -213142,7 +213128,7 @@ function ConnectorManagementContent({ tenantKey, username, mentorId, rbacPermiss
|
|
|
213142
213128
|
|
|
213143
213129
|
function McpTab({ onSelect } = {}) {
|
|
213144
213130
|
const { tenantKey, mentorId, username, rbacPermissions } = useAgentSettings();
|
|
213145
|
-
return (jsxs(Fragment$1, { children: [jsx("div", { className: "flex hidden h-[73px] flex-shrink-0 items-center border-b border-gray-200 bg-white p-4 lg:block", children: jsxs("div", { children: [jsx("h3", { className: "mb-1 text-base font-medium text-gray-900", children: "MCP" }), jsx("p", { className: "text-xs text-gray-700", children: "Manage Model Context Protocol connectors for your
|
|
213131
|
+
return (jsxs(Fragment$1, { children: [jsx("div", { className: "flex hidden h-[73px] flex-shrink-0 items-center border-b border-gray-200 bg-white p-4 lg:block", children: jsxs("div", { children: [jsx("h3", { className: "mb-1 text-base font-medium text-gray-900", children: "MCP" }), jsx("p", { className: "text-xs text-gray-700", children: "Manage Model Context Protocol connectors for your agent." })] }) }), jsx("div", { className: "flex-1 p-3 lg:p-4", style: {
|
|
213146
213132
|
overflowY: 'auto',
|
|
213147
213133
|
overflowX: 'hidden',
|
|
213148
213134
|
}, children: jsx(ConnectorManagementContent, { tenantKey: tenantKey, username: username !== null && username !== void 0 ? username : '', mentorId: mentorId, rbacPermissions: rbacPermissions, onSelect: onSelect }) })] }));
|
|
@@ -213153,13 +213139,13 @@ function CopyButton({ text, disabled = false }) {
|
|
|
213153
213139
|
return (jsxs(Button$1, { variant: "outline", size: "sm", className: "h-8 flex-1 py-5", disabled: disabled, onClick: () => copy(text), "aria-label": status === 'success' ? 'Text copied to clipboard' : 'Copy text to clipboard', children: [jsx(Copy, { className: "mr-2 h-4 w-4" }), status === 'success' ? 'Copied' : 'Copy'] }));
|
|
213154
213140
|
}
|
|
213155
213141
|
|
|
213156
|
-
const systemPromptSchema$1 = z$
|
|
213157
|
-
prompt: z$
|
|
213142
|
+
const systemPromptSchema$1 = z$2.object({
|
|
213143
|
+
prompt: z$2.string().min(1, 'Prompt is required'),
|
|
213158
213144
|
});
|
|
213159
|
-
const nonSystemPromptSchema$1 = z$
|
|
213160
|
-
category: z$
|
|
213161
|
-
prompt: z$
|
|
213162
|
-
promptVisibility: z$
|
|
213145
|
+
const nonSystemPromptSchema$1 = z$2.object({
|
|
213146
|
+
category: z$2.string().min(1, 'Category is required'),
|
|
213147
|
+
prompt: z$2.string().min(1, 'Prompt is required'),
|
|
213148
|
+
promptVisibility: z$2.nativeEnum(PromptVisibilityEnum),
|
|
213163
213149
|
});
|
|
213164
213150
|
function EditPromptModal$1({ isOpen, onClose, selectedPrompt, handleSave, isEditing }) {
|
|
213165
213151
|
var _a;
|
|
@@ -214464,12 +214450,12 @@ function daysFromCurrentDate(targetDate) {
|
|
|
214464
214450
|
function CreateApiModal({ isOpen, onClose, tenantKey, username, executeGatedAction, labels, apiKeyModalLabels, }) {
|
|
214465
214451
|
const [apiKey, setApiKey] = React__default.useState(null);
|
|
214466
214452
|
const [createApiKey, { isLoading }] = useCreateApiKeyMutation();
|
|
214467
|
-
const createApiFormSchema = React__default.useMemo(() => z$
|
|
214468
|
-
name: z$
|
|
214453
|
+
const createApiFormSchema = React__default.useMemo(() => z$2.object({
|
|
214454
|
+
name: z$2
|
|
214469
214455
|
.string()
|
|
214470
214456
|
.min(1, labels.nameRequired)
|
|
214471
214457
|
.regex(/^[a-zA-Z0-9_-]+$/, labels.nameInvalid),
|
|
214472
|
-
expiration_date: z$
|
|
214458
|
+
expiration_date: z$2.date().nullable(),
|
|
214473
214459
|
}), [labels.nameRequired, labels.nameInvalid]);
|
|
214474
214460
|
const form = useForm({
|
|
214475
214461
|
defaultValues: createApiFormDefaultValues,
|
|
@@ -215709,7 +215695,7 @@ const useEmbedTab = (urls) => {
|
|
|
215709
215695
|
const value = form.state.values;
|
|
215710
215696
|
// Validate website URL if not anonymous
|
|
215711
215697
|
if (!value.allow_anonymous &&
|
|
215712
|
-
(!value.website_url || !z$
|
|
215698
|
+
(!value.website_url || !z$2.string().url().safeParse(value.website_url).success)) {
|
|
215713
215699
|
setCreateTokenError('Please specify a valid Website URL');
|
|
215714
215700
|
return { success: false };
|
|
215715
215701
|
}
|
|
@@ -215795,7 +215781,7 @@ const useEmbedTab = (urls) => {
|
|
|
215795
215781
|
const createTokenHandler = async () => {
|
|
215796
215782
|
var _a, _b, _c;
|
|
215797
215783
|
const websiteUrl = form.getFieldValue('website_url');
|
|
215798
|
-
if (!websiteUrl || !z$
|
|
215784
|
+
if (!websiteUrl || !z$2.string().url().safeParse(websiteUrl).success) {
|
|
215799
215785
|
setCreateTokenError('A valid url is required!');
|
|
215800
215786
|
return;
|
|
215801
215787
|
}
|
|
@@ -222822,7 +222808,7 @@ const DefaultTasksPagination = IblPagination;
|
|
|
222822
222808
|
const AGENT_TASKS_TAB_LABELS = {
|
|
222823
222809
|
header: {
|
|
222824
222810
|
title: 'Tasks',
|
|
222825
|
-
description: 'Configure automated tasks for your
|
|
222811
|
+
description: 'Configure automated tasks for your agent.',
|
|
222826
222812
|
},
|
|
222827
222813
|
toolbar: {
|
|
222828
222814
|
searchPlaceholder: 'Search all tasks...',
|
|
@@ -223235,13 +223221,13 @@ function AddPromptModal({ isOpen, onClose, mentorId, tenantKey }) {
|
|
|
223235
223221
|
} }), jsx("div", { className: "flex justify-end", children: jsx(form.Subscribe, { selector: (state) => ({ isFormValue: state.canSubmit }), children: ({ isFormValue }) => (jsx(Button$1, { type: "submit", className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", disabled: isDisabled || !isFormValue, children: isCreatingPrompt ? 'Submitting...' : 'Submit' })) }) })] })] }) }), isModalOpen && FreeTrialDialog && (jsx(FreeTrialDialog, { isOpen: isModalOpen, onClose: closeModal }))] }));
|
|
223236
223222
|
}
|
|
223237
223223
|
|
|
223238
|
-
const systemPromptSchema = z$
|
|
223239
|
-
prompt: z$
|
|
223224
|
+
const systemPromptSchema = z$2.object({
|
|
223225
|
+
prompt: z$2.string().min(1, 'Prompt is required'),
|
|
223240
223226
|
});
|
|
223241
|
-
const nonSystemPromptSchema = z$
|
|
223242
|
-
category: z$
|
|
223243
|
-
prompt: z$
|
|
223244
|
-
promptVisibility: z$
|
|
223227
|
+
const nonSystemPromptSchema = z$2.object({
|
|
223228
|
+
category: z$2.string().min(1, 'Category is required'),
|
|
223229
|
+
prompt: z$2.string().min(1, 'Prompt is required'),
|
|
223230
|
+
promptVisibility: z$2.nativeEnum(PromptVisibilityEnum),
|
|
223245
223231
|
});
|
|
223246
223232
|
function EditPromptModal({ isOpen, onClose, selectedPrompt, handleSave, isEditing, tenantKey, }) {
|
|
223247
223233
|
var _a;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iblai/iblai-js",
|
|
3
|
-
"version": "1.20.
|
|
3
|
+
"version": "1.20.2",
|
|
4
4
|
"description": "Unified JavaScript SDK for IBL.ai — re-exports data-layer, web-containers, and web-utils under a single package",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -66,10 +66,10 @@
|
|
|
66
66
|
"axios": "1.13.6",
|
|
67
67
|
"dotenv": "16.6.1",
|
|
68
68
|
"winston": "3.19.0",
|
|
69
|
-
"@iblai/
|
|
70
|
-
"@iblai/data-layer": "1.8.3",
|
|
69
|
+
"@iblai/data-layer": "1.8.4",
|
|
71
70
|
"@iblai/mcp": "1.7.2",
|
|
72
|
-
"@iblai/web-utils": "1.11.2"
|
|
71
|
+
"@iblai/web-utils": "1.11.2",
|
|
72
|
+
"@iblai/web-containers": "1.10.2"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
75
|
"@radix-ui/react-dialog": "^1.1.7",
|