@memberjunction/server 5.48.0 → 5.49.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 (117) 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/config.d.ts +40 -0
  11. package/dist/config.d.ts.map +1 -1
  12. package/dist/config.js +12 -0
  13. package/dist/config.js.map +1 -1
  14. package/dist/context.d.ts.map +1 -1
  15. package/dist/context.js +28 -2
  16. package/dist/context.js.map +1 -1
  17. package/dist/generated/generated.d.ts +122 -0
  18. package/dist/generated/generated.d.ts.map +1 -1
  19. package/dist/generated/generated.js +629 -0
  20. package/dist/generated/generated.js.map +1 -1
  21. package/dist/generic/ResolverBase.d.ts.map +1 -1
  22. package/dist/generic/ResolverBase.js +4 -2
  23. package/dist/generic/ResolverBase.js.map +1 -1
  24. package/dist/generic/RunViewResolver.d.ts +1 -0
  25. package/dist/generic/RunViewResolver.d.ts.map +1 -1
  26. package/dist/generic/RunViewResolver.js +12 -0
  27. package/dist/generic/RunViewResolver.js.map +1 -1
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +73 -11
  30. package/dist/index.js.map +1 -1
  31. package/dist/integration/CustomColumnPromoter.d.ts +15 -2
  32. package/dist/integration/CustomColumnPromoter.d.ts.map +1 -1
  33. package/dist/integration/CustomColumnPromoter.js +113 -11
  34. package/dist/integration/CustomColumnPromoter.js.map +1 -1
  35. package/dist/integration/EntityMapLifecycle.d.ts +66 -0
  36. package/dist/integration/EntityMapLifecycle.d.ts.map +1 -0
  37. package/dist/integration/EntityMapLifecycle.js +189 -0
  38. package/dist/integration/EntityMapLifecycle.js.map +1 -0
  39. package/dist/realtimeProxy/RealtimeProxyServer.d.ts +10 -0
  40. package/dist/realtimeProxy/RealtimeProxyServer.d.ts.map +1 -1
  41. package/dist/realtimeProxy/RealtimeProxyServer.js +67 -1
  42. package/dist/realtimeProxy/RealtimeProxyServer.js.map +1 -1
  43. package/dist/realtimeWidget/WidgetRouter.d.ts.map +1 -1
  44. package/dist/realtimeWidget/WidgetRouter.js +6 -2
  45. package/dist/realtimeWidget/WidgetRouter.js.map +1 -1
  46. package/dist/resolvers/AdhocQueryResolver.d.ts +17 -0
  47. package/dist/resolvers/AdhocQueryResolver.d.ts.map +1 -1
  48. package/dist/resolvers/AdhocQueryResolver.js +81 -25
  49. package/dist/resolvers/AdhocQueryResolver.js.map +1 -1
  50. package/dist/resolvers/GetDataResolver.d.ts +16 -0
  51. package/dist/resolvers/GetDataResolver.d.ts.map +1 -1
  52. package/dist/resolvers/GetDataResolver.js +26 -1
  53. package/dist/resolvers/GetDataResolver.js.map +1 -1
  54. package/dist/resolvers/IntegrationDiscoveryResolver.d.ts +53 -1
  55. package/dist/resolvers/IntegrationDiscoveryResolver.d.ts.map +1 -1
  56. package/dist/resolvers/IntegrationDiscoveryResolver.js +522 -60
  57. package/dist/resolvers/IntegrationDiscoveryResolver.js.map +1 -1
  58. package/dist/resolvers/QueryResolver.d.ts.map +1 -1
  59. package/dist/resolvers/QueryResolver.js +0 -6
  60. package/dist/resolvers/QueryResolver.js.map +1 -1
  61. package/dist/resolvers/RSUResolver.d.ts +10 -0
  62. package/dist/resolvers/RSUResolver.d.ts.map +1 -1
  63. package/dist/resolvers/RSUResolver.js +28 -0
  64. package/dist/resolvers/RSUResolver.js.map +1 -1
  65. package/dist/resolvers/RunAIAgentResolver.d.ts +9 -6
  66. package/dist/resolvers/RunAIAgentResolver.d.ts.map +1 -1
  67. package/dist/resolvers/RunAIAgentResolver.js +135 -132
  68. package/dist/resolvers/RunAIAgentResolver.js.map +1 -1
  69. package/dist/resolvers/TransactionGroupResolver.d.ts +8 -1
  70. package/dist/resolvers/TransactionGroupResolver.d.ts.map +1 -1
  71. package/dist/resolvers/TransactionGroupResolver.js +29 -1
  72. package/dist/resolvers/TransactionGroupResolver.js.map +1 -1
  73. package/dist/resolvers/adhoc-query-helpers.d.ts +27 -0
  74. package/dist/resolvers/adhoc-query-helpers.d.ts.map +1 -0
  75. package/dist/resolvers/adhoc-query-helpers.js +42 -0
  76. package/dist/resolvers/adhoc-query-helpers.js.map +1 -0
  77. package/dist/rest/OAuthCallbackHandler.d.ts +9 -0
  78. package/dist/rest/OAuthCallbackHandler.d.ts.map +1 -1
  79. package/dist/rest/OAuthCallbackHandler.js +21 -4
  80. package/dist/rest/OAuthCallbackHandler.js.map +1 -1
  81. package/dist/telephony/media-upgrade-router.d.ts +14 -0
  82. package/dist/telephony/media-upgrade-router.d.ts.map +1 -1
  83. package/dist/telephony/media-upgrade-router.js +17 -1
  84. package/dist/telephony/media-upgrade-router.js.map +1 -1
  85. package/package.json +88 -88
  86. package/src/__tests__/AdhocQueryResolver.pagination.test.ts +114 -0
  87. package/src/__tests__/EntityMapLifecycle.dagWarnings.test.ts +91 -0
  88. package/src/__tests__/OAuthCallbackHandler.xss.test.ts +83 -0
  89. package/src/__tests__/RealtimeProxyServer.test.ts +53 -1
  90. package/src/__tests__/adhoc-query-helpers.test.ts +50 -0
  91. package/src/__tests__/magicLinkService.provisionLog.test.ts +106 -0
  92. package/src/__tests__/media-upgrade-router.test.ts +43 -0
  93. package/src/__tests__/unifiedAuth.test.ts +18 -3
  94. package/src/auth/magicLink/MagicLinkKeys.ts +12 -6
  95. package/src/auth/magicLink/MagicLinkRouter.ts +2 -2
  96. package/src/auth/magicLink/MagicLinkService.ts +4 -0
  97. package/src/config.ts +14 -0
  98. package/src/context.ts +28 -2
  99. package/src/generated/generated.ts +446 -1
  100. package/src/generic/ResolverBase.ts +5 -2
  101. package/src/generic/RunViewResolver.ts +11 -0
  102. package/src/index.ts +75 -11
  103. package/src/integration/CustomColumnPromoter.ts +123 -6
  104. package/src/integration/EntityMapLifecycle.ts +221 -0
  105. package/src/realtimeProxy/RealtimeProxyServer.ts +70 -1
  106. package/src/realtimeWidget/WidgetRouter.ts +6 -2
  107. package/src/resolvers/AdhocQueryResolver.ts +97 -30
  108. package/src/resolvers/GetDataResolver.ts +30 -1
  109. package/src/resolvers/IntegrationDiscoveryResolver.ts +514 -60
  110. package/src/resolvers/QueryResolver.ts +1 -7
  111. package/src/resolvers/RSUResolver.ts +28 -0
  112. package/src/resolvers/RunAIAgentResolver.ts +74 -70
  113. package/src/resolvers/TransactionGroupResolver.ts +36 -2
  114. package/src/resolvers/__tests__/GetDataResolver.tokens.test.ts +138 -0
  115. package/src/resolvers/adhoc-query-helpers.ts +50 -0
  116. package/src/rest/OAuthCallbackHandler.ts +22 -4
  117. 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, 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, 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
  //****************************************************************************
