@memberjunction/server 6.2.0-edge.0 → 6.2.0-edge.1
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.
- package/dist/.tsbuildinfo +1 -1
- package/dist/agentSessions/ReturningVisitorRecap.d.ts +2 -0
- package/dist/agentSessions/ReturningVisitorRecap.d.ts.map +1 -1
- package/dist/agentSessions/ReturningVisitorRecap.js +5 -1
- package/dist/agentSessions/ReturningVisitorRecap.js.map +1 -1
- package/dist/agentSessions/SessionManager.js +2 -2
- package/dist/agentSessions/remoteBrowserGoalEngine.d.ts +8 -0
- package/dist/agentSessions/remoteBrowserGoalEngine.d.ts.map +1 -1
- package/dist/agentSessions/remoteBrowserGoalEngine.js +21 -5
- package/dist/agentSessions/remoteBrowserGoalEngine.js.map +1 -1
- package/dist/auth/AuthProviderCatalogRouter.d.ts +2 -0
- package/dist/auth/AuthProviderCatalogRouter.d.ts.map +1 -1
- package/dist/auth/AuthProviderCatalogRouter.js +5 -1
- package/dist/auth/AuthProviderCatalogRouter.js.map +1 -1
- package/dist/auth/index.d.ts +20 -1
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +20 -10
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/initializeProviders.d.ts +8 -0
- package/dist/auth/initializeProviders.d.ts.map +1 -1
- package/dist/auth/initializeProviders.js +21 -5
- package/dist/auth/initializeProviders.js.map +1 -1
- package/dist/auth/magicLink/MagicLinkRouter.d.ts +9 -0
- package/dist/auth/magicLink/MagicLinkRouter.d.ts.map +1 -1
- package/dist/auth/magicLink/MagicLinkRouter.js +22 -10
- package/dist/auth/magicLink/MagicLinkRouter.js.map +1 -1
- package/dist/auth/magicLink/MagicLinkService.d.ts +17 -15
- package/dist/auth/magicLink/MagicLinkService.d.ts.map +1 -1
- package/dist/auth/magicLink/MagicLinkService.js +65 -51
- package/dist/auth/magicLink/MagicLinkService.js.map +1 -1
- package/dist/auth/magicLink/index.d.ts +2 -2
- package/dist/auth/magicLink/index.d.ts.map +1 -1
- package/dist/auth/magicLink/index.js +2 -2
- package/dist/auth/magicLink/index.js.map +1 -1
- package/dist/auth/magicLink/magicLinkCore.d.ts +54 -33
- package/dist/auth/magicLink/magicLinkCore.d.ts.map +1 -1
- package/dist/auth/magicLink/magicLinkCore.js +61 -61
- package/dist/auth/magicLink/magicLinkCore.js.map +1 -1
- package/dist/auth/magicLink/redeemLanding.d.ts +4 -0
- package/dist/auth/magicLink/redeemLanding.d.ts.map +1 -1
- package/dist/auth/magicLink/redeemLanding.js +12 -4
- package/dist/auth/magicLink/redeemLanding.js.map +1 -1
- package/dist/auth/magicLink/types.d.ts +4 -4
- package/dist/auth/principals.d.ts +2 -0
- package/dist/auth/principals.d.ts.map +1 -1
- package/dist/auth/principals.js +6 -2
- package/dist/auth/principals.js.map +1 -1
- package/dist/cache.d.ts +2 -0
- package/dist/cache.d.ts.map +1 -1
- package/dist/cache.js +3 -1
- package/dist/cache.js.map +1 -1
- package/dist/config.d.ts +346 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +34 -4
- package/dist/config.js.map +1 -1
- package/dist/context.d.ts +20 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +27 -19
- package/dist/context.js.map +1 -1
- package/dist/directives/Public.d.ts +2 -0
- package/dist/directives/Public.d.ts.map +1 -1
- package/dist/directives/Public.js +3 -1
- package/dist/directives/Public.js.map +1 -1
- package/dist/directives/RequireSystemUser.d.ts +2 -0
- package/dist/directives/RequireSystemUser.d.ts.map +1 -1
- package/dist/directives/RequireSystemUser.js +3 -1
- package/dist/directives/RequireSystemUser.js.map +1 -1
- package/dist/generated/graphql-schemas/__mj.d.ts +11 -0
- package/dist/generated/graphql-schemas/__mj.d.ts.map +1 -1
- package/dist/generated/graphql-schemas/__mj.js +48 -0
- package/dist/generated/graphql-schemas/__mj.js.map +1 -1
- package/dist/generic/CacheInvalidationResolver.d.ts +94 -4
- package/dist/generic/CacheInvalidationResolver.d.ts.map +1 -1
- package/dist/generic/CacheInvalidationResolver.js +122 -3
- package/dist/generic/CacheInvalidationResolver.js.map +1 -1
- package/dist/generic/DeleteOptionsInput.d.ts +8 -1
- package/dist/generic/DeleteOptionsInput.d.ts.map +1 -1
- package/dist/generic/DeleteOptionsInput.js +1 -1
- package/dist/generic/DeleteOptionsInput.js.map +1 -1
- package/dist/generic/FireAndForgetHeartbeat.d.ts +3 -1
- package/dist/generic/FireAndForgetHeartbeat.d.ts.map +1 -1
- package/dist/generic/FireAndForgetHeartbeat.js +8 -4
- package/dist/generic/FireAndForgetHeartbeat.js.map +1 -1
- package/dist/generic/PushStatusResolver.d.ts +10 -1
- package/dist/generic/PushStatusResolver.d.ts.map +1 -1
- package/dist/generic/PushStatusResolver.js +11 -3
- package/dist/generic/PushStatusResolver.js.map +1 -1
- package/dist/generic/ResolverBase.d.ts +5 -1
- package/dist/generic/ResolverBase.d.ts.map +1 -1
- package/dist/generic/ResolverBase.js +15 -8
- package/dist/generic/ResolverBase.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +30 -9
- package/dist/index.js.map +1 -1
- package/dist/integration/CustomColumnPromoter.d.ts +2 -0
- package/dist/integration/CustomColumnPromoter.d.ts.map +1 -1
- package/dist/integration/CustomColumnPromoter.js +5 -1
- package/dist/integration/CustomColumnPromoter.js.map +1 -1
- package/dist/integration/EntityMapLifecycle.d.ts +4 -0
- package/dist/integration/EntityMapLifecycle.d.ts.map +1 -1
- package/dist/integration/EntityMapLifecycle.js +10 -2
- package/dist/integration/EntityMapLifecycle.js.map +1 -1
- package/dist/logging/NoLog.d.ts +4 -0
- package/dist/logging/NoLog.d.ts.map +1 -1
- package/dist/logging/NoLog.js +10 -2
- package/dist/logging/NoLog.js.map +1 -1
- package/dist/logging/StartupLogger.d.ts +2 -0
- package/dist/logging/StartupLogger.d.ts.map +1 -1
- package/dist/logging/StartupLogger.js +5 -1
- package/dist/logging/StartupLogger.js.map +1 -1
- package/dist/logging/bootAudit.d.ts +11 -7
- package/dist/logging/bootAudit.d.ts.map +1 -1
- package/dist/logging/bootAudit.js +15 -7
- package/dist/logging/bootAudit.js.map +1 -1
- package/dist/logging/boundaryLogPayload.d.ts +4 -0
- package/dist/logging/boundaryLogPayload.d.ts.map +1 -1
- package/dist/logging/boundaryLogPayload.js +5 -1
- package/dist/logging/boundaryLogPayload.js.map +1 -1
- package/dist/logging/secretRedactor.d.ts +2 -0
- package/dist/logging/secretRedactor.d.ts.map +1 -1
- package/dist/logging/secretRedactor.js +8 -4
- package/dist/logging/secretRedactor.js.map +1 -1
- package/dist/logging/shortenForLog.d.ts +2 -0
- package/dist/logging/shortenForLog.d.ts.map +1 -1
- package/dist/logging/shortenForLog.js +7 -3
- package/dist/logging/shortenForLog.js.map +1 -1
- package/dist/logging/variablesLoggingMiddleware.d.ts +2 -0
- package/dist/logging/variablesLoggingMiddleware.d.ts.map +1 -1
- package/dist/logging/variablesLoggingMiddleware.js +8 -6
- package/dist/logging/variablesLoggingMiddleware.js.map +1 -1
- package/dist/metadataRefreshSignal.d.ts +19 -0
- package/dist/metadataRefreshSignal.d.ts.map +1 -0
- package/dist/metadataRefreshSignal.js +45 -0
- package/dist/metadataRefreshSignal.js.map +1 -0
- package/dist/middleware/MJTenantFilterMiddleware.js +4 -4
- package/dist/multiTenancy/index.d.ts +8 -0
- package/dist/multiTenancy/index.d.ts.map +1 -1
- package/dist/multiTenancy/index.js +21 -5
- package/dist/multiTenancy/index.js.map +1 -1
- package/dist/realtimeWidget/WidgetRouter.d.ts +5 -0
- package/dist/realtimeWidget/WidgetRouter.d.ts.map +1 -1
- package/dist/realtimeWidget/WidgetRouter.js +14 -10
- package/dist/realtimeWidget/WidgetRouter.js.map +1 -1
- package/dist/realtimeWidget/WidgetSessionService.d.ts +6 -6
- package/dist/realtimeWidget/WidgetSessionService.js +27 -27
- package/dist/realtimeWidget/host-identity.d.ts +5 -1
- package/dist/realtimeWidget/host-identity.d.ts.map +1 -1
- package/dist/realtimeWidget/host-identity.js +11 -3
- package/dist/realtimeWidget/host-identity.js.map +1 -1
- package/dist/realtimeWidget/index.d.ts +2 -2
- package/dist/realtimeWidget/index.d.ts.map +1 -1
- package/dist/realtimeWidget/index.js +2 -2
- package/dist/realtimeWidget/index.js.map +1 -1
- package/dist/realtimeWidget/visitorIdentity.d.ts +21 -1
- package/dist/realtimeWidget/visitorIdentity.d.ts.map +1 -1
- package/dist/realtimeWidget/visitorIdentity.js +16 -4
- package/dist/realtimeWidget/visitorIdentity.js.map +1 -1
- package/dist/realtimeWidget/widgetCore.d.ts +48 -0
- package/dist/realtimeWidget/widgetCore.d.ts.map +1 -1
- package/dist/realtimeWidget/widgetCore.js +38 -10
- package/dist/realtimeWidget/widgetCore.js.map +1 -1
- package/dist/realtimeWidget/widgetGuestElevation.d.ts +10 -6
- package/dist/realtimeWidget/widgetGuestElevation.d.ts.map +1 -1
- package/dist/realtimeWidget/widgetGuestElevation.js +14 -6
- package/dist/realtimeWidget/widgetGuestElevation.js.map +1 -1
- package/dist/resolvers/AdhocQueryResolver.js +3 -3
- package/dist/resolvers/FileResolver.js +3 -3
- package/dist/resolvers/GeoResolver.d.ts +2 -2
- package/dist/resolvers/GeoResolver.js +4 -4
- package/dist/resolvers/GetDataResolver.d.ts +14 -0
- package/dist/resolvers/GetDataResolver.d.ts.map +1 -1
- package/dist/resolvers/GetDataResolver.js +43 -15
- package/dist/resolvers/GetDataResolver.js.map +1 -1
- package/dist/resolvers/IntegrationDiscoveryResolver.js +2 -2
- package/dist/resolvers/ListOperationsResolver.d.ts +20 -0
- package/dist/resolvers/ListOperationsResolver.d.ts.map +1 -1
- package/dist/resolvers/ListOperationsResolver.js +68 -28
- package/dist/resolvers/ListOperationsResolver.js.map +1 -1
- package/dist/resolvers/MCPResolver.d.ts +11 -1
- package/dist/resolvers/MCPResolver.d.ts.map +1 -1
- package/dist/resolvers/MCPResolver.js +7 -3
- package/dist/resolvers/MCPResolver.js.map +1 -1
- package/dist/resolvers/RealtimeBridgeResolver.js +3 -3
- package/dist/resolvers/RealtimeClientSessionResolver.js +3 -3
- package/dist/resolvers/RemoteBrowserActionResolver.js +5 -5
- package/dist/resolvers/RunAIAgentResolver.d.ts +10 -4
- package/dist/resolvers/RunAIAgentResolver.d.ts.map +1 -1
- package/dist/resolvers/RunAIAgentResolver.js +69 -38
- package/dist/resolvers/RunAIAgentResolver.js.map +1 -1
- package/dist/resolvers/RunAIPromptResolver.d.ts +1 -1
- package/dist/resolvers/RunAIPromptResolver.js +2 -2
- package/dist/resolvers/RunTestResolver.js +5 -5
- package/dist/resolvers/SqlLoggingConfigResolver.d.ts +8 -4
- package/dist/resolvers/SqlLoggingConfigResolver.d.ts.map +1 -1
- package/dist/resolvers/SqlLoggingConfigResolver.js +5 -5
- package/dist/resolvers/TaskGraphFrameResolver.d.ts +8 -1
- package/dist/resolvers/TaskGraphFrameResolver.d.ts.map +1 -1
- package/dist/resolvers/TaskGraphFrameResolver.js +6 -2
- package/dist/resolvers/TaskGraphFrameResolver.js.map +1 -1
- package/dist/resolvers/adhoc-query-helpers.d.ts +6 -0
- package/dist/resolvers/adhoc-query-helpers.d.ts.map +1 -1
- package/dist/resolvers/adhoc-query-helpers.js +10 -2
- package/dist/resolvers/adhoc-query-helpers.js.map +1 -1
- package/dist/resolvers/artifact-routing.d.ts +8 -8
- package/dist/resolvers/artifact-routing.js +2 -2
- package/dist/resolvers/artifact-routing.js.map +1 -1
- package/dist/resolvers/meetingRecordingRegistration.d.ts +10 -2
- package/dist/resolvers/meetingRecordingRegistration.d.ts.map +1 -1
- package/dist/resolvers/meetingRecordingRegistration.js +24 -8
- package/dist/resolvers/meetingRecordingRegistration.js.map +1 -1
- package/dist/resolvers/peaksSidecar.d.ts +4 -0
- package/dist/resolvers/peaksSidecar.d.ts.map +1 -1
- package/dist/resolvers/peaksSidecar.js +10 -2
- package/dist/resolvers/peaksSidecar.js.map +1 -1
- package/dist/rest/EntityCRUDHandler.d.ts +28 -0
- package/dist/rest/EntityCRUDHandler.d.ts.map +1 -1
- package/dist/rest/EntityCRUDHandler.js +20 -4
- package/dist/rest/EntityCRUDHandler.js.map +1 -1
- package/dist/rest/MediaStreamHandler.d.ts +2 -0
- package/dist/rest/MediaStreamHandler.d.ts.map +1 -1
- package/dist/rest/MediaStreamHandler.js +10 -6
- package/dist/rest/MediaStreamHandler.js.map +1 -1
- package/dist/rest/OAuthCallbackHandler.d.ts +9 -0
- package/dist/rest/OAuthCallbackHandler.d.ts.map +1 -1
- package/dist/rest/OAuthCallbackHandler.js +15 -3
- package/dist/rest/OAuthCallbackHandler.js.map +1 -1
- package/dist/rest/RESTEndpointHandler.d.ts +6 -4
- package/dist/rest/RESTEndpointHandler.d.ts.map +1 -1
- package/dist/rest/RESTEndpointHandler.js +15 -11
- package/dist/rest/RESTEndpointHandler.js.map +1 -1
- package/dist/rest/RealtimeSdpBrokerHandler.d.ts +5 -1
- package/dist/rest/RealtimeSdpBrokerHandler.d.ts.map +1 -1
- package/dist/rest/RealtimeSdpBrokerHandler.js +12 -4
- package/dist/rest/RealtimeSdpBrokerHandler.js.map +1 -1
- package/dist/rest/SignatureWebhookHandler.d.ts +2 -0
- package/dist/rest/SignatureWebhookHandler.d.ts.map +1 -1
- package/dist/rest/SignatureWebhookHandler.js +5 -1
- package/dist/rest/SignatureWebhookHandler.js.map +1 -1
- package/dist/rest/UploadTokenManager.d.ts +24 -8
- package/dist/rest/UploadTokenManager.d.ts.map +1 -1
- package/dist/rest/UploadTokenManager.js +53 -21
- package/dist/rest/UploadTokenManager.js.map +1 -1
- package/dist/rest/ViewOperationsHandler.d.ts +20 -0
- package/dist/rest/ViewOperationsHandler.d.ts.map +1 -1
- package/dist/rest/ViewOperationsHandler.js +20 -4
- package/dist/rest/ViewOperationsHandler.js.map +1 -1
- package/dist/rest/mediaRange.d.ts +4 -0
- package/dist/rest/mediaRange.d.ts.map +1 -1
- package/dist/rest/mediaRange.js +10 -2
- package/dist/rest/mediaRange.js.map +1 -1
- package/dist/rest/setupRESTEndpoints.d.ts +4 -0
- package/dist/rest/setupRESTEndpoints.d.ts.map +1 -1
- package/dist/rest/setupRESTEndpoints.js +13 -7
- package/dist/rest/setupRESTEndpoints.js.map +1 -1
- package/dist/serverExtensionReservedRoots.d.ts +2 -0
- package/dist/serverExtensionReservedRoots.d.ts.map +1 -1
- package/dist/serverExtensionReservedRoots.js +5 -1
- package/dist/serverExtensionReservedRoots.js.map +1 -1
- package/dist/services/TaskGraphActionRunner.d.ts +13 -8
- package/dist/services/TaskGraphActionRunner.d.ts.map +1 -1
- package/dist/services/TaskGraphActionRunner.js +16 -15
- package/dist/services/TaskGraphActionRunner.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +7 -3
- package/dist/types.js.map +1 -1
- package/dist/util.d.ts +6 -0
- package/dist/util.d.ts.map +1 -1
- package/dist/util.js +13 -5
- package/dist/util.js.map +1 -1
- package/package.json +92 -92
- package/src/__tests__/DeleteOptionsInput.wireShape.test.ts +62 -0
- package/src/__tests__/FileResolverPeaks.test.ts +13 -13
- package/src/__tests__/ListOperationsResolver.test.ts +17 -17
- package/src/__tests__/MediaStreamHandler.test.ts +28 -28
- package/src/__tests__/NoLog.test.ts +11 -11
- package/src/__tests__/PrimaryKeyAlwaysMapped.test.ts +10 -10
- package/src/__tests__/RESTEndpointHandler.test.ts +14 -14
- package/src/__tests__/RealtimeBridgeResolver.test.ts +4 -2
- package/src/__tests__/RealtimeSdpBrokerHandler.test.ts +6 -6
- package/src/__tests__/RefreshAdoptsNewColumns.test.ts +8 -8
- package/src/__tests__/RemoteBrowserGoalEngine.test.ts +18 -18
- package/src/__tests__/RunAIAgentResolver.historyFrom.test.ts +228 -0
- package/src/__tests__/TaskGraphActionRunner.durablePayload.test.ts +129 -0
- package/src/__tests__/TaskGraphFrameResolver.test.ts +2 -2
- package/src/__tests__/WidgetSessionService.test.ts +8 -4
- package/src/__tests__/adhoc-query-helpers.test.ts +21 -21
- package/src/__tests__/bootAudit.test.ts +11 -11
- package/src/__tests__/boundaryLogPayload.test.ts +6 -6
- package/src/__tests__/cacheInvalidationRecordData.test.ts +177 -0
- package/src/__tests__/databaseAbstraction.test.ts +12 -6
- package/src/__tests__/getDataTokenRedaction.test.ts +7 -7
- package/src/__tests__/initializeProviders.refresh.test.ts +4 -4
- package/src/__tests__/magicLink.test.ts +73 -134
- package/src/__tests__/magicLinkService.consume.test.ts +224 -0
- package/src/__tests__/meetingRecordingRegistration.test.ts +12 -12
- package/src/__tests__/metadataRefreshSignal.test.ts +78 -0
- package/src/__tests__/multiTenancy.security.test.ts +40 -40
- package/src/__tests__/multiTenancy.test.ts +18 -18
- package/src/__tests__/newUsers.test.ts +24 -23
- package/src/__tests__/principals.test.ts +22 -22
- package/src/__tests__/pushStatusResolver.filter.test.ts +8 -8
- package/src/__tests__/secretRedactor.failOpen.test.ts +12 -12
- package/src/__tests__/secretRedactor.test.ts +12 -12
- package/src/__tests__/serverExtensionReservedRoots.test.ts +7 -7
- package/src/__tests__/subscriptionRedaction.test.ts +5 -5
- package/src/__tests__/unifiedAuth.test.ts +15 -9
- package/src/__tests__/visitorIdentity.resolve.test.ts +6 -6
- package/src/__tests__/widget.test.ts +45 -45
- package/src/__tests__/widgetGuestElevation.test.ts +7 -7
- package/src/__tests__/widgetHostIdentity.test.ts +14 -14
- package/src/agentSessions/ReturningVisitorRecap.ts +12 -1
- package/src/agentSessions/SessionManager.ts +2 -2
- package/src/agentSessions/remoteBrowserGoalEngine.ts +30 -5
- package/src/auth/AuthProviderCatalogRouter.ts +6 -1
- package/src/auth/__tests__/backward-compatibility.test.ts +3 -3
- package/src/auth/index.ts +43 -28
- package/src/auth/initializeProviders.ts +25 -5
- package/src/auth/magicLink/MagicLinkRouter.ts +28 -10
- package/src/auth/magicLink/MagicLinkService.ts +71 -52
- package/src/auth/magicLink/index.ts +7 -7
- package/src/auth/magicLink/magicLinkCore.ts +96 -64
- package/src/auth/magicLink/redeemLanding.ts +14 -4
- package/src/auth/magicLink/types.ts +54 -54
- package/src/auth/newUsers.ts +1 -1
- package/src/auth/principals.ts +11 -2
- package/src/cache.ts +4 -1
- package/src/config.ts +37 -4
- package/src/context.ts +37 -24
- package/src/directives/Public.ts +4 -1
- package/src/directives/RequireSystemUser.ts +4 -1
- package/src/generated/graphql-schemas/__mj.ts +37 -0
- package/src/generic/CacheInvalidationResolver.ts +148 -4
- package/src/generic/DeleteOptionsInput.ts +9 -2
- package/src/generic/FireAndForgetHeartbeat.ts +19 -14
- package/src/generic/PushStatusResolver.ts +21 -7
- package/src/generic/ResolverBase.ts +16 -8
- package/src/generic/RunViewResolver.ts +22 -22
- package/src/generic/__tests__/FireAndForgetHeartbeat.test.ts +7 -7
- package/src/index.ts +35 -9
- package/src/integration/CustomColumnPromoter.ts +6 -1
- package/src/integration/EntityMapLifecycle.ts +20 -2
- package/src/logging/NoLog.ts +16 -2
- package/src/logging/StartupLogger.ts +6 -1
- package/src/logging/bootAudit.ts +26 -16
- package/src/logging/boundaryLogPayload.ts +8 -1
- package/src/logging/secretRedactor.ts +14 -9
- package/src/logging/shortenForLog.ts +8 -3
- package/src/logging/variablesLoggingMiddleware.ts +9 -6
- package/src/metadataRefreshSignal.ts +45 -0
- package/src/middleware/MJTenantFilterMiddleware.ts +4 -4
- package/src/multiTenancy/index.ts +29 -5
- package/src/realtimeWidget/WidgetRouter.ts +15 -10
- package/src/realtimeWidget/WidgetSessionService.ts +76 -76
- package/src/realtimeWidget/host-identity.ts +24 -10
- package/src/realtimeWidget/index.ts +3 -3
- package/src/realtimeWidget/visitorIdentity.ts +39 -8
- package/src/realtimeWidget/widgetCore.ts +75 -10
- package/src/realtimeWidget/widgetGuestElevation.ts +25 -12
- package/src/resolvers/AdhocQueryResolver.ts +3 -3
- package/src/resolvers/AgentSessionResolver.ts +3 -3
- package/src/resolvers/ColorResolver.ts +6 -6
- package/src/resolvers/ComponentRegistryResolver.ts +36 -36
- package/src/resolvers/EntityCommunicationsResolver.ts +4 -4
- package/src/resolvers/ExecuteRemoteOperationResolver.ts +9 -9
- package/src/resolvers/FileResolver.ts +42 -42
- package/src/resolvers/GeoResolver.ts +4 -4
- package/src/resolvers/GetDataResolver.ts +50 -15
- package/src/resolvers/IntegrationDiscoveryResolver.ts +2 -2
- package/src/resolvers/ListOperationsResolver.ts +78 -28
- package/src/resolvers/MCPResolver.ts +30 -15
- package/src/resolvers/QueryResolver.ts +13 -13
- package/src/resolvers/RealtimeBridgeResolver.ts +3 -3
- package/src/resolvers/RealtimeClientSessionResolver.ts +3 -3
- package/src/resolvers/RemoteBrowserActionResolver.ts +5 -5
- package/src/resolvers/RunAIAgentResolver.ts +113 -72
- package/src/resolvers/RunAIPromptResolver.ts +22 -22
- package/src/resolvers/RunTemplateResolver.ts +4 -4
- package/src/resolvers/RunTestResolver.ts +25 -25
- package/src/resolvers/SqlLoggingConfigResolver.ts +56 -56
- package/src/resolvers/TaskGraphFrameResolver.ts +37 -28
- package/src/resolvers/TelemetryResolver.ts +79 -79
- package/src/resolvers/__tests__/GetDataResolver.tokens.test.ts +40 -38
- package/src/resolvers/__tests__/artifact-routing.test.ts +23 -23
- package/src/resolvers/adhoc-query-helpers.ts +19 -2
- package/src/resolvers/artifact-routing.ts +19 -19
- package/src/resolvers/meetingRecordingRegistration.ts +44 -10
- package/src/resolvers/peaksSidecar.ts +12 -2
- package/src/rest/EntityCRUDHandler.ts +24 -4
- package/src/rest/MediaStreamHandler.ts +11 -6
- package/src/rest/OAuthCallbackHandler.ts +25 -7
- package/src/rest/RESTEndpointHandler.ts +20 -15
- package/src/rest/RealtimeSdpBrokerHandler.ts +14 -4
- package/src/rest/SignatureWebhookHandler.ts +6 -1
- package/src/rest/UploadTokenManager.ts +66 -30
- package/src/rest/ViewOperationsHandler.ts +24 -4
- package/src/rest/mediaRange.ts +16 -6
- package/src/rest/setupRESTEndpoints.ts +24 -12
- package/src/serverExtensionReservedRoots.ts +6 -1
- package/src/services/TaskGraphActionRunner.ts +16 -15
- package/src/types.ts +21 -16
- package/src/util.ts +16 -6
|
@@ -8,10 +8,10 @@ import { MJAIAgentEntityExtended, MJAIAgentRunEntityExtended, ExecuteAgentResult
|
|
|
8
8
|
import { AIEngine } from '@memberjunction/aiengine';
|
|
9
9
|
import { ChatMessage, ChatMessageContent } from '@memberjunction/ai';
|
|
10
10
|
import { ResolverBase } from '../generic/ResolverBase.js';
|
|
11
|
-
import {
|
|
11
|
+
import { StartLivenessPulse } from '../generic/FireAndForgetHeartbeat.js';
|
|
12
12
|
import { RequireSystemUser } from '../directives/RequireSystemUser.js';
|
|
13
13
|
import { GetReadWriteProvider } from '../util.js';
|
|
14
|
-
import {
|
|
14
|
+
import { ResolveWidgetGuestRunContext, ElevateUserPayload } from '../realtimeWidget/widgetGuestElevation.js';
|
|
15
15
|
import { SafeJSONParse, UUIDsEqual } from '@memberjunction/global';
|
|
16
16
|
import { GetAttachmentService } from '@memberjunction/aiengine';
|
|
17
17
|
import { NotificationEngine } from '@memberjunction/notifications';
|
|
@@ -28,55 +28,55 @@ const INLINE_SIZE_CAP = 100 * 1024;
|
|
|
28
28
|
@ObjectType()
|
|
29
29
|
export class AIAgentRunResult {
|
|
30
30
|
@Field()
|
|
31
|
-
success: boolean;
|
|
31
|
+
success: boolean; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
32
32
|
|
|
33
33
|
@Field({ nullable: true })
|
|
34
|
-
errorMessage?: string;
|
|
34
|
+
errorMessage?: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
35
35
|
|
|
36
36
|
@Field({ nullable: true })
|
|
37
|
-
executionTimeMs?: number;
|
|
37
|
+
executionTimeMs?: number; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
38
38
|
|
|
39
39
|
@Field()
|
|
40
|
-
result: string; // JSON serialized ExecuteAgentResult with scalars only
|
|
40
|
+
result: string; // JSON serialized ExecuteAgentResult with scalars only — case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
@ObjectType()
|
|
44
44
|
export class AgentExecutionProgress {
|
|
45
45
|
@Field()
|
|
46
|
-
currentStep: string;
|
|
46
|
+
currentStep: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
47
47
|
|
|
48
48
|
@Field({ nullable: true })
|
|
49
|
-
percentage?: number;
|
|
49
|
+
percentage?: number; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
50
50
|
|
|
51
51
|
@Field()
|
|
52
|
-
message: string;
|
|
52
|
+
message: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
53
53
|
|
|
54
54
|
@Field({ nullable: true })
|
|
55
|
-
agentName?: string;
|
|
55
|
+
agentName?: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
56
56
|
|
|
57
57
|
@Field({ nullable: true })
|
|
58
|
-
agentType?: string;
|
|
58
|
+
agentType?: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
59
59
|
|
|
60
60
|
@Field({ nullable: true })
|
|
61
|
-
stepCount?: number;
|
|
61
|
+
stepCount?: number; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
62
62
|
|
|
63
63
|
@Field({ nullable: true })
|
|
64
|
-
hierarchicalStep?: string;
|
|
64
|
+
hierarchicalStep?: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
@ObjectType()
|
|
68
68
|
export class AgentStreamingContent {
|
|
69
69
|
@Field()
|
|
70
|
-
content: string;
|
|
70
|
+
content: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
71
71
|
|
|
72
72
|
@Field()
|
|
73
|
-
isPartial: boolean;
|
|
73
|
+
isPartial: boolean; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
74
74
|
|
|
75
75
|
@Field({ nullable: true })
|
|
76
|
-
stepName?: string;
|
|
76
|
+
stepName?: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
77
77
|
|
|
78
78
|
@Field({ nullable: true })
|
|
79
|
-
agentName?: string;
|
|
79
|
+
agentName?: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
80
80
|
|
|
81
81
|
/**
|
|
82
82
|
* Content discriminator passed through from the agent's streaming chunk (see
|
|
@@ -87,73 +87,73 @@ export class AgentStreamingContent {
|
|
|
87
87
|
* rendered by the conversation client.
|
|
88
88
|
*/
|
|
89
89
|
@Field({ nullable: true })
|
|
90
|
-
kind?: string;
|
|
90
|
+
kind?: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
@ObjectType()
|
|
94
94
|
export class AgentExecutionStepSummary {
|
|
95
95
|
@Field()
|
|
96
|
-
stepId: string;
|
|
96
|
+
stepId: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
97
97
|
|
|
98
98
|
@Field()
|
|
99
|
-
stepName: string;
|
|
99
|
+
stepName: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
100
100
|
|
|
101
101
|
@Field({ nullable: true })
|
|
102
|
-
agentName?: string;
|
|
102
|
+
agentName?: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
103
103
|
|
|
104
104
|
@Field({ nullable: true })
|
|
105
|
-
agentType?: string;
|
|
105
|
+
agentType?: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
106
106
|
|
|
107
107
|
@Field()
|
|
108
|
-
startTime: Date;
|
|
108
|
+
startTime: Date; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
109
109
|
|
|
110
110
|
@Field({ nullable: true })
|
|
111
|
-
endTime?: Date;
|
|
111
|
+
endTime?: Date; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
112
112
|
|
|
113
113
|
@Field()
|
|
114
|
-
status: string;
|
|
114
|
+
status: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
115
115
|
|
|
116
116
|
@Field({ nullable: true })
|
|
117
|
-
result?: string;
|
|
117
|
+
result?: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
@ObjectType()
|
|
121
121
|
export class AgentPartialResult {
|
|
122
122
|
@Field()
|
|
123
|
-
currentStep: string;
|
|
123
|
+
currentStep: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
124
124
|
|
|
125
125
|
@Field({ nullable: true })
|
|
126
|
-
partialOutput?: string;
|
|
126
|
+
partialOutput?: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
@ObjectType()
|
|
130
130
|
export class AgentExecutionStreamMessage {
|
|
131
131
|
@Field(() => ID)
|
|
132
|
-
sessionId: string;
|
|
132
|
+
sessionId: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
133
133
|
|
|
134
134
|
@Field(() => ID)
|
|
135
|
-
agentRunId: string;
|
|
135
|
+
agentRunId: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
136
136
|
|
|
137
137
|
@Field()
|
|
138
|
-
type: 'progress' | 'streaming' | 'partial_result' | 'complete';
|
|
138
|
+
type: 'progress' | 'streaming' | 'partial_result' | 'complete'; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
139
139
|
|
|
140
140
|
@Field({ nullable: true })
|
|
141
|
-
progress?: AgentExecutionProgress;
|
|
141
|
+
progress?: AgentExecutionProgress; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
142
142
|
|
|
143
143
|
@Field({ nullable: true })
|
|
144
|
-
streaming?: AgentStreamingContent;
|
|
144
|
+
streaming?: AgentStreamingContent; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
145
145
|
|
|
146
146
|
@Field({ nullable: true })
|
|
147
|
-
partialResult?: AgentPartialResult;
|
|
147
|
+
partialResult?: AgentPartialResult; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
148
148
|
|
|
149
149
|
@Field()
|
|
150
|
-
timestamp: Date;
|
|
150
|
+
timestamp: Date; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
151
151
|
|
|
152
152
|
// Not a GraphQL field - used internally for streaming
|
|
153
|
-
agentRun?: any;
|
|
153
|
+
agentRun?: any; // case-violation-ok-legacy-back-compat: an accessor cannot be optional, so a stub would turn this into a required member
|
|
154
154
|
|
|
155
155
|
// Not a GraphQL field - used for completion routing to correct conversation detail
|
|
156
|
-
conversationDetailId?: string;
|
|
156
|
+
conversationDetailId?: string; // case-violation-ok-legacy-back-compat: an accessor cannot be optional, so a stub would turn this into a required member
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
|
|
@@ -300,11 +300,11 @@ export class RunAIAgentResolver extends ResolverBase {
|
|
|
300
300
|
},
|
|
301
301
|
timestamp: new Date()
|
|
302
302
|
};
|
|
303
|
-
this.
|
|
303
|
+
this.publishProgressUpdate(pubSub, progressMsg, userPayload);
|
|
304
304
|
};
|
|
305
305
|
}
|
|
306
306
|
|
|
307
|
-
private
|
|
307
|
+
private publishProgressUpdate(pubSub: PubSubEngine, data: any, userPayload: UserPayload) {
|
|
308
308
|
this.PublishStatusUpdate(pubSub, userPayload.sessionId, JSON.stringify({
|
|
309
309
|
resolver: 'RunAIAgentResolver',
|
|
310
310
|
type: 'ExecutionProgress',
|
|
@@ -314,7 +314,7 @@ export class RunAIAgentResolver extends ResolverBase {
|
|
|
314
314
|
}
|
|
315
315
|
|
|
316
316
|
|
|
317
|
-
private
|
|
317
|
+
private publishStreamingUpdate(pubSub: PubSubEngine, data: any, userPayload: UserPayload) {
|
|
318
318
|
this.PublishStatusUpdate(pubSub, userPayload.sessionId, JSON.stringify({
|
|
319
319
|
resolver: 'RunAIAgentResolver',
|
|
320
320
|
type: 'StreamingContent',
|
|
@@ -350,7 +350,7 @@ export class RunAIAgentResolver extends ResolverBase {
|
|
|
350
350
|
},
|
|
351
351
|
timestamp: new Date()
|
|
352
352
|
};
|
|
353
|
-
this.
|
|
353
|
+
this.publishStreamingUpdate(pubSub, streamMsg, userPayload);
|
|
354
354
|
};
|
|
355
355
|
}
|
|
356
356
|
|
|
@@ -389,7 +389,10 @@ export class RunAIAgentResolver extends ResolverBase {
|
|
|
389
389
|
* The framework intersects them with the agent's accepted skills AND the user's Run permission. */
|
|
390
390
|
requestedSkillIDs?: string[],
|
|
391
391
|
/** JSON `{ paused?: boolean }` — seeds `$.debug` on a submitted task graph at insert. */
|
|
392
|
-
taskGraphDebug?: string
|
|
392
|
+
taskGraphDebug?: string,
|
|
393
|
+
/** History floor for a conversation run — threaded into ExecuteAgentParams.ConversationHistoryFrom,
|
|
394
|
+
* so the framework's own conversation reads (retrieval tools, artifacts, compaction) honour it too. */
|
|
395
|
+
conversationHistoryFrom?: Date
|
|
393
396
|
): Promise<AIAgentRunResult> {
|
|
394
397
|
const startTime = Date.now();
|
|
395
398
|
// Best-effort handle for persistInFlightAgentFailure. Populated from a
|
|
@@ -446,6 +449,7 @@ export class RunAIAgentResolver extends ResolverBase {
|
|
|
446
449
|
planMode: planMode,
|
|
447
450
|
requestedSkillIDs: requestedSkillIDs,
|
|
448
451
|
taskGraphDebug: parseTaskGraphDebug(taskGraphDebug),
|
|
452
|
+
ConversationHistoryFrom: conversationHistoryFrom,
|
|
449
453
|
data: parsedData,
|
|
450
454
|
context: {
|
|
451
455
|
dataSource: dataSource
|
|
@@ -641,7 +645,7 @@ export class RunAIAgentResolver extends ResolverBase {
|
|
|
641
645
|
partialResult,
|
|
642
646
|
timestamp: new Date()
|
|
643
647
|
};
|
|
644
|
-
this.
|
|
648
|
+
this.publishStreamingUpdate(pubSub, partialMsg, userPayload);
|
|
645
649
|
}
|
|
646
650
|
|
|
647
651
|
// Publish completion with conversationDetailId for client-side routing.
|
|
@@ -656,7 +660,7 @@ export class RunAIAgentResolver extends ResolverBase {
|
|
|
656
660
|
errorMessage: result.agentRun?.ErrorMessage || undefined,
|
|
657
661
|
result: resultJson || undefined
|
|
658
662
|
};
|
|
659
|
-
this.
|
|
663
|
+
this.publishStreamingUpdate(pubSub, completionData, userPayload);
|
|
660
664
|
}
|
|
661
665
|
|
|
662
666
|
/**
|
|
@@ -1017,7 +1021,13 @@ export class RunAIAgentResolver extends ResolverBase {
|
|
|
1017
1021
|
@Arg('sourceArtifactVersionId', { nullable: true }) sourceArtifactVersionId?: string,
|
|
1018
1022
|
@Arg('fireAndForget', { nullable: true }) fireAndForget?: boolean,
|
|
1019
1023
|
@Arg('planMode', { nullable: true }) planMode?: boolean,
|
|
1020
|
-
@Arg('requestedSkillIDs', () => [String], { nullable: true }) requestedSkillIDs?: string[]
|
|
1024
|
+
@Arg('requestedSkillIDs', () => [String], { nullable: true }) requestedSkillIDs?: string[],
|
|
1025
|
+
/** History floor: an ISO-8601 timestamp, the first moment of the conversation this run may
|
|
1026
|
+
* read. The history is loaded from there and no summary of earlier messages is used, and the
|
|
1027
|
+
* run's own conversation reads honour it too. Omitted (clients send it only when set, so an
|
|
1028
|
+
* older client never does), the run reads the whole conversation as before. An unreadable
|
|
1029
|
+
* value fails the request rather than being dropped. */
|
|
1030
|
+
@Arg('agentHistoryFrom', { nullable: true }) agentHistoryFrom?: string
|
|
1021
1031
|
): Promise<AIAgentRunResult> {
|
|
1022
1032
|
// Check API key scope authorization for agent execution
|
|
1023
1033
|
await this.CheckAPIKeyScopeAuthorization('agent:execute', agentId, userPayload);
|
|
@@ -1040,11 +1050,14 @@ export class RunAIAgentResolver extends ResolverBase {
|
|
|
1040
1050
|
// Conversation OWNERSHIP is still enforced under the guest principal below: the guest loads its
|
|
1041
1051
|
// own ConversationDetail through the Widget Guest RLS filters, so a detail id from another
|
|
1042
1052
|
// session resolves to "not found" before any elevated work happens.
|
|
1043
|
-
const widgetElevation = await
|
|
1044
|
-
const effectiveAgentId = widgetElevation ? widgetElevation.
|
|
1045
|
-
const effectiveUserPayload = widgetElevation ?
|
|
1053
|
+
const widgetElevation = await ResolveWidgetGuestRunContext(userPayload, p);
|
|
1054
|
+
const effectiveAgentId = widgetElevation ? widgetElevation.PinnedAgentId : agentId;
|
|
1055
|
+
const effectiveUserPayload = widgetElevation ? ElevateUserPayload(userPayload, widgetElevation.ElevatedUser) : userPayload;
|
|
1046
1056
|
|
|
1047
1057
|
try {
|
|
1058
|
+
// Parsed before anything loads: a floor the caller asked for must never be dropped.
|
|
1059
|
+
const historyFrom = parseAgentHistoryFrom(agentHistoryFrom);
|
|
1060
|
+
|
|
1048
1061
|
// LATENCY OPTIMIZATION (Opt #2 + #3): Load ConversationDetail once here to extract
|
|
1049
1062
|
// conversationId, then pass it downstream. Previously this record was loaded multiple
|
|
1050
1063
|
// times: once in loadConversationHistoryWithAttachments (just to get conversationId),
|
|
@@ -1067,7 +1080,8 @@ export class RunAIAgentResolver extends ResolverBase {
|
|
|
1067
1080
|
p,
|
|
1068
1081
|
// The UI creates the agent-response placeholder row ('⏳ ...') before invoking
|
|
1069
1082
|
// this mutation — exclude it so the model never sees an empty assistant turn.
|
|
1070
|
-
[conversationDetailId]
|
|
1083
|
+
[conversationDetailId],
|
|
1084
|
+
historyFrom
|
|
1071
1085
|
);
|
|
1072
1086
|
|
|
1073
1087
|
// Convert to JSON string for the existing executeAIAgent method
|
|
@@ -1080,7 +1094,9 @@ export class RunAIAgentResolver extends ResolverBase {
|
|
|
1080
1094
|
p, dataSource, effectiveAgentId, effectiveUserPayload, messagesJson, sessionId, pubSub,
|
|
1081
1095
|
data, payload, lastRunId, autoPopulateLastRunPayload, configurationId,
|
|
1082
1096
|
conversationDetailId, createArtifacts || false, createNotification || false,
|
|
1083
|
-
sourceArtifactId, sourceArtifactVersionId, conversationId, planMode, requestedSkillIDs
|
|
1097
|
+
sourceArtifactId, sourceArtifactVersionId, conversationId, planMode, requestedSkillIDs,
|
|
1098
|
+
undefined, // taskGraphDebug
|
|
1099
|
+
historyFrom
|
|
1084
1100
|
);
|
|
1085
1101
|
|
|
1086
1102
|
LogStatus(`🔥 Fire-and-forget: Agent ${effectiveAgentId} execution started in background for session ${sessionId}`);
|
|
@@ -1114,7 +1130,9 @@ export class RunAIAgentResolver extends ResolverBase {
|
|
|
1114
1130
|
conversationId, // LATENCY OPT #2: pass pre-resolved conversationId
|
|
1115
1131
|
undefined, // runRef
|
|
1116
1132
|
planMode,
|
|
1117
|
-
requestedSkillIDs
|
|
1133
|
+
requestedSkillIDs,
|
|
1134
|
+
undefined, // taskGraphDebug
|
|
1135
|
+
historyFrom
|
|
1118
1136
|
);
|
|
1119
1137
|
} catch (error) {
|
|
1120
1138
|
const errorMessage = (error as Error).message || 'Unknown error loading conversation history';
|
|
@@ -1334,11 +1352,13 @@ export class RunAIAgentResolver extends ResolverBase {
|
|
|
1334
1352
|
planMode?: boolean,
|
|
1335
1353
|
/** Skill IDs the user requested — threaded through to ExecuteAgentParams.requestedSkillIDs. */
|
|
1336
1354
|
requestedSkillIDs?: string[],
|
|
1337
|
-
taskGraphDebug?: string
|
|
1355
|
+
taskGraphDebug?: string,
|
|
1356
|
+
/** History floor — threaded through to ExecuteAgentParams.ConversationHistoryFrom. */
|
|
1357
|
+
conversationHistoryFrom?: Date
|
|
1338
1358
|
): void {
|
|
1339
1359
|
// Ref the liveness pulse reads to enrich heartbeats once the run is created.
|
|
1340
1360
|
const runRef: { current: MJAIAgentRunEntityExtended | null } = { current: null };
|
|
1341
|
-
const pulse =
|
|
1361
|
+
const pulse = StartLivenessPulse({
|
|
1342
1362
|
pubSub,
|
|
1343
1363
|
sessionId,
|
|
1344
1364
|
ownerUserId: userPayload.userRecord.ID,
|
|
@@ -1353,7 +1373,8 @@ export class RunAIAgentResolver extends ResolverBase {
|
|
|
1353
1373
|
p, dataSource, agentId, userPayload, messagesJson, sessionId, pubSub,
|
|
1354
1374
|
data, payload, undefined, lastRunId, autoPopulateLastRunPayload,
|
|
1355
1375
|
configurationId, conversationDetailId, createArtifacts, createNotification,
|
|
1356
|
-
sourceArtifactId, sourceArtifactVersionId, conversationId, runRef, planMode, requestedSkillIDs, taskGraphDebug
|
|
1376
|
+
sourceArtifactId, sourceArtifactVersionId, conversationId, runRef, planMode, requestedSkillIDs, taskGraphDebug,
|
|
1377
|
+
conversationHistoryFrom
|
|
1357
1378
|
).catch((error: unknown) => {
|
|
1358
1379
|
// Background execution failed unexpectedly (executeAIAgent has its own try-catch,
|
|
1359
1380
|
// so this would only fire for truly unexpected errors).
|
|
@@ -1371,8 +1392,8 @@ export class RunAIAgentResolver extends ResolverBase {
|
|
|
1371
1392
|
errorMessage,
|
|
1372
1393
|
result: JSON.stringify({ success: false, errorMessage })
|
|
1373
1394
|
};
|
|
1374
|
-
this.
|
|
1375
|
-
}).finally(() => pulse.
|
|
1395
|
+
this.publishStreamingUpdate(pubSub, errorCompletionData, userPayload);
|
|
1396
|
+
}).finally(() => pulse.Stop());
|
|
1376
1397
|
}
|
|
1377
1398
|
|
|
1378
1399
|
/**
|
|
@@ -1389,7 +1410,7 @@ export class RunAIAgentResolver extends ResolverBase {
|
|
|
1389
1410
|
*
|
|
1390
1411
|
* Opt #8: Switched from ResultType 'entity_object' to 'simple' with explicit Fields.
|
|
1391
1412
|
* The history query only needs the window-assembly fields (ConversationWindowFields:
|
|
1392
|
-
* ID, Sequence, Role, Message, SummaryOfEarlierConversation) from each
|
|
1413
|
+
* ID, Sequence, Role, Message, SummaryOfEarlierConversation, __mj_CreatedAt) from each
|
|
1393
1414
|
* ConversationDetail record. Using 'entity_object' created full BaseEntity instances
|
|
1394
1415
|
* with getters/setters, dirty tracking, and validation — none of which are needed for
|
|
1395
1416
|
* read-only history assembly. The 'simple' result type returns plain JS objects,
|
|
@@ -1400,13 +1421,15 @@ export class RunAIAgentResolver extends ResolverBase {
|
|
|
1400
1421
|
contextUser: UserInfo,
|
|
1401
1422
|
maxMessages: number,
|
|
1402
1423
|
provider: IMetadataProvider,
|
|
1403
|
-
excludeDetailIds?: string[]
|
|
1424
|
+
excludeDetailIds?: string[],
|
|
1425
|
+
/** History floor: only rows written at or after it are loaded, and no summary is used. */
|
|
1426
|
+
historyFrom?: Date
|
|
1404
1427
|
): Promise<ChatMessage[]> {
|
|
1405
1428
|
// Context windowing (summary boundary + raw tail, or legacy last-N when no
|
|
1406
1429
|
// summary exists) shares ONE fold implementation with all other callers —
|
|
1407
1430
|
// ConversationEngine.AssembleContextWindow — and the ROWS come from the
|
|
1408
1431
|
// single-sourced fresh-per-request loader (same one the compaction pass uses).
|
|
1409
|
-
//
|
|
1432
|
+
// Four deliberate properties vs. the engine's cached GetAgentContextWindow:
|
|
1410
1433
|
// 1. Entity RLS applies (the engine path loads via a stored query with no
|
|
1411
1434
|
// row-level security — wrong for guest/widget-scoped users), and the
|
|
1412
1435
|
// process-global per-conversation cache — keyed by conversation, not user —
|
|
@@ -1415,10 +1438,13 @@ export class RunAIAgentResolver extends ResolverBase {
|
|
|
1415
1438
|
// cross-server staleness (a warm cache misses rows written by other nodes).
|
|
1416
1439
|
// 3. Load failure THROWS → the mutation fails, instead of silently running
|
|
1417
1440
|
// the agent against zero history.
|
|
1418
|
-
|
|
1441
|
+
// 4. A history floor (`historyFrom`) is applied in the query, so rows before it never
|
|
1442
|
+
// leave the database, and again in the assembly, which then skips the summary.
|
|
1443
|
+
const rows = await ConversationEngine.LoadWindowRowsFresh(conversationId, contextUser, provider, historyFrom);
|
|
1419
1444
|
const window = ConversationEngine.AssembleContextWindow(rows, {
|
|
1420
1445
|
maxTailMessages: maxMessages,
|
|
1421
|
-
excludeDetailIds
|
|
1446
|
+
excludeDetailIds,
|
|
1447
|
+
historyFrom
|
|
1422
1448
|
});
|
|
1423
1449
|
|
|
1424
1450
|
// Batch load input artifacts for the windowed messages. Since the backfill migration
|
|
@@ -1477,20 +1503,20 @@ export class RunAIAgentResolver extends ResolverBase {
|
|
|
1477
1503
|
const artifactType = ArtifactMetadataEngine.Instance.GetArtifactTypeByMimeType(artifactMime, ext);
|
|
1478
1504
|
|
|
1479
1505
|
const decision = RouteArtifact({
|
|
1480
|
-
|
|
1481
|
-
|
|
1506
|
+
TypeDefault: artifactType?.DefaultDeliveryMode ?? 'ToolsOnly',
|
|
1507
|
+
ForceToolsOnly: artifactVersion.ForceToolsOnly,
|
|
1482
1508
|
mimeType: artifactMime,
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1509
|
+
SizeBytes: artifactVersion.ContentSizeBytes ?? 0,
|
|
1510
|
+
InlineSizeCap: INLINE_SIZE_CAP,
|
|
1511
|
+
ModelSupportsModality: () => true,
|
|
1512
|
+
ModelName: '<resolver>',
|
|
1513
|
+
ArtifactTypeName: artifactType?.Name ?? artifactMime,
|
|
1488
1514
|
});
|
|
1489
1515
|
|
|
1490
1516
|
if (artifactVersion.ContentMode === 'File' && artifactVersion.FileID) {
|
|
1491
1517
|
if (decision.delivery !== 'inline') {
|
|
1492
|
-
if (decision.delivery === 'tools' && decision.
|
|
1493
|
-
LogStatus(`[RunAIAgentResolver] ${decision.
|
|
1518
|
+
if (decision.delivery === 'tools' && decision.Annotation) {
|
|
1519
|
+
LogStatus(`[RunAIAgentResolver] ${decision.Annotation}`);
|
|
1494
1520
|
}
|
|
1495
1521
|
continue;
|
|
1496
1522
|
}
|
|
@@ -1508,8 +1534,8 @@ export class RunAIAgentResolver extends ResolverBase {
|
|
|
1508
1534
|
// Text-mode artifact (ContentMode = 'Text'). Honor the
|
|
1509
1535
|
// routing decision the same way as for file-mode.
|
|
1510
1536
|
if (decision.delivery !== 'inline') {
|
|
1511
|
-
if (decision.delivery === 'tools' && decision.
|
|
1512
|
-
LogStatus(`[RunAIAgentResolver] ${decision.
|
|
1537
|
+
if (decision.delivery === 'tools' && decision.Annotation) {
|
|
1538
|
+
LogStatus(`[RunAIAgentResolver] ${decision.Annotation}`);
|
|
1513
1539
|
}
|
|
1514
1540
|
continue;
|
|
1515
1541
|
}
|
|
@@ -1648,6 +1674,21 @@ export class RunAIAgentResolver extends ResolverBase {
|
|
|
1648
1674
|
|
|
1649
1675
|
}
|
|
1650
1676
|
|
|
1677
|
+
/**
|
|
1678
|
+
* Reads the `agentHistoryFrom` argument of `RunAIAgentFromConversationDetail`: an ISO-8601
|
|
1679
|
+
* timestamp. Absent means no floor. A value that is present but not a timestamp throws — a
|
|
1680
|
+
* floor the caller asked for must fail the request, never be dropped, since dropping it lets
|
|
1681
|
+
* the run read the history it was meant to keep out.
|
|
1682
|
+
*/
|
|
1683
|
+
function parseAgentHistoryFrom(raw?: string | null): Date | undefined {
|
|
1684
|
+
if (raw == null) return undefined;
|
|
1685
|
+
const parsed = new Date(raw);
|
|
1686
|
+
if (Number.isNaN(parsed.getTime())) {
|
|
1687
|
+
throw new Error(`agentHistoryFrom must be an ISO-8601 timestamp; received "${raw}"`);
|
|
1688
|
+
}
|
|
1689
|
+
return parsed;
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1651
1692
|
function parseTaskGraphDebug(raw?: string): { paused?: boolean } | undefined {
|
|
1652
1693
|
if (!raw) return undefined;
|
|
1653
1694
|
const parsed: unknown = SafeJSONParse(raw);
|
|
@@ -15,70 +15,70 @@ import { GetReadWriteProvider } from '../util.js';
|
|
|
15
15
|
@ObjectType()
|
|
16
16
|
export class AIPromptRunResult {
|
|
17
17
|
@Field()
|
|
18
|
-
success: boolean;
|
|
18
|
+
success: boolean; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
19
19
|
|
|
20
20
|
@Field({ nullable: true })
|
|
21
|
-
output?: string;
|
|
21
|
+
output?: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
22
22
|
|
|
23
23
|
@Field({ nullable: true })
|
|
24
|
-
parsedResult?: string;
|
|
24
|
+
parsedResult?: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
25
25
|
|
|
26
26
|
@Field({ nullable: true })
|
|
27
|
-
error?: string;
|
|
27
|
+
error?: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
28
28
|
|
|
29
29
|
@Field({ nullable: true })
|
|
30
|
-
executionTimeMs?: number;
|
|
30
|
+
executionTimeMs?: number; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
31
31
|
|
|
32
32
|
@Field({ nullable: true })
|
|
33
|
-
tokensUsed?: number;
|
|
33
|
+
tokensUsed?: number; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
34
34
|
|
|
35
35
|
@Field({ nullable: true })
|
|
36
|
-
promptRunId?: string;
|
|
36
|
+
promptRunId?: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
37
37
|
|
|
38
38
|
@Field({ nullable: true })
|
|
39
|
-
rawResult?: string;
|
|
39
|
+
rawResult?: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
40
40
|
|
|
41
41
|
@Field({ nullable: true })
|
|
42
|
-
validationResult?: string;
|
|
42
|
+
validationResult?: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
43
43
|
|
|
44
44
|
@Field({ nullable: true })
|
|
45
|
-
chatResult?: string;
|
|
45
|
+
chatResult?: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
@ObjectType()
|
|
49
49
|
export class SimplePromptResult {
|
|
50
50
|
@Field()
|
|
51
|
-
success: boolean;
|
|
51
|
+
success: boolean; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
52
52
|
|
|
53
53
|
@Field({ nullable: true })
|
|
54
|
-
result?: string;
|
|
54
|
+
result?: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
55
55
|
|
|
56
56
|
@Field({ nullable: true })
|
|
57
|
-
resultObject?: string; // JSON stringified object
|
|
57
|
+
resultObject?: string; // JSON stringified object — case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
58
58
|
|
|
59
59
|
@Field()
|
|
60
|
-
modelName: string;
|
|
60
|
+
modelName: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
61
61
|
|
|
62
62
|
@Field({ nullable: true })
|
|
63
|
-
error?: string;
|
|
63
|
+
error?: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
64
64
|
|
|
65
65
|
@Field({ nullable: true })
|
|
66
|
-
executionTimeMs?: number;
|
|
66
|
+
executionTimeMs?: number; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
@ObjectType()
|
|
70
70
|
export class EmbedTextResult {
|
|
71
71
|
@Field(() => [[Number]])
|
|
72
|
-
embeddings: number[][];
|
|
72
|
+
embeddings: number[][]; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
73
73
|
|
|
74
74
|
@Field()
|
|
75
|
-
modelName: string;
|
|
75
|
+
modelName: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
76
76
|
|
|
77
77
|
@Field(() => Int)
|
|
78
|
-
vectorDimensions: number;
|
|
78
|
+
vectorDimensions: number; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
79
79
|
|
|
80
80
|
@Field({ nullable: true })
|
|
81
|
-
error?: string;
|
|
81
|
+
error?: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
/**
|
|
@@ -418,7 +418,7 @@ export class RunAIPromptResolver extends ResolverBase {
|
|
|
418
418
|
}
|
|
419
419
|
|
|
420
420
|
/** The `AI Model Types.Name` that means "a chat LLM", compared lowercased. */
|
|
421
|
-
private static readonly
|
|
421
|
+
private static readonly simplePromptLLMTypeName = 'llm';
|
|
422
422
|
|
|
423
423
|
/**
|
|
424
424
|
* Selects a runnable model + vendor for simple prompt execution.
|
|
@@ -551,7 +551,7 @@ export class RunAIPromptResolver extends ResolverBase {
|
|
|
551
551
|
*/
|
|
552
552
|
private isLLMModel(model: MJAIModelEntityExtended): boolean {
|
|
553
553
|
const typeName = AIEngine.Instance.ModelTypesByID.get(model.AIModelTypeID)?.Name ?? model.AIModelType;
|
|
554
|
-
return typeName?.trim().toLowerCase() === RunAIPromptResolver.
|
|
554
|
+
return typeName?.trim().toLowerCase() === RunAIPromptResolver.simplePromptLLMTypeName;
|
|
555
555
|
}
|
|
556
556
|
|
|
557
557
|
/**
|
|
@@ -9,16 +9,16 @@ import { GetReadWriteProvider } from '../util.js';
|
|
|
9
9
|
@ObjectType()
|
|
10
10
|
export class TemplateRunResult {
|
|
11
11
|
@Field()
|
|
12
|
-
success: boolean;
|
|
12
|
+
success: boolean; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
13
13
|
|
|
14
14
|
@Field({ nullable: true })
|
|
15
|
-
output?: string;
|
|
15
|
+
output?: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
16
16
|
|
|
17
17
|
@Field({ nullable: true })
|
|
18
|
-
error?: string;
|
|
18
|
+
error?: string; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
19
19
|
|
|
20
20
|
@Field({ nullable: true })
|
|
21
|
-
executionTimeMs?: number;
|
|
21
|
+
executionTimeMs?: number; // case-violation-ok-legacy-back-compat: the property name is the GraphQL schema field name — renaming it breaks every client query
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
/**
|