@memberjunction/server 5.48.0 → 5.50.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.
Files changed (127) hide show
  1. package/README.md +9 -0
  2. package/dist/auth/magicLink/MagicLinkKeys.d.ts.map +1 -1
  3. package/dist/auth/magicLink/MagicLinkKeys.js +11 -4
  4. package/dist/auth/magicLink/MagicLinkKeys.js.map +1 -1
  5. package/dist/auth/magicLink/MagicLinkRouter.js +2 -2
  6. package/dist/auth/magicLink/MagicLinkRouter.js.map +1 -1
  7. package/dist/auth/magicLink/MagicLinkService.d.ts.map +1 -1
  8. package/dist/auth/magicLink/MagicLinkService.js +4 -0
  9. package/dist/auth/magicLink/MagicLinkService.js.map +1 -1
  10. package/dist/auth/newUsers.d.ts.map +1 -1
  11. package/dist/auth/newUsers.js +6 -4
  12. package/dist/auth/newUsers.js.map +1 -1
  13. package/dist/config.d.ts +40 -0
  14. package/dist/config.d.ts.map +1 -1
  15. package/dist/config.js +12 -0
  16. package/dist/config.js.map +1 -1
  17. package/dist/context.d.ts.map +1 -1
  18. package/dist/context.js +28 -2
  19. package/dist/context.js.map +1 -1
  20. package/dist/generated/generated.d.ts +373 -6
  21. package/dist/generated/generated.d.ts.map +1 -1
  22. package/dist/generated/generated.js +1975 -39
  23. package/dist/generated/generated.js.map +1 -1
  24. package/dist/generic/ResolverBase.d.ts.map +1 -1
  25. package/dist/generic/ResolverBase.js +4 -2
  26. package/dist/generic/ResolverBase.js.map +1 -1
  27. package/dist/generic/RunViewResolver.d.ts +1 -0
  28. package/dist/generic/RunViewResolver.d.ts.map +1 -1
  29. package/dist/generic/RunViewResolver.js +12 -0
  30. package/dist/generic/RunViewResolver.js.map +1 -1
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +73 -11
  33. package/dist/index.js.map +1 -1
  34. package/dist/integration/CustomColumnPromoter.d.ts +15 -2
  35. package/dist/integration/CustomColumnPromoter.d.ts.map +1 -1
  36. package/dist/integration/CustomColumnPromoter.js +113 -11
  37. package/dist/integration/CustomColumnPromoter.js.map +1 -1
  38. package/dist/integration/EntityMapLifecycle.d.ts +66 -0
  39. package/dist/integration/EntityMapLifecycle.d.ts.map +1 -0
  40. package/dist/integration/EntityMapLifecycle.js +189 -0
  41. package/dist/integration/EntityMapLifecycle.js.map +1 -0
  42. package/dist/realtimeProxy/RealtimeProxyServer.d.ts +10 -0
  43. package/dist/realtimeProxy/RealtimeProxyServer.d.ts.map +1 -1
  44. package/dist/realtimeProxy/RealtimeProxyServer.js +67 -1
  45. package/dist/realtimeProxy/RealtimeProxyServer.js.map +1 -1
  46. package/dist/realtimeWidget/WidgetRouter.d.ts.map +1 -1
  47. package/dist/realtimeWidget/WidgetRouter.js +6 -2
  48. package/dist/realtimeWidget/WidgetRouter.js.map +1 -1
  49. package/dist/realtimeWidget/WidgetSessionService.d.ts +12 -1
  50. package/dist/realtimeWidget/WidgetSessionService.d.ts.map +1 -1
  51. package/dist/realtimeWidget/WidgetSessionService.js +23 -8
  52. package/dist/realtimeWidget/WidgetSessionService.js.map +1 -1
  53. package/dist/resolvers/AdhocQueryResolver.d.ts +17 -0
  54. package/dist/resolvers/AdhocQueryResolver.d.ts.map +1 -1
  55. package/dist/resolvers/AdhocQueryResolver.js +81 -25
  56. package/dist/resolvers/AdhocQueryResolver.js.map +1 -1
  57. package/dist/resolvers/GetDataResolver.d.ts +16 -0
  58. package/dist/resolvers/GetDataResolver.d.ts.map +1 -1
  59. package/dist/resolvers/GetDataResolver.js +26 -1
  60. package/dist/resolvers/GetDataResolver.js.map +1 -1
  61. package/dist/resolvers/IntegrationDiscoveryResolver.d.ts +53 -1
  62. package/dist/resolvers/IntegrationDiscoveryResolver.d.ts.map +1 -1
  63. package/dist/resolvers/IntegrationDiscoveryResolver.js +531 -64
  64. package/dist/resolvers/IntegrationDiscoveryResolver.js.map +1 -1
  65. package/dist/resolvers/QueryResolver.d.ts.map +1 -1
  66. package/dist/resolvers/QueryResolver.js +0 -6
  67. package/dist/resolvers/QueryResolver.js.map +1 -1
  68. package/dist/resolvers/RSUResolver.d.ts +10 -0
  69. package/dist/resolvers/RSUResolver.d.ts.map +1 -1
  70. package/dist/resolvers/RSUResolver.js +28 -0
  71. package/dist/resolvers/RSUResolver.js.map +1 -1
  72. package/dist/resolvers/RunAIAgentResolver.d.ts +9 -6
  73. package/dist/resolvers/RunAIAgentResolver.d.ts.map +1 -1
  74. package/dist/resolvers/RunAIAgentResolver.js +135 -132
  75. package/dist/resolvers/RunAIAgentResolver.js.map +1 -1
  76. package/dist/resolvers/TransactionGroupResolver.d.ts +8 -1
  77. package/dist/resolvers/TransactionGroupResolver.d.ts.map +1 -1
  78. package/dist/resolvers/TransactionGroupResolver.js +29 -1
  79. package/dist/resolvers/TransactionGroupResolver.js.map +1 -1
  80. package/dist/resolvers/adhoc-query-helpers.d.ts +27 -0
  81. package/dist/resolvers/adhoc-query-helpers.d.ts.map +1 -0
  82. package/dist/resolvers/adhoc-query-helpers.js +42 -0
  83. package/dist/resolvers/adhoc-query-helpers.js.map +1 -0
  84. package/dist/rest/OAuthCallbackHandler.d.ts +9 -0
  85. package/dist/rest/OAuthCallbackHandler.d.ts.map +1 -1
  86. package/dist/rest/OAuthCallbackHandler.js +21 -4
  87. package/dist/rest/OAuthCallbackHandler.js.map +1 -1
  88. package/dist/telephony/media-upgrade-router.d.ts +14 -0
  89. package/dist/telephony/media-upgrade-router.d.ts.map +1 -1
  90. package/dist/telephony/media-upgrade-router.js +17 -1
  91. package/dist/telephony/media-upgrade-router.js.map +1 -1
  92. package/package.json +91 -89
  93. package/src/__tests__/AdhocQueryResolver.pagination.test.ts +114 -0
  94. package/src/__tests__/EntityMapLifecycle.dagWarnings.test.ts +91 -0
  95. package/src/__tests__/OAuthCallbackHandler.xss.test.ts +83 -0
  96. package/src/__tests__/RealtimeProxyServer.test.ts +53 -1
  97. package/src/__tests__/WidgetSessionService.test.ts +96 -0
  98. package/src/__tests__/adhoc-query-helpers.test.ts +50 -0
  99. package/src/__tests__/magicLinkService.provisionLog.test.ts +106 -0
  100. package/src/__tests__/media-upgrade-router.test.ts +43 -0
  101. package/src/__tests__/unifiedAuth.test.ts +18 -3
  102. package/src/auth/magicLink/MagicLinkKeys.ts +12 -6
  103. package/src/auth/magicLink/MagicLinkRouter.ts +2 -2
  104. package/src/auth/magicLink/MagicLinkService.ts +4 -0
  105. package/src/auth/newUsers.ts +6 -5
  106. package/src/config.ts +14 -0
  107. package/src/context.ts +28 -2
  108. package/src/generated/generated.ts +1385 -28
  109. package/src/generic/ResolverBase.ts +5 -2
  110. package/src/generic/RunViewResolver.ts +11 -0
  111. package/src/index.ts +75 -11
  112. package/src/integration/CustomColumnPromoter.ts +123 -6
  113. package/src/integration/EntityMapLifecycle.ts +221 -0
  114. package/src/realtimeProxy/RealtimeProxyServer.ts +70 -1
  115. package/src/realtimeWidget/WidgetRouter.ts +6 -2
  116. package/src/realtimeWidget/WidgetSessionService.ts +24 -8
  117. package/src/resolvers/AdhocQueryResolver.ts +97 -30
  118. package/src/resolvers/GetDataResolver.ts +30 -1
  119. package/src/resolvers/IntegrationDiscoveryResolver.ts +523 -64
  120. package/src/resolvers/QueryResolver.ts +1 -7
  121. package/src/resolvers/RSUResolver.ts +28 -0
  122. package/src/resolvers/RunAIAgentResolver.ts +74 -70
  123. package/src/resolvers/TransactionGroupResolver.ts +36 -2
  124. package/src/resolvers/__tests__/GetDataResolver.tokens.test.ts +138 -0
  125. package/src/resolvers/adhoc-query-helpers.ts +50 -0
  126. package/src/rest/OAuthCallbackHandler.ts +22 -4
  127. package/src/telephony/media-upgrade-router.ts +18 -1
@@ -18,7 +18,7 @@ import { mj_core_schema } from '../config.js';
18
18
 
19
19
 
20
20
 
