@agent-native/core 0.80.8 → 0.80.9

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 (281) hide show
  1. package/corpus/README.md +2 -2
  2. package/corpus/core/CHANGELOG.md +12 -0
  3. package/corpus/core/docs/content/locales/ar-SA/template-design.mdx +6 -0
  4. package/corpus/core/docs/content/locales/de-DE/template-design.mdx +8 -0
  5. package/corpus/core/docs/content/locales/es-ES/template-design.mdx +10 -2
  6. package/corpus/core/docs/content/locales/fr-FR/template-design.mdx +10 -2
  7. package/corpus/core/docs/content/locales/hi-IN/template-design.mdx +7 -0
  8. package/corpus/core/docs/content/locales/ja-JP/template-design.mdx +7 -0
  9. package/corpus/core/docs/content/locales/ko-KR/template-design.mdx +7 -0
  10. package/corpus/core/docs/content/locales/pt-BR/template-design.mdx +9 -2
  11. package/corpus/core/docs/content/locales/zh-CN/template-design.mdx +6 -0
  12. package/corpus/core/docs/content/locales/zh-TW/template-design.mdx +6 -0
  13. package/corpus/core/docs/content/template-design.mdx +9 -2
  14. package/corpus/core/package.json +1 -1
  15. package/corpus/core/src/cli/mcp.ts +10 -0
  16. package/corpus/core/src/cli/skills.ts +58 -12
  17. package/corpus/core/src/client/error-format.ts +25 -0
  18. package/corpus/core/src/client/extensions/ExtensionViewer.tsx +13 -11
  19. package/corpus/core/src/client/guided-questions.tsx +32 -4
  20. package/corpus/core/src/client/onboarding/OnboardingPanel.tsx +33 -1
  21. package/corpus/core/src/client/resources/BuiltinCapabilityDetail.tsx +8 -0
  22. package/corpus/core/src/client/resources/use-builtin-capabilities.ts +4 -2
  23. package/corpus/core/src/client/session-replay.ts +34 -0
  24. package/corpus/core/src/client/sharing/ShareButton.tsx +106 -21
  25. package/corpus/core/src/coding-tools/index.ts +1 -1
  26. package/corpus/core/src/mcp/index.ts +2 -0
  27. package/corpus/core/src/mcp/screen-memory-stdio.ts +290 -0
  28. package/corpus/core/src/mcp-client/builtin-capabilities.ts +13 -1
  29. package/corpus/core/src/mcp-client/index.ts +9 -0
  30. package/corpus/core/src/mcp-client/screen-memory-local.ts +461 -0
  31. package/corpus/core/src/onboarding/types.ts +7 -0
  32. package/corpus/core/src/server/agent-chat-plugin.ts +25 -0
  33. package/corpus/core/src/server/agents-bundle.ts +35 -7
  34. package/corpus/core/src/styles/agent-native.css +5 -0
  35. package/corpus/core/src/templates/default/app/global.css +35 -35
  36. package/corpus/templates/analytics/AGENTS.md +6 -0
  37. package/corpus/templates/analytics/actions/github-repo-files.ts +9 -0
  38. package/corpus/templates/analytics/app/components/layout/Layout.tsx +4 -4
  39. package/corpus/templates/analytics/app/global.css +144 -40
  40. package/corpus/templates/analytics/app/pages/adhoc/explorer/index.tsx +1 -1
  41. package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/ChartCard.tsx +1 -1
  42. package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +1 -1
  43. package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +4 -4
  44. package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +9 -9
  45. package/corpus/templates/analytics/changelog/2026-06-29-agents-can-search-and-read-connected-github-repositories-whe.md +6 -0
  46. package/corpus/templates/analytics/changelog/2026-06-29-sessions-and-explorer-layouts-adapt-when-the-agent-sidebar-is.md +6 -0
  47. package/corpus/templates/assets/app/components/layout/Layout.tsx +3 -1
  48. package/corpus/templates/assets/app/components/library/LibraryPresetGrid.tsx +1 -1
  49. package/corpus/templates/assets/app/global.css +99 -35
  50. package/corpus/templates/assets/app/routes/asset.$id.tsx +2 -2
  51. package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +4 -4
  52. package/corpus/templates/assets/app/routes/library.tsx +4 -4
  53. package/corpus/templates/assets/changelog/2026-06-29-asset-library-and-detail-layouts-adapt-when-the-agent-sidebar.md +6 -0
  54. package/corpus/templates/brain/app/components/layout/Layout.tsx +1 -1
  55. package/corpus/templates/brain/app/global.css +63 -35
  56. package/corpus/templates/brain/app/routes/search.tsx +1 -1
  57. package/corpus/templates/brain/app/routes/settings.tsx +1 -1
  58. package/corpus/templates/brain/app/routes/sources.tsx +2 -2
  59. package/corpus/templates/brain/changelog/2026-06-29-search-settings-and-source-layouts-adapt-when-the-agent-sidebar.md +6 -0
  60. package/corpus/templates/calendar/app/components/calendar/EventDetailPanel.tsx +4 -4
  61. package/corpus/templates/calendar/app/components/calendar/FindTimePanel.tsx +3 -2
  62. package/corpus/templates/calendar/app/components/layout/AppLayout.tsx +4 -2
  63. package/corpus/templates/calendar/app/global.css +69 -35
  64. package/corpus/templates/calendar/changelog/2026-06-29-event-and-find-time-layouts-adapt-when-the-agent-sidebar-is.md +6 -0
  65. package/corpus/templates/chat/app/components/layout/Layout.tsx +1 -1
  66. package/corpus/templates/chat/app/global.css +35 -35
  67. package/corpus/templates/chat/changelog/2026-06-29-chat-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
  68. package/corpus/templates/clips/AGENTS.md +13 -0
  69. package/corpus/templates/clips/actions/get-screen-memory-status.ts +12 -0
  70. package/corpus/templates/clips/actions/query-screen-memory-context.ts +29 -0
  71. package/corpus/templates/clips/actions/view-screen.ts +2 -2
  72. package/corpus/templates/clips/app/components/library/library-layout.tsx +1 -1
  73. package/corpus/templates/clips/app/global.css +47 -35
  74. package/corpus/templates/clips/app/routes/_app.meetings.$meetingId.tsx +3 -3
  75. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +45 -18
  76. package/corpus/templates/clips/changelog/2026-06-29-meeting-detail-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
  77. package/corpus/templates/clips/changelog/2026-06-29-screen-memory-keeps-a-local-rolling-screen-buffer-for-agent-context.md +5 -0
  78. package/corpus/templates/clips/changelog/2026-06-29-video-chat-is-easier-to-find-on-recording-pages-and-s3-setup.md +6 -0
  79. package/corpus/templates/clips/chrome-extension/src/styles.css +39 -39
  80. package/corpus/templates/clips/desktop/src/app.tsx +290 -1
  81. package/corpus/templates/clips/desktop/src/shared/config.ts +83 -0
  82. package/corpus/templates/clips/desktop/src/styles.css +67 -52
  83. package/corpus/templates/clips/desktop/src-tauri/src/config.rs +50 -0
  84. package/corpus/templates/clips/desktop/src-tauri/src/lib.rs +17 -0
  85. package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +13 -13
  86. package/corpus/templates/clips/desktop/src-tauri/src/screen_memory.rs +990 -0
  87. package/corpus/templates/clips/server/plugins/onboarding.ts +2 -0
  88. package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +3 -3
  89. package/corpus/templates/content/app/components/layout/Layout.tsx +1 -1
  90. package/corpus/templates/content/app/global.css +29 -15
  91. package/corpus/templates/content/changelog/2026-06-29-database-gallery-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
  92. package/corpus/templates/design/.agents/skills/design-generation/SKILL.md +25 -20
  93. package/corpus/templates/design/.agents/skills/design-systems/SKILL.md +8 -0
  94. package/corpus/templates/design/.agents/skills/export-handoff/SKILL.md +8 -0
  95. package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +13 -0
  96. package/corpus/templates/design/AGENTS.md +20 -12
  97. package/corpus/templates/design/CODE_NATIVE_DESIGN_STUDIO_IMPLEMENTATION_PLAN.md +1054 -0
  98. package/corpus/templates/design/actions/apply-visual-edit.ts +24 -4
  99. package/corpus/templates/design/actions/export-coding-handoff.ts +12 -4
  100. package/corpus/templates/design/actions/generate-design.ts +6 -21
  101. package/corpus/templates/design/actions/generate-screens.ts +43 -2
  102. package/corpus/templates/design/actions/get-design.ts +1 -0
  103. package/corpus/templates/design/actions/present-design-variants.ts +355 -30
  104. package/corpus/templates/design/actions/view-screen.ts +75 -31
  105. package/corpus/templates/design/app/components/design/DesignCanvas.tsx +329 -69
  106. package/corpus/templates/design/app/components/design/DesignEditorSkeleton.tsx +1 -1
  107. package/corpus/templates/design/app/components/design/EditPanel.tsx +479 -77
  108. package/corpus/templates/design/app/components/design/LayersPanel.tsx +380 -216
  109. package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +1050 -196
  110. package/corpus/templates/design/app/components/design/QuestionFlow.tsx +83 -206
  111. package/corpus/templates/design/app/components/design/TweaksPanel.tsx +1 -1
  112. package/corpus/templates/design/app/components/design/index.ts +0 -1
  113. package/corpus/templates/design/app/components/design/inspector/AutoLayoutMatrix.tsx +225 -133
  114. package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +122 -11
  115. package/corpus/templates/design/app/components/design/inspector/ExportSettingsPanel.tsx +24 -5
  116. package/corpus/templates/design/app/components/design/inspector/ImageFillControls.tsx +57 -1
  117. package/corpus/templates/design/app/components/design/inspector/ScrubInput.tsx +37 -12
  118. package/corpus/templates/design/app/components/design/inspector/index.ts +1 -0
  119. package/corpus/templates/design/app/components/design/inspector/scrub-input-utils.ts +12 -5
  120. package/corpus/templates/design/app/components/design/types.ts +9 -0
  121. package/corpus/templates/design/app/components/layout/Layout.tsx +23 -5
  122. package/corpus/templates/design/app/global.css +77 -49
  123. package/corpus/templates/design/app/hooks/use-question-flow.ts +2 -2
  124. package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +8 -1
  125. package/corpus/templates/design/app/i18n/zh-TW.ts +3 -0
  126. package/corpus/templates/design/app/i18n-data.ts +45 -3
  127. package/corpus/templates/design/app/pages/DesignEditor.tsx +2602 -657
  128. package/corpus/templates/design/app/root.tsx +1 -1
  129. package/corpus/templates/design/changelog/2026-06-29-containers-no-longer-block-selecting-nested-elements-and-nor.md +6 -0
  130. package/corpus/templates/design/changelog/2026-06-29-design-agents-now-generate-and-refine-variants-from-stronger.md +6 -0
  131. package/corpus/templates/design/changelog/2026-06-29-design-inspector-controls-now-match-figmas-softer-dark-chrome.md +6 -0
  132. package/corpus/templates/design/changelog/2026-06-29-design-questions-now-appear-as-a-cleaner-canvas-intake-with-.md +6 -0
  133. package/corpus/templates/design/changelog/2026-06-29-design-variant-directions-now-appear-as-board-screens-with-chat-buttons.md +5 -0
  134. package/corpus/templates/design/changelog/2026-06-29-element-selection-no-longer-snaps-back-to-the-previous-layer.md +6 -0
  135. package/corpus/templates/design/changelog/2026-06-29-frame-resize-measurements-now-stay-beside-the-cursor-while-d.md +6 -0
  136. package/corpus/templates/design/changelog/2026-06-29-inspector-number-fields-have-cleaner-tooltips-and-draggable-.md +6 -0
  137. package/corpus/templates/design/changelog/2026-06-29-layer-locking-layer-nesting-generated-question-intake-and-im.md +6 -0
  138. package/corpus/templates/design/changelog/2026-06-29-layer-names-in-the-sidebar-can-scroll-horizontally-instead-o.md +6 -0
  139. package/corpus/templates/design/changelog/2026-06-29-layer-nesting-in-the-sidebar-now-uses-tighter-spacing-so-nam.md +6 -0
  140. package/corpus/templates/design/changelog/2026-06-29-layers-no-longer-repeat-document-wrapper-rows-when-a-screen-.md +6 -0
  141. package/corpus/templates/design/changelog/2026-06-29-overview-previews-now-keep-element-hover-and-selection-tied-.md +6 -0
  142. package/corpus/templates/design/changelog/2026-06-29-pressing-escape-now-cancels-a-stuck-screen-drag-in-the-overv.md +6 -0
  143. package/corpus/templates/design/changelog/2026-06-29-screen-overview-is-easier-to-find-and-named-screens-open-dir.md +6 -0
  144. package/corpus/templates/design/changelog/2026-06-29-screen-overview-only-highlights-screens-when-the-frame-or-ti.md +6 -0
  145. package/corpus/templates/design/changelog/2026-06-29-screen-overview-previews-now-resize-to-match-the-selected-de.md +6 -0
  146. package/corpus/templates/design/changelog/2026-06-29-screen-overview-selection-now-uses-a-pointer-cursor-instead-.md +6 -0
  147. package/corpus/templates/design/changelog/2026-06-29-screen-overview-selection-outlines-now-stay-locked-to-the-se.md +6 -0
  148. package/corpus/templates/design/changelog/2026-06-29-screen-overview-zoom-now-reports-real-screen-scale-separatel.md +6 -0
  149. package/corpus/templates/design/changelog/2026-06-29-screen-overview-zooming-feels-smoother-and-selection-outline.md +6 -0
  150. package/corpus/templates/design/changelog/2026-06-29-screen-overview-zooming-now-stays-on-the-overview-canvas-ins.md +6 -0
  151. package/corpus/templates/design/changelog/2026-06-29-selecting-a-nested-layer-from-all-screens-now-keeps-you-in-a.md +6 -0
  152. package/corpus/templates/design/changelog/2026-06-29-share-now-groups-link-sharing-exports-and-agent-handoff.md +6 -0
  153. package/corpus/templates/design/changelog/2026-06-29-the-design-editor-loading-skeleton-now-uses-a-softer-charcoa.md +6 -0
  154. package/corpus/templates/design/changelog/2026-06-29-the-device-preview-menu-now-sits-next-to-the-preview-button-.md +6 -0
  155. package/corpus/templates/design/changelog/2026-06-29-the-inspector-stays-read-only-while-an-empty-design-is-still.md +6 -0
  156. package/corpus/templates/design/changelog/2026-06-29-the-missing-design-view-now-matches-the-rest-of-the-editor-c.md +6 -0
  157. package/corpus/templates/design/changelog/2026-06-29-the-pen-tool-icon-and-tool-option-menus-better-match-the-edi.md +6 -0
  158. package/corpus/templates/design/changelog/2026-06-29-typography-controls-now-keep-the-font-name-visible-and-move-.md +6 -0
  159. package/corpus/templates/design/e2e/README.md +3 -3
  160. package/corpus/templates/design/e2e/global-setup.ts +11 -22
  161. package/corpus/templates/design/e2e/helpers.ts +122 -11
  162. package/corpus/templates/design/playwright.config.ts +9 -3
  163. package/corpus/templates/design/server/lib/coding-handoff.ts +126 -2
  164. package/corpus/templates/design/server/plugins/core-routes.ts +1 -2
  165. package/corpus/templates/design/server/routes/api/design-handoff/[id].zip.get.ts +86 -0
  166. package/corpus/templates/design/shared/code-layer.ts +125 -22
  167. package/corpus/templates/design/shared/generation-session.ts +41 -0
  168. package/corpus/templates/dispatch/app/global.css +79 -35
  169. package/corpus/templates/dispatch/app/routes/integrations.tsx +8 -7
  170. package/corpus/templates/dispatch/changelog/2026-06-29-integration-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
  171. package/corpus/templates/forms/app/components/layout/Layout.tsx +6 -2
  172. package/corpus/templates/forms/app/global.css +64 -35
  173. package/corpus/templates/forms/app/pages/FormsListPage.tsx +2 -2
  174. package/corpus/templates/forms/app/pages/ResponseInsightsPage.tsx +3 -3
  175. package/corpus/templates/forms/changelog/2026-06-29-form-list-and-insight-layouts-adapt-when-the-agent-sidebar.md +6 -0
  176. package/corpus/templates/macros/app/components/layout/AppLayout.tsx +3 -1
  177. package/corpus/templates/macros/app/global.css +25 -9
  178. package/corpus/templates/macros/changelog/2026-06-29-macro-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
  179. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +6 -2
  180. package/corpus/templates/mail/app/global.css +42 -36
  181. package/corpus/templates/mail/app/pages/InboxPage.tsx +1 -1
  182. package/corpus/templates/mail/changelog/2026-06-29-the-contact-panel-now-adapts-to-the-available-mail-pane-width.md +6 -0
  183. package/corpus/templates/plan/app/components/layout/Layout.tsx +3 -1
  184. package/corpus/templates/plan/app/components/plan/DocumentArea.tsx +6 -7
  185. package/corpus/templates/plan/app/global.css +74 -42
  186. package/corpus/templates/plan/changelog/2026-06-29-plan-document-blocks-adapt-to-the-available-document-width.md +6 -0
  187. package/corpus/templates/plan/changelog/2026-06-29-plan-titles-and-summaries-can-be-edited-inline-without-focus.md +6 -0
  188. package/corpus/templates/slides/app/components/layout/Layout.tsx +3 -1
  189. package/corpus/templates/slides/app/global.css +49 -33
  190. package/corpus/templates/slides/changelog/2026-06-29-slide-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
  191. package/corpus/templates/videos/app/components/layout/Layout.tsx +3 -1
  192. package/corpus/templates/videos/app/global.css +35 -35
  193. package/corpus/templates/videos/changelog/2026-06-29-video-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
  194. package/dist/cli/mcp.d.ts.map +1 -1
  195. package/dist/cli/mcp.js +10 -0
  196. package/dist/cli/mcp.js.map +1 -1
  197. package/dist/cli/skills.d.ts.map +1 -1
  198. package/dist/cli/skills.js +58 -12
  199. package/dist/cli/skills.js.map +1 -1
  200. package/dist/client/error-format.d.ts.map +1 -1
  201. package/dist/client/error-format.js +17 -0
  202. package/dist/client/error-format.js.map +1 -1
  203. package/dist/client/extensions/ExtensionViewer.d.ts.map +1 -1
  204. package/dist/client/extensions/ExtensionViewer.js +3 -4
  205. package/dist/client/extensions/ExtensionViewer.js.map +1 -1
  206. package/dist/client/guided-questions.d.ts +4 -0
  207. package/dist/client/guided-questions.d.ts.map +1 -1
  208. package/dist/client/guided-questions.js +16 -7
  209. package/dist/client/guided-questions.js.map +1 -1
  210. package/dist/client/onboarding/OnboardingPanel.js +26 -1
  211. package/dist/client/onboarding/OnboardingPanel.js.map +1 -1
  212. package/dist/client/resources/BuiltinCapabilityDetail.d.ts.map +1 -1
  213. package/dist/client/resources/BuiltinCapabilityDetail.js +1 -1
  214. package/dist/client/resources/BuiltinCapabilityDetail.js.map +1 -1
  215. package/dist/client/resources/use-builtin-capabilities.d.ts +1 -1
  216. package/dist/client/resources/use-builtin-capabilities.d.ts.map +1 -1
  217. package/dist/client/resources/use-builtin-capabilities.js +2 -1
  218. package/dist/client/resources/use-builtin-capabilities.js.map +1 -1
  219. package/dist/client/session-replay.d.ts.map +1 -1
  220. package/dist/client/session-replay.js +31 -0
  221. package/dist/client/session-replay.js.map +1 -1
  222. package/dist/client/sharing/ShareButton.d.ts +14 -0
  223. package/dist/client/sharing/ShareButton.d.ts.map +1 -1
  224. package/dist/client/sharing/ShareButton.js +36 -7
  225. package/dist/client/sharing/ShareButton.js.map +1 -1
  226. package/dist/coding-tools/index.js +1 -1
  227. package/dist/coding-tools/index.js.map +1 -1
  228. package/dist/collab/routes.d.ts +1 -1
  229. package/dist/file-upload/actions/upload-image.d.ts +2 -2
  230. package/dist/mcp/index.d.ts +2 -0
  231. package/dist/mcp/index.d.ts.map +1 -1
  232. package/dist/mcp/index.js +1 -0
  233. package/dist/mcp/index.js.map +1 -1
  234. package/dist/mcp/screen-memory-stdio.d.ts +6 -0
  235. package/dist/mcp/screen-memory-stdio.d.ts.map +1 -0
  236. package/dist/mcp/screen-memory-stdio.js +213 -0
  237. package/dist/mcp/screen-memory-stdio.js.map +1 -0
  238. package/dist/mcp-client/builtin-capabilities.d.ts +1 -1
  239. package/dist/mcp-client/builtin-capabilities.d.ts.map +1 -1
  240. package/dist/mcp-client/builtin-capabilities.js +10 -0
  241. package/dist/mcp-client/builtin-capabilities.js.map +1 -1
  242. package/dist/mcp-client/index.d.ts +1 -0
  243. package/dist/mcp-client/index.d.ts.map +1 -1
  244. package/dist/mcp-client/index.js +1 -0
  245. package/dist/mcp-client/index.js.map +1 -1
  246. package/dist/mcp-client/screen-memory-local.d.ts +61 -0
  247. package/dist/mcp-client/screen-memory-local.d.ts.map +1 -0
  248. package/dist/mcp-client/screen-memory-local.js +336 -0
  249. package/dist/mcp-client/screen-memory-local.js.map +1 -0
  250. package/dist/notifications/routes.d.ts +2 -2
  251. package/dist/observability/routes.d.ts +8 -8
  252. package/dist/onboarding/types.d.ts +7 -0
  253. package/dist/onboarding/types.d.ts.map +1 -1
  254. package/dist/onboarding/types.js.map +1 -1
  255. package/dist/resources/handlers.d.ts +2 -2
  256. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  257. package/dist/server/agent-chat-plugin.js +26 -0
  258. package/dist/server/agent-chat-plugin.js.map +1 -1
  259. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  260. package/dist/server/agents-bundle.d.ts.map +1 -1
  261. package/dist/server/agents-bundle.js +22 -7
  262. package/dist/server/agents-bundle.js.map +1 -1
  263. package/dist/server/transcribe-voice.d.ts +1 -1
  264. package/dist/styles/agent-native.css +5 -0
  265. package/dist/templates/default/app/global.css +35 -35
  266. package/docs/content/locales/ar-SA/template-design.mdx +6 -0
  267. package/docs/content/locales/de-DE/template-design.mdx +8 -0
  268. package/docs/content/locales/es-ES/template-design.mdx +10 -2
  269. package/docs/content/locales/fr-FR/template-design.mdx +10 -2
  270. package/docs/content/locales/hi-IN/template-design.mdx +7 -0
  271. package/docs/content/locales/ja-JP/template-design.mdx +7 -0
  272. package/docs/content/locales/ko-KR/template-design.mdx +7 -0
  273. package/docs/content/locales/pt-BR/template-design.mdx +9 -2
  274. package/docs/content/locales/zh-CN/template-design.mdx +6 -0
  275. package/docs/content/locales/zh-TW/template-design.mdx +6 -0
  276. package/docs/content/template-design.mdx +9 -2
  277. package/package.json +1 -1
  278. package/src/templates/default/app/global.css +35 -35
  279. package/corpus/templates/design/app/components/design/VariantGrid.tsx +0 -189
  280. package/corpus/templates/design/app/components/design/VariantHandoffCard.tsx +0 -115
  281. package/corpus/templates/design/app/hooks/use-variant-flow.ts +0 -342
