@iblai/iblai-js 1.20.0 → 1.20.1

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.
@@ -86714,7 +86714,7 @@ function PurchasesTab({ org, username }) {
86714
86714
  refetch();
86715
86715
  } }));
86716
86716
  }
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: "Mentor" }), 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.' })] }) }))] }));
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: "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
86718
  }
86719
86719
 
86720
86720
  function AddMemoryDialog({ open, onOpenChange, org, username }) {
@@ -90886,7 +90886,7 @@ const TabDescription = ({ icon, title, children }) => {
90886
90886
  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
90887
  };
90888
90888
  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 mentor, 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 })] }))] }) }));
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 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
90890
  };
90891
90891
 
90892
90892
  function DeleteApiModal({ isOpen, onClose, apiKey, tenantKey }) {
@@ -95980,17 +95980,17 @@ const StudentMentorCreationContent = ({ platformKey, }) => {
95980
95980
  dispatch(coreApiSlice.util.updateQueryData('getStudentMentorCreationStatus', { platformKey }, (draft) => {
95981
95981
  draft.allow_students_to_create_mentors = checked;
95982
95982
  }));
95983
- toast.success('User mentor creation setting updated successfully');
95983
+ toast.success('User agent creation setting updated successfully');
95984
95984
  }
95985
95985
  catch (error) {
95986
95986
  console.error(JSON.stringify(error));
95987
- toast.error('Failed to update user mentor creation setting');
95987
+ toast.error('Failed to update user agent creation setting');
95988
95988
  }
95989
95989
  };
95990
95990
  if (isLoadingStudentMentorCreationStatus) {
95991
95991
  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
95992
  }
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 Mentor 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 mentors in the mentor 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 mentor 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" }))] })] }));
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 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
95994
  };
95995
95995
 
95996
95996
  const RecommendationSystemPromptsContent = ({ platformKey, currentSPA, }) => {
@@ -96136,11 +96136,11 @@ const RecommendationSystemPromptsContent = ({ platformKey, currentSPA, }) => {
96136
96136
  .sort((a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime())
96137
96137
  .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
96138
  ? 'Catalog'
96139
- : 'Mentor', ' ', "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
96139
+ : '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
96140
  ? 'bg-blue-100 text-blue-800'
96141
96141
  : '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
96142
  ? 'Update the recommendation system prompt details.'
96143
- : `Create a new ${recommendationType === recommendationPromptTypeEnum.catalog ? 'catalog' : 'mentors'} 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'] })] })] }) })] }));
96143
+ : `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
96144
  };
96145
96145
 
96146
96146
  const getMetadataKey = (spa) => {
@@ -97419,7 +97419,7 @@ function AdvancedTab({ platformKey, username, currentSPA, authURL, currentPlatfo
97419
97419
  };
97420
97420
  // Set mentor to null and disable sidebar display
97421
97421
  await updateMultipleOrganizationMetadata(updatedMetadata, () => {
97422
- toast.success('Mentor setting updated successfully');
97422
+ toast.success('Agent setting updated successfully');
97423
97423
  });
97424
97424
  return;
97425
97425
  }
@@ -97437,7 +97437,7 @@ function AdvancedTab({ platformKey, username, currentSPA, authURL, currentPlatfo
97437
97437
  enable_sidebar_ai_mentor_display: true,
97438
97438
  };
97439
97439
  await updateMultipleOrganizationMetadata(updatedMetadata, () => {
97440
- toast.success('Mentor setting updated successfully');
97440
+ toast.success('Agent setting updated successfully');
97441
97441
  });
97442
97442
  };
97443
97443
  const handleMentorSearch = (query) => {
@@ -97491,7 +97491,7 @@ function AdvancedTab({ platformKey, username, currentSPA, authURL, currentPlatfo
97491
97491
  : ((_a = metadataItem.value) !== null && _a !== void 0 ? _a : metadataItem.defaultValue);
97492
97492
  const isMentorSetting = metadataItem.slug === 'overall_default_mentor';
97493
97493
  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 mentor", children: currentValue ? getMentorName(currentValue) : '' }) }), jsxs(SelectContent, { className: "font-medium text-[#646464]", children: [jsx("div", { className: "p-2", children: jsx(Input, { placeholder: "Search mentors...", 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 mentors...", value: "loading", disabled: true, children: "Loading mentors..." })) : ((_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 mentors found" }))] })] }), isUpdatingTenantMetadata && (jsx("div", { "aria-label": "Updating mentor 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 () => {
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 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
97495
  await handleToggleSetting(metadataItem.slug, currentValue);
97496
97496
  }, 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
97497
  }) })) : (
@@ -97510,7 +97510,7 @@ function AdvancedTab({ platformKey, username, currentSPA, authURL, currentPlatfo
97510
97510
  const currentValue = (_a = metadataItem.value) !== null && _a !== void 0 ? _a : metadataItem.defaultValue;
97511
97511
  const isMentorSetting = metadataItem.slug === 'overall_default_mentor';
97512
97512
  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 mentor", children: currentValue ? getMentorName(currentValue) : '' }) }), jsxs(SelectContent, { className: "font-medium text-[#646464]", children: [jsx("div", { className: "p-2", children: jsx(Input, { placeholder: "Search mentors...", 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 mentors..." })) : ((_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 mentors 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 () => {
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 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
97514
  await handleToggleSetting(metadataItem.slug, currentValue);
97515
97515
  }, 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
97516
  }) })] }, spa)));
