@agent-native/core 0.189.0 → 0.190.0-nightly-20260925211446

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 (233) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/templates/analytics/.agents/skills/analysis-workspace/SKILL.md +10 -0
  3. package/corpus/templates/analytics/.agents/skills/data-querying/SKILL.md +1 -1
  4. package/corpus/templates/analytics/AGENTS.md +11 -22
  5. package/corpus/templates/analytics/actions/list-data-dictionary.ts +7 -9
  6. package/corpus/templates/analytics/actions/search-analytics-query-catalog.ts +1 -1
  7. package/corpus/templates/analytics/app/components/AnalyticsReviewArtifactPreview.tsx +201 -0
  8. package/corpus/templates/analytics/app/i18n/en-US.ts +2 -0
  9. package/corpus/templates/analytics/app/pages/Settings.tsx +50 -3
  10. package/corpus/templates/analytics/changelog/2026-09-25-first-run-onboarding-records-setup-choices-and-builder-conne.md +6 -0
  11. package/corpus/templates/analytics/changelog/2026-09-25-human-review-previews-analytics-dashboards-as-real-charts.md +6 -0
  12. package/corpus/templates/analytics/changelog/2026-09-25-org-admins-can-review-agent-runs-from-settings.md +6 -0
  13. package/corpus/templates/analytics/changelog/2026-09-25-proactive-query-context.md +6 -0
  14. package/corpus/templates/analytics/seeds/dashboards/agent-native-templates-first-party.json +98 -2
  15. package/corpus/templates/analytics/server/lib/analytics-agent-context.ts +557 -0
  16. package/corpus/templates/analytics/server/lib/analytics-query-catalog.ts +217 -46
  17. package/corpus/templates/analytics/server/lib/dashboard-catalog.ts +2 -2
  18. package/corpus/templates/analytics/server/lib/dashboards-store.ts +39 -5
  19. package/corpus/templates/analytics/server/lib/data-dictionary-context.ts +4 -0
  20. package/corpus/templates/analytics/server/lib/first-party-metric-catalog.ts +268 -2
  21. package/corpus/templates/analytics/server/plugins/agent-chat.ts +44 -9
  22. package/corpus/templates/calendar/AGENTS.md +5 -0
  23. package/corpus/templates/calendar/CHANGELOG.md +6 -0
  24. package/corpus/templates/calendar/actions/get-event-rules-status.ts +47 -0
  25. package/corpus/templates/calendar/actions/list-events.ts +50 -4
  26. package/corpus/templates/calendar/actions/undo-calendar-event-rule.ts +229 -0
  27. package/corpus/templates/calendar/actions/update-settings.ts +8 -0
  28. package/corpus/templates/calendar/app/i18n/en-US.ts +27 -0
  29. package/corpus/templates/calendar/app/pages/Settings.tsx +196 -1
  30. package/corpus/templates/calendar/changelog/2026-09-25-calendar-feeds-with-the-same-url-keep-their-own-names-and-co.md +6 -0
  31. package/corpus/templates/calendar/changelog/2026-09-25-calendar-invitation-rules-surface-expired-connections-and-un.md +6 -0
  32. package/corpus/templates/calendar/changelog/2026-09-25-restore-locally-hidden-events-from-activity-after-disconnect.md +6 -0
  33. package/corpus/templates/calendar/server/lib/calendar-settings.ts +44 -10
  34. package/corpus/templates/calendar/server/lib/google-api.ts +15 -1
  35. package/corpus/templates/calendar/server/lib/google-calendar.ts +1 -1
  36. package/corpus/templates/calendar/server/plugins/event-rules.ts +628 -0
  37. package/corpus/templates/calendar/shared/api.ts +13 -0
  38. package/corpus/templates/calendar/shared/settings.ts +71 -1
  39. package/corpus/templates/clips/actions/create-recording.ts +83 -2
  40. package/corpus/templates/clips/actions/finalize-recording.ts +610 -110
  41. package/corpus/templates/clips/actions/get-recording-player-data.ts +6 -0
  42. package/corpus/templates/clips/actions/import-loom-recording.ts +2 -0
  43. package/corpus/templates/clips/actions/lib/create-recording-schema.ts +7 -0
  44. package/corpus/templates/clips/actions/lib/loom-import-job.ts +15 -1
  45. package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +126 -26
  46. package/corpus/templates/clips/app/hooks/use-drop-video-upload.ts +75 -15
  47. package/corpus/templates/clips/app/routes/_app.r.$recordingId.tsx +5 -1
  48. package/corpus/templates/clips/app/routes/record.tsx +134 -40
  49. package/corpus/templates/clips/chrome-extension/src/background.ts +3 -0
  50. package/corpus/templates/clips/chrome-extension/src/offscreen.ts +73 -16
  51. package/corpus/templates/clips/desktop/src/lib/recorder.ts +188 -18
  52. package/corpus/templates/clips/desktop/src/lib/recording-request.ts +1 -0
  53. package/corpus/templates/clips/server/db/schema.ts +4 -0
  54. package/corpus/templates/clips/server/jobs/media-verification.ts +78 -4
  55. package/corpus/templates/clips/server/jobs/recording-failure-backfill.ts +142 -0
  56. package/corpus/templates/clips/server/lib/media-verification-state.ts +29 -0
  57. package/corpus/templates/clips/server/lib/post-finalize-dispatch.ts +2 -0
  58. package/corpus/templates/clips/server/lib/recording-failures.ts +111 -0
  59. package/corpus/templates/clips/server/lib/recordings.ts +6 -1
  60. package/corpus/templates/clips/server/lib/s3-upload-provider.ts +8 -3
  61. package/corpus/templates/clips/server/lib/upload-lease.ts +25 -6
  62. package/corpus/templates/clips/server/plugins/calendar-jobs.ts +2 -0
  63. package/corpus/templates/clips/server/plugins/db.ts +18 -0
  64. package/corpus/templates/clips/server/routes/api/_agent-native-background/post-finalize-worker.post.ts +48 -5
  65. package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/abort.post.ts +322 -31
  66. package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/chunk.post.ts +223 -61
  67. package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/interrupt.post.ts +62 -4
  68. package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/reset-chunks.post.ts +74 -7
  69. package/corpus/templates/clips/shared/recording-core.ts +27 -0
  70. package/corpus/templates/design/actions/get-design.ts +35 -6
  71. package/corpus/templates/mail/.agents/skills/inbox-automations/SKILL.md +4 -0
  72. package/corpus/templates/mail/actions/consolidate-ai-filter-rules.ts +41 -0
  73. package/corpus/templates/mail/actions/get-ai-priority.ts +48 -8
  74. package/corpus/templates/mail/actions/record-ai-priority-feedback.ts +69 -0
  75. package/corpus/templates/mail/actions/update-mail-preferences.ts +2 -0
  76. package/corpus/templates/mail/app/components/email/EmailList.tsx +179 -32
  77. package/corpus/templates/mail/app/components/email/EmailListItem.tsx +97 -9
  78. package/corpus/templates/mail/app/components/email/EmailThread.tsx +55 -1
  79. package/corpus/templates/mail/app/components/email/ImportanceFeedbackMenu.tsx +52 -0
  80. package/corpus/templates/mail/app/components/email/compose-autocomplete.ts +2 -1
  81. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +219 -188
  82. package/corpus/templates/mail/app/components/onboarding/AiInboxSetup.tsx +338 -0
  83. package/corpus/templates/mail/app/components/settings/AiFilterSection.tsx +597 -781
  84. package/corpus/templates/mail/app/components/settings/AiRulePromptField.tsx +37 -0
  85. package/corpus/templates/mail/app/global.css +42 -26
  86. package/corpus/templates/mail/app/hooks/use-ai-priority-feedback.ts +43 -0
  87. package/corpus/templates/mail/app/hooks/use-automations.ts +23 -0
  88. package/corpus/templates/mail/app/i18n/en-US.ts +58 -3
  89. package/corpus/templates/mail/app/pages/InboxPage.tsx +47 -10
  90. package/corpus/templates/mail/changelog/2026-09-25-editing-importance-rules-preserves-disabled-instructions-and.md +6 -0
  91. package/corpus/templates/mail/changelog/2026-09-25-handle-astral-unicode-letters-in-autocomplete-word-boundarie.md +6 -0
  92. package/corpus/templates/mail/changelog/2026-09-25-jev-priority-feedback-and-inbox-settings.md +6 -0
  93. package/corpus/templates/mail/changelog/2026-09-25-keep-existing-ai-filter-rules-intact-when-saving-a-prompt.md +6 -0
  94. package/corpus/templates/mail/server/lib/automation-engine.ts +21 -12
  95. package/corpus/templates/mail/server/lib/automations.ts +100 -1
  96. package/corpus/templates/mail/shared/types.ts +3 -0
  97. package/corpus/templates/plan/app/i18n/en-US.ts +6 -0
  98. package/corpus/templates/plan/app/lib/plan-invite-suggestion.ts +43 -0
  99. package/corpus/templates/plan/app/pages/PlansPage.tsx +249 -4
  100. package/corpus/templates/slides/actions/create-deck.ts +11 -1
  101. package/corpus/templates/slides/app/components/deck/SlideRenderer.tsx +117 -1
  102. package/corpus/templates/slides/app/components/design-system/DesignSystemSetup.tsx +373 -330
  103. package/corpus/templates/slides/app/components/design-system/builder-index-response.ts +36 -5
  104. package/corpus/templates/slides/app/components/editor/BlockBubbleMenu.tsx +21 -53
  105. package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +347 -671
  106. package/corpus/templates/slides/app/components/editor/bullet-editing.ts +55 -8
  107. package/corpus/templates/slides/app/components/editor/in-place-text-session.ts +2082 -0
  108. package/corpus/templates/slides/app/components/editor/list-editing.ts +174 -16
  109. package/corpus/templates/slides/app/components/editor/rich-text-selection.ts +497 -62
  110. package/corpus/templates/slides/app/components/editor/slide-text-targets.ts +102 -20
  111. package/corpus/templates/slides/app/context/DeckContext.tsx +9 -4
  112. package/corpus/templates/slides/app/global.css +7 -219
  113. package/corpus/templates/slides/app/i18n/en-US.ts +3 -0
  114. package/corpus/templates/slides/app/lib/sanitize-slide-html.ts +7 -0
  115. package/corpus/templates/slides/app/lib/slide-image-replacement.ts +203 -1
  116. package/corpus/templates/slides/app/lib/slide-source-map.ts +43 -0
  117. package/corpus/templates/slides/app/pages/DeckEditor.tsx +182 -4
  118. package/corpus/templates/slides/app/routes/settings.tsx +33 -2
  119. package/corpus/templates/slides/changelog/2026-09-25-improve-slides-design-system-setup-feedback.md +6 -0
  120. package/corpus/templates/slides/changelog/2026-09-25-org-admins-can-review-agent-runs-from-settings.md +6 -0
  121. package/corpus/templates/slides/changelog/2026-09-25-text-on-a-slide-is-now-edited-in-place-clicking-into-it-chan.md +6 -0
  122. package/corpus/templates/slides/package.json +0 -12
  123. package/corpus/templates/slides/scripts/edit-fidelity/README.md +4 -2
  124. package/corpus/templates/slides/scripts/edit-fidelity/run.ts +12 -3
  125. package/corpus/templates/slides/vite.config.ts +1 -10
  126. package/dist/agent/jev-tool-prefetch.d.ts +29 -3
  127. package/dist/agent/jev-tool-prefetch.js +161 -34
  128. package/dist/agent/production-agent.d.ts +11 -0
  129. package/dist/agent/production-agent.js +39 -8
  130. package/dist/app-config/runtime.d.ts +1 -0
  131. package/dist/app-config/runtime.js +4 -0
  132. package/dist/app-config/schema.d.ts +1 -0
  133. package/dist/client/AgentSidebar.d.ts +3 -1
  134. package/dist/client/AgentSidebar.js +8 -12
  135. package/dist/client/analytics/index.d.ts +1 -1
  136. package/dist/client/analytics/index.js +1 -1
  137. package/dist/client/analytics.d.ts +2 -0
  138. package/dist/client/analytics.js +9 -0
  139. package/dist/client/api-path.js +5 -2
  140. package/dist/client/chat/run-recovery.d.ts +0 -3
  141. package/dist/client/chat/run-recovery.js +13 -23
  142. package/dist/client/index.d.ts +1 -1
  143. package/dist/client/index.js +1 -1
  144. package/dist/client/observability/ObservabilityDashboard.d.ts +3 -0
  145. package/dist/client/observability/ObservabilityDashboard.js +366 -71
  146. package/dist/client/observability/ObservabilityReviewSummaryButton.d.ts +4 -1
  147. package/dist/client/observability/ObservabilityReviewSummaryButton.js +13 -9
  148. package/dist/client/observability/OutputPreview.d.ts +9 -4
  149. package/dist/client/observability/OutputPreview.js +230 -52
  150. package/dist/client/onboarding/FirstRunOnboarding.js +67 -4
  151. package/dist/client/onboarding/use-onboarding.js +2 -0
  152. package/dist/client/sharing/ShareButton.d.ts +2 -0
  153. package/dist/client/sharing/ShareButton.js +1 -0
  154. package/dist/client/sharing/useShareButtonController.d.ts +1 -0
  155. package/dist/client/sharing/useShareButtonController.js +29 -8
  156. package/dist/collab/awareness.d.ts +2 -2
  157. package/dist/collab/struct-routes.d.ts +1 -1
  158. package/dist/deploy/build.js +9 -1
  159. package/dist/embeddings/index.d.ts +3 -1
  160. package/dist/embeddings/index.js +20 -10
  161. package/dist/jobs/sweep-hooks.d.ts +7 -0
  162. package/dist/jobs/sweep-hooks.js +28 -0
  163. package/dist/localization/default-messages.d.ts +1 -0
  164. package/dist/localization/default-messages.js +1 -0
  165. package/dist/mcp/screen-memory-stdio.d.ts +7 -7
  166. package/dist/notifications/routes.d.ts +1 -1
  167. package/dist/observability/actions/authorization.d.ts +1 -0
  168. package/dist/observability/actions/authorization.js +22 -0
  169. package/dist/observability/actions/get-observability-review-detail.d.ts +5 -0
  170. package/dist/observability/actions/get-observability-review-detail.js +10 -2
  171. package/dist/observability/actions/get-observability-review-summary-source.d.ts +2 -0
  172. package/dist/observability/actions/get-observability-review-summary-source.js +3 -2
  173. package/dist/observability/actions/save-observability-instruction-update.js +2 -1
  174. package/dist/observability/actions/save-observability-review-summary.js +21 -10
  175. package/dist/observability/migrations.js +25 -0
  176. package/dist/observability/reviews.d.ts +3 -1
  177. package/dist/observability/reviews.js +410 -53
  178. package/dist/observability/routes.d.ts +6 -6
  179. package/dist/observability/store.d.ts +15 -0
  180. package/dist/observability/store.js +131 -11
  181. package/dist/observability/types.d.ts +18 -0
  182. package/dist/org/handlers.d.ts +1 -1
  183. package/dist/org/index.d.ts +1 -1
  184. package/dist/progress/routes.d.ts +1 -1
  185. package/dist/provider-api/actions/custom-provider-registration.d.ts +5 -5
  186. package/dist/provider-api/actions/provider-api.d.ts +8 -8
  187. package/dist/secrets/routes.d.ts +3 -3
  188. package/dist/server/agent-chat/plugin-options.d.ts +4 -20
  189. package/dist/server/agent-chat/prompt-resources.d.ts +16 -0
  190. package/dist/server/agent-chat/prompt-resources.js +385 -22
  191. package/dist/server/agent-chat-plugin.d.ts +3 -1
  192. package/dist/server/agent-chat-plugin.js +149 -27
  193. package/dist/server/agent-engine-ollama-models-route.d.ts +1 -1
  194. package/dist/server/index.d.ts +3 -0
  195. package/dist/server/index.js +3 -0
  196. package/dist/server/prompts/framework-core-compact.js +1 -1
  197. package/dist/server/prompts/framework-core.js +1 -1
  198. package/dist/server/realtime-token.d.ts +1 -1
  199. package/dist/server/request-context.d.ts +6 -3
  200. package/dist/server/transcribe-voice.d.ts +1 -1
  201. package/dist/settings/org-settings.d.ts +4 -2
  202. package/dist/settings/org-settings.js +3 -3
  203. package/dist/settings/store.d.ts +3 -1
  204. package/dist/settings/store.js +8 -3
  205. package/dist/styles/agent-native.css +5 -0
  206. package/dist/templates/default/app/i18n/ar-SA.ts +1 -0
  207. package/dist/templates/default/app/i18n/de-DE.ts +1 -0
  208. package/dist/templates/default/app/i18n/en-US.ts +1 -0
  209. package/dist/templates/default/app/i18n/es-ES.ts +1 -0
  210. package/dist/templates/default/app/i18n/fr-FR.ts +1 -0
  211. package/dist/templates/default/app/i18n/hi-IN.ts +1 -0
  212. package/dist/templates/default/app/i18n/ja-JP.ts +1 -0
  213. package/dist/templates/default/app/i18n/ko-KR.ts +1 -0
  214. package/dist/templates/default/app/i18n/pt-BR.ts +1 -0
  215. package/dist/templates/default/app/i18n/zh-CN.ts +1 -0
  216. package/dist/templates/default/app/i18n/zh-TW.ts +1 -0
  217. package/dist/tracking/registry.js +11 -4
  218. package/package.json +4 -3
  219. package/src/templates/default/app/i18n/ar-SA.ts +1 -0
  220. package/src/templates/default/app/i18n/de-DE.ts +1 -0
  221. package/src/templates/default/app/i18n/en-US.ts +1 -0
  222. package/src/templates/default/app/i18n/es-ES.ts +1 -0
  223. package/src/templates/default/app/i18n/fr-FR.ts +1 -0
  224. package/src/templates/default/app/i18n/hi-IN.ts +1 -0
  225. package/src/templates/default/app/i18n/ja-JP.ts +1 -0
  226. package/src/templates/default/app/i18n/ko-KR.ts +1 -0
  227. package/src/templates/default/app/i18n/pt-BR.ts +1 -0
  228. package/src/templates/default/app/i18n/zh-CN.ts +1 -0
  229. package/src/templates/default/app/i18n/zh-TW.ts +1 -0
  230. package/corpus/templates/slides/app/components/editor/SlideBubbleMenu.tsx +0 -488
  231. package/corpus/templates/slides/app/components/editor/SlideInlineEditor.tsx +0 -589
  232. package/corpus/templates/slides/app/components/editor/SlideRichTextEditor.tsx +0 -1347
  233. package/corpus/templates/slides/app/components/editor/SlideSlashMenu.tsx +0 -373
