@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
@@ -103,6 +103,20 @@ export function getSlideCanvasTraversalElements(
103
103
  });
104
104
  }
105
105
 
106
+ /**
107
+ * On the editing canvas a slide link is content to select and edit, not a way
108
+ * out of the editor: no click on it (Cmd/Ctrl-click adds to the selection, a
109
+ * middle click, a click that only selects its card) opens it.
110
+ */
111
+ export function preventSlideLinkNavigation(
112
+ event: Pick<Event, "target" | "preventDefault">,
113
+ ) {
114
+ const target = event.target instanceof Element ? event.target : null;
115
+ if (target?.closest("a[href]")?.closest(".slide-content")) {
116
+ event.preventDefault();
117
+ }
118
+ }
119
+
106
120
  /** Canvas-only shortcuts must not consume keys while focus is in editor chrome. */
107
121
  export function isSlideCanvasShortcutTarget(
108
122
  activeElement: Element | null,
@@ -231,6 +245,18 @@ export function isSmartGroup(element: HTMLElement): boolean {
231
245
  return true;
232
246
  }
233
247
 
248
+ /**
249
+ * A text block whose text was all deleted: the edit leaves a `<br>` so the
250
+ * empty line keeps its height, and it must stay enterable to type again.
251
+ */
252
+ function isEmptiedTextBlock(element: HTMLElement): boolean {
253
+ return (
254
+ !element.textContent?.trim() &&
255
+ element.children.length > 0 &&
256
+ Array.from(element.children).every((child) => child.tagName === "BR")
257
+ );
258
+ }
259
+
234
260
  /** A single canvas target whose descendants are rich-text structure, not layers. */
235
261
  export function isRichTextBlock(element: HTMLElement): boolean {
236
262
  if (!element || isInlineTextElement(element) || element.tagName === "IMG") {
@@ -250,7 +276,8 @@ export function isRichTextBlock(element: HTMLElement): boolean {
250
276
  element.classList.contains("fmd-text-box") ||
251
277
  element.getAttribute("data-editing-block") === "true" ||
252
278
  isTextLeaf(element) ||
253
- isSmartGroup(element)
279
+ isSmartGroup(element) ||
280
+ isEmptiedTextBlock(element)
254
281
  ) {
255
282
  return true;
256
283
  }
@@ -306,7 +333,13 @@ function hasUnsafeRichTextDescendant(element: HTMLElement): boolean {
306
333
  function canEnterRichTextEdit(element: HTMLElement): boolean {
307
334
  if (!isRichTextBlock(element)) return false;
308
335
  // A single text layer keeps its outer style while its contents are edited.
309
- if (isTextLeaf(element) || detectSlideListKind(element)) return true;
336
+ if (
337
+ isTextLeaf(element) ||
338
+ isEmptiedTextBlock(element) ||
339
+ detectSlideListKind(element)
340
+ ) {
341
+ return true;
342
+ }
310
343
  return !hasUnsafeRichTextDescendant(element);
311
344
  }
312
345
 
@@ -336,17 +369,19 @@ export function resolveRichTextEditingBlock(element: HTMLElement): HTMLElement {
336
369
  function findSlideRichTextOwner(
337
370
  target: HTMLElement,
338
371
  root: HTMLElement,
372
+ boundary: HTMLElement | null,
339
373
  ): HTMLElement | null {
340
374
  if (target.closest(".fmd-text-box[data-slide-object-id]")) return null;
341
- let owner: HTMLElement | null = null;
375
+ const owners: HTMLElement[] = [];
342
376
  let element: HTMLElement | null = target;
343
377
  while (element && element !== root && root.contains(element)) {
344
378
  if (isSlideCanvasShell(element)) break;
345
379
  if (RICH_TEXT_TABLE_TAGS.has(element.tagName)) break;
346
- if (ownsRichTextEditingLayer(element)) owner = element;
380
+ if (ownsRichTextEditingLayer(element)) owners.unshift(element);
381
+ if (element === boundary) break;
347
382
  element = element.parentElement;
348
383
  }
349
- return owner;
384
+ return owners.find((owner) => !holdsPaintedTextBox(owner, root)) ?? null;
350
385
  }
351
386
 
352
387
  function isTransparentPaint(color: string): boolean {
@@ -380,6 +415,51 @@ function paintsOwnBox(element: HTMLElement): boolean {
380
415
  /** A painted box this large is the slide's backdrop, not an object on it. */
381
416
  const SLIDE_BACKDROP_AREA_RATIO = 0.9;
382
417
 
418
+ function isPaintedObject(element: HTMLElement, root: HTMLElement): boolean {
419
+ if (isInlineTextElement(element) || !paintsOwnBox(element)) return false;
420
+ const rootRect = root.getBoundingClientRect();
421
+ const rootArea = rootRect.width * rootRect.height;
422
+ const rect = element.getBoundingClientRect();
423
+ return (
424
+ rootArea <= 0 ||
425
+ rect.width * rect.height < rootArea * SLIDE_BACKDROP_AREA_RATIO
426
+ );
427
+ }
428
+
429
+ /** The nearest box at or above `target` that the slide paints, such as a card. */
430
+ function paintedBoxAround(
431
+ target: HTMLElement,
432
+ root: HTMLElement,
433
+ ): HTMLElement | null {
434
+ for (
435
+ let element: HTMLElement | null = target;
436
+ element && element !== root && root.contains(element);
437
+ element = element.parentElement
438
+ ) {
439
+ if (isSlideCanvasShell(element)) return null;
440
+ if (isPaintedObject(element, root)) return element;
441
+ }
442
+ return null;
443
+ }
444
+
445
+ /**
446
+ * Whether `element` holds a painted box with text, such as a card in a grid:
447
+ * one edit there would let Enter and Backspace move text between boxes the
448
+ * slide draws apart. List items are their list's own rows, and a box with no
449
+ * text (a marker, a divider) holds nothing to move.
450
+ */
451
+ export function holdsPaintedTextBox(
452
+ element: HTMLElement,
453
+ root: HTMLElement,
454
+ ): boolean {
455
+ return Array.from(element.querySelectorAll<HTMLElement>("*")).some(
456
+ (box) =>
457
+ box.tagName !== "LI" &&
458
+ Boolean(box.textContent?.trim()) &&
459
+ isPaintedObject(box, root),
460
+ );
461
+ }
462
+
383
463
  /**
384
464
  * Google Slides drags a shape from anywhere, its text included, while a bare
385
465
  * text box keeps its interior for the caret. Generated HTML has no shape type,
@@ -391,8 +471,6 @@ export function findSlideShapeOwner(
391
471
  target: HTMLElement | null,
392
472
  root: HTMLElement,
393
473
  ): HTMLElement | null {
394
- const rootRect = root.getBoundingClientRect();
395
- const rootArea = rootRect.width * rootRect.height;
396
474
  let element = target;
397
475
  while (element && element !== root && root.contains(element)) {
398
476
  if (
@@ -406,13 +484,7 @@ export function findSlideShapeOwner(
406
484
  ) {
407
485
  return null;
408
486
  }
409
- if (!isInlineTextElement(element) && paintsOwnBox(element)) {
410
- const rect = element.getBoundingClientRect();
411
- const isBackdrop =
412
- rootArea > 0 &&
413
- rect.width * rect.height >= rootArea * SLIDE_BACKDROP_AREA_RATIO;
414
- if (!isBackdrop) return element;
415
- }
487
+ if (isPaintedObject(element, root)) return element;
416
488
  element = element.parentElement;
417
489
  }
418
490
  return null;
@@ -430,15 +502,23 @@ export function findGrabbedSlideShape(
430
502
  : null;
431
503
  }
432
504
 
433
- /** Resolve a click inside inline markup to the containing editable text block. */
505
+ /**
506
+ * Resolve a click inside inline markup to the containing editable text block.
507
+ * The block never spans more than one painted box: it may be the card the
508
+ * click is in, or text inside it, never the grid around the cards.
509
+ */
434
510
  export function findSmartBlock(
435
511
  target: HTMLElement,
436
512
  root: HTMLElement,
437
513
  options?: { includeTextBoxes?: boolean },
438
514
  ): HTMLElement | null {
439
515
  const includeTextBoxes = options?.includeTextBoxes ?? true;
440
- const richTextOwner = findSlideRichTextOwner(target, root);
516
+ const boundary = paintedBoxAround(target, root);
517
+ const richTextOwner = findSlideRichTextOwner(target, root, boundary);
441
518
  if (richTextOwner) return richTextOwner;
519
+ const fits = (block: HTMLElement) =>
520
+ (!boundary || boundary.contains(block)) &&
521
+ !holdsPaintedTextBox(block, root);
442
522
  let element: HTMLElement | null = target;
443
523
  while (element && root.contains(element)) {
444
524
  if (
@@ -450,13 +530,15 @@ export function findSmartBlock(
450
530
  if (isTextLeaf(element)) {
451
531
  const list = findEnclosingList(element, root);
452
532
  const block = resolveRichTextEditingBlock(list ?? element);
453
- return canEnterRichTextEdit(block) ? block : element;
533
+ return canEnterRichTextEdit(block) && fits(block) ? block : element;
454
534
  }
455
- if (isSmartGroup(element) && canEnterRichTextEdit(element)) return element;
456
- if (isRichTextBlock(element)) {
535
+ if (isSmartGroup(element) && canEnterRichTextEdit(element)) {
536
+ if (fits(element)) return element;
537
+ } else if (isRichTextBlock(element)) {
457
538
  const block = resolveRichTextEditingBlock(element);
458
- return canEnterRichTextEdit(block) ? block : null;
539
+ return canEnterRichTextEdit(block) && fits(block) ? block : null;
459
540
  }
541
+ if (element === boundary) return null;
460
542
  element = element.parentElement;
461
543
  }
462
544
  return null;
@@ -1112,13 +1112,18 @@ function settleQueuedContentDraft(
1112
1112
  ): boolean {
1113
1113
  const queue = pendingOpsQueue.get(deckId) ?? [];
1114
1114
  for (;;) {
1115
- const index = queue.findLastIndex(
1116
- (op) =>
1115
+ let index = queue.length - 1;
1116
+ for (; index >= 0; index--) {
1117
+ const op = queue[index];
1118
+ if (
1117
1119
  op.op === "full-replace" ||
1118
1120
  (op.op === "patch-slide"
1119
1121
  ? op.slideId === slideId && typeof op.fields.content === "string"
1120
- : "slideId" in op && op.slideId === slideId),
1121
- );
1122
+ : "slideId" in op && op.slideId === slideId)
1123
+ ) {
1124
+ break;
1125
+ }
1126
+ }
1122
1127
  if (index < 0) break;
1123
1128
  const op = queue[index];
1124
1129
  if (op.op !== "patch-slide") return false;
@@ -1291,183 +1291,14 @@ button[title="Open agent sidebar"] {
1291
1291
  color: hsl(var(--popover-foreground));
1292
1292
  }
1293
1293
 
1294
- /* ─── Inline Slide Editor (TipTap) ─── */
1295
-
1296
- .slide-tiptap-editor {
1297
- font-family: "Poppins", sans-serif;
1298
- color: rgba(255, 255, 255, 0.9);
1299
- caret-color: #609ff8;
1300
- outline: none;
1301
- cursor: text;
1302
- }
1303
-
1304
- .slide-tiptap-editor .tiptap {
1294
+ /* A slide element is edited in place. Chrome's UA rules for an editing host
1295
+ change its wrapping (`overflow-wrap: break-word`, `line-break:
1296
+ after-white-space`) and draw a focus ring; `:where` keeps every author
1297
+ rule ahead of these, so entering edit changes nothing on the slide. */
1298
+ :where(.slide-content [contenteditable="true"]) {
1305
1299
  outline: none;
1306
- min-height: 100%;
1307
- height: 100%;
1308
- }
1309
-
1310
- /* Placeholder */
1311
- .slide-tiptap-editor .tiptap p.is-editor-empty:first-child::before {
1312
- content: attr(data-placeholder);
1313
- color: rgba(255, 255, 255, 0.2);
1314
- pointer-events: none;
1315
- float: left;
1316
- height: 0;
1317
- }
1318
-
1319
- /* Headings */
1320
- .slide-tiptap-editor .tiptap h1 {
1321
- font-size: 54px;
1322
- font-weight: 900;
1323
- color: #ffffff;
1324
- line-height: 1.1;
1325
- letter-spacing: -1px;
1326
- margin-bottom: 32px;
1327
- }
1328
-
1329
- .slide-tiptap-editor .tiptap h2 {
1330
- font-size: 40px;
1331
- font-weight: 900;
1332
- color: #ffffff;
1333
- line-height: 1.15;
1334
- letter-spacing: -0.5px;
1335
- margin-bottom: 24px;
1336
- }
1337
-
1338
- .slide-tiptap-editor .tiptap h3 {
1339
- font-size: 28px;
1340
- font-weight: 700;
1341
- color: #ffffff;
1342
- line-height: 1.2;
1343
- margin-bottom: 16px;
1344
- }
1345
-
1346
- /* Paragraph */
1347
- .slide-tiptap-editor .tiptap p {
1348
- font-size: 22px;
1349
- color: rgba(255, 255, 255, 0.85);
1350
- line-height: 1.5;
1351
- margin-bottom: 16px;
1352
- }
1353
-
1354
- /* Lists */
1355
- .slide-tiptap-editor .tiptap ul {
1356
- padding-left: 0;
1357
- margin-bottom: 16px;
1358
- list-style: none;
1359
- display: flex;
1360
- flex-direction: column;
1361
- gap: 14px;
1362
- }
1363
-
1364
- .slide-tiptap-editor .tiptap ul li {
1365
- display: flex;
1366
- align-items: baseline;
1367
- gap: 18px;
1368
- font-size: 22px;
1369
- color: rgba(255, 255, 255, 0.85);
1370
- line-height: 1.4;
1371
- }
1372
-
1373
- .slide-tiptap-editor .tiptap ul li::before {
1374
- content: "●";
1375
- color: #ffffff;
1376
- font-size: 8px;
1377
- position: relative;
1378
- top: -4px;
1379
- flex-shrink: 0;
1380
- }
1381
-
1382
- /* TipTap wraps li content in <p> — remove its margin */
1383
- .slide-tiptap-editor .tiptap ul li p {
1384
- margin: 0;
1385
- font-size: inherit;
1386
- color: inherit;
1387
- }
1388
-
1389
- .slide-tiptap-editor .tiptap ol {
1390
- padding-left: 28px;
1391
- margin-bottom: 16px;
1392
- display: flex;
1393
- flex-direction: column;
1394
- gap: 14px;
1395
- }
1396
-
1397
- .slide-tiptap-editor .tiptap ol li {
1398
- font-size: 22px;
1399
- color: rgba(255, 255, 255, 0.85);
1400
- line-height: 1.4;
1401
- list-style-type: decimal;
1402
- }
1403
-
1404
- .slide-tiptap-editor .tiptap ol li p {
1405
- margin: 0;
1406
- font-size: inherit;
1407
- color: inherit;
1408
- }
1409
-
1410
- /* Blockquote */
1411
- .slide-tiptap-editor .tiptap blockquote {
1412
- border-left: 4px solid #00e5ff;
1413
- padding-left: 24px;
1414
- color: rgba(255, 255, 255, 0.7);
1415
- font-size: 24px;
1416
- font-style: italic;
1417
- margin-bottom: 16px;
1418
- }
1419
-
1420
- /* Inline formatting */
1421
- .slide-tiptap-editor .tiptap strong {
1422
- color: #ffffff;
1423
- font-weight: 700;
1424
- }
1425
-
1426
- .slide-tiptap-editor .tiptap em {
1427
- color: rgba(255, 255, 255, 0.9);
1428
- font-style: italic;
1429
- }
1430
-
1431
- .slide-tiptap-editor .tiptap s {
1432
- opacity: 0.6;
1433
- }
1434
-
1435
- .slide-tiptap-editor .tiptap code {
1436
- background: rgba(255, 255, 255, 0.1);
1437
- padding: 2px 8px;
1438
- border-radius: 4px;
1439
- color: #00e5ff;
1440
- font-family: monospace;
1441
- font-size: 0.85em;
1442
- }
1443
-
1444
- .slide-tiptap-editor .tiptap a {
1445
- color: #00e5ff;
1446
- text-decoration: underline;
1447
- }
1448
-
1449
- /* Selection highlight */
1450
- .slide-tiptap-editor .tiptap ::selection {
1451
- background: rgba(96, 159, 248, 0.35);
1452
- }
1453
-
1454
- /* The shared editor supplies the Content editing behavior and renders
1455
- unstyled, so the slide element's own layout and inherited text styles are
1456
- the only ones that apply while editing. Nothing in edit mode may restyle
1457
- text; the element must look identical selected and unselected. */
1458
- .slide-content .slide-rich-editor-host {
1459
- display: contents;
1460
- }
1461
-
1462
- /* The body-mounted editing context needs a real box for its fixed host. */
1463
- .slide-content.slide-rich-editor-context .slide-rich-editor-host {
1464
- display: block;
1465
- }
1466
-
1467
- /* TipTap's relative editor root must not become the containing block for
1468
- persisted absolute slide objects when a text layer receives focus. */
1469
- .slide-content .slide-shared-rich-editor .ProseMirror {
1470
- position: static;
1300
+ overflow-wrap: inherit;
1301
+ line-break: inherit;
1471
1302
  }
1472
1303
 
1473
1304
  /* An empty paragraph is an intentional line break, not editor-only chrome. */
@@ -1475,44 +1306,6 @@ button[title="Open agent sidebar"] {
1475
1306
  min-height: 1em;
1476
1307
  }
1477
1308
 
1478
- /* Editing one list item renders it inside its own list, so hide the outer
1479
- marker and let the inner one take its place. */
1480
- .slide-content .fmd-slide li[data-editing-block="true"] {
1481
- list-style: none;
1482
- }
1483
-
1484
- .slide-content
1485
- .fmd-slide
1486
- li[data-editing-block="true"]
1487
- .an-rich-md-unstyled
1488
- > :is(ul, ol) {
1489
- padding-left: 0;
1490
- padding-inline-start: 0;
1491
- }
1492
-
1493
- /* Older decks style bullets as flex rows with a marker span; they are edited
1494
- as a semantic list that draws the same marker. */
1495
- .slide-content .slide-shared-rich-editor ul[style*="--slide-legacy-list"] {
1496
- padding-left: 0;
1497
- list-style: none;
1498
- }
1499
-
1500
- .slide-content .slide-shared-rich-editor ul[style*="--slide-legacy-list"] > li {
1501
- list-style: none;
1502
- }
1503
-
1504
- .slide-content
1505
- .slide-shared-rich-editor
1506
- ul[style*="--slide-legacy-list"]
1507
- > li::before {
1508
- content: var(--slide-legacy-marker-content, "•");
1509
- color: var(--slide-legacy-marker-color, currentColor);
1510
- font-size: var(--slide-legacy-marker-size, 0.5em);
1511
- position: relative;
1512
- top: var(--slide-legacy-marker-top, -0.25em);
1513
- flex-shrink: 0;
1514
- }
1515
-
1516
1309
  .slide-content .fmd-slide h1 {
1517
1310
  font-size: 2em;
1518
1311
  font-weight: 700;
@@ -1537,11 +1330,6 @@ button[title="Open agent sidebar"] {
1537
1330
  line-height: 1.5;
1538
1331
  }
1539
1332
 
1540
- /* Slides has its own toolbar; the shared bubble toolbar stays hidden. */
1541
- .slide-content .slide-shared-rich-editor .an-rich-md-bubble-toolbar {
1542
- display: none;
1543
- }
1544
-
1545
1333
  /* Google Slides-style object selection chrome. The edge hit targets are wider
1546
1334
  than their visible bars, but both centers sit on the 1px outline rather than
1547
1335
  drifting into the selected object through the outline's border box. */
@@ -26,6 +26,7 @@ const messages = {
26
26
  team: "Team",
27
27
  },
28
28
  settings: {
29
+ agentObservability: "Agent Observability",
29
30
  title: "Settings",
30
31
  description: "Language and workspace preferences for this app.",
31
32
  labs: "Labs",
@@ -701,6 +702,8 @@ const messages = {
701
702
  leaveWithoutSaving: "Exit without saving",
702
703
  editorMarkupNotSaved:
703
704
  "This edit wasn't saved because it would have added editor markup to the slide.",
705
+ textEditConflictNotSaved:
706
+ "Your text edit wasn't saved because the same text was changed elsewhere at the same time.",
704
707
  },
705
708
  designSystemSetup: {
706
709
  importedBrand: "Imported brand",
@@ -90,6 +90,12 @@ const ALLOWED_ATTRS = new Set([
90
90
  "width",
91
91
  ]);
92
92
 
93
+ /** List numbering, which only means something on its own tag. */
94
+ const TAG_ATTRS: Readonly<Record<string, ReadonlySet<string>>> = {
95
+ ol: new Set(["reversed", "start", "type"]),
96
+ li: new Set(["value"]),
97
+ };
98
+
93
99
  const URL_ATTRS = new Set(["href", "src", "poster", "xlink:href"]);
94
100
 
95
101
  function escapeHtml(value: string): string {
@@ -284,6 +290,7 @@ function cleanNode(
284
290
  if (name === "srcdoc" || name === "srcset") continue;
285
291
  if (
286
292
  !ALLOWED_ATTRS.has(name) &&
293
+ !TAG_ATTRS[tag]?.has(name) &&
287
294
  !name.startsWith("data-") &&
288
295
  !name.startsWith("aria-")
289
296
  ) {