@iblai/iblai-js 2.3.10 → 2.3.12

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.
@@ -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, useGetMemsearchStatusQuery, useGetUserMemorySettingsQuery, useUpdateUserMemorySettingsMutation, useGetGlobalMemoriesQuery, useGetAllMentorMemoriesQuery, useDeleteGlobalMemoryMutation, 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, useDeleteApiKeyMutation, useGetApiKeyQuery, useGetApiKeyFieldPermissionsQuery, useUpdateApiKeyMutation, useGetApiKeysQuery, unwrapApiTokenList, useCreateApiKeyMutation, useCreateLLMCredentialMutation, useGetCredentialsSchemaQuery, useGetMaskedLLMCredentialsQuery, useGetLlmsQuery, useDeleteIntegrationCredentialMutation, useDeleteCredentialMutation, useCreateIntegrationCredentialMutation, useGetIntegrationCredentialsSchemaQuery, useGetMaskedIntegrationCredentialsQuery, useGetAccountBillingInfoQuery, useUpdateAutoRechargeInfoMutation, useTriggerAutoRechargeMutation, useCreateStripeCustomerPortalMutation, useSetPlatformConfigurationsMutation, useGetPlatformConfigurationsQuery, useUpdatePlatformMembershipMutation, useGetPlatformMembershipQuery, useGetCustomDomainsQuery, useCreateCustomDomainMutation, useDeleteCustomDomainMutation, useGetStudentMentorCreationStatusQuery, useSetStudentMentorCreationStatusMutation, coreApiSlice, recommendationPromptTypeEnum, useGetRecommendedPromptsListQuery, useCreateRecommendedPromptMutation, useUpdateRecommendedPromptMutation, useDeleteRecommendedPromptMutation, useLazyGetPublicPlatformImageAssetFileUrlQuery, useUpdateTenantMetadataMutation, useCreatePlatformImageAssetMutation, useGetProviderConfigQuery, useCreateProviderConfigMutation, useDeleteProviderConfigMutation, useGetExternalMappingQuery, useGetCredentialsListQuery, useCreateExternalMappingMutation, useDeleteExternalMappingMutation, useGetMemsearchConfigQuery, useUpdateMemsearchConfigMutation, useGetStripeConnectStatusQuery, useStartStripeConnectOnboardingMutation, useLazyGetStripeConnectDashboardQuery, useGetAiSearchMentorsQuery, useListPaywallsQuery, useListPricesQuery, useCreatePriceMutation, useUpdatePriceMutation, useDeletePriceMutation, useGetPaywallConfigQuery, useEnablePaywallMutation, useUpdatePaywallMutation, useStarMentorMutation, useUnstarMentorMutation, useLazyGetCourseMetaDataQuery, useLazyGetCourseCompletionOutlinesQuery, useLazyGetCourseEligibilityQuery, useLazyGetEdxSSOTokenQuery, useCreateCourseEnrollmentMutation, useCreateStripeCheckoutSessionMutation, useLazyGetCourseProgressQuery, useLazyGetCourseCompletionQuery, useUpdateExamAttemptMutation, useStartExamMutation, useLazyGetExamInfoQuery, useGetAgentSkillResourcesQuery, useCreateAgentSkillResourceMutation, useUpdateAgentSkillResourceMutation, useUploadAgentSkillResourceAssetMutation, useDeleteAgentSkillResourceMutation, useGetAgentSkillsQuery, useGetMentorSkillAssignmentsQuery, useCreateMentorSkillAssignmentMutation, useUpdateMentorSkillAssignmentMutation, useDeleteMentorSkillAssignmentMutation, useCreateAgentSkillMutation, useUpdateAgentSkillMutation, useDeleteAgentSkillMutation, resolveEffectiveAgentSkills, filterSlashSkills, useUpdateUserProjectMutation, useGetTrainingDocumentsQuery, useGetVectorDocumentsQuery, useGetMentorMemoriesListQuery, useGetMemoryCategoriesAdminQuery, useDeleteMentorMemoryMutation, useUpdateMentorMemoryMutation, useCreateMentorMemoryMutation, 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, useGetMentorPublicSettingsQuery, useGetChatHistoryQuery, useGetMentorSummariesQuery, useGetConversationMemoriesQuery, useGetSupportTicketsQuery, useGetSupportTicketMessagesQuery, useCreateSupportTicketMessageMutation, usePatchSupportTicketMutation, useCloseSupportTicketMutation, useCreateLtiMentorMutation, useUpdateLtiMentorMutation, useGetLtiMentorsQuery, 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, useDeletePromptMutation, useDeleteTrainingDocumentMutation, useGetTrainingDocumentRetrainScheduleQuery, useCreateTrainingDocumentRetrainScheduleMutation, useCreateMemoryCategoryMutation, useUpdateMemoryCategoryMutation, useDeleteMemoryCategoryMutation, useUpdateArtifactMutation, useLazyGetArtifactVersionQuery, useLazyListArtifactVersionsQuery, useSetCurrentVersionMutation, useListArtifactVersionsQuery, useLazyGetArtifactQuery, useLazyListArtifactsQuery, useEditSessionMutation } 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, useGetMemsearchStatusQuery, useGetUserMemorySettingsQuery, useUpdateUserMemorySettingsMutation, useGetGlobalMemoriesQuery, useGetAllMentorMemoriesQuery, useDeleteGlobalMemoryMutation, 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, useDeleteApiKeyMutation, useGetApiKeyQuery, useGetApiKeyFieldPermissionsQuery, useUpdateApiKeyMutation, useGetApiKeysQuery, unwrapApiTokenList, useCreateApiKeyMutation, useCreateLLMCredentialMutation, useGetCredentialsSchemaQuery, useGetMaskedLLMCredentialsQuery, useGetLlmsQuery, useDeleteIntegrationCredentialMutation, useDeleteCredentialMutation, useCreateIntegrationCredentialMutation, useGetIntegrationCredentialsSchemaQuery, useGetMaskedIntegrationCredentialsQuery, useGetAccountBillingInfoQuery, useUpdateAutoRechargeInfoMutation, useTriggerAutoRechargeMutation, useCreateStripeCustomerPortalMutation, useSetPlatformConfigurationsMutation, useGetPlatformConfigurationsQuery, useUpdatePlatformMembershipMutation, useGetPlatformMembershipQuery, useGetCustomDomainsQuery, useCreateCustomDomainMutation, useDeleteCustomDomainMutation, useGetStudentMentorCreationStatusQuery, useSetStudentMentorCreationStatusMutation, coreApiSlice, recommendationPromptTypeEnum, useGetRecommendedPromptsListQuery, useCreateRecommendedPromptMutation, useUpdateRecommendedPromptMutation, useDeleteRecommendedPromptMutation, useLazyGetPublicPlatformImageAssetFileUrlQuery, useUpdateTenantMetadataMutation, useCreatePlatformImageAssetMutation, useGetProviderConfigQuery, useCreateProviderConfigMutation, useDeleteProviderConfigMutation, useGetExternalMappingQuery, useGetCredentialsListQuery, useCreateExternalMappingMutation, useDeleteExternalMappingMutation, useGetMemsearchConfigQuery, useUpdateMemsearchConfigMutation, useGetStripeConnectStatusQuery, useStartStripeConnectOnboardingMutation, useLazyGetStripeConnectDashboardQuery, useGetAiSearchMentorsQuery, useListPaywallsQuery, useListPricesQuery, useCreatePriceMutation, useUpdatePriceMutation, useDeletePriceMutation, useGetPaywallConfigQuery, useEnablePaywallMutation, useUpdatePaywallMutation, useStarMentorMutation, useUnstarMentorMutation, useLazyGetCourseMetaDataQuery, useLazyGetCourseCompletionOutlinesQuery, useLazyGetCourseEligibilityQuery, useLazyGetEdxSSOTokenQuery, useCreateCourseEnrollmentMutation, useCreateStripeCheckoutSessionMutation, useLazyGetCourseProgressQuery, useLazyGetCourseCompletionQuery, useUpdateExamAttemptMutation, useStartExamMutation, useLazyGetExamInfoQuery, useGetAgentSkillResourcesQuery, useCreateAgentSkillResourceMutation, useUpdateAgentSkillResourceMutation, useUploadAgentSkillResourceAssetMutation, useDeleteAgentSkillResourceMutation, useGetAgentSkillsQuery, useGetMentorSkillAssignmentsQuery, useCreateMentorSkillAssignmentMutation, useUpdateMentorSkillAssignmentMutation, useDeleteMentorSkillAssignmentMutation, useCreateAgentSkillMutation, useUpdateAgentSkillMutation, useDeleteAgentSkillMutation, resolveEffectiveAgentSkills, filterSlashSkills, useGetMentorSkillAssignmentsInfiniteQuery, MENTOR_SKILL_ASSIGNMENTS_PAGE_SIZE, useUpdateUserProjectMutation, useGetTrainingDocumentsQuery, useGetVectorDocumentsQuery, useGetMentorMemoriesListQuery, useGetMemoryCategoriesAdminQuery, useDeleteMentorMemoryMutation, useUpdateMentorMemoryMutation, useCreateMentorMemoryMutation, 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, useGetMentorPublicSettingsQuery, useGetChatHistoryQuery, useGetMentorSummariesQuery, useGetConversationMemoriesQuery, useGetSupportTicketsQuery, useGetSupportTicketMessagesQuery, useCreateSupportTicketMessageMutation, usePatchSupportTicketMutation, useCloseSupportTicketMutation, useCreateLtiMentorMutation, useUpdateLtiMentorMutation, useGetLtiMentorsQuery, 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, useDeletePromptMutation, useDeleteTrainingDocumentMutation, useGetTrainingDocumentRetrainScheduleQuery, useCreateTrainingDocumentRetrainScheduleMutation, useCreateMemoryCategoryMutation, useUpdateMemoryCategoryMutation, useDeleteMemoryCategoryMutation, useUpdateArtifactMutation, useLazyGetArtifactVersionQuery, useLazyListArtifactVersionsQuery, useSetCurrentVersionMutation, useListArtifactVersionsQuery, useLazyGetArtifactQuery, useLazyListArtifactsQuery, useEditSessionMutation } from '@iblai/data-layer';
6
6
  import { getInitials, useTenantMetadata, useCurrentTenant, selectRbacPermissions, 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, 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';
@@ -98454,20 +98454,18 @@ var clawSandboxAgentSkills$3 = {
98454
98454
  fieldDescriptionPlaceholder: "e.g. Search the web for information",
98455
98455
  fieldInstruction: "Instruction",
98456
98456
  sessionNote: "Skills added or removed here apply to new chat sessions only. Edits to a skill's instructions apply immediately, including in conversations already in progress.",
98457
- effectiveHeading: "This agent's skills",
98458
- catalogHeading: "Available skills",
98459
- noEffectiveSkills: "No skills enabled for this agent yet. Add one from the available skills below.",
98457
+ noEffectiveSkills: "No skills enabled for this agent yet. Add one from the Available Skills tab.",
98460
98458
  addToAgent: "Add",
98461
98459
  addToAgentLabel: "Add {name} to this agent",
98462
- removeFromAgent: "Remove from agent",
98460
+ removeFromAgent: "Remove from Agent",
98463
98461
  skillAdded: "{name} added",
98464
98462
  skillRemoved: "{name} removed",
98465
98463
  featuredBadge: "Featured",
98466
98464
  nativeBadge: "Native",
98467
- privateBadge: "Only this agent",
98465
+ privateBadge: "Only This Agent",
98468
98466
  fieldCategory: "Category",
98469
98467
  fieldCategoryPlaceholder: "e.g. web, code, data",
98470
- privateToAgent: "Only this agent",
98468
+ privateToAgent: "Only This Agent",
98471
98469
  privateToAgentHint: "Private skills are available to this agent only and take precedence over platform skills with the same slug.",
98472
98470
  instructionHint: "The playbook the agent follows when the skill is used. Edits apply immediately, including in conversations already in progress.",
98473
98471
  filesHint: "Optional resources the agent can use with this skill. References and scripts are text files; assets are uploaded files.",
@@ -98478,11 +98476,11 @@ var clawSandboxAgentSkills$3 = {
98478
98476
  fileTypeReference: "Reference",
98479
98477
  fileTypeScript: "Script",
98480
98478
  fileTypeAsset: "Asset",
98481
- fileNameLabel: "File name",
98479
+ fileNameLabel: "File Name",
98482
98480
  fileNamePlaceholder: "e.g. rubric.md",
98483
98481
  fileContentLabel: "Content",
98484
98482
  fileContentPlaceholder: "The file's text content",
98485
- addFileButton: "Add resource",
98483
+ addFileButton: "Add Resource",
98486
98484
  adding: "Adding...",
98487
98485
  uploading: "Uploading...",
98488
98486
  fileAdded: "Resource added",
@@ -98499,10 +98497,13 @@ var clawSandboxAgentSkills$3 = {
98499
98497
  editFileDialogTitle: "Edit Resource",
98500
98498
  deleteFileDialogTitle: "Delete Resource",
98501
98499
  deleteFileConfirmation: "Are you sure you want to delete {name}? This action cannot be undone.",
98502
- chooseFile: "Choose file",
98500
+ chooseFile: "Choose File",
98503
98501
  upload: "Upload",
98504
98502
  download: "Download",
98505
- resourcesItemLabel: "resources"
98503
+ tabsAriaLabel: "Skills",
98504
+ tabAgentSkills: "Agent Skills",
98505
+ tabAvailableSkills: "Available Skills",
98506
+ addedBadge: "Added"
98506
98507
  };
98507
98508
  var clawSandboxHelpers$3 = {
98508
98509
  unknown: "Unknown",
@@ -102413,7 +102414,7 @@ var platformNavbar$3 = {
102413
102414
  placementExamFallback: "Placement exam"
102414
102415
  };
102415
102416
  var slashSkillPicker$3 = {
102416
- listLabel: "Agent skills",
102417
+ listLabel: "Agent Skills",
102417
102418
  resultsAnnouncement: "{count} skills available. Use arrow keys to browse and Enter to select.",
102418
102419
  loading: "Loading..."
102419
102420
  };
@@ -104940,9 +104941,7 @@ var clawSandboxAgentSkills$2 = {
104940
104941
  fieldDescriptionPlaceholder: "ex. Rechercher des informations sur le web",
104941
104942
  fieldInstruction: "Instruction",
104942
104943
  sessionNote: "Les compétences ajoutées ou supprimées ici ne s'appliquent qu'aux nouvelles sessions de chat. Les modifications des instructions d'une compétence s'appliquent immédiatement, y compris dans les conversations en cours.",
104943
- effectiveHeading: "Compétences de cet agent",
104944
- catalogHeading: "Compétences disponibles",
104945
- noEffectiveSkills: "Cet agent n'a pas encore de compétences activées. Ajoutez-en une depuis les compétences disponibles.",
104944
+ noEffectiveSkills: "Cet agent n'a pas encore de compétences activées. Ajoutez-en une depuis l'onglet Compétences disponibles.",
104946
104945
  addToAgent: "Ajouter",
104947
104946
  addToAgentLabel: "Ajouter {name} à cet agent",
104948
104947
  removeFromAgent: "Retirer de l'agent",
@@ -104988,7 +104987,10 @@ var clawSandboxAgentSkills$2 = {
104988
104987
  chooseFile: "Choisir un fichier",
104989
104988
  upload: "Téléverser",
104990
104989
  download: "Télécharger",
104991
- resourcesItemLabel: "ressources"
104990
+ tabsAriaLabel: "Compétences",
104991
+ tabAgentSkills: "Compétences de l'agent",
104992
+ tabAvailableSkills: "Compétences disponibles",
104993
+ addedBadge: "Ajoutée"
104992
104994
  };
104993
104995
  var clawSandboxHelpers$2 = {
104994
104996
  unknown: "Inconnu",
@@ -111260,9 +111262,7 @@ var clawSandboxAgentSkills$1 = {
111260
111262
  fieldDescriptionPlaceholder: "ej. Buscar información en la web",
111261
111263
  fieldInstruction: "Instrucción",
111262
111264
  sessionNote: "Las habilidades añadidas o eliminadas aquí solo se aplican a las nuevas sesiones de chat. Los cambios en las instrucciones de una habilidad se aplican de inmediato, incluso en conversaciones en curso.",
111263
- effectiveHeading: "Habilidades de este agente",
111264
- catalogHeading: "Habilidades disponibles",
111265
- noEffectiveSkills: "Este agente aún no tiene habilidades habilitadas. Añade una desde las habilidades disponibles.",
111265
+ noEffectiveSkills: "Este agente aún no tiene habilidades habilitadas. Añade una desde la pestaña Habilidades disponibles.",
111266
111266
  addToAgent: "Añadir",
111267
111267
  addToAgentLabel: "Añadir {name} a este agente",
111268
111268
  removeFromAgent: "Quitar del agente",
@@ -111308,7 +111308,10 @@ var clawSandboxAgentSkills$1 = {
111308
111308
  chooseFile: "Elegir archivo",
111309
111309
  upload: "Subir",
111310
111310
  download: "Descargar",
111311
- resourcesItemLabel: "recursos"
111311
+ tabsAriaLabel: "Habilidades",
111312
+ tabAgentSkills: "Habilidades del agente",
111313
+ tabAvailableSkills: "Habilidades disponibles",
111314
+ addedBadge: "Añadida"
111312
111315
  };
111313
111316
  var clawSandboxHelpers$1 = {
111314
111317
  unknown: "Desconocido",
@@ -117580,9 +117583,7 @@ var clawSandboxAgentSkills = {
117580
117583
  fieldDescriptionPlaceholder: "例如:在网络上搜索信息",
117581
117584
  fieldInstruction: "指令",
117582
117585
  sessionNote: "在此添加或移除的技能仅对新的聊天会话生效。技能指令的修改会立即生效,包括正在进行的对话。",
117583
- effectiveHeading: "此智能体的技能",
117584
- catalogHeading: "可用技能",
117585
- noEffectiveSkills: "此智能体尚未启用任何技能。请从下方的可用技能中添加。",
117586
+ noEffectiveSkills: "此智能体尚未启用任何技能。请从“可用技能”标签页添加。",
117586
117587
  addToAgent: "添加",
117587
117588
  addToAgentLabel: "将 {name} 添加到此智能体",
117588
117589
  removeFromAgent: "从智能体中移除",
@@ -117628,7 +117629,10 @@ var clawSandboxAgentSkills = {
117628
117629
  chooseFile: "选择文件",
117629
117630
  upload: "上传",
117630
117631
  download: "下载",
117631
- resourcesItemLabel: "资源"
117632
+ tabsAriaLabel: "技能",
117633
+ tabAgentSkills: "智能体技能",
117634
+ tabAvailableSkills: "可用技能",
117635
+ addedBadge: "已添加"
117632
117636
  };
117633
117637
  var clawSandboxHelpers = {
117634
117638
  unknown: "未知",
@@ -189684,6 +189688,19 @@ function StringSettingInput({ value, defaultValue, disabled, onSave, }) {
189684
189688
  };
189685
189689
  return (jsxs("div", { className: "flex items-center gap-2", children: [isDirty && (jsx(Button$1, { type: "button", size: "sm", onClick: handleSave, disabled: disabled, className: "h-8 bg-blue-500 hover:bg-blue-600 text-white", children: t('advancedAdvanced.save') })), jsx(Input, { value: localValue, onChange: (e) => setLocalValue(e.target.value), disabled: disabled, className: "max-w-[240px] w-[110px] sm:w-[230px] font-medium text-[#646464] text-sm" }), disabled && (jsx("div", { className: "w-4 h-4 border-2 border-blue-500 border-t-transparent rounded-full animate-spin" }))] }));
189686
189690
  }
189691
+ /**
189692
+ * A setting whose value is constrained to a fixed list of options declared in the
189693
+ * tenant metadata config, rendered as a dropdown.
189694
+ */
189695
+ function hasSelectableOptions(metadataItem) {
189696
+ return Array.isArray(metadataItem.options) && metadataItem.options.length > 0;
189697
+ }
189698
+ function SelectSettingInput({ label, options, value, defaultValue, disabled, triggerClassName, onSelect, }) {
189699
+ // Values saved before an option was renamed/removed fall back to the default
189700
+ // so the trigger never renders an empty selection.
189701
+ const selectedValue = options.some((option) => option.value === value) ? value : defaultValue;
189702
+ return (jsxs("div", { className: "flex items-center gap-2", children: [jsxs(Select$1, { value: selectedValue, onValueChange: onSelect, disabled: disabled, children: [jsx(SelectTrigger, { "aria-label": label, className: triggerClassName, children: jsx(SelectValue, {}) }), jsx(SelectContent, { className: "font-medium text-[#646464]", children: options.map((option) => (jsx(SelectItem, { value: option.value, children: option.label }, option.value))) })] }), disabled && (jsx("div", { className: "w-4 h-4 border-2 border-blue-500 border-t-transparent rounded-full animate-spin" }))] }));
189703
+ }
189687
189704
  function AdvancedTab({ platformKey, username, currentSPA, authURL, currentPlatformBaseDomain, }) {
189688
189705
  const t = useT();
189689
189706
  const [updateTenantMetadata, { isLoading: isUpdatingTenantMetadata }] = useUpdateTenantMetadataMutation();
@@ -189719,33 +189736,35 @@ function AdvancedTab({ platformKey, username, currentSPA, authURL, currentPlatfo
189719
189736
  'enable_profile_screen_on_start_page',
189720
189737
  'enable_get_started_screen_on_start_page',
189721
189738
  ];
189739
+ // String settings rendered as a free-text input; every other string setting is
189740
+ // either handled by a dedicated component or exposed through its own options list
189741
+ const stringSettingSlugs = [
189742
+ 'overall_default_mentor',
189743
+ 'help_center_url',
189744
+ 'monetization_base_path',
189745
+ 'skills_welcome_tagline',
189746
+ ];
189747
+ const getConfigurableMetadatas = () => {
189748
+ // Include boolean, select and whitelisted string settings, but exclude start
189749
+ // screen settings which are handled by the StartScreenContent component
189750
+ const configurableMetadatas = getAllMetadatas().filter((metadata) => (typeof metadata.defaultValue === 'boolean' ||
189751
+ hasSelectableOptions(metadata) ||
189752
+ (typeof metadata.defaultValue === 'string' &&
189753
+ stringSettingSlugs.includes(metadata.slug))) &&
189754
+ !startScreenSlugs.includes(metadata.slug));
189755
+ // Show all configurable settings when no SPA is specified
189756
+ if (!currentSPA)
189757
+ return configurableMetadatas;
189758
+ // Filter by current SPA if specified (case-insensitive partial matching)
189759
+ return configurableMetadatas.filter((metadata) => {
189760
+ const spaName = String(metadata.SPA || '').toLowerCase();
189761
+ const searchTerm = String(currentSPA).toLowerCase();
189762
+ return spaName.includes(searchTerm) || searchTerm.includes(spaName);
189763
+ });
189764
+ };
189722
189765
  useEffect(() => {
189723
189766
  if (metadataLoaded) {
189724
- const allMetadatas = getAllMetadatas();
189725
- // Include both boolean and string settings, but exclude start screen settings
189726
- // which are handled by the StartScreenContent component
189727
- const stringSettingSlugs = [
189728
- 'overall_default_mentor',
189729
- 'help_center_url',
189730
- 'monetization_base_path',
189731
- 'skills_welcome_tagline',
189732
- ];
189733
- const configurableMetadatas = allMetadatas.filter((metadata) => (typeof metadata.defaultValue === 'boolean' ||
189734
- (typeof metadata.defaultValue === 'string' &&
189735
- stringSettingSlugs.includes(metadata.slug))) &&
189736
- !startScreenSlugs.includes(metadata.slug));
189737
- if (currentSPA) {
189738
- // Filter by current SPA if specified (case-insensitive partial matching)
189739
- setFlagTenantMetadatas(configurableMetadatas.filter((metadata) => {
189740
- const spaName = String(metadata.SPA || '').toLowerCase();
189741
- const searchTerm = String(currentSPA).toLowerCase();
189742
- return spaName.includes(searchTerm) || searchTerm.includes(spaName);
189743
- }));
189744
- }
189745
- else {
189746
- // Show all configurable settings when no SPA is specified
189747
- setFlagTenantMetadatas(configurableMetadatas);
189748
- }
189767
+ setFlagTenantMetadatas(getConfigurableMetadatas());
189749
189768
  }
189750
189769
  }, [metadataLoaded, currentSPA]);
189751
189770
  const updateOrganizationMetadata = async (key, value, callback) => {
@@ -189789,8 +189808,7 @@ function AdvancedTab({ platformKey, username, currentSPA, authURL, currentPlatfo
189789
189808
  updateOrganizationMetadata(slug, newValue, () => {
189790
189809
  toast.success(t('advancedAdvanced.settingUpdatedSuccessfully'));
189791
189810
  // Update local state by refreshing the metadata
189792
- setFlagTenantMetadatas(getAllMetadatas().filter((metadata) => String(metadata.SPA).toLowerCase().includes(String(currentSPA).toLowerCase()) &&
189793
- typeof metadata.defaultValue === 'boolean'));
189811
+ setFlagTenantMetadatas(getConfigurableMetadatas());
189794
189812
  });
189795
189813
  };
189796
189814
  const handleMentorSelection = async (slug, mentorUniqueId) => {
@@ -189842,6 +189860,13 @@ function AdvancedTab({ platformKey, username, currentSPA, authURL, currentPlatfo
189842
189860
  toast.success(t('advancedAdvanced.settingUpdatedSuccessfully'));
189843
189861
  });
189844
189862
  };
189863
+ const handleSelectSettingUpdate = async (slug, value) => {
189864
+ updateOrganizationMetadata(slug, value, () => {
189865
+ toast.success(t('advancedAdvanced.settingUpdatedSuccessfully'));
189866
+ // Update local state so the dropdown reflects the saved value
189867
+ setFlagTenantMetadatas(getConfigurableMetadatas());
189868
+ });
189869
+ };
189845
189870
  // Helper function to get mentor name from JSON string, object, or unique_id
189846
189871
  const getMentorName = (mentorValue) => {
189847
189872
  var _a;
@@ -189876,11 +189901,17 @@ function AdvancedTab({ platformKey, username, currentSPA, authURL, currentPlatfo
189876
189901
  ? 'None'
189877
189902
  : ((_a = metadataItem.value) !== null && _a !== void 0 ? _a : metadataItem.defaultValue);
189878
189903
  const isMentorSetting = metadataItem.slug === 'overall_default_mentor';
189879
- const isStringSetting = typeof metadataItem.defaultValue === 'string' && !isMentorSetting;
189880
- return (jsxs("div", { className: `flex items-center justify-between rounded-lg border px-6 ${isMentorSetting || isStringSetting ? 'py-4' : 'py-6'}`, style: { borderColor: 'oklch(.922 0 0)' }, children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: metadataItem.label }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { "aria-label": t('advancedAdvanced.moreInfoAbout', {
189904
+ const selectOptions = hasSelectableOptions(metadataItem)
189905
+ ? metadataItem.options
189906
+ : null;
189907
+ const isSelectSetting = selectOptions !== null;
189908
+ const isStringSetting = typeof metadataItem.defaultValue === 'string' &&
189909
+ !isMentorSetting &&
189910
+ !isSelectSetting;
189911
+ return (jsxs("div", { className: `flex items-center justify-between rounded-lg border px-6 ${isMentorSetting || isStringSetting || isSelectSetting ? 'py-4' : 'py-6'}`, style: { borderColor: 'oklch(.922 0 0)' }, children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: metadataItem.label }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { "aria-label": t('advancedAdvanced.moreInfoAbout', {
189881
189912
  label: metadataItem.label,
189882
189913
  }), className: "hidden sm:block", children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "rounded-lg bg-gray-700 px-3 py-2 text-sm font-medium whitespace-nowrap text-white shadow-sm transition-opacity duration-300 z-50", children: jsx("p", { children: metadataItem.description ||
189883
- t('advancedAdvanced.noDescriptionAvailable') }) })] }) })] }), jsx("div", { className: "flex items-center gap-2", children: isMentorSetting ? (jsxs("div", { className: "flex items-center gap-2", children: [jsxs(Select$1, { value: currentValue || '', onValueChange: (value) => handleMentorSelection(metadataItem.slug, value), disabled: isUpdatingTenantMetadata, children: [jsx(SelectTrigger, { className: "max-w-[240px] w-[110px] sm:w-[230px] font-medium text-[#646464]", children: jsx(SelectValue, { placeholder: t('advancedAdvanced.selectAgent'), children: currentValue ? getMentorName(currentValue) : '' }) }), jsxs(SelectContent, { className: "font-medium text-[#646464]", children: [jsx("div", { className: "p-2", children: jsx(Input, { placeholder: t('advancedAdvanced.searchAgents'), value: mentorSearchQuery, onChange: (e) => handleMentorSearch(e.target.value), className: "mb-2 font-medium text-[#646464]" }) }), jsx(SelectItem, { value: "none", children: t('advancedAdvanced.none') }), isMentorsLoading ? (jsx(SelectItem, { "aria-label": t('advancedAdvanced.loadingAgents'), value: "loading", disabled: true, children: t('advancedAdvanced.loadingAgents') })) : ((_b = mentorsData === null || mentorsData === void 0 ? void 0 : mentorsData.results) === null || _b === void 0 ? void 0 : _b.length) ? (mentorsData.results.map((mentor) => (jsx(SelectItem, { value: mentor.unique_id, children: mentor.name }, mentor.unique_id)))) : (jsx(SelectItem, { value: "no-results", disabled: true, children: t('advancedAdvanced.noAgentsFound') }))] })] }), isUpdatingTenantMetadata && (jsx("div", { "aria-label": t('advancedAdvanced.updatingAgentSelection'), role: "status", className: "w-4 h-4 border-2 border-blue-500 border-t-transparent rounded-full animate-spin" }))] })) : isStringSetting ? (jsx(StringSettingInput, { value: currentValue, defaultValue: metadataItem.defaultValue, disabled: isUpdatingTenantMetadata, onSave: (value) => handleStringSettingUpdate(metadataItem.slug, value) })) : (jsxs(Fragment$1, { children: [jsx(Switch, { checked: currentValue, onCheckedChange: async () => {
189914
+ t('advancedAdvanced.noDescriptionAvailable') }) })] }) })] }), jsx("div", { className: "flex items-center gap-2", children: isMentorSetting ? (jsxs("div", { className: "flex items-center gap-2", children: [jsxs(Select$1, { value: currentValue || '', onValueChange: (value) => handleMentorSelection(metadataItem.slug, value), disabled: isUpdatingTenantMetadata, children: [jsx(SelectTrigger, { className: "max-w-[240px] w-[110px] sm:w-[230px] font-medium text-[#646464]", children: jsx(SelectValue, { placeholder: t('advancedAdvanced.selectAgent'), children: currentValue ? getMentorName(currentValue) : '' }) }), jsxs(SelectContent, { className: "font-medium text-[#646464]", children: [jsx("div", { className: "p-2", children: jsx(Input, { placeholder: t('advancedAdvanced.searchAgents'), value: mentorSearchQuery, onChange: (e) => handleMentorSearch(e.target.value), className: "mb-2 font-medium text-[#646464]" }) }), jsx(SelectItem, { value: "none", children: t('advancedAdvanced.none') }), isMentorsLoading ? (jsx(SelectItem, { "aria-label": t('advancedAdvanced.loadingAgents'), value: "loading", disabled: true, children: t('advancedAdvanced.loadingAgents') })) : ((_b = mentorsData === null || mentorsData === void 0 ? void 0 : mentorsData.results) === null || _b === void 0 ? void 0 : _b.length) ? (mentorsData.results.map((mentor) => (jsx(SelectItem, { value: mentor.unique_id, children: mentor.name }, mentor.unique_id)))) : (jsx(SelectItem, { value: "no-results", disabled: true, children: t('advancedAdvanced.noAgentsFound') }))] })] }), isUpdatingTenantMetadata && (jsx("div", { "aria-label": t('advancedAdvanced.updatingAgentSelection'), role: "status", className: "w-4 h-4 border-2 border-blue-500 border-t-transparent rounded-full animate-spin" }))] })) : selectOptions ? (jsx(SelectSettingInput, { label: metadataItem.label, options: selectOptions, value: metadataItem.value, defaultValue: metadataItem.defaultValue, disabled: isUpdatingTenantMetadata, triggerClassName: "max-w-[240px] w-[110px] sm:w-[230px] font-medium text-[#646464]", onSelect: (value) => handleSelectSettingUpdate(metadataItem.slug, value) })) : isStringSetting ? (jsx(StringSettingInput, { value: currentValue, defaultValue: metadataItem.defaultValue, disabled: isUpdatingTenantMetadata, onSave: (value) => handleStringSettingUpdate(metadataItem.slug, value) })) : (jsxs(Fragment$1, { children: [jsx(Switch, { checked: currentValue, onCheckedChange: async () => {
189884
189915
  await handleToggleSetting(metadataItem.slug, currentValue);
189885
189916
  }, disabled: isUpdatingTenantMetadata, "aria-label": `${metadataItem.label} ${currentValue ? t('advancedAdvanced.enabled') : t('advancedAdvanced.disabled')}`, className: "cursor-pointer data-[state=checked]:bg-blue-500" }), isUpdatingTenantMetadata && (jsx("div", { className: "w-4 h-4 border-2 border-blue-500 border-t-transparent rounded-full animate-spin" }))] })) })] }, metadataItem.slug));
189886
189917
  }) })) : (
@@ -189898,11 +189929,17 @@ function AdvancedTab({ platformKey, username, currentSPA, authURL, currentPlatfo
189898
189929
  var _a, _b;
189899
189930
  const currentValue = (_a = metadataItem.value) !== null && _a !== void 0 ? _a : metadataItem.defaultValue;
189900
189931
  const isMentorSetting = metadataItem.slug === 'overall_default_mentor';
189901
- const isStringSetting = typeof metadataItem.defaultValue === 'string' && !isMentorSetting;
189902
- return (jsxs("div", { className: `flex items-center justify-between rounded-lg border px-6 ${isMentorSetting || isStringSetting ? 'py-4' : 'py-6'}`, style: { borderColor: 'oklch(.922 0 0)' }, children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: metadataItem.label }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { "aria-label": t('advancedAdvanced.moreInfoAbout', {
189932
+ const selectOptions = hasSelectableOptions(metadataItem)
189933
+ ? metadataItem.options
189934
+ : null;
189935
+ const isSelectSetting = selectOptions !== null;
189936
+ const isStringSetting = typeof metadataItem.defaultValue === 'string' &&
189937
+ !isMentorSetting &&
189938
+ !isSelectSetting;
189939
+ return (jsxs("div", { className: `flex items-center justify-between rounded-lg border px-6 ${isMentorSetting || isStringSetting || isSelectSetting ? 'py-4' : 'py-6'}`, style: { borderColor: 'oklch(.922 0 0)' }, children: [jsxs("div", { className: "flex items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-[#646464]", children: metadataItem.label }), jsx(TooltipProvider, { children: jsxs(Tooltip$1, { children: [jsx(TooltipTrigger, { "aria-label": t('advancedAdvanced.moreInfoAbout', {
189903
189940
  label: metadataItem.label,
189904
189941
  }), className: "hidden sm:block", children: jsx(Info$3, { className: "h-4 w-4 text-gray-400" }) }), jsx(TooltipContent, { className: "ibl-tooltip-content", children: jsx("p", { children: metadataItem.description ||
189905
- t('advancedAdvanced.noDescriptionAvailable') }) })] }) })] }), jsx("div", { className: "flex items-center gap-2", children: isMentorSetting ? (jsxs("div", { className: "flex items-center gap-2", children: [jsxs(Select$1, { value: currentValue || '', onValueChange: (value) => handleMentorSelection(metadataItem.slug, value), disabled: isUpdatingTenantMetadata, children: [jsx(SelectTrigger, { className: "max-w-[240px] w-[230px] sm:w-[150px] font-medium text-[#646464]", children: jsx(SelectValue, { placeholder: t('advancedAdvanced.selectAgent'), children: currentValue ? getMentorName(currentValue) : '' }) }), jsxs(SelectContent, { className: "font-medium text-[#646464]", children: [jsx("div", { className: "p-2", children: jsx(Input, { placeholder: t('advancedAdvanced.searchAgents'), value: mentorSearchQuery, onChange: (e) => handleMentorSearch(e.target.value), className: "mb-2 font-medium text-[#646464]" }) }), jsx(SelectItem, { value: "none", children: t('advancedAdvanced.none') }), isMentorsLoading ? (jsx(SelectItem, { value: "loading", disabled: true, children: t('advancedAdvanced.loadingAgents') })) : ((_b = mentorsData === null || mentorsData === void 0 ? void 0 : mentorsData.results) === null || _b === void 0 ? void 0 : _b.length) ? (mentorsData.results.map((mentor) => (jsx(SelectItem, { value: mentor.unique_id, children: mentor.name }, mentor.unique_id)))) : (jsx(SelectItem, { value: "no-results", disabled: true, children: t('advancedAdvanced.noAgentsFound') }))] })] }), isUpdatingTenantMetadata && (jsx("div", { className: "w-4 h-4 border-2 border-blue-500 border-t-transparent rounded-full animate-spin" }))] })) : isStringSetting ? (jsx(StringSettingInput, { value: currentValue, defaultValue: metadataItem.defaultValue, disabled: isUpdatingTenantMetadata, onSave: (value) => handleStringSettingUpdate(metadataItem.slug, value) })) : (jsxs(Fragment$1, { children: [jsx(Switch, { checked: currentValue, onCheckedChange: async () => {
189942
+ t('advancedAdvanced.noDescriptionAvailable') }) })] }) })] }), jsx("div", { className: "flex items-center gap-2", children: isMentorSetting ? (jsxs("div", { className: "flex items-center gap-2", children: [jsxs(Select$1, { value: currentValue || '', onValueChange: (value) => handleMentorSelection(metadataItem.slug, value), disabled: isUpdatingTenantMetadata, children: [jsx(SelectTrigger, { className: "max-w-[240px] w-[230px] sm:w-[150px] font-medium text-[#646464]", children: jsx(SelectValue, { placeholder: t('advancedAdvanced.selectAgent'), children: currentValue ? getMentorName(currentValue) : '' }) }), jsxs(SelectContent, { className: "font-medium text-[#646464]", children: [jsx("div", { className: "p-2", children: jsx(Input, { placeholder: t('advancedAdvanced.searchAgents'), value: mentorSearchQuery, onChange: (e) => handleMentorSearch(e.target.value), className: "mb-2 font-medium text-[#646464]" }) }), jsx(SelectItem, { value: "none", children: t('advancedAdvanced.none') }), isMentorsLoading ? (jsx(SelectItem, { value: "loading", disabled: true, children: t('advancedAdvanced.loadingAgents') })) : ((_b = mentorsData === null || mentorsData === void 0 ? void 0 : mentorsData.results) === null || _b === void 0 ? void 0 : _b.length) ? (mentorsData.results.map((mentor) => (jsx(SelectItem, { value: mentor.unique_id, children: mentor.name }, mentor.unique_id)))) : (jsx(SelectItem, { value: "no-results", disabled: true, children: t('advancedAdvanced.noAgentsFound') }))] })] }), isUpdatingTenantMetadata && (jsx("div", { className: "w-4 h-4 border-2 border-blue-500 border-t-transparent rounded-full animate-spin" }))] })) : selectOptions ? (jsx(SelectSettingInput, { label: metadataItem.label, options: selectOptions, value: metadataItem.value, defaultValue: metadataItem.defaultValue, disabled: isUpdatingTenantMetadata, triggerClassName: "max-w-[240px] w-[230px] sm:w-[150px] font-medium text-[#646464]", onSelect: (value) => handleSelectSettingUpdate(metadataItem.slug, value) })) : isStringSetting ? (jsx(StringSettingInput, { value: currentValue, defaultValue: metadataItem.defaultValue, disabled: isUpdatingTenantMetadata, onSave: (value) => handleStringSettingUpdate(metadataItem.slug, value) })) : (jsxs(Fragment$1, { children: [jsx(Switch, { checked: currentValue, onCheckedChange: async () => {
189906
189943
  await handleToggleSetting(metadataItem.slug, currentValue);
189907
189944
  }, disabled: isUpdatingTenantMetadata, "aria-label": `${metadataItem.label} ${currentValue ? t('advancedAdvanced.enabled') : t('advancedAdvanced.disabled')}`, className: "cursor-pointer data-[state=checked]:bg-blue-500" }), isUpdatingTenantMetadata && (jsx("div", { className: "w-4 h-4 border-2 border-blue-500 border-t-transparent rounded-full animate-spin" }))] })) })] }, metadataItem.slug));
189908
189945
  }) })] }, spa)));
