@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.
Files changed (407) hide show
  1. package/README.md +69 -0
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/agentSessions/BridgeHostInstance.d.ts +8 -3
  4. package/dist/agentSessions/BridgeHostInstance.d.ts.map +1 -1
  5. package/dist/agentSessions/BridgeHostInstance.js +14 -4
  6. package/dist/agentSessions/BridgeHostInstance.js.map +1 -1
  7. package/dist/agentSessions/HandoffOfferExpiry.d.ts +10 -0
  8. package/dist/agentSessions/HandoffOfferExpiry.d.ts.map +1 -0
  9. package/dist/agentSessions/HandoffOfferExpiry.js +18 -0
  10. package/dist/agentSessions/HandoffOfferExpiry.js.map +1 -0
  11. package/dist/agentSessions/ReturningVisitorRecap.js +1 -0
  12. package/dist/agentSessions/ReturningVisitorRecap.js.map +1 -1
  13. package/dist/agentSessions/SessionJanitor.d.ts +31 -8
  14. package/dist/agentSessions/SessionJanitor.d.ts.map +1 -1
  15. package/dist/agentSessions/SessionJanitor.js +85 -41
  16. package/dist/agentSessions/SessionJanitor.js.map +1 -1
  17. package/dist/agentSessions/SessionManager.d.ts +14 -4
  18. package/dist/agentSessions/SessionManager.d.ts.map +1 -1
  19. package/dist/agentSessions/SessionManager.js +28 -4
  20. package/dist/agentSessions/SessionManager.js.map +1 -1
  21. package/dist/agentSessions/conversationBrowsers.d.ts +61 -0
  22. package/dist/agentSessions/conversationBrowsers.d.ts.map +1 -0
  23. package/dist/agentSessions/conversationBrowsers.js +118 -0
  24. package/dist/agentSessions/conversationBrowsers.js.map +1 -0
  25. package/dist/agentSessions/sessionDeadline.d.ts +43 -0
  26. package/dist/agentSessions/sessionDeadline.d.ts.map +1 -0
  27. package/dist/agentSessions/sessionDeadline.js +68 -0
  28. package/dist/agentSessions/sessionDeadline.js.map +1 -0
  29. package/dist/auth/APIKeyScopeAuth.d.ts.map +1 -1
  30. package/dist/auth/APIKeyScopeAuth.js +5 -4
  31. package/dist/auth/APIKeyScopeAuth.js.map +1 -1
  32. package/dist/auth/loginEmailResolution.d.ts +41 -0
  33. package/dist/auth/loginEmailResolution.d.ts.map +1 -0
  34. package/dist/auth/loginEmailResolution.js +47 -0
  35. package/dist/auth/loginEmailResolution.js.map +1 -0
  36. package/dist/auth/magicLink/MagicLinkKeys.d.ts +50 -2
  37. package/dist/auth/magicLink/MagicLinkKeys.d.ts.map +1 -1
  38. package/dist/auth/magicLink/MagicLinkKeys.js +129 -12
  39. package/dist/auth/magicLink/MagicLinkKeys.js.map +1 -1
  40. package/dist/auth/magicLink/MagicLinkRouter.d.ts +3 -0
  41. package/dist/auth/magicLink/MagicLinkRouter.d.ts.map +1 -1
  42. package/dist/auth/magicLink/MagicLinkRouter.js +23 -5
  43. package/dist/auth/magicLink/MagicLinkRouter.js.map +1 -1
  44. package/dist/auth/magicLink/MagicLinkService.d.ts +39 -5
  45. package/dist/auth/magicLink/MagicLinkService.d.ts.map +1 -1
  46. package/dist/auth/magicLink/MagicLinkService.js +221 -9
  47. package/dist/auth/magicLink/MagicLinkService.js.map +1 -1
  48. package/dist/auth/magicLink/index.d.ts +1 -1
  49. package/dist/auth/magicLink/index.d.ts.map +1 -1
  50. package/dist/auth/magicLink/index.js +1 -1
  51. package/dist/auth/magicLink/index.js.map +1 -1
  52. package/dist/auth/magicLink/redeemLanding.d.ts +2 -2
  53. package/dist/auth/magicLink/redeemLanding.d.ts.map +1 -1
  54. package/dist/auth/magicLink/redeemLanding.js +7 -4
  55. package/dist/auth/magicLink/redeemLanding.js.map +1 -1
  56. package/dist/auth/magicLink/types.d.ts +27 -3
  57. package/dist/auth/magicLink/types.d.ts.map +1 -1
  58. package/dist/auth/magicLink/types.js +0 -4
  59. package/dist/auth/magicLink/types.js.map +1 -1
  60. package/dist/auth/newUsers.d.ts.map +1 -1
  61. package/dist/auth/newUsers.js +1 -0
  62. package/dist/auth/newUsers.js.map +1 -1
  63. package/dist/backgroundSweepConfigUnits.d.ts +231 -0
  64. package/dist/backgroundSweepConfigUnits.d.ts.map +1 -0
  65. package/dist/backgroundSweepConfigUnits.js +180 -0
  66. package/dist/backgroundSweepConfigUnits.js.map +1 -0
  67. package/dist/config.d.ts +906 -8
  68. package/dist/config.d.ts.map +1 -1
  69. package/dist/config.js +59 -0
  70. package/dist/config.js.map +1 -1
  71. package/dist/context.d.ts +2 -0
  72. package/dist/context.d.ts.map +1 -1
  73. package/dist/context.js +35 -4
  74. package/dist/context.js.map +1 -1
  75. package/dist/coreRoutes.d.ts +3 -1
  76. package/dist/coreRoutes.d.ts.map +1 -1
  77. package/dist/coreRoutes.js +6 -4
  78. package/dist/coreRoutes.js.map +1 -1
  79. package/dist/generated/graphql-schemas/__mj.d.ts +228 -0
  80. package/dist/generated/graphql-schemas/__mj.d.ts.map +1 -1
  81. package/dist/generated/graphql-schemas/__mj.js +1163 -6
  82. package/dist/generated/graphql-schemas/__mj.js.map +1 -1
  83. package/dist/generic/OrphanedConversationDetailReconciler.d.ts +11 -0
  84. package/dist/generic/OrphanedConversationDetailReconciler.d.ts.map +1 -1
  85. package/dist/generic/OrphanedConversationDetailReconciler.js +27 -1
  86. package/dist/generic/OrphanedConversationDetailReconciler.js.map +1 -1
  87. package/dist/generic/ResolverBase.d.ts +50 -5
  88. package/dist/generic/ResolverBase.d.ts.map +1 -1
  89. package/dist/generic/ResolverBase.js +321 -132
  90. package/dist/generic/ResolverBase.js.map +1 -1
  91. package/dist/generic/RunViewResolver.d.ts +4 -0
  92. package/dist/generic/RunViewResolver.d.ts.map +1 -1
  93. package/dist/generic/RunViewResolver.js +47 -7
  94. package/dist/generic/RunViewResolver.js.map +1 -1
  95. package/dist/index.d.ts +1 -0
  96. package/dist/index.d.ts.map +1 -1
  97. package/dist/index.js +157 -35
  98. package/dist/index.js.map +1 -1
  99. package/dist/integration/ConnectionPause.d.ts +121 -0
  100. package/dist/integration/ConnectionPause.d.ts.map +1 -0
  101. package/dist/integration/ConnectionPause.js +183 -0
  102. package/dist/integration/ConnectionPause.js.map +1 -0
  103. package/dist/integration/CustomColumnPromoter.d.ts +72 -6
  104. package/dist/integration/CustomColumnPromoter.d.ts.map +1 -1
  105. package/dist/integration/CustomColumnPromoter.js +87 -46
  106. package/dist/integration/CustomColumnPromoter.js.map +1 -1
  107. package/dist/integration/EntityMapLifecycle.d.ts +78 -4
  108. package/dist/integration/EntityMapLifecycle.d.ts.map +1 -1
  109. package/dist/integration/EntityMapLifecycle.js +199 -5
  110. package/dist/integration/EntityMapLifecycle.js.map +1 -1
  111. package/dist/integration/InactiveRowWarnings.d.ts +31 -0
  112. package/dist/integration/InactiveRowWarnings.d.ts.map +1 -1
  113. package/dist/integration/InactiveRowWarnings.js +29 -0
  114. package/dist/integration/InactiveRowWarnings.js.map +1 -1
  115. package/dist/integration/ObjectNamesByID.d.ts +28 -0
  116. package/dist/integration/ObjectNamesByID.d.ts.map +1 -0
  117. package/dist/integration/ObjectNamesByID.js +87 -0
  118. package/dist/integration/ObjectNamesByID.js.map +1 -0
  119. package/dist/integration/PostRestartIntrospect.d.ts +26 -0
  120. package/dist/integration/PostRestartIntrospect.d.ts.map +1 -0
  121. package/dist/integration/PostRestartIntrospect.js +27 -0
  122. package/dist/integration/PostRestartIntrospect.js.map +1 -0
  123. package/dist/integration/RSUPostRestartProgress.d.ts +176 -0
  124. package/dist/integration/RSUPostRestartProgress.d.ts.map +1 -0
  125. package/dist/integration/RSUPostRestartProgress.js +323 -0
  126. package/dist/integration/RSUPostRestartProgress.js.map +1 -0
  127. package/dist/integration/RSUProgressBridge.d.ts +41 -2
  128. package/dist/integration/RSUProgressBridge.d.ts.map +1 -1
  129. package/dist/integration/RSUProgressBridge.js +84 -1
  130. package/dist/integration/RSUProgressBridge.js.map +1 -1
  131. package/dist/integration/RunArtifactAuthorization.d.ts +39 -0
  132. package/dist/integration/RunArtifactAuthorization.d.ts.map +1 -0
  133. package/dist/integration/RunArtifactAuthorization.js +45 -0
  134. package/dist/integration/RunArtifactAuthorization.js.map +1 -0
  135. package/dist/integration/SchemaRefreshLaunch.d.ts +9 -0
  136. package/dist/integration/SchemaRefreshLaunch.d.ts.map +1 -1
  137. package/dist/integration/SchemaRefreshLaunch.js +3 -2
  138. package/dist/integration/SchemaRefreshLaunch.js.map +1 -1
  139. package/dist/integration/ScopedFieldsForBuild.d.ts +46 -0
  140. package/dist/integration/ScopedFieldsForBuild.d.ts.map +1 -0
  141. package/dist/integration/ScopedFieldsForBuild.js +91 -0
  142. package/dist/integration/ScopedFieldsForBuild.js.map +1 -0
  143. package/dist/integration/TargetConfigGuard.d.ts +40 -0
  144. package/dist/integration/TargetConfigGuard.d.ts.map +1 -0
  145. package/dist/integration/TargetConfigGuard.js +40 -0
  146. package/dist/integration/TargetConfigGuard.js.map +1 -0
  147. package/dist/realtimeSessions/ownedRealtimeSession.d.ts.map +1 -1
  148. package/dist/realtimeSessions/ownedRealtimeSession.js +2 -3
  149. package/dist/realtimeSessions/ownedRealtimeSession.js.map +1 -1
  150. package/dist/realtimeSessions/sessionAccess.d.ts +15 -0
  151. package/dist/realtimeSessions/sessionAccess.d.ts.map +1 -1
  152. package/dist/realtimeSessions/sessionAccess.js +22 -0
  153. package/dist/realtimeSessions/sessionAccess.js.map +1 -1
  154. package/dist/realtimeWidget/WidgetSessionService.d.ts.map +1 -1
  155. package/dist/realtimeWidget/WidgetSessionService.js +2 -0
  156. package/dist/realtimeWidget/WidgetSessionService.js.map +1 -1
  157. package/dist/realtimeWidget/visitorIdentity.d.ts.map +1 -1
  158. package/dist/realtimeWidget/visitorIdentity.js +1 -0
  159. package/dist/realtimeWidget/visitorIdentity.js.map +1 -1
  160. package/dist/realtimeWidget/widgetCore.d.ts.map +1 -1
  161. package/dist/realtimeWidget/widgetCore.js +4 -7
  162. package/dist/realtimeWidget/widgetCore.js.map +1 -1
  163. package/dist/realtimeWidget/widgetGuestElevation.js +1 -0
  164. package/dist/realtimeWidget/widgetGuestElevation.js.map +1 -1
  165. package/dist/requestOrigin.d.ts +22 -0
  166. package/dist/requestOrigin.d.ts.map +1 -0
  167. package/dist/requestOrigin.js +60 -0
  168. package/dist/requestOrigin.js.map +1 -0
  169. package/dist/resolvers/AgentSessionResolver.d.ts.map +1 -1
  170. package/dist/resolvers/AgentSessionResolver.js +6 -2
  171. package/dist/resolvers/AgentSessionResolver.js.map +1 -1
  172. package/dist/resolvers/AutotagPipelineResolver.d.ts.map +1 -1
  173. package/dist/resolvers/AutotagPipelineResolver.js +2 -1
  174. package/dist/resolvers/AutotagPipelineResolver.js.map +1 -1
  175. package/dist/resolvers/ConversationRunEventsResolver.d.ts.map +1 -1
  176. package/dist/resolvers/ConversationRunEventsResolver.js +2 -0
  177. package/dist/resolvers/ConversationRunEventsResolver.js.map +1 -1
  178. package/dist/resolvers/ExecuteRemoteOperationResolver.d.ts +6 -0
  179. package/dist/resolvers/ExecuteRemoteOperationResolver.d.ts.map +1 -1
  180. package/dist/resolvers/ExecuteRemoteOperationResolver.js +30 -7
  181. package/dist/resolvers/ExecuteRemoteOperationResolver.js.map +1 -1
  182. package/dist/resolvers/GetDataResolver.d.ts.map +1 -1
  183. package/dist/resolvers/GetDataResolver.js +34 -13
  184. package/dist/resolvers/GetDataResolver.js.map +1 -1
  185. package/dist/resolvers/IntegrationDiscoveryResolver.d.ts +401 -11
  186. package/dist/resolvers/IntegrationDiscoveryResolver.d.ts.map +1 -1
  187. package/dist/resolvers/IntegrationDiscoveryResolver.js +2690 -1305
  188. package/dist/resolvers/IntegrationDiscoveryResolver.js.map +1 -1
  189. package/dist/resolvers/MCPResolver.d.ts.map +1 -1
  190. package/dist/resolvers/MCPResolver.js +13 -2
  191. package/dist/resolvers/MCPResolver.js.map +1 -1
  192. package/dist/resolvers/QuerySystemUserResolver.d.ts +36 -0
  193. package/dist/resolvers/QuerySystemUserResolver.d.ts.map +1 -1
  194. package/dist/resolvers/QuerySystemUserResolver.js +174 -87
  195. package/dist/resolvers/QuerySystemUserResolver.js.map +1 -1
  196. package/dist/resolvers/RealtimeBridgeResolver.d.ts.map +1 -1
  197. package/dist/resolvers/RealtimeBridgeResolver.js +1 -0
  198. package/dist/resolvers/RealtimeBridgeResolver.js.map +1 -1
  199. package/dist/resolvers/RealtimeClientSessionResolver.d.ts +6 -0
  200. package/dist/resolvers/RealtimeClientSessionResolver.d.ts.map +1 -1
  201. package/dist/resolvers/RealtimeClientSessionResolver.js +36 -5
  202. package/dist/resolvers/RealtimeClientSessionResolver.js.map +1 -1
  203. package/dist/resolvers/RemoteBrowserActionResolver.d.ts +62 -10
  204. package/dist/resolvers/RemoteBrowserActionResolver.d.ts.map +1 -1
  205. package/dist/resolvers/RemoteBrowserActionResolver.js +217 -34
  206. package/dist/resolvers/RemoteBrowserActionResolver.js.map +1 -1
  207. package/dist/resolvers/RunAIAgentResolver.d.ts +24 -8
  208. package/dist/resolvers/RunAIAgentResolver.d.ts.map +1 -1
  209. package/dist/resolvers/RunAIAgentResolver.js +185 -67
  210. package/dist/resolvers/RunAIAgentResolver.js.map +1 -1
  211. package/dist/resolvers/RunAIPromptResolver.d.ts +5 -3
  212. package/dist/resolvers/RunAIPromptResolver.d.ts.map +1 -1
  213. package/dist/resolvers/RunAIPromptResolver.js +19 -18
  214. package/dist/resolvers/RunAIPromptResolver.js.map +1 -1
  215. package/dist/resolvers/RunTemplateResolver.d.ts.map +1 -1
  216. package/dist/resolvers/RunTemplateResolver.js +3 -1
  217. package/dist/resolvers/RunTemplateResolver.js.map +1 -1
  218. package/dist/resolvers/meetingRecordingRegistration.d.ts.map +1 -1
  219. package/dist/resolvers/meetingRecordingRegistration.js +2 -0
  220. package/dist/resolvers/meetingRecordingRegistration.js.map +1 -1
  221. package/dist/rest/MediaAccessKeys.d.ts.map +1 -1
  222. package/dist/rest/MediaAccessKeys.js +6 -2
  223. package/dist/rest/MediaAccessKeys.js.map +1 -1
  224. package/dist/rest/OAuthCallbackHandler.d.ts.map +1 -1
  225. package/dist/rest/OAuthCallbackHandler.js +11 -5
  226. package/dist/rest/OAuthCallbackHandler.js.map +1 -1
  227. package/dist/rest/RealtimeRecordingHandler.d.ts +3 -3
  228. package/dist/rest/RealtimeRecordingHandler.d.ts.map +1 -1
  229. package/dist/rest/RealtimeRecordingHandler.js +2 -4
  230. package/dist/rest/RealtimeRecordingHandler.js.map +1 -1
  231. package/dist/rest/ViewOperationsHandler.d.ts.map +1 -1
  232. package/dist/rest/ViewOperationsHandler.js +2 -1
  233. package/dist/rest/ViewOperationsHandler.js.map +1 -1
  234. package/dist/rest/setupRESTEndpoints.d.ts +3 -1
  235. package/dist/rest/setupRESTEndpoints.d.ts.map +1 -1
  236. package/dist/rest/setupRESTEndpoints.js +11 -2
  237. package/dist/rest/setupRESTEndpoints.js.map +1 -1
  238. package/dist/services/DurableEntityActionTaskSubmitter.d.ts.map +1 -1
  239. package/dist/services/DurableEntityActionTaskSubmitter.js +6 -1
  240. package/dist/services/DurableEntityActionTaskSubmitter.js.map +1 -1
  241. package/dist/services/TaskGraphActionRunner.d.ts.map +1 -1
  242. package/dist/services/TaskGraphActionRunner.js +2 -26
  243. package/dist/services/TaskGraphActionRunner.js.map +1 -1
  244. package/dist/services/TaskGraphAgentRunner.d.ts +6 -0
  245. package/dist/services/TaskGraphAgentRunner.d.ts.map +1 -1
  246. package/dist/services/TaskGraphAgentRunner.js +38 -0
  247. package/dist/services/TaskGraphAgentRunner.js.map +1 -1
  248. package/dist/services/TaskGraphContinuationDeliverer.d.ts.map +1 -1
  249. package/dist/services/TaskGraphContinuationDeliverer.js +1 -0
  250. package/dist/services/TaskGraphContinuationDeliverer.js.map +1 -1
  251. package/dist/services/WorkQueueHostService.d.ts +2 -1
  252. package/dist/services/WorkQueueHostService.d.ts.map +1 -1
  253. package/dist/services/WorkQueueHostService.js +19 -4
  254. package/dist/services/WorkQueueHostService.js.map +1 -1
  255. package/dist/services/workQueueConfig.d.ts +2 -2
  256. package/dist/services/workQueueConfig.js +5 -5
  257. package/dist/services/workQueueConfig.js.map +1 -1
  258. package/dist/sharedCache.js +1 -1
  259. package/dist/sharedCache.js.map +1 -1
  260. package/dist/types.d.ts +17 -0
  261. package/dist/types.d.ts.map +1 -1
  262. package/dist/types.js.map +1 -1
  263. package/package.json +98 -98
  264. package/src/__tests__/APIKeyScopeAuth.test.ts +4 -8
  265. package/src/__tests__/ActiveOperations.test.ts +68 -0
  266. package/src/__tests__/AgentSessionResolver.ownership.test.ts +13 -0
  267. package/src/__tests__/AssertTargetConfigs.test.ts +75 -0
  268. package/src/__tests__/BatchApplyParity.test.ts +109 -0
  269. package/src/__tests__/BridgeHostInstance.test.ts +42 -0
  270. package/src/__tests__/CollectInactiveRowWarnings.test.ts +115 -0
  271. package/src/__tests__/ConnectionPause.test.ts +192 -0
  272. package/src/__tests__/ConnectionPauseResolver.test.ts +166 -0
  273. package/src/__tests__/ConnectionPauseSave.test.ts +143 -0
  274. package/src/__tests__/CustomColumnPromoterCompletion.test.ts +142 -0
  275. package/src/__tests__/DeleteConnectionRemovesPerConnectionCatalog.test.ts +51 -0
  276. package/src/__tests__/DetachedDiscoveryStart.test.ts +65 -0
  277. package/src/__tests__/DurableEntityActionTaskSubmitter.test.ts +73 -0
  278. package/src/__tests__/EntityMapLifecycle.rekey.test.ts +252 -0
  279. package/src/__tests__/ExecuteRemoteOperationResolver.test.ts +213 -0
  280. package/src/__tests__/HandoffOfferExpiry.test.ts +40 -0
  281. package/src/__tests__/IntegrationRunArtifactAuthorization.test.ts +126 -0
  282. package/src/__tests__/MagicLinkKeys.test.ts +102 -0
  283. package/src/__tests__/MediaAccessKeys.test.ts +57 -10
  284. package/src/__tests__/NewArrivalsDefaultDisabled.test.ts +50 -0
  285. package/src/__tests__/ObjectNamesByID.test.ts +176 -0
  286. package/src/__tests__/PostRestartMapsInCatalogScope.test.ts +146 -0
  287. package/src/__tests__/QuerySystemUserResolver.childRows.test.ts +80 -0
  288. package/src/__tests__/QuerySystemUserResolver.collision.test.ts +200 -0
  289. package/src/__tests__/QuerySystemUserResolver.permissions.test.ts +132 -0
  290. package/src/__tests__/RSUPostRestartProgress.test.ts +343 -0
  291. package/src/__tests__/RSUProgressBridge.test.ts +188 -5
  292. package/src/__tests__/RSUStartupSweepWiring.test.ts +30 -0
  293. package/src/__tests__/ReactivateRefreshMessage.test.ts +10 -3
  294. package/src/__tests__/RealtimeClientSessionResolver.test.ts +22 -0
  295. package/src/__tests__/{RefreshAdoptsNewColumns.test.ts → RefreshReportsNewColumns.test.ts} +25 -16
  296. package/src/__tests__/RemoteBrowserActionRecovery.test.ts +287 -0
  297. package/src/__tests__/RemoteBrowserActionResolver.goalRunLink.test.ts +3 -0
  298. package/src/__tests__/RemoteBrowserActionResolver.ownership.test.ts +6 -4
  299. package/src/__tests__/RemoteBrowserAudioStream.test.ts +3 -0
  300. package/src/__tests__/RemoteBrowserSnapshot.test.ts +3 -0
  301. package/src/__tests__/ResolverBase.clientOldValues.test.ts +323 -26
  302. package/src/__tests__/ResolverBase.encryptedApiZeroReencrypt.test.ts +307 -0
  303. package/src/__tests__/ResolverBase.entityMessageRelay.test.ts +53 -2
  304. package/src/__tests__/ResolverBase.includeBinaryFields.test.ts +60 -0
  305. package/src/__tests__/RunAIAgentResolver.branch.test.ts +4 -0
  306. package/src/__tests__/RunAIAgentResolver.consultPredecessor.test.ts +289 -0
  307. package/src/__tests__/RunAIAgentResolver.handoff.test.ts +649 -0
  308. package/src/__tests__/RunAIAgentResolver.historyFrom.test.ts +2 -0
  309. package/src/__tests__/RunAIAgentResolver.runDataGuard.test.ts +2 -0
  310. package/src/__tests__/RunAIAgentResolver.stoppedPredecessor.test.ts +87 -12
  311. package/src/__tests__/SchemaEvolutionCustomColumns.test.ts +119 -0
  312. package/src/__tests__/SchemaRefreshLaunch.test.ts +24 -2
  313. package/src/__tests__/ScopedFieldsForBuild.test.ts +192 -0
  314. package/src/__tests__/SessionJanitor.test.ts +195 -4
  315. package/src/__tests__/SessionManager.test.ts +69 -0
  316. package/src/__tests__/TaskGraphActionRunner.durablePayload.test.ts +2 -2
  317. package/src/__tests__/TaskGraphAgentRunner.test.ts +272 -16
  318. package/src/__tests__/ViewOperationsHandler.test.ts +2 -5
  319. package/src/__tests__/WorkQueueHostService.test.ts +25 -7
  320. package/src/__tests__/backgroundSweepConfigUnits.test.ts +153 -0
  321. package/src/__tests__/contextRequestOrigin.test.ts +105 -0
  322. package/src/__tests__/conversationBrowsers.test.ts +62 -0
  323. package/src/__tests__/magicLinkExtensionCapabilities.test.ts +413 -0
  324. package/src/__tests__/orphanedConversationDetailReconciler.start.test.ts +82 -0
  325. package/src/__tests__/ownedRealtimeSession.test.ts +14 -0
  326. package/src/__tests__/realtimeRecordingHandler.test.ts +7 -2
  327. package/src/__tests__/realtimeSessions/sessionAccess.test.ts +79 -1
  328. package/src/__tests__/requestOrigin.test.ts +104 -0
  329. package/src/__tests__/securityHardeningPr6034.test.ts +120 -0
  330. package/src/__tests__/sessionDeadline.test.ts +51 -0
  331. package/src/__tests__/sharedCache.test.ts +11 -0
  332. package/src/__tests__/unifiedAuth.test.ts +73 -1
  333. package/src/agentSessions/BridgeHostInstance.ts +20 -5
  334. package/src/agentSessions/HandoffOfferExpiry.ts +18 -0
  335. package/src/agentSessions/ReturningVisitorRecap.ts +1 -0
  336. package/src/agentSessions/SessionJanitor.ts +92 -42
  337. package/src/agentSessions/SessionManager.ts +38 -8
  338. package/src/agentSessions/conversationBrowsers.ts +143 -0
  339. package/src/agentSessions/sessionDeadline.ts +81 -0
  340. package/src/auth/APIKeyScopeAuth.ts +5 -4
  341. package/src/auth/__tests__/loginEmailResolution.test.ts +67 -0
  342. package/src/auth/loginEmailResolution.ts +67 -0
  343. package/src/auth/magicLink/MagicLinkKeys.ts +146 -14
  344. package/src/auth/magicLink/MagicLinkRouter.ts +33 -6
  345. package/src/auth/magicLink/MagicLinkService.ts +250 -10
  346. package/src/auth/magicLink/index.ts +1 -1
  347. package/src/auth/magicLink/redeemLanding.ts +7 -4
  348. package/src/auth/magicLink/types.ts +28 -3
  349. package/src/auth/newUsers.ts +1 -0
  350. package/src/backgroundSweepConfigUnits.ts +213 -0
  351. package/src/config.ts +69 -0
  352. package/src/context.ts +39 -6
  353. package/src/coreRoutes.ts +14 -7
  354. package/src/generated/graphql-schemas/__mj.ts +822 -7
  355. package/src/generic/OrphanedConversationDetailReconciler.ts +32 -1
  356. package/src/generic/ResolverBase.ts +414 -143
  357. package/src/generic/RunViewResolver.ts +96 -49
  358. package/src/index.ts +201 -35
  359. package/src/integration/ConnectionPause.ts +222 -0
  360. package/src/integration/CustomColumnPromoter.ts +123 -53
  361. package/src/integration/EntityMapLifecycle.ts +229 -6
  362. package/src/integration/InactiveRowWarnings.ts +50 -0
  363. package/src/integration/ObjectNamesByID.ts +97 -0
  364. package/src/integration/PostRestartIntrospect.ts +49 -0
  365. package/src/integration/RSUPostRestartProgress.ts +359 -0
  366. package/src/integration/RSUProgressBridge.ts +85 -2
  367. package/src/integration/RunArtifactAuthorization.ts +65 -0
  368. package/src/integration/SchemaRefreshLaunch.ts +12 -2
  369. package/src/integration/ScopedFieldsForBuild.ts +113 -0
  370. package/src/integration/TargetConfigGuard.ts +71 -0
  371. package/src/realtimeSessions/ownedRealtimeSession.ts +2 -6
  372. package/src/realtimeSessions/sessionAccess.ts +30 -0
  373. package/src/realtimeWidget/WidgetSessionService.ts +2 -0
  374. package/src/realtimeWidget/visitorIdentity.ts +1 -0
  375. package/src/realtimeWidget/widgetCore.ts +4 -8
  376. package/src/realtimeWidget/widgetGuestElevation.ts +1 -0
  377. package/src/requestOrigin.ts +64 -0
  378. package/src/resolvers/AgentSessionResolver.ts +6 -2
  379. package/src/resolvers/AutotagPipelineResolver.ts +2 -1
  380. package/src/resolvers/ConversationRunEventsResolver.ts +2 -0
  381. package/src/resolvers/ExecuteRemoteOperationResolver.ts +41 -9
  382. package/src/resolvers/GetDataResolver.ts +35 -13
  383. package/src/resolvers/IntegrationDiscoveryResolver.ts +1522 -203
  384. package/src/resolvers/MCPResolver.ts +15 -2
  385. package/src/resolvers/QuerySystemUserResolver.ts +197 -98
  386. package/src/resolvers/RealtimeBridgeResolver.ts +1 -0
  387. package/src/resolvers/RealtimeClientSessionResolver.ts +40 -7
  388. package/src/resolvers/RemoteBrowserActionResolver.ts +242 -32
  389. package/src/resolvers/RunAIAgentResolver.ts +265 -86
  390. package/src/resolvers/RunAIPromptResolver.ts +18 -18
  391. package/src/resolvers/RunTemplateResolver.ts +3 -1
  392. package/src/resolvers/__tests__/GetDataResolver.tokens.test.ts +52 -0
  393. package/src/resolvers/meetingRecordingRegistration.ts +2 -0
  394. package/src/rest/MediaAccessKeys.ts +6 -2
  395. package/src/rest/OAuthCallbackHandler.ts +13 -5
  396. package/src/rest/RealtimeRecordingHandler.ts +5 -9
  397. package/src/rest/ViewOperationsHandler.ts +2 -1
  398. package/src/rest/setupRESTEndpoints.ts +11 -2
  399. package/src/services/DurableEntityActionTaskSubmitter.ts +10 -2
  400. package/src/services/TaskGraphActionRunner.ts +2 -23
  401. package/src/services/TaskGraphAgentRunner.ts +43 -0
  402. package/src/services/TaskGraphContinuationDeliverer.ts +1 -0
  403. package/src/services/WorkQueueHostService.ts +26 -4
  404. package/src/services/workQueueConfig.ts +5 -5
  405. package/src/sharedCache.ts +1 -1
  406. package/src/types.ts +18 -0
  407. package/src/services/TaskOrchestration-Integration.md +0 -188
