@agent-native/core 0.141.7 → 0.144.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/agent-native.eject.json +9 -0
- package/corpus/README.md +1 -1
- package/corpus/templates/analytics/.agents/skills/provider-api/SKILL.md +19 -0
- package/corpus/templates/analytics/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/analytics/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/analytics/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/analytics/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/analytics/AGENTS.md +35 -38
- package/corpus/templates/analytics/actions/ensure-native-v2-dashboards.ts +1 -1
- package/corpus/templates/analytics/actions/list-dashboard-usage-stats.ts +17 -22
- package/corpus/templates/analytics/actions/migrate-first-party-analytics-to-bigquery.ts +1 -1
- package/corpus/templates/analytics/actions/navigate.ts +4 -5
- package/corpus/templates/analytics/actions/provider-api-register.ts +50 -0
- package/corpus/templates/analytics/actions/query-agent-native-analytics.ts +44 -11
- package/corpus/templates/analytics/actions/test-custom-api-connection.ts +106 -0
- package/corpus/templates/analytics/app/components/CustomApiCard.tsx +430 -0
- package/corpus/templates/analytics/app/i18n-data.ts +680 -0
- package/corpus/templates/analytics/app/lib/native-mcp-exclusions.ts +6 -0
- package/corpus/templates/analytics/app/lib/sql-query.ts +33 -6
- package/corpus/templates/analytics/app/pages/DataSources.tsx +4 -0
- package/corpus/templates/analytics/changelog/2026-08-06-analytics-dashboards-load-reliably-during-background-data-sw.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-06-analytics-dashboards-remain-responsive-while-historical-data.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-06-analytics-query-results-now-render-as-a-table-with-csv-downl.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-06-connect-public-https-custom-apis-and-hand-tested-endpoints-t.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-06-durable-agent-worker-memory.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-06-live-dashboard-panels-use-the-shared-query-timeout.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-06-on-demand-billing-is-available-as-a-native-dashboard-with-ta.md +6 -0
- package/corpus/templates/analytics/changelog/2026-08-06-visible-dashboard-names-are-unique.md +6 -0
- package/corpus/templates/analytics/netlify.toml +7 -0
- package/corpus/templates/analytics/scripts/emit-netlify-dashboard-report-cron.ts +4 -0
- package/corpus/templates/analytics/server/db/index.ts +27 -0
- package/corpus/templates/analytics/server/db/schema.ts +10 -0
- package/corpus/templates/analytics/server/lib/dashboards-store.ts +227 -60
- package/corpus/templates/analytics/server/lib/first-party-analytics-backend.ts +156 -45
- package/corpus/templates/analytics/server/lib/native-v2-dashboards.ts +227 -1
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +5 -0
- package/corpus/templates/analytics/server/plugins/analytics-rollup-backfill-jobs.ts +1 -0
- package/corpus/templates/analytics/server/plugins/db.ts +52 -18
- package/corpus/templates/assets/.agents/skills/asset-generation/SKILL.md +28 -2
- package/corpus/templates/assets/.agents/skills/image-generation/SKILL.md +16 -1
- package/corpus/templates/assets/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/assets/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/assets/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/assets/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/brain/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/brain/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/brain/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/brain/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/brain/actions/list-connection-providers.ts +24 -3
- package/corpus/templates/brain/app/lib/dispatch-links.ts +44 -0
- package/corpus/templates/brain/app/routes/sources.tsx +15 -7
- package/corpus/templates/brain/changelog/2026-08-06-brain-provider-setup-links-open-dispatch-correctly-in-standa.md +6 -0
- package/corpus/templates/brain/server/plugins/agent-chat.ts +1 -0
- package/corpus/templates/calendar/.agents/skills/event-management/SKILL.md +26 -0
- package/corpus/templates/calendar/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/calendar/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/calendar/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/calendar/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/calendar/AGENTS.md +11 -32
- package/corpus/templates/calendar/actions/update-event.ts +107 -1
- package/corpus/templates/calendar/app/components/calendar/EventCalendarSelect.tsx +83 -0
- package/corpus/templates/calendar/app/components/calendar/EventDetailPanel.tsx +57 -0
- package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +59 -73
- package/corpus/templates/calendar/app/hooks/use-events.ts +4 -1
- package/corpus/templates/calendar/app/i18n-data.ts +20 -0
- package/corpus/templates/calendar/changelog/2026-08-06-delegated-requests-continue-in-the-background.md +6 -0
- package/corpus/templates/calendar/changelog/2026-08-06-existing-events-can-move-between-connected-google-account-ca.md +6 -0
- package/corpus/templates/calendar/server/lib/google-calendar.ts +101 -0
- package/corpus/templates/calendar/server/plugins/agent-chat.ts +7 -1
- package/corpus/templates/chat/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/chat/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/chat/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/clips/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/clips/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/clips/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/clips/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/clips/app/components/editor/editor-layout.tsx +9 -24
- package/corpus/templates/clips/app/components/editor/timeline-geometry.ts +15 -0
- package/corpus/templates/clips/app/components/editor/waveform.tsx +4 -17
- package/corpus/templates/clips/app/components/player/delete-recording-menu.tsx +14 -3
- package/corpus/templates/clips/app/components/player/player-controls.tsx +0 -3
- package/corpus/templates/clips/app/components/player/scrubber.tsx +2 -33
- package/corpus/templates/clips/app/components/player/video-player.tsx +58 -11
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +28 -38
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +21 -27
- package/corpus/templates/clips/changelog/2026-08-06-clips-recovers-from-stalled-recording-setup-without-requirin.md +6 -0
- package/corpus/templates/clips/changelog/2026-08-06-clips-starts-faster-after-a-deploy-or-idle-period-startup-no.md +6 -0
- package/corpus/templates/clips/changelog/2026-08-06-deleting-a-recording-returns-cleanly-to-the-library-and-fit-.md +6 -0
- package/corpus/templates/clips/changelog/2026-08-06-hide-clip-insights-from-viewers-without-analytics-access.md +6 -0
- package/corpus/templates/clips/changelog/2026-08-06-trimmed-clips-play-on-a-clean-timeline-without-cut-markers.md +6 -0
- package/corpus/templates/clips/desktop/src/app.tsx +48 -20
- package/corpus/templates/clips/desktop/src/lib/recorder.ts +275 -74
- package/corpus/templates/clips/desktop/src/lib/recording-start-guard.ts +84 -0
- package/corpus/templates/clips/desktop/src/overlays/toolbar.tsx +14 -4
- package/corpus/templates/clips/server/plugins/db.ts +214 -26
- package/corpus/templates/content/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/content/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/content/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/content/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/crm/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/crm/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/crm/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/crm/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/crm/changelog/2026-08-06-crm-starts-faster-after-a-deploy-or-idle-period-one-time-dat.md +6 -0
- package/corpus/templates/crm/server/plugins/db.ts +11 -8
- package/corpus/templates/design/.agents/skills/design-generation/SKILL.md +36 -1
- package/corpus/templates/design/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/design/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/design/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/design/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/design/actions/import-from-url.ts +1 -1
- package/corpus/templates/design/app/components/design/LayersPanel.tsx +27 -18
- package/corpus/templates/design/app/pages/Index.tsx +6 -2
- package/corpus/templates/design/changelog/2026-08-05-deleting-a-design-from-the-home-page-no-longer-leaves-the-ap.md +6 -0
- package/corpus/templates/design/changelog/2026-08-05-renaming-a-layer-now-focuses-its-name-field-automatically.md +6 -0
- package/corpus/templates/design/server/plugins/agent-chat.ts +2 -0
- package/corpus/templates/dispatch/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/dispatch/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/dispatch/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/dispatch/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/dispatch/AGENTS.md +8 -1
- package/corpus/templates/dispatch/app/dispatch-extensions.tsx +1 -0
- package/corpus/templates/dispatch/app/hooks/use-navigation-state.ts +30 -15
- package/corpus/templates/dispatch/app/i18n-data.ts +131 -0
- package/corpus/templates/dispatch/app/routes/admin._index.tsx +4 -0
- package/corpus/templates/dispatch/app/routes/admin.agents.tsx +1 -0
- package/corpus/templates/dispatch/app/routes/admin.approvals.tsx +1 -0
- package/corpus/templates/dispatch/app/routes/admin.apps.$appId.tsx +1 -0
- package/corpus/templates/dispatch/app/routes/admin.apps.tsx +1 -0
- package/corpus/templates/dispatch/app/routes/admin.audit.tsx +1 -0
- package/corpus/templates/dispatch/app/routes/admin.automations.tsx +1 -0
- package/corpus/templates/dispatch/app/routes/admin.destinations.tsx +4 -0
- package/corpus/templates/dispatch/app/routes/admin.dreams.tsx +1 -0
- package/corpus/templates/dispatch/app/routes/admin.identities.tsx +1 -0
- package/corpus/templates/dispatch/app/routes/admin.integrations.tsx +4 -0
- package/corpus/templates/dispatch/app/routes/admin.messaging.tsx +1 -0
- package/corpus/templates/dispatch/app/routes/admin.metrics.tsx +1 -0
- package/corpus/templates/dispatch/app/routes/admin.new-app.tsx +1 -0
- package/corpus/templates/dispatch/app/routes/admin.operations.tsx +1 -0
- package/corpus/templates/dispatch/app/routes/admin.thread-debug.tsx +4 -0
- package/corpus/templates/dispatch/app/routes/admin.transactional-email.$appId.$id.tsx +4 -0
- package/corpus/templates/dispatch/app/routes/admin.transactional-email.tsx +4 -0
- package/corpus/templates/dispatch/app/routes/admin.tsx +1 -0
- package/corpus/templates/dispatch/app/routes/admin.vault.tsx +1 -0
- package/corpus/templates/dispatch/app/routes/admin.workspace.tsx +1 -0
- package/corpus/templates/dispatch/changelog/2026-08-06-dispatch-keeps-everyday-navigation-focused-while-management-.md +6 -0
- package/corpus/templates/dispatch/changelog/2026-08-06-ready-workspace-apps-stay-one-click-away-in-a-compact-dispat.md +6 -0
- package/corpus/templates/dispatch/changelog/2026-08-06-shared-vault-values-and-management-are-now-restricted-to-wor.md +6 -0
- package/corpus/templates/factory/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/factory/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/factory/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/factory/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/forms/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/forms/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/forms/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/forms/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/forms/changelog/2026-08-06-delegated-requests-continue-in-the-background.md +6 -0
- package/corpus/templates/forms/server/plugins/agent-chat.ts +4 -0
- package/corpus/templates/macros/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/macros/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/macros/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/macros/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/mail/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/mail/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/mail/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/mail/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/mail/changelog/2026-08-06-delegated-requests-continue-in-the-background.md +6 -0
- package/corpus/templates/mail/server/plugins/agent-chat.ts +6 -0
- package/corpus/templates/plan/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/plan/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/plan/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/plan/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/slides/.agents/skills/create-deck/SKILL.md +48 -5
- package/corpus/templates/slides/.agents/skills/design-systems/SKILL.md +37 -1
- package/corpus/templates/slides/.agents/skills/image-generation-via-a2a/SKILL.md +6 -0
- package/corpus/templates/slides/.agents/skills/slide-editing/SKILL.md +15 -2
- package/corpus/templates/slides/.agents/skills/slide-images/SKILL.md +29 -24
- package/corpus/templates/slides/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/slides/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/slides/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/slides/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/corpus/templates/slides/AGENTS.md +17 -21
- package/corpus/templates/slides/_gitignore +1 -0
- package/corpus/templates/slides/actions/export-pptx.ts +470 -36
- package/corpus/templates/slides/actions/get-deck.ts +12 -0
- package/corpus/templates/slides/actions/import-file.ts +175 -139
- package/corpus/templates/slides/actions/import-google-slides-reference.ts +271 -12
- package/corpus/templates/slides/actions/import-pptx.ts +193 -68
- package/corpus/templates/slides/actions/patch-deck.ts +51 -0
- package/corpus/templates/slides/actions/update-slide.ts +29 -3
- package/corpus/templates/slides/app/components/deck/DeckCard.tsx +10 -13
- package/corpus/templates/slides/app/components/editor/AddSlidePopover.tsx +5 -1
- package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +25 -12
- package/corpus/templates/slides/app/components/editor/ExportMenu.tsx +112 -57
- package/corpus/templates/slides/app/components/editor/GoogleDriveConnectionCta.tsx +202 -0
- package/corpus/templates/slides/app/components/editor/GoogleSlidesReferenceImport.tsx +26 -14
- package/corpus/templates/slides/app/components/editor/PromptDialog.tsx +173 -0
- package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +182 -141
- package/corpus/templates/slides/app/components/editor/canvas-interactions/index.ts +1 -0
- package/corpus/templates/slides/app/components/editor/canvas-interactions/slides-canvas-adapter.ts +18 -0
- package/corpus/templates/slides/app/components/editor/slide-text-targets.ts +85 -0
- package/corpus/templates/slides/app/components/layout/Layout.tsx +3 -0
- package/corpus/templates/slides/app/components/onboarding/FirstDeckOnboardingFlow.tsx +15 -0
- package/corpus/templates/slides/app/components/presentation/PresentationView.tsx +27 -1
- package/corpus/templates/slides/app/i18n/en-US.ts +1 -0
- package/corpus/templates/slides/app/lib/create-deck-generation.ts +72 -11
- package/corpus/templates/slides/app/lib/deck-preview-frame.ts +15 -0
- package/corpus/templates/slides/app/lib/deck-share-links.ts +9 -0
- package/corpus/templates/slides/app/lib/export-pptx-client.ts +89 -0
- package/corpus/templates/slides/app/lib/import-uploaded-deck.ts +89 -0
- package/corpus/templates/slides/app/lib/slide-animation-elements.ts +3 -0
- package/corpus/templates/slides/app/pages/Index.tsx +172 -15
- package/corpus/templates/slides/changelog/2026-08-06-clicking-the-gray-canvas-around-a-slide-clears-its-selection.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-06-deck-thumbnails-keep-a-consistent-listing-frame-across-aspec.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-06-deep-linked-decks-open-directly-instead-of-being-interrupted.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-06-google-slides-exports-now-show-clear-import-steps-when-direc.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-06-import-pdf-google-slides-and-powerpoint-decks-directly-from-.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-06-imported-powerpoint-exports-keep-text-and-images-editable-an.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-06-presentation-prompts-continue-adding-rendered-slides-until-t.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-06-public-decks-now-share-read-only-presentation-links-by-defau.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-06-slides-offers-a-direct-connect-google-button-when-a-drive-co.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-06-slides-preserve-uploaded-pdf-layouts-accept-larger-reference.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-06-styled-words-stay-part-of-their-text-box-instead-of-becoming.md +6 -0
- package/corpus/templates/slides/changelog/2026-08-06-uploaded-decks-keep-their-slides-and-visuals-when-you-improv.md +6 -0
- package/corpus/templates/slides/server/handlers/google-docs-auth.ts +7 -20
- package/corpus/templates/slides/server/handlers/import/html-converter.ts +247 -13
- package/corpus/templates/slides/server/handlers/import/pptx-assets.ts +67 -0
- package/corpus/templates/slides/server/handlers/import/pptx-parser.ts +2 -0
- package/corpus/templates/slides/server/handlers/uploads.ts +7 -3
- package/corpus/templates/slides/server/lib/chat-attachments.ts +7 -4
- package/corpus/templates/slides/server/lib/emails.ts +7 -2
- package/corpus/templates/slides/server/lib/google-docs-error.ts +50 -0
- package/corpus/templates/slides/server/lib/google-docs-oauth.ts +1 -0
- package/corpus/templates/slides/server/lib/import-asset-storage.ts +127 -0
- package/corpus/templates/slides/server/lib/source-import.ts +167 -0
- package/corpus/templates/slides/server/plugins/agent-chat.ts +12 -3
- package/corpus/templates/slides/server/routes/api/import-assets/[token].get.ts +70 -0
- package/corpus/templates/slides/shared/upload-types.ts +3 -0
- package/corpus/templates/tasks/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/corpus/templates/tasks/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/corpus/templates/tasks/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/corpus/templates/tasks/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/dist/agent/production-agent.d.ts +17 -0
- package/dist/agent/production-agent.js +72 -1
- package/dist/cli/agent-plugin.d.ts +112 -0
- package/dist/cli/agent-plugin.js +1081 -0
- package/dist/cli/app-skill.js +39 -1
- package/dist/cli/code-agent-executor.d.ts +3 -0
- package/dist/cli/code-agent-executor.js +51 -13
- package/dist/cli/index.js +13 -0
- package/dist/cli/templates-meta.js +1 -1
- package/dist/client/AgentPanel.d.ts +3 -1
- package/dist/client/AgentPanel.js +9 -2
- package/dist/client/AssistantChat.d.ts +8 -0
- package/dist/client/AssistantChat.js +23 -8
- package/dist/client/NewWorkspaceAppFlow.js +1 -0
- package/dist/client/agent-chat-adapter.js +123 -4
- package/dist/client/assistant-ui-recovery.d.ts +2 -1
- package/dist/client/assistant-ui-recovery.js +7 -3
- package/dist/client/onboarding/FirstRunOnboarding.js +11 -4
- package/dist/client/org/TeamPage.js +1 -1
- package/dist/client/require-session.js +1 -1
- package/dist/client/resources/McpConnectionSuggestion.d.ts +1 -0
- package/dist/client/resources/McpConnectionSuggestion.js +27 -10
- package/dist/client/resources/McpIntegrationDialog.js +77 -45
- package/dist/client/resources/mcp-integration-catalog.d.ts +13 -1
- package/dist/client/resources/mcp-integration-catalog.js +255 -2
- package/dist/client/resources/mcp-integration-logos.js +18 -2
- package/dist/client/settings/AccountSettingsCard.js +2 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/db/client.d.ts +9 -0
- package/dist/db/client.js +51 -16
- package/dist/db/create-get-db.js +2 -2
- package/dist/db/ddl-guard.d.ts +11 -10
- package/dist/db/ddl-guard.js +40 -12
- package/dist/deploy/build.d.ts +2 -0
- package/dist/deploy/build.js +97 -4
- package/dist/deploy/workspace-deploy.js +0 -2
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/guards/no-env-credentials.js +9 -0
- package/dist/ingestion/index.d.ts +1 -1
- package/dist/ingestion/pptx.d.ts +68 -0
- package/dist/ingestion/pptx.js +660 -213
- package/dist/integrations/plugin.js +9 -6
- package/dist/jobs/scheduler.js +79 -23
- package/dist/localization/default-messages.d.ts +54 -0
- package/dist/localization/default-messages.js +57 -2
- package/dist/mcp/screen-memory-stdio.d.ts +7 -7
- package/dist/mcp-client/oauth-routes.d.ts +2 -0
- package/dist/mcp-client/oauth-routes.js +73 -6
- package/dist/observability/routes.d.ts +5 -5
- package/dist/onboarding/app-profile.js +11 -0
- package/dist/progress/routes.d.ts +1 -1
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/resources/store.js +15 -1
- package/dist/scripts/call-agent.js +34 -4
- package/dist/secrets/routes.d.ts +3 -3
- package/dist/server/agent-chat/action-filters-a2a.d.ts +1 -1
- package/dist/server/agent-chat/action-filters-a2a.js +36 -1
- package/dist/server/agent-chat-plugin.js +29 -8
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/auth.js +47 -11
- package/dist/server/better-auth-instance.js +5 -3
- package/dist/server/core-routes-plugin.d.ts +8 -1
- package/dist/server/core-routes-plugin.js +28 -3
- package/dist/server/credential-provider.d.ts +3 -3
- package/dist/server/credential-provider.js +90 -4
- package/dist/server/onboarding-html.d.ts +2 -0
- package/dist/server/onboarding-html.js +115 -29
- package/dist/server/realtime-token.d.ts +1 -1
- package/dist/server/self-dispatch.d.ts +5 -4
- package/dist/server/self-dispatch.js +25 -14
- package/dist/server/ssr-handler.d.ts +1 -1
- package/dist/server/ssr-handler.js +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/shared/cache-control.d.ts +26 -2
- package/dist/shared/cache-control.js +43 -2
- package/dist/shared/password-policy.d.ts +3 -0
- package/dist/shared/password-policy.js +3 -0
- package/dist/sharing/actions/set-resource-visibility.js +16 -4
- package/dist/sharing/registry.d.ts +14 -0
- package/dist/styles/agent-native.css +6 -0
- package/dist/templates/chat/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/dist/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/dist/templates/chat/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/dist/templates/chat/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/dist/templates/default/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/dist/templates/default/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/dist/templates/default/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/dist/templates/default/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/dist/templates/headless/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/dist/templates/headless/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/dist/templates/headless/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/dist/templates/headless/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/dist/templates/workspace-core/.agents/skills/adding-workspace-apps/SKILL.md +6 -0
- package/dist/templates/workspace-core/.agents/skills/performance/SKILL.md +51 -0
- package/dist/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/dist/templates/workspace-core/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/dist/templates/workspace-core/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/dist/templates/workspace-core/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/dist/templates/workspace-root/AGENTS.md +7 -0
- package/dist/user-profile/actions/change-password.js +8 -3
- package/dist/user-profile/actions/set-password.js +5 -1
- package/dist/vite/action-types-plugin.js +59 -0
- package/docs/content/creating-templates.mdx +1 -1
- package/docs/content/getting-started-actions.mdx +38 -189
- package/docs/content/getting-started-database.mdx +80 -164
- package/docs/content/getting-started-pages.mdx +44 -155
- package/docs/content/getting-started.mdx +26 -106
- package/docs/content/skills-guide.mdx +13 -0
- package/package.json +6 -2
- package/src/templates/chat/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/src/templates/chat/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/src/templates/chat/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/src/templates/chat/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/src/templates/default/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/src/templates/default/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/src/templates/default/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/src/templates/default/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/src/templates/headless/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/src/templates/headless/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/src/templates/headless/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/src/templates/headless/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/src/templates/workspace-core/.agents/skills/adding-workspace-apps/SKILL.md +6 -0
- package/src/templates/workspace-core/.agents/skills/performance/SKILL.md +51 -0
- package/src/templates/workspace-core/.agents/skills/turn-into-app/SKILL.md +296 -0
- package/src/templates/workspace-core/.agents/skills/turn-into-app/agents/openai.yaml +4 -0
- package/src/templates/workspace-core/.agents/skills/turn-into-skill/SKILL.md +112 -0
- package/src/templates/workspace-core/.agents/skills/turn-into-skill/agents/openai.yaml +4 -0
- package/src/templates/workspace-root/AGENTS.md +7 -0
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
import { useSendToAgentChat } from "@agent-native/core/client/agent-chat";
|
|
2
|
+
import { useActionMutation } from "@agent-native/core/client/hooks";
|
|
3
|
+
import { useT } from "@agent-native/core/client/i18n";
|
|
4
|
+
import { useOrgRole } from "@agent-native/core/client/org";
|
|
5
|
+
import {
|
|
6
|
+
IconChevronDown,
|
|
7
|
+
IconChevronUp,
|
|
8
|
+
IconExternalLink,
|
|
9
|
+
} from "@tabler/icons-react";
|
|
10
|
+
import { useMemo, useState } from "react";
|
|
11
|
+
|
|
12
|
+
import { Badge } from "@/components/ui/badge";
|
|
13
|
+
import { Button } from "@/components/ui/button";
|
|
14
|
+
import {
|
|
15
|
+
Card,
|
|
16
|
+
CardContent,
|
|
17
|
+
CardDescription,
|
|
18
|
+
CardHeader,
|
|
19
|
+
CardTitle,
|
|
20
|
+
} from "@/components/ui/card";
|
|
21
|
+
import { Input } from "@/components/ui/input";
|
|
22
|
+
import { Label } from "@/components/ui/label";
|
|
23
|
+
import {
|
|
24
|
+
Select,
|
|
25
|
+
SelectContent,
|
|
26
|
+
SelectItem,
|
|
27
|
+
SelectTrigger,
|
|
28
|
+
SelectValue,
|
|
29
|
+
} from "@/components/ui/select";
|
|
30
|
+
import { Textarea } from "@/components/ui/textarea";
|
|
31
|
+
|
|
32
|
+
type AuthType = "none" | "bearer" | "basic" | "api-key-header";
|
|
33
|
+
type TestResult = {
|
|
34
|
+
ok?: boolean;
|
|
35
|
+
status?: number;
|
|
36
|
+
error?: string;
|
|
37
|
+
rowCount?: number;
|
|
38
|
+
columns?: string[];
|
|
39
|
+
sampleRows?: unknown[];
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
type ActionMutationName = Parameters<typeof useActionMutation>[0];
|
|
43
|
+
|
|
44
|
+
const mutationName = (name: string): ActionMutationName => name;
|
|
45
|
+
|
|
46
|
+
export function CustomApiCard() {
|
|
47
|
+
const t = useT();
|
|
48
|
+
const { canManageOrg, org } = useOrgRole();
|
|
49
|
+
const scope = org?.orgId && canManageOrg ? "org" : "user";
|
|
50
|
+
const { send, isGenerating, codeRequiredDialog } = useSendToAgentChat();
|
|
51
|
+
const register = useActionMutation(mutationName("provider-api-register"));
|
|
52
|
+
const test = useActionMutation(mutationName("test-custom-api-connection"));
|
|
53
|
+
const [open, setOpen] = useState(false);
|
|
54
|
+
const [registered, setRegistered] = useState(false);
|
|
55
|
+
const [registeredProviderId, setRegisteredProviderId] = useState<
|
|
56
|
+
string | null
|
|
57
|
+
>(null);
|
|
58
|
+
const [result, setResult] = useState<TestResult | null>(null);
|
|
59
|
+
const [error, setError] = useState<string | null>(null);
|
|
60
|
+
const [authType, setAuthType] = useState<AuthType>("none");
|
|
61
|
+
const [values, setValues] = useState({
|
|
62
|
+
label: "",
|
|
63
|
+
baseUrl: "",
|
|
64
|
+
path: "",
|
|
65
|
+
query: "",
|
|
66
|
+
itemsPath: "",
|
|
67
|
+
credentialKey: "",
|
|
68
|
+
usernameKey: "",
|
|
69
|
+
passwordKey: "",
|
|
70
|
+
headerName: "",
|
|
71
|
+
docsUrl: "",
|
|
72
|
+
});
|
|
73
|
+
function resetConnectionState() {
|
|
74
|
+
setRegistered(false);
|
|
75
|
+
setRegisteredProviderId(null);
|
|
76
|
+
setResult(null);
|
|
77
|
+
}
|
|
78
|
+
const set =
|
|
79
|
+
(key: keyof typeof values) =>
|
|
80
|
+
(event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
|
|
81
|
+
setValues((current) => ({ ...current, [key]: event.target.value }));
|
|
82
|
+
setError(null);
|
|
83
|
+
if (key === "path" || key === "query" || key === "itemsPath") {
|
|
84
|
+
setResult(null);
|
|
85
|
+
} else {
|
|
86
|
+
resetConnectionState();
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
const parsedQuery = useMemo(() => {
|
|
90
|
+
if (!values.query.trim()) return undefined;
|
|
91
|
+
try {
|
|
92
|
+
const value: unknown = JSON.parse(values.query);
|
|
93
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
return value as Record<string, unknown>;
|
|
97
|
+
} catch {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
}, [values.query]);
|
|
101
|
+
|
|
102
|
+
function providerId(label: string): string {
|
|
103
|
+
return (
|
|
104
|
+
label
|
|
105
|
+
.trim()
|
|
106
|
+
.toLowerCase()
|
|
107
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
108
|
+
.replace(/^-+|-+$/g, "")
|
|
109
|
+
.slice(0, 64) || "custom-api"
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function auth() {
|
|
114
|
+
if (authType === "none") return { type: "none" as const };
|
|
115
|
+
if (authType === "basic")
|
|
116
|
+
return {
|
|
117
|
+
type: "basic" as const,
|
|
118
|
+
usernameKey: values.usernameKey.trim(),
|
|
119
|
+
passwordKey: values.passwordKey.trim(),
|
|
120
|
+
};
|
|
121
|
+
if (authType === "api-key-header")
|
|
122
|
+
return {
|
|
123
|
+
type: "api-key-header" as const,
|
|
124
|
+
credentialKey: values.credentialKey.trim(),
|
|
125
|
+
headerName: values.headerName.trim(),
|
|
126
|
+
};
|
|
127
|
+
return {
|
|
128
|
+
type: "bearer" as const,
|
|
129
|
+
credentialKey: values.credentialKey.trim(),
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
async function handleRegister() {
|
|
134
|
+
setError(null);
|
|
135
|
+
const id = providerId(values.label);
|
|
136
|
+
try {
|
|
137
|
+
await register.mutateAsync({
|
|
138
|
+
operation: "upsert",
|
|
139
|
+
scope,
|
|
140
|
+
id,
|
|
141
|
+
label: values.label.trim(),
|
|
142
|
+
baseUrl: values.baseUrl.trim(),
|
|
143
|
+
auth: auth(),
|
|
144
|
+
docsUrls: values.docsUrl.trim() ? [values.docsUrl.trim()] : undefined,
|
|
145
|
+
});
|
|
146
|
+
setRegistered(true);
|
|
147
|
+
setRegisteredProviderId(id);
|
|
148
|
+
setResult(null);
|
|
149
|
+
} catch (cause) {
|
|
150
|
+
setError(
|
|
151
|
+
cause instanceof Error
|
|
152
|
+
? cause.message
|
|
153
|
+
: t("dataSources.customApi.registerError"),
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
async function handleTest() {
|
|
159
|
+
setError(null);
|
|
160
|
+
if (parsedQuery === null) {
|
|
161
|
+
setError(t("dataSources.customApi.invalidQuery"));
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
const provider = registeredProviderId ?? providerId(values.label);
|
|
165
|
+
try {
|
|
166
|
+
const response = await test.mutateAsync({
|
|
167
|
+
provider,
|
|
168
|
+
path: values.path.trim(),
|
|
169
|
+
query: parsedQuery,
|
|
170
|
+
itemsPath: values.itemsPath.trim() || undefined,
|
|
171
|
+
});
|
|
172
|
+
const nextResult = response as TestResult;
|
|
173
|
+
setResult(nextResult);
|
|
174
|
+
if (!nextResult.ok) {
|
|
175
|
+
setError(nextResult.error || t("dataSources.customApi.testError"));
|
|
176
|
+
}
|
|
177
|
+
} catch (cause) {
|
|
178
|
+
setError(
|
|
179
|
+
cause instanceof Error
|
|
180
|
+
? cause.message
|
|
181
|
+
: t("dataSources.customApi.testError"),
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function saveAsProgram() {
|
|
187
|
+
const details = {
|
|
188
|
+
provider: registeredProviderId ?? providerId(values.label),
|
|
189
|
+
path: values.path.trim(),
|
|
190
|
+
itemsPath: values.itemsPath.trim() || undefined,
|
|
191
|
+
query: parsedQuery,
|
|
192
|
+
};
|
|
193
|
+
send({
|
|
194
|
+
submit: true,
|
|
195
|
+
openSidebar: true,
|
|
196
|
+
message: `${t("dataSources.customApi.agentPrompt")}\n\n${JSON.stringify(details)}`,
|
|
197
|
+
context:
|
|
198
|
+
"The endpoint above passed a bounded read-only GET test. Save it as a manual-refresh Analytics Data Program using providerFetch and emit(rows, schema). Do not ask for or include raw credential values; the provider registration already references the user's scoped secret key.",
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
const needsKey = authType !== "none";
|
|
203
|
+
const credentialLink =
|
|
204
|
+
values.credentialKey.trim() ||
|
|
205
|
+
(authType === "basic" ? values.usernameKey.trim() : "");
|
|
206
|
+
return (
|
|
207
|
+
<Card>
|
|
208
|
+
<CardHeader className="p-0">
|
|
209
|
+
<button
|
|
210
|
+
type="button"
|
|
211
|
+
className="flex w-full items-center justify-between gap-3 p-6 text-left"
|
|
212
|
+
aria-expanded={open}
|
|
213
|
+
onClick={() => setOpen((current) => !current)}
|
|
214
|
+
>
|
|
215
|
+
<div>
|
|
216
|
+
<CardTitle>{t("dataSources.customApi.title")}</CardTitle>
|
|
217
|
+
<CardDescription>
|
|
218
|
+
{t("dataSources.customApi.description")}
|
|
219
|
+
</CardDescription>
|
|
220
|
+
</div>
|
|
221
|
+
{open ? (
|
|
222
|
+
<IconChevronUp aria-hidden="true" />
|
|
223
|
+
) : (
|
|
224
|
+
<IconChevronDown aria-hidden="true" />
|
|
225
|
+
)}
|
|
226
|
+
</button>
|
|
227
|
+
</CardHeader>
|
|
228
|
+
{open && (
|
|
229
|
+
<CardContent className="space-y-4">
|
|
230
|
+
<div className="grid gap-4 sm:grid-cols-2">
|
|
231
|
+
{(["label", "baseUrl", "path"] as const).map((key) => (
|
|
232
|
+
<div className="space-y-2" key={key}>
|
|
233
|
+
<Label htmlFor={`custom-api-${key}`}>
|
|
234
|
+
{t(`dataSources.customApi.fields.${key}`)}
|
|
235
|
+
</Label>
|
|
236
|
+
<Input
|
|
237
|
+
id={`custom-api-${key}`}
|
|
238
|
+
value={values[key]}
|
|
239
|
+
onChange={set(key)}
|
|
240
|
+
placeholder={t(`dataSources.customApi.placeholders.${key}`)}
|
|
241
|
+
type={key === "baseUrl" ? "url" : "text"}
|
|
242
|
+
/>
|
|
243
|
+
</div>
|
|
244
|
+
))}
|
|
245
|
+
</div>
|
|
246
|
+
<div className="space-y-2">
|
|
247
|
+
<Label htmlFor="custom-api-query">
|
|
248
|
+
{t("dataSources.customApi.fields.query")}
|
|
249
|
+
</Label>
|
|
250
|
+
<Textarea
|
|
251
|
+
id="custom-api-query"
|
|
252
|
+
value={values.query}
|
|
253
|
+
onChange={set("query")}
|
|
254
|
+
placeholder={t("dataSources.customApi.placeholders.query")}
|
|
255
|
+
rows={3}
|
|
256
|
+
/>
|
|
257
|
+
</div>
|
|
258
|
+
<div className="grid gap-4 sm:grid-cols-2">
|
|
259
|
+
<div className="space-y-2">
|
|
260
|
+
<Label htmlFor="custom-api-items-path">
|
|
261
|
+
{t("dataSources.customApi.fields.itemsPath")}
|
|
262
|
+
</Label>
|
|
263
|
+
<Input
|
|
264
|
+
id="custom-api-items-path"
|
|
265
|
+
value={values.itemsPath}
|
|
266
|
+
onChange={set("itemsPath")}
|
|
267
|
+
placeholder={t("dataSources.customApi.placeholders.itemsPath")}
|
|
268
|
+
/>
|
|
269
|
+
</div>
|
|
270
|
+
<div className="space-y-2">
|
|
271
|
+
<Label htmlFor="custom-api-docs">
|
|
272
|
+
{t("dataSources.customApi.fields.docsUrl")}
|
|
273
|
+
</Label>
|
|
274
|
+
<Input
|
|
275
|
+
id="custom-api-docs"
|
|
276
|
+
type="url"
|
|
277
|
+
value={values.docsUrl}
|
|
278
|
+
onChange={set("docsUrl")}
|
|
279
|
+
placeholder={t("dataSources.customApi.placeholders.docsUrl")}
|
|
280
|
+
/>
|
|
281
|
+
</div>
|
|
282
|
+
</div>
|
|
283
|
+
<div className="space-y-2">
|
|
284
|
+
<Label htmlFor="custom-api-auth">
|
|
285
|
+
{t("dataSources.customApi.fields.authType")}
|
|
286
|
+
</Label>
|
|
287
|
+
<Select
|
|
288
|
+
value={authType}
|
|
289
|
+
onValueChange={(value) => {
|
|
290
|
+
setAuthType(value as AuthType);
|
|
291
|
+
setError(null);
|
|
292
|
+
resetConnectionState();
|
|
293
|
+
}}
|
|
294
|
+
>
|
|
295
|
+
<SelectTrigger id="custom-api-auth">
|
|
296
|
+
<SelectValue />
|
|
297
|
+
</SelectTrigger>
|
|
298
|
+
<SelectContent>
|
|
299
|
+
<SelectItem value="none">
|
|
300
|
+
{t("dataSources.customApi.authNone")}
|
|
301
|
+
</SelectItem>
|
|
302
|
+
<SelectItem value="bearer">
|
|
303
|
+
{t("dataSources.customApi.authBearer")}
|
|
304
|
+
</SelectItem>
|
|
305
|
+
<SelectItem value="basic">
|
|
306
|
+
{t("dataSources.customApi.authBasic")}
|
|
307
|
+
</SelectItem>
|
|
308
|
+
<SelectItem value="api-key-header">
|
|
309
|
+
{t("dataSources.customApi.authApiKey")}
|
|
310
|
+
</SelectItem>
|
|
311
|
+
</SelectContent>
|
|
312
|
+
</Select>
|
|
313
|
+
</div>
|
|
314
|
+
{needsKey && (
|
|
315
|
+
<div className="grid gap-4 sm:grid-cols-2">
|
|
316
|
+
{authType === "basic" ? (
|
|
317
|
+
<>
|
|
318
|
+
<div className="space-y-2">
|
|
319
|
+
<Label htmlFor="custom-api-username-key">
|
|
320
|
+
{t("dataSources.customApi.fields.usernameKey")}
|
|
321
|
+
</Label>
|
|
322
|
+
<Input
|
|
323
|
+
id="custom-api-username-key"
|
|
324
|
+
value={values.usernameKey}
|
|
325
|
+
onChange={set("usernameKey")}
|
|
326
|
+
/>
|
|
327
|
+
</div>
|
|
328
|
+
<div className="space-y-2">
|
|
329
|
+
<Label htmlFor="custom-api-password-key">
|
|
330
|
+
{t("dataSources.customApi.fields.passwordKey")}
|
|
331
|
+
</Label>
|
|
332
|
+
<Input
|
|
333
|
+
id="custom-api-password-key"
|
|
334
|
+
value={values.passwordKey}
|
|
335
|
+
onChange={set("passwordKey")}
|
|
336
|
+
/>
|
|
337
|
+
</div>
|
|
338
|
+
</>
|
|
339
|
+
) : (
|
|
340
|
+
<div className="space-y-2">
|
|
341
|
+
<Label htmlFor="custom-api-credential-key">
|
|
342
|
+
{t("dataSources.customApi.fields.credentialKey")}
|
|
343
|
+
</Label>
|
|
344
|
+
<Input
|
|
345
|
+
id="custom-api-credential-key"
|
|
346
|
+
value={values.credentialKey}
|
|
347
|
+
onChange={set("credentialKey")}
|
|
348
|
+
/>
|
|
349
|
+
</div>
|
|
350
|
+
)}
|
|
351
|
+
{authType === "api-key-header" && (
|
|
352
|
+
<div className="space-y-2">
|
|
353
|
+
<Label htmlFor="custom-api-header-name">
|
|
354
|
+
{t("dataSources.customApi.fields.headerName")}
|
|
355
|
+
</Label>
|
|
356
|
+
<Input
|
|
357
|
+
id="custom-api-header-name"
|
|
358
|
+
value={values.headerName}
|
|
359
|
+
onChange={set("headerName")}
|
|
360
|
+
/>
|
|
361
|
+
</div>
|
|
362
|
+
)}
|
|
363
|
+
</div>
|
|
364
|
+
)}
|
|
365
|
+
{needsKey && credentialLink && (
|
|
366
|
+
<p className="text-sm text-muted-foreground">
|
|
367
|
+
{t("dataSources.customApi.keyHint")}{" "}
|
|
368
|
+
<a
|
|
369
|
+
className="inline-flex items-center gap-1 underline"
|
|
370
|
+
href={`/settings/integrations/secrets/${encodeURIComponent(credentialLink)}`}
|
|
371
|
+
>
|
|
372
|
+
{credentialLink}
|
|
373
|
+
<IconExternalLink className="h-3.5 w-3.5" aria-hidden="true" />
|
|
374
|
+
</a>
|
|
375
|
+
</p>
|
|
376
|
+
)}
|
|
377
|
+
{error && (
|
|
378
|
+
<p role="alert" className="text-sm text-destructive">
|
|
379
|
+
{error}
|
|
380
|
+
</p>
|
|
381
|
+
)}
|
|
382
|
+
<div className="flex flex-wrap gap-2">
|
|
383
|
+
<Button
|
|
384
|
+
onClick={handleRegister}
|
|
385
|
+
disabled={register.isPending || !values.label || !values.baseUrl}
|
|
386
|
+
>
|
|
387
|
+
{t("dataSources.customApi.register")}
|
|
388
|
+
</Button>
|
|
389
|
+
<Button
|
|
390
|
+
variant="outline"
|
|
391
|
+
onClick={handleTest}
|
|
392
|
+
disabled={!registered || test.isPending || !values.path}
|
|
393
|
+
>
|
|
394
|
+
{t("dataSources.customApi.test")}
|
|
395
|
+
</Button>
|
|
396
|
+
</div>
|
|
397
|
+
{result && (
|
|
398
|
+
<div className="space-y-2">
|
|
399
|
+
<div className="flex flex-wrap gap-2">
|
|
400
|
+
<Badge>
|
|
401
|
+
{t("dataSources.customApi.connectionResult")}:{" "}
|
|
402
|
+
{result.status ?? t("dataSources.customApi.unknown")}
|
|
403
|
+
</Badge>
|
|
404
|
+
<Badge>
|
|
405
|
+
{t("dataSources.customApi.rowCount")}:{" "}
|
|
406
|
+
{result.rowCount ?? result.sampleRows?.length ?? 0}
|
|
407
|
+
</Badge>
|
|
408
|
+
</div>
|
|
409
|
+
{result.columns?.length ? (
|
|
410
|
+
<p className="text-sm text-muted-foreground">
|
|
411
|
+
{t("dataSources.customApi.columns")}:{" "}
|
|
412
|
+
{result.columns.join(", ")}
|
|
413
|
+
</p>
|
|
414
|
+
) : null}
|
|
415
|
+
<pre className="max-h-56 overflow-auto rounded-md bg-muted p-3 text-xs">
|
|
416
|
+
{JSON.stringify((result.sampleRows ?? []).slice(0, 5), null, 2)}
|
|
417
|
+
</pre>
|
|
418
|
+
{result.ok && (
|
|
419
|
+
<Button onClick={saveAsProgram} disabled={isGenerating}>
|
|
420
|
+
{t("dataSources.customApi.handoffButton")}
|
|
421
|
+
</Button>
|
|
422
|
+
)}
|
|
423
|
+
</div>
|
|
424
|
+
)}
|
|
425
|
+
{codeRequiredDialog}
|
|
426
|
+
</CardContent>
|
|
427
|
+
)}
|
|
428
|
+
</Card>
|
|
429
|
+
);
|
|
430
|
+
}
|