21
- import { MJAccessControlRuleEntity, MJActionAuthorizationEntity, MJActionCategoryEntity, MJActionContextTypeEntity, MJActionContextEntity, MJActionExecutionLogEntity, MJActionFilterEntity, MJActionLibraryEntity, MJActionParamEntity, MJActionResultCodeEntity, MJActionEntity, MJAIActionEntity, MJAIAgentActionEntity, MJAIAgentArtifactTypeEntity, MJAIAgentCategoryEntity, MJAIAgentChannelEntity, MJAIAgentClientToolEntity, MJAIAgentCoAgentEntity, MJAIAgentConfigurationEntity, MJAIAgentDataSourceEntity, MJAIAgentExampleEntity, MJAIAgentLearningCycleEntity, MJAIAgentModalityEntity, MJAIAgentModelEntity, MJAIAgentNoteTypeEntity, MJAIAgentNoteEntity, MJAIAgentPermissionEntity, MJAIAgentPromptEntity, MJAIAgentRelationshipEntity, MJAIAgentRequestTypeEntity, MJAIAgentRequestEntity, MJAIAgentRunMediaEntity, MJAIAgentRunStepEntity, MJAIAgentRunEntity, MJAIAgentSearchScopeEntity, MJAIAgentSessionBridgeParticipantEntity, MJAIAgentSessionBridgeEntity, MJAIAgentSessionChannelEntity, MJAIAgentSessionEntity, MJAIAgentSkillEntity, MJAIAgentStepPathEntity, MJAIAgentStepEntity, MJAIAgentTypeEntity, MJAIAgentEntity, MJAIArchitectureEntity, MJAIBridgeAgentIdentityEntity, MJAIBridgeProviderChannelEntity, MJAIBridgeProviderEntity, MJAIClientToolDefinitionEntity, MJAIConfigurationParamEntity, MJAIConfigurationEntity, MJAICredentialBindingEntity, MJAIModalityEntity, MJAIModelActionEntity, MJAIModelArchitectureEntity, MJAIModelCostEntity, MJAIModelModalityEntity, MJAIModelPriceTypeEntity, MJAIModelPriceUnitTypeEntity, MJAIModelTypeEntity, MJAIModelVendorEntity, MJAIModelEntity, MJAIPromptCategoryEntity, MJAIPromptModelEntity, MJAIPromptRunMediaEntity, MJAIPromptRunEntity, MJAIPromptTypeEntity, MJAIPromptEntity, MJAIRemoteBrowserProviderEntity, MJAIResultCacheEntity, MJAISkillActionEntity, MJAISkillPermissionEntity, MJAISkillSubAgentEntity, MJAISkillEntity, MJAIVendorTypeDefinitionEntity, MJAIVendorTypeEntity, MJAIVendorEntity, MJAPIApplicationScopeEntity, MJAPIApplicationEntity, MJAPIKeyApplicationEntity, MJAPIKeyScopeEntity, MJAPIKeyUsageLogEntity, MJAPIKeyEntity, MJAPIScopeEntity, MJApplicationEntityEntity, MJApplicationRoleEntity, MJApplicationSettingEntity, MJApplicationEntity, MJArchiveConfigurationEntityEntity, MJArchiveConfigurationEntity, MJArchiveRunDetailEntity, MJArchiveRunEntity, MJArtifactPermissionEntity, MJArtifactTypeEntity, MJArtifactUseEntity, MJArtifactVersionAttributeEntity, MJArtifactVersionEntity, MJArtifactEntity, MJAuditLogTypeEntity, MJAuditLogEntity, MJAuthorizationRoleEntity, MJAuthorizationEntity, MJClusterAnalysisEntity, MJClusterAnalysisClusterEntity, MJCollectionArtifactEntity, MJCollectionPermissionEntity, MJCollectionEntity, MJCommunicationBaseMessageTypeEntity, MJCommunicationLogEntity, MJCommunicationProviderMessageTypeEntity, MJCommunicationProviderEntity, MJCommunicationRunEntity, MJCompanyEntity, MJCompanyIntegrationEntityMapEntity, MJCompanyIntegrationFieldMapEntity, MJCompanyIntegrationRecordMapEntity, MJCompanyIntegrationRunAPILogEntity, MJCompanyIntegrationRunDetailEntity, MJCompanyIntegrationRunEntity, MJCompanyIntegrationSyncWatermarkEntity, MJCompanyIntegrationEntity, MJComponentDependencyEntity, MJComponentLibraryEntity, MJComponentLibraryLinkEntity, MJComponentRegistryEntity, MJComponentEntity, MJContentFileTypeEntity, MJContentItemAttributeEntity, MJContentItemDuplicateEntity, MJContentItemTagEntity, MJContentItemEntity, MJContentProcessRunDetailEntity, MJContentProcessRunPromptRunEntity, MJContentProcessRunEntity, MJContentSourceParamEntity, MJContentSourceTypeParamEntity, MJContentSourceTypeEntity, MJContentSourceEntity, MJContentTypeAttributeEntity, MJContentTypeEntity, MJConversationArtifactPermissionEntity, MJConversationArtifactVersionEntity, MJConversationArtifactEntity, MJConversationDetailArtifactEntity, MJConversationDetailAttachmentEntity, MJConversationDetailRatingEntity, MJConversationDetailEntity, MJConversationWidgetInstanceEntity, MJConversationEntity, MJCountryEntity, MJCredentialCategoryEntity, MJCredentialTypeEntity, MJCredentialEntity, MJDashboardCategoryEntity, MJDashboardCategoryLinkEntity, MJDashboardCategoryPermissionEntity, MJDashboardPartTypeEntity, MJDashboardPermissionEntity, MJDashboardUserPreferenceEntity, MJDashboardUserStateEntity, MJDashboardEntity, MJDataContextItemEntity, MJDataContextEntity, MJDatasetItemEntity, MJDatasetEntity, MJDuplicateRunDetailMatchEntity, MJDuplicateRunDetailEntity, MJDuplicateRunEntity, MJEmployeeCompanyIntegrationEntity, MJEmployeeRoleEntity, MJEmployeeSkillEntity, MJEmployeeEntity, MJEncryptionAlgorithmEntity, MJEncryptionKeySourceEntity, MJEncryptionKeyEntity, MJEntityEntity, MJEntityActionFilterEntity, MJEntityActionInvocationTypeEntity, MJEntityActionInvocationEntity, MJEntityActionParamEntity, MJEntityActionEntity, MJEntityAIActionEntity, MJEntityCommunicationFieldEntity, MJEntityCommunicationMessageTypeEntity, MJEntityDocumentRunEntity, MJEntityDocumentSettingEntity, MJEntityDocumentTypeEntity, MJEntityDocumentEntity, MJEntityFieldValueEntity, MJEntityFieldEntity, MJEntityFormOverrideEntity, MJEntityOrganicKeyRelatedEntityEntity, MJEntityOrganicKeyEntity, MJEntityPermissionEntity, MJEntityRecordDocumentEntity, MJEntityRelationshipDisplayComponentEntity, MJEntityRelationshipEntity, MJEntitySettingEntity, MJEnvironmentEntity, MJErrorLogEntity, MJExperimentSessionIterationEntity, MJExperimentSessionEntity, MJExperimentEntity, MJExplorerNavigationItemEntity, MJExternalDataSourceTypeEntity, MJExternalDataSourceEntity, MJFileCategoryEntity, MJFileEntityRecordLinkEntity, MJFileStorageAccountPermissionEntity, MJFileStorageAccountEntity, MJFileStorageProviderEntity, MJFileEntity, MJGeneratedCodeCategoryEntity, MJGeneratedCodeEntity, MJInstanceConfigurationEntity, MJIntegrationObjectFieldEntity, MJIntegrationObjectEntity, MJIntegrationSourceTypeEntity, MJIntegrationURLFormatEntity, MJIntegrationEntity, MJKnowledgeHubSavedSearchEntity, MJLibraryEntity, MJLibraryItemEntity, MJListCategoryEntity, MJListDetailEntity, MJListInvitationEntity, MJListShareEntity, MJListEntity, MJMagicLinkInviteAllowedDomainEntity, MJMagicLinkInviteAllowedPathEntity, MJMagicLinkInviteApplicationEntity, MJMagicLinkInviteRoleEntity, MJMagicLinkInviteEntity, MJMagicLinkRedemptionEntity, MJMCPServerConnectionPermissionEntity, MJMCPServerConnectionToolEntity, MJMCPServerConnectionEntity, MJMCPServerToolEntity, MJMCPServerEntity, MJMCPToolExecutionLogEntity, MJMCPToolFavoriteEntity, MJMLAlgorithmUseCaseRankingEntity, MJMLAlgorithmUseCaseEntity, MJMLAlgorithmEntity, MJMLModelScoringBindingEntity, MJMLModelEntity, MJMLTrainingPipelineEntity, MJMLTrainingRunEntity, MJOAuthAuthServerMetadataCacheEntity, MJOAuthAuthorizationStateEntity, MJOAuthClientRegistrationEntity, MJOAuthTokenEntity, MJOpenAppDependencyEntity, MJOpenAppInstallHistoryEntity, MJOpenAppEntity, MJOutputDeliveryTypeEntity, MJOutputFormatTypeEntity, MJOutputTriggerTypeEntity, MJPermissionDomainEntity, MJProcessRunDetailEntity, MJProcessRunEntity, MJProjectEntity, MJPublicLinkEntity, MJQueryEntity, MJQueryCategoryEntity, MJQueryDependencyEntity, MJQueryEntityEntity, MJQueryFieldEntity, MJQueryParameterEntity, MJQueryPermissionEntity, MJQuerySQLEntity, MJQueueTaskEntity, MJQueueTypeEntity, MJQueueEntity, MJRecommendationItemEntity, MJRecommendationProviderEntity, MJRecommendationRunEntity, MJRecommendationEntity, MJRecordChangeReplayRunEntity, MJRecordChangeEntity, MJRecordGeoCodeEntity, MJRecordLinkEntity, MJRecordMergeDeletionLogEntity, MJRecordMergeLogEntity, MJRecordProcessCategoryEntity, MJRecordProcessWatermarkEntity, MJRecordProcessEntity, MJRemoteOperationCategoryEntity, MJRemoteOperationEntity, MJReportCategoryEntity, MJReportSnapshotEntity, MJReportUserStateEntity, MJReportVersionEntity, MJReportEntity, MJResourceLinkEntity, MJResourcePermissionEntity, MJResourceTypeEntity, MJRoleEntity, MJRowLevelSecurityFilterEntity, MJScheduledActionParamEntity, MJScheduledActionEntity, MJScheduledJobRunEntity, MJScheduledJobTypeEntity, MJScheduledJobEntity, MJSchemaInfoEntity, MJScopedPromptConfigEntity, MJScopedPromptPartEntity, MJSearchExecutionLogEntity, MJSearchProviderEntity, MJSearchScopeEntityEntity, MJSearchScopeExternalIndexEntity, MJSearchScopePermissionEntity, MJSearchScopeProviderEntity, MJSearchScopeStorageAccountEntity, MJSearchScopeTestQueryEntity, MJSearchScopeEntity, MJSignatureAccountEntity, MJSignatureProviderEntity, MJSignatureRequestDocumentEntity, MJSignatureRequestLogEntity, MJSignatureRequestRecipientEntity, MJSignatureRequestEntity, MJSkillEntity, MJSQLDialectEntity, MJStateProvinceEntity, MJTagAuditLogEntity, MJTagCoOccurrenceEntity, MJTagScopeEntity, MJTagSuggestionEntity, MJTagSynonymEntity, MJTaggedItemEntity, MJTagEntity, MJTaskDependencyEntity, MJTaskTypeEntity, MJTaskEntity, MJTemplateCategoryEntity, MJTemplateContentTypeEntity, MJTemplateContentEntity, MJTemplateParamEntity, MJTemplateEntity, MJTestRubricEntity, MJTestRunFeedbackEntity, MJTestRunOutputTypeEntity, MJTestRunOutputEntity, MJTestRunEntity, MJTestSuiteRunEntity, MJTestSuiteTestEntity, MJTestSuiteEntity, MJTestTypeEntity, MJTestEntity, MJUserApplicationEntityEntity, MJUserApplicationEntity, MJUserFavoriteEntity, MJUserNotificationPreferenceEntity, MJUserNotificationTypeEntity, MJUserNotificationEntity, MJUserRecordLogEntity, MJUserRoleEntity, MJUserRoutineRecipientEntity, MJUserRoutineRunEntity, MJUserRoutineEntity, MJUserSettingEntity, MJUserViewCategoryEntity, MJUserViewRunDetailEntity, MJUserViewRunEntity, MJUserViewEntity, MJUserEntity, MJVectorDatabaseEntity, MJVectorIndexEntity, MJVersionInstallationEntity, MJVersionLabelItemEntity, MJVersionLabelRestoreEntity, MJVersionLabelEntity, MJViewTypeEntity, MJWorkflowEngineEntity, MJWorkflowRunEntity, MJWorkflowEntity, MJWorkspaceItemEntity, MJWorkspaceEntity } from '@memberjunction/core-entities';
21
+ import { MJAccessControlRuleEntity, MJActionAuthorizationEntity, MJActionCategoryEntity, MJActionContextTypeEntity, MJActionContextEntity, MJActionExecutionLogEntity, MJActionFilterEntity, MJActionLibraryEntity, MJActionParamEntity, MJActionResultCodeEntity, MJActionEntity, MJAIActionEntity, MJAIAgentActionEntity, MJAIAgentArtifactTypeEntity, MJAIAgentCategoryEntity, MJAIAgentChannelEntity, MJAIAgentClientToolEntity, MJAIAgentCoAgentEntity, MJAIAgentConfigurationEntity, MJAIAgentDataSourceEntity, MJAIAgentExampleEntity, MJAIAgentLearningCycleEntity, MJAIAgentModalityEntity, MJAIAgentModelEntity, MJAIAgentNoteTypeEntity, MJAIAgentNoteEntity, MJAIAgentPermissionEntity, MJAIAgentPromptEntity, MJAIAgentRelationshipEntity, MJAIAgentRequestTypeEntity, MJAIAgentRequestEntity, MJAIAgentRunMediaEntity, MJAIAgentRunStepEntity, MJAIAgentRunEntity, MJAIAgentSearchScopeEntity, MJAIAgentSessionBridgeParticipantEntity, MJAIAgentSessionBridgeEntity, MJAIAgentSessionChannelEntity, MJAIAgentSessionEntity, MJAIAgentSkillEntity, MJAIAgentStepPathEntity, MJAIAgentStepEntity, MJAIAgentTypeEntity, MJAIAgentEntity, MJAIArchitectureEntity, MJAIBridgeAgentIdentityEntity, MJAIBridgeProviderChannelEntity, MJAIBridgeProviderEntity, MJAIClientToolDefinitionEntity, MJAIConfigurationParamEntity, MJAIConfigurationEntity, MJAICredentialBindingEntity, MJAIModalityEntity, MJAIModelActionEntity, MJAIModelArchitectureEntity, MJAIModelCostEntity, MJAIModelModalityEntity, MJAIModelPriceTypeEntity, MJAIModelPriceUnitTypeEntity, MJAIModelTypeEntity, MJAIModelVendorEntity, MJAIModelEntity, MJAIPromptCategoryEntity, MJAIPromptModelEntity, MJAIPromptRunMediaEntity, MJAIPromptRunEntity, MJAIPromptTypeEntity, MJAIPromptEntity, MJAIRemoteBrowserProviderEntity, MJAIResultCacheEntity, MJAISkillActionEntity, MJAISkillPermissionEntity, MJAISkillSearchScopeEntity, MJAISkillSubAgentEntity, MJAISkillEntity, MJAIVendorTypeDefinitionEntity, MJAIVendorTypeEntity, MJAIVendorEntity, MJAPIApplicationScopeEntity, MJAPIApplicationEntity, MJAPIKeyApplicationEntity, MJAPIKeyScopeEntity, MJAPIKeyUsageLogEntity, MJAPIKeyEntity, MJAPIScopeEntity, MJApplicationEntityEntity, MJApplicationRoleEntity, MJApplicationSettingEntity, MJApplicationEntity, MJArchiveConfigurationEntityEntity, MJArchiveConfigurationEntity, MJArchiveRunDetailEntity, MJArchiveRunEntity, MJArtifactPermissionEntity, MJArtifactTypeEntity, MJArtifactUseEntity, MJArtifactVersionAttributeEntity, MJArtifactVersionEntity, MJArtifactEntity, MJAuditLogTypeEntity, MJAuditLogEntity, MJAuthorizationRoleEntity, MJAuthorizationEntity, MJClusterAnalysisEntity, MJClusterAnalysisClusterEntity, MJCollectionArtifactEntity, MJCollectionPermissionEntity, MJCollectionEntity, MJCommunicationBaseMessageTypeEntity, MJCommunicationLogEntity, MJCommunicationProviderMessageTypeEntity, MJCommunicationProviderEntity, MJCommunicationRunEntity, MJCompanyEntity, MJCompanyIntegrationEntityMapEntity, MJCompanyIntegrationFieldMapEntity, MJCompanyIntegrationRecordMapEntity, MJCompanyIntegrationRunAPILogEntity, MJCompanyIntegrationRunDetailEntity, MJCompanyIntegrationRunEntity, MJCompanyIntegrationSyncWatermarkEntity, MJCompanyIntegrationEntity, MJComponentDependencyEntity, MJComponentLibraryEntity, MJComponentLibraryLinkEntity, MJComponentRegistryEntity, MJComponentEntity, MJContentFileTypeEntity, MJContentItemAttributeEntity, MJContentItemChunkEntity, MJContentItemDuplicateEntity, MJContentItemTagEntity, MJContentItemEntity, MJContentProcessRunDetailEntity, MJContentProcessRunPromptRunEntity, MJContentProcessRunEntity, MJContentSourceParamEntity, MJContentSourceTypeParamEntity, MJContentSourceTypeEntity, MJContentSourceEntity, MJContentTypeAttributeEntity, MJContentTypeEntity, MJConversationArtifactPermissionEntity, MJConversationArtifactVersionEntity, MJConversationArtifactEntity, MJConversationCompactionRunEntity, MJConversationDetailArtifactEntity, MJConversationDetailAttachmentEntity, MJConversationDetailRatingEntity, MJConversationDetailEntity, MJConversationWidgetInstanceEntity, MJConversationEntity, MJCountryEntity, MJCredentialCategoryEntity, MJCredentialTypeEntity, MJCredentialEntity, MJDashboardCategoryEntity, MJDashboardCategoryLinkEntity, MJDashboardCategoryPermissionEntity, MJDashboardPartTypeEntity, MJDashboardPermissionEntity, MJDashboardUserPreferenceEntity, MJDashboardUserStateEntity, MJDashboardEntity, MJDataContextItemEntity, MJDataContextEntity, MJDatasetItemEntity, MJDatasetEntity, MJDuplicateRunDetailMatchEntity, MJDuplicateRunDetailEntity, MJDuplicateRunEntity, MJEmployeeCompanyIntegrationEntity, MJEmployeeRoleEntity, MJEmployeeSkillEntity, MJEmployeeEntity, MJEncryptionAlgorithmEntity, MJEncryptionKeySourceEntity, MJEncryptionKeyEntity, MJEntityEntity, MJEntityActionFilterEntity, MJEntityActionInvocationTypeEntity, MJEntityActionInvocationEntity, MJEntityActionParamEntity, MJEntityActionEntity, MJEntityAIActionEntity, MJEntityCommunicationFieldEntity, MJEntityCommunicationMessageTypeEntity, MJEntityDocumentRunEntity, MJEntityDocumentSettingEntity, MJEntityDocumentTypeEntity, MJEntityDocumentEntity, MJEntityFieldValueEntity, MJEntityFieldEntity, MJEntityFormOverrideEntity, MJEntityOrganicKeyRelatedEntityEntity, MJEntityOrganicKeyEntity, MJEntityPermissionEntity, MJEntityRecordDocumentEntity, MJEntityRelationshipDisplayComponentEntity, MJEntityRelationshipEntity, MJEntitySettingEntity, MJEnvironmentEntity, MJErrorLogEntity, MJExperimentSessionIterationEntity, MJExperimentSessionEntity, MJExperimentEntity, MJExplorerNavigationItemEntity, MJExternalDataSourceTypeEntity, MJExternalDataSourceEntity, MJFileCategoryEntity, MJFileEntityRecordLinkEntity, MJFileStorageAccountPermissionEntity, MJFileStorageAccountEntity, MJFileStorageProviderEntity, MJFileEntity, MJGeneratedCodeCategoryEntity, MJGeneratedCodeEntity, MJInstanceConfigurationEntity, MJIntegrationObjectFieldEntity, MJIntegrationObjectEntity, MJIntegrationSourceTypeEntity, MJIntegrationURLFormatEntity, MJIntegrationEntity, MJKnowledgeHubSavedSearchEntity, MJLibraryEntity, MJLibraryItemEntity, MJListCategoryEntity, MJListDetailEntity, MJListInvitationEntity, MJListShareEntity, MJListEntity, MJMagicLinkInviteAllowedDomainEntity, MJMagicLinkInviteAllowedPathEntity, MJMagicLinkInviteApplicationEntity, MJMagicLinkInviteRoleEntity, MJMagicLinkInviteEntity, MJMagicLinkRedemptionEntity, MJMCPServerConnectionPermissionEntity, MJMCPServerConnectionToolEntity, MJMCPServerConnectionEntity, MJMCPServerToolEntity, MJMCPServerEntity, MJMCPToolExecutionLogEntity, MJMCPToolFavoriteEntity, MJMLAlgorithmUseCaseRankingEntity, MJMLAlgorithmUseCaseEntity, MJMLAlgorithmEntity, MJMLModelScoringBindingEntity, MJMLModelEntity, MJMLTrainingPipelineEntity, MJMLTrainingRunEntity, MJOAuthAuthServerMetadataCacheEntity, MJOAuthAuthorizationStateEntity, MJOAuthClientRegistrationEntity, MJOAuthTokenEntity, MJOpenAppDependencyEntity, MJOpenAppInstallHistoryEntity, MJOpenAppEntity, MJOutputDeliveryTypeEntity, MJOutputFormatTypeEntity, MJOutputTriggerTypeEntity, MJPermissionDomainEntity, MJProcessRunDetailEntity, MJProcessRunEntity, MJProjectEntity, MJPublicLinkEntity, MJQueryEntity, MJQueryCategoryEntity, MJQueryDependencyEntity, MJQueryEntityEntity, MJQueryFieldEntity, MJQueryParameterEntity, MJQueryPermissionEntity, MJQuerySQLEntity, MJQueueTaskEntity, MJQueueTypeEntity, MJQueueEntity, MJRecommendationItemEntity, MJRecommendationProviderEntity, MJRecommendationRunEntity, MJRecommendationEntity, MJRecordChangeReplayRunEntity, MJRecordChangeEntity, MJRecordGeoCodeEntity, MJRecordLinkEntity, MJRecordMergeDeletionLogEntity, MJRecordMergeLogEntity, MJRecordProcessCategoryEntity, MJRecordProcessWatermarkEntity, MJRecordProcessEntity, MJRemoteOperationCategoryEntity, MJRemoteOperationEntity, MJReportCategoryEntity, MJReportSnapshotEntity, MJReportUserStateEntity, MJReportVersionEntity, MJReportEntity, MJResourceLinkEntity, MJResourcePermissionEntity, MJResourceTypeEntity, MJRoleEntity, MJRowLevelSecurityFilterEntity, MJScheduledActionParamEntity, MJScheduledActionEntity, MJScheduledJobRunEntity, MJScheduledJobTypeEntity, MJScheduledJobEntity, MJSchemaInfoEntity, MJScopedPromptConfigEntity, MJScopedPromptPartEntity, MJSearchExecutionLogEntity, MJSearchProviderEntity, MJSearchScopeEntityEntity, MJSearchScopeExternalIndexEntity, MJSearchScopePermissionEntity, MJSearchScopeProviderEntity, MJSearchScopeStorageAccountEntity, MJSearchScopeTestQueryEntity, MJSearchScopeEntity, MJSignatureAccountEntity, MJSignatureProviderEntity, MJSignatureRequestDocumentEntity, MJSignatureRequestLogEntity, MJSignatureRequestRecipientEntity, MJSignatureRequestEntity, MJSkillEntity, MJSQLDialectEntity, MJStateProvinceEntity, MJTagAuditLogEntity, MJTagCoOccurrenceEntity, MJTagScopeEntity, MJTagSuggestionEntity, MJTagSynonymEntity, MJTaggedItemEntity, MJTagEntity, MJTaskDependencyEntity, MJTaskTypeEntity, MJTaskEntity, MJTemplateCategoryEntity, MJTemplateContentTypeEntity, MJTemplateContentEntity, MJTemplateParamEntity, MJTemplateEntity, MJTestRubricEntity, MJTestRunFeedbackEntity, MJTestRunOutputTypeEntity, MJTestRunOutputEntity, MJTestRunEntity, MJTestSuiteRunEntity, MJTestSuiteTestEntity, MJTestSuiteEntity, MJTestTypeEntity, MJTestEntity, MJThemeEntity, MJUserApplicationEntityEntity, MJUserApplicationEntity, MJUserFavoriteEntity, MJUserNotificationPreferenceEntity, MJUserNotificationTypeEntity, MJUserNotificationEntity, MJUserRecordLogEntity, MJUserRoleEntity, MJUserRoutineRecipientEntity, MJUserRoutineRunEntity, MJUserRoutineEntity, MJUserSettingEntity, MJUserViewCategoryEntity, MJUserViewRunDetailEntity, MJUserViewRunEntity, MJUserViewEntity, MJUserEntity, MJVectorDatabaseEntity, MJVectorIndexEntity, MJVersionInstallationEntity, MJVersionLabelItemEntity, MJVersionLabelRestoreEntity, MJVersionLabelEntity, MJViewTypeEntity, MJWorkflowEngineEntity, MJWorkflowRunEntity, MJWorkflowEntity, MJWorkspaceItemEntity, MJWorkspaceEntity } from '@memberjunction/core-entities';
22
22
 