@@ -136,6 +136,52 @@ declare class SchemaEvolutionOutput {
136
136
  ChangedObjects?: string[];
137
137
  /** U10 — objects whose Pull watermark was reset so the next sync backfills the schema change. */
138
138
  WatermarksReset?: string[];
139
+ /**
140
+ * Objects whose stored rows were CLEARED because the connector changed what identifies a row.
141
+ * Reported separately from WatermarksReset: a reset means "fetch it all again", this means
142
+ * "what was here could not be reconciled with the source and has been rebuilt from it".
143
+ */
144
+ RekeyedObjects?: string[];
145
+ /**
146
+ * Custom columns the source has been sending that are still sitting in the overflow JSON,
147
+ * offered here so a schema refresh is where you see them.
148
+ *
149
+ * everything.txt: promoting one "requires that the user accepts" it, so this is REPORT-ONLY.
150
+ * Pass the column names back in `acceptCustomColumns` to actually materialise them — in the
151
+ * same migration and the same restart as the refresh's own DDL.
152
+ */
153
+ CustomColumnCandidates?: CustomColumnCandidate[];
154
+ /** The accepted columns that were folded into this run's migration. */
155
+ PromotedColumns?: PromotedColumn[];
156
+ }
157
+ /**
158
+ * One tunable setting, described by the connector.
159
+ *
160
+ * Exists so a surface can render the settings for a connection it knows nothing about, and so the
161
+ * DEFAULT it shows is the engine's real one. The alternative — a hardcoded list per surface — is
162
+ * how a sample size of 500 came to be shown and stamped against an engine whose default is 50.
163
+ */
164
+ declare class ConnectorSettingOutput {
165
+ Key: string;
166
+ Label: string;
167
+ Group: string;
168
+ Type: string;
169
+ Options?: string[];
170
+ /** JSON-encoded: the value is polymorphic per setting, and Type says how to read it. */
171
+ DefaultJSON?: string;
172
+ Min?: number;
173
+ Max?: number;
174
+ /** 'basic' | 'advanced' | 'expert' — how a surface decides what to show. */
175
+ Tier: string;
176
+ /** 'connection' | 'object' */
177
+ AppliesTo: string;
178
+ Description: string;
179
+ Sensitive: boolean;
180
+ }
181
+ declare class ConnectorSettingsSchemaOutput {
182
+ Success: boolean;
183
+ Message: string;
184
+ Settings: ConnectorSettingOutput[];
139
185
  }