@@ -10913,6 +10913,29 @@ export class MJAIAgentType_ {
10913
10913
  @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
10914
  DefaultConfiguration?: string;
10915
10915
 
10916
+ @Field(() => Int, {nullable: true, description: `Type-level default for the in-turn context-compression message-count threshold. Overridable per agent via AIAgent.ContextCompressionMessageThreshold.`})
10917
+ ContextCompressionMessageThreshold?: number;
10918
+
10919
+ @Field({nullable: true, description: `Type-level default prompt used for in-turn context compression. Overridable per agent via AIAgent.ContextCompressionPromptID.`})
10920
+ @MaxLength(36)
10921
+ ContextCompressionPromptID?: string;
10922
+
10923
+ @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.`})
10924
+ ContextCompressionMessageRetentionCount?: number;
10925
+
10926
+ @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.`})
10927
+ ContextWindowMaxTokens?: number;
10928
+
10929
+ @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.`})
10930
+ CompactionTriggerPercent: number;
10931
+
10932
+ @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.`})
10933
+ CompactionTargetPercent: number;
10934
+
10935
+ @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.`})
10936
+ @MaxLength(36)
10937
+ ConversationSummaryPromptID?: string;
10938
+
10916
10939
  @Field({nullable: true})
10917
10940
  @MaxLength(255)
10918
10941
  SystemPrompt?: string;
@@ -10921,6 +10944,14 @@ export class MJAIAgentType_ {
10921
10944
  @MaxLength(200)
10922
10945
  DefaultStorageAccount?: string;
10923
10946
 
10947
+ @Field({nullable: true})
10948
+ @MaxLength(255)
10949
+ ContextCompressionPrompt?: string;
10950
+
10951
+ @Field({nullable: true})
10952
+ @MaxLength(255)
10953
+ ConversationSummaryPrompt?: string;
10954
+
10924
10955
  @Field(() => [MJAIAgentCoAgent_])
10925
10956
  MJAIAgentCoAgents_TargetAgentTypeIDArray: MJAIAgentCoAgent_[]; // Link to MJAIAgentCoAgents
10926
10957
 
@@ -10979,6 +11010,27 @@ export class CreateMJAIAgentTypeInput {
10979
11010
  @Field({ nullable: true })
10980
11011
  DefaultConfiguration: string | null;
10981
11012
 
11013
+ @Field(() => Int, { nullable: true })
11014
+ ContextCompressionMessageThreshold: number | null;
11015
+
11016
+ @Field({ nullable: true })
11017
+ ContextCompressionPromptID: string | null;
11018
+
11019
+ @Field(() => Int, { nullable: true })
11020
+ ContextCompressionMessageRetentionCount: number | null;
11021
+
11022
+ @Field(() => Int, { nullable: true })
11023
+ ContextWindowMaxTokens: number | null;
11024
+
11025
+ @Field(() => Int, { nullable: true })
11026
+ CompactionTriggerPercent?: number;
11027
+
11028
+ @Field(() => Int, { nullable: true })
11029
+ CompactionTargetPercent?: number;
11030
+
11031
+ @Field({ nullable: true })
11032
+ ConversationSummaryPromptID: string | null;
11033
+
10982
11034
  @Field(() => RestoreContextInput, { nullable: true })
10983
11035
  RestoreContext___?: RestoreContextInput;
10984
11036
  }
@@ -11034,6 +11086,27 @@ export class UpdateMJAIAgentTypeInput {
11034
11086
  @Field({ nullable: true })
11035
11087
  DefaultConfiguration?: string | null;
11036
11088
 
11089
+ @Field(() => Int, { nullable: true })
11090
+ ContextCompressionMessageThreshold?: number | null;
11091
+
11092
+ @Field({ nullable: true })
11093
+ ContextCompressionPromptID?: string | null;
11094
+
11095
+ @Field(() => Int, { nullable: true })
11096
+ ContextCompressionMessageRetentionCount?: number | null;
11097
+
11098
+ @Field(() => Int, { nullable: true })
11099
+ ContextWindowMaxTokens?: number | null;
11100
+
11101
+ @Field(() => Int, { nullable: true })
11102
+ CompactionTriggerPercent?: number;
11103
+
11104
+ @Field(() => Int, { nullable: true })
11105
+ CompactionTargetPercent?: number;
11106
+
11107
+ @Field({ nullable: true })
11108
+ ConversationSummaryPromptID?: string | null;
11109
+
11037
11110
  @Field(() => [KeyValuePairInput], { nullable: true })
11038
11111
  OldValues___?: KeyValuePairInput[];
11039
11112
 
@@ -11419,6 +11492,19 @@ if this limit is exceeded.`})
11419
11492
  @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