23
23
 
24
24
  //****************************************************************************
@@ -8223,9 +8223,6 @@ each time the agent processes a prompt step.`})
8223
8223
  @Field(() => [MJAIAgentRequest_])
8224
8224
  MJAIAgentRequests_ResumingAgentRunIDArray: MJAIAgentRequest_[]; // Link to MJAIAgentRequests
8225
8225
 
8226
- @Field(() => [MJAIPromptRun_])
8227
- MJAIPromptRuns_AgentRunIDArray: MJAIPromptRun_[]; // Link to MJAIPromptRuns
8228
-
8229
8226
  @Field(() => [MJAIAgentRun_])
8230
8227
  MJAIAgentRuns_LastRunIDArray: MJAIAgentRun_[]; // Link to MJAIAgentRuns
8231
8228
 
@@ -8689,16 +8686,6 @@ export class MJAIAgentRunResolver extends ResolverBase {
8689
8686
  return result;
8690
8687
  }
8691
8688
 
8692
- @FieldResolver(() => [MJAIPromptRun_])
8693
- async MJAIPromptRuns_AgentRunIDArray(@Root() mjaiagentrun_: MJAIAgentRun_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
8694
- this.CheckUserReadPermissions('MJ: AI Prompt Runs', userPayload);
8695
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
8696
- const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwAIPromptRuns')} WHERE ${provider.QuoteIdentifier('AgentRunID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Prompt Runs', userPayload, EntityPermissionType.Read, 'AND');
8697
- const rows = await provider.ExecuteSQL(sSQL, [mjaiagentrun_.ID], undefined, this.GetUserFromPayload(userPayload));
8698
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: AI Prompt Runs', rows, this.GetUserFromPayload(userPayload));
8699
- return result;
8700
- }
8701
-
8702
8689
  @FieldResolver(() => [MJAIAgentRun_])
8703
8690
  async MJAIAgentRuns_LastRunIDArray(@Root() mjaiagentrun_: MJAIAgentRun_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
8704
8691
  this.CheckUserReadPermissions('MJ: AI Agent Runs', userPayload);
@@ -10913,6 +10900,29 @@ export class MJAIAgentType_ {
10913
10900
  @Field({nullable: true, description: `Type-level DEFAULT configuration JSON for agents of this type — the base layer of the effective-configuration merge: type DefaultConfiguration <- agent TypeConfiguration <- runtime overrides (later layers win per key, deep-merged). Must itself conform to ConfigSchema when one is published. Null = no type defaults.`})
10914
10901
  DefaultConfiguration?: string;
10915
10902
 
10903
+ @Field(() => Int, {nullable: true, description: `Type-level default for the in-turn context-compression message-count threshold. Overridable per agent via AIAgent.ContextCompressionMessageThreshold.`})
10904
+ ContextCompressionMessageThreshold?: number;
10905
+
10906
+ @Field({nullable: true, description: `Type-level default prompt used for in-turn context compression. Overridable per agent via AIAgent.ContextCompressionPromptID.`})
10907
+ @MaxLength(36)
10908
+ ContextCompressionPromptID?: string;
10909
+
10910
+ @Field(() => Int, {nullable: true, description: `Type-level default for the number of most-recent messages kept uncompressed (the "hot tail") when context compression is applied. Overridable per agent via AIAgent.ContextCompressionMessageRetentionCount.`})
10911
+ ContextCompressionMessageRetentionCount?: number;
10912
+
10913
+ @Field(() => Int, {nullable: true, description: `Type-level default effective working-context budget, in tokens. Null means use the selected model's MaxInputTokens. The resolved value is clamped to the model's limit at runtime (a warning is logged if it would exceed it). Overridable per agent via AIAgent.ContextWindowMaxTokens.`})
10914
+ ContextWindowMaxTokens?: number;
10915
+
10916
+ @Field(() => Int, {description: `Type-level default: the percentage of the effective context budget at which cross-turn conversation compaction is triggered. Defaults to 75. Overridable per agent via AIAgent.CompactionTriggerPercent.`})
10917
+ CompactionTriggerPercent: number;
10918
+
10919
+ @Field(() => Int, {description: `Type-level default: the target percentage of the effective context budget to reduce to after a cross-turn compaction. Defaults to 30. Overridable per agent via AIAgent.CompactionTargetPercent.`})
10920
+ CompactionTargetPercent: number;
10921
+
10922
+ @Field({nullable: true, description: `Type-level default prompt used for cross-turn conversation compaction (the durable summary baseline). Distinct from ContextCompressionPromptID, which governs in-turn compression. Overridable per agent via AIAgent.ConversationSummaryPromptID.`})
10923
+ @MaxLength(36)
10924
+ ConversationSummaryPromptID?: string;
10925
+
10916
10926
  @Field({nullable: true})
10917
10927
  @MaxLength(255)
10918
10928
  SystemPrompt?: string;
@@ -10921,6 +10931,14 @@ export class MJAIAgentType_ {
10921
10931
  @MaxLength(200)
10922
10932
  DefaultStorageAccount?: string;
10923
10933
 
10934
+ @Field({nullable: true})
10935
+ @MaxLength(255)
10936
+ ContextCompressionPrompt?: string;
10937
+
10938
+ @Field({nullable: true})
10939
+ @MaxLength(255)
10940
+ ConversationSummaryPrompt?: string;
10941
+
10924
10942
  @Field(() => [MJAIAgentCoAgent_])
10925
10943
  MJAIAgentCoAgents_TargetAgentTypeIDArray: MJAIAgentCoAgent_[]; // Link to MJAIAgentCoAgents
10926
10944
 
@@ -10979,6 +10997,27 @@ export class CreateMJAIAgentTypeInput {
10979
10997
  @Field({ nullable: true })
10980
10998
  DefaultConfiguration: string | null;
10981
10999
 
11000
+ @Field(() => Int, { nullable: true })
11001
+ ContextCompressionMessageThreshold: number | null;
11002
+
11003
+ @Field({ nullable: true })
11004
+ ContextCompressionPromptID: string | null;
11005
+
11006
+ @Field(() => Int, { nullable: true })
11007
+ ContextCompressionMessageRetentionCount: number | null;
11008
+
11009
+ @Field(() => Int, { nullable: true })
11010
+ ContextWindowMaxTokens: number | null;
11011
+
11012
+ @Field(() => Int, { nullable: true })
11013
+ CompactionTriggerPercent?: number;
11014
+
11015
+ @Field(() => Int, { nullable: true })
11016
+ CompactionTargetPercent?: number;
11017
+
11018
+ @Field({ nullable: true })
11019
+ ConversationSummaryPromptID: string | null;
11020
+
10982
11021
  @Field(() => RestoreContextInput, { nullable: true })
10983
11022
  RestoreContext___?: RestoreContextInput;
10984
11023
  }
@@ -11034,6 +11073,27 @@ export class UpdateMJAIAgentTypeInput {
11034
11073
  @Field({ nullable: true })
11035
11074
  DefaultConfiguration?: string | null;
11036
11075
 
11076
+ @Field(() => Int, { nullable: true })
11077
+ ContextCompressionMessageThreshold?: number | null;
11078
+
11079
+ @Field({ nullable: true })
11080
+ ContextCompressionPromptID?: string | null;
11081
+
11082
+ @Field(() => Int, { nullable: true })
11083
+ ContextCompressionMessageRetentionCount?: number | null;
11084
+
11085
+ @Field(() => Int, { nullable: true })
11086
+ ContextWindowMaxTokens?: number | null;
11087
+
11088
+ @Field(() => Int, { nullable: true })
11089
+ CompactionTriggerPercent?: number;
11090
+
11091
+ @Field(() => Int, { nullable: true })
11092
+ CompactionTargetPercent?: number;
11093
+
11094
+ @Field({ nullable: true })
11095
+ ConversationSummaryPromptID?: string | null;
11096
+
11037
11097
  @Field(() => [KeyValuePairInput], { nullable: true })
11038
11098
  OldValues___?: KeyValuePairInput[];
11039
11099
 
@@ -11419,6 +11479,19 @@ if this limit is exceeded.`})
11419
11479
  @Field(() => Boolean, {description: `When 1, every root-level run of this agent executes in plan mode regardless of the per-request planMode flag — the agent must present a plan and receive human approval before any Actions or Sub-Agent steps execute. SupportsPlanMode is irrelevant when this is set. Use for high-consequence agents (e.g. ones with outbound-communication capabilities) where human-in-the-loop review is mandatory.`})
11420
11480
  RequirePlanMode: boolean;
11421
11481
 
11482
+ @Field(() => Int, {nullable: true, description: `Per-agent override for the effective working-context budget, in tokens. Null inherits the agent type's value (which, if also null, falls back to the selected model's MaxInputTokens). The resolved value is clamped to the model's limit at runtime.`})
11483
+ ContextWindowMaxTokens?: number;
11484
+
11485
+ @Field(() => Int, {nullable: true, description: `Per-agent override for the cross-turn compaction trigger percentage. Null inherits the agent type's value.`})
11486
+ CompactionTriggerPercent?: number;
11487
+
11488
+ @Field(() => Int, {nullable: true, description: `Per-agent override for the cross-turn compaction target percentage. Null inherits the agent type's value.`})
11489
+ CompactionTargetPercent?: number;
11490
+
11491
+ @Field({nullable: true, description: `Per-agent override for the cross-turn conversation compaction prompt. Null inherits the agent type's value.`})
11492
+ @MaxLength(36)
11493
+ ConversationSummaryPromptID?: string;
11494
+
11422
11495
  @Field({nullable: true})
11423
11496
  @MaxLength(255)
11424
11497
  Parent?: string;