140
186
  declare class ConnectorCapabilitiesOutput {
141
187
  Success: boolean;
@@ -220,6 +266,20 @@ declare class RefreshConnectorSchemaOutput {
220
266
  UnresolvedObjects?: string[];
221
267
  FailureMessage?: string;
222
268
  }
269
+ /**
270
+ * The reply to a DETACHED discovery start. Deliberately a different shape from
271
+ * RefreshConnectorSchemaOutput: that one reports real counts because it waited, and handing back
272
+ * placeholder zeros from a run that has not begun is exactly the confusion this type avoids.
273
+ */
274
+ declare class StartSchemaRefreshOutput {
275
+ Success: boolean;
276
+ Message: string;
277
+ /** Tail this with IntegrationTailRunEvents. 'not-started' when Success is false. */
278
+ RunID: string;
279
+ InProgress: boolean;
280
+ /** Set when the refusal was a lock: names what is holding it, so the UI can say why. */
281
+ BlockedBy?: string;
282
+ }
223
283
  declare class IntegrationGenerateActionResult {
224
284
  Success: boolean;
225
285
  ActionID?: string;
@@ -340,6 +400,26 @@ declare class MutationResultOutput {
340
400
  Success: boolean;
341
401
  Message: string;
342
402
  }
403
+ /**
404
+ * Deactivate returns more than a boolean because pausing a connection is not one act.
405
+ *
406
+ * A caller has to be able to tell "paused, and the sync you were watching is stopping" from
407
+ * "paused, and the sync you were watching will run to completion in a process I cannot reach".
408
+ * Both are successful pauses. Only one of them means the work has stopped, and a UI that says
409
+ * "stopping" for the second is lying to the operator about the state of their data.
410
+ */
411
+ declare class DeactivateConnectionOutput {
412
+ Success: boolean;
413
+ Message: string;
414
+ /** How many scheduled jobs this pause actually moved from Active to Paused. */
415
+ SchedulesPaused: number;
416
+ /** The live sync run at the moment of pause, when there was one. */
417
+ InFlightSyncRunID?: string;
418
+ /** True when a live run existed AND a cancel was signalled for it. */
419
+ CancelRequested: boolean;
420
+ /** 'durable' | 'this-process' | 'unknown' | 'none' — see ConnectionPause.DescribeCancelScope. */
421
+ CancelScope: string;
422
+ }
343
423
  declare class IntegrationSyncConfigInput {
344
424
  SyncConcurrency?: number;
345
425
  MaxConcurrency?: number;
@@ -530,6 +610,10 @@ declare class SyncHistoryOutput {
530
610
  Success: boolean;
531
611
  Message: string;
532
612
  Runs?: SyncRunSummaryOutput[];
613
+ /** Total runs for this connection, so a pager can size itself without fetching every row. */
614
+ TotalKnown?: number;
615
+ /** True when rows exist beyond this page. */
616
+ HasMore?: boolean;
533
617
  }
534
618
  declare class OperationProgressOutput {
535
619
  Success: boolean;
@@ -543,6 +627,8 @@ declare class OperationProgressOutput {
543
627
  RecordsCreated?: number;
544
628
  RecordsUpdated?: number;
545
629
  RecordsErrored?: number;
630
+ /** Records the sync chose not to write because the content hash matched. */
631
+ RecordsSkipped?: number;
546
632
  RSUStep?: string;
547
633
  RSURunning?: boolean;
548
634
  /** U11 — 1-based index of the current RSU step (determinate stepper). */
@@ -552,6 +638,65 @@ declare class OperationProgressOutput {
552
638
  ElapsedMs?: number;
553
639
  StartedAt?: string;
554
640
  }
641
+ declare class ActiveOperationOutput {
642
+ /** 'sync' | 'rsu' | 'discovery' | 'maintenance' */
643
+ Kind: string;
644
+ /**
645
+ * 'connection' when this operation provably belongs to the requested connection;
646
+ * 'workspace' when it is process-wide and cannot be attributed to one. The UI must not claim a
647
+ * workspace-scoped RSU belongs to the connector being viewed - that mislabelling is why an
648
+ * unrelated schema update read as "your connector is building".
649
+ */
650
+ Scope: string;
651
+ Label: string;
652
+ RunID?: string;
653
+ StartedAt?: Date;
654
+ StepLabel?: string;
655
+ StepIndex?: number;
656
+ StepTotal?: number;
657
+ RecordsCreated?: number;
658
+ RecordsUpdated?: number;
659
+ RecordsSkipped?: number;
660
+ RecordsErrored?: number;
661
+ /** Only a sync can be cancelled, and only from the process running it. */
662
+ Cancellable: boolean;
663
+ }
664
+ declare class ActiveOperationsOutput {
665
+ Success: boolean;
666
+ Message: string;
667
+ Operations?: ActiveOperationOutput[];
668
+ /** What holds this connection's maintenance lock, if anything. */
669
+ MaintenanceLockReason?: string;
670
+ }
671
+ declare class ResourcePressureFindingOutput {
672
+ Code: string;
673
+ Message: string;
674
+ }
675
+ declare class ResourcePressureOutput {
676
+ Success: boolean;
677
+ Message: string;
678
+ HeapUsedFraction?: number;
679
+ HeapUsedMB?: number;
680
+ HeapLimitMB?: number;
681
+ ResidentMB?: number;
682
+ /**
683
+ * Resident set as a fraction of HOST memory, plus the host totals it is derived from.
684
+ *
685
+ * ResidentMB alone is a number with no denominator: a client cannot tell whether 3,478 MB is
686
+ * comfortable or one step from a SIGKILL without knowing the box. It was the latter on the
687
+ * sandbox on 2026-09-14 — 3,478 MB of 3,830 MB, killed by the kernel, while HeapUsedFraction
688
+ * (the only judgeable number this type exposed) sat unremarkable because `--max-old-space-size`
689
+ * bounds V8's old space and not the response buffers that actually filled the machine.
690
+ */
691
+ ResidentFraction?: number;
692
+ HostMemTotalMB?: number;
693
+ HostMemAvailableMB?: number;
694
+ ArtifactDiskFreeMB?: number;
695
+ WorkDirFreeMB?: number;
696
+ ActiveSyncCount?: number;
697
+ /** Empty when nothing is under pressure. Ordered most severe first. */
698
+ Findings?: ResourcePressureFindingOutput[];
699
+ }
555
700
  declare class IntegrationRunCountsOutput {
556
701
  Processed?: number;
557
702
  Succeeded?: number;
@@ -564,6 +709,12 @@ declare class IntegrationRunSummaryArtifactOutput {
564
709
  RunKind: string;
565
710
  IntegrationID?: string;
566
711
  CompanyIntegrationID?: string;
712
+ /**
713
+ * Every connection the run touched. Populated for runs that can span more than one (an RSU
714
+ * batch); `CompanyIntegrationID` above is set only when this holds exactly one. A client should
715
+ * read this rather than the singular field when it needs to know what a run covers.
716
+ */
717
+ CompanyIntegrationIDs?: string[];
567
718
  ObjectName?: string;
568
719
  TriggerType?: string;
569
720
  StartedAt: string;
@@ -598,6 +749,10 @@ declare class IntegrationListRunsOutput {
598
749
  Success: boolean;
599
750
  Message: string;
600
751
  Runs?: IntegrationRunSummaryArtifactOutput[];
752
+ /** Feed back as `offset` for the next page. Absent when there is no next page. */
753
+ NextOffset?: number;
754
+ /** True when the store holds more runs past this page. */
755
+ HasMore?: boolean;
601
756
  }
602
757
  declare class IntegrationRunDetailOutput {
603
758
  Success: boolean;
@@ -692,12 +847,90 @@ export declare class IntegrationDiscoveryResolver extends ResolverBase {
692
847
  * (IntegrationObjectField.RelatedIntegrationObjectID) plus soft-FK declarations in the IO's
693
848
  * Configuration (parentObjectName / parentObjectNames map / ReferencedType). Reads the
694
849
  * engine cache only (no DB round-trip); objects with no persisted IO row have no entry.
850
+ *
851
+ * Hard FK parents come from `GetRelatedIntegrationObjectIDs`, which answers a per-connection
852
+ * object from the scope's edge set. Its full field rows are cold here (only the sync loop warms
853
+ * them), so reading them would find no parents at all.
695
854
  */
696
855
  private computeObjectDependencyNames;
697
856
  /**
698
857
  * Discovers fields on a specific external object.
699
858
  */
700
859
  IntegrationDiscoverFields(companyIntegrationID: string, objectName: string, ctx: AppContext): Promise<DiscoverFieldsOutput>;
860
+ /**
861
+ * Tests credentials that have NOT been saved anywhere.
862
+ *
863
+ * ── Why this exists ───────────────────────────────────────────────────────
864
+ *
865
+ * `IntegrationTestConnection` takes a `companyIntegrationID`, so it can only test a
866
+ * connection that already exists. That forces every setup wizard into create-then-test:
867
+ * the workspace writes a Credential and a CompanyIntegration, THEN finds out the
868
+ * password was wrong, and something has to go back and delete them. Two cases escape
869
+ * that cleanup — a credential test that outlives the caller's gateway (most likely
870
+ * precisely when a host or tenant id is wrong, because that is what makes a vendor call
871
+ * hang rather than refuse), and a test that passes before a later step fails. Both leave
872
+ * a connection that answers every listing and syncs nothing.
873
+ *
874
+ * This inverts the order. Nothing is written, so there is nothing to clean up.
875
+ *
876
+ * ── How it can work without persisting ────────────────────────────────────
877
+ *
878
+ * The connector is resolved from the INTEGRATION row, not from a connection —
879
+ * `ConnectorFactory.Resolve` already only needs the former. The credentials then ride in
880
+ * on a transient CompanyIntegration that is constructed with `NewRecord()` and
881
+ * DELIBERATELY NEVER SAVED, carrying the values in `Configuration`.
882
+ *
883
+ * That works because every connector resolves its auth material the same way: prefer the
884
+ * linked Credential when `CredentialID` is set, otherwise fall back to the
885
+ * `Configuration` JSON. It is a de-facto framework convention rather than a documented
886
+ * one — verified across all seven connectors this was written for (NetSuite, Totara,
887
+ * Nimble AMS, OpenWater, PheedLoop, PropFuel, Elevate), each of which reads
888
+ * `CredentialID` first and `Configuration` second. A connector that reads ONLY
889
+ * `CredentialID` would report missing credentials here rather than misbehave, which is
890
+ * the safe direction to fail: the caller learns the probe cannot help and falls back to
891
+ * create-then-test, exactly as before.
892
+ *
893
+ * ── Rules this endpoint holds itself to ───────────────────────────────────
894
+ *
895
+ * - NOTHING IS PERSISTED. No Credential, no CompanyIntegration, no Company. The
896
+ * transient entity is a local and never leaves this method.
897
+ * - THE VALUES ARE NEVER LOGGED. Not on success, not on failure, not inside an error
898
+ * message. Only the integration id and the outcome are ever written down.
899
+ * - IT CANNOT HANG. A hard deadline applies regardless of what the connector does,
900
+ * because a probe that inherits the gateway-timeout problem solves nothing. A
901
+ * timeout is reported as a timeout, which is itself the diagnosis for an unreachable
902
+ * host.
903
+ * - IT IS RATE LIMITED per (user, integration). The endpoint turns caller-supplied
904
+ * input into an outbound vendor request, so an unbounded one is a request amplifier.
905
+ */
906
+ IntegrationProbeCredentials(integrationID: string, credentialValues: string, ctx: AppContext): Promise<ConnectionTestOutput>;
907
+ /**
908
+ * The probe's hard deadline.
909
+ *
910
+ * `TestConnectionMs` exists on the connector config but is advisory — an implementation
911
+ * that does not consult it can block for as long as the vendor's socket does, which is
912
+ * the whole failure this endpoint exists to avoid. So the bound is applied here, where it
913
+ * cannot be opted out of.
914
+ *
915
+ * 20 seconds: comfortably longer than any healthy handshake, comfortably shorter than the
916
+ * ~240s gateway ceiling that create-then-test keeps running into.
917
+ */
918
+ private static readonly PROBE_DEADLINE_MS;
919
+ private static withProbeDeadline;
920
+ /**
921
+ * Per (user, integration) rate limit.
922
+ *
923
+ * This endpoint converts caller-supplied input into an outbound request to a third party,
924
+ * which makes an unbounded version a request amplifier pointed at somebody else's API —
925
+ * and the fastest way to get a tenant's key rate-limited by its own vendor. In-process
926
+ * and per-instance on purpose: it is a courtesy bound on a human typing into a form, not
927
+ * a security boundary, and giving it a durable store would buy nothing a form's own pace
928
+ * does not already provide.
929
+ */
930
+ private static readonly PROBE_WINDOW_MS;
931
+ private static readonly PROBE_MAX_PER_WINDOW;
932
+ private static readonly probeHits;
933
+ private static probeRateLimited;
701
934
  /**
702
935
  * Tests connectivity to the external system.
703
936
  */
@@ -718,6 +951,23 @@ export declare class IntegrationDiscoveryResolver extends ResolverBase {
718
951
  * both on stdout (visible in the MJAPI log file) and in a per-run
719
952
  * `<cwd>/logs/integration-runs/<runID>/progress.jsonl` artifact.
720
953
  */
954
+ /**
955
+ * Start discovery and return immediately with a tailable RunID.
956
+ *
957
+ * plan.md is emphatic that this must exist: "going to a page should NEVER, NEVER trigger such
958
+ * things automatically, it must in a very clean way tell the user to click a button to start
959
+ * discovery of tables". A button needs a call that returns at once; the synchronous mutation
960
+ * runs the whole pipeline inline and times out at the gateway on a large catalog, which is why
961
+ * both surfaces ended up auto-triggering on page entry and adopting whatever run they found.
962
+ *
963
+ * A DISTINCT mutation rather than a flag on the synchronous one: that reply promises real
964
+ * counts because it waited, and a detached launch can only offer placeholder zeros.
965
+ *
966
+ * The lock is PROBED here so a second click is refused with a reason the UI can show. The
967
+ * pipeline still acquires it for real - this probe is not the guard, it is the clean answer in
968
+ * the common case. Losing the race just means the launch fails on the run stream instead.
969
+ */
970
+ IntegrationStartSchemaRefresh(companyIntegrationID: string, universalPKConvention: string | undefined, ctx: AppContext): Promise<StartSchemaRefreshOutput>;
721
971
  IntegrationRefreshConnectorSchema(companyIntegrationID: string, universalPKConvention: string | undefined, deactivateAbsent: boolean | undefined, ctx: AppContext): Promise<RefreshConnectorSchemaOutput>;
722
972
  /**
723
973
  * Generates + persists strongly-typed Action metadata on demand for an
@@ -858,16 +1108,19 @@ export declare class IntegrationDiscoveryResolver extends ResolverBase {
858
1108
  */
859
1109
  private userCanReadCompanyIntegration;
860
1110
  /**
861
- * Authorizes the caller for a single run artifact based on the run's
862
- * manifest CompanyIntegrationID. Returns true when the run is tenant-scoped
863
- * and the caller is authorized for that CompanyIntegration. Returns false
864
- * for tenant-scoped runs the caller may not read, OR for runs with no
865
- * CompanyIntegrationID (non-tenant-scoped artifacts are not exposed through
866
- * these per-company endpoints).
1111
+ * Authorizes the caller for a single run artifact against EVERY connection the run touched.
1112
+ *
1113
+ * The rule itself — AND over the run's whole connection set, and why anything weaker leaks —
1114
+ * lives in {@link AuthorizeRunArtifact}. This method supplies the per-connection check, which is
1115
+ * the part that needs the caller's context and the data provider's row-level security.
867
1116
  */
1117
+ private authorizeRunArtifact;
1118
+ /** Boolean form of {@link authorizeRunArtifact}, for the list path which needs no message. */
868
1119
  private userCanReadRunArtifact;
869
1120
  /** Standard authorization-failure message for run-artifact endpoints. */
870
1121
  private notAuthorizedForCompanyIntegrationMessage;
1122
+ /** The denial message for a run, naming the connection that blocked it when there is one. */
1123
+ private notAuthorizedForRunMessage;
871
1124
  /**
872
1125
  * Loads the CompanyIntegration + its parent Integration, then resolves the
873
1126
  * appropriate connector via ConnectorFactory.
@@ -916,8 +1169,46 @@ export declare class IntegrationDiscoveryResolver extends ResolverBase {
916
1169
  * `IsPrimaryKey=true`.
917
1170
  * - Foreign-key relationships are reconstructed from
918
1171
  * `RelatedIntegrationObjectID` lookups against the same cache.
1172
+ * - Under a per-connection catalog the FIELD rows come from `scopedFields`
1173
+ * (`LoadScopedFieldsForBuild`), never from the engine: a connection's field rows
1174
+ * are warmed on demand by the sync loop only, so the engine answers `[]` for them
1175
+ * during an apply and every object would build with no columns.
919
1176
  */
920
1177
  private buildSourceSchemaFromPersistedRows;
1178
+ /**
1179
+ * Brings the integration catalog caches to committed state, then re-configures the engine from it.
1180
+ *
1181
+ * Both halves are needed and the ORDER is the point. `mj sync push` writes IO/IOF rows through
1182
+ * stored procedures, which fire no `BaseEntity` change events, so nothing invalidates the RunView
1183
+ * cache and `Config(true)` re-queries straight back into the stale entries. The per-connection
1184
+ * catalog entities are guarded individually because a workspace without that migration has not
1185
+ * registered them, and a missing entity must not fail an apply.
1186
+ *
1187
+ * One method so the single apply and the batch apply cannot drift apart on it again.
1188
+ */
1189
+ private refreshIntegrationCatalogCaches;
1190
+ /**
1191
+ * The declared-but-inactive-row warnings for an apply, computed from the catalog rather than from
1192
+ * whichever schema object the apply happens to be holding.
1193
+ *
1194
+ * Separate from {@link buildSourceSchemaFromPersistedRows} because the two are independent
1195
+ * questions, and conflating them cost the batch path its warnings entirely: the batch builds its
1196
+ * source schema once and hands it down as `prefetchedSourceSchema`, which skips the rebuild — and
1197
+ * with it skipped the only place these warnings were ever collected. The warnings come from the
1198
+ * IO/IOF rows' `Status`, which is knowable whenever the integration and the requested names are,
1199
+ * so it never needed to ride along with a rebuild.
1200
+ *
1201
+ * `requestedNames` empty/undefined means "everything active", which deliberately does NOT report
1202
+ * deactivated objects (a large catalog carries hundreds and announcing them on every apply is
1203
+ * noise) — see ComputeInactiveRowWarnings.
1204
+ *
1205
+ * `scopedFields` is the connection's field rows when the apply runs under a per-connection catalog
1206
+ * (`LoadScopedFieldsForBuild`). The FIELD half of the warnings reads through it for the same reason
1207
+ * the rebuild does: the engine answers `[]` for a connection's fields during an apply, so reading
1208
+ * them from the engine would silently drop every field warning. Without it the engine is read, as
1209
+ * for the shared catalog.
1210
+ */
1211
+ private collectInactiveRowWarnings;
921
1212
  private runSchemaRefreshPipeline;
922
1213
  /** The body of {@link runSchemaRefreshPipeline}, run with the maintenance lock held. */
923
1214
  private runSchemaRefreshPipelineLocked;
@@ -1031,9 +1322,28 @@ export declare class IntegrationDiscoveryResolver extends ResolverBase {
1031
1322
  */
1032
1323
  IntegrationPromoteCustomColumns(companyIntegrationID: string, entityNames: string[] | undefined, ctx: AppContext): Promise<PromoteCustomColumnsOutput>;
1033
1324
  /**
1034
- * Soft-deletes a CompanyIntegration by setting IsActive=false.
1325
+ * Pauses a connection: IsActive=false, both scheduled jobs paused, and a stop requested for
1326
+ * any sync already in flight.
1327
+ *
1328
+ * It used to be the first of those three only. The engine checks IsActive before a sync, so
1329
+ * manual syncs did stop — but the CRON jobs kept firing (a sync schedule woke, was refused,
1330
+ * and wrote a failed run, every tick, for as long as the connection stayed paused), the
1331
+ * DISCOVERY schedule kept firing and was not refused at all (a paused connection went on
1332
+ * rescanning the vendor on a timer, spending rate budget and rewriting the catalog the pause
1333
+ * was meant to freeze), and an in-flight sync ran to completion.
1334
+ *
1335
+ * ORDER IS DELIBERATE. IsActive is written FIRST, because it is the flag every other actor
1336
+ * reads: once it is false, nothing new can start, so a failure in any later step degrades the
1337
+ * pause rather than voiding it. The schedules come next. The cancel is last and is
1338
+ * best-effort by nature — a running sync belongs to whichever process owns it.
1339
+ *
1340
+ * WHAT PAUSE DOES NOT TOUCH: entity maps. Their Status is the user's own selection of which
1341
+ * tables sync, and a pause that silently deselected tables would be undone wrong on resume.
1342
+ *
1343
+ * The reply distinguishes a stop that will happen from one that will not — see
1344
+ * {@link DeactivateConnectionOutput}.
1035
1345
  */
1036
- IntegrationDeactivateConnection(companyIntegrationID: string, ctx: AppContext): Promise<MutationResultOutput>;
1346
+ IntegrationDeactivateConnection(companyIntegrationID: string, ctx: AppContext): Promise<DeactivateConnectionOutput>;
1037
1347
  /**
1038
1348
  * Reactivates a previously deactivated CompanyIntegration by setting IsActive=true.
1039
1349
  *
@@ -1161,6 +1471,33 @@ export declare class IntegrationDiscoveryResolver extends ResolverBase {
1161
1471
  */
1162
1472
  IntegrationWriteRecord(companyIntegrationID: string, objectName: string, operation: string, externalID: string, attributesJson: string, ctx: AppContext): Promise<WriteRecordOutput>;
1163
1473
  IntegrationCreateSchedule(input: CreateScheduleInput, ctx: AppContext): Promise<CreateScheduleOutput>;
1474
+ /**
1475
+ * Every scheduled job that targets this connection, with its kind, for pause/resume.
1476
+ *
1477
+ * Deliberately ONE view over both driver classes rather than two calls: pause has to move
1478
+ * the pair together, and a partial failure that pauses the sync job but leaves the discovery
1479
+ * job running is the exact defect this whole change exists to remove.
1480
+ *
1481
+ * Uses the same structured `"CompanyIntegrationID":"<uuid>"` predicate as
1482
+ * {@link findExistingScheduledJob} — a bare-UUID substring would false-match the same id
1483
+ * appearing under a different config key and pause an unrelated connection's job.
1484
+ */
1485
+ private findScheduledJobsForConnection;
1486
+ /**
1487
+ * A refusal reason when this connection is paused, or null when it is not.
1488
+ *
1489
+ * everything.txt C6 makes deactivation mean "stop touching the source". Syncs already honoured
1490
+ * that — the engine checks IsActive before RunSync — but DISCOVERY never did. A paused
1491
+ * connection could still be re-scanned by hand or by a cron that outlived the pause, which
1492
+ * spends the customer's rate budget and rewrites the very catalog the pause was meant to
1493
+ * freeze. Pausing the schedules stops the timer; this stops everything else.
1494
+ *
1495
+ * Fails OPEN: a connection we cannot read is not declared paused. The gate exists to honour an
1496
+ * explicit pause, not to become a new way for discovery to be unavailable.
1497
+ */
1498
+ private describeIfPaused;
1499
+ /** Moves one scheduled job to a status. Returns false on any failure; the caller reports honestly. */
1500
+ private setScheduledJobStatus;
1164
1501
  /**
1165
1502
  * U7 — server-side schedule uniqueness: finds an existing (non-deleted) scheduled job of the
1166
1503
  * given job type that targets the given CompanyIntegration (its Configuration JSON carries
@@ -1179,14 +1516,56 @@ export declare class IntegrationDiscoveryResolver extends ResolverBase {
1179
1516
  IntegrationGetRSUProgress(ctx: AppContext): Promise<OperationProgressOutput>;
1180
1517
  IntegrationGetSyncProgress(companyIntegrationID: string, ctx: AppContext): Promise<OperationProgressOutput>;
1181
1518
  IntegrationGetStatus(companyIntegrationID: string, ctx: AppContext): Promise<IntegrationStatusOutput>;
1182
- IntegrationGetSyncHistory(companyIntegrationID: string, limit: number, ctx: AppContext): Promise<SyncHistoryOutput>;
1519
+ /**
1520
+ * Paged run history, newest first.
1521
+ *
1522
+ * plan.md: "history must show a paginated list with all runs (25 per page) in the history, it
1523
+ * should not shwo just aprt of it". Both surfaces used to fake paging by re-fetching with a
1524
+ * DOUBLED limit and slicing client-side, which cannot reach past the cap and re-transfers
1525
+ * everything already shown.
1526
+ *
1527
+ * `offset` maps to RunView's StartRow. TotalKnown comes from a separate count so a pager can
1528
+ * size itself without fetching every row.
1529
+ */
1530
+ /**
1531
+ * Everything running for a connection, in one call.
1532
+ *
1533
+ * plan.md: "In the UI for the integration ... there shouldbe an area that shows thigns that are
1534
+ * running actively, this can be syncs, rsu, discovery, etc." and "Let us say i clear browser
1535
+ * cache and then i go to that integration page, i should see the same steps i mentioned
1536
+ * hapepning there to". Every field here is derived SERVER-side, so a cleared browser sees the
1537
+ * same thing — nothing depends on client state.
1538
+ *
1539
+ * Previously a surface had to fan out to four queries and stitch them, and each got the
1540
+ * attribution wrong in its own way. The two rules that fan-out kept breaking are encoded here:
1541
+ *
1542
+ * - RSU status from GetStatus is PROCESS-WIDE. It is only attributed to this connection when
1543
+ * an RSU run artifact actually names it; otherwise it is reported Scope='workspace'.
1544
+ * - A ConnectorCreation run is discovery, never a sync. Narrating it as a sync is what made a
1545
+ * first-time setup claim it was syncing records it had not fetched.
1546
+ */
1547
+ IntegrationGetActiveOperations(companyIntegrationID: string, ctx: AppContext): Promise<ActiveOperationsOutput>;
1548
+ /**
1549
+ * What the tenant can see about its own resource headroom.
1550
+ *
1551
+ * plan.md line 158: "what happens if we run out of storage when we sync, how do we alert the
1552
+ * user, OOM (MJC should handle)". The tenant MEASURES - it is the process that fills the heap
1553
+ * and the disk - and the control plane decides. Before this there was no measurement at all,
1554
+ * so a sync that died of OOM or a full disk did so with no warning ahead of it and no
1555
+ * explanation after.
1556
+ *
1557
+ * Deliberately not authorized per connection: this is a property of the workspace, not of any
1558
+ * one connector, and the control plane polls it to decide admission.
1559
+ */
1560
+ IntegrationGetResourcePressure(_ctx: AppContext): Promise<ResourcePressureOutput>;
1561
+ IntegrationGetSyncHistory(companyIntegrationID: string, limit: number, offset: number, ctx: AppContext): Promise<SyncHistoryOutput>;
1183
1562
  /**
1184
1563
  * Lists integration runs (sync, connector-creation, RSU, discovery, …) from the
1185
1564
  * durable progress-artifact store, newest-first. Use this to render run history
1186
1565
  * with live status for a multi-tenant control surface. Optionally scope to a
1187
1566
  * single connector and/or run kind, or to only in-flight runs.
1188
1567
  */
1189
- IntegrationListRuns(ctx: AppContext, companyIntegrationID?: string, runKind?: string, inFlightOnly?: boolean, limit?: number): Promise<IntegrationListRunsOutput>;
1568
+ IntegrationListRuns(ctx: AppContext, companyIntegrationID?: string, runKind?: string, inFlightOnly?: boolean, limit?: number, offset?: number): Promise<IntegrationListRunsOutput>;
1190
1569
  /** Returns only the run snapshots the caller is authorized to read. */
1191
1570
  private filterAuthorizedRuns;
1192
1571
  /**
@@ -1205,6 +1584,13 @@ export declare class IntegrationDiscoveryResolver extends ResolverBase {
1205
1584
  private toRunSummaryArtifact;
1206
1585
  /** Maps the reader's lowercase counts shape to the PascalCase GraphQL output. */
1207
1586
  private toCountsOutput;
1587
+ /**
1588
+ * Returns the settings the connector bound to a CompanyIntegration declares in its
1589
+ * `SettingsSchema` — key, label, group, type, default, bounds and tier — so a client can
1590
+ * render the connection's settings form without knowing the connector. A connector that
1591
+ * declares none returns an empty list.
1592
+ */
1593
+ IntegrationGetConnectorSettingsSchema(companyIntegrationID: string, ctx: AppContext): Promise<ConnectorSettingsSchemaOutput>;
1208
1594
  /**
1209
1595
  * Returns the CRUD capability flags for the connector bound to a CompanyIntegration.
1210
1596
  * Use this to determine which operations (Create/Update/Delete/Search) are supported
@@ -1230,7 +1616,7 @@ export declare class IntegrationDiscoveryResolver extends ResolverBase {
1230
1616
  * applies ALTER TABLE migrations via the RSU pipeline.
1231
1617
  * Compares the current connector introspection against existing MJ entities.
1232
1618
  */
1233
- IntegrationSchemaEvolution(companyIntegrationID: string, platform: string, skipGitCommit: boolean, skipRestart: boolean, autoEnableNewObjects: boolean, autoEnableNewColumns: boolean, deactivateAbsent: boolean | undefined, cascadeRemoveDependents: boolean, ctx: AppContext): Promise<SchemaEvolutionOutput>;
1619
+ IntegrationSchemaEvolution(companyIntegrationID: string, platform: string, skipGitCommit: boolean, skipRestart: boolean, autoEnableNewObjects: boolean, autoEnableNewColumns: boolean, deactivateAbsent: boolean | undefined, cascadeRemoveDependents: boolean, acceptCustomColumns: string[], ctx: AppContext): Promise<SchemaEvolutionOutput>;
1234
1620
  /**
1235
1621
  * Refresh diff (continuing objects): reconciles one entity map's field maps to the
1236
1622
  * post-resolution IOF set.
@@ -1248,6 +1634,10 @@ export declare class IntegrationDiscoveryResolver extends ResolverBase {
1248
1634
  * A field map whose source field is no longer Active in the resolution is DISABLED, never
1249
1635
  * deleted — a later re-appearance re-enables it through the same reconciliation (the
1250
1636
  * field-is-back branch above), so retiring and restoring a column are both non-destructive.
1637
+ *
1638
+ * Under a per-connection catalog the field rows come from `scopedFields`, never from the
1639
+ * engine: the engine answers `[]` for a cold per-connection object, and an empty field list here
1640
+ * disables every Active field map on the object.
1251
1641
  */
1252
1642
  private reconcileFieldMapsForEntityMap;
1253
1643
  private sendWebhook;