@iblai/iblai-js 2.11.3 → 2.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@ import React__default, { useRef, useEffect, useState, useCallback, createContext
3
3
  import { useDispatch, useSelector } from 'react-redux';
4
4
  import { selectSessionId, selectActiveChatMessages, useCachedSessionId, chatActions, LOCAL_STORAGE_KEYS, TimeTracker, selectRbacPermissions, useCurrentTenant, canViewOtherUsersChatHistory, getInitials, useTenantMetadata, isPureWatcher, WithPermissions, canWriteField, useStripeUpgrade, openExternalUrl, CHAT_AREA_SIZE, isAlphaNumeric32, checkRbacPermission, getTimeAgo, REQUIRED_ACTIONS_FOR_GROUPS, getVisibleAnalyticsTabs, getUserName as getUserName$2, formatRelativeTime as formatRelativeTime$2, ANONYMOUS_USERNAME, combineCSVData, WATCHER_HIDDEN_REPORTS, canViewPlatformAuditLogs, redirectToAuthSpaJoinTenant, redirectToAuthSpa, getAuthSpaJoinUrl, useOS, selectNumberOfActiveChatMessages, useUsername, selectStreaming, isLoggedIn, TOOLS, hasRemoteAiConfig, isSafariBrowser, useShowAttachment, useShowVoiceCall, useShowVoiceRecorder, useMentorSettings, selectShowingSharedChat, useShowFreeTrialDialog, useEmbedMode, chatInputSliceSelectors, useResponsive, useAccessingPublicRoute, useVisitingTenant, useModelFileUploadCapabilities, useChatFileUpload, useVoiceChat, selectAttachedFiles, MENTOR_CHAT_DOCUMENTS_EXTENSIONS, chatInputSliceActions, removeFile, WithFormPermissions, MENTOR_VISIBILITY } from '@iblai/web-utils';
5
5
  import * as dataLayer from '@iblai/data-layer';
6
- import { useCreateSessionIdMutation, useTimeTrackingMutation, useGetUserMetadataQuery, useGetUserMetadataEdxQuery, useUpdateUserMetadataMutation, useUpdateUserMetadataEdxMutation, useUploadProfileImageMutation, useResetPasswordMutation, useSelfRetireMutation, useCreateUserInstitutionMutation, useGetUserInstitutionsQuery, useCreateUserEducationMutation, useUpdateUserEducationMutation, useDeleteUserEducationMutation, useGetUserEducationQuery, useCreateUserCompanyMutation, useGetUserCompaniesQuery, useCreateUserExperienceMutation, useUpdateUserExperienceMutation, useDeleteUserExperienceMutation, useGetUserExperienceQuery, useGetUserResumeQuery, useCreateUserResumeMutation, useGetMySubscriptionsQuery, useGetItemSubscriptionQuery, useCancelSubscriptionMutation, useGetLearnerDetailsQuery, useGetUserEnrolledCoursesQuery, useGetUserEnrolledProgramsQuery, useGetUserCatalogPathwaysQuery, useGetUsersAsAssertionsQuery, useGetUserEarnedSkillsQuery, useGetUserReportedSkillsQuery, useGetUserDesiredSkillsQuery, useCreateGlobalMemoryMutation, useUpdateGlobalMemoryMutation, useUpdateMentorMemoryMutation, useGetMemsearchStatusQuery, useGetUserMemorySettingsQuery, useUpdateUserMemorySettingsMutation, useGetGlobalMemoriesQuery, useGetAllMentorMemoriesQuery, useDeleteGlobalMemoryMutation, useDeleteMentorMemoryMutation, useGetAiSearchMentorsQuery, useGetUserChatHistoryReportsQuery, USER_CHAT_HISTORY_REPORT_ACTIVE_STATES, useCreateUserChatHistoryReportMutation, useLazyGetDownloadReportFromURLQuery, useGetUserChatHistoryReportStatusQuery, userChatHistoryApiSlice, USER_CHAT_HISTORY_QUERY_KEYS, useGetUserChatHistoryQuery, useGetUserChatHistoryFilterQuery, useGetMentorsQuery, useGetUserChatHistorySessionQuery, useInviteUserMutation, usePlatformInvitationsQuery, useCreateCatalogInvitationCourseBulkMutation, useGetCatalogInvitationsCourseQuery, useLazyPlatformUsersQuery, useLazyPlatformUserGroupsQuery, useGetPersonnalizedSearchQuery, useCreateCatalogInvitationProgramBulkMutation, useGetCatalogInvitationsProgramQuery, useUpdateUserRoleMutation, useUpdateUserStatusMutation, useUpdatePlatformUserRoleWithPoliciesMutation, usePlatformUsersQuery, useGetAccessibleUsersQuery, isPoliciesResponse, platformApiSlice, featureTags, useLazyGetRbacTeamsAccessListQuery, useCreateRbacTeamsAccessMutation, useGetRbacGroupsQuery, usePlatformUserGroupsQuery, useCreateRbacGroupMutation, useUpdateRbacGroupMutation, useDeleteRbacGroupMutation, useCreatePlatformUserGroupMutation, useUpdatePlatformUserGroupMutation, useDeletePlatformUserGroupMutation, useGetRbacGroupDetailsQuery, useGetPlatformUserGroupDetailsQuery, useGetRbacPermissionsMutation, useGetRbacRolesQuery, useCreateRbacRoleMutation, useUpdateRbacRoleMutation, useDeleteRbacRoleMutation, useGetRbacRoleDetailsQuery, useGetRbacActionsDefinitionQuery, useGetRbacResourceDiscoveryQuery, useGetRbacResourceListQuery, useGetRbacPoliciesQuery, useCreateRbacPolicyMutation, useUpdateRbacPolicyMutation, useDeleteRbacPolicyMutation, useGetRbacPolicyDetailsQuery, useGetWatchedGroupsQuery, useCreateWatchedGroupMutation, useUpdateWatchedGroupMutation, useDeleteWatchedGroupMutation, useAddWatchedUserMutation, useRemoveWatchedUserMutation, useAddWatcherMutation, useUpdateWatcherMutation, useDeleteWatcherMutation, useGetWatchedUsersQuery, useGetWatchersQuery, WATCHER_NOTIFICATION_EVENTS, WATCHER_NOTIFICATION_EVENT_LABELS, useGetApplicationFormsQuery, useGetApplicationFormDetailQuery, useCreateApplicationFormMutation, useUpdateApplicationFormMutation, useGetApplicationAdminDetailQuery, useInviteApplicationCandidateMutation, useLazyGetApplicationAttachmentFileQuery, useCreateApplicationWaiverMutation, useDeleteApplicationWaiverMutation, useSubmitApplicationOverrideMutation, useUpdateApplicationPlacementMutation, useDeleteApplicationCourseAssignmentMutation, useCreateApplicationNoteMutation, useUpdateApplicationNoteMutation, useDeleteApplicationNoteMutation, useTransitionApplicationMutation, useLinkApplicationCandidateMutation, useCreateApplicationPlacementsMutation, useGetCustomMentorsQuery, useCreateApplicationCourseAssignmentsMutation, useGetApplicationBlocksQuery, useDeleteApplicationBlockMutation, useGetApplicationsPipelineStatsQuery, useGetApplicationsPipelineQuery, useGetTenantMetadataQuery, useUpdateTenantMetadataMutation, useLazyGetTenantMetadataQuery, useDeleteApiKeyMutation, useGetApiKeyQuery, useGetApiKeyFieldPermissionsQuery, useUpdateApiKeyMutation, useGetApiKeysQuery, unwrapApiTokenList, useCreateApiKeyMutation, useCreateLLMCredentialMutation, useGetCredentialsSchemaQuery, useGetMaskedLLMCredentialsQuery, useGetLlmsQuery, useDeleteIntegrationCredentialMutation, useDeleteCredentialMutation, useCreateIntegrationCredentialMutation, useGetIntegrationCredentialsSchemaQuery, useGetMaskedIntegrationCredentialsQuery, useGetAccountBillingInfoQuery, useUpdateAutoRechargeInfoMutation, useTriggerAutoRechargeMutation, useGetAgentSpendCapQuery, useGetTenantSpendCapQuery, useListAgentUserSpendCapsQuery, useUpsertAgentSpendCapMutation, useDeleteAgentSpendCapMutation, useUpsertTenantSpendCapMutation, useDeleteTenantSpendCapMutation, useUpsertUserSpendCapMutation, useDeleteUserSpendCapMutation, useGetLlmUsageMetricsQuery, useListAgentSpendCapsQuery, useGetCreditTransactionsQuery, useCreateStripeCustomerPortalMutation, useSetPlatformConfigurationsMutation, useGetPlatformConfigurationsQuery, useUpdatePlatformMembershipMutation, useGetPlatformMembershipQuery, useGetCustomDomainsQuery, useCreateCustomDomainMutation, useDeleteCustomDomainMutation, useGetStudentMentorCreationStatusQuery, useSetStudentMentorCreationStatusMutation, coreApiSlice, recommendationPromptTypeEnum, useGetRecommendedPromptsListQuery, useCreateRecommendedPromptMutation, useUpdateRecommendedPromptMutation, useDeleteRecommendedPromptMutation, useLazyGetPublicPlatformImageAssetFileUrlQuery, useCreatePlatformImageAssetMutation, useGetProviderConfigQuery, useCreateProviderConfigMutation, useDeleteProviderConfigMutation, useGetExternalMappingQuery, useGetCredentialsListQuery, useCreateExternalMappingMutation, useDeleteExternalMappingMutation, useGetMemsearchConfigQuery, useUpdateMemsearchConfigMutation, useGetStripeConnectStatusQuery, useStartStripeConnectOnboardingMutation, useLazyGetStripeConnectDashboardQuery, useListPaywallsQuery, useListPricesQuery, useCreatePriceMutation, useUpdatePriceMutation, useDeletePriceMutation, useGetPaywallConfigQuery, useEnablePaywallMutation, useUpdatePaywallMutation, useGetMentorMemoriesListQuery, useGetMemoryCategoriesAdminQuery, useCreateMentorMemoryMutation, useGetNotificationsCountQuery, useLazyGetNotificationsQuery, useMarkAllAsReadMutation, useCreateNotificationPreviewMutation, useSendNotificationMutation, USER_PROGRESS_DATA_POINTS, useResetTemplateMutation, useSendTestTemplateEmailMutation, useUpdateTemplateMutation, useGetTemplateDetailsQuery, USER_PROGRESS_SUMMARY_TYPE, useGetTemplatesQuery, useLazyGetTemplateDetailsQuery, useToggleTemplateMutation, useGetLlmUsageTracesQuery, useGetLlmUsageObservationsQuery, useGetTopicsStatsQuery, useGetUsersStatsQuery, useGetSessionStatsQuery, useGetTopicsDetailsStatsQuery, useGetTranscriptsConversationHeadlineQuery, useGetAccessTimeHeatmapQuery, useGetUserDetailsStatsQuery, useGetAverageRatingQuery, useGetModelCostsQuery, useGetPerUserCostsQuery, useGetTenantCostQuery, useGetAgentCostQuery, useGetTranscriptsMessagesDetailsQuery, useGetTranscriptsMessagesQuery, useGetReportDetailQuery, useGetMentorPublicSettingsQuery, useGetReportsQuery, useCreateReportMutation, useGetContentAnalyticsQuery, useGetContentAnalyticsDetailsQuery, useGetRevenueQuery, useListSubscribersQuery, useGetAuditLogsQuery, useGetPlatformAuditLogsQuery, PLATFORM_AUDIT_EVENT_TYPES, PLATFORM_AUDIT_ACTION_CODES, useGetMentorMemoriesQuery, useLazyGetCourseMetaDataQuery, useLazyGetCourseCompletionOutlinesQuery, useLazyGetCourseEligibilityQuery, useLazyGetUserEnrolledCoursesQuery, useLazyGetUserAssignedCoursesQuery, useLazyGetUserCredentialsQuery, useLazyGetOverTimeActivityQuery, useLazyGetCatalogSearchQuery, useCreateOrUpdateUserReportedSkillMutation, useCreateOrUpdateUserDesiredSkillMutation, useLazyGetPathwayListQuery, useLazyGetUserAssignedPathwaysQuery, useLazyGetUserEnrolledPathwaysQuery, useLazyGetPathwayCompletionQuery, useLazyGetProgramListQuery, useLazyGetProgramCompletionQuery, useLazyGetUserEnrolledProgramsQuery, useLazyGetAssignedProgramsQuery, useLazyGetUserSkillsPointsQuery, useLazyGetUserReportedSkillsQuery, useLazyGetUserDesiredSkillsQuery, useLazyGetUserCatalogPathwaysQuery, useLazyGetPerLearnerInfoQuery, useLazyGetEdxSSOTokenQuery, useCreateCourseEnrollmentMutation, useCreateStripeCheckoutSessionMutation, useLazyGetCourseProgressQuery, useLazyGetCourseCompletionQuery, useLazyGetPersonnalizedSearchQuery, useUpdateExamAttemptMutation, useStartExamMutation, useLazyGetExamInfoQuery, useGetMentorSettingsQuery, useEditMentorMutation, useGetClawMentorConfigQuery, useGetClawInstancesQuery, useGetAgentConfigQuery, useUpdateClawMentorConfigMutation, useCreateClawMentorConfigMutation, useDeleteClawMentorConfigMutation, usePushClawConfigMutation, useCreateClawInstanceMutation, useDeleteClawInstanceMutation, useUpdateAgentConfigMutation, useHealthCheckClawInstanceMutation, useTestConnectivityClawInstanceMutation, useUpdateClawInstanceMutation, useGetAgentSkillResourcesQuery, useCreateAgentSkillResourceMutation, useUpdateAgentSkillResourceMutation, useUploadAgentSkillResourceAssetMutation, useDeleteAgentSkillResourceMutation, useGetMentorSkillAssignmentsQuery, useGetAgentSkillsQuery, useCreateMentorSkillAssignmentMutation, useUpdateMentorSkillAssignmentMutation, useDeleteMentorSkillAssignmentMutation, useCreateAgentSkillMutation, useUpdateAgentSkillMutation, useDeleteAgentSkillMutation, filterSlashSkills, useGetMentorSkillAssignmentsInfiniteQuery, MENTOR_SKILL_ASSIGNMENTS_PAGE_SIZE, useCreateCheckoutMutation, useGetUserProjectsQuery, useUpdateUserProjectMutation, useGetTrainingDocumentsQuery, useGetVectorDocumentsQuery, useLazyGetConnectedServiceAuthUrlQuery, useCreateUserProjectMutation, useDeleteUserProjectMutation, useGetUserProjectDetailsQuery, useEditTrainingDocumentMutation, useAddTrainingDocumentMutation, useLazyGetCredentialsQuery, useGetMentorCategoriesQuery, useCreateMentorMutation, useUpdateUserPlatformMetadataMutation, useGetApplicationStatusQuery, useListOwnApplicationsQuery, useGetApplicationFormQuery, useWithdrawApplicationMutation, useRenewApplicationMutation, useCreateApplicationDraftMutation, useSubmitApplicationMutation, useUpdateApplicationMutation, useUploadApplicationAttachmentMutation, useDeleteApplicationAttachmentMutation, useCreateMemoryCategoryMutation, useUpdateMemoryCategoryMutation, useDeleteMemoryCategoryMutation, useGetPromptCategoriesQuery, useCreatePromptMutation, useDeletePromptMutation, useGetPromptsSearchQuery, useUpdatePromptMutation, useDeleteTrainingDocumentMutation, useGetTrainingDocumentRetrainScheduleQuery, useCreateTrainingDocumentRetrainScheduleMutation } from '@iblai/data-layer';
6
+ import { useCreateSessionIdMutation, useTimeTrackingMutation, useGetUserMetadataQuery, useGetUserMetadataEdxQuery, useGetUserProfileSummaryQuery, useUpdateUserMetadataMutation, useUpdateUserMetadataEdxMutation, useUploadProfileImageMutation, useResetPasswordMutation, useSelfRetireMutation, useCreateUserInstitutionMutation, useGetUserInstitutionsQuery, useCreateUserEducationMutation, useUpdateUserEducationMutation, useDeleteUserEducationMutation, useGetUserEducationQuery, useCreateUserCompanyMutation, useGetUserCompaniesQuery, useCreateUserExperienceMutation, useUpdateUserExperienceMutation, useDeleteUserExperienceMutation, useGetUserExperienceQuery, useGetUserResumeQuery, useCreateUserResumeMutation, useGetMySubscriptionsQuery, useGetItemSubscriptionQuery, useCancelSubscriptionMutation, useGetLearnerDetailsQuery, useGetUserEnrolledCoursesQuery, useGetUserEnrolledProgramsQuery, useGetUserCatalogPathwaysQuery, useGetUsersAsAssertionsQuery, useGetUserEarnedSkillsQuery, useGetUserReportedSkillsQuery, useGetUserDesiredSkillsQuery, useCreateGlobalMemoryMutation, useUpdateGlobalMemoryMutation, useUpdateMentorMemoryMutation, useGetMemsearchStatusQuery, useGetUserMemorySettingsQuery, useUpdateUserMemorySettingsMutation, useGetGlobalMemoriesQuery, useGetAllMentorMemoriesQuery, useDeleteGlobalMemoryMutation, useDeleteMentorMemoryMutation, useGetAiSearchMentorsQuery, useGetUserChatHistoryReportsQuery, USER_CHAT_HISTORY_REPORT_ACTIVE_STATES, useCreateUserChatHistoryReportMutation, useLazyGetDownloadReportFromURLQuery, useGetUserChatHistoryReportStatusQuery, userChatHistoryApiSlice, USER_CHAT_HISTORY_QUERY_KEYS, useGetUserChatHistoryQuery, useGetUserChatHistoryFilterQuery, useGetMentorsQuery, useGetUserChatHistorySessionQuery, useInviteUserMutation, usePlatformInvitationsQuery, useCreateCatalogInvitationCourseBulkMutation, useGetCatalogInvitationsCourseQuery, useLazyPlatformUsersQuery, useLazyPlatformUserGroupsQuery, useGetPersonnalizedSearchQuery, useCreateCatalogInvitationProgramBulkMutation, useGetCatalogInvitationsProgramQuery, useUpdateUserRoleMutation, useUpdateUserStatusMutation, useUpdatePlatformUserRoleWithPoliciesMutation, usePlatformUsersQuery, useGetAccessibleUsersQuery, isPoliciesResponse, platformApiSlice, featureTags, useLazyGetRbacTeamsAccessListQuery, useCreateRbacTeamsAccessMutation, useGetRbacGroupsQuery, usePlatformUserGroupsQuery, useCreateRbacGroupMutation, useUpdateRbacGroupMutation, useDeleteRbacGroupMutation, useCreatePlatformUserGroupMutation, useUpdatePlatformUserGroupMutation, useDeletePlatformUserGroupMutation, useGetRbacGroupDetailsQuery, useGetPlatformUserGroupDetailsQuery, useGetRbacPermissionsMutation, useGetRbacRolesQuery, useCreateRbacRoleMutation, useUpdateRbacRoleMutation, useDeleteRbacRoleMutation, useGetRbacRoleDetailsQuery, useGetRbacActionsDefinitionQuery, useGetRbacResourceDiscoveryQuery, useGetRbacResourceListQuery, useGetRbacPoliciesQuery, useCreateRbacPolicyMutation, useUpdateRbacPolicyMutation, useDeleteRbacPolicyMutation, useGetRbacPolicyDetailsQuery, useGetWatchedGroupsQuery, useCreateWatchedGroupMutation, useUpdateWatchedGroupMutation, useDeleteWatchedGroupMutation, useAddWatchedUserMutation, useRemoveWatchedUserMutation, useAddWatcherMutation, useUpdateWatcherMutation, useDeleteWatcherMutation, useGetWatchedUsersQuery, useGetWatchersQuery, WATCHER_NOTIFICATION_EVENTS, WATCHER_NOTIFICATION_EVENT_LABELS, useGetApplicationFormsQuery, useGetApplicationFormDetailQuery, useCreateApplicationFormMutation, useUpdateApplicationFormMutation, useGetApplicationAdminDetailQuery, useInviteApplicationCandidateMutation, useLazyGetApplicationAttachmentFileQuery, useCreateApplicationWaiverMutation, useDeleteApplicationWaiverMutation, useSubmitApplicationOverrideMutation, useUpdateApplicationPlacementMutation, useDeleteApplicationCourseAssignmentMutation, useCreateApplicationNoteMutation, useUpdateApplicationNoteMutation, useDeleteApplicationNoteMutation, useTransitionApplicationMutation, useLinkApplicationCandidateMutation, useCreateApplicationPlacementsMutation, useGetCustomMentorsQuery, useCreateApplicationCourseAssignmentsMutation, useGetApplicationBlocksQuery, useDeleteApplicationBlockMutation, useGetApplicationsPipelineStatsQuery, useGetApplicationsPipelineQuery, useGetTenantMetadataQuery, useUpdateTenantMetadataMutation, useLazyGetTenantMetadataQuery, useDeleteApiKeyMutation, useGetApiKeyQuery, useGetApiKeyFieldPermissionsQuery, useUpdateApiKeyMutation, useGetApiKeysQuery, unwrapApiTokenList, useCreateApiKeyMutation, useCreateLLMCredentialMutation, useGetCredentialsSchemaQuery, useGetMaskedLLMCredentialsQuery, useGetLlmsQuery, useDeleteIntegrationCredentialMutation, useDeleteCredentialMutation, useCreateIntegrationCredentialMutation, useGetIntegrationCredentialsSchemaQuery, useGetMaskedIntegrationCredentialsQuery, useGetAccountBillingInfoQuery, useUpdateAutoRechargeInfoMutation, useTriggerAutoRechargeMutation, useGetAgentSpendCapQuery, useGetTenantSpendCapQuery, useListAgentUserSpendCapsQuery, useUpsertAgentSpendCapMutation, useDeleteAgentSpendCapMutation, useUpsertTenantSpendCapMutation, useDeleteTenantSpendCapMutation, useUpsertUserSpendCapMutation, useDeleteUserSpendCapMutation, useGetLlmUsageMetricsQuery, useListAgentSpendCapsQuery, useGetCreditTransactionsQuery, useCreateStripeCustomerPortalMutation, useSetPlatformConfigurationsMutation, useGetPlatformConfigurationsQuery, useUpdatePlatformMembershipMutation, useGetPlatformMembershipQuery, useGetCustomDomainsQuery, useCreateCustomDomainMutation, useDeleteCustomDomainMutation, useGetStudentMentorCreationStatusQuery, useSetStudentMentorCreationStatusMutation, coreApiSlice, recommendationPromptTypeEnum, useGetRecommendedPromptsListQuery, useCreateRecommendedPromptMutation, useUpdateRecommendedPromptMutation, useDeleteRecommendedPromptMutation, useLazyGetPublicPlatformImageAssetFileUrlQuery, useCreatePlatformImageAssetMutation, useGetProviderConfigQuery, useCreateProviderConfigMutation, useDeleteProviderConfigMutation, useGetExternalMappingQuery, useGetCredentialsListQuery, useCreateExternalMappingMutation, useDeleteExternalMappingMutation, useGetMemsearchConfigQuery, useUpdateMemsearchConfigMutation, useGetStripeConnectStatusQuery, useStartStripeConnectOnboardingMutation, useLazyGetStripeConnectDashboardQuery, useListPaywallsQuery, useListPricesQuery, useCreatePriceMutation, useUpdatePriceMutation, useDeletePriceMutation, useGetPaywallConfigQuery, useEnablePaywallMutation, useUpdatePaywallMutation, useGetMentorMemoriesListQuery, useGetMemoryCategoriesAdminQuery, useCreateMentorMemoryMutation, useGetNotificationsCountQuery, useLazyGetNotificationsQuery, useMarkAllAsReadMutation, useCreateNotificationPreviewMutation, useSendNotificationMutation, USER_PROGRESS_DATA_POINTS, useResetTemplateMutation, useSendTestTemplateEmailMutation, useUpdateTemplateMutation, useGetTemplateDetailsQuery, USER_PROGRESS_SUMMARY_TYPE, useGetTemplatesQuery, useLazyGetTemplateDetailsQuery, useToggleTemplateMutation, useGetLlmUsageTracesQuery, useGetLlmUsageObservationsQuery, useGetTopicsStatsQuery, useGetUsersStatsQuery, useGetSessionStatsQuery, useGetTopicsDetailsStatsQuery, useGetTranscriptsConversationHeadlineQuery, useGetAccessTimeHeatmapQuery, useGetUserDetailsStatsQuery, useGetAverageRatingQuery, useGetModelCostsQuery, useGetPerUserCostsQuery, useGetTenantCostQuery, useGetAgentCostQuery, useGetTranscriptsMessagesDetailsQuery, useGetTranscriptsMessagesQuery, useGetReportDetailQuery, useGetMentorPublicSettingsQuery, useGetReportsQuery, useCreateReportMutation, useGetContentAnalyticsQuery, useGetContentAnalyticsDetailsQuery, useGetRevenueQuery, useListSubscribersQuery, useGetAuditLogsQuery, useGetPlatformAuditLogsQuery, PLATFORM_AUDIT_EVENT_TYPES, PLATFORM_AUDIT_ACTION_CODES, useGetMentorMemoriesQuery, useLazyGetCourseMetaDataQuery, useLazyGetCourseCompletionOutlinesQuery, useLazyGetCourseEligibilityQuery, useLazyGetUserEnrolledCoursesQuery, useLazyGetUserAssignedCoursesQuery, useLazyGetUserCredentialsQuery, useLazyGetOverTimeActivityQuery, useLazyGetCatalogSearchQuery, useCreateOrUpdateUserReportedSkillMutation, useCreateOrUpdateUserDesiredSkillMutation, useLazyGetPathwayListQuery, useLazyGetUserAssignedPathwaysQuery, useLazyGetUserEnrolledPathwaysQuery, useLazyGetPathwayCompletionQuery, useLazyGetProgramListQuery, useLazyGetProgramCompletionQuery, useLazyGetUserEnrolledProgramsQuery, useLazyGetAssignedProgramsQuery, useLazyGetUserSkillsPointsQuery, useLazyGetUserReportedSkillsQuery, useLazyGetUserDesiredSkillsQuery, useLazyGetUserCatalogPathwaysQuery, useLazyGetPerLearnerInfoQuery, useLazyGetEdxSSOTokenQuery, useCreateCourseEnrollmentMutation, useCreateStripeCheckoutSessionMutation, useLazyGetCourseProgressQuery, useLazyGetCourseCompletionQuery, useLazyGetPersonnalizedSearchQuery, useUpdateExamAttemptMutation, useStartExamMutation, useLazyGetExamInfoQuery, useGetMentorSettingsQuery, useEditMentorMutation, useGetClawMentorConfigQuery, useGetClawInstancesQuery, useGetAgentConfigQuery, useUpdateClawMentorConfigMutation, useCreateClawMentorConfigMutation, useDeleteClawMentorConfigMutation, usePushClawConfigMutation, useCreateClawInstanceMutation, useDeleteClawInstanceMutation, useUpdateAgentConfigMutation, useHealthCheckClawInstanceMutation, useTestConnectivityClawInstanceMutation, useUpdateClawInstanceMutation, useGetAgentSkillResourcesQuery, useCreateAgentSkillResourceMutation, useUpdateAgentSkillResourceMutation, useUploadAgentSkillResourceAssetMutation, useDeleteAgentSkillResourceMutation, useGetMentorSkillAssignmentsQuery, useGetAgentSkillsQuery, useCreateMentorSkillAssignmentMutation, useUpdateMentorSkillAssignmentMutation, useDeleteMentorSkillAssignmentMutation, useCreateAgentSkillMutation, useUpdateAgentSkillMutation, useDeleteAgentSkillMutation, filterSlashSkills, useGetMentorSkillAssignmentsInfiniteQuery, MENTOR_SKILL_ASSIGNMENTS_PAGE_SIZE, useCreateCheckoutMutation, useGetUserProjectsQuery, useUpdateUserProjectMutation, useGetTrainingDocumentsQuery, useGetVectorDocumentsQuery, useLazyGetConnectedServiceAuthUrlQuery, useCreateUserProjectMutation, useDeleteUserProjectMutation, useGetUserProjectDetailsQuery, useEditTrainingDocumentMutation, useAddTrainingDocumentMutation, useLazyGetCredentialsQuery, useGetMentorCategoriesQuery, useCreateMentorMutation, useUpdateUserPlatformMetadataMutation, useGetApplicationStatusQuery, useListOwnApplicationsQuery, useGetApplicationFormQuery, useWithdrawApplicationMutation, useRenewApplicationMutation, useCreateApplicationDraftMutation, useSubmitApplicationMutation, useUpdateApplicationMutation, useUploadApplicationAttachmentMutation, useDeleteApplicationAttachmentMutation, useCreateMemoryCategoryMutation, useUpdateMemoryCategoryMutation, useDeleteMemoryCategoryMutation, useGetPromptCategoriesQuery, useCreatePromptMutation, useDeletePromptMutation, useGetPromptsSearchQuery, useUpdatePromptMutation, useDeleteTrainingDocumentMutation, useGetTrainingDocumentRetrainScheduleQuery, useCreateTrainingDocumentRetrainScheduleMutation } from '@iblai/data-layer';
7
7
  import { toast } from 'sonner';
8
8
  import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
9
9
  import * as ReactDOM from 'react-dom';
@@ -3620,7 +3620,10 @@ var datasetsTabLabels$3 = {
3620
3620
  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.",
3621
3621
  "delete": "Delete",
3622
3622
  train: "Train",
3623
- training: "Training..."
3623
+ training: "Training...",
3624
+ userAgentLabel: "User-Agent (optional)",
3625
+ userAgentPlaceholder: "Iblai-bot/1.0 (+https://ibl.ai/bot)",
3626
+ userAgentHelpText: "Optional. Overrides the default crawler User-Agent for every request. Leave blank to keep the current setting."
3624
3627
  },
3625
3628
  retrainScheduleModal: {
3626
3629
  title: "Schedule Retraining",
@@ -10934,7 +10937,10 @@ var datasetsTabLabels$2 = {
10934
10937
  description: "Ce jeu de données n'est pas encore entraîné. Vous pouvez l'entraîner pour le rendre disponible à votre agent, ou le supprimer définitivement s'il n'est plus nécessaire.",
10935
10938
  "delete": "Supprimer",
10936
10939
  train: "Entraîner",
10937
- training: "Entraînement..."
10940
+ training: "Entraînement...",
10941
+ userAgentLabel: "User-Agent (facultatif)",
10942
+ userAgentPlaceholder: "Iblai-bot/1.0 (+https://ibl.ai/bot)",
10943
+ userAgentHelpText: "Facultatif. Remplace le User-Agent par defaut du robot d'exploration pour chaque requete. Laissez vide pour conserver le reglage actuel."
10938
10944
  },
10939
10945
  retrainScheduleModal: {
10940
10946
  title: "Planifier le réentraînement",
@@ -18082,7 +18088,10 @@ var datasetsTabLabels$1 = {
18082
18088
  description: "Este conjunto de datos no está entrenado actualmente. Puede entrenarlo para que esté disponible para su agente, o eliminarlo permanentemente si ya no lo necesita.",
18083
18089
  "delete": "Eliminar",
18084
18090
  train: "Entrenar",
18085
- training: "Entrenando..."
18091
+ training: "Entrenando...",
18092
+ userAgentLabel: "User-Agent (opcional)",
18093
+ userAgentPlaceholder: "Iblai-bot/1.0 (+https://ibl.ai/bot)",
18094
+ userAgentHelpText: "Opcional. Sustituye el User-Agent predeterminado del rastreador en cada solicitud. Dejalo en blanco para conservar la configuracion actual."
18086
18095
  },
18087
18096
  retrainScheduleModal: {
18088
18097
  title: "Programar reentrenamiento",
@@ -25230,7 +25239,10 @@ var datasetsTabLabels = {
25230
25239
  description: "该数据集当前未经训练。您可以对其进行训练以使其可供您的代理使用,或者如果不再需要则将其永久删除。",
25231
25240
  "delete": "删除",
25232
25241
  train: "训练",
25233
- training: "训练中..."
25242
+ training: "训练中...",
25243
+ userAgentLabel: "User-Agent(可选)",
25244
+ userAgentPlaceholder: "Iblai-bot/1.0 (+https://ibl.ai/bot)",
25245
+ userAgentHelpText: "可选。为每个请求覆盖默认的抓取工具 User-Agent。留空则保留当前设置。"
25234
25246
  },
25235
25247
  retrainScheduleModal: {
25236
25248
  title: "计划重新训练",
@@ -92207,6 +92219,55 @@ function useForm(opts) {
92207
92219
  return formApi;
92208
92220
  }
92209
92221
 
92222
+ const getUserName$1 = () => {
92223
+ var _a;
92224
+ return (_a = JSON.parse(localStorage.getItem("userData"))) === null || _a === void 0 ? void 0 : _a.user_nicename;
92225
+ };
92226
+
92227
+ /**
92228
+ * The signed-in user's username, or `null` until it has been read. Read from
92229
+ * localStorage after mount to stay SSR-safe.
92230
+ */
92231
+ function useStoredUsername() {
92232
+ const [currentUsername, setCurrentUsername] = useState(null);
92233
+ useEffect(() => {
92234
+ try {
92235
+ setCurrentUsername(getUserName$1() || '');
92236
+ }
92237
+ catch (_a) {
92238
+ setCurrentUsername('');
92239
+ }
92240
+ }, []);
92241
+ return currentUsername;
92242
+ }
92243
+ /**
92244
+ * The signed-in user's username, or an empty string before it is known.
92245
+ */
92246
+ function useCurrentUsername() {
92247
+ var _a;
92248
+ return (_a = useStoredUsername()) !== null && _a !== void 0 ? _a : '';
92249
+ }
92250
+ /**
92251
+ * True when the logged-in user is viewing someone else's profile (preview
92252
+ * mode), so editing affordances can be hidden.
92253
+ */
92254
+ function useIsProfilePreview(username) {
92255
+ const currentUsername = useCurrentUsername();
92256
+ return !!currentUsername && currentUsername !== username;
92257
+ }
92258
+ /**
92259
+ * Preview mode plus whether the viewer has been read yet. Until `isResolved`,
92260
+ * `isPreview` is false only because the viewer is unknown, so callers picking
92261
+ * between endpoints should hold their requests rather than guess.
92262
+ */
92263
+ function useProfilePreviewState(username) {
92264
+ const currentUsername = useStoredUsername();
92265
+ return {
92266
+ isPreview: !!currentUsername && currentUsername !== username,
92267
+ isResolved: currentUsername !== null,
92268
+ };
92269
+ }
92270
+
92210
92271
  // Define URL prefixes as constants outside the function
92211
92272
  const FACEBOOK_URL_PREFIX = 'https://facebook.com/';
92212
92273
  const X_URL_PREFIX = 'https://x.com/';
@@ -92240,15 +92301,68 @@ const socialFormSchema = z.object({
92240
92301
  message: 'Username must be 4 to 15 characters long and can only contain letters, numbers, and underscores.',
92241
92302
  }),
92242
92303
  });
92243
- const useProfile = (username) => {
92304
+ // The summary may hold full profile URLs, while the social form holds handles
92305
+ // and adds its own prefix. The handle is the last path segment; a bare domain
92306
+ // has none.
92307
+ const toSocialHandle = (link) => {
92308
+ var _a;
92309
+ const path = link.trim().replace(/^https?:\/\/[^/]*/i, '');
92310
+ return (_a = path.split('/').filter(Boolean).pop()) !== null && _a !== void 0 ? _a : '';
92311
+ };
92312
+ // Fit the summary into the shapes the profile UI already reads. The summary
92313
+ // has no title or display toggles, so those stay empty.
92314
+ const fromProfileSummary = (summary) => {
92315
+ var _a, _b;
92316
+ const imageUrl = summary.profile_image || '';
92317
+ return {
92318
+ userMetadata: {
92319
+ username: summary.username,
92320
+ name: summary.name,
92321
+ email: summary.email,
92322
+ date_joined: summary.date_joined,
92323
+ bio: summary.bio,
92324
+ about: summary.about,
92325
+ title: '',
92326
+ public_metadata: (_a = summary.public_metadata) !== null && _a !== void 0 ? _a : {},
92327
+ social_links: ((_b = summary.social_links) !== null && _b !== void 0 ? _b : []).map((social) => {
92328
+ var _a;
92329
+ return ({
92330
+ platform: social.platform,
92331
+ social_link: toSocialHandle((_a = social.social_link) !== null && _a !== void 0 ? _a : ''),
92332
+ });
92333
+ }),
92334
+ },
92335
+ userMetadataEdx: {
92336
+ profile_image: {
92337
+ has_image: !!imageUrl,
92338
+ image_url_full: imageUrl,
92339
+ image_url_large: imageUrl,
92340
+ image_url_medium: imageUrl,
92341
+ image_url_small: imageUrl,
92342
+ },
92343
+ },
92344
+ };
92345
+ };
92346
+ const useProfile = (username, options = {}) => {
92244
92347
  var _a, _b, _c, _d, _e, _f, _g, _h;
92245
92348
  //const toast = useToast();
92246
- const { data: userMetadata, isLoading: isUserMetadataLoading, refetch, } = useGetUserMetadataQuery({
92349
+ // Nothing is requested until the viewer is known, so a preview never fires
92350
+ // the own-profile endpoints first.
92351
+ const { isPreview, isResolved } = useProfilePreviewState(username);
92352
+ const { data: ownMetadata, isLoading: isOwnMetadataLoading, refetch, } = useGetUserMetadataQuery({
92247
92353
  params: { username },
92248
- });
92249
- const { data: userMetadataEdx, isLoading: isUserMetadataEdxLoading, refetch: refetchUserMetadataEdx, } = useGetUserMetadataEdxQuery({
92354
+ }, { skip: !isResolved || isPreview });
92355
+ const { data: ownMetadataEdx, isLoading: isOwnMetadataEdxLoading, refetch: refetchUserMetadataEdx, } = useGetUserMetadataEdxQuery({
92250
92356
  params: { username },
92251
- });
92357
+ }, { skip: !isResolved || isPreview });
92358
+ // Someone else's profile: the endpoints above refuse watchers, while the
92359
+ // summary serves the profile-card fields to every viewer allowed to see them.
92360
+ const { data: profileSummary, isLoading: isProfileSummaryLoading } = useGetUserProfileSummaryQuery({ username, platformKey: options.platformKey }, { skip: !isPreview });
92361
+ const previewProfile = useMemo(() => (profileSummary ? fromProfileSummary(profileSummary) : undefined), [profileSummary]);
92362
+ const userMetadata = isPreview ? previewProfile === null || previewProfile === void 0 ? void 0 : previewProfile.userMetadata : ownMetadata;
92363
+ const userMetadataEdx = isPreview ? previewProfile === null || previewProfile === void 0 ? void 0 : previewProfile.userMetadataEdx : ownMetadataEdx;
92364
+ const isUserMetadataLoading = !isResolved || (isPreview ? isProfileSummaryLoading : isOwnMetadataLoading);
92365
+ const isUserMetadataEdxLoading = !isResolved || (isPreview ? isProfileSummaryLoading : isOwnMetadataEdxLoading);
92252
92366
  const [updateUserMetadata] = useUpdateUserMetadataMutation();
92253
92367
  const [updateUserMetadataEdx] = useUpdateUserMetadataEdxMutation();
92254
92368
  const [uploadProfileImage, { isLoading: isUploadingProfileImage }] = useUploadProfileImageMutation();
@@ -92457,36 +92571,6 @@ const useProfile = (username) => {
92457
92571
  };
92458
92572
  };
92459
92573
 
92460
- const getUserName$1 = () => {
92461
- var _a;
92462
- return (_a = JSON.parse(localStorage.getItem("userData"))) === null || _a === void 0 ? void 0 : _a.user_nicename;
92463
- };
92464
-
92465
- /**
92466
- * The signed-in user's username, or an empty string before it is known. Read
92467
- * from localStorage after mount to stay SSR-safe.
92468
- */
92469
- function useCurrentUsername() {
92470
- const [currentUsername, setCurrentUsername] = useState('');
92471
- useEffect(() => {
92472
- try {
92473
- setCurrentUsername(getUserName$1() || '');
92474
- }
92475
- catch (_a) {
92476
- setCurrentUsername('');
92477
- }
92478
- }, []);
92479
- return currentUsername;
92480
- }
92481
- /**
92482
- * True when the logged-in user is viewing someone else's profile (preview
92483
- * mode), so editing affordances can be hidden.
92484
- */
92485
- function useIsProfilePreview(username) {
92486
- const currentUsername = useCurrentUsername();
92487
- return !!currentUsername && currentUsername !== username;
92488
- }
92489
-
92490
92574
  const Dialog = DialogPrimitive.Root;
92491
92575
  const DialogTrigger = DialogPrimitive.Trigger;
92492
92576
  const DialogPortal = DialogPrimitive.Portal;
@@ -186230,7 +186314,7 @@ function Profile({ tenant, username, tenants, onClose, customization = {}, isAdm
186230
186314
  const [isExperienceDialogOpen, setIsExperienceDialogOpen] = useState(false);
186231
186315
  const [educationSubTab, setEducationSubTab] = useState('education');
186232
186316
  const [experienceSubTab, setExperienceSubTab] = useState('experience');
186233
- const { basicForm, socialForm, isUserMetadataLoading, userMetadata, handleProfileImageUpload, isUploadingProfileImage, userMetadataEdx, isUserMetadataEdxLoading, FACEBOOK_URL_PREFIX, X_URL_PREFIX, LINKEDIN_URL_PREFIX, handleSocialLinkChange, socialValidators, basicValidators, } = useProfile(username);
186317
+ const { basicForm, socialForm, isUserMetadataLoading, userMetadata, handleProfileImageUpload, isUploadingProfileImage, userMetadataEdx, isUserMetadataEdxLoading, FACEBOOK_URL_PREFIX, X_URL_PREFIX, LINKEDIN_URL_PREFIX, handleSocialLinkChange, socialValidators, basicValidators, } = useProfile(username, { platformKey: tenant });
186234
186318
  useEffect(() => {
186235
186319
  const firstInput = document.getElementById('fullName');
186236
186320
  if (firstInput) {
@@ -241464,6 +241548,25 @@ const RetrainScheduleModal$1 = dynamic(() => Promise.resolve().then(function ()
241464
241548
  const TrainOrDeleteModal$1 = dynamic(() => Promise.resolve().then(function () { return trainOrDeleteModal; }).then((mod) => ({
241465
241549
  default: mod.TrainOrDeleteModal,
241466
241550
  })));
241551
+ /**
241552
+ * Crawlable documents are re-fetched over HTTP on retrain, so crawler options
241553
+ * (such as a custom User-Agent) apply to them. Local uploads and cloud-provider
241554
+ * documents are not re-fetched, so they are not crawlable.
241555
+ */
241556
+ function isCrawlableDocType(documentType) {
241557
+ const docType = documentType === null || documentType === void 0 ? void 0 : documentType.toLowerCase();
241558
+ // Uploaded documents (local files like PDF, DOCX, etc.)
241559
+ const uploadedFileTypes = ['file'];
241560
+ if (uploadedFileTypes.some((type) => docType === null || docType === void 0 ? void 0 : docType.includes(type))) {
241561
+ return false;
241562
+ }
241563
+ // Cloud storage providers
241564
+ const cloudProviders = ['google drive', 'onedrive', 'dropbox', 'one drive'];
241565
+ if (cloudProviders.some((provider) => docType === null || docType === void 0 ? void 0 : docType.includes(provider))) {
241566
+ return false;
241567
+ }
241568
+ return true;
241569
+ }
241467
241570
  function DatasetItem({ dataset, onSelect, isSelected, labels }) {
241468
241571
  var _a, _b, _c, _d, _e;
241469
241572
  const t = useT();
@@ -241492,10 +241595,12 @@ function DatasetItem({ dataset, onSelect, isSelected, labels }) {
241492
241595
  console.error(JSON.stringify({ tenant: tenantKey, error }));
241493
241596
  }
241494
241597
  };
241495
- const handleTrainDataset = async () => {
241598
+ const handleTrainDataset = async (userAgent) => {
241599
+ const trimmedUserAgent = userAgent === null || userAgent === void 0 ? void 0 : userAgent.trim();
241496
241600
  await handleEditTrainingDocument({
241497
241601
  url: dataset.url,
241498
241602
  train: true,
241603
+ ...(trimmedUserAgent ? { crawler_extra_headers: { 'User-Agent': trimmedUserAgent } } : {}),
241499
241604
  });
241500
241605
  setIsTrainOrDeleteModalOpen(false);
241501
241606
  };
@@ -241505,23 +241610,12 @@ function DatasetItem({ dataset, onSelect, isSelected, labels }) {
241505
241610
  };
241506
241611
  // Helper function to check if retrain should be disabled
241507
241612
  const isRetrainDisabled = () => {
241508
- var _a;
241509
241613
  // Disable if the dataset is not trained yet
241510
241614
  if (!dataset.is_trained) {
241511
241615
  return true;
241512
241616
  }
241513
- const docType = (_a = dataset.document_type) === null || _a === void 0 ? void 0 : _a.toLowerCase();
241514
- // Disable for uploaded documents (local files like PDF, DOCX, etc.)
241515
- const uploadedFileTypes = ['file'];
241516
- if (uploadedFileTypes.some((type) => docType === null || docType === void 0 ? void 0 : docType.includes(type))) {
241517
- return true;
241518
- }
241519
- // Disable for cloud storage providers
241520
- const cloudProviders = ['google drive', 'onedrive', 'dropbox', 'one drive'];
241521
- if (cloudProviders.some((provider) => docType === null || docType === void 0 ? void 0 : docType.includes(provider))) {
241522
- return true;
241523
- }
241524
- return false;
241617
+ // Disable for uploaded documents and cloud storage providers
241618
+ return !isCrawlableDocType(dataset.document_type);
241525
241619
  };
241526
241620
  return (jsxs(Fragment$1, { children: [jsxs(TableRow, { className: `border-b last:border-0 ${onSelect ? 'hover:bg-muted/50 cursor-pointer' : ''} ${isSelected ? 'bg-blue-50' : ''}`, onClick: onSelect ? () => onSelect(dataset) : undefined, children: [jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { asChild: true, children: jsx(TableCell, { className: "max-w-[200px] truncate p-3 font-medium whitespace-nowrap text-[#646464]", children: jsx(WithFormPermissions, { name: ['document_name', 'url'],
241527
241621
  // @ts-ignore
@@ -241549,7 +241643,7 @@ function DatasetItem({ dataset, onSelect, isSelected, labels }) {
241549
241643
  }
241550
241644
  }, className: "text-gray-500 hover:text-gray-700", disabled: isEditTrainingDocumentLoading || disabled, children: dataset.access === 'private' ? (jsxs(Fragment$1, { children: [jsx(EyeOff, { className: "h-4 w-4" }), jsx("span", { className: "sr-only", children: t('datasetsTabDatasetItem.makePublic') })] })) : (jsxs(Fragment$1, { children: [jsx(Eye, { className: "h-4 w-4" }), jsx("span", { className: "sr-only", children: t('datasetsTabDatasetItem.makePrivate') })] })) })) }) }), jsx(TableCell, { className: "p-3 whitespace-nowrap", children: jsx(WithFormPermissions, { name: "is_trained",
241551
241645
  // @ts-ignore
241552
- permissions: (_e = dataset === null || dataset === void 0 ? void 0 : dataset.permissions) === null || _e === void 0 ? void 0 : _e.field, children: ({ disabled }) => (jsx(TrainingStatusSwitch, { is_trained: dataset.is_trained, url: dataset.url, disabled: disabled, training_status: dataset.training_status, handleEditTrainingDocument: handleEditTrainingDocument, onUntrainSuccess: () => setIsDeleteDatasetModalOpen(true), onTrainRequest: () => setIsTrainOrDeleteModalOpen(true) })) }) })] }, dataset.id), isDeleteDatasetModalOpen && (jsx(DeleteDatasetModal$1, { isOpen: isDeleteDatasetModalOpen, onClose: () => setIsDeleteDatasetModalOpen(false), dataset: dataset, labels: labels })), isRetrainScheduleModalOpen && (jsx(RetrainScheduleModal$1, { isOpen: isRetrainScheduleModalOpen, onClose: () => setIsRetrainScheduleModalOpen(false), dataset: dataset, labels: labels })), isTrainOrDeleteModalOpen && (jsx(TrainOrDeleteModal$1, { isOpen: isTrainOrDeleteModalOpen, onClose: () => setIsTrainOrDeleteModalOpen(false), onTrain: handleTrainDataset, onDelete: handleDeleteFromTrainModal, isLoading: isEditTrainingDocumentLoading, labels: labels }))] }));
241646
+ permissions: (_e = dataset === null || dataset === void 0 ? void 0 : dataset.permissions) === null || _e === void 0 ? void 0 : _e.field, children: ({ disabled }) => (jsx(TrainingStatusSwitch, { is_trained: dataset.is_trained, url: dataset.url, disabled: disabled, training_status: dataset.training_status, handleEditTrainingDocument: handleEditTrainingDocument, onUntrainSuccess: () => setIsDeleteDatasetModalOpen(true), onTrainRequest: () => setIsTrainOrDeleteModalOpen(true) })) }) })] }, dataset.id), isDeleteDatasetModalOpen && (jsx(DeleteDatasetModal$1, { isOpen: isDeleteDatasetModalOpen, onClose: () => setIsDeleteDatasetModalOpen(false), dataset: dataset, labels: labels })), isRetrainScheduleModalOpen && (jsx(RetrainScheduleModal$1, { isOpen: isRetrainScheduleModalOpen, onClose: () => setIsRetrainScheduleModalOpen(false), dataset: dataset, labels: labels })), isTrainOrDeleteModalOpen && (jsx(TrainOrDeleteModal$1, { isOpen: isTrainOrDeleteModalOpen, onClose: () => setIsTrainOrDeleteModalOpen(false), onTrain: handleTrainDataset, onDelete: handleDeleteFromTrainModal, showUserAgentField: isCrawlableDocType(dataset.document_type), isLoading: isEditTrainingDocumentLoading, labels: labels }))] }));
241553
241647
  }