@@ -11463,6 +11536,10 @@ if this limit is exceeded.`})
11463
11536
  @MaxLength(255)
11464
11537
  DefaultMediaCollection?: string;
11465
11538
 
11539
+ @Field({nullable: true})
11540
+ @MaxLength(255)
11541
+ ConversationSummaryPrompt?: string;
11542
+
11466
11543
  @Field({nullable: true})
11467
11544
  @MaxLength(36)
11468
11545
  RootParentID?: string;
@@ -11811,6 +11888,18 @@ export class CreateMJAIAgentInput {
11811
11888
  @Field(() => Boolean, { nullable: true })
11812
11889
  RequirePlanMode?: boolean;
11813
11890
 
11891
+ @Field(() => Int, { nullable: true })
11892
+ ContextWindowMaxTokens: number | null;
11893
+
11894
+ @Field(() => Int, { nullable: true })
11895
+ CompactionTriggerPercent: number | null;
11896
+
11897
+ @Field(() => Int, { nullable: true })
11898
+ CompactionTargetPercent: number | null;
11899
+
11900
+ @Field({ nullable: true })
11901
+ ConversationSummaryPromptID: string | null;
11902
+
11814
11903
  @Field(() => RestoreContextInput, { nullable: true })
11815
11904
  RestoreContext___?: RestoreContextInput;
11816
11905
  }
@@ -12043,6 +12132,18 @@ export class UpdateMJAIAgentInput {
12043
12132
  @Field(() => Boolean, { nullable: true })
12044
12133
  RequirePlanMode?: boolean;
12045
12134
 
12135
+ @Field(() => Int, { nullable: true })
12136
+ ContextWindowMaxTokens?: number | null;
12137
+
12138
+ @Field(() => Int, { nullable: true })
12139
+ CompactionTriggerPercent?: number | null;
12140
+
12141
+ @Field(() => Int, { nullable: true })
12142
+ CompactionTargetPercent?: number | null;
12143
+
12144
+ @Field({ nullable: true })
12145
+ ConversationSummaryPromptID?: string | null;
12146
+
12046
12147
  @Field(() => [KeyValuePairInput], { nullable: true })
12047
12148
  OldValues___?: KeyValuePairInput[];
12048
12149
 
@@ -17884,10 +17985,6 @@ export class MJAIPromptRun_ {
17884
17985
  @Field(() => Int, {nullable: true, description: `Execution order for parallel child runs and result selector runs. Used to track the sequence of execution within a parallel run group. NULL for single runs and parallel parent runs.`})
17885
17986
  ExecutionOrder?: number;
17886
17987
 
17887
- @Field({nullable: true, description: `Optional reference to the AIAgentRun that initiated this prompt execution. Links prompt runs to their parent agent runs for comprehensive execution tracking.`})
17888
- @MaxLength(36)
17889
- AgentRunID?: string;
17890
-
17891
17988
  @Field(() => Float, {nullable: true, description: `The cost of this specific prompt execution as reported by the AI provider. This does not include costs from child executions. The currency is specified in CostCurrency field.`})
17892
17989
  Cost?: number;
17893
17990
 
@@ -18125,10 +18222,6 @@ export class MJAIPromptRun_ {
18125
18222
  @MaxLength(255)
18126
18223
  Parent?: string;
18127
18224
 
18128
- @Field({nullable: true})
18129
- @MaxLength(255)
18130
- AgentRun?: string;
18131
-
18132
18225
  @Field({nullable: true})
18133
18226
  @MaxLength(50)
18134
18227
  OriginalModel?: string;
@@ -18181,6 +18274,9 @@ export class MJAIPromptRun_ {
18181
18274
  @Field(() => [MJUserRoutineRun_])
18182
18275
  MJUserRoutineRuns_PromptRunIDArray: MJUserRoutineRun_[]; // Link to MJUserRoutineRuns
18183
18276
 
18277
+ @Field(() => [MJConversationCompactionRun_])
18278
+ MJConversationCompactionRuns_PromptRunIDArray: MJConversationCompactionRun_[]; // Link to MJConversationCompactionRuns
18279
+
18184
18280
  }
18185
18281
 
18186
18282
  //****************************************************************************
@@ -18248,9 +18344,6 @@ export class CreateMJAIPromptRunInput {
18248
18344
  @Field(() => Int, { nullable: true })
18249
18345
  ExecutionOrder: number | null;
18250
18346
 
18251
- @Field({ nullable: true })
18252
- AgentRunID: string | null;
18253
-
18254
18347
  @Field(() => Float, { nullable: true })
18255
18348
  Cost: number | null;
18256
18349
 
@@ -18519,9 +18612,6 @@ export class UpdateMJAIPromptRunInput {
18519
18612
  @Field(() => Int, { nullable: true })
18520
18613
  ExecutionOrder?: number | null;
18521
18614
 
18522
- @Field({ nullable: true })
18523
- AgentRunID?: string | null;
18524
-
18525
18615
  @Field(() => Float, { nullable: true })
18526
18616
  Cost?: number | null;
18527
18617
 
@@ -18864,6 +18954,16 @@ export class MJAIPromptRunResolver extends ResolverBase {
18864
18954
  return result;
18865
18955
  }
18866
18956
 
18957
+ @FieldResolver(() => [MJConversationCompactionRun_])
18958
+ async MJConversationCompactionRuns_PromptRunIDArray(@Root() mjaipromptrun_: MJAIPromptRun_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
18959
+ this.CheckUserReadPermissions('MJ: Conversation Compaction Runs', userPayload);
18960
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
18961
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwConversationCompactionRuns')} WHERE ${provider.QuoteIdentifier('PromptRunID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Conversation Compaction Runs', userPayload, EntityPermissionType.Read, 'AND');
18962
+ const rows = await provider.ExecuteSQL(sSQL, [mjaipromptrun_.ID], undefined, this.GetUserFromPayload(userPayload));
18963
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Conversation Compaction Runs', rows, this.GetUserFromPayload(userPayload));
18964
+ return result;
18965
+ }
18966
+
18867
18967
  @Mutation(() => MJAIPromptRun_)
18868
18968
  async CreateMJAIPromptRun(
18869
18969
  @Arg('input', () => CreateMJAIPromptRunInput) input: CreateMJAIPromptRunInput,
@@ -19325,6 +19425,15 @@ export class MJAIPrompt_ {
19325
19425
  @Field(() => [MJScopedPromptConfig_])
19326
19426
  MJScopedPromptConfigs_PromptIDArray: MJScopedPromptConfig_[]; // Link to MJScopedPromptConfigs
19327
19427
 
19428
+ @Field(() => [MJAIAgent_])
19429
+ MJAIAgents_ConversationSummaryPromptIDArray: MJAIAgent_[]; // Link to MJAIAgents
19430
+
19431
+ @Field(() => [MJAIAgentType_])
19432
+ MJAIAgentTypes_ContextCompressionPromptIDArray: MJAIAgentType_[]; // Link to MJAIAgentTypes
19433
+
19434
+ @Field(() => [MJAIAgentType_])
19435
+ MJAIAgentTypes_ConversationSummaryPromptIDArray: MJAIAgentType_[]; // Link to MJAIAgentTypes
19436
+
19328
19437
  }
19329
19438
 
19330
19439
  //****************************************************************************
@@ -19898,6 +20007,36 @@ export class MJAIPromptResolver extends ResolverBase {
19898
20007
  return result;
19899
20008
  }
19900
20009
 
20010
+ @FieldResolver(() => [MJAIAgent_])
20011
+ async MJAIAgents_ConversationSummaryPromptIDArray(@Root() mjaiprompt_: MJAIPrompt_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
20012
+ this.CheckUserReadPermissions('MJ: AI Agents', userPayload);
20013
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20014
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwAIAgents')} WHERE ${provider.QuoteIdentifier('ConversationSummaryPromptID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agents', userPayload, EntityPermissionType.Read, 'AND');
20015
+ const rows = await provider.ExecuteSQL(sSQL, [mjaiprompt_.ID], undefined, this.GetUserFromPayload(userPayload));
20016
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: AI Agents', rows, this.GetUserFromPayload(userPayload));
20017
+ return result;
20018
+ }
20019
+
20020
+ @FieldResolver(() => [MJAIAgentType_])
20021
+ async MJAIAgentTypes_ContextCompressionPromptIDArray(@Root() mjaiprompt_: MJAIPrompt_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
20022
+ this.CheckUserReadPermissions('MJ: AI Agent Types', userPayload);
20023
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20024
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwAIAgentTypes')} WHERE ${provider.QuoteIdentifier('ContextCompressionPromptID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Types', userPayload, EntityPermissionType.Read, 'AND');
20025
+ const rows = await provider.ExecuteSQL(sSQL, [mjaiprompt_.ID], undefined, this.GetUserFromPayload(userPayload));
20026
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Types', rows, this.GetUserFromPayload(userPayload));
20027
+ return result;
20028
+ }
20029
+
20030
+ @FieldResolver(() => [MJAIAgentType_])
20031
+ async MJAIAgentTypes_ConversationSummaryPromptIDArray(@Root() mjaiprompt_: MJAIPrompt_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
20032
+ this.CheckUserReadPermissions('MJ: AI Agent Types', userPayload);
20033
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20034
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwAIAgentTypes')} WHERE ${provider.QuoteIdentifier('ConversationSummaryPromptID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Types', userPayload, EntityPermissionType.Read, 'AND');
20035
+ const rows = await provider.ExecuteSQL(sSQL, [mjaiprompt_.ID], undefined, this.GetUserFromPayload(userPayload));
20036
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Types', rows, this.GetUserFromPayload(userPayload));
20037
+ return result;
20038
+ }
20039
+
19901
20040
  @Mutation(() => MJAIPrompt_)
19902
20041
  async CreateMJAIPrompt(
19903
20042
  @Arg('input', () => CreateMJAIPromptInput) input: CreateMJAIPromptInput,
@@ -20792,6 +20931,211 @@ export class MJAISkillPermissionResolver extends ResolverBase {
20792
20931
 
20793
20932
  }
20794
20933
 
20934
+ //****************************************************************************
20935
+ // ENTITY CLASS for MJ: AI Skill Search Scopes
20936
+ //****************************************************************************
20937
+ @ObjectType({ description: `Search Scopes an AI Skill may reach when activated, honoured when AISkill.SearchScopeAccess = \'Assigned\'. Mirrors AIAgentSearchScope: Status plus an optional StartAt/EndAt window time-box a grant, and Priority/IsDefault pick among several. An empty table means no skill grants any scope - the pre-migration behaviour.` })
20938
+ export class MJAISkillSearchScope_ {
20939
+ @Field()
20940
+ @MaxLength(36)
20941
+ ID: string;
20942
+
20943
+ @Field({description: `The skill this grant belongs to.`})
20944
+ @MaxLength(36)
20945
+ SkillID: string;
20946
+
20947
+ @Field({description: `The Search Scope this skill may reach.`})
20948
+ @MaxLength(36)
20949
+ SearchScopeID: string;
20950
+
20951
+ @Field({description: `Active or Inactive. Inactive rows are ignored during resolution.`})
20952
+ @MaxLength(20)
20953
+ Status: string;
20954
+
20955
+ @Field({nullable: true, description: `Optional start of the window in which this grant is honoured. NULL = no lower bound. Evaluated against the current time on every resolution, so a window opening or closing needs no cache invalidation.`})
20956
+ StartAt?: Date;
20957
+
20958
+ @Field({nullable: true, description: `Optional end of the window in which this grant is honoured. NULL = no upper bound.`})
20959
+ EndAt?: Date;
20960
+
20961
+ @Field(() => Int, {nullable: true, description: `Lower numbers win when several granted scopes are candidates and none is marked IsDefault.`})
20962
+ Priority?: number;
20963
+
20964
+ @Field(() => Boolean, {description: `When set, this scope is chosen for the skill ahead of Priority ordering.`})
20965
+ IsDefault: boolean;
20966
+
20967
+ @Field()
20968
+ _mj__CreatedAt: Date;
20969
+
20970
+ @Field()
20971
+ _mj__UpdatedAt: Date;
20972
+
20973
+ @Field()
20974
+ @MaxLength(255)
20975
+ Skill: string;
20976
+
20977
+ @Field()
20978
+ @MaxLength(200)
20979
+ SearchScope: string;
20980
+
20981
+ }
20982
+
20983
+ //****************************************************************************
20984
+ // INPUT TYPE for MJ: AI Skill Search Scopes
20985
+ //****************************************************************************
20986
+ @InputType()
20987
+ export class CreateMJAISkillSearchScopeInput {
20988
+ @Field({ nullable: true })
20989
+ ID?: string;
20990
+
20991
+ @Field({ nullable: true })
20992
+ SkillID?: string;
20993
+
20994
+ @Field({ nullable: true })
20995
+ SearchScopeID?: string;
20996
+
20997
+ @Field({ nullable: true })
20998
+ Status?: string;
20999
+
21000
+ @Field({ nullable: true })
21001
+ StartAt: Date | null;
21002
+
21003
+ @Field({ nullable: true })
21004
+ EndAt: Date | null;
21005
+
21006
+ @Field(() => Int, { nullable: true })
21007
+ Priority: number | null;
21008
+
21009
+ @Field(() => Boolean, { nullable: true })
21010
+ IsDefault?: boolean;
21011
+
21012
+ @Field(() => RestoreContextInput, { nullable: true })
21013
+ RestoreContext___?: RestoreContextInput;
21014
+ }
21015
+
21016
+
21017
+ //****************************************************************************
21018
+ // INPUT TYPE for MJ: AI Skill Search Scopes
21019
+ //****************************************************************************
21020
+ @InputType()
21021
+ export class UpdateMJAISkillSearchScopeInput {
21022
+ @Field()
21023
+ ID: string;
21024
+
21025
+ @Field({ nullable: true })
21026
+ SkillID?: string;
21027
+
21028
+ @Field({ nullable: true })
21029
+ SearchScopeID?: string;
21030
+
21031
+ @Field({ nullable: true })
21032
+ Status?: string;
21033
+
21034
+ @Field({ nullable: true })
21035
+ StartAt?: Date | null;
21036
+
21037
+ @Field({ nullable: true })
21038
+ EndAt?: Date | null;
21039
+
21040
+ @Field(() => Int, { nullable: true })
21041
+ Priority?: number | null;
21042
+
21043
+ @Field(() => Boolean, { nullable: true })
21044
+ IsDefault?: boolean;
21045
+
21046
+ @Field(() => [KeyValuePairInput], { nullable: true })
21047
+ OldValues___?: KeyValuePairInput[];
21048
+
21049
+ @Field(() => RestoreContextInput, { nullable: true })
21050
+ RestoreContext___?: RestoreContextInput;
21051
+ }
21052
+
21053
+ //****************************************************************************
21054
+ // RESOLVER for MJ: AI Skill Search Scopes
21055
+ //****************************************************************************
21056
+ @ObjectType()
21057
+ export class RunMJAISkillSearchScopeViewResult {
21058
+ @Field(() => [MJAISkillSearchScope_])
21059
+ Results: MJAISkillSearchScope_[];
21060
+
21061
+ @Field(() => String, {nullable: true})
21062
+ UserViewRunID?: string;
21063
+
21064
+ @Field(() => Int, {nullable: true})
21065
+ RowCount: number;
21066
+
21067
+ @Field(() => Int, {nullable: true})
21068
+ TotalRowCount: number;
21069
+
21070
+ @Field(() => Int, {nullable: true})
21071
+ ExecutionTime: number;
21072
+
21073
+ @Field({nullable: true})
21074
+ ErrorMessage?: string;
21075
+
21076
+ @Field(() => Boolean, {nullable: false})
21077
+ Success: boolean;
21078
+ }
21079
+
21080
+ @Resolver(MJAISkillSearchScope_)
21081
+ export class MJAISkillSearchScopeResolver extends ResolverBase {
21082
+ @Query(() => RunMJAISkillSearchScopeViewResult)
21083
+ async RunMJAISkillSearchScopeViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
21084
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
21085
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
21086
+ }
21087
+
21088
+ @Query(() => RunMJAISkillSearchScopeViewResult)
21089
+ async RunMJAISkillSearchScopeViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
21090
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
21091
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
21092
+ }
21093
+
21094
+ @Query(() => RunMJAISkillSearchScopeViewResult)
21095
+ async RunMJAISkillSearchScopeDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
21096
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
21097
+ input.EntityName = 'MJ: AI Skill Search Scopes';
21098
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
21099
+ }
21100
+ @Query(() => MJAISkillSearchScope_, { nullable: true })
21101
+ async MJAISkillSearchScope(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJAISkillSearchScope_ | null> {
21102
+ this.CheckUserReadPermissions('MJ: AI Skill Search Scopes', userPayload);
21103
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
21104
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwAISkillSearchScopes')} WHERE ${provider.QuoteIdentifier('ID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Skill Search Scopes', userPayload, EntityPermissionType.Read, 'AND');
21105
+ const rows = await provider.ExecuteSQL(sSQL, [ID], undefined, this.GetUserFromPayload(userPayload));
21106
+ const result = await this.MapFieldNamesToCodeNames('MJ: AI Skill Search Scopes', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
21107
+ return result;
21108
+ }
21109
+
21110
+ @Mutation(() => MJAISkillSearchScope_)
21111
+ async CreateMJAISkillSearchScope(
21112
+ @Arg('input', () => CreateMJAISkillSearchScopeInput) input: CreateMJAISkillSearchScopeInput,
21113
+ @Ctx() { providers, userPayload }: AppContext,
21114
+ @PubSub() pubSub: PubSubEngine
21115
+ ) {
21116
+ const provider = GetReadWriteProvider(providers);
21117
+ return this.CreateRecord('MJ: AI Skill Search Scopes', input, provider, userPayload, pubSub)
21118
+ }
21119
+
21120
+ @Mutation(() => MJAISkillSearchScope_)
21121
+ async UpdateMJAISkillSearchScope(
21122
+ @Arg('input', () => UpdateMJAISkillSearchScopeInput) input: UpdateMJAISkillSearchScopeInput,
21123
+ @Ctx() { providers, userPayload }: AppContext,
21124
+ @PubSub() pubSub: PubSubEngine
21125
+ ) {
21126
+ const provider = GetReadWriteProvider(providers);
21127
+ return this.UpdateRecord('MJ: AI Skill Search Scopes', input, provider, userPayload, pubSub);
21128
+ }
21129
+
21130
+ @Mutation(() => MJAISkillSearchScope_)
21131
+ async DeleteMJAISkillSearchScope(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
21132
+ const provider = GetReadWriteProvider(providers);
21133
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
21134
+ return this.DeleteRecord('MJ: AI Skill Search Scopes', key, options, provider, userPayload, pubSub);
21135
+ }
21136
+
21137
+ }
21138
+
20795
21139
  //****************************************************************************
20796
21140
  // ENTITY CLASS for MJ: AI Skill Sub Agents
20797
21141
  //****************************************************************************
@@ -21000,6 +21344,10 @@ export class MJAISkill_ {
21000
21344
  @MaxLength(20)
21001
21345
  ActivationMode: string;
21002
21346
 
21347
+ @Field({nullable: true, description: `Which Search Scopes this skill may reach when activated. None = grants no retrieval scope; Assigned = only scopes listed in AISkillSearchScope; All = any active scope. NULL behaves as None so existing skills are unaffected. Mirrors AIAgent.SearchScopeAccess so a skill and an agent are interchangeable principals to SearchScopePermissionResolver.`})
21348
+ @MaxLength(20)
21349
+ SearchScopeAccess?: string;
21350
+
21003
21351
  @Field()
21004
21352
  @MaxLength(100)
21005
21353
  CreatedByUser: string;
@@ -21016,6 +21364,12 @@ export class MJAISkill_ {
21016
21364
  @Field(() => [MJAISkillPermission_])
21017
21365
  MJAISkillPermissions_SkillIDArray: MJAISkillPermission_[]; // Link to MJAISkillPermissions
21018
21366
 
21367
+ @Field(() => [MJSearchExecutionLog_])
21368
+ MJSearchExecutionLogs_AISkillIDArray: MJSearchExecutionLog_[]; // Link to MJSearchExecutionLogs
21369
+
21370
+ @Field(() => [MJAISkillSearchScope_])
21371
+ MJAISkillSearchScopes_SkillIDArray: MJAISkillSearchScope_[]; // Link to MJAISkillSearchScopes
21372
+
21019
21373
  }
21020
21374
 
21021
21375
  //****************************************************************************
@@ -21053,6 +21407,9 @@ export class CreateMJAISkillInput {
21053
21407
  @Field({ nullable: true })
21054
21408
  ActivationMode?: string;
21055
21409
 
21410
+ @Field({ nullable: true })
21411
+ SearchScopeAccess: string | null;
21412
+
21056
21413
  @Field(() => RestoreContextInput, { nullable: true })
21057
21414
  RestoreContext___?: RestoreContextInput;
21058
21415
  }
@@ -21093,6 +21450,9 @@ export class UpdateMJAISkillInput {
21093
21450
  @Field({ nullable: true })
21094
21451
  ActivationMode?: string;
21095
21452
 
21453
+ @Field({ nullable: true })
21454
+ SearchScopeAccess?: string | null;
21455
+
21096
21456
  @Field(() => [KeyValuePairInput], { nullable: true })
21097
21457
  OldValues___?: KeyValuePairInput[];
21098
21458
 
@@ -21197,6 +21557,26 @@ export class MJAISkillResolver extends ResolverBase {
21197
21557
  return result;
21198
21558
  }
21199
21559
 
21560
+ @FieldResolver(() => [MJSearchExecutionLog_])
21561
+ async MJSearchExecutionLogs_AISkillIDArray(@Root() mjaiskill_: MJAISkill_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
21562
+ this.CheckUserReadPermissions('MJ: Search Execution Logs', userPayload);
21563
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
21564
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwSearchExecutionLogs')} WHERE ${provider.QuoteIdentifier('AISkillID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Search Execution Logs', userPayload, EntityPermissionType.Read, 'AND');
21565
+ const rows = await provider.ExecuteSQL(sSQL, [mjaiskill_.ID], undefined, this.GetUserFromPayload(userPayload));
21566
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Search Execution Logs', rows, this.GetUserFromPayload(userPayload));
21567
+ return result;
21568
+ }
21569
+
21570
+ @FieldResolver(() => [MJAISkillSearchScope_])
21571
+ async MJAISkillSearchScopes_SkillIDArray(@Root() mjaiskill_: MJAISkill_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
21572
+ this.CheckUserReadPermissions('MJ: AI Skill Search Scopes', userPayload);
21573
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
21574
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwAISkillSearchScopes')} WHERE ${provider.QuoteIdentifier('SkillID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Skill Search Scopes', userPayload, EntityPermissionType.Read, 'AND');
21575
+ const rows = await provider.ExecuteSQL(sSQL, [mjaiskill_.ID], undefined, this.GetUserFromPayload(userPayload));
21576
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: AI Skill Search Scopes', rows, this.GetUserFromPayload(userPayload));
21577
+ return result;
21578
+ }
21579
+
21200
21580
  @Mutation(() => MJAISkill_)
21201
21581
  async CreateMJAISkill(
21202
21582
  @Arg('input', () => CreateMJAISkillInput) input: CreateMJAISkillInput,
@@ -33912,6 +34292,356 @@ export class MJContentItemAttributeResolver extends ResolverBase {
33912
34292
 
33913
34293
  }
33914
34294
 
34295
+ //****************************************************************************
34296
+ // ENTITY CLASS for MJ: Content Item Chunks
34297
+ //****************************************************************************
34298
+ @ObjectType({ description: `Represents an individual chunk of a Content Item\'s text that was embedded as a distinct vector. When a Content Item is too large to embed as a single vector it is split into ordered chunks; each chunk becomes one row here, linking the stored vector back to the specific portion of the parent Content Item it represents.` })
34299
+ export class MJContentItemChunk_ {
34300
+ @Field()
34301
+ @MaxLength(36)
34302
+ ID: string;
34303
+
34304
+ @Field()
34305
+ @MaxLength(36)
34306
+ ContentItemID: string;
34307
+
34308
+ @Field(() => Int, {description: `Zero-based ordinal position of this chunk within the parent Content Item, preserving the original order in which the text was split.`})
34309
+ Sequence: number;
34310
+
34311
+ @Field({nullable: true, description: `The chunk of extracted text (from the parent Content Item) that was embedded to produce this chunk's vector. NULL for media-only segments (for example an image, or a video window with no transcript), where the embedded payload is the media itself and any readable representation lives in Description/Transcript.`})
34312
+ Text?: string;
34313
+
34314
+ @Field({nullable: true, description: `The identifier of this chunk's vector record in the vector database (e.g. Pinecone) — the deterministic key MemberJunction assigns and upserts the chunk's embedding under. Provides traceability from the chunk back to its stored vector.`})
34315
+ @MaxLength(100)
34316
+ VectorRecordID?: string;
34317
+
34318
+ @Field({description: `Embedding lifecycle state of this chunk: Pending (default), Processing, Active, Complete, Processed, Failed, or Skipped.`})
34319
+ @MaxLength(20)
34320
+ EmbeddingStatus: string;
34321
+
34322
+ @Field({description: `Tagging lifecycle state of this chunk: Pending (default), Processing, Active, Complete, Processed, Failed, or Skipped.`})
34323
+ @MaxLength(20)
34324
+ TaggingStatus: string;
34325
+
34326
+ @Field({nullable: true, description: `Deletion lifecycle state of this chunk's vector: NULL when not slated for deletion, Pending when vector removal is queued, or Deleted once the vector has been removed from the vector database.`})
34327
+ @MaxLength(20)
34328
+ DeleteStatus?: string;
34329
+
34330
+ @Field({nullable: true, description: `Timestamp of the last successful embedding of this chunk.`})
34331
+ LastEmbeddedAt?: Date;
34332
+
34333
+ @Field({nullable: true, description: `Timestamp of the last successful tagging of this chunk.`})
34334
+ LastTaggedAt?: Date;
34335
+
34336
+ @Field({nullable: true, description: `Timestamp of the last successful deletion of this chunk's vector from the vector database.`})
34337
+ LastDeletedAt?: Date;
34338
+
34339
+ @Field()
34340
+ _mj__CreatedAt: Date;
34341
+
34342
+ @Field()
34343
+ _mj__UpdatedAt: Date;
34344
+
34345
+ @Field({description: `The modality of this chunk's embedded payload: text (default), image, audio, video, or multimodal (text and media fused into a single vector). Determines which vector index the chunk's embedding belongs to, since a multimodal embedding model produces vectors of a different dimension than a text model, and is used at retrieval time to merge results per modality rather than taking a single global top-k.`})
34346
+ @MaxLength(20)
34347
+ Modality: string;
34348
+
34349
+ @Field(() => Int, {nullable: true, description: `Inclusive character offset where this chunk begins within the parent Content Item's extracted text. Together with EndOffset this is the provenance link that resolves a search hit back to the exact passage in the source document. NULL for media segments, which are positioned by StartMs/EndMs instead.`})
34350
+ StartOffset?: number;
34351
+
34352
+ @Field(() => Int, {nullable: true, description: `Exclusive character offset where this chunk ends within the parent Content Item's extracted text. See StartOffset. NULL for media segments.`})
34353
+ EndOffset?: number;
34354
+
34355
+ @Field(() => Int, {nullable: true, description: `Start of this chunk's time window, in milliseconds from the beginning of the parent audio or video asset. Set by transcript- or window-based segmentation; enables time-windowed playback deep-links from a search result (for example 14:22-15:05 of a session recording). NULL for text segments.`})
34356
+ StartMs?: number;
34357
+
34358
+ @Field(() => Int, {nullable: true, description: `End of this chunk's time window, in milliseconds from the beginning of the parent audio or video asset. See StartMs. NULL for text segments.`})
34359
+ EndMs?: number;
34360
+
34361
+ @Field(() => Int, {nullable: true, description: `One-based page number this chunk came from, for paginated sources such as PDFs or slide decks. Provides citation-grade provenance alongside the character offsets. NULL when the source is not paginated.`})
34362
+ PageNumber?: number;
34363
+
34364
+ @Field({nullable: true, description: `Human-readable label for this segment — a document heading for structure-based segmentation, or a generated chapter title for topic- and transcript-based segmentation. Displayed with search results and prepended to the embedded text so a chunk's vector carries its own topic.`})
34365
+ @MaxLength(500)
34366
+ SegmentTitle?: string;
34367
+
34368
+ @Field({nullable: true, description: `An AI-generated description of this chunk's content, primarily for non-text segments. Retrieval of a media chunk otherwise yields only a pointer (an asset and a time window) that an agent cannot reason over; this column is the readable representation that an agent reads, a cross-encoder reranks, and lexical search matches. A short summary of it may be mirrored into the vector record's metadata for display and filtering, but the full text belongs here.`})
34369
+ Description?: string;
34370
+
34371
+ @Field({nullable: true, description: `The verbatim transcript covering this chunk's time window, for audio and video segments, including speaker labels where the source provides them. Distinct from Description, which is a generated summary: this is what was actually said, and it is what makes a recording findable by lexical search.`})
34372
+ Transcript?: string;
34373
+
34374
+ @Field({nullable: true, description: `Registration key of the segmentation strategy that produced this chunk (for example StructuralText, SemanticText, Transcript, or FixedWindow). Provenance: when a Content Source's configured strategy changes, this identifies which chunks were produced by the previous strategy and therefore need re-chunking.`})
34375
+ @MaxLength(100)
34376
+ SegmenterKey?: string;
34377
+
34378
+ @Field({nullable: true, description: `Optional self-reference to another chunk of the same Content Item that is the parent of this one, expressing a chapter to sub-chapter hierarchy — for example a five-minute chapter of a recording and the individual speaker turns within it, or a document section and its subsections. NULL for top-level segments.`})
34379
+ @MaxLength(36)
34380
+ ParentChunkID?: string;
34381
+
34382
+ @Field({nullable: true})
34383
+ @MaxLength(250)
34384
+ ContentItem?: string;
34385
+
34386
+ @Field({nullable: true})
34387
+ @MaxLength(36)
34388
+ RootParentChunkID?: string;
34389
+
34390
+ @Field(() => [MJContentItemChunk_])
34391
+ MJContentItemChunks_ParentChunkIDArray: MJContentItemChunk_[]; // Link to MJContentItemChunks
34392
+
34393
+ }
34394
+
34395
+ //****************************************************************************
34396
+ // INPUT TYPE for MJ: Content Item Chunks
34397
+ //****************************************************************************
34398
+ @InputType()
34399
+ export class CreateMJContentItemChunkInput {
34400
+ @Field({ nullable: true })
34401
+ ID?: string;
34402
+
34403
+ @Field({ nullable: true })
34404
+ ContentItemID?: string;
34405
+
34406
+ @Field(() => Int, { nullable: true })
34407
+ Sequence?: number;
34408
+
34409
+ @Field({ nullable: true })
34410
+ Text: string | null;
34411
+
34412
+ @Field({ nullable: true })
34413
+ VectorRecordID: string | null;
34414
+
34415
+ @Field({ nullable: true })
34416
+ EmbeddingStatus?: string;
34417
+
34418
+ @Field({ nullable: true })
34419
+ TaggingStatus?: string;
34420
+
34421
+ @Field({ nullable: true })
34422
+ DeleteStatus: string | null;
34423
+
34424
+ @Field({ nullable: true })
34425
+ LastEmbeddedAt: Date | null;
34426
+
34427
+ @Field({ nullable: true })
34428
+ LastTaggedAt: Date | null;
34429
+
34430
+ @Field({ nullable: true })
34431
+ LastDeletedAt: Date | null;
34432
+
34433
+ @Field({ nullable: true })
34434
+ Modality?: string;
34435
+
34436
+ @Field(() => Int, { nullable: true })
34437
+ StartOffset: number | null;
34438
+
34439
+ @Field(() => Int, { nullable: true })
34440
+ EndOffset: number | null;
34441
+
34442
+ @Field(() => Int, { nullable: true })
34443
+ StartMs: number | null;
34444
+
34445
+ @Field(() => Int, { nullable: true })
34446
+ EndMs: number | null;
34447
+
34448
+ @Field(() => Int, { nullable: true })
34449
+ PageNumber: number | null;
34450
+
34451
+ @Field({ nullable: true })
34452
+ SegmentTitle: string | null;
34453
+
34454
+ @Field({ nullable: true })
34455
+ Description: string | null;
34456
+
34457
+ @Field({ nullable: true })
34458
+ Transcript: string | null;
34459
+
34460
+ @Field({ nullable: true })
34461
+ SegmenterKey: string | null;
34462
+
34463
+ @Field({ nullable: true })
34464
+ ParentChunkID: string | null;
34465
+
34466
+ @Field(() => RestoreContextInput, { nullable: true })
34467
+ RestoreContext___?: RestoreContextInput;
34468
+ }
34469
+
34470
+
34471
+ //****************************************************************************
34472
+ // INPUT TYPE for MJ: Content Item Chunks
34473
+ //****************************************************************************
34474
+ @InputType()
34475
+ export class UpdateMJContentItemChunkInput {
34476
+ @Field()
34477
+ ID: string;
34478
+
34479
+ @Field({ nullable: true })
34480
+ ContentItemID?: string;
34481
+
34482
+ @Field(() => Int, { nullable: true })
34483
+ Sequence?: number;
34484
+
34485
+ @Field({ nullable: true })
34486
+ Text?: string | null;
34487
+
34488
+ @Field({ nullable: true })
34489
+ VectorRecordID?: string | null;
34490
+
34491
+ @Field({ nullable: true })
34492
+ EmbeddingStatus?: string;
34493
+
34494
+ @Field({ nullable: true })
34495
+ TaggingStatus?: string;
34496
+
34497
+ @Field({ nullable: true })
34498
+ DeleteStatus?: string | null;
34499
+
34500
+ @Field({ nullable: true })
34501
+ LastEmbeddedAt?: Date | null;
34502
+
34503
+ @Field({ nullable: true })
34504
+ LastTaggedAt?: Date | null;
34505
+
34506
+ @Field({ nullable: true })
34507
+ LastDeletedAt?: Date | null;
34508
+
34509
+ @Field({ nullable: true })
34510
+ Modality?: string;
34511
+
34512
+ @Field(() => Int, { nullable: true })
34513
+ StartOffset?: number | null;
34514
+
34515
+ @Field(() => Int, { nullable: true })
34516
+ EndOffset?: number | null;
34517
+
34518
+ @Field(() => Int, { nullable: true })
34519
+ StartMs?: number | null;
34520
+
34521
+ @Field(() => Int, { nullable: true })
34522
+ EndMs?: number | null;
34523
+
34524
+ @Field(() => Int, { nullable: true })
34525
+ PageNumber?: number | null;
34526
+
34527
+ @Field({ nullable: true })
34528
+ SegmentTitle?: string | null;
34529
+
34530
+ @Field({ nullable: true })
34531
+ Description?: string | null;
34532
+
34533
+ @Field({ nullable: true })
34534
+ Transcript?: string | null;
34535
+
34536
+ @Field({ nullable: true })
34537
+ SegmenterKey?: string | null;
34538
+
34539
+ @Field({ nullable: true })
34540
+ ParentChunkID?: string | null;
34541
+
34542
+ @Field(() => [KeyValuePairInput], { nullable: true })
34543
+ OldValues___?: KeyValuePairInput[];
34544
+
34545
+ @Field(() => RestoreContextInput, { nullable: true })
34546
+ RestoreContext___?: RestoreContextInput;
34547
+ }
34548
+
34549
+ //****************************************************************************
34550
+ // RESOLVER for MJ: Content Item Chunks
34551
+ //****************************************************************************
34552
+ @ObjectType()
34553
+ export class RunMJContentItemChunkViewResult {
34554
+ @Field(() => [MJContentItemChunk_])
34555
+ Results: MJContentItemChunk_[];
34556
+
34557
+ @Field(() => String, {nullable: true})
34558
+ UserViewRunID?: string;
34559
+
34560
+ @Field(() => Int, {nullable: true})
34561
+ RowCount: number;
34562
+
34563
+ @Field(() => Int, {nullable: true})
34564
+ TotalRowCount: number;
34565
+
34566
+ @Field(() => Int, {nullable: true})
34567
+ ExecutionTime: number;
34568
+
34569
+ @Field({nullable: true})
34570
+ ErrorMessage?: string;
34571
+
34572
+ @Field(() => Boolean, {nullable: false})
34573
+ Success: boolean;
34574
+ }
34575
+
34576
+ @Resolver(MJContentItemChunk_)
34577
+ export class MJContentItemChunkResolver extends ResolverBase {
34578
+ @Query(() => RunMJContentItemChunkViewResult)
34579
+ async RunMJContentItemChunkViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
34580
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
34581
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
34582
+ }
34583
+
34584
+ @Query(() => RunMJContentItemChunkViewResult)
34585
+ async RunMJContentItemChunkViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
34586
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
34587
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
34588
+ }
34589
+
34590
+ @Query(() => RunMJContentItemChunkViewResult)
34591
+ async RunMJContentItemChunkDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
34592
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
34593
+ input.EntityName = 'MJ: Content Item Chunks';
34594
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
34595
+ }
34596
+ @Query(() => MJContentItemChunk_, { nullable: true })
34597
+ async MJContentItemChunk(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJContentItemChunk_ | null> {
34598
+ this.CheckUserReadPermissions('MJ: Content Item Chunks', userPayload);
34599
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
34600
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwContentItemChunks')} WHERE ${provider.QuoteIdentifier('ID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Content Item Chunks', userPayload, EntityPermissionType.Read, 'AND');
34601
+ const rows = await provider.ExecuteSQL(sSQL, [ID], undefined, this.GetUserFromPayload(userPayload));
34602
+ const result = await this.MapFieldNamesToCodeNames('MJ: Content Item Chunks', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
34603
+ return result;
34604
+ }
34605
+
34606
+ @FieldResolver(() => [MJContentItemChunk_])
34607
+ async MJContentItemChunks_ParentChunkIDArray(@Root() mjcontentitemchunk_: MJContentItemChunk_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
34608
+ this.CheckUserReadPermissions('MJ: Content Item Chunks', userPayload);
34609
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
34610
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwContentItemChunks')} WHERE ${provider.QuoteIdentifier('ParentChunkID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Content Item Chunks', userPayload, EntityPermissionType.Read, 'AND');
34611
+ const rows = await provider.ExecuteSQL(sSQL, [mjcontentitemchunk_.ID], undefined, this.GetUserFromPayload(userPayload));
34612
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Item Chunks', rows, this.GetUserFromPayload(userPayload));
34613
+ return result;
34614
+ }
34615
+
34616
+ @Mutation(() => MJContentItemChunk_)
34617
+ async CreateMJContentItemChunk(
34618
+ @Arg('input', () => CreateMJContentItemChunkInput) input: CreateMJContentItemChunkInput,
34619
+ @Ctx() { providers, userPayload }: AppContext,
34620
+ @PubSub() pubSub: PubSubEngine
34621
+ ) {
34622
+ const provider = GetReadWriteProvider(providers);
34623
+ return this.CreateRecord('MJ: Content Item Chunks', input, provider, userPayload, pubSub)
34624
+ }
34625
+
34626
+ @Mutation(() => MJContentItemChunk_)
34627
+ async UpdateMJContentItemChunk(
34628
+ @Arg('input', () => UpdateMJContentItemChunkInput) input: UpdateMJContentItemChunkInput,
34629
+ @Ctx() { providers, userPayload }: AppContext,
34630
+ @PubSub() pubSub: PubSubEngine
34631
+ ) {
34632
+ const provider = GetReadWriteProvider(providers);
34633
+ return this.UpdateRecord('MJ: Content Item Chunks', input, provider, userPayload, pubSub);
34634
+ }
34635
+
34636
+ @Mutation(() => MJContentItemChunk_)
34637
+ async DeleteMJContentItemChunk(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
34638
+ const provider = GetReadWriteProvider(providers);
34639
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
34640
+ return this.DeleteRecord('MJ: Content Item Chunks', key, options, provider, userPayload, pubSub);
34641
+ }
34642
+
34643
+ }
34644
+
33915
34645
  //****************************************************************************
33916
34646
  // ENTITY CLASS for MJ: Content Item Duplicates
33917
34647
  //****************************************************************************
@@ -34405,6 +35135,18 @@ export class MJContentItem_ {
34405
35135
  @Field({nullable: true, description: `Timestamp of the most recent successful autotagging run for this content item.`})
34406
35136
  LastTaggedAt?: Date;
34407
35137
 
35138
+ @Field({nullable: true, description: `The identifier of this Content Item's vector record in the vector database (e.g. Pinecone) — the deterministic key MemberJunction assigns and upserts the embedding under when the item is embedded as a single vector. Provides traceability from the Content Item back to its stored vector. For chunked items, per-chunk identifiers are tracked on the ContentItemChunk entity instead.`})
35139
+ @MaxLength(100)
35140
+ VectorRecordID?: string;
35141
+
35142
+ @Field({nullable: true, description: `Optional self-reference to another Content Item that is the parent of this one, enabling a content-item hierarchy (e.g. a document and its sub-pages, or a site and its crawled pages). NULL for top-level items.`})
35143
+ @MaxLength(36)
35144
+ ParentID?: string;
35145
+
35146
+ @Field({nullable: true, description: `Optional display/clickable URL for this Content Item (e.g. a canonical or human-facing link), distinct from the source URL used for ingestion.`})
35147
+ @MaxLength(2000)
35148
+ DisplayLink?: string;
35149
+
34408
35150
  @Field({nullable: true})
34409
35151
  @MaxLength(255)
34410
35152
  ContentSource?: string;
@@ -34429,6 +35171,14 @@ export class MJContentItem_ {
34429
35171
  @MaxLength(50)
34430
35172
  EmbeddingModel?: string;
34431
35173
 
35174
+ @Field({nullable: true})
35175
+ @MaxLength(250)
35176
+ Parent?: string;
35177
+
35178
+ @Field({nullable: true})
35179
+ @MaxLength(36)
35180
+ RootParentID?: string;
35181
+
34432
35182
  @Field(() => [MJContentItemAttribute_])
34433
35183
  MJContentItemAttributes_ContentItemIDArray: MJContentItemAttribute_[]; // Link to MJContentItemAttributes
34434
35184
 
@@ -34441,9 +35191,15 @@ export class MJContentItem_ {
34441
35191
  @Field(() => [MJContentItemDuplicate_])
34442
35192
  MJContentItemDuplicates_ContentItemBIDArray: MJContentItemDuplicate_[]; // Link to MJContentItemDuplicates
34443
35193
 
35194
+ @Field(() => [MJContentItem_])
35195
+ MJContentItems_ParentIDArray: MJContentItem_[]; // Link to MJContentItems
35196
+
34444
35197
  @Field(() => [MJTagSuggestion_])
34445
35198
  MJTagSuggestions_SourceContentItemIDArray: MJTagSuggestion_[]; // Link to MJTagSuggestions
34446
35199
 
35200
+ @Field(() => [MJContentItemChunk_])
35201
+ MJContentItemChunks_ContentItemIDArray: MJContentItemChunk_[]; // Link to MJContentItemChunks
35202
+
34447
35203
  }
34448
35204
 
34449
35205
  //****************************************************************************
@@ -34499,6 +35255,15 @@ export class CreateMJContentItemInput {
34499
35255
  @Field({ nullable: true })
34500
35256
  LastTaggedAt: Date | null;
34501
35257
 
35258
+ @Field({ nullable: true })
35259
+ VectorRecordID: string | null;
35260
+
35261
+ @Field({ nullable: true })
35262
+ ParentID: string | null;
35263
+
35264
+ @Field({ nullable: true })
35265
+ DisplayLink: string | null;
35266
+
34502
35267
  @Field(() => RestoreContextInput, { nullable: true })
34503
35268
  RestoreContext___?: RestoreContextInput;
34504
35269
  }
@@ -34557,6 +35322,15 @@ export class UpdateMJContentItemInput {
34557
35322
  @Field({ nullable: true })
34558
35323
  LastTaggedAt?: Date | null;
34559
35324
 
35325
+ @Field({ nullable: true })
35326
+ VectorRecordID?: string | null;
35327
+
35328
+ @Field({ nullable: true })
35329
+ ParentID?: string | null;
35330
+
35331
+ @Field({ nullable: true })
35332
+ DisplayLink?: string | null;
35333
+
34560
35334
  @Field(() => [KeyValuePairInput], { nullable: true })
34561
35335
  OldValues___?: KeyValuePairInput[];
34562
35336
 
@@ -34661,6 +35435,16 @@ export class MJContentItemResolver extends ResolverBase {
34661
35435
  return result;
34662
35436
  }
34663
35437
 
35438
+ @FieldResolver(() => [MJContentItem_])
35439
+ async MJContentItems_ParentIDArray(@Root() mjcontentitem_: MJContentItem_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
35440
+ this.CheckUserReadPermissions('MJ: Content Items', userPayload);
35441
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
35442
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwContentItems')} WHERE ${provider.QuoteIdentifier('ParentID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Content Items', userPayload, EntityPermissionType.Read, 'AND');
35443
+ const rows = await provider.ExecuteSQL(sSQL, [mjcontentitem_.ID], undefined, this.GetUserFromPayload(userPayload));
35444
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Items', rows, this.GetUserFromPayload(userPayload));
35445
+ return result;
35446
+ }
35447
+
34664
35448
  @FieldResolver(() => [MJTagSuggestion_])
34665
35449
  async MJTagSuggestions_SourceContentItemIDArray(@Root() mjcontentitem_: MJContentItem_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
34666
35450
  this.CheckUserReadPermissions('MJ: Tag Suggestions', userPayload);
@@ -34671,6 +35455,16 @@ export class MJContentItemResolver extends ResolverBase {
34671
35455
  return result;
34672
35456
  }
34673
35457
 
35458
+ @FieldResolver(() => [MJContentItemChunk_])
35459
+ async MJContentItemChunks_ContentItemIDArray(@Root() mjcontentitem_: MJContentItem_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
35460
+ this.CheckUserReadPermissions('MJ: Content Item Chunks', userPayload);
35461
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
35462
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwContentItemChunks')} WHERE ${provider.QuoteIdentifier('ContentItemID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Content Item Chunks', userPayload, EntityPermissionType.Read, 'AND');
35463
+ const rows = await provider.ExecuteSQL(sSQL, [mjcontentitem_.ID], undefined, this.GetUserFromPayload(userPayload));
35464
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Content Item Chunks', rows, this.GetUserFromPayload(userPayload));
35465
+ return result;
35466
+ }
35467
+
34674
35468
  @Mutation(() => MJContentItem_)
34675
35469
  async CreateMJContentItem(
34676
35470
  @Arg('input', () => CreateMJContentItemInput) input: CreateMJContentItemInput,
@@ -36023,6 +36817,14 @@ export class MJContentSource_ {
36023
36817
  @MaxLength(36)
36024
36818
  ScheduledActionID?: string;
36025
36819
 
36820
+ @Field({nullable: true, description: `Registration key of the segmentation strategy used to split this source's content into embeddable chunks — for example StructuralText (document headings), AdaptiveBoundary (target size closing on the nearest natural break), SemanticText (LLM-detected topic boundaries), Transcript (audio/video chapters), PagedContent (one segment per page), or FixedWindow (uniform windows). NULL falls back to the Content Type's value, then to a built-in default.`})
36821
+ @MaxLength(100)
36822
+ SegmenterKey?: string;
36823
+
36824
+ @Field({nullable: true, description: `Registration key of the content-cleaning strategy applied to this source before segmentation — for example Html (CSS-selector-driven extraction that drops navigation, sidebars, and advertising) or PlainText (whitespace normalization only). Cleaning is separate from segmentation because the two change for different reasons: a new site template needs new selectors, not a new chunking strategy. NULL falls back to the Content Type's value, then to a default inferred from the content's mime type.`})
36825
+ @MaxLength(100)
36826
+ CleanerKey?: string;
36827
+
36026
36828
  @Field()
36027
36829
  @MaxLength(255)
36028
36830
  ContentType: string;
@@ -36113,6 +36915,12 @@ export class CreateMJContentSourceInput {
36113
36915
  @Field({ nullable: true })
36114
36916
  ScheduledActionID: string | null;
36115
36917
 
36918
+ @Field({ nullable: true })
36919
+ SegmenterKey: string | null;
36920
+
36921
+ @Field({ nullable: true })
36922
+ CleanerKey: string | null;
36923
+
36116
36924
  @Field(() => RestoreContextInput, { nullable: true })
36117
36925
  RestoreContext___?: RestoreContextInput;
36118
36926
  }
@@ -36159,6 +36967,12 @@ export class UpdateMJContentSourceInput {
36159
36967
  @Field({ nullable: true })
36160
36968
  ScheduledActionID?: string | null;
36161
36969
 
36970
+ @Field({ nullable: true })
36971
+ SegmenterKey?: string | null;
36972
+
36973
+ @Field({ nullable: true })
36974
+ CleanerKey?: string | null;
36975
+
36162
36976
  @Field(() => [KeyValuePairInput], { nullable: true })
36163
36977
  OldValues___?: KeyValuePairInput[];
36164
36978
 
@@ -36514,6 +37328,14 @@ export class MJContentType_ {
36514
37328
  @Field({nullable: true, description: `JSON configuration blob for content-type-level settings. Conforms to the IContentTypeConfiguration interface. Reserved for future type-wide settings such as default tag taxonomy rules and processing options.`})
36515
37329
  Configuration?: string;
36516
37330
 
37331
+ @Field({nullable: true, description: `Default segmentation strategy for content of this type, used when a Content Source does not specify its own SegmenterKey. See ContentSource.SegmenterKey for the available strategies.`})
37332
+ @MaxLength(100)
37333
+ SegmenterKey?: string;
37334
+
37335
+ @Field({nullable: true, description: `Default content-cleaning strategy for content of this type, used when a Content Source does not specify its own CleanerKey. See ContentSource.CleanerKey.`})
37336
+ @MaxLength(100)
37337
+ CleanerKey?: string;
37338
+
36517
37339
  @Field()
36518
37340
  @MaxLength(50)
36519
37341
  AIModel: string;
@@ -36566,6 +37388,12 @@ export class CreateMJContentTypeInput {
36566
37388
  @Field({ nullable: true })
36567
37389
  Configuration: string | null;
36568
37390
 
37391
+ @Field({ nullable: true })
37392
+ SegmenterKey: string | null;
37393
+
37394
+ @Field({ nullable: true })
37395
+ CleanerKey: string | null;
37396
+
36569
37397
  @Field(() => RestoreContextInput, { nullable: true })
36570
37398
  RestoreContext___?: RestoreContextInput;
36571
37399
  }
@@ -36603,6 +37431,12 @@ export class UpdateMJContentTypeInput {
36603
37431
  @Field({ nullable: true })
36604
37432
  Configuration?: string | null;
36605
37433
 
37434
+ @Field({ nullable: true })
37435
+ SegmenterKey?: string | null;
37436
+
37437
+ @Field({ nullable: true })
37438
+ CleanerKey?: string | null;
37439
+
36606
37440
  @Field(() => [KeyValuePairInput], { nullable: true })
36607
37441
  OldValues___?: KeyValuePairInput[];
36608
37442
 
@@ -37311,6 +38145,165 @@ export class MJConversationArtifactResolver extends ResolverBase {
37311
38145
 
37312
38146
  }
37313
38147
 
38148
+ //****************************************************************************
38149
+ // ENTITY CLASS for MJ: Conversation Compaction Runs
38150
+ //****************************************************************************
38151
+ @ObjectType({ description: `Links a conversation detail boundary row to the AI Prompt Run that produced its compaction summary. Audit-only join table replacing the former ConversationDetail.SummaryPromptRunID FK to break the CodeGen cycle.` })
38152
+ export class MJConversationCompactionRun_ {
38153
+ @Field()
38154
+ @MaxLength(36)
38155
+ ID: string;
38156
+
38157
+ @Field({description: `The conversation detail row whose SummaryOfEarlierConversation was produced by this compaction run.`})
38158
+ @MaxLength(36)
38159
+ ConversationDetailID: string;
38160
+
38161
+ @Field({description: `The AI Prompt Run that generated the compaction summary (model, tokens, cost, prompt version).`})
38162
+ @MaxLength(36)
38163
+ PromptRunID: string;
38164
+
38165
+ @Field()
38166
+ _mj__CreatedAt: Date;
38167
+
38168
+ @Field()
38169
+ _mj__UpdatedAt: Date;
38170
+
38171
+ @Field({nullable: true})
38172
+ @MaxLength(100)
38173
+ ConversationDetail?: string;
38174
+
38175
+ @Field({nullable: true})
38176
+ @MaxLength(255)
38177
+ PromptRun?: string;
38178
+
38179
+ }
38180
+
38181
+ //****************************************************************************
38182
+ // INPUT TYPE for MJ: Conversation Compaction Runs
38183
+ //****************************************************************************
38184
+ @InputType()
38185
+ export class CreateMJConversationCompactionRunInput {
38186
+ @Field({ nullable: true })
38187
+ ID?: string;
38188
+
38189
+ @Field({ nullable: true })
38190
+ ConversationDetailID?: string;
38191
+
38192
+ @Field({ nullable: true })
38193
+ PromptRunID?: string;
38194
+
38195
+ @Field(() => RestoreContextInput, { nullable: true })
38196
+ RestoreContext___?: RestoreContextInput;
38197
+ }
38198
+
38199
+
38200
+ //****************************************************************************
38201
+ // INPUT TYPE for MJ: Conversation Compaction Runs
38202
+ //****************************************************************************
38203
+ @InputType()
38204
+ export class UpdateMJConversationCompactionRunInput {
38205
+ @Field()
38206
+ ID: string;
38207
+
38208
+ @Field({ nullable: true })
38209
+ ConversationDetailID?: string;
38210
+
38211
+ @Field({ nullable: true })
38212
+ PromptRunID?: string;
38213
+
38214
+ @Field(() => [KeyValuePairInput], { nullable: true })
38215
+ OldValues___?: KeyValuePairInput[];
38216
+
38217
+ @Field(() => RestoreContextInput, { nullable: true })
38218
+ RestoreContext___?: RestoreContextInput;
38219
+ }
38220
+
38221
+ //****************************************************************************
38222
+ // RESOLVER for MJ: Conversation Compaction Runs
38223
+ //****************************************************************************
38224
+ @ObjectType()
38225
+ export class RunMJConversationCompactionRunViewResult {
38226
+ @Field(() => [MJConversationCompactionRun_])
38227
+ Results: MJConversationCompactionRun_[];
38228
+
38229
+ @Field(() => String, {nullable: true})
38230
+ UserViewRunID?: string;
38231
+
38232
+ @Field(() => Int, {nullable: true})
38233
+ RowCount: number;
38234
+
38235
+ @Field(() => Int, {nullable: true})
38236
+ TotalRowCount: number;
38237
+
38238
+ @Field(() => Int, {nullable: true})
38239
+ ExecutionTime: number;
38240
+
38241
+ @Field({nullable: true})
38242
+ ErrorMessage?: string;
38243
+
38244
+ @Field(() => Boolean, {nullable: false})
38245
+ Success: boolean;
38246
+ }
38247
+
38248
+ @Resolver(MJConversationCompactionRun_)
38249
+ export class MJConversationCompactionRunResolver extends ResolverBase {
38250
+ @Query(() => RunMJConversationCompactionRunViewResult)
38251
+ async RunMJConversationCompactionRunViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
38252
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
38253
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
38254
+ }
38255
+
38256
+ @Query(() => RunMJConversationCompactionRunViewResult)
38257
+ async RunMJConversationCompactionRunViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
38258
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
38259
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
38260
+ }
38261
+
38262
+ @Query(() => RunMJConversationCompactionRunViewResult)
38263
+ async RunMJConversationCompactionRunDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
38264
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
38265
+ input.EntityName = 'MJ: Conversation Compaction Runs';
38266
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
38267
+ }
38268
+ @Query(() => MJConversationCompactionRun_, { nullable: true })
38269
+ async MJConversationCompactionRun(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJConversationCompactionRun_ | null> {
38270
+ this.CheckUserReadPermissions('MJ: Conversation Compaction Runs', userPayload);
38271
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
38272
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwConversationCompactionRuns')} WHERE ${provider.QuoteIdentifier('ID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Conversation Compaction Runs', userPayload, EntityPermissionType.Read, 'AND');
38273
+ const rows = await provider.ExecuteSQL(sSQL, [ID], undefined, this.GetUserFromPayload(userPayload));
38274
+ const result = await this.MapFieldNamesToCodeNames('MJ: Conversation Compaction Runs', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
38275
+ return result;
38276
+ }
38277
+
38278
+ @Mutation(() => MJConversationCompactionRun_)
38279
+ async CreateMJConversationCompactionRun(
38280
+ @Arg('input', () => CreateMJConversationCompactionRunInput) input: CreateMJConversationCompactionRunInput,
38281
+ @Ctx() { providers, userPayload }: AppContext,
38282
+ @PubSub() pubSub: PubSubEngine
38283
+ ) {
38284
+ const provider = GetReadWriteProvider(providers);
38285
+ return this.CreateRecord('MJ: Conversation Compaction Runs', input, provider, userPayload, pubSub)
38286
+ }
38287
+
38288
+ @Mutation(() => MJConversationCompactionRun_)
38289
+ async UpdateMJConversationCompactionRun(
38290
+ @Arg('input', () => UpdateMJConversationCompactionRunInput) input: UpdateMJConversationCompactionRunInput,
38291
+ @Ctx() { providers, userPayload }: AppContext,
38292
+ @PubSub() pubSub: PubSubEngine
38293
+ ) {
38294
+ const provider = GetReadWriteProvider(providers);
38295
+ return this.UpdateRecord('MJ: Conversation Compaction Runs', input, provider, userPayload, pubSub);
38296
+ }
38297
+
38298
+ @Mutation(() => MJConversationCompactionRun_)
38299
+ async DeleteMJConversationCompactionRun(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
38300
+ const provider = GetReadWriteProvider(providers);
38301
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
38302
+ return this.DeleteRecord('MJ: Conversation Compaction Runs', key, options, provider, userPayload, pubSub);
38303
+ }
38304
+
38305
+ }
38306
+
37314
38307
  //****************************************************************************
37315
38308
  // ENTITY CLASS for MJ: Conversation Detail Artifacts
37316
38309
  //****************************************************************************
@@ -38050,6 +39043,9 @@ export class MJConversationDetail_ {
38050
39043
  @MaxLength(20)
38051
39044
  MediaType?: string;
38052
39045
 
39046
+ @Field(() => Int, {description: `Monotonic, per-conversation ordinal assigned on insert (1-based). Provides a stable symbolic handle used by conversation-history retrieval tools and by the sequence markers embedded in compaction summaries. A summary stored in SummaryOfEarlierConversation on a given row covers all rows with a lower Sequence in the same conversation.`})
39047
+ Sequence: number;
39048
+
38053
39049
  @Field({nullable: true})
38054
39050
  @MaxLength(255)
38055
39051
  Conversation?: string;
@@ -38109,6 +39105,9 @@ export class MJConversationDetail_ {
38109
39105
  @Field(() => [MJTask_])
38110
39106
  MJTasks_ConversationDetailIDArray: MJTask_[]; // Link to MJTasks
38111
39107
 
39108
+ @Field(() => [MJConversationCompactionRun_])
39109
+ MJConversationCompactionRuns_ConversationDetailIDArray: MJConversationCompactionRun_[]; // Link to MJConversationCompactionRuns
39110
+
38112
39111
  }
38113
39112
 
38114
39113
  //****************************************************************************
@@ -38460,6 +39459,16 @@ export class MJConversationDetailResolver extends ResolverBase {
38460
39459
  return result;
38461
39460
  }
38462
39461
 
39462
+ @FieldResolver(() => [MJConversationCompactionRun_])
39463
+ async MJConversationCompactionRuns_ConversationDetailIDArray(@Root() mjconversationdetail_: MJConversationDetail_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
39464
+ this.CheckUserReadPermissions('MJ: Conversation Compaction Runs', userPayload);
39465
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
39466
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwConversationCompactionRuns')} WHERE ${provider.QuoteIdentifier('ConversationDetailID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Conversation Compaction Runs', userPayload, EntityPermissionType.Read, 'AND');
39467
+ const rows = await provider.ExecuteSQL(sSQL, [mjconversationdetail_.ID], undefined, this.GetUserFromPayload(userPayload));
39468
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Conversation Compaction Runs', rows, this.GetUserFromPayload(userPayload));
39469
+ return result;
39470
+ }
39471
+
38463
39472
  @Mutation(() => MJConversationDetail_)
38464
39473
  async CreateMJConversationDetail(
38465
39474
  @Arg('input', () => CreateMJConversationDetailInput) input: CreateMJConversationDetailInput,
@@ -65814,6 +66823,14 @@ export class MJOpenApp_ {
65814
66823
  @MaxLength(500)
65815
66824
  Subpath?: string;
65816
66825
 
66826
+ @Field({nullable: true, description: `The last install/upgrade/remove step that completed successfully for this app while Status is Installing, Upgrading, or Removing. Used to resume a crashed or failed operation from the correct point instead of restarting it entirely. Cleared (NULL) once the operation reaches a terminal state (Active/Disabled/Removed/Error).`})
66827
+ @MaxLength(50)
66828
+ LastCompletedStep?: string;
66829
+
66830
+ @Field({nullable: true, description: `The version this app was being upgraded TO when LastCompletedStep was last written, for Upgrade only. A resume only trusts LastCompletedStep when this matches the version currently being requested — otherwise a checkpoint from an interrupted upgrade to a different version could wrongly skip steps for the new target. Cleared alongside LastCompletedStep.`})
66831
+ @MaxLength(20)
66832
+ LastCompletedStepTargetVersion?: string;
66833
+
65817
66834
  @Field()
65818
66835
  @MaxLength(100)
65819
66836
  InstalledByUser: string;
@@ -65891,6 +66908,12 @@ export class CreateMJOpenAppInput {
65891
66908
  @Field({ nullable: true })
65892
66909
  Subpath: string | null;
65893
66910
 
66911
+ @Field({ nullable: true })
66912
+ LastCompletedStep: string | null;
66913
+
66914
+ @Field({ nullable: true })
66915
+ LastCompletedStepTargetVersion: string | null;
66916
+
65894
66917
  @Field(() => RestoreContextInput, { nullable: true })
65895
66918
  RestoreContext___?: RestoreContextInput;
65896
66919
  }
@@ -65958,6 +66981,12 @@ export class UpdateMJOpenAppInput {
65958
66981
  @Field({ nullable: true })
65959
66982
  Subpath?: string | null;
65960
66983
 
66984
+ @Field({ nullable: true })
66985
+ LastCompletedStep?: string | null;
66986
+
66987
+ @Field({ nullable: true })
66988
+ LastCompletedStepTargetVersion?: string | null;
66989
+
65961
66990
  @Field(() => [KeyValuePairInput], { nullable: true })
65962
66991
  OldValues___?: KeyValuePairInput[];
65963
66992
 
@@ -78764,6 +79793,17 @@ export class MJSearchExecutionLog_ {
78764
79793
  @Field()
78765
79794
  _mj__UpdatedAt: Date;
78766
79795
 
79796
+ @Field({nullable: true, description: `The AI Skill on whose behalf this search ran, or NULL for a search with no active skill. Mirrors AIAgentID: since a skill is a search principal in its own right (AISkill.SearchScopeAccess plus MJ: AI Skill Search Scopes rows can reach a scope the user's own roles do not grant), the log must record which skill was active or the entitlement decision cannot be reconstructed.`})
79797
+ @MaxLength(36)
79798
+ AISkillID?: string;
79799
+
79800
+ @Field({nullable: true, description: `The tenant this search ran for, taken from SearchContext.PrimaryScopeRecordID. Lets a multi-tenant deployment partition, filter and retain search audit history per customer. NULL for untenanted searches. Named for the existing primary-scope concept rather than OrganizationID because a scope's primary scope may be a Company, Client or Practice.`})
79801
+ @MaxLength(36)
79802
+ PrimaryScopeRecordID?: string;
79803
+
79804
+ @Field({nullable: true, description: `Serialized ScopeExplanation recording WHY this search could reach what it reached: the entitlement decision and the grant that produced it, every dimension with its provenance (CallerSupplied / ServerDerived / Default / DiscardedCaller / Absent), and each lane's rendered filter with its active-or-skipped status and reason. Identical in shape to the value returned by SearchEngine.ExplainScope(), so the dry-run an administrator previews before running a search is the same structure the audit log stores afterwards. NULL when the engine did not capture a decision (older writers, or a failure before scope resolution).`})
79805
+ ScopeDecisionJSON?: string;
79806
+
78767
79807
  @Field({nullable: true})
78768
79808
  @MaxLength(200)
78769
79809
  SearchScope?: string;
@@ -78776,6 +79816,10 @@ export class MJSearchExecutionLog_ {
78776
79816
  @MaxLength(255)
78777
79817
  AIAgent?: string;
78778
79818
 
79819
+ @Field({nullable: true})
79820
+ @MaxLength(255)
79821
+ AISkill?: string;
79822
+
78779
79823
  }
78780
79824
 
78781
79825
  //****************************************************************************
@@ -78819,6 +79863,15 @@ export class CreateMJSearchExecutionLogInput {
78819
79863
  @Field({ nullable: true })
78820
79864
  ProvidersJSON: string | null;
78821
79865
 
79866
+ @Field({ nullable: true })
79867
+ AISkillID: string | null;
79868
+
79869
+ @Field({ nullable: true })
79870
+ PrimaryScopeRecordID: string | null;
79871
+
79872
+ @Field({ nullable: true })
79873
+ ScopeDecisionJSON: string | null;
79874
+
78822
79875
  @Field(() => RestoreContextInput, { nullable: true })
78823
79876
  RestoreContext___?: RestoreContextInput;
78824
79877
  }
@@ -78865,6 +79918,15 @@ export class UpdateMJSearchExecutionLogInput {
78865
79918
  @Field({ nullable: true })
78866
79919
  ProvidersJSON?: string | null;
78867
79920
 
79921
+ @Field({ nullable: true })
79922
+ AISkillID?: string | null;
79923
+
79924
+ @Field({ nullable: true })
79925
+ PrimaryScopeRecordID?: string | null;
79926
+
79927
+ @Field({ nullable: true })
79928
+ ScopeDecisionJSON?: string | null;
79929
+
78868
79930
  @Field(() => [KeyValuePairInput], { nullable: true })
78869
79931
  OldValues___?: KeyValuePairInput[];
78870
79932
 
@@ -79249,6 +80311,9 @@ export class MJSearchScopeEntity_ {
79249
80311
  @Field()
79250
80312
  _mj__UpdatedAt: Date;
79251
80313
 
80314
+ @Field({nullable: true, description: `JSON array of column or alias names the rendered ExtraFilter MUST reference for this lane to be considered safe, e.g. ["OrganizationID","ContentSourceID"]. Checked against the RENDERED filter at search time: if one is missing the lane is SKIPPED rather than queried, because a partially-rendered filter (an {% if %} clause dropped when its dimension was absent or discarded) is still valid SQL and silently widens the search. Same concept and same engine check as SearchScopeExternalIndex.RequiredMetadataKeys, applied to the SQL lane. NULL = no contract declared, which is the pre-migration behaviour.`})
80315
+ RequiredMetadataKeys?: string;
80316
+
79252
80317
  @Field()
79253
80318
  @MaxLength(200)
79254
80319
  SearchScope: string;
@@ -79279,6 +80344,9 @@ export class CreateMJSearchScopeEntityInput {
79279
80344
  @Field({ nullable: true })
79280
80345
  UserSearchString: string | null;
79281
80346
 
80347
+ @Field({ nullable: true })
80348
+ RequiredMetadataKeys: string | null;
80349
+
79282
80350
  @Field(() => RestoreContextInput, { nullable: true })
79283
80351
  RestoreContext___?: RestoreContextInput;
79284
80352
  }
@@ -79304,6 +80372,9 @@ export class UpdateMJSearchScopeEntityInput {
79304
80372
  @Field({ nullable: true })
79305
80373
  UserSearchString?: string | null;
79306
80374
 
80375
+ @Field({ nullable: true })
80376
+ RequiredMetadataKeys?: string | null;
80377
+
79307
80378
  @Field(() => [KeyValuePairInput], { nullable: true })
79308
80379
  OldValues___?: KeyValuePairInput[];
79309
80380
 
@@ -79434,6 +80505,9 @@ export class MJSearchScopeExternalIndex_ {
79434
80505
  @Field()
79435
80506
  _mj__UpdatedAt: Date;
79436
80507
 
80508
+ @Field({nullable: true, description: `JSON array of metadata key names the rendered MetadataFilter MUST constrain on for this lane to be considered safe, e.g. ["OrganizationID","ContentSourceID"]. Checked against the RENDERED filter at search time: if a key is missing the lane is SKIPPED rather than queried, because a partially-rendered filter silently widens the search. This also documents the ingest contract — these are the labels the writer must stamp on every document in the index, since a filter on a key that was never written either matches nothing or (on providers that ignore unknown keys) matches everything. NULL = no contract declared, which is the pre-migration behaviour.`})
80509
+ RequiredMetadataKeys?: string;
80510
+
79437
80511
  @Field()
79438
80512
  @MaxLength(200)
79439
80513
  SearchScope: string;
@@ -79470,6 +80544,9 @@ export class CreateMJSearchScopeExternalIndexInput {
79470
80544
  @Field({ nullable: true })
79471
80545
  MetadataFilter: string | null;
79472
80546
 
80547
+ @Field({ nullable: true })
80548
+ RequiredMetadataKeys: string | null;
80549
+
79473
80550
  @Field(() => RestoreContextInput, { nullable: true })
79474
80551
  RestoreContext___?: RestoreContextInput;
79475
80552
  }
@@ -79501,6 +80578,9 @@ export class UpdateMJSearchScopeExternalIndexInput {
79501
80578
  @Field({ nullable: true })
79502
80579
  MetadataFilter?: string | null;
79503
80580
 
80581
+ @Field({ nullable: true })
80582
+ RequiredMetadataKeys?: string | null;
80583
+
79504
80584
  @Field(() => [KeyValuePairInput], { nullable: true })
79505
80585
  OldValues___?: KeyValuePairInput[];
79506
80586
 
@@ -79625,6 +80705,16 @@ export class MJSearchScopePermission_ {
79625
80705
  @Field()
79626
80706
  _mj__UpdatedAt: Date;
79627
80707
 
80708
+ @Field({nullable: true, description: `Optional start of the window in which this grant applies. NULL = no lower bound. SearchScopePermission was the only member of this family without a time window, so temporary grants previously needed a bespoke mechanism.`})
80709
+ StartAt?: Date;
80710
+
80711
+ @Field({nullable: true, description: `Optional end of the window in which this grant applies. NULL = no upper bound.`})
80712
+ EndAt?: Date;
80713
+
80714
+ @Field({nullable: true, description: `Optional tenant this grant is limited to, matched against SearchContext.PrimaryScopeRecordID at search time and type-checkable against the scope's own PrimaryScopeEntityID. NULL = applies to every tenant, which is the pre-migration behaviour for all existing rows. Deliberately NOT called OrganizationID: MJ is domain-agnostic and a scope's primary scope may be a Company, Client or Practice, so this reuses the existing primary-scope concept rather than inventing a parallel tenancy column.`})
80715
+ @MaxLength(36)
80716
+ PrimaryScopeRecordID?: string;
80717
+
79628
80718
  @Field()
79629
80719
  @MaxLength(200)
79630
80720
  SearchScope: string;
@@ -79659,6 +80749,15 @@ export class CreateMJSearchScopePermissionInput {
79659
80749
  @Field({ nullable: true })
79660
80750
  PermissionLevel?: string;
79661
80751
 
80752
+ @Field({ nullable: true })
80753
+ StartAt: Date | null;
80754
+
80755
+ @Field({ nullable: true })
80756
+ EndAt: Date | null;
80757
+
80758
+ @Field({ nullable: true })
80759
+ PrimaryScopeRecordID: string | null;
80760
+
79662
80761
  @Field(() => RestoreContextInput, { nullable: true })
79663
80762
  RestoreContext___?: RestoreContextInput;
79664
80763
  }
@@ -79684,6 +80783,15 @@ export class UpdateMJSearchScopePermissionInput {
79684
80783
  @Field({ nullable: true })
79685
80784
  PermissionLevel?: string;
79686
80785
 
80786
+ @Field({ nullable: true })
80787
+ StartAt?: Date | null;
80788
+
80789
+ @Field({ nullable: true })
80790
+ EndAt?: Date | null;
80791
+
80792
+ @Field({ nullable: true })
80793
+ PrimaryScopeRecordID?: string | null;
80794
+
79687
80795
  @Field(() => [KeyValuePairInput], { nullable: true })
79688
80796
  OldValues___?: KeyValuePairInput[];
79689
80797
 
@@ -80422,6 +81530,9 @@ export class MJSearchScope_ {
80422
81530
  @Field(() => [MJSearchExecutionLog_])
80423
81531
  MJSearchExecutionLogs_SearchScopeIDArray: MJSearchExecutionLog_[]; // Link to MJSearchExecutionLogs
80424
81532
 
81533
+ @Field(() => [MJAISkillSearchScope_])
81534
+ MJAISkillSearchScopes_SearchScopeIDArray: MJAISkillSearchScope_[]; // Link to MJAISkillSearchScopes
81535
+
80425
81536
  }
80426
81537
 
80427
81538
  //****************************************************************************
@@ -80661,6 +81772,16 @@ export class MJSearchScopeResolver extends ResolverBase {
80661
81772
  return result;
80662
81773
  }
80663
81774
 
81775
+ @FieldResolver(() => [MJAISkillSearchScope_])
81776
+ async MJAISkillSearchScopes_SearchScopeIDArray(@Root() mjsearchscope_: MJSearchScope_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
81777
+ this.CheckUserReadPermissions('MJ: AI Skill Search Scopes', userPayload);
81778
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
81779
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwAISkillSearchScopes')} WHERE ${provider.QuoteIdentifier('SearchScopeID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Skill Search Scopes', userPayload, EntityPermissionType.Read, 'AND');
81780
+ const rows = await provider.ExecuteSQL(sSQL, [mjsearchscope_.ID], undefined, this.GetUserFromPayload(userPayload));
81781
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: AI Skill Search Scopes', rows, this.GetUserFromPayload(userPayload));
81782
+ return result;
81783
+ }
81784
+
80664
81785
  @Mutation(() => MJSearchScope_)
80665
81786
  async CreateMJSearchScope(
80666
81787
  @Arg('input', () => CreateMJSearchScopeInput) input: CreateMJSearchScopeInput,
@@ -88828,6 +89949,242 @@ export class MJTestResolver extends ResolverBase {
88828
89949
 
88829
89950
  }
88830
89951
 
89952
+ //****************************************************************************
89953
+ // ENTITY CLASS for MJ: Themes
89954
+ //****************************************************************************
89955
+ @ObjectType({ description: `A named brand theme. Stores ~8 brand seeds (color hue anchors, neutral character, vibrancy, shape, depth, type, viz palette) as JSON; the full --mj-* design-token contract is derived from the seeds at load. A theme is a brand — light/dark is the user\'s mode layered under it, so a theme carries no per-mode values.` })
89956
+ export class MJTheme_ {
89957
+ @Field()
89958
+ @MaxLength(36)
89959
+ ID: string;
89960
+
89961
+ @Field({description: `Display name for the theme (unique).`})
89962
+ @MaxLength(100)
89963
+ Name: string;
89964
+
89965
+ @Field({nullable: true, description: `Optional description of the theme.`})
89966
+ Description?: string;
89967
+
89968
+ @Field({description: `Brand seeds as JSON (the ThemeSeeds shape from @memberjunction/theme-engine): primary/accent/tertiary hue anchors, neutralChroma, vibrancy, radius, depth, fontFamily, and an optional vizPalette override. Source of truth — the full token contract is derived from this, not stored.`})
89969
+ Seeds: string;
89970
+
89971
+ @Field({nullable: true, description: `Public URL of the logo mark for light surfaces. Logos are variant uploads, never recolored.`})
89972
+ @MaxLength(1000)
89973
+ LightMarkURL?: string;
89974
+
89975
+ @Field({nullable: true, description: `Public URL of the logo mark for dark surfaces. Dark mode swaps to this artwork rather than transforming the light mark.`})
89976
+ @MaxLength(1000)
89977
+ DarkMarkURL?: string;
89978
+
89979
+ @Field({nullable: true, description: `Optional public URL of the full wordmark logo.`})
89980
+ @MaxLength(1000)
89981
+ WordmarkURL?: string;
89982
+
89983
+ @Field({nullable: true, description: `Optional public URL of a single-fill monochrome logo variant.`})
89984
+ @MaxLength(1000)
89985
+ MonochromeURL?: string;
89986
+
89987
+ @Field(() => Boolean, {description: `When 1, this is the default theme applied when no other is selected. Single-default enforcement is handled at the application layer.`})
89988
+ IsDefault: boolean;
89989
+
89990
+ @Field({description: `Lifecycle status: Active (available), Inactive (retired), or Draft (in progress, not applied).`})
89991
+ @MaxLength(20)
89992
+ Status: string;
89993
+
89994
+ @Field({nullable: true, description: `Optional advanced token overrides as a JSON object mapping a --mj-* CSS custom property name to a value (e.g. {"--mj-brand-primary-hover":"#0a5cff"}). Applied on top of the seed-derived token contract at load, before CustomCSS. Leave null to use the pure derived theme.`})
89995
+ Overrides?: string;
89996
+
89997
+ @Field({nullable: true, description: `Optional advanced raw CSS appended to the theme overlay and auto-scoped under [data-theme-overlay="<id>"]. Applied last, after the derived tokens and Overrides. Escape hatch for rules the seed/token model cannot express; leave null for none.`})
89998
+ CustomCSS?: string;
89999
+
90000
+ @Field()
90001
+ _mj__CreatedAt: Date;
90002
+
90003
+ @Field()
90004
+ _mj__UpdatedAt: Date;
90005
+
90006
+ }
90007
+
90008
+ //****************************************************************************
90009
+ // INPUT TYPE for MJ: Themes
90010
+ //****************************************************************************
90011
+ @InputType()
90012
+ export class CreateMJThemeInput {
90013
+ @Field({ nullable: true })
90014
+ ID?: string;
90015
+
90016
+ @Field({ nullable: true })
90017
+ Name?: string;
90018
+
90019
+ @Field({ nullable: true })
90020
+ Description: string | null;
90021
+
90022
+ @Field({ nullable: true })
90023
+ Seeds?: string;
90024
+
90025
+ @Field({ nullable: true })
90026
+ LightMarkURL: string | null;
90027
+
90028
+ @Field({ nullable: true })
90029
+ DarkMarkURL: string | null;
90030
+
90031
+ @Field({ nullable: true })
90032
+ WordmarkURL: string | null;
90033
+
90034
+ @Field({ nullable: true })
90035
+ MonochromeURL: string | null;
90036
+
90037
+ @Field(() => Boolean, { nullable: true })
90038
+ IsDefault?: boolean;
90039
+
90040
+ @Field({ nullable: true })
90041
+ Status?: string;
90042
+
90043
+ @Field({ nullable: true })
90044
+ Overrides: string | null;
90045
+
90046
+ @Field({ nullable: true })
90047
+ CustomCSS: string | null;
90048
+
90049
+ @Field(() => RestoreContextInput, { nullable: true })
90050
+ RestoreContext___?: RestoreContextInput;
90051
+ }
90052
+
90053
+
90054
+ //****************************************************************************
90055
+ // INPUT TYPE for MJ: Themes
90056
+ //****************************************************************************
90057
+ @InputType()
90058
+ export class UpdateMJThemeInput {
90059
+ @Field()
90060
+ ID: string;
90061
+
90062
+ @Field({ nullable: true })
90063
+ Name?: string;
90064
+
90065
+ @Field({ nullable: true })
90066
+ Description?: string | null;
90067
+
90068
+ @Field({ nullable: true })
90069
+ Seeds?: string;
90070
+
90071
+ @Field({ nullable: true })
90072
+ LightMarkURL?: string | null;
90073
+
90074
+ @Field({ nullable: true })
90075
+ DarkMarkURL?: string | null;
90076
+
90077
+ @Field({ nullable: true })
90078
+ WordmarkURL?: string | null;
90079
+
90080
+ @Field({ nullable: true })
90081
+ MonochromeURL?: string | null;
90082
+
90083
+ @Field(() => Boolean, { nullable: true })
90084
+ IsDefault?: boolean;
90085
+
90086
+ @Field({ nullable: true })
90087
+ Status?: string;
90088
+
90089
+ @Field({ nullable: true })
90090
+ Overrides?: string | null;
90091
+
90092
+ @Field({ nullable: true })
90093
+ CustomCSS?: string | null;
90094
+
90095
+ @Field(() => [KeyValuePairInput], { nullable: true })
90096
+ OldValues___?: KeyValuePairInput[];
90097
+
90098
+ @Field(() => RestoreContextInput, { nullable: true })
90099
+ RestoreContext___?: RestoreContextInput;
90100
+ }
90101
+
90102
+ //****************************************************************************
90103
+ // RESOLVER for MJ: Themes
90104
+ //****************************************************************************
90105
+ @ObjectType()
90106
+ export class RunMJThemeViewResult {
90107
+ @Field(() => [MJTheme_])
90108
+ Results: MJTheme_[];
90109
+
90110
+ @Field(() => String, {nullable: true})
90111
+ UserViewRunID?: string;
90112
+
90113
+ @Field(() => Int, {nullable: true})
90114
+ RowCount: number;
90115
+
90116
+ @Field(() => Int, {nullable: true})
90117
+ TotalRowCount: number;
90118
+
90119
+ @Field(() => Int, {nullable: true})
90120
+ ExecutionTime: number;
90121
+
90122
+ @Field({nullable: true})
90123
+ ErrorMessage?: string;
90124
+
90125
+ @Field(() => Boolean, {nullable: false})
90126
+ Success: boolean;
90127
+ }
90128
+
90129
+ @Resolver(MJTheme_)
90130
+ export class MJThemeResolver extends ResolverBase {
90131
+ @Query(() => RunMJThemeViewResult)
90132
+ async RunMJThemeViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
90133
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
90134
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
90135
+ }
90136
+
90137
+ @Query(() => RunMJThemeViewResult)
90138
+ async RunMJThemeViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
90139
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
90140
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
90141
+ }
90142
+
90143
+ @Query(() => RunMJThemeViewResult)
90144
+ async RunMJThemeDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
90145
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
90146
+ input.EntityName = 'MJ: Themes';
90147
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
90148
+ }
90149
+ @Query(() => MJTheme_, { nullable: true })
90150
+ async MJTheme(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJTheme_ | null> {
90151
+ this.CheckUserReadPermissions('MJ: Themes', userPayload);
90152
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
90153
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwThemes')} WHERE ${provider.QuoteIdentifier('ID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Themes', userPayload, EntityPermissionType.Read, 'AND');
90154
+ const rows = await provider.ExecuteSQL(sSQL, [ID], undefined, this.GetUserFromPayload(userPayload));
90155
+ const result = await this.MapFieldNamesToCodeNames('MJ: Themes', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
90156
+ return result;
90157
+ }
90158
+
90159
+ @Mutation(() => MJTheme_)
90160
+ async CreateMJTheme(
90161
+ @Arg('input', () => CreateMJThemeInput) input: CreateMJThemeInput,
90162
+ @Ctx() { providers, userPayload }: AppContext,
90163
+ @PubSub() pubSub: PubSubEngine
90164
+ ) {
90165
+ const provider = GetReadWriteProvider(providers);
90166
+ return this.CreateRecord('MJ: Themes', input, provider, userPayload, pubSub)
90167
+ }
90168
+
90169
+ @Mutation(() => MJTheme_)
90170
+ async UpdateMJTheme(
90171
+ @Arg('input', () => UpdateMJThemeInput) input: UpdateMJThemeInput,
90172
+ @Ctx() { providers, userPayload }: AppContext,
90173
+ @PubSub() pubSub: PubSubEngine
90174
+ ) {
90175
+ const provider = GetReadWriteProvider(providers);
90176
+ return this.UpdateRecord('MJ: Themes', input, provider, userPayload, pubSub);
90177
+ }
90178
+
90179
+ @Mutation(() => MJTheme_)
90180
+ async DeleteMJTheme(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
90181
+ const provider = GetReadWriteProvider(providers);
90182
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
90183
+ return this.DeleteRecord('MJ: Themes', key, options, provider, userPayload, pubSub);
90184
+ }
90185
+
90186
+ }
90187
+
88831
90188
  //****************************************************************************
88832
90189
  // ENTITY CLASS for MJ: User Application Entities
88833
90190
  //****************************************************************************