@agent-native/core 0.98.4 → 0.98.6

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 (314) hide show
  1. package/corpus/README.md +2 -2
  2. package/corpus/core/CHANGELOG.md +28 -0
  3. package/corpus/core/docs/content/durable-background-runs.mdx +37 -0
  4. package/corpus/core/docs/content/external-agents.mdx +62 -7
  5. package/corpus/core/docs/content/locales/ar-SA/external-agents.mdx +38 -7
  6. package/corpus/core/docs/content/locales/ar-SA/tracking.mdx +2 -0
  7. package/corpus/core/docs/content/locales/de-DE/external-agents.mdx +39 -7
  8. package/corpus/core/docs/content/locales/de-DE/tracking.mdx +2 -0
  9. package/corpus/core/docs/content/locales/es-ES/external-agents.mdx +39 -7
  10. package/corpus/core/docs/content/locales/es-ES/tracking.mdx +2 -0
  11. package/corpus/core/docs/content/locales/fr-FR/external-agents.mdx +39 -7
  12. package/corpus/core/docs/content/locales/fr-FR/tracking.mdx +4 -2
  13. package/corpus/core/docs/content/locales/hi-IN/external-agents.mdx +38 -7
  14. package/corpus/core/docs/content/locales/hi-IN/tracking.mdx +2 -0
  15. package/corpus/core/docs/content/locales/ja-JP/external-agents.mdx +38 -7
  16. package/corpus/core/docs/content/locales/ja-JP/tracking.mdx +2 -0
  17. package/corpus/core/docs/content/locales/ko-KR/external-agents.mdx +38 -7
  18. package/corpus/core/docs/content/locales/ko-KR/tracking.mdx +2 -0
  19. package/corpus/core/docs/content/locales/pt-BR/external-agents.mdx +39 -7
  20. package/corpus/core/docs/content/locales/pt-BR/tracking.mdx +2 -0
  21. package/corpus/core/docs/content/locales/zh-CN/external-agents.mdx +37 -7
  22. package/corpus/core/docs/content/locales/zh-CN/tracking.mdx +2 -0
  23. package/corpus/core/docs/content/locales/zh-TW/durable-background-runs.mdx +14 -0
  24. package/corpus/core/docs/content/locales/zh-TW/external-agents.mdx +37 -7
  25. package/corpus/core/docs/content/locales/zh-TW/tracking.mdx +2 -0
  26. package/corpus/core/docs/content/tracking.mdx +2 -0
  27. package/corpus/core/package.json +1 -1
  28. package/corpus/core/src/a2a/handlers.ts +95 -21
  29. package/corpus/core/src/a2a/task-store.ts +65 -3
  30. package/corpus/core/src/agent/durable-background.ts +16 -16
  31. package/corpus/core/src/agent/engine/ai-sdk-engine.ts +25 -8
  32. package/corpus/core/src/agent/engine/anthropic-engine.ts +17 -3
  33. package/corpus/core/src/agent/engine/output-tokens.ts +6 -6
  34. package/corpus/core/src/agent/production-agent.ts +200 -27
  35. package/corpus/core/src/agent/run-manager.ts +81 -1
  36. package/corpus/core/src/agent/run-store.ts +301 -41
  37. package/corpus/core/src/client/AgentPanel.tsx +6 -2
  38. package/corpus/core/src/client/AssistantChat.tsx +364 -69
  39. package/corpus/core/src/client/agent-chat-adapter.ts +169 -1
  40. package/corpus/core/src/client/chat/message-components.tsx +3 -0
  41. package/corpus/core/src/client/chat/tool-call-display.tsx +20 -36
  42. package/corpus/core/src/client/conversation/use-near-bottom-autoscroll.ts +7 -0
  43. package/corpus/core/src/client/extensions/AgentNativeExtensionFrame.tsx +2 -0
  44. package/corpus/core/src/client/extensions/EmbeddedExtension.tsx +2 -0
  45. package/corpus/core/src/client/extensions/ExtensionEditor.tsx +9 -2
  46. package/corpus/core/src/client/extensions/ExtensionViewer.tsx +2 -0
  47. package/corpus/core/src/client/extensions/InlineExtensionFrame.tsx +2 -0
  48. package/corpus/core/src/client/extensions/portable-extension.ts +2 -0
  49. package/corpus/core/src/client/session-replay.ts +361 -29
  50. package/corpus/core/src/client/sse-event-processor.ts +43 -1
  51. package/corpus/core/src/demo/actions/toggle-demo-mode.ts +1 -1
  52. package/corpus/core/src/demo/config.ts +6 -6
  53. package/corpus/core/src/demo/fetch-interceptor.ts +13 -4
  54. package/corpus/core/src/demo/redact.ts +13 -149
  55. package/corpus/core/src/extensions/html-shell.ts +3 -0
  56. package/corpus/core/src/extensions/session-replay-iframe.ts +131 -0
  57. package/corpus/core/src/integrations/adapters/slack.ts +123 -13
  58. package/corpus/core/src/integrations/identity-links-store.ts +210 -0
  59. package/corpus/core/src/integrations/identity.ts +132 -0
  60. package/corpus/core/src/integrations/index.ts +6 -0
  61. package/corpus/core/src/integrations/plugin.ts +58 -1
  62. package/corpus/core/src/integrations/types.ts +7 -0
  63. package/corpus/core/src/mcp/build-server.ts +127 -22
  64. package/corpus/core/src/mcp/external-agent-policy.ts +18 -0
  65. package/corpus/core/src/mcp/index.ts +1 -0
  66. package/corpus/core/src/scripts/agent-engines/list-agent-engines.ts +1 -20
  67. package/corpus/core/src/server/agent-chat/plugin-options.ts +12 -1
  68. package/corpus/core/src/server/agent-chat/script-entries.ts +20 -3
  69. package/corpus/core/src/server/agent-chat-plugin.ts +3 -0
  70. package/corpus/core/src/session-replay-iframe-protocol.ts +58 -0
  71. package/corpus/core/src/shared/reasoning-effort.ts +35 -0
  72. package/corpus/core/src/styles/agent-conversation.css +26 -0
  73. package/corpus/core/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +34 -5
  74. package/corpus/core/src/templates/workspace-core/.agents/skills/observability/SKILL.md +0 -15
  75. package/corpus/templates/analytics/.agents/skills/session-replay/SKILL.md +30 -21
  76. package/corpus/templates/analytics/AGENTS.md +27 -0
  77. package/corpus/templates/analytics/actions/create-session-replay-agent-link.ts +0 -1
  78. package/corpus/templates/analytics/actions/get-error-issue.ts +1 -0
  79. package/corpus/templates/analytics/actions/get-session-replay-summary.ts +1 -0
  80. package/corpus/templates/analytics/actions/get-session-replay-timeline.ts +40 -0
  81. package/corpus/templates/analytics/actions/list-error-issues.ts +13 -0
  82. package/corpus/templates/analytics/actions/list-session-recordings.ts +1 -0
  83. package/corpus/templates/analytics/actions/query-agent-native-analytics.ts +4 -0
  84. package/corpus/templates/analytics/app/global.css +2 -2
  85. package/corpus/templates/analytics/app/hooks/use-dashboard-chat-context.ts +41 -4
  86. package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +52 -203
  87. package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +69 -16
  88. package/corpus/templates/analytics/changelog/2026-07-12-analytics-chat-retries-before-showing-a-generic-no-data-mess.md +6 -0
  89. package/corpus/templates/analytics/changelog/2026-07-12-analytics-sessions-search-no-longer-loses-fast-keystrokes-an.md +6 -0
  90. package/corpus/templates/analytics/changelog/2026-07-12-chart-selection-respects-chat-state.md +6 -0
  91. package/corpus/templates/analytics/changelog/2026-07-12-connected-external-agents-can-now-look-up-sessions-error-iss.md +6 -0
  92. package/corpus/templates/analytics/changelog/2026-07-12-demo-mode-anonymizes-error-reporting-emails.md +6 -0
  93. package/corpus/templates/analytics/changelog/2026-07-12-session-identities-stay-visible-when-demo-mode-is-off.md +6 -0
  94. package/corpus/templates/analytics/changelog/2026-07-12-session-replays-show-iframe-content.md +6 -0
  95. package/corpus/templates/analytics/netlify.toml +0 -3
  96. package/corpus/templates/analytics/server/lib/analytics-connector-catalog.ts +14 -0
  97. package/corpus/templates/analytics/server/lib/error-capture.ts +101 -2
  98. package/corpus/templates/analytics/server/lib/real-data-actions.ts +24 -0
  99. package/corpus/templates/analytics/server/lib/session-replay-agent-context.ts +49 -17
  100. package/corpus/templates/analytics/server/lib/session-replay.ts +18 -16
  101. package/corpus/templates/analytics/server/plugins/agent-chat.ts +43 -6
  102. package/corpus/templates/analytics/server/plugins/db.ts +15 -0
  103. package/corpus/templates/assets/app/global.css +1 -1
  104. package/corpus/templates/brain/app/global.css +2 -2
  105. package/corpus/templates/brain/changelog/2026-07-12-fix-long-response-progress.md +6 -0
  106. package/corpus/templates/forms/app/components/CloudUpgrade.tsx +1 -1
  107. package/corpus/templates/forms/app/components/ThemeToggle.tsx +22 -6
  108. package/corpus/templates/forms/app/components/builder/FieldPropertiesPanel.tsx +5 -5
  109. package/corpus/templates/forms/app/components/builder/FieldRenderer.tsx +3 -3
  110. package/corpus/templates/forms/app/components/layout/Sidebar.tsx +16 -16
  111. package/corpus/templates/forms/app/global.css +164 -13
  112. package/corpus/templates/forms/app/pages/AskPage.tsx +35 -13
  113. package/corpus/templates/forms/app/pages/FormBuilderPage.tsx +143 -67
  114. package/corpus/templates/forms/app/pages/FormFillPage.tsx +44 -11
  115. package/corpus/templates/forms/app/pages/FormsListPage.tsx +42 -24
  116. package/corpus/templates/forms/app/pages/ResponseInsightsPage.tsx +28 -15
  117. package/corpus/templates/forms/app/pages/ResponsesPage.tsx +46 -20
  118. package/corpus/templates/forms/app/routes/_app.settings.tsx +1 -1
  119. package/corpus/templates/forms/changelog/2026-07-12-ask-forms-suggestions-now-sit-beneath-the-composer-for-a-tig.md +6 -0
  120. package/corpus/templates/forms/changelog/2026-07-12-builder-response-tables-now-fill-the-view-without-a-redundan.md +6 -0
  121. package/corpus/templates/forms/changelog/2026-07-12-form-builder-surfaces-are-calmer-fields-stay-stable-on-hover.md +6 -0
  122. package/corpus/templates/forms/changelog/2026-07-12-response-tables-now-fill-the-available-pane-with-a-flexible-.md +6 -0
  123. package/corpus/templates/forms/changelog/2026-07-12-smoother-more-tactile-controls-throughout-animated-icon-and-.md +6 -0
  124. package/corpus/templates/mail/AGENTS.md +3 -1
  125. package/corpus/templates/mail/app/components/email/EmailThread.tsx +21 -13
  126. package/corpus/templates/mail/app/components/email/email-iframe-document.ts +18 -0
  127. package/corpus/templates/mail/server/lib/mail-integrations.ts +3 -0
  128. package/dist/a2a/handlers.d.ts.map +1 -1
  129. package/dist/a2a/handlers.js +84 -15
  130. package/dist/a2a/handlers.js.map +1 -1
  131. package/dist/a2a/task-store.d.ts +20 -1
  132. package/dist/a2a/task-store.d.ts.map +1 -1
  133. package/dist/a2a/task-store.js +57 -4
  134. package/dist/a2a/task-store.js.map +1 -1
  135. package/dist/agent/durable-background.d.ts +10 -10
  136. package/dist/agent/durable-background.d.ts.map +1 -1
  137. package/dist/agent/durable-background.js +16 -16
  138. package/dist/agent/durable-background.js.map +1 -1
  139. package/dist/agent/engine/ai-sdk-engine.d.ts.map +1 -1
  140. package/dist/agent/engine/ai-sdk-engine.js +19 -8
  141. package/dist/agent/engine/ai-sdk-engine.js.map +1 -1
  142. package/dist/agent/engine/anthropic-engine.d.ts.map +1 -1
  143. package/dist/agent/engine/anthropic-engine.js +11 -3
  144. package/dist/agent/engine/anthropic-engine.js.map +1 -1
  145. package/dist/agent/engine/output-tokens.js +6 -6
  146. package/dist/agent/engine/output-tokens.js.map +1 -1
  147. package/dist/agent/production-agent.d.ts +52 -0
  148. package/dist/agent/production-agent.d.ts.map +1 -1
  149. package/dist/agent/production-agent.js +154 -26
  150. package/dist/agent/production-agent.js.map +1 -1
  151. package/dist/agent/run-manager.d.ts +9 -0
  152. package/dist/agent/run-manager.d.ts.map +1 -1
  153. package/dist/agent/run-manager.js +71 -1
  154. package/dist/agent/run-manager.js.map +1 -1
  155. package/dist/agent/run-store.d.ts +9 -0
  156. package/dist/agent/run-store.d.ts.map +1 -1
  157. package/dist/agent/run-store.js +243 -48
  158. package/dist/agent/run-store.js.map +1 -1
  159. package/dist/client/AgentPanel.d.ts.map +1 -1
  160. package/dist/client/AgentPanel.js +6 -2
  161. package/dist/client/AgentPanel.js.map +1 -1
  162. package/dist/client/AssistantChat.d.ts +21 -0
  163. package/dist/client/AssistantChat.d.ts.map +1 -1
  164. package/dist/client/AssistantChat.js +298 -67
  165. package/dist/client/AssistantChat.js.map +1 -1
  166. package/dist/client/agent-chat-adapter.d.ts.map +1 -1
  167. package/dist/client/agent-chat-adapter.js +146 -1
  168. package/dist/client/agent-chat-adapter.js.map +1 -1
  169. package/dist/client/chat/message-components.d.ts.map +1 -1
  170. package/dist/client/chat/message-components.js +2 -1
  171. package/dist/client/chat/message-components.js.map +1 -1
  172. package/dist/client/chat/tool-call-display.d.ts +3 -1
  173. package/dist/client/chat/tool-call-display.d.ts.map +1 -1
  174. package/dist/client/chat/tool-call-display.js +13 -37
  175. package/dist/client/chat/tool-call-display.js.map +1 -1
  176. package/dist/client/conversation/use-near-bottom-autoscroll.d.ts +1 -0
  177. package/dist/client/conversation/use-near-bottom-autoscroll.d.ts.map +1 -1
  178. package/dist/client/conversation/use-near-bottom-autoscroll.js +6 -0
  179. package/dist/client/conversation/use-near-bottom-autoscroll.js.map +1 -1
  180. package/dist/client/extensions/AgentNativeExtensionFrame.d.ts.map +1 -1
  181. package/dist/client/extensions/AgentNativeExtensionFrame.js +2 -1
  182. package/dist/client/extensions/AgentNativeExtensionFrame.js.map +1 -1
  183. package/dist/client/extensions/EmbeddedExtension.d.ts.map +1 -1
  184. package/dist/client/extensions/EmbeddedExtension.js +2 -1
  185. package/dist/client/extensions/EmbeddedExtension.js.map +1 -1
  186. package/dist/client/extensions/ExtensionEditor.d.ts.map +1 -1
  187. package/dist/client/extensions/ExtensionEditor.js +5 -2
  188. package/dist/client/extensions/ExtensionEditor.js.map +1 -1
  189. package/dist/client/extensions/ExtensionViewer.d.ts.map +1 -1
  190. package/dist/client/extensions/ExtensionViewer.js +2 -1
  191. package/dist/client/extensions/ExtensionViewer.js.map +1 -1
  192. package/dist/client/extensions/InlineExtensionFrame.d.ts.map +1 -1
  193. package/dist/client/extensions/InlineExtensionFrame.js +2 -1
  194. package/dist/client/extensions/InlineExtensionFrame.js.map +1 -1
  195. package/dist/client/extensions/portable-extension.d.ts.map +1 -1
  196. package/dist/client/extensions/portable-extension.js +2 -0
  197. package/dist/client/extensions/portable-extension.js.map +1 -1
  198. package/dist/client/session-replay.d.ts.map +1 -1
  199. package/dist/client/session-replay.js +308 -29
  200. package/dist/client/session-replay.js.map +1 -1
  201. package/dist/client/sse-event-processor.d.ts +5 -0
  202. package/dist/client/sse-event-processor.d.ts.map +1 -1
  203. package/dist/client/sse-event-processor.js +37 -1
  204. package/dist/client/sse-event-processor.js.map +1 -1
  205. package/dist/collab/routes.d.ts +1 -1
  206. package/dist/demo/actions/toggle-demo-mode.js +1 -1
  207. package/dist/demo/actions/toggle-demo-mode.js.map +1 -1
  208. package/dist/demo/config.js +6 -6
  209. package/dist/demo/config.js.map +1 -1
  210. package/dist/demo/fetch-interceptor.d.ts.map +1 -1
  211. package/dist/demo/fetch-interceptor.js +13 -4
  212. package/dist/demo/fetch-interceptor.js.map +1 -1
  213. package/dist/demo/redact.d.ts +7 -7
  214. package/dist/demo/redact.d.ts.map +1 -1
  215. package/dist/demo/redact.js +8 -145
  216. package/dist/demo/redact.js.map +1 -1
  217. package/dist/extensions/html-shell.d.ts.map +1 -1
  218. package/dist/extensions/html-shell.js +2 -0
  219. package/dist/extensions/html-shell.js.map +1 -1
  220. package/dist/extensions/session-replay-iframe.d.ts +10 -0
  221. package/dist/extensions/session-replay-iframe.d.ts.map +1 -0
  222. package/dist/extensions/session-replay-iframe.js +121 -0
  223. package/dist/extensions/session-replay-iframe.js.map +1 -0
  224. package/dist/file-upload/actions/upload-image.d.ts +1 -1
  225. package/dist/integrations/adapters/slack.d.ts.map +1 -1
  226. package/dist/integrations/adapters/slack.js +98 -13
  227. package/dist/integrations/adapters/slack.js.map +1 -1
  228. package/dist/integrations/identity-links-store.d.ts +23 -0
  229. package/dist/integrations/identity-links-store.d.ts.map +1 -0
  230. package/dist/integrations/identity-links-store.js +158 -0
  231. package/dist/integrations/identity-links-store.js.map +1 -0
  232. package/dist/integrations/identity.d.ts +11 -0
  233. package/dist/integrations/identity.d.ts.map +1 -0
  234. package/dist/integrations/identity.js +100 -0
  235. package/dist/integrations/identity.js.map +1 -0
  236. package/dist/integrations/index.d.ts +2 -0
  237. package/dist/integrations/index.d.ts.map +1 -1
  238. package/dist/integrations/index.js +2 -0
  239. package/dist/integrations/index.js.map +1 -1
  240. package/dist/integrations/plugin.d.ts.map +1 -1
  241. package/dist/integrations/plugin.js +43 -1
  242. package/dist/integrations/plugin.js.map +1 -1
  243. package/dist/integrations/types.d.ts +6 -0
  244. package/dist/integrations/types.d.ts.map +1 -1
  245. package/dist/integrations/types.js.map +1 -1
  246. package/dist/mcp/build-server.d.ts +9 -2
  247. package/dist/mcp/build-server.d.ts.map +1 -1
  248. package/dist/mcp/build-server.js +97 -20
  249. package/dist/mcp/build-server.js.map +1 -1
  250. package/dist/mcp/external-agent-policy.d.ts +19 -0
  251. package/dist/mcp/external-agent-policy.d.ts.map +1 -0
  252. package/dist/mcp/external-agent-policy.js +2 -0
  253. package/dist/mcp/external-agent-policy.js.map +1 -0
  254. package/dist/mcp/index.d.ts +1 -0
  255. package/dist/mcp/index.d.ts.map +1 -1
  256. package/dist/mcp/index.js.map +1 -1
  257. package/dist/notifications/routes.d.ts +1 -1
  258. package/dist/scripts/agent-engines/list-agent-engines.d.ts.map +1 -1
  259. package/dist/scripts/agent-engines/list-agent-engines.js +1 -19
  260. package/dist/scripts/agent-engines/list-agent-engines.js.map +1 -1
  261. package/dist/server/agent-chat/plugin-options.d.ts +11 -1
  262. package/dist/server/agent-chat/plugin-options.d.ts.map +1 -1
  263. package/dist/server/agent-chat/plugin-options.js.map +1 -1
  264. package/dist/server/agent-chat/script-entries.d.ts.map +1 -1
  265. package/dist/server/agent-chat/script-entries.js +16 -2
  266. package/dist/server/agent-chat/script-entries.js.map +1 -1
  267. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  268. package/dist/server/agent-chat-plugin.js +3 -0
  269. package/dist/server/agent-chat-plugin.js.map +1 -1
  270. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  271. package/dist/server/transcribe-voice.d.ts +1 -1
  272. package/dist/session-replay-iframe-protocol.d.ts +36 -0
  273. package/dist/session-replay-iframe-protocol.d.ts.map +1 -0
  274. package/dist/session-replay-iframe-protocol.js +24 -0
  275. package/dist/session-replay-iframe-protocol.js.map +1 -0
  276. package/dist/shared/reasoning-effort.d.ts +11 -0
  277. package/dist/shared/reasoning-effort.d.ts.map +1 -1
  278. package/dist/shared/reasoning-effort.js +36 -0
  279. package/dist/shared/reasoning-effort.js.map +1 -1
  280. package/dist/styles/agent-conversation.css +26 -0
  281. package/dist/templates/workspace-core/.agents/skills/external-agents/SKILL.md +34 -5
  282. package/dist/templates/workspace-core/.agents/skills/observability/SKILL.md +0 -15
  283. package/docs/content/durable-background-runs.mdx +37 -0
  284. package/docs/content/external-agents.mdx +62 -7
  285. package/docs/content/locales/ar-SA/external-agents.mdx +38 -7
  286. package/docs/content/locales/ar-SA/tracking.mdx +2 -0
  287. package/docs/content/locales/de-DE/external-agents.mdx +39 -7
  288. package/docs/content/locales/de-DE/tracking.mdx +2 -0
  289. package/docs/content/locales/es-ES/external-agents.mdx +39 -7
  290. package/docs/content/locales/es-ES/tracking.mdx +2 -0
  291. package/docs/content/locales/fr-FR/external-agents.mdx +39 -7
  292. package/docs/content/locales/fr-FR/tracking.mdx +4 -2
  293. package/docs/content/locales/hi-IN/external-agents.mdx +38 -7
  294. package/docs/content/locales/hi-IN/tracking.mdx +2 -0
  295. package/docs/content/locales/ja-JP/external-agents.mdx +38 -7
  296. package/docs/content/locales/ja-JP/tracking.mdx +2 -0
  297. package/docs/content/locales/ko-KR/external-agents.mdx +38 -7
  298. package/docs/content/locales/ko-KR/tracking.mdx +2 -0
  299. package/docs/content/locales/pt-BR/external-agents.mdx +39 -7
  300. package/docs/content/locales/pt-BR/tracking.mdx +2 -0
  301. package/docs/content/locales/zh-CN/external-agents.mdx +37 -7
  302. package/docs/content/locales/zh-CN/tracking.mdx +2 -0
  303. package/docs/content/locales/zh-TW/durable-background-runs.mdx +14 -0
  304. package/docs/content/locales/zh-TW/external-agents.mdx +37 -7
  305. package/docs/content/locales/zh-TW/tracking.mdx +2 -0
  306. package/docs/content/tracking.mdx +2 -0
  307. package/package.json +2 -2
  308. package/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +34 -5
  309. package/src/templates/workspace-core/.agents/skills/observability/SKILL.md +0 -15
  310. package/corpus/core/src/observability/hosted-model-experiment.ts +0 -118
  311. package/dist/observability/hosted-model-experiment.d.ts +0 -39
  312. package/dist/observability/hosted-model-experiment.d.ts.map +0 -1
  313. package/dist/observability/hosted-model-experiment.js +0 -90
  314. package/dist/observability/hosted-model-experiment.js.map +0 -1