@@ -128479,7 +128479,7 @@ function MentorPromptDialog({ open, onOpenChange, mentor, initialPrompt, onSave,
128479
128479
  }
128480
128480
  onOpenChange(nextOpen);
128481
128481
  };
128482
- return (jsx(Dialog, { open: open, onOpenChange: handleOpenChange, children: jsxs(DialogContent, { className: "sm:max-w-md", children: [jsxs(DialogHeader, { children: [jsx(DialogTitle, { children: "Edit Mentor Prompt" }), jsx(DialogDescription, { children: "Provide an optional prompt that will be associated with this mentor 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: "Mentor" }), 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 a mentor prompt...", rows: 5 }), jsx("p", { className: "text-xs text-gray-500", children: "This prompt is saved with the mentor" })] })] }), 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" })] })] }) }));
128482
+ 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
128483
  }
128484
128484
 
128485
128485
  function PolicyConfigDialog({ open, onOpenChange, config, onSave, }) {
@@ -128626,10 +128626,10 @@ function ProactiveSettingsSection({ platformKey, username, isSaving, userLocalTi
128626
128626
  const isExecutionTimeMissing = periodicFrequency === 'CUSTOM' && !periodicExecutionTime.trim();
128627
128627
  const isProactiveInvalid = isCustomIntervalMissing || isExecutionTimeMissing;
128628
128628
  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 mentor 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) => {
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 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
128630
  const value = String(index + 1);
128631
128631
  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 Mentors" }), jsx(SearchableMultiSelect, { items: mentorOptions, selectedItems: selectedMentors, onSelectionChange: handleMentorSelectionChange, searchQuery: mentorSearch, onSearchChange: setMentorSearch, isLoading: isMentorsLoading, placeholder: "Search mentors 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 mentor 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 mentors 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 })] }));
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 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
128633
  }
128634
128634
 
