@agent-native/core 0.97.0 → 0.98.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 +56 -0
- package/corpus/core/docs/content/authentication.mdx +3 -3
- package/corpus/core/docs/content/doctor.mdx +170 -0
- package/corpus/core/docs/content/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/ar-SA/authentication.mdx +2 -2
- package/corpus/core/docs/content/locales/ar-SA/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/ar-SA/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/ar-SA/security.mdx +2 -0
- package/corpus/core/docs/content/locales/de-DE/authentication.mdx +1 -1
- package/corpus/core/docs/content/locales/de-DE/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/de-DE/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/de-DE/security.mdx +2 -0
- package/corpus/core/docs/content/locales/es-ES/authentication.mdx +2 -2
- package/corpus/core/docs/content/locales/es-ES/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/es-ES/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/es-ES/security.mdx +2 -0
- package/corpus/core/docs/content/locales/fr-FR/authentication.mdx +1 -1
- package/corpus/core/docs/content/locales/fr-FR/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/fr-FR/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/fr-FR/security.mdx +2 -0
- package/corpus/core/docs/content/locales/hi-IN/authentication.mdx +2 -2
- package/corpus/core/docs/content/locales/hi-IN/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/hi-IN/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/hi-IN/security.mdx +2 -0
- package/corpus/core/docs/content/locales/ja-JP/authentication.mdx +2 -2
- package/corpus/core/docs/content/locales/ja-JP/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/ja-JP/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/ja-JP/security.mdx +2 -0
- package/corpus/core/docs/content/locales/ko-KR/authentication.mdx +2 -2
- package/corpus/core/docs/content/locales/ko-KR/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/ko-KR/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/ko-KR/security.mdx +2 -0
- package/corpus/core/docs/content/locales/pt-BR/authentication.mdx +2 -2
- package/corpus/core/docs/content/locales/pt-BR/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/pt-BR/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/pt-BR/security.mdx +2 -0
- package/corpus/core/docs/content/locales/zh-CN/authentication.mdx +2 -2
- package/corpus/core/docs/content/locales/zh-CN/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/zh-CN/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-CN/security.mdx +2 -0
- package/corpus/core/docs/content/locales/zh-TW/authentication.mdx +2 -2
- package/corpus/core/docs/content/locales/zh-TW/external-agents.mdx +8 -7
- package/corpus/core/docs/content/locales/zh-TW/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/locales/zh-TW/security.mdx +2 -0
- package/corpus/core/docs/content/mcp-protocol.mdx +1 -1
- package/corpus/core/docs/content/security.mdx +2 -0
- package/corpus/core/package.json +6 -2
- package/corpus/core/scripts/finalize-build.mjs +63 -3
- package/corpus/core/scripts/materialize-source-corpus.mjs +101 -15
- package/corpus/core/src/action-change-marker.ts +8 -1
- package/corpus/core/src/action.ts +42 -0
- package/corpus/core/src/agent/engine/builder-engine.ts +3 -0
- package/corpus/core/src/agent/engine/context-directives-transform.ts +69 -0
- package/corpus/core/src/agent/engine/continuation-dispatch-retry.ts +168 -0
- package/corpus/core/src/agent/engine/tool-call-journal-seed.ts +85 -0
- package/corpus/core/src/agent/production-agent.ts +129 -244
- package/corpus/core/src/changelog/parse.ts +8 -3
- package/corpus/core/src/cli/doctor.ts +9 -3
- package/corpus/core/src/cli/plan-local.ts +10 -2
- package/corpus/core/src/cli/skills-content/assets-skill.ts +83 -0
- package/corpus/core/src/cli/skills-content/canvas.ts +153 -0
- package/corpus/core/src/cli/skills-content/connection.ts +52 -0
- package/corpus/core/src/cli/skills-content/content-skill.ts +109 -0
- package/corpus/core/src/cli/skills-content/design-exploration-skill.ts +118 -0
- package/corpus/core/src/cli/skills-content/design-visual-edit-skill.ts +228 -0
- package/corpus/core/src/cli/skills-content/document-quality.ts +196 -0
- package/corpus/core/src/cli/skills-content/exemplar.ts +69 -0
- package/corpus/core/src/cli/skills-content/help.ts +77 -0
- package/corpus/core/src/cli/skills-content/index.ts +22 -0
- package/corpus/core/src/cli/skills-content/local-files.ts +95 -0
- package/corpus/core/src/cli/skills-content/plan-setup-auth.ts +80 -0
- package/corpus/core/src/cli/skills-content/visual-plan-skill.ts +470 -0
- package/corpus/core/src/cli/skills-content/visual-recap-skill.ts +547 -0
- package/corpus/core/src/cli/skills-content/visualize-repo-skill.ts +93 -0
- package/corpus/core/src/cli/skills-content/wireframe.ts +349 -0
- package/corpus/core/src/cli/skills.ts +27 -2733
- package/corpus/core/src/client/AgentPanel.tsx +8 -8
- package/corpus/core/src/client/AssistantChat.tsx +83 -39
- package/corpus/core/src/client/CommandMenu.tsx +16 -5
- package/corpus/core/src/client/FeedbackButton.tsx +2 -2
- package/corpus/core/src/client/analytics.ts +29 -0
- package/corpus/core/src/client/app-providers.tsx +18 -5
- package/corpus/core/src/client/blocks/library/wireframe-kit.tsx +16 -2
- package/corpus/core/src/client/chat/tool-call-display.tsx +3 -3
- package/corpus/core/src/client/chat-model-groups.ts +28 -0
- package/corpus/core/src/client/composer/PastedTextChip.tsx +1 -1
- package/corpus/core/src/client/composer/RealtimeVoiceMode.tsx +523 -68
- package/corpus/core/src/client/composer/TiptapComposer.tsx +47 -30
- package/corpus/core/src/client/composer/VoiceButton.tsx +22 -5
- package/corpus/core/src/client/composer/index.ts +5 -0
- package/corpus/core/src/client/composer/useRealtimeVoiceMode.tsx +1271 -35
- package/corpus/core/src/client/context-xray/ContextXRayPanel.tsx +5 -2
- package/corpus/core/src/client/extensions/ExtensionEditor.tsx +37 -4
- package/corpus/core/src/client/extensions/ExtensionQueryErrorState.tsx +47 -0
- package/corpus/core/src/client/extensions/ExtensionSlot.tsx +39 -10
- package/corpus/core/src/client/extensions/ExtensionViewer.tsx +44 -6
- package/corpus/core/src/client/extensions/ExtensionsListPage.tsx +12 -3
- package/corpus/core/src/client/extensions/ExtensionsSidebarSection.tsx +49 -11
- package/corpus/core/src/client/index.ts +5 -13
- package/corpus/core/src/client/progress/RunsTray.tsx +23 -4
- package/corpus/core/src/client/settings/SecretsSection.tsx +387 -266
- package/corpus/core/src/client/settings/SettingsPanel.tsx +117 -38
- package/corpus/core/src/client/settings/SettingsTabsPage.tsx +7 -0
- package/corpus/core/src/client/settings/useBuilderStatus.ts +6 -0
- package/corpus/core/src/client/tool-cells/EditCell.tsx +19 -16
- package/corpus/core/src/client/tool-cells/FilesChangedSummary.tsx +26 -23
- package/corpus/core/src/client/tool-cells/WriteCell.tsx +19 -16
- package/corpus/core/src/client/use-action.ts +12 -0
- package/corpus/core/src/client/use-agent-chat-home-handoff.ts +8 -1
- package/corpus/core/src/client/use-agent-engine-configured.ts +17 -3
- package/corpus/core/src/client/use-db-sync.ts +84 -34
- package/corpus/core/src/client/use-pausing-interval.ts +14 -4
- package/corpus/core/src/client/visual-style-controls.tsx +1 -1
- package/corpus/core/src/deploy/build.ts +36 -14
- package/corpus/core/src/integrations/google-docs-poller.ts +23 -2
- package/corpus/core/src/integrations/plugin.ts +10 -0
- package/corpus/core/src/integrations/scope-store.ts +1 -1
- package/corpus/core/src/integrations/usage-budget-store.ts +1 -1
- package/corpus/core/src/integrations/webhook-handler.ts +27 -2
- package/corpus/core/src/jobs/scheduler.ts +28 -2
- package/corpus/core/src/localization/default-messages.ts +51 -1
- package/corpus/core/src/mcp/oauth-token.ts +6 -1
- package/corpus/core/src/mcp-client/workspace-servers.ts +4 -4
- package/corpus/core/src/observability/routes.ts +36 -0
- package/corpus/core/src/observability/sentiment.ts +261 -0
- package/corpus/core/src/observability/store.ts +23 -0
- package/corpus/core/src/observability/traces.ts +49 -63
- package/corpus/core/src/observability/tracking-identity.ts +55 -0
- package/corpus/core/src/observability/types.ts +13 -0
- package/corpus/core/src/secrets/crypto.ts +28 -8
- package/corpus/core/src/secrets/storage.ts +67 -3
- package/corpus/core/src/server/action-change.ts +5 -1
- package/corpus/core/src/server/action-routes.ts +8 -0
- package/corpus/core/src/server/agent-chat/action-filters-a2a.ts +199 -0
- package/corpus/core/src/server/agent-chat/browser-team-tools.ts +510 -0
- package/corpus/core/src/server/agent-chat/context-tools.ts +595 -0
- package/corpus/core/src/server/agent-chat/framework-prompts.ts +470 -0
- package/corpus/core/src/server/agent-chat/lazy-fs.ts +11 -0
- package/corpus/core/src/server/agent-chat/mcp-glue.ts +91 -0
- package/corpus/core/src/server/agent-chat/plugin-options.ts +350 -0
- package/corpus/core/src/server/agent-chat/process-run-failure.ts +62 -0
- package/corpus/core/src/server/agent-chat/prompt-resources.ts +688 -0
- package/corpus/core/src/server/agent-chat/recurring-jobs-runtime.ts +80 -0
- package/corpus/core/src/server/agent-chat/request-surface.ts +71 -0
- package/corpus/core/src/server/agent-chat/run-code-tools.ts +67 -0
- package/corpus/core/src/server/agent-chat/script-entries.ts +779 -0
- package/corpus/core/src/server/agent-chat/shared-thread.ts +301 -0
- package/corpus/core/src/server/agent-chat/skill-frontmatter.ts +41 -0
- package/corpus/core/src/server/agent-chat-plugin.ts +364 -4182
- package/corpus/core/src/server/agent-teams.ts +26 -3
- package/corpus/core/src/server/auth.ts +55 -57
- package/corpus/core/src/server/credential-provider.ts +22 -25
- package/corpus/core/src/server/edge.ts +1 -0
- package/corpus/core/src/server/onboarding-html.ts +1 -16
- package/corpus/core/src/server/poll.ts +1 -0
- package/corpus/core/src/server/realtime-voice.ts +335 -14
- package/corpus/core/src/server/request-origin.ts +6 -2
- package/corpus/core/src/server/ssr-handler.ts +55 -2
- package/corpus/core/src/sharing/access.ts +155 -11
- package/corpus/core/src/sharing/registry.ts +7 -0
- package/corpus/core/src/styles/agent-native.css +17 -16
- package/corpus/core/src/templates/default/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/core/src/templates/default/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/core/src/templates/default/app/i18n/ar-SA.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/de-DE.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/en-US.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/es-ES.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/fr-FR.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/hi-IN.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/ja-JP.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/ko-KR.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/pt-BR.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/zh-CN.ts +6 -0
- package/corpus/core/src/templates/default/app/i18n/zh-TW.ts +6 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +27 -29
- package/corpus/core/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +2 -1
- package/corpus/core/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/core/src/templates/workspace-core/.agents/skills/observability/SKILL.md +32 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/core/src/templates/workspace-core/.agents/skills/secrets/SKILL.md +7 -3
- package/corpus/core/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +39 -9
- package/corpus/core/src/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +25 -0
- package/corpus/core/src/templates/workspace-core/src/server/index.ts +4 -2
- package/corpus/core/src/testing.ts +26 -0
- package/corpus/core/src/triggers/dispatcher.ts +23 -2
- package/corpus/core/src/vite/client.ts +135 -3
- package/corpus/core/tsconfig.cli.json +1 -1
- package/corpus/core/tsconfig.json +5 -1
- package/corpus/templates/analytics/.agents/skills/bigquery/SKILL.md +2 -2
- package/corpus/templates/analytics/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/analytics/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/analytics/.agents/skills/session-replay/SKILL.md +10 -5
- package/corpus/templates/analytics/AGENTS.md +15 -6
- package/corpus/templates/analytics/actions/install-dashboard-template.ts +79 -43
- package/corpus/templates/analytics/actions/list-explorer-dashboards.ts +3 -3
- package/corpus/templates/analytics/actions/list-sql-dashboards.ts +8 -3
- package/corpus/templates/analytics/actions/navigate.ts +59 -5
- package/corpus/templates/analytics/actions/rename-analysis.ts +8 -2
- package/corpus/templates/analytics/actions/rename-dashboard.ts +8 -7
- package/corpus/templates/analytics/actions/view-screen.ts +7 -29
- package/corpus/templates/analytics/app/components/ProviderCorpusJobNotifier.tsx +20 -3
- package/corpus/templates/analytics/app/components/ResourceLoadError.tsx +42 -0
- package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +2 -1
- package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +85 -70
- package/corpus/templates/analytics/app/components/layout/Header.tsx +1 -1
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +128 -95
- package/corpus/templates/analytics/app/components/layout/SidebarLoadError.tsx +24 -0
- package/corpus/templates/analytics/app/global.css +19 -20
- package/corpus/templates/analytics/app/hooks/use-dashboard-views.ts +15 -5
- package/corpus/templates/analytics/app/i18n/zh-TW.ts +4 -0
- package/corpus/templates/analytics/app/i18n-data.ts +40 -0
- package/corpus/templates/analytics/app/lib/provider-corpus-job-sync.ts +26 -0
- package/corpus/templates/analytics/app/pages/Settings.tsx +41 -343
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/SqlPreview.tsx +36 -20
- package/corpus/templates/analytics/app/pages/adhoc/explorer/index.tsx +34 -20
- package/corpus/templates/analytics/app/pages/adhoc/explorer/use-explorer-config.ts +42 -41
- package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +43 -36
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/ViewsMenu.tsx +11 -2
- package/corpus/templates/analytics/app/pages/monitoring/ErrorsPanel.tsx +38 -7
- package/corpus/templates/analytics/app/pages/monitoring/MonitoringPage.tsx +1 -1
- package/corpus/templates/analytics/app/pages/monitoring/errors/i18n.ts +3 -0
- package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +333 -272
- package/corpus/templates/analytics/app/pages/sessions/SessionDevToolsPanel.tsx +72 -17
- package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +297 -108
- package/corpus/templates/analytics/app/root.tsx +40 -8
- package/corpus/templates/analytics/app/routes/_index.tsx +14 -2
- package/corpus/templates/analytics/changelog/2026-06-24-first-party-signup-and-pageview-panels-now-honor-dashboard-filters.md +2 -1
- package/corpus/templates/analytics/changelog/2026-06-25-referrer-dashboard-panels-show-external-domains.md +2 -1
- package/corpus/templates/analytics/changelog/2026-07-03-agent-llm-observability-dashboard.md +1 -1
- package/corpus/templates/analytics/changelog/2026-07-06-mobile-chat-header-is-more-compact-and-the-menu-button-opens-navigation.md +1 -0
- package/corpus/templates/analytics/changelog/2026-07-08-dashboard-history-and-chat-context.md +1 -0
- package/corpus/templates/analytics/changelog/2026-07-08-settings-are-cleaner-searchable-and-alerts-have-their-own-tab.md +1 -0
- package/corpus/templates/analytics/changelog/2026-07-08-sidebar-sections-stay-collapsed-until-opened.md +1 -0
- package/corpus/templates/analytics/changelog/2026-07-11-agent-feedback-sentiment-dashboard.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-analytics-chats-now-start-faster-by-loading-metric-definitio.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-analytics-no-longer-repeatedly-restarts-background-requests-.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-analytics-only-asks-for-replay-storage-when-you-enable-sessi.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-charts-now-show-their-loading-skeleton-while-refreshing.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-command-and-sql-previews-now-respond-without-lag.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-command-search-now-reports-loading-failures-and-lets-you-ret.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-dashboard-navigation-now-loads-faster-and-reports-request-fa.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-inferred-message-sentiment-dashboard.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-microphone-settings-from-realtime-voice-mode-now-open-the-vo.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-more-dashboard-edit-paths-are-now-safe-against-simultaneous-.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-realtime-voice-now-shows-a-clear-connection-indicator-comple.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-renaming-a-dashboard-is-now-safe-against-simultaneous-agent-.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-renaming-an-analysis-is-now-safe-against-simultaneous-edits.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-replay-event-counts-stay-hidden-until-recordings-finish-load.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-replay-storage-key-mismatches-show-actionable-setup-guidance.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-replay-timelines-group-continuous-scrolling-and-dev-tools-co.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-session-filters-now-stay-compact-in-a-settings-menu-at-mediu.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-session-replay-console-errors-now-link-to-matching-issues-or.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-session-replays-load-large-recordings-faster-and-surface-fai.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-session-replays-preserve-recorded-styles-and-viewport-layout.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-session-replays-stay-centered-instead-of-clipping-wide-recor.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-workspace-mounted-analytics-now-opens-ask-reliably-and-route.md +6 -0
- package/corpus/templates/analytics/docs/schemas/first-party-analytics.md +37 -3
- package/corpus/templates/analytics/package.json +1 -1
- package/corpus/templates/analytics/seeds/dashboards/agent-native-templates-first-party.json +37 -1
- package/corpus/templates/analytics/server/handlers/session-replay.ts +57 -0
- package/corpus/templates/analytics/server/lib/dashboard-catalog.ts +1 -24
- package/corpus/templates/analytics/server/lib/dashboard-seeds.ts +0 -5
- package/corpus/templates/analytics/server/lib/dashboards-store.ts +289 -20
- package/corpus/templates/analytics/server/lib/data-dictionary-context.ts +106 -34
- package/corpus/templates/analytics/server/lib/demo-dashboards.ts +20 -4
- package/corpus/templates/analytics/server/lib/session-replay-agent-context.ts +12 -0
- package/corpus/templates/analytics/server/lib/session-replay.ts +208 -2
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +11 -39
- package/corpus/templates/analytics/server/plugins/onboarding.ts +7 -79
- package/corpus/templates/analytics/server/routes/api/session-replay/recordings/[recordingId]/chunks.get.ts +1 -0
- package/corpus/templates/assets/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/assets/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/assets/app/components/create/RecentDraftsSection.tsx +30 -4
- package/corpus/templates/assets/app/global.css +4 -4
- package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +0 -1
- package/corpus/templates/assets/app/routes/library.tsx +49 -6
- package/corpus/templates/assets/changelog/2026-07-11-library-load-failures-now-show-a-retry-action.md +6 -0
- package/corpus/templates/brain/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/brain/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/brain/app/global.css +5 -5
- package/corpus/templates/brain/app/root.tsx +0 -3
- package/corpus/templates/calendar/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/calendar/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/calendar/.env.example +5 -0
- package/corpus/templates/calendar/app/components/calendar/EventCard.tsx +2 -2
- package/corpus/templates/calendar/app/i18n/zh-TW.ts +2 -0
- package/corpus/templates/calendar/app/i18n-data.ts +20 -0
- package/corpus/templates/calendar/app/pages/BookingLinksPage.tsx +37 -1
- package/corpus/templates/calendar/app/pages/BookingsList.tsx +20 -3
- package/corpus/templates/calendar/app/root.tsx +1 -0
- package/corpus/templates/calendar/changelog/2026-07-11-booking-load-failures-now-show-a-retry-action.md +6 -0
- package/corpus/templates/calendar/changelog/2026-07-11-event-cards-give-subtle-press-feedback-and-smoother-hover.md +6 -0
- package/corpus/templates/chat/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/chat/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/clips/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/clips/actions/decline-invite.ts +8 -0
- package/corpus/templates/clips/app/components/library/folder-tree.tsx +209 -187
- package/corpus/templates/clips/app/components/meetings/meeting-card.tsx +2 -2
- package/corpus/templates/clips/app/components/player/reactions-tray.tsx +17 -5
- package/corpus/templates/clips/app/components/player/scrubber.tsx +5 -3
- package/corpus/templates/clips/app/components/recorder/pre-record-panel.tsx +2 -2
- package/corpus/templates/clips/app/components/workspace/insights-hub.tsx +119 -95
- package/corpus/templates/clips/app/global.css +45 -0
- package/corpus/templates/clips/app/hooks/use-auto-title.ts +74 -8
- package/corpus/templates/clips/app/hooks/use-library.ts +12 -25
- package/corpus/templates/clips/app/root.tsx +4 -0
- package/corpus/templates/clips/app/routes/_app.notifications.tsx +23 -2
- package/corpus/templates/clips/app/routes/_app.settings._index.tsx +20 -22
- package/corpus/templates/clips/app/routes/_app.trash.tsx +24 -2
- package/corpus/templates/clips/changelog/2026-07-11-controls-and-folders-now-move-more-smoothly.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-11-declining-an-invitation-now-requires-being-its-recipient.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-11-generated-titles-no-longer-cause-continuous-background-refreshes.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-11-recording-overlays-are-lighter-weight-and-no-longer-cause-pa.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-11-s3-storage-setup-stays-collapsed-until-you-choose-it-as-the-.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-11-workspace-load-failures-now-show-a-retry-action.md +6 -0
- package/corpus/templates/clips/chrome-extension/src/overlay.css +34 -5
- package/corpus/templates/clips/chrome-extension/src/styles.css +2 -2
- package/corpus/templates/clips/desktop/src/styles.css +71 -26
- package/corpus/templates/content/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/content/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/content/actions/move-document.ts +34 -18
- package/corpus/templates/content/app/components/QueryErrorState.tsx +39 -0
- package/corpus/templates/content/app/components/editor/LinkHoverPreview.tsx +1 -1
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +225 -1435
- package/corpus/templates/content/app/components/editor/database/GalleryView.tsx +368 -0
- package/corpus/templates/content/app/components/editor/database/ListView.tsx +353 -0
- package/corpus/templates/content/app/components/editor/database/TimelineView.tsx +580 -0
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +11 -2
- package/corpus/templates/content/app/global.css +19 -19
- package/corpus/templates/content/app/hooks/use-comments.ts +0 -1
- package/corpus/templates/content/app/root.tsx +2 -2
- package/corpus/templates/content/app/routes/_app._index.tsx +11 -1
- package/corpus/templates/content/changelog/2026-07-11-comments-now-update-from-live-collaboration-events-without-c.md +6 -0
- package/corpus/templates/content/changelog/2026-07-11-document-load-failures-now-show-a-retry-action.md +6 -0
- package/corpus/templates/content/changelog/2026-07-11-editor-toggle-feedback-now-feels-more-responsive.md +6 -0
- package/corpus/templates/content/changelog/2026-07-11-moving-documents-at-the-same-time-no-longer-scrambles-their-.md +6 -0
- package/corpus/templates/content/changelog/2026-07-11-public-document-chats-now-start-faster-while-keeping-full-do.md +6 -0
- package/corpus/templates/content/changelog/2026-07-11-reopening-a-comment-now-uses-consistent-permissions-everywhe.md +6 -0
- package/corpus/templates/content/changelog/2026-07-11-sidebar-resizing-now-tracks-your-cursor-instantly-instead-of.md +6 -0
- package/corpus/templates/content/server/lib/public-documents.ts +47 -10
- package/corpus/templates/content/server/routes/api/comments/[id].patch.ts +24 -24
- package/corpus/templates/design/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/design/app/components/QueryErrorState.tsx +24 -0
- package/corpus/templates/design/app/components/design/CanvasContextMenu.tsx +1 -1
- package/corpus/templates/design/app/components/design/DesignImportPanel.tsx +5 -2
- package/corpus/templates/design/app/components/design/EditPanel.tsx +326 -319
- package/corpus/templates/design/app/components/design/LayersPanel.tsx +198 -193
- package/corpus/templates/design/app/components/design/edit-panel/panel-primitives.tsx +11 -4
- package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +1 -1
- package/corpus/templates/design/app/components/layout/Header.tsx +1 -1
- package/corpus/templates/design/app/components/layout/Layout.tsx +1 -1
- package/corpus/templates/design/app/pages/DesignSystems.tsx +7 -1
- package/corpus/templates/design/app/pages/Index.tsx +14 -2
- package/corpus/templates/design/app/pages/Present.tsx +16 -3
- package/corpus/templates/design/app/pages/Templates.tsx +10 -4
- package/corpus/templates/design/app/pages/design-editor/canvas-primitive-insert.ts +484 -0
- package/corpus/templates/design/app/pages/design-editor/clone-and-pen-edit.ts +378 -0
- package/corpus/templates/design/app/pages/design-editor/design-data-geometry-utils.ts +138 -0
- package/corpus/templates/design/app/pages/design-editor/dom-utils.ts +15 -0
- package/corpus/templates/design/app/pages/design-editor/generation-prompt-directives.ts +180 -0
- package/corpus/templates/design/app/pages/design-editor/html-layer-positioning.ts +226 -0
- package/corpus/templates/design/app/pages/design-editor/png-export-render.ts +348 -0
- package/corpus/templates/design/app/pages/design-editor/screen-command-utils.ts +160 -0
- package/corpus/templates/design/app/pages/design-editor/text-edit-utils.ts +238 -0
- package/corpus/templates/design/app/pages/design-editor/tool-state.ts +23 -1
- package/corpus/templates/design/app/pages/design-editor/types.ts +25 -0
- package/corpus/templates/design/app/root.tsx +10 -1
- package/corpus/templates/design/changelog/2026-07-11-canvas-context-menus-now-open-without-motion-jitter.md +6 -0
- package/corpus/templates/design/changelog/2026-07-11-design-load-failures-now-show-a-retry-action.md +6 -0
- package/corpus/templates/design/changelog/2026-07-11-inspector-tooltips-appear-instantly-as-you-sweep-across-icon.md +6 -0
- package/corpus/templates/dispatch/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/dispatch/app/i18n/zh-TW.ts +10 -0
- package/corpus/templates/dispatch/app/i18n-data.ts +123 -0
- package/corpus/templates/dispatch/app/routes/integrations.tsx +163 -144
- package/corpus/templates/dispatch/changelog/2026-07-11-dispatch-mcp-connections-now-start-with-safer-app-access-and.md +6 -0
- package/corpus/templates/dispatch/changelog/2026-07-11-overview-and-chat-now-share-a-cleaner-more-stable-flow.md +6 -0
- package/corpus/templates/dispatch/changelog/2026-07-11-query-errors-now-show-a-retry-option.md +6 -0
- package/corpus/templates/forms/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/forms/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/forms/app/components/layout/Sidebar.tsx +3 -3
- package/corpus/templates/forms/app/root.tsx +34 -8
- package/corpus/templates/macros/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/macros/app/components/DailyProgress.tsx +25 -5
- package/corpus/templates/macros/app/components/QueryErrorState.tsx +31 -0
- package/corpus/templates/macros/app/components/WeightTracker.tsx +5 -1
- package/corpus/templates/macros/app/components/layout/AppLayout.tsx +1 -2
- package/corpus/templates/macros/app/components/ui/button.tsx +1 -1
- package/corpus/templates/macros/app/components/ui/progress.tsx +1 -1
- package/corpus/templates/macros/app/components/ui/tabs.tsx +1 -1
- package/corpus/templates/macros/app/i18n/ar-SA.ts +2 -0
- package/corpus/templates/macros/app/i18n/de-DE.ts +2 -0
- package/corpus/templates/macros/app/i18n/en-US.ts +2 -0
- package/corpus/templates/macros/app/i18n/es-ES.ts +2 -0
- package/corpus/templates/macros/app/i18n/fr-FR.ts +2 -0
- package/corpus/templates/macros/app/i18n/hi-IN.ts +2 -0
- package/corpus/templates/macros/app/i18n/ja-JP.ts +2 -0
- package/corpus/templates/macros/app/i18n/ko-KR.ts +2 -0
- package/corpus/templates/macros/app/i18n/pt-BR.ts +2 -0
- package/corpus/templates/macros/app/i18n/zh-CN.ts +2 -0
- package/corpus/templates/macros/app/i18n/zh-TW.ts +2 -0
- package/corpus/templates/macros/app/root.tsx +0 -3
- package/corpus/templates/macros/app/routes/_index.tsx +22 -12
- package/corpus/templates/macros/app/routes/analytics.tsx +31 -10
- package/corpus/templates/macros/changelog/2026-07-11-daily-tracking-now-loads-and-updates-more-quickly.md +6 -0
- package/corpus/templates/macros/changelog/2026-07-11-data-load-failures-now-show-a-clear-error-with-a-retry-actio.md +6 -0
- package/corpus/templates/mail/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/mail/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/mail/.env.example +16 -11
- package/corpus/templates/mail/actions/list-emails.ts +39 -35
- package/corpus/templates/mail/app/components/email/ComposeModal.tsx +58 -6
- package/corpus/templates/mail/app/components/email/EmailListItem.tsx +35 -2
- package/corpus/templates/mail/app/components/layout/AppLayout.tsx +113 -104
- package/corpus/templates/mail/app/hooks/use-compose-state.ts +1 -0
- package/corpus/templates/mail/app/root.tsx +9 -22
- package/corpus/templates/mail/changelog/2026-07-11-compose-and-navigation-motion-now-feel-faster-and-smoother.md +6 -0
- package/corpus/templates/mail/changelog/2026-07-11-swipe-to-archive-or-snooze-now-responds-to-quick-flicks-not-.md +6 -0
- package/corpus/templates/mail/changelog/2026-07-11-the-assistant-now-sees-the-same-inbox-you-do-snoozed-mail-st.md +6 -0
- package/corpus/templates/mail/server/handlers/emails.ts +25 -69
- package/corpus/templates/mail/server/lib/list-inbox-emails.ts +169 -0
- package/corpus/templates/plan/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/plan/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/plan/.env.example +4 -0
- package/corpus/templates/plan/actions/create-plan-design.ts +89 -81
- package/corpus/templates/plan/actions/create-prototype-plan.ts +72 -59
- package/corpus/templates/plan/actions/create-ui-plan.ts +70 -55
- package/corpus/templates/plan/actions/create-visual-plan.ts +65 -51
- package/corpus/templates/plan/actions/update-local-plan-folder.ts +43 -30
- package/corpus/templates/plan/actions/update-visual-plan.ts +81 -64
- package/corpus/templates/plan/app/components/layout/Sidebar.tsx +17 -0
- package/corpus/templates/plan/app/components/ui/tabs.tsx +1 -1
- package/corpus/templates/plan/app/hooks/use-navigation-state.ts +5 -2
- package/corpus/templates/plan/app/hooks/use-plans.ts +6 -13
- package/corpus/templates/plan/app/i18n/ar-SA.ts +10 -0
- package/corpus/templates/plan/app/i18n/de-DE.ts +10 -0
- package/corpus/templates/plan/app/i18n/en-US.ts +10 -0
- package/corpus/templates/plan/app/i18n/es-ES.ts +10 -0
- package/corpus/templates/plan/app/i18n/fr-FR.ts +10 -0
- package/corpus/templates/plan/app/i18n/hi-IN.ts +10 -0
- package/corpus/templates/plan/app/i18n/ja-JP.ts +10 -0
- package/corpus/templates/plan/app/i18n/ko-KR.ts +10 -0
- package/corpus/templates/plan/app/i18n/pt-BR.ts +10 -0
- package/corpus/templates/plan/app/i18n/zh-CN.ts +10 -0
- package/corpus/templates/plan/app/i18n/zh-TW.ts +10 -0
- package/corpus/templates/plan/app/lib/plan-local-bridge.ts +80 -1
- package/corpus/templates/plan/app/pages/PlansPage.tsx +157 -31
- package/corpus/templates/plan/app/root.tsx +11 -0
- package/corpus/templates/plan/changelog/2026-07-11-local-plans-now-explain-and-recover-from-browser-permission-.md +6 -0
- package/corpus/templates/plan/changelog/2026-07-11-plan-edits-now-save-atomically-and-can-no-longer-partially-a.md +6 -0
- package/corpus/templates/plan/changelog/2026-07-11-plan-lists-now-show-a-clear-error-with-a-retry-action-when-t.md +6 -0
- package/corpus/templates/plan/changelog/2026-07-11-plan-refreshes-only-when-content-changes.md +6 -0
- package/corpus/templates/plan/shared/plan-content.ts +546 -260
- package/corpus/templates/slides/.agents/skills/frontend-design/SKILL.md +1 -1
- package/corpus/templates/slides/actions/delete-slide-comment.ts +49 -0
- package/corpus/templates/slides/actions/update-slide-comment.ts +93 -0
- package/corpus/templates/slides/actions/view-screen.ts +14 -6
- package/corpus/templates/slides/app/components/comments/SlideCommentsPanel.tsx +37 -11
- package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +1 -1
- package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +2 -2
- package/corpus/templates/slides/app/components/editor/GenerateSlidesDialog.tsx +2 -2
- package/corpus/templates/slides/app/components/layout/Header.tsx +1 -1
- package/corpus/templates/slides/app/components/presentation/PresentationView.tsx +4 -2
- package/corpus/templates/slides/app/components/visual-editor/CanvasCommentPins.tsx +4 -3
- package/corpus/templates/slides/app/context/DeckContext.tsx +10 -0
- package/corpus/templates/slides/app/hooks/use-slide-comments.ts +7 -31
- package/corpus/templates/slides/app/i18n/ar-SA.ts +6 -0
- package/corpus/templates/slides/app/i18n/de-DE.ts +6 -0
- package/corpus/templates/slides/app/i18n/en-US.ts +6 -0
- package/corpus/templates/slides/app/i18n/es-ES.ts +6 -0
- package/corpus/templates/slides/app/i18n/fr-FR.ts +6 -0
- package/corpus/templates/slides/app/i18n/hi-IN.ts +6 -0
- package/corpus/templates/slides/app/i18n/ja-JP.ts +6 -0
- package/corpus/templates/slides/app/i18n/ko-KR.ts +6 -0
- package/corpus/templates/slides/app/i18n/pt-BR.ts +6 -0
- package/corpus/templates/slides/app/i18n/zh-CN.ts +5 -0
- package/corpus/templates/slides/app/i18n/zh-TW.ts +5 -0
- package/corpus/templates/slides/app/pages/DesignSystems.tsx +23 -2
- package/corpus/templates/slides/app/pages/Index.tsx +29 -1
- package/corpus/templates/slides/changelog/2026-07-11-comment-load-failures-now-show-a-retry-action-instead-of-say.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-11-comment-pins-now-clear-with-a-faster-smoother-confirmation.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-11-comments-now-update-from-live-collaboration-events-without-c.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-11-deck-and-design-system-load-failures-now-show-a-retry-action.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-11-editor-toggles-and-toolbar-menus-now-animate-smoothly.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-11-the-assistant-can-now-resolve-reopen-and-delete-slide-commen.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-11-viewing-slides-no-longer-loads-every-deck-s-full-contents-in.md +6 -0
- package/corpus/templates/slides/server/routes/api/comments/[id].delete.ts +29 -48
- package/corpus/templates/slides/server/routes/api/comments/[id].patch.ts +29 -65
- package/dist/action-change-marker.d.ts +1 -0
- package/dist/action-change-marker.d.ts.map +1 -1
- package/dist/action-change-marker.js +7 -1
- package/dist/action-change-marker.js.map +1 -1
- package/dist/action.d.ts +23 -0
- package/dist/action.d.ts.map +1 -1
- package/dist/action.js +13 -0
- package/dist/action.js.map +1 -1
- package/dist/agent/engine/builder-engine.d.ts.map +1 -1
- package/dist/agent/engine/builder-engine.js +3 -0
- package/dist/agent/engine/builder-engine.js.map +1 -1
- package/dist/agent/engine/context-directives-transform.d.ts +25 -0
- package/dist/agent/engine/context-directives-transform.d.ts.map +1 -0
- package/dist/agent/engine/context-directives-transform.js +53 -0
- package/dist/agent/engine/context-directives-transform.js.map +1 -0
- package/dist/agent/engine/continuation-dispatch-retry.d.ts +40 -0
- package/dist/agent/engine/continuation-dispatch-retry.d.ts.map +1 -0
- package/dist/agent/engine/continuation-dispatch-retry.js +109 -0
- package/dist/agent/engine/continuation-dispatch-retry.js.map +1 -0
- package/dist/agent/engine/tool-call-journal-seed.d.ts +46 -0
- package/dist/agent/engine/tool-call-journal-seed.d.ts.map +1 -0
- package/dist/agent/engine/tool-call-journal-seed.js +60 -0
- package/dist/agent/engine/tool-call-journal-seed.js.map +1 -0
- package/dist/agent/production-agent.d.ts +7 -0
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +102 -222
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/changelog/parse.d.ts +4 -2
- package/dist/changelog/parse.d.ts.map +1 -1
- package/dist/changelog/parse.js +5 -3
- package/dist/changelog/parse.js.map +1 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +7 -3
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/plan-local.d.ts.map +1 -1
- package/dist/cli/plan-local.js +8 -2
- package/dist/cli/plan-local.js.map +1 -1
- package/dist/cli/skills-content/assets-skill.d.ts +2 -0
- package/dist/cli/skills-content/assets-skill.d.ts.map +1 -0
- package/dist/cli/skills-content/assets-skill.js +84 -0
- package/dist/cli/skills-content/assets-skill.js.map +1 -0
- package/dist/cli/skills-content/canvas.d.ts +4 -0
- package/dist/cli/skills-content/canvas.d.ts.map +1 -0
- package/dist/cli/skills-content/canvas.js +152 -0
- package/dist/cli/skills-content/canvas.js.map +1 -0
- package/dist/cli/skills-content/connection.d.ts +2 -0
- package/dist/cli/skills-content/connection.d.ts.map +1 -0
- package/dist/cli/skills-content/connection.js +53 -0
- package/dist/cli/skills-content/connection.js.map +1 -0
- package/dist/cli/skills-content/content-skill.d.ts +2 -0
- package/dist/cli/skills-content/content-skill.d.ts.map +1 -0
- package/dist/cli/skills-content/content-skill.js +110 -0
- package/dist/cli/skills-content/content-skill.js.map +1 -0
- package/dist/cli/skills-content/design-exploration-skill.d.ts +2 -0
- package/dist/cli/skills-content/design-exploration-skill.d.ts.map +1 -0
- package/dist/cli/skills-content/design-exploration-skill.js +119 -0
- package/dist/cli/skills-content/design-exploration-skill.js.map +1 -0
- package/dist/cli/skills-content/design-visual-edit-skill.d.ts +2 -0
- package/dist/cli/skills-content/design-visual-edit-skill.d.ts.map +1 -0
- package/dist/cli/skills-content/design-visual-edit-skill.js +229 -0
- package/dist/cli/skills-content/design-visual-edit-skill.js.map +1 -0
- package/dist/cli/skills-content/document-quality.d.ts +4 -0
- package/dist/cli/skills-content/document-quality.d.ts.map +1 -0
- package/dist/cli/skills-content/document-quality.js +195 -0
- package/dist/cli/skills-content/document-quality.js.map +1 -0
- package/dist/cli/skills-content/exemplar.d.ts +4 -0
- package/dist/cli/skills-content/exemplar.d.ts.map +1 -0
- package/dist/cli/skills-content/exemplar.js +68 -0
- package/dist/cli/skills-content/exemplar.js.map +1 -0
- package/dist/cli/skills-content/help.d.ts +2 -0
- package/dist/cli/skills-content/help.d.ts.map +1 -0
- package/dist/cli/skills-content/help.js +78 -0
- package/dist/cli/skills-content/help.js.map +1 -0
- package/dist/cli/skills-content/index.d.ts +23 -0
- package/dist/cli/skills-content/index.d.ts.map +1 -0
- package/dist/cli/skills-content/index.js +23 -0
- package/dist/cli/skills-content/index.js.map +1 -0
- package/dist/cli/skills-content/local-files.d.ts +2 -0
- package/dist/cli/skills-content/local-files.d.ts.map +1 -0
- package/dist/cli/skills-content/local-files.js +96 -0
- package/dist/cli/skills-content/local-files.js.map +1 -0
- package/dist/cli/skills-content/plan-setup-auth.d.ts +9 -0
- package/dist/cli/skills-content/plan-setup-auth.d.ts.map +1 -0
- package/dist/cli/skills-content/plan-setup-auth.js +81 -0
- package/dist/cli/skills-content/plan-setup-auth.js.map +1 -0
- package/dist/cli/skills-content/visual-plan-skill.d.ts +2 -0
- package/dist/cli/skills-content/visual-plan-skill.d.ts.map +1 -0
- package/dist/cli/skills-content/visual-plan-skill.js +471 -0
- package/dist/cli/skills-content/visual-plan-skill.js.map +1 -0
- package/dist/cli/skills-content/visual-recap-skill.d.ts +2 -0
- package/dist/cli/skills-content/visual-recap-skill.d.ts.map +1 -0
- package/dist/cli/skills-content/visual-recap-skill.js +548 -0
- package/dist/cli/skills-content/visual-recap-skill.js.map +1 -0
- package/dist/cli/skills-content/visualize-repo-skill.d.ts +2 -0
- package/dist/cli/skills-content/visualize-repo-skill.d.ts.map +1 -0
- package/dist/cli/skills-content/visualize-repo-skill.js +94 -0
- package/dist/cli/skills-content/visualize-repo-skill.js.map +1 -0
- package/dist/cli/skills-content/wireframe.d.ts +4 -0
- package/dist/cli/skills-content/wireframe.d.ts.map +1 -0
- package/dist/cli/skills-content/wireframe.js +347 -0
- package/dist/cli/skills-content/wireframe.js.map +1 -0
- package/dist/cli/skills.d.ts +2 -10
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +2 -2710
- package/dist/cli/skills.js.map +1 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +6 -5
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/AssistantChat.d.ts +7 -0
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +62 -40
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/CommandMenu.d.ts.map +1 -1
- package/dist/client/CommandMenu.js +15 -3
- package/dist/client/CommandMenu.js.map +1 -1
- package/dist/client/FeedbackButton.js +2 -2
- package/dist/client/FeedbackButton.js.map +1 -1
- package/dist/client/analytics.d.ts.map +1 -1
- package/dist/client/analytics.js +26 -0
- package/dist/client/analytics.js.map +1 -1
- package/dist/client/app-providers.d.ts +13 -5
- package/dist/client/app-providers.d.ts.map +1 -1
- package/dist/client/app-providers.js +9 -6
- package/dist/client/app-providers.js.map +1 -1
- package/dist/client/blocks/library/wireframe-kit.d.ts +2 -0
- package/dist/client/blocks/library/wireframe-kit.d.ts.map +1 -1
- package/dist/client/blocks/library/wireframe-kit.js +9 -2
- package/dist/client/blocks/library/wireframe-kit.js.map +1 -1
- package/dist/client/chat/tool-call-display.d.ts +4 -0
- package/dist/client/chat/tool-call-display.d.ts.map +1 -1
- package/dist/client/chat/tool-call-display.js +3 -3
- package/dist/client/chat/tool-call-display.js.map +1 -1
- package/dist/client/chat-model-groups.d.ts.map +1 -1
- package/dist/client/chat-model-groups.js +24 -0
- package/dist/client/chat-model-groups.js.map +1 -1
- package/dist/client/composer/PastedTextChip.js +1 -1
- package/dist/client/composer/PastedTextChip.js.map +1 -1
- package/dist/client/composer/RealtimeVoiceMode.d.ts +40 -2
- package/dist/client/composer/RealtimeVoiceMode.d.ts.map +1 -1
- package/dist/client/composer/RealtimeVoiceMode.js +186 -35
- package/dist/client/composer/RealtimeVoiceMode.js.map +1 -1
- package/dist/client/composer/TiptapComposer.d.ts +4 -0
- package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
- package/dist/client/composer/TiptapComposer.js +48 -30
- package/dist/client/composer/TiptapComposer.js.map +1 -1
- package/dist/client/composer/VoiceButton.d.ts +2 -0
- package/dist/client/composer/VoiceButton.d.ts.map +1 -1
- package/dist/client/composer/VoiceButton.js +9 -3
- package/dist/client/composer/VoiceButton.js.map +1 -1
- package/dist/client/composer/index.d.ts +2 -2
- package/dist/client/composer/index.d.ts.map +1 -1
- package/dist/client/composer/index.js +1 -1
- package/dist/client/composer/index.js.map +1 -1
- package/dist/client/composer/useRealtimeVoiceMode.d.ts +104 -2
- package/dist/client/composer/useRealtimeVoiceMode.d.ts.map +1 -1
- package/dist/client/composer/useRealtimeVoiceMode.js +1015 -35
- package/dist/client/composer/useRealtimeVoiceMode.js.map +1 -1
- package/dist/client/context-xray/ContextXRayPanel.d.ts.map +1 -1
- package/dist/client/context-xray/ContextXRayPanel.js +4 -1
- package/dist/client/context-xray/ContextXRayPanel.js.map +1 -1
- package/dist/client/extensions/ExtensionEditor.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionEditor.js +15 -5
- package/dist/client/extensions/ExtensionEditor.js.map +1 -1
- package/dist/client/extensions/ExtensionQueryErrorState.d.ts +8 -0
- package/dist/client/extensions/ExtensionQueryErrorState.d.ts.map +1 -0
- package/dist/client/extensions/ExtensionQueryErrorState.js +11 -0
- package/dist/client/extensions/ExtensionQueryErrorState.js.map +1 -0
- package/dist/client/extensions/ExtensionSlot.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionSlot.js +17 -7
- package/dist/client/extensions/ExtensionSlot.js.map +1 -1
- package/dist/client/extensions/ExtensionViewer.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionViewer.js +17 -7
- package/dist/client/extensions/ExtensionViewer.js.map +1 -1
- package/dist/client/extensions/ExtensionsListPage.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionsListPage.js +5 -3
- package/dist/client/extensions/ExtensionsListPage.js.map +1 -1
- package/dist/client/extensions/ExtensionsSidebarSection.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionsSidebarSection.js +21 -8
- package/dist/client/extensions/ExtensionsSidebarSection.js.map +1 -1
- package/dist/client/index.d.ts +1 -3
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +1 -6
- package/dist/client/index.js.map +1 -1
- package/dist/client/progress/RunsTray.d.ts.map +1 -1
- package/dist/client/progress/RunsTray.js +17 -4
- package/dist/client/progress/RunsTray.js.map +1 -1
- package/dist/client/settings/SecretsSection.d.ts +2 -3
- package/dist/client/settings/SecretsSection.d.ts.map +1 -1
- package/dist/client/settings/SecretsSection.js +46 -22
- package/dist/client/settings/SecretsSection.js.map +1 -1
- package/dist/client/settings/SettingsPanel.d.ts +9 -0
- package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
- package/dist/client/settings/SettingsPanel.js +46 -12
- package/dist/client/settings/SettingsPanel.js.map +1 -1
- package/dist/client/settings/SettingsTabsPage.d.ts.map +1 -1
- package/dist/client/settings/SettingsTabsPage.js +4 -0
- package/dist/client/settings/SettingsTabsPage.js.map +1 -1
- package/dist/client/settings/useBuilderStatus.d.ts +2 -0
- package/dist/client/settings/useBuilderStatus.d.ts.map +1 -1
- package/dist/client/settings/useBuilderStatus.js +4 -0
- package/dist/client/settings/useBuilderStatus.js.map +1 -1
- package/dist/client/tool-cells/EditCell.d.ts.map +1 -1
- package/dist/client/tool-cells/EditCell.js +2 -1
- package/dist/client/tool-cells/EditCell.js.map +1 -1
- package/dist/client/tool-cells/FilesChangedSummary.d.ts.map +1 -1
- package/dist/client/tool-cells/FilesChangedSummary.js +2 -1
- package/dist/client/tool-cells/FilesChangedSummary.js.map +1 -1
- package/dist/client/tool-cells/WriteCell.d.ts.map +1 -1
- package/dist/client/tool-cells/WriteCell.js +2 -1
- package/dist/client/tool-cells/WriteCell.js.map +1 -1
- package/dist/client/use-action.d.ts +2 -0
- package/dist/client/use-action.d.ts.map +1 -1
- package/dist/client/use-action.js +10 -0
- package/dist/client/use-action.js.map +1 -1
- package/dist/client/use-agent-chat-home-handoff.d.ts +2 -0
- package/dist/client/use-agent-chat-home-handoff.d.ts.map +1 -1
- package/dist/client/use-agent-chat-home-handoff.js +7 -1
- package/dist/client/use-agent-chat-home-handoff.js.map +1 -1
- package/dist/client/use-agent-engine-configured.d.ts.map +1 -1
- package/dist/client/use-agent-engine-configured.js +17 -3
- package/dist/client/use-agent-engine-configured.js.map +1 -1
- package/dist/client/use-db-sync.d.ts +8 -2
- package/dist/client/use-db-sync.d.ts.map +1 -1
- package/dist/client/use-db-sync.js +57 -32
- package/dist/client/use-db-sync.js.map +1 -1
- package/dist/client/use-pausing-interval.d.ts.map +1 -1
- package/dist/client/use-pausing-interval.js +16 -4
- package/dist/client/use-pausing-interval.js.map +1 -1
- package/dist/client/visual-style-controls.js +1 -1
- package/dist/client/visual-style-controls.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/deploy/build.d.ts.map +1 -1
- package/dist/deploy/build.js +36 -14
- package/dist/deploy/build.js.map +1 -1
- package/dist/integrations/google-docs-poller.d.ts +7 -0
- package/dist/integrations/google-docs-poller.d.ts.map +1 -1
- package/dist/integrations/google-docs-poller.js +13 -3
- package/dist/integrations/google-docs-poller.js.map +1 -1
- package/dist/integrations/plugin.d.ts.map +1 -1
- package/dist/integrations/plugin.js +10 -0
- package/dist/integrations/plugin.js.map +1 -1
- package/dist/integrations/scope-store.js +1 -1
- package/dist/integrations/scope-store.js.map +1 -1
- package/dist/integrations/usage-budget-store.js +1 -1
- package/dist/integrations/usage-budget-store.js.map +1 -1
- package/dist/integrations/webhook-handler.d.ts +11 -0
- package/dist/integrations/webhook-handler.d.ts.map +1 -1
- package/dist/integrations/webhook-handler.js +16 -4
- package/dist/integrations/webhook-handler.js.map +1 -1
- package/dist/jobs/scheduler.d.ts +12 -0
- package/dist/jobs/scheduler.d.ts.map +1 -1
- package/dist/jobs/scheduler.js +13 -3
- package/dist/jobs/scheduler.js.map +1 -1
- package/dist/localization/default-messages.d.ts +47 -0
- package/dist/localization/default-messages.d.ts.map +1 -1
- package/dist/localization/default-messages.js +48 -1
- package/dist/localization/default-messages.js.map +1 -1
- package/dist/mcp/oauth-token.d.ts +1 -1
- package/dist/mcp/oauth-token.d.ts.map +1 -1
- package/dist/mcp/oauth-token.js +6 -1
- package/dist/mcp/oauth-token.js.map +1 -1
- package/dist/mcp-client/workspace-servers.js +4 -4
- package/dist/mcp-client/workspace-servers.js.map +1 -1
- package/dist/notifications/routes.d.ts +2 -2
- package/dist/observability/routes.d.ts +5 -5
- package/dist/observability/routes.d.ts.map +1 -1
- package/dist/observability/routes.js +32 -0
- package/dist/observability/routes.js.map +1 -1
- package/dist/observability/sentiment.d.ts +42 -0
- package/dist/observability/sentiment.d.ts.map +1 -0
- package/dist/observability/sentiment.js +196 -0
- package/dist/observability/sentiment.js.map +1 -0
- package/dist/observability/store.d.ts +5 -0
- package/dist/observability/store.d.ts.map +1 -1
- package/dist/observability/store.js +17 -0
- package/dist/observability/store.js.map +1 -1
- package/dist/observability/traces.d.ts +2 -0
- package/dist/observability/traces.d.ts.map +1 -1
- package/dist/observability/traces.js +42 -57
- package/dist/observability/traces.js.map +1 -1
- package/dist/observability/tracking-identity.d.ts +3 -0
- package/dist/observability/tracking-identity.d.ts.map +1 -0
- package/dist/observability/tracking-identity.js +51 -0
- package/dist/observability/tracking-identity.js.map +1 -0
- package/dist/observability/types.d.ts +10 -0
- package/dist/observability/types.d.ts.map +1 -1
- package/dist/observability/types.js +3 -0
- package/dist/observability/types.js.map +1 -1
- package/dist/progress/routes.d.ts +1 -1
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/secrets/crypto.d.ts +7 -6
- package/dist/secrets/crypto.d.ts.map +1 -1
- package/dist/secrets/crypto.js +30 -11
- package/dist/secrets/crypto.js.map +1 -1
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/secrets/storage.d.ts +6 -0
- package/dist/secrets/storage.d.ts.map +1 -1
- package/dist/secrets/storage.js +61 -3
- package/dist/secrets/storage.js.map +1 -1
- package/dist/server/action-change.d.ts +1 -0
- package/dist/server/action-change.d.ts.map +1 -1
- package/dist/server/action-change.js +4 -1
- package/dist/server/action-change.js.map +1 -1
- package/dist/server/action-routes.d.ts.map +1 -1
- package/dist/server/action-routes.js +5 -0
- package/dist/server/action-routes.js.map +1 -1
- package/dist/server/agent-chat/action-filters-a2a.d.ts +50 -0
- package/dist/server/agent-chat/action-filters-a2a.d.ts.map +1 -0
- package/dist/server/agent-chat/action-filters-a2a.js +127 -0
- package/dist/server/agent-chat/action-filters-a2a.js.map +1 -0
- package/dist/server/agent-chat/browser-team-tools.d.ts +21 -0
- package/dist/server/agent-chat/browser-team-tools.d.ts.map +1 -0
- package/dist/server/agent-chat/browser-team-tools.js +417 -0
- package/dist/server/agent-chat/browser-team-tools.js.map +1 -0
- package/dist/server/agent-chat/context-tools.d.ts +33 -0
- package/dist/server/agent-chat/context-tools.d.ts.map +1 -0
- package/dist/server/agent-chat/context-tools.js +520 -0
- package/dist/server/agent-chat/context-tools.js.map +1 -0
- package/dist/server/agent-chat/framework-prompts.d.ts +65 -0
- package/dist/server/agent-chat/framework-prompts.d.ts.map +1 -0
- package/dist/server/agent-chat/framework-prompts.js +403 -0
- package/dist/server/agent-chat/framework-prompts.js.map +1 -0
- package/dist/server/agent-chat/lazy-fs.d.ts +2 -0
- package/dist/server/agent-chat/lazy-fs.d.ts.map +1 -0
- package/dist/server/agent-chat/lazy-fs.js +11 -0
- package/dist/server/agent-chat/lazy-fs.js.map +1 -0
- package/dist/server/agent-chat/mcp-glue.d.ts +9 -0
- package/dist/server/agent-chat/mcp-glue.d.ts.map +1 -0
- package/dist/server/agent-chat/mcp-glue.js +63 -0
- package/dist/server/agent-chat/mcp-glue.js.map +1 -0
- package/dist/server/agent-chat/plugin-options.d.ts +322 -0
- package/dist/server/agent-chat/plugin-options.d.ts.map +1 -0
- package/dist/server/agent-chat/plugin-options.js +2 -0
- package/dist/server/agent-chat/plugin-options.js.map +1 -0
- package/dist/server/agent-chat/process-run-failure.d.ts +12 -0
- package/dist/server/agent-chat/process-run-failure.d.ts.map +1 -0
- package/dist/server/agent-chat/process-run-failure.js +24 -0
- package/dist/server/agent-chat/process-run-failure.js.map +1 -0
- package/dist/server/agent-chat/prompt-resources.d.ts +28 -0
- package/dist/server/agent-chat/prompt-resources.d.ts.map +1 -0
- package/dist/server/agent-chat/prompt-resources.js +514 -0
- package/dist/server/agent-chat/prompt-resources.js.map +1 -0
- package/dist/server/agent-chat/recurring-jobs-runtime.d.ts +5 -0
- package/dist/server/agent-chat/recurring-jobs-runtime.d.ts.map +1 -0
- package/dist/server/agent-chat/recurring-jobs-runtime.js +53 -0
- package/dist/server/agent-chat/recurring-jobs-runtime.js.map +1 -0
- package/dist/server/agent-chat/request-surface.d.ts +8 -0
- package/dist/server/agent-chat/request-surface.d.ts.map +1 -0
- package/dist/server/agent-chat/request-surface.js +56 -0
- package/dist/server/agent-chat/request-surface.js.map +1 -0
- package/dist/server/agent-chat/run-code-tools.d.ts +17 -0
- package/dist/server/agent-chat/run-code-tools.d.ts.map +1 -0
- package/dist/server/agent-chat/run-code-tools.js +55 -0
- package/dist/server/agent-chat/run-code-tools.js.map +1 -0
- package/dist/server/agent-chat/script-entries.d.ts +47 -0
- package/dist/server/agent-chat/script-entries.d.ts.map +1 -0
- package/dist/server/agent-chat/script-entries.js +633 -0
- package/dist/server/agent-chat/script-entries.js.map +1 -0
- package/dist/server/agent-chat/shared-thread.d.ts +33 -0
- package/dist/server/agent-chat/shared-thread.d.ts.map +1 -0
- package/dist/server/agent-chat/shared-thread.js +242 -0
- package/dist/server/agent-chat/shared-thread.js.map +1 -0
- package/dist/server/agent-chat/skill-frontmatter.d.ts +7 -0
- package/dist/server/agent-chat/skill-frontmatter.d.ts.map +1 -0
- package/dist/server/agent-chat/skill-frontmatter.js +26 -0
- package/dist/server/agent-chat/skill-frontmatter.js.map +1 -0
- package/dist/server/agent-chat-plugin.d.ts +45 -486
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +173 -3005
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/agent-teams.d.ts +10 -0
- package/dist/server/agent-teams.d.ts.map +1 -1
- package/dist/server/agent-teams.js +13 -3
- package/dist/server/agent-teams.js.map +1 -1
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +50 -52
- package/dist/server/auth.js.map +1 -1
- package/dist/server/credential-provider.d.ts.map +1 -1
- package/dist/server/credential-provider.js +22 -21
- package/dist/server/credential-provider.js.map +1 -1
- package/dist/server/edge.d.ts +1 -0
- package/dist/server/edge.d.ts.map +1 -1
- package/dist/server/edge.js +1 -0
- package/dist/server/edge.js.map +1 -1
- package/dist/server/onboarding-html.d.ts.map +1 -1
- package/dist/server/onboarding-html.js +1 -16
- package/dist/server/onboarding-html.js.map +1 -1
- package/dist/server/poll.d.ts.map +1 -1
- package/dist/server/poll.js +1 -0
- package/dist/server/poll.js.map +1 -1
- package/dist/server/realtime-voice.d.ts +10 -0
- package/dist/server/realtime-voice.d.ts.map +1 -1
- package/dist/server/realtime-voice.js +249 -15
- package/dist/server/realtime-voice.js.map +1 -1
- package/dist/server/request-origin.d.ts.map +1 -1
- package/dist/server/request-origin.js +6 -3
- package/dist/server/request-origin.js.map +1 -1
- package/dist/server/ssr-handler.d.ts.map +1 -1
- package/dist/server/ssr-handler.js +47 -2
- package/dist/server/ssr-handler.js.map +1 -1
- package/dist/sharing/access.d.ts +63 -3
- package/dist/sharing/access.d.ts.map +1 -1
- package/dist/sharing/access.js +53 -15
- package/dist/sharing/access.js.map +1 -1
- package/dist/sharing/registry.d.ts +7 -0
- package/dist/sharing/registry.d.ts.map +1 -1
- package/dist/sharing/registry.js.map +1 -1
- package/dist/styles/agent-native.css +17 -16
- package/dist/templates/default/.agents/skills/frontend-design/SKILL.md +1 -1
- package/dist/templates/default/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/dist/templates/default/app/i18n/ar-SA.ts +6 -0
- package/dist/templates/default/app/i18n/de-DE.ts +6 -0
- package/dist/templates/default/app/i18n/en-US.ts +6 -0
- package/dist/templates/default/app/i18n/es-ES.ts +6 -0
- package/dist/templates/default/app/i18n/fr-FR.ts +6 -0
- package/dist/templates/default/app/i18n/hi-IN.ts +6 -0
- package/dist/templates/default/app/i18n/ja-JP.ts +6 -0
- package/dist/templates/default/app/i18n/ko-KR.ts +6 -0
- package/dist/templates/default/app/i18n/pt-BR.ts +6 -0
- package/dist/templates/default/app/i18n/zh-CN.ts +6 -0
- package/dist/templates/default/app/i18n/zh-TW.ts +6 -0
- package/dist/templates/workspace-core/.agents/skills/authentication/SKILL.md +27 -29
- package/dist/templates/workspace-core/.agents/skills/external-agents/SKILL.md +2 -1
- package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +1 -1
- package/dist/templates/workspace-core/.agents/skills/observability/SKILL.md +32 -0
- package/dist/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/dist/templates/workspace-core/.agents/skills/secrets/SKILL.md +7 -3
- package/dist/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +39 -9
- package/dist/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +25 -0
- package/dist/templates/workspace-core/src/server/index.ts +4 -2
- package/dist/testing.d.ts +16 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +16 -0
- package/dist/testing.js.map +1 -0
- package/dist/triggers/dispatcher.d.ts +7 -0
- package/dist/triggers/dispatcher.d.ts.map +1 -1
- package/dist/triggers/dispatcher.js +13 -3
- package/dist/triggers/dispatcher.js.map +1 -1
- package/dist/vite/client.d.ts +16 -1
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +111 -3
- package/dist/vite/client.js.map +1 -1
- package/docs/content/authentication.mdx +3 -3
- package/docs/content/doctor.mdx +170 -0
- package/docs/content/external-agents.mdx +8 -7
- package/docs/content/locales/ar-SA/authentication.mdx +2 -2
- package/docs/content/locales/ar-SA/external-agents.mdx +8 -7
- package/docs/content/locales/ar-SA/mcp-protocol.mdx +1 -1
- package/docs/content/locales/ar-SA/security.mdx +2 -0
- package/docs/content/locales/de-DE/authentication.mdx +1 -1
- package/docs/content/locales/de-DE/external-agents.mdx +8 -7
- package/docs/content/locales/de-DE/mcp-protocol.mdx +1 -1
- package/docs/content/locales/de-DE/security.mdx +2 -0
- package/docs/content/locales/es-ES/authentication.mdx +2 -2
- package/docs/content/locales/es-ES/external-agents.mdx +8 -7
- package/docs/content/locales/es-ES/mcp-protocol.mdx +1 -1
- package/docs/content/locales/es-ES/security.mdx +2 -0
- package/docs/content/locales/fr-FR/authentication.mdx +1 -1
- package/docs/content/locales/fr-FR/external-agents.mdx +8 -7
- package/docs/content/locales/fr-FR/mcp-protocol.mdx +1 -1
- package/docs/content/locales/fr-FR/security.mdx +2 -0
- package/docs/content/locales/hi-IN/authentication.mdx +2 -2
- package/docs/content/locales/hi-IN/external-agents.mdx +8 -7
- package/docs/content/locales/hi-IN/mcp-protocol.mdx +1 -1
- package/docs/content/locales/hi-IN/security.mdx +2 -0
- package/docs/content/locales/ja-JP/authentication.mdx +2 -2
- package/docs/content/locales/ja-JP/external-agents.mdx +8 -7
- package/docs/content/locales/ja-JP/mcp-protocol.mdx +1 -1
- package/docs/content/locales/ja-JP/security.mdx +2 -0
- package/docs/content/locales/ko-KR/authentication.mdx +2 -2
- package/docs/content/locales/ko-KR/external-agents.mdx +8 -7
- package/docs/content/locales/ko-KR/mcp-protocol.mdx +1 -1
- package/docs/content/locales/ko-KR/security.mdx +2 -0
- package/docs/content/locales/pt-BR/authentication.mdx +2 -2
- package/docs/content/locales/pt-BR/external-agents.mdx +8 -7
- package/docs/content/locales/pt-BR/mcp-protocol.mdx +1 -1
- package/docs/content/locales/pt-BR/security.mdx +2 -0
- package/docs/content/locales/zh-CN/authentication.mdx +2 -2
- package/docs/content/locales/zh-CN/external-agents.mdx +8 -7
- package/docs/content/locales/zh-CN/mcp-protocol.mdx +1 -1
- package/docs/content/locales/zh-CN/security.mdx +2 -0
- package/docs/content/locales/zh-TW/authentication.mdx +2 -2
- package/docs/content/locales/zh-TW/external-agents.mdx +8 -7
- package/docs/content/locales/zh-TW/mcp-protocol.mdx +1 -1
- package/docs/content/locales/zh-TW/security.mdx +2 -0
- package/docs/content/mcp-protocol.mdx +1 -1
- package/docs/content/security.mdx +2 -0
- package/package.json +7 -3
- package/src/templates/default/.agents/skills/frontend-design/SKILL.md +1 -1
- package/src/templates/default/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/src/templates/default/app/i18n/ar-SA.ts +6 -0
- package/src/templates/default/app/i18n/de-DE.ts +6 -0
- package/src/templates/default/app/i18n/en-US.ts +6 -0
- package/src/templates/default/app/i18n/es-ES.ts +6 -0
- package/src/templates/default/app/i18n/fr-FR.ts +6 -0
- package/src/templates/default/app/i18n/hi-IN.ts +6 -0
- package/src/templates/default/app/i18n/ja-JP.ts +6 -0
- package/src/templates/default/app/i18n/ko-KR.ts +6 -0
- package/src/templates/default/app/i18n/pt-BR.ts +6 -0
- package/src/templates/default/app/i18n/zh-CN.ts +6 -0
- package/src/templates/default/app/i18n/zh-TW.ts +6 -0
- package/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +27 -29
- package/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +2 -1
- package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +1 -1
- package/src/templates/workspace-core/.agents/skills/observability/SKILL.md +32 -0
- package/src/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/src/templates/workspace-core/.agents/skills/secrets/SKILL.md +7 -3
- package/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +39 -9
- package/src/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +25 -0
- package/src/templates/workspace-core/src/server/index.ts +4 -2
- package/corpus/core/src/client/ProductionAgentPanel.tsx +0 -9
- package/corpus/core/src/client/auth-redirect-url.ts +0 -23
- package/corpus/core/src/client/useProductionAgent.ts +0 -253
- package/corpus/core/src/shared/auth-redirect-url.ts +0 -1
- package/corpus/templates/analytics/app/pages/Index.tsx +0 -16
- package/corpus/templates/analytics/seeds/dashboards/agent-observability-llm.json +0 -173
- package/dist/client/ProductionAgentPanel.d.ts +0 -6
- package/dist/client/ProductionAgentPanel.d.ts.map +0 -1
- package/dist/client/ProductionAgentPanel.js +0 -6
- package/dist/client/ProductionAgentPanel.js.map +0 -1
- package/dist/client/auth-redirect-url.d.ts +0 -2
- package/dist/client/auth-redirect-url.d.ts.map +0 -1
- package/dist/client/auth-redirect-url.js +0 -19
- package/dist/client/auth-redirect-url.js.map +0 -1
- package/dist/client/useProductionAgent.d.ts +0 -24
- package/dist/client/useProductionAgent.d.ts.map +0 -1
- package/dist/client/useProductionAgent.js +0 -179
- package/dist/client/useProductionAgent.js.map +0 -1
- package/dist/shared/auth-redirect-url.d.ts +0 -2
- package/dist/shared/auth-redirect-url.d.ts.map +0 -1
- package/dist/shared/auth-redirect-url.js +0 -2
- package/dist/shared/auth-redirect-url.js.map +0 -1
|
@@ -10,6 +10,7 @@ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "../co
|
|
|
10
10
|
import { useT } from "../i18n.js";
|
|
11
11
|
import { cn } from "../utils.js";
|
|
12
12
|
import { deleteOrHideExtension, invalidateExtensionRemoval, } from "./delete-extension.js";
|
|
13
|
+
import { ExtensionQueryErrorState } from "./ExtensionQueryErrorState.js";
|
|
13
14
|
export function ExtensionEditor({ extensionId }) {
|
|
14
15
|
const t = useT();
|
|
15
16
|
const navigate = useNavigate();
|
|
@@ -22,17 +23,19 @@ export function ExtensionEditor({ extensionId }) {
|
|
|
22
23
|
const [deleting, setDeleting] = useState(false);
|
|
23
24
|
const [menuOpen, setMenuOpen] = useState(false);
|
|
24
25
|
const [confirmingDelete, setConfirmingDelete] = useState(false);
|
|
25
|
-
const
|
|
26
|
+
const slotsQuery = useQuery({
|
|
26
27
|
queryKey: ["extension-slots", extensionId],
|
|
27
28
|
queryFn: async () => {
|
|
28
29
|
const res = await fetch(agentNativePath(`/_agent-native/slots/extension/${extensionId}`));
|
|
29
|
-
if (!res.ok)
|
|
30
|
-
|
|
30
|
+
if (!res.ok) {
|
|
31
|
+
throw new Error(`Failed to load extension slots (${res.status})`);
|
|
32
|
+
}
|
|
31
33
|
return res.json();
|
|
32
34
|
},
|
|
33
35
|
enabled: isEdit && menuOpen,
|
|
34
36
|
});
|
|
35
|
-
const
|
|
37
|
+
const slots = slotsQuery.data ?? [];
|
|
38
|
+
const existingToolQuery = useQuery({
|
|
36
39
|
queryKey: ["extension", extensionId],
|
|
37
40
|
queryFn: async () => {
|
|
38
41
|
const res = await fetch(agentNativePath(`/_agent-native/extensions/${extensionId}`));
|
|
@@ -42,6 +45,7 @@ export function ExtensionEditor({ extensionId }) {
|
|
|
42
45
|
},
|
|
43
46
|
enabled: isEdit,
|
|
44
47
|
});
|
|
48
|
+
const existingTool = existingToolQuery.data;
|
|
45
49
|
useEffect(() => {
|
|
46
50
|
if (existingTool) {
|
|
47
51
|
setName(existingTool.name ?? "");
|
|
@@ -125,6 +129,12 @@ export function ExtensionEditor({ extensionId }) {
|
|
|
125
129
|
queryClient.invalidateQueries({ queryKey: ["slot-installs", slotId] });
|
|
126
130
|
}
|
|
127
131
|
};
|
|
132
|
+
if (isEdit && existingToolQuery.isLoading) {
|
|
133
|
+
return (_jsxs("div", { className: "flex h-full flex-col", children: [_jsx("div", { className: "h-12 shrink-0 border-b" }), _jsx("div", { className: "flex-1 bg-muted/20 animate-pulse" })] }));
|
|
134
|
+
}
|
|
135
|
+
if (isEdit && existingToolQuery.isError) {
|
|
136
|
+
return (_jsx(ExtensionQueryErrorState, { className: "h-full min-h-[20rem]", message: t("extensions.loadError"), onRetry: () => void existingToolQuery.refetch(), retrying: existingToolQuery.isFetching }));
|
|
137
|
+
}
|
|
128
138
|
return (_jsx(TooltipProvider, { delayDuration: 200, children: _jsxs("div", { className: "flex h-full flex-col", children: [_jsxs("header", { className: "flex items-center justify-between border-b px-4 py-3", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx(Link, { to: extensionId
|
|
129
139
|
? extensionPath(extensionId, existingTool?.name ?? name)
|
|
130
140
|
: "/extensions", className: "inline-flex cursor-pointer items-center justify-center rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-accent-foreground", "aria-label": t("extensions.back"), children: _jsx(IconArrowLeft, { className: "h-4 w-4" }) }), _jsx("h1", { className: "text-sm font-semibold", children: isEdit
|
|
@@ -137,7 +147,7 @@ export function ExtensionEditor({ extensionId }) {
|
|
|
137
147
|
setMenuOpen(o);
|
|
138
148
|
if (!o)
|
|
139
149
|
setConfirmingDelete(false);
|
|
140
|
-
}, children: [_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(PopoverTrigger, { asChild: true, children: _jsx("button", { type: "button", className: "inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-accent-foreground", "aria-label": t("extensions.moreOptions"), children: _jsx(IconDots, { className: "h-4 w-4" }) }) }) }), _jsx(TooltipContent, { children: t("extensions.moreOptions") })] }), _jsx(PopoverContent, { align: "end", sideOffset: 4, className: "w-72 p-0", children: !confirmingDelete ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "px-3 py-2 border-b border-border/40", children: [_jsx("p", { className: "text-[12px] font-medium", children: t("extensions.appearsIn") }), slots.length === 0 ? (_jsx("p", { className: "text-[11px] text-muted-foreground/70 mt-0.5", children: t("extensions.noWidgetAreas") })) : (_jsx("p", { className: "text-[11px] text-muted-foreground/70 mt-0.5", children: t("extensions.widgetAreaCount", {
|
|
150
|
+
}, children: [_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(PopoverTrigger, { asChild: true, children: _jsx("button", { type: "button", className: "inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-accent-foreground", "aria-label": t("extensions.moreOptions"), children: _jsx(IconDots, { className: "h-4 w-4" }) }) }) }), _jsx(TooltipContent, { children: t("extensions.moreOptions") })] }), _jsx(PopoverContent, { align: "end", sideOffset: 4, className: "w-72 p-0", children: !confirmingDelete ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "px-3 py-2 border-b border-border/40", children: [_jsx("p", { className: "text-[12px] font-medium", children: t("extensions.appearsIn") }), slotsQuery.isError ? (_jsx(ExtensionQueryErrorState, { compact: true, className: "px-0", message: t("extensions.widgetAreasLoadError"), onRetry: () => void slotsQuery.refetch(), retrying: slotsQuery.isFetching })) : slots.length === 0 ? (_jsx("p", { className: "text-[11px] text-muted-foreground/70 mt-0.5", children: t("extensions.noWidgetAreas") })) : (_jsx("p", { className: "text-[11px] text-muted-foreground/70 mt-0.5", children: t("extensions.widgetAreaCount", {
|
|
141
151
|
count: slots.length,
|
|
142
152
|
}) }))] }), slots.length > 0 && (_jsx("div", { className: "max-h-48 overflow-y-auto py-1", children: slots.map((s) => (_jsxs("div", { className: "flex items-center gap-2 px-3 py-1.5 text-[12px]", children: [_jsx("span", { className: "flex-1 truncate font-mono text-[11px] text-muted-foreground", children: s.slotId }), _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { type: "button", onClick: () => handleRemoveFromSlot(s.slotId), className: "rounded p-1 text-muted-foreground/60 hover:bg-accent hover:text-foreground cursor-pointer", "aria-label": t("extensions.removeFromWidgetArea"), children: _jsx(IconX, { className: "h-3.5 w-3.5" }) }) }), _jsx(TooltipContent, { children: t("extensions.removeFromWidgetAreaForMe") })] })] }, s.id))) })), _jsx("div", { className: "border-t border-border/40 p-1", children: _jsxs("button", { type: "button", onClick: () => setConfirmingDelete(true), className: "flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-[12px] text-destructive hover:bg-destructive/10 cursor-pointer text-left", children: [_jsx(IconTrash, { className: "h-3.5 w-3.5" }), _jsx("span", { children: existingTool?.canDelete === false
|
|
143
153
|
? t("extensions.removeFromMyListEllipsis")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtensionEditor.js","sourceRoot":"","sources":["../../../src/client/extensions/ExtensionEditor.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,KAAK,GACN,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EACL,OAAO,EACP,cAAc,EACd,cAAc,GACf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,OAAO,EACP,cAAc,EACd,eAAe,EACf,cAAc,GACf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,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C,sOAAsO,GAChP,IACE,EAEN,eAAK,SAAS,EAAC,sBAAsB,aACnC,gBAAO,SAAS,EAAC,kDAAkD,YAChE,CAAC,CAAC,yBAAyB,CAAC,GACvB,EACR,mBACE,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAC3C,WAAW,EAAE,CAAC,CAAC,+BAA+B,CAAC,EAC/C,SAAS,EAAC,0OAA0O,EACpP,UAAU,EAAE,KAAK,GACjB,IACE,IACF,EAEN,cAAK,SAAS,EAAC,OAAO,YACnB,OAAO,CAAC,CAAC,CAAC,CACT,iBACE,MAAM,EAAE,OAAO,EACf,SAAS,EAAC,wBAAwB,EAClC,OAAO,EAAC,2BAA2B,EACnC,KAAK,EAAE,CAAC,CAAC,yBAAyB,CAAC,GACnC,CACH,CAAC,CAAC,CAAC,CACF,cAAK,SAAS,EAAC,uEAAuE,YACnF,CAAC,CAAC,yBAAyB,CAAC,GACzB,CACP,GACG,IACF,IACF,GACU,CACnB,CAAC;AACJ,CAAC","sourcesContent":["import {\n IconArrowLeft,\n IconDeviceFloppy,\n IconDots,\n IconTrash,\n IconX,\n} from \"@tabler/icons-react\";\nimport { useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport { useState, useEffect } from \"react\";\nimport { Link, useNavigate } from \"react-router\";\n\nimport { extensionPath } from \"../../extensions/path.js\";\nimport { agentNativePath } from \"../api-path.js\";\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"../components/ui/popover.js\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from \"../components/ui/tooltip.js\";\nimport { useT } from \"../i18n.js\";\nimport { cn } from \"../utils.js\";\nimport {\n deleteOrHideExtension,\n invalidateExtensionRemoval,\n} from \"./delete-extension.js\";\n\ninterface SlotDeclaration {\n id: string;\n extensionId: string;\n slotId: string;\n}\n\ninterface Extension {\n id: string;\n name: string;\n description?: string;\n content?: string;\n canDelete?: boolean;\n}\n\nexport interface ExtensionEditorProps {\n extensionId?: string;\n}\n\nexport function ExtensionEditor({ extensionId }: ExtensionEditorProps) {\n const t = useT();\n const navigate = useNavigate();\n const queryClient = useQueryClient();\n const isEdit = !!extensionId;\n\n const [name, setName] = useState(\"\");\n const [description, setDescription] = useState(\"\");\n const [content, setContent] = useState(\"\");\n const [saving, setSaving] = useState(false);\n const [deleting, setDeleting] = useState(false);\n const [menuOpen, setMenuOpen] = useState(false);\n const [confirmingDelete, setConfirmingDelete] = useState(false);\n\n const { data: slots = [] } = useQuery<SlotDeclaration[]>({\n queryKey: [\"extension-slots\", extensionId],\n queryFn: async () => {\n const res = await fetch(\n agentNativePath(`/_agent-native/slots/extension/${extensionId}`),\n );\n if (!res.ok) return [];\n return res.json();\n },\n enabled: isEdit && menuOpen,\n });\n\n const { data: existingTool } = useQuery<Extension>({\n queryKey: [\"extension\", extensionId],\n queryFn: async () => {\n const res = await fetch(\n agentNativePath(`/_agent-native/extensions/${extensionId}`),\n );\n if (!res.ok) throw new Error(\"Failed to fetch extension\");\n return res.json();\n },\n enabled: isEdit,\n });\n\n useEffect(() => {\n if (existingTool) {\n setName(existingTool.name ?? \"\");\n setDescription(existingTool.description ?? \"\");\n setContent(existingTool.content ?? \"\");\n }\n }, [existingTool]);\n\n const handleSave = async () => {\n if (!name.trim()) return;\n setSaving(true);\n try {\n const body = JSON.stringify({\n name: name.trim(),\n description: description.trim() || undefined,\n content,\n });\n\n if (isEdit) {\n const res = await fetch(\n agentNativePath(`/_agent-native/extensions/${extensionId}`),\n {\n method: \"PUT\",\n headers: { \"Content-Type\": \"application/json\" },\n body,\n },\n );\n if (!res.ok) throw new Error(\"Update failed\");\n queryClient.invalidateQueries({ queryKey: [\"extension\", extensionId] });\n queryClient.invalidateQueries({ queryKey: [\"extensions\"] });\n navigate(extensionPath(extensionId, name.trim()));\n } else {\n const res = await fetch(agentNativePath(\"/_agent-native/extensions\"), {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body,\n });\n if (!res.ok) throw new Error(\"Create failed\");\n const created = await res.json();\n queryClient.invalidateQueries({ queryKey: [\"extensions\"] });\n navigate(extensionPath(created.id, created.name ?? name.trim()));\n }\n } finally {\n setSaving(false);\n }\n };\n\n const handleDelete = async () => {\n if (!extensionId) return;\n setDeleting(true);\n const prev = queryClient.getQueryData<Extension[]>([\"extensions\"]);\n try {\n queryClient.setQueryData<Extension[]>([\"extensions\"], (old) =>\n (old ?? []).filter((t) => t.id !== extensionId),\n );\n\n await deleteOrHideExtension({\n id: extensionId,\n canDelete: existingTool?.canDelete,\n });\n invalidateExtensionRemoval(queryClient, extensionId);\n slots.forEach((s) =>\n queryClient.invalidateQueries({\n queryKey: [\"slot-installs\", s.slotId],\n }),\n );\n navigate(\"/extensions\");\n } catch {\n if (prev) queryClient.setQueryData([\"extensions\"], prev);\n } finally {\n setDeleting(false);\n setConfirmingDelete(false);\n setMenuOpen(false);\n }\n };\n\n const handleRemoveFromSlot = async (slotId: string) => {\n if (!extensionId) return;\n try {\n await fetch(\n agentNativePath(\n `/_agent-native/slots/${encodeURIComponent(slotId)}/install/${encodeURIComponent(extensionId)}`,\n ),\n { method: \"DELETE\" },\n );\n } finally {\n queryClient.invalidateQueries({ queryKey: [\"slot-installs\", slotId] });\n }\n };\n\n return (\n <TooltipProvider delayDuration={200}>\n <div className=\"flex h-full flex-col\">\n <header className=\"flex items-center justify-between border-b px-4 py-3\">\n <div className=\"flex items-center gap-3\">\n <Link\n to={\n extensionId\n ? extensionPath(extensionId, existingTool?.name ?? name)\n : \"/extensions\"\n }\n className=\"inline-flex cursor-pointer items-center justify-center rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-accent-foreground\"\n aria-label={t(\"extensions.back\")}\n >\n <IconArrowLeft className=\"h-4 w-4\" />\n </Link>\n <h1 className=\"text-sm font-semibold\">\n {isEdit\n ? t(\"extensions.editExtension\")\n : t(\"extensions.newExtension\")}\n </h1>\n </div>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={handleSave}\n disabled={saving || !name.trim()}\n className={cn(\n \"inline-flex cursor-pointer items-center justify-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-sm text-primary-foreground hover:bg-primary/90\",\n (saving || !name.trim()) && \"opacity-60\",\n )}\n >\n <IconDeviceFloppy className=\"h-3.5 w-3.5\" />\n {saving\n ? t(\"extensions.saving\")\n : isEdit\n ? t(\"extensions.save\")\n : t(\"extensions.create\")}\n </button>\n {isEdit && (\n <Popover\n open={menuOpen}\n onOpenChange={(o) => {\n setMenuOpen(o);\n if (!o) setConfirmingDelete(false);\n }}\n >\n <Tooltip>\n <TooltipTrigger asChild>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n className=\"inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-accent-foreground\"\n aria-label={t(\"extensions.moreOptions\")}\n >\n <IconDots className=\"h-4 w-4\" />\n </button>\n </PopoverTrigger>\n </TooltipTrigger>\n <TooltipContent>{t(\"extensions.moreOptions\")}</TooltipContent>\n </Tooltip>\n <PopoverContent align=\"end\" sideOffset={4} className=\"w-72 p-0\">\n {!confirmingDelete ? (\n <>\n <div className=\"px-3 py-2 border-b border-border/40\">\n <p className=\"text-[12px] font-medium\">\n {t(\"extensions.appearsIn\")}\n </p>\n {slots.length === 0 ? (\n <p className=\"text-[11px] text-muted-foreground/70 mt-0.5\">\n {t(\"extensions.noWidgetAreas\")}\n </p>\n ) : (\n <p className=\"text-[11px] text-muted-foreground/70 mt-0.5\">\n {t(\"extensions.widgetAreaCount\", {\n count: slots.length,\n })}\n </p>\n )}\n </div>\n {slots.length > 0 && (\n <div className=\"max-h-48 overflow-y-auto py-1\">\n {slots.map((s) => (\n <div\n key={s.id}\n className=\"flex items-center gap-2 px-3 py-1.5 text-[12px]\"\n >\n <span className=\"flex-1 truncate font-mono text-[11px] text-muted-foreground\">\n {s.slotId}\n </span>\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n onClick={() =>\n handleRemoveFromSlot(s.slotId)\n }\n className=\"rounded p-1 text-muted-foreground/60 hover:bg-accent hover:text-foreground cursor-pointer\"\n aria-label={t(\n \"extensions.removeFromWidgetArea\",\n )}\n >\n <IconX className=\"h-3.5 w-3.5\" />\n </button>\n </TooltipTrigger>\n <TooltipContent>\n {t(\"extensions.removeFromWidgetAreaForMe\")}\n </TooltipContent>\n </Tooltip>\n </div>\n ))}\n </div>\n )}\n <div className=\"border-t border-border/40 p-1\">\n <button\n type=\"button\"\n onClick={() => setConfirmingDelete(true)}\n className=\"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-[12px] text-destructive hover:bg-destructive/10 cursor-pointer text-left\"\n >\n <IconTrash className=\"h-3.5 w-3.5\" />\n <span>\n {existingTool?.canDelete === false\n ? t(\"extensions.removeFromMyListEllipsis\")\n : t(\"extensions.deleteExtensionEllipsis\")}\n </span>\n </button>\n </div>\n </>\n ) : (\n <div className=\"flex flex-col gap-2 p-3\">\n <p className=\"text-[12px]\">\n {existingTool?.canDelete === false\n ? t(\"extensions.removeQuestion\", { name })\n : t(\"extensions.deleteQuestion\", { name })}{\" \"}\n {existingTool?.canDelete === false\n ? t(\"extensions.hideForYouDescription\")\n : t(\"extensions.deleteEverywhereConfirmation\")}\n </p>\n <div className=\"flex justify-end gap-1\">\n <button\n type=\"button\"\n onClick={() => setConfirmingDelete(false)}\n className=\"rounded-md px-2 py-1 text-[12px] hover:bg-accent cursor-pointer\"\n >\n {t(\"extensions.cancel\")}\n </button>\n <button\n type=\"button\"\n onClick={handleDelete}\n disabled={deleting}\n className={cn(\n \"rounded-md bg-destructive px-2 py-1 text-[12px] text-destructive-foreground hover:bg-destructive/90 cursor-pointer\",\n deleting && \"opacity-60\",\n )}\n >\n {deleting\n ? existingTool?.canDelete === false\n ? t(\"extensions.removing\")\n : t(\"extensions.deleting\")\n : existingTool?.canDelete === false\n ? t(\"extensions.remove\")\n : t(\"extensions.delete\")}\n </button>\n </div>\n </div>\n )}\n </PopoverContent>\n </Popover>\n )}\n </div>\n </header>\n\n <div className=\"flex flex-1 overflow-hidden\">\n <div className=\"flex w-1/2 flex-col gap-4 overflow-auto border-r p-4\">\n <div>\n <label className=\"mb-1.5 block text-sm font-medium text-foreground\">\n {t(\"extensions.nameLabel\")}\n </label>\n <input\n type=\"text\"\n value={name}\n onChange={(e) => setName(e.target.value)}\n placeholder={t(\"extensions.namePlaceholder\")}\n className=\"h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background\"\n />\n </div>\n\n <div>\n <label className=\"mb-1.5 block text-sm font-medium text-foreground\">\n {t(\"extensions.descriptionLabel\")}\n </label>\n <textarea\n value={description}\n onChange={(e) => setDescription(e.target.value)}\n placeholder={t(\"extensions.descriptionPlaceholder\")}\n rows={2}\n className=\"w-full resize-none rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background\"\n />\n </div>\n\n <div className=\"flex flex-1 flex-col\">\n <label className=\"mb-1.5 block text-sm font-medium text-foreground\">\n {t(\"extensions.contentLabel\")}\n </label>\n <textarea\n value={content}\n onChange={(e) => setContent(e.target.value)}\n placeholder={t(\"extensions.contentPlaceholder\")}\n className=\"flex-1 resize-none rounded-md border border-input bg-background p-3 font-mono text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background\"\n spellCheck={false}\n />\n </div>\n </div>\n\n <div className=\"w-1/2\">\n {content ? (\n <iframe\n srcDoc={content}\n className=\"h-full w-full border-0\"\n sandbox=\"allow-scripts allow-forms\"\n title={t(\"extensions.previewTitle\")}\n />\n ) : (\n <div className=\"flex h-full items-center justify-center text-sm text-muted-foreground\">\n {t(\"extensions.previewEmpty\")}\n </div>\n )}\n </div>\n </div>\n </div>\n </TooltipProvider>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ExtensionEditor.js","sourceRoot":"","sources":["../../../src/client/extensions/ExtensionEditor.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,KAAK,GACN,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EACL,OAAO,EACP,cAAc,EACd,cAAc,GACf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,OAAO,EACP,cAAc,EACd,eAAe,EACf,cAAc,GACf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAoBzE,MAAM,UAAU,eAAe,CAAC,EAAE,WAAW,EAAwB;IACnE,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC;IACjB,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IACrC,MAAM,MAAM,GAAG,CAAC,CAAC,WAAW,CAAC;IAE7B,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,EAAE,C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GACzB,CACP,GACG,IACF,IACF,GACU,CACnB,CAAC;AACJ,CAAC","sourcesContent":["import {\n IconArrowLeft,\n IconDeviceFloppy,\n IconDots,\n IconTrash,\n IconX,\n} from \"@tabler/icons-react\";\nimport { useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport { useState, useEffect } from \"react\";\nimport { Link, useNavigate } from \"react-router\";\n\nimport { extensionPath } from \"../../extensions/path.js\";\nimport { agentNativePath } from \"../api-path.js\";\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"../components/ui/popover.js\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from \"../components/ui/tooltip.js\";\nimport { useT } from \"../i18n.js\";\nimport { cn } from \"../utils.js\";\nimport {\n deleteOrHideExtension,\n invalidateExtensionRemoval,\n} from \"./delete-extension.js\";\nimport { ExtensionQueryErrorState } from \"./ExtensionQueryErrorState.js\";\n\ninterface SlotDeclaration {\n id: string;\n extensionId: string;\n slotId: string;\n}\n\ninterface Extension {\n id: string;\n name: string;\n description?: string;\n content?: string;\n canDelete?: boolean;\n}\n\nexport interface ExtensionEditorProps {\n extensionId?: string;\n}\n\nexport function ExtensionEditor({ extensionId }: ExtensionEditorProps) {\n const t = useT();\n const navigate = useNavigate();\n const queryClient = useQueryClient();\n const isEdit = !!extensionId;\n\n const [name, setName] = useState(\"\");\n const [description, setDescription] = useState(\"\");\n const [content, setContent] = useState(\"\");\n const [saving, setSaving] = useState(false);\n const [deleting, setDeleting] = useState(false);\n const [menuOpen, setMenuOpen] = useState(false);\n const [confirmingDelete, setConfirmingDelete] = useState(false);\n\n const slotsQuery = useQuery<SlotDeclaration[]>({\n queryKey: [\"extension-slots\", extensionId],\n queryFn: async () => {\n const res = await fetch(\n agentNativePath(`/_agent-native/slots/extension/${extensionId}`),\n );\n if (!res.ok) {\n throw new Error(`Failed to load extension slots (${res.status})`);\n }\n return res.json();\n },\n enabled: isEdit && menuOpen,\n });\n const slots = slotsQuery.data ?? [];\n\n const existingToolQuery = useQuery<Extension>({\n queryKey: [\"extension\", extensionId],\n queryFn: async () => {\n const res = await fetch(\n agentNativePath(`/_agent-native/extensions/${extensionId}`),\n );\n if (!res.ok) throw new Error(\"Failed to fetch extension\");\n return res.json();\n },\n enabled: isEdit,\n });\n const existingTool = existingToolQuery.data;\n\n useEffect(() => {\n if (existingTool) {\n setName(existingTool.name ?? \"\");\n setDescription(existingTool.description ?? \"\");\n setContent(existingTool.content ?? \"\");\n }\n }, [existingTool]);\n\n const handleSave = async () => {\n if (!name.trim()) return;\n setSaving(true);\n try {\n const body = JSON.stringify({\n name: name.trim(),\n description: description.trim() || undefined,\n content,\n });\n\n if (isEdit) {\n const res = await fetch(\n agentNativePath(`/_agent-native/extensions/${extensionId}`),\n {\n method: \"PUT\",\n headers: { \"Content-Type\": \"application/json\" },\n body,\n },\n );\n if (!res.ok) throw new Error(\"Update failed\");\n queryClient.invalidateQueries({ queryKey: [\"extension\", extensionId] });\n queryClient.invalidateQueries({ queryKey: [\"extensions\"] });\n navigate(extensionPath(extensionId, name.trim()));\n } else {\n const res = await fetch(agentNativePath(\"/_agent-native/extensions\"), {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body,\n });\n if (!res.ok) throw new Error(\"Create failed\");\n const created = await res.json();\n queryClient.invalidateQueries({ queryKey: [\"extensions\"] });\n navigate(extensionPath(created.id, created.name ?? name.trim()));\n }\n } finally {\n setSaving(false);\n }\n };\n\n const handleDelete = async () => {\n if (!extensionId) return;\n setDeleting(true);\n const prev = queryClient.getQueryData<Extension[]>([\"extensions\"]);\n try {\n queryClient.setQueryData<Extension[]>([\"extensions\"], (old) =>\n (old ?? []).filter((t) => t.id !== extensionId),\n );\n\n await deleteOrHideExtension({\n id: extensionId,\n canDelete: existingTool?.canDelete,\n });\n invalidateExtensionRemoval(queryClient, extensionId);\n slots.forEach((s) =>\n queryClient.invalidateQueries({\n queryKey: [\"slot-installs\", s.slotId],\n }),\n );\n navigate(\"/extensions\");\n } catch {\n if (prev) queryClient.setQueryData([\"extensions\"], prev);\n } finally {\n setDeleting(false);\n setConfirmingDelete(false);\n setMenuOpen(false);\n }\n };\n\n const handleRemoveFromSlot = async (slotId: string) => {\n if (!extensionId) return;\n try {\n await fetch(\n agentNativePath(\n `/_agent-native/slots/${encodeURIComponent(slotId)}/install/${encodeURIComponent(extensionId)}`,\n ),\n { method: \"DELETE\" },\n );\n } finally {\n queryClient.invalidateQueries({ queryKey: [\"slot-installs\", slotId] });\n }\n };\n\n if (isEdit && existingToolQuery.isLoading) {\n return (\n <div className=\"flex h-full flex-col\">\n <div className=\"h-12 shrink-0 border-b\" />\n <div className=\"flex-1 bg-muted/20 animate-pulse\" />\n </div>\n );\n }\n\n if (isEdit && existingToolQuery.isError) {\n return (\n <ExtensionQueryErrorState\n className=\"h-full min-h-[20rem]\"\n message={t(\"extensions.loadError\")}\n onRetry={() => void existingToolQuery.refetch()}\n retrying={existingToolQuery.isFetching}\n />\n );\n }\n\n return (\n <TooltipProvider delayDuration={200}>\n <div className=\"flex h-full flex-col\">\n <header className=\"flex items-center justify-between border-b px-4 py-3\">\n <div className=\"flex items-center gap-3\">\n <Link\n to={\n extensionId\n ? extensionPath(extensionId, existingTool?.name ?? name)\n : \"/extensions\"\n }\n className=\"inline-flex cursor-pointer items-center justify-center rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-accent-foreground\"\n aria-label={t(\"extensions.back\")}\n >\n <IconArrowLeft className=\"h-4 w-4\" />\n </Link>\n <h1 className=\"text-sm font-semibold\">\n {isEdit\n ? t(\"extensions.editExtension\")\n : t(\"extensions.newExtension\")}\n </h1>\n </div>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={handleSave}\n disabled={saving || !name.trim()}\n className={cn(\n \"inline-flex cursor-pointer items-center justify-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-sm text-primary-foreground hover:bg-primary/90\",\n (saving || !name.trim()) && \"opacity-60\",\n )}\n >\n <IconDeviceFloppy className=\"h-3.5 w-3.5\" />\n {saving\n ? t(\"extensions.saving\")\n : isEdit\n ? t(\"extensions.save\")\n : t(\"extensions.create\")}\n </button>\n {isEdit && (\n <Popover\n open={menuOpen}\n onOpenChange={(o) => {\n setMenuOpen(o);\n if (!o) setConfirmingDelete(false);\n }}\n >\n <Tooltip>\n <TooltipTrigger asChild>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n className=\"inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-accent-foreground\"\n aria-label={t(\"extensions.moreOptions\")}\n >\n <IconDots className=\"h-4 w-4\" />\n </button>\n </PopoverTrigger>\n </TooltipTrigger>\n <TooltipContent>{t(\"extensions.moreOptions\")}</TooltipContent>\n </Tooltip>\n <PopoverContent align=\"end\" sideOffset={4} className=\"w-72 p-0\">\n {!confirmingDelete ? (\n <>\n <div className=\"px-3 py-2 border-b border-border/40\">\n <p className=\"text-[12px] font-medium\">\n {t(\"extensions.appearsIn\")}\n </p>\n {slotsQuery.isError ? (\n <ExtensionQueryErrorState\n compact\n className=\"px-0\"\n message={t(\"extensions.widgetAreasLoadError\")}\n onRetry={() => void slotsQuery.refetch()}\n retrying={slotsQuery.isFetching}\n />\n ) : slots.length === 0 ? (\n <p className=\"text-[11px] text-muted-foreground/70 mt-0.5\">\n {t(\"extensions.noWidgetAreas\")}\n </p>\n ) : (\n <p className=\"text-[11px] text-muted-foreground/70 mt-0.5\">\n {t(\"extensions.widgetAreaCount\", {\n count: slots.length,\n })}\n </p>\n )}\n </div>\n {slots.length > 0 && (\n <div className=\"max-h-48 overflow-y-auto py-1\">\n {slots.map((s) => (\n <div\n key={s.id}\n className=\"flex items-center gap-2 px-3 py-1.5 text-[12px]\"\n >\n <span className=\"flex-1 truncate font-mono text-[11px] text-muted-foreground\">\n {s.slotId}\n </span>\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n onClick={() =>\n handleRemoveFromSlot(s.slotId)\n }\n className=\"rounded p-1 text-muted-foreground/60 hover:bg-accent hover:text-foreground cursor-pointer\"\n aria-label={t(\n \"extensions.removeFromWidgetArea\",\n )}\n >\n <IconX className=\"h-3.5 w-3.5\" />\n </button>\n </TooltipTrigger>\n <TooltipContent>\n {t(\"extensions.removeFromWidgetAreaForMe\")}\n </TooltipContent>\n </Tooltip>\n </div>\n ))}\n </div>\n )}\n <div className=\"border-t border-border/40 p-1\">\n <button\n type=\"button\"\n onClick={() => setConfirmingDelete(true)}\n className=\"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-[12px] text-destructive hover:bg-destructive/10 cursor-pointer text-left\"\n >\n <IconTrash className=\"h-3.5 w-3.5\" />\n <span>\n {existingTool?.canDelete === false\n ? t(\"extensions.removeFromMyListEllipsis\")\n : t(\"extensions.deleteExtensionEllipsis\")}\n </span>\n </button>\n </div>\n </>\n ) : (\n <div className=\"flex flex-col gap-2 p-3\">\n <p className=\"text-[12px]\">\n {existingTool?.canDelete === false\n ? t(\"extensions.removeQuestion\", { name })\n : t(\"extensions.deleteQuestion\", { name })}{\" \"}\n {existingTool?.canDelete === false\n ? t(\"extensions.hideForYouDescription\")\n : t(\"extensions.deleteEverywhereConfirmation\")}\n </p>\n <div className=\"flex justify-end gap-1\">\n <button\n type=\"button\"\n onClick={() => setConfirmingDelete(false)}\n className=\"rounded-md px-2 py-1 text-[12px] hover:bg-accent cursor-pointer\"\n >\n {t(\"extensions.cancel\")}\n </button>\n <button\n type=\"button\"\n onClick={handleDelete}\n disabled={deleting}\n className={cn(\n \"rounded-md bg-destructive px-2 py-1 text-[12px] text-destructive-foreground hover:bg-destructive/90 cursor-pointer\",\n deleting && \"opacity-60\",\n )}\n >\n {deleting\n ? existingTool?.canDelete === false\n ? t(\"extensions.removing\")\n : t(\"extensions.deleting\")\n : existingTool?.canDelete === false\n ? t(\"extensions.remove\")\n : t(\"extensions.delete\")}\n </button>\n </div>\n </div>\n )}\n </PopoverContent>\n </Popover>\n )}\n </div>\n </header>\n\n <div className=\"flex flex-1 overflow-hidden\">\n <div className=\"flex w-1/2 flex-col gap-4 overflow-auto border-r p-4\">\n <div>\n <label className=\"mb-1.5 block text-sm font-medium text-foreground\">\n {t(\"extensions.nameLabel\")}\n </label>\n <input\n type=\"text\"\n value={name}\n onChange={(e) => setName(e.target.value)}\n placeholder={t(\"extensions.namePlaceholder\")}\n className=\"h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background\"\n />\n </div>\n\n <div>\n <label className=\"mb-1.5 block text-sm font-medium text-foreground\">\n {t(\"extensions.descriptionLabel\")}\n </label>\n <textarea\n value={description}\n onChange={(e) => setDescription(e.target.value)}\n placeholder={t(\"extensions.descriptionPlaceholder\")}\n rows={2}\n className=\"w-full resize-none rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background\"\n />\n </div>\n\n <div className=\"flex flex-1 flex-col\">\n <label className=\"mb-1.5 block text-sm font-medium text-foreground\">\n {t(\"extensions.contentLabel\")}\n </label>\n <textarea\n value={content}\n onChange={(e) => setContent(e.target.value)}\n placeholder={t(\"extensions.contentPlaceholder\")}\n className=\"flex-1 resize-none rounded-md border border-input bg-background p-3 font-mono text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background\"\n spellCheck={false}\n />\n </div>\n </div>\n\n <div className=\"w-1/2\">\n {content ? (\n <iframe\n srcDoc={content}\n className=\"h-full w-full border-0\"\n sandbox=\"allow-scripts allow-forms\"\n title={t(\"extensions.previewTitle\")}\n />\n ) : (\n <div className=\"flex h-full items-center justify-center text-sm text-muted-foreground\">\n {t(\"extensions.previewEmpty\")}\n </div>\n )}\n </div>\n </div>\n </div>\n </TooltipProvider>\n );\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function ExtensionQueryErrorState({ message, onRetry, retrying, compact, className, }: {
|
|
2
|
+
message: string;
|
|
3
|
+
onRetry: () => void;
|
|
4
|
+
retrying?: boolean;
|
|
5
|
+
compact?: boolean;
|
|
6
|
+
className?: string;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=ExtensionQueryErrorState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExtensionQueryErrorState.d.ts","sourceRoot":"","sources":["../../../src/client/extensions/ExtensionQueryErrorState.tsx"],"names":[],"mappings":"AAKA,wBAAgB,wBAAwB,CAAC,EACvC,OAAO,EACP,OAAO,EACP,QAAgB,EAChB,OAAe,EACf,SAAS,GACV,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,+BA6BA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { IconRefresh } from "@tabler/icons-react";
|
|
3
|
+
import { useT } from "../i18n.js";
|
|
4
|
+
import { cn } from "../utils.js";
|
|
5
|
+
export function ExtensionQueryErrorState({ message, onRetry, retrying = false, compact = false, className, }) {
|
|
6
|
+
const t = useT();
|
|
7
|
+
return (_jsxs("div", { role: "alert", className: cn("flex items-center text-destructive", compact
|
|
8
|
+
? "gap-2 px-2 py-1.5 text-[11px]"
|
|
9
|
+
: "flex-col justify-center gap-3 px-4 py-8 text-center text-sm", className), children: [_jsx("span", { children: message }), _jsxs("button", { type: "button", onClick: onRetry, disabled: retrying, className: cn("inline-flex shrink-0 items-center justify-center gap-1.5 rounded-md border border-border text-foreground hover:bg-accent disabled:pointer-events-none disabled:opacity-60", compact ? "px-2 py-1 text-[11px]" : "px-3 py-1.5 text-xs"), children: [_jsx(IconRefresh, { className: cn("size-3.5", retrying && "animate-spin") }), t("extensions.retry")] })] }));
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=ExtensionQueryErrorState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExtensionQueryErrorState.js","sourceRoot":"","sources":["../../../src/client/extensions/ExtensionQueryErrorState.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEjC,MAAM,UAAU,wBAAwB,CAAC,EACvC,OAAO,EACP,OAAO,EACP,QAAQ,GAAG,KAAK,EAChB,OAAO,GAAG,KAAK,EACf,SAAS,GAOV;IACC,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC;IAEjB,OAAO,CACL,eACE,IAAI,EAAC,OAAO,EACZ,SAAS,EAAE,EAAE,CACX,oCAAoC,EACpC,OAAO;YACL,CAAC,CAAC,+BAA+B;YACjC,CAAC,CAAC,6DAA6D,EACjE,SAAS,CACV,aAED,yBAAO,OAAO,GAAQ,EACtB,kBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,EAAE,CACX,2KAA2K,EAC3K,OAAO,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,qBAAqB,CAC1D,aAED,KAAC,WAAW,IAAC,SAAS,EAAE,EAAE,CAAC,UAAU,EAAE,QAAQ,IAAI,cAAc,CAAC,GAAI,EACrE,CAAC,CAAC,kBAAkB,CAAC,IACf,IACL,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { IconRefresh } from \"@tabler/icons-react\";\n\nimport { useT } from \"../i18n.js\";\nimport { cn } from \"../utils.js\";\n\nexport function ExtensionQueryErrorState({\n message,\n onRetry,\n retrying = false,\n compact = false,\n className,\n}: {\n message: string;\n onRetry: () => void;\n retrying?: boolean;\n compact?: boolean;\n className?: string;\n}) {\n const t = useT();\n\n return (\n <div\n role=\"alert\"\n className={cn(\n \"flex items-center text-destructive\",\n compact\n ? \"gap-2 px-2 py-1.5 text-[11px]\"\n : \"flex-col justify-center gap-3 px-4 py-8 text-center text-sm\",\n className,\n )}\n >\n <span>{message}</span>\n <button\n type=\"button\"\n onClick={onRetry}\n disabled={retrying}\n className={cn(\n \"inline-flex shrink-0 items-center justify-center gap-1.5 rounded-md border border-border text-foreground hover:bg-accent disabled:pointer-events-none disabled:opacity-60\",\n compact ? \"px-2 py-1 text-[11px]\" : \"px-3 py-1.5 text-xs\",\n )}\n >\n <IconRefresh className={cn(\"size-3.5\", retrying && \"animate-spin\")} />\n {t(\"extensions.retry\")}\n </button>\n </div>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtensionSlot.d.ts","sourceRoot":"","sources":["../../../src/client/extensions/ExtensionSlot.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExtensionSlot.d.ts","sourceRoot":"","sources":["../../../src/client/extensions/ExtensionSlot.tsx"],"names":[],"mappings":"AAwCA,MAAM,WAAW,kBAAkB;IACjC,sEAAsE;IACtE,EAAE,EAAE,MAAM,CAAC;IACX,iEAAiE;IACjE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACzC,iFAAiF;IACjF,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,EAC5B,EAAE,EACF,OAAO,EACP,mBAAmB,EACnB,SAAS,EACT,aAAa,GACd,EAAE,kBAAkB,sCAuDpB"}
|
|
@@ -8,6 +8,7 @@ import { Popover, PopoverContent, PopoverTrigger, } from "../components/ui/popov
|
|
|
8
8
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "../components/ui/tooltip.js";
|
|
9
9
|
import { useT } from "../i18n.js";
|
|
10
10
|
import { EmbeddedExtension } from "./EmbeddedExtension.js";
|
|
11
|
+
import { ExtensionQueryErrorState } from "./ExtensionQueryErrorState.js";
|
|
11
12
|
/**
|
|
12
13
|
* A named UI slot that user-installed extensions can render into. Apps drop this
|
|
13
14
|
* component wherever they want to allow extensions; the framework handles
|
|
@@ -22,18 +23,23 @@ import { EmbeddedExtension } from "./EmbeddedExtension.js";
|
|
|
22
23
|
* />
|
|
23
24
|
*/
|
|
24
25
|
export function ExtensionSlot({ id, context, showEmptyAffordance, className, toolClassName, }) {
|
|
25
|
-
const
|
|
26
|
+
const t = useT();
|
|
27
|
+
const installsQuery = useQuery({
|
|
26
28
|
queryKey: ["slot-installs", id],
|
|
27
29
|
queryFn: async () => {
|
|
28
30
|
const res = await fetch(agentNativePath(`/_agent-native/slots/${encodeURIComponent(id)}/installs`));
|
|
29
31
|
if (!res.ok)
|
|
30
|
-
|
|
32
|
+
throw new Error(`Failed to load slot installs (${res.status})`);
|
|
31
33
|
return res.json();
|
|
32
34
|
},
|
|
33
35
|
});
|
|
34
|
-
|
|
36
|
+
const installs = installsQuery.data ?? [];
|
|
37
|
+
if (installsQuery.isLoading) {
|
|
35
38
|
return null;
|
|
36
39
|
}
|
|
40
|
+
if (installsQuery.isError) {
|
|
41
|
+
return (_jsx(ExtensionQueryErrorState, { compact: true, className: className, message: t("extensions.widgetsLoadError"), onRetry: () => void installsQuery.refetch(), retrying: installsQuery.isFetching }));
|
|
42
|
+
}
|
|
37
43
|
if (installs.length === 0) {
|
|
38
44
|
if (!showEmptyAffordance)
|
|
39
45
|
return null;
|
|
@@ -44,16 +50,18 @@ export function ExtensionSlot({ id, context, showEmptyAffordance, className, too
|
|
|
44
50
|
function SlotEmptyAffordance({ slotId }) {
|
|
45
51
|
const t = useT();
|
|
46
52
|
const [open, setOpen] = useState(false);
|
|
47
|
-
const
|
|
53
|
+
const availableQuery = useQuery({
|
|
48
54
|
queryKey: ["slot-available", slotId],
|
|
49
55
|
queryFn: async () => {
|
|
50
56
|
const res = await fetch(agentNativePath(`/_agent-native/slots/${encodeURIComponent(slotId)}/available`));
|
|
51
|
-
if (!res.ok)
|
|
52
|
-
|
|
57
|
+
if (!res.ok) {
|
|
58
|
+
throw new Error(`Failed to load available extensions (${res.status})`);
|
|
59
|
+
}
|
|
53
60
|
return res.json();
|
|
54
61
|
},
|
|
55
62
|
enabled: open,
|
|
56
63
|
});
|
|
64
|
+
const available = availableQuery.data ?? [];
|
|
57
65
|
const queryClient = useQueryClient();
|
|
58
66
|
const install = async (extensionId) => {
|
|
59
67
|
queryClient.setQueryData(["slot-installs", slotId], (old) => {
|
|
@@ -95,7 +103,9 @@ function SlotEmptyAffordance({ slotId }) {
|
|
|
95
103
|
});
|
|
96
104
|
};
|
|
97
105
|
const slotDescription = describeSlot(slotId, t);
|
|
98
|
-
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(TooltipProvider, { delayDuration: 200, children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(PopoverTrigger, { asChild: true, children: _jsxs("button", { type: "button", className: "flex w-full items-center gap-2 px-4 py-2 text-[11px] text-muted-foreground/60 hover:text-muted-foreground cursor-pointer", children: [_jsx("div", { className: "h-5 w-5 rounded-md border border-dashed border-border/40 flex items-center justify-center shrink-0", children: _jsx(IconPlus, { className: "h-3 w-3" }) }), _jsx("span", { children: t("extensions.addWidget") })] }) }) }), _jsx(TooltipContent, { children: t("extensions.addWidget") })] }) }), _jsxs(PopoverContent, { side: "left", align: "end", sideOffset: 8, className: "w-72 p-0 overflow-hidden", children: [_jsxs("div", { className: "px-3 py-2 border-b border-border/40", children: [_jsx("p", { className: "text-[12px] font-medium", children: slotDescription.title }), _jsx("p", { className: "text-[11px] text-muted-foreground/70", children: slotDescription.description })] }), _jsxs("div", { className: "max-h-72 overflow-y-auto py-1", children: [isLoading && (_jsx("div", { className: "px-3 py-3 text-[12px] text-muted-foreground/60", children: t("extensions.loading") })),
|
|
106
|
+
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(TooltipProvider, { delayDuration: 200, children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(PopoverTrigger, { asChild: true, children: _jsxs("button", { type: "button", className: "flex w-full items-center gap-2 px-4 py-2 text-[11px] text-muted-foreground/60 hover:text-muted-foreground cursor-pointer", children: [_jsx("div", { className: "h-5 w-5 rounded-md border border-dashed border-border/40 flex items-center justify-center shrink-0", children: _jsx(IconPlus, { className: "h-3 w-3" }) }), _jsx("span", { children: t("extensions.addWidget") })] }) }) }), _jsx(TooltipContent, { children: t("extensions.addWidget") })] }) }), _jsxs(PopoverContent, { side: "left", align: "end", sideOffset: 8, className: "w-72 p-0 overflow-hidden", children: [_jsxs("div", { className: "px-3 py-2 border-b border-border/40", children: [_jsx("p", { className: "text-[12px] font-medium", children: slotDescription.title }), _jsx("p", { className: "text-[11px] text-muted-foreground/70", children: slotDescription.description })] }), _jsxs("div", { className: "max-h-72 overflow-y-auto py-1", children: [availableQuery.isLoading && (_jsx("div", { className: "px-3 py-3 text-[12px] text-muted-foreground/60", children: t("extensions.loading") })), availableQuery.isError && (_jsx(ExtensionQueryErrorState, { compact: true, message: t("extensions.widgetsLoadError"), onRetry: () => void availableQuery.refetch(), retrying: availableQuery.isFetching })), !availableQuery.isLoading &&
|
|
107
|
+
!availableQuery.isError &&
|
|
108
|
+
available.length === 0 && (_jsx("div", { className: "px-3 py-3 text-[12px] text-muted-foreground/60", children: t("extensions.noWidgetsAvailable") })), available.map((extension) => (_jsx("button", { type: "button", onClick: () => install(extension.extensionId), className: "flex w-full items-start gap-2 px-3 py-2 text-left hover:bg-accent cursor-pointer", children: _jsxs("div", { className: "flex-1 min-w-0", children: [_jsx("p", { className: "text-[12px] font-medium truncate", children: extension.name }), extension.description && (_jsx("p", { className: "text-[11px] text-muted-foreground/70 truncate", children: extension.description }))] }) }, extension.extensionId)))] }), _jsx("div", { className: "border-t border-border/40 p-1", children: _jsxs("button", { type: "button", onClick: requestNew, className: "flex w-full items-center gap-2 rounded-md px-3 py-2 text-[12px] text-muted-foreground hover:bg-accent hover:text-foreground cursor-pointer", children: [_jsx(IconPlus, { className: "h-3.5 w-3.5" }), _jsx("span", { children: t("extensions.buildNewWidget") })] }) })] })] }));
|
|
99
109
|
}
|
|
100
110
|
function describeSlot(slotId, t) {
|
|
101
111
|
if (slotId === "mail.contact-sidebar.bottom") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtensionSlot.js","sourceRoot":"","sources":["../../../src/client/extensions/ExtensionSlot.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EACL,OAAO,EACP,cAAc,EACd,cAAc,GACf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,OAAO,EACP,cAAc,EACd,eAAe,EACf,cAAc,GACf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAkC3D;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,aAAa,CAAC,EAC5B,EAAE,EACF,OAAO,EACP,mBAAmB,EACnB,SAAS,EACT,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O;YACL,KAAK,EAAE,CAAC,CAAC,iCAAiC,CAAC;YAC3C,WAAW,EAAE,CAAC,CAAC,sCAAsC,CAAC;SACvD,CAAC;IACJ,CAAC;IAED,IAAI,MAAM,KAAK,8BAA8B,EAAE,CAAC;QAC9C,OAAO;YACL,KAAK,EAAE,CAAC,CAAC,8BAA8B,CAAC;YACxC,WAAW,EAAE,CAAC,CAAC,mCAAmC,CAAC;SACpD,CAAC;IACJ,CAAC;IAED,OAAO;QACL,KAAK,EAAE,CAAC,CAAC,0BAA0B,CAAC;QACpC,WAAW,EAAE,MAAM;KACpB,CAAC;AACJ,CAAC","sourcesContent":["import { IconPlus } from \"@tabler/icons-react\";\nimport { useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport { useState } from \"react\";\n\nimport { sendToAgentChat } from \"../agent-chat.js\";\nimport { agentNativePath } from \"../api-path.js\";\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"../components/ui/popover.js\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from \"../components/ui/tooltip.js\";\nimport { useT } from \"../i18n.js\";\nimport { EmbeddedExtension } from \"./EmbeddedExtension.js\";\n\ninterface SlotInstall {\n installId: string;\n extensionId: string;\n name: string;\n description: string;\n icon: string | null;\n updatedAt: string;\n position: number;\n config: string | null;\n}\n\ninterface AvailableTool {\n extensionId: string;\n name: string;\n description: string;\n icon: string | null;\n config: string | null;\n}\n\nexport interface ExtensionSlotProps {\n /** Stable slot identifier — convention: `<app>.<area>.<position>`. */\n id: string;\n /** Object pushed to each embedded extension as `slotContext`. */\n context?: Record<string, unknown> | null;\n /** Show a small \"+\" affordance when the slot has no installs. Default: false. */\n showEmptyAffordance?: boolean;\n /** Optional className applied to the wrapper. */\n className?: string;\n /** Optional className applied to each EmbeddedExtension. */\n toolClassName?: string;\n}\n\n/**\n * A named UI slot that user-installed extensions can render into. Apps drop this\n * component wherever they want to allow extensions; the framework handles\n * fetching, sandboxing, context delivery, and lifecycle.\n *\n * Example:\n *\n * <ExtensionSlot\n * id=\"mail.contact-sidebar.bottom\"\n * context={{ contactEmail }}\n * showEmptyAffordance\n * />\n */\nexport function ExtensionSlot({\n id,\n context,\n showEmptyAffordance,\n className,\n toolClassName,\n}: ExtensionSlotProps) {\n const { data: installs = [], isLoading } = useQuery<SlotInstall[]>({\n queryKey: [\"slot-installs\", id],\n queryFn: async () => {\n const res = await fetch(\n agentNativePath(\n `/_agent-native/slots/${encodeURIComponent(id)}/installs`,\n ),\n );\n if (!res.ok) return [];\n return res.json();\n },\n });\n\n if (isLoading) {\n return null;\n }\n\n if (installs.length === 0) {\n if (!showEmptyAffordance) return null;\n return (\n <div className={className}>\n <SlotEmptyAffordance slotId={id} />\n </div>\n );\n }\n\n return (\n <div className={className}>\n {installs.map((install) => (\n <EmbeddedExtension\n key={install.installId}\n extensionId={install.extensionId}\n slotId={id}\n context={context}\n className={toolClassName}\n />\n ))}\n </div>\n );\n}\n\nfunction SlotEmptyAffordance({ slotId }: { slotId: string }) {\n const t = useT();\n const [open, setOpen] = useState(false);\n const { data: available = [], isLoading } = useQuery<AvailableTool[]>({\n queryKey: [\"slot-available\", slotId],\n queryFn: async () => {\n const res = await fetch(\n agentNativePath(\n `/_agent-native/slots/${encodeURIComponent(slotId)}/available`,\n ),\n );\n if (!res.ok) return [];\n return res.json();\n },\n enabled: open,\n });\n const queryClient = useQueryClient();\n\n const install = async (extensionId: string) => {\n queryClient.setQueryData<SlotInstall[]>(\n [\"slot-installs\", slotId],\n (old) => {\n const extension = available.find((t) => t.extensionId === extensionId);\n if (!extension || !old) return old;\n return [\n ...old,\n {\n installId: `optimistic-${extensionId}`,\n extensionId,\n name: extension.name,\n description: extension.description,\n icon: extension.icon,\n updatedAt: new Date().toISOString(),\n position: old.length,\n config: extension.config,\n },\n ];\n },\n );\n setOpen(false);\n try {\n await fetch(\n agentNativePath(\n `/_agent-native/slots/${encodeURIComponent(slotId)}/install`,\n ),\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ extensionId }),\n },\n );\n } finally {\n queryClient.invalidateQueries({ queryKey: [\"slot-installs\", slotId] });\n }\n };\n\n const requestNew = () => {\n setOpen(false);\n sendToAgentChat({\n message: t(\"extensions.createWidgetPrompt\", { slotId }),\n submit: false,\n openSidebar: true,\n });\n };\n const slotDescription = describeSlot(slotId, t);\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <TooltipProvider delayDuration={200}>\n <Tooltip>\n <TooltipTrigger asChild>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n className=\"flex w-full items-center gap-2 px-4 py-2 text-[11px] text-muted-foreground/60 hover:text-muted-foreground cursor-pointer\"\n >\n <div className=\"h-5 w-5 rounded-md border border-dashed border-border/40 flex items-center justify-center shrink-0\">\n <IconPlus className=\"h-3 w-3\" />\n </div>\n <span>{t(\"extensions.addWidget\")}</span>\n </button>\n </PopoverTrigger>\n </TooltipTrigger>\n <TooltipContent>{t(\"extensions.addWidget\")}</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n <PopoverContent\n side=\"left\"\n align=\"end\"\n sideOffset={8}\n className=\"w-72 p-0 overflow-hidden\"\n >\n <div className=\"px-3 py-2 border-b border-border/40\">\n <p className=\"text-[12px] font-medium\">{slotDescription.title}</p>\n <p className=\"text-[11px] text-muted-foreground/70\">\n {slotDescription.description}\n </p>\n </div>\n <div className=\"max-h-72 overflow-y-auto py-1\">\n {isLoading && (\n <div className=\"px-3 py-3 text-[12px] text-muted-foreground/60\">\n {t(\"extensions.loading\")}\n </div>\n )}\n {!isLoading && available.length === 0 && (\n <div className=\"px-3 py-3 text-[12px] text-muted-foreground/60\">\n {t(\"extensions.noWidgetsAvailable\")}\n </div>\n )}\n {available.map((extension) => (\n <button\n key={extension.extensionId}\n type=\"button\"\n onClick={() => install(extension.extensionId)}\n className=\"flex w-full items-start gap-2 px-3 py-2 text-left hover:bg-accent cursor-pointer\"\n >\n <div className=\"flex-1 min-w-0\">\n <p className=\"text-[12px] font-medium truncate\">\n {extension.name}\n </p>\n {extension.description && (\n <p className=\"text-[11px] text-muted-foreground/70 truncate\">\n {extension.description}\n </p>\n )}\n </div>\n </button>\n ))}\n </div>\n <div className=\"border-t border-border/40 p-1\">\n <button\n type=\"button\"\n onClick={requestNew}\n className=\"flex w-full items-center gap-2 rounded-md px-3 py-2 text-[12px] text-muted-foreground hover:bg-accent hover:text-foreground cursor-pointer\"\n >\n <IconPlus className=\"h-3.5 w-3.5\" />\n <span>{t(\"extensions.buildNewWidget\")}</span>\n </button>\n </div>\n </PopoverContent>\n </Popover>\n );\n}\n\nfunction describeSlot(\n slotId: string,\n t: ReturnType<typeof useT>,\n): { title: string; description: string } {\n if (slotId === \"mail.contact-sidebar.bottom\") {\n return {\n title: t(\"extensions.contactSidebarWidget\"),\n description: t(\"extensions.contactSidebarDescription\"),\n };\n }\n\n if (slotId === \"calendar.event-detail.bottom\") {\n return {\n title: t(\"extensions.eventDetailWidget\"),\n description: t(\"extensions.eventDetailDescription\"),\n };\n }\n\n return {\n title: t(\"extensions.addWidgetHere\"),\n description: slotId,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ExtensionSlot.js","sourceRoot":"","sources":["../../../src/client/extensions/ExtensionSlot.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EACL,OAAO,EACP,cAAc,EACd,cAAc,GACf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,OAAO,EACP,cAAc,EACd,eAAe,EACf,cAAc,GACf,MAAM,6BAA6B,CAAC;AACrC,OAAO,E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,CAAC;YACxC,WAAW,EAAE,CAAC,CAAC,mCAAmC,CAAC;SACpD,CAAC;IACJ,CAAC;IAED,OAAO;QACL,KAAK,EAAE,CAAC,CAAC,0BAA0B,CAAC;QACpC,WAAW,EAAE,MAAM;KACpB,CAAC;AACJ,CAAC","sourcesContent":["import { IconPlus } from \"@tabler/icons-react\";\nimport { useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport { useState } from \"react\";\n\nimport { sendToAgentChat } from \"../agent-chat.js\";\nimport { agentNativePath } from \"../api-path.js\";\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"../components/ui/popover.js\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from \"../components/ui/tooltip.js\";\nimport { useT } from \"../i18n.js\";\nimport { EmbeddedExtension } from \"./EmbeddedExtension.js\";\nimport { ExtensionQueryErrorState } from \"./ExtensionQueryErrorState.js\";\n\ninterface SlotInstall {\n installId: string;\n extensionId: string;\n name: string;\n description: string;\n icon: string | null;\n updatedAt: string;\n position: number;\n config: string | null;\n}\n\ninterface AvailableTool {\n extensionId: string;\n name: string;\n description: string;\n icon: string | null;\n config: string | null;\n}\n\nexport interface ExtensionSlotProps {\n /** Stable slot identifier — convention: `<app>.<area>.<position>`. */\n id: string;\n /** Object pushed to each embedded extension as `slotContext`. */\n context?: Record<string, unknown> | null;\n /** Show a small \"+\" affordance when the slot has no installs. Default: false. */\n showEmptyAffordance?: boolean;\n /** Optional className applied to the wrapper. */\n className?: string;\n /** Optional className applied to each EmbeddedExtension. */\n toolClassName?: string;\n}\n\n/**\n * A named UI slot that user-installed extensions can render into. Apps drop this\n * component wherever they want to allow extensions; the framework handles\n * fetching, sandboxing, context delivery, and lifecycle.\n *\n * Example:\n *\n * <ExtensionSlot\n * id=\"mail.contact-sidebar.bottom\"\n * context={{ contactEmail }}\n * showEmptyAffordance\n * />\n */\nexport function ExtensionSlot({\n id,\n context,\n showEmptyAffordance,\n className,\n toolClassName,\n}: ExtensionSlotProps) {\n const t = useT();\n const installsQuery = useQuery<SlotInstall[]>({\n queryKey: [\"slot-installs\", id],\n queryFn: async () => {\n const res = await fetch(\n agentNativePath(\n `/_agent-native/slots/${encodeURIComponent(id)}/installs`,\n ),\n );\n if (!res.ok)\n throw new Error(`Failed to load slot installs (${res.status})`);\n return res.json();\n },\n });\n const installs = installsQuery.data ?? [];\n\n if (installsQuery.isLoading) {\n return null;\n }\n\n if (installsQuery.isError) {\n return (\n <ExtensionQueryErrorState\n compact\n className={className}\n message={t(\"extensions.widgetsLoadError\")}\n onRetry={() => void installsQuery.refetch()}\n retrying={installsQuery.isFetching}\n />\n );\n }\n\n if (installs.length === 0) {\n if (!showEmptyAffordance) return null;\n return (\n <div className={className}>\n <SlotEmptyAffordance slotId={id} />\n </div>\n );\n }\n\n return (\n <div className={className}>\n {installs.map((install) => (\n <EmbeddedExtension\n key={install.installId}\n extensionId={install.extensionId}\n slotId={id}\n context={context}\n className={toolClassName}\n />\n ))}\n </div>\n );\n}\n\nfunction SlotEmptyAffordance({ slotId }: { slotId: string }) {\n const t = useT();\n const [open, setOpen] = useState(false);\n const availableQuery = useQuery<AvailableTool[]>({\n queryKey: [\"slot-available\", slotId],\n queryFn: async () => {\n const res = await fetch(\n agentNativePath(\n `/_agent-native/slots/${encodeURIComponent(slotId)}/available`,\n ),\n );\n if (!res.ok) {\n throw new Error(`Failed to load available extensions (${res.status})`);\n }\n return res.json();\n },\n enabled: open,\n });\n const available = availableQuery.data ?? [];\n const queryClient = useQueryClient();\n\n const install = async (extensionId: string) => {\n queryClient.setQueryData<SlotInstall[]>(\n [\"slot-installs\", slotId],\n (old) => {\n const extension = available.find((t) => t.extensionId === extensionId);\n if (!extension || !old) return old;\n return [\n ...old,\n {\n installId: `optimistic-${extensionId}`,\n extensionId,\n name: extension.name,\n description: extension.description,\n icon: extension.icon,\n updatedAt: new Date().toISOString(),\n position: old.length,\n config: extension.config,\n },\n ];\n },\n );\n setOpen(false);\n try {\n await fetch(\n agentNativePath(\n `/_agent-native/slots/${encodeURIComponent(slotId)}/install`,\n ),\n {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ extensionId }),\n },\n );\n } finally {\n queryClient.invalidateQueries({ queryKey: [\"slot-installs\", slotId] });\n }\n };\n\n const requestNew = () => {\n setOpen(false);\n sendToAgentChat({\n message: t(\"extensions.createWidgetPrompt\", { slotId }),\n submit: false,\n openSidebar: true,\n });\n };\n const slotDescription = describeSlot(slotId, t);\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <TooltipProvider delayDuration={200}>\n <Tooltip>\n <TooltipTrigger asChild>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n className=\"flex w-full items-center gap-2 px-4 py-2 text-[11px] text-muted-foreground/60 hover:text-muted-foreground cursor-pointer\"\n >\n <div className=\"h-5 w-5 rounded-md border border-dashed border-border/40 flex items-center justify-center shrink-0\">\n <IconPlus className=\"h-3 w-3\" />\n </div>\n <span>{t(\"extensions.addWidget\")}</span>\n </button>\n </PopoverTrigger>\n </TooltipTrigger>\n <TooltipContent>{t(\"extensions.addWidget\")}</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n <PopoverContent\n side=\"left\"\n align=\"end\"\n sideOffset={8}\n className=\"w-72 p-0 overflow-hidden\"\n >\n <div className=\"px-3 py-2 border-b border-border/40\">\n <p className=\"text-[12px] font-medium\">{slotDescription.title}</p>\n <p className=\"text-[11px] text-muted-foreground/70\">\n {slotDescription.description}\n </p>\n </div>\n <div className=\"max-h-72 overflow-y-auto py-1\">\n {availableQuery.isLoading && (\n <div className=\"px-3 py-3 text-[12px] text-muted-foreground/60\">\n {t(\"extensions.loading\")}\n </div>\n )}\n {availableQuery.isError && (\n <ExtensionQueryErrorState\n compact\n message={t(\"extensions.widgetsLoadError\")}\n onRetry={() => void availableQuery.refetch()}\n retrying={availableQuery.isFetching}\n />\n )}\n {!availableQuery.isLoading &&\n !availableQuery.isError &&\n available.length === 0 && (\n <div className=\"px-3 py-3 text-[12px] text-muted-foreground/60\">\n {t(\"extensions.noWidgetsAvailable\")}\n </div>\n )}\n {available.map((extension) => (\n <button\n key={extension.extensionId}\n type=\"button\"\n onClick={() => install(extension.extensionId)}\n className=\"flex w-full items-start gap-2 px-3 py-2 text-left hover:bg-accent cursor-pointer\"\n >\n <div className=\"flex-1 min-w-0\">\n <p className=\"text-[12px] font-medium truncate\">\n {extension.name}\n </p>\n {extension.description && (\n <p className=\"text-[11px] text-muted-foreground/70 truncate\">\n {extension.description}\n </p>\n )}\n </div>\n </button>\n ))}\n </div>\n <div className=\"border-t border-border/40 p-1\">\n <button\n type=\"button\"\n onClick={requestNew}\n className=\"flex w-full items-center gap-2 rounded-md px-3 py-2 text-[12px] text-muted-foreground hover:bg-accent hover:text-foreground cursor-pointer\"\n >\n <IconPlus className=\"h-3.5 w-3.5\" />\n <span>{t(\"extensions.buildNewWidget\")}</span>\n </button>\n </div>\n </PopoverContent>\n </Popover>\n );\n}\n\nfunction describeSlot(\n slotId: string,\n t: ReturnType<typeof useT>,\n): { title: string; description: string } {\n if (slotId === \"mail.contact-sidebar.bottom\") {\n return {\n title: t(\"extensions.contactSidebarWidget\"),\n description: t(\"extensions.contactSidebarDescription\"),\n };\n }\n\n if (slotId === \"calendar.event-detail.bottom\") {\n return {\n title: t(\"extensions.eventDetailWidget\"),\n description: t(\"extensions.eventDetailDescription\"),\n };\n }\n\n return {\n title: t(\"extensions.addWidgetHere\"),\n description: slotId,\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExtensionViewer.d.ts","sourceRoot":"","sources":["../../../src/client/extensions/ExtensionViewer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExtensionViewer.d.ts","sourceRoot":"","sources":["../../../src/client/extensions/ExtensionViewer.tsx"],"names":[],"mappings":"AAuHA,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;CACrB;AAsrBD,wBAAgB,eAAe,CAAC,EAAE,WAAW,EAAE,EAAE,oBAAoB,+BA8lBpE"}
|
|
@@ -14,9 +14,11 @@ import { Popover, PopoverContent, PopoverTrigger, } from "../components/ui/popov
|
|
|
14
14
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "../components/ui/tooltip.js";
|
|
15
15
|
import { PromptComposer } from "../composer/PromptComposer.js";
|
|
16
16
|
import { isEmbedMcpChatBridgeActive } from "../embed-auth.js";
|
|
17
|
+
import { useT } from "../i18n.js";
|
|
17
18
|
import { ShareButton } from "../sharing/ShareButton.js";
|
|
18
19
|
import { deleteOrHideExtension, invalidateExtensionRemoval, } from "./delete-extension.js";
|
|
19
20
|
import { extensionLoadError, extensionLoadErrorStatus, shouldRetryExtensionLoad, } from "./extension-load-error.js";
|
|
21
|
+
import { ExtensionQueryErrorState } from "./ExtensionQueryErrorState.js";
|
|
20
22
|
import { isAllowedExtensionPath, sanitizeExtensionRequestOptions, checkBridgePolicy, } from "./iframe-bridge.js";
|
|
21
23
|
import { normalizeAgentNativeExtensionSandbox } from "./portable-extension.js";
|
|
22
24
|
const THEME_CSS_VARS = [
|
|
@@ -332,6 +334,7 @@ function EditToolPopover({ extension, onOpenChange, }) {
|
|
|
332
334
|
return (_jsxs(Popover, { open: open, onOpenChange: setOpenAndNotify, children: [_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(PopoverTrigger, { asChild: true, children: _jsx("button", { type: "button", className: "inline-flex items-center justify-center rounded-md h-8 w-8 text-muted-foreground hover:bg-accent hover:text-accent-foreground cursor-pointer", children: _jsx(IconPencil, { className: "h-4 w-4" }) }) }) }), _jsx(TooltipContent, { children: "Edit" })] }), _jsxs(PopoverContent, { align: "end", sideOffset: 6, className: "w-[420px] p-3", children: [_jsx("p", { className: "px-1 pb-2 text-sm font-semibold text-foreground", children: "Edit extension" }), _jsx(PromptComposer, { autoFocus: true, placeholder: "What would you like to change?", draftScope: `extensions:edit:${extension.id}`, onSubmit: handleSubmit })] })] }));
|
|
333
335
|
}
|
|
334
336
|
function ExtensionHistoryPopover({ extensionId, canEdit, onRestored, onOpenChange, }) {
|
|
337
|
+
const t = useT();
|
|
335
338
|
const [open, setOpen] = useState(false);
|
|
336
339
|
const [selectedVersion, setSelectedVersion] = useState(null);
|
|
337
340
|
const [restoringVersion, setRestoringVersion] = useState(null);
|
|
@@ -399,15 +402,16 @@ function ExtensionHistoryPopover({ extensionId, canEdit, onRestored, onOpenChang
|
|
|
399
402
|
}
|
|
400
403
|
};
|
|
401
404
|
const compactedDiff = compactDiffLines(detailQuery.data?.diff ?? []);
|
|
402
|
-
return (_jsxs(Popover, { open: open, onOpenChange: setOpenAndNotify, children: [_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(PopoverTrigger, { asChild: true, children: _jsx("button", { type: "button", className: "inline-flex items-center justify-center rounded-md h-8 w-8 text-muted-foreground hover:bg-accent hover:text-accent-foreground cursor-pointer", "aria-label": "History", children: _jsx(IconHistory, { className: "h-4 w-4" }) }) }) }), _jsx(TooltipContent, { children: "History" })] }), _jsx(PopoverContent, { align: "end", sideOffset: 6, className: "w-[42rem] max-w-[calc(100vw-2rem)] p-0", children: _jsxs("div", { className: "grid max-h-[72vh] min-h-[24rem] grid-cols-1 overflow-hidden sm:grid-cols-[15rem_minmax(0,1fr)]", children: [_jsxs("div", { className: "border-b border-border/60 sm:border-b-0 sm:border-r", children: [_jsxs("div", { className: "border-b border-border/60 px-3 py-2", children: [_jsx("p", { className: "text-sm font-semibold text-foreground", children: "History" }), _jsx("p", { className: "text-[11px] text-muted-foreground", children: "Snapshots are saved when extensions change." })] }), _jsx("div", { className: "max-h-56 overflow-y-auto p-1 sm:max-h-[calc(72vh-3.5rem)]", children: historyQuery.isLoading ? (_jsxs("div", { className: "flex items-center gap-2 px-2 py-3 text-xs text-muted-foreground", children: [_jsx(IconLoader2, { className: "h-3.5 w-3.5 animate-spin" }), "Loading history"] })) : history.length === 0 ? (_jsx("p", { className: "px-2 py-3 text-xs text-muted-foreground", children: "No history yet." })) : (history.map((entry) => (_jsxs("button", { type: "button", onClick: () => setSelectedVersion(entry.version), className: `flex w-full flex-col gap-0.5 rounded-md px-2 py-2 text-left text-xs hover:bg-accent ${entry.version === selectedVersion
|
|
405
|
+
return (_jsxs(Popover, { open: open, onOpenChange: setOpenAndNotify, children: [_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(PopoverTrigger, { asChild: true, children: _jsx("button", { type: "button", className: "inline-flex items-center justify-center rounded-md h-8 w-8 text-muted-foreground hover:bg-accent hover:text-accent-foreground cursor-pointer", "aria-label": "History", children: _jsx(IconHistory, { className: "h-4 w-4" }) }) }) }), _jsx(TooltipContent, { children: "History" })] }), _jsx(PopoverContent, { align: "end", sideOffset: 6, className: "w-[42rem] max-w-[calc(100vw-2rem)] p-0", children: _jsxs("div", { className: "grid max-h-[72vh] min-h-[24rem] grid-cols-1 overflow-hidden sm:grid-cols-[15rem_minmax(0,1fr)]", children: [_jsxs("div", { className: "border-b border-border/60 sm:border-b-0 sm:border-r", children: [_jsxs("div", { className: "border-b border-border/60 px-3 py-2", children: [_jsx("p", { className: "text-sm font-semibold text-foreground", children: "History" }), _jsx("p", { className: "text-[11px] text-muted-foreground", children: "Snapshots are saved when extensions change." })] }), _jsx("div", { className: "max-h-56 overflow-y-auto p-1 sm:max-h-[calc(72vh-3.5rem)]", children: historyQuery.isLoading ? (_jsxs("div", { className: "flex items-center gap-2 px-2 py-3 text-xs text-muted-foreground", children: [_jsx(IconLoader2, { className: "h-3.5 w-3.5 animate-spin" }), "Loading history"] })) : historyQuery.isError ? (_jsx(ExtensionQueryErrorState, { compact: true, message: t("extensions.historyLoadError"), onRetry: () => void historyQuery.refetch(), retrying: historyQuery.isFetching })) : history.length === 0 ? (_jsx("p", { className: "px-2 py-3 text-xs text-muted-foreground", children: "No history yet." })) : (history.map((entry) => (_jsxs("button", { type: "button", onClick: () => setSelectedVersion(entry.version), className: `flex w-full flex-col gap-0.5 rounded-md px-2 py-2 text-left text-xs hover:bg-accent ${entry.version === selectedVersion
|
|
403
406
|
? "bg-accent text-accent-foreground"
|
|
404
407
|
: "text-foreground"}`, children: [_jsxs("span", { className: "flex items-center justify-between gap-2", children: [_jsxs("span", { className: "font-medium", children: ["Version ", entry.version] }), _jsx("span", { className: "text-[10px] text-muted-foreground", children: operationLabel(entry.operation) })] }), _jsx("span", { className: "line-clamp-2 text-[11px] text-muted-foreground", children: entry.summary || "Saved version" }), _jsx("span", { className: "text-[10px] text-muted-foreground/80", children: formatHistoryTime(entry.createdAt) })] }, `${entry.id}-${entry.version}`)))) })] }), _jsxs("div", { className: "flex min-h-0 flex-col", children: [_jsxs("div", { className: "flex items-start justify-between gap-3 border-b border-border/60 px-3 py-2", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "truncate text-sm font-semibold text-foreground", children: selectedEntry
|
|
405
408
|
? `Version ${selectedEntry.version}`
|
|
406
|
-
: "Select a version" }), _jsx("p", { className: "truncate text-[11px] text-muted-foreground", children: selectedEntry?.summary ?? "Compare saved extension content" })] }), _jsxs("button", { type: "button", disabled: !canRestoreSelected || restoringVersion !== null, onClick: restoreSelected, className: "inline-flex shrink-0 items-center gap-1.5 rounded-md border border-border px-2 py-1 text-[11px] font-medium text-foreground hover:bg-accent disabled:pointer-events-none disabled:opacity-50", children: [restoringVersion === selectedEntry?.version ? (_jsx(IconLoader2, { className: "h-3.5 w-3.5 animate-spin" })) : (_jsx(IconArrowBackUp, { className: "h-3.5 w-3.5" })), "Restore"] })] }), _jsx("div", { className: "min-h-0 flex-1 overflow-auto bg-muted/20", children: detailQuery.isLoading ? (_jsxs("div", { className: "flex h-full items-center justify-center gap-2 text-xs text-muted-foreground", children: [_jsx(IconLoader2, { className: "h-3.5 w-3.5 animate-spin" }), "Loading diff"] })) : detailQuery.isError ? (_jsx(
|
|
409
|
+
: "Select a version" }), _jsx("p", { className: "truncate text-[11px] text-muted-foreground", children: selectedEntry?.summary ?? "Compare saved extension content" })] }), _jsxs("button", { type: "button", disabled: !canRestoreSelected || restoringVersion !== null, onClick: restoreSelected, className: "inline-flex shrink-0 items-center gap-1.5 rounded-md border border-border px-2 py-1 text-[11px] font-medium text-foreground hover:bg-accent disabled:pointer-events-none disabled:opacity-50", children: [restoringVersion === selectedEntry?.version ? (_jsx(IconLoader2, { className: "h-3.5 w-3.5 animate-spin" })) : (_jsx(IconArrowBackUp, { className: "h-3.5 w-3.5" })), "Restore"] })] }), _jsx("div", { className: "min-h-0 flex-1 overflow-auto bg-muted/20", children: detailQuery.isLoading ? (_jsxs("div", { className: "flex h-full items-center justify-center gap-2 text-xs text-muted-foreground", children: [_jsx(IconLoader2, { className: "h-3.5 w-3.5 animate-spin" }), "Loading diff"] })) : detailQuery.isError ? (_jsx(ExtensionQueryErrorState, { message: t("extensions.versionLoadError"), onRetry: () => void detailQuery.refetch(), retrying: detailQuery.isFetching })) : compactedDiff.length === 0 ? (_jsx("div", { className: "p-4 text-xs text-muted-foreground", children: "No content changes in this version." })) : (_jsx("pre", { className: "min-w-full text-[11px] leading-5", children: compactedDiff.map((line, index) => (_jsxs("div", { className: `grid grid-cols-[2rem_minmax(0,1fr)] px-2 ${diffLineClass(line)}`, children: [_jsx("span", { className: "select-none text-right font-mono opacity-70", children: diffLinePrefix(line) }), _jsx("span", { className: "whitespace-pre-wrap break-words pl-3 font-mono", children: line.type === "omitted"
|
|
407
410
|
? `${line.count} unchanged lines`
|
|
408
411
|
: line.text })] }, index))) })) })] })] }) })] }));
|
|
409
412
|
}
|
|
410
413
|
export function ExtensionViewer({ extensionId }) {
|
|
414
|
+
const t = useT();
|
|
411
415
|
const location = useLocation();
|
|
412
416
|
const navigate = useNavigate();
|
|
413
417
|
const [isDark, setIsDark] = useState(false);
|
|
@@ -672,7 +676,7 @@ export function ExtensionViewer({ extensionId }) {
|
|
|
672
676
|
window.addEventListener("message", handleMessage);
|
|
673
677
|
return () => window.removeEventListener("message", handleMessage);
|
|
674
678
|
}, [extensionId, queryClient]);
|
|
675
|
-
const { data: extension, error: extensionError, failureReason: extensionFailureReason, isFetching, isLoading, } = useQuery({
|
|
679
|
+
const { data: extension, error: extensionError, failureReason: extensionFailureReason, isFetching, isLoading, isError, refetch, } = useQuery({
|
|
676
680
|
queryKey: ["extension", extensionId],
|
|
677
681
|
queryFn: async () => {
|
|
678
682
|
const res = await fetch(agentNativePath(`/_agent-native/extensions/${extensionId}`));
|
|
@@ -761,6 +765,9 @@ export function ExtensionViewer({ extensionId }) {
|
|
|
761
765
|
if (isLoading || (!extension && isFetching)) {
|
|
762
766
|
return (_jsxs("div", { className: "flex h-full flex-col", children: [_jsxs("div", { className: "flex h-12 items-center gap-2 px-3 border-b shrink-0", children: [_jsx("div", { className: "h-3.5 w-3.5 rounded bg-muted animate-pulse" }), _jsx("div", { className: "h-3.5 w-24 rounded bg-muted animate-pulse" })] }), _jsx("div", { className: "flex-1 bg-muted/20 animate-pulse" })] }));
|
|
763
767
|
}
|
|
768
|
+
if (isError && !latestFetchDenied) {
|
|
769
|
+
return (_jsx(ExtensionQueryErrorState, { className: "h-full min-h-[20rem]", message: t("extensions.loadError"), onRetry: () => void refetch(), retrying: isFetching }));
|
|
770
|
+
}
|
|
764
771
|
if (latestFetchDenied || !extension) {
|
|
765
772
|
return _jsx(ExtensionUnavailableState, { status: unavailableStatus });
|
|
766
773
|
}
|
|
@@ -778,6 +785,7 @@ export function ExtensionViewer({ extensionId }) {
|
|
|
778
785
|
} }, `${extension.updatedAt}-${refreshKey}`)] })] }) }));
|
|
779
786
|
}
|
|
780
787
|
function ToolMoreMenu({ extensionId, toolName, canDelete, sourceMode, onOpenChange, }) {
|
|
788
|
+
const t = useT();
|
|
781
789
|
const [open, setOpen] = useState(false);
|
|
782
790
|
const [confirmingDelete, setConfirmingDelete] = useState(false);
|
|
783
791
|
const queryClient = useQueryClient();
|
|
@@ -786,16 +794,18 @@ function ToolMoreMenu({ extensionId, toolName, canDelete, sourceMode, onOpenChan
|
|
|
786
794
|
setOpen(v);
|
|
787
795
|
onOpenChange?.(v);
|
|
788
796
|
};
|
|
789
|
-
const
|
|
797
|
+
const slotsQuery = useQuery({
|
|
790
798
|
queryKey: ["extension-slots", extensionId],
|
|
791
799
|
queryFn: async () => {
|
|
792
800
|
const res = await fetch(agentNativePath(`/_agent-native/slots/extension/${extensionId}`));
|
|
793
|
-
if (!res.ok)
|
|
794
|
-
|
|
801
|
+
if (!res.ok) {
|
|
802
|
+
throw new Error(`Failed to load extension slots (${res.status})`);
|
|
803
|
+
}
|
|
795
804
|
return res.json();
|
|
796
805
|
},
|
|
797
806
|
enabled: open,
|
|
798
807
|
});
|
|
808
|
+
const slots = slotsQuery.data ?? [];
|
|
799
809
|
const closeMenu = () => {
|
|
800
810
|
setOpenAndNotify(false);
|
|
801
811
|
setConfirmingDelete(false);
|
|
@@ -827,7 +837,7 @@ function ToolMoreMenu({ extensionId, toolName, canDelete, sourceMode, onOpenChan
|
|
|
827
837
|
setOpenAndNotify(o);
|
|
828
838
|
if (!o)
|
|
829
839
|
setConfirmingDelete(false);
|
|
830
|
-
}, children: [_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(PopoverTrigger, { asChild: true, children: _jsx("button", { type: "button", className: "inline-flex items-center justify-center rounded-md h-8 w-8 text-muted-foreground hover:bg-accent hover:text-accent-foreground cursor-pointer", "aria-label": "More options", children: _jsx(IconDotsVertical, { className: "h-4 w-4" }) }) }) }), _jsx(TooltipContent, { children: "More options" })] }), _jsx(PopoverContent, { align: "end", sideOffset: 4, className: "w-72 p-0", children: !confirmingDelete ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "px-3 py-2 border-b border-border/40", children: [_jsx("p", { className: "text-[12px] font-medium", children: "Appears in" }), slots.length === 0 ? (_jsx("p", { className: "text-[11px] text-muted-foreground/70 mt-0.5", children: "Not installed in any widget areas. Ask the agent to add it somewhere." })) : (_jsxs("p", { className: "text-[11px] text-muted-foreground/70 mt-0.5", children: ["This extension can render in ", slots.length, " widget area", slots.length === 1 ? "" : "s", "."] }))] }), slots.length > 0 && (_jsx("div", { className: "max-h-48 overflow-y-auto py-1", children: slots.map((s) => (_jsxs("div", { className: "flex items-center gap-2 px-3 py-1.5 text-[12px]", children: [_jsx("span", { className: "flex-1 truncate font-mono text-[11px] text-muted-foreground", children: s.slotId }), !isLocalExtension && (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { type: "button", onClick: () => removeFromSlot(s.slotId), className: "rounded p-1 text-muted-foreground/60 hover:bg-accent hover:text-foreground cursor-pointer", "aria-label": "Remove from this widget area", children: _jsx(IconX, { className: "h-3.5 w-3.5" }) }) }), _jsx(TooltipContent, { children: "Remove from this widget area (for me)" })] }))] }, s.id))) })), isLocalExtension ? (_jsx("div", { className: "border-t border-border/40 px-3 py-2 text-[11px] text-muted-foreground", children: "Slot targets and source edits are controlled by this extension's files." })) : (_jsx("div", { className: "border-t border-border/40 p-1", children: _jsxs("button", { type: "button", onClick: () => setConfirmingDelete(true), className: "flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-[12px] text-destructive hover:bg-destructive/10 cursor-pointer text-left", children: [_jsx(IconTrash, { className: "h-3.5 w-3.5" }), _jsx("span", { children: canDelete === false
|
|
840
|
+
}, children: [_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(PopoverTrigger, { asChild: true, children: _jsx("button", { type: "button", className: "inline-flex items-center justify-center rounded-md h-8 w-8 text-muted-foreground hover:bg-accent hover:text-accent-foreground cursor-pointer", "aria-label": "More options", children: _jsx(IconDotsVertical, { className: "h-4 w-4" }) }) }) }), _jsx(TooltipContent, { children: "More options" })] }), _jsx(PopoverContent, { align: "end", sideOffset: 4, className: "w-72 p-0", children: !confirmingDelete ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "px-3 py-2 border-b border-border/40", children: [_jsx("p", { className: "text-[12px] font-medium", children: "Appears in" }), slotsQuery.isError ? (_jsx(ExtensionQueryErrorState, { compact: true, className: "px-0", message: t("extensions.widgetAreasLoadError"), onRetry: () => void slotsQuery.refetch(), retrying: slotsQuery.isFetching })) : slots.length === 0 ? (_jsx("p", { className: "text-[11px] text-muted-foreground/70 mt-0.5", children: "Not installed in any widget areas. Ask the agent to add it somewhere." })) : (_jsxs("p", { className: "text-[11px] text-muted-foreground/70 mt-0.5", children: ["This extension can render in ", slots.length, " widget area", slots.length === 1 ? "" : "s", "."] }))] }), slots.length > 0 && (_jsx("div", { className: "max-h-48 overflow-y-auto py-1", children: slots.map((s) => (_jsxs("div", { className: "flex items-center gap-2 px-3 py-1.5 text-[12px]", children: [_jsx("span", { className: "flex-1 truncate font-mono text-[11px] text-muted-foreground", children: s.slotId }), !isLocalExtension && (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("button", { type: "button", onClick: () => removeFromSlot(s.slotId), className: "rounded p-1 text-muted-foreground/60 hover:bg-accent hover:text-foreground cursor-pointer", "aria-label": "Remove from this widget area", children: _jsx(IconX, { className: "h-3.5 w-3.5" }) }) }), _jsx(TooltipContent, { children: "Remove from this widget area (for me)" })] }))] }, s.id))) })), isLocalExtension ? (_jsx("div", { className: "border-t border-border/40 px-3 py-2 text-[11px] text-muted-foreground", children: "Slot targets and source edits are controlled by this extension's files." })) : (_jsx("div", { className: "border-t border-border/40 p-1", children: _jsxs("button", { type: "button", onClick: () => setConfirmingDelete(true), className: "flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-[12px] text-destructive hover:bg-destructive/10 cursor-pointer text-left", children: [_jsx(IconTrash, { className: "h-3.5 w-3.5" }), _jsx("span", { children: canDelete === false
|
|
831
841
|
? "Remove from my list..."
|
|
832
842
|
: "Delete extension..." })] }) }))] })) : (_jsxs("div", { className: "flex flex-col gap-2 p-3", children: [_jsxs("p", { className: "text-[12px]", children: [canDelete === false ? "Remove " : "Delete ", _jsx("span", { className: "font-medium", children: toolName }), "?", canDelete === false
|
|
833
843
|
? " This hides it from your Extensions list without deleting it for anyone else."
|