@@ -253998,9 +254035,9 @@ function SkillResourcesSection({ platformKey, skillId }) {
253998
254035
  }
253999
254036
  return isCreating ? t('clawSandboxAgentSkills.adding') : t('clawSandboxAgentSkills.addFileButton');
254000
254037
  };
254001
- return (jsxs("div", { className: "space-y-4", "data-testid": "skill-resources-section", children: [jsxs("div", { className: "flex items-start justify-between gap-4", children: [jsx("p", { className: "text-xs text-gray-500", children: t('clawSandboxAgentSkills.filesHint') }), jsxs(Button$1, { onClick: openNewFileDialog, size: "sm", className: "shrink-0 cursor-pointer bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", children: [jsx(Plus, { className: "h-4 w-4" }), t('clawSandboxAgentSkills.newFile')] })] }), isLoading ? (jsxs("div", { className: "flex items-center gap-2 p-4", role: "status", children: [jsx(LoaderCircle, { className: "h-4 w-4 animate-spin text-blue-500" }), jsx("span", { className: "text-sm text-gray-500", children: t('clawSandboxAgentSkills.loadingFiles') })] })) : resources.length === 0 ? (jsx("div", { className: "flex items-center justify-center rounded-lg border p-6", children: jsx("p", { className: "text-sm text-gray-500", children: t('clawSandboxAgentSkills.noFiles') }) })) : (jsxs("div", { className: "space-y-3", children: [resources.map((resource) => (jsxs("div", { className: "flex items-center justify-between gap-4 rounded-lg border p-4", children: [jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [jsx(Paperclip, { className: "h-4 w-4 shrink-0 text-gray-400" }), jsx("span", { className: "truncate text-sm font-medium text-gray-700", children: resource.filename }), jsx("span", { className: "rounded-full bg-gray-100 px-2 py-0.5 text-[0.625rem] text-gray-500", children: typeLabel(resource.file_type) })] }), jsx(FloatingPortalContainerContext.Provider, { value: null, children: jsxs(DropdownMenu, { children: [jsx(DropdownMenuTrigger, { asChild: true, children: jsx(Button$1, { variant: "ghost", size: "sm", "aria-label": t('clawSandboxAgentSkills.skillActions', {
254038
+ return (jsxs("div", { className: "space-y-4", "data-testid": "skill-resources-section", children: [jsxs("div", { className: "flex items-start justify-between gap-4", children: [jsx("p", { className: "text-xs text-gray-500", children: t('clawSandboxAgentSkills.filesHint') }), jsxs(Button$1, { onClick: openNewFileDialog, size: "sm", className: "shrink-0 cursor-pointer bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", children: [jsx(Plus, { className: "h-4 w-4" }), t('clawSandboxAgentSkills.newFile')] })] }), isLoading ? (jsxs("div", { className: "flex items-center gap-2 p-4", role: "status", children: [jsx(LoaderCircle, { className: "h-4 w-4 animate-spin text-blue-500" }), jsx("span", { className: "text-sm text-gray-500", children: t('clawSandboxAgentSkills.loadingFiles') })] })) : resources.length === 0 ? (jsx("div", { className: "flex items-center justify-center rounded-lg border p-6", children: jsx("p", { className: "text-sm text-gray-500", children: t('clawSandboxAgentSkills.noFiles') }) })) : (jsxs("div", { className: "space-y-3", children: [resources.map((resource) => (jsxs("div", { className: "flex items-center justify-between gap-4 rounded-lg border p-4", "data-testid": "skill-resource-row", children: [jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [jsx(Paperclip, { className: "h-4 w-4 shrink-0 text-gray-400" }), jsx("span", { className: "truncate text-sm font-medium text-gray-700", children: resource.filename }), jsx("span", { className: "rounded-full bg-gray-100 px-2 py-0.5 text-[0.625rem] text-gray-500", children: typeLabel(resource.file_type) })] }), jsx(FloatingPortalContainerContext.Provider, { value: null, children: jsxs(DropdownMenu, { children: [jsx(DropdownMenuTrigger, { asChild: true, children: jsx(Button$1, { variant: "ghost", size: "sm", "aria-label": t('clawSandboxAgentSkills.skillActions', {
254002
254039
  name: resource.filename,
254003
- }), children: jsx(Ellipsis, { className: "h-4 w-4" }) }) }), jsxs(DropdownMenuContent, { align: "end", className: "z-[110]", children: [resource.file_type === 'asset' && resource.file && (jsx(DropdownMenuItem, { asChild: true, className: "cursor-pointer", children: jsxs("a", { href: resource.file, target: "_blank", rel: "noreferrer", download: true, children: [jsx(Download, { className: "mr-2 h-4 w-4" }), t('clawSandboxAgentSkills.download')] }) })), resource.file_type !== 'asset' && (jsxs(DropdownMenuItem, { className: "cursor-pointer", onClick: () => openEditFileDialog(resource), children: [jsx(Pen, { className: "mr-2 h-4 w-4" }), t('clawSandboxAgentSkills.edit')] })), jsxs(DropdownMenuItem, { variant: "destructive", className: "cursor-pointer", onClick: () => setDeletingResource(resource), children: [jsx(Trash2, { className: "mr-2 h-4 w-4" }), t('clawSandboxAgentSkills.delete')] })] })] }) })] }, resource.id))), jsx(AdvancedPagination, { currentPage: page, totalPages: totalPages, onPageChange: setPage, totalCount: totalCount, itemsPerPage: RESOURCES_PAGE_SIZE, itemLabel: t('clawSandboxAgentSkills.resourcesItemLabel') })] })), jsxs(OverlayModal, { open: showFileDialog, onClose: closeFileDialog, title: t(editingResource
254040
+ }), children: jsx(Ellipsis, { className: "h-4 w-4" }) }) }), jsxs(DropdownMenuContent, { align: "end", className: "z-[110]", children: [resource.file_type === 'asset' && resource.file && (jsx(DropdownMenuItem, { asChild: true, className: "cursor-pointer", children: jsxs("a", { href: resource.file, target: "_blank", rel: "noreferrer", download: true, children: [jsx(Download, { className: "mr-2 h-4 w-4" }), t('clawSandboxAgentSkills.download')] }) })), resource.file_type !== 'asset' && (jsxs(DropdownMenuItem, { className: "cursor-pointer", onClick: () => openEditFileDialog(resource), children: [jsx(Pen, { className: "mr-2 h-4 w-4" }), t('clawSandboxAgentSkills.edit')] })), jsxs(DropdownMenuItem, { variant: "destructive", className: "cursor-pointer", onClick: () => setDeletingResource(resource), children: [jsx(Trash2, { className: "mr-2 h-4 w-4" }), t('clawSandboxAgentSkills.delete')] })] })] }) })] }, resource.id))), jsx(IblPagination, { currentPage: page, totalPages: totalPages, onPageChange: setPage, disabled: isSaving || isDeleting })] })), jsxs(OverlayModal, { open: showFileDialog, onClose: closeFileDialog, title: t(editingResource
254004
254041
  ? 'clawSandboxAgentSkills.editFileDialogTitle'
254005
254042
  : 'clawSandboxAgentSkills.newFileDialogTitle'), className: "max-w-lg", children: [jsxs("div", { className: "mt-4 grid gap-4", children: [!editingResource && (jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "resource-type", className: "text-sm font-medium text-[#646464]", children: t('clawSandboxAgentSkills.fileTypeLabel') }), jsxs(Select$1, { value: form.file_type, onValueChange: (value) => setForm({ ...form, file_type: value }), children: [jsx(SelectTrigger, { id: "resource-type", className: "w-full", children: jsx(SelectValue, {}) }), jsxs(SelectContent, { children: [jsx(SelectItem, { value: "reference", children: t('clawSandboxAgentSkills.fileTypeReference') }), jsx(SelectItem, { value: "script", children: t('clawSandboxAgentSkills.fileTypeScript') }), jsx(SelectItem, { value: "asset", children: t('clawSandboxAgentSkills.fileTypeAsset') })] })] })] })), isAssetForm ? (jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "resource-file", className: "text-sm font-medium text-[#646464]", children: t('clawSandboxAgentSkills.fileNameLabel') }), jsx("input", { ref: fileInputRef, id: "resource-file", type: "file", className: "hidden", onChange: (e) => { var _a, _b; return setAssetFile((_b = (_a = e.target.files) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : null); }, "data-testid": "resource-file-input" }), jsxs("div", { className: "flex items-center gap-2", children: [jsxs(Button$1, { variant: "outline", size: "sm", onClick: () => { var _a; return (_a = fileInputRef.current) === null || _a === void 0 ? void 0 : _a.click(); }, children: [jsx(Paperclip, { className: "h-4 w-4" }), t('clawSandboxAgentSkills.chooseFile')] }), assetFile && (jsx("span", { className: "truncate text-sm text-gray-600", children: assetFile.name }))] })] })) : (jsxs(Fragment$1, { children: [jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "resource-filename", className: "text-sm font-medium text-[#646464]", children: t('clawSandboxAgentSkills.fileNameLabel') }), jsx(Input, { id: "resource-filename", name: "resource-filename", value: form.filename, onChange: (e) => setForm({ ...form, filename: e.target.value }), placeholder: t('clawSandboxAgentSkills.fileNamePlaceholder'), className: "py-6" })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "resource-content", className: "text-sm font-medium text-[#646464]", children: t('clawSandboxAgentSkills.fileContentLabel') }), jsx(Textarea, { id: "resource-content", name: "resource-content", value: form.content, onChange: (e) => setForm({ ...form, content: e.target.value }), placeholder: t('clawSandboxAgentSkills.fileContentPlaceholder'), rows: 6 })] })] }))] }), jsxs("div", { className: "flex justify-end gap-2 pt-2", children: [jsx(Button$1, { variant: "outline", onClick: closeFileDialog, children: t('clawSandboxAgentSkills.cancel') }), jsx(Button$1, { onClick: handleSubmitFile, disabled: isSaving || !canSubmitFile, className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", children: submitLabel() })] })] }), jsxs(OverlayModal, { open: !!deletingResource, onClose: () => setDeletingResource(null), title: t('clawSandboxAgentSkills.deleteFileDialogTitle'), className: "max-w-md", children: [jsx("p", { className: "mt-2 text-sm text-gray-600", children: t('clawSandboxAgentSkills.deleteFileConfirmation', {
254006
254043
  name: (_c = deletingResource === null || deletingResource === void 0 ? void 0 : deletingResource.filename) !== null && _c !== void 0 ? _c : '',
@@ -254018,20 +254055,19 @@ const EMPTY_SKILL_FORM = {
254018
254055
  instruction: '',
254019
254056
  privateToAgent: false,
254020
254057
  };
254021
- // The builder resolves the effective skill set client-side, which needs the
254022
- // complete catalog and assignment lists. Request one explicit large page so
254023
- // the result is deterministic even if the backend later configures a default
254024
- // page size (the list endpoints unwrap paginated envelopes to `results`).
254058
+ /** Page size for both skill lists. */
254059
+ const SKILLS_PAGE_SIZE = 10;
254060
+ // Resolving the agent's own set (assignment metadata + its private skills)
254061
+ // needs a catalog lookup that the API cannot scope server-side yet (there is
254062
+ // no `mentor=` filter), so one bounded background fetch covers the join.
254025
254063
  const FULL_LIST_LIMIT = 1000;
254026
254064
  function AgentSkills({ platformKey, mentorUniqueId }) {
254027
- var _a;
254065
+ var _a, _b, _c, _d;
254028
254066
  const t = useT();
254029
254067
  // Skills are managed independently of the sandbox connection — org-level
254030
254068
  // skills and the mentor's assignments both resolve without a wired Claw
254031
254069
  // instance, so we always fetch and let admins add/assign skills freely.
254032
- // Always fetch the backend enforces read access; RBAC here only gates
254033
- // the write affordances (a partial permissions map must not blank the UI).
254034
- const { data: availableSkills, isLoading: isLoadingSkills } = useGetAgentSkillsQuery({
254070
+ const { data: joinCatalog, isLoading: isLoadingSkills } = useGetAgentSkillsQuery({
254035
254071
  org: platformKey,
254036
254072
  limit: FULL_LIST_LIMIT,
254037
254073
  offset: 0,
@@ -254042,6 +254078,21 @@ function AgentSkills({ platformKey, mentorUniqueId }) {
254042
254078
  limit: FULL_LIST_LIMIT,
254043
254079
  offset: 0,
254044
254080
  });
254081
+ // The "Available skills" tab pages the catalog server-side.
254082
+ const [catalogPage, setCatalogPage] = useState(1);
254083
+ const { data: catalogSkillsPage, isLoading: isLoadingCatalog } = useGetAgentSkillsQuery({
254084
+ org: platformKey,
254085
+ enabled: true,
254086
+ limit: SKILLS_PAGE_SIZE,
254087
+ offset: (catalogPage - 1) * SKILLS_PAGE_SIZE,
254088
+ });
254089
+ const catalogSkills = (_a = catalogSkillsPage === null || catalogSkillsPage === void 0 ? void 0 : catalogSkillsPage.results) !== null && _a !== void 0 ? _a : [];
254090
+ const catalogTotalCount = (_b = catalogSkillsPage === null || catalogSkillsPage === void 0 ? void 0 : catalogSkillsPage.count) !== null && _b !== void 0 ? _b : 0;
254091
+ const catalogTotalPages = Math.max(1, Math.ceil(catalogTotalCount / SKILLS_PAGE_SIZE));
254092
+ useEffect(() => {
254093
+ if (catalogPage > catalogTotalPages)
254094
+ setCatalogPage(catalogTotalPages);
254095
+ }, [catalogPage, catalogTotalPages]);
254045
254096
  // Assignment mutations (attach/detach/toggle on the agent)
254046
254097
  const [createAssignment, { isLoading: isCreatingAssignment }] = useCreateMentorSkillAssignmentMutation();
254047
254098
  const [updateAssignment, { isLoading: isUpdatingAssignment }] = useUpdateMentorSkillAssignmentMutation();
@@ -254056,18 +254107,24 @@ function AgentSkills({ platformKey, mentorUniqueId }) {
254056
254107
  const [form, setForm] = useState(EMPTY_SKILL_FORM);
254057
254108
  const isLoading = isLoadingSkills || isLoadingAssignments;
254058
254109
  const isMutatingAgentSkill = isCreatingAssignment || isUpdatingAssignment || isDeletingAssignment || isUpdatingSkill;
254059
- const allSkills = availableSkills !== null && availableSkills !== void 0 ? availableSkills : [];
254110
+ const allSkills = (_c = joinCatalog === null || joinCatalog === void 0 ? void 0 : joinCatalog.results) !== null && _c !== void 0 ? _c : [];
254060
254111
  const effectiveSkills = resolveEffectiveAgentSkills(allSkills, assignments !== null && assignments !== void 0 ? assignments : [], mentorUniqueId);
254061
254112
  const effectiveUniqueIds = new Set(effectiveSkills.map((s) => s.unique_id));
254062
254113
  const effectiveSlugs = new Set(effectiveSkills.map((s) => s.slug));
254063
- // Catalog skills this agent could still attach: enabled, platform-wide
254064
- // (never another agent's private skills), and not already effective. A
254065
- // skill whose slug is already effective (e.g. shadowed by a private skill)
254066
- // would dedupe away after attaching — don't offer an Add that does nothing.
254067
- const attachableSkills = allSkills.filter((skill) => skill.enabled &&
254068
- !skill.mentor &&
254069
- !effectiveUniqueIds.has(skill.unique_id) &&
254070
- !effectiveSlugs.has(skill.slug));
254114
+ // The "Agent skills" tab pages the (small, per-agent) effective set locally.
254115
+ const [agentPage, setAgentPage] = useState(1);
254116
+ const agentTotalPages = Math.max(1, Math.ceil(effectiveSkills.length / SKILLS_PAGE_SIZE));
254117
+ useEffect(() => {
254118
+ if (agentPage > agentTotalPages)
254119
+ setAgentPage(agentTotalPages);
254120
+ }, [agentPage, agentTotalPages]);
254121
+ const pagedEffectiveSkills = effectiveSkills.slice((agentPage - 1) * SKILLS_PAGE_SIZE, agentPage * SKILLS_PAGE_SIZE);
254122
+ // Catalog rows already covered by the agent's set (attached, or shadowed by
254123
+ // a same-slug private skill) show an "Added" chip instead of an Add button
254124
+ // — hiding them would make server pages uneven. Another agent's private
254125
+ // skills are not attachable at all.
254126
+ const isCoveredByAgent = (skill) => effectiveUniqueIds.has(skill.unique_id) || effectiveSlugs.has(skill.slug);
254127
+ const isOtherAgentsPrivate = (skill) => !!skill.mentor && skill.mentor !== mentorUniqueId;
254071
254128
  // Featured skills from the `main` platform are read-only for tenants — the
254072
254129
  // API 404s writes against them, so hide the edit/delete affordances.
254073
254130
  const isSkillEditable = (skill) => {
@@ -254193,6 +254250,7 @@ function AgentSkills({ platformKey, mentorUniqueId }) {
254193
254250
  version: form.version,
254194
254251
  category: form.category,
254195
254252
  instruction: form.instruction,
254253
+ mentor: form.privateToAgent ? mentorUniqueId : null,
254196
254254
  }).unwrap();
254197
254255
  toast.success(t('clawSandboxAgentSkills.skillUpdated'));
254198
254256
  closeAllDialogs();
@@ -254234,23 +254292,25 @@ function AgentSkills({ platformKey, mentorUniqueId }) {
254234
254292
  if (isLoading) {
254235
254293
  return (jsxs("div", { className: "flex items-center gap-2 p-4", children: [jsx(LoaderCircle, { className: "h-4 w-4 animate-spin text-blue-500" }), jsx("span", { className: "text-sm text-gray-500", children: t('clawSandboxAgentSkills.loadingSkills') })] }));
254236
254294
  }
254237
- return (jsxs("div", { className: "space-y-4", "data-testid": "agent-skills-content", children: [jsxs("div", { className: "flex items-start justify-between gap-4", children: [jsxs("p", { className: "flex items-start gap-2 text-xs text-gray-500", children: [jsx(Info$3, { className: "mt-0.5 h-4 w-4 shrink-0 text-gray-400" }), jsx("span", { children: t('clawSandboxAgentSkills.sessionNote') })] }), jsxs(Button$1, { onClick: openNewSkillDialog, size: "sm", className: "shrink-0 cursor-pointer bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", children: [jsx(Plus, { className: "h-4 w-4" }), t('clawSandboxAgentSkills.newSkill')] })] }), jsxs("div", { className: "space-y-2", children: [jsx("h3", { className: "text-sm font-semibold text-gray-700", children: t('clawSandboxAgentSkills.effectiveHeading') }), effectiveSkills.length === 0 ? (jsx("div", { className: "flex items-center justify-center rounded-lg border p-6", children: jsx("p", { className: "text-sm text-gray-500", children: t('clawSandboxAgentSkills.noEffectiveSkills') }) })) : (jsx("div", { className: "space-y-3", children: effectiveSkills.map((effective) => {
254238
- var _a;
254239
- return (jsxs("div", { className: "flex items-center justify-between gap-4 rounded-lg border p-4", children: [jsxs("div", { className: "min-w-0 space-y-1", children: [jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-gray-700", children: effective.name }), ((_a = effective.skill) === null || _a === void 0 ? void 0 : _a.version) && (jsxs("span", { className: "hidden text-xs text-gray-400 sm:inline", children: ["v", effective.skill.version] })), renderBadges(effective.skill, effective)] }), effective.description && (jsx("p", { className: "line-clamp-2 text-xs text-gray-500", children: effective.description }))] }), jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [jsx(Switch, { checked: effective.enabled, onCheckedChange: (checked) => handleToggleEffective(effective, checked), disabled: isMutatingAgentSkill, className: "cursor-pointer data-[state=checked]:bg-blue-500", "aria-label": t(effective.enabled
254240
- ? 'clawSandboxAgentSkills.skillEnabledLabel'
254241
- : 'clawSandboxAgentSkills.skillDisabledLabel', { name: effective.name }) }), renderSkillMenu(effective.skill, effective)] })] }, effective.unique_id));
254242
- }) }))] }), jsxs("div", { className: "space-y-2", children: [jsx("h3", { className: "text-sm font-semibold text-gray-700", children: t('clawSandboxAgentSkills.catalogHeading') }), attachableSkills.length === 0 ? (jsx("div", { className: "flex items-center justify-center rounded-lg border p-6", children: jsx("p", { className: "text-sm text-gray-500", children: t('clawSandboxAgentSkills.noSkillsAvailable') }) })) : (jsx("div", { className: "space-y-3", children: attachableSkills.map((skill) => (jsxs("div", { className: "flex items-center justify-between gap-4 rounded-lg border p-4", children: [jsxs("div", { className: "min-w-0 space-y-1", children: [jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-gray-700", children: skill.name }), jsxs("span", { className: "hidden text-xs text-gray-400 sm:inline", children: ["v", skill.version] }), renderBadges(skill)] }), skill.description && (jsx("p", { className: "line-clamp-2 text-xs text-gray-500", children: skill.description }))] }), jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [jsxs(Button$1, { variant: "outline", size: "sm", className: "cursor-pointer", disabled: isMutatingAgentSkill, onClick: () => handleAttach(skill), "aria-label": t('clawSandboxAgentSkills.addToAgentLabel', { name: skill.name }), children: [jsx(Plus, { className: "h-4 w-4" }), t('clawSandboxAgentSkills.addToAgent')] }), renderSkillMenu(skill)] })] }, skill.id))) }))] }), jsx(OverlayModal, { open: showNewDialog, onClose: closeAllDialogs, title: t('clawSandboxAgentSkills.newSkillDialogTitle'), className: "max-w-2xl", children: jsxs("div", { className: "flex h-[min(75dvh,46rem)] flex-col", children: [jsxs("div", { className: "flex-1 space-y-4 overflow-y-auto pb-4 pr-1", children: [jsx(SkillForm, { form: form, onChange: setForm, showPrivateToggle: true }), jsx("p", { className: "text-xs text-gray-500", children: t('clawSandboxAgentSkills.filesAfterCreateHint') })] }), jsxs("div", { className: "flex justify-end gap-2 border-t pt-4", children: [jsx(Button$1, { variant: "outline", onClick: closeAllDialogs, children: t('clawSandboxAgentSkills.cancel') }), jsx(Button$1, { onClick: handleCreateSkill, disabled: isCreatingSkill || !form.name || !form.slug, className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", children: isCreatingSkill
254295
+ return (jsxs("div", { className: "space-y-4", "data-testid": "agent-skills-content", children: [jsxs("div", { className: "flex items-start justify-between gap-4", children: [jsxs("p", { className: "flex items-start gap-2 text-xs text-gray-500", children: [jsx(Info$3, { className: "mt-0.5 h-4 w-4 shrink-0 text-gray-400" }), jsx("span", { children: t('clawSandboxAgentSkills.sessionNote') })] }), jsxs(Button$1, { onClick: openNewSkillDialog, size: "sm", className: "shrink-0 cursor-pointer bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", children: [jsx(Plus, { className: "h-4 w-4" }), t('clawSandboxAgentSkills.newSkill')] })] }), jsxs(Tabs, { defaultValue: "agent", className: "w-full", children: [jsxs(TabsList, { "aria-label": t('clawSandboxAgentSkills.tabsAriaLabel'), "data-testid": "agent-skills-tabs", children: [jsx(TabsTrigger, { value: "agent", "data-testid": "agent-skills-tab-agent", children: t('clawSandboxAgentSkills.tabAgentSkills') }), jsx(TabsTrigger, { value: "available", "data-testid": "agent-skills-tab-available", children: t('clawSandboxAgentSkills.tabAvailableSkills') })] }), jsx(TabsContent, { value: "agent", className: "space-y-3", children: effectiveSkills.length === 0 ? (jsx("div", { className: "flex items-center justify-center rounded-lg border p-6", children: jsx("p", { className: "text-sm text-gray-500", children: t('clawSandboxAgentSkills.noEffectiveSkills') }) })) : (jsxs(Fragment$1, { children: [pagedEffectiveSkills.map((effective) => {
254296
+ var _a;
254297
+ return (jsxs("div", { className: "flex items-center justify-between gap-4 rounded-lg border p-4", "data-testid": "agent-skill-row", children: [jsxs("div", { className: "min-w-0 space-y-1", children: [jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-gray-700", children: effective.name }), ((_a = effective.skill) === null || _a === void 0 ? void 0 : _a.version) && (jsxs("span", { className: "hidden text-xs text-gray-400 sm:inline", children: ["v", effective.skill.version] })), renderBadges(effective.skill, effective)] }), effective.description && (jsx("p", { className: "line-clamp-2 text-xs text-gray-500", children: effective.description }))] }), jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [jsx(Switch, { checked: effective.enabled, onCheckedChange: (checked) => handleToggleEffective(effective, checked), disabled: isMutatingAgentSkill, className: "cursor-pointer data-[state=checked]:bg-blue-500", "aria-label": t(effective.enabled
254298
+ ? 'clawSandboxAgentSkills.skillEnabledLabel'
254299
+ : 'clawSandboxAgentSkills.skillDisabledLabel', { name: effective.name }) }), renderSkillMenu(effective.skill, effective)] })] }, effective.unique_id));
254300
+ }), jsx(IblPagination, { currentPage: agentPage, totalPages: agentTotalPages, onPageChange: setAgentPage, disabled: isMutatingAgentSkill })] })) }), jsx(TabsContent, { value: "available", className: "space-y-3", children: isLoadingCatalog ? (jsxs("div", { className: "flex items-center gap-2 p-4", role: "status", children: [jsx(LoaderCircle, { className: "h-4 w-4 animate-spin text-blue-500" }), jsx("span", { className: "text-sm text-gray-500", children: t('clawSandboxAgentSkills.loadingSkills') })] })) : catalogTotalCount === 0 ? (jsx("div", { className: "flex items-center justify-center rounded-lg border p-6", children: jsx("p", { className: "text-sm text-gray-500", children: t('clawSandboxAgentSkills.noSkillsAvailable') }) })) : (jsxs(Fragment$1, { children: [catalogSkills.map((skill) => (jsxs("div", { className: "flex items-center justify-between gap-4 rounded-lg border p-4", "data-testid": "available-skill-row", children: [jsxs("div", { className: "min-w-0 space-y-1", children: [jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [jsx("span", { className: "text-sm font-medium text-gray-700", children: skill.name }), jsxs("span", { className: "hidden text-xs text-gray-400 sm:inline", children: ["v", skill.version] }), renderBadges(skill)] }), skill.description && (jsx("p", { className: "line-clamp-2 text-xs text-gray-500", children: skill.description }))] }), jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [isCoveredByAgent(skill) ? (jsx("span", { className: "rounded-full bg-green-50 px-2 py-0.5 text-xs text-green-700", children: t('clawSandboxAgentSkills.addedBadge') })) : (!isOtherAgentsPrivate(skill) && (jsxs(Button$1, { variant: "outline", size: "sm", className: "cursor-pointer", disabled: isMutatingAgentSkill, onClick: () => handleAttach(skill), "aria-label": t('clawSandboxAgentSkills.addToAgentLabel', {
254301
+ name: skill.name,
254302
+ }), children: [jsx(Plus, { className: "h-4 w-4" }), t('clawSandboxAgentSkills.addToAgent')] }))), renderSkillMenu(skill)] })] }, skill.id))), jsx(IblPagination, { currentPage: catalogPage, totalPages: catalogTotalPages, onPageChange: setCatalogPage, disabled: isMutatingAgentSkill })] })) })] }), jsx(OverlayModal, { open: showNewDialog, onClose: closeAllDialogs, title: t('clawSandboxAgentSkills.newSkillDialogTitle'), className: "max-w-2xl", children: jsxs("div", { className: "flex h-[min(75dvh,46rem)] flex-col", children: [jsxs("div", { className: "flex-1 space-y-4 overflow-y-auto pb-4 pr-1", children: [jsx(SkillForm, { form: form, onChange: setForm }), jsx("p", { className: "text-xs text-gray-500", children: t('clawSandboxAgentSkills.filesAfterCreateHint') })] }), jsxs("div", { className: "flex justify-end gap-2 border-t pt-4", children: [jsx(Button$1, { variant: "outline", onClick: closeAllDialogs, children: t('clawSandboxAgentSkills.cancel') }), jsx(Button$1, { onClick: handleCreateSkill, disabled: isCreatingSkill || !form.name || !form.slug, className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", children: isCreatingSkill
254243
254303
  ? t('clawSandboxAgentSkills.creating')
254244
254304
  : t('clawSandboxAgentSkills.create') })] })] }) }), jsx(OverlayModal, { open: !!editingSkill, onClose: closeAllDialogs, title: t('clawSandboxAgentSkills.editSkillDialogTitle'), className: "max-w-2xl", children: jsxs(Tabs, { defaultValue: "details", className: "w-full", children: [jsxs(TabsList, { "aria-label": t('clawSandboxAgentSkills.editSkillDialogTitle'), "data-testid": "skill-dialog-tabs", children: [jsx(TabsTrigger, { value: "details", "data-testid": "skill-dialog-tab-details", children: t('clawSandboxAgentSkills.detailsTab') }), jsx(TabsTrigger, { value: "files", "data-testid": "skill-dialog-tab-files", children: t('clawSandboxAgentSkills.filesTab') })] }), jsx(TabsContent, { value: "details", children: jsxs("div", { className: "flex h-[min(75dvh,46rem)] flex-col", children: [jsx("div", { className: "flex-1 space-y-4 overflow-y-auto pb-4 pr-1", children: jsx(SkillForm, { form: form, onChange: setForm }) }), jsxs("div", { className: "flex justify-end gap-2 border-t pt-4", children: [jsx(Button$1, { variant: "outline", onClick: closeAllDialogs, children: t('clawSandboxAgentSkills.cancel') }), jsx(Button$1, { onClick: handleUpdateSkill, disabled: isUpdatingSkill || !form.name || !form.slug, className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", children: isUpdatingSkill
254245
254305
  ? t('clawSandboxAgentSkills.saving')
254246
- : t('clawSandboxAgentSkills.save') })] })] }) }), jsx(TabsContent, { value: "files", children: jsx("div", { className: "flex h-[min(75dvh,46rem)] flex-col", children: jsx("div", { className: "flex-1 space-y-4 overflow-y-auto pb-4 pr-1", children: editingSkill && (jsx(SkillResourcesSection, { platformKey: platformKey, skillId: editingSkill.id })) }) }) })] }) }), jsxs(OverlayModal, { open: !!deletingSkill, onClose: () => setDeletingSkill(null), title: t('clawSandboxAgentSkills.deleteSkillDialogTitle'), className: "max-w-md", children: [jsx("p", { className: "mt-2 text-sm text-gray-600", children: t('clawSandboxAgentSkills.deleteConfirmation', { name: (_a = deletingSkill === null || deletingSkill === void 0 ? void 0 : deletingSkill.name) !== null && _a !== void 0 ? _a : '' }) }), jsxs("div", { className: "flex justify-end gap-2 pt-2", children: [jsx(Button$1, { variant: "outline", onClick: () => setDeletingSkill(null), children: t('clawSandboxAgentSkills.cancel') }), jsx(Button$1, { onClick: handleDeleteSkill, disabled: isDeletingSkill, className: "bg-red-600 text-white hover:bg-red-700", children: isDeletingSkill
254306
+ : t('clawSandboxAgentSkills.save') })] })] }) }), jsx(TabsContent, { value: "files", children: jsx("div", { className: "flex h-[min(75dvh,46rem)] flex-col", children: jsx("div", { className: "flex-1 space-y-4 overflow-y-auto pb-4 pr-1", children: editingSkill && (jsx(SkillResourcesSection, { platformKey: platformKey, skillId: editingSkill.id })) }) }) })] }) }), jsxs(OverlayModal, { open: !!deletingSkill, onClose: () => setDeletingSkill(null), title: t('clawSandboxAgentSkills.deleteSkillDialogTitle'), className: "max-w-md", children: [jsx("p", { className: "mt-2 text-sm text-gray-600", children: t('clawSandboxAgentSkills.deleteConfirmation', { name: (_d = deletingSkill === null || deletingSkill === void 0 ? void 0 : deletingSkill.name) !== null && _d !== void 0 ? _d : '' }) }), jsxs("div", { className: "flex justify-end gap-2 pt-2", children: [jsx(Button$1, { variant: "outline", onClick: () => setDeletingSkill(null), children: t('clawSandboxAgentSkills.cancel') }), jsx(Button$1, { onClick: handleDeleteSkill, disabled: isDeletingSkill, className: "bg-red-600 text-white hover:bg-red-700", children: isDeletingSkill
254247
254307
  ? t('clawSandboxAgentSkills.deleting')
254248
254308
  : t('clawSandboxAgentSkills.delete') })] })] })] }));
254249
254309
  }
254250
254310
  // ── Shared Skill Form ────────────────────────────────────────────────────────
254251
- function SkillForm({ form, onChange, showPrivateToggle = false, }) {
254311
+ function SkillForm({ form, onChange, }) {
254252
254312
  const t = useT();
254253
- return (jsxs("div", { className: "mt-4 grid gap-4", children: [jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "skill-name", className: "text-sm font-medium text-[#646464]", children: t('clawSandboxAgentSkills.fieldName') }), jsx(Input, { id: "skill-name", name: "skill-name", value: form.name, onChange: (e) => onChange({ ...form, name: e.target.value }), placeholder: t('clawSandboxAgentSkills.fieldNamePlaceholder'), className: "py-6" })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "skill-slug", className: "text-sm font-medium text-[#646464]", children: t('clawSandboxAgentSkills.fieldSlug') }), jsx(Input, { id: "skill-slug", name: "skill-slug", value: form.slug, onChange: (e) => onChange({ ...form, slug: e.target.value }), placeholder: t('clawSandboxAgentSkills.fieldSlugPlaceholder'), className: "py-6" })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "skill-version", className: "text-sm font-medium text-[#646464]", children: t('clawSandboxAgentSkills.fieldVersion') }), jsx(Input, { id: "skill-version", name: "skill-version", value: form.version, onChange: (e) => onChange({ ...form, version: e.target.value }), placeholder: t('clawSandboxAgentSkills.fieldVersionPlaceholder'), className: "py-6" })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "skill-category", className: "text-sm font-medium text-[#646464]", children: t('clawSandboxAgentSkills.fieldCategory') }), jsx(Input, { id: "skill-category", name: "skill-category", value: form.category, onChange: (e) => onChange({ ...form, category: e.target.value }), placeholder: t('clawSandboxAgentSkills.fieldCategoryPlaceholder'), className: "py-6" })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "skill-description", className: "text-sm font-medium text-[#646464]", children: t('clawSandboxAgentSkills.fieldDescription') }), jsx(Input, { id: "skill-description", name: "skill-description", value: form.description, onChange: (e) => onChange({ ...form, description: e.target.value }), placeholder: t('clawSandboxAgentSkills.fieldDescriptionPlaceholder'), className: "py-6" })] }), showPrivateToggle && (jsxs("div", { className: "flex items-center justify-between rounded-lg border p-4", children: [jsxs("div", { className: "space-y-1", children: [jsx(Label$1, { htmlFor: "skill-private", className: "text-sm font-medium text-[#646464]", children: t('clawSandboxAgentSkills.privateToAgent') }), jsx("p", { className: "text-xs text-gray-500", children: t('clawSandboxAgentSkills.privateToAgentHint') })] }), jsx(Switch, { id: "skill-private", checked: form.privateToAgent, onCheckedChange: (checked) => onChange({ ...form, privateToAgent: checked }), className: "cursor-pointer data-[state=checked]:bg-blue-500" })] })), jsxs("div", { className: "space-y-2 overflow-hidden", children: [jsx(Label$1, { htmlFor: "skill-instruction", className: "text-sm font-medium text-[#646464]", children: t('clawSandboxAgentSkills.fieldInstruction') }), jsx("p", { className: "text-xs text-gray-500", children: t('clawSandboxAgentSkills.instructionHint') }), jsx(RichTextEditor, { value: form.instruction, onChange: (value) => onChange({ ...form, instruction: value }) })] })] }));
254313
+ return (jsxs("div", { className: "mt-4 grid gap-4", children: [jsxs("div", { className: "flex items-center justify-between rounded-lg border p-4", children: [jsxs("div", { className: "space-y-1", children: [jsx(Label$1, { htmlFor: "skill-private", className: "text-sm font-medium text-[#646464]", children: t('clawSandboxAgentSkills.privateToAgent') }), jsx("p", { className: "text-xs text-gray-500", children: t('clawSandboxAgentSkills.privateToAgentHint') })] }), jsx(Switch, { id: "skill-private", checked: form.privateToAgent, onCheckedChange: (checked) => onChange({ ...form, privateToAgent: checked }), className: "cursor-pointer data-[state=checked]:bg-blue-500" })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "skill-name", className: "text-sm font-medium text-[#646464]", children: t('clawSandboxAgentSkills.fieldName') }), jsx(Input, { id: "skill-name", name: "skill-name", value: form.name, onChange: (e) => onChange({ ...form, name: e.target.value }), placeholder: t('clawSandboxAgentSkills.fieldNamePlaceholder'), className: "py-6" })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "skill-slug", className: "text-sm font-medium text-[#646464]", children: t('clawSandboxAgentSkills.fieldSlug') }), jsx(Input, { id: "skill-slug", name: "skill-slug", value: form.slug, onChange: (e) => onChange({ ...form, slug: e.target.value }), placeholder: t('clawSandboxAgentSkills.fieldSlugPlaceholder'), className: "py-6" })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "skill-version", className: "text-sm font-medium text-[#646464]", children: t('clawSandboxAgentSkills.fieldVersion') }), jsx(Input, { id: "skill-version", name: "skill-version", value: form.version, onChange: (e) => onChange({ ...form, version: e.target.value }), placeholder: t('clawSandboxAgentSkills.fieldVersionPlaceholder'), className: "py-6" })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "skill-category", className: "text-sm font-medium text-[#646464]", children: t('clawSandboxAgentSkills.fieldCategory') }), jsx(Input, { id: "skill-category", name: "skill-category", value: form.category, onChange: (e) => onChange({ ...form, category: e.target.value }), placeholder: t('clawSandboxAgentSkills.fieldCategoryPlaceholder'), className: "py-6" })] }), jsxs("div", { className: "space-y-2", children: [jsx(Label$1, { htmlFor: "skill-description", className: "text-sm font-medium text-[#646464]", children: t('clawSandboxAgentSkills.fieldDescription') }), jsx(Textarea, { id: "skill-description", name: "skill-description", value: form.description, onChange: (e) => onChange({ ...form, description: e.target.value }), placeholder: t('clawSandboxAgentSkills.fieldDescriptionPlaceholder'), rows: 3 })] }), jsxs("div", { className: "space-y-2 overflow-hidden", children: [jsx(Label$1, { htmlFor: "skill-instruction", className: "text-sm font-medium text-[#646464]", children: t('clawSandboxAgentSkills.fieldInstruction') }), jsx("p", { className: "text-xs text-gray-500", children: t('clawSandboxAgentSkills.instructionHint') }), jsx(RichTextEditor, { value: form.instruction, onChange: (value) => onChange({ ...form, instruction: value }) })] })] }));
254254
254314
  }