@@ -570,7 +570,7 @@ function FormMethod({
570
570
  method: Extract<OnboardingMethod, { kind: "form" }>;
571
571
  onCompleted: () => Promise<void>;
572
572
  }) {
573
- const { fields, writeScope } = method.payload;
573
+ const { fields, writeScope, saveTo, secretDescription } = method.payload;
574
574
  const [values, setValues] = useState<Record<string, string>>({});
575
575
  const [saving, setSaving] = useState(false);
576
576
  const [err, setErr] = useState<string | null>(null);
@@ -587,6 +587,38 @@ function FormMethod({
587
587
  setErr("Enter a value first.");
588
588
  return;
589
589
  }
590
+ if (saveTo === "scoped-secrets") {
591
+ const secretScope =
592
+ writeScope === "workspace" || writeScope === "app"
593
+ ? "workspace"
594
+ : "user";
595
+ for (const entry of vars) {
596
+ const res = await fetch(
597
+ agentNativePath("/_agent-native/secrets/adhoc"),
598
+ {
599
+ method: "POST",
600
+ headers: { "Content-Type": "application/json" },
601
+ body: JSON.stringify({
602
+ name: entry.key,
603
+ value: entry.value,
604
+ scope: secretScope,
605
+ description:
606
+ secretDescription ?? method.description ?? "Setup key",
607
+ }),
608
+ },
609
+ );
610
+ if (!res.ok) {
611
+ const data = await res.json().catch(() => ({}));
612
+ throw new Error(
613
+ (data as { error?: string }).error ??
614
+ `Save failed: ${res.status}`,
615
+ );
616
+ }
617
+ }
618
+ setValues({});
619
+ await onCompleted();
620
+ return;
621
+ }
590
622
  const res = await fetch(agentNativePath("/_agent-native/env-vars"), {
591
623
  method: "POST",
592
624
  headers: { "Content-Type": "application/json" },
@@ -151,6 +151,14 @@ export function BuiltinCapabilityDetail({
151
151
  existing login.
152
152
  </p>
153
153
  )}
154
+
155
+ {capability.id === "screen-memory" && (
156
+ <p className="mt-6 rounded-md border border-border bg-muted/40 p-2.5 text-[11px] leading-relaxed text-muted-foreground">
157
+ Screen Memory only reads local Clips desktop context on this
158
+ machine. Turn it on from Clips desktop Settings before expecting
159
+ recent context results.
160
+ </p>
161
+ )}
154
162
  </div>
155
163
  </div>
156
164
  );
@@ -6,7 +6,8 @@ import type { McpServerScope } from "./use-mcp-servers.js";
6
6
  export type BuiltinCapabilityId =
7
7
  | "browser-chrome-devtools"
8
8
  | "browser-playwright"
9
- | "computer-use";
9
+ | "computer-use"
10
+ | "screen-memory";
10
11
 
11
12
  export interface BuiltinCapability {
12
13
  id: BuiltinCapabilityId;
@@ -103,7 +104,8 @@ export function parseMcpBuiltinVirtualId(
103
104
  if (
104
105
  capabilityId !== "browser-chrome-devtools" &&
105
106
  capabilityId !== "browser-playwright" &&
106
- capabilityId !== "computer-use"
107
+ capabilityId !== "computer-use" &&
108
+ capabilityId !== "screen-memory"
107
109
  ) {
108
110
  return null;
109
111
  }
@@ -191,6 +191,7 @@ const DEFAULT_FLUSH_INTERVAL_MS = 5000;
191
191
  const DEFAULT_MAX_DURATION_MS = 30 * 60 * 1000;
192
192
  const DEFAULT_MAX_EVENTS_PER_BATCH = 50;
193
193
  const DEFAULT_MAX_BATCH_BYTES = 256 * 1024;
194
+ const MAX_KEEPALIVE_REPLAY_UPLOAD_BYTES = 60 * 1024;
194
195
  const URL_LIKE_KEYS = new Set([
195
196
  "url",
196
197
  "uri",
@@ -729,6 +730,24 @@ interface ReplayUploadBody {
729
730
  compressed: boolean;
730
731
  }
731
732
 
733
+ function isCrossOriginReplayEndpoint(endpoint: string): boolean {
734
+ if (typeof window === "undefined") return false;
735
+ try {
736
+ return (
737
+ new URL(endpoint, window.location.href).origin !== window.location.origin
738
+ );
739
+ } catch {
740
+ return false;
741
+ }
742
+ }
743
+
744
+ function replayUploadByteLength(body: string): number {
745
+ if (typeof TextEncoder !== "undefined") {
746
+ return new TextEncoder().encode(body).byteLength;
747
+ }
748
+ return body.length;
749
+ }
750
+
732
751
  async function gzipReplayBody(body: string): Promise<Blob | null> {
733
752
  if (
734
753
  typeof CompressionStream === "undefined" ||
@@ -773,6 +792,21 @@ async function sendReplayUpload(
773
792
  options: NormalizedSessionReplayOptions,
774
793
  body: string,
775
794
  ): Promise<void> {
795
+ if (isCrossOriginReplayEndpoint(options.endpoint)) {
796
+ if (navigator.sendBeacon) {
797
+ const sent = navigator.sendBeacon(options.endpoint, body);
798
+ if (sent) return;
799
+ }
800
+ await fetch(options.endpoint, {
801
+ method: "POST",
802
+ body,
803
+ keepalive:
804
+ replayUploadByteLength(body) <= MAX_KEEPALIVE_REPLAY_UPLOAD_BYTES,
805
+ headers: { "Content-Type": "text/plain;charset=UTF-8" },
806
+ }).catch(() => {});
807
+ return;
808
+ }
809
+
776
810
  const upload = await buildReplayUploadBody(body);
777
811
  if (!upload.compressed && navigator.sendBeacon) {
778
812
  const sent = navigator.sendBeacon(options.endpoint, body);
@@ -109,6 +109,20 @@ export interface ShareButtonProps {
109
109
  description?: ReactNode;
110
110
  onCheckedChange: (checked: boolean) => void | Promise<void>;
111
111
  };
112
+ /** Optional extra tabs rendered beside the default sharing/access panel. */
113
+ shareTabs?: {
114
+ shareLabel?: ReactNode;
115
+ defaultValue?: string;
116
+ tabs: Array<{
117
+ value: string;
118
+ label: ReactNode;
119
+ content: ReactNode;
120
+ disabled?: boolean;
121
+ }>;
122
+ onValueChange?: (value: string) => void;
123
+ };
124
+ /** Optional className for the popover content, useful for wider custom tabs. */
125
+ popoverClassName?: string;
112
126
  }
113
127
 
114
128
  type Visibility = "private" | "org" | "public";
@@ -213,6 +227,8 @@ const ROLE_OPTIONS: Array<{ value: Role; label: string; description: string }> =
213
227
  */
214
228
  export function ShareButton(props: ShareButtonProps) {
215
229
  const [open, setOpen] = useState(false);
230
+ const shareTabDefaultValue = props.shareTabs?.defaultValue ?? "share";
231
+ const [activeShareTab, setActiveShareTab] = useState(shareTabDefaultValue);
216
232
  const [pendingVisibility, setPendingVisibility] = useState<Visibility | null>(
217
233
  null,
218
234
  );
@@ -238,7 +254,16 @@ export function ShareButton(props: ShareButtonProps) {
238
254
  const handleOpenChange = (v: boolean) => {
239
255
  setOpen(v);
240
256
  props.onOpenChange?.(v);
241
- if (v && pendingVisibility === null) sharesQuery.refetch();
257
+ if (v) {
258
+ setActiveShareTab(shareTabDefaultValue);
259
+ props.shareTabs?.onValueChange?.(shareTabDefaultValue);
260
+ if (pendingVisibility === null) sharesQuery.refetch();
261
+ }
262
+ };
263
+
264
+ const handleShareTabChange = (value: string) => {
265
+ setActiveShareTab(value);
266
+ props.shareTabs?.onValueChange?.(value);
242
267
  };
243
268
 
244
269
  useEffect(() => {
@@ -322,6 +347,7 @@ export function ShareButton(props: ShareButtonProps) {
322
347
  className={cn(
323
348
  "z-[2000] w-[min(460px,92vw)] rounded-lg p-4 shadow-lg",
324
349
  SHARE_POPOVER_SURFACE,
350
+ props.popoverClassName,
325
351
  )}
326
352
  onOpenAutoFocus={(e) => e.preventDefault()}
327
353
  >
@@ -331,6 +357,8 @@ export function ShareButton(props: ShareButtonProps) {
331
357
  visibilityOverride={pendingVisibility}
332
358
  onVisibilityChange={handleVisibilityChange}
333
359
  onClose={() => handleOpenChange(false)}
360
+ activeTab={activeShareTab}
361
+ onTabChange={handleShareTabChange}
334
362
  />
335
363
  </PopoverContent>
336
364
  </Popover>
@@ -505,6 +533,8 @@ function SharePanel(
505
533
  visibilityOverride: Visibility | null;
506
534
  onVisibilityChange: (visibility: Visibility) => Promise<void>;
507
535
  onClose: () => void;
536
+ activeTab: string;
537
+ onTabChange: (value: string) => void;
508
538
  },
509
539
  ) {
510
540
  const {
@@ -596,6 +626,9 @@ function SharePanel(
596
626
  Boolean(props.shareUrlPlaceholder) ||
597
627
  Boolean(props.secondaryShareUrl);
598
628
  const shareUrlPlacement = props.shareUrlPlacement ?? "bottom";
629
+ const extraTabs = props.shareTabs?.tabs ?? [];
630
+ const hasTabs = extraTabs.length > 0;
631
+ const shareTabLabel = props.shareTabs?.shareLabel ?? "Share link";
599
632
 
600
633
  const serverShares = data?.shares ?? [];
601
634
  const shares: Share[] = [
@@ -773,34 +806,37 @@ function SharePanel(
773
806
  ? `Share "${resourceTitle}"`
774
807
  : `Share ${resourceType}`;
775
808
 
776
- if (isLoading) {
777
- return (
778
- <div>
809
+ const sharePanel = isLoading ? (
810
+ <div>
811
+ {!hasTabs ? (
779
812
  <div
780
813
  className="mb-3 truncate text-base font-semibold"
781
814
  title={titleText}
782
815
  >
783
816
  {titleText}
784
817
  </div>
785
- <div className="mb-4 h-9 rounded-md bg-muted animate-pulse" />
786
- <div className="mb-2 text-sm font-semibold">{peopleAccessLabel}</div>
787
- <div className="mb-4 h-7 rounded-md bg-muted animate-pulse" />
788
- <div className="mb-2 text-sm font-semibold">{generalAccessLabel}</div>
789
- <div className="mb-4 h-9 rounded-md bg-muted animate-pulse" />
790
- <div className="mt-2 flex justify-end">
791
- <button type="button" onClick={onClose} className={BUTTON_PRIMARY_SM}>
792
- Done
793
- </button>
794
- </div>
818
+ ) : null}
819
+ <div className="mb-4 h-9 rounded-md bg-muted animate-pulse" />
820
+ <div className="mb-2 text-sm font-semibold">{peopleAccessLabel}</div>
821
+ <div className="mb-4 h-7 rounded-md bg-muted animate-pulse" />
822
+ <div className="mb-2 text-sm font-semibold">{generalAccessLabel}</div>
823
+ <div className="mb-4 h-9 rounded-md bg-muted animate-pulse" />
824
+ <div className="mt-2 flex justify-end">
825
+ <button type="button" onClick={onClose} className={BUTTON_PRIMARY_SM}>
826
+ Done
827
+ </button>
795
828
  </div>
796
- );
797
- }
798
-
799
- return (
829
+ </div>
830
+ ) : (
800
831
  <div>
801
- <div className="mb-3 truncate text-base font-semibold" title={titleText}>
802
- {titleText}
803
- </div>
832
+ {!hasTabs ? (
833
+ <div
834
+ className="mb-3 truncate text-base font-semibold"
835
+ title={titleText}
836
+ >
837
+ {titleText}
838
+ </div>
839
+ ) : null}
804
840
 
805
841
  {showShareLinks && shareUrlPlacement === "top" ? shareLinks : null}
806
842
 
@@ -965,6 +1001,55 @@ function SharePanel(
965
1001
  </div>
966
1002
  </div>
967
1003
  );
1004
+
1005
+ if (!hasTabs) return sharePanel;
1006
+
1007
+ const tabs = [
1008
+ {
1009
+ value: "share",
1010
+ label: shareTabLabel,
1011
+ content: sharePanel,
1012
+ disabled: false,
1013
+ },
1014
+ ...extraTabs,
1015
+ ];
1016
+ const activeTab = tabs.some((tab) => tab.value === props.activeTab)
1017
+ ? props.activeTab
1018
+ : "share";
1019
+
1020
+ return (
1021
+ <div className="flex flex-col gap-4">
1022
+ <div
1023
+ role="tablist"
1024
+ aria-label="Share options"
1025
+ className="flex gap-1 rounded-xl bg-muted/70 p-1"
1026
+ >
1027
+ {tabs.map((tab) => {
1028
+ const active = tab.value === activeTab;
1029
+ return (
1030
+ <button
1031
+ key={tab.value}
1032
+ type="button"
1033
+ role="tab"
1034
+ aria-selected={active}
1035
+ disabled={tab.disabled}
1036
+ onClick={() => props.onTabChange(tab.value)}
1037
+ className={cn(
1038
+ "h-11 min-w-0 flex-1 rounded-lg px-3 text-sm font-medium text-muted-foreground transition-colors hover:bg-background/70 hover:text-foreground disabled:pointer-events-none disabled:opacity-50",
1039
+ active &&
1040
+ "bg-background text-foreground shadow-sm ring-2 ring-primary",
1041
+ )}
1042
+ >
1043
+ <span className="block truncate">{tab.label}</span>
1044
+ </button>
1045
+ );
1046
+ })}
1047
+ </div>
1048
+ <div role="tabpanel">
1049
+ {tabs.find((tab) => tab.value === activeTab)?.content}
1050
+ </div>
1051
+ </div>
1052
+ );
968
1053
  }
969
1054
 
970
1055
  function AdvancedAccessPopover({
@@ -481,7 +481,7 @@ export async function runCodingCommand(
481
481
  else child.stdin?.end();
482
482
  const code = await new Promise<number | null>((resolve, reject) => {
483
483
  child.once("error", reject);
484
- child.once("exit", resolve);
484
+ child.once("close", resolve);
485
485
  });
486
486
  clearTimeout(timer);
487
487
  return { code, stdout, stderr, timedOut, durationMs: Date.now() - startMs };
@@ -14,6 +14,8 @@ export type { MCPCallerIdentity, MCPRequestMeta } from "./build-server.js";
14
14
  // stdio transport for `agent-native mcp serve` (Node-only).
15
15
  export { runMCPStdio } from "./stdio.js";
16
16
  export type { RunMCPStdioOptions } from "./stdio.js";
17
+ export { runScreenMemoryMCPStdio } from "./screen-memory-stdio.js";
18
+ export type { RunScreenMemoryMCPStdioOptions } from "./screen-memory-stdio.js";
17
19
 
18
20
  // Generic cross-app builtin tools (merged into the registry, template wins).
19
21
  export { getBuiltinCrossAppTools } from "./builtin-tools.js";
@@ -0,0 +1,290 @@
1
+ import fs from "node:fs";
2
+ import os from "node:os";
3
+ import path from "node:path";
4
+
5
+ interface ScreenMemoryEvent {
6
+ capturedAt: string;
7
+ appName?: string | null;
8
+ windowTitle?: string | null;
9
+ bundleId?: string | null;
10
+ source: string;
11
+ }
12
+
13
+ interface ScreenMemorySegment {
14
+ id: string;
15
+ startedAt: string;
16
+ endedAt: string;
17
+ path: string;
18
+ fileName?: string;
19
+ mimeType: string;
20
+ bytes: number;
21
+ durationMs: number;
22
+ corrupt?: boolean;
23
+ }
24
+
25
+ interface ScreenMemoryConfig {
26
+ enabled?: boolean;
27
+ paused?: boolean;
28
+ retentionHours?: number;
29
+ maxBytes?: number;
30
+ }
31
+
32
+ export interface RunScreenMemoryMCPStdioOptions {
33
+ storeDir?: string;
34
+ env?: NodeJS.ProcessEnv;
35
+ }
36
+
37
+ const EVENTS_JSONL = "events.jsonl";
38
+
39
+ function log(msg: string): void {
40
+ process.stderr.write(`[screen-memory-mcp] ${msg}\n`);
41
+ }
42
+
43
+ function defaultAppDataDir(env: NodeJS.ProcessEnv): string {
44
+ const home = os.homedir();
45
+ if (process.platform === "darwin") {
46
+ return path.join(home, "Library", "Application Support", "com.clips.tray");
47
+ }
48
+ if (process.platform === "win32") {
49
+ return path.join(
50
+ env.APPDATA || path.join(home, "AppData", "Roaming"),
51
+ "com.clips.tray",
52
+ );
53
+ }
54
+ return path.join(
55
+ env.XDG_DATA_HOME || path.join(home, ".local", "share"),
56
+ "com.clips.tray",
57
+ );
58
+ }
59
+
60
+ function defaultStoreDir(env: NodeJS.ProcessEnv): string {
61
+ const envDir =
62
+ env.AGENT_NATIVE_SCREEN_MEMORY_DIR ?? env.CLIPS_SCREEN_MEMORY_DIR;
63
+ if (envDir) return envDir;
64
+ return path.join(defaultAppDataDir(env), "screen-memory");
65
+ }
66
+
67
+ function readJsonl<T>(file: string): T[] {
68
+ let body = "";
69
+ try {
70
+ body = fs.readFileSync(file, "utf-8");
71
+ } catch {
72
+ return [];
73
+ }
74
+ return body
75
+ .split(/\r?\n/)
76
+ .filter(Boolean)
77
+ .map((line) => {
78
+ try {
79
+ return JSON.parse(line) as T;
80
+ } catch {
81
+ return null;
82
+ }
83
+ })
84
+ .filter((value): value is T => Boolean(value));
85
+ }
86
+
87
+ function readFeatureConfig(storeDir: string): ScreenMemoryConfig {
88
+ const configPath = path.join(path.dirname(storeDir), "feature-config.json");
89
+ try {
90
+ const parsed = JSON.parse(fs.readFileSync(configPath, "utf-8")) as {
91
+ screenMemory?: ScreenMemoryConfig;
92
+ };
93
+ return parsed.screenMemory ?? {};
94
+ } catch {
95
+ return {};
96
+ }
97
+ }
98
+
99
+ function cutoffFor(minutes: number): number {
100
+ return Date.now() - Math.max(1, Math.min(minutes, 24 * 60)) * 60_000;
101
+ }
102
+
103
+ function eventMatches(event: ScreenMemoryEvent, query: string): boolean {
104
+ const needle = query.trim().toLowerCase();
105
+ if (!needle) return true;
106
+ return [event.appName, event.windowTitle, event.bundleId, event.source].some(
107
+ (value) => value?.toLowerCase().includes(needle),
108
+ );
109
+ }
110
+
111
+ function recentEvents(
112
+ storeDir: string,
113
+ args: { query?: string; minutes?: number; limit?: number },
114
+ ): ScreenMemoryEvent[] {
115
+ const cutoff = cutoffFor(args.minutes ?? 30);
116
+ const limit = Math.max(1, Math.min(args.limit ?? 40, 200));
117
+ return readJsonl<ScreenMemoryEvent>(path.join(storeDir, EVENTS_JSONL))
118
+ .filter((event) => {
119
+ const capturedAt = Date.parse(event.capturedAt);
120
+ return Number.isFinite(capturedAt) && capturedAt >= cutoff;
121
+ })
122
+ .filter((event) => eventMatches(event, args.query ?? ""))
123
+ .sort((a, b) => b.capturedAt.localeCompare(a.capturedAt))
124
+ .slice(0, limit);
125
+ }
126
+
127
+ function readSegments(storeDir: string): ScreenMemorySegment[] {
128
+ let entries: string[] = [];
129
+ try {
130
+ entries = fs.readdirSync(storeDir);
131
+ } catch {
132
+ return [];
133
+ }
134
+ return entries
135
+ .filter((entry) => entry.endsWith(".json"))
136
+ .map((entry) => {
137
+ try {
138
+ return JSON.parse(
139
+ fs.readFileSync(path.join(storeDir, entry), "utf-8"),
140
+ ) as ScreenMemorySegment;
141
+ } catch {
142
+ return null;
143
+ }
144
+ })
145
+ .filter((segment): segment is ScreenMemorySegment => Boolean(segment));
146
+ }
147
+
148
+ function recentSegments(
149
+ storeDir: string,
150
+ minutes: number,
151
+ ): ScreenMemorySegment[] {
152
+ const cutoff = cutoffFor(minutes);
153
+ return readSegments(storeDir)
154
+ .filter((segment) => {
155
+ const endedAt = Date.parse(segment.endedAt);
156
+ return (
157
+ Number.isFinite(endedAt) &&
158
+ endedAt >= cutoff &&
159
+ typeof segment.path === "string" &&
160
+ fs.existsSync(segment.path) &&
161
+ segment.corrupt !== true
162
+ );
163
+ })
164
+ .sort((a, b) => b.endedAt.localeCompare(a.endedAt));
165
+ }
166
+
167
+ function textResult(value: unknown) {
168
+ return {
169
+ content: [
170
+ {
171
+ type: "text" as const,
172
+ text:
173
+ typeof value === "string" ? value : JSON.stringify(value, null, 2),
174
+ },
175
+ ],
176
+ };
177
+ }
178
+
179
+ export async function runScreenMemoryMCPStdio(
180
+ opts: RunScreenMemoryMCPStdioOptions = {},
181
+ ): Promise<void> {
182
+ const env = opts.env ?? process.env;
183
+ const storeDir = opts.storeDir ?? defaultStoreDir(env);
184
+
185
+ const { Server } = await import("@modelcontextprotocol/sdk/server/index.js");
186
+ const { StdioServerTransport } =
187
+ await import("@modelcontextprotocol/sdk/server/stdio.js");
188
+ const { CallToolRequestSchema, ListToolsRequestSchema } =
189
+ await import("@modelcontextprotocol/sdk/types.js");
190
+
191
+ const server = new Server(
192
+ { name: "clips-screen-memory", version: "0.1.0" },
193
+ { capabilities: { tools: {} } },
194
+ );
195
+
196
+ server.setRequestHandler(ListToolsRequestSchema, async () => ({
197
+ tools: [
198
+ {
199
+ name: "screen_memory_status",
200
+ description:
201
+ "Read local Clips Screen Memory status, retention, disk usage, and store path. Local-only.",
202
+ inputSchema: { type: "object", properties: {} },
203
+ },
204
+ {
205
+ name: "screen_memory_recent_context",
206
+ description:
207
+ "Search recent local Screen Memory app/window context. Returns timestamps, app names, window titles, and bundle ids; does not return images.",
208
+ inputSchema: {
209
+ type: "object",
210
+ properties: {
211
+ query: {
212
+ type: "string",
213
+ description: "Optional case-insensitive text filter.",
214
+ },
215
+ minutes: {
216
+ type: "number",
217
+ description: "Lookback window in minutes. Defaults to 30.",
218
+ },
219
+ limit: {
220
+ type: "number",
221
+ description: "Maximum events to return. Defaults to 40.",
222
+ },
223
+ },
224
+ },
225
+ },
226
+ {
227
+ name: "screen_memory_recent_segments",
228
+ description:
229
+ "List recent local Screen Memory video segment file paths and timestamps. Use only when the user asks to inspect or export local context.",
230
+ inputSchema: {
231
+ type: "object",
232
+ properties: {
233
+ minutes: {
234
+ type: "number",
235
+ description: "Lookback window in minutes. Defaults to 30.",
236
+ },
237
+ },
238
+ },
239
+ },
240
+ ],
241
+ }));
242
+
243
+ server.setRequestHandler(CallToolRequestSchema, async (request: any) => {
244
+ const name = request.params?.name;
245
+ const args = (request.params?.arguments ?? {}) as Record<string, unknown>;
246
+ if (name === "screen_memory_status") {
247
+ const config = readFeatureConfig(storeDir);
248
+ const segments = recentSegments(storeDir, 24 * 60);
249
+ return textResult({
250
+ enabled: config.enabled === true,
251
+ paused: config.paused === true,
252
+ retentionHours: config.retentionHours ?? 24,
253
+ maxBytes: config.maxBytes ?? 20 * 1024 * 1024 * 1024,
254
+ segmentCount: segments.length,
255
+ totalBytes: segments.reduce(
256
+ (sum, segment) => sum + (segment.bytes || 0),
257
+ 0,
258
+ ),
259
+ storeDir,
260
+ });
261
+ }
262
+ if (name === "screen_memory_recent_context") {
263
+ return textResult({
264
+ storeDir,
265
+ events: recentEvents(storeDir, {
266
+ query: typeof args.query === "string" ? args.query : undefined,
267
+ minutes: typeof args.minutes === "number" ? args.minutes : undefined,
268
+ limit: typeof args.limit === "number" ? args.limit : undefined,
269
+ }),
270
+ });
271
+ }
272
+ if (name === "screen_memory_recent_segments") {
273
+ const minutes = typeof args.minutes === "number" ? args.minutes : 30;
274
+ return textResult({
275
+ storeDir,
276
+ segments: recentSegments(storeDir, minutes),
277
+ });
278
+ }
279
+ throw new Error(`Unknown Screen Memory tool: ${name}`);
280
+ });
281
+
282
+ log(`Serving local Screen Memory from ${storeDir}`);
283
+ const transport = new StdioServerTransport();
284
+ await server.connect(transport);
285
+ await new Promise<void>((resolve) => {
286
+ transport.onclose = resolve;
287
+ process.once("SIGINT", resolve);
288
+ process.once("SIGTERM", resolve);
289
+ });
290
+ }
@@ -3,7 +3,8 @@ import type { McpStdioServerConfig } from "./config.js";
3
3
  export type BuiltinMcpCapabilityId =
4
4
  | "browser-chrome-devtools"
5
5
  | "browser-playwright"
6
- | "computer-use";
6
+ | "computer-use"
7
+ | "screen-memory";
7
8
 
8
9
  export interface BuiltinMcpCapability {
9
10
  id: BuiltinMcpCapabilityId;
@@ -53,6 +54,17 @@ export const BUILTIN_MCP_CAPABILITIES: BuiltinMcpCapability[] = [
53
54
  args: ["-y", "computer-use-mcp@1.8.0"],
54
55
  platforms: ["darwin"],
55
56
  },
57
+ {
58
+ id: "screen-memory",
59
+ serverId: "screen-memory",
60
+ name: "Screen Memory",
61
+ description: "Query local Clips Screen Memory context from this machine.",
62
+ command: "agent-native",
63
+ args: ["mcp", "screen-memory"],
64
+ platforms: ["darwin"],
65
+ notes:
66
+ "Requires Clips desktop Screen Memory to be enabled. Local-only and disabled by default.",
67
+ },
56
68
  ];
57
69
 
58
70
  const CAPABILITY_BY_ID = new Map(
@@ -81,6 +81,15 @@ export { fetchHubServers } from "./hub-client.js";
81
81
 
82
82
  export { isMcpToolAllowedForRequest } from "./visibility.js";
83
83
  import { isMcpToolAllowedForRequest } from "./visibility.js";
84
+ export {
85
+ configureScreenMemory,
86
+ queryScreenMemoryContext,
87
+ readScreenMemoryStatus,
88
+ type ScreenMemoryConfig,
89
+ type ScreenMemoryContextItem,
90
+ type ScreenMemoryQueryResult,
91
+ type ScreenMemoryStatus,
92
+ } from "./screen-memory-local.js";
84
93
  export {
85
94
  MCP_ACTION_RESULT_MARKER,
86
95
  isMcpActionResult,