241554
241648
  function TrainingStatusSwitch({ is_trained, url, training_status, disabled, handleEditTrainingDocument, onUntrainSuccess, onTrainRequest, }) {
241555
241649
  const t = useT();
@@ -241622,6 +241716,9 @@ const AGENT_DATASETS_TAB_LABELS = {
241622
241716
  delete: 'Delete',
241623
241717
  train: 'Train',
241624
241718
  training: 'Training...',
241719
+ userAgentLabel: 'User-Agent (optional)',
241720
+ userAgentPlaceholder: 'Iblai-bot/1.0 (+https://ibl.ai/bot)',
241721
+ userAgentHelpText: 'Optional. Overrides the default crawler User-Agent for every request. Leave blank to keep the current setting.',
241625
241722
  },
241626
241723
  retrainScheduleModal: {
241627
241724
  title: 'Schedule Retraining',
@@ -241682,6 +241779,9 @@ function buildDatasetsTabLabels(t) {
241682
241779
  delete: t('datasetsTabLabels.trainOrDeleteModal.delete'),
241683
241780
  train: t('datasetsTabLabels.trainOrDeleteModal.train'),
241684
241781
  training: t('datasetsTabLabels.trainOrDeleteModal.training'),
241782
+ userAgentLabel: t('datasetsTabLabels.trainOrDeleteModal.userAgentLabel'),
241783
+ userAgentPlaceholder: t('datasetsTabLabels.trainOrDeleteModal.userAgentPlaceholder'),
241784
+ userAgentHelpText: t('datasetsTabLabels.trainOrDeleteModal.userAgentHelpText'),
241685
241785
  },
241686
241786
  retrainScheduleModal: {
241687
241787
  title: t('datasetsTabLabels.retrainScheduleModal.title'),
@@ -245681,8 +245781,9 @@ var retrainScheduleModal = /*#__PURE__*/Object.freeze({
245681
245781
  RetrainScheduleModal: RetrainScheduleModal
245682
245782
  });
245683
245783
 
245684
- function TrainOrDeleteModal({ isOpen, onClose, onTrain, onDelete, isLoading, labels, }) {
245685
- return (jsx(Dialog, { open: isOpen, onOpenChange: onClose, children: jsxs(DialogContent, { "aria-describedby": "train-or-delete-description", className: "gap-0", children: [jsx(DialogHeader, { children: jsx(DialogTitle, { className: "ibl-dialog-title", children: labels.trainOrDeleteModal.title }) }), jsx("div", { className: "my-5", children: jsx("p", { id: "train-or-delete-description", className: "text-sm text-[#646464]", children: labels.trainOrDeleteModal.description }) }), jsxs(DialogFooter, { className: "gap-3", children: [jsx(Button$1, { variant: "outline", onClick: onDelete, disabled: isLoading, children: labels.trainOrDeleteModal.delete }), jsx(Button$1, { className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", onClick: onTrain, disabled: isLoading, children: isLoading ? labels.trainOrDeleteModal.training : labels.trainOrDeleteModal.train })] })] }) }));
245784
+ function TrainOrDeleteModal({ isOpen, onClose, onTrain, onDelete, isLoading, showUserAgentField, labels, }) {
245785
+ const [userAgent, setUserAgent] = React__default.useState('');
245786
+ return (jsx(Dialog, { open: isOpen, onOpenChange: onClose, children: jsxs(DialogContent, { "aria-describedby": "train-or-delete-description", className: "gap-0", children: [jsx(DialogHeader, { children: jsx(DialogTitle, { className: "ibl-dialog-title", children: labels.trainOrDeleteModal.title }) }), jsx("div", { className: "my-5", children: jsx("p", { id: "train-or-delete-description", className: "text-sm text-[#646464]", children: labels.trainOrDeleteModal.description }) }), showUserAgentField && (jsxs("div", { className: "mb-5 space-y-2", children: [jsx(Label$2, { htmlFor: "train-user-agent", className: "text-sm font-medium", children: labels.trainOrDeleteModal.userAgentLabel }), jsx(Input, { id: "train-user-agent", type: "text", value: userAgent, onChange: (e) => setUserAgent(e.target.value), disabled: isLoading, placeholder: labels.trainOrDeleteModal.userAgentPlaceholder, className: "h-10" }), jsx("p", { className: "text-muted-foreground text-xs", children: labels.trainOrDeleteModal.userAgentHelpText })] })), jsxs(DialogFooter, { className: "gap-3", children: [jsx(Button$1, { variant: "outline", onClick: onDelete, disabled: isLoading, children: labels.trainOrDeleteModal.delete }), jsx(Button$1, { className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", onClick: () => onTrain(userAgent.trim() || undefined), disabled: isLoading, children: isLoading ? labels.trainOrDeleteModal.training : labels.trainOrDeleteModal.train })] })] }) }));
245686
245787
  }
245687
245788
 
245688
245789
  var trainOrDeleteModal = /*#__PURE__*/Object.freeze({
@@ -2,7 +2,7 @@ import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
3
  import React__default, { useState, useEffect, forwardRef, createElement as createElement$3, useLayoutEffect, createContext, useContext, useMemo, useReducer, useRef, useImperativeHandle, useCallback, isValidElement, Children, PureComponent, cloneElement, Component as Component$1, useId as useId$2, useDebugValue, lazy, Suspense } from 'react';
4
4
  import * as dataLayer from '@iblai/data-layer';
5
- import { useGetUserMetadataQuery, useGetUserMetadataEdxQuery, useUpdateUserMetadataMutation, useUpdateUserMetadataEdxMutation, useUploadProfileImageMutation, useResetPasswordMutation, useSelfRetireMutation, useCreateUserInstitutionMutation, useGetUserInstitutionsQuery, useCreateUserEducationMutation, useUpdateUserEducationMutation, useDeleteUserEducationMutation, useGetUserEducationQuery, useCreateUserCompanyMutation, useGetUserCompaniesQuery, useCreateUserExperienceMutation, useUpdateUserExperienceMutation, useDeleteUserExperienceMutation, useGetUserExperienceQuery, useGetUserResumeQuery, useCreateUserResumeMutation, useGetMySubscriptionsQuery, useGetItemSubscriptionQuery, useCancelSubscriptionMutation, useGetLearnerDetailsQuery, useGetUserEnrolledCoursesQuery, useGetUserEnrolledProgramsQuery, useGetUserCatalogPathwaysQuery, useGetUsersAsAssertionsQuery, useGetUserEarnedSkillsQuery, useGetUserReportedSkillsQuery, useGetUserDesiredSkillsQuery, useCreateGlobalMemoryMutation, useUpdateGlobalMemoryMutation, useUpdateMentorMemoryMutation, useGetMemsearchStatusQuery, useGetUserMemorySettingsQuery, useUpdateUserMemorySettingsMutation, useGetGlobalMemoriesQuery, useGetAllMentorMemoriesQuery, useDeleteGlobalMemoryMutation, useDeleteMentorMemoryMutation, useGetAiSearchMentorsQuery, useStarMentorMutation, useUnstarMentorMutation, useGetUserChatHistoryReportsQuery, USER_CHAT_HISTORY_REPORT_ACTIVE_STATES, useCreateUserChatHistoryReportMutation, useLazyGetDownloadReportFromURLQuery, useGetUserChatHistoryReportStatusQuery, userChatHistoryApiSlice, USER_CHAT_HISTORY_QUERY_KEYS, useGetUserChatHistoryQuery, useGetUserChatHistoryFilterQuery, useGetMentorsQuery, useGetUserChatHistorySessionQuery, useInviteUserMutation, usePlatformInvitationsQuery, useCreateCatalogInvitationCourseBulkMutation, useGetCatalogInvitationsCourseQuery, useLazyPlatformUsersQuery, useLazyPlatformUserGroupsQuery, useGetPersonnalizedSearchQuery, useCreateCatalogInvitationProgramBulkMutation, useGetCatalogInvitationsProgramQuery, useUpdateUserRoleMutation, useUpdateUserStatusMutation, useUpdatePlatformUserRoleWithPoliciesMutation, usePlatformUsersQuery, useGetAccessibleUsersQuery, isPoliciesResponse, platformApiSlice, featureTags, useLazyGetRbacTeamsAccessListQuery, useCreateRbacTeamsAccessMutation, useGetRbacGroupsQuery, usePlatformUserGroupsQuery, useCreateRbacGroupMutation, useUpdateRbacGroupMutation, useDeleteRbacGroupMutation, useCreatePlatformUserGroupMutation, useUpdatePlatformUserGroupMutation, useDeletePlatformUserGroupMutation, useGetRbacGroupDetailsQuery, useGetPlatformUserGroupDetailsQuery, useGetRbacPermissionsMutation, useGetRbacRolesQuery, useCreateRbacRoleMutation, useUpdateRbacRoleMutation, useDeleteRbacRoleMutation, useGetRbacRoleDetailsQuery, useGetRbacActionsDefinitionQuery, useGetRbacResourceDiscoveryQuery, useGetRbacResourceListQuery, useGetRbacPoliciesQuery, useCreateRbacPolicyMutation, useUpdateRbacPolicyMutation, useDeleteRbacPolicyMutation, useGetRbacPolicyDetailsQuery, useGetWatchedGroupsQuery, useCreateWatchedGroupMutation, useUpdateWatchedGroupMutation, useDeleteWatchedGroupMutation, useAddWatchedUserMutation, useRemoveWatchedUserMutation, useAddWatcherMutation, useUpdateWatcherMutation, useDeleteWatcherMutation, useGetWatchedUsersQuery, useGetWatchersQuery, WATCHER_NOTIFICATION_EVENTS, WATCHER_NOTIFICATION_EVENT_LABELS, useGetApplicationFormsQuery, useGetApplicationFormDetailQuery, useCreateApplicationFormMutation, useUpdateApplicationFormMutation, useGetApplicationAdminDetailQuery, useInviteApplicationCandidateMutation, useLazyGetApplicationAttachmentFileQuery, useCreateApplicationWaiverMutation, useDeleteApplicationWaiverMutation, useSubmitApplicationOverrideMutation, useUpdateApplicationPlacementMutation, useDeleteApplicationCourseAssignmentMutation, useCreateApplicationNoteMutation, useUpdateApplicationNoteMutation, useDeleteApplicationNoteMutation, useTransitionApplicationMutation, useLinkApplicationCandidateMutation, useCreateApplicationPlacementsMutation, useGetCustomMentorsQuery, useCreateApplicationCourseAssignmentsMutation, useGetApplicationBlocksQuery, useDeleteApplicationBlockMutation, useGetApplicationsPipelineStatsQuery, useGetApplicationsPipelineQuery, useGetTenantMetadataQuery, useUpdateTenantMetadataMutation, useLazyGetTenantMetadataQuery, useDeleteApiKeyMutation, useGetApiKeyQuery, useGetApiKeyFieldPermissionsQuery, useUpdateApiKeyMutation, useGetApiKeysQuery, unwrapApiTokenList, useCreateApiKeyMutation, useCreateLLMCredentialMutation, useGetCredentialsSchemaQuery, useGetMaskedLLMCredentialsQuery, useGetLlmsQuery, useDeleteIntegrationCredentialMutation, useDeleteCredentialMutation, useCreateIntegrationCredentialMutation, useGetIntegrationCredentialsSchemaQuery, useGetMaskedIntegrationCredentialsQuery, useGetAccountBillingInfoQuery, useUpdateAutoRechargeInfoMutation, useTriggerAutoRechargeMutation, useGetAgentSpendCapQuery, useGetTenantSpendCapQuery, useListAgentUserSpendCapsQuery, useUpsertAgentSpendCapMutation, useDeleteAgentSpendCapMutation, useUpsertTenantSpendCapMutation, useDeleteTenantSpendCapMutation, useUpsertUserSpendCapMutation, useDeleteUserSpendCapMutation, useGetLlmUsageMetricsQuery, useListAgentSpendCapsQuery, useGetCreditTransactionsQuery, useCreateStripeCustomerPortalMutation, useSetPlatformConfigurationsMutation, useGetPlatformConfigurationsQuery, useUpdatePlatformMembershipMutation, useGetPlatformMembershipQuery, useGetCustomDomainsQuery, useCreateCustomDomainMutation, useDeleteCustomDomainMutation, useGetStudentMentorCreationStatusQuery, useSetStudentMentorCreationStatusMutation, coreApiSlice, recommendationPromptTypeEnum, useGetRecommendedPromptsListQuery, useCreateRecommendedPromptMutation, useUpdateRecommendedPromptMutation, useDeleteRecommendedPromptMutation, useLazyGetPublicPlatformImageAssetFileUrlQuery, useCreatePlatformImageAssetMutation, useGetProviderConfigQuery, useCreateProviderConfigMutation, useDeleteProviderConfigMutation, useGetExternalMappingQuery, useGetCredentialsListQuery, useCreateExternalMappingMutation, useDeleteExternalMappingMutation, useGetMemsearchConfigQuery, useUpdateMemsearchConfigMutation, useGetStripeConnectStatusQuery, useStartStripeConnectOnboardingMutation, useLazyGetStripeConnectDashboardQuery, useListPaywallsQuery, useListPricesQuery, useCreatePriceMutation, useUpdatePriceMutation, useDeletePriceMutation, useGetPaywallConfigQuery, useEnablePaywallMutation, useUpdatePaywallMutation, useGetMentorMemoriesListQuery, useGetMemoryCategoriesAdminQuery, useCreateMentorMemoryMutation, useLazyGetCourseMetaDataQuery, useLazyGetCourseCompletionOutlinesQuery, useLazyGetCourseEligibilityQuery, useLazyGetEdxSSOTokenQuery, useCreateCourseEnrollmentMutation, useCreateStripeCheckoutSessionMutation, useLazyGetCourseProgressQuery, useLazyGetCourseCompletionQuery, useUpdateExamAttemptMutation, useStartExamMutation, useLazyGetExamInfoQuery, useGetAgentSkillResourcesQuery, useCreateAgentSkillResourceMutation, useUpdateAgentSkillResourceMutation, useUploadAgentSkillResourceAssetMutation, useDeleteAgentSkillResourceMutation, useGetMentorSkillAssignmentsQuery, useGetAgentSkillsQuery, useCreateMentorSkillAssignmentMutation, useUpdateMentorSkillAssignmentMutation, useDeleteMentorSkillAssignmentMutation, useCreateAgentSkillMutation, useUpdateAgentSkillMutation, useDeleteAgentSkillMutation, filterSlashSkills, useGetMentorSkillAssignmentsInfiniteQuery, MENTOR_SKILL_ASSIGNMENTS_PAGE_SIZE, useUpdateUserProjectMutation, useGetTrainingDocumentsQuery, useGetVectorDocumentsQuery, useLazyGetConnectedServiceAuthUrlQuery, useCreateUserProjectMutation, useDeleteUserProjectMutation, useGetUserProjectDetailsQuery, useEditTrainingDocumentMutation, useAddTrainingDocumentMutation, useLazyGetCredentialsQuery, useGetMentorSettingsQuery, useEditMentorMutation, useUploadLightLogoMutation, useUploadDarkLogoMutation, useUpdatePlatformInfoMutation, LOGO_ENDPOINTS, useCreateEvalDatasetMutation, useAddEvalDatasetItemsMutation, useUploadEvalDatasetCsvMutation, useDeleteEvalDatasetItemMutation, useListEvalDatasetItemsQuery, evalTotalPages, useListEvalDatasetsQuery, useGetUserProjectsQuery, useCreateSessionIdMutation, useGetMentorCategoriesQuery, useGetTenantChatPrivacyConfigQuery as useGetTenantChatPrivacyConfigQuery$1, useGetCallConfigurationsQuery, useCreateCallConfigurationMutation, useUpdateCallConfigurationMutation, chatPrivacyApiSlice, useDeleteMentorMutation, useForkMentorMutation, useGetToolsQuery, useLazyGetMCPServersQuery, useOauthFindMutation, useLazyStartOAuthFlowQuery, useCreateMCPServerMutation, usePartialUpdateMCPServerMutation, useCreateMCPServerConnectionMutation, usePatchMCPServerConnectionMutation, useGetConnectedServicesQuery, useGetMCPServersQuery, useGetMCPServerConnectionsQuery, useUpdateMCPServerMutation, useDeleteMCPServerMutation, useEditMentorJsonMutation, useDisconnectServiceMutation, useGetPromptCategoriesQuery, PRIVACY_ACTIONS, PRIVACY_ENTITY_TYPES, useGetVoicesQuery, useGetVoiceQuery, isBaseAgentMentor, useGetGradeResultQuery, useOverrideGradeResultMutation, useGetChatHistoryFilterQuery, useListGradeResultsQuery, useGetMentorGraderConfigurationQuery, useListGraderCriteriaQuery, useCreateMentorGraderConfigurationMutation, useUpdateMentorGraderConfigurationMutation, useCreateGraderCriterionMutation, useUpdateGraderCriterionMutation, useDeleteGraderCriterionMutation, useGetSpendCapStatusQuery, useGetMentorPublicSettingsQuery, useGetChatHistoryQuery, useGetMentorSummariesQuery, useGetConversationMemoriesQuery, useGetSupportTicketsQuery, useGetSupportTicketMessagesQuery, useCreateSupportTicketMessageMutation, usePatchSupportTicketMutation, useCloseSupportTicketMutation, useCreateLtiMentorMutation, useUpdateLtiMentorMutation, useGetLtiMentorsQuery, useDeleteLtiMentorMutation, useCreateLtiKeyMutation, useUpdateLtiKeyMutation, useDeleteLtiKeyMutation, useGetLtiKeysQuery, useCreateLtiToolMutation, useUpdateLtiToolMutation, useGetLtiToolsQuery, useGetPlatformInfoQuery, useCreatePromptMutation, useGetPromptsSearchQuery, useUpdatePromptMutation, useCreateRedirectTokenMutation, useGetShareableLinkQuery, useCreateShareableLinkMutation, useUpdateShareableLinkMutation, useCreateDisclaimerMutation, useUpdateDisclaimerMutation, useGetDisclaimersQuery, useUpdateRbacMentorAccessMutation, useGetRbacMentorAccessListQuery, useStartEvalRunMutation, useEvaluateEvalRunMutation, useGetEvalRunQuery, useDeleteEvalScoreMutation, useListEvalRunJudgesQuery, useCreateEvalScoreMutation, useDeleteEvalRunMutation, useExportEvalRunMutation, useListEvalRunsQuery, useLazyGetEvalRunQuery, evaluationsApiSlice, EVALUATIONS_TAGS, useGetPersonnalizedMentorsQuery, useCreateCallCredentialsMutation, useGetGuidedPromptsQuery, useUpdateChatSessionSharedMutation, useUpdateMessageFeedbackMutation, useLazyGetPromptsSearchQuery, useLazyGetGuidedPromptsQuery, useGetPublicMentorsQuery, useGetPeriodicAgentsQuery, useGetPeriodicAgentLogsListQuery, useCreatePeriodicAgentMutation, useDeletePeriodicAgentMutation, useCreateMemoryCategoryMutation, useUpdateMemoryCategoryMutation, useDeleteMemoryCategoryMutation, useDeletePromptMutation, useDeleteTrainingDocumentMutation, useGetTrainingDocumentRetrainScheduleQuery, useCreateTrainingDocumentRetrainScheduleMutation, useUpdateArtifactMutation, useLazyGetArtifactVersionQuery, useLazyListArtifactVersionsQuery, useSetCurrentVersionMutation, useListArtifactVersionsQuery, useLazyGetArtifactQuery, useLazyListArtifactsQuery, useEditSessionMutation } from '@iblai/data-layer';
5
+ import { useGetUserMetadataQuery, useGetUserMetadataEdxQuery, useGetUserProfileSummaryQuery, useUpdateUserMetadataMutation, useUpdateUserMetadataEdxMutation, useUploadProfileImageMutation, useResetPasswordMutation, useSelfRetireMutation, useCreateUserInstitutionMutation, useGetUserInstitutionsQuery, useCreateUserEducationMutation, useUpdateUserEducationMutation, useDeleteUserEducationMutation, useGetUserEducationQuery, useCreateUserCompanyMutation, useGetUserCompaniesQuery, useCreateUserExperienceMutation, useUpdateUserExperienceMutation, useDeleteUserExperienceMutation, useGetUserExperienceQuery, useGetUserResumeQuery, useCreateUserResumeMutation, useGetMySubscriptionsQuery, useGetItemSubscriptionQuery, useCancelSubscriptionMutation, useGetLearnerDetailsQuery, useGetUserEnrolledCoursesQuery, useGetUserEnrolledProgramsQuery, useGetUserCatalogPathwaysQuery, useGetUsersAsAssertionsQuery, useGetUserEarnedSkillsQuery, useGetUserReportedSkillsQuery, useGetUserDesiredSkillsQuery, useCreateGlobalMemoryMutation, useUpdateGlobalMemoryMutation, useUpdateMentorMemoryMutation, useGetMemsearchStatusQuery, useGetUserMemorySettingsQuery, useUpdateUserMemorySettingsMutation, useGetGlobalMemoriesQuery, useGetAllMentorMemoriesQuery, useDeleteGlobalMemoryMutation, useDeleteMentorMemoryMutation, useGetAiSearchMentorsQuery, useStarMentorMutation, useUnstarMentorMutation, useGetUserChatHistoryReportsQuery, USER_CHAT_HISTORY_REPORT_ACTIVE_STATES, useCreateUserChatHistoryReportMutation, useLazyGetDownloadReportFromURLQuery, useGetUserChatHistoryReportStatusQuery, userChatHistoryApiSlice, USER_CHAT_HISTORY_QUERY_KEYS, useGetUserChatHistoryQuery, useGetUserChatHistoryFilterQuery, useGetMentorsQuery, useGetUserChatHistorySessionQuery, useInviteUserMutation, usePlatformInvitationsQuery, useCreateCatalogInvitationCourseBulkMutation, useGetCatalogInvitationsCourseQuery, useLazyPlatformUsersQuery, useLazyPlatformUserGroupsQuery, useGetPersonnalizedSearchQuery, useCreateCatalogInvitationProgramBulkMutation, useGetCatalogInvitationsProgramQuery, useUpdateUserRoleMutation, useUpdateUserStatusMutation, useUpdatePlatformUserRoleWithPoliciesMutation, usePlatformUsersQuery, useGetAccessibleUsersQuery, isPoliciesResponse, platformApiSlice, featureTags, useLazyGetRbacTeamsAccessListQuery, useCreateRbacTeamsAccessMutation, useGetRbacGroupsQuery, usePlatformUserGroupsQuery, useCreateRbacGroupMutation, useUpdateRbacGroupMutation, useDeleteRbacGroupMutation, useCreatePlatformUserGroupMutation, useUpdatePlatformUserGroupMutation, useDeletePlatformUserGroupMutation, useGetRbacGroupDetailsQuery, useGetPlatformUserGroupDetailsQuery, useGetRbacPermissionsMutation, useGetRbacRolesQuery, useCreateRbacRoleMutation, useUpdateRbacRoleMutation, useDeleteRbacRoleMutation, useGetRbacRoleDetailsQuery, useGetRbacActionsDefinitionQuery, useGetRbacResourceDiscoveryQuery, useGetRbacResourceListQuery, useGetRbacPoliciesQuery, useCreateRbacPolicyMutation, useUpdateRbacPolicyMutation, useDeleteRbacPolicyMutation, useGetRbacPolicyDetailsQuery, useGetWatchedGroupsQuery, useCreateWatchedGroupMutation, useUpdateWatchedGroupMutation, useDeleteWatchedGroupMutation, useAddWatchedUserMutation, useRemoveWatchedUserMutation, useAddWatcherMutation, useUpdateWatcherMutation, useDeleteWatcherMutation, useGetWatchedUsersQuery, useGetWatchersQuery, WATCHER_NOTIFICATION_EVENTS, WATCHER_NOTIFICATION_EVENT_LABELS, useGetApplicationFormsQuery, useGetApplicationFormDetailQuery, useCreateApplicationFormMutation, useUpdateApplicationFormMutation, useGetApplicationAdminDetailQuery, useInviteApplicationCandidateMutation, useLazyGetApplicationAttachmentFileQuery, useCreateApplicationWaiverMutation, useDeleteApplicationWaiverMutation, useSubmitApplicationOverrideMutation, useUpdateApplicationPlacementMutation, useDeleteApplicationCourseAssignmentMutation, useCreateApplicationNoteMutation, useUpdateApplicationNoteMutation, useDeleteApplicationNoteMutation, useTransitionApplicationMutation, useLinkApplicationCandidateMutation, useCreateApplicationPlacementsMutation, useGetCustomMentorsQuery, useCreateApplicationCourseAssignmentsMutation, useGetApplicationBlocksQuery, useDeleteApplicationBlockMutation, useGetApplicationsPipelineStatsQuery, useGetApplicationsPipelineQuery, useGetTenantMetadataQuery, useUpdateTenantMetadataMutation, useLazyGetTenantMetadataQuery, useDeleteApiKeyMutation, useGetApiKeyQuery, useGetApiKeyFieldPermissionsQuery, useUpdateApiKeyMutation, useGetApiKeysQuery, unwrapApiTokenList, useCreateApiKeyMutation, useCreateLLMCredentialMutation, useGetCredentialsSchemaQuery, useGetMaskedLLMCredentialsQuery, useGetLlmsQuery, useDeleteIntegrationCredentialMutation, useDeleteCredentialMutation, useCreateIntegrationCredentialMutation, useGetIntegrationCredentialsSchemaQuery, useGetMaskedIntegrationCredentialsQuery, useGetAccountBillingInfoQuery, useUpdateAutoRechargeInfoMutation, useTriggerAutoRechargeMutation, useGetAgentSpendCapQuery, useGetTenantSpendCapQuery, useListAgentUserSpendCapsQuery, useUpsertAgentSpendCapMutation, useDeleteAgentSpendCapMutation, useUpsertTenantSpendCapMutation, useDeleteTenantSpendCapMutation, useUpsertUserSpendCapMutation, useDeleteUserSpendCapMutation, useGetLlmUsageMetricsQuery, useListAgentSpendCapsQuery, useGetCreditTransactionsQuery, useCreateStripeCustomerPortalMutation, useSetPlatformConfigurationsMutation, useGetPlatformConfigurationsQuery, useUpdatePlatformMembershipMutation, useGetPlatformMembershipQuery, useGetCustomDomainsQuery, useCreateCustomDomainMutation, useDeleteCustomDomainMutation, useGetStudentMentorCreationStatusQuery, useSetStudentMentorCreationStatusMutation, coreApiSlice, recommendationPromptTypeEnum, useGetRecommendedPromptsListQuery, useCreateRecommendedPromptMutation, useUpdateRecommendedPromptMutation, useDeleteRecommendedPromptMutation, useLazyGetPublicPlatformImageAssetFileUrlQuery, useCreatePlatformImageAssetMutation, useGetProviderConfigQuery, useCreateProviderConfigMutation, useDeleteProviderConfigMutation, useGetExternalMappingQuery, useGetCredentialsListQuery, useCreateExternalMappingMutation, useDeleteExternalMappingMutation, useGetMemsearchConfigQuery, useUpdateMemsearchConfigMutation, useGetStripeConnectStatusQuery, useStartStripeConnectOnboardingMutation, useLazyGetStripeConnectDashboardQuery, useListPaywallsQuery, useListPricesQuery, useCreatePriceMutation, useUpdatePriceMutation, useDeletePriceMutation, useGetPaywallConfigQuery, useEnablePaywallMutation, useUpdatePaywallMutation, useGetMentorMemoriesListQuery, useGetMemoryCategoriesAdminQuery, useCreateMentorMemoryMutation, useLazyGetCourseMetaDataQuery, useLazyGetCourseCompletionOutlinesQuery, useLazyGetCourseEligibilityQuery, useLazyGetEdxSSOTokenQuery, useCreateCourseEnrollmentMutation, useCreateStripeCheckoutSessionMutation, useLazyGetCourseProgressQuery, useLazyGetCourseCompletionQuery, useUpdateExamAttemptMutation, useStartExamMutation, useLazyGetExamInfoQuery, useGetAgentSkillResourcesQuery, useCreateAgentSkillResourceMutation, useUpdateAgentSkillResourceMutation, useUploadAgentSkillResourceAssetMutation, useDeleteAgentSkillResourceMutation, useGetMentorSkillAssignmentsQuery, useGetAgentSkillsQuery, useCreateMentorSkillAssignmentMutation, useUpdateMentorSkillAssignmentMutation, useDeleteMentorSkillAssignmentMutation, useCreateAgentSkillMutation, useUpdateAgentSkillMutation, useDeleteAgentSkillMutation, filterSlashSkills, useGetMentorSkillAssignmentsInfiniteQuery, MENTOR_SKILL_ASSIGNMENTS_PAGE_SIZE, useUpdateUserProjectMutation, useGetTrainingDocumentsQuery, useGetVectorDocumentsQuery, useLazyGetConnectedServiceAuthUrlQuery, useCreateUserProjectMutation, useDeleteUserProjectMutation, useGetUserProjectDetailsQuery, useEditTrainingDocumentMutation, useAddTrainingDocumentMutation, useLazyGetCredentialsQuery, useGetMentorSettingsQuery, useEditMentorMutation, useUploadLightLogoMutation, useUploadDarkLogoMutation, useUpdatePlatformInfoMutation, LOGO_ENDPOINTS, useCreateEvalDatasetMutation, useAddEvalDatasetItemsMutation, useUploadEvalDatasetCsvMutation, useDeleteEvalDatasetItemMutation, useListEvalDatasetItemsQuery, evalTotalPages, useListEvalDatasetsQuery, useGetUserProjectsQuery, useCreateSessionIdMutation, useGetMentorCategoriesQuery, useGetTenantChatPrivacyConfigQuery as useGetTenantChatPrivacyConfigQuery$1, useGetCallConfigurationsQuery, useCreateCallConfigurationMutation, useUpdateCallConfigurationMutation, chatPrivacyApiSlice, useDeleteMentorMutation, useForkMentorMutation, useGetToolsQuery, useLazyGetMCPServersQuery, useOauthFindMutation, useLazyStartOAuthFlowQuery, useCreateMCPServerMutation, usePartialUpdateMCPServerMutation, useCreateMCPServerConnectionMutation, usePatchMCPServerConnectionMutation, useGetConnectedServicesQuery, useGetMCPServersQuery, useGetMCPServerConnectionsQuery, useUpdateMCPServerMutation, useDeleteMCPServerMutation, useEditMentorJsonMutation, useDisconnectServiceMutation, useGetPromptCategoriesQuery, PRIVACY_ACTIONS, PRIVACY_ENTITY_TYPES, useGetVoicesQuery, useGetVoiceQuery, isBaseAgentMentor, useGetGradeResultQuery, useOverrideGradeResultMutation, useGetChatHistoryFilterQuery, useListGradeResultsQuery, useGetMentorGraderConfigurationQuery, useListGraderCriteriaQuery, useCreateMentorGraderConfigurationMutation, useUpdateMentorGraderConfigurationMutation, useCreateGraderCriterionMutation, useUpdateGraderCriterionMutation, useDeleteGraderCriterionMutation, useGetSpendCapStatusQuery, useGetMentorPublicSettingsQuery, useGetChatHistoryQuery, useGetMentorSummariesQuery, useGetConversationMemoriesQuery, useGetSupportTicketsQuery, useGetSupportTicketMessagesQuery, useCreateSupportTicketMessageMutation, usePatchSupportTicketMutation, useCloseSupportTicketMutation, useCreateLtiMentorMutation, useUpdateLtiMentorMutation, useGetLtiMentorsQuery, useDeleteLtiMentorMutation, useCreateLtiKeyMutation, useUpdateLtiKeyMutation, useDeleteLtiKeyMutation, useGetLtiKeysQuery, useCreateLtiToolMutation, useUpdateLtiToolMutation, useGetLtiToolsQuery, useGetPlatformInfoQuery, useCreatePromptMutation, useGetPromptsSearchQuery, useUpdatePromptMutation, useCreateRedirectTokenMutation, useGetShareableLinkQuery, useCreateShareableLinkMutation, useUpdateShareableLinkMutation, useCreateDisclaimerMutation, useUpdateDisclaimerMutation, useGetDisclaimersQuery, useUpdateRbacMentorAccessMutation, useGetRbacMentorAccessListQuery, useStartEvalRunMutation, useEvaluateEvalRunMutation, useGetEvalRunQuery, useDeleteEvalScoreMutation, useListEvalRunJudgesQuery, useCreateEvalScoreMutation, useDeleteEvalRunMutation, useExportEvalRunMutation, useListEvalRunsQuery, useLazyGetEvalRunQuery, evaluationsApiSlice, EVALUATIONS_TAGS, useGetPersonnalizedMentorsQuery, useCreateCallCredentialsMutation, useGetGuidedPromptsQuery, useUpdateChatSessionSharedMutation, useUpdateMessageFeedbackMutation, useLazyGetPromptsSearchQuery, useLazyGetGuidedPromptsQuery, useGetPublicMentorsQuery, useGetPeriodicAgentsQuery, useGetPeriodicAgentLogsListQuery, useCreatePeriodicAgentMutation, useDeletePeriodicAgentMutation, useCreateMemoryCategoryMutation, useUpdateMemoryCategoryMutation, useDeleteMemoryCategoryMutation, useDeletePromptMutation, useDeleteTrainingDocumentMutation, useGetTrainingDocumentRetrainScheduleQuery, useCreateTrainingDocumentRetrainScheduleMutation, useUpdateArtifactMutation, useLazyGetArtifactVersionQuery, useLazyListArtifactVersionsQuery, useSetCurrentVersionMutation, useListArtifactVersionsQuery, useLazyGetArtifactQuery, useLazyListArtifactsQuery, useEditSessionMutation } from '@iblai/data-layer';
6
6
  import { removeAuthItem, setAuthItem, isTauriEmbeddedLLMHost, selectRbacPermissions, useCurrentTenant, canViewOtherUsersChatHistory, getInitials, useTenantMetadata, isPureWatcher, WithPermissions, canWriteField, useStripeUpgrade, openExternalUrl, CHAT_AREA_SIZE, isAlphaNumeric32, checkRbacPermission, selectNumberOfActiveChatMessages, useUsername, selectStreaming, isLoggedIn, TOOLS, hasRemoteAiConfig, isSafariBrowser, useShowAttachment, useShowVoiceCall, useShowVoiceRecorder, useMentorSettings, selectShowingSharedChat, useShowFreeTrialDialog, useEmbedMode, chatInputSliceSelectors, useResponsive, useAccessingPublicRoute, useVisitingTenant, useModelFileUploadCapabilities, useChatFileUpload, useVoiceChat, selectAttachedFiles, MENTOR_CHAT_DOCUMENTS_EXTENSIONS, removeFile, chatInputSliceActions, chatActions, WithFormPermissions, useTenantContext, TimeTracker, advancedTabsProperties, defaultSessionIds, pickWritableFields, ANONYMOUS_USERNAME as ANONYMOUS_USERNAME$3, redirectToAuthSpaJoinTenant, selectActiveTab, useAxdToken, useWelcomeMessage, markdownToPlainText, useCachedSessionId, use402ErrorCheck, use401TokenRefresh, selectTokenEnabled, selectToken, useServiceWorker, useUserAgreement, useAdvancedChat, sendMessageToParentWebsite, useMentorTools, useFileDragDrop, eventBus, RemoteEvents, selectEnableChatActionsPopup, advancedTabs, isInIframe, getAuthSpaJoinUrl, addMessage, clearFiles, MENTOR_VISIBILITY } from '@iblai/web-utils';
7
7
  import { useDispatch, useSelector } from 'react-redux';
8
8
  import { toast } from 'sonner';
@@ -98403,7 +98403,10 @@ var datasetsTabLabels$3 = {
98403
98403
  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.",
98404
98404
  "delete": "Delete",
98405
98405
  train: "Train",
98406
- training: "Training..."
98406
+ training: "Training...",
98407
+ userAgentLabel: "User-Agent (optional)",
98408
+ userAgentPlaceholder: "Iblai-bot/1.0 (+https://ibl.ai/bot)",
98409
+ userAgentHelpText: "Optional. Overrides the default crawler User-Agent for every request. Leave blank to keep the current setting."
98407
98410
  },
98408
98411
  retrainScheduleModal: {
98409
98412
  title: "Schedule Retraining",
@@ -105717,7 +105720,10 @@ var datasetsTabLabels$2 = {
105717
105720
  description: "Ce jeu de données n'est pas encore entraîné. Vous pouvez l'entraîner pour le rendre disponible à votre agent, ou le supprimer définitivement s'il n'est plus nécessaire.",
105718
105721
  "delete": "Supprimer",
105719
105722
  train: "Entraîner",
105720
- training: "Entraînement..."
105723
+ training: "Entraînement...",
105724
+ userAgentLabel: "User-Agent (facultatif)",
105725
+ userAgentPlaceholder: "Iblai-bot/1.0 (+https://ibl.ai/bot)",
105726
+ userAgentHelpText: "Facultatif. Remplace le User-Agent par defaut du robot d'exploration pour chaque requete. Laissez vide pour conserver le reglage actuel."
105721
105727
  },
105722
105728
  retrainScheduleModal: {
105723
105729
  title: "Planifier le réentraînement",
@@ -112865,7 +112871,10 @@ var datasetsTabLabels$1 = {
112865
112871
  description: "Este conjunto de datos no está entrenado actualmente. Puede entrenarlo para que esté disponible para su agente, o eliminarlo permanentemente si ya no lo necesita.",
112866
112872
  "delete": "Eliminar",
112867
112873
  train: "Entrenar",
112868
- training: "Entrenando..."
112874
+ training: "Entrenando...",
112875
+ userAgentLabel: "User-Agent (opcional)",
112876
+ userAgentPlaceholder: "Iblai-bot/1.0 (+https://ibl.ai/bot)",
112877
+ userAgentHelpText: "Opcional. Sustituye el User-Agent predeterminado del rastreador en cada solicitud. Dejalo en blanco para conservar la configuracion actual."
112869
112878
  },
112870
112879
  retrainScheduleModal: {
112871
112880
  title: "Programar reentrenamiento",
@@ -120013,7 +120022,10 @@ var datasetsTabLabels = {
120013
120022
  description: "该数据集当前未经训练。您可以对其进行训练以使其可供您的代理使用,或者如果不再需要则将其永久删除。",
120014
120023
  "delete": "删除",
120015
120024
  train: "训练",
120016
- training: "训练中..."
120025
+ training: "训练中...",
120026
+ userAgentLabel: "User-Agent(可选)",
120027
+ userAgentPlaceholder: "Iblai-bot/1.0 (+https://ibl.ai/bot)",
120028
+ userAgentHelpText: "可选。为每个请求覆盖默认的抓取工具 User-Agent。留空则保留当前设置。"
120017
120029
  },
120018
120030
  retrainScheduleModal: {
120019
120031
  title: "计划重新训练",
@@ -127165,6 +127177,55 @@ function useForm(opts) {
127165
127177
  return formApi;
127166
127178
  }
127167
127179
 
127180
+ const getUserName$1 = () => {
127181
+ var _a;
127182
+ return (_a = JSON.parse(localStorage.getItem("userData"))) === null || _a === void 0 ? void 0 : _a.user_nicename;
127183
+ };
127184
+
127185
+ /**
127186
+ * The signed-in user's username, or `null` until it has been read. Read from
127187
+ * localStorage after mount to stay SSR-safe.
127188
+ */
127189
+ function useStoredUsername() {
127190
+ const [currentUsername, setCurrentUsername] = useState(null);
127191
+ useEffect(() => {
127192
+ try {
127193
+ setCurrentUsername(getUserName$1() || '');
127194
+ }
127195
+ catch (_a) {
127196
+ setCurrentUsername('');
127197
+ }
127198
+ }, []);
127199
+ return currentUsername;
127200
+ }
127201
+ /**
127202
+ * The signed-in user's username, or an empty string before it is known.
127203
+ */
127204
+ function useCurrentUsername() {
127205
+ var _a;
127206
+ return (_a = useStoredUsername()) !== null && _a !== void 0 ? _a : '';
127207
+ }
127208
+ /**
127209
+ * True when the logged-in user is viewing someone else's profile (preview
127210
+ * mode), so editing affordances can be hidden.
127211
+ */
127212
+ function useIsProfilePreview(username) {
127213
+ const currentUsername = useCurrentUsername();
127214
+ return !!currentUsername && currentUsername !== username;
127215
+ }
127216
+ /**
127217
+ * Preview mode plus whether the viewer has been read yet. Until `isResolved`,
127218
+ * `isPreview` is false only because the viewer is unknown, so callers picking
127219
+ * between endpoints should hold their requests rather than guess.
127220
+ */
127221
+ function useProfilePreviewState(username) {
127222
+ const currentUsername = useStoredUsername();
127223
+ return {
127224
+ isPreview: !!currentUsername && currentUsername !== username,
127225
+ isResolved: currentUsername !== null,
127226
+ };
127227
+ }
127228
+
127168
127229
  // Define URL prefixes as constants outside the function
127169
127230
  const FACEBOOK_URL_PREFIX = 'https://facebook.com/';
127170
127231
  const X_URL_PREFIX = 'https://x.com/';
@@ -127198,15 +127259,68 @@ const socialFormSchema = z$2.object({
127198
127259
  message: 'Username must be 4 to 15 characters long and can only contain letters, numbers, and underscores.',
127199
127260
  }),
127200
127261
  });
127201
- const useProfile = (username) => {
127262
+ // The summary may hold full profile URLs, while the social form holds handles
127263
+ // and adds its own prefix. The handle is the last path segment; a bare domain
127264
+ // has none.
127265
+ const toSocialHandle = (link) => {
127266
+ var _a;
127267
+ const path = link.trim().replace(/^https?:\/\/[^/]*/i, '');
127268
+ return (_a = path.split('/').filter(Boolean).pop()) !== null && _a !== void 0 ? _a : '';
127269
+ };
127270
+ // Fit the summary into the shapes the profile UI already reads. The summary
127271
+ // has no title or display toggles, so those stay empty.
127272
+ const fromProfileSummary = (summary) => {
127273
+ var _a, _b;
127274
+ const imageUrl = summary.profile_image || '';
127275
+ return {
127276
+ userMetadata: {
127277
+ username: summary.username,
127278
+ name: summary.name,
127279
+ email: summary.email,
127280
+ date_joined: summary.date_joined,
127281
+ bio: summary.bio,
127282
+ about: summary.about,
127283
+ title: '',
127284
+ public_metadata: (_a = summary.public_metadata) !== null && _a !== void 0 ? _a : {},
127285
+ social_links: ((_b = summary.social_links) !== null && _b !== void 0 ? _b : []).map((social) => {
127286
+ var _a;
127287
+ return ({
127288
+ platform: social.platform,
127289
+ social_link: toSocialHandle((_a = social.social_link) !== null && _a !== void 0 ? _a : ''),
127290
+ });
127291
+ }),
127292
+ },
127293
+ userMetadataEdx: {
127294
+ profile_image: {
127295
+ has_image: !!imageUrl,
127296
+ image_url_full: imageUrl,
127297
+ image_url_large: imageUrl,
127298
+ image_url_medium: imageUrl,
127299
+ image_url_small: imageUrl,
127300
+ },
127301
+ },
127302
+ };
127303
+ };
127304
+ const useProfile = (username, options = {}) => {
127202
127305
  var _a, _b, _c, _d, _e, _f, _g, _h;
127203
127306
  //const toast = useToast();
127204
- const { data: userMetadata, isLoading: isUserMetadataLoading, refetch, } = useGetUserMetadataQuery({
127307
+ // Nothing is requested until the viewer is known, so a preview never fires
127308
+ // the own-profile endpoints first.
127309
+ const { isPreview, isResolved } = useProfilePreviewState(username);
127310
+ const { data: ownMetadata, isLoading: isOwnMetadataLoading, refetch, } = useGetUserMetadataQuery({
127205
127311
  params: { username },
127206
- });
127207
- const { data: userMetadataEdx, isLoading: isUserMetadataEdxLoading, refetch: refetchUserMetadataEdx, } = useGetUserMetadataEdxQuery({
127312
+ }, { skip: !isResolved || isPreview });
127313
+ const { data: ownMetadataEdx, isLoading: isOwnMetadataEdxLoading, refetch: refetchUserMetadataEdx, } = useGetUserMetadataEdxQuery({
127208
127314
  params: { username },
127209
- });
127315
+ }, { skip: !isResolved || isPreview });
127316
+ // Someone else's profile: the endpoints above refuse watchers, while the
127317
+ // summary serves the profile-card fields to every viewer allowed to see them.
127318
+ const { data: profileSummary, isLoading: isProfileSummaryLoading } = useGetUserProfileSummaryQuery({ username, platformKey: options.platformKey }, { skip: !isPreview });
127319
+ const previewProfile = useMemo(() => (profileSummary ? fromProfileSummary(profileSummary) : undefined), [profileSummary]);
127320
+ const userMetadata = isPreview ? previewProfile === null || previewProfile === void 0 ? void 0 : previewProfile.userMetadata : ownMetadata;
127321
+ const userMetadataEdx = isPreview ? previewProfile === null || previewProfile === void 0 ? void 0 : previewProfile.userMetadataEdx : ownMetadataEdx;
127322
+ const isUserMetadataLoading = !isResolved || (isPreview ? isProfileSummaryLoading : isOwnMetadataLoading);
127323
+ const isUserMetadataEdxLoading = !isResolved || (isPreview ? isProfileSummaryLoading : isOwnMetadataEdxLoading);
127210
127324
  const [updateUserMetadata] = useUpdateUserMetadataMutation();
127211
127325
  const [updateUserMetadataEdx] = useUpdateUserMetadataEdxMutation();
127212
127326
  const [uploadProfileImage, { isLoading: isUploadingProfileImage }] = useUploadProfileImageMutation();
@@ -127415,36 +127529,6 @@ const useProfile = (username) => {
127415
127529
  };
127416
127530
  };
127417
127531
 
127418
- const getUserName$1 = () => {
127419
- var _a;
127420
- return (_a = JSON.parse(localStorage.getItem("userData"))) === null || _a === void 0 ? void 0 : _a.user_nicename;
127421
- };
127422
-
127423
- /**
127424
- * The signed-in user's username, or an empty string before it is known. Read
127425
- * from localStorage after mount to stay SSR-safe.
127426
- */
127427
- function useCurrentUsername() {
127428
- const [currentUsername, setCurrentUsername] = useState('');
127429
- useEffect(() => {
127430
- try {
127431
- setCurrentUsername(getUserName$1() || '');
127432
- }
127433
- catch (_a) {
127434
- setCurrentUsername('');
127435
- }
127436
- }, []);
127437
- return currentUsername;
127438
- }
127439
- /**
127440
- * True when the logged-in user is viewing someone else's profile (preview
127441
- * mode), so editing affordances can be hidden.
127442
- */
127443
- function useIsProfilePreview(username) {
127444
- const currentUsername = useCurrentUsername();
127445
- return !!currentUsername && currentUsername !== username;
127446
- }
127447
-
127448
127532
  const Dialog = DialogPrimitive.Root;
127449
127533
  const DialogTrigger = DialogPrimitive.Trigger;
127450
127534
  const DialogPortal = DialogPrimitive.Portal;
@@ -218850,7 +218934,7 @@ function Profile({ tenant, username, tenants, onClose, customization = {}, isAdm
218850
218934
  const [isExperienceDialogOpen, setIsExperienceDialogOpen] = useState(false);
218851
218935
  const [educationSubTab, setEducationSubTab] = useState('education');
218852
218936
  const [experienceSubTab, setExperienceSubTab] = useState('experience');
218853
- const { basicForm, socialForm, isUserMetadataLoading, userMetadata, handleProfileImageUpload, isUploadingProfileImage, userMetadataEdx, isUserMetadataEdxLoading, FACEBOOK_URL_PREFIX, X_URL_PREFIX, LINKEDIN_URL_PREFIX, handleSocialLinkChange, socialValidators, basicValidators, } = useProfile(username);
218937
+ const { basicForm, socialForm, isUserMetadataLoading, userMetadata, handleProfileImageUpload, isUploadingProfileImage, userMetadataEdx, isUserMetadataEdxLoading, FACEBOOK_URL_PREFIX, X_URL_PREFIX, LINKEDIN_URL_PREFIX, handleSocialLinkChange, socialValidators, basicValidators, } = useProfile(username, { platformKey: tenant });
218854
218938
  useEffect(() => {
218855
218939
  const firstInput = document.getElementById('fullName');
218856
218940
  if (firstInput) {
@@ -262655,6 +262739,25 @@ const RetrainScheduleModal$1 = dynamic(() => Promise.resolve().then(function ()
262655
262739
  const TrainOrDeleteModal$1 = dynamic(() => Promise.resolve().then(function () { return trainOrDeleteModal; }).then((mod) => ({
262656
262740
  default: mod.TrainOrDeleteModal,
262657
262741
  })));
262742
+ /**
262743
+ * Crawlable documents are re-fetched over HTTP on retrain, so crawler options
262744
+ * (such as a custom User-Agent) apply to them. Local uploads and cloud-provider
262745
+ * documents are not re-fetched, so they are not crawlable.
262746
+ */
262747
+ function isCrawlableDocType(documentType) {
262748
+ const docType = documentType === null || documentType === void 0 ? void 0 : documentType.toLowerCase();
262749
+ // Uploaded documents (local files like PDF, DOCX, etc.)
262750
+ const uploadedFileTypes = ['file'];
262751
+ if (uploadedFileTypes.some((type) => docType === null || docType === void 0 ? void 0 : docType.includes(type))) {
262752
+ return false;
262753
+ }
262754
+ // Cloud storage providers
262755
+ const cloudProviders = ['google drive', 'onedrive', 'dropbox', 'one drive'];
262756
+ if (cloudProviders.some((provider) => docType === null || docType === void 0 ? void 0 : docType.includes(provider))) {
262757
+ return false;
262758
+ }
262759
+ return true;
262760
+ }
262658
262761
  function DatasetItem({ dataset, onSelect, isSelected, labels }) {
262659
262762
  var _a, _b, _c, _d, _e;
262660
262763
  const t = useT();
@@ -262683,10 +262786,12 @@ function DatasetItem({ dataset, onSelect, isSelected, labels }) {
262683
262786
  console.error(JSON.stringify({ tenant: tenantKey, error }));
262684
262787
  }
262685
262788
  };
262686
- const handleTrainDataset = async () => {
262789
+ const handleTrainDataset = async (userAgent) => {
262790
+ const trimmedUserAgent = userAgent === null || userAgent === void 0 ? void 0 : userAgent.trim();
262687
262791
  await handleEditTrainingDocument({
262688
262792
  url: dataset.url,
262689
262793
  train: true,
262794
+ ...(trimmedUserAgent ? { crawler_extra_headers: { 'User-Agent': trimmedUserAgent } } : {}),
262690
262795
  });
262691
262796
  setIsTrainOrDeleteModalOpen(false);
262692
262797
  };
@@ -262696,23 +262801,12 @@ function DatasetItem({ dataset, onSelect, isSelected, labels }) {
262696
262801
  };
262697
262802
  // Helper function to check if retrain should be disabled
262698
262803
  const isRetrainDisabled = () => {
262699
- var _a;
262700
262804
  // Disable if the dataset is not trained yet
262701
262805
  if (!dataset.is_trained) {
262702
262806
  return true;
262703
262807
  }
262704
- const docType = (_a = dataset.document_type) === null || _a === void 0 ? void 0 : _a.toLowerCase();
262705
- // Disable for uploaded documents (local files like PDF, DOCX, etc.)
262706
- const uploadedFileTypes = ['file'];
262707
- if (uploadedFileTypes.some((type) => docType === null || docType === void 0 ? void 0 : docType.includes(type))) {
262708
- return true;
262709
- }
262710
- // Disable for cloud storage providers
262711
- const cloudProviders = ['google drive', 'onedrive', 'dropbox', 'one drive'];
262712
- if (cloudProviders.some((provider) => docType === null || docType === void 0 ? void 0 : docType.includes(provider))) {
262713
- return true;
262714
- }
262715
- return false;
262808
+ // Disable for uploaded documents and cloud storage providers
262809
+ return !isCrawlableDocType(dataset.document_type);
262716
262810
  };
262717
262811
  return (jsxs(Fragment$1, { children: [jsxs(TableRow$1, { className: `border-b last:border-0 ${onSelect ? 'hover:bg-muted/50 cursor-pointer' : ''} ${isSelected ? 'bg-blue-50' : ''}`, onClick: onSelect ? () => onSelect(dataset) : undefined, children: [jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { asChild: true, children: jsx(TableCell$1, { className: "max-w-[200px] truncate p-3 font-medium whitespace-nowrap text-[#646464]", children: jsx(WithFormPermissions, { name: ['document_name', 'url'],
262718
262812
  // @ts-ignore
@@ -262740,7 +262834,7 @@ function DatasetItem({ dataset, onSelect, isSelected, labels }) {
262740
262834
  }
262741
262835
  }, className: "text-gray-500 hover:text-gray-700", disabled: isEditTrainingDocumentLoading || disabled, children: dataset.access === 'private' ? (jsxs(Fragment$1, { children: [jsx(EyeOff, { className: "h-4 w-4" }), jsx("span", { className: "sr-only", children: t('datasetsTabDatasetItem.makePublic') })] })) : (jsxs(Fragment$1, { children: [jsx(Eye, { className: "h-4 w-4" }), jsx("span", { className: "sr-only", children: t('datasetsTabDatasetItem.makePrivate') })] })) })) }) }), jsx(TableCell$1, { className: "p-3 whitespace-nowrap", children: jsx(WithFormPermissions, { name: "is_trained",
262742
262836
  // @ts-ignore
262743
- permissions: (_e = dataset === null || dataset === void 0 ? void 0 : dataset.permissions) === null || _e === void 0 ? void 0 : _e.field, children: ({ disabled }) => (jsx(TrainingStatusSwitch, { is_trained: dataset.is_trained, url: dataset.url, disabled: disabled, training_status: dataset.training_status, handleEditTrainingDocument: handleEditTrainingDocument, onUntrainSuccess: () => setIsDeleteDatasetModalOpen(true), onTrainRequest: () => setIsTrainOrDeleteModalOpen(true) })) }) })] }, dataset.id), isDeleteDatasetModalOpen && (jsx(DeleteDatasetModal$1, { isOpen: isDeleteDatasetModalOpen, onClose: () => setIsDeleteDatasetModalOpen(false), dataset: dataset, labels: labels })), isRetrainScheduleModalOpen && (jsx(RetrainScheduleModal$1, { isOpen: isRetrainScheduleModalOpen, onClose: () => setIsRetrainScheduleModalOpen(false), dataset: dataset, labels: labels })), isTrainOrDeleteModalOpen && (jsx(TrainOrDeleteModal$1, { isOpen: isTrainOrDeleteModalOpen, onClose: () => setIsTrainOrDeleteModalOpen(false), onTrain: handleTrainDataset, onDelete: handleDeleteFromTrainModal, isLoading: isEditTrainingDocumentLoading, labels: labels }))] }));
262837
+ permissions: (_e = dataset === null || dataset === void 0 ? void 0 : dataset.permissions) === null || _e === void 0 ? void 0 : _e.field, children: ({ disabled }) => (jsx(TrainingStatusSwitch, { is_trained: dataset.is_trained, url: dataset.url, disabled: disabled, training_status: dataset.training_status, handleEditTrainingDocument: handleEditTrainingDocument, onUntrainSuccess: () => setIsDeleteDatasetModalOpen(true), onTrainRequest: () => setIsTrainOrDeleteModalOpen(true) })) }) })] }, dataset.id), isDeleteDatasetModalOpen && (jsx(DeleteDatasetModal$1, { isOpen: isDeleteDatasetModalOpen, onClose: () => setIsDeleteDatasetModalOpen(false), dataset: dataset, labels: labels })), isRetrainScheduleModalOpen && (jsx(RetrainScheduleModal$1, { isOpen: isRetrainScheduleModalOpen, onClose: () => setIsRetrainScheduleModalOpen(false), dataset: dataset, labels: labels })), isTrainOrDeleteModalOpen && (jsx(TrainOrDeleteModal$1, { isOpen: isTrainOrDeleteModalOpen, onClose: () => setIsTrainOrDeleteModalOpen(false), onTrain: handleTrainDataset, onDelete: handleDeleteFromTrainModal, showUserAgentField: isCrawlableDocType(dataset.document_type), isLoading: isEditTrainingDocumentLoading, labels: labels }))] }));
262744
262838
  }
262745
262839
  function TrainingStatusSwitch({ is_trained, url, training_status, disabled, handleEditTrainingDocument, onUntrainSuccess, onTrainRequest, }) {
262746
262840
  const t = useT();
@@ -262813,6 +262907,9 @@ const AGENT_DATASETS_TAB_LABELS = {
262813
262907
  delete: 'Delete',
262814
262908
  train: 'Train',
262815
262909
  training: 'Training...',
262910
+ userAgentLabel: 'User-Agent (optional)',
262911
+ userAgentPlaceholder: 'Iblai-bot/1.0 (+https://ibl.ai/bot)',
262912
+ userAgentHelpText: 'Optional. Overrides the default crawler User-Agent for every request. Leave blank to keep the current setting.',
262816
262913
  },
262817
262914
  retrainScheduleModal: {
262818
262915
  title: 'Schedule Retraining',
@@ -262873,6 +262970,9 @@ function buildDatasetsTabLabels(t) {
262873
262970
  delete: t('datasetsTabLabels.trainOrDeleteModal.delete'),
262874
262971
  train: t('datasetsTabLabels.trainOrDeleteModal.train'),
262875
262972
  training: t('datasetsTabLabels.trainOrDeleteModal.training'),
262973
+ userAgentLabel: t('datasetsTabLabels.trainOrDeleteModal.userAgentLabel'),
262974
+ userAgentPlaceholder: t('datasetsTabLabels.trainOrDeleteModal.userAgentPlaceholder'),
262975
+ userAgentHelpText: t('datasetsTabLabels.trainOrDeleteModal.userAgentHelpText'),
262876
262976
  },
262877
262977
  retrainScheduleModal: {
262878
262978
  title: t('datasetsTabLabels.retrainScheduleModal.title'),
@@ -288579,8 +288679,9 @@ var retrainScheduleModal = /*#__PURE__*/Object.freeze({
288579
288679
  RetrainScheduleModal: RetrainScheduleModal
288580
288680
  });
288581
288681
 
288582
- function TrainOrDeleteModal({ isOpen, onClose, onTrain, onDelete, isLoading, labels, }) {
288583
- return (jsx(Dialog, { open: isOpen, onOpenChange: onClose, children: jsxs(DialogContent, { "aria-describedby": "train-or-delete-description", className: "gap-0", children: [jsx(DialogHeader, { children: jsx(DialogTitle, { className: "ibl-dialog-title", children: labels.trainOrDeleteModal.title }) }), jsx("div", { className: "my-5", children: jsx("p", { id: "train-or-delete-description", className: "text-sm text-[#646464]", children: labels.trainOrDeleteModal.description }) }), jsxs(DialogFooter, { className: "gap-3", children: [jsx(Button$1, { variant: "outline", onClick: onDelete, disabled: isLoading, children: labels.trainOrDeleteModal.delete }), jsx(Button$1, { className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", onClick: onTrain, disabled: isLoading, children: isLoading ? labels.trainOrDeleteModal.training : labels.trainOrDeleteModal.train })] })] }) }));
288682
+ function TrainOrDeleteModal({ isOpen, onClose, onTrain, onDelete, isLoading, showUserAgentField, labels, }) {
288683
+ const [userAgent, setUserAgent] = React__default.useState('');
288684
+ return (jsx(Dialog, { open: isOpen, onOpenChange: onClose, children: jsxs(DialogContent, { "aria-describedby": "train-or-delete-description", className: "gap-0", children: [jsx(DialogHeader, { children: jsx(DialogTitle, { className: "ibl-dialog-title", children: labels.trainOrDeleteModal.title }) }), jsx("div", { className: "my-5", children: jsx("p", { id: "train-or-delete-description", className: "text-sm text-[#646464]", children: labels.trainOrDeleteModal.description }) }), showUserAgentField && (jsxs("div", { className: "mb-5 space-y-2", children: [jsx(Label$1, { htmlFor: "train-user-agent", className: "text-sm font-medium", children: labels.trainOrDeleteModal.userAgentLabel }), jsx(Input, { id: "train-user-agent", type: "text", value: userAgent, onChange: (e) => setUserAgent(e.target.value), disabled: isLoading, placeholder: labels.trainOrDeleteModal.userAgentPlaceholder, className: "h-10" }), jsx("p", { className: "text-muted-foreground text-xs", children: labels.trainOrDeleteModal.userAgentHelpText })] })), jsxs(DialogFooter, { className: "gap-3", children: [jsx(Button$1, { variant: "outline", onClick: onDelete, disabled: isLoading, children: labels.trainOrDeleteModal.delete }), jsx(Button$1, { className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", onClick: () => onTrain(userAgent.trim() || undefined), disabled: isLoading, children: isLoading ? labels.trainOrDeleteModal.training : labels.trainOrDeleteModal.train })] })] }) }));
288584
288685
  }
288585
288686
 
288586
288687
  var trainOrDeleteModal = /*#__PURE__*/Object.freeze({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iblai/iblai-js",
3
- "version": "2.11.3",
3
+ "version": "2.12.0",
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": {
@@ -76,9 +76,9 @@
76
76
  "axios": "1.13.6",
77
77
  "dotenv": "16.6.1",
78
78
  "winston": "3.19.0",
79
- "@iblai/mcp": "1.12.14",
80
- "@iblai/web-containers": "1.20.2",
81
- "@iblai/data-layer": "1.13.5",
79
+ "@iblai/mcp": "1.13.0",
80
+ "@iblai/data-layer": "1.14.0",
81
+ "@iblai/web-containers": "1.21.0",
82
82
  "@iblai/web-utils": "2.4.6"
83
83
  },
84
84
  "peerDependencies": {