@iblai/iblai-js 2.2.9 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -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, useDeleteGlobalMemoryMutation, useInviteUserMutation, usePlatformInvitationsQuery, useCreateCatalogInvitationCourseBulkMutation, useGetCatalogInvitationsCourseQuery, useLazyPlatformUsersQuery, useLazyPlatformUserGroupsQuery, useGetPersonnalizedSearchQuery, useCreateCatalogInvitationProgramBulkMutation, useGetCatalogInvitationsProgramQuery, useUpdateUserRoleMutation, useUpdateUserStatusMutation, useUpdatePlatformUserRoleWithPoliciesMutation, usePlatformUsersQuery, isPoliciesResponse, platformApiSlice, featureTags, useLazyGetRbacTeamsAccessListQuery, useCreateRbacTeamsAccessMutation, useGetRbacGroupsQuery, usePlatformUserGroupsQuery, useCreateRbacGroupMutation, useUpdateRbacGroupMutation, useDeleteRbacGroupMutation, useCreatePlatformUserGroupMutation, useUpdatePlatformUserGroupMutation, useDeletePlatformUserGroupMutation, useGetRbacGroupDetailsQuery, useGetPlatformUserGroupDetailsQuery, useGetRbacPermissionsMutation, useGetRbacRolesQuery, useCreateRbacRoleMutation, useUpdateRbacRoleMutation, useDeleteRbacRoleMutation, useGetRbacRoleDetailsQuery, useGetRbacActionsDefinitionQuery, 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, useGetApiKeysQuery, useCreateApiKeyMutation, useCreateLLMCredentialMutation, useGetCredentialsSchemaQuery, useGetMaskedLLMCredentialsQuery, useGetLlmsQuery, useDeleteIntegrationCredentialMutation, useDeleteCredentialMutation, useCreateIntegrationCredentialMutation, useGetIntegrationCredentialsSchemaQuery, useGetMaskedIntegrationCredentialsQuery, useGetAccountBillingInfoQuery, useUpdateAutoRechargeInfoMutation, useTriggerAutoRechargeMutation, useCreateStripeCustomerPortalMutation, useSetPlatformConfigurationsMutation, useGetPlatformConfigurationsQuery, useUpdatePlatformMembershipMutation, useGetPlatformMembershipQuery, useGetCustomDomainsQuery, useCreateCustomDomainMutation, useDeleteCustomDomainMutation, useGetStudentMentorCreationStatusQuery, useSetStudentMentorCreationStatusMutation, coreApiSlice, recommendationPromptTypeEnum, useGetRecommendedPromptsListQuery, useCreateRecommendedPromptMutation, useUpdateRecommendedPromptMutation, useDeleteRecommendedPromptMutation, useLazyGetPublicPlatformImageAssetFileUrlQuery, useUpdateTenantMetadataMutation, useCreatePlatformImageAssetMutation, useGetProviderConfigQuery, useCreateProviderConfigMutation, useDeleteProviderConfigMutation, useGetExternalMappingQuery, useGetCredentialsListQuery, useCreateExternalMappingMutation, useDeleteExternalMappingMutation, useGetMemsearchConfigQuery, useUpdateMemsearchConfigMutation, useGetStripeConnectStatusQuery, useStartStripeConnectOnboardingMutation, useLazyGetStripeConnectDashboardQuery, useGetAiSearchMentorsQuery, useListPaywallsQuery, useListPricesQuery, useCreatePriceMutation, useUpdatePriceMutation, useDeletePriceMutation, useGetPaywallConfigQuery, useEnablePaywallMutation, useUpdatePaywallMutation, useLazyGetCourseMetaDataQuery, useLazyGetCourseCompletionOutlinesQuery, useLazyGetCourseEligibilityQuery, useLazyGetEdxSSOTokenQuery, useCreateCourseEnrollmentMutation, useCreateStripeCheckoutSessionMutation, useLazyGetCourseProgressQuery, useLazyGetCourseCompletionQuery, useUpdateExamAttemptMutation, useStartExamMutation, useLazyGetExamInfoQuery, useUpdateUserProjectMutation, useGetTrainingDocumentsQuery, useGetVectorDocumentsQuery, useGetMentorMemoriesListQuery, useGetMemoryCategoriesAdminQuery, useDeleteMentorMemoryMutation, useUpdateMentorMemoryMutation, useCreateMentorMemoryMutation, useLazyGetConnectedServiceAuthUrlQuery, useStarMentorMutation, useUnstarMentorMutation, 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, useGetMentorGraderConfigurationQuery, useListGraderCriteriaQuery, useCreateMentorGraderConfigurationMutation, useUpdateMentorGraderConfigurationMutation, useCreateGraderCriterionMutation, useUpdateGraderCriterionMutation, useDeleteGraderCriterionMutation, useGetMentorPublicSettingsQuery, useGetChatHistoryFilterQuery, 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, useDeleteGlobalMemoryMutation, useInviteUserMutation, usePlatformInvitationsQuery, useCreateCatalogInvitationCourseBulkMutation, useGetCatalogInvitationsCourseQuery, useLazyPlatformUsersQuery, useLazyPlatformUserGroupsQuery, useGetPersonnalizedSearchQuery, useCreateCatalogInvitationProgramBulkMutation, useGetCatalogInvitationsProgramQuery, useUpdateUserRoleMutation, useUpdateUserStatusMutation, useUpdatePlatformUserRoleWithPoliciesMutation, usePlatformUsersQuery, isPoliciesResponse, platformApiSlice, featureTags, useLazyGetRbacTeamsAccessListQuery, useCreateRbacTeamsAccessMutation, useGetRbacGroupsQuery, usePlatformUserGroupsQuery, useCreateRbacGroupMutation, useUpdateRbacGroupMutation, useDeleteRbacGroupMutation, useCreatePlatformUserGroupMutation, useUpdatePlatformUserGroupMutation, useDeletePlatformUserGroupMutation, useGetRbacGroupDetailsQuery, useGetPlatformUserGroupDetailsQuery, useGetRbacPermissionsMutation, useGetRbacRolesQuery, useCreateRbacRoleMutation, useUpdateRbacRoleMutation, useDeleteRbacRoleMutation, useGetRbacRoleDetailsQuery, useGetRbacActionsDefinitionQuery, 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, useGetApiKeysQuery, useCreateApiKeyMutation, useCreateLLMCredentialMutation, useGetCredentialsSchemaQuery, useGetMaskedLLMCredentialsQuery, useGetLlmsQuery, useDeleteIntegrationCredentialMutation, useDeleteCredentialMutation, useCreateIntegrationCredentialMutation, useGetIntegrationCredentialsSchemaQuery, useGetMaskedIntegrationCredentialsQuery, useGetAccountBillingInfoQuery, useUpdateAutoRechargeInfoMutation, useTriggerAutoRechargeMutation, useCreateStripeCustomerPortalMutation, useSetPlatformConfigurationsMutation, useGetPlatformConfigurationsQuery, useUpdatePlatformMembershipMutation, useGetPlatformMembershipQuery, useGetCustomDomainsQuery, useCreateCustomDomainMutation, useDeleteCustomDomainMutation, useGetStudentMentorCreationStatusQuery, useSetStudentMentorCreationStatusMutation, coreApiSlice, recommendationPromptTypeEnum, useGetRecommendedPromptsListQuery, useCreateRecommendedPromptMutation, useUpdateRecommendedPromptMutation, useDeleteRecommendedPromptMutation, useLazyGetPublicPlatformImageAssetFileUrlQuery, useUpdateTenantMetadataMutation, useCreatePlatformImageAssetMutation, useGetProviderConfigQuery, useCreateProviderConfigMutation, useDeleteProviderConfigMutation, useGetExternalMappingQuery, useGetCredentialsListQuery, useCreateExternalMappingMutation, useDeleteExternalMappingMutation, useGetMemsearchConfigQuery, useUpdateMemsearchConfigMutation, useGetStripeConnectStatusQuery, useStartStripeConnectOnboardingMutation, useLazyGetStripeConnectDashboardQuery, useGetAiSearchMentorsQuery, useListPaywallsQuery, useListPricesQuery, useCreatePriceMutation, useUpdatePriceMutation, useDeletePriceMutation, useGetPaywallConfigQuery, useEnablePaywallMutation, useUpdatePaywallMutation, 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, useStarMentorMutation, useUnstarMentorMutation, 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, useGetMentorGraderConfigurationQuery, useListGraderCriteriaQuery, useCreateMentorGraderConfigurationMutation, useUpdateMentorGraderConfigurationMutation, useCreateGraderCriterionMutation, useUpdateGraderCriterionMutation, useDeleteGraderCriterionMutation, useGetMentorPublicSettingsQuery, useGetChatHistoryFilterQuery, 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, WithPermissions, useStripeUpgrade, openExternalUrl, CHAT_AREA_SIZE, isAlphaNumeric32, checkRbacPermission, selectNumberOfActiveChatMessages, useUsername, selectStreaming, isLoggedIn, TOOLS, hasRemoteAiConfig, isSafariBrowser, useShowAttachment, useShowVoiceCall, useShowVoiceRecorder, useMentorSettings, selectShowingSharedChat, selectRbacPermissions, useShowFreeTrialDialog, useEmbedMode, chatInputSliceSelectors, useResponsive, useAccessingPublicRoute, useVisitingTenant, useModelFileUploadCapabilities, useChatFileUpload, useVoiceChat, selectAttachedFiles, MENTOR_CHAT_DOCUMENTS_EXTENSIONS, removeFile, chatInputSliceActions, chatActions, WithFormPermissions, useTenantContext, TimeTracker, advancedTabsProperties, defaultSessionIds, 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';
|
|
@@ -98069,118 +98069,6 @@ var gradebookGradebookTab$3 = {
|
|
|
98069
98069
|
previousPage: "Previous",
|
|
98070
98070
|
nextPage: "Next"
|
|
98071
98071
|
};
|
|
98072
|
-
var graderTabLabels$3 = {
|
|
98073
|
-
header: {
|
|
98074
|
-
title: "Grader",
|
|
98075
|
-
description: "Set up how your agent grades work against a rubric you define."
|
|
98076
|
-
},
|
|
98077
|
-
capability: {
|
|
98078
|
-
title: "Grading",
|
|
98079
|
-
description: "Let your agent grade work. When this is on, the agent scores what people submit against the rubric you set up below and shares the result as feedback — great for essays, projects, and practice exercises.",
|
|
98080
|
-
offHint: "Turn it on to write grading instructions and build your rubric. Anything you set up here is kept safe if you later turn it off."
|
|
98081
|
-
},
|
|
98082
|
-
subTabs: {
|
|
98083
|
-
setup: "Grading setup",
|
|
98084
|
-
rubric: "Rubric"
|
|
98085
|
-
},
|
|
98086
|
-
denied: {
|
|
98087
|
-
title: "No access to grading settings",
|
|
98088
|
-
description: "You don't have permission to view this agent's grading setup. Ask an administrator for access."
|
|
98089
|
-
},
|
|
98090
|
-
warnings: {
|
|
98091
|
-
noConfig: "Grading is on but not set up yet — the agent will fail when asked to grade. Save your grading instructions in Grading setup to finish.",
|
|
98092
|
-
noCriteria: "Grading is on but the rubric is empty — the agent will fail when asked to grade. Add at least one criterion in the Rubric tab."
|
|
98093
|
-
},
|
|
98094
|
-
config: {
|
|
98095
|
-
sectionTitle: "Grading setup",
|
|
98096
|
-
gradingMode: {
|
|
98097
|
-
label: "What gets graded",
|
|
98098
|
-
options: {
|
|
98099
|
-
submission: "A submission",
|
|
98100
|
-
conversation: "The conversation"
|
|
98101
|
-
},
|
|
98102
|
-
help: {
|
|
98103
|
-
submission: "The agent grades a piece of work the person hands in, like an essay or answer.",
|
|
98104
|
-
conversation: "The agent grades how the whole conversation went."
|
|
98105
|
-
}
|
|
98106
|
-
},
|
|
98107
|
-
feedbackMode: {
|
|
98108
|
-
label: "Feedback shared with the person",
|
|
98109
|
-
options: {
|
|
98110
|
-
overall: "Overall feedback only",
|
|
98111
|
-
perCriteria: "Feedback per criterion",
|
|
98112
|
-
both: "Overall + per criterion"
|
|
98113
|
-
},
|
|
98114
|
-
help: "The overall score is always calculated — this only controls how much detail is shared back."
|
|
98115
|
-
},
|
|
98116
|
-
instructions: {
|
|
98117
|
-
label: "Grading instructions",
|
|
98118
|
-
placeholder: "Describe what's being graded and anything the grader should know beyond the rubric. E.g. 'You are grading a 500-word persuasive essay on climate policy written by a high-school student. Be encouraging but honest.'",
|
|
98119
|
-
help: "Required. This is the context the agent uses every time it grades."
|
|
98120
|
-
},
|
|
98121
|
-
saveButton: "Save",
|
|
98122
|
-
savingButton: "Saving…"
|
|
98123
|
-
},
|
|
98124
|
-
criteria: {
|
|
98125
|
-
sectionTitle: "Rubric",
|
|
98126
|
-
description: "Each row is one thing the agent looks for and how many points it is worth. The overall score is points earned out of the total.",
|
|
98127
|
-
needsConfigHint: "Save your grading setup first, then add rubric criteria here.",
|
|
98128
|
-
emptyState: "No criteria yet. Add your first one — for example \"Clarity\", 10 points.",
|
|
98129
|
-
addButton: "Add criterion",
|
|
98130
|
-
columns: {
|
|
98131
|
-
name: "Name",
|
|
98132
|
-
criteria: "Criteria",
|
|
98133
|
-
points: "Points"
|
|
98134
|
-
},
|
|
98135
|
-
actionsAria: "Actions for {name}",
|
|
98136
|
-
edit: "Edit",
|
|
98137
|
-
"delete": "Delete",
|
|
98138
|
-
totalPoints: "Total possible points: {total}",
|
|
98139
|
-
scoreHint: "Overall score = points earned ÷ {total}.",
|
|
98140
|
-
lastCriterionHint: "A rubric needs at least one criterion — add another before removing this one.",
|
|
98141
|
-
modal: {
|
|
98142
|
-
addTitle: "Add criterion",
|
|
98143
|
-
editTitle: "Edit criterion",
|
|
98144
|
-
name: {
|
|
98145
|
-
label: "Name",
|
|
98146
|
-
placeholder: "e.g. Clarity",
|
|
98147
|
-
required: "Name is required"
|
|
98148
|
-
},
|
|
98149
|
-
criteria: {
|
|
98150
|
-
label: "Criteria",
|
|
98151
|
-
placeholder: "e.g. The argument is easy to follow and each paragraph makes one clear point.",
|
|
98152
|
-
required: "Criteria is required"
|
|
98153
|
-
},
|
|
98154
|
-
points: {
|
|
98155
|
-
label: "Points",
|
|
98156
|
-
placeholder: "10",
|
|
98157
|
-
positive: "Points must be a positive number"
|
|
98158
|
-
},
|
|
98159
|
-
save: "Save",
|
|
98160
|
-
saving: "Saving…",
|
|
98161
|
-
cancel: "Cancel"
|
|
98162
|
-
},
|
|
98163
|
-
deleteModal: {
|
|
98164
|
-
title: "Delete criterion",
|
|
98165
|
-
confirmationPrefix: "Are you sure you want to remove",
|
|
98166
|
-
confirmationSuffix: " from the rubric?",
|
|
98167
|
-
cancel: "Cancel",
|
|
98168
|
-
"delete": "Delete",
|
|
98169
|
-
deleting: "Deleting…"
|
|
98170
|
-
}
|
|
98171
|
-
},
|
|
98172
|
-
toasts: {
|
|
98173
|
-
toggleOn: "Grading turned on",
|
|
98174
|
-
toggleOff: "Grading turned off — your rubric is kept for next time",
|
|
98175
|
-
toggleError: "Couldn't update grading",
|
|
98176
|
-
configSaved: "Grading setup saved",
|
|
98177
|
-
configError: "Couldn't save grading setup",
|
|
98178
|
-
criterionAdded: "Criterion added",
|
|
98179
|
-
criterionUpdated: "Criterion updated",
|
|
98180
|
-
criterionDeleted: "Criterion deleted",
|
|
98181
|
-
criterionError: "Couldn't update the rubric"
|
|
98182
|
-
}
|
|
98183
|
-
};
|
|
98184
98072
|
var careerExperienceDialog$3 = {
|
|
98185
98073
|
pleaseSelectACompany: "Please select a company",
|
|
98186
98074
|
endDateCannotBeBeforeStartDate: "End date cannot be before start date",
|
|
@@ -98494,7 +98382,57 @@ var clawSandboxAgentSkills$3 = {
|
|
|
98494
98382
|
fieldVersionPlaceholder: "e.g. 1.0.0",
|
|
98495
98383
|
fieldDescription: "Description",
|
|
98496
98384
|
fieldDescriptionPlaceholder: "e.g. Search the web for information",
|
|
98497
|
-
fieldInstruction: "Instruction"
|
|
98385
|
+
fieldInstruction: "Instruction",
|
|
98386
|
+
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.",
|
|
98387
|
+
effectiveHeading: "This agent's skills",
|
|
98388
|
+
catalogHeading: "Available skills",
|
|
98389
|
+
noEffectiveSkills: "No skills enabled for this agent yet. Add one from the available skills below.",
|
|
98390
|
+
addToAgent: "Add",
|
|
98391
|
+
addToAgentLabel: "Add {name} to this agent",
|
|
98392
|
+
removeFromAgent: "Remove from agent",
|
|
98393
|
+
skillAdded: "{name} added",
|
|
98394
|
+
skillRemoved: "{name} removed",
|
|
98395
|
+
featuredBadge: "Featured",
|
|
98396
|
+
nativeBadge: "Native",
|
|
98397
|
+
privateBadge: "Only this agent",
|
|
98398
|
+
fieldCategory: "Category",
|
|
98399
|
+
fieldCategoryPlaceholder: "e.g. web, code, data",
|
|
98400
|
+
privateToAgent: "Only this agent",
|
|
98401
|
+
privateToAgentHint: "Private skills are available to this agent only and take precedence over platform skills with the same slug.",
|
|
98402
|
+
instructionHint: "The playbook the agent follows when the skill is used. Edits apply immediately, including in conversations already in progress.",
|
|
98403
|
+
filesHint: "Optional resources the agent can use with this skill. References and scripts are text files; assets are uploaded files.",
|
|
98404
|
+
filesAfterCreateHint: "You can attach resources to this skill after creating it (reopen it with Edit).",
|
|
98405
|
+
noFiles: "No resources attached yet.",
|
|
98406
|
+
loadingFiles: "Loading resources...",
|
|
98407
|
+
fileTypeLabel: "Type",
|
|
98408
|
+
fileTypeReference: "Reference",
|
|
98409
|
+
fileTypeScript: "Script",
|
|
98410
|
+
fileTypeAsset: "Asset",
|
|
98411
|
+
fileNameLabel: "File name",
|
|
98412
|
+
fileNamePlaceholder: "e.g. rubric.md",
|
|
98413
|
+
fileContentLabel: "Content",
|
|
98414
|
+
fileContentPlaceholder: "The file's text content",
|
|
98415
|
+
addFileButton: "Add resource",
|
|
98416
|
+
adding: "Adding...",
|
|
98417
|
+
uploading: "Uploading...",
|
|
98418
|
+
fileAdded: "Resource added",
|
|
98419
|
+
fileUploaded: "Resource uploaded",
|
|
98420
|
+
fileSaved: "Resource saved",
|
|
98421
|
+
fileDeleted: "Resource deleted",
|
|
98422
|
+
failedToSaveFile: "Failed to save resource",
|
|
98423
|
+
failedToUploadFile: "Failed to upload resource",
|
|
98424
|
+
failedToDeleteFile: "Failed to delete resource",
|
|
98425
|
+
detailsTab: "General",
|
|
98426
|
+
filesTab: "Resources",
|
|
98427
|
+
newFile: "New Resource",
|
|
98428
|
+
newFileDialogTitle: "New Resource",
|
|
98429
|
+
editFileDialogTitle: "Edit Resource",
|
|
98430
|
+
deleteFileDialogTitle: "Delete Resource",
|
|
98431
|
+
deleteFileConfirmation: "Are you sure you want to delete {name}? This action cannot be undone.",
|
|
98432
|
+
chooseFile: "Choose file",
|
|
98433
|
+
upload: "Upload",
|
|
98434
|
+
download: "Download",
|
|
98435
|
+
resourcesItemLabel: "resources"
|
|
98498
98436
|
};
|
|
98499
98437
|
var clawSandboxHelpers$3 = {
|
|
98500
98438
|
unknown: "Unknown",
|
|
@@ -100759,7 +100697,7 @@ var safetyTabLabels$3 = {
|
|
|
100759
100697
|
};
|
|
100760
100698
|
var screenshareTabLabels$3 = {
|
|
100761
100699
|
header: {
|
|
100762
|
-
title: "Screen
|
|
100700
|
+
title: "Screen",
|
|
100763
100701
|
description: "How your agent behaves when a user shares their screen during a voice call."
|
|
100764
100702
|
},
|
|
100765
100703
|
capability: {
|
|
@@ -102398,6 +102336,19 @@ var platformNavbar$3 = {
|
|
|
102398
102336
|
placementExamsHeader: "Placement exams",
|
|
102399
102337
|
placementExamFallback: "Placement exam"
|
|
102400
102338
|
};
|
|
102339
|
+
var slashSkillPicker$3 = {
|
|
102340
|
+
listLabel: "Agent skills",
|
|
102341
|
+
resultsAnnouncement: "{count} skills available. Use arrow keys to browse and Enter to select.",
|
|
102342
|
+
loading: "Loading..."
|
|
102343
|
+
};
|
|
102344
|
+
var skillsTabLabels$3 = {
|
|
102345
|
+
header: {
|
|
102346
|
+
title: "Skills",
|
|
102347
|
+
description: "Reusable playbooks you can attach to this agent — each one is a set of instructions for a job. In chat, type / to use one."
|
|
102348
|
+
},
|
|
102349
|
+
notBaseAgent: "Skills are only available to Base Agents.",
|
|
102350
|
+
loading: "Loading..."
|
|
102351
|
+
};
|
|
102401
102352
|
var placementExam$3 = {
|
|
102402
102353
|
title: "Placement exam",
|
|
102403
102354
|
back: "Back"
|
|
@@ -102694,6 +102645,118 @@ var profileApplicationsQuestionsEditor$3 = {
|
|
|
102694
102645
|
collapseSection: "Collapse section",
|
|
102695
102646
|
expandSection: "Expand section"
|
|
102696
102647
|
};
|
|
102648
|
+
var graderTabLabels$3 = {
|
|
102649
|
+
header: {
|
|
102650
|
+
title: "Grader",
|
|
102651
|
+
description: "Set up how your agent grades work against a rubric you define."
|
|
102652
|
+
},
|
|
102653
|
+
capability: {
|
|
102654
|
+
title: "Grading",
|
|
102655
|
+
description: "Let your agent grade work. When this is on, the agent scores what people submit against the rubric you set up below and shares the result as feedback — great for essays, projects, and practice exercises.",
|
|
102656
|
+
offHint: "Turn it on to write grading instructions and build your rubric. Anything you set up here is kept safe if you later turn it off."
|
|
102657
|
+
},
|
|
102658
|
+
subTabs: {
|
|
102659
|
+
setup: "Grading setup",
|
|
102660
|
+
rubric: "Rubric"
|
|
102661
|
+
},
|
|
102662
|
+
denied: {
|
|
102663
|
+
title: "No access to grading settings",
|
|
102664
|
+
description: "You don't have permission to view this agent's grading setup. Ask an administrator for access."
|
|
102665
|
+
},
|
|
102666
|
+
warnings: {
|
|
102667
|
+
noConfig: "Grading is on but not set up yet — the agent will fail when asked to grade. Save your grading instructions in Grading setup to finish.",
|
|
102668
|
+
noCriteria: "Grading is on but the rubric is empty — the agent will fail when asked to grade. Add at least one criterion in the Rubric tab."
|
|
102669
|
+
},
|
|
102670
|
+
config: {
|
|
102671
|
+
sectionTitle: "Grading setup",
|
|
102672
|
+
gradingMode: {
|
|
102673
|
+
label: "What gets graded",
|
|
102674
|
+
options: {
|
|
102675
|
+
submission: "A submission",
|
|
102676
|
+
conversation: "The conversation"
|
|
102677
|
+
},
|
|
102678
|
+
help: {
|
|
102679
|
+
submission: "The agent grades a piece of work the person hands in, like an essay or answer.",
|
|
102680
|
+
conversation: "The agent grades how the whole conversation went."
|
|
102681
|
+
}
|
|
102682
|
+
},
|
|
102683
|
+
feedbackMode: {
|
|
102684
|
+
label: "Feedback shared with the person",
|
|
102685
|
+
options: {
|
|
102686
|
+
overall: "Overall feedback only",
|
|
102687
|
+
perCriteria: "Feedback per criterion",
|
|
102688
|
+
both: "Overall + per criterion"
|
|
102689
|
+
},
|
|
102690
|
+
help: "The overall score is always calculated — this only controls how much detail is shared back."
|
|
102691
|
+
},
|
|
102692
|
+
instructions: {
|
|
102693
|
+
label: "Grading instructions",
|
|
102694
|
+
placeholder: "Describe what's being graded and anything the grader should know beyond the rubric. E.g. 'You are grading a 500-word persuasive essay on climate policy written by a high-school student. Be encouraging but honest.'",
|
|
102695
|
+
help: "Required. This is the context the agent uses every time it grades."
|
|
102696
|
+
},
|
|
102697
|
+
saveButton: "Save",
|
|
102698
|
+
savingButton: "Saving…"
|
|
102699
|
+
},
|
|
102700
|
+
criteria: {
|
|
102701
|
+
sectionTitle: "Rubric",
|
|
102702
|
+
description: "Each row is one thing the agent looks for and how many points it is worth. The overall score is points earned out of the total.",
|
|
102703
|
+
needsConfigHint: "Save your grading setup first, then add rubric criteria here.",
|
|
102704
|
+
emptyState: "No criteria yet. Add your first one — for example \"Clarity\", 10 points.",
|
|
102705
|
+
addButton: "Add criterion",
|
|
102706
|
+
columns: {
|
|
102707
|
+
name: "Name",
|
|
102708
|
+
criteria: "Criteria",
|
|
102709
|
+
points: "Points"
|
|
102710
|
+
},
|
|
102711
|
+
actionsAria: "Actions for {name}",
|
|
102712
|
+
edit: "Edit",
|
|
102713
|
+
"delete": "Delete",
|
|
102714
|
+
totalPoints: "Total possible points: {total}",
|
|
102715
|
+
scoreHint: "Overall score = points earned ÷ {total}.",
|
|
102716
|
+
lastCriterionHint: "A rubric needs at least one criterion — add another before removing this one.",
|
|
102717
|
+
modal: {
|
|
102718
|
+
addTitle: "Add criterion",
|
|
102719
|
+
editTitle: "Edit criterion",
|
|
102720
|
+
name: {
|
|
102721
|
+
label: "Name",
|
|
102722
|
+
placeholder: "e.g. Clarity",
|
|
102723
|
+
required: "Name is required"
|
|
102724
|
+
},
|
|
102725
|
+
criteria: {
|
|
102726
|
+
label: "Criteria",
|
|
102727
|
+
placeholder: "e.g. The argument is easy to follow and each paragraph makes one clear point.",
|
|
102728
|
+
required: "Criteria is required"
|
|
102729
|
+
},
|
|
102730
|
+
points: {
|
|
102731
|
+
label: "Points",
|
|
102732
|
+
placeholder: "10",
|
|
102733
|
+
positive: "Points must be a positive number"
|
|
102734
|
+
},
|
|
102735
|
+
save: "Save",
|
|
102736
|
+
saving: "Saving…",
|
|
102737
|
+
cancel: "Cancel"
|
|
102738
|
+
},
|
|
102739
|
+
deleteModal: {
|
|
102740
|
+
title: "Delete criterion",
|
|
102741
|
+
confirmationPrefix: "Are you sure you want to remove",
|
|
102742
|
+
confirmationSuffix: " from the rubric?",
|
|
102743
|
+
cancel: "Cancel",
|
|
102744
|
+
"delete": "Delete",
|
|
102745
|
+
deleting: "Deleting…"
|
|
102746
|
+
}
|
|
102747
|
+
},
|
|
102748
|
+
toasts: {
|
|
102749
|
+
toggleOn: "Grading turned on",
|
|
102750
|
+
toggleOff: "Grading turned off — your rubric is kept for next time",
|
|
102751
|
+
toggleError: "Couldn't update grading",
|
|
102752
|
+
configSaved: "Grading setup saved",
|
|
102753
|
+
configError: "Couldn't save grading setup",
|
|
102754
|
+
criterionAdded: "Criterion added",
|
|
102755
|
+
criterionUpdated: "Criterion updated",
|
|
102756
|
+
criterionDeleted: "Criterion deleted",
|
|
102757
|
+
criterionError: "Couldn't update the rubric"
|
|
102758
|
+
}
|
|
102759
|
+
};
|
|
102697
102760
|
var en = {
|
|
102698
102761
|
accessTabAddAccess: accessTabAddAccess$3,
|
|
102699
102762
|
accessTabLabels: accessTabLabels$3,
|
|
@@ -102748,7 +102811,6 @@ var en = {
|
|
|
102748
102811
|
careerEducationDialog: careerEducationDialog$3,
|
|
102749
102812
|
careerEducationTab: careerEducationTab$3,
|
|
102750
102813
|
gradebookGradebookTab: gradebookGradebookTab$3,
|
|
102751
|
-
graderTabLabels: graderTabLabels$3,
|
|
102752
102814
|
careerExperienceDialog: careerExperienceDialog$3,
|
|
102753
102815
|
careerExperienceTab: careerExperienceTab$3,
|
|
102754
102816
|
careerInstitutionDialog: careerInstitutionDialog$3,
|
|
@@ -102942,10 +103004,13 @@ var en = {
|
|
|
102942
103004
|
benchmarksAddItemsModal: benchmarksAddItemsModal$3,
|
|
102943
103005
|
platformSidebar: platformSidebar$3,
|
|
102944
103006
|
platformNavbar: platformNavbar$3,
|
|
103007
|
+
slashSkillPicker: slashSkillPicker$3,
|
|
103008
|
+
skillsTabLabels: skillsTabLabels$3,
|
|
102945
103009
|
placementExam: placementExam$3,
|
|
102946
103010
|
applyApplyWizard: applyApplyWizard$3,
|
|
102947
103011
|
profileApplicationsTab: profileApplicationsTab$3,
|
|
102948
|
-
profileApplicationsQuestionsEditor: profileApplicationsQuestionsEditor$3
|
|
103012
|
+
profileApplicationsQuestionsEditor: profileApplicationsQuestionsEditor$3,
|
|
103013
|
+
graderTabLabels: graderTabLabels$3
|
|
102949
103014
|
};
|
|
102950
103015
|
|
|
102951
103016
|
var accessTabAddAccess$2 = {
|
|
@@ -104615,7 +104680,57 @@ var clawSandboxAgentSkills$2 = {
|
|
|
104615
104680
|
fieldVersionPlaceholder: "ex. 1.0.0",
|
|
104616
104681
|
fieldDescription: "Description",
|
|
104617
104682
|
fieldDescriptionPlaceholder: "ex. Rechercher des informations sur le web",
|
|
104618
|
-
fieldInstruction: "Instruction"
|
|
104683
|
+
fieldInstruction: "Instruction",
|
|
104684
|
+
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.",
|
|
104685
|
+
effectiveHeading: "Compétences de cet agent",
|
|
104686
|
+
catalogHeading: "Compétences disponibles",
|
|
104687
|
+
noEffectiveSkills: "Cet agent n'a pas encore de compétences activées. Ajoutez-en une depuis les compétences disponibles.",
|
|
104688
|
+
addToAgent: "Ajouter",
|
|
104689
|
+
addToAgentLabel: "Ajouter {name} à cet agent",
|
|
104690
|
+
removeFromAgent: "Retirer de l'agent",
|
|
104691
|
+
skillAdded: "{name} ajoutée",
|
|
104692
|
+
skillRemoved: "{name} retirée",
|
|
104693
|
+
featuredBadge: "En vedette",
|
|
104694
|
+
nativeBadge: "Native",
|
|
104695
|
+
privateBadge: "Cet agent uniquement",
|
|
104696
|
+
fieldCategory: "Catégorie",
|
|
104697
|
+
fieldCategoryPlaceholder: "p. ex. web, code, données",
|
|
104698
|
+
privateToAgent: "Cet agent uniquement",
|
|
104699
|
+
privateToAgentHint: "Les compétences privées ne sont disponibles que pour cet agent et priment sur les compétences de la plateforme portant le même slug.",
|
|
104700
|
+
instructionHint: "Le guide que l'agent suit lorsque la compétence est utilisée. Les modifications s'appliquent immédiatement, y compris dans les conversations en cours.",
|
|
104701
|
+
filesHint: "Ressources facultatives que l'agent peut utiliser avec cette compétence. Les références et les scripts sont des fichiers texte ; les assets sont des fichiers téléversés.",
|
|
104702
|
+
filesAfterCreateHint: "Vous pouvez joindre des ressources à cette compétence après sa création (rouvrez-la avec Modifier).",
|
|
104703
|
+
noFiles: "Aucune ressource jointe pour le moment.",
|
|
104704
|
+
loadingFiles: "Chargement des ressources...",
|
|
104705
|
+
fileTypeLabel: "Type",
|
|
104706
|
+
fileTypeReference: "Référence",
|
|
104707
|
+
fileTypeScript: "Script",
|
|
104708
|
+
fileTypeAsset: "Ressource",
|
|
104709
|
+
fileNameLabel: "Nom du fichier",
|
|
104710
|
+
fileNamePlaceholder: "p. ex. grille.md",
|
|
104711
|
+
fileContentLabel: "Contenu",
|
|
104712
|
+
fileContentPlaceholder: "Le contenu texte du fichier",
|
|
104713
|
+
addFileButton: "Ajouter la ressource",
|
|
104714
|
+
adding: "Ajout...",
|
|
104715
|
+
uploading: "Téléversement...",
|
|
104716
|
+
fileAdded: "Ressource ajoutée",
|
|
104717
|
+
fileUploaded: "Ressource téléversée",
|
|
104718
|
+
fileSaved: "Ressource enregistrée",
|
|
104719
|
+
fileDeleted: "Ressource supprimée",
|
|
104720
|
+
failedToSaveFile: "Impossible d'enregistrer la ressource",
|
|
104721
|
+
failedToUploadFile: "Impossible de téléverser la ressource",
|
|
104722
|
+
failedToDeleteFile: "Impossible de supprimer la ressource",
|
|
104723
|
+
detailsTab: "Général",
|
|
104724
|
+
filesTab: "Ressources",
|
|
104725
|
+
newFile: "Nouvelle ressource",
|
|
104726
|
+
newFileDialogTitle: "Nouvelle ressource",
|
|
104727
|
+
editFileDialogTitle: "Modifier la ressource",
|
|
104728
|
+
deleteFileDialogTitle: "Supprimer la ressource",
|
|
104729
|
+
deleteFileConfirmation: "Voulez-vous vraiment supprimer {name} ? Cette action est irréversible.",
|
|
104730
|
+
chooseFile: "Choisir un fichier",
|
|
104731
|
+
upload: "Téléverser",
|
|
104732
|
+
download: "Télécharger",
|
|
104733
|
+
resourcesItemLabel: "ressources"
|
|
104619
104734
|
};
|
|
104620
104735
|
var clawSandboxHelpers$2 = {
|
|
104621
104736
|
unknown: "Inconnu",
|
|
@@ -106880,7 +106995,7 @@ var safetyTabLabels$2 = {
|
|
|
106880
106995
|
};
|
|
106881
106996
|
var screenshareTabLabels$2 = {
|
|
106882
106997
|
header: {
|
|
106883
|
-
title: "
|
|
106998
|
+
title: "Écran",
|
|
106884
106999
|
description: "Comment votre agent se comporte lorsqu’un utilisateur partage son écran pendant un appel vocal."
|
|
106885
107000
|
},
|
|
106886
107001
|
capability: {
|
|
@@ -108815,6 +108930,19 @@ var profileApplicationsQuestionsEditor$2 = {
|
|
|
108815
108930
|
collapseSection: "Réduire la section",
|
|
108816
108931
|
expandSection: "Développer la section"
|
|
108817
108932
|
};
|
|
108933
|
+
var slashSkillPicker$2 = {
|
|
108934
|
+
listLabel: "Compétences de l'agent",
|
|
108935
|
+
resultsAnnouncement: "{count} compétences disponibles. Utilisez les flèches pour parcourir et Entrée pour sélectionner.",
|
|
108936
|
+
loading: "Chargement..."
|
|
108937
|
+
};
|
|
108938
|
+
var skillsTabLabels$2 = {
|
|
108939
|
+
header: {
|
|
108940
|
+
title: "Compétences",
|
|
108941
|
+
description: "Des guides réutilisables à attacher à cet agent — chacun est un ensemble d'instructions pour une tâche. Dans le chat, tapez / pour en utiliser un."
|
|
108942
|
+
},
|
|
108943
|
+
notBaseAgent: "Les compétences ne sont disponibles que pour les agents de base.",
|
|
108944
|
+
loading: "Chargement..."
|
|
108945
|
+
};
|
|
108818
108946
|
var fr = {
|
|
108819
108947
|
accessTabAddAccess: accessTabAddAccess$2,
|
|
108820
108948
|
accessTabLabels: accessTabLabels$2,
|
|
@@ -109066,7 +109194,9 @@ var fr = {
|
|
|
109066
109194
|
placementExam: placementExam$2,
|
|
109067
109195
|
applyApplyWizard: applyApplyWizard$2,
|
|
109068
109196
|
profileApplicationsTab: profileApplicationsTab$2,
|
|
109069
|
-
profileApplicationsQuestionsEditor: profileApplicationsQuestionsEditor$2
|
|
109197
|
+
profileApplicationsQuestionsEditor: profileApplicationsQuestionsEditor$2,
|
|
109198
|
+
slashSkillPicker: slashSkillPicker$2,
|
|
109199
|
+
skillsTabLabels: skillsTabLabels$2
|
|
109070
109200
|
};
|
|
109071
109201
|
|
|
109072
109202
|
var accessTabAddAccess$1 = {
|
|
@@ -110736,7 +110866,57 @@ var clawSandboxAgentSkills$1 = {
|
|
|
110736
110866
|
fieldVersionPlaceholder: "ej. 1.0.0",
|
|
110737
110867
|
fieldDescription: "Descripción",
|
|
110738
110868
|
fieldDescriptionPlaceholder: "ej. Buscar información en la web",
|
|
110739
|
-
fieldInstruction: "Instrucción"
|
|
110869
|
+
fieldInstruction: "Instrucción",
|
|
110870
|
+
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.",
|
|
110871
|
+
effectiveHeading: "Habilidades de este agente",
|
|
110872
|
+
catalogHeading: "Habilidades disponibles",
|
|
110873
|
+
noEffectiveSkills: "Este agente aún no tiene habilidades habilitadas. Añade una desde las habilidades disponibles.",
|
|
110874
|
+
addToAgent: "Añadir",
|
|
110875
|
+
addToAgentLabel: "Añadir {name} a este agente",
|
|
110876
|
+
removeFromAgent: "Quitar del agente",
|
|
110877
|
+
skillAdded: "{name} añadida",
|
|
110878
|
+
skillRemoved: "{name} eliminada",
|
|
110879
|
+
featuredBadge: "Destacada",
|
|
110880
|
+
nativeBadge: "Nativa",
|
|
110881
|
+
privateBadge: "Solo este agente",
|
|
110882
|
+
fieldCategory: "Categoría",
|
|
110883
|
+
fieldCategoryPlaceholder: "p. ej. web, código, datos",
|
|
110884
|
+
privateToAgent: "Solo este agente",
|
|
110885
|
+
privateToAgentHint: "Las habilidades privadas solo están disponibles para este agente y tienen prioridad sobre las habilidades de la plataforma con el mismo slug.",
|
|
110886
|
+
instructionHint: "La guía que sigue el agente cuando se usa la habilidad. Los cambios se aplican de inmediato, incluso en conversaciones en curso.",
|
|
110887
|
+
filesHint: "Recursos opcionales que el agente puede usar con esta habilidad. Las referencias y los scripts son archivos de texto; los assets son archivos subidos.",
|
|
110888
|
+
filesAfterCreateHint: "Puedes adjuntar recursos a esta habilidad después de crearla (vuelve a abrirla con Editar).",
|
|
110889
|
+
noFiles: "Aún no hay recursos adjuntos.",
|
|
110890
|
+
loadingFiles: "Cargando recursos...",
|
|
110891
|
+
fileTypeLabel: "Tipo",
|
|
110892
|
+
fileTypeReference: "Referencia",
|
|
110893
|
+
fileTypeScript: "Script",
|
|
110894
|
+
fileTypeAsset: "Recurso",
|
|
110895
|
+
fileNameLabel: "Nombre del archivo",
|
|
110896
|
+
fileNamePlaceholder: "p. ej. rubrica.md",
|
|
110897
|
+
fileContentLabel: "Contenido",
|
|
110898
|
+
fileContentPlaceholder: "El contenido de texto del archivo",
|
|
110899
|
+
addFileButton: "Añadir recurso",
|
|
110900
|
+
adding: "Añadiendo...",
|
|
110901
|
+
uploading: "Subiendo...",
|
|
110902
|
+
fileAdded: "Recurso añadido",
|
|
110903
|
+
fileUploaded: "Recurso subido",
|
|
110904
|
+
fileSaved: "Recurso guardado",
|
|
110905
|
+
fileDeleted: "Recurso eliminado",
|
|
110906
|
+
failedToSaveFile: "No se pudo guardar el recurso",
|
|
110907
|
+
failedToUploadFile: "No se pudo subir el recurso",
|
|
110908
|
+
failedToDeleteFile: "No se pudo eliminar el recurso",
|
|
110909
|
+
detailsTab: "General",
|
|
110910
|
+
filesTab: "Recursos",
|
|
110911
|
+
newFile: "Nuevo recurso",
|
|
110912
|
+
newFileDialogTitle: "Nuevo recurso",
|
|
110913
|
+
editFileDialogTitle: "Editar recurso",
|
|
110914
|
+
deleteFileDialogTitle: "Eliminar recurso",
|
|
110915
|
+
deleteFileConfirmation: "¿Seguro que quieres eliminar {name}? Esta acción no se puede deshacer.",
|
|
110916
|
+
chooseFile: "Elegir archivo",
|
|
110917
|
+
upload: "Subir",
|
|
110918
|
+
download: "Descargar",
|
|
110919
|
+
resourcesItemLabel: "recursos"
|
|
110740
110920
|
};
|
|
110741
110921
|
var clawSandboxHelpers$1 = {
|
|
110742
110922
|
unknown: "Desconocido",
|
|
@@ -113001,7 +113181,7 @@ var safetyTabLabels$1 = {
|
|
|
113001
113181
|
};
|
|
113002
113182
|
var screenshareTabLabels$1 = {
|
|
113003
113183
|
header: {
|
|
113004
|
-
title: "Pantalla
|
|
113184
|
+
title: "Pantalla",
|
|
113005
113185
|
description: "Cómo se comporta tu agente cuando un usuario comparte su pantalla durante una llamada de voz."
|
|
113006
113186
|
},
|
|
113007
113187
|
capability: {
|
|
@@ -114936,6 +115116,19 @@ var profileApplicationsQuestionsEditor$1 = {
|
|
|
114936
115116
|
collapseSection: "Contraer sección",
|
|
114937
115117
|
expandSection: "Expandir sección"
|
|
114938
115118
|
};
|
|
115119
|
+
var slashSkillPicker$1 = {
|
|
115120
|
+
listLabel: "Habilidades del agente",
|
|
115121
|
+
resultsAnnouncement: "{count} habilidades disponibles. Usa las flechas para navegar y Enter para seleccionar.",
|
|
115122
|
+
loading: "Cargando..."
|
|
115123
|
+
};
|
|
115124
|
+
var skillsTabLabels$1 = {
|
|
115125
|
+
header: {
|
|
115126
|
+
title: "Habilidades",
|
|
115127
|
+
description: "Guías reutilizables que puedes adjuntar a este agente: cada una es un conjunto de instrucciones para una tarea. En el chat, escribe / para usar una."
|
|
115128
|
+
},
|
|
115129
|
+
notBaseAgent: "Las habilidades solo están disponibles para los agentes base.",
|
|
115130
|
+
loading: "Cargando..."
|
|
115131
|
+
};
|
|
114939
115132
|
var es = {
|
|
114940
115133
|
accessTabAddAccess: accessTabAddAccess$1,
|
|
114941
115134
|
accessTabLabels: accessTabLabels$1,
|
|
@@ -115187,7 +115380,9 @@ var es = {
|
|
|
115187
115380
|
placementExam: placementExam$1,
|
|
115188
115381
|
applyApplyWizard: applyApplyWizard$1,
|
|
115189
115382
|
profileApplicationsTab: profileApplicationsTab$1,
|
|
115190
|
-
profileApplicationsQuestionsEditor: profileApplicationsQuestionsEditor$1
|
|
115383
|
+
profileApplicationsQuestionsEditor: profileApplicationsQuestionsEditor$1,
|
|
115384
|
+
slashSkillPicker: slashSkillPicker$1,
|
|
115385
|
+
skillsTabLabels: skillsTabLabels$1
|
|
115191
115386
|
};
|
|
115192
115387
|
|
|
115193
115388
|
var accessTabAddAccess = {
|
|
@@ -116857,7 +117052,57 @@ var clawSandboxAgentSkills = {
|
|
|
116857
117052
|
fieldVersionPlaceholder: "例如:1.0.0",
|
|
116858
117053
|
fieldDescription: "描述",
|
|
116859
117054
|
fieldDescriptionPlaceholder: "例如:在网络上搜索信息",
|
|
116860
|
-
fieldInstruction: "指令"
|
|
117055
|
+
fieldInstruction: "指令",
|
|
117056
|
+
sessionNote: "在此添加或移除的技能仅对新的聊天会话生效。技能指令的修改会立即生效,包括正在进行的对话。",
|
|
117057
|
+
effectiveHeading: "此智能体的技能",
|
|
117058
|
+
catalogHeading: "可用技能",
|
|
117059
|
+
noEffectiveSkills: "此智能体尚未启用任何技能。请从下方的可用技能中添加。",
|
|
117060
|
+
addToAgent: "添加",
|
|
117061
|
+
addToAgentLabel: "将 {name} 添加到此智能体",
|
|
117062
|
+
removeFromAgent: "从智能体中移除",
|
|
117063
|
+
skillAdded: "已添加 {name}",
|
|
117064
|
+
skillRemoved: "已移除 {name}",
|
|
117065
|
+
featuredBadge: "精选",
|
|
117066
|
+
nativeBadge: "原生",
|
|
117067
|
+
privateBadge: "仅此智能体",
|
|
117068
|
+
fieldCategory: "分类",
|
|
117069
|
+
fieldCategoryPlaceholder: "例如 web、代码、数据",
|
|
117070
|
+
privateToAgent: "仅此智能体",
|
|
117071
|
+
privateToAgentHint: "私有技能仅对此智能体可用,并优先于具有相同 slug 的平台技能。",
|
|
117072
|
+
instructionHint: "使用该技能时智能体遵循的操作指南。修改会立即生效,包括正在进行的对话。",
|
|
117073
|
+
filesHint: "智能体在使用此技能时可参考的可选资源。参考资料和脚本是文本文件;资产是上传的文件。",
|
|
117074
|
+
filesAfterCreateHint: "创建技能后即可附加资源(通过“编辑”重新打开)。",
|
|
117075
|
+
noFiles: "尚未附加任何资源。",
|
|
117076
|
+
loadingFiles: "正在加载资源...",
|
|
117077
|
+
fileTypeLabel: "类型",
|
|
117078
|
+
fileTypeReference: "参考资料",
|
|
117079
|
+
fileTypeScript: "脚本",
|
|
117080
|
+
fileTypeAsset: "资源",
|
|
117081
|
+
fileNameLabel: "文件名",
|
|
117082
|
+
fileNamePlaceholder: "例如 rubric.md",
|
|
117083
|
+
fileContentLabel: "内容",
|
|
117084
|
+
fileContentPlaceholder: "文件的文本内容",
|
|
117085
|
+
addFileButton: "添加资源",
|
|
117086
|
+
adding: "添加中...",
|
|
117087
|
+
uploading: "上传中...",
|
|
117088
|
+
fileAdded: "资源已添加",
|
|
117089
|
+
fileUploaded: "资源已上传",
|
|
117090
|
+
fileSaved: "资源已保存",
|
|
117091
|
+
fileDeleted: "资源已删除",
|
|
117092
|
+
failedToSaveFile: "保存资源失败",
|
|
117093
|
+
failedToUploadFile: "上传资源失败",
|
|
117094
|
+
failedToDeleteFile: "删除资源失败",
|
|
117095
|
+
detailsTab: "常规",
|
|
117096
|
+
filesTab: "资源",
|
|
117097
|
+
newFile: "新建资源",
|
|
117098
|
+
newFileDialogTitle: "新建资源",
|
|
117099
|
+
editFileDialogTitle: "编辑资源",
|
|
117100
|
+
deleteFileDialogTitle: "删除资源",
|
|
117101
|
+
deleteFileConfirmation: "确定要删除 {name} 吗?此操作无法撤销。",
|
|
117102
|
+
chooseFile: "选择文件",
|
|
117103
|
+
upload: "上传",
|
|
117104
|
+
download: "下载",
|
|
117105
|
+
resourcesItemLabel: "资源"
|
|
116861
117106
|
};
|
|
116862
117107
|
var clawSandboxHelpers = {
|
|
116863
117108
|
unknown: "未知",
|
|
@@ -119122,7 +119367,7 @@ var safetyTabLabels = {
|
|
|
119122
119367
|
};
|
|
119123
119368
|
var screenshareTabLabels = {
|
|
119124
119369
|
header: {
|
|
119125
|
-
title: "
|
|
119370
|
+
title: "屏幕",
|
|
119126
119371
|
description: "当用户在语音通话中共享屏幕时,您的智能体的表现方式。"
|
|
119127
119372
|
},
|
|
119128
119373
|
capability: {
|
|
@@ -121057,6 +121302,19 @@ var profileApplicationsQuestionsEditor = {
|
|
|
121057
121302
|
collapseSection: "折叠板块",
|
|
121058
121303
|
expandSection: "展开板块"
|
|
121059
121304
|
};
|
|
121305
|
+
var slashSkillPicker = {
|
|
121306
|
+
listLabel: "智能体技能",
|
|
121307
|
+
resultsAnnouncement: "{count} 个技能可用。使用方向键浏览,按 Enter 选择。",
|
|
121308
|
+
loading: "加载中..."
|
|
121309
|
+
};
|
|
121310
|
+
var skillsTabLabels = {
|
|
121311
|
+
header: {
|
|
121312
|
+
title: "技能",
|
|
121313
|
+
description: "可附加到此智能体的可复用操作指南——每个技能都是完成一项任务的指令集。在聊天中输入 / 即可使用。"
|
|
121314
|
+
},
|
|
121315
|
+
notBaseAgent: "技能仅适用于基础智能体。",
|
|
121316
|
+
loading: "加载中..."
|
|
121317
|
+
};
|
|
121060
121318
|
var zh = {
|
|
121061
121319
|
accessTabAddAccess: accessTabAddAccess,
|
|
121062
121320
|
accessTabLabels: accessTabLabels,
|
|
@@ -121308,7 +121566,9 @@ var zh = {
|
|
|
121308
121566
|
placementExam: placementExam,
|
|
121309
121567
|
applyApplyWizard: applyApplyWizard,
|
|
121310
121568
|
profileApplicationsTab: profileApplicationsTab,
|
|
121311
|
-
profileApplicationsQuestionsEditor: profileApplicationsQuestionsEditor
|
|
121569
|
+
profileApplicationsQuestionsEditor: profileApplicationsQuestionsEditor,
|
|
121570
|
+
slashSkillPicker: slashSkillPicker,
|
|
121571
|
+
skillsTabLabels: skillsTabLabels
|
|
121312
121572
|
};
|
|
121313
121573
|
|
|
121314
121574
|
/**
|
|
@@ -252456,6 +252716,543 @@ function getLLMProviderDetails(llmProvider, llmName) {
|
|
|
252456
252716
|
}
|
|
252457
252717
|
}
|
|
252458
252718
|
|
|
252719
|
+
function OverlayModal({ open, onClose, title, description, className, children, }) {
|
|
252720
|
+
const t = useT();
|
|
252721
|
+
const [mounted, setMounted] = useState(false);
|
|
252722
|
+
const [dialogPanel, setDialogPanel] = useState(null);
|
|
252723
|
+
useEffect(() => {
|
|
252724
|
+
setMounted(true);
|
|
252725
|
+
}, []);
|
|
252726
|
+
const handleOpenChange = (nextOpen) => {
|
|
252727
|
+
if (!nextOpen)
|
|
252728
|
+
onClose();
|
|
252729
|
+
};
|
|
252730
|
+
if (!mounted || typeof document === 'undefined') {
|
|
252731
|
+
return null;
|
|
252732
|
+
}
|
|
252733
|
+
// Nested Radix Dialog on document.body: viewport-fixed overlay + its own scroll lock,
|
|
252734
|
+
// independent of any parent modal. Requires the app to resolve the same
|
|
252735
|
+
// `@radix-ui/react-dialog` instance as this package (peer dependency + Rollup external).
|
|
252736
|
+
return (jsx(DialogPrimitive.Root, { open: open, onOpenChange: handleOpenChange, modal: true, children: jsxs(DialogPrimitive.Portal, { container: document.body, children: [jsx(DialogPrimitive.Overlay, { "data-iblai-dialog-interaction-layer": true, className: cn('pointer-events-auto fixed inset-0 z-[100] bg-black/60', 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0') }), jsx(DialogPrimitive.Content, { ref: setDialogPanel, "data-iblai-dialog-interaction-layer": true, ...(!description ? { 'aria-describedby': undefined } : {}), className: cn('pointer-events-auto fixed left-[50%] top-[50%] z-[100] grid w-full translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background shadow-lg duration-200', 'max-h-[min(90dvh,calc(100dvh-2rem))] max-w-[calc(100vw-2rem)] overflow-y-auto overscroll-contain rounded-lg p-6 sm:rounded-lg', 'pt-[max(1.5rem,env(safe-area-inset-top))] pb-[max(1.5rem,env(safe-area-inset-bottom))]', 'pl-[max(1.5rem,env(safe-area-inset-left))] pr-[max(1.5rem,env(safe-area-inset-right))]', 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]', 'focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2', className), children: jsxs(FloatingPortalContainerContext.Provider, { value: dialogPanel, children: [jsx(DialogPrimitive.Close, { type: "button", className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", "aria-label": t('clawSandboxOverlayModal.close'), children: jsx(X$2, { className: "h-4 w-4" }) }), jsxs("div", { className: "space-y-4", children: [jsxs("div", { className: "flex flex-col space-y-1.5 pr-8 text-center sm:text-left", children: [jsx(DialogPrimitive.Title, { className: "text-lg font-semibold leading-none tracking-tight", children: title }), description ? (jsx(DialogPrimitive.Description, { className: "text-sm text-muted-foreground", children: description })) : null] }), children] })] }) })] }) }));
|
|
252737
|
+
}
|
|
252738
|
+
|
|
252739
|
+
/** Page size for the resources list inside the Edit Skill dialog. */
|
|
252740
|
+
const RESOURCES_PAGE_SIZE = 20;
|
|
252741
|
+
const EMPTY_RESOURCE_FORM = {
|
|
252742
|
+
file_type: 'reference',
|
|
252743
|
+
filename: '',
|
|
252744
|
+
content: '',
|
|
252745
|
+
};
|
|
252746
|
+
/**
|
|
252747
|
+
* File attachments for a skill (agent-skill-resources). `reference`/`script`
|
|
252748
|
+
* files are text (filename + content); `asset` files are binary uploads.
|
|
252749
|
+
* Rendered as the Files tab of the Edit Skill dialog: a list with row
|
|
252750
|
+
* actions, a New File popup for add/edit, and a delete confirmation.
|
|
252751
|
+
*/
|
|
252752
|
+
function SkillResourcesSection({ platformKey, skillId }) {
|
|
252753
|
+
var _a, _b, _c;
|
|
252754
|
+
const t = useT();
|
|
252755
|
+
const [page, setPage] = useState(1);
|
|
252756
|
+
const { data: resourcePage, isLoading } = useGetAgentSkillResourcesQuery({
|
|
252757
|
+
org: platformKey,
|
|
252758
|
+
skill: skillId,
|
|
252759
|
+
limit: RESOURCES_PAGE_SIZE,
|
|
252760
|
+
offset: (page - 1) * RESOURCES_PAGE_SIZE,
|
|
252761
|
+
});
|
|
252762
|
+
const resources = (_a = resourcePage === null || resourcePage === void 0 ? void 0 : resourcePage.results) !== null && _a !== void 0 ? _a : [];
|
|
252763
|
+
const totalCount = (_b = resourcePage === null || resourcePage === void 0 ? void 0 : resourcePage.count) !== null && _b !== void 0 ? _b : 0;
|
|
252764
|
+
const totalPages = Math.max(1, Math.ceil(totalCount / RESOURCES_PAGE_SIZE));
|
|
252765
|
+
// Deleting the last item of the last page leaves the page out of range —
|
|
252766
|
+
// snap back to the new last page.
|
|
252767
|
+
useEffect(() => {
|
|
252768
|
+
if (page > totalPages)
|
|
252769
|
+
setPage(totalPages);
|
|
252770
|
+
}, [page, totalPages]);
|
|
252771
|
+
const [createResource, { isLoading: isCreating }] = useCreateAgentSkillResourceMutation();
|
|
252772
|
+
const [updateResource, { isLoading: isUpdating }] = useUpdateAgentSkillResourceMutation();
|
|
252773
|
+
const [uploadAsset, { isLoading: isUploading }] = useUploadAgentSkillResourceAssetMutation();
|
|
252774
|
+
const [deleteResource, { isLoading: isDeleting }] = useDeleteAgentSkillResourceMutation();
|
|
252775
|
+
const [showFileDialog, setShowFileDialog] = useState(false);
|
|
252776
|
+
const [editingResource, setEditingResource] = useState(null);
|
|
252777
|
+
const [deletingResource, setDeletingResource] = useState(null);
|
|
252778
|
+
const [form, setForm] = useState(EMPTY_RESOURCE_FORM);
|
|
252779
|
+
const [assetFile, setAssetFile] = useState(null);
|
|
252780
|
+
const fileInputRef = useRef(null);
|
|
252781
|
+
const isSaving = isCreating || isUpdating || isUploading;
|
|
252782
|
+
const isAssetForm = form.file_type === 'asset' && !editingResource;
|
|
252783
|
+
const canSubmitFile = isAssetForm ? !!assetFile : !!form.filename && !!form.content;
|
|
252784
|
+
const typeLabel = (fileType) => {
|
|
252785
|
+
switch (fileType) {
|
|
252786
|
+
case 'script':
|
|
252787
|
+
return t('clawSandboxAgentSkills.fileTypeScript');
|
|
252788
|
+
case 'asset':
|
|
252789
|
+
return t('clawSandboxAgentSkills.fileTypeAsset');
|
|
252790
|
+
default:
|
|
252791
|
+
return t('clawSandboxAgentSkills.fileTypeReference');
|
|
252792
|
+
}
|
|
252793
|
+
};
|
|
252794
|
+
const openNewFileDialog = () => {
|
|
252795
|
+
setForm(EMPTY_RESOURCE_FORM);
|
|
252796
|
+
setAssetFile(null);
|
|
252797
|
+
setEditingResource(null);
|
|
252798
|
+
setShowFileDialog(true);
|
|
252799
|
+
};
|
|
252800
|
+
const openEditFileDialog = (resource) => {
|
|
252801
|
+
var _a, _b;
|
|
252802
|
+
setForm({
|
|
252803
|
+
file_type: (_a = resource.file_type) !== null && _a !== void 0 ? _a : 'reference',
|
|
252804
|
+
filename: resource.filename,
|
|
252805
|
+
content: (_b = resource.content) !== null && _b !== void 0 ? _b : '',
|
|
252806
|
+
});
|
|
252807
|
+
setAssetFile(null);
|
|
252808
|
+
setEditingResource(resource);
|
|
252809
|
+
setShowFileDialog(true);
|
|
252810
|
+
};
|
|
252811
|
+
const closeFileDialog = () => {
|
|
252812
|
+
setShowFileDialog(false);
|
|
252813
|
+
setEditingResource(null);
|
|
252814
|
+
setForm(EMPTY_RESOURCE_FORM);
|
|
252815
|
+
setAssetFile(null);
|
|
252816
|
+
};
|
|
252817
|
+
const handleSubmitFile = async () => {
|
|
252818
|
+
try {
|
|
252819
|
+
if (editingResource) {
|
|
252820
|
+
await updateResource({
|
|
252821
|
+
org: platformKey,
|
|
252822
|
+
id: editingResource.id,
|
|
252823
|
+
filename: form.filename,
|
|
252824
|
+
content: form.content,
|
|
252825
|
+
}).unwrap();
|
|
252826
|
+
toast.success(t('clawSandboxAgentSkills.fileSaved'));
|
|
252827
|
+
}
|
|
252828
|
+
else if (isAssetForm) {
|
|
252829
|
+
if (!assetFile)
|
|
252830
|
+
return;
|
|
252831
|
+
await uploadAsset({
|
|
252832
|
+
org: platformKey,
|
|
252833
|
+
skill: skillId,
|
|
252834
|
+
file: assetFile,
|
|
252835
|
+
filename: assetFile.name,
|
|
252836
|
+
}).unwrap();
|
|
252837
|
+
toast.success(t('clawSandboxAgentSkills.fileUploaded'));
|
|
252838
|
+
}
|
|
252839
|
+
else {
|
|
252840
|
+
await createResource({
|
|
252841
|
+
org: platformKey,
|
|
252842
|
+
skill: skillId,
|
|
252843
|
+
file_type: form.file_type,
|
|
252844
|
+
filename: form.filename,
|
|
252845
|
+
content: form.content,
|
|
252846
|
+
}).unwrap();
|
|
252847
|
+
toast.success(t('clawSandboxAgentSkills.fileAdded'));
|
|
252848
|
+
}
|
|
252849
|
+
closeFileDialog();
|
|
252850
|
+
}
|
|
252851
|
+
catch (_a) {
|
|
252852
|
+
toast.error(t(isAssetForm
|
|
252853
|
+
? 'clawSandboxAgentSkills.failedToUploadFile'
|
|
252854
|
+
: 'clawSandboxAgentSkills.failedToSaveFile'));
|
|
252855
|
+
}
|
|
252856
|
+
};
|
|
252857
|
+
const handleDeleteFile = async () => {
|
|
252858
|
+
if (!deletingResource)
|
|
252859
|
+
return;
|
|
252860
|
+
try {
|
|
252861
|
+
await deleteResource({ org: platformKey, id: deletingResource.id }).unwrap();
|
|
252862
|
+
toast.success(t('clawSandboxAgentSkills.fileDeleted'));
|
|
252863
|
+
setDeletingResource(null);
|
|
252864
|
+
}
|
|
252865
|
+
catch (_a) {
|
|
252866
|
+
toast.error(t('clawSandboxAgentSkills.failedToDeleteFile'));
|
|
252867
|
+
}
|
|
252868
|
+
};
|
|
252869
|
+
const submitLabel = () => {
|
|
252870
|
+
if (editingResource) {
|
|
252871
|
+
return isUpdating ? t('clawSandboxAgentSkills.saving') : t('clawSandboxAgentSkills.save');
|
|
252872
|
+
}
|
|
252873
|
+
if (isAssetForm) {
|
|
252874
|
+
return isUploading
|
|
252875
|
+
? t('clawSandboxAgentSkills.uploading')
|
|
252876
|
+
: t('clawSandboxAgentSkills.upload');
|
|
252877
|
+
}
|
|
252878
|
+
return isCreating ? t('clawSandboxAgentSkills.adding') : t('clawSandboxAgentSkills.addFileButton');
|
|
252879
|
+
};
|
|
252880
|
+
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', {
|
|
252881
|
+
name: resource.filename,
|
|
252882
|
+
}), 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
|
|
252883
|
+
? 'clawSandboxAgentSkills.editFileDialogTitle'
|
|
252884
|
+
: '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', {
|
|
252885
|
+
name: (_c = deletingResource === null || deletingResource === void 0 ? void 0 : deletingResource.filename) !== null && _c !== void 0 ? _c : '',
|
|
252886
|
+
}) }), jsxs("div", { className: "flex justify-end gap-2 pt-2", children: [jsx(Button$1, { variant: "outline", onClick: () => setDeletingResource(null), children: t('clawSandboxAgentSkills.cancel') }), jsx(Button$1, { onClick: handleDeleteFile, disabled: isDeleting, className: "bg-red-600 text-white hover:bg-red-700", children: isDeleting
|
|
252887
|
+
? t('clawSandboxAgentSkills.deleting')
|
|
252888
|
+
: t('clawSandboxAgentSkills.delete') })] })] })] }));
|
|
252889
|
+
}
|
|
252890
|
+
|
|
252891
|
+
const EMPTY_SKILL_FORM = {
|
|
252892
|
+
name: '',
|
|
252893
|
+
slug: '',
|
|
252894
|
+
description: '',
|
|
252895
|
+
version: '1.0.0',
|
|
252896
|
+
category: '',
|
|
252897
|
+
instruction: '',
|
|
252898
|
+
privateToAgent: false,
|
|
252899
|
+
};
|
|
252900
|
+
// The builder resolves the effective skill set client-side, which needs the
|
|
252901
|
+
// complete catalog and assignment lists. Request one explicit large page so
|
|
252902
|
+
// the result is deterministic even if the backend later configures a default
|
|
252903
|
+
// page size (the list endpoints unwrap paginated envelopes to `results`).
|
|
252904
|
+
const FULL_LIST_LIMIT = 1000;
|
|
252905
|
+
function AgentSkills({ platformKey, mentorUniqueId }) {
|
|
252906
|
+
var _a;
|
|
252907
|
+
const t = useT();
|
|
252908
|
+
// Skills are managed independently of the sandbox connection — org-level
|
|
252909
|
+
// skills and the mentor's assignments both resolve without a wired Claw
|
|
252910
|
+
// instance, so we always fetch and let admins add/assign skills freely.
|
|
252911
|
+
// Always fetch — the backend enforces read access; RBAC here only gates
|
|
252912
|
+
// the write affordances (a partial permissions map must not blank the UI).
|
|
252913
|
+
const { data: availableSkills, isLoading: isLoadingSkills } = useGetAgentSkillsQuery({
|
|
252914
|
+
org: platformKey,
|
|
252915
|
+
limit: FULL_LIST_LIMIT,
|
|
252916
|
+
offset: 0,
|
|
252917
|
+
});
|
|
252918
|
+
const { data: assignments, isLoading: isLoadingAssignments } = useGetMentorSkillAssignmentsQuery({
|
|
252919
|
+
org: platformKey,
|
|
252920
|
+
mentorUniqueId,
|
|
252921
|
+
limit: FULL_LIST_LIMIT,
|
|
252922
|
+
offset: 0,
|
|
252923
|
+
});
|
|
252924
|
+
// Assignment mutations (attach/detach/toggle on the agent)
|
|
252925
|
+
const [createAssignment, { isLoading: isCreatingAssignment }] = useCreateMentorSkillAssignmentMutation();
|
|
252926
|
+
const [updateAssignment, { isLoading: isUpdatingAssignment }] = useUpdateMentorSkillAssignmentMutation();
|
|
252927
|
+
const [deleteAssignment, { isLoading: isDeletingAssignment }] = useDeleteMentorSkillAssignmentMutation();
|
|
252928
|
+
// Skill CRUD mutations (platform-level)
|
|
252929
|
+
const [createSkill, { isLoading: isCreatingSkill }] = useCreateAgentSkillMutation();
|
|
252930
|
+
const [updateSkill, { isLoading: isUpdatingSkill }] = useUpdateAgentSkillMutation();
|
|
252931
|
+
const [deleteSkill, { isLoading: isDeletingSkill }] = useDeleteAgentSkillMutation();
|
|
252932
|
+
const [showNewDialog, setShowNewDialog] = useState(false);
|
|
252933
|
+
const [editingSkill, setEditingSkill] = useState(null);
|
|
252934
|
+
const [deletingSkill, setDeletingSkill] = useState(null);
|
|
252935
|
+
const [form, setForm] = useState(EMPTY_SKILL_FORM);
|
|
252936
|
+
const isLoading = isLoadingSkills || isLoadingAssignments;
|
|
252937
|
+
const isMutatingAgentSkill = isCreatingAssignment || isUpdatingAssignment || isDeletingAssignment || isUpdatingSkill;
|
|
252938
|
+
const allSkills = availableSkills !== null && availableSkills !== void 0 ? availableSkills : [];
|
|
252939
|
+
const effectiveSkills = resolveEffectiveAgentSkills(allSkills, assignments !== null && assignments !== void 0 ? assignments : [], mentorUniqueId);
|
|
252940
|
+
const effectiveUniqueIds = new Set(effectiveSkills.map((s) => s.unique_id));
|
|
252941
|
+
const effectiveSlugs = new Set(effectiveSkills.map((s) => s.slug));
|
|
252942
|
+
// Catalog skills this agent could still attach: enabled, platform-wide
|
|
252943
|
+
// (never another agent's private skills), and not already effective. A
|
|
252944
|
+
// skill whose slug is already effective (e.g. shadowed by a private skill)
|
|
252945
|
+
// would dedupe away after attaching — don't offer an Add that does nothing.
|
|
252946
|
+
const attachableSkills = allSkills.filter((skill) => skill.enabled &&
|
|
252947
|
+
!skill.mentor &&
|
|
252948
|
+
!effectiveUniqueIds.has(skill.unique_id) &&
|
|
252949
|
+
!effectiveSlugs.has(skill.slug));
|
|
252950
|
+
// Featured skills from the `main` platform are read-only for tenants — the
|
|
252951
|
+
// API 404s writes against them, so hide the edit/delete affordances.
|
|
252952
|
+
const isSkillEditable = (skill) => {
|
|
252953
|
+
if (!skill)
|
|
252954
|
+
return false;
|
|
252955
|
+
return skill.platform_key ? skill.platform_key === platformKey : !skill.is_featured;
|
|
252956
|
+
};
|
|
252957
|
+
const resetForm = () => setForm(EMPTY_SKILL_FORM);
|
|
252958
|
+
const handleToggleEffective = async (effective, shouldEnable) => {
|
|
252959
|
+
try {
|
|
252960
|
+
if (effective.origin === 'private' && effective.skill) {
|
|
252961
|
+
await updateSkill({
|
|
252962
|
+
org: platformKey,
|
|
252963
|
+
id: effective.skill.id,
|
|
252964
|
+
enabled: shouldEnable,
|
|
252965
|
+
}).unwrap();
|
|
252966
|
+
}
|
|
252967
|
+
else if (effective.assignmentId !== undefined) {
|
|
252968
|
+
await updateAssignment({
|
|
252969
|
+
org: platformKey,
|
|
252970
|
+
mentorUniqueId,
|
|
252971
|
+
assignmentPk: effective.assignmentId,
|
|
252972
|
+
enabled: shouldEnable,
|
|
252973
|
+
}).unwrap();
|
|
252974
|
+
}
|
|
252975
|
+
toast.success(t(shouldEnable
|
|
252976
|
+
? 'clawSandboxAgentSkills.skillEnabled'
|
|
252977
|
+
: 'clawSandboxAgentSkills.skillDisabled', { name: effective.name }));
|
|
252978
|
+
}
|
|
252979
|
+
catch (_a) {
|
|
252980
|
+
toast.error(t('clawSandboxAgentSkills.failedToUpdateSkill', { name: effective.name }));
|
|
252981
|
+
}
|
|
252982
|
+
};
|
|
252983
|
+
const handleAttach = async (skill) => {
|
|
252984
|
+
try {
|
|
252985
|
+
await createAssignment({
|
|
252986
|
+
org: platformKey,
|
|
252987
|
+
mentorUniqueId,
|
|
252988
|
+
skill: skill.unique_id,
|
|
252989
|
+
enabled: true,
|
|
252990
|
+
}).unwrap();
|
|
252991
|
+
toast.success(t('clawSandboxAgentSkills.skillAdded', { name: skill.name }));
|
|
252992
|
+
}
|
|
252993
|
+
catch (_a) {
|
|
252994
|
+
toast.error(t('clawSandboxAgentSkills.failedToUpdateSkill', { name: skill.name }));
|
|
252995
|
+
}
|
|
252996
|
+
};
|
|
252997
|
+
const handleDetach = async (effective) => {
|
|
252998
|
+
if (effective.assignmentId === undefined)
|
|
252999
|
+
return;
|
|
253000
|
+
try {
|
|
253001
|
+
await deleteAssignment({
|
|
253002
|
+
org: platformKey,
|
|
253003
|
+
mentorUniqueId,
|
|
253004
|
+
assignmentPk: effective.assignmentId,
|
|
253005
|
+
}).unwrap();
|
|
253006
|
+
toast.success(t('clawSandboxAgentSkills.skillRemoved', { name: effective.name }));
|
|
253007
|
+
}
|
|
253008
|
+
catch (_a) {
|
|
253009
|
+
toast.error(t('clawSandboxAgentSkills.failedToUpdateSkill', { name: effective.name }));
|
|
253010
|
+
}
|
|
253011
|
+
};
|
|
253012
|
+
const openNewSkillDialog = () => {
|
|
253013
|
+
resetForm();
|
|
253014
|
+
setShowNewDialog(true);
|
|
253015
|
+
};
|
|
253016
|
+
const openEditSkillDialog = (skill) => {
|
|
253017
|
+
var _a;
|
|
253018
|
+
setForm({
|
|
253019
|
+
name: skill.name,
|
|
253020
|
+
slug: skill.slug,
|
|
253021
|
+
description: skill.description,
|
|
253022
|
+
version: skill.version,
|
|
253023
|
+
category: (_a = skill.category) !== null && _a !== void 0 ? _a : '',
|
|
253024
|
+
instruction: skill.instruction,
|
|
253025
|
+
privateToAgent: skill.mentor === mentorUniqueId,
|
|
253026
|
+
});
|
|
253027
|
+
setEditingSkill(skill);
|
|
253028
|
+
};
|
|
253029
|
+
const closeAllDialogs = () => {
|
|
253030
|
+
setShowNewDialog(false);
|
|
253031
|
+
setEditingSkill(null);
|
|
253032
|
+
resetForm();
|
|
253033
|
+
};
|
|
253034
|
+
const handleCreateSkill = async () => {
|
|
253035
|
+
if (!form.name || !form.slug) {
|
|
253036
|
+
toast.error(t('clawSandboxAgentSkills.nameAndSlugRequired'));
|
|
253037
|
+
return;
|
|
253038
|
+
}
|
|
253039
|
+
try {
|
|
253040
|
+
await createSkill({
|
|
253041
|
+
org: platformKey,
|
|
253042
|
+
name: form.name,
|
|
253043
|
+
slug: form.slug,
|
|
253044
|
+
description: form.description,
|
|
253045
|
+
version: form.version || '1.0.0',
|
|
253046
|
+
...(form.category && { category: form.category }),
|
|
253047
|
+
...(form.privateToAgent && { mentor: mentorUniqueId }),
|
|
253048
|
+
instruction: form.instruction,
|
|
253049
|
+
enabled: true,
|
|
253050
|
+
}).unwrap();
|
|
253051
|
+
toast.success(t('clawSandboxAgentSkills.skillCreated'));
|
|
253052
|
+
closeAllDialogs();
|
|
253053
|
+
}
|
|
253054
|
+
catch (_a) {
|
|
253055
|
+
toast.error(t('clawSandboxAgentSkills.failedToCreateSkill'));
|
|
253056
|
+
}
|
|
253057
|
+
};
|
|
253058
|
+
const handleUpdateSkill = async () => {
|
|
253059
|
+
if (!editingSkill)
|
|
253060
|
+
return;
|
|
253061
|
+
if (!form.name || !form.slug) {
|
|
253062
|
+
toast.error(t('clawSandboxAgentSkills.nameAndSlugRequired'));
|
|
253063
|
+
return;
|
|
253064
|
+
}
|
|
253065
|
+
try {
|
|
253066
|
+
await updateSkill({
|
|
253067
|
+
org: platformKey,
|
|
253068
|
+
id: editingSkill.id,
|
|
253069
|
+
name: form.name,
|
|
253070
|
+
slug: form.slug,
|
|
253071
|
+
description: form.description,
|
|
253072
|
+
version: form.version,
|
|
253073
|
+
category: form.category,
|
|
253074
|
+
instruction: form.instruction,
|
|
253075
|
+
}).unwrap();
|
|
253076
|
+
toast.success(t('clawSandboxAgentSkills.skillUpdated'));
|
|
253077
|
+
closeAllDialogs();
|
|
253078
|
+
}
|
|
253079
|
+
catch (_a) {
|
|
253080
|
+
toast.error(t('clawSandboxAgentSkills.failedToUpdateSkillGeneric'));
|
|
253081
|
+
}
|
|
253082
|
+
};
|
|
253083
|
+
const handleDeleteSkill = async () => {
|
|
253084
|
+
if (!deletingSkill)
|
|
253085
|
+
return;
|
|
253086
|
+
try {
|
|
253087
|
+
await deleteSkill({ org: platformKey, id: deletingSkill.id }).unwrap();
|
|
253088
|
+
toast.success(t('clawSandboxAgentSkills.skillDeleted'));
|
|
253089
|
+
setDeletingSkill(null);
|
|
253090
|
+
}
|
|
253091
|
+
catch (_a) {
|
|
253092
|
+
toast.error(t('clawSandboxAgentSkills.failedToDeleteSkill'));
|
|
253093
|
+
}
|
|
253094
|
+
};
|
|
253095
|
+
const renderBadges = (skill, effective) => {
|
|
253096
|
+
var _a, _b, _c;
|
|
253097
|
+
const category = (_a = effective === null || effective === void 0 ? void 0 : effective.category) !== null && _a !== void 0 ? _a : skill === null || skill === void 0 ? void 0 : skill.category;
|
|
253098
|
+
const skillType = (_b = effective === null || effective === void 0 ? void 0 : effective.skill_type) !== null && _b !== void 0 ? _b : skill === null || skill === void 0 ? void 0 : skill.skill_type;
|
|
253099
|
+
const isFeatured = (_c = effective === null || effective === void 0 ? void 0 : effective.is_featured) !== null && _c !== void 0 ? _c : skill === null || skill === void 0 ? void 0 : skill.is_featured;
|
|
253100
|
+
return (jsxs("span", { className: "flex flex-wrap items-center gap-1", children: [category && (jsx("span", { className: "rounded-full bg-gray-100 px-2 py-0.5 text-[0.625rem] text-gray-500", children: category })), skillType === 'native' && (jsx("span", { className: "rounded-full bg-purple-50 px-2 py-0.5 text-[0.625rem] text-purple-600", children: t('clawSandboxAgentSkills.nativeBadge') })), isFeatured && (jsx("span", { className: "rounded-full bg-amber-50 px-2 py-0.5 text-[0.625rem] text-amber-600", children: t('clawSandboxAgentSkills.featuredBadge') })), (effective === null || effective === void 0 ? void 0 : effective.origin) === 'private' && (jsx("span", { className: "rounded-full bg-blue-50 px-2 py-0.5 text-[0.625rem] text-blue-600", children: t('clawSandboxAgentSkills.privateBadge') }))] }));
|
|
253101
|
+
};
|
|
253102
|
+
const renderSkillMenu = (skill, effective) => {
|
|
253103
|
+
var _a, _b;
|
|
253104
|
+
const editable = isSkillEditable(skill);
|
|
253105
|
+
const showEdit = editable;
|
|
253106
|
+
const showDelete = editable;
|
|
253107
|
+
const detachable = (effective === null || effective === void 0 ? void 0 : effective.origin) === 'assignment';
|
|
253108
|
+
if (!showEdit && !showDelete && !detachable)
|
|
253109
|
+
return null;
|
|
253110
|
+
const name = (_b = (_a = effective === null || effective === void 0 ? void 0 : effective.name) !== null && _a !== void 0 ? _a : skill === null || skill === void 0 ? void 0 : skill.name) !== null && _b !== void 0 ? _b : '';
|
|
253111
|
+
return (jsxs(DropdownMenu, { children: [jsx(DropdownMenuTrigger, { asChild: true, children: jsx(Button$1, { variant: "ghost", size: "sm", "aria-label": t('clawSandboxAgentSkills.skillActions', { name }), children: jsx(Ellipsis, { className: "h-4 w-4" }) }) }), jsxs(DropdownMenuContent, { align: "end", children: [detachable && (jsxs(DropdownMenuItem, { className: "cursor-pointer", onClick: () => effective && handleDetach(effective), children: [jsx(CircleMinus$1, { className: "mr-2 h-4 w-4" }), t('clawSandboxAgentSkills.removeFromAgent')] })), showEdit && skill && (jsxs(DropdownMenuItem, { className: "cursor-pointer", onClick: () => openEditSkillDialog(skill), children: [jsx(Pen, { className: "mr-2 h-4 w-4" }), t('clawSandboxAgentSkills.edit')] })), showDelete && skill && (jsxs(DropdownMenuItem, { variant: "destructive", className: "cursor-pointer", onClick: () => setDeletingSkill(skill), children: [jsx(Trash2, { className: "mr-2 h-4 w-4" }), t('clawSandboxAgentSkills.delete')] }))] })] }));
|
|
253112
|
+
};
|
|
253113
|
+
if (isLoading) {
|
|
253114
|
+
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') })] }));
|
|
253115
|
+
}
|
|
253116
|
+
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) => {
|
|
253117
|
+
var _a;
|
|
253118
|
+
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
|
|
253119
|
+
? 'clawSandboxAgentSkills.skillEnabledLabel'
|
|
253120
|
+
: 'clawSandboxAgentSkills.skillDisabledLabel', { name: effective.name }) }), renderSkillMenu(effective.skill, effective)] })] }, effective.unique_id));
|
|
253121
|
+
}) }))] }), 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
|
|
253122
|
+
? t('clawSandboxAgentSkills.creating')
|
|
253123
|
+
: 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
|
|
253124
|
+
? t('clawSandboxAgentSkills.saving')
|
|
253125
|
+
: 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
|
|
253126
|
+
? t('clawSandboxAgentSkills.deleting')
|
|
253127
|
+
: t('clawSandboxAgentSkills.delete') })] })] })] }));
|
|
253128
|
+
}
|
|
253129
|
+
// ── Shared Skill Form ────────────────────────────────────────────────────────
|
|
253130
|
+
function SkillForm({ form, onChange, showPrivateToggle = false, }) {
|
|
253131
|
+
const t = useT();
|
|
253132
|
+
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 }) })] })] }));
|
|
253133
|
+
}
|
|
253134
|
+
|
|
253135
|
+
/** Distance (px) from the list bottom at which the next page is requested. */
|
|
253136
|
+
const LOAD_MORE_THRESHOLD_PX = 48;
|
|
253137
|
+
/**
|
|
253138
|
+
* Listbox half of the chat `/` skill combobox. The composer textarea owns
|
|
253139
|
+
* focus and keyboard handling (see `useSlashSkillPicker`); options here are
|
|
253140
|
+
* referenced via `aria-activedescendant` and selected on click. Scrolling
|
|
253141
|
+
* near the bottom lazily loads the next page of skills.
|
|
253142
|
+
*/
|
|
253143
|
+
function SlashSkillPicker({ skills, activeIndex, listboxId, onSelect, onActiveIndexChange, isLoading = false, isFetchingMore = false, hasMore = false, onLoadMore, }) {
|
|
253144
|
+
const t = useT();
|
|
253145
|
+
const listRef = useRef(null);
|
|
253146
|
+
// Keep the active option scrolled into view during arrow-key browsing.
|
|
253147
|
+
useEffect(() => {
|
|
253148
|
+
var _a;
|
|
253149
|
+
const option = (_a = listRef.current) === null || _a === void 0 ? void 0 : _a.children[activeIndex];
|
|
253150
|
+
option === null || option === void 0 ? void 0 : option.scrollIntoView({ block: 'nearest' });
|
|
253151
|
+
}, [activeIndex]);
|
|
253152
|
+
if (skills.length === 0 && !isLoading)
|
|
253153
|
+
return null;
|
|
253154
|
+
const handleScroll = (event) => {
|
|
253155
|
+
if (!hasMore || isFetchingMore || !onLoadMore)
|
|
253156
|
+
return;
|
|
253157
|
+
const el = event.currentTarget;
|
|
253158
|
+
if (el.scrollTop + el.clientHeight >= el.scrollHeight - LOAD_MORE_THRESHOLD_PX) {
|
|
253159
|
+
onLoadMore();
|
|
253160
|
+
}
|
|
253161
|
+
};
|
|
253162
|
+
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
|
|
253163
|
+
? t('slashSkillPicker.loading')
|
|
253164
|
+
: 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),
|
|
253165
|
+
// onMouseDown so selection wins over the textarea losing focus.
|
|
253166
|
+
onMouseDown: (e) => {
|
|
253167
|
+
e.preventDefault();
|
|
253168
|
+
onSelect(skill);
|
|
253169
|
+
}, 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') })] }))] }))] }));
|
|
253170
|
+
}
|
|
253171
|
+
|
|
253172
|
+
/** Matches a composer value that is a single `/`-prefixed token (no whitespace). */
|
|
253173
|
+
const SLASH_TOKEN_RE = /^\/\S*$/;
|
|
253174
|
+
/**
|
|
253175
|
+
* State machine for the chat `/` skill picker. Opens while the composer holds
|
|
253176
|
+
* a single `/`-prefixed token and at least one enabled skill matches; `Esc`
|
|
253177
|
+
* dismisses until the token is cleared, so plain text starting with `/` is
|
|
253178
|
+
* never blocked.
|
|
253179
|
+
*/
|
|
253180
|
+
function useSlashSkillPicker({ inputValue, setInputValue, skills, isLoading = false, }) {
|
|
253181
|
+
const listboxId = useId$2();
|
|
253182
|
+
const [dismissed, setDismissed] = useState(false);
|
|
253183
|
+
const [activeIndex, setActiveIndex] = useState(0);
|
|
253184
|
+
const isSlashToken = SLASH_TOKEN_RE.test(inputValue);
|
|
253185
|
+
const query = isSlashToken ? inputValue.slice(1) : '';
|
|
253186
|
+
const filteredSkills = useMemo(() => (isSlashToken ? filterSlashSkills(skills, query) : []), [isSlashToken, skills, query]);
|
|
253187
|
+
// Loading keeps the picker open (with a loading row) so the user knows
|
|
253188
|
+
// something is coming; once loaded, zero matches closes it.
|
|
253189
|
+
const open = isSlashToken && !dismissed && (filteredSkills.length > 0 || isLoading);
|
|
253190
|
+
// Re-arm the picker once the slash token is gone (text sent or cleared).
|
|
253191
|
+
useEffect(() => {
|
|
253192
|
+
if (!isSlashToken && dismissed)
|
|
253193
|
+
setDismissed(false);
|
|
253194
|
+
}, [isSlashToken, dismissed]);
|
|
253195
|
+
// Keep the active option valid as the query narrows the list.
|
|
253196
|
+
const filteredLength = filteredSkills.length;
|
|
253197
|
+
const previousLength = useRef(filteredLength);
|
|
253198
|
+
useEffect(() => {
|
|
253199
|
+
if (previousLength.current !== filteredLength) {
|
|
253200
|
+
previousLength.current = filteredLength;
|
|
253201
|
+
setActiveIndex(0);
|
|
253202
|
+
}
|
|
253203
|
+
}, [filteredLength]);
|
|
253204
|
+
const selectSkill = (skill) => {
|
|
253205
|
+
setInputValue(`/${skill.slug} `);
|
|
253206
|
+
setActiveIndex(0);
|
|
253207
|
+
};
|
|
253208
|
+
const handleKeyDown = (event) => {
|
|
253209
|
+
if (!open)
|
|
253210
|
+
return false;
|
|
253211
|
+
switch (event.key) {
|
|
253212
|
+
case 'ArrowDown':
|
|
253213
|
+
if (!filteredSkills.length)
|
|
253214
|
+
return false;
|
|
253215
|
+
event.preventDefault();
|
|
253216
|
+
setActiveIndex((index) => (index + 1) % filteredSkills.length);
|
|
253217
|
+
return true;
|
|
253218
|
+
case 'ArrowUp':
|
|
253219
|
+
if (!filteredSkills.length)
|
|
253220
|
+
return false;
|
|
253221
|
+
event.preventDefault();
|
|
253222
|
+
setActiveIndex((index) => (index - 1 + filteredSkills.length) % filteredSkills.length);
|
|
253223
|
+
return true;
|
|
253224
|
+
case 'Enter':
|
|
253225
|
+
if (event.shiftKey || !filteredSkills.length)
|
|
253226
|
+
return false;
|
|
253227
|
+
event.preventDefault();
|
|
253228
|
+
selectSkill(filteredSkills[activeIndex]);
|
|
253229
|
+
return true;
|
|
253230
|
+
case 'Tab':
|
|
253231
|
+
if (!filteredSkills.length)
|
|
253232
|
+
return false;
|
|
253233
|
+
event.preventDefault();
|
|
253234
|
+
selectSkill(filteredSkills[activeIndex]);
|
|
253235
|
+
return true;
|
|
253236
|
+
case 'Escape':
|
|
253237
|
+
event.preventDefault();
|
|
253238
|
+
setDismissed(true);
|
|
253239
|
+
return true;
|
|
253240
|
+
default:
|
|
253241
|
+
return false;
|
|
253242
|
+
}
|
|
253243
|
+
};
|
|
253244
|
+
return {
|
|
253245
|
+
open,
|
|
253246
|
+
filteredSkills,
|
|
253247
|
+
activeIndex,
|
|
253248
|
+
setActiveIndex,
|
|
253249
|
+
listboxId,
|
|
253250
|
+
activeOptionId: open && filteredSkills.length > 0 ? `${listboxId}-option-${activeIndex}` : undefined,
|
|
253251
|
+
selectSkill,
|
|
253252
|
+
handleKeyDown,
|
|
253253
|
+
};
|
|
253254
|
+
}
|
|
253255
|
+
|
|
252459
253256
|
function c$3(e,u,c){var i=this,a=useRef(null),o=useRef(0),f=useRef(null),l=useRef([]),v=useRef(),m=useRef(),d=useRef(e),g=useRef(true);d.current=e;var p="undefined"!=typeof window,w=!u&&0!==u&&p;if("function"!=typeof e)throw new TypeError("Expected a function");u=+u||0;var s=!!(c=c||{}).leading,x=!("trailing"in c)||!!c.trailing,h="maxWait"in c,y="debounceOnServer"in c&&!!c.debounceOnServer,F=h?Math.max(+c.maxWait||0,u):null;useEffect(function(){return g.current=true,function(){g.current=false;}},[]);var A=useMemo(function(){var r=function(r){var n=l.current,t=v.current;return l.current=v.current=null,o.current=r,m.current=d.current.apply(t,n)},n=function(r,n){w&&cancelAnimationFrame(f.current),f.current=w?requestAnimationFrame(r):setTimeout(r,n);},t=function(r){if(!g.current)return false;var n=r-a.current;return !a.current||n>=u||n<0||h&&r-o.current>=F},e=function(n){return f.current=null,x&&l.current?r(n):(l.current=v.current=null,m.current)},c=function r(){var c=Date.now();if(t(c))return e(c);if(g.current){var i=u-(c-a.current),f=h?Math.min(i,F-(c-o.current)):i;n(r,f);}},A=function(){if(p||y){var e=Date.now(),d=t(e);if(l.current=[].slice.call(arguments),v.current=i,a.current=e,d){if(!f.current&&g.current)return o.current=a.current,n(c,u),s?r(a.current):m.current;if(h)return n(c,u),r(a.current)}return f.current||n(c,u),m.current}};return A.cancel=function(){f.current&&(w?cancelAnimationFrame(f.current):clearTimeout(f.current)),o.current=0,l.current=a.current=v.current=f.current=null;},A.isPending=function(){return !!f.current},A.flush=function(){return f.current?e(Date.now()):m.current},A},[s,h,u,F,x,w,p,y]);return A}function i$8(r,n){return r===n}function a$3(n,t,a){var o=i$8,f=useRef(n),l=useState({})[1],v=c$3(useCallback(function(r){f.current=r,l({});},[l]),t,a),m=useRef(n);return o(m.current,n)||(v(n),m.current=n),[f.current,v]}
|
|
252460
253257
|
|
|
252461
253258
|
lazy(() => Promise.resolve().then(function () { return createProjectModal; }).then((mod) => ({
|
|
@@ -253163,7 +253960,7 @@ const CSS_CLASS_NAMES = {
|
|
|
253163
253960
|
},
|
|
253164
253961
|
};
|
|
253165
253962
|
|
|
253166
|
-
const AutoResizeTextarea = ({ allowEmptySubmit = false, value, onChange, onSubmit, disabled = false, placeholder = '', sessionId = null, isPreviewMode = false, textAreaRows = 3, className = '', style = {}, allowAnonymousAccess = false, embedMode = false, ...props }) => {
|
|
253963
|
+
const AutoResizeTextarea = ({ allowEmptySubmit = false, value, onChange, onSubmit, onComposerKeyDown, disabled = false, placeholder = '', sessionId = null, isPreviewMode = false, textAreaRows = 3, className = '', style = {}, allowAnonymousAccess = false, embedMode = false, ...props }) => {
|
|
253167
253964
|
const textareaRef = useRef(null);
|
|
253168
253965
|
const [isResizing, setIsResizing] = useState(false);
|
|
253169
253966
|
const numberOfMessages = useSelector(selectNumberOfActiveChatMessages);
|
|
@@ -253211,6 +254008,8 @@ const AutoResizeTextarea = ({ allowEmptySubmit = false, value, onChange, onSubmi
|
|
|
253211
254008
|
const handleKeyDown = (e) => {
|
|
253212
254009
|
if (isPreviewMode && !allowAnonymousAccess)
|
|
253213
254010
|
return;
|
|
254011
|
+
if (onComposerKeyDown === null || onComposerKeyDown === void 0 ? void 0 : onComposerKeyDown(e))
|
|
254012
|
+
return;
|
|
253214
254013
|
if (e.key === 'Enter' && !e.shiftKey) {
|
|
253215
254014
|
e.preventDefault();
|
|
253216
254015
|
if (value.trim() || allowEmptySubmit) {
|
|
@@ -254548,7 +255347,7 @@ function SubmitMessageButton({ isPreviewMode, allowAnonymousAccess, isUploading,
|
|
|
254548
255347
|
const PromptGalleryModal$1 = dynamic(() => Promise.resolve().then(function () { return promptGalleryModal; }).then((mod) => mod.PromptGalleryModal), {
|
|
254549
255348
|
ssr: false,
|
|
254550
255349
|
});
|
|
254551
|
-
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, }) {
|
|
255350
|
+
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, }) {
|
|
254552
255351
|
var _a, _b, _c, _d, _e;
|
|
254553
255352
|
const t = useT();
|
|
254554
255353
|
const dispatch = useDispatch();
|
|
@@ -254602,6 +255401,15 @@ function ChatInputForm({ onSubmit, onScreenSharingClick, isScreenSharingModalOpe
|
|
|
254602
255401
|
const setInputValue = (input) => {
|
|
254603
255402
|
dispatch(chatInputSliceActions.setTextareaInput(input));
|
|
254604
255403
|
};
|
|
255404
|
+
// `/` skill picker — active only when the host supplies the agent's
|
|
255405
|
+
// effective skills (or reports them loading). No fetching happens here.
|
|
255406
|
+
const effectiveSlashSkills = slashSkills !== null && slashSkills !== void 0 ? slashSkills : [];
|
|
255407
|
+
const slashPicker = useSlashSkillPicker({
|
|
255408
|
+
inputValue,
|
|
255409
|
+
setInputValue,
|
|
255410
|
+
skills: effectiveSlashSkills,
|
|
255411
|
+
isLoading: slashSkillsLoading,
|
|
255412
|
+
});
|
|
254605
255413
|
const handleSelectPrompt = (promptText) => {
|
|
254606
255414
|
setInputValue(promptText);
|
|
254607
255415
|
setIsPromptGalleryOpen(false);
|
|
@@ -254666,9 +255474,18 @@ function ChatInputForm({ onSubmit, onScreenSharingClick, isScreenSharingModalOpe
|
|
|
254666
255474
|
}
|
|
254667
255475
|
return persistentChatInputLabel ? '' : t('chatInputForm.askAnything');
|
|
254668
255476
|
};
|
|
254669
|
-
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('mx-auto mt-4 w-full pb-2', CSS_CLASS_NAMES.CHAT.TEXTAREA), style: chatAreaMaxWidth ? { maxWidth: `${chatAreaMaxWidth}px` } : undefined, children: [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
|
|
255477
|
+
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
|
|
254670
255478
|
? 'block px-[18.5px] pt-3 text-xs font-medium text-gray-600'
|
|
254671
|
-
: '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,
|
|
255479
|
+
: '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) && {
|
|
255480
|
+
role: 'combobox',
|
|
255481
|
+
'aria-expanded': slashPicker.open,
|
|
255482
|
+
'aria-haspopup': 'listbox',
|
|
255483
|
+
'aria-controls': slashPicker.open && slashPicker.filteredSkills.length > 0
|
|
255484
|
+
? slashPicker.listboxId
|
|
255485
|
+
: undefined,
|
|
255486
|
+
'aria-activedescendant': slashPicker.activeOptionId,
|
|
255487
|
+
'aria-autocomplete': 'list',
|
|
255488
|
+
}), value: inputValue, onChange: handleInputChange, onSubmit: handleSubmit, onComposerKeyDown: slashPicker.handleKeyDown, sessionId: sessionId, isPreviewMode: isPreviewMode, textAreaRows: textAreaRows, placeholder: isChatDisabledByRbac ? t('chatInputForm.noChatPermission') : textAreaPlaceholder(), disabled: isChatDisabledByRbac || hasUploadingFiles, allowEmptySubmit: attachedFiles.length > 0, allowAnonymousAccess: isMentorViewableByAnyone || showingSharedChat || !!userIsVisiting, embedMode: embedMode }), jsxs("div", { className: "flex items-center gap-2 px-2", children: [visibleToLoggedInUsersOnly && !compactMode && (jsx(UploadMenu, { onFileInputTrigger: () => executeWithTrialCheck(triggerFileInput), disabled: isChatDisabledByRbac || !sessionId, mentorId: mentorId, tenantKey: tenantKey, isPublicRoute: isPublicRoute })), visibleToLoggedInUsersOnly && !compactMode && (jsx(InsideButtons, { containerWidth: containerWidth, activeOptions: activeTools, onOptionClick: updateSessionTools, deepResearch: deepResearch, artifactsEnabled: artifactsEnabled, disabled: isChatDisabledByRbac, onOpenPromptGallery: openPromptGallery, embedMode: embedMode, promptsIsEnabled: promptsIsEnabled, studyMode: studyMode, memoryEnabled: mentorSettings.data.memoryEnabled, mentorId: mentorId, tenantKey: tenantKey, username: username })), jsxs("div", { className: "ml-auto flex", children: [visibleToLoggedInUsersOnly && !compactMode && (jsx(ScreenSharingButton, { onClick: onScreenSharingClick, isScreenSharingModalOpen: isScreenSharingModalOpen, screenSharing: screenSharing, isPreviewMode: isPreviewMode, disabled: isChatDisabledByRbac })), visibleToLoggedInUsersOnly && !compactMode && (jsx(VoiceChatButton, { isPreviewMode: isPreviewMode, handleMicrophoneBtnClick: () => executeWithTrialCheck(handleMicrophoneBtnClick), processing: processing, recording: recording, disabled: isChatDisabledByRbac, mentorId: mentorId, tenantKey: tenantKey, isPublicRoute: isPublicRoute })), visibleToLoggedInUsersOnly && !compactMode && (jsx(VoiceCallButton, { isPreviewMode: isPreviewMode, onClick: () => executeWithTrialCheck(onPhoneCallClick), disabled: isChatDisabledByRbac, mentorId: mentorId, tenantKey: tenantKey, isPublicRoute: isPublicRoute })), isStreaming ? (jsx(StopStreamingButton, { ref: stopStreamingButtonRef, stopGenerating: stopGenerating })) : (jsx(SubmitMessageButton, { isPreviewMode: isPreviewMode, allowAnonymousAccess: isMentorViewableByAnyone, isUploading: hasUploadingFiles, disabled: isChatDisabledByRbac || !sessionId, isConnecting: isConnecting }))] })] })] }), jsx("input", { type: "file", ref: fileUploadInputRef, className: "hidden", onChange: handleFileInputChange, accept: fileUploadCapabilities.allSupportedTypes.length > 0
|
|
254672
255489
|
? fileUploadCapabilities.allSupportedTypes.join(',')
|
|
254673
255490
|
: MENTOR_CHAT_DOCUMENTS_EXTENSIONS.join(','), multiple: true, disabled: isChatDisabledByRbac || !sessionId })] }), visibleToLoggedInUsersOnly && !compactMode && (jsx("div", { className: "flex w-full justify-center", children: jsx(OutsideButtons, { activeOptions: activeTools, onOptionClick: updateSessionTools, setSessionTools: setSessionTools, onCrossClick: updateSessionTools, containerWidth: containerWidth, enableWebBrowsing: enableWebBrowsing, imageGeneration: imageGeneration, codeInterpreter: codeInterpreter, googleSlidesIsEnabled: googleSlidesIsEnabled, googleDocumentIsEnabled: googleDocumentIsEnabled, tenantKey: tenantKey, userId: username, disabled: isChatDisabledByRbac }) }))] }), isPromptGalleryOpen && (jsx(PromptGalleryModal$1, { isOpen: isPromptGalleryOpen, onClose: () => setIsPromptGalleryOpen(false), onSelectPrompt: handleSelectPrompt, mentorId: mentorId, tenantKey: tenantKey, userIsStudent: userIsStudent })), isFreeTrialModalOpen && FreeTrialDialog && (jsx(FreeTrialDialog, { isOpen: isFreeTrialModalOpen, onClose: closeFreeTrialModal }))] }));
|
|
254674
255491
|
}
|
|
@@ -266843,7 +267660,9 @@ function PromptCard$1({ label, placeholder, value, disabled, renderContent, onEd
|
|
|
266843
267660
|
|
|
266844
267661
|
const AGENT_SCREENSHARE_TAB_LABELS = {
|
|
266845
267662
|
header: {
|
|
266846
|
-
|
|
267663
|
+
// Title is deliberately just "Screen" — the description below carries the
|
|
267664
|
+
// screen-sharing wording.
|
|
267665
|
+
title: 'Screen',
|
|
266847
267666
|
description: 'How your agent behaves when a user shares their screen during a voice call.',
|
|
266848
267667
|
},
|
|
266849
267668
|
capability: {
|
|
@@ -267063,6 +267882,86 @@ function AgentScreenShareTab({ labels: labelsOverride, renderPromptContent, tena
|
|
|
267063
267882
|
} }) }))] })) })] }));
|
|
267064
267883
|
}
|
|
267065
267884
|
|
|
267885
|
+
const AGENT_SKILLS_TAB_LABELS = {
|
|
267886
|
+
header: {
|
|
267887
|
+
title: 'Skills',
|
|
267888
|
+
description: 'Reusable playbooks you can attach to this agent — each one is a set of instructions for a job. In chat, type / to use one.',
|
|
267889
|
+
},
|
|
267890
|
+
notBaseAgent: 'Skills are only available to Base Agents.',
|
|
267891
|
+
loading: 'Loading...',
|
|
267892
|
+
};
|
|
267893
|
+
function buildSkillsTabLabels(t) {
|
|
267894
|
+
return {
|
|
267895
|
+
header: {
|
|
267896
|
+
title: t('skillsTabLabels.header.title'),
|
|
267897
|
+
description: t('skillsTabLabels.header.description'),
|
|
267898
|
+
},
|
|
267899
|
+
notBaseAgent: t('skillsTabLabels.notBaseAgent'),
|
|
267900
|
+
loading: t('skillsTabLabels.loading'),
|
|
267901
|
+
};
|
|
267902
|
+
}
|
|
267903
|
+
function resolveSkillsTabLabels(override, t) {
|
|
267904
|
+
const base = t ? buildSkillsTabLabels(t) : AGENT_SKILLS_TAB_LABELS;
|
|
267905
|
+
if (!override)
|
|
267906
|
+
return base;
|
|
267907
|
+
return deepMerge(base, override);
|
|
267908
|
+
}
|
|
267909
|
+
|
|
267910
|
+
/**
|
|
267911
|
+
* Best-effort slug extraction from the `template_mentor` field, whose shape
|
|
267912
|
+
* is untyped on the settings serializer (string slug or nested object).
|
|
267913
|
+
*/
|
|
267914
|
+
function templateMentorSlug(template) {
|
|
267915
|
+
if (typeof template === 'string')
|
|
267916
|
+
return template;
|
|
267917
|
+
if (template && typeof template === 'object') {
|
|
267918
|
+
const record = template;
|
|
267919
|
+
for (const key of ['slug', 'mentor_slug', 'template_slug']) {
|
|
267920
|
+
if (typeof record[key] === 'string')
|
|
267921
|
+
return record[key];
|
|
267922
|
+
}
|
|
267923
|
+
}
|
|
267924
|
+
return undefined;
|
|
267925
|
+
}
|
|
267926
|
+
/**
|
|
267927
|
+
* The Skills section of the agent configuration modal. Resolves the agent's
|
|
267928
|
+
* UUID from mentor settings and renders the AgentSkills manager (effective
|
|
267929
|
+
* skills + attachable catalog). Skills only apply to Base Agents — when the
|
|
267930
|
+
* settings identify another agent type, an informational note renders
|
|
267931
|
+
* instead. Hosts should also hide the tab for non-Base-Agents when they can.
|
|
267932
|
+
*/
|
|
267933
|
+
function AgentSkillsTab({ labels: labelsOverride, tenantKey: tenantKeyProp, mentorId: mentorIdProp, username: usernameProp, userIsStudent: userIsStudentProp, }) {
|
|
267934
|
+
var _a, _b, _c, _d, _e;
|
|
267935
|
+
const t = useT();
|
|
267936
|
+
const labels = React__default.useMemo(() => resolveSkillsTabLabels(labelsOverride, t), [labelsOverride, t]);
|
|
267937
|
+
const ctx = useAgentSettingsOptional();
|
|
267938
|
+
const tenantKey = (_a = tenantKeyProp !== null && tenantKeyProp !== void 0 ? tenantKeyProp : ctx === null || ctx === void 0 ? void 0 : ctx.tenantKey) !== null && _a !== void 0 ? _a : '';
|
|
267939
|
+
const mentorId = (_b = mentorIdProp !== null && mentorIdProp !== void 0 ? mentorIdProp : ctx === null || ctx === void 0 ? void 0 : ctx.mentorId) !== null && _b !== void 0 ? _b : '';
|
|
267940
|
+
const username = (_c = usernameProp !== null && usernameProp !== void 0 ? usernameProp : ctx === null || ctx === void 0 ? void 0 : ctx.username) !== null && _c !== void 0 ? _c : '';
|
|
267941
|
+
// Agent Skills are admin-only: render nothing for learners even if a host
|
|
267942
|
+
// registers the tab or deep-links to it. Prop overrides context.
|
|
267943
|
+
const userIsStudent = (_d = userIsStudentProp !== null && userIsStudentProp !== void 0 ? userIsStudentProp : ctx === null || ctx === void 0 ? void 0 : ctx.userIsStudent) !== null && _d !== void 0 ? _d : false;
|
|
267944
|
+
const { data: mentorSettings, isLoading: isSettingsLoading } = useGetMentorSettingsQuery({
|
|
267945
|
+
mentor: mentorId,
|
|
267946
|
+
org: tenantKey,
|
|
267947
|
+
}, { skip: !username || !mentorId || !tenantKey || userIsStudent });
|
|
267948
|
+
const settings = mentorSettings;
|
|
267949
|
+
const mentorUniqueId = (_e = settings === null || settings === void 0 ? void 0 : settings.mentor_unique_id) !== null && _e !== void 0 ? _e : '';
|
|
267950
|
+
const templateSlug = templateMentorSlug(settings === null || settings === void 0 ? void 0 : settings.template_mentor);
|
|
267951
|
+
// Only block when the template positively identifies a non-Base-Agent type;
|
|
267952
|
+
// with no template evidence (custom mentors carry their own slug), render
|
|
267953
|
+
// the manager and let the backend enforce.
|
|
267954
|
+
const knownNotBaseAgent = !!settings &&
|
|
267955
|
+
templateSlug !== undefined &&
|
|
267956
|
+
!isBaseAgentMentor({ mentorSlug: settings.mentor_slug, templateMentorSlug: templateSlug });
|
|
267957
|
+
if (userIsStudent)
|
|
267958
|
+
return null;
|
|
267959
|
+
return (jsxs(Fragment$1, { children: [jsx("div", { className: "hidden h-[73px] flex-shrink-0 items-center border-b border-gray-200 bg-white p-4 lg:block", children: jsxs("div", { children: [jsx("h3", { className: "mb-1 text-base font-medium text-gray-900", children: labels.header.title }), jsx("p", { className: "text-xs text-gray-700", children: labels.header.description })] }) }), jsx("div", { className: "flex-1 space-y-4 p-3", style: {
|
|
267960
|
+
overflowY: 'auto',
|
|
267961
|
+
overflowX: 'hidden',
|
|
267962
|
+
}, children: isSettingsLoading || !mentorUniqueId ? (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: labels.loading })] })) : knownNotBaseAgent ? (jsx("div", { className: "flex items-center justify-center rounded-lg border p-6", children: jsx("p", { className: "text-sm text-gray-500", children: labels.notBaseAgent }) })) : (jsx(AgentSkills, { platformKey: tenantKey, mentorUniqueId: mentorUniqueId })) })] }));
|
|
267963
|
+
}
|
|
267964
|
+
|
|
267066
267965
|
const AGENT_GRADER_TAB_LABELS = {
|
|
267067
267966
|
header: {
|
|
267068
267967
|
title: 'Grader',
|
|
@@ -269146,7 +270045,7 @@ function AgentLinksSection({ identity, labels, }) {
|
|
|
269146
270045
|
event.stopPropagation();
|
|
269147
270046
|
setEditingLink(link);
|
|
269148
270047
|
}, children: jsx(Pencil, { className: "h-4 w-4" }) }) })] }, link.id));
|
|
269149
|
-
}) })] }) }), isFetching && (jsx("p", { className: "px-3 py-2 text-xs text-gray-400", children: labels.common.refreshing }))] })), jsx(IblPagination, { currentPage: page, totalPages: totalPages, onPageChange: setPage, disabled: busy
|
|
270048
|
+
}) })] }) }), isFetching && (jsx("p", { className: "px-3 py-2 text-xs text-gray-400", children: labels.common.refreshing }))] })), jsx(IblPagination, { currentPage: page, totalPages: totalPages, onPageChange: setPage, disabled: busy }), showCreate && (jsx(AgentLinkModal, { isOpen: showCreate, onClose: () => setShowCreate(false), platformKey: platformKey, mentorId: mentorId, mentorUniqueId: mentorUniqueId, username: username, isLtiAccessible: isLtiAccessible, labels: labels })), editingLink && (jsx(AgentLinkModal, { isOpen: Boolean(editingLink), onClose: () => setEditingLink(null), platformKey: platformKey, mentorId: mentorId, mentorUniqueId: mentorUniqueId, username: username, isLtiAccessible: isLtiAccessible, link: editingLink, labels: labels }))] }));
|
|
269150
270049
|
}
|
|
269151
270050
|
|
|
269152
270051
|
function KeyCreateModal({ isOpen, onClose, platformKey, labels }) {
|
|
@@ -269243,7 +270142,7 @@ function KeysSection({ identity, labels }) {
|
|
|
269243
270142
|
const keys = React__default.useMemo(() => toArray(keysData), [keysData]);
|
|
269244
270143
|
const totalPages = getTotalPages(keysData);
|
|
269245
270144
|
const busy = !isReady || isLoading;
|
|
269246
|
-
return (jsxs("div", { className: "space-y-4", "data-testid": "lti-keys-section", children: [jsxs("div", { className: "flex flex-col items-start justify-between gap-3 sm:flex-row sm:items-center", children: [jsx("p", { className: "text-xs text-gray-600", children: labels.keys.description }), jsxs(Button$1, { onClick: () => setShowCreate(true), size: "sm", "data-testid": "lti-key-create-button", className: "cursor-pointer whitespace-nowrap bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", children: [jsx(Plus, { className: "h-4 w-4" }), labels.keys.createButton] })] }), busy ? (jsx("div", { className: "flex w-full items-center justify-center py-10", children: jsx(Spinner, {}) })) : keys.length === 0 ? (jsxs("div", { className: "flex flex-col items-center justify-center gap-3 rounded-md border border-dashed border-gray-200 py-12 text-center", "data-testid": "lti-keys-empty", children: [jsx(KeyRound, { className: "h-8 w-8 text-gray-300", "aria-hidden": "true" }), jsx("p", { className: "text-sm text-[#646464]", children: labels.keys.empty })] })) : (jsxs("div", { className: "overflow-hidden rounded-md border", children: [jsx("div", { className: "overflow-x-auto", children: jsxs(Table$1, { className: "min-w-full", children: [jsx(TableHeader$1, { children: jsxs(TableRow$1, { className: "bg-muted/50 border-b", children: [jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: labels.common.nameColumn }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: labels.keys.publicKeyColumn }), jsx(TableHead, { className: "p-3 text-right text-sm whitespace-nowrap text-[#646464]", children: labels.common.actionsColumn })] }) }), jsx(TableBody, { children: keys.map((key) => (jsxs(TableRow$1, { "data-testid": "lti-key-row", className: "border-b last:border-0 hover:bg-muted/40", children: [jsx(TableCell$1, { className: "p-3 text-sm font-medium text-gray-900", children: key.name }), jsx(TableCell$1, { className: "p-3 font-mono text-xs text-[#646464]", children: truncateMiddle(key.public_key, 40) }), jsx(TableCell$1, { className: "p-3 text-right", children: jsxs(DropdownMenu, { children: [jsx(DropdownMenuTrigger, { asChild: true, children: jsx(Button$1, { type: "button", variant: "ghost", size: "icon", "aria-label": labels.keys.actionsAria(key.name), children: jsx(EllipsisVertical, { className: "h-4 w-4" }) }) }), jsxs(DropdownMenuContent, { align: "end", children: [jsxs(DropdownMenuItem, { onClick: () => setSelectedKey(key), children: [jsx(Pencil, { className: "mr-2 h-4 w-4" }), labels.common.edit] }), jsxs(DropdownMenuItem, { className: "text-red-600 focus:text-red-700", onClick: () => setKeyToDelete(key), children: [jsx(Trash2, { className: "mr-2 h-4 w-4" }), labels.common.delete] })] })] }) })] }, key.id))) })] }) }), isFetching && (jsx("p", { className: "px-3 py-2 text-xs text-gray-400", children: labels.common.refreshing }))] })), jsx(IblPagination, { currentPage: page, totalPages: totalPages, onPageChange: setPage, disabled: busy
|
|
270145
|
+
return (jsxs("div", { className: "space-y-4", "data-testid": "lti-keys-section", children: [jsxs("div", { className: "flex flex-col items-start justify-between gap-3 sm:flex-row sm:items-center", children: [jsx("p", { className: "text-xs text-gray-600", children: labels.keys.description }), jsxs(Button$1, { onClick: () => setShowCreate(true), size: "sm", "data-testid": "lti-key-create-button", className: "cursor-pointer whitespace-nowrap bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", children: [jsx(Plus, { className: "h-4 w-4" }), labels.keys.createButton] })] }), busy ? (jsx("div", { className: "flex w-full items-center justify-center py-10", children: jsx(Spinner, {}) })) : keys.length === 0 ? (jsxs("div", { className: "flex flex-col items-center justify-center gap-3 rounded-md border border-dashed border-gray-200 py-12 text-center", "data-testid": "lti-keys-empty", children: [jsx(KeyRound, { className: "h-8 w-8 text-gray-300", "aria-hidden": "true" }), jsx("p", { className: "text-sm text-[#646464]", children: labels.keys.empty })] })) : (jsxs("div", { className: "overflow-hidden rounded-md border", children: [jsx("div", { className: "overflow-x-auto", children: jsxs(Table$1, { className: "min-w-full", children: [jsx(TableHeader$1, { children: jsxs(TableRow$1, { className: "bg-muted/50 border-b", children: [jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: labels.common.nameColumn }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: labels.keys.publicKeyColumn }), jsx(TableHead, { className: "p-3 text-right text-sm whitespace-nowrap text-[#646464]", children: labels.common.actionsColumn })] }) }), jsx(TableBody, { children: keys.map((key) => (jsxs(TableRow$1, { "data-testid": "lti-key-row", className: "border-b last:border-0 hover:bg-muted/40", children: [jsx(TableCell$1, { className: "p-3 text-sm font-medium text-gray-900", children: key.name }), jsx(TableCell$1, { className: "p-3 font-mono text-xs text-[#646464]", children: truncateMiddle(key.public_key, 40) }), jsx(TableCell$1, { className: "p-3 text-right", children: jsxs(DropdownMenu, { children: [jsx(DropdownMenuTrigger, { asChild: true, children: jsx(Button$1, { type: "button", variant: "ghost", size: "icon", "aria-label": labels.keys.actionsAria(key.name), children: jsx(EllipsisVertical, { className: "h-4 w-4" }) }) }), jsxs(DropdownMenuContent, { align: "end", children: [jsxs(DropdownMenuItem, { onClick: () => setSelectedKey(key), children: [jsx(Pencil, { className: "mr-2 h-4 w-4" }), labels.common.edit] }), jsxs(DropdownMenuItem, { className: "text-red-600 focus:text-red-700", onClick: () => setKeyToDelete(key), children: [jsx(Trash2, { className: "mr-2 h-4 w-4" }), labels.common.delete] })] })] }) })] }, key.id))) })] }) }), isFetching && (jsx("p", { className: "px-3 py-2 text-xs text-gray-400", children: labels.common.refreshing }))] })), jsx(IblPagination, { currentPage: page, totalPages: totalPages, onPageChange: setPage, disabled: busy }), showCreate && (jsx(KeyCreateModal, { isOpen: showCreate, onClose: () => setShowCreate(false), platformKey: platformKey, labels: labels })), selectedKey && (jsx(KeyDetailModal, { isOpen: Boolean(selectedKey), onClose: () => setSelectedKey(null), platformKey: platformKey, ltiKey: selectedKey, labels: labels })), keyToDelete && (jsx(KeyDeleteModal, { isOpen: Boolean(keyToDelete), onClose: () => setKeyToDelete(null), platformKey: platformKey, ltiKey: keyToDelete, labels: labels }))] }));
|
|
269247
270146
|
}
|
|
269248
270147
|
|
|
269249
270148
|
function FieldError({ field, }) {
|
|
@@ -269382,7 +270281,7 @@ function ToolsSection({ identity, labels }) {
|
|
|
269382
270281
|
return (jsxs("div", { className: "space-y-4", "data-testid": "lti-tools-section", children: [jsxs("div", { className: "flex flex-col items-start justify-between gap-3 sm:flex-row sm:items-center", children: [jsx("p", { className: "text-xs text-gray-600", children: labels.tools.description }), jsxs(Button$1, { onClick: () => setShowCreate(true), size: "sm", "data-testid": "lti-tool-create-button", className: "cursor-pointer whitespace-nowrap bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", children: [jsx(Plus, { className: "h-4 w-4" }), labels.tools.createButton] })] }), busy ? (jsx("div", { className: "flex w-full items-center justify-center py-10", children: jsx(Spinner, {}) })) : !tools || tools.length === 0 ? (jsxs("div", { className: "flex flex-col items-center justify-center gap-3 rounded-md border border-dashed border-gray-200 py-12 text-center", "data-testid": "lti-tools-empty", children: [jsx(Wrench, { className: "h-8 w-8 text-gray-300", "aria-hidden": "true" }), jsx("p", { className: "text-sm text-[#646464]", children: labels.tools.empty })] })) : (jsxs("div", { className: "overflow-hidden rounded-md border", children: [jsx("div", { className: "overflow-x-auto", children: jsxs(Table$1, { className: "min-w-full", children: [jsx(TableHeader$1, { children: jsxs(TableRow$1, { className: "bg-muted/50 border-b", children: [jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: labels.common.nameColumn }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: labels.tools.issuerColumn }), jsx(TableHead, { className: "p-3 text-left text-sm whitespace-nowrap text-[#646464]", children: labels.tools.clientIdColumn }), jsx(TableHead, { className: "p-3 text-right text-sm whitespace-nowrap text-[#646464]", children: labels.common.actionsColumn })] }) }), jsx(TableBody, { children: tools.map((tool) => (jsxs(TableRow$1, { "data-testid": "lti-tool-row", className: "cursor-pointer border-b last:border-0 hover:bg-muted/40", onClick: () => setEditingTool(tool), children: [jsx(TableCell$1, { className: "p-3 text-sm font-medium text-gray-900", children: tool.title }), jsx(TableCell$1, { className: "max-w-[260px] truncate p-3 text-sm text-[#646464]", children: tool.issuer }), jsx(TableCell$1, { className: "max-w-[200px] truncate p-3 text-sm text-[#646464]", children: tool.client_id }), jsx(TableCell$1, { className: "p-3 text-right", children: jsx(Button$1, { type: "button", variant: "outline", size: "icon", "aria-label": labels.tools.editAria(tool.title), onClick: (event) => {
|
|
269383
270282
|
event.stopPropagation();
|
|
269384
270283
|
setEditingTool(tool);
|
|
269385
|
-
}, children: jsx(Pencil, { className: "h-4 w-4" }) }) })] }, tool.id))) })] }) }), isFetching && (jsx("p", { className: "px-3 py-2 text-xs text-gray-400", children: labels.common.refreshing }))] })), jsx(IblPagination, { currentPage: page, totalPages: totalPages, onPageChange: setPage, disabled: busy
|
|
270284
|
+
}, children: jsx(Pencil, { className: "h-4 w-4" }) }) })] }, tool.id))) })] }) }), isFetching && (jsx("p", { className: "px-3 py-2 text-xs text-gray-400", children: labels.common.refreshing }))] })), jsx(IblPagination, { currentPage: page, totalPages: totalPages, onPageChange: setPage, disabled: busy }), showCreate && (jsx(ToolModal, { isOpen: showCreate, onClose: () => setShowCreate(false), platformKey: platformKey, labels: labels })), editingTool && (jsx(ToolModal, { isOpen: Boolean(editingTool), onClose: () => setEditingTool(null), platformKey: platformKey, tool: editingTool, labels: labels }))] }));
|
|
269386
270285
|
}
|
|
269387
270286
|
|
|
269388
270287
|
function ToolEndpointsSection({ identity, labels, }) {
|
|
@@ -273031,7 +273930,15 @@ function StatusBadge({ status }) {
|
|
|
273031
273930
|
: 'bg-gray-100 text-gray-600';
|
|
273032
273931
|
return (jsx("span", { className: cn('inline-flex rounded-full px-2 py-0.5 text-xs font-medium', color), children: upper !== null && upper !== void 0 ? upper : '—' }));
|
|
273033
273932
|
}
|
|
273034
|
-
function AgentEvaluationTab({
|
|
273933
|
+
function AgentEvaluationTab({ userIsStudent: userIsStudentProp, ...props }) {
|
|
273934
|
+
var _a;
|
|
273935
|
+
const ctx = useAgentSettings();
|
|
273936
|
+
const userIsStudent = (_a = userIsStudentProp !== null && userIsStudentProp !== void 0 ? userIsStudentProp : ctx.userIsStudent) !== null && _a !== void 0 ? _a : false;
|
|
273937
|
+
if (userIsStudent)
|
|
273938
|
+
return null;
|
|
273939
|
+
return jsx(AgentEvaluationTabContent, { ...props });
|
|
273940
|
+
}
|
|
273941
|
+
function AgentEvaluationTabContent({ getLLMProviderDetails, labels: labelsOverride, PaginationComponent, }) {
|
|
273035
273942
|
var _a, _b;
|
|
273036
273943
|
const { tenantKey, mentorId, username } = useAgentSettings();
|
|
273037
273944
|
const dispatch = useDispatch();
|
|
@@ -277172,7 +278079,7 @@ const CODE_FILE_EXTENSIONS = new Set([
|
|
|
277172
278079
|
'css',
|
|
277173
278080
|
'sh',
|
|
277174
278081
|
]);
|
|
277175
|
-
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, }) {
|
|
278082
|
+
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, }) {
|
|
277176
278083
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
277177
278084
|
const t = useT();
|
|
277178
278085
|
const { metadata } = useTenantContext();
|
|
@@ -278201,7 +279108,7 @@ function Chat({ mode = 'default', isPreviewMode = false, hasBorder = true, isInC
|
|
|
278201
279108
|
!(messages.length > 0 &&
|
|
278202
279109
|
((_g = messages[messages.length - 1]) === null || _g === void 0 ? void 0 : _g.role) === 'assistant' &&
|
|
278203
279110
|
((_h = messages[messages.length - 1]) === null || _h === void 0 ? void 0 : _h.artifactVersions) &&
|
|
278204
|
-
((_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, sessionId: sessionId, onSubmit: handleSubmit, stopGenerating: stopGenerating, onScreenSharingClick: () => {
|
|
279111
|
+
((_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: () => {
|
|
278205
279112
|
var _a;
|
|
278206
279113
|
if (enableChatPopupActions && isInIframe()) {
|
|
278207
279114
|
sendMessageToParentWebsite({
|
|
@@ -278233,7 +279140,7 @@ function Chat({ mode = 'default', isPreviewMode = false, hasBorder = true, isInC
|
|
|
278233
279140
|
height: '100%',
|
|
278234
279141
|
}, 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) => {
|
|
278235
279142
|
sendMessage(activeTab, text, options);
|
|
278236
|
-
}, 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, sessionId: sessionId, onSubmit: handleSubmit, stopGenerating: stopGenerating, onScreenSharingClick: () => {
|
|
279143
|
+
}, 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: () => {
|
|
278237
279144
|
var _a;
|
|
278238
279145
|
if (enableChatPopupActions && isInIframe()) {
|
|
278239
279146
|
sendMessageToParentWebsite({
|
|
@@ -278280,7 +279187,7 @@ function Chat({ mode = 'default', isPreviewMode = false, hasBorder = true, isInC
|
|
|
278280
279187
|
(isAdvancedMode ||
|
|
278281
279188
|
isEmbeddedMode ||
|
|
278282
279189
|
(messages.length > 0 &&
|
|
278283
|
-
(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, sessionId: (_u = cachedSessionId === null || cachedSessionId === void 0 ? void 0 : cachedSessionId[mentorId]) !== null && _u !== void 0 ? _u : sessionId, onSubmit: handleSubmit, stopGenerating: stopGenerating, onScreenSharingClick: () => {
|
|
279190
|
+
(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: () => {
|
|
278284
279191
|
var _a;
|
|
278285
279192
|
if (enableChatPopupActions && isInIframe()) {
|
|
278286
279193
|
sendMessageToParentWebsite({
|
|
@@ -329589,5 +330496,5 @@ var index_es = /*#__PURE__*/Object.freeze({
|
|
|
329589
330496
|
vectorsRatio: vectorsRatio
|
|
329590
330497
|
});
|
|
329591
330498
|
|
|
329592
|
-
export { AGENT_ACCESS_TAB_LABELS, AGENT_ANALYTICS_TAB_LABELS, AGENT_API_TAB_LABELS, AGENT_DATASETS_TAB_LABELS, AGENT_DISCLAIMERS_TAB_LABELS, AGENT_EMBED_TAB_LABELS, AGENT_EVALUATION_TAB_LABELS, AGENT_GRADER_TAB_LABELS, AGENT_HISTORY_TAB_LABELS, AGENT_HUMAN_SUPPORT_TAB_LABELS, AGENT_LLM_TAB_LABELS, AGENT_LTI_TAB_LABELS, AGENT_MEMORY_TAB_LABELS, AGENT_PICKER_LABELS, AGENT_PRIVACY_TAB_LABELS, AGENT_PROMPTS_TAB_LABELS, AGENT_SAFETY_TAB_LABELS, AGENT_SCREENSHARE_TAB_LABELS, AGENT_SEARCH_LABELS, AGENT_SETTINGS_TAB_LABELS, AGENT_TASKS_TAB_LABELS, AGENT_TOOLS_TAB_LABELS, AGENT_VOICE_TAB_LABELS, Account, AgentAccessTab, AgentAnalyticsTab, AgentApiTab, AgentCard, AgentDatasetsTab, AgentDisclaimersTab, AgentEmbedTab, AgentEmptyState, AgentEvaluationTab, AgentGraderTab, AgentHistoryTab, AgentHumanSupportTab, AgentLLMTab, AgentLtiTab, AgentMemoryTab, AgentPrivacyTab, AgentPromptsTab, AgentSafetyTab, AgentScreenShareTab, AgentSearch, AgentSearchFilters, AgentSearchInput, AgentSettingsProvider, AgentSettingsTab, AgentTasksTab, AgentToolsTab, AgentVoiceTab, AppSidebar, CATALOGS, Chat, ClientErrorPage, ConversationStarters$1 as ConversationStarters, CopyButton, CopyMentorModal, CourseBox, CourseContentLayout, CourseContentTabPage, CreatePathwayModal, CredentialDetailModal, CredentialMiniBox, DEFAULT_ANALYTICS_HUB_TABS, DEFAULT_LOCALE, DeleteMentorModal, EMPTY_PROGRAM_SETTINGS_FORM, EdxIframe, ErrorPage, GRADING_TOOL_NAME, GreetingMethod, McpTab, MediaBox, MentorSelectionGrid, NavBar, OrganizationTab, PLATFORM_SIDEBAR_FLYOUT_ITEM_COLOR, PLATFORM_SIDEBAR_FLYOUT_TITLE_COLOR, PLATFORM_SIDEBAR_NAV_ACTIVE_BG_OPEN, PLATFORM_SIDEBAR_NAV_MUTED, PathwayDetailModal, PlatformAccountSheet, PlatformSidebar, PlatformSidebarCollapsedLabelFlyout, PlatformSidebarCollapsedNavFlyout, PlatformSidebarFooter, PlatformSidebarNavDivider, PlatformSidebarNavSection, PlatformSidebarSubNavItem, ProfileInfoCards, ProfileTabs, ProgramDetailModal, ProjectsSidebarDropdown, SUPPORTED_LOCALES, SidebarInset, SidebarProvider, SidebarTrigger, SsoLogin, StarButton, UserProfileDropdown, UserProfileModal, WebContainersI18nProvider, formatDateString, getCatalog, getLLMProviderDetails, initializeLocalStorageWithObject, isValidLocale, resolveAgentPickerLabels, resolveAgentSearchLabels, resolveSettingsTabLabels, useAgentSearch, useAgentSearchWithPagination, useAgentSettings, useAgentStar, useGetChatDetails, usePlatformSidebarFooterActions, usePlatformSidebarNavCallback, useSidebar, useT, useTimeTracker, useWebContainersI18n, useWebContainersLocale };
|
|
330499
|
+
export { AGENT_ACCESS_TAB_LABELS, AGENT_ANALYTICS_TAB_LABELS, AGENT_API_TAB_LABELS, AGENT_DATASETS_TAB_LABELS, AGENT_DISCLAIMERS_TAB_LABELS, AGENT_EMBED_TAB_LABELS, AGENT_EVALUATION_TAB_LABELS, AGENT_GRADER_TAB_LABELS, AGENT_HISTORY_TAB_LABELS, AGENT_HUMAN_SUPPORT_TAB_LABELS, AGENT_LLM_TAB_LABELS, AGENT_LTI_TAB_LABELS, AGENT_MEMORY_TAB_LABELS, AGENT_PICKER_LABELS, AGENT_PRIVACY_TAB_LABELS, AGENT_PROMPTS_TAB_LABELS, AGENT_SAFETY_TAB_LABELS, AGENT_SCREENSHARE_TAB_LABELS, AGENT_SEARCH_LABELS, AGENT_SETTINGS_TAB_LABELS, AGENT_SKILLS_TAB_LABELS, AGENT_TASKS_TAB_LABELS, AGENT_TOOLS_TAB_LABELS, AGENT_VOICE_TAB_LABELS, Account, AgentAccessTab, AgentAnalyticsTab, AgentApiTab, AgentCard, AgentDatasetsTab, AgentDisclaimersTab, AgentEmbedTab, AgentEmptyState, AgentEvaluationTab, AgentGraderTab, AgentHistoryTab, AgentHumanSupportTab, AgentLLMTab, AgentLtiTab, AgentMemoryTab, AgentPrivacyTab, AgentPromptsTab, AgentSafetyTab, AgentScreenShareTab, AgentSearch, AgentSearchFilters, AgentSearchInput, AgentSettingsProvider, AgentSettingsTab, AgentSkillsTab, AgentTasksTab, AgentToolsTab, AgentVoiceTab, AppSidebar, CATALOGS, Chat, ClientErrorPage, ConversationStarters$1 as ConversationStarters, CopyButton, CopyMentorModal, CourseBox, CourseContentLayout, CourseContentTabPage, CreatePathwayModal, CredentialDetailModal, CredentialMiniBox, DEFAULT_ANALYTICS_HUB_TABS, DEFAULT_LOCALE, DeleteMentorModal, EMPTY_PROGRAM_SETTINGS_FORM, EdxIframe, ErrorPage, GRADING_TOOL_NAME, GreetingMethod, McpTab, MediaBox, MentorSelectionGrid, NavBar, OrganizationTab, PLATFORM_SIDEBAR_FLYOUT_ITEM_COLOR, PLATFORM_SIDEBAR_FLYOUT_TITLE_COLOR, PLATFORM_SIDEBAR_NAV_ACTIVE_BG_OPEN, PLATFORM_SIDEBAR_NAV_MUTED, PathwayDetailModal, PlatformAccountSheet, PlatformSidebar, PlatformSidebarCollapsedLabelFlyout, PlatformSidebarCollapsedNavFlyout, PlatformSidebarFooter, PlatformSidebarNavDivider, PlatformSidebarNavSection, PlatformSidebarSubNavItem, ProfileInfoCards, ProfileTabs, ProgramDetailModal, ProjectsSidebarDropdown, SUPPORTED_LOCALES, SidebarInset, SidebarProvider, SidebarTrigger, SsoLogin, StarButton, UserProfileDropdown, UserProfileModal, WebContainersI18nProvider, formatDateString, getCatalog, getLLMProviderDetails, initializeLocalStorageWithObject, isValidLocale, resolveAgentPickerLabels, resolveAgentSearchLabels, resolveSettingsTabLabels, useAgentSearch, useAgentSearchWithPagination, useAgentSettings, useAgentStar, useGetChatDetails, usePlatformSidebarFooterActions, usePlatformSidebarNavCallback, useSidebar, useT, useTimeTracker, useWebContainersI18n, useWebContainersLocale };
|
|
329593
330500
|
//# sourceMappingURL=index.esm.js.map
|