@agent-native/core 0.75.5 → 0.76.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +48 -0
- package/corpus/core/docs/AGENTS.md +1 -0
- package/corpus/core/docs/content/client.md +15 -0
- package/corpus/core/docs/content/internationalization.md +145 -0
- package/corpus/core/docs/content/locales/ar-SA/internationalization.md +102 -0
- package/corpus/core/docs/content/locales/de-DE/internationalization.md +102 -0
- package/corpus/core/docs/content/locales/es-ES/internationalization.md +102 -0
- package/corpus/core/docs/content/locales/fr-FR/internationalization.md +102 -0
- package/corpus/core/docs/content/locales/hi-IN/internationalization.md +102 -0
- package/corpus/core/docs/content/locales/ja-JP/internationalization.md +114 -0
- package/corpus/core/docs/content/locales/ko-KR/internationalization.md +102 -0
- package/corpus/core/docs/content/locales/pt-BR/internationalization.md +102 -0
- package/corpus/core/docs/content/locales/zh-CN/internationalization.md +102 -0
- package/corpus/core/docs/content/skills-guide.md +19 -18
- package/corpus/core/package.json +7 -1
- package/corpus/core/src/agent/durable-background.ts +38 -2
- package/corpus/core/src/agent/production-agent.ts +54 -0
- package/corpus/core/src/agent/run-manager.ts +27 -0
- package/corpus/core/src/agent/run-store.ts +185 -4
- package/corpus/core/src/client/CommandMenu.tsx +16 -0
- package/corpus/core/src/client/app-providers.tsx +26 -1
- package/corpus/core/src/client/i18n.tsx +605 -0
- package/corpus/core/src/client/index.ts +28 -0
- package/corpus/core/src/index.browser.ts +25 -0
- package/corpus/core/src/localization/actions/get-localization-preference.ts +23 -0
- package/corpus/core/src/localization/actions/set-localization-preference.ts +30 -0
- package/corpus/core/src/localization/index.ts +2 -0
- package/corpus/core/src/localization/server.ts +131 -0
- package/corpus/core/src/localization/shared.ts +163 -0
- package/corpus/core/src/server/action-discovery.ts +8 -0
- package/corpus/core/src/server/agent-chat-plugin.ts +71 -0
- package/corpus/core/src/server/auth.ts +13 -0
- package/corpus/core/src/server/index.ts +8 -0
- package/corpus/core/src/templates/default/.agents/skills/adding-a-feature/SKILL.md +5 -0
- package/corpus/core/src/templates/default/.agents/skills/internationalization/SKILL.md +77 -0
- package/corpus/core/src/templates/default/.agents/skills/self-modifying-code/SKILL.md +6 -0
- package/corpus/core/src/templates/default/AGENTS.md +16 -15
- package/corpus/core/src/templates/default/app/i18n/en-US.ts +29 -0
- package/corpus/core/src/templates/default/app/i18n/index.ts +13 -0
- package/corpus/core/src/templates/default/app/root.tsx +20 -1
- package/corpus/core/src/templates/default/app/routes/_index.tsx +24 -9
- package/corpus/core/src/templates/default/app/routes/settings.tsx +67 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +5 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/internationalization/SKILL.md +77 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +6 -0
- package/corpus/core/src/vite/action-types-plugin.ts +10 -0
- package/corpus/templates/analytics/.agents/skills/self-modifying-code/SKILL.md +6 -0
- package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +12 -12
- package/corpus/templates/analytics/app/components/layout/Header.tsx +18 -15
- package/corpus/templates/analytics/app/components/layout/Layout.tsx +7 -5
- package/corpus/templates/analytics/app/components/layout/MobileNav.tsx +9 -3
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +28 -26
- package/corpus/templates/analytics/app/i18n/ar-SA.ts +3 -0
- package/corpus/templates/analytics/app/i18n/de-DE.ts +3 -0
- package/corpus/templates/analytics/app/i18n/en-US.ts +3 -0
- package/corpus/templates/analytics/app/i18n/es-ES.ts +3 -0
- package/corpus/templates/analytics/app/i18n/fr-FR.ts +3 -0
- package/corpus/templates/analytics/app/i18n/hi-IN.ts +3 -0
- package/corpus/templates/analytics/app/i18n/index.ts +31 -0
- package/corpus/templates/analytics/app/i18n/ja-JP.ts +3 -0
- package/corpus/templates/analytics/app/i18n/ko-KR.ts +3 -0
- package/corpus/templates/analytics/app/i18n/pt-BR.ts +3 -0
- package/corpus/templates/analytics/app/i18n/zh-CN.ts +3 -0
- package/corpus/templates/analytics/app/i18n-data.ts +433 -0
- package/corpus/templates/analytics/app/pages/Settings.tsx +50 -16
- package/corpus/templates/analytics/app/pages/analyses/AnalysesList.tsx +2 -2
- package/corpus/templates/analytics/app/root.tsx +14 -1
- package/corpus/templates/analytics/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
- package/corpus/templates/analytics/changelog/2026-06-24-settings-now-link-directly-to-agent-settings-for-model-api-k.md +6 -0
- package/corpus/templates/assets/.agents/skills/self-modifying-code/SKILL.md +6 -0
- package/corpus/templates/assets/app/components/layout/Header.tsx +17 -8
- package/corpus/templates/assets/app/components/layout/Layout.tsx +10 -6
- package/corpus/templates/assets/app/components/layout/Sidebar.tsx +40 -23
- package/corpus/templates/assets/app/i18n/ar-SA.ts +3 -0
- package/corpus/templates/assets/app/i18n/de-DE.ts +3 -0
- package/corpus/templates/assets/app/i18n/en-US.ts +3 -0
- package/corpus/templates/assets/app/i18n/es-ES.ts +3 -0
- package/corpus/templates/assets/app/i18n/fr-FR.ts +3 -0
- package/corpus/templates/assets/app/i18n/hi-IN.ts +3 -0
- package/corpus/templates/assets/app/i18n/index.ts +31 -0
- package/corpus/templates/assets/app/i18n/ja-JP.ts +3 -0
- package/corpus/templates/assets/app/i18n/ko-KR.ts +3 -0
- package/corpus/templates/assets/app/i18n/pt-BR.ts +3 -0
- package/corpus/templates/assets/app/i18n/zh-CN.ts +3 -0
- package/corpus/templates/assets/app/i18n-data.ts +668 -0
- package/corpus/templates/assets/app/root.tsx +40 -15
- package/corpus/templates/assets/app/routes/_index.tsx +9 -10
- package/corpus/templates/assets/app/routes/settings.tsx +37 -6
- package/corpus/templates/assets/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
- package/corpus/templates/assets/changelog/2026-06-24-settings-now-link-directly-to-agent-settings-for-model-api-k.md +6 -0
- package/corpus/templates/brain/.agents/skills/adding-a-feature/SKILL.md +5 -0
- package/corpus/templates/brain/.agents/skills/self-modifying-code/SKILL.md +6 -0
- package/corpus/templates/brain/app/components/layout/Layout.tsx +12 -8
- package/corpus/templates/brain/app/components/layout/Sidebar.tsx +23 -12
- package/corpus/templates/brain/app/i18n/ar-SA.ts +3 -0
- package/corpus/templates/brain/app/i18n/de-DE.ts +3 -0
- package/corpus/templates/brain/app/i18n/en-US.ts +3 -0
- package/corpus/templates/brain/app/i18n/es-ES.ts +3 -0
- package/corpus/templates/brain/app/i18n/fr-FR.ts +3 -0
- package/corpus/templates/brain/app/i18n/hi-IN.ts +3 -0
- package/corpus/templates/brain/app/i18n/index.ts +31 -0
- package/corpus/templates/brain/app/i18n/ja-JP.ts +3 -0
- package/corpus/templates/brain/app/i18n/ko-KR.ts +3 -0
- package/corpus/templates/brain/app/i18n/pt-BR.ts +3 -0
- package/corpus/templates/brain/app/i18n/zh-CN.ts +3 -0
- package/corpus/templates/brain/app/i18n-data.ts +624 -0
- package/corpus/templates/brain/app/root.tsx +27 -12
- package/corpus/templates/brain/app/routes/knowledge.tsx +6 -6
- package/corpus/templates/brain/app/routes/ops.tsx +4 -4
- package/corpus/templates/brain/app/routes/search.tsx +4 -4
- package/corpus/templates/brain/app/routes/settings.tsx +48 -11
- package/corpus/templates/brain/app/routes/sources.tsx +3 -3
- package/corpus/templates/brain/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
- package/corpus/templates/brain/changelog/2026-06-24-settings-now-link-directly-to-agent-settings-for-model-api-k.md +6 -0
- package/corpus/templates/calendar/.agents/skills/self-modifying-code/SKILL.md +6 -0
- package/corpus/templates/calendar/app/components/layout/AppLayout.tsx +2 -0
- package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +16 -9
- package/corpus/templates/calendar/app/i18n/ar-SA.ts +57 -0
- package/corpus/templates/calendar/app/i18n/de-DE.ts +58 -0
- package/corpus/templates/calendar/app/i18n/en-US.ts +57 -0
- package/corpus/templates/calendar/app/i18n/es-ES.ts +58 -0
- package/corpus/templates/calendar/app/i18n/fr-FR.ts +58 -0
- package/corpus/templates/calendar/app/i18n/hi-IN.ts +57 -0
- package/corpus/templates/calendar/app/i18n/index.ts +31 -0
- package/corpus/templates/calendar/app/i18n/ja-JP.ts +58 -0
- package/corpus/templates/calendar/app/i18n/ko-KR.ts +57 -0
- package/corpus/templates/calendar/app/i18n/pt-BR.ts +57 -0
- package/corpus/templates/calendar/app/i18n/zh-CN.ts +57 -0
- package/corpus/templates/calendar/app/i18n-data.ts +516 -0
- package/corpus/templates/calendar/app/pages/CalendarView.tsx +2 -0
- package/corpus/templates/calendar/app/pages/Settings.tsx +63 -28
- package/corpus/templates/calendar/app/root.tsx +78 -7
- package/corpus/templates/calendar/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
- package/corpus/templates/calendar/changelog/2026-06-24-settings-now-link-directly-to-agent-settings-for-model-api-k.md +6 -0
- package/corpus/templates/chat/.agents/skills/adding-a-feature/SKILL.md +5 -0
- package/corpus/templates/chat/.agents/skills/self-modifying-code/SKILL.md +6 -0
- package/corpus/templates/chat/app/components/layout/Header.tsx +17 -11
- package/corpus/templates/chat/app/components/layout/Layout.tsx +12 -8
- package/corpus/templates/chat/app/components/layout/Sidebar.tsx +47 -18
- package/corpus/templates/chat/app/i18n/ar-SA.ts +62 -0
- package/corpus/templates/chat/app/i18n/de-DE.ts +63 -0
- package/corpus/templates/chat/app/i18n/en-US.ts +63 -0
- package/corpus/templates/chat/app/i18n/es-ES.ts +63 -0
- package/corpus/templates/chat/app/i18n/fr-FR.ts +63 -0
- package/corpus/templates/chat/app/i18n/hi-IN.ts +63 -0
- package/corpus/templates/chat/app/i18n/index.ts +31 -0
- package/corpus/templates/chat/app/i18n/ja-JP.ts +63 -0
- package/corpus/templates/chat/app/i18n/ko-KR.ts +63 -0
- package/corpus/templates/chat/app/i18n/pt-BR.ts +63 -0
- package/corpus/templates/chat/app/i18n/zh-CN.ts +61 -0
- package/corpus/templates/chat/app/i18n-data.ts +475 -0
- package/corpus/templates/chat/app/root.tsx +18 -5
- package/corpus/templates/chat/app/routes/_index.tsx +9 -8
- package/corpus/templates/chat/app/routes/settings.tsx +86 -0
- package/corpus/templates/chat/changelog/2026-06-24-a-new-settings-page-gives-quick-access-to-language-workspace.md +6 -0
- package/corpus/templates/chat/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
- package/corpus/templates/clips/.agents/skills/self-modifying-code/SKILL.md +6 -0
- package/corpus/templates/clips/app/components/layout/Header.tsx +23 -17
- package/corpus/templates/clips/app/components/library/empty-state.tsx +10 -34
- package/corpus/templates/clips/app/components/library/library-layout.tsx +45 -34
- package/corpus/templates/clips/app/i18n/ar-SA.ts +182 -0
- package/corpus/templates/clips/app/i18n/de-DE.ts +184 -0
- package/corpus/templates/clips/app/i18n/en-US.ts +179 -0
- package/corpus/templates/clips/app/i18n/es-ES.ts +183 -0
- package/corpus/templates/clips/app/i18n/fr-FR.ts +184 -0
- package/corpus/templates/clips/app/i18n/hi-IN.ts +180 -0
- package/corpus/templates/clips/app/i18n/index.ts +41 -0
- package/corpus/templates/clips/app/i18n/ja-JP.ts +180 -0
- package/corpus/templates/clips/app/i18n/ko-KR.ts +178 -0
- package/corpus/templates/clips/app/i18n/pt-BR.ts +183 -0
- package/corpus/templates/clips/app/i18n/zh-CN.ts +173 -0
- package/corpus/templates/clips/app/root.tsx +104 -10
- package/corpus/templates/clips/app/routes/_app.settings._index.tsx +154 -95
- package/corpus/templates/clips/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-24-clips-now-includes-a-language-picker-and-simplified-chinese-ui.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-24-settings-now-link-directly-to-agent-settings-for-model-api-k.md +6 -0
- package/corpus/templates/content/.agents/skills/self-modifying-code/SKILL.md +6 -0
- package/corpus/templates/content/app/components/EmptyState.tsx +7 -5
- package/corpus/templates/content/app/components/ThemeToggle.tsx +4 -2
- package/corpus/templates/content/app/components/layout/Header.tsx +2 -0
- package/corpus/templates/content/app/components/layout/Layout.tsx +8 -7
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +41 -1
- package/corpus/templates/content/app/i18n/ar-SA.ts +3 -0
- package/corpus/templates/content/app/i18n/de-DE.ts +3 -0
- package/corpus/templates/content/app/i18n/en-US.ts +3 -0
- package/corpus/templates/content/app/i18n/es-ES.ts +3 -0
- package/corpus/templates/content/app/i18n/fr-FR.ts +3 -0
- package/corpus/templates/content/app/i18n/hi-IN.ts +3 -0
- package/corpus/templates/content/app/i18n/index.ts +31 -0
- package/corpus/templates/content/app/i18n/ja-JP.ts +3 -0
- package/corpus/templates/content/app/i18n/ko-KR.ts +3 -0
- package/corpus/templates/content/app/i18n/pt-BR.ts +3 -0
- package/corpus/templates/content/app/i18n/zh-CN.ts +3 -0
- package/corpus/templates/content/app/i18n-data.ts +490 -0
- package/corpus/templates/content/app/root.tsx +110 -23
- package/corpus/templates/content/app/routes/_app.settings.tsx +84 -0
- package/corpus/templates/content/changelog/2026-06-24-a-new-settings-page-gives-quick-access-to-language-workspace.md +6 -0
- package/corpus/templates/content/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
- package/corpus/templates/design/.agents/skills/self-modifying-code/SKILL.md +6 -0
- package/corpus/templates/design/app/components/layout/Header.tsx +16 -8
- package/corpus/templates/design/app/components/layout/Layout.tsx +8 -6
- package/corpus/templates/design/app/components/layout/Sidebar.tsx +25 -9
- package/corpus/templates/design/app/i18n/ar-SA.ts +3 -0
- package/corpus/templates/design/app/i18n/de-DE.ts +3 -0
- package/corpus/templates/design/app/i18n/en-US.ts +3 -0
- package/corpus/templates/design/app/i18n/es-ES.ts +3 -0
- package/corpus/templates/design/app/i18n/fr-FR.ts +3 -0
- package/corpus/templates/design/app/i18n/hi-IN.ts +3 -0
- package/corpus/templates/design/app/i18n/index.ts +31 -0
- package/corpus/templates/design/app/i18n/ja-JP.ts +3 -0
- package/corpus/templates/design/app/i18n/ko-KR.ts +3 -0
- package/corpus/templates/design/app/i18n/pt-BR.ts +3 -0
- package/corpus/templates/design/app/i18n/zh-CN.ts +3 -0
- package/corpus/templates/design/app/i18n-data.ts +350 -0
- package/corpus/templates/design/app/root.tsx +40 -15
- package/corpus/templates/design/app/routes/settings.tsx +43 -0
- package/corpus/templates/design/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
- package/corpus/templates/design/changelog/2026-06-24-settings-now-link-directly-to-agent-settings-for-model-api-k.md +6 -0
- package/corpus/templates/dispatch/.agents/skills/self-modifying-code/SKILL.md +6 -0
- package/corpus/templates/dispatch/app/i18n/ar-SA.ts +3 -0
- package/corpus/templates/dispatch/app/i18n/de-DE.ts +3 -0
- package/corpus/templates/dispatch/app/i18n/en-US.ts +3 -0
- package/corpus/templates/dispatch/app/i18n/es-ES.ts +3 -0
- package/corpus/templates/dispatch/app/i18n/fr-FR.ts +3 -0
- package/corpus/templates/dispatch/app/i18n/hi-IN.ts +3 -0
- package/corpus/templates/dispatch/app/i18n/index.ts +31 -0
- package/corpus/templates/dispatch/app/i18n/ja-JP.ts +3 -0
- package/corpus/templates/dispatch/app/i18n/ko-KR.ts +3 -0
- package/corpus/templates/dispatch/app/i18n/pt-BR.ts +3 -0
- package/corpus/templates/dispatch/app/i18n/zh-CN.ts +3 -0
- package/corpus/templates/dispatch/app/i18n-data.ts +267 -0
- package/corpus/templates/dispatch/app/root.tsx +18 -4
- package/corpus/templates/dispatch/app/routes/settings.tsx +86 -0
- package/corpus/templates/dispatch/changelog/2026-06-24-a-new-settings-page-gives-quick-access-to-language-workspace.md +6 -0
- package/corpus/templates/dispatch/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
- package/corpus/templates/forms/.agents/skills/self-modifying-code/SKILL.md +6 -0
- package/corpus/templates/forms/app/components/layout/Header.tsx +16 -9
- package/corpus/templates/forms/app/components/layout/Layout.tsx +6 -4
- package/corpus/templates/forms/app/components/layout/Sidebar.tsx +34 -17
- package/corpus/templates/forms/app/i18n/ar-SA.ts +58 -0
- package/corpus/templates/forms/app/i18n/de-DE.ts +59 -0
- package/corpus/templates/forms/app/i18n/en-US.ts +59 -0
- package/corpus/templates/forms/app/i18n/es-ES.ts +59 -0
- package/corpus/templates/forms/app/i18n/fr-FR.ts +59 -0
- package/corpus/templates/forms/app/i18n/hi-IN.ts +59 -0
- package/corpus/templates/forms/app/i18n/index.ts +31 -0
- package/corpus/templates/forms/app/i18n/ja-JP.ts +59 -0
- package/corpus/templates/forms/app/i18n/ko-KR.ts +59 -0
- package/corpus/templates/forms/app/i18n/pt-BR.ts +59 -0
- package/corpus/templates/forms/app/i18n/zh-CN.ts +56 -0
- package/corpus/templates/forms/app/root.tsx +65 -16
- package/corpus/templates/forms/app/routes/_app.settings.tsx +85 -0
- package/corpus/templates/forms/changelog/2026-06-24-a-new-settings-page-gives-quick-access-to-language-workspace.md +6 -0
- package/corpus/templates/forms/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
- package/corpus/templates/macros/app/components/layout/AppLayout.tsx +29 -17
- package/corpus/templates/macros/app/components/layout/Header.tsx +16 -10
- package/corpus/templates/macros/app/i18n/ar-SA.ts +54 -0
- package/corpus/templates/macros/app/i18n/de-DE.ts +55 -0
- package/corpus/templates/macros/app/i18n/en-US.ts +55 -0
- package/corpus/templates/macros/app/i18n/es-ES.ts +55 -0
- package/corpus/templates/macros/app/i18n/fr-FR.ts +55 -0
- package/corpus/templates/macros/app/i18n/hi-IN.ts +55 -0
- package/corpus/templates/macros/app/i18n/index.ts +31 -0
- package/corpus/templates/macros/app/i18n/ja-JP.ts +55 -0
- package/corpus/templates/macros/app/i18n/ko-KR.ts +55 -0
- package/corpus/templates/macros/app/i18n/pt-BR.ts +55 -0
- package/corpus/templates/macros/app/i18n/zh-CN.ts +53 -0
- package/corpus/templates/macros/app/root.tsx +65 -15
- package/corpus/templates/macros/app/routes/settings.tsx +85 -0
- package/corpus/templates/macros/changelog/2026-06-24-a-new-settings-page-gives-quick-access-to-language-workspace.md +6 -0
- package/corpus/templates/macros/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
- package/corpus/templates/mail/.agents/skills/self-modifying-code/SKILL.md +6 -0
- package/corpus/templates/mail/app/components/layout/AppLayout.tsx +9 -4
- package/corpus/templates/mail/app/i18n/ar-SA.ts +33 -0
- package/corpus/templates/mail/app/i18n/de-DE.ts +33 -0
- package/corpus/templates/mail/app/i18n/en-US.ts +32 -0
- package/corpus/templates/mail/app/i18n/es-ES.ts +33 -0
- package/corpus/templates/mail/app/i18n/fr-FR.ts +33 -0
- package/corpus/templates/mail/app/i18n/hi-IN.ts +32 -0
- package/corpus/templates/mail/app/i18n/index.ts +31 -0
- package/corpus/templates/mail/app/i18n/ja-JP.ts +32 -0
- package/corpus/templates/mail/app/i18n/ko-KR.ts +33 -0
- package/corpus/templates/mail/app/i18n/pt-BR.ts +34 -0
- package/corpus/templates/mail/app/i18n/zh-CN.ts +32 -0
- package/corpus/templates/mail/app/pages/SettingsPage.tsx +67 -13
- package/corpus/templates/mail/app/root.tsx +20 -0
- package/corpus/templates/mail/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
- package/corpus/templates/mail/changelog/2026-06-24-settings-now-link-directly-to-agent-settings-for-model-api-k.md +6 -0
- package/corpus/templates/plan/.agents/skills/adding-a-feature/SKILL.md +5 -0
- package/corpus/templates/plan/.agents/skills/self-modifying-code/SKILL.md +6 -0
- package/corpus/templates/plan/app/components/layout/Header.tsx +19 -12
- package/corpus/templates/plan/app/components/layout/Layout.tsx +11 -7
- package/corpus/templates/plan/app/components/layout/Sidebar.tsx +41 -28
- package/corpus/templates/plan/app/i18n/ar-SA.ts +77 -0
- package/corpus/templates/plan/app/i18n/de-DE.ts +78 -0
- package/corpus/templates/plan/app/i18n/en-US.ts +78 -0
- package/corpus/templates/plan/app/i18n/es-ES.ts +78 -0
- package/corpus/templates/plan/app/i18n/fr-FR.ts +78 -0
- package/corpus/templates/plan/app/i18n/hi-IN.ts +78 -0
- package/corpus/templates/plan/app/i18n/index.ts +31 -0
- package/corpus/templates/plan/app/i18n/ja-JP.ts +79 -0
- package/corpus/templates/plan/app/i18n/ko-KR.ts +77 -0
- package/corpus/templates/plan/app/i18n/pt-BR.ts +78 -0
- package/corpus/templates/plan/app/i18n/zh-CN.ts +74 -0
- package/corpus/templates/plan/app/root.tsx +45 -8
- package/corpus/templates/plan/app/routes/settings.tsx +86 -0
- package/corpus/templates/plan/changelog/2026-06-24-a-new-settings-page-gives-quick-access-to-language-workspace.md +6 -0
- package/corpus/templates/plan/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
- package/corpus/templates/slides/.agents/skills/self-modifying-code/SKILL.md +6 -0
- package/corpus/templates/slides/app/components/layout/Header.tsx +23 -11
- package/corpus/templates/slides/app/components/layout/Layout.tsx +7 -6
- package/corpus/templates/slides/app/components/layout/Sidebar.tsx +23 -11
- package/corpus/templates/slides/app/i18n/ar-SA.ts +54 -0
- package/corpus/templates/slides/app/i18n/de-DE.ts +56 -0
- package/corpus/templates/slides/app/i18n/en-US.ts +55 -0
- package/corpus/templates/slides/app/i18n/es-ES.ts +55 -0
- package/corpus/templates/slides/app/i18n/fr-FR.ts +55 -0
- package/corpus/templates/slides/app/i18n/hi-IN.ts +55 -0
- package/corpus/templates/slides/app/i18n/index.ts +31 -0
- package/corpus/templates/slides/app/i18n/ja-JP.ts +55 -0
- package/corpus/templates/slides/app/i18n/ko-KR.ts +55 -0
- package/corpus/templates/slides/app/i18n/pt-BR.ts +55 -0
- package/corpus/templates/slides/app/i18n/zh-CN.ts +53 -0
- package/corpus/templates/slides/app/root.tsx +50 -8
- package/corpus/templates/slides/app/routes/settings.tsx +85 -0
- package/corpus/templates/slides/changelog/2026-06-24-a-new-settings-page-gives-quick-access-to-language-workspace.md +6 -0
- package/corpus/templates/slides/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
- package/corpus/templates/videos/.agents/skills/self-modifying-code/SKILL.md +6 -0
- package/corpus/templates/videos/app/components/NewCompositionPopover.tsx +14 -9
- package/corpus/templates/videos/app/components/Sidebar.tsx +16 -9
- package/corpus/templates/videos/app/components/StudioHeader.tsx +12 -8
- package/corpus/templates/videos/app/components/layout/Header.tsx +21 -15
- package/corpus/templates/videos/app/components/layout/Layout.tsx +10 -7
- package/corpus/templates/videos/app/components/layout/NavSidebar.tsx +21 -6
- package/corpus/templates/videos/app/i18n/ar-SA.ts +73 -0
- package/corpus/templates/videos/app/i18n/de-DE.ts +75 -0
- package/corpus/templates/videos/app/i18n/en-US.ts +74 -0
- package/corpus/templates/videos/app/i18n/es-ES.ts +75 -0
- package/corpus/templates/videos/app/i18n/fr-FR.ts +75 -0
- package/corpus/templates/videos/app/i18n/hi-IN.ts +74 -0
- package/corpus/templates/videos/app/i18n/index.ts +31 -0
- package/corpus/templates/videos/app/i18n/ja-JP.ts +74 -0
- package/corpus/templates/videos/app/i18n/ko-KR.ts +74 -0
- package/corpus/templates/videos/app/i18n/pt-BR.ts +75 -0
- package/corpus/templates/videos/app/i18n/zh-CN.ts +72 -0
- package/corpus/templates/videos/app/pages/Index.tsx +11 -9
- package/corpus/templates/videos/app/root.tsx +45 -7
- package/corpus/templates/videos/app/routes/settings.tsx +85 -0
- package/corpus/templates/videos/changelog/2026-06-24-a-new-settings-page-gives-quick-access-to-language-workspace.md +6 -0
- package/corpus/templates/videos/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
- package/dist/agent/durable-background.d.ts +15 -0
- package/dist/agent/durable-background.d.ts.map +1 -1
- package/dist/agent/durable-background.js +28 -2
- package/dist/agent/durable-background.js.map +1 -1
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +34 -1
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/run-manager.d.ts +8 -0
- package/dist/agent/run-manager.d.ts.map +1 -1
- package/dist/agent/run-manager.js +18 -1
- package/dist/agent/run-manager.js.map +1 -1
- package/dist/agent/run-store.d.ts +99 -0
- package/dist/agent/run-store.d.ts.map +1 -1
- package/dist/agent/run-store.js +155 -4
- package/dist/agent/run-store.js.map +1 -1
- package/dist/client/CommandMenu.d.ts +3 -0
- package/dist/client/CommandMenu.d.ts.map +1 -1
- package/dist/client/CommandMenu.js +9 -0
- package/dist/client/CommandMenu.js.map +1 -1
- package/dist/client/app-providers.d.ts +8 -1
- package/dist/client/app-providers.d.ts.map +1 -1
- package/dist/client/app-providers.js +7 -5
- package/dist/client/app-providers.js.map +1 -1
- package/dist/client/i18n.d.ts +54 -0
- package/dist/client/i18n.d.ts.map +1 -0
- package/dist/client/i18n.js +354 -0
- package/dist/client/i18n.js.map +1 -0
- package/dist/client/index.d.ts +2 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +2 -1
- package/dist/client/index.js.map +1 -1
- package/dist/index.browser.d.ts +1 -1
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.browser.js +1 -1
- package/dist/index.browser.js.map +1 -1
- package/dist/localization/actions/get-localization-preference.d.ts +4 -0
- package/dist/localization/actions/get-localization-preference.d.ts.map +1 -0
- package/dist/localization/actions/get-localization-preference.js +16 -0
- package/dist/localization/actions/get-localization-preference.js.map +1 -0
- package/dist/localization/actions/set-localization-preference.d.ts +6 -0
- package/dist/localization/actions/set-localization-preference.d.ts.map +1 -0
- package/dist/localization/actions/set-localization-preference.js +24 -0
- package/dist/localization/actions/set-localization-preference.js.map +1 -0
- package/dist/localization/index.d.ts +3 -0
- package/dist/localization/index.d.ts.map +1 -0
- package/dist/localization/index.js +3 -0
- package/dist/localization/index.js.map +1 -0
- package/dist/localization/server.d.ts +25 -0
- package/dist/localization/server.d.ts.map +1 -0
- package/dist/localization/server.js +69 -0
- package/dist/localization/server.js.map +1 -0
- package/dist/localization/shared.d.ts +25 -0
- package/dist/localization/shared.d.ts.map +1 -0
- package/dist/localization/shared.js +134 -0
- package/dist/localization/shared.js.map +1 -0
- package/dist/server/action-discovery.d.ts.map +1 -1
- package/dist/server/action-discovery.js +8 -0
- package/dist/server/action-discovery.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +58 -1
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +12 -0
- package/dist/server/auth.js.map +1 -1
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +1 -0
- package/dist/server/index.js.map +1 -1
- package/dist/templates/default/.agents/skills/adding-a-feature/SKILL.md +5 -0
- package/dist/templates/default/.agents/skills/internationalization/SKILL.md +77 -0
- package/dist/templates/default/.agents/skills/self-modifying-code/SKILL.md +6 -0
- package/dist/templates/default/AGENTS.md +16 -15
- package/dist/templates/default/app/i18n/en-US.ts +29 -0
- package/dist/templates/default/app/i18n/index.ts +13 -0
- package/dist/templates/default/app/root.tsx +20 -1
- package/dist/templates/default/app/routes/_index.tsx +24 -9
- package/dist/templates/default/app/routes/settings.tsx +67 -0
- package/dist/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +5 -0
- package/dist/templates/workspace-core/.agents/skills/internationalization/SKILL.md +77 -0
- package/dist/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +6 -0
- package/dist/vite/action-types-plugin.d.ts.map +1 -1
- package/dist/vite/action-types-plugin.js +8 -0
- package/dist/vite/action-types-plugin.js.map +1 -1
- package/docs/AGENTS.md +1 -0
- package/docs/content/client.md +15 -0
- package/docs/content/internationalization.md +145 -0
- package/docs/content/locales/ar-SA/internationalization.md +102 -0
- package/docs/content/locales/de-DE/internationalization.md +102 -0
- package/docs/content/locales/es-ES/internationalization.md +102 -0
- package/docs/content/locales/fr-FR/internationalization.md +102 -0
- package/docs/content/locales/hi-IN/internationalization.md +102 -0
- package/docs/content/locales/ja-JP/internationalization.md +114 -0
- package/docs/content/locales/ko-KR/internationalization.md +102 -0
- package/docs/content/locales/pt-BR/internationalization.md +102 -0
- package/docs/content/locales/zh-CN/internationalization.md +102 -0
- package/docs/content/skills-guide.md +19 -18
- package/package.json +7 -1
- package/src/templates/default/.agents/skills/adding-a-feature/SKILL.md +5 -0
- package/src/templates/default/.agents/skills/internationalization/SKILL.md +77 -0
- package/src/templates/default/.agents/skills/self-modifying-code/SKILL.md +6 -0
- package/src/templates/default/AGENTS.md +16 -15
- package/src/templates/default/app/i18n/en-US.ts +29 -0
- package/src/templates/default/app/i18n/index.ts +13 -0
- package/src/templates/default/app/root.tsx +20 -1
- package/src/templates/default/app/routes/_index.tsx +24 -9
- package/src/templates/default/app/routes/settings.tsx +67 -0
- package/src/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +5 -0
- package/src/templates/workspace-core/.agents/skills/internationalization/SKILL.md +77 -0
- package/src/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +6 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
const messages = {
|
|
2
|
+
common: {
|
|
3
|
+
cancel: "取消",
|
|
4
|
+
create: "创建",
|
|
5
|
+
save: "保存",
|
|
6
|
+
saving: "正在保存…",
|
|
7
|
+
saveChanges: "保存更改",
|
|
8
|
+
connected: "已连接",
|
|
9
|
+
notConnected: "未连接",
|
|
10
|
+
disconnect: "断开连接",
|
|
11
|
+
disconnecting: "正在断开连接...",
|
|
12
|
+
},
|
|
13
|
+
root: {
|
|
14
|
+
commandActions: "操作",
|
|
15
|
+
commandSearch: "搜索",
|
|
16
|
+
commandAppearance: "外观",
|
|
17
|
+
toggleTheme: "切换主题",
|
|
18
|
+
extensionSignedInTitle: "已登录",
|
|
19
|
+
extensionSignedInDescription: "再次打开 Clips 扩展即可开始录制。",
|
|
20
|
+
gotIt: "知道了",
|
|
21
|
+
},
|
|
22
|
+
navigation: {
|
|
23
|
+
brand: "Clips",
|
|
24
|
+
library: "资料库",
|
|
25
|
+
spaces: "空间",
|
|
26
|
+
meetings: "会议",
|
|
27
|
+
dictate: "听写",
|
|
28
|
+
archive: "归档",
|
|
29
|
+
trash: "废纸篓",
|
|
30
|
+
settings: "设置",
|
|
31
|
+
notifications: "通知",
|
|
32
|
+
insights: "洞察",
|
|
33
|
+
space: "空间",
|
|
34
|
+
folder: "文件夹",
|
|
35
|
+
extensions: "扩展",
|
|
36
|
+
newRecording: "新建录制",
|
|
37
|
+
folders: "文件夹",
|
|
38
|
+
newFolder: "新建文件夹",
|
|
39
|
+
noSpaces: "暂无空间",
|
|
40
|
+
desktopCta: "获取桌面应用",
|
|
41
|
+
desktopTitle: "获取 Clips 桌面应用。",
|
|
42
|
+
desktopBody: "从菜单栏录制,使用全局快捷键,并自动更新。",
|
|
43
|
+
expandSidebar: "展开侧边栏",
|
|
44
|
+
collapseSidebar: "收起侧边栏",
|
|
45
|
+
agentEmptyState: "我可以怎样帮助你处理录制?",
|
|
46
|
+
agentSuggestionSummary: "总结我最近的录制",
|
|
47
|
+
agentSuggestionPricing: "查找我提到价格的位置",
|
|
48
|
+
agentSuggestionFiller: "从这个剪辑中移除口头禅",
|
|
49
|
+
createFolderError: "创建失败",
|
|
50
|
+
folderCreated: "文件夹已创建",
|
|
51
|
+
folderNamePlaceholder: "文件夹名称",
|
|
52
|
+
},
|
|
53
|
+
empty: {
|
|
54
|
+
library: {
|
|
55
|
+
title: "你的资料库还是空的",
|
|
56
|
+
body: "录制第一个屏幕视频后,它会出现在这里,随时可以分享。",
|
|
57
|
+
cta: "录制第一个 Clip",
|
|
58
|
+
},
|
|
59
|
+
folder: {
|
|
60
|
+
title: "这个文件夹是空的",
|
|
61
|
+
body: "拖入录制,或点击录制在此文件夹中开始新内容。",
|
|
62
|
+
cta: "在这里录制",
|
|
63
|
+
},
|
|
64
|
+
space: {
|
|
65
|
+
title: "这个空间还没有录制",
|
|
66
|
+
body: "将录制分享到空间,或录制新内容,团队会在这里看到。",
|
|
67
|
+
cta: "为这个空间录制",
|
|
68
|
+
},
|
|
69
|
+
archive: {
|
|
70
|
+
title: "没有归档内容",
|
|
71
|
+
body: "归档的录制会从资料库隐藏但仍安全保留。你可以随时恢复它们。",
|
|
72
|
+
},
|
|
73
|
+
trash: {
|
|
74
|
+
title: "废纸篓是空的",
|
|
75
|
+
body: "删除的录制会在这里保留 30 天,然后永久移除。",
|
|
76
|
+
},
|
|
77
|
+
search: {
|
|
78
|
+
title: "没有匹配结果",
|
|
79
|
+
body: "尝试其他搜索词,或检查你的筛选条件。",
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
settings: {
|
|
83
|
+
openAgentSettings: "打开代理设置",
|
|
84
|
+
agentDescription:
|
|
85
|
+
"打开代理侧边栏设置,管理模型、API 密钥、自动化、语音和其他代理控制项。",
|
|
86
|
+
agentTitle: "代理设置",
|
|
87
|
+
title: "设置",
|
|
88
|
+
intro: "此 Clips 工作区的偏好设置和已连接服务。",
|
|
89
|
+
languageTitle: "语言",
|
|
90
|
+
languageDescription:
|
|
91
|
+
"选择此账号的界面语言。Clips 会在不同设备上记住你的选择。",
|
|
92
|
+
languageLabel: "界面语言",
|
|
93
|
+
profile: "个人资料",
|
|
94
|
+
email: "邮箱",
|
|
95
|
+
displayName: "显示名称",
|
|
96
|
+
displayNamePlaceholder: "你的姓名",
|
|
97
|
+
playback: "播放",
|
|
98
|
+
defaultPlaybackSpeed: "默认播放速度",
|
|
99
|
+
playbackDescription: "打开录制时会自动应用。",
|
|
100
|
+
transcript: "转录",
|
|
101
|
+
transcriptCleanup: "后台清理",
|
|
102
|
+
transcriptCleanupDescription: "先立即显示原生转录,后台可用时再进行清理。",
|
|
103
|
+
notifications: "通知",
|
|
104
|
+
emailNotifications: "邮件通知",
|
|
105
|
+
emailNotificationsDescription:
|
|
106
|
+
"当有人评论、回应或与你分享录制时,收到邮件通知。",
|
|
107
|
+
saved: "设置已保存",
|
|
108
|
+
saveFailed: "保存失败",
|
|
109
|
+
builderConnectedToast: "Builder.io 已连接",
|
|
110
|
+
videoStorage: "视频存储",
|
|
111
|
+
videoStorageDescription:
|
|
112
|
+
"Builder.io 是 Clips 上传的主要存储路径。需要自带存储桶时,也可以使用 S3。",
|
|
113
|
+
checkingBuilder: "正在检查 Builder.io",
|
|
114
|
+
builderConnected: "Builder.io 已连接",
|
|
115
|
+
connectBuilder: "连接 Builder.io",
|
|
116
|
+
builderConnectedFor: "正在为 {{orgName}} 使用 Builder.io。",
|
|
117
|
+
builderConnectedGeneric: "新的剪辑会使用已连接的 Builder.io 提供方。",
|
|
118
|
+
builderIncludes: "包含对象存储、上传,以及新剪辑的托管转录。",
|
|
119
|
+
s3Title: "S3 兼容存储",
|
|
120
|
+
secondary: "备用",
|
|
121
|
+
active: "当前启用",
|
|
122
|
+
s3BuilderConnectedDescription:
|
|
123
|
+
"仅当此工作区应上传到你自己的存储桶而不是 Builder.io 时使用。",
|
|
124
|
+
s3CurrentProvider: "当前正在使用 {{providerName}}。",
|
|
125
|
+
s3OwnBucketDescription:
|
|
126
|
+
"如果不想使用 Builder.io 存储,可以使用自己的存储桶。",
|
|
127
|
+
configureS3: "配置 S3",
|
|
128
|
+
hideS3: "隐藏 S3",
|
|
129
|
+
saveStorage: "保存存储设置",
|
|
130
|
+
storageSaved: "存储设置已保存",
|
|
131
|
+
storageRequired: "Endpoint、bucket、access key 和 secret 为必填项。",
|
|
132
|
+
apiSetup: "AI 设置",
|
|
133
|
+
apiSetupDescription:
|
|
134
|
+
"Builder.io 是托管 AI 额度的默认路径。也可以在这里添加可选的提供方密钥。",
|
|
135
|
+
builderEasySetup: "Builder.io 是最简单的设置方式",
|
|
136
|
+
builderAiAvailable: "Clips 可使用包含的 AI 额度和托管转录。",
|
|
137
|
+
builderAiDescription:
|
|
138
|
+
"先连接 Builder,即可使用包含的 AI 额度、对象存储、上传和托管转录。",
|
|
139
|
+
providerKeyTitle: "使用自己的提供方密钥",
|
|
140
|
+
providerKeyDescription:
|
|
141
|
+
"添加 Anthropic、OpenAI、Gemini、Groq 或 OpenRouter 密钥,用于按提供方计费的使用。",
|
|
142
|
+
providerKeysSet: "已设置 {{count}} 个",
|
|
143
|
+
checkingProviderKeys: "正在检查提供方密钥…",
|
|
144
|
+
keySet: "已设置",
|
|
145
|
+
replaceKey: "替换密钥…",
|
|
146
|
+
pasteProviderKey: "请先粘贴提供方密钥。",
|
|
147
|
+
apiKeySaved: "API 密钥已保存",
|
|
148
|
+
apiKeyFailed: "保存密钥失败",
|
|
149
|
+
slackTitle: "Agent-Native Clips for Slack",
|
|
150
|
+
slackDescription:
|
|
151
|
+
"分享公开剪辑,将链接粘贴到 Slack 后即可内联播放,观看者无需额外步骤。每个工作区连接一次即可。",
|
|
152
|
+
checkingSlack: "正在检查 Slack",
|
|
153
|
+
slackConnected_other: "已连接 {{count}} 个工作区",
|
|
154
|
+
slackOauthNeeded: "需要 OAuth 凭据",
|
|
155
|
+
slackPreviewDescription: "公开 Clips 链接可以显示为可播放的 Slack 预览。",
|
|
156
|
+
connectSlack: "连接 Slack",
|
|
157
|
+
slackClientMissing:
|
|
158
|
+
"连接工作区前,请为此部署设置 SLACK_CLIENT_ID 和 SLACK_CLIENT_SECRET。",
|
|
159
|
+
slackSigningMissing:
|
|
160
|
+
"请设置 SLACK_SIGNING_SECRET,以便验证 Slack 事件回调。",
|
|
161
|
+
connectedBy: "由 {{email}} 连接",
|
|
162
|
+
disconnectSlackLabel: "断开 {{team}}",
|
|
163
|
+
slackConnectedToast: "Slack 已连接",
|
|
164
|
+
slackCheckedToast: "Slack 连接已检查",
|
|
165
|
+
slackDisconnectedToast: "Slack 已断开连接",
|
|
166
|
+
disconnectSlackTitle: "断开 Slack?",
|
|
167
|
+
disconnectSlackDescription:
|
|
168
|
+
"Clips 将删除 {{team}} 的已存储机器人令牌,并停止发送可播放的 Slack 预览。",
|
|
169
|
+
thisWorkspace: "此工作区",
|
|
170
|
+
},
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export default messages;
|
|
@@ -4,7 +4,9 @@ import {
|
|
|
4
4
|
Outlet,
|
|
5
5
|
Scripts,
|
|
6
6
|
ScrollRestoration,
|
|
7
|
+
useLoaderData,
|
|
7
8
|
useLocation,
|
|
9
|
+
useRouteLoaderData,
|
|
8
10
|
} from "react-router";
|
|
9
11
|
import { useCallback, useEffect, useState } from "react";
|
|
10
12
|
import { useNavigationState } from "@/hooks/use-navigation-state";
|
|
@@ -16,9 +18,15 @@ import {
|
|
|
16
18
|
DevOverlay,
|
|
17
19
|
appPath,
|
|
18
20
|
createAgentNativeQueryClient,
|
|
21
|
+
getLocaleInitScript,
|
|
19
22
|
getThemeInitScript,
|
|
23
|
+
type LocaleCode,
|
|
24
|
+
type LocaleMessages,
|
|
25
|
+
type LocalizationPreference,
|
|
20
26
|
useCommandMenuShortcut,
|
|
27
|
+
useT,
|
|
21
28
|
} from "@agent-native/core/client";
|
|
29
|
+
import { resolveLocaleFromRequest } from "@agent-native/core/server";
|
|
22
30
|
import { IconCheck, IconSun, IconMoon } from "@tabler/icons-react";
|
|
23
31
|
import { useTheme } from "next-themes";
|
|
24
32
|
import changelog from "../CHANGELOG.md?raw";
|
|
@@ -32,9 +40,10 @@ import {
|
|
|
32
40
|
DialogHeader,
|
|
33
41
|
DialogTitle,
|
|
34
42
|
} from "@/components/ui/dialog";
|
|
35
|
-
import type { LinksFunction } from "react-router";
|
|
43
|
+
import type { LinksFunction, LoaderFunctionArgs } from "react-router";
|
|
36
44
|
import stylesheet from "./global.css?url";
|
|
37
45
|
import { configureTracking } from "@agent-native/core/client";
|
|
46
|
+
import { i18nCatalog, loadI18nMessages } from "./i18n";
|
|
38
47
|
|
|
39
48
|
configureTracking({
|
|
40
49
|
getDefaultProps: (_name, properties) => ({
|
|
@@ -47,11 +56,77 @@ export const links: LinksFunction = () => [
|
|
|
47
56
|
{ rel: "stylesheet", href: stylesheet },
|
|
48
57
|
];
|
|
49
58
|
|
|
50
|
-
|
|
59
|
+
interface RootLoaderData {
|
|
60
|
+
locale: LocaleCode;
|
|
61
|
+
preference: LocalizationPreference;
|
|
62
|
+
dir: "ltr" | "rtl";
|
|
63
|
+
messages: LocaleMessages;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export async function loader({
|
|
67
|
+
request,
|
|
68
|
+
}: LoaderFunctionArgs): Promise<RootLoaderData> {
|
|
69
|
+
const resolved = resolveLocaleFromRequest({ request });
|
|
70
|
+
const messages =
|
|
71
|
+
(await loadI18nMessages(resolved.locale)) ?? i18nCatalog.messages;
|
|
72
|
+
return {
|
|
73
|
+
locale: resolved.locale,
|
|
74
|
+
preference: resolved.preference,
|
|
75
|
+
dir: resolved.dir,
|
|
76
|
+
messages,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const THEME_INIT_SCRIPT_SELECTOR = "script[data-agent-native-theme-init]";
|
|
81
|
+
const LOCALE_INIT_SCRIPT_SELECTOR = "script[data-agent-native-locale-init]";
|
|
82
|
+
|
|
83
|
+
function getHydrationStableThemeInitScript() {
|
|
84
|
+
if (typeof document !== "undefined") {
|
|
85
|
+
const existing = document.querySelector<HTMLScriptElement>(
|
|
86
|
+
THEME_INIT_SCRIPT_SELECTOR,
|
|
87
|
+
);
|
|
88
|
+
if (existing?.innerHTML) return existing.innerHTML;
|
|
89
|
+
}
|
|
90
|
+
return getThemeInitScript();
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function getHydrationStableLocaleInitScript(
|
|
94
|
+
options: Parameters<typeof getLocaleInitScript>[0],
|
|
95
|
+
) {
|
|
96
|
+
if (typeof document !== "undefined") {
|
|
97
|
+
const existing = document.querySelector<HTMLScriptElement>(
|
|
98
|
+
LOCALE_INIT_SCRIPT_SELECTOR,
|
|
99
|
+
);
|
|
100
|
+
if (existing?.innerHTML) return existing.innerHTML;
|
|
101
|
+
}
|
|
102
|
+
return getLocaleInitScript(options);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const THEME_INIT_SCRIPT = getHydrationStableThemeInitScript();
|
|
106
|
+
|
|
107
|
+
const DEFAULT_LOADER_DATA: RootLoaderData = {
|
|
108
|
+
locale: "en-US",
|
|
109
|
+
preference: { locale: "system" },
|
|
110
|
+
dir: "ltr",
|
|
111
|
+
messages: i18nCatalog.messages,
|
|
112
|
+
};
|
|
51
113
|
|
|
52
114
|
export function Layout({ children }: { children: React.ReactNode }) {
|
|
115
|
+
const loaderData =
|
|
116
|
+
useRouteLoaderData<typeof loader>("root") ?? DEFAULT_LOADER_DATA;
|
|
117
|
+
const localeInitScript = getHydrationStableLocaleInitScript({
|
|
118
|
+
locale: loaderData.locale,
|
|
119
|
+
preference: loaderData.preference,
|
|
120
|
+
messages: loaderData.messages,
|
|
121
|
+
});
|
|
122
|
+
|
|
53
123
|
return (
|
|
54
|
-
<html
|
|
124
|
+
<html
|
|
125
|
+
lang={loaderData.locale}
|
|
126
|
+
dir={loaderData.dir}
|
|
127
|
+
data-locale={loaderData.locale}
|
|
128
|
+
suppressHydrationWarning
|
|
129
|
+
>
|
|
55
130
|
<head>
|
|
56
131
|
<meta charSet="utf-8" />
|
|
57
132
|
<meta
|
|
@@ -59,9 +134,15 @@ export function Layout({ children }: { children: React.ReactNode }) {
|
|
|
59
134
|
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
|
|
60
135
|
/>
|
|
61
136
|
<script
|
|
137
|
+
data-agent-native-theme-init
|
|
62
138
|
suppressHydrationWarning
|
|
63
139
|
dangerouslySetInnerHTML={{ __html: THEME_INIT_SCRIPT }}
|
|
64
140
|
/>
|
|
141
|
+
<script
|
|
142
|
+
data-agent-native-locale-init
|
|
143
|
+
suppressHydrationWarning
|
|
144
|
+
dangerouslySetInnerHTML={{ __html: localeInitScript }}
|
|
145
|
+
/>
|
|
65
146
|
<link rel="manifest" href={appPath("/manifest.json")} />
|
|
66
147
|
<meta name="theme-color" content="#18181B" />
|
|
67
148
|
<meta name="mobile-web-app-capable" content="yes" />
|
|
@@ -106,6 +187,7 @@ function DbSyncSetup() {
|
|
|
106
187
|
|
|
107
188
|
function ThemeToggleItem() {
|
|
108
189
|
const { resolvedTheme, setTheme } = useTheme();
|
|
190
|
+
const t = useT();
|
|
109
191
|
const isDark = resolvedTheme === "dark";
|
|
110
192
|
return (
|
|
111
193
|
<CommandMenu.Item
|
|
@@ -113,7 +195,7 @@ function ThemeToggleItem() {
|
|
|
113
195
|
keywords={["theme", "dark", "light", "mode"]}
|
|
114
196
|
>
|
|
115
197
|
{isDark ? <IconSun size={16} /> : <IconMoon size={16} />}
|
|
116
|
-
|
|
198
|
+
{t("root.toggleTheme")}
|
|
117
199
|
</CommandMenu.Item>
|
|
118
200
|
);
|
|
119
201
|
}
|
|
@@ -150,6 +232,7 @@ const CLIPS_COMMAND_DOCS = [
|
|
|
150
232
|
|
|
151
233
|
function ClipsExtensionAuthBridge() {
|
|
152
234
|
const location = useLocation();
|
|
235
|
+
const t = useT();
|
|
153
236
|
const [showAuthSuccess, setShowAuthSuccess] = useState(false);
|
|
154
237
|
|
|
155
238
|
useEffect(() => {
|
|
@@ -213,14 +296,14 @@ function ClipsExtensionAuthBridge() {
|
|
|
213
296
|
<IconCheck className="h-9 w-9" strokeWidth={2.5} />
|
|
214
297
|
</div>
|
|
215
298
|
<DialogHeader className="items-center text-center sm:text-center">
|
|
216
|
-
<DialogTitle>
|
|
299
|
+
<DialogTitle>{t("root.extensionSignedInTitle")}</DialogTitle>
|
|
217
300
|
<DialogDescription className="max-w-xs">
|
|
218
|
-
|
|
301
|
+
{t("root.extensionSignedInDescription")}
|
|
219
302
|
</DialogDescription>
|
|
220
303
|
</DialogHeader>
|
|
221
304
|
<DialogFooter className="sm:justify-center">
|
|
222
305
|
<Button type="button" onClick={() => setShowAuthSuccess(false)}>
|
|
223
|
-
|
|
306
|
+
{t("root.gotIt")}
|
|
224
307
|
</Button>
|
|
225
308
|
</DialogFooter>
|
|
226
309
|
</DialogContent>
|
|
@@ -246,6 +329,7 @@ function isStandalonePublicPath(pathname: string): boolean {
|
|
|
246
329
|
|
|
247
330
|
function AppContent() {
|
|
248
331
|
const location = useLocation();
|
|
332
|
+
const t = useT();
|
|
249
333
|
const standalonePublic = isStandalonePublicPath(location.pathname);
|
|
250
334
|
const [cmdkOpen, setCmdkOpen] = useState(false);
|
|
251
335
|
useCommandMenuShortcut(
|
|
@@ -265,11 +349,13 @@ function AppContent() {
|
|
|
265
349
|
changelog={changelog}
|
|
266
350
|
changelogKey="clips"
|
|
267
351
|
>
|
|
268
|
-
<CommandMenu.Group heading="
|
|
269
|
-
<CommandMenu.Item onSelect={() => {}}>
|
|
352
|
+
<CommandMenu.Group heading={t("root.commandActions")}>
|
|
353
|
+
<CommandMenu.Item onSelect={() => {}}>
|
|
354
|
+
{t("root.commandSearch")}
|
|
355
|
+
</CommandMenu.Item>
|
|
270
356
|
</CommandMenu.Group>
|
|
271
357
|
<CommandMenu.DocsGroup docs={CLIPS_COMMAND_DOCS} />
|
|
272
|
-
<CommandMenu.Group heading="
|
|
358
|
+
<CommandMenu.Group heading={t("root.commandAppearance")}>
|
|
273
359
|
<ThemeToggleItem />
|
|
274
360
|
</CommandMenu.Group>
|
|
275
361
|
</CommandMenu>
|
|
@@ -289,11 +375,19 @@ function AppContent() {
|
|
|
289
375
|
*/
|
|
290
376
|
export default function Root() {
|
|
291
377
|
const location = useLocation();
|
|
378
|
+
const loaderData = useLoaderData<typeof loader>();
|
|
292
379
|
const [queryClient] = useState(() => createAgentNativeQueryClient());
|
|
293
380
|
return (
|
|
294
381
|
<AppProviders
|
|
295
382
|
queryClient={queryClient}
|
|
296
383
|
isPublicPath={isStandalonePublicPath(location.pathname)}
|
|
384
|
+
i18n={{
|
|
385
|
+
catalog: i18nCatalog,
|
|
386
|
+
initialLocale: loaderData.locale,
|
|
387
|
+
initialPreference: loaderData.preference,
|
|
388
|
+
initialMessages: loaderData.messages,
|
|
389
|
+
persistPreference: !isStandalonePublicPath(location.pathname),
|
|
390
|
+
}}
|
|
297
391
|
>
|
|
298
392
|
<AppContent />
|
|
299
393
|
</AppProviders>
|