254255
254315
 
254256
254316
  /** Distance (px) from the list bottom at which the next page is requested. */
@@ -254282,16 +254342,20 @@ function SlashSkillPicker({ skills, activeIndex, listboxId, onSelect, onActiveIn
254282
254342
  };
254283
254343
  return (jsxs("div", { className: "absolute right-0 bottom-full left-0 z-50 mb-2", children: [jsx("div", { "aria-live": "polite", className: "sr-only", children: isLoading
254284
254344
  ? t('slashSkillPicker.loading')
254285
- : t('slashSkillPicker.resultsAnnouncement', { count: skills.length }) }), isLoading ? (jsxs("div", { role: "status", className: "flex items-center gap-2 rounded-xl border border-gray-200 bg-white px-3 py-3 shadow-lg", "data-testid": "slash-skill-picker-loading", children: [jsx(LoaderCircle, { className: "h-4 w-4 animate-spin text-blue-500" }), jsx("span", { className: "text-sm text-gray-500", children: t('slashSkillPicker.loading') })] })) : (jsxs("ul", { ref: listRef, id: listboxId, role: "listbox", "aria-label": t('slashSkillPicker.listLabel'), onScroll: handleScroll, className: "max-h-64 overflow-y-auto rounded-xl border border-gray-200 bg-white p-1 shadow-lg", "data-testid": "slash-skill-picker", children: [skills.map((skill, index) => (jsxs("li", { id: `${listboxId}-option-${index}`, role: "option", "aria-selected": index === activeIndex, className: cn('flex cursor-pointer flex-col gap-0.5 rounded-lg px-3 py-2', index === activeIndex ? 'bg-blue-50' : 'hover:bg-gray-50'), onMouseEnter: () => onActiveIndexChange(index),
254345
+ : t('slashSkillPicker.resultsAnnouncement', { count: skills.length }) }), isLoading ? (jsxs("div", { role: "status", className: "flex items-center gap-2 rounded-xl border border-gray-200 bg-white px-3 py-3 shadow-lg", "data-testid": "slash-skill-picker-loading", children: [jsx(LoaderCircle, { className: "h-4 w-4 animate-spin text-blue-500" }), jsx("span", { className: "text-sm text-gray-500", children: t('slashSkillPicker.loading') })] })) : (jsxs("ul", { ref: listRef, id: listboxId, role: "listbox", "aria-label": t('slashSkillPicker.listLabel'), onScroll: handleScroll, className: "max-h-64 overflow-y-auto rounded-xl border border-gray-200 bg-white p-1 shadow-lg", "data-testid": "slash-skill-picker", children: [skills.map((skill, index) => (jsx("li", { id: `${listboxId}-option-${index}`, role: "option", "aria-selected": index === activeIndex, className: cn('flex cursor-pointer flex-col gap-0.5 rounded-lg px-3 py-2', index === activeIndex ? 'bg-blue-50' : 'hover:bg-gray-50'), onMouseEnter: () => onActiveIndexChange(index),
254286
254346
  // onMouseDown so selection wins over the textarea losing focus.
254287
254347
  onMouseDown: (e) => {
254288
254348
  e.preventDefault();
254289
254349
  onSelect(skill);
254290
- }, children: [jsxs("span", { className: "flex items-baseline gap-2", children: [jsx("span", { className: "text-sm font-medium text-gray-800", children: skill.name }), jsxs("span", { className: "text-xs text-gray-400", children: ["/", skill.slug] }), skill.category && (jsx("span", { className: "ml-auto rounded-full bg-gray-100 px-2 py-0.5 text-[0.625rem] text-gray-500", children: skill.category }))] }), skill.description && (jsx("span", { className: "line-clamp-2 text-xs text-gray-500", children: skill.description }))] }, skill.unique_id))), isFetchingMore && (jsxs("li", { role: "presentation", className: "flex items-center gap-2 px-3 py-2", "data-testid": "slash-skill-picker-loading-more", children: [jsx(LoaderCircle, { className: "h-4 w-4 animate-spin text-blue-500" }), jsx("span", { className: "text-xs text-gray-500", children: t('slashSkillPicker.loading') })] }))] }))] }));
254350
+ }, children: jsxs("span", { className: "flex items-baseline gap-2", children: [jsx("span", { className: "text-sm font-medium text-gray-800", children: skill.name }), jsxs("span", { className: "text-xs text-gray-400", children: ["/", skill.slug] }), skill.category && (jsx("span", { className: "ml-auto rounded-full bg-gray-100 px-2 py-0.5 text-[0.625rem] text-gray-500", children: skill.category }))] }) }, skill.unique_id))), isFetchingMore && (jsxs("li", { role: "presentation", className: "flex items-center gap-2 px-3 py-2", "data-testid": "slash-skill-picker-loading-more", children: [jsx(LoaderCircle, { className: "h-4 w-4 animate-spin text-blue-500" }), jsx("span", { className: "text-xs text-gray-500", children: t('slashSkillPicker.loading') })] }))] }))] }));
254291
254351
  }
