@agent-native/core 0.102.0 → 0.102.2
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 +15 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/client/AgentPanel.tsx +7 -0
- package/corpus/core/src/client/AssistantChat.tsx +7 -0
- package/corpus/core/src/client/agent-chat-adapter.ts +7 -1
- package/corpus/core/src/client/agent-page/AgentTabsPage.tsx +1 -1
- package/corpus/core/src/client/chat/message-components.tsx +17 -3
- package/corpus/core/src/client/composer/ComposerPlusMenu.tsx +96 -6
- package/corpus/core/src/client/composer/asset-picker-url.ts +80 -0
- package/corpus/core/src/client/error-format.ts +24 -0
- package/corpus/core/src/client/resources/McpIntegrationDialog.tsx +8 -1
- package/corpus/templates/analytics/changelog/2026-07-15-fixed-the-agent-discarding-a-successful-dashboard-edit-and-r.md +6 -0
- package/corpus/templates/analytics/server/lib/real-data-actions.ts +30 -1
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +15 -0
- package/corpus/templates/assets/app/routes/library.tsx +69 -0
- package/corpus/templates/assets/changelog/2026-07-15-fixed-top-level-image-picker-selections-returning-to-the-com.md +6 -0
- package/corpus/templates/clips/actions/disconnect-calendar.ts +57 -9
- package/corpus/templates/clips/actions/generate-workflow.ts +102 -59
- package/corpus/templates/clips/actions/get-recording-player-data.ts +64 -1
- package/corpus/templates/clips/actions/regenerate-summary.ts +7 -0
- package/corpus/templates/clips/actions/regenerate-title.ts +29 -11
- package/corpus/templates/clips/app/components/editor/editor-layout.tsx +22 -11
- package/corpus/templates/clips/app/components/editor/thumbnail-picker.tsx +87 -9
- package/corpus/templates/clips/app/components/editor/trim-handles.tsx +15 -0
- package/corpus/templates/clips/app/components/editor/waveform.tsx +21 -8
- package/corpus/templates/clips/app/components/library/folder-tree.tsx +52 -0
- package/corpus/templates/clips/app/components/player/settings-panel.tsx +86 -46
- package/corpus/templates/clips/app/components/player/share-dialog.tsx +43 -37
- package/corpus/templates/clips/app/components/player/video-player.tsx +45 -1
- package/corpus/templates/clips/app/i18n/ar-SA.ts +2 -0
- package/corpus/templates/clips/app/i18n/de-DE.ts +2 -0
- package/corpus/templates/clips/app/i18n/en-US.ts +2 -0
- package/corpus/templates/clips/app/i18n/es-ES.ts +2 -0
- package/corpus/templates/clips/app/i18n/fr-FR.ts +2 -0
- package/corpus/templates/clips/app/i18n/hi-IN.ts +2 -0
- package/corpus/templates/clips/app/i18n/ja-JP.ts +2 -0
- package/corpus/templates/clips/app/i18n/ko-KR.ts +2 -0
- package/corpus/templates/clips/app/i18n/pt-BR.ts +2 -0
- package/corpus/templates/clips/app/i18n/zh-CN.ts +2 -0
- package/corpus/templates/clips/app/i18n/zh-TW.ts +2 -0
- package/corpus/templates/clips/app/lib/timestamp-mapping.ts +14 -0
- package/corpus/templates/clips/app/routes/_app.library._index.tsx +1 -2
- package/corpus/templates/clips/app/routes/_index.tsx +1 -2
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +71 -31
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +4 -1
- package/corpus/templates/clips/changelog/2026-07-15-ai-workflow-generation-now-stays-visible-avoids-duplicate-re.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-15-clip-playback-and-cta-controls-remain-interactive-through-ed.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-15-clip-titles-no-longer-describe-the-product-as-a-loom-alterna.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-15-description-regeneration-now-opens-the-agent-chat-so-progres.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-15-direct-recording-urls-now-respect-share-link-and-password-ac.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-15-disconnecting-a-calendar-now-clears-unrecorded-synced-meetin.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-15-folders-now-expose-rename-and-delete-actions-directly-in-the.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-15-recording-pages-now-explain-sign-in-access-and-avoid-showing.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-15-the-clips-extension-quick-actions-toolbar-can-be-moved-out-o.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-15-the-editor-now-skips-cut-sections-during-preview-and-keeps-t.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-15-thumbnail-capture-now-updates-previews-while-scrubbing-and-l.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-15-windows-permission-links-open-the-matching-settings-page.md +6 -0
- package/corpus/templates/clips/chrome-extension/src/content-script.ts +117 -2
- package/corpus/templates/clips/chrome-extension/src/overlay.ts +27 -0
- package/corpus/templates/clips/desktop/src-tauri/tauri.conf.json +1 -1
- package/corpus/templates/clips/server/lib/calendar-event-meetings.ts +139 -101
- package/corpus/templates/clips/server/lib/recording-page-access.ts +35 -0
- package/corpus/templates/content/app/components/editor/DescriptionField.tsx +10 -2
- package/corpus/templates/content/changelog/2026-07-15-page-and-database-descriptions-now-use-a-clean-single-line-f.md +6 -0
- package/corpus/templates/design/app/components/design/design-canvas/external-preview.ts +7 -3
- package/corpus/templates/design/changelog/2026-07-15-prototype-print-and-download-buttons-now-work-in-preview.md +6 -0
- package/corpus/templates/slides/actions/extract-pdf.ts +1 -1
- package/corpus/templates/slides/actions/import-file.ts +4 -1
- package/corpus/templates/slides/app/components/editor/ImageGenPanel.tsx +1 -1
- package/corpus/templates/slides/app/components/editor/ImageSearchPanel.tsx +9 -12
- package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +29 -21
- package/corpus/templates/slides/app/i18n/ar-SA.ts +1 -0
- package/corpus/templates/slides/app/i18n/de-DE.ts +1 -0
- package/corpus/templates/slides/app/i18n/en-US.ts +1 -0
- package/corpus/templates/slides/app/i18n/es-ES.ts +1 -0
- package/corpus/templates/slides/app/i18n/fr-FR.ts +1 -0
- package/corpus/templates/slides/app/i18n/hi-IN.ts +1 -0
- package/corpus/templates/slides/app/i18n/ja-JP.ts +1 -0
- package/corpus/templates/slides/app/i18n/ko-KR.ts +1 -0
- package/corpus/templates/slides/app/i18n/pt-BR.ts +1 -0
- package/corpus/templates/slides/app/i18n/zh-CN.ts +1 -0
- package/corpus/templates/slides/app/i18n/zh-TW.ts +1 -0
- package/corpus/templates/slides/changelog/2026-07-15-image-search-and-generation-controls-now-use-the-registered-.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-15-pdf-deck-references-can-be-imported-for-slide-inspiration-ag.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-15-stable-style-inspector-dock.md +6 -0
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +5 -0
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +7 -0
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/agent-chat-adapter.d.ts.map +1 -1
- package/dist/client/agent-chat-adapter.js +8 -1
- package/dist/client/agent-chat-adapter.js.map +1 -1
- package/dist/client/agent-page/AgentTabsPage.js +1 -1
- package/dist/client/agent-page/AgentTabsPage.js.map +1 -1
- package/dist/client/chat/message-components.d.ts +4 -0
- package/dist/client/chat/message-components.d.ts.map +1 -1
- package/dist/client/chat/message-components.js +10 -3
- package/dist/client/chat/message-components.js.map +1 -1
- package/dist/client/composer/ComposerPlusMenu.d.ts.map +1 -1
- package/dist/client/composer/ComposerPlusMenu.js +58 -6
- package/dist/client/composer/ComposerPlusMenu.js.map +1 -1
- package/dist/client/composer/asset-picker-url.d.ts +16 -0
- package/dist/client/composer/asset-picker-url.d.ts.map +1 -0
- package/dist/client/composer/asset-picker-url.js +64 -0
- package/dist/client/composer/asset-picker-url.js.map +1 -0
- package/dist/client/error-format.d.ts.map +1 -1
- package/dist/client/error-format.js +17 -0
- package/dist/client/error-format.js.map +1 -1
- package/dist/client/resources/McpIntegrationDialog.d.ts.map +1 -1
- package/dist/client/resources/McpIntegrationDialog.js +6 -1
- package/dist/client/resources/McpIntegrationDialog.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/observability/routes.d.ts +1 -1
- package/dist/provider-api/corpus-jobs.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpIntegrationDialog.js","sourceRoot":"","sources":["../../../src/client/resources/McpIntegrationDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,WAAW,EACX,UAAU,GACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE7D,OAAO,EACL,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,WAAW,GACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,OAAO,EACP,cAAc,EACd,cAAc,GACf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,gCAAgC,EAChC,qBAAqB,EACrB,yBAAyB,EACzB,6BAA6B,GAE9B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACxB,gBAAgB,EAChB,aAAa,GAGd,MAAM,sBAAsB,CAAC;AAmB9B,SAAS,gBAAgB,CAAC,IAAY;IACpC,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;QACvC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAC5B,IAAI,CAAC,OAAO;YAAE,SAAS;QACvB,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACjC,IAAI,GAAG,IAAI,CAAC;YAAE,SAAS;QACvB,MAAM,GAAG,GA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,0BAA0B,GAAG,EAC5D,CAAC,CAAC,yBAAyB,CAAC,IACtB,IACL,IACL,CACJ,GACa,GACT,CACV,CAAC;AACJ,CAAC","sourcesContent":["import {\n IconArrowLeft,\n IconCheck,\n IconExternalLink,\n IconLoader2,\n IconSearch,\n} from \"@tabler/icons-react\";\nimport { useEffect, useMemo, useRef, useState } from \"react\";\n\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from \"../components/ui/dialog.js\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from \"../components/ui/tooltip.js\";\nimport { useT } from \"../i18n.js\";\nimport { cn } from \"../utils.js\";\nimport {\n createMcpIntegrationFormDefaults,\n filterMcpIntegrations,\n getDefaultMcpIntegrations,\n isCustomMcpIntegrationEnabled,\n type DefaultMcpIntegration,\n} from \"./mcp-integration-catalog.js\";\nimport {\n formatMcpServerError,\n getMcpUrlValidationError,\n testMcpServerUrl,\n useMcpServers,\n type CreateMcpServerArgs,\n type McpServerScope,\n} from \"./use-mcp-servers.js\";\n\ntype DialogMode = \"catalog\" | \"form\";\n\ninterface McpIntegrationDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n defaultScope: McpServerScope;\n canCreateOrgMcp: boolean;\n hasOrg: boolean;\n onCreateMcpServer: (args: CreateMcpServerArgs) => Promise<unknown>;\n onCreated?: () => void;\n}\n\ninterface TestResult {\n ok: boolean;\n message: string;\n}\n\nfunction parseHeaderLines(text: string): Record<string, string> | undefined {\n const out: Record<string, string> = {};\n for (const line of text.split(/\\r?\\n/)) {\n const trimmed = line.trim();\n if (!trimmed) continue;\n const idx = trimmed.indexOf(\":\");\n if (idx <= 0) continue;\n const key = trimmed.slice(0, idx).trim();\n const value = trimmed.slice(idx + 1).trim();\n if (!key || !value) continue;\n out[key] = value;\n }\n return Object.keys(out).length > 0 ? out : undefined;\n}\n\nfunction compareUrl(value: string): string {\n try {\n const url = new URL(value.trim());\n url.hash = \"\";\n return url.toString().replace(/\\/+$/, \"\");\n } catch {\n return value.trim().replace(/\\/+$/, \"\");\n }\n}\n\nexport function McpIntegrationDialog({\n open,\n onOpenChange,\n defaultScope,\n canCreateOrgMcp,\n hasOrg,\n onCreateMcpServer,\n onCreated,\n}: McpIntegrationDialogProps) {\n const t = useT();\n const [mode, setMode] = useState<DialogMode>(\"catalog\");\n const [query, setQuery] = useState(\"\");\n const [selected, setSelected] = useState<DefaultMcpIntegration | null>(null);\n const [scope, setScope] = useState<McpServerScope>(defaultScope);\n const [name, setName] = useState(\"\");\n const [url, setUrl] = useState(\"\");\n const [description, setDescription] = useState(\"\");\n const [headersText, setHeadersText] = useState(\"\");\n const [busy, setBusy] = useState(false);\n const [quickBusyId, setQuickBusyId] = useState<string | null>(null);\n const [error, setError] = useState<string | null>(null);\n const [testResult, setTestResult] = useState<TestResult | null>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const mcpServersQuery = useMcpServers();\n const defaultIntegrations = useMemo(() => getDefaultMcpIntegrations(), []);\n const customIntegrationEnabled = useMemo(\n () => isCustomMcpIntegrationEnabled(),\n [],\n );\n const showCatalog = defaultIntegrations.length > 0;\n\n const connectedUrls = useMemo(() => {\n const servers = [\n ...(mcpServersQuery.data?.user ?? []),\n ...(mcpServersQuery.data?.org ?? []),\n ];\n return new Set(servers.map((server) => compareUrl(server.url)));\n }, [mcpServersQuery.data]);\n\n const filteredIntegrations = useMemo(\n () => filterMcpIntegrations(query, defaultIntegrations),\n [defaultIntegrations, query],\n );\n\n useEffect(() => {\n if (!open) return;\n setMode(showCatalog ? \"catalog\" : \"form\");\n setQuery(\"\");\n setSelected(null);\n setScope(defaultScope);\n setName(\"\");\n setUrl(\"\");\n setDescription(\"\");\n setHeadersText(\"\");\n setBusy(false);\n setQuickBusyId(null);\n setError(null);\n setTestResult(null);\n }, [defaultScope, open, showCatalog]);\n\n useEffect(() => {\n if (open && mode === \"form\") {\n const timer = window.setTimeout(() => inputRef.current?.focus(), 60);\n return () => window.clearTimeout(timer);\n }\n }, [mode, open]);\n\n const clearFeedback = () => {\n setError(null);\n setTestResult(null);\n };\n\n const openForm = (integration?: DefaultMcpIntegration | null) => {\n const defaults = createMcpIntegrationFormDefaults(integration);\n setSelected(integration ?? null);\n setScope(defaultScope);\n setName(defaults.name);\n setUrl(defaults.url);\n setDescription(defaults.description);\n setHeadersText(defaults.headersText);\n setError(null);\n setTestResult(null);\n setMode(\"form\");\n };\n\n const createServer = async (\n args: CreateMcpServerArgs,\n options?: { quickId?: string },\n ) => {\n const validationError = getMcpUrlValidationError(args.url);\n if (validationError) {\n setError(validationError);\n setTestResult(null);\n return;\n }\n\n if (options?.quickId) setQuickBusyId(options.quickId);\n setBusy(true);\n setError(null);\n try {\n await onCreateMcpServer(args);\n onOpenChange(false);\n onCreated?.();\n } catch (err) {\n setError(formatMcpServerError(err));\n } finally {\n setBusy(false);\n setQuickBusyId(null);\n }\n };\n\n const submitForm = () => {\n const trimmedName = name.trim();\n const trimmedUrl = url.trim();\n if (!trimmedName || !trimmedUrl || busy) return;\n void createServer({\n scope,\n name: trimmedName,\n url: trimmedUrl,\n headers: parseHeaderLines(headersText),\n description: description.trim() || undefined,\n });\n };\n\n const quickConnect = (integration: DefaultMcpIntegration) => {\n if (integration.authMode !== \"none\") {\n openForm(integration);\n return;\n }\n void createServer(\n {\n scope: defaultScope,\n name: integration.name,\n url: integration.url,\n description: integration.description,\n },\n { quickId: integration.id },\n );\n };\n\n const runTest = async () => {\n const trimmedUrl = url.trim();\n if (!trimmedUrl || busy) return;\n const validationError = getMcpUrlValidationError(trimmedUrl);\n if (validationError) {\n setTestResult({ ok: false, message: validationError });\n setError(null);\n return;\n }\n setBusy(true);\n setError(null);\n setTestResult(null);\n try {\n const res = await testMcpServerUrl(\n trimmedUrl,\n parseHeaderLines(headersText),\n );\n setTestResult(\n res.ok\n ? {\n ok: true,\n message: t(\"mcpIntegrations.toolsAvailable\", {\n count: res.toolCount ?? 0,\n }),\n }\n : { ok: false, message: res.error ?? t(\"mcpIntegrations.failed\") },\n );\n } catch (err) {\n setTestResult({ ok: false, message: formatMcpServerError(err) });\n } finally {\n setBusy(false);\n }\n };\n\n const renderScopeSelector = () => {\n const orgTooltip = !hasOrg\n ? t(\"mcpIntegrations.orgNoOrg\")\n : !canCreateOrgMcp\n ? t(\"mcpIntegrations.orgAdminOnly\")\n : null;\n\n return (\n <div className=\"flex gap-1 rounded-md border border-border bg-background p-0.5\">\n <button\n type=\"button\"\n onClick={() => setScope(\"user\")}\n className={cn(\n \"flex-1 rounded px-2 py-1.5 text-[11px] font-medium\",\n scope === \"user\"\n ? \"bg-accent text-foreground\"\n : \"text-muted-foreground hover:text-foreground\",\n )}\n >\n {t(\"mcpIntegrations.personal\")}\n </button>\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n onClick={() => hasOrg && canCreateOrgMcp && setScope(\"org\")}\n disabled={!hasOrg || !canCreateOrgMcp}\n className={cn(\n \"flex-1 rounded px-2 py-1.5 text-[11px] font-medium\",\n scope === \"org\"\n ? \"bg-accent text-foreground\"\n : \"text-muted-foreground hover:text-foreground\",\n (!hasOrg || !canCreateOrgMcp) &&\n \"cursor-not-allowed opacity-50 hover:text-muted-foreground\",\n )}\n >\n {t(\"mcpIntegrations.organization\")}\n </button>\n </TooltipTrigger>\n {orgTooltip && <TooltipContent>{orgTooltip}</TooltipContent>}\n </Tooltip>\n </div>\n );\n };\n\n if (!showCatalog && !customIntegrationEnabled) return null;\n\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent className=\"flex max-h-[min(820px,calc(100vh-32px))] w-[calc(100vw-24px)] max-w-[760px] flex-col gap-0 p-0 sm:w-[min(760px,calc(100vw-48px))]\">\n {mode === \"catalog\" ? (\n <>\n <DialogHeader className=\"shrink-0 px-7 pb-5 pe-14 pt-6\">\n <DialogTitle>{t(\"mcpIntegrations.title\")}</DialogTitle>\n <DialogDescription>\n {t(\"mcpIntegrations.description\")}\n </DialogDescription>\n </DialogHeader>\n <div className=\"flex shrink-0 flex-col gap-3 px-7 pb-5 sm:flex-row\">\n <label className=\"relative min-w-0 flex-1\">\n <IconSearch className=\"pointer-events-none absolute start-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground\" />\n <input\n value={query}\n onChange={(event) => setQuery(event.target.value)}\n className=\"h-9 w-full rounded-md border border-border bg-background pe-3 ps-8 text-[13px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-ring\"\n placeholder={t(\"mcpIntegrations.searchPlaceholder\")}\n />\n </label>\n <button\n type=\"button\"\n onClick={() => openForm(null)}\n className={cn(\n \"inline-flex h-9 items-center justify-center gap-1.5 rounded-md border border-border bg-background px-3 text-[12px] font-medium text-foreground hover:bg-accent\",\n !customIntegrationEnabled && \"hidden\",\n )}\n >\n {t(\"mcpIntegrations.addYourOwn\")}\n </button>\n </div>\n <div className=\"min-h-0 flex-1 overflow-y-auto px-7 pb-7\">\n {error && (\n <div className=\"mb-3 rounded-md border border-red-500/20 bg-red-500/5 px-3 py-2 text-[12px] leading-relaxed text-red-600 dark:text-red-400\">\n {error}\n </div>\n )}\n <div className=\"grid gap-3 sm:grid-cols-2\">\n {filteredIntegrations.map((integration) => {\n const connected = connectedUrls.has(\n compareUrl(integration.url),\n );\n const requiresConfig = integration.authMode !== \"none\";\n return (\n <article\n key={integration.id}\n className=\"flex min-h-[128px] flex-col rounded-md border border-border bg-card p-4 transition-colors hover:border-border/80 hover:bg-accent/20\"\n >\n <h3 className=\"truncate text-[13px] font-semibold text-foreground\">\n {integration.name}\n </h3>\n <p className=\"mt-1 line-clamp-2 flex-1 text-[12px] leading-relaxed text-muted-foreground\">\n {t(integration.descriptionKey)}\n </p>\n <div className=\"mt-3 flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => quickConnect(integration)}\n disabled={busy || connected}\n className={cn(\n \"inline-flex h-8 flex-1 items-center justify-center gap-1.5 rounded-md px-2.5 text-[12px] font-medium\",\n connected\n ? \"border border-border bg-muted text-muted-foreground\"\n : \"bg-primary text-primary-foreground hover:bg-primary/90\",\n (busy || connected) &&\n \"cursor-not-allowed opacity-70\",\n )}\n >\n {quickBusyId === integration.id ? (\n <IconLoader2 className=\"h-3.5 w-3.5 animate-spin\" />\n ) : null}\n {connected\n ? t(\"mcpIntegrations.connected\")\n : requiresConfig\n ? t(\"mcpIntegrations.configure\")\n : t(\"mcpIntegrations.connect\")}\n </button>\n {integration.docsUrl && (\n <Tooltip>\n <TooltipTrigger asChild>\n <a\n href={integration.docsUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex h-8 w-8 items-center justify-center rounded-md border border-border text-muted-foreground hover:bg-accent hover:text-foreground\"\n aria-label={t(\"mcpIntegrations.docsLabel\", {\n name: integration.name,\n })}\n >\n <IconExternalLink className=\"h-3.5 w-3.5\" />\n </a>\n </TooltipTrigger>\n <TooltipContent>\n {t(\"mcpIntegrations.docsLabel\", {\n name: integration.name,\n })}\n </TooltipContent>\n </Tooltip>\n )}\n </div>\n </article>\n );\n })}\n </div>\n {filteredIntegrations.length === 0 && (\n <div className=\"rounded-md border border-dashed border-border p-6 text-center text-[12px] text-muted-foreground\">\n {t(\"mcpIntegrations.noMatches\")}\n </div>\n )}\n </div>\n </>\n ) : (\n <>\n <DialogHeader className=\"shrink-0 border-b border-border px-7 pb-5 pe-14 pt-6\">\n <button\n type=\"button\"\n onClick={() => {\n clearFeedback();\n setMode(\"catalog\");\n }}\n className={cn(\n \"mb-1 inline-flex w-fit items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground\",\n !showCatalog && \"hidden\",\n )}\n >\n <IconArrowLeft className=\"h-3 w-3 rtl:-scale-x-100\" />\n {t(\"mcpIntegrations.backToIntegrations\")}\n </button>\n <DialogTitle>\n {selected\n ? t(\"mcpIntegrations.configureTitle\", {\n name: selected.name,\n })\n : t(\"mcpIntegrations.customTitle\")}\n </DialogTitle>\n <DialogDescription>\n {selected\n ? selected.authMode === \"none\"\n ? t(\"mcpIntegrations.presetNoAuthDescription\")\n : t(\"mcpIntegrations.presetAuthDescription\")\n : t(\"mcpIntegrations.customDescription\")}\n </DialogDescription>\n </DialogHeader>\n <div className=\"min-h-0 flex-1 overflow-y-auto px-7 py-5\">\n <div className=\"space-y-3\">\n {renderScopeSelector()}\n {selected?.setupNoteKey && (\n <div className=\"rounded-md border border-amber-500/20 bg-amber-500/5 px-3 py-2 text-[11px] leading-relaxed text-amber-700 dark:text-amber-300\">\n {t(selected.setupNoteKey)}\n </div>\n )}\n {selected?.authMode === \"oauth\" && (\n <div className=\"rounded-md border border-blue-500/20 bg-blue-500/5 px-3 py-2 text-[11px] leading-relaxed text-blue-700 dark:text-blue-300\">\n {t(\"mcpIntegrations.oauthNotice\")}\n </div>\n )}\n <label className=\"block\">\n <span className=\"mb-1 block text-[10px] font-medium text-muted-foreground\">\n {t(\"mcpIntegrations.serverName\")}\n </span>\n <input\n ref={inputRef}\n value={name}\n onChange={(event) => {\n setName(event.target.value);\n clearFeedback();\n }}\n className=\"w-full rounded-md border border-border bg-background px-2.5 py-1.5 text-[13px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-ring\"\n placeholder={t(\"mcpIntegrations.serverNamePlaceholder\")}\n />\n </label>\n <label className=\"block\">\n <span className=\"mb-1 block text-[10px] font-medium text-muted-foreground\">\n {t(\"mcpIntegrations.url\")}\n </span>\n <input\n value={url}\n onChange={(event) => {\n setUrl(event.target.value);\n clearFeedback();\n }}\n className=\"w-full rounded-md border border-border bg-background px-2.5 py-1.5 text-[13px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-ring\"\n placeholder={t(\"mcpIntegrations.urlPlaceholder\")}\n />\n </label>\n <label className=\"block\">\n <span className=\"mb-1 block text-[10px] font-medium text-muted-foreground\">\n {t(\"mcpIntegrations.fieldDescription\")}\n </span>\n <input\n value={description}\n onChange={(event) => {\n setDescription(event.target.value);\n clearFeedback();\n }}\n className=\"w-full rounded-md border border-border bg-background px-2.5 py-1.5 text-[13px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-ring\"\n placeholder={t(\"mcpIntegrations.descriptionPlaceholder\")}\n />\n </label>\n <label className=\"block\">\n <span className=\"mb-1 block text-[10px] font-medium text-muted-foreground\">\n {t(\"mcpIntegrations.headers\")}\n </span>\n <textarea\n value={headersText}\n onChange={(event) => {\n setHeadersText(event.target.value);\n clearFeedback();\n }}\n rows={3}\n className=\"w-full resize-y rounded-md border border-border bg-background px-2.5 py-1.5 text-[12px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-ring\"\n style={{\n fontFamily:\n 'ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, Consolas, monospace',\n }}\n placeholder={\n selected?.headerPlaceholder ??\n t(\"mcpIntegrations.headersPlaceholder\")\n }\n />\n </label>\n {selected?.docsUrl && (\n <a\n href={selected.docsUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1 text-[11px] text-muted-foreground underline hover:text-foreground\"\n >\n {t(\"mcpIntegrations.openSetupDocs\")}\n <IconExternalLink className=\"h-3 w-3\" />\n </a>\n )}\n {testResult && (\n <div\n className={cn(\n \"flex items-start gap-1 rounded-md px-3 py-2 text-[11px] leading-snug\",\n testResult.ok\n ? \"bg-green-500/5 text-green-600 dark:text-green-400\"\n : \"bg-red-500/5 text-red-600 dark:text-red-400\",\n )}\n >\n {testResult.ok && (\n <IconCheck className=\"mt-0.5 h-3 w-3 shrink-0\" />\n )}\n <span className=\"min-w-0 break-words\">\n {testResult.message}\n </span>\n </div>\n )}\n {error && (\n <div className=\"break-words rounded-md bg-red-500/5 px-3 py-2 text-[11px] leading-snug text-red-600 dark:text-red-400\">\n {error}\n </div>\n )}\n </div>\n </div>\n <div className=\"flex shrink-0 items-center justify-between gap-2 border-t border-border px-7 py-4\">\n <button\n type=\"button\"\n onClick={runTest}\n disabled={!url.trim() || busy}\n className=\"rounded-md border border-border bg-background px-3 py-1.5 text-[12px] font-medium text-foreground hover:bg-accent disabled:pointer-events-none disabled:opacity-40\"\n >\n {t(\"mcpIntegrations.test\")}\n </button>\n <button\n type=\"button\"\n onClick={submitForm}\n disabled={!name.trim() || !url.trim() || busy}\n className=\"inline-flex min-w-[92px] items-center justify-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-[12px] font-medium text-primary-foreground hover:bg-primary/90 disabled:pointer-events-none disabled:opacity-40\"\n >\n {busy && <IconLoader2 className=\"h-3.5 w-3.5 animate-spin\" />}\n {t(\"mcpIntegrations.connect\")}\n </button>\n </div>\n </>\n )}\n </DialogContent>\n </Dialog>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"McpIntegrationDialog.js","sourceRoot":"","sources":["../../../src/client/resources/McpIntegrationDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,WAAW,EACX,UAAU,GACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE7D,OAAO,EACL,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,WAAW,GACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,OAAO,EACP,cAAc,EACd,cAAc,GACf,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,gCAAgC,EAChC,qBAAqB,EACrB,yBAAyB,EACzB,6BAA6B,GAE9B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACxB,gBAAgB,EAChB,aAAa,GAGd,MAAM,sBAAsB,CAAC;AAmB9B,SAAS,gBAAgB,CAAC,IAAY;IACpC,MAAM,GAAG,GAA2B,EAAE,CAAC;I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N,eAAK,SAAS,EAAC,mFAAmF,aAChG,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,IAAI,EAC7B,SAAS,EAAC,oKAAoK,YAE7K,CAAC,CAAC,sBAAsB,CAAC,GACnB,EACT,kBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,IAAI,EAC7C,SAAS,EAAC,qNAAqN,aAE9N,IAAI,IAAI,KAAC,WAAW,IAAC,SAAS,EAAC,0BAA0B,GAAG,EAC5D,CAAC,CAAC,yBAAyB,CAAC,IACtB,IACL,IACL,CACJ,GACa,GACT,CACV,CAAC;AACJ,CAAC","sourcesContent":["import {\n IconArrowLeft,\n IconCheck,\n IconExternalLink,\n IconLoader2,\n IconSearch,\n} from \"@tabler/icons-react\";\nimport { useEffect, useMemo, useRef, useState } from \"react\";\n\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from \"../components/ui/dialog.js\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from \"../components/ui/tooltip.js\";\nimport { useT } from \"../i18n.js\";\nimport { cn } from \"../utils.js\";\nimport {\n createMcpIntegrationFormDefaults,\n filterMcpIntegrations,\n getDefaultMcpIntegrations,\n isCustomMcpIntegrationEnabled,\n type DefaultMcpIntegration,\n} from \"./mcp-integration-catalog.js\";\nimport {\n formatMcpServerError,\n getMcpUrlValidationError,\n testMcpServerUrl,\n useMcpServers,\n type CreateMcpServerArgs,\n type McpServerScope,\n} from \"./use-mcp-servers.js\";\n\ntype DialogMode = \"catalog\" | \"form\";\n\ninterface McpIntegrationDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n defaultScope: McpServerScope;\n canCreateOrgMcp: boolean;\n hasOrg: boolean;\n onCreateMcpServer: (args: CreateMcpServerArgs) => Promise<unknown>;\n onCreated?: () => void;\n}\n\ninterface TestResult {\n ok: boolean;\n message: string;\n}\n\nfunction parseHeaderLines(text: string): Record<string, string> | undefined {\n const out: Record<string, string> = {};\n for (const line of text.split(/\\r?\\n/)) {\n const trimmed = line.trim();\n if (!trimmed) continue;\n const idx = trimmed.indexOf(\":\");\n if (idx <= 0) continue;\n const key = trimmed.slice(0, idx).trim();\n const value = trimmed.slice(idx + 1).trim();\n if (!key || !value) continue;\n out[key] = value;\n }\n return Object.keys(out).length > 0 ? out : undefined;\n}\n\nfunction compareUrl(value: string): string {\n try {\n const url = new URL(value.trim());\n url.hash = \"\";\n return url.toString().replace(/\\/+$/, \"\");\n } catch {\n return value.trim().replace(/\\/+$/, \"\");\n }\n}\n\nexport function McpIntegrationDialog({\n open,\n onOpenChange,\n defaultScope,\n canCreateOrgMcp,\n hasOrg,\n onCreateMcpServer,\n onCreated,\n}: McpIntegrationDialogProps) {\n const t = useT();\n const [mode, setMode] = useState<DialogMode>(\"catalog\");\n const [query, setQuery] = useState(\"\");\n const [selected, setSelected] = useState<DefaultMcpIntegration | null>(null);\n const [scope, setScope] = useState<McpServerScope>(defaultScope);\n const [name, setName] = useState(\"\");\n const [url, setUrl] = useState(\"\");\n const [description, setDescription] = useState(\"\");\n const [headersText, setHeadersText] = useState(\"\");\n const [busy, setBusy] = useState(false);\n const [quickBusyId, setQuickBusyId] = useState<string | null>(null);\n const [error, setError] = useState<string | null>(null);\n const [testResult, setTestResult] = useState<TestResult | null>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n const mcpServersQuery = useMcpServers();\n const defaultIntegrations = useMemo(() => getDefaultMcpIntegrations(), []);\n const customIntegrationEnabled = useMemo(\n () => isCustomMcpIntegrationEnabled(),\n [],\n );\n const showCatalog = defaultIntegrations.length > 0;\n\n const connectedUrls = useMemo(() => {\n const servers = [\n ...(mcpServersQuery.data?.user ?? []),\n ...(mcpServersQuery.data?.org ?? []),\n ];\n // A saved server is not necessarily a working connection. The settings\n // page reports failed and unknown health states separately, so only mark\n // catalog entries as connected after the health probe succeeds.\n return new Set(\n servers\n .filter((server) => server.status.state === \"connected\")\n .map((server) => compareUrl(server.url)),\n );\n }, [mcpServersQuery.data]);\n\n const filteredIntegrations = useMemo(\n () => filterMcpIntegrations(query, defaultIntegrations),\n [defaultIntegrations, query],\n );\n\n useEffect(() => {\n if (!open) return;\n setMode(showCatalog ? \"catalog\" : \"form\");\n setQuery(\"\");\n setSelected(null);\n setScope(defaultScope);\n setName(\"\");\n setUrl(\"\");\n setDescription(\"\");\n setHeadersText(\"\");\n setBusy(false);\n setQuickBusyId(null);\n setError(null);\n setTestResult(null);\n }, [defaultScope, open, showCatalog]);\n\n useEffect(() => {\n if (open && mode === \"form\") {\n const timer = window.setTimeout(() => inputRef.current?.focus(), 60);\n return () => window.clearTimeout(timer);\n }\n }, [mode, open]);\n\n const clearFeedback = () => {\n setError(null);\n setTestResult(null);\n };\n\n const openForm = (integration?: DefaultMcpIntegration | null) => {\n const defaults = createMcpIntegrationFormDefaults(integration);\n setSelected(integration ?? null);\n setScope(defaultScope);\n setName(defaults.name);\n setUrl(defaults.url);\n setDescription(defaults.description);\n setHeadersText(defaults.headersText);\n setError(null);\n setTestResult(null);\n setMode(\"form\");\n };\n\n const createServer = async (\n args: CreateMcpServerArgs,\n options?: { quickId?: string },\n ) => {\n const validationError = getMcpUrlValidationError(args.url);\n if (validationError) {\n setError(validationError);\n setTestResult(null);\n return;\n }\n\n if (options?.quickId) setQuickBusyId(options.quickId);\n setBusy(true);\n setError(null);\n try {\n await onCreateMcpServer(args);\n onOpenChange(false);\n onCreated?.();\n } catch (err) {\n setError(formatMcpServerError(err));\n } finally {\n setBusy(false);\n setQuickBusyId(null);\n }\n };\n\n const submitForm = () => {\n const trimmedName = name.trim();\n const trimmedUrl = url.trim();\n if (!trimmedName || !trimmedUrl || busy) return;\n void createServer({\n scope,\n name: trimmedName,\n url: trimmedUrl,\n headers: parseHeaderLines(headersText),\n description: description.trim() || undefined,\n });\n };\n\n const quickConnect = (integration: DefaultMcpIntegration) => {\n if (integration.authMode !== \"none\") {\n openForm(integration);\n return;\n }\n void createServer(\n {\n scope: defaultScope,\n name: integration.name,\n url: integration.url,\n description: integration.description,\n },\n { quickId: integration.id },\n );\n };\n\n const runTest = async () => {\n const trimmedUrl = url.trim();\n if (!trimmedUrl || busy) return;\n const validationError = getMcpUrlValidationError(trimmedUrl);\n if (validationError) {\n setTestResult({ ok: false, message: validationError });\n setError(null);\n return;\n }\n setBusy(true);\n setError(null);\n setTestResult(null);\n try {\n const res = await testMcpServerUrl(\n trimmedUrl,\n parseHeaderLines(headersText),\n );\n setTestResult(\n res.ok\n ? {\n ok: true,\n message: t(\"mcpIntegrations.toolsAvailable\", {\n count: res.toolCount ?? 0,\n }),\n }\n : { ok: false, message: res.error ?? t(\"mcpIntegrations.failed\") },\n );\n } catch (err) {\n setTestResult({ ok: false, message: formatMcpServerError(err) });\n } finally {\n setBusy(false);\n }\n };\n\n const renderScopeSelector = () => {\n const orgTooltip = !hasOrg\n ? t(\"mcpIntegrations.orgNoOrg\")\n : !canCreateOrgMcp\n ? t(\"mcpIntegrations.orgAdminOnly\")\n : null;\n\n return (\n <div className=\"flex gap-1 rounded-md border border-border bg-background p-0.5\">\n <button\n type=\"button\"\n onClick={() => setScope(\"user\")}\n className={cn(\n \"flex-1 rounded px-2 py-1.5 text-[11px] font-medium\",\n scope === \"user\"\n ? \"bg-accent text-foreground\"\n : \"text-muted-foreground hover:text-foreground\",\n )}\n >\n {t(\"mcpIntegrations.personal\")}\n </button>\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n onClick={() => hasOrg && canCreateOrgMcp && setScope(\"org\")}\n disabled={!hasOrg || !canCreateOrgMcp}\n className={cn(\n \"flex-1 rounded px-2 py-1.5 text-[11px] font-medium\",\n scope === \"org\"\n ? \"bg-accent text-foreground\"\n : \"text-muted-foreground hover:text-foreground\",\n (!hasOrg || !canCreateOrgMcp) &&\n \"cursor-not-allowed opacity-50 hover:text-muted-foreground\",\n )}\n >\n {t(\"mcpIntegrations.organization\")}\n </button>\n </TooltipTrigger>\n {orgTooltip && <TooltipContent>{orgTooltip}</TooltipContent>}\n </Tooltip>\n </div>\n );\n };\n\n if (!showCatalog && !customIntegrationEnabled) return null;\n\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent className=\"flex max-h-[min(820px,calc(100vh-32px))] w-[calc(100vw-24px)] max-w-[760px] flex-col gap-0 p-0 sm:w-[min(760px,calc(100vw-48px))]\">\n {mode === \"catalog\" ? (\n <>\n <DialogHeader className=\"shrink-0 px-7 pb-5 pe-14 pt-6\">\n <DialogTitle>{t(\"mcpIntegrations.title\")}</DialogTitle>\n <DialogDescription>\n {t(\"mcpIntegrations.description\")}\n </DialogDescription>\n </DialogHeader>\n <div className=\"flex shrink-0 flex-col gap-3 px-7 pb-5 sm:flex-row\">\n <label className=\"relative min-w-0 flex-1\">\n <IconSearch className=\"pointer-events-none absolute start-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground\" />\n <input\n value={query}\n onChange={(event) => setQuery(event.target.value)}\n className=\"h-9 w-full rounded-md border border-border bg-background pe-3 ps-8 text-[13px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-ring\"\n placeholder={t(\"mcpIntegrations.searchPlaceholder\")}\n />\n </label>\n <button\n type=\"button\"\n onClick={() => openForm(null)}\n className={cn(\n \"inline-flex h-9 items-center justify-center gap-1.5 rounded-md border border-border bg-background px-3 text-[12px] font-medium text-foreground hover:bg-accent\",\n !customIntegrationEnabled && \"hidden\",\n )}\n >\n {t(\"mcpIntegrations.addYourOwn\")}\n </button>\n </div>\n <div className=\"min-h-0 flex-1 overflow-y-auto px-7 pb-7\">\n {error && (\n <div className=\"mb-3 rounded-md border border-red-500/20 bg-red-500/5 px-3 py-2 text-[12px] leading-relaxed text-red-600 dark:text-red-400\">\n {error}\n </div>\n )}\n <div className=\"grid gap-3 sm:grid-cols-2\">\n {filteredIntegrations.map((integration) => {\n const connected = connectedUrls.has(\n compareUrl(integration.url),\n );\n const requiresConfig = integration.authMode !== \"none\";\n return (\n <article\n key={integration.id}\n className=\"flex min-h-[128px] flex-col rounded-md border border-border bg-card p-4 transition-colors hover:border-border/80 hover:bg-accent/20\"\n >\n <h3 className=\"truncate text-[13px] font-semibold text-foreground\">\n {integration.name}\n </h3>\n <p className=\"mt-1 line-clamp-2 flex-1 text-[12px] leading-relaxed text-muted-foreground\">\n {t(integration.descriptionKey)}\n </p>\n <div className=\"mt-3 flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => quickConnect(integration)}\n disabled={busy || connected}\n className={cn(\n \"inline-flex h-8 flex-1 items-center justify-center gap-1.5 rounded-md px-2.5 text-[12px] font-medium\",\n connected\n ? \"border border-border bg-muted text-muted-foreground\"\n : \"bg-primary text-primary-foreground hover:bg-primary/90\",\n (busy || connected) &&\n \"cursor-not-allowed opacity-70\",\n )}\n >\n {quickBusyId === integration.id ? (\n <IconLoader2 className=\"h-3.5 w-3.5 animate-spin\" />\n ) : null}\n {connected\n ? t(\"mcpIntegrations.connected\")\n : requiresConfig\n ? t(\"mcpIntegrations.configure\")\n : t(\"mcpIntegrations.connect\")}\n </button>\n {integration.docsUrl && (\n <Tooltip>\n <TooltipTrigger asChild>\n <a\n href={integration.docsUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex h-8 w-8 items-center justify-center rounded-md border border-border text-muted-foreground hover:bg-accent hover:text-foreground\"\n aria-label={t(\"mcpIntegrations.docsLabel\", {\n name: integration.name,\n })}\n >\n <IconExternalLink className=\"h-3.5 w-3.5\" />\n </a>\n </TooltipTrigger>\n <TooltipContent>\n {t(\"mcpIntegrations.docsLabel\", {\n name: integration.name,\n })}\n </TooltipContent>\n </Tooltip>\n )}\n </div>\n </article>\n );\n })}\n </div>\n {filteredIntegrations.length === 0 && (\n <div className=\"rounded-md border border-dashed border-border p-6 text-center text-[12px] text-muted-foreground\">\n {t(\"mcpIntegrations.noMatches\")}\n </div>\n )}\n </div>\n </>\n ) : (\n <>\n <DialogHeader className=\"shrink-0 border-b border-border px-7 pb-5 pe-14 pt-6\">\n <button\n type=\"button\"\n onClick={() => {\n clearFeedback();\n setMode(\"catalog\");\n }}\n className={cn(\n \"mb-1 inline-flex w-fit items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground\",\n !showCatalog && \"hidden\",\n )}\n >\n <IconArrowLeft className=\"h-3 w-3 rtl:-scale-x-100\" />\n {t(\"mcpIntegrations.backToIntegrations\")}\n </button>\n <DialogTitle>\n {selected\n ? t(\"mcpIntegrations.configureTitle\", {\n name: selected.name,\n })\n : t(\"mcpIntegrations.customTitle\")}\n </DialogTitle>\n <DialogDescription>\n {selected\n ? selected.authMode === \"none\"\n ? t(\"mcpIntegrations.presetNoAuthDescription\")\n : t(\"mcpIntegrations.presetAuthDescription\")\n : t(\"mcpIntegrations.customDescription\")}\n </DialogDescription>\n </DialogHeader>\n <div className=\"min-h-0 flex-1 overflow-y-auto px-7 py-5\">\n <div className=\"space-y-3\">\n {renderScopeSelector()}\n {selected?.setupNoteKey && (\n <div className=\"rounded-md border border-amber-500/20 bg-amber-500/5 px-3 py-2 text-[11px] leading-relaxed text-amber-700 dark:text-amber-300\">\n {t(selected.setupNoteKey)}\n </div>\n )}\n {selected?.authMode === \"oauth\" && (\n <div className=\"rounded-md border border-blue-500/20 bg-blue-500/5 px-3 py-2 text-[11px] leading-relaxed text-blue-700 dark:text-blue-300\">\n {t(\"mcpIntegrations.oauthNotice\")}\n </div>\n )}\n <label className=\"block\">\n <span className=\"mb-1 block text-[10px] font-medium text-muted-foreground\">\n {t(\"mcpIntegrations.serverName\")}\n </span>\n <input\n ref={inputRef}\n value={name}\n onChange={(event) => {\n setName(event.target.value);\n clearFeedback();\n }}\n className=\"w-full rounded-md border border-border bg-background px-2.5 py-1.5 text-[13px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-ring\"\n placeholder={t(\"mcpIntegrations.serverNamePlaceholder\")}\n />\n </label>\n <label className=\"block\">\n <span className=\"mb-1 block text-[10px] font-medium text-muted-foreground\">\n {t(\"mcpIntegrations.url\")}\n </span>\n <input\n value={url}\n onChange={(event) => {\n setUrl(event.target.value);\n clearFeedback();\n }}\n className=\"w-full rounded-md border border-border bg-background px-2.5 py-1.5 text-[13px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-ring\"\n placeholder={t(\"mcpIntegrations.urlPlaceholder\")}\n />\n </label>\n <label className=\"block\">\n <span className=\"mb-1 block text-[10px] font-medium text-muted-foreground\">\n {t(\"mcpIntegrations.fieldDescription\")}\n </span>\n <input\n value={description}\n onChange={(event) => {\n setDescription(event.target.value);\n clearFeedback();\n }}\n className=\"w-full rounded-md border border-border bg-background px-2.5 py-1.5 text-[13px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-ring\"\n placeholder={t(\"mcpIntegrations.descriptionPlaceholder\")}\n />\n </label>\n <label className=\"block\">\n <span className=\"mb-1 block text-[10px] font-medium text-muted-foreground\">\n {t(\"mcpIntegrations.headers\")}\n </span>\n <textarea\n value={headersText}\n onChange={(event) => {\n setHeadersText(event.target.value);\n clearFeedback();\n }}\n rows={3}\n className=\"w-full resize-y rounded-md border border-border bg-background px-2.5 py-1.5 text-[12px] text-foreground outline-none placeholder:text-muted-foreground/50 focus:ring-1 focus:ring-ring\"\n style={{\n fontFamily:\n 'ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, Consolas, monospace',\n }}\n placeholder={\n selected?.headerPlaceholder ??\n t(\"mcpIntegrations.headersPlaceholder\")\n }\n />\n </label>\n {selected?.docsUrl && (\n <a\n href={selected.docsUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-1 text-[11px] text-muted-foreground underline hover:text-foreground\"\n >\n {t(\"mcpIntegrations.openSetupDocs\")}\n <IconExternalLink className=\"h-3 w-3\" />\n </a>\n )}\n {testResult && (\n <div\n className={cn(\n \"flex items-start gap-1 rounded-md px-3 py-2 text-[11px] leading-snug\",\n testResult.ok\n ? \"bg-green-500/5 text-green-600 dark:text-green-400\"\n : \"bg-red-500/5 text-red-600 dark:text-red-400\",\n )}\n >\n {testResult.ok && (\n <IconCheck className=\"mt-0.5 h-3 w-3 shrink-0\" />\n )}\n <span className=\"min-w-0 break-words\">\n {testResult.message}\n </span>\n </div>\n )}\n {error && (\n <div className=\"break-words rounded-md bg-red-500/5 px-3 py-2 text-[11px] leading-snug text-red-600 dark:text-red-400\">\n {error}\n </div>\n )}\n </div>\n </div>\n <div className=\"flex shrink-0 items-center justify-between gap-2 border-t border-border px-7 py-4\">\n <button\n type=\"button\"\n onClick={runTest}\n disabled={!url.trim() || busy}\n className=\"rounded-md border border-border bg-background px-3 py-1.5 text-[12px] font-medium text-foreground hover:bg-accent disabled:pointer-events-none disabled:opacity-40\"\n >\n {t(\"mcpIntegrations.test\")}\n </button>\n <button\n type=\"button\"\n onClick={submitForm}\n disabled={!name.trim() || !url.trim() || busy}\n className=\"inline-flex min-w-[92px] items-center justify-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-[12px] font-medium text-primary-foreground hover:bg-primary/90 disabled:pointer-events-none disabled:opacity-40\"\n >\n {busy && <IconLoader2 className=\"h-3.5 w-3.5 animate-spin\" />}\n {t(\"mcpIntegrations.connect\")}\n </button>\n </div>\n </>\n )}\n </DialogContent>\n </Dialog>\n );\n}\n"]}
|
package/dist/collab/routes.d.ts
CHANGED
|
@@ -26,8 +26,8 @@ export declare const getCollabState: import("h3").EventHandlerWithFetch<import("
|
|
|
26
26
|
* Body: { update: string (base64), requestSource?: string }
|
|
27
27
|
*/
|
|
28
28
|
export declare const postCollabUpdate: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
29
|
-
error: string;
|
|
30
29
|
ok?: undefined;
|
|
30
|
+
error: string;
|
|
31
31
|
} | {
|
|
32
32
|
error?: undefined;
|
|
33
33
|
ok: boolean;
|
|
@@ -73,7 +73,6 @@ export declare function createProviderCorpusJobAction(options: CreateProviderCor
|
|
|
73
73
|
offset?: unknown;
|
|
74
74
|
limit?: unknown;
|
|
75
75
|
}, {
|
|
76
|
-
deleted?: undefined;
|
|
77
76
|
jobs: {
|
|
78
77
|
id: string;
|
|
79
78
|
name: string;
|
|
@@ -84,6 +83,7 @@ export declare function createProviderCorpusJobAction(options: CreateProviderCor
|
|
|
84
83
|
updatedAt: string;
|
|
85
84
|
}[];
|
|
86
85
|
total: number;
|
|
86
|
+
deleted?: undefined;
|
|
87
87
|
jobId?: undefined;
|
|
88
88
|
} | {
|
|
89
89
|
jobs?: undefined;
|
|
@@ -91,9 +91,9 @@ export declare function createProviderCorpusJobAction(options: CreateProviderCor
|
|
|
91
91
|
deleted: boolean;
|
|
92
92
|
jobId: string;
|
|
93
93
|
} | {
|
|
94
|
-
deleted?: undefined;
|
|
95
94
|
jobs?: undefined;
|
|
96
95
|
total?: undefined;
|
|
96
|
+
deleted?: undefined;
|
|
97
97
|
jobId?: undefined;
|
|
98
98
|
hits: Record<string, unknown>[];
|
|
99
99
|
offset: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.102.
|
|
3
|
+
"version": "0.102.2",
|
|
4
4
|
"description": "Framework for agent-native application development — where AI agents and UI share SQL state, actions, and context",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/agent-native#readme",
|
|
6
6
|
"bugs": {
|