@memberjunction/server 6.2.0-edge.6 → 6.2.0-edge.7
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/README.md +69 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/agentSessions/BridgeHostInstance.d.ts +8 -3
- package/dist/agentSessions/BridgeHostInstance.d.ts.map +1 -1
- package/dist/agentSessions/BridgeHostInstance.js +14 -4
- package/dist/agentSessions/BridgeHostInstance.js.map +1 -1
- package/dist/agentSessions/HandoffOfferExpiry.d.ts +10 -0
- package/dist/agentSessions/HandoffOfferExpiry.d.ts.map +1 -0
- package/dist/agentSessions/HandoffOfferExpiry.js +18 -0
- package/dist/agentSessions/HandoffOfferExpiry.js.map +1 -0
- package/dist/agentSessions/ReturningVisitorRecap.js +1 -0
- package/dist/agentSessions/ReturningVisitorRecap.js.map +1 -1
- package/dist/agentSessions/SessionJanitor.d.ts +31 -8
- package/dist/agentSessions/SessionJanitor.d.ts.map +1 -1
- package/dist/agentSessions/SessionJanitor.js +85 -41
- package/dist/agentSessions/SessionJanitor.js.map +1 -1
- package/dist/agentSessions/SessionManager.d.ts +14 -4
- package/dist/agentSessions/SessionManager.d.ts.map +1 -1
- package/dist/agentSessions/SessionManager.js +28 -4
- package/dist/agentSessions/SessionManager.js.map +1 -1
- package/dist/agentSessions/conversationBrowsers.d.ts +61 -0
- package/dist/agentSessions/conversationBrowsers.d.ts.map +1 -0
- package/dist/agentSessions/conversationBrowsers.js +118 -0
- package/dist/agentSessions/conversationBrowsers.js.map +1 -0
- package/dist/agentSessions/sessionDeadline.d.ts +43 -0
- package/dist/agentSessions/sessionDeadline.d.ts.map +1 -0
- package/dist/agentSessions/sessionDeadline.js +68 -0
- package/dist/agentSessions/sessionDeadline.js.map +1 -0
- package/dist/auth/APIKeyScopeAuth.d.ts.map +1 -1
- package/dist/auth/APIKeyScopeAuth.js +5 -4
- package/dist/auth/APIKeyScopeAuth.js.map +1 -1
- package/dist/auth/loginEmailResolution.d.ts +41 -0
- package/dist/auth/loginEmailResolution.d.ts.map +1 -0
- package/dist/auth/loginEmailResolution.js +47 -0
- package/dist/auth/loginEmailResolution.js.map +1 -0
- package/dist/auth/magicLink/MagicLinkKeys.d.ts +50 -2
- package/dist/auth/magicLink/MagicLinkKeys.d.ts.map +1 -1
- package/dist/auth/magicLink/MagicLinkKeys.js +129 -12
- package/dist/auth/magicLink/MagicLinkKeys.js.map +1 -1
- package/dist/auth/magicLink/MagicLinkRouter.d.ts +3 -0
- package/dist/auth/magicLink/MagicLinkRouter.d.ts.map +1 -1
- package/dist/auth/magicLink/MagicLinkRouter.js +23 -5
- package/dist/auth/magicLink/MagicLinkRouter.js.map +1 -1
- package/dist/auth/magicLink/MagicLinkService.d.ts +39 -5
- package/dist/auth/magicLink/MagicLinkService.d.ts.map +1 -1
- package/dist/auth/magicLink/MagicLinkService.js +221 -9
- package/dist/auth/magicLink/MagicLinkService.js.map +1 -1
- package/dist/auth/magicLink/index.d.ts +1 -1
- package/dist/auth/magicLink/index.d.ts.map +1 -1
- package/dist/auth/magicLink/index.js +1 -1
- package/dist/auth/magicLink/index.js.map +1 -1
- package/dist/auth/magicLink/redeemLanding.d.ts +2 -2
- package/dist/auth/magicLink/redeemLanding.d.ts.map +1 -1
- package/dist/auth/magicLink/redeemLanding.js +7 -4
- package/dist/auth/magicLink/redeemLanding.js.map +1 -1
- package/dist/auth/magicLink/types.d.ts +27 -3
- package/dist/auth/magicLink/types.d.ts.map +1 -1
- package/dist/auth/magicLink/types.js +0 -4
- package/dist/auth/magicLink/types.js.map +1 -1
- package/dist/auth/newUsers.d.ts.map +1 -1
- package/dist/auth/newUsers.js +1 -0
- package/dist/auth/newUsers.js.map +1 -1
- package/dist/backgroundSweepConfigUnits.d.ts +231 -0
- package/dist/backgroundSweepConfigUnits.d.ts.map +1 -0
- package/dist/backgroundSweepConfigUnits.js +180 -0
- package/dist/backgroundSweepConfigUnits.js.map +1 -0
- package/dist/config.d.ts +906 -8
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +59 -0
- package/dist/config.js.map +1 -1
- package/dist/context.d.ts +2 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +35 -4
- package/dist/context.js.map +1 -1
- package/dist/coreRoutes.d.ts +3 -1
- package/dist/coreRoutes.d.ts.map +1 -1
- package/dist/coreRoutes.js +6 -4
- package/dist/coreRoutes.js.map +1 -1
- package/dist/generated/graphql-schemas/__mj.d.ts +228 -0
- package/dist/generated/graphql-schemas/__mj.d.ts.map +1 -1
- package/dist/generated/graphql-schemas/__mj.js +1163 -6
- package/dist/generated/graphql-schemas/__mj.js.map +1 -1
- package/dist/generic/OrphanedConversationDetailReconciler.d.ts +11 -0
- package/dist/generic/OrphanedConversationDetailReconciler.d.ts.map +1 -1
- package/dist/generic/OrphanedConversationDetailReconciler.js +27 -1
- package/dist/generic/OrphanedConversationDetailReconciler.js.map +1 -1
- package/dist/generic/ResolverBase.d.ts +50 -5
- package/dist/generic/ResolverBase.d.ts.map +1 -1
- package/dist/generic/ResolverBase.js +321 -132
- package/dist/generic/ResolverBase.js.map +1 -1
- package/dist/generic/RunViewResolver.d.ts +4 -0
- package/dist/generic/RunViewResolver.d.ts.map +1 -1
- package/dist/generic/RunViewResolver.js +47 -7
- package/dist/generic/RunViewResolver.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +157 -35
- package/dist/index.js.map +1 -1
- package/dist/integration/ConnectionPause.d.ts +121 -0
- package/dist/integration/ConnectionPause.d.ts.map +1 -0
- package/dist/integration/ConnectionPause.js +183 -0
- package/dist/integration/ConnectionPause.js.map +1 -0
- package/dist/integration/CustomColumnPromoter.d.ts +72 -6
- package/dist/integration/CustomColumnPromoter.d.ts.map +1 -1
- package/dist/integration/CustomColumnPromoter.js +87 -46
- package/dist/integration/CustomColumnPromoter.js.map +1 -1
- package/dist/integration/EntityMapLifecycle.d.ts +78 -4
- package/dist/integration/EntityMapLifecycle.d.ts.map +1 -1
- package/dist/integration/EntityMapLifecycle.js +199 -5
- package/dist/integration/EntityMapLifecycle.js.map +1 -1
- package/dist/integration/InactiveRowWarnings.d.ts +31 -0
- package/dist/integration/InactiveRowWarnings.d.ts.map +1 -1
- package/dist/integration/InactiveRowWarnings.js +29 -0
- package/dist/integration/InactiveRowWarnings.js.map +1 -1
- package/dist/integration/ObjectNamesByID.d.ts +28 -0
- package/dist/integration/ObjectNamesByID.d.ts.map +1 -0
- package/dist/integration/ObjectNamesByID.js +87 -0
- package/dist/integration/ObjectNamesByID.js.map +1 -0
- package/dist/integration/PostRestartIntrospect.d.ts +26 -0
- package/dist/integration/PostRestartIntrospect.d.ts.map +1 -0
- package/dist/integration/PostRestartIntrospect.js +27 -0
- package/dist/integration/PostRestartIntrospect.js.map +1 -0
- package/dist/integration/RSUPostRestartProgress.d.ts +176 -0
- package/dist/integration/RSUPostRestartProgress.d.ts.map +1 -0
- package/dist/integration/RSUPostRestartProgress.js +323 -0
- package/dist/integration/RSUPostRestartProgress.js.map +1 -0
- package/dist/integration/RSUProgressBridge.d.ts +41 -2
- package/dist/integration/RSUProgressBridge.d.ts.map +1 -1
- package/dist/integration/RSUProgressBridge.js +84 -1
- package/dist/integration/RSUProgressBridge.js.map +1 -1
- package/dist/integration/RunArtifactAuthorization.d.ts +39 -0
- package/dist/integration/RunArtifactAuthorization.d.ts.map +1 -0
- package/dist/integration/RunArtifactAuthorization.js +45 -0
- package/dist/integration/RunArtifactAuthorization.js.map +1 -0
- package/dist/integration/SchemaRefreshLaunch.d.ts +9 -0
- package/dist/integration/SchemaRefreshLaunch.d.ts.map +1 -1
- package/dist/integration/SchemaRefreshLaunch.js +3 -2
- package/dist/integration/SchemaRefreshLaunch.js.map +1 -1
- package/dist/integration/ScopedFieldsForBuild.d.ts +46 -0
- package/dist/integration/ScopedFieldsForBuild.d.ts.map +1 -0
- package/dist/integration/ScopedFieldsForBuild.js +91 -0
- package/dist/integration/ScopedFieldsForBuild.js.map +1 -0
- package/dist/integration/TargetConfigGuard.d.ts +40 -0
- package/dist/integration/TargetConfigGuard.d.ts.map +1 -0
- package/dist/integration/TargetConfigGuard.js +40 -0
- package/dist/integration/TargetConfigGuard.js.map +1 -0
- package/dist/realtimeSessions/ownedRealtimeSession.d.ts.map +1 -1
- package/dist/realtimeSessions/ownedRealtimeSession.js +2 -3
- package/dist/realtimeSessions/ownedRealtimeSession.js.map +1 -1
- package/dist/realtimeSessions/sessionAccess.d.ts +15 -0
- package/dist/realtimeSessions/sessionAccess.d.ts.map +1 -1
- package/dist/realtimeSessions/sessionAccess.js +22 -0
- package/dist/realtimeSessions/sessionAccess.js.map +1 -1
- package/dist/realtimeWidget/WidgetSessionService.d.ts.map +1 -1
- package/dist/realtimeWidget/WidgetSessionService.js +2 -0
- package/dist/realtimeWidget/WidgetSessionService.js.map +1 -1
- package/dist/realtimeWidget/visitorIdentity.d.ts.map +1 -1
- package/dist/realtimeWidget/visitorIdentity.js +1 -0
- package/dist/realtimeWidget/visitorIdentity.js.map +1 -1
- package/dist/realtimeWidget/widgetCore.d.ts.map +1 -1
- package/dist/realtimeWidget/widgetCore.js +4 -7
- package/dist/realtimeWidget/widgetCore.js.map +1 -1
- package/dist/realtimeWidget/widgetGuestElevation.js +1 -0
- package/dist/realtimeWidget/widgetGuestElevation.js.map +1 -1
- package/dist/requestOrigin.d.ts +22 -0
- package/dist/requestOrigin.d.ts.map +1 -0
- package/dist/requestOrigin.js +60 -0
- package/dist/requestOrigin.js.map +1 -0
- package/dist/resolvers/AgentSessionResolver.d.ts.map +1 -1
- package/dist/resolvers/AgentSessionResolver.js +6 -2
- package/dist/resolvers/AgentSessionResolver.js.map +1 -1
- package/dist/resolvers/AutotagPipelineResolver.d.ts.map +1 -1
- package/dist/resolvers/AutotagPipelineResolver.js +2 -1
- package/dist/resolvers/AutotagPipelineResolver.js.map +1 -1
- package/dist/resolvers/ConversationRunEventsResolver.d.ts.map +1 -1
- package/dist/resolvers/ConversationRunEventsResolver.js +2 -0
- package/dist/resolvers/ConversationRunEventsResolver.js.map +1 -1
- package/dist/resolvers/ExecuteRemoteOperationResolver.d.ts +6 -0
- package/dist/resolvers/ExecuteRemoteOperationResolver.d.ts.map +1 -1
- package/dist/resolvers/ExecuteRemoteOperationResolver.js +30 -7
- package/dist/resolvers/ExecuteRemoteOperationResolver.js.map +1 -1
- package/dist/resolvers/GetDataResolver.d.ts.map +1 -1
- package/dist/resolvers/GetDataResolver.js +34 -13
- package/dist/resolvers/GetDataResolver.js.map +1 -1
- package/dist/resolvers/IntegrationDiscoveryResolver.d.ts +401 -11
- package/dist/resolvers/IntegrationDiscoveryResolver.d.ts.map +1 -1
- package/dist/resolvers/IntegrationDiscoveryResolver.js +2690 -1305
- package/dist/resolvers/IntegrationDiscoveryResolver.js.map +1 -1
- package/dist/resolvers/MCPResolver.d.ts.map +1 -1
- package/dist/resolvers/MCPResolver.js +13 -2
- package/dist/resolvers/MCPResolver.js.map +1 -1
- package/dist/resolvers/QuerySystemUserResolver.d.ts +36 -0
- package/dist/resolvers/QuerySystemUserResolver.d.ts.map +1 -1
- package/dist/resolvers/QuerySystemUserResolver.js +174 -87
- package/dist/resolvers/QuerySystemUserResolver.js.map +1 -1
- package/dist/resolvers/RealtimeBridgeResolver.d.ts.map +1 -1
- package/dist/resolvers/RealtimeBridgeResolver.js +1 -0
- package/dist/resolvers/RealtimeBridgeResolver.js.map +1 -1
- package/dist/resolvers/RealtimeClientSessionResolver.d.ts +6 -0
- package/dist/resolvers/RealtimeClientSessionResolver.d.ts.map +1 -1
- package/dist/resolvers/RealtimeClientSessionResolver.js +36 -5
- package/dist/resolvers/RealtimeClientSessionResolver.js.map +1 -1
- package/dist/resolvers/RemoteBrowserActionResolver.d.ts +62 -10
- package/dist/resolvers/RemoteBrowserActionResolver.d.ts.map +1 -1
- package/dist/resolvers/RemoteBrowserActionResolver.js +217 -34
- package/dist/resolvers/RemoteBrowserActionResolver.js.map +1 -1
- package/dist/resolvers/RunAIAgentResolver.d.ts +24 -8
- package/dist/resolvers/RunAIAgentResolver.d.ts.map +1 -1
- package/dist/resolvers/RunAIAgentResolver.js +185 -67
- package/dist/resolvers/RunAIAgentResolver.js.map +1 -1
- package/dist/resolvers/RunAIPromptResolver.d.ts +5 -3
- package/dist/resolvers/RunAIPromptResolver.d.ts.map +1 -1
- package/dist/resolvers/RunAIPromptResolver.js +19 -18
- package/dist/resolvers/RunAIPromptResolver.js.map +1 -1
- package/dist/resolvers/RunTemplateResolver.d.ts.map +1 -1
- package/dist/resolvers/RunTemplateResolver.js +3 -1
- package/dist/resolvers/RunTemplateResolver.js.map +1 -1
- package/dist/resolvers/meetingRecordingRegistration.d.ts.map +1 -1
- package/dist/resolvers/meetingRecordingRegistration.js +2 -0
- package/dist/resolvers/meetingRecordingRegistration.js.map +1 -1
- package/dist/rest/MediaAccessKeys.d.ts.map +1 -1
- package/dist/rest/MediaAccessKeys.js +6 -2
- package/dist/rest/MediaAccessKeys.js.map +1 -1
- package/dist/rest/OAuthCallbackHandler.d.ts.map +1 -1
- package/dist/rest/OAuthCallbackHandler.js +11 -5
- package/dist/rest/OAuthCallbackHandler.js.map +1 -1
- package/dist/rest/RealtimeRecordingHandler.d.ts +3 -3
- package/dist/rest/RealtimeRecordingHandler.d.ts.map +1 -1
- package/dist/rest/RealtimeRecordingHandler.js +2 -4
- package/dist/rest/RealtimeRecordingHandler.js.map +1 -1
- package/dist/rest/ViewOperationsHandler.d.ts.map +1 -1
- package/dist/rest/ViewOperationsHandler.js +2 -1
- package/dist/rest/ViewOperationsHandler.js.map +1 -1
- package/dist/rest/setupRESTEndpoints.d.ts +3 -1
- package/dist/rest/setupRESTEndpoints.d.ts.map +1 -1
- package/dist/rest/setupRESTEndpoints.js +11 -2
- package/dist/rest/setupRESTEndpoints.js.map +1 -1
- package/dist/services/DurableEntityActionTaskSubmitter.d.ts.map +1 -1
- package/dist/services/DurableEntityActionTaskSubmitter.js +6 -1
- package/dist/services/DurableEntityActionTaskSubmitter.js.map +1 -1
- package/dist/services/TaskGraphActionRunner.d.ts.map +1 -1
- package/dist/services/TaskGraphActionRunner.js +2 -26
- package/dist/services/TaskGraphActionRunner.js.map +1 -1
- package/dist/services/TaskGraphAgentRunner.d.ts +6 -0
- package/dist/services/TaskGraphAgentRunner.d.ts.map +1 -1
- package/dist/services/TaskGraphAgentRunner.js +38 -0
- package/dist/services/TaskGraphAgentRunner.js.map +1 -1
- package/dist/services/TaskGraphContinuationDeliverer.d.ts.map +1 -1
- package/dist/services/TaskGraphContinuationDeliverer.js +1 -0
- package/dist/services/TaskGraphContinuationDeliverer.js.map +1 -1
- package/dist/services/WorkQueueHostService.d.ts +2 -1
- package/dist/services/WorkQueueHostService.d.ts.map +1 -1
- package/dist/services/WorkQueueHostService.js +19 -4
- package/dist/services/WorkQueueHostService.js.map +1 -1
- package/dist/services/workQueueConfig.d.ts +2 -2
- package/dist/services/workQueueConfig.js +5 -5
- package/dist/services/workQueueConfig.js.map +1 -1
- package/dist/sharedCache.js +1 -1
- package/dist/sharedCache.js.map +1 -1
- package/dist/types.d.ts +17 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +98 -98
- package/src/__tests__/APIKeyScopeAuth.test.ts +4 -8
- package/src/__tests__/ActiveOperations.test.ts +68 -0
- package/src/__tests__/AgentSessionResolver.ownership.test.ts +13 -0
- package/src/__tests__/AssertTargetConfigs.test.ts +75 -0
- package/src/__tests__/BatchApplyParity.test.ts +109 -0
- package/src/__tests__/BridgeHostInstance.test.ts +42 -0
- package/src/__tests__/CollectInactiveRowWarnings.test.ts +115 -0
- package/src/__tests__/ConnectionPause.test.ts +192 -0
- package/src/__tests__/ConnectionPauseResolver.test.ts +166 -0
- package/src/__tests__/ConnectionPauseSave.test.ts +143 -0
- package/src/__tests__/CustomColumnPromoterCompletion.test.ts +142 -0
- package/src/__tests__/DeleteConnectionRemovesPerConnectionCatalog.test.ts +51 -0
- package/src/__tests__/DetachedDiscoveryStart.test.ts +65 -0
- package/src/__tests__/DurableEntityActionTaskSubmitter.test.ts +73 -0
- package/src/__tests__/EntityMapLifecycle.rekey.test.ts +252 -0
- package/src/__tests__/ExecuteRemoteOperationResolver.test.ts +213 -0
- package/src/__tests__/HandoffOfferExpiry.test.ts +40 -0
- package/src/__tests__/IntegrationRunArtifactAuthorization.test.ts +126 -0
- package/src/__tests__/MagicLinkKeys.test.ts +102 -0
- package/src/__tests__/MediaAccessKeys.test.ts +57 -10
- package/src/__tests__/NewArrivalsDefaultDisabled.test.ts +50 -0
- package/src/__tests__/ObjectNamesByID.test.ts +176 -0
- package/src/__tests__/PostRestartMapsInCatalogScope.test.ts +146 -0
- package/src/__tests__/QuerySystemUserResolver.childRows.test.ts +80 -0
- package/src/__tests__/QuerySystemUserResolver.collision.test.ts +200 -0
- package/src/__tests__/QuerySystemUserResolver.permissions.test.ts +132 -0
- package/src/__tests__/RSUPostRestartProgress.test.ts +343 -0
- package/src/__tests__/RSUProgressBridge.test.ts +188 -5
- package/src/__tests__/RSUStartupSweepWiring.test.ts +30 -0
- package/src/__tests__/ReactivateRefreshMessage.test.ts +10 -3
- package/src/__tests__/RealtimeClientSessionResolver.test.ts +22 -0
- package/src/__tests__/{RefreshAdoptsNewColumns.test.ts → RefreshReportsNewColumns.test.ts} +25 -16
- package/src/__tests__/RemoteBrowserActionRecovery.test.ts +287 -0
- package/src/__tests__/RemoteBrowserActionResolver.goalRunLink.test.ts +3 -0
- package/src/__tests__/RemoteBrowserActionResolver.ownership.test.ts +6 -4
- package/src/__tests__/RemoteBrowserAudioStream.test.ts +3 -0
- package/src/__tests__/RemoteBrowserSnapshot.test.ts +3 -0
- package/src/__tests__/ResolverBase.clientOldValues.test.ts +323 -26
- package/src/__tests__/ResolverBase.encryptedApiZeroReencrypt.test.ts +307 -0
- package/src/__tests__/ResolverBase.entityMessageRelay.test.ts +53 -2
- package/src/__tests__/ResolverBase.includeBinaryFields.test.ts +60 -0
- package/src/__tests__/RunAIAgentResolver.branch.test.ts +4 -0
- package/src/__tests__/RunAIAgentResolver.consultPredecessor.test.ts +289 -0
- package/src/__tests__/RunAIAgentResolver.handoff.test.ts +649 -0
- package/src/__tests__/RunAIAgentResolver.historyFrom.test.ts +2 -0
- package/src/__tests__/RunAIAgentResolver.runDataGuard.test.ts +2 -0
- package/src/__tests__/RunAIAgentResolver.stoppedPredecessor.test.ts +87 -12
- package/src/__tests__/SchemaEvolutionCustomColumns.test.ts +119 -0
- package/src/__tests__/SchemaRefreshLaunch.test.ts +24 -2
- package/src/__tests__/ScopedFieldsForBuild.test.ts +192 -0
- package/src/__tests__/SessionJanitor.test.ts +195 -4
- package/src/__tests__/SessionManager.test.ts +69 -0
- package/src/__tests__/TaskGraphActionRunner.durablePayload.test.ts +2 -2
- package/src/__tests__/TaskGraphAgentRunner.test.ts +272 -16
- package/src/__tests__/ViewOperationsHandler.test.ts +2 -5
- package/src/__tests__/WorkQueueHostService.test.ts +25 -7
- package/src/__tests__/backgroundSweepConfigUnits.test.ts +153 -0
- package/src/__tests__/contextRequestOrigin.test.ts +105 -0
- package/src/__tests__/conversationBrowsers.test.ts +62 -0
- package/src/__tests__/magicLinkExtensionCapabilities.test.ts +413 -0
- package/src/__tests__/orphanedConversationDetailReconciler.start.test.ts +82 -0
- package/src/__tests__/ownedRealtimeSession.test.ts +14 -0
- package/src/__tests__/realtimeRecordingHandler.test.ts +7 -2
- package/src/__tests__/realtimeSessions/sessionAccess.test.ts +79 -1
- package/src/__tests__/requestOrigin.test.ts +104 -0
- package/src/__tests__/securityHardeningPr6034.test.ts +120 -0
- package/src/__tests__/sessionDeadline.test.ts +51 -0
- package/src/__tests__/sharedCache.test.ts +11 -0
- package/src/__tests__/unifiedAuth.test.ts +73 -1
- package/src/agentSessions/BridgeHostInstance.ts +20 -5
- package/src/agentSessions/HandoffOfferExpiry.ts +18 -0
- package/src/agentSessions/ReturningVisitorRecap.ts +1 -0
- package/src/agentSessions/SessionJanitor.ts +92 -42
- package/src/agentSessions/SessionManager.ts +38 -8
- package/src/agentSessions/conversationBrowsers.ts +143 -0
- package/src/agentSessions/sessionDeadline.ts +81 -0
- package/src/auth/APIKeyScopeAuth.ts +5 -4
- package/src/auth/__tests__/loginEmailResolution.test.ts +67 -0
- package/src/auth/loginEmailResolution.ts +67 -0
- package/src/auth/magicLink/MagicLinkKeys.ts +146 -14
- package/src/auth/magicLink/MagicLinkRouter.ts +33 -6
- package/src/auth/magicLink/MagicLinkService.ts +250 -10
- package/src/auth/magicLink/index.ts +1 -1
- package/src/auth/magicLink/redeemLanding.ts +7 -4
- package/src/auth/magicLink/types.ts +28 -3
- package/src/auth/newUsers.ts +1 -0
- package/src/backgroundSweepConfigUnits.ts +213 -0
- package/src/config.ts +69 -0
- package/src/context.ts +39 -6
- package/src/coreRoutes.ts +14 -7
- package/src/generated/graphql-schemas/__mj.ts +822 -7
- package/src/generic/OrphanedConversationDetailReconciler.ts +32 -1
- package/src/generic/ResolverBase.ts +414 -143
- package/src/generic/RunViewResolver.ts +96 -49
- package/src/index.ts +201 -35
- package/src/integration/ConnectionPause.ts +222 -0
- package/src/integration/CustomColumnPromoter.ts +123 -53
- package/src/integration/EntityMapLifecycle.ts +229 -6
- package/src/integration/InactiveRowWarnings.ts +50 -0
- package/src/integration/ObjectNamesByID.ts +97 -0
- package/src/integration/PostRestartIntrospect.ts +49 -0
- package/src/integration/RSUPostRestartProgress.ts +359 -0
- package/src/integration/RSUProgressBridge.ts +85 -2
- package/src/integration/RunArtifactAuthorization.ts +65 -0
- package/src/integration/SchemaRefreshLaunch.ts +12 -2
- package/src/integration/ScopedFieldsForBuild.ts +113 -0
- package/src/integration/TargetConfigGuard.ts +71 -0
- package/src/realtimeSessions/ownedRealtimeSession.ts +2 -6
- package/src/realtimeSessions/sessionAccess.ts +30 -0
- package/src/realtimeWidget/WidgetSessionService.ts +2 -0
- package/src/realtimeWidget/visitorIdentity.ts +1 -0
- package/src/realtimeWidget/widgetCore.ts +4 -8
- package/src/realtimeWidget/widgetGuestElevation.ts +1 -0
- package/src/requestOrigin.ts +64 -0
- package/src/resolvers/AgentSessionResolver.ts +6 -2
- package/src/resolvers/AutotagPipelineResolver.ts +2 -1
- package/src/resolvers/ConversationRunEventsResolver.ts +2 -0
- package/src/resolvers/ExecuteRemoteOperationResolver.ts +41 -9
- package/src/resolvers/GetDataResolver.ts +35 -13
- package/src/resolvers/IntegrationDiscoveryResolver.ts +1522 -203
- package/src/resolvers/MCPResolver.ts +15 -2
- package/src/resolvers/QuerySystemUserResolver.ts +197 -98
- package/src/resolvers/RealtimeBridgeResolver.ts +1 -0
- package/src/resolvers/RealtimeClientSessionResolver.ts +40 -7
- package/src/resolvers/RemoteBrowserActionResolver.ts +242 -32
- package/src/resolvers/RunAIAgentResolver.ts +265 -86
- package/src/resolvers/RunAIPromptResolver.ts +18 -18
- package/src/resolvers/RunTemplateResolver.ts +3 -1
- package/src/resolvers/__tests__/GetDataResolver.tokens.test.ts +52 -0
- package/src/resolvers/meetingRecordingRegistration.ts +2 -0
- package/src/rest/MediaAccessKeys.ts +6 -2
- package/src/rest/OAuthCallbackHandler.ts +13 -5
- package/src/rest/RealtimeRecordingHandler.ts +5 -9
- package/src/rest/ViewOperationsHandler.ts +2 -1
- package/src/rest/setupRESTEndpoints.ts +11 -2
- package/src/services/DurableEntityActionTaskSubmitter.ts +10 -2
- package/src/services/TaskGraphActionRunner.ts +2 -23
- package/src/services/TaskGraphAgentRunner.ts +43 -0
- package/src/services/TaskGraphContinuationDeliverer.ts +1 -0
- package/src/services/WorkQueueHostService.ts +26 -4
- package/src/services/workQueueConfig.ts +5 -5
- package/src/sharedCache.ts +1 -1
- package/src/types.ts +18 -0
- package/src/services/TaskOrchestration-Integration.md +0 -188
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
|
|
2
|
-
import { mkdtempSync, rmSync, readFileSync, existsSync } from 'node:fs';
|
|
2
|
+
import { mkdtempSync, rmSync, readFileSync, existsSync, statSync } from 'node:fs';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import { tmpdir } from 'node:os';
|
|
5
5
|
import { RSUProgressBridge } from '../integration/RSUProgressBridge.js';
|
|
@@ -44,12 +44,39 @@ describe('RSUProgressBridge', () => {
|
|
|
44
44
|
ItemCount: 2,
|
|
45
45
|
Descriptions: ['add Orders', 'add OrderItems'],
|
|
46
46
|
AffectedTables: ['Orders', 'OrderItems'],
|
|
47
|
-
StepTotal:
|
|
47
|
+
StepTotal: 14,
|
|
48
|
+
CompanyIntegrationIDs: ['CI-1'],
|
|
48
49
|
};
|
|
49
50
|
|
|
50
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* Waits for the emitter's append chain to quiesce.
|
|
53
|
+
*
|
|
54
|
+
* This was a flat 50 ms sleep, which is plenty on an idle machine and NOT always enough with
|
|
55
|
+
* the whole suite running in parallel — the emitter appends through a promise chain the test
|
|
56
|
+
* cannot await, so a slow write made the assertion read "the event was never emitted" when it
|
|
57
|
+
* simply had not landed yet. Observed as an intermittent failure of the stage.error test.
|
|
58
|
+
* Poll for the journal to stop growing instead of guessing how long that takes.
|
|
59
|
+
*/
|
|
51
60
|
async function settle(): Promise<void> {
|
|
52
|
-
|
|
61
|
+
const path = join(rootDir, bridge.CurrentRunID ?? '', 'progress.jsonl');
|
|
62
|
+
const deadline = Date.now() + 5000;
|
|
63
|
+
let last = -1;
|
|
64
|
+
let stableReads = 0;
|
|
65
|
+
while (Date.now() < deadline) {
|
|
66
|
+
await new Promise(resolve => setTimeout(resolve, 10));
|
|
67
|
+
let size = -1;
|
|
68
|
+
try { size = statSync(path).size; } catch { /* not written yet */ }
|
|
69
|
+
if (size === last) {
|
|
70
|
+
stableReads++;
|
|
71
|
+
// A journal that exists and has stopped growing is settled. One that does not
|
|
72
|
+
// exist at all gets a short grace period and then counts as settled too, so a
|
|
73
|
+
// test asserting that NOTHING was written does not pay the full deadline.
|
|
74
|
+
if (stableReads >= 3 && (size >= 0 || stableReads >= 20)) return;
|
|
75
|
+
} else {
|
|
76
|
+
stableReads = 0;
|
|
77
|
+
last = size;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
53
80
|
}
|
|
54
81
|
|
|
55
82
|
function runDir(): string {
|
|
@@ -100,7 +127,7 @@ describe('RSUProgressBridge', () => {
|
|
|
100
127
|
expect(manifest.context).toMatchObject({
|
|
101
128
|
itemCount: 2,
|
|
102
129
|
affectedTables: ['Orders', 'OrderItems'],
|
|
103
|
-
stepTotal:
|
|
130
|
+
stepTotal: 14,
|
|
104
131
|
});
|
|
105
132
|
|
|
106
133
|
const events = readEvents(dir);
|
|
@@ -237,6 +264,162 @@ describe('RSUProgressBridge', () => {
|
|
|
237
264
|
expect(start?.message).toBe('step 0 of 12');
|
|
238
265
|
});
|
|
239
266
|
|
|
267
|
+
// ── Connection identity: what makes an RSU run readable over the API at all ──────────────
|
|
268
|
+
|
|
269
|
+
it('stamps the batch connections onto the manifest, which is what the read check tests', async () => {
|
|
270
|
+
// Before this, an RSU manifest carried no connection, `userCanReadRunArtifact` returned false
|
|
271
|
+
// on the missing field, and EVERY RSU run answered "not authorized" to IntegrationGetRun and
|
|
272
|
+
// IntegrationTailRunEvents. The manifest field is the fix.
|
|
273
|
+
bridge.Observe({ ...RUN_START, CompanyIntegrationIDs: ['CI-1'] });
|
|
274
|
+
const dir = runDir();
|
|
275
|
+
await settle();
|
|
276
|
+
|
|
277
|
+
const manifest = JSON.parse(readFileSync(join(dir, 'manifest.json'), 'utf-8')) as IntegrationRunManifest;
|
|
278
|
+
expect(manifest.companyIntegrationIDs).toEqual(['CI-1']);
|
|
279
|
+
// Singular is set too, so the per-connection list filter and the GQL summary keep working.
|
|
280
|
+
expect(manifest.companyIntegrationID).toBe('CI-1');
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
it('leaves the SINGULAR connection empty for a batch spanning several, keeping the full set', async () => {
|
|
284
|
+
// Picking one member of the set to report as "the" connection would be a lie a client could
|
|
285
|
+
// act on; the AND authorization rule reads the set instead.
|
|
286
|
+
bridge.Observe({ ...RUN_START, CompanyIntegrationIDs: ['CI-1', 'CI-2'] });
|
|
287
|
+
const dir = runDir();
|
|
288
|
+
await settle();
|
|
289
|
+
|
|
290
|
+
const manifest = JSON.parse(readFileSync(join(dir, 'manifest.json'), 'utf-8')) as IntegrationRunManifest;
|
|
291
|
+
expect(manifest.companyIntegrationIDs).toEqual(['CI-1', 'CI-2']);
|
|
292
|
+
expect(manifest.companyIntegrationID).toBeUndefined();
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
it('records no connection when the batch supplied none, rather than inventing one', async () => {
|
|
296
|
+
bridge.Observe({ ...RUN_START, CompanyIntegrationIDs: [] });
|
|
297
|
+
const dir = runDir();
|
|
298
|
+
await settle();
|
|
299
|
+
|
|
300
|
+
const manifest = JSON.parse(readFileSync(join(dir, 'manifest.json'), 'utf-8')) as IntegrationRunManifest;
|
|
301
|
+
expect(manifest.companyIntegrationIDs).toEqual([]);
|
|
302
|
+
expect(manifest.companyIntegrationID).toBeUndefined();
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
// ── The restart boundary ─────────────────────────────────────────────────────────────────
|
|
306
|
+
|
|
307
|
+
it('closes the RestartMJAPI stage and checkpoints BEFORE the process is killed', async () => {
|
|
308
|
+
// `step.end` for RestartMJAPI is unreachable — pm2 kills the process inside the step — so
|
|
309
|
+
// without this the stream ends on an open stage and the run is in-flight forever.
|
|
310
|
+
bridge.Observe(RUN_START);
|
|
311
|
+
const dir = runDir();
|
|
312
|
+
bridge.Observe({ Kind: 'step.start', Name: 'RestartMJAPI', StepIndex: 10, StepTotal: 14 });
|
|
313
|
+
|
|
314
|
+
await bridge.Observe({
|
|
315
|
+
Kind: 'restart.pending',
|
|
316
|
+
RemainingSteps: ['CreateEntityMaps', 'StartSync'],
|
|
317
|
+
StepIndex: 10,
|
|
318
|
+
StepTotal: 14,
|
|
319
|
+
CompanyIntegrationIDs: ['CI-1'],
|
|
320
|
+
PendingWorkIDs: ['PW-1'],
|
|
321
|
+
TotalCount: 2,
|
|
322
|
+
SuccessCount: 2,
|
|
323
|
+
});
|
|
324
|
+
|
|
325
|
+
const events = readEvents(dir);
|
|
326
|
+
const done = events.find(e => e.eventType === 'stage.complete' && e.stage === 'RestartMJAPI');
|
|
327
|
+
const checkpoint = events.find(e => e.eventType === 'checkpoint' && e.stage === 'RestartMJAPI');
|
|
328
|
+
expect(done).toBeDefined();
|
|
329
|
+
expect(checkpoint?.resumableState).toMatchObject({
|
|
330
|
+
remainingSteps: ['CreateEntityMaps', 'StartSync'],
|
|
331
|
+
stepIndex: 10,
|
|
332
|
+
stepTotal: 14,
|
|
333
|
+
companyIntegrationIDs: ['CI-1'],
|
|
334
|
+
pendingWorkIDs: ['PW-1'],
|
|
335
|
+
});
|
|
336
|
+
// Still in flight: the run is finished by the process on the other side of the restart.
|
|
337
|
+
expect(existsSync(join(dir, 'result.json'))).toBe(false);
|
|
338
|
+
});
|
|
339
|
+
|
|
340
|
+
it('AWAITS the restart checkpoint to disk — an unflushed write would be lost to the kill', async () => {
|
|
341
|
+
// Deliberately does NOT call settle(): the returned promise must have flushed already.
|
|
342
|
+
bridge.Observe(RUN_START);
|
|
343
|
+
const dir = runDir();
|
|
344
|
+
await bridge.Observe({
|
|
345
|
+
Kind: 'restart.pending',
|
|
346
|
+
RemainingSteps: ['CreateEntityMaps', 'StartSync'],
|
|
347
|
+
CompanyIntegrationIDs: ['CI-1'],
|
|
348
|
+
PendingWorkIDs: [],
|
|
349
|
+
TotalCount: 1,
|
|
350
|
+
SuccessCount: 1,
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
const events = readEvents(dir);
|
|
354
|
+
expect(events.some(e => e.eventType === 'checkpoint' && e.stage === 'RestartMJAPI')).toBe(true);
|
|
355
|
+
});
|
|
356
|
+
|
|
357
|
+
it('ignores a restart.pending that arrives with no run open', async () => {
|
|
358
|
+
await expect(bridge.Observe({
|
|
359
|
+
Kind: 'restart.pending',
|
|
360
|
+
RemainingSteps: [],
|
|
361
|
+
CompanyIntegrationIDs: [],
|
|
362
|
+
PendingWorkIDs: [],
|
|
363
|
+
TotalCount: 0,
|
|
364
|
+
SuccessCount: 0,
|
|
365
|
+
})).resolves.toBeUndefined();
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
// ── Heartbeat staleness ──────────────────────────────────────────────────────────────────
|
|
369
|
+
|
|
370
|
+
it('never lets one run heartbeat stamp its stage name onto the NEXT run', async () => {
|
|
371
|
+
// The timer captures its stage; if it outlives the run it was armed for, it writes that
|
|
372
|
+
// stale name into whatever emitter the bridge points at next.
|
|
373
|
+
vi.useFakeTimers();
|
|
374
|
+
try {
|
|
375
|
+
bridge.Observe(RUN_START);
|
|
376
|
+
bridge.Observe({ Kind: 'step.start', Name: 'CompileTypeScript', StepIndex: 8, StepTotal: 14 });
|
|
377
|
+
|
|
378
|
+
// A retry starts a brand-new run while the previous step's heartbeat is still armed.
|
|
379
|
+
bridge.Observe(RUN_START);
|
|
380
|
+
const secondDir = runDir();
|
|
381
|
+
vi.advanceTimersByTime(300_000); // ten ticks' worth
|
|
382
|
+
|
|
383
|
+
vi.useRealTimers();
|
|
384
|
+
await settle();
|
|
385
|
+
|
|
386
|
+
const beats = readEvents(secondDir).filter(e => e.eventType === 'progress.heartbeat');
|
|
387
|
+
expect(beats.filter(b => b.stage === 'CompileTypeScript')).toHaveLength(0);
|
|
388
|
+
expect(beats).toHaveLength(0);
|
|
389
|
+
} finally {
|
|
390
|
+
vi.useRealTimers();
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
|
|
394
|
+
it('stops heart-beating once the restart boundary is published', async () => {
|
|
395
|
+
vi.useFakeTimers();
|
|
396
|
+
try {
|
|
397
|
+
bridge.Observe(RUN_START);
|
|
398
|
+
const dir = runDir();
|
|
399
|
+
bridge.Observe({ Kind: 'step.start', Name: 'RestartMJAPI', StepIndex: 10, StepTotal: 14 });
|
|
400
|
+
const pending = bridge.Observe({
|
|
401
|
+
Kind: 'restart.pending',
|
|
402
|
+
RemainingSteps: ['CreateEntityMaps', 'StartSync'],
|
|
403
|
+
CompanyIntegrationIDs: ['CI-1'],
|
|
404
|
+
PendingWorkIDs: [],
|
|
405
|
+
TotalCount: 1,
|
|
406
|
+
SuccessCount: 1,
|
|
407
|
+
});
|
|
408
|
+
vi.useRealTimers();
|
|
409
|
+
await pending;
|
|
410
|
+
|
|
411
|
+
vi.useFakeTimers();
|
|
412
|
+
vi.advanceTimersByTime(300_000);
|
|
413
|
+
vi.useRealTimers();
|
|
414
|
+
await settle();
|
|
415
|
+
|
|
416
|
+
const beats = readEvents(dir).filter(e => e.eventType === 'progress.heartbeat');
|
|
417
|
+
expect(beats).toHaveLength(0);
|
|
418
|
+
} finally {
|
|
419
|
+
vi.useRealTimers();
|
|
420
|
+
}
|
|
421
|
+
});
|
|
422
|
+
|
|
240
423
|
it('ignores step and run.end events that arrive with no run open', async () => {
|
|
241
424
|
// Defensive: an observer registered mid-run would see a trailing run.end for a run it never
|
|
242
425
|
// saw start. That must be a no-op, not a crash.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Startup order in index.ts: the boot sweep must exempt restart-killed RSU runs on a replica that
|
|
3
|
+
* runs background workers (processRSUPendingWork is their continuation), and whichever of those
|
|
4
|
+
* nothing re-attached to must be swept once the resuming pass is over. The behaviour of each half
|
|
5
|
+
* is tested in RSUPostRestartProgress.test.ts; this pins the wiring between them, which lives in
|
|
6
|
+
* a bootstrap function no unit test can run.
|
|
7
|
+
*/
|
|
8
|
+
import { describe, it, expect } from 'vitest';
|
|
9
|
+
import { readFileSync } from 'node:fs';
|
|
10
|
+
import { join } from 'node:path';
|
|
11
|
+
|
|
12
|
+
const src = readFileSync(join(__dirname, '..', 'index.ts'), 'utf-8');
|
|
13
|
+
|
|
14
|
+
describe('RSU startup sweep wiring', () => {
|
|
15
|
+
it('the boot sweep exempts restart-killed RSU runs only where background workers will resume them', () => {
|
|
16
|
+
expect(src).toMatch(
|
|
17
|
+
/const bootSweep = await SweepInterruptedRuns\(\s*undefined,\s*msg => console\.warn\(msg\),\s*runBackgroundWorkers \? RSUPostRestartProgressSession\.WasKilledAtRestart : undefined\s*\);/
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('the leftover sweep runs after the resuming pass, over exactly the runs the boot sweep left in flight', () => {
|
|
22
|
+
const pending = src.indexOf('processRSUPendingWork().catch(');
|
|
23
|
+
const leftover = src.indexOf('RSUPostRestartProgressSession.SweepUnattached(bootSweep.Skipped');
|
|
24
|
+
const boot = src.indexOf('const bootSweep = await SweepInterruptedRuns(');
|
|
25
|
+
expect(boot).toBeGreaterThan(-1);
|
|
26
|
+
expect(pending).toBeGreaterThan(boot);
|
|
27
|
+
expect(leftover).toBeGreaterThan(pending);
|
|
28
|
+
expect(src.slice(pending, leftover)).toMatch(/\.finally\(/);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -19,6 +19,8 @@ function summary(over: Partial<SchemaRefreshSummaryLike> = {}): SchemaRefreshSum
|
|
|
19
19
|
Succeeded: true,
|
|
20
20
|
ObjectsCreated: 12,
|
|
21
21
|
ObjectsUpdated: 3,
|
|
22
|
+
FieldsCreated: 69,
|
|
23
|
+
FieldsUpdated: 487,
|
|
22
24
|
UnresolvedObjects: ['Widgets'],
|
|
23
25
|
...over,
|
|
24
26
|
};
|
|
@@ -28,7 +30,7 @@ describe('BuildReactivateMessage', () => {
|
|
|
28
30
|
it('leads with the reactivation on every path', () => {
|
|
29
31
|
const paths = [
|
|
30
32
|
BuildReactivateMessage(undefined),
|
|
31
|
-
BuildReactivateMessage(summary({ InProgress: true, ObjectsCreated: 0, ObjectsUpdated: 0, UnresolvedObjects: [] })),
|
|
33
|
+
BuildReactivateMessage(summary({ InProgress: true, ObjectsCreated: 0, ObjectsUpdated: 0, FieldsCreated: 0, FieldsUpdated: 0, UnresolvedObjects: [] })),
|
|
32
34
|
BuildReactivateMessage(summary()),
|
|
33
35
|
BuildReactivateMessage(summary({ Succeeded: false, FailureMessage: 'boom' })),
|
|
34
36
|
];
|
|
@@ -40,6 +42,8 @@ describe('BuildReactivateMessage', () => {
|
|
|
40
42
|
InProgress: true,
|
|
41
43
|
ObjectsCreated: 0,
|
|
42
44
|
ObjectsUpdated: 0,
|
|
45
|
+
FieldsCreated: 0,
|
|
46
|
+
FieldsUpdated: 0,
|
|
43
47
|
UnresolvedObjects: [],
|
|
44
48
|
}));
|
|
45
49
|
|
|
@@ -50,10 +54,11 @@ describe('BuildReactivateMessage', () => {
|
|
|
50
54
|
expect(msg).not.toMatch(/PK-unresolved/);
|
|
51
55
|
});
|
|
52
56
|
|
|
53
|
-
it('reports real counts when the caller asked to block', () => {
|
|
57
|
+
it('reports real counts when the caller asked to block — fields included', () => {
|
|
54
58
|
const msg = BuildReactivateMessage(summary());
|
|
55
|
-
expect(msg).toContain('12 created');
|
|
59
|
+
expect(msg).toContain('12 objects created');
|
|
56
60
|
expect(msg).toContain('3 updated');
|
|
61
|
+
expect(msg).toContain('69 fields created');
|
|
57
62
|
expect(msg).toContain('1 PK-unresolved');
|
|
58
63
|
expect(msg).not.toMatch(/running/i);
|
|
59
64
|
});
|
|
@@ -67,6 +72,8 @@ describe('BuildReactivateMessage', () => {
|
|
|
67
72
|
FailureMessage: 'ConnectionTest failed: No Totara credentials found',
|
|
68
73
|
ObjectsCreated: 0,
|
|
69
74
|
ObjectsUpdated: 0,
|
|
75
|
+
FieldsCreated: 0,
|
|
76
|
+
FieldsUpdated: 0,
|
|
70
77
|
UnresolvedObjects: [],
|
|
71
78
|
}));
|
|
72
79
|
|
|
@@ -2695,6 +2695,28 @@ describe('RealtimeClientSessionResolver.RelayRealtimeUsage', () => {
|
|
|
2695
2695
|
expect(promptRun.Save).not.toHaveBeenCalled();
|
|
2696
2696
|
});
|
|
2697
2697
|
|
|
2698
|
+
it('logs a missing co-agent promptRunID once per session, not once per relay', async () => {
|
|
2699
|
+
errSpy = vi.spyOn(console, 'error').mockImplementation(() => undefined);
|
|
2700
|
+
const missingRunLines = (): string[] =>
|
|
2701
|
+
(errSpy?.mock.calls ?? []).map((c) => c.map(String).join(' ')).filter((m) => m.includes('has no co-agent promptRunID'));
|
|
2702
|
+
const resolver = makeResolver();
|
|
2703
|
+
|
|
2704
|
+
for (const sessionID of ['session-no-run-a', 'session-no-run-b']) {
|
|
2705
|
+
const { provider } = makeUsageProvider({
|
|
2706
|
+
session: makeSessionEntity({ ID: sessionID, Config_: JSON.stringify({ targetAgentID: 'target-1' }) }),
|
|
2707
|
+
});
|
|
2708
|
+
currentProvider = provider;
|
|
2709
|
+
for (let i = 0; i < 3; i++) {
|
|
2710
|
+
await expect(resolver.RelayRealtimeUsage(sessionID, 10, 5, makeCtx())).resolves.toBe(false);
|
|
2711
|
+
}
|
|
2712
|
+
}
|
|
2713
|
+
|
|
2714
|
+
const lines = missingRunLines();
|
|
2715
|
+
expect(lines).toHaveLength(2);
|
|
2716
|
+
expect(lines[0]).toContain('session-no-run-a');
|
|
2717
|
+
expect(lines[1]).toContain('session-no-run-b');
|
|
2718
|
+
});
|
|
2719
|
+
|
|
2698
2720
|
it('returns false (tolerant, no throw) when the session config is missing/malformed', async () => {
|
|
2699
2721
|
const { provider } = makeUsageProvider({ session: makeSessionEntity({ Config_: '{broken json' }) });
|
|
2700
2722
|
currentProvider = provider;
|
|
@@ -4,28 +4,37 @@ import { join } from 'node:path';
|
|
|
4
4
|
import { DecideFieldMapReconcile } from '../integration/EntityMapLifecycle.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* A REFRESH
|
|
7
|
+
* A REFRESH REPORTS the source's current shape; it does not adopt it. New objects and new columns
|
|
8
|
+
* are created but arrive DISABLED, and the user turns them on.
|
|
8
9
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* everything.txt: "we create entity maps for all objects that are determined as things that should
|
|
11
|
+
* be now added but arent, we enable nothing (because the user needs to, after the refresh, then go
|
|
12
|
+
* turn them on)". plan.md says the same for a schema refresh: "New tables are default deselected
|
|
13
|
+
* during schema refresh, and same with columns."
|
|
12
14
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
+
* This file previously asserted the OPPOSITE, and that is how the regression survived: the flip to
|
|
16
|
+
* auto-adopt was pinned by a test whose own premise contradicted the spec. Its stated reason was
|
|
17
|
+
* that a disabled new object never reached a migration, which is false — CreateDisabled governs
|
|
18
|
+
* only the entity/field MAP status, the IntegrationObject row is written Active regardless, and
|
|
19
|
+
* phase 4 evolves over continuing + new objects either way. The table is always created; the flag
|
|
20
|
+
* only decides whether it starts SYNCING unasked.
|
|
21
|
+
*
|
|
22
|
+
* The asymmetry with SYNC-discovered columns still holds and is sharper now: a sync never creates
|
|
23
|
+
* anything, it only captures a candidate for acceptance.
|
|
15
24
|
*/
|
|
16
25
|
const fm = (SourceFieldName: string, Status: string) => ({ SourceFieldName, Status });
|
|
17
26
|
|
|
18
|
-
describe('decideFieldMapReconcile — a refresh
|
|
19
|
-
it('creates a new column
|
|
27
|
+
describe('decideFieldMapReconcile — a refresh reports new columns, disabled', () => {
|
|
28
|
+
it('creates a new column DISABLED on an enabled map, by default', () => {
|
|
20
29
|
const plan = DecideFieldMapReconcile(['id', 'brand_new_col'], [fm('id', 'Active')], true);
|
|
21
|
-
expect(plan.Create).toEqual([{ SourceFieldName: 'brand_new_col', Status: '
|
|
30
|
+
expect(plan.Create).toEqual([{ SourceFieldName: 'brand_new_col', Status: 'Inactive' }]);
|
|
22
31
|
expect(plan.Enable).toEqual([]);
|
|
23
32
|
expect(plan.Disable).toEqual([]);
|
|
24
33
|
});
|
|
25
34
|
|
|
26
|
-
it('autoEnableNewColumns:
|
|
27
|
-
const plan = DecideFieldMapReconcile(['id', 'brand_new_col'], [fm('id', 'Active')], true,
|
|
28
|
-
expect(plan.Create).toEqual([{ SourceFieldName: 'brand_new_col', Status: '
|
|
35
|
+
it('autoEnableNewColumns:true is the explicit opt-in for a connection that wants adoption', () => {
|
|
36
|
+
const plan = DecideFieldMapReconcile(['id', 'brand_new_col'], [fm('id', 'Active')], true, true);
|
|
37
|
+
expect(plan.Create).toEqual([{ SourceFieldName: 'brand_new_col', Status: 'Active' }]);
|
|
29
38
|
});
|
|
30
39
|
|
|
31
40
|
it('a DISABLED map never gets an Active column — the map always bounds the column', () => {
|
|
@@ -73,12 +82,12 @@ describe('refresh adopts, sync only suggests — the defaults that encode it', (
|
|
|
73
82
|
const promoter = readFileSync(
|
|
74
83
|
join(__dirname, '..', 'integration', 'CustomColumnPromoter.ts'), 'utf8');
|
|
75
84
|
|
|
76
|
-
it('a REFRESH
|
|
77
|
-
expect(resolver).toMatch(/@Arg\("autoEnableNewObjects",\s*\{\s*defaultValue:\s*
|
|
85
|
+
it('a REFRESH creates new objects DISABLED', () => {
|
|
86
|
+
expect(resolver).toMatch(/@Arg\("autoEnableNewObjects",\s*\{\s*defaultValue:\s*false/);
|
|
78
87
|
});
|
|
79
88
|
|
|
80
|
-
it('a REFRESH
|
|
81
|
-
expect(resolver).toMatch(/@Arg\("autoEnableNewColumns",\s*\{\s*defaultValue:\s*
|
|
89
|
+
it('a REFRESH creates new columns DISABLED', () => {
|
|
90
|
+
expect(resolver).toMatch(/@Arg\("autoEnableNewColumns",\s*\{\s*defaultValue:\s*false/);
|
|
82
91
|
});
|
|
83
92
|
|
|
84
93
|
it('a SYNC never auto-creates a column — it captures a candidate and waits for acceptance', () => {
|