254292
254352
 
254293
254353
  /** Matches a composer value that is a single `/`-prefixed token (no whitespace). */
254294
254354
  const SLASH_TOKEN_RE = /^\/\S*$/;
254355
+ /** Whether the composer text is a `/` skill token (single word, leading slash). */
254356
+ function isSlashCommandToken(value) {
254357
+ return SLASH_TOKEN_RE.test(value);
254358
+ }
254295
254359
  /**
254296
254360
  * State machine for the chat `/` skill picker. Opens while the composer holds
254297
254361
  * a single `/`-prefixed token and at least one enabled skill matches; `Esc`
@@ -254374,6 +254438,55 @@ function useSlashSkillPicker({ inputValue, setInputValue, skills, isLoading = fa
254374
254438
  };
254375
254439
  }
254376
254440
 
254441
+ /** Assignment rows carry everything the picker shows (name + slug + enabled). */
254442
+ const toSlashSkill = (assignment) => {
254443
+ var _a;
254444
+ return ({
254445
+ unique_id: assignment.skill,
254446
+ name: assignment.skill_name,
254447
+ slug: (_a = assignment.skill_slug) !== null && _a !== void 0 ? _a : assignment.skill_name,
254448
+ enabled: assignment.enabled,
254449
+ origin: 'assignment',
254450
+ assignmentId: assignment.id,
254451
+ });
254452
+ };
254453
+ /**
254454
+ * Lazy, paged fetch of the agent's skills for the chat `/` picker, straight
254455
+ * from the per-agent skills endpoint (`/agents/{uuid}/skills/`) — the
254456
+ * org-wide agent-skills catalog is not involved. Fetching is deferred until
254457
+ * the user first types `/` (then kept warm), and errors degrade to an empty
254458
+ * list so the picker simply stays closed.
254459
+ */
254460
+ function useSlashSkills({ org, mentorUniqueId, enabled, active, pageSize = MENTOR_SKILL_ASSIGNMENTS_PAGE_SIZE, }) {
254461
+ const [offset, setOffset] = useState(0);
254462
+ // Sticky: once the user opens the picker, keep results cached for the session.
254463
+ const [activated, setActivated] = useState(false);
254464
+ useEffect(() => {
254465
+ if (active && !activated)
254466
+ setActivated(true);
254467
+ }, [active, activated]);
254468
+ // A different agent gets its own cache entry — restart from the first page.
254469
+ useEffect(() => {
254470
+ setOffset(0);
254471
+ }, [org, mentorUniqueId]);
254472
+ const { data, isLoading, isFetching } = useGetMentorSkillAssignmentsInfiniteQuery({ org, mentorUniqueId: mentorUniqueId !== null && mentorUniqueId !== void 0 ? mentorUniqueId : '', limit: pageSize, offset }, { skip: !enabled || !mentorUniqueId || !org || !activated });
254473
+ const rows = data === null || data === void 0 ? void 0 : data.results;
254474
+ const skills = useMemo(() => (rows !== null && rows !== void 0 ? rows : []).map(toSlashSkill), [rows]);
254475
+ const loadedCount = skills.length;
254476
+ const hasMore = !!(data === null || data === void 0 ? void 0 : data.next);
254477
+ const loadMore = useCallback(() => {
254478
+ if (hasMore && !isFetching)
254479
+ setOffset(loadedCount);
254480
+ }, [hasMore, isFetching, loadedCount]);
254481
+ return {
254482
+ skills,
254483
+ isLoading: (isLoading || isFetching) && loadedCount === 0,
254484
+ isFetchingMore: isFetching && loadedCount > 0,
254485
+ hasMore,
254486
+ loadMore,
254487
+ };
254488
+ }
254489
+
254377
254490
  lazy(() => Promise.resolve().then(function () { return createProjectModal; }).then((mod) => ({
254378
254491
  default: mod.CreateProjectModal,
254379
254492
  })));