11493
  RequirePlanMode: boolean;
11421
11494
 
11495
+ @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.`})
11496
+ ContextWindowMaxTokens?: number;
11497
+
11498
+ @Field(() => Int, {nullable: true, description: `Per-agent override for the cross-turn compaction trigger percentage. Null inherits the agent type's value.`})
11499
+ CompactionTriggerPercent?: number;
11500
+
11501
+ @Field(() => Int, {nullable: true, description: `Per-agent override for the cross-turn compaction target percentage. Null inherits the agent type's value.`})
11502
+ CompactionTargetPercent?: number;
11503
+
11504
+ @Field({nullable: true, description: `Per-agent override for the cross-turn conversation compaction prompt. Null inherits the agent type's value.`})
11505
+ @MaxLength(36)
11506
+ ConversationSummaryPromptID?: string;
11507
+
11422
11508
  @Field({nullable: true})
11423
11509
  @MaxLength(255)
11424
11510
  Parent?: string;
@@ -11463,6 +11549,10 @@ if this limit is exceeded.`})
11463
11549
  @MaxLength(255)
11464
11550
  DefaultMediaCollection?: string;
11465
11551
 
11552
+ @Field({nullable: true})
11553
+ @MaxLength(255)
11554
+ ConversationSummaryPrompt?: string;
11555
+
11466
11556
  @Field({nullable: true})
11467
11557
  @MaxLength(36)
11468
11558
  RootParentID?: string;
@@ -11811,6 +11901,18 @@ export class CreateMJAIAgentInput {
11811
11901
  @Field(() => Boolean, { nullable: true })
11812
11902
  RequirePlanMode?: boolean;
11813
11903
 
11904
+ @Field(() => Int, { nullable: true })
11905
+ ContextWindowMaxTokens: number | null;
11906
+
11907
+ @Field(() => Int, { nullable: true })
11908
+ CompactionTriggerPercent: number | null;
11909
+
11910
+ @Field(() => Int, { nullable: true })
11911
+ CompactionTargetPercent: number | null;
11912
+
11913
+ @Field({ nullable: true })
11914
+ ConversationSummaryPromptID: string | null;
11915
+
11814
11916
  @Field(() => RestoreContextInput, { nullable: true })
11815
11917
  RestoreContext___?: RestoreContextInput;
11816
11918
  }
@@ -12043,6 +12145,18 @@ export class UpdateMJAIAgentInput {
12043
12145
  @Field(() => Boolean, { nullable: true })
12044
12146
  RequirePlanMode?: boolean;
12045
12147
 
12148
+ @Field(() => Int, { nullable: true })
12149
+ ContextWindowMaxTokens?: number | null;
12150
+
12151
+ @Field(() => Int, { nullable: true })
12152
+ CompactionTriggerPercent?: number | null;
12153
+
12154
+ @Field(() => Int, { nullable: true })
12155
+ CompactionTargetPercent?: number | null;
12156
+
12157
+ @Field({ nullable: true })
12158
+ ConversationSummaryPromptID?: string | null;
12159
+
12046
12160
  @Field(() => [KeyValuePairInput], { nullable: true })
12047
12161
  OldValues___?: KeyValuePairInput[];
12048
12162
 
@@ -18181,6 +18295,9 @@ export class MJAIPromptRun_ {
18181
18295
  @Field(() => [MJUserRoutineRun_])
18182
18296
  MJUserRoutineRuns_PromptRunIDArray: MJUserRoutineRun_[]; // Link to MJUserRoutineRuns
18183
18297
 
18298
+ @Field(() => [MJConversationDetail_])
18299
+ MJConversationDetails_SummaryPromptRunIDArray: MJConversationDetail_[]; // Link to MJConversationDetails
18300
+
18184
18301
  }
18185
18302
 
18186
18303
  //****************************************************************************
@@ -18864,6 +18981,16 @@ export class MJAIPromptRunResolver extends ResolverBase {
18864
18981
  return result;
18865
18982
  }
18866
18983
 
18984
+ @FieldResolver(() => [MJConversationDetail_])
18985
+ async MJConversationDetails_SummaryPromptRunIDArray(@Root() mjaipromptrun_: MJAIPromptRun_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
18986
+ this.CheckUserReadPermissions('MJ: Conversation Details', userPayload);
18987
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
18988
+ const sSQL = `SELECT * FROM ${provider.QuoteSchemaAndView(Metadata.Provider.ConfigData.MJCoreSchemaName, 'vwConversationDetails')} WHERE ${provider.QuoteIdentifier('SummaryPromptRunID')}=${provider.BuildParameterPlaceholder(0)} ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Conversation Details', userPayload, EntityPermissionType.Read, 'AND');
18989
+ const rows = await provider.ExecuteSQL(sSQL, [mjaipromptrun_.ID], undefined, this.GetUserFromPayload(userPayload));
18990
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Conversation Details', rows, this.GetUserFromPayload(userPayload));
18991
+ return result;
18992
+ }
18993
+
18867
18994
  @Mutation(() => MJAIPromptRun_)
