@memberjunction/server 6.2.0-edge.0 → 6.2.0-edge.1

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