@@ -256634,8 +256747,8 @@ function SubmitMessageButton({ isPreviewMode, allowAnonymousAccess, isUploading,
256634
256747
  const PromptGalleryModal$1 = dynamic(() => Promise.resolve().then(function () { return promptGalleryModal; }).then((mod) => mod.PromptGalleryModal), {
256635
256748
  ssr: false,
256636
256749
  });
256637
- function ChatInputForm({ onSubmit, onScreenSharingClick, isScreenSharingModalOpen, onPhoneCallClick, sessionId, stopGenerating, mentorId, tenantKey, isPublicRoute, userIsStudent, username, isPreviewMode, enableWebBrowsing, isStreaming, updateSessionTools, setSessionTools, activeTools, screenSharing, deepResearch, studyMode, imageGeneration, codeInterpreter, promptsIsEnabled, googleSlidesIsEnabled, googleDocumentIsEnabled, artifactsEnabled, compactMode = false, chatAreaMaxWidth, isConnecting = false, stopStreamingButtonRef, slashSkills, slashSkillsLoading = false, }) {
256638
- var _a, _b, _c, _d, _e;
256750
+ function ChatInputForm({ onSubmit, onScreenSharingClick, isScreenSharingModalOpen, onPhoneCallClick, sessionId, stopGenerating, mentorId, tenantKey, isPublicRoute, userIsStudent, username, isPreviewMode, enableWebBrowsing, isStreaming, updateSessionTools, setSessionTools, activeTools, screenSharing, deepResearch, studyMode, imageGeneration, codeInterpreter, promptsIsEnabled, googleSlidesIsEnabled, googleDocumentIsEnabled, artifactsEnabled, compactMode = false, chatAreaMaxWidth, isConnecting = false, stopStreamingButtonRef, slashSkillsEnabled = false, slashSkills, slashSkillsLoading = false, }) {
256751
+ var _a, _b, _c, _d, _e, _f;
256639
256752
  const t = useT();
256640
256753
  const dispatch = useDispatch();
256641
256754
  const mentorSettings = useMentorSettings({
@@ -256688,14 +256801,25 @@ function ChatInputForm({ onSubmit, onScreenSharingClick, isScreenSharingModalOpe
256688
256801
  const setInputValue = (input) => {
256689
256802
  dispatch(chatInputSliceActions.setTextareaInput(input));
256690
256803
  };
256691
- // `/` skill picker — active only when the host supplies the agent's
256692
- // effective skills (or reports them loading). No fetching happens here.
256693
- const effectiveSlashSkills = slashSkills !== null && slashSkills !== void 0 ? slashSkills : [];
256804
+ // `/` skill picker — fetches the agent's skills lazily from the per-agent
256805
+ // skills endpoint on the first `/` keystroke (the popup shows a loading row
256806
+ // meanwhile; scrolling loads more). A host-supplied `slashSkills` list
256807
+ // bypasses fetching entirely.
256808
+ const mentorUniqueId = (_c = mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.data) === null || _c === void 0 ? void 0 : _c.mentorUniqueId;
256809
+ const slashTokenActive = slashSkillsEnabled && isSlashCommandToken(inputValue);
256810
+ const fetchedSlashSkills = useSlashSkills({
256811
+ org: tenantKey,
256812
+ mentorUniqueId,
256813
+ enabled: slashSkillsEnabled && !slashSkills,
256814
+ active: slashTokenActive,
256815
+ });
256816
+ const effectiveSlashSkills = slashSkills !== null && slashSkills !== void 0 ? slashSkills : (slashSkillsEnabled ? fetchedSlashSkills.skills : []);
256817
+ const pickerLoading = slashSkills ? slashSkillsLoading : fetchedSlashSkills.isLoading;
256694
256818
  const slashPicker = useSlashSkillPicker({
256695
256819
  inputValue,
256696
256820
  setInputValue,
256697
256821
  skills: effectiveSlashSkills,
256698
- isLoading: slashSkillsLoading,
256822
+ isLoading: pickerLoading,
256699
256823
  });
256700
256824
  const handleSelectPrompt = (promptText) => {
256701
256825
  setInputValue(promptText);
@@ -256761,9 +256885,9 @@ function ChatInputForm({ onSubmit, onScreenSharingClick, isScreenSharingModalOpe
256761
256885
  }
256762
256886
  return persistentChatInputLabel ? '' : t('chatInputForm.askAnything');
256763
256887
  };
256764
- return (jsxs(Fragment$1, { children: [isTabletOrMobile && !isPreviewMode && !embedMode && !compactMode && (jsx("div", { className: "mx-auto flex w-full justify-end pt-4 pl-4", style: chatAreaMaxWidth ? { maxWidth: `${chatAreaMaxWidth}px` } : undefined, children: jsx(RetrievedDocumentsButton, { sessionId: sessionId }) })), ((_c = mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.data) === null || _c === void 0 ? void 0 : _c.disclaimer) && !compactMode && (jsx("div", { className: "mx-auto mt-1 w-full pb-1", style: chatAreaMaxWidth ? { maxWidth: `${chatAreaMaxWidth}px` } : undefined, children: jsx("p", { id: "chat-input-disclaimer", className: "text-center text-[0.625rem] text-gray-500 italic", children: (_d = mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.data) === null || _d === void 0 ? void 0 : _d.disclaimer }) })), jsxs("form", { ref: containerRef, onSubmit: handleSubmit, className: cn('relative mx-auto mt-4 w-full pb-2', CSS_CLASS_NAMES.CHAT.TEXTAREA), style: chatAreaMaxWidth ? { maxWidth: `${chatAreaMaxWidth}px` } : undefined, children: [slashPicker.open && (jsx(SlashSkillPicker, { skills: slashPicker.filteredSkills, activeIndex: slashPicker.activeIndex, listboxId: slashPicker.listboxId, onSelect: slashPicker.selectSkill, onActiveIndexChange: slashPicker.setActiveIndex, isLoading: slashSkillsLoading })), jsxs("div", { className: "relative overflow-hidden rounded-2xl border border-gray-200 bg-[#fbfbfb] pb-3 shadow-xs", children: [jsx(FileAttachmentsList, { attachedFiles: attachedFiles, onRemoveFile: handleRemoveFile, onRetryFile: retryUpload }), fileAddedNotification && (jsxs("div", { className: "animate-in slide-in-from-bottom-5 absolute top-0 right-0 left-0 -mt-10 flex items-center gap-2 rounded-md bg-blue-50 p-2 text-xs text-blue-600 duration-300", children: [jsx(FileText, { className: "h-3 w-3" }), jsx("span", { className: "truncate", children: fileAddedNotification })] })), jsxs("div", { className: "grid", children: [jsx("label", { id: "chat-input-label", htmlFor: "chat-input-textarea", className: cn(persistentChatInputLabel
256888
+ return (jsxs(Fragment$1, { children: [isTabletOrMobile && !isPreviewMode && !embedMode && !compactMode && (jsx("div", { className: "mx-auto flex w-full justify-end pt-4 pl-4", style: chatAreaMaxWidth ? { maxWidth: `${chatAreaMaxWidth}px` } : undefined, children: jsx(RetrievedDocumentsButton, { sessionId: sessionId }) })), ((_d = mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.data) === null || _d === void 0 ? void 0 : _d.disclaimer) && !compactMode && (jsx("div", { className: "mx-auto mt-1 w-full pb-1", style: chatAreaMaxWidth ? { maxWidth: `${chatAreaMaxWidth}px` } : undefined, children: jsx("p", { id: "chat-input-disclaimer", className: "text-center text-[0.625rem] text-gray-500 italic", children: (_e = mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.data) === null || _e === void 0 ? void 0 : _e.disclaimer }) })), jsxs("form", { ref: containerRef, onSubmit: handleSubmit, className: cn('relative mx-auto mt-4 w-full pb-2', CSS_CLASS_NAMES.CHAT.TEXTAREA), style: chatAreaMaxWidth ? { maxWidth: `${chatAreaMaxWidth}px` } : undefined, children: [slashPicker.open && (jsx(SlashSkillPicker, { skills: slashPicker.filteredSkills, activeIndex: slashPicker.activeIndex, listboxId: slashPicker.listboxId, onSelect: slashPicker.selectSkill, onActiveIndexChange: slashPicker.setActiveIndex, isLoading: pickerLoading, isFetchingMore: !slashSkills && fetchedSlashSkills.isFetchingMore, hasMore: !slashSkills && fetchedSlashSkills.hasMore, onLoadMore: fetchedSlashSkills.loadMore })), jsxs("div", { className: "relative overflow-hidden rounded-2xl border border-gray-200 bg-[#fbfbfb] pb-3 shadow-xs", children: [jsx(FileAttachmentsList, { attachedFiles: attachedFiles, onRemoveFile: handleRemoveFile, onRetryFile: retryUpload }), fileAddedNotification && (jsxs("div", { className: "animate-in slide-in-from-bottom-5 absolute top-0 right-0 left-0 -mt-10 flex items-center gap-2 rounded-md bg-blue-50 p-2 text-xs text-blue-600 duration-300", children: [jsx(FileText, { className: "h-3 w-3" }), jsx("span", { className: "truncate", children: fileAddedNotification })] })), jsxs("div", { className: "grid", children: [jsx("label", { id: "chat-input-label", htmlFor: "chat-input-textarea", className: cn(persistentChatInputLabel
256765
256889
  ? 'block px-[18.5px] pt-3 text-xs font-medium text-gray-600'
256766
- : 'sr-only'), children: t('chatInputForm.askAnything') }), jsx(AutoResizeTextarea, { id: "chat-input-textarea", "aria-labelledby": "chat-input-label", "aria-describedby": ((_e = mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.data) === null || _e === void 0 ? void 0 : _e.disclaimer) ? 'chat-input-disclaimer' : undefined, ...((effectiveSlashSkills.length > 0 || slashPicker.open) && {
256890
+ : 'sr-only'), children: t('chatInputForm.askAnything') }), jsx(AutoResizeTextarea, { id: "chat-input-textarea", "aria-labelledby": "chat-input-label", "aria-describedby": ((_f = mentorSettings === null || mentorSettings === void 0 ? void 0 : mentorSettings.data) === null || _f === void 0 ? void 0 : _f.disclaimer) ? 'chat-input-disclaimer' : undefined, ...((effectiveSlashSkills.length > 0 || slashPicker.open) && {
256767
256891
  role: 'combobox',
256768
256892
  'aria-expanded': slashPicker.open,
256769
256893
  'aria-haspopup': 'listbox',
@@ -279655,7 +279779,7 @@ const CODE_FILE_EXTENSIONS = new Set([
279655
279779
  'css',
279656
279780
  'sh',
279657
279781
  ]);
279658
- function Chat({ mode = 'default', isPreviewMode = false, hasBorder = true, isInCanvasView = false, config, redirectToAuthSpa, username, userTenants, visitingTenant, axdToken, mentorId, tenantKey, userIsStudent, isPublicRoute, showConversationStarters = false, showExploreMentors = false, projectId, slashSkills, slashSkillsLoading = false, }) {
279782
+ function Chat({ mode = 'default', isPreviewMode = false, hasBorder = true, isInCanvasView = false, config, redirectToAuthSpa, username, userTenants, visitingTenant, axdToken, mentorId, tenantKey, userIsStudent, isPublicRoute, showConversationStarters = false, showExploreMentors = false, projectId, slashSkillsEnabled = false, slashSkills, slashSkillsLoading = false, }) {
279659
279783
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
279660
279784
  const t = useT();
279661
279785
  const { metadata } = useTenantContext();
@@ -280684,7 +280808,7 @@ function Chat({ mode = 'default', isPreviewMode = false, hasBorder = true, isInC
280684
280808
  !(messages.length > 0 &&
280685
280809
  ((_g = messages[messages.length - 1]) === null || _g === void 0 ? void 0 : _g.role) === 'assistant' &&
280686
280810
  ((_h = messages[messages.length - 1]) === null || _h === void 0 ? void 0 : _h.artifactVersions) &&
280687
- ((_l = (_k = (_j = messages[messages.length - 1]) === null || _j === void 0 ? void 0 : _j.artifactVersions) === null || _k === void 0 ? void 0 : _k.length) !== null && _l !== void 0 ? _l : 0) > 0) && jsx(LoadingMessage, { mentorName: mentorName, profileImage: profileImage }), !showingSharedChat && guidedPrompts] }) }) }), jsx("div", { className: "flex-shrink-0 overflow-y-auto border-t border-gray-200 bg-white p-3 [scrollbar-gutter:stable]", children: jsx(ChatInputForm, { mentorId: mentorId, userIsStudent: userIsStudent, isPublicRoute: isPublicRoute, slashSkills: slashSkills, slashSkillsLoading: slashSkillsLoading, sessionId: sessionId, onSubmit: handleSubmit, stopGenerating: stopGenerating, onScreenSharingClick: () => {
280811
+ ((_l = (_k = (_j = messages[messages.length - 1]) === null || _j === void 0 ? void 0 : _j.artifactVersions) === null || _k === void 0 ? void 0 : _k.length) !== null && _l !== void 0 ? _l : 0) > 0) && jsx(LoadingMessage, { mentorName: mentorName, profileImage: profileImage }), !showingSharedChat && guidedPrompts] }) }) }), jsx("div", { className: "flex-shrink-0 overflow-y-auto border-t border-gray-200 bg-white p-3 [scrollbar-gutter:stable]", children: jsx(ChatInputForm, { mentorId: mentorId, userIsStudent: userIsStudent, isPublicRoute: isPublicRoute, slashSkillsEnabled: slashSkillsEnabled, slashSkills: slashSkills, slashSkillsLoading: slashSkillsLoading, sessionId: sessionId, onSubmit: handleSubmit, stopGenerating: stopGenerating, onScreenSharingClick: () => {
280688
280812
  var _a;
280689
280813
  if (enableChatPopupActions && isInIframe()) {
280690
280814
  sendMessageToParentWebsite({
@@ -280716,7 +280840,7 @@ function Chat({ mode = 'default', isPreviewMode = false, hasBorder = true, isInC
280716
280840
  height: '100%',
280717
280841
  }, children: [jsx(CanvasView$1, { canvasTitle: canvasState.title, canvasContent: canvasState.content, canvasType: canvasState.type, artifactId: canvasState.artifactId, org: canvasState.org, userId: canvasState.userId, fileExtension: canvasState.fileExtension, metadata: canvasState.metadata, sessionId: sessionId, tenantKey: tenantKey, refreshTrigger: canvasRefreshTrigger, sendMessage: (text, options) => {
280718
280842
  sendMessage(activeTab, text, options);
280719
- }, onClose: handleCloseCanvas }, `${(_m = canvasState.artifactId) !== null && _m !== void 0 ? _m : 'canvas'}-${canvasRefreshTrigger}`), jsx("div", { className: "flex-shrink-0 border-t border-gray-200 bg-white p-3 md:hidden", children: jsx(ChatInputForm, { mentorId: mentorId, userIsStudent: userIsStudent, isPublicRoute: isPublicRoute, slashSkills: slashSkills, slashSkillsLoading: slashSkillsLoading, sessionId: sessionId, onSubmit: handleSubmit, stopGenerating: stopGenerating, onScreenSharingClick: () => {
280843
+ }, onClose: handleCloseCanvas }, `${(_m = canvasState.artifactId) !== null && _m !== void 0 ? _m : 'canvas'}-${canvasRefreshTrigger}`), jsx("div", { className: "flex-shrink-0 border-t border-gray-200 bg-white p-3 md:hidden", children: jsx(ChatInputForm, { mentorId: mentorId, userIsStudent: userIsStudent, isPublicRoute: isPublicRoute, slashSkillsEnabled: slashSkillsEnabled, slashSkills: slashSkills, slashSkillsLoading: slashSkillsLoading, sessionId: sessionId, onSubmit: handleSubmit, stopGenerating: stopGenerating, onScreenSharingClick: () => {
280720
280844
  var _a;
280721
280845
  if (enableChatPopupActions && isInIframe()) {
280722
280846
  sendMessageToParentWebsite({
@@ -280763,7 +280887,7 @@ function Chat({ mode = 'default', isPreviewMode = false, hasBorder = true, isInC
280763
280887
  (isAdvancedMode ||
280764
280888
  isEmbeddedMode ||
280765
280889
  (messages.length > 0 &&
280766
- (messages[0].role === 'assistant' ? messages.slice(1) : messages).length > 0)) && (jsx("div", { className: "flex-shrink-0 overflow-y-auto pb-3.5 [scrollbar-gutter:stable]", children: jsx(ChatInputForm, { mentorId: mentorId, userIsStudent: userIsStudent, isPublicRoute: isPublicRoute, slashSkills: slashSkills, slashSkillsLoading: slashSkillsLoading, sessionId: (_u = cachedSessionId === null || cachedSessionId === void 0 ? void 0 : cachedSessionId[mentorId]) !== null && _u !== void 0 ? _u : sessionId, onSubmit: handleSubmit, stopGenerating: stopGenerating, onScreenSharingClick: () => {
280890
+ (messages[0].role === 'assistant' ? messages.slice(1) : messages).length > 0)) && (jsx("div", { className: "flex-shrink-0 overflow-y-auto pb-3.5 [scrollbar-gutter:stable]", children: jsx(ChatInputForm, { mentorId: mentorId, userIsStudent: userIsStudent, isPublicRoute: isPublicRoute, slashSkillsEnabled: slashSkillsEnabled, slashSkills: slashSkills, slashSkillsLoading: slashSkillsLoading, sessionId: (_u = cachedSessionId === null || cachedSessionId === void 0 ? void 0 : cachedSessionId[mentorId]) !== null && _u !== void 0 ? _u : sessionId, onSubmit: handleSubmit, stopGenerating: stopGenerating, onScreenSharingClick: () => {
280767
280891
  var _a;
280768
280892
  if (enableChatPopupActions && isInIframe()) {
280769
280893
  sendMessageToParentWebsite({