128635
128635
  function useDebouncedValue$1(value, delay) {
@@ -128767,9 +128767,9 @@ function useDebouncedValue(value, delay) {
128767
128767
  return debouncedValue;
128768
128768
  }
128769
128769
  const RECIPIENT_MODE_OPTIONS = [
128770
- { value: 'platform_admins_and_mentor_owner', label: 'Platform Admins & Mentor Owner' },
128770
+ { value: 'platform_admins_and_mentor_owner', label: 'Platform Admins & Agent Owner' },
128771
128771
  { value: 'platform_admins_only', label: 'Platform Admins Only' },
128772
- { value: 'mentor_owner_only', label: 'Mentor Owner Only' },
128772
+ { value: 'mentor_owner_only', label: 'Agent Owner Only' },
128773
128773
  { value: 'custom', label: 'Custom' },
128774
128774
  ];
128775
128775
  const formatUserSelections = (recipients, userList) => {
@@ -192321,7 +192321,7 @@ function AnalyticsTranscriptsStats({ tenantKey, mentorId, selectedMentorId, user
192321
192321
  /* Error or no data state */
192322
192322
  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
192323
  /* 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: ["Mentor: ", ((_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: "Mentor" }) }), 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." }) })) })] })) }));
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: ["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
192325
  };
192326
192326
  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
192327
  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 +192342,7 @@ function AnalyticsTranscriptsStats({ tenantKey, mentorId, selectedMentorId, user
192342
192342
  ? 'Negative'
192343
192343
  : transcript.sentiment === 'positive'
192344
192344
  ? '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: ["Mentor: ", (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));
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: ["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
192346
  })) : (
192347
192347
  // Empty state
192348
192348
  jsx("div", { className: "text-center py-12", children: jsx("p", { className: "text-gray-500", children: filters.topicSearch || filters.userSearch || filters.rating
@@ -192361,7 +192361,7 @@ function AnalyticsTranscriptsStats({ tenantKey, mentorId, selectedMentorId, user
192361
192361
  /* Error or no data state */
192362
192362
  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
192363
  /* 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: ["Mentor: ", ((_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: "Mentor" }) }), 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." }) })) })] })) })] }) }))] }));
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: ["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
192365
  }
192366
192366
 
192367
192367
  const phaseConfig = {
@@ -194048,7 +194048,7 @@ function AnalyticsMonetizationStats({ tenantKey }) {
194048
194048
  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
194049
  setPaywallTypeFilter(v);
194050
194050
  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: "Mentor" }), 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) => {
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: "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
194052
  var _a, _b;
194053
194053
  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
194054
  ? 'bg-blue-100 text-blue-700 border-blue-200 hover:bg-blue-100'
@@ -194141,7 +194141,7 @@ const ACTION_FILTER_OPTIONS = [
194141
194141
  // We keep the full UUID so mentors with the same name stay distinguishable.
194142
194142
  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
194143
  const RESOURCE_TYPE_LABELS = {
194144
- mentorsettings: 'mentor settings',
194144
+ mentorsettings: 'agent settings',
194145
194145
  };
194146
194146
  function humanizeResourceType(type) {
194147
194147
  var _a;
@@ -194161,7 +194161,7 @@ function splitReprAndUniqueId(repr) {
194161
194161
  // Raw field names like `enable_multi_query_rag` or `llm_name` read poorly
194162
194162
  // when just underscore-replaced, so we map the common ones explicitly.
194163
194163
  const FIELD_LABELS = {
194164
- align_mentor_bubble: 'mentor bubble alignment',
194164
+ align_mentor_bubble: 'agent bubble alignment',
194165
194165
  allow_anonymous: 'anonymous access',
194166
194166
  can_use_tools: 'tools',
194167
194167
  display_name: 'display name',
@@ -194175,7 +194175,7 @@ const FIELD_LABELS = {
194175
194175
  is_lti_accessible: 'LTI access',
194176
194176
  llm_name: 'LLM model',
194177
194177
  llm_provider: 'LLM provider',
194178
- mentor_bubble_color: 'mentor bubble color',
194178
+ mentor_bubble_color: 'agent bubble color',
194179
194179
  mentor_visibility: 'visibility',
194180
194180
  profile_image: 'profile image',
194181
194181
  system_prompt: 'system prompt',
@@ -198073,7 +198073,7 @@ function AgentSkills({ platformKey, mentorUniqueId }) {
198073
198073
  const assignment = assignmentsBySkillUniqueId.get(skill.unique_id);
198074
198074
  const isEnabled = (_a = assignment === null || assignment === void 0 ? void 0 : assignment.enabled) !== null && _a !== void 0 ? _a : false;
198075
198075
  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 mentors."] }), 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' })] })] })] }));
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 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
198077
  }
198078
198078
  // ── Shared Skill Form ────────────────────────────────────────────────────────
198079
198079
  function SkillForm({ form, onChange, }) {
@@ -198238,7 +198238,7 @@ const defaultSections = [
198238
198238
  {
198239
198239
  title: 'Core',
198240
198240
  items: [
198241
- { id: 'mentor', label: 'Mentor' },
198241
+ { id: 'mentor', label: 'Agent' },
198242
198242
  { id: 'end', label: 'End' },
198243
198243
  { id: 'note', label: 'Note' },
198244
198244
  ],
@@ -200893,7 +200893,7 @@ const AGENT_DATASETS_TAB_LABELS = {
200893
200893
  },
200894
200894
  trainOrDeleteModal: {
200895
200895
  title: 'What would you like to do?',
200896
- description: "This dataset is currently untrained. You can train it to make it available for your mentor, or permanently delete it if it's no longer needed.",
200896
+ 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
200897
  delete: 'Delete',
200898
200898
  train: 'Train',
200899
200899
  training: 'Training...',
@@ -201137,7 +201137,7 @@ function GithubFileUploadModal() {
201137
201137
  const handleSubmit = async () => {
201138
201138
  try {
201139
201139
  if (!mentorId) {
201140
- toast.error('Mentor not found');
201140
+ toast.error('Agent not found');
201141
201141
  return;
201142
201142
  }
201143
201143
  await addTrainingDocument({
@@ -124811,7 +124811,7 @@ function PurchasesTab({ org, username }) {
124811
124811
  refetch();
124812
124812
  } }));
124813
124813
  }
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: "Mentor" }), 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.' })] }) }))] }));
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: "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
124815
  }
124816
124816
 
124817
124817
  function AddMemoryDialog({ open, onOpenChange, org, username }) {
@@ -128651,7 +128651,7 @@ const TabDescription = ({ icon, title, children }) => {
128651
128651
  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
128652
  };
128653
128653
  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 mentor, 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 })] }))] }) }));
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 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
128655
  };
128656
128656
 
128657
128657
  function DeleteApiModal$1({ isOpen, onClose, apiKey, tenantKey }) {
@@ -133745,17 +133745,17 @@ const StudentMentorCreationContent = ({ platformKey, }) => {
133745
133745
  dispatch(coreApiSlice.util.updateQueryData('getStudentMentorCreationStatus', { platformKey }, (draft) => {
133746
133746
  draft.allow_students_to_create_mentors = checked;
133747
133747
  }));
133748
- toast.success('User mentor creation setting updated successfully');
133748
+ toast.success('User agent creation setting updated successfully');
133749
133749
  }
133750
133750
  catch (error) {
133751
133751
  console.error(JSON.stringify(error));
133752
- toast.error('Failed to update user mentor creation setting');
133752
+ toast.error('Failed to update user agent creation setting');
133753
133753
  }
133754
133754
  };
133755
133755
  if (isLoadingStudentMentorCreationStatus) {
133756
133756
  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
133757
  }
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 Mentor 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 mentors in the mentor 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 mentor 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" }))] })] }));
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 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
133759
  };
133760
133760
 
133761
133761
  const RecommendationSystemPromptsContent = ({ platformKey, currentSPA, }) => {
@@ -133901,11 +133901,11 @@ const RecommendationSystemPromptsContent = ({ platformKey, currentSPA, }) => {
133901
133901
  .sort((a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime())
133902
133902
  .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
133903
  ? 'Catalog'
133904
- : 'Mentor', ' ', "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
133904
+ : '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
133905
  ? 'bg-blue-100 text-blue-800'
133906
133906
  : '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
133907
  ? 'Update the recommendation system prompt details.'
133908
- : `Create a new ${recommendationType === recommendationPromptTypeEnum.catalog ? 'catalog' : 'mentors'} 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'] })] })] }) })] }));
133908
+ : `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
133909
  };
133910
133910
 
133911
133911
  const getMetadataKey = (spa) => {
@@ -135184,7 +135184,7 @@ function AdvancedTab({ platformKey, username, currentSPA, authURL, currentPlatfo
135184
135184
  };
135185
135185
  // Set mentor to null and disable sidebar display
135186
135186
  await updateMultipleOrganizationMetadata(updatedMetadata, () => {
135187
- toast.success('Mentor setting updated successfully');
135187
+ toast.success('Agent setting updated successfully');
135188
135188
  });
135189
135189
  return;
135190
135190
  }
@@ -135202,7 +135202,7 @@ function AdvancedTab({ platformKey, username, currentSPA, authURL, currentPlatfo
135202
135202
  enable_sidebar_ai_mentor_display: true,
135203
135203
  };
135204
135204
  await updateMultipleOrganizationMetadata(updatedMetadata, () => {
135205
- toast.success('Mentor setting updated successfully');
135205
+ toast.success('Agent setting updated successfully');
135206
135206
  });
135207
135207
  };
135208
135208
  const handleMentorSearch = (query) => {
@@ -135256,7 +135256,7 @@ function AdvancedTab({ platformKey, username, currentSPA, authURL, currentPlatfo
135256
135256
  : ((_a = metadataItem.value) !== null && _a !== void 0 ? _a : metadataItem.defaultValue);
135257
135257
  const isMentorSetting = metadataItem.slug === 'overall_default_mentor';
135258
135258
  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 mentor", children: currentValue ? getMentorName(currentValue) : '' }) }), jsxs(SelectContent, { className: "font-medium text-[#646464]", children: [jsx("div", { className: "p-2", children: jsx(Input, { placeholder: "Search mentors...", 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 mentors...", value: "loading", disabled: true, children: "Loading mentors..." })) : ((_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 mentors found" }))] })] }), isUpdatingTenantMetadata && (jsx("div", { "aria-label": "Updating mentor 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 () => {
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 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
135260
  await handleToggleSetting(metadataItem.slug, currentValue);
135261
135261
  }, 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
135262
  }) })) : (
@@ -135275,7 +135275,7 @@ function AdvancedTab({ platformKey, username, currentSPA, authURL, currentPlatfo
135275
135275
  const currentValue = (_a = metadataItem.value) !== null && _a !== void 0 ? _a : metadataItem.defaultValue;
135276
135276
  const isMentorSetting = metadataItem.slug === 'overall_default_mentor';
135277
135277
  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 mentor", children: currentValue ? getMentorName(currentValue) : '' }) }), jsxs(SelectContent, { className: "font-medium text-[#646464]", children: [jsx("div", { className: "p-2", children: jsx(Input, { placeholder: "Search mentors...", 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 mentors..." })) : ((_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 mentors 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 () => {
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 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
135279
  await handleToggleSetting(metadataItem.slug, currentValue);
135280
135280
  }, 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
135281
  }) })] }, spa)));
@@ -204639,7 +204639,7 @@ const AGENT_DATASETS_TAB_LABELS = {
204639
204639
  },
204640
204640
  trainOrDeleteModal: {
204641
204641
  title: 'What would you like to do?',
204642
- description: "This dataset is currently untrained. You can train it to make it available for your mentor, or permanently delete it if it's no longer needed.",
204642
+ 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
204643
  delete: 'Delete',
204644
204644
  train: 'Train',
204645
204645
  training: 'Training...',
@@ -204883,7 +204883,7 @@ function GithubFileUploadModal() {
204883
204883
  const handleSubmit = async () => {
204884
204884
  try {
204885
204885
  if (!mentorId) {
204886
- toast.error('Mentor not found');
204886
+ toast.error('Agent not found');
204887
204887
  return;
204888
204888
  }
204889
204889
  await addTrainingDocument({
@@ -206236,7 +206236,7 @@ function OrganizationTab({ platformKey, setOrganizationLogoFromOutside, tenant,
206236
206236
  }
206237
206237
  }, children: [organizationLogo ? (jsxs("div", { className: "relative h-full w-full", children: [jsx(Image$4, { src: typeof organizationLogo === 'string'
206238
206238
  ? organizationLogo
206239
- : URL.createObjectURL(organizationLogo), alt: "Mentor", className: "h-full w-full rounded-lg object-contain", height: 200, width: 200, onClick: (event) => {
206239
+ : URL.createObjectURL(organizationLogo), alt: "Agent", className: "h-full w-full rounded-lg object-contain", height: 200, width: 200, onClick: (event) => {
206240
206240
  event.stopPropagation();
206241
206241
  }, onError: (event) => {
206242
206242
  event.stopPropagation();
@@ -206262,7 +206262,7 @@ function OrganizationTab({ platformKey, setOrganizationLogoFromOutside, tenant,
206262
206262
  }
206263
206263
  }, children: [organizationDarkLogo ? (jsxs("div", { className: "relative h-full w-full", children: [jsx(Image$4, { src: typeof organizationDarkLogo === 'string'
206264
206264
  ? organizationDarkLogo
206265
- : URL.createObjectURL(organizationDarkLogo), alt: "Mentor", className: "h-full w-full rounded-lg object-contain", height: 200, width: 200, onClick: (event) => {
206265
+ : URL.createObjectURL(organizationDarkLogo), alt: "Agent", className: "h-full w-full rounded-lg object-contain", height: 200, width: 200, onClick: (event) => {
206266
206266
  event.stopPropagation();
206267
206267
  }, onError: (event) => {
206268
206268
  event.stopPropagation();
@@ -209400,7 +209400,7 @@ function AppSidebar({ logo, contentItems, footerItems, showProjects = false, sho
209400
209400
  }
209401
209401
 
209402
209402
  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 Mentor" }), jsx(DropdownMenuItem, { children: "Explore Mentors" })] })] })), 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"] })))] })] }));
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 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
209404
  }
209405
209405
 
209406
209406
  function useTimeTracker(config) {
@@ -212137,7 +212137,7 @@ function ConnectorDialogs({ open, onClose, onAddConnector, editingServer, editin
212137
212137
  resetForm();
212138
212138
  onClose();
212139
212139
  }, [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 Mentors" })] }), 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 Mentor" })] })] }), connectorScope === 'tenant' && (jsx("p", { className: "text-muted-foreground text-xs", children: "This MCP will be available for all mentors." })), connectorScope === 'this-mentor' && (jsx("p", { className: "text-muted-foreground text-xs", children: "This MCP will only be available for this mentor." }))] }), 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: "Mentor" }), 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 mentors 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 mentor." }) })), 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() ||
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 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
212141
  !connectorServer.trim() ||
212142
212142
  isSubmitting ||
212143
212143
  (authMethod === 'oauth' && !!oauthUrlError) ||
@@ -213106,7 +213106,7 @@ function ConnectorManagementContent({ tenantKey, username, mentorId, rbacPermiss
213106
213106
  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
213107
  ? 'User'
213108
213108
  : server.auth_scope === 'mentor'
213109
- ? 'Mentor'
213109
+ ? 'Agent'
213110
213110
  : '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
213111
  // Custom (non-featured) servers: Show Edit/Delete based on object permissions, and Connect/Disconnect if OAuth
213112
213112
  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 +213142,7 @@ function ConnectorManagementContent({ tenantKey, username, mentorId, rbacPermiss
213142
213142
 
213143
213143
  function McpTab({ onSelect } = {}) {
213144
213144
  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 mentor." })] }) }), jsx("div", { className: "flex-1 p-3 lg:p-4", style: {
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 agent." })] }) }), jsx("div", { className: "flex-1 p-3 lg:p-4", style: {
213146
213146
  overflowY: 'auto',
213147
213147
  overflowX: 'hidden',
213148
213148
  }, children: jsx(ConnectorManagementContent, { tenantKey: tenantKey, username: username !== null && username !== void 0 ? username : '', mentorId: mentorId, rbacPermissions: rbacPermissions, onSelect: onSelect }) })] }));
@@ -222822,7 +222822,7 @@ const DefaultTasksPagination = IblPagination;
222822
222822
  const AGENT_TASKS_TAB_LABELS = {
222823
222823
  header: {
222824
222824
  title: 'Tasks',
222825
- description: 'Configure automated tasks for your mentor.',
222825
+ description: 'Configure automated tasks for your agent.',
222826
222826
  },
222827
222827
  toolbar: {
222828
222828
  searchPlaceholder: 'Search all tasks...',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iblai/iblai-js",
3
- "version": "1.20.0",
3
+ "version": "1.20.1",
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/web-containers": "1.10.0",
70
69
  "@iblai/data-layer": "1.8.3",
71
- "@iblai/mcp": "1.7.2",
72
- "@iblai/web-utils": "1.11.2"
70
+ "@iblai/web-containers": "1.10.1",
71
+ "@iblai/web-utils": "1.11.2",
72
+ "@iblai/mcp": "1.7.2"
73
73
  },
74
74
  "peerDependencies": {
75
75
  "@radix-ui/react-dialog": "^1.1.7",