@@ -15,8 +15,6 @@ import {
15
15
  normalizeModelForEngine,
16
16
  } from "../../agent/engine/index.js";
17
17
  import type { ActionTool } from "../../agent/types.js";
18
- import { resolveHostedDefaultModelExperiment } from "../../observability/hosted-model-experiment.js";
19
- import { getRequestUserEmail } from "../../server/request-context.js";
20
18
  import { getSetting } from "../../settings/index.js";
21
19
 
22
20
  export const tool: ActionTool = {
@@ -84,24 +82,13 @@ export async function run(args: Record<string, string> = {}): Promise<string> {
84
82
  ? current?.model
85
83
  : undefined;
86
84
  const currentEngineName = currentEntry?.name ?? "anthropic";
87
- let currentModel =
85
+ const currentModel =
88
86
  currentEntry && !envUnavailable
89
87
  ? normalizeModelForEngine(
90
88
  currentEntry,
91
89
  currentModelCandidate ?? currentEntry.defaultModel,
92
90
  )
93
91
  : (currentModelCandidate ?? DEFAULT_MODEL);
94
- const hostedExperiment =
95
- currentEntry && !currentModelCandidate
96
- ? resolveHostedDefaultModelExperiment({
97
- userId: getRequestUserEmail(),
98
- engineName: currentEntry.name,
99
- isDefaultModelSelection: true,
100
- supportedModels: currentEntry.supportedModels,
101
- })
102
- : null;
103
- if (hostedExperiment) currentModel = hostedExperiment.model;
104
-
105
92
  const result = {
106
93
  engines: engines.map((e) => ({
107
94
  name: e.name,
@@ -119,12 +106,6 @@ export async function run(args: Record<string, string> = {}): Promise<string> {
119
106
  : {
120
107
  engine: currentEngineName,
121
108
  model: currentModel,
122
- ...(hostedExperiment
123
- ? {
124
- modelSelectionSource: "experiment",
125
- experimentAssignment: hostedExperiment.assignment,
126
- }
127
- : {}),
128
109
  },
129
110
  };
130
111
 
@@ -5,6 +5,7 @@ import type {
5
5
  AgentChatReference,
6
6
  MentionProvider,
7
7
  } from "../../agent/types.js";
8
+ import type { ExternalAgentPolicy } from "../../mcp/external-agent-policy.js";
8
9
  import type { DatabaseToolsOption } from "../../scripts/db/tool-mode.js";
9
10
  import type { PromptExamples } from "../prompts/index.js";
10
11
 
@@ -293,7 +294,9 @@ export interface AgentChatPluginOptions {
293
294
  * browser-session tools) from connectors. It is no longer gated behind an
294
295
  * environment variable, and the catalog is never inferred from the client.
295
296
  *
296
- * `tool-search` stays available so any trimmed tool is reachable on demand.
297
+ * `tool-search` stays available for discovery; a trimmed action still needs
298
+ * the connector catalog, authenticated-read policy, or full-catalog opt-in
299
+ * before an external caller can execute it.
297
300
  * Callers who need the full surface up front opt in explicitly with
298
301
  * `agent-native connect --full-catalog` (embeds a `catalog_scope: "full"`
299
302
  * claim in their connect-minted JWT) or the deployment-wide
@@ -303,6 +306,14 @@ export interface AgentChatPluginOptions {
303
306
  */
304
307
  connectorCatalog?: string[];
305
308
 
309
+ /**
310
+ * Default authenticated external-agent policy. In `auto` read mode, every
311
+ * action explicitly marked as GET + readOnly + publicAgent.requiresAuth is
312
+ * added to the connector surface automatically. Writes remain ask_app-only
313
+ * unless `writes: "allowlisted"` is explicitly selected.
314
+ */
315
+ externalAgents?: ExternalAgentPolicy;
316
+
306
317
  /**
307
318
  * Skip mounting the remote MCP protocol route.
308
319
  *
@@ -31,7 +31,10 @@ import {
31
31
  function wrapCliScript(
32
32
  tool: ActionTool,
33
33
  cliDefault: (args: string[]) => Promise<void>,
34
- opts?: { readOnly?: boolean },
34
+ opts?: {
35
+ allowedArgs?: readonly string[];
36
+ readOnly?: boolean;
37
+ },
35
38
  ): ActionEntry {
36
39
  return {
37
40
  tool,
@@ -39,6 +42,14 @@ function wrapCliScript(
39
42
  run: async (args: Record<string, string>): Promise<string> => {
40
43
  const cliArgs: string[] = [];
41
44
  for (const [k, v] of Object.entries(args)) {
45
+ // MCP input schemas are descriptive and some hosts can still send
46
+ // undeclared keys. The externally exposed DB readers must never accept
47
+ // the CLI-only `--db` escape hatch, which could point at another local
48
+ // SQLite file. Keep their runtime surface identical to the advertised
49
+ // schema instead of trusting the client to validate it.
50
+ if (opts?.allowedArgs && !opts.allowedArgs.includes(k)) {
51
+ throw new Error(`Unknown argument: ${k}`);
52
+ }
42
53
  const raw = v as unknown;
43
54
  const value =
44
55
  raw != null && typeof raw === "object"
@@ -101,7 +112,10 @@ export async function createDbScriptEntries(
101
112
  },
102
113
  },
103
114
  schemaMod.default,
104
- { readOnly: true },
115
+ {
116
+ allowedArgs: ["format"],
117
+ readOnly: true,
118
+ },
105
119
  ),
106
120
  "db-query": wrapCliScript(
107
121
  {
@@ -134,7 +148,10 @@ export async function createDbScriptEntries(
134
148
  },
135
149
  },
136
150
  queryMod.default,
137
- { readOnly: true },
151
+ {
152
+ allowedArgs: ["sql", "args", "format", "limit"],
153
+ readOnly: true,
154
+ },
138
155
  ),
139
156
  };
140
157
 
@@ -1512,6 +1512,9 @@ export function createAgentChatPlugin(
1512
1512
  ...(options?.connectorCatalog
1513
1513
  ? { connectorCatalog: options.connectorCatalog }
1514
1514
  : {}),
1515
+ ...(options?.externalAgents
1516
+ ? { externalAgents: options.externalAgents }
1517
+ : {}),
1515
1518
  askAgent: async (message: string) => {
1516
1519
  const mcpEngine = await resolveEngine({
1517
1520
  engineOption: options?.engine,
@@ -0,0 +1,58 @@
1
+ export const SESSION_REPLAY_IFRAME_ATTRIBUTE =
2
+ "data-agent-native-session-replay";
3
+ export const SESSION_REPLAY_IFRAME_PROBE = "agent-native-session-replay:probe";
4
+ export const SESSION_REPLAY_IFRAME_START = "agent-native-session-replay:start";
5
+ export const SESSION_REPLAY_IFRAME_STOP = "agent-native-session-replay:stop";
6
+
7
+ export interface SessionReplayIframePrivacyOptions {
8
+ blockSelector: string;
9
+ ignoreSelector: string;
10
+ maskTextClass?: string | RegExp;
11
+ maskTextSelector: string;
12
+ maskAllInputs: boolean;
13
+ maskInputOptions?: Record<string, boolean>;
14
+ recordCanvas: boolean;
15
+ collectFonts: boolean;
16
+ inlineImages: boolean;
17
+ sampling: Record<string, unknown>;
18
+ }
19
+
20
+ export interface SessionReplayIframeProbeMessage {
21
+ type: typeof SESSION_REPLAY_IFRAME_PROBE;
22
+ }
23
+
24
+ export interface SessionReplayIframeStartMessage {
25
+ type: typeof SESSION_REPLAY_IFRAME_START;
26
+ options: SessionReplayIframePrivacyOptions;
27
+ }
28
+
29
+ export interface SessionReplayIframeStopMessage {
30
+ type: typeof SESSION_REPLAY_IFRAME_STOP;
31
+ }
32
+
33
+ export type SessionReplayIframeMessage =
34
+ | SessionReplayIframeProbeMessage
35
+ | SessionReplayIframeStartMessage
36
+ | SessionReplayIframeStopMessage;
37
+
38
+ /**
39
+ * `srcdoc` HTML came from the immediate parent, so that parent already owns the
40
+ * document being rendered. Server-rendered extension URLs are stricter: only a
41
+ * parent on the render URL's origin may activate recording. That supports
42
+ * custom app domains without allowing an external embed host to make an opaque
43
+ * extension frame disclose its DOM through rrweb's postMessage transport.
44
+ */
45
+ export function isTrustedSessionReplayIframeParentOrigin(
46
+ parentOrigin: string,
47
+ frameHref: string,
48
+ ): boolean {
49
+ if (frameHref === "about:srcdoc") {
50
+ return parentOrigin !== "null" && parentOrigin !== "";
51
+ }
52
+ try {
53
+ const frameOrigin = new URL(frameHref).origin;
54
+ return frameOrigin !== "null" && parentOrigin === frameOrigin;
55
+ } catch {
56
+ return false;
57
+ }
58
+ }
@@ -170,6 +170,41 @@ function isClaudeReasoningModel(model: string) {
170
170
  return opusMatch ? parseInt(opusMatch[1], 10) >= 6 : false;
171
171
  }
172
172
 
173
+ /**
174
+ * Anthropic's adaptive-thinking API is only available on the newer Claude
175
+ * model families. Claude Haiku 4.5 is reasoning-capable, but it still
176
+ * requires the legacy manual `budget_tokens` configuration.
177
+ */
178
+ export function supportsClaudeAdaptiveThinking(model: string | undefined) {
179
+ if (!model) return false;
180
+ const id = model.toLowerCase().replace(/^anthropic\//, "");
181
+ if (id.includes("fable-5") || id.includes("mythos-5")) return true;
182
+ if (id.includes("sonnet-5") || id.includes("sonnet-4-6")) return true;
183
+ const opusMatch = id.match(/opus-4[-.](\d+)/);
184
+ return opusMatch ? parseInt(opusMatch[1], 10) >= 6 : false;
185
+ }
186
+
187
+ /**
188
+ * Map the shared reasoning ladder to Anthropic's manual thinking budgets for
189
+ * models that do not support adaptive thinking (currently Claude Haiku 4.5).
190
+ */
191
+ export function anthropicManualThinkingBudget(effort: ReasoningEffort) {
192
+ switch (effort) {
193
+ case "low":
194
+ return 1_024;
195
+ case "medium":
196
+ return 4_096;
197
+ case "high":
198
+ return 8_000;
199
+ case "xhigh":
200
+ return 16_000;
201
+ case "max":
202
+ return 32_000;
203
+ default:
204
+ return 4_096;
205
+ }
206
+ }
207
+
173
208
  function supportsClaudeXHigh(model: string) {
174
209
  const id = model.toLowerCase().replace(/^anthropic\//, "");
175
210
  // Models that support the xhigh effort tier (built-in extended thinking via
@@ -493,6 +493,32 @@
493
493
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 1.5rem);
494
494
  }
495
495
 
496
+ .agent-chat-collapse {
497
+ display: grid;
498
+ grid-template-rows: 1fr;
499
+ opacity: 1;
500
+ transition:
501
+ grid-template-rows 200ms var(--ease-collapse),
502
+ opacity 150ms ease-out;
503
+ }
504
+
505
+ .agent-chat-collapse[data-state="closed"] {
506
+ grid-template-rows: 0fr;
507
+ opacity: 0;
508
+ pointer-events: none;
509
+ }
510
+
511
+ .agent-chat-collapse__content {
512
+ min-height: 0;
513
+ overflow: hidden;
514
+ }
515
+
516
+ @media (prefers-reduced-motion: reduce) {
517
+ .agent-chat-collapse {
518
+ transition-duration: 0.01ms;
519
+ }
520
+ }
521
+
496
522
  /* ─── Agent-Markdown (AssistantChat react-markdown render surface) ─────────── */
497
523
  /* These classes are applied by the SmoothMarkdownText/MarkdownText components */
498
524
  /* in the AssistantChat/AssistantChatInner tree. The shiki dual-theme rules */
@@ -160,15 +160,44 @@ tiny by default for ChatGPT/Claude-style app hosts, including OAuth MCP Apps
160
160
  callers and generic authenticated remote HTTP/static-token callers. The model
161
161
  sees the generic app-facing verbs (`list_apps`, `open_app`, `ask_app`, and
162
162
  app-only `create_embed_session`) and routes UI through
163
- `open_app({ embed: true })`. Stdio/code clients that explicitly identify as
164
- developer clients keep the full connected action surface, and
165
- `publicAgent.expose` remains the opt-in for safe read/ingest tools outside the
166
- compact MCP Apps catalog. Do not rely on action-specific `mcpApp` resources
167
- appearing in ChatGPT/Claude discovery by default; use `open_app` for the
163
+ `open_app({ embed: true })`. Stdio/code clients use the same compact surface
164
+ unless they explicitly opt into the full catalog, and
165
+ `publicAgent.expose` remains the action-level opt-in for safe read/ingest tools
166
+ outside the compact MCP Apps catalog. Apps can set
167
+ `externalAgents.authenticatedReads: "auto"` to automatically advertise every
168
+ action that is GET + `readOnly` + `publicAgent.requiresAuth`, instead of
169
+ maintaining a long connector allow-list. This policy never includes writes by
170
+ default; use `writes: "ask_app_only"` to keep mutations behind `ask_app`, and
171
+ use `denyActions` for defense-in-depth vetoes. `tool-search` remains available
172
+ for discovery, but a searched action still needs to be in the connector
173
+ catalog, included by the authenticated-read policy, or enabled by the explicit
174
+ full-catalog opt-in before `tools/call` can execute it. Do not rely on
175
+ action-specific `mcpApp` resources appearing in ChatGPT/Claude discovery by
176
+ default; use `open_app` for the
168
177
  first-class app embed path. If a specific
169
178
  action truly must remain visible in that compact app-host catalog, set
170
179
  `mcpApp.compactCatalog: true` as a rare escape hatch.
171
180
 
181
+ Generic core `db-schema` and `db-query` are intentionally not automatic
182
+ external reads. They remain available to the in-app agent through the normal
183
+ scoped SQL path, but broad schema/SQL access is too powerful to infer from
184
+ read-only metadata alone. If an app needs direct external querying, expose an
185
+ app-owned bounded GET action or add an explicit table/column allow-list with
186
+ row, byte, timeout, and audit limits. Keep `db-exec` and `db-patch` outside
187
+ automatic external-agent exposure.
188
+
189
+ Authentication and authorization are separate gates. A verified MCP OAuth or
190
+ connect token identifies the caller and organization; `publicAgent` only opts
191
+ an action into the external protocol surface and does not grant record access.
192
+ Actions still need `accessFilter`, `resolveAccess`, or `assertAccess` so private
193
+ documents/dashboards, shares, organization boundaries, and roles are enforced.
194
+ For Slack, verified DMs are linked to an existing Agent Native org member
195
+ before execution and run with that user's context; shared channels use a
196
+ service principal, and guests/external members cannot borrow personal access.
197
+ Managed Slack OAuth and the generated app manifest both request
198
+ `users:read.email`; existing installs must reconnect/reinstall after a scope
199
+ change, while legacy bot-token installs must add the scope in Slack manually.
200
+
172
201
  ### 1b. Fast-path expectations for MCP Apps hosts
173
202
 
174
203
  Keep ChatGPT/Claude paths short. For a known app-facing intent, the external
@@ -158,21 +158,6 @@ The agent loop reads active experiments via `resolveActiveExperimentConfig()` an
158
158
 
159
159
  Compute results with `POST /_agent-native/observability/experiments/:id/results`.
160
160
 
161
- #### First-party hosted default-model rollout
162
-
163
- First-party apps on `agent-native.com` automatically run the July 2026
164
- default-model experiment for authenticated users on the Builder engine:
165
-
166
- - 80% `claude-sonnet-5`
167
- - 20% `gpt-5-6-luna`
168
- - Assignment is sticky by normalized user email and shared across templates.
169
- - The rollout applies only when the user, app, and deployment have not selected
170
- a model. Explicit model choices and BYO provider engines always win.
171
- - Set `AGENT_NATIVE_HOSTED_MODEL_EXPERIMENT=off` for an emergency rollback, or
172
- `true` to exercise the rollout on a non-first-party preview.
173
- - `$ai_generation` tracking includes `experiment_id`,
174
- `experiment_variant`, and `model_selection_source` for central analysis.
175
-
176
161
  In production, experiment management routes require the caller's email in the
177
162
  comma-separated `AGENT_NATIVE_EXPERIMENT_ADMIN_EMAILS` allowlist. This gate is
178
163
  separate from normal app/org admin roles because an experiment affects every
@@ -125,23 +125,29 @@ agent answers about browser recordings in the Analytics template.
125
125
  historical replays and resolve external imports/fonts at capture before
126
126
  blocking the recorded resource origins. Do not diagnose current font loss as
127
127
  CSP without checking the deployed response headers first.
128
- - Let rrweb own normal iframe sizing via Meta / ViewportResize, and keep the
129
- outer wrapper in that same coordinate system for fit-to-stage scaling. Some
130
- legacy recordings contain demonstrably corrupt 4,000–7,500px-wide viewport
131
- values from ordinary desktop sessions. Only widths of at least 4,000px with
132
- aspect ratios above 4:1 are recovered to a 16:10 viewport; real 32:9 and
133
- mobile portrait captures remain untouched. The resize handler applies the
134
- recovery to **both** rrweb's iframe and the outer stage. This includes the
135
- historical 3,000–3,999px-wide, sub-1,000px-high malformed shape; do not
136
- narrow the guard back to only 4,000px+ recordings.
137
- Never remove this recovery, clamp only one layer, or broadly rewrite event
138
- geometry: those changes repeatedly recreated the ribbon/clipping regression.
139
- - The malformed-viewport recovery's sole event-data exception is pointer
140
- geometry: project MouseMove, TouchMove, Drag, and MouseInteraction x/y into
141
- the corrected camera and clamp impossible coordinates. Correcting the iframe
142
- without its paired pointer projection makes rrweb cast valid target ids
143
- thousands of pixels off-stage. Normal-viewport pointer events must retain
144
- their original object references and exact coordinates.
128
+ - Let rrweb own iframe sizing entirely via Meta / ViewportResize, and keep the
129
+ outer wrapper on the exact same raw dimensions for fit-to-stage scaling.
130
+ Player geometry and pointer coordinates are fully stock and untouched — do
131
+ not add width/aspect-ratio "recovery" heuristics or pointer-coordinate
132
+ projection. There is no such thing as a stored recording with corrupt
133
+ viewport geometry: a census of all production recordings found zero stored
134
+ widths >= 3,000px. The 2026-07 "ultra-wide replay" bugs (stages rendered
135
+ 3,000–9,500px wide, frozen/teleporting cursors, giant icons) were caused
136
+ entirely by demo mode's fetch interceptor: its number redactor faked any
137
+ integer >= 1000 inside raw replay JSON at *view* time, corrupting Meta /
138
+ ViewportResize widths, pointer x/y coordinates, and numeric values inside
139
+ `_cssText` and SVG attributes before rrweb ever saw the payload (heights
140
+ below 1000 stayed real, which is why the symptom looked like a viewport
141
+ problem rather than a redaction bug two different sessions that both
142
+ stored a 1,152px width read back as the same 4,491px, a deterministic
143
+ salted-hash fingerprint of the redactor, not two coincidentally identical
144
+ malformed recordings). This is fixed in
145
+ `packages/core/src/demo/fetch-interceptor.ts`: raw replay payload and
146
+ manifest URLs are skipped from demo number redaction entirely, and must
147
+ never be routed through it again. Do not reintroduce viewport clamping or
148
+ pointer-coordinate projection in the player — they can now only corrupt
149
+ genuine future recordings (for example, a real 3440x900 ultrawide browser
150
+ window, or a short vertical window under 1,000px tall).
145
151
  - Keep rrweb's stock cursor stylesheet and its hotspot transform. During
146
152
  playback, hide the viewer's native pointer over Analytics' transparent
147
153
  click-to-pause overlay so it cannot masquerade as a frozen recorded cursor.
@@ -152,10 +158,13 @@ agent answers about browser recordings in the Analytics template.
152
158
  hide generic framework primitives such as
153
159
  `[data-radix-popper-content-wrapper]`: Radix dropdowns, selects, tooltips,
154
160
  and other real recorded product UI all share that wrapper.
155
- - Keep the realistic fidelity and malformed-viewport tests in
156
- `SessionDetailPage.spec.ts`. Do not change their expectations merely to bless
157
- a new sanitizer or raw ultra-wide sizing; validate the affected replay in a
158
- browser first.
161
+ - Keep the realistic-fidelity purity/pass-through tests in
162
+ `SessionDetailPage.spec.ts` raw event identity, raw viewport dimensions,
163
+ and raw resize-state derivation (including the 3,189x885 tripwire against
164
+ reintroducing a clamp) — as regression guards against reintroducing any
165
+ viewport "recovery" or pointer-projection heuristic. Do not change their
166
+ expectations merely to bless a new sanitizer or clamp; validate the affected
167
+ replay in a browser first.
159
168
  - The event timeline soft-highlights the active marker, auto-scrolls it into
160
169
  view (pausing briefly after manual scroll), and supports search. It appears
161
170
  beside the player from ~880px content width upward.
@@ -106,6 +106,33 @@ details live in `.agents/skills/`.
106
106
  / `$ai_latency`, `status`, `tool_calls`, `successful_tools`, `failed_tools`,
107
107
  and `$ai_error` / `error_message`. Do not expect prompts, tool args, or model
108
108
  responses in these tracked events by default.
109
+ - External MCP callers should use `ask_app` as the default for multi-step
110
+ Analytics work. It can resolve a person's known email, correlate sessions
111
+ with captured errors, mint a temporary replay-context link, and inspect the
112
+ timeline, page navigation, console diagnostics, failed network requests, and
113
+ clicks when needed. The authenticated connector catalog is the fast fallback
114
+ and exposes only bounded, user/org-scoped read actions for incident triage:
115
+ `list-session-recordings`, `get-session-replay-summary`,
116
+ `get-session-replay-timeline`, `query-agent-native-analytics`,
117
+ `list-error-issues`, and `get-error-issue`. Fetch the summary before the
118
+ sanitized timeline; the timeline contains bounded page/click/error markers
119
+ without raw replay events or storage references. Do not add replay blob or
120
+ dashboard mutation actions to this catalog without an explicit security
121
+ review.
122
+ - While Demo mode is enabled, session and error identities display anonymized
123
+ (`anonymous@builder.io`), so incident lookups must filter by the stable
124
+ `userId`/email parameter (e.g. `userId: "user@example.com"`) or recording/
125
+ issue id — never by matching emails read back from previously displayed
126
+ output.
127
+ - Analytics opts into the framework's authenticated-read connector policy, so
128
+ every Analytics action explicitly marked GET + read-only +
129
+ `publicAgent.requiresAuth` is directly callable by a signed-in external
130
+ agent. This includes the incident reads above plus safe dashboard/analysis
131
+ reads. Generic core `db-schema` / `db-query` remain in-app agent tools and
132
+ are not automatically exposed because broad SQL/schema access is too
133
+ powerful to infer from read-only metadata. Writes remain `ask_app`-only.
134
+ Use the explicit catalog and `denyActions` policy for any unusually
135
+ sensitive read instead of exposing an unannotated action.
109
136
  - `/agents` is the Analytics home for admin surfaces. The default Monitoring
110
137
  view embeds the shared observability dashboard for traces, conversations,
111
138
  evals, experiments, and feedback. `/agents?view=dashboards` shows the
@@ -20,7 +20,6 @@ export default defineAction({
20
20
  schema: z.object({
21
21
  recordingId: z.string().describe("The session_recordings id"),
22
22
  }),
23
- readOnly: true,
24
23
  run: async (args) => {
25
24
  return createSessionReplayAgentLink({
26
25
  recordingId: args.recordingId,
@@ -28,6 +28,7 @@ export default defineAction({
28
28
  }),
29
29
  http: { method: "GET" },
30
30
  readOnly: true,
31
+ publicAgent: { expose: true, readOnly: true, requiresAuth: true },
31
32
  run: async (args) => {
32
33
  return getErrorIssue(resolveScope(), args.id, {
33
34
  eventsLimit: args.eventsLimit,
@@ -21,6 +21,7 @@ export default defineAction({
21
21
  }),
22
22
  http: { method: "GET" },
23
23
  readOnly: true,
24
+ publicAgent: { expose: true, readOnly: true, requiresAuth: true },
24
25
  run: async (args) => {
25
26
  return getSessionReplaySummary(args.recordingId, resolveScope());
26
27
  },
@@ -0,0 +1,40 @@
1
+ import { defineAction } from "@agent-native/core";
2
+ import {
3
+ getRequestOrgId,
4
+ getRequestUserEmail,
5
+ } from "@agent-native/core/server";
6
+ import { z } from "zod";
7
+
8
+ import { getSessionReplayTimeline } from "../server/lib/session-replay-agent-context.js";
9
+
10
+ function resolveScope() {
11
+ const userEmail = getRequestUserEmail();
12
+ if (!userEmail) throw new Error("no authenticated user");
13
+ return { userEmail, orgId: getRequestOrgId() || null };
14
+ }
15
+
16
+ export default defineAction({
17
+ description:
18
+ "Get a bounded, sanitized timeline for one first-party Analytics session recording: page navigation, clicks, inputs, scrolls, custom events, console errors, and failed network requests. Returns marker metadata only; never returns raw rrweb/DOM/input values, replay chunks, or storage references. Use this after get-session-replay-summary when direct incident triage needs the user's click/page sequence.",
19
+ schema: z.object({
20
+ recordingId: z.string().describe("The session_recordings id"),
21
+ eventLimit: z.coerce
22
+ .number()
23
+ .int()
24
+ .min(1)
25
+ .max(10000)
26
+ .optional()
27
+ .default(10000)
28
+ .describe(
29
+ "Maximum replay events to inspect before building the capped timeline",
30
+ ),
31
+ }),
32
+ http: { method: "GET" },
33
+ readOnly: true,
34
+ publicAgent: { expose: true, readOnly: true, requiresAuth: true },
35
+ run: async (args) => {
36
+ return getSessionReplayTimeline(args.recordingId, resolveScope(), {
37
+ eventLimit: args.eventLimit,
38
+ });
39
+ },
40
+ });
@@ -26,6 +26,18 @@ export default defineAction({
26
26
  .optional()
27
27
  .describe("Search across issue title, type, culprit, and fingerprint."),
28
28
  app: z.string().optional().describe("Optional app filter."),
29
+ sessionRecordingId: z
30
+ .string()
31
+ .optional()
32
+ .describe(
33
+ "Filter to issues with an occurrence in this session recording.",
34
+ ),
35
+ userId: z
36
+ .string()
37
+ .optional()
38
+ .describe(
39
+ "Filter to issues with an occurrence for this user ID or user key.",
40
+ ),
29
41
  sort: z
30
42
  .enum(["lastSeen", "eventCount", "firstSeen"])
31
43
  .optional()
@@ -34,6 +46,7 @@ export default defineAction({
34
46
  }),
35
47
  http: { method: "GET" },
36
48
  readOnly: true,
49
+ publicAgent: { expose: true, readOnly: true, requiresAuth: true },
37
50
  run: async (args) => {
38
51
  return listErrorIssues(resolveScope(), args);
39
52
  },
@@ -58,6 +58,7 @@ export default defineAction({
58
58
  }),
59
59
  http: { method: "GET" },
60
60
  readOnly: true,
61
+ publicAgent: { expose: true, readOnly: true, requiresAuth: true },
61
62
  run: async (args) => {
62
63
  return listSessionRecordings(resolveScope(), args);
63
64
  },
@@ -33,7 +33,11 @@ export default defineAction({
33
33
  ),
34
34
  }),
35
35
  readOnly: true,
36
+ // No raw HTTP route: a GET endpoint would put caller SQL in query strings
37
+ // and access logs. External MCP callers reach this through the explicit
38
+ // ANALYTICS_CONNECTOR_CATALOG entry, which dispatches run() in-process.
36
39
  http: false,
40
+ publicAgent: { expose: true, readOnly: true, requiresAuth: true },
37
41
  run: async (args) => {
38
42
  return queryFirstPartyAnalytics(args.sql, resolveScope());
39
43
  },
@@ -186,7 +186,7 @@
186
186
  .analytics-chat-intro {
187
187
  display: grid;
188
188
  width: 100%;
189
- max-width: min(570px, 90%);
189
+ max-width: min(684px, 90%);
190
190
  gap: 0.5rem;
191
191
  margin: 0 auto 1rem;
192
192
  text-align: center;
@@ -223,7 +223,7 @@
223
223
  [data-agent-empty-state="centered"]
224
224
  .agent-plan-mode-callout {
225
225
  width: 100%;
226
- max-width: min(570px, 90%);
226
+ max-width: min(684px, 90%);
227
227
  padding: 0;
228
228
  }
229
229