18868
18995
  async CreateMJAIPromptRun(
18869
18996
  @Arg('input', () => CreateMJAIPromptRunInput) input: CreateMJAIPromptRunInput,
@@ -19325,6 +19452,15 @@ export class MJAIPrompt_ {
19325
19452
  @Field(() => [MJScopedPromptConfig_])
19326
19453
  MJScopedPromptConfigs_PromptIDArray: MJScopedPromptConfig_[]; // Link to MJScopedPromptConfigs
19327
19454
 
19455
+ @Field(() => [MJAIAgent_])
19456
+ MJAIAgents_ConversationSummaryPromptIDArray: MJAIAgent_[]; // Link to MJAIAgents
19457
+
19458
+ @Field(() => [MJAIAgentType_])
19459
+ MJAIAgentTypes_ContextCompressionPromptIDArray: MJAIAgentType_[]; // Link to MJAIAgentTypes
19460
+
19461
+ @Field(() => [MJAIAgentType_])
19462
+ MJAIAgentTypes_ConversationSummaryPromptIDArray: MJAIAgentType_[]; // Link to MJAIAgentTypes
19463
+
19328
19464
  }
19329
19465
 
19330
19466
  //****************************************************************************
@@ -19898,6 +20034,36 @@ export class MJAIPromptResolver extends ResolverBase {
19898
20034
  return result;
19899
20035
  }
19900
20036
 
20037
+ @FieldResolver(() => [MJAIAgent_])
20038
+ async MJAIAgents_ConversationSummaryPromptIDArray(@Root() mjaiprompt_: MJAIPrompt_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
20039
+ this.CheckUserReadPermissions('MJ: AI Agents', userPayload);
20040
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20041
+ 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');
20042
+ const rows = await provider.ExecuteSQL(sSQL, [mjaiprompt_.ID], undefined, this.GetUserFromPayload(userPayload));
20043
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: AI Agents', rows, this.GetUserFromPayload(userPayload));
20044
+ return result;
20045
+ }
20046
+
20047
+ @FieldResolver(() => [MJAIAgentType_])
20048
+ async MJAIAgentTypes_ContextCompressionPromptIDArray(@Root() mjaiprompt_: MJAIPrompt_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
20049
+ this.CheckUserReadPermissions('MJ: AI Agent Types', userPayload);
20050
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20051
+ 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');
20052
+ const rows = await provider.ExecuteSQL(sSQL, [mjaiprompt_.ID], undefined, this.GetUserFromPayload(userPayload));
20053
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Types', rows, this.GetUserFromPayload(userPayload));
20054
+ return result;
20055
+ }
20056
+
20057
+ @FieldResolver(() => [MJAIAgentType_])
20058
+ async MJAIAgentTypes_ConversationSummaryPromptIDArray(@Root() mjaiprompt_: MJAIPrompt_, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
20059
+ this.CheckUserReadPermissions('MJ: AI Agent Types', userPayload);
20060
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20061
+ 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');
20062
+ const rows = await provider.ExecuteSQL(sSQL, [mjaiprompt_.ID], undefined, this.GetUserFromPayload(userPayload));
20063
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Types', rows, this.GetUserFromPayload(userPayload));
20064
+ return result;
20065
+ }
20066
+
19901
20067
  @Mutation(() => MJAIPrompt_)
19902
20068
  async CreateMJAIPrompt(
19903
20069
  @Arg('input', () => CreateMJAIPromptInput) input: CreateMJAIPromptInput,
@@ -38050,6 +38216,13 @@ export class MJConversationDetail_ {
38050
38216
  @MaxLength(20)
38051
38217
  MediaType?: string;
38052
38218
 
38219
+ @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.`})
38220
+ Sequence: number;
38221
+
38222
+ @Field({nullable: true, description: `When SummaryOfEarlierConversation is populated by a cross-turn compaction, this links to the AIPromptRun that produced it (model, tokens, cost, prompt version). Null for ordinary (non-summary) rows.`})
38223
+ @MaxLength(36)
38224
+ SummaryPromptRunID?: string;
38225
+
38053
38226
  @Field({nullable: true})
38054
38227
  @MaxLength(255)
38055
38228
  Conversation?: string;
@@ -38078,6 +38251,10 @@ export class MJConversationDetail_ {
38078
38251
  @MaxLength(255)
38079
38252
  TestRun?: string;
38080
38253
 
38254
+ @Field({nullable: true})
38255
+ @MaxLength(255)
38256
+ SummaryPromptRun?: string;
38257
+
38081
38258
  @Field({nullable: true})
38082
38259
  @MaxLength(36)
38083
38260
  RootParentID?: string;
@@ -38206,6 +38383,12 @@ export class CreateMJConversationDetailInput {
38206
38383
  @Field({ nullable: true })
38207
38384
  MediaType: string | null;
38208
38385
 
38386
+ @Field(() => Int, { nullable: true })
38387
+ Sequence?: number;
38388
+
38389
+ @Field({ nullable: true })
38390
+ SummaryPromptRunID: string | null;
38391
+
38209
38392
  @Field(() => RestoreContextInput, { nullable: true })
38210
38393
  RestoreContext___?: RestoreContextInput;
38211
38394
  }
@@ -38306,6 +38489,12 @@ export class UpdateMJConversationDetailInput {
38306
38489
  @Field({ nullable: true })
38307
38490
  MediaType?: string | null;
38308
38491
 
38492
+ @Field(() => Int, { nullable: true })
38493
+ Sequence?: number;
38494
+
38495
+ @Field({ nullable: true })
38496
+ SummaryPromptRunID?: string | null;
38497
+
38309
38498
  @Field(() => [KeyValuePairInput], { nullable: true })
38310
38499
  OldValues___?: KeyValuePairInput[];
38311
38500
 
@@ -65814,6 +66003,14 @@ export class MJOpenApp_ {
65814
66003
  @MaxLength(500)
65815
66004
  Subpath?: string;
65816
66005
 
66006
+ @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).`})
66007
+ @MaxLength(50)
66008
+ LastCompletedStep?: string;
66009
+
66010
+ @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.`})
66011
+ @MaxLength(20)
66012
+ LastCompletedStepTargetVersion?: string;
66013
+
65817
66014
  @Field()
65818
66015
  @MaxLength(100)
65819
66016
  InstalledByUser: string;
@@ -65891,6 +66088,12 @@ export class CreateMJOpenAppInput {
65891
66088
  @Field({ nullable: true })
65892
66089
  Subpath: string | null;
65893
66090
 
66091
+ @Field({ nullable: true })
66092
+ LastCompletedStep: string | null;
66093
+
66094
+ @Field({ nullable: true })
66095
+ LastCompletedStepTargetVersion: string | null;
66096
+
65894
66097
  @Field(() => RestoreContextInput, { nullable: true })
65895
66098
  RestoreContext___?: RestoreContextInput;
65896
66099
  }
@@ -65958,6 +66161,12 @@ export class UpdateMJOpenAppInput {
65958
66161
  @Field({ nullable: true })
65959
66162
  Subpath?: string | null;
65960
66163
 
66164
+ @Field({ nullable: true })
66165
+ LastCompletedStep?: string | null;
66166
+
66167
+ @Field({ nullable: true })
66168
+ LastCompletedStepTargetVersion?: string | null;
66169
+
65961
66170
  @Field(() => [KeyValuePairInput], { nullable: true })
65962
66171
  OldValues___?: KeyValuePairInput[];
65963
66172
 
@@ -88828,6 +89037,242 @@ export class MJTestResolver extends ResolverBase {
88828
89037
 
88829
89038
  }
88830
89039
 
89040
+ //****************************************************************************
89041
+ // ENTITY CLASS for MJ: Themes
89042
+ //****************************************************************************
89043
+ @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.` })
89044
+ export class MJTheme_ {
89045
+ @Field()
89046
+ @MaxLength(36)
89047
+ ID: string;
89048
+
89049
+ @Field({description: `Display name for the theme (unique).`})
89050
+ @MaxLength(100)
89051
+ Name: string;
89052
+
89053
+ @Field({nullable: true, description: `Optional description of the theme.`})
89054
+ Description?: string;
89055
+
89056
+ @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.`})
89057
+ Seeds: string;
89058
+
89059
+ @Field({nullable: true, description: `Public URL of the logo mark for light surfaces. Logos are variant uploads, never recolored.`})
89060
+ @MaxLength(1000)
89061
+ LightMarkURL?: string;
89062
+
89063
+ @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.`})
89064
+ @MaxLength(1000)
89065
+ DarkMarkURL?: string;
89066
+
89067
+ @Field({nullable: true, description: `Optional public URL of the full wordmark logo.`})
89068
+ @MaxLength(1000)
89069
+ WordmarkURL?: string;
89070
+
89071
+ @Field({nullable: true, description: `Optional public URL of a single-fill monochrome logo variant.`})
89072
+ @MaxLength(1000)
89073
+ MonochromeURL?: string;
89074
+
89075
+ @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.`})
89076
+ IsDefault: boolean;
89077
+
89078
+ @Field({description: `Lifecycle status: Active (available), Inactive (retired), or Draft (in progress, not applied).`})
89079
+ @MaxLength(20)
89080
+ Status: string;
89081
+
89082
+ @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.`})
89083
+ Overrides?: string;
89084
+
89085
+ @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.`})
89086
+ CustomCSS?: string;
89087
+
89088
+ @Field()
89089
+ _mj__CreatedAt: Date;
89090
+
89091
+ @Field()
89092
+ _mj__UpdatedAt: Date;
89093
+
89094
+ }
89095
+
89096
+ //****************************************************************************
89097
+ // INPUT TYPE for MJ: Themes
89098
+ //****************************************************************************
89099
+ @InputType()
89100
+ export class CreateMJThemeInput {
89101
+ @Field({ nullable: true })
89102
+ ID?: string;
89103
+
89104
+ @Field({ nullable: true })
89105
+ Name?: string;
89106
+
89107
+ @Field({ nullable: true })
89108
+ Description: string | null;
89109
+
89110
+ @Field({ nullable: true })
89111
+ Seeds?: string;
89112
+
89113
+ @Field({ nullable: true })
89114
+ LightMarkURL: string | null;
89115
+
89116
+ @Field({ nullable: true })
89117
+ DarkMarkURL: string | null;
89118
+
89119
+ @Field({ nullable: true })
89120
+ WordmarkURL: string | null;
89121
+
89122
+ @Field({ nullable: true })
89123
+ MonochromeURL: string | null;
89124
+
89125
+ @Field(() => Boolean, { nullable: true })
89126
+ IsDefault?: boolean;
89127
+
89128
+ @Field({ nullable: true })
89129
+ Status?: string;
89130
+
89131
+ @Field({ nullable: true })
89132
+ Overrides: string | null;
89133
+
89134
+ @Field({ nullable: true })
89135
+ CustomCSS: string | null;
89136
+
89137
+ @Field(() => RestoreContextInput, { nullable: true })
89138
+ RestoreContext___?: RestoreContextInput;
89139
+ }
89140
+
89141
+
89142
+ //****************************************************************************
89143
+ // INPUT TYPE for MJ: Themes
89144
+ //****************************************************************************
89145
+ @InputType()
89146
+ export class UpdateMJThemeInput {
89147
+ @Field()
89148
+ ID: string;
89149
+
89150
+ @Field({ nullable: true })
89151
+ Name?: string;
89152
+
89153
+ @Field({ nullable: true })
89154
+ Description?: string | null;
89155
+
89156
+ @Field({ nullable: true })
89157
+ Seeds?: string;
89158
+
89159
+ @Field({ nullable: true })
89160
+ LightMarkURL?: string | null;
89161
+
89162
+ @Field({ nullable: true })
89163
+ DarkMarkURL?: string | null;
89164
+
89165
+ @Field({ nullable: true })
89166
+ WordmarkURL?: string | null;
89167
+
89168
+ @Field({ nullable: true })
89169
+ MonochromeURL?: string | null;
89170
+
89171
+ @Field(() => Boolean, { nullable: true })
89172
+ IsDefault?: boolean;
89173
+
89174
+ @Field({ nullable: true })
89175
+ Status?: string;
89176
+
89177
+ @Field({ nullable: true })
89178
+ Overrides?: string | null;
89179
+
89180
+ @Field({ nullable: true })
89181
+ CustomCSS?: string | null;
89182
+
89183
+ @Field(() => [KeyValuePairInput], { nullable: true })
89184
+ OldValues___?: KeyValuePairInput[];
89185
+
89186
+ @Field(() => RestoreContextInput, { nullable: true })
89187
+ RestoreContext___?: RestoreContextInput;
89188
+ }
89189
+
89190
+ //****************************************************************************
89191
+ // RESOLVER for MJ: Themes
89192
+ //****************************************************************************
89193
+ @ObjectType()
89194
+ export class RunMJThemeViewResult {
89195
+ @Field(() => [MJTheme_])
89196
+ Results: MJTheme_[];
89197
+
89198
+ @Field(() => String, {nullable: true})
89199
+ UserViewRunID?: string;
89200
+
89201
+ @Field(() => Int, {nullable: true})
89202
+ RowCount: number;
89203
+
89204
+ @Field(() => Int, {nullable: true})
89205
+ TotalRowCount: number;
89206
+
89207
+ @Field(() => Int, {nullable: true})
89208
+ ExecutionTime: number;
89209
+
89210
+ @Field({nullable: true})
89211
+ ErrorMessage?: string;
89212
+
89213
+ @Field(() => Boolean, {nullable: false})
89214
+ Success: boolean;
89215
+ }
89216
+
89217
+ @Resolver(MJTheme_)
89218
+ export class MJThemeResolver extends ResolverBase {
89219
+ @Query(() => RunMJThemeViewResult)
89220
+ async RunMJThemeViewByID(@Arg('input', () => RunViewByIDInput) input: RunViewByIDInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
89221
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
89222
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
89223
+ }
89224
+
89225
+ @Query(() => RunMJThemeViewResult)
89226
+ async RunMJThemeViewByName(@Arg('input', () => RunViewByNameInput) input: RunViewByNameInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
89227
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
89228
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
89229
+ }
89230
+
89231
+ @Query(() => RunMJThemeViewResult)
89232
+ async RunMJThemeDynamicView(@Arg('input', () => RunDynamicViewInput) input: RunDynamicViewInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
89233
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
89234
+ input.EntityName = 'MJ: Themes';
89235
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
89236
+ }
89237
+ @Query(() => MJTheme_, { nullable: true })
89238
+ async MJTheme(@Arg('ID', () => String) ID: string, @Ctx() { userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<MJTheme_ | null> {
89239
+ this.CheckUserReadPermissions('MJ: Themes', userPayload);
89240
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
89241
+ 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');
89242
+ const rows = await provider.ExecuteSQL(sSQL, [ID], undefined, this.GetUserFromPayload(userPayload));
89243
+ const result = await this.MapFieldNamesToCodeNames('MJ: Themes', rows && rows.length > 0 ? rows[0] : null, this.GetUserFromPayload(userPayload));
89244
+ return result;
89245
+ }
89246
+
89247
+ @Mutation(() => MJTheme_)
89248
+ async CreateMJTheme(
89249
+ @Arg('input', () => CreateMJThemeInput) input: CreateMJThemeInput,
89250
+ @Ctx() { providers, userPayload }: AppContext,
89251
+ @PubSub() pubSub: PubSubEngine
89252
+ ) {
89253
+ const provider = GetReadWriteProvider(providers);
89254
+ return this.CreateRecord('MJ: Themes', input, provider, userPayload, pubSub)
89255
+ }
89256
+
89257
+ @Mutation(() => MJTheme_)
89258
+ async UpdateMJTheme(
89259
+ @Arg('input', () => UpdateMJThemeInput) input: UpdateMJThemeInput,
89260
+ @Ctx() { providers, userPayload }: AppContext,
89261
+ @PubSub() pubSub: PubSubEngine
89262
+ ) {
89263
+ const provider = GetReadWriteProvider(providers);
89264
+ return this.UpdateRecord('MJ: Themes', input, provider, userPayload, pubSub);
89265
+ }
89266
+
89267
+ @Mutation(() => MJTheme_)
89268
+ async DeleteMJTheme(@Arg('ID', () => String) ID: string, @Arg('options___', () => DeleteOptionsInput) options: DeleteOptionsInput, @Ctx() { providers, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
89269
+ const provider = GetReadWriteProvider(providers);
89270
+ const key = new CompositeKey([{FieldName: 'ID', Value: ID}]);
89271
+ return this.DeleteRecord('MJ: Themes', key, options, provider, userPayload, pubSub);
89272
+ }
89273
+
89274
+ }
89275
+
88831
89276
  //****************************************************************************
88832
89277
  // ENTITY CLASS for MJ: User Application Entities
88833
89278
  //****************************************************************************
@@ -673,14 +673,17 @@ export class ResolverBase {
673
673
 
674
674
  const apiKeyEngine = GetAPIKeyEngine();
675
675
 
676
- // Check for full_access scope first (god power - bypasses all other checks)
676
+ // Check for full_access scope first (god power - bypasses all other checks).
677
+ // Use skipLogging to avoid polluting the usage log with expected denials —
678
+ // this is a fast-path optimization, not the real authorization decision.
677
679
  const fullAccessResult = await apiKeyEngine.Authorize(
678
680
  userPayload.apiKeyHash,
679
681
  'MJAPI',
680
682
  'full_access',
681
683
  '*',
682
684
  systemUser,
683
- { endpoint: '/graphql', method: 'POST' }
685
+ { endpoint: '/graphql', method: 'POST' },
686
+ { skipLogging: true }
684
687
  );
685
688
 
686
689
  if (fullAccessResult.Allowed) {