@@ -184,6 +184,28 @@ export async function runPostAgentTurnAutosave(callback, scope, run) {
184
184
  console.error("[agent-chat] post-agent-turn autosave failed:", error);
185
185
  }
186
186
  }
187
+ export async function runPostAgentRunComplete(callback, scope, run) {
188
+ if (!callback)
189
+ return;
190
+ try {
191
+ await callback(scope, run);
192
+ }
193
+ catch (error) {
194
+ captureError(error, {
195
+ route: "agent-chat",
196
+ aiTraceId: run.runId,
197
+ tags: {
198
+ source: "agent-chat",
199
+ failureClass: "post-agent-run-observer",
200
+ },
201
+ extra: {
202
+ runId: run.runId,
203
+ threadId: run.threadId,
204
+ },
205
+ });
206
+ console.error("[agent-chat] post-agent-run observer failed:", error);
207
+ }
208
+ }
187
209
  export async function runPreAgentTurnAutosave(callback, scope, run) {
188
210
  if (!callback || !scope)
189
211
  return;
@@ -331,6 +353,87 @@ export function resolveProductionCodeExecutionForActionSurface(mode, hasRequestS
331
353
  // bridge is filtered against the current request, as the safe equivalent.
332
354
  return hasRequestScopedSurface && mode === "trusted" ? "sandboxed" : mode;
333
355
  }
356
+ const observabilityReviewSummaryActions = [
357
+ "get-observability-review-summary-source",
358
+ "save-observability-review-summary",
359
+ ];
360
+ const MAX_OBSERVABILITY_REVIEW_SUMMARY_BATCH = 25;
361
+ const observabilityFeedbackImprovementActions = [
362
+ "get-observability-review-summary-source",
363
+ "save-observability-instruction-update",
364
+ ];
365
+ export async function resolveObservabilityReviewSummaryActionSurface(details, resolveHostSurface) {
366
+ if (details.actionScope?.kind === "observability-review-summary") {
367
+ const scopedRunId = details.actionScope.runId;
368
+ if (typeof scopedRunId !== "string" ||
369
+ scopedRunId.trim().length === 0 ||
370
+ scopedRunId.trim().length > 200) {
371
+ throw createError({
372
+ statusCode: 400,
373
+ statusMessage: "A valid runId is required for summary review.",
374
+ });
375
+ }
376
+ const runId = scopedRunId.trim();
377
+ if (observabilityReviewSummaryActions.some((name) => !details.availableActionNames.includes(name))) {
378
+ throw createError({
379
+ statusCode: 403,
380
+ statusMessage: "Summary review actions are unavailable.",
381
+ });
382
+ }
383
+ return {
384
+ allowedActionNames: [...observabilityReviewSummaryActions],
385
+ actionScope: { kind: "observability-review-summary", runId },
386
+ };
387
+ }
388
+ if (details.actionScope?.kind === "observability-review-summary-batch") {
389
+ const candidateRunIds = details.actionScope.runIds;
390
+ if (!Array.isArray(candidateRunIds) ||
391
+ candidateRunIds.length === 0 ||
392
+ candidateRunIds.length > MAX_OBSERVABILITY_REVIEW_SUMMARY_BATCH ||
393
+ !candidateRunIds.every((runId) => typeof runId === "string" &&
394
+ runId.trim().length > 0 &&
395
+ runId.trim().length <= 200)) {
396
+ throw createError({
397
+ statusCode: 400,
398
+ statusMessage: "A valid bounded run batch is required for summary review.",
399
+ });
400
+ }
401
+ const runIds = [...new Set(candidateRunIds.map((runId) => runId.trim()))];
402
+ if (observabilityReviewSummaryActions.some((name) => !details.availableActionNames.includes(name))) {
403
+ throw createError({
404
+ statusCode: 403,
405
+ statusMessage: "Summary review actions are unavailable.",
406
+ });
407
+ }
408
+ return {
409
+ allowedActionNames: [...observabilityReviewSummaryActions],
410
+ actionScope: { kind: "observability-review-summary-batch", runIds },
411
+ };
412
+ }
413
+ if (details.actionScope?.kind === "observability-feedback-improvement") {
414
+ const scopedRunId = details.actionScope.runId;
415
+ if (typeof scopedRunId !== "string" ||
416
+ scopedRunId.trim().length === 0 ||
417
+ scopedRunId.trim().length > 200) {
418
+ throw createError({
419
+ statusCode: 400,
420
+ statusMessage: "A valid runId is required for feedback improvement.",
421
+ });
422
+ }
423
+ const runId = scopedRunId.trim();
424
+ if (observabilityFeedbackImprovementActions.some((name) => !details.availableActionNames.includes(name))) {
425
+ throw createError({
426
+ statusCode: 403,
427
+ statusMessage: "Feedback improvement actions are unavailable.",
428
+ });
429
+ }
430
+ return {
431
+ allowedActionNames: [...observabilityFeedbackImprovementActions],
432
+ actionScope: { kind: "observability-feedback-improvement", runId },
433
+ };
434
+ }
435
+ return resolveHostSurface ? resolveHostSurface(details) : { mode: "default" };
436
+ }
334
437
  /**
335
438
  * In-memory rate-limit tracker for `/generate-title`. Keyed by user email,
336
439
  * value is recent invocation timestamps within the rolling window. Stale
@@ -2539,6 +2642,7 @@ export function createAgentChatPlugin(options) {
2539
2642
  // not strand the run while a successful checkpoint cannot be lost when
2540
2643
  // a serverless invocation exits.
2541
2644
  await runPostAgentTurnAutosave(options?.onAgentTurnComplete, chatScope, run);
2645
+ await runPostAgentRunComplete(options?.onAgentRunComplete, chatScope, run);
2542
2646
  // Event triggers and local git checkpoints remain best effort and do
2543
2647
  // not extend the durable chat persistence gate.
2544
2648
  void (async () => {
@@ -3269,7 +3373,7 @@ Non-code requests are still fine on this surface: read data, navigate the UI, su
3269
3373
  message,
3270
3374
  };
3271
3375
  },
3272
- resolveActionSurface: options?.resolveActionSurface,
3376
+ resolveActionSurface: (details) => resolveObservabilityReviewSummaryActionSurface(details, options?.resolveActionSurface),
3273
3377
  skipFilesContext,
3274
3378
  jevContextCompact: leanPrompt || lazyContext,
3275
3379
  initialToolNames: effectiveInitialToolNames,
@@ -3322,7 +3426,7 @@ Non-code requests are still fine on this surface: read data, navigate the UI, su
3322
3426
  jevContextCompact: true,
3323
3427
  finalResponseGuard: options?.finalResponseGuard,
3324
3428
  prepareRequest: options?.prepareRequest,
3325
- resolveActionSurface: options?.resolveActionSurface,
3429
+ resolveActionSurface: (details) => resolveObservabilityReviewSummaryActionSurface(details, options?.resolveActionSurface),
3326
3430
  skipFilesContext: true,
3327
3431
  initialToolNames: effectiveInitialToolNames,
3328
3432
  onEngineResolved: (engine, model) => {
@@ -3378,33 +3482,32 @@ Non-code requests are still fine on this surface: read data, navigate the UI, su
3378
3482
  databaseTools: databaseToolsMode,
3379
3483
  });
3380
3484
  const localDevActionNames = new Set(Object.keys(devScriptRegistry));
3381
- const resolveDevActionSurface = options?.resolveActionSurface
3382
- ? async (details) => {
3383
- const appActionNames = details.availableActionNames.filter((name) => !localDevActionNames.has(name));
3384
- const surface = await options.resolveActionSurface({
3385
- ...details,
3386
- availableActionNames: appActionNames,
3387
- });
3388
- const normalizedSurface = normalizeAgentActionSurfaceResolution(surface);
3389
- if (normalizedSurface.mode === "default")
3390
- return surface;
3391
- if (normalizedSurface.actionScope) {
3392
- return {
3393
- allowedActionNames: normalizedSurface.allowedActionNames,
3394
- actionScope: normalizedSurface.actionScope,
3395
- };
3396
- }
3397
- const localActionNames = details.availableActionNames.filter((name) => localDevActionNames.has(name));
3485
+ const resolveDevActionSurface = async (details) => {
3486
+ const appActionNames = details.availableActionNames.filter((name) => !localDevActionNames.has(name));
3487
+ const appDetails = {
3488
+ ...details,
3489
+ availableActionNames: appActionNames,
3490
+ };
3491
+ const surface = await resolveObservabilityReviewSummaryActionSurface(appDetails, options?.resolveActionSurface);
3492
+ const normalizedSurface = normalizeAgentActionSurfaceResolution(surface);
3493
+ if (normalizedSurface.mode === "default")
3494
+ return surface;
3495
+ if (normalizedSurface.actionScope) {
3398
3496
  return {
3399
- allowedActionNames: [
3400
- ...new Set([
3401
- ...normalizedSurface.allowedActionNames,
3402
- ...localActionNames,
3403
- ]),
3404
- ],
3497
+ allowedActionNames: normalizedSurface.allowedActionNames,
3498
+ actionScope: normalizedSurface.actionScope,
3405
3499
  };
3406
3500
  }
3407
- : undefined;
3501
+ const localActionNames = details.availableActionNames.filter((name) => localDevActionNames.has(name));
3502
+ return {
3503
+ allowedActionNames: [
3504
+ ...new Set([
3505
+ ...normalizedSurface.allowedActionNames,
3506
+ ...localActionNames,
3507
+ ]),
3508
+ ],
3509
+ };
3510
+ };
3408
3511
  const devActions = attachToolSearch(leanPrompt
3409
3512
  ? { ...devScriptRegistry, ...leanActions }
3410
3513
  : devNative
@@ -5742,6 +5845,8 @@ Non-code requests are still fine on this surface: read data, navigate the UI, su
5742
5845
  console.error("[agent-chat] durable unclaimed-run sweep failed:", error);
5743
5846
  return null;
5744
5847
  });
5848
+ const { runRecurringSweepHandlers } = await import("../jobs/sweep-hooks.js");
5849
+ const appSweepHandlers = await runRecurringSweepHandlers();
5745
5850
  const triggerAvailability = scheduledTriggerAvailability();
5746
5851
  if (unclaimedBackgroundRuns === null) {
5747
5852
  setResponseStatus(event, 500);
@@ -5750,16 +5855,21 @@ Non-code requests are still fine on this surface: read data, navigate the UI, su
5750
5855
  staleRunsReaped,
5751
5856
  chatHealth,
5752
5857
  unclaimedBackgroundRuns,
5858
+ appSweepHandlers,
5753
5859
  jobsSkipped: true,
5754
5860
  jobsSkippedReason: "unclaimed-background-sweep-failed",
5755
5861
  };
5756
5862
  }
5757
5863
  if (!triggerAvailability.available) {
5864
+ if (appSweepHandlers.failed.length > 0) {
5865
+ setResponseStatus(event, 500);
5866
+ }
5758
5867
  return {
5759
- ok: true,
5868
+ ok: appSweepHandlers.failed.length === 0,
5760
5869
  staleRunsReaped,
5761
5870
  chatHealth,
5762
5871
  unclaimedBackgroundRuns,
5872
+ appSweepHandlers,
5763
5873
  jobsSkipped: true,
5764
5874
  jobsSkippedReason: triggerAvailability.reason,
5765
5875
  };
@@ -5770,11 +5880,22 @@ Non-code requests are still fine on this surface: read data, navigate the UI, su
5770
5880
  // eagerly initialized still resolves them.
5771
5881
  await ensureMcpInitialized();
5772
5882
  await processRecurringJobs(schedulerDeps);
5883
+ if (appSweepHandlers.failed.length > 0) {
5884
+ setResponseStatus(event, 500);
5885
+ return {
5886
+ ok: false,
5887
+ staleRunsReaped,
5888
+ chatHealth,
5889
+ unclaimedBackgroundRuns,
5890
+ appSweepHandlers,
5891
+ };
5892
+ }
5773
5893
  return {
5774
5894
  ok: true,
5775
5895
  staleRunsReaped,
5776
5896
  chatHealth,
5777
5897
  unclaimedBackgroundRuns,
5898
+ appSweepHandlers,
5778
5899
  };
5779
5900
  }
5780
5901
  catch (error) {
@@ -5785,6 +5906,7 @@ Non-code requests are still fine on this surface: read data, navigate the UI, su
5785
5906
  staleRunsReaped,
5786
5907
  chatHealth,
5787
5908
  unclaimedBackgroundRuns,
5909
+ appSweepHandlers,
5788
5910
  };
5789
5911
  }
5790
5912
  }));
@@ -5,8 +5,8 @@
5
5
  * static suggestion list in `model-config.ts`.
6
6
  */
7
7
  export declare function createAgentEngineOllamaModelsHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
8
- error: string;
9
8
  ok?: undefined;
9
+ error: string;
10
10
  models?: undefined;
11
11
  } | {
12
12
  ok: boolean;
@@ -1,4 +1,5 @@
1
1
  export { defineAppConfig, getAppConfig, resetAppConfigForTests, appConfigSchema, type AppConfig, type AppConfigInput, } from "../app-config/index.js";
2
+ export { resolveDeployEnvironment } from "./deploy-environment.js";
2
3
  export { inferWorkspaceAppRootHomePath, readConfiguredWorkspaceAppHomePath, } from "../workspace-app-config.js";
3
4
  export { createServer, type CreateServerOptions, type EnvKeyConfig, } from "./create-server.js";
4
5
  export { startIntervalJob, type IntervalJobOptions, type IntervalJobHandle, } from "./interval-job.js";
@@ -91,6 +92,8 @@ export { sendEmail, isEmailConfigured, getEmailReadiness, getEmailProvider, type
91
92
  export { defineTransactionalEmail, defineTransactionalEmails, replaceTransactionalEmails, listTransactionalEmails, getTransactionalEmail, renderTransactionalEmailPreview, type TransactionalEmailDefinition, type RegisteredTransactionalEmail, } from "../email-catalog/registry.js";
92
93
  export { notifyActivity, runActivityNotification, resolveActivityRecipients, type ActivityDeliveryFailure, type ActivityNotificationResult, type ActivityNotificationStatus, type NotifyActivityInput, type ResolveActivityRecipientsInput, } from "./activity-notifications.js";
93
94
  export { renderEmail, emailStrong, emailLink, type RenderEmailArgs, type RenderedEmail, type EmailCta, } from "./email-template.js";
95
+ export { hasRecurringSweepHandler, registerRecurringSweepHandler, runRecurringSweepHandlers, type RecurringSweepHandler, } from "../jobs/sweep-hooks.js";
96
+ export { scheduledTriggerAvailability, type ScheduledTriggerAvailability, } from "./agent-chat/recurring-jobs-runtime.js";
94
97
  export { getAppProductionUrl, getFirstPartyProdUrl, resolveAppRuntimeUrl, } from "./app-url.js";
95
98
  export { getConfiguredAppBasePath, normalizeAppBasePath, withConfiguredAppBasePath, } from "./app-base-path.js";
96
99
  export { signShortLivedToken, verifyShortLivedToken, type ShortLivedTokenClaims, type VerifyResult as ShortLivedTokenVerifyResult, } from "./short-lived-token.js";
@@ -1,4 +1,5 @@
1
1
  export { defineAppConfig, getAppConfig, resetAppConfigForTests, appConfigSchema, } from "../app-config/index.js";
2
+ export { resolveDeployEnvironment } from "./deploy-environment.js";
2
3
  export { inferWorkspaceAppRootHomePath, readConfiguredWorkspaceAppHomePath, } from "../workspace-app-config.js";
3
4
  export { createServer, } from "./create-server.js";
4
5
  export { startIntervalJob, } from "./interval-job.js";
@@ -101,6 +102,8 @@ export { sendEmail, isEmailConfigured, getEmailReadiness, getEmailProvider, } fr
101
102
  export { defineTransactionalEmail, defineTransactionalEmails, replaceTransactionalEmails, listTransactionalEmails, getTransactionalEmail, renderTransactionalEmailPreview, } from "../email-catalog/registry.js";
102
103
  export { notifyActivity, runActivityNotification, resolveActivityRecipients, } from "./activity-notifications.js";
103
104
  export { renderEmail, emailStrong, emailLink, } from "./email-template.js";
105
+ export { hasRecurringSweepHandler, registerRecurringSweepHandler, runRecurringSweepHandlers, } from "../jobs/sweep-hooks.js";
106
+ export { scheduledTriggerAvailability, } from "./agent-chat/recurring-jobs-runtime.js";
104
107
  export { getAppProductionUrl, getFirstPartyProdUrl, resolveAppRuntimeUrl, } from "./app-url.js";
105
108
  export { getConfiguredAppBasePath, normalizeAppBasePath, withConfiguredAppBasePath, } from "./app-base-path.js";
106
109
  export { signShortLivedToken, verifyShortLivedToken, } from "./short-lived-token.js";
@@ -75,7 +75,7 @@ Bring a senior engineer's judgment, arrived at through attention not premature c
75
75
  3. **Navigate the UI** — On "show me", "go to", "open", or similar, use \`navigate\` first, then fetch/display data.
76
76
  4. **Application state** — Ephemeral UI state lives in \`application_state\`. Use \`readAppState\`/\`writeAppState\`.
77
77
  5. **Screen refresh is automatic** — The UI re-fetches itself after mutating tool calls, so you rarely need \`refresh-screen\`; its description covers the exceptions. Never tell the user to reload the page.
78
- 6. **Memory** — Use \`save-memory\` proactively when you learn preferences, corrections, or project context.
78
+ 6. **Memory** — Use \`save-memory\` proactively when you learn preferences, corrections, or project context. At the end of a meaningful multi-turn task, review the thread for durable new learnings and save only what should help future conversations.
79
79
  7. **Security** — ${securityRule}
80
80
  ${sharedRule8(examples, options)}
81
81
  ${SHARED_RULE_9}
@@ -102,7 +102,7 @@ Write like a sharp, warm product teammate: concise, direct, and human. Lead with
102
102
  3. **Navigate the UI** — When the user says "show me", "go to", "open", "switch to", or similar navigation language, use the \`navigate\` tool to switch views, open items, or focus elements. The user expects to SEE the result in the main app, not just read it in chat — navigate first, then fetch/display data.
103
103
  4. **Application state** — Ephemeral UI state (drafts, selections, navigation) lives in \`application_state\`. Use \`readAppState\`/\`writeAppState\` to read and write it. When you write state, the UI updates automatically.
104
104
  ${refreshRule}
105
- 6. **Memory** — Use the structured memory system to persist knowledge across sessions. Use \`save-memory\` proactively when you learn preferences, corrections, or project context. Update shared AGENTS.md for instructions that should apply to all users.
105
+ 6. **Memory** — Use the structured memory system to persist knowledge across sessions. Use \`save-memory\` proactively when you learn preferences, corrections, or project context. At the end of a meaningful multi-turn task, review the thread for durable new learnings and save only what should help future conversations. Update shared AGENTS.md for instructions that should apply to all users.
106
106
  ${securityRule}
107
107
  ${sharedRule8(examples, options)}
108
108
  ${SHARED_RULE_9}
@@ -59,8 +59,8 @@ export declare function createRealtimeTokenHandler(): import("h3").EventHandlerW
59
59
  expiresAt?: undefined;
60
60
  ttlSeconds?: undefined;
61
61
  } | {
62
- error?: undefined;
63
62
  token: string;
64
63
  expiresAt: string;
65
64
  ttlSeconds: number;
65
+ error?: undefined;
66
66
  }>>;
@@ -77,11 +77,14 @@ export interface RequestRunContext {
77
77
  /**
78
78
  * True when this run is executing inside the durable background-function
79
79
  * worker (the `_process-run` self-dispatch), not the synchronous foreground
80
- * request. Template `extraContext` / system-prompt builders can read this to
81
- * skip heavy, hang-prone enrichment (large data-dictionary DB reads, etc.)
82
- * in the worker so it reliably claims its run within the setup budget.
80
+ * request. Template prompt builders can use this to skip unbounded enrichment;
81
+ * bounded preloads must still run because this worker rebuilds the prompt.
83
82
  */
84
83
  isBackgroundWorker?: boolean;
84
+ /** Low-cardinality Analytics context counts carried into run-completion telemetry. */
85
+ analyticsJevPrefetch?: {
86
+ preloadedReferenceCount: number;
87
+ };
85
88
  /** Tool calls made so far in the current agent loop. */
86
89
  toolCalls?: Array<{
87
90
  name: string;
@@ -20,6 +20,6 @@ export declare function createTranscribeVoiceHandler(): import("h3").EventHandle
20
20
  error: string;
21
21
  text?: undefined;
22
22
  } | {
23
- error?: undefined;
24
23
  text: string;
24
+ error?: undefined;
25
25
  }>>;
@@ -19,7 +19,9 @@ export declare function deleteOrgSetting(orgId: string, key: string, options?: S
19
19
  /** Delete every setting belonging to an org. For org deletion. */
20
20
  export declare function deleteAllOrgSettings(orgId: string, options?: StoreWriteOptions): Promise<number>;
21
21
  /**
22
- * List all settings keys for an org with an optional sub-prefix.
22
+ * List settings keys for an org with an optional sub-prefix and result limit.
23
23
  * Returns a map of `<key>` (without the org prefix) to value.
24
24
  */
25
- export declare function listOrgSettings(orgId: string, subPrefix?: string): Promise<Record<string, Record<string, unknown>>>;
25
+ export declare function listOrgSettings(orgId: string, subPrefix?: string, options?: {
26
+ limit?: number;
27
+ }): Promise<Record<string, Record<string, unknown>>>;
@@ -33,15 +33,15 @@ export async function deleteAllOrgSettings(orgId, options) {
33
33
  return deleteSettingsByPrefix(`o:${orgId}:`, options);
34
34
  }
35
35
  /**
36
- * List all settings keys for an org with an optional sub-prefix.
36
+ * List settings keys for an org with an optional sub-prefix and result limit.
37
37
  * Returns a map of `<key>` (without the org prefix) to value.
38
38
  */
39
- export async function listOrgSettings(orgId, subPrefix) {
39
+ export async function listOrgSettings(orgId, subPrefix, options) {
40
40
  // Narrow in SQL, then apply the same checks as before. Reading this with
41
41
  // `getAllSettings()` pulled and JSON-parsed every org's rows into the caller
42
42
  // to keep one org's, putting the whole deployment's settings table on the
43
43
  // critical path of any org-scoped list read.
44
- const scoped = await listSettingsByPrefix(`o:${orgId}:${subPrefix ?? ""}`);
44
+ const scoped = await listSettingsByPrefix(`o:${orgId}:${subPrefix ?? ""}`, options);
45
45
  const out = {};
46
46
  for (const { key: fullKey, value } of scoped) {
47
47
  const m = ORG_PREFIX_RE.exec(fullKey);
@@ -46,7 +46,9 @@ export declare function deleteSettingsByPrefix(prefix: string, options?: StoreWr
46
46
  * one namespace must not use {@link getAllSettings} — that loads the whole
47
47
  * table.
48
48
  */
49
- export declare function listSettingsByPrefix(prefix: string): Promise<Array<{
49
+ export declare function listSettingsByPrefix(prefix: string, options?: {
50
+ limit?: number;
51
+ }): Promise<Array<{
50
52
  key: string;
51
53
  value: Record<string, unknown>;
52
54
  }>>;
@@ -310,14 +310,19 @@ export async function deleteSettingsByPrefix(prefix, options) {
310
310
  * one namespace must not use {@link getAllSettings} — that loads the whole
311
311
  * table.
312
312
  */
313
- export async function listSettingsByPrefix(prefix) {
313
+ export async function listSettingsByPrefix(prefix, options) {
314
314
  await ensureTable();
315
315
  const client = getDbExec();
316
316
  const table = settingsTable();
317
317
  const escaped = prefix.replace(/[!%_]/g, (c) => `!${c}`);
318
+ const limit = options?.limit;
319
+ if (limit !== undefined && (!Number.isSafeInteger(limit) || limit < 0)) {
320
+ throw new RangeError("Settings prefix limit must be a non-negative integer.");
321
+ }
318
322
  const { rows } = await client.execute({
319
- sql: `SELECT key, value FROM ${table} WHERE key LIKE ? ESCAPE '!'`,
320
- args: [`${escaped}%`],
323
+ sql: `SELECT key, value FROM ${table} WHERE key LIKE ? ESCAPE '!'
324
+ ${limit === undefined ? "" : "ORDER BY key ASC LIMIT ?"}`,
325
+ args: limit === undefined ? [`${escaped}%`] : [`${escaped}%`, limit],
321
326
  });
322
327
  return rows.map((row) => ({
323
328
  key: String(row.key),
@@ -1068,6 +1068,11 @@
1068
1068
  .agent-composer-root {
1069
1069
  container-type: inline-size;
1070
1070
  container-name: agent-composer;
1071
+ background: color-mix(
1072
+ in srgb,
1073
+ var(--agent-kit-subtle-surface) 45%,
1074
+ var(--agent-kit-recessed-surface)
1075
+ );
1071
1076
  }
1072
1077
  @container agent-composer (max-width: 370px) {
1073
1078
  .agent-composer-model-effort {
@@ -702,6 +702,7 @@ const messages = {
702
702
  reviewFeedback: "الملاحظات",
703
703
  reviewOutput: "مراجعة الإجابة",
704
704
  reviewPreview: "معاينة الإجابة",
705
+ reviewPreviewUnavailable: "المعاينة غير متاحة",
705
706
  closePreview: "إخفاء المعاينة",
706
707
  addFeedback: "إضافة ملاحظات",
707
708
  draftInstruction: "صياغة تعليمات",
@@ -692,6 +692,7 @@ const messages = {
692
692
  reviewFeedback: "Feedback",
693
693
  reviewOutput: "Antwort prüfen",
694
694
  reviewPreview: "Antwortvorschau",
695
+ reviewPreviewUnavailable: "Vorschau nicht verfügbar",
695
696
  closePreview: "Vorschau ausblenden",
696
697
  addFeedback: "Feedback hinzufügen",
697
698
  draftInstruction: "Anweisung entwerfen",
@@ -678,6 +678,7 @@ const messages = {
678
678
  reviewFeedback: "Feedback",
679
679
  reviewOutput: "Review output",
680
680
  reviewPreview: "Preview output",
681
+ reviewPreviewUnavailable: "Preview unavailable",
681
682
  closePreview: "Hide preview",
682
683
  addFeedback: "Add feedback",
683
684
  draftInstruction: "Draft instruction",
@@ -700,6 +700,7 @@ const messages = {
700
700
  reviewFeedback: "Comentarios",
701
701
  reviewOutput: "Revisar respuesta",
702
702
  reviewPreview: "Vista previa de la respuesta",
703
+ reviewPreviewUnavailable: "Vista previa no disponible",
703
704
  closePreview: "Ocultar vista previa",
704
705
  addFeedback: "Añadir comentarios",
705
706
  draftInstruction: "Borrador de instrucción",
@@ -697,6 +697,7 @@ const messages = {
697
697
  reviewFeedback: "Avis",
698
698
  reviewOutput: "Revoir la réponse",
699
699
  reviewPreview: "Aperçu de la réponse",
700
+ reviewPreviewUnavailable: "Aperçu indisponible",
700
701
  closePreview: "Masquer l'aperçu",
701
702
  addFeedback: "Ajouter un commentaire",
702
703
  draftInstruction: "Brouillon d'instruction",
@@ -670,6 +670,7 @@ const messages = {
670
670
  reviewFeedback: "फ़ीडबैक",
671
671
  reviewOutput: "उत्तर की समीक्षा",
672
672
  reviewPreview: "उत्तर का पूर्वावलोकन",
673
+ reviewPreviewUnavailable: "पूर्वावलोकन उपलब्ध नहीं है",
673
674
  closePreview: "पूर्वावलोकन छिपाएँ",
674
675
  addFeedback: "फ़ीडबैक जोड़ें",
675
676
  draftInstruction: "निर्देश का मसौदा",
@@ -680,6 +680,7 @@ const messages = {
680
680
  reviewFeedback: "フィードバック",
681
681
  reviewOutput: "回答をレビュー",
682
682
  reviewPreview: "回答をプレビュー",
683
+ reviewPreviewUnavailable: "プレビューを利用できません",
683
684
  closePreview: "プレビューを非表示",
684
685
  addFeedback: "フィードバックを追加",
685
686
  draftInstruction: "指示を下書き",
@@ -670,6 +670,7 @@ const messages = {
670
670
  reviewFeedback: "피드백",
671
671
  reviewOutput: "답변 검토",
672
672
  reviewPreview: "답변 미리보기",
673
+ reviewPreviewUnavailable: "미리보기를 사용할 수 없습니다",
673
674
  closePreview: "미리보기 숨기기",
674
675
  addFeedback: "피드백 추가",
675
676
  draftInstruction: "지침 초안",
@@ -693,6 +693,7 @@ const messages = {
693
693
  reviewFeedback: "Feedback",
694
694
  reviewOutput: "Revisar resposta",
695
695
  reviewPreview: "Visualizar resposta",
696
+ reviewPreviewUnavailable: "Prévia indisponível",
696
697
  closePreview: "Ocultar visualização",
697
698
  addFeedback: "Adicionar feedback",
698
699
  draftInstruction: "Rascunhar instrução",
@@ -650,6 +650,7 @@ const messages = {
650
650
  reviewFeedback: "反馈",
651
651
  reviewOutput: "审核回答",
652
652
  reviewPreview: "预览回答",
653
+ reviewPreviewUnavailable: "无法预览",
653
654
  closePreview: "隐藏预览",
654
655
  addFeedback: "添加反馈",
655
656
  draftInstruction: "起草指令",
@@ -650,6 +650,7 @@ const messages = {
650
650
  reviewFeedback: "回饋",
651
651
  reviewOutput: "審核回答",
652
652
  reviewPreview: "預覽回答",
653
+ reviewPreviewUnavailable: "無法預覽",
653
654
  closePreview: "隱藏預覽",
654
655
  addFeedback: "新增回饋",
655
656
  draftInstruction: "草擬指示",
@@ -55,20 +55,27 @@ function resolveTrackingSource(source) {
55
55
  };
56
56
  }
57
57
  if (isActionRunContext(source)) {
58
+ const callerMatchesRequest = source.userEmail === requestContext?.userEmail;
58
59
  return {
59
60
  userId: source.userEmail,
60
- ...(source.userEmail === requestContext?.userEmail
61
+ ...(callerMatchesRequest
61
62
  ? { authUserId: requestContext?.authUserId }
62
63
  : {}),
63
- sessionId: ambientSessionId,
64
+ sessionId: callerMatchesRequest ? ambientSessionId : undefined,
64
65
  telemetryOrigin: "server",
65
66
  };
66
67
  }
68
+ const canUseAmbientIdentity = source.userId
69
+ ? source.userId === requestContext?.userEmail
70
+ : !source.anonymousId;
71
+ const canUseAmbientSession = canUseAmbientIdentity &&
72
+ (!source.authUserId || source.authUserId === requestContext?.authUserId);
67
73
  return {
68
74
  userId: source.userId,
69
- authUserId: source.authUserId,
75
+ authUserId: source.authUserId ??
76
+ (canUseAmbientIdentity ? requestContext?.authUserId : undefined),
70
77
  anonymousId: source.anonymousId,
71
- sessionId: source.sessionId ?? ambientSessionId,
78
+ sessionId: source.sessionId ?? (canUseAmbientSession ? ambientSessionId : undefined),
72
79
  occurredAt: source.occurredAt,
73
80
  telemetryOrigin: source.telemetryOrigin ?? "server",
74
81
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.189.0",
3
+ "version": "0.190.0-nightly-20260925211446",
4
4
  "description": "The agentic application framework for building autonomous agents with intuitive UIs",
5
5
  "homepage": "https://github.com/BuilderIO/agent-native#readme",
6
6
  "bugs": {
@@ -268,6 +268,7 @@
268
268
  "./secrets": "./dist/secrets/index.js",
269
269
  "./secrets/crypto": "./dist/secrets/crypto.js",
270
270
  "./org": "./dist/org/index.js",
271
+ "./org/free-email-providers": "./dist/org/free-email-providers.js",
271
272
  "./org-team": "./dist/org-team/index.js",
272
273
  "./client/org": "./dist/client/org/index.js",
273
274
  "./client/org-switcher": "./dist/client/org/OrgSwitcher.js",
@@ -508,9 +509,9 @@
508
509
  "yaml": "^2.9.0",
509
510
  "yjs": "^13.6.32",
510
511
  "zod": "^4.3.6",
511
- "@agent-native/agentkit": "^0.2.11",
512
512
  "@agent-native/recap-cli": "0.5.41",
513
- "@agent-native/toolkit": "^0.21.1"
513
+ "@agent-native/agentkit": "^0.2.12-nightly-20260925211446",
514
+ "@agent-native/toolkit": "^0.21.2-nightly-20260925211446"
514
515
  },
515
516
  "devDependencies": {
516
517
  "@ai-sdk/anthropic": "^3.0.71",
@@ -702,6 +702,7 @@ const messages = {
702
702
  reviewFeedback: "الملاحظات",
703
703
  reviewOutput: "مراجعة الإجابة",
704
704
  reviewPreview: "معاينة الإجابة",
705
+ reviewPreviewUnavailable: "المعاينة غير متاحة",
705
706
  closePreview: "إخفاء المعاينة",
706
707
  addFeedback: "إضافة ملاحظات",
707
708
  draftInstruction: "صياغة تعليمات",
@@ -692,6 +692,7 @@ const messages = {
692
692
  reviewFeedback: "Feedback",
693
693
  reviewOutput: "Antwort prüfen",
694
694
  reviewPreview: "Antwortvorschau",
695
+ reviewPreviewUnavailable: "Vorschau nicht verfügbar",
695
696
  closePreview: "Vorschau ausblenden",
696
697
  addFeedback: "Feedback hinzufügen",
697
698
  draftInstruction: "Anweisung entwerfen",
@@ -678,6 +678,7 @@ const messages = {
678
678
  reviewFeedback: "Feedback",
679
679
  reviewOutput: "Review output",
680
680
  reviewPreview: "Preview output",
681
+ reviewPreviewUnavailable: "Preview unavailable",
681
682
  closePreview: "Hide preview",
682
683
  addFeedback: "Add feedback",
683
684
  draftInstruction: "Draft instruction",