@agent-native/core 0.168.0 → 0.168.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/corpus/templates/clips/desktop/src-tauri/src/util.rs +32 -0
- package/dist/client/AgentPanel.d.ts +3 -1
- package/dist/client/AgentPanel.js +2 -2
- package/dist/client/agent-page/AgentTabsPage.d.ts +4 -1
- package/dist/client/agent-page/AgentTabsPage.js +2 -2
- package/dist/client/integrations/IntegrationConnectionChoice.d.ts +4 -1
- package/dist/client/integrations/IntegrationConnectionChoice.js +6 -2
- package/dist/client/onboarding/FirstRunOnboarding.js +9 -5
- package/dist/client/resources/McpIntegrationDialog.d.ts +3 -1
- package/dist/client/resources/McpIntegrationDialog.js +181 -112
- package/dist/client/resources/mcp-integration-catalog.d.ts +1 -0
- package/dist/client/resources/mcp-integration-catalog.js +5 -2
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/routes.d.ts +1 -1
- package/dist/localization/default-messages.d.ts +9 -0
- package/dist/localization/default-messages.js +9 -0
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/observability/routes.d.ts +3 -3
- package/dist/resources/handlers.d.ts +2 -2
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ use std::{
|
|
|
2
2
|
ffi::OsString,
|
|
3
3
|
path::{Path, PathBuf},
|
|
4
4
|
process::{Command, Stdio},
|
|
5
|
+
sync::atomic::{AtomicU64, Ordering},
|
|
5
6
|
};
|
|
6
7
|
|
|
7
8
|
use tauri::{AppHandle, Emitter, Manager, WebviewUrl, WebviewWindow, WebviewWindowBuilder};
|
|
@@ -13,6 +14,7 @@ use crate::state::{
|
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
const POPOVER_SHADOW_GUTTER_LOGICAL: f64 = 24.0;
|
|
17
|
+
static OAUTH_WINDOW_COUNTER: AtomicU64 = AtomicU64::new(0);
|
|
16
18
|
const POPOVER_DEFAULT_WIDTH_LOGICAL: f64 = 320.0;
|
|
17
19
|
const POPOVER_DEFAULT_HEIGHT_LOGICAL: f64 = 520.0;
|
|
18
20
|
|
|
@@ -109,6 +111,7 @@ pub fn set_capture_included(window: &WebviewWindow) {
|
|
|
109
111
|
|
|
110
112
|
pub fn build_popover_window(app: &mut tauri::App) -> Result<WebviewWindow, tauri::Error> {
|
|
111
113
|
let gutter = POPOVER_SHADOW_GUTTER_LOGICAL * 2.0;
|
|
114
|
+
let app_handle = app.handle().clone();
|
|
112
115
|
WebviewWindowBuilder::new(app, "popover", WebviewUrl::App("index.html".into()))
|
|
113
116
|
.title("Clips")
|
|
114
117
|
.inner_size(
|
|
@@ -126,6 +129,35 @@ pub fn build_popover_window(app: &mut tauri::App) -> Result<WebviewWindow, tauri
|
|
|
126
129
|
.focused(true)
|
|
127
130
|
.shadow(false)
|
|
128
131
|
.accept_first_mouse(true)
|
|
132
|
+
// Tauri does not create a native child for window.open by default.
|
|
133
|
+
// Create it here with the opener's webview configuration so Google
|
|
134
|
+
// OAuth stays in a visible child window and shares the binding cookie.
|
|
135
|
+
.on_new_window(move |url, features| {
|
|
136
|
+
let label = format!(
|
|
137
|
+
"google-oauth-{}",
|
|
138
|
+
OAUTH_WINDOW_COUNTER.fetch_add(1, Ordering::Relaxed)
|
|
139
|
+
);
|
|
140
|
+
let popup = WebviewWindowBuilder::new(&app_handle, label, WebviewUrl::External(url))
|
|
141
|
+
.title("Sign in to Clips")
|
|
142
|
+
.inner_size(520.0, 720.0)
|
|
143
|
+
.resizable(true)
|
|
144
|
+
.always_on_top(false)
|
|
145
|
+
.focused(true)
|
|
146
|
+
.window_features(features)
|
|
147
|
+
.build();
|
|
148
|
+
|
|
149
|
+
match popup {
|
|
150
|
+
Ok(window) => {
|
|
151
|
+
set_capture_excluded(&window);
|
|
152
|
+
configure_overlay_behavior(&window);
|
|
153
|
+
tauri::webview::NewWindowResponse::Create { window }
|
|
154
|
+
}
|
|
155
|
+
Err(error) => {
|
|
156
|
+
eprintln!("[clips-tray] failed to create OAuth popup: {error}");
|
|
157
|
+
tauri::webview::NewWindowResponse::Deny
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
})
|
|
129
161
|
.build()
|
|
130
162
|
}
|
|
131
163
|
|
|
@@ -187,6 +187,8 @@ export interface AgentSidebarProps {
|
|
|
187
187
|
onAgentChange?: AssistantChatProps["onAgentChange"];
|
|
188
188
|
/** Route local runtime setup through the host's native bridge. */
|
|
189
189
|
onConnectLocalRuntime?: AssistantChatProps["onConnectLocalRuntime"];
|
|
190
|
+
/** Route hosted provider setup through the host's native bridge. */
|
|
191
|
+
onConnectProvider?: AssistantChatProps["onConnectProvider"];
|
|
190
192
|
/** Bring-your-own runtime used by embedded hosts such as Electron. */
|
|
191
193
|
runtime?: AssistantChatProps["runtime"];
|
|
192
194
|
/** Explicit key for recreating an injected runtime adapter. */
|
|
@@ -258,7 +260,7 @@ export interface AgentSidebarProps {
|
|
|
258
260
|
* Wraps app content with a toggleable agent sidebar.
|
|
259
261
|
* Use AgentToggleButton in your header to open/close it.
|
|
260
262
|
*/
|
|
261
|
-
export declare function AgentSidebar({ children, emptyStateText, suggestions, dynamicSuggestions, composerToolbarSlot, composerSlot, onComposerTextChange, imageModelMenu, availableAgents, availableModels, modelListLoading, selectedAgent, onAgentChange, onConnectLocalRuntime, runtime, adapterReloadKey, threadFooterSlot, defaultSidebarWidth, sidebarWidth, position, defaultOpen, animateMobile, animateDesktop, chatViewTransition, chatViewTransitionHandoff, storageKey, openStorageKey, apiUrl, agentChatSurface, desktopIdentityUnauthenticated, desktopIdentityAuthenticated, showTabBar, suppressInlineOpenApp, composerPlaceholder, openOnChatRunning, onFullscreenRequest, scope, isolateHistoryByScope, showScopeBadge, browserTabId, threadUrlSync, agentPageHref, suppressFirstRunOnboarding, }: AgentSidebarProps): React.JSX.Element;
|
|
263
|
+
export declare function AgentSidebar({ children, emptyStateText, suggestions, dynamicSuggestions, composerToolbarSlot, composerSlot, onComposerTextChange, imageModelMenu, availableAgents, availableModels, modelListLoading, selectedAgent, onAgentChange, onConnectLocalRuntime, onConnectProvider, runtime, adapterReloadKey, threadFooterSlot, defaultSidebarWidth, sidebarWidth, position, defaultOpen, animateMobile, animateDesktop, chatViewTransition, chatViewTransitionHandoff, storageKey, openStorageKey, apiUrl, agentChatSurface, desktopIdentityUnauthenticated, desktopIdentityAuthenticated, showTabBar, suppressInlineOpenApp, composerPlaceholder, openOnChatRunning, onFullscreenRequest, scope, isolateHistoryByScope, showScopeBadge, browserTabId, threadUrlSync, agentPageHref, suppressFirstRunOnboarding, }: AgentSidebarProps): React.JSX.Element;
|
|
262
264
|
/**
|
|
263
265
|
* Focus the agent chat composer input.
|
|
264
266
|
* Opens the sidebar if closed, then focuses the text input.
|
|
@@ -1418,7 +1418,7 @@ export function AgentChatSurface({ mode = "panel", className, defaultMode = "cha
|
|
|
1418
1418
|
* Wraps app content with a toggleable agent sidebar.
|
|
1419
1419
|
* Use AgentToggleButton in your header to open/close it.
|
|
1420
1420
|
*/
|
|
1421
|
-
export function AgentSidebar({ children, emptyStateText = "How can I help you?", suggestions, dynamicSuggestions, composerToolbarSlot, composerSlot, onComposerTextChange, imageModelMenu, availableAgents, availableModels, modelListLoading, selectedAgent, onAgentChange, onConnectLocalRuntime, runtime, adapterReloadKey, threadFooterSlot, defaultSidebarWidth, sidebarWidth, position = "right", defaultOpen = false, animateMobile = true, animateDesktop = true, chatViewTransition = false, chatViewTransitionHandoff = false, storageKey, openStorageKey, apiUrl, agentChatSurface, desktopIdentityUnauthenticated, desktopIdentityAuthenticated, showTabBar = true, suppressInlineOpenApp, composerPlaceholder, openOnChatRunning = false, onFullscreenRequest, scope, isolateHistoryByScope = false, showScopeBadge, browserTabId, threadUrlSync, agentPageHref, suppressFirstRunOnboarding = false, }) {
|
|
1421
|
+
export function AgentSidebar({ children, emptyStateText = "How can I help you?", suggestions, dynamicSuggestions, composerToolbarSlot, composerSlot, onComposerTextChange, imageModelMenu, availableAgents, availableModels, modelListLoading, selectedAgent, onAgentChange, onConnectLocalRuntime, onConnectProvider, runtime, adapterReloadKey, threadFooterSlot, defaultSidebarWidth, sidebarWidth, position = "right", defaultOpen = false, animateMobile = true, animateDesktop = true, chatViewTransition = false, chatViewTransitionHandoff = false, storageKey, openStorageKey, apiUrl, agentChatSurface, desktopIdentityUnauthenticated, desktopIdentityAuthenticated, showTabBar = true, suppressInlineOpenApp, composerPlaceholder, openOnChatRunning = false, onFullscreenRequest, scope, isolateHistoryByScope = false, showScopeBadge, browserTabId, threadUrlSync, agentPageHref, suppressFirstRunOnboarding = false, }) {
|
|
1422
1422
|
const staticHostedHarnessEnabled = isHostedHarnessConfigured(injectedAgentNativeConfig().harness);
|
|
1423
1423
|
const hostedHarnessQuery = useActionQuery("get-hosted-harness-config", undefined, { enabled: staticHostedHarnessEnabled });
|
|
1424
1424
|
const hostedHarnessStatus = hostedHarnessQuery.data;
|
|
@@ -2059,7 +2059,7 @@ export function AgentSidebar({ children, emptyStateText = "How can I help you?",
|
|
|
2059
2059
|
? "desktop"
|
|
2060
2060
|
: undefined, "data-agent-sidebar-layout": panelLayout, "data-agent-sidebar-position": effectivePosition, "data-agent-native-hosted-harness-ui": hostedHarnessUi ? "desktop" : undefined, "data-agent-sidebar-state": panelOpen ? "open" : "closed", "data-agent-sidebar-per-app-chat": isPerAppChatSidebar ? "true" : undefined, "data-agent-sidebar-resizing": isResizing ? "true" : undefined, "data-agent-sidebar-chat-handoff": chatViewTransitionHandoff ? "true" : undefined, style: chatViewTransition
|
|
2061
2061
|
? getAgentChatViewTransitionStyle(panelStyle)
|
|
2062
|
-
: panelStyle, inert: sidebarAnimationEnabled && !panelOpen ? true : undefined, "aria-hidden": sidebarAnimationEnabled && !panelOpen ? true : undefined, children: _jsx("div", { className: "agent-sidebar-panel-inner flex min-h-0 flex-1 flex-col", children: _jsx(AgentPanel, { emptyStateText: emptyStateText, suggestions: suggestions, dynamicSuggestions: dynamicSuggestions, composerToolbarSlot: composerToolbarSlot, composerSlot: composerSlot, onComposerTextChange: onComposerTextChange, imageModelMenu: imageModelMenu, availableAgents: effectiveAvailableAgents, availableModels: availableModels, modelListLoading: modelListLoading, selectedAgent: effectiveSelectedAgent, onAgentChange: effectiveOnAgentChange, hostedHarness: hostedHarnessEnabled, onConnectLocalRuntime: onConnectLocalRuntime, runtime: runtime, adapterReloadKey: adapterReloadKey, threadFooterSlot: threadFooterSlot, apiUrl: apiUrl, agentChatSurface: agentChatSurface, desktopIdentityUnauthenticated: desktopIdentityUnauthenticated, desktopIdentityAuthenticated: desktopIdentityAuthenticated, showTabBar: effectiveShowTabBar, suppressInlineOpenApp: suppressInlineOpenApp, composerPlaceholder: composerPlaceholder, missingApiKeySetupLayout: "sidebar", onCollapse: () => setOpenPersisted(false), onSnapTo75Percent: isMobile ? undefined : snapTo75Percent, isWideDrawer: isMobile ? false : isWideDrawer, onExitWideDrawer: isMobile ? undefined : exitWideDrawer, onFullViewRequest: onFullscreenRequest, storageKey: storageKey, scope: scope, isolateHistoryByScope: isolateHistoryByScope, showScopeBadge: showScopeBadge, browserTabId: browserTabId, threadUrlSync: threadUrlSync, agentPageHref: agentPageHref, allowSettingsMode: false, chatOnly: true }) }) }), showResizeHandle && isLeft && (_jsx(ResizeHandle, { position: effectivePosition, onDrag: handleDrag, onResizeStart: handleResizeStart, onResizeEnd: handleResizeEnd }))] })) : null;
|
|
2062
|
+
: panelStyle, inert: sidebarAnimationEnabled && !panelOpen ? true : undefined, "aria-hidden": sidebarAnimationEnabled && !panelOpen ? true : undefined, children: _jsx("div", { className: "agent-sidebar-panel-inner flex min-h-0 flex-1 flex-col", children: _jsx(AgentPanel, { emptyStateText: emptyStateText, suggestions: suggestions, dynamicSuggestions: dynamicSuggestions, composerToolbarSlot: composerToolbarSlot, composerSlot: composerSlot, onComposerTextChange: onComposerTextChange, imageModelMenu: imageModelMenu, availableAgents: effectiveAvailableAgents, availableModels: availableModels, modelListLoading: modelListLoading, selectedAgent: effectiveSelectedAgent, onAgentChange: effectiveOnAgentChange, hostedHarness: hostedHarnessEnabled, onConnectProvider: onConnectProvider, onConnectLocalRuntime: onConnectLocalRuntime, runtime: runtime, adapterReloadKey: adapterReloadKey, threadFooterSlot: threadFooterSlot, apiUrl: apiUrl, agentChatSurface: agentChatSurface, desktopIdentityUnauthenticated: desktopIdentityUnauthenticated, desktopIdentityAuthenticated: desktopIdentityAuthenticated, showTabBar: effectiveShowTabBar, suppressInlineOpenApp: suppressInlineOpenApp, composerPlaceholder: composerPlaceholder, missingApiKeySetupLayout: "sidebar", onCollapse: () => setOpenPersisted(false), onSnapTo75Percent: isMobile ? undefined : snapTo75Percent, isWideDrawer: isMobile ? false : isWideDrawer, onExitWideDrawer: isMobile ? undefined : exitWideDrawer, onFullViewRequest: onFullscreenRequest, storageKey: storageKey, scope: scope, isolateHistoryByScope: isolateHistoryByScope, showScopeBadge: showScopeBadge, browserTabId: browserTabId, threadUrlSync: threadUrlSync, agentPageHref: agentPageHref, allowSettingsMode: false, chatOnly: true }) }) }), showResizeHandle && isLeft && (_jsx(ResizeHandle, { position: effectivePosition, onDrag: handleDrag, onResizeStart: handleResizeStart, onResizeEnd: handleResizeEnd }))] })) : null;
|
|
2063
2063
|
const drawerPlaceholder = wideDrawerEnabled && !presentationMode && panelOpen ? (_jsx("div", { "aria-hidden": "true", className: "agent-sidebar-drawer-placeholder shrink-0", "data-agent-sidebar-placeholder": "true", style: { width: drawerPlaceholderWidth + 1 } })) : null;
|
|
2064
2064
|
return (_jsx(AgentSidebarOnboardingContext.Provider, { value: true, children: _jsxs(RealtimeVoiceModeProvider, { browserTabId: browserTabId, children: [showFirstRunOnboarding && (_jsx(Suspense, { fallback: null, children: _jsx(FirstRunOnboarding, {}) })), _jsxs("div", { className: "agent-sidebar-shell flex min-w-0 flex-1 h-screen overflow-hidden", "data-agent-sidebar-position": effectivePosition, "data-agent-native-hosted-harness-ui": hostedHarnessUi ? "desktop" : undefined, "data-agent-native-hosted-chat": isPerAppChatHosted ? "true" : undefined, "data-agent-sidebar-resizing": isResizing ? "true" : undefined, children: [isMobile &&
|
|
2065
2065
|
!isPerAppChatHosted &&
|
|
@@ -3,7 +3,10 @@ import type { ResourceView } from "../resources/ResourcesPanel.js";
|
|
|
3
3
|
import type { SettingsTabItem } from "../settings/SettingsTabsPage.js";
|
|
4
4
|
import type { AgentPageTabProps } from "./types.js";
|
|
5
5
|
export declare const AGENT_RESOURCE_DOCS_HREF: Record<ResourceView, string>;
|
|
6
|
-
export declare function ConnectionsTab({ canManageOrg, }?: Partial<AgentPageTabProps>
|
|
6
|
+
export declare function ConnectionsTab({ canManageOrg, onOAuthStart, oauthReturnPath, }?: Partial<AgentPageTabProps> & {
|
|
7
|
+
onOAuthStart?: (url: string) => void | Promise<void>;
|
|
8
|
+
oauthReturnPath?: string;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
7
10
|
export declare const AGENT_ACCESS_DOCS_HREF: {
|
|
8
11
|
readonly mcp: string;
|
|
9
12
|
readonly a2a: string;
|
|
@@ -117,7 +117,7 @@ function ServerStatus({ server }) {
|
|
|
117
117
|
}
|
|
118
118
|
return (_jsx("span", { className: "text-[11px] text-muted-foreground", children: "Status unknown" }));
|
|
119
119
|
}
|
|
120
|
-
export function ConnectionsTab({ canManageOrg, } = {}) {
|
|
120
|
+
export function ConnectionsTab({ canManageOrg, onOAuthStart, oauthReturnPath, } = {}) {
|
|
121
121
|
const t = useT();
|
|
122
122
|
const serversQuery = useMcpServers();
|
|
123
123
|
const createServer = useCreateMcpServer();
|
|
@@ -181,7 +181,7 @@ export function ConnectionsTab({ canManageOrg, } = {}) {
|
|
|
181
181
|
? "No personal agent integrations yet"
|
|
182
182
|
: "No workspace-shared agent integrations yet", description: section.scope === "user"
|
|
183
183
|
? "Connect a service to give the agent access to it."
|
|
184
|
-
: "Agent integrations shared with this workspace will appear here." }))] }, section.scope))) })), _jsx(McpIntegrationDialog, { open: dialogOpen, onOpenChange: setDialogOpen, defaultScope: "user", canCreateOrgMcp: canCreateOrgMcp, hasOrg: hasOrg, onCreateMcpServer: onCreateMcpServer })] }) }));
|
|
184
|
+
: "Agent integrations shared with this workspace will appear here." }))] }, section.scope))) })), _jsx(McpIntegrationDialog, { open: dialogOpen, onOpenChange: setDialogOpen, defaultScope: "user", canCreateOrgMcp: canCreateOrgMcp, hasOrg: hasOrg, onCreateMcpServer: onCreateMcpServer, onOAuthStart: onOAuthStart, oauthReturnPath: oauthReturnPath })] }) }));
|
|
185
185
|
}
|
|
186
186
|
export const AGENT_ACCESS_DOCS_HREF = {
|
|
187
187
|
mcp: docsUrl("mcp-protocol"),
|
|
@@ -3,9 +3,12 @@ export interface IntegrationConnectionChoiceProps {
|
|
|
3
3
|
name: string;
|
|
4
4
|
logo?: ReactNode;
|
|
5
5
|
showWorkspaceOption: boolean;
|
|
6
|
+
workspaceOptionDisabled?: boolean;
|
|
7
|
+
workspaceOptionDisabledReason?: string;
|
|
8
|
+
personalOnlyReason?: string;
|
|
6
9
|
busy?: boolean;
|
|
7
10
|
onPersonal: () => void;
|
|
8
11
|
onWorkspace: () => void;
|
|
9
12
|
}
|
|
10
13
|
/** The one small decision before an integration's advanced setup surface. */
|
|
11
|
-
export declare function IntegrationConnectionChoice({ name, logo, showWorkspaceOption, busy, onPersonal, onWorkspace, }: IntegrationConnectionChoiceProps): import("react").JSX.Element;
|
|
14
|
+
export declare function IntegrationConnectionChoice({ name, logo, showWorkspaceOption, workspaceOptionDisabled, workspaceOptionDisabledReason, personalOnlyReason, busy, onPersonal, onWorkspace, }: IntegrationConnectionChoiceProps): import("react").JSX.Element;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { IconLoader2, IconUser, IconUsersGroup } from "@tabler/icons-react";
|
|
3
|
+
import { useT } from "../i18n.js";
|
|
3
4
|
/** The one small decision before an integration's advanced setup surface. */
|
|
4
|
-
export function IntegrationConnectionChoice({ name, logo, showWorkspaceOption, busy = false, onPersonal, onWorkspace, }) {
|
|
5
|
-
|
|
5
|
+
export function IntegrationConnectionChoice({ name, logo, showWorkspaceOption, workspaceOptionDisabled = false, workspaceOptionDisabledReason, personalOnlyReason, busy = false, onPersonal, onWorkspace, }) {
|
|
6
|
+
const t = useT();
|
|
7
|
+
return (_jsxs("div", { className: "flex min-h-full flex-1 flex-col bg-background", children: [_jsx("header", { className: "flex min-h-16 items-center border-b border-border px-6 sm:px-10", children: _jsxs("div", { className: "flex min-w-0 items-center gap-3", children: [logo ? (_jsx("span", { className: "flex size-8 shrink-0 items-center justify-center rounded-md bg-muted/50 text-foreground", children: logo })) : null, _jsxs("span", { className: "truncate text-sm font-medium text-foreground", children: [t("mcpIntegrations.connect"), " ", name] })] }) }), _jsx("main", { className: "flex flex-1 justify-center overflow-y-auto px-6 py-12 sm:px-10 sm:py-[12vh]", children: _jsxs("div", { className: "w-full max-w-[420px] self-start", children: [_jsx("h1", { className: "text-2xl font-semibold tracking-[-0.03em] text-foreground sm:text-[28px]", children: t("mcpIntegrations.scopeChoiceTitle") }), _jsx("p", { className: "mt-2 text-sm leading-6 text-muted-foreground", children: t("mcpIntegrations.scopeChoiceDescription") }), _jsxs("div", { className: "mt-8 grid gap-2.5", children: [_jsxs("button", { type: "button", onClick: onPersonal, disabled: busy, "aria-busy": busy, className: "flex min-h-12 items-center gap-3 rounded-lg bg-primary px-4 py-3 text-left text-primary-foreground transition-[background-color,opacity] hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-wait disabled:opacity-60", children: [_jsx(IconUser, { className: "size-4 shrink-0 opacity-75" }), _jsx("span", { className: "min-w-0 flex-1 text-sm font-medium", children: t("mcpIntegrations.connectForMe") }), busy ? (_jsx(IconLoader2, { className: "size-4 shrink-0 animate-spin" })) : null] }), showWorkspaceOption ? (_jsxs("button", { type: "button", onClick: onWorkspace, disabled: busy || workspaceOptionDisabled, "aria-describedby": workspaceOptionDisabledReason
|
|
8
|
+
? "integration-workspace-scope-restriction"
|
|
9
|
+
: undefined, className: "flex min-h-12 items-center gap-3 rounded-lg bg-muted/50 px-4 py-3 text-left text-foreground transition-colors hover:bg-muted/70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-60", children: [_jsx(IconUsersGroup, { className: "size-4 shrink-0 text-muted-foreground" }), _jsx("span", { className: "min-w-0 flex-1 text-sm font-medium", children: t("mcpIntegrations.setUpForWorkspace") }), workspaceOptionDisabledReason ? (_jsx("span", { id: "integration-workspace-scope-restriction", className: "shrink-0 text-[11px] font-normal text-muted-foreground", children: workspaceOptionDisabledReason })) : null] })) : null] }), personalOnlyReason ? (_jsx("p", { className: "mt-3 text-[11px] leading-relaxed text-muted-foreground", children: personalOnlyReason })) : null] }) })] }));
|
|
6
10
|
}
|
|
@@ -6,10 +6,10 @@ import { docsUrl } from "../../shared/docs-url.js";
|
|
|
6
6
|
import { appPath } from "../api-path.js";
|
|
7
7
|
import { Tooltip, TooltipContent, TooltipTrigger, } from "../components/ui/tooltip.js";
|
|
8
8
|
import { IntegrationGrid } from "../integrations/IntegrationGrid.js";
|
|
9
|
-
import { buildMcpOAuthStartUrl, filterMcpIntegrations, getDefaultMcpIntegrations, navigateToMcpOAuthStart,
|
|
9
|
+
import { buildMcpOAuthStartUrl, filterMcpIntegrations, getDefaultMcpIntegrations, navigateToMcpOAuthStart, } from "../resources/mcp-integration-catalog.js";
|
|
10
10
|
import { McpIntegrationDialog } from "../resources/McpIntegrationDialog.js";
|
|
11
11
|
import { McpIntegrationLogo } from "../resources/McpIntegrationLogo.js";
|
|
12
|
-
import { formatMcpServerError, useCreateMcpServer, useMcpServers, } from "../resources/use-mcp-servers.js";
|
|
12
|
+
import { formatMcpServerError, formatMcpServersLoadError, useCreateMcpServer, useMcpServers, } from "../resources/use-mcp-servers.js";
|
|
13
13
|
import { useBuilderConnectFlow } from "../settings/useBuilderStatus.js";
|
|
14
14
|
import { cn } from "../utils.js";
|
|
15
15
|
import { shouldSkipFirstRunIntegrations } from "./first-run-enabled.js";
|
|
@@ -122,7 +122,9 @@ export function FirstRunOnboarding({ skipIntegrations = shouldSkipFirstRunIntegr
|
|
|
122
122
|
connectingIntegrationId === integration.id) {
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
|
-
if (
|
|
125
|
+
if (!mcpServersQuery.isSuccess)
|
|
126
|
+
return;
|
|
127
|
+
if (hasOrg) {
|
|
126
128
|
setIntegrationDialogId(integration.id);
|
|
127
129
|
return;
|
|
128
130
|
}
|
|
@@ -190,7 +192,7 @@ export function FirstRunOnboarding({ skipIntegrations = shouldSkipFirstRunIntegr
|
|
|
190
192
|
return (_jsx(OnboardingShell, { profile: profile, screen: "choice", children: _jsxs("div", { className: "mx-auto flex w-full max-w-xl flex-col gap-4", children: [_jsxs("div", { children: [_jsx("button", { type: "button", className: "mb-4 text-xs text-muted-foreground hover:text-foreground", onClick: () => setScreen("choice"), children: "Back" }), _jsx("h1", { className: "text-xl font-semibold tracking-[-0.04em] sm:text-2xl", children: "Your keys" })] }), _jsxs("div", { className: "rounded-xl bg-muted/35 p-4", children: [_jsx(CapabilityList, { capabilities: profile.capabilities }), _jsxs("div", { className: "mt-5 flex flex-col-reverse gap-2 pt-4 sm:flex-row sm:justify-between", children: [_jsx("button", { type: "button", className: secondaryButtonClass, onClick: () => setScreen("choice"), children: "Back" }), _jsxs("button", { type: "button", className: primaryButtonClass, onClick: handleOpenSettings, children: ["Open key settings", _jsx(IconArrowRight, { size: 15 })] }), _jsx("button", { type: "button", className: secondaryButtonClass, onClick: () => setScreen(skipIntegrations ? "ready" : "tools"), children: skipIntegrations ? "Continue" : "Continue to tools" })] })] })] }) }));
|
|
191
193
|
}
|
|
192
194
|
if (screen === "tools") {
|
|
193
|
-
return (_jsxs(OnboardingShell, { profile: profile, screen: "tools", footer: _jsxs("div", { "data-testid": "onboarding-tools-footer", className: "mx-auto flex w-full max-w-3xl flex-wrap items-center justify-end gap-2", children: [_jsx("button", { type: "button", className: secondaryButtonClass, onClick: handleFinish, children: "Skip for now" }), _jsxs("button", { type: "button", className: primaryButtonClass, onClick: handleFinish, children: ["Continue", _jsx(IconArrowRight, { size: 15 })] })] }), children: [_jsxs("div", { className: "mx-auto flex w-full max-w-4xl flex-col gap-5", children: [_jsxs("div", { children: [_jsx("h1", { className: "text-2xl font-semibold tracking-[-0.05em] sm:text-3xl", children: "This app is an agent." }), _jsx("p", { className: "mt-1.5 max-w-2xl text-sm leading-6 text-muted-foreground", children: "Connect the tools your agent can use to gather context and take action. You can add more later in Settings." })] }), _jsxs("div", { className: "flex flex-col gap-4", children: [_jsxs("div", { className: "flex flex-col gap-3 pb-4", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("div", { children: _jsx("p", { className: "text-sm font-medium text-foreground", children: "Agent integrations" }) }), _jsxs("label", { className: "relative w-full max-w-xs", children: [_jsx(IconSearch, { className: "pointer-events-none absolute start-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }), _jsx("input", { value: integrationQuery, onChange: (event) => setIntegrationQuery(event.target.value), 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", placeholder: "Search integrations", "aria-label": "Search integrations" })] })] }), connectError && (_jsx("p", { className: "text-xs leading-5 text-destructive", children: connectError }))] }), _jsx(IntegrationGrid, { items: mcpIntegrations.map((integration) => {
|
|
195
|
+
return (_jsxs(OnboardingShell, { profile: profile, screen: "tools", footer: _jsxs("div", { "data-testid": "onboarding-tools-footer", className: "mx-auto flex w-full max-w-3xl flex-wrap items-center justify-end gap-2", children: [_jsx("button", { type: "button", className: secondaryButtonClass, onClick: handleFinish, children: "Skip for now" }), _jsxs("button", { type: "button", className: primaryButtonClass, onClick: handleFinish, children: ["Continue", _jsx(IconArrowRight, { size: 15 })] })] }), children: [_jsxs("div", { className: "mx-auto flex w-full max-w-4xl flex-col gap-5", children: [_jsxs("div", { children: [_jsx("h1", { className: "text-2xl font-semibold tracking-[-0.05em] sm:text-3xl", children: "This app is an agent." }), _jsx("p", { className: "mt-1.5 max-w-2xl text-sm leading-6 text-muted-foreground", children: "Connect the tools your agent can use to gather context and take action. You can add more later in Settings." })] }), _jsxs("div", { className: "flex flex-col gap-4", children: [_jsxs("div", { className: "flex flex-col gap-3 pb-4", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("div", { children: _jsx("p", { className: "text-sm font-medium text-foreground", children: "Agent integrations" }) }), _jsxs("label", { className: "relative w-full max-w-xs", children: [_jsx(IconSearch, { className: "pointer-events-none absolute start-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }), _jsx("input", { value: integrationQuery, onChange: (event) => setIntegrationQuery(event.target.value), 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", placeholder: "Search integrations", "aria-label": "Search integrations" })] })] }), connectError && (_jsx("p", { className: "text-xs leading-5 text-destructive", children: connectError })), mcpServersQuery.isError ? (_jsxs("div", { role: "alert", className: "rounded-md border border-destructive/20 bg-destructive/5 px-3 py-2 text-xs text-destructive", children: [_jsx("p", { children: formatMcpServersLoadError(mcpServersQuery.error) }), _jsx("button", { type: "button", onClick: () => void mcpServersQuery.refetch(), disabled: mcpServersQuery.isFetching, className: "mt-2 font-medium underline underline-offset-2 hover:text-foreground disabled:cursor-wait disabled:opacity-60", children: mcpServersQuery.isFetching ? "Retrying…" : "Retry" })] })) : null] }), _jsx(IntegrationGrid, { items: mcpIntegrations.map((integration) => {
|
|
194
196
|
const connected = connectedUrls.has(compareUrl(integration.url));
|
|
195
197
|
return {
|
|
196
198
|
id: integration.id,
|
|
@@ -200,7 +202,9 @@ export function FirstRunOnboarding({ skipIntegrations = shouldSkipFirstRunIntegr
|
|
|
200
202
|
status: connected ? "Connected" : undefined,
|
|
201
203
|
statusClassName: "text-emerald-600 dark:text-emerald-400",
|
|
202
204
|
actionLabel: connected ? "Connected" : "Connect",
|
|
203
|
-
disabled: connected ||
|
|
205
|
+
disabled: connected ||
|
|
206
|
+
connectingIntegrationId === integration.id ||
|
|
207
|
+
!mcpServersQuery.isSuccess,
|
|
204
208
|
onAction: () => void connectIntegration(integration),
|
|
205
209
|
};
|
|
206
210
|
}), emptyLabel: "No integrations match." })] })] }), integrationDialogId && (_jsx(McpIntegrationDialog, { open: true, onOpenChange: (open) => {
|
|
@@ -10,7 +10,9 @@ export interface McpIntegrationDialogProps {
|
|
|
10
10
|
canCreateOrgMcp: boolean;
|
|
11
11
|
hasOrg: boolean;
|
|
12
12
|
onCreateMcpServer: (args: CreateMcpServerArgs) => Promise<unknown>;
|
|
13
|
+
onOAuthStart?: (url: string) => void | Promise<void>;
|
|
14
|
+
oauthReturnPath?: string;
|
|
13
15
|
onCreated?: () => void;
|
|
14
16
|
integrations?: DefaultMcpIntegration[];
|
|
15
17
|
}
|
|
16
|
-
export declare function McpIntegrationDialog({ open, onOpenChange, initialIntegrationId, connectIntegrationId, quickConnectIntegrationId, defaultScope, canCreateOrgMcp, hasOrg, onCreateMcpServer, onCreated, integrations, }: McpIntegrationDialogProps): import("react").JSX.Element | null;
|
|
18
|
+
export declare function McpIntegrationDialog({ open, onOpenChange, initialIntegrationId, connectIntegrationId, quickConnectIntegrationId, defaultScope, canCreateOrgMcp, hasOrg, onCreateMcpServer, onOAuthStart, oauthReturnPath, onCreated, integrations, }: McpIntegrationDialogProps): import("react").JSX.Element | null;
|
|
@@ -8,9 +8,9 @@ import { useT } from "../i18n.js";
|
|
|
8
8
|
import { IntegrationConnectionChoice } from "../integrations/IntegrationConnectionChoice.js";
|
|
9
9
|
import { IntegrationGrid } from "../integrations/IntegrationGrid.js";
|
|
10
10
|
import { cn } from "../utils.js";
|
|
11
|
-
import { buildMcpOAuthStartUrl, createMcpIntegrationFormDefaults, filterMcpIntegrations, getMcpIntegrationApiFallback, getDefaultMcpIntegrations, isCustomMcpIntegrationEnabled, navigateToMcpOAuthStart, resolveMcpIntegrationScope, shouldOfferMcpIntegrationOrganizationScope, shouldOfferMcpOrganizationScope, } from "./mcp-integration-catalog.js";
|
|
11
|
+
import { buildMcpOAuthStartUrl, createMcpIntegrationFormDefaults, filterMcpIntegrations, getMcpIntegrationApiFallback, getDefaultMcpIntegrations, isCustomMcpIntegrationEnabled, navigateToMcpOAuthStart, resolveMcpIntegrationScope, shouldOfferMcpIntegrationOrganizationScope, shouldOfferMcpOrganizationScope, supportsMcpIntegrationOrganizationScope, } from "./mcp-integration-catalog.js";
|
|
12
12
|
import { McpIntegrationLogo } from "./McpIntegrationLogo.js";
|
|
13
|
-
import { formatMcpServerError, getMcpUrlValidationError, useMcpServersApi, useMcpServers, } from "./use-mcp-servers.js";
|
|
13
|
+
import { formatMcpServerError, formatMcpServersLoadError, getMcpUrlValidationError, useMcpServersApi, useMcpServers, } from "./use-mcp-servers.js";
|
|
14
14
|
function parseHeaderLines(text) {
|
|
15
15
|
const out = {};
|
|
16
16
|
for (const line of text.split(/\r?\n/)) {
|
|
@@ -49,7 +49,7 @@ function resolveIntegrationScope(integration, defaultScope, hasOrg, canCreateOrg
|
|
|
49
49
|
(integration.supportsOrganizationScope === true &&
|
|
50
50
|
integration.managedOAuth !== true));
|
|
51
51
|
}
|
|
52
|
-
export function McpIntegrationDialog({ open, onOpenChange, initialIntegrationId = null, connectIntegrationId = null, quickConnectIntegrationId = null, defaultScope, canCreateOrgMcp, hasOrg, onCreateMcpServer, onCreated, integrations, }) {
|
|
52
|
+
export function McpIntegrationDialog({ open, onOpenChange, initialIntegrationId = null, connectIntegrationId = null, quickConnectIntegrationId = null, defaultScope, canCreateOrgMcp, hasOrg, onCreateMcpServer, onOAuthStart, oauthReturnPath, onCreated, integrations, }) {
|
|
53
53
|
const t = useT();
|
|
54
54
|
const [mode, setMode] = useState("catalog");
|
|
55
55
|
const [query, setQuery] = useState("");
|
|
@@ -89,11 +89,21 @@ export function McpIntegrationDialog({ open, onOpenChange, initialIntegrationId
|
|
|
89
89
|
useEffect(() => {
|
|
90
90
|
if (!open)
|
|
91
91
|
return;
|
|
92
|
+
if (initialIntegrationId && !mcpServersQuery.isSuccess)
|
|
93
|
+
return;
|
|
92
94
|
const initialIntegration = initialIntegrationId
|
|
93
95
|
? defaultIntegrations.find((integration) => integration.id === initialIntegrationId)
|
|
94
96
|
: null;
|
|
95
97
|
const initialDefaults = createMcpIntegrationFormDefaults(initialIntegration);
|
|
96
|
-
|
|
98
|
+
const initialNeedsScopeChoice = Boolean(initialIntegration &&
|
|
99
|
+
hasOrg &&
|
|
100
|
+
requiresMcpIntegrationSetup(initialIntegration) &&
|
|
101
|
+
supportsMcpIntegrationOrganizationScope(initialIntegration));
|
|
102
|
+
setMode(initialNeedsScopeChoice
|
|
103
|
+
? "choice"
|
|
104
|
+
: initialIntegration || !showCatalog
|
|
105
|
+
? "form"
|
|
106
|
+
: "catalog");
|
|
97
107
|
setQuery("");
|
|
98
108
|
setSelected(initialIntegration ?? null);
|
|
99
109
|
setScope(resolveIntegrationScope(initialIntegration, defaultScope, hasOrg, canCreateOrgMcp));
|
|
@@ -114,6 +124,7 @@ export function McpIntegrationDialog({ open, onOpenChange, initialIntegrationId
|
|
|
114
124
|
open,
|
|
115
125
|
safeDefaultScope,
|
|
116
126
|
showCatalog,
|
|
127
|
+
mcpServersQuery.isSuccess,
|
|
117
128
|
]);
|
|
118
129
|
useEffect(() => {
|
|
119
130
|
if (open && mode === "form") {
|
|
@@ -147,18 +158,31 @@ export function McpIntegrationDialog({ open, onOpenChange, initialIntegrationId
|
|
|
147
158
|
return;
|
|
148
159
|
}
|
|
149
160
|
setBusy(true);
|
|
150
|
-
const returnUrl =
|
|
151
|
-
?
|
|
152
|
-
: window
|
|
153
|
-
|
|
154
|
-
window.location.
|
|
155
|
-
|
|
161
|
+
const returnUrl = oauthReturnPath?.startsWith("/")
|
|
162
|
+
? oauthReturnPath
|
|
163
|
+
: typeof window === "undefined"
|
|
164
|
+
? "/"
|
|
165
|
+
: window.location.pathname +
|
|
166
|
+
window.location.search +
|
|
167
|
+
window.location.hash;
|
|
168
|
+
const oauthUrl = agentNativePath(buildMcpOAuthStartUrl({
|
|
156
169
|
name: args.name,
|
|
157
170
|
url: args.url,
|
|
158
171
|
description: args.description,
|
|
159
172
|
scope: options?.scope ?? scope,
|
|
160
173
|
returnUrl,
|
|
161
|
-
}))
|
|
174
|
+
}));
|
|
175
|
+
if (!onOAuthStart) {
|
|
176
|
+
navigateToMcpOAuthStart(oauthUrl);
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
void Promise.resolve()
|
|
180
|
+
.then(() => onOAuthStart(oauthUrl))
|
|
181
|
+
.then(() => onOpenChange(false))
|
|
182
|
+
.catch((cause) => {
|
|
183
|
+
setBusy(false);
|
|
184
|
+
setError(formatMcpServerError(cause));
|
|
185
|
+
});
|
|
162
186
|
};
|
|
163
187
|
const connectWithOAuth = (integration, options) => beginOAuth({
|
|
164
188
|
name: integration.name,
|
|
@@ -218,6 +242,11 @@ export function McpIntegrationDialog({ open, onOpenChange, initialIntegrationId
|
|
|
218
242
|
});
|
|
219
243
|
};
|
|
220
244
|
const quickConnect = (integration) => {
|
|
245
|
+
if (hasOrg) {
|
|
246
|
+
setSelected(integration);
|
|
247
|
+
setMode("choice");
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
221
250
|
if (requiresMcpIntegrationSetup(integration)) {
|
|
222
251
|
openForm(integration);
|
|
223
252
|
return;
|
|
@@ -240,6 +269,13 @@ export function McpIntegrationDialog({ open, onOpenChange, initialIntegrationId
|
|
|
240
269
|
});
|
|
241
270
|
};
|
|
242
271
|
const selectCatalogConnection = (integration) => {
|
|
272
|
+
if (!mcpServersQuery.isSuccess)
|
|
273
|
+
return;
|
|
274
|
+
if (hasOrg) {
|
|
275
|
+
setSelected(integration);
|
|
276
|
+
setMode("choice");
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
243
279
|
if (requiresMcpIntegrationSetup(integration)) {
|
|
244
280
|
const apiFallback = getMcpIntegrationApiFallback(integration);
|
|
245
281
|
if (apiFallback) {
|
|
@@ -250,11 +286,6 @@ export function McpIntegrationDialog({ open, onOpenChange, initialIntegrationId
|
|
|
250
286
|
}
|
|
251
287
|
return;
|
|
252
288
|
}
|
|
253
|
-
if (shouldOfferMcpIntegrationOrganizationScope(integration, hasOrg, canCreateOrgMcp)) {
|
|
254
|
-
setSelected(integration);
|
|
255
|
-
setMode("choice");
|
|
256
|
-
return;
|
|
257
|
-
}
|
|
258
289
|
quickConnect(integration);
|
|
259
290
|
};
|
|
260
291
|
quickConnectRef.current = quickConnect;
|
|
@@ -267,15 +298,30 @@ export function McpIntegrationDialog({ open, onOpenChange, initialIntegrationId
|
|
|
267
298
|
quickConnectAttemptedRef.current === quickConnectIntegrationId) {
|
|
268
299
|
return;
|
|
269
300
|
}
|
|
301
|
+
if (mcpServersQuery.isError)
|
|
302
|
+
return;
|
|
303
|
+
if (!mcpServersQuery.isSuccess)
|
|
304
|
+
return;
|
|
270
305
|
const integration = defaultIntegrations.find((candidate) => candidate.id === quickConnectIntegrationId);
|
|
271
306
|
if (!integration)
|
|
272
307
|
return;
|
|
273
308
|
quickConnectAttemptedRef.current = quickConnectIntegrationId;
|
|
274
309
|
quickConnectRef.current?.(integration);
|
|
275
|
-
}, [
|
|
310
|
+
}, [
|
|
311
|
+
defaultIntegrations,
|
|
312
|
+
hasOrg,
|
|
313
|
+
mcpServersQuery.isError,
|
|
314
|
+
mcpServersQuery.isSuccess,
|
|
315
|
+
open,
|
|
316
|
+
quickConnectIntegrationId,
|
|
317
|
+
]);
|
|
276
318
|
useEffect(() => {
|
|
277
319
|
if (!open || !connectIntegrationId)
|
|
278
320
|
return;
|
|
321
|
+
if (mcpServersQuery.isError)
|
|
322
|
+
return;
|
|
323
|
+
if (!mcpServersQuery.isSuccess)
|
|
324
|
+
return;
|
|
279
325
|
const integration = defaultIntegrations.find((candidate) => candidate.id === connectIntegrationId);
|
|
280
326
|
if (!integration)
|
|
281
327
|
return;
|
|
@@ -283,25 +329,36 @@ export function McpIntegrationDialog({ open, onOpenChange, initialIntegrationId
|
|
|
283
329
|
if (quickConnectAttemptedRef.current === attemptKey)
|
|
284
330
|
return;
|
|
285
331
|
quickConnectAttemptedRef.current = attemptKey;
|
|
332
|
+
if (hasOrg) {
|
|
333
|
+
setSelected(integration);
|
|
334
|
+
setMode("choice");
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
286
337
|
if (requiresMcpIntegrationSetup(integration)) {
|
|
287
338
|
openForm(integration);
|
|
288
339
|
return;
|
|
289
340
|
}
|
|
290
|
-
|
|
291
|
-
if (!showWorkspaceChoice) {
|
|
292
|
-
quickConnectRef.current?.(integration);
|
|
293
|
-
}
|
|
294
|
-
else {
|
|
295
|
-
setMode("choice");
|
|
296
|
-
}
|
|
341
|
+
quickConnectRef.current?.(integration);
|
|
297
342
|
}, [
|
|
298
343
|
canCreateOrgMcp,
|
|
299
344
|
connectIntegrationId,
|
|
300
345
|
defaultIntegrations,
|
|
301
346
|
hasOrg,
|
|
347
|
+
mcpServersQuery.isError,
|
|
348
|
+
mcpServersQuery.isSuccess,
|
|
302
349
|
open,
|
|
303
350
|
]);
|
|
304
351
|
const connectPersonal = (integration) => {
|
|
352
|
+
if (requiresMcpIntegrationSetup(integration)) {
|
|
353
|
+
const apiFallback = getMcpIntegrationApiFallback(integration);
|
|
354
|
+
if (apiFallback) {
|
|
355
|
+
openAgentSettings(`secrets:${apiFallback.secretKey}`);
|
|
356
|
+
}
|
|
357
|
+
else {
|
|
358
|
+
openForm(integration, { scope: "user" });
|
|
359
|
+
}
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
305
362
|
if (integration.authMode === "oauth") {
|
|
306
363
|
connectWithOAuth(integration, { scope: "user" });
|
|
307
364
|
return;
|
|
@@ -319,6 +376,12 @@ export function McpIntegrationDialog({ open, onOpenChange, initialIntegrationId
|
|
|
319
376
|
openForm(integration, { scope: "user" });
|
|
320
377
|
};
|
|
321
378
|
const connectWorkspace = (integration) => {
|
|
379
|
+
if (!canCreateOrgMcp)
|
|
380
|
+
return;
|
|
381
|
+
if (requiresMcpIntegrationSetup(integration)) {
|
|
382
|
+
openForm(integration, { scope: "org" });
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
322
385
|
if (integration.authMode === "oauth") {
|
|
323
386
|
connectWithOAuth(integration, { scope: "org" });
|
|
324
387
|
return;
|
|
@@ -384,93 +447,99 @@ export function McpIntegrationDialog({ open, onOpenChange, initialIntegrationId
|
|
|
384
447
|
};
|
|
385
448
|
if (!showCatalog && !customIntegrationEnabled)
|
|
386
449
|
return null;
|
|
387
|
-
return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children:
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
:
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
actionLabel: connected
|
|
407
|
-
? "Manage"
|
|
408
|
-
: setupOnly && apiFallback
|
|
409
|
-
? t("mcpIntegrations.useApiToken")
|
|
450
|
+
return (_jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(DialogContent, { "aria-describedby": undefined, className: "inset-0 flex h-[100dvh] max-h-none w-full max-w-none translate-x-0 translate-y-0 flex-col gap-0 overflow-hidden rounded-none p-0", children: [mcpServersQuery.isError ? (_jsxs("div", { role: "alert", className: "mx-7 mt-4 shrink-0 rounded-md border border-destructive/20 bg-destructive/5 px-3 py-2 text-xs text-destructive sm:mx-10", children: [_jsx("p", { children: formatMcpServersLoadError(mcpServersQuery.error) }), _jsx("button", { type: "button", onClick: () => void mcpServersQuery.refetch(), disabled: mcpServersQuery.isFetching, className: "mt-2 font-medium underline underline-offset-2 hover:text-foreground disabled:cursor-wait disabled:opacity-60", children: mcpServersQuery.isFetching
|
|
451
|
+
? t("mcpIntegrations.retrying")
|
|
452
|
+
: t("mcpIntegrations.retry") })] })) : null, mode === "choice" && selected ? (_jsxs(_Fragment, { children: [_jsx(DialogHeader, { className: "sr-only", children: _jsxs(DialogTitle, { children: [t("mcpIntegrations.connect"), " ", selected.name] }) }), _jsx(IntegrationConnectionChoice, { name: selected.name, logo: _jsx(McpIntegrationLogo, { name: selected.name, logoUrl: selected.logoUrl, integrationId: selected.id, className: "size-7 rounded-md", imageClassName: "size-full p-1" }), showWorkspaceOption: supportsMcpIntegrationOrganizationScope(selected), workspaceOptionDisabled: !canCreateOrgMcp, workspaceOptionDisabledReason: !canCreateOrgMcp
|
|
453
|
+
? t("mcpIntegrations.workspaceAdminRequired")
|
|
454
|
+
: undefined, personalOnlyReason: !supportsMcpIntegrationOrganizationScope(selected)
|
|
455
|
+
? t("mcpIntegrations.personalOnlyDescription")
|
|
456
|
+
: undefined, busy: busy, onPersonal: () => connectPersonal(selected), onWorkspace: () => connectWorkspace(selected) })] })) : mode === "catalog" ? (_jsxs(_Fragment, { children: [_jsxs(DialogHeader, { className: "shrink-0 border-b border-border px-7 pb-5 pe-14 pt-7 sm:px-10", children: [_jsx(DialogTitle, { children: t("mcpIntegrations.title") }), _jsx(DialogDescription, { children: t("mcpIntegrations.description", {
|
|
457
|
+
count: defaultIntegrations.length,
|
|
458
|
+
}) })] }), _jsx("div", { className: "shrink-0 px-7 pb-5 sm:px-10", children: _jsxs("div", { className: "mx-auto flex w-full max-w-5xl flex-col gap-3 sm:flex-row", children: [_jsxs("label", { className: "relative min-w-0 flex-1", children: [_jsx(IconSearch, { className: "pointer-events-none absolute start-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }), _jsx("input", { value: query, onChange: (event) => setQuery(event.target.value), 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", placeholder: t("mcpIntegrations.searchPlaceholder") })] }), _jsx("button", { type: "button", onClick: () => openForm(null), className: cn("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", !customIntegrationEnabled && "hidden"), children: t("mcpIntegrations.addYourOwn") })] }) }), _jsx("div", { className: "min-h-0 flex-1 overflow-y-auto px-7 pb-10 pt-7 sm:px-10", children: _jsxs("div", { className: "mx-auto w-full max-w-5xl", children: [error && (_jsx("div", { className: "mb-3 rounded-md border border-destructive/20 bg-destructive/5 px-3 py-2 text-[12px] leading-relaxed text-destructive", children: error })), !mcpServersQuery.isSuccess && !mcpServersQuery.isError ? (_jsx("div", { role: "status", className: "mb-3 rounded-md border border-border bg-muted/30 px-3 py-2 text-[12px] leading-relaxed text-muted-foreground", children: t("mcpIntegrations.loadingScopeMetadata") })) : null, _jsx(IntegrationGrid, { items: filteredIntegrations.map((integration) => {
|
|
459
|
+
const connected = connectedUrls.has(compareUrl(integration.url));
|
|
460
|
+
const setupOnly = requiresMcpIntegrationSetup(integration);
|
|
461
|
+
const apiFallback = getMcpIntegrationApiFallback(integration);
|
|
462
|
+
return {
|
|
463
|
+
id: integration.id,
|
|
464
|
+
name: integration.name,
|
|
465
|
+
description: t(integration.descriptionKey),
|
|
466
|
+
logo: (_jsx(McpIntegrationLogo, { name: integration.name, logoUrl: integration.logoUrl, integrationId: integration.id, className: "size-7 rounded-md", imageClassName: "size-full p-1" })),
|
|
467
|
+
status: connected
|
|
468
|
+
? t("mcpIntegrations.connected")
|
|
410
469
|
: setupOnly
|
|
411
|
-
? t("mcpIntegrations.
|
|
412
|
-
:
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
})
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
? t("mcpIntegrations.
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
"mcpIntegrations.
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
470
|
+
? t("mcpIntegrations.status.setupRequired")
|
|
471
|
+
: undefined,
|
|
472
|
+
statusClassName: connected
|
|
473
|
+
? "text-emerald-600 dark:text-emerald-400"
|
|
474
|
+
: "text-muted-foreground",
|
|
475
|
+
actionLabel: connected
|
|
476
|
+
? "Manage"
|
|
477
|
+
: setupOnly && apiFallback
|
|
478
|
+
? t("mcpIntegrations.useApiToken")
|
|
479
|
+
: setupOnly
|
|
480
|
+
? t("mcpIntegrations.viewSetup")
|
|
481
|
+
: t("mcpIntegrations.connect"),
|
|
482
|
+
disabled: connected || busy || !mcpServersQuery.isSuccess,
|
|
483
|
+
onAction: () => {
|
|
484
|
+
if (connected) {
|
|
485
|
+
openForm(integration);
|
|
486
|
+
return;
|
|
487
|
+
}
|
|
488
|
+
selectCatalogConnection(integration);
|
|
489
|
+
},
|
|
490
|
+
};
|
|
491
|
+
}), emptyLabel: t("mcpIntegrations.noMatches") })] }) })] })) : (_jsxs(_Fragment, { children: [_jsxs(DialogHeader, { className: "shrink-0 border-b border-border px-7 pb-5 pe-14 pt-7 sm:px-10", children: [_jsxs("button", { type: "button", onClick: () => {
|
|
492
|
+
clearFeedback();
|
|
493
|
+
setMode("catalog");
|
|
494
|
+
}, className: cn("mb-1 inline-flex w-fit items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground", !showCatalog && "hidden"), children: [_jsx(IconArrowLeft, { className: "h-3 w-3 rtl:-scale-x-100" }), t("mcpIntegrations.backToIntegrations")] }), _jsx(DialogTitle, { children: selected
|
|
495
|
+
? selectedRequiresSetup
|
|
496
|
+
? t("mcpIntegrations.setupTitle", {
|
|
497
|
+
name: selected.name,
|
|
498
|
+
})
|
|
499
|
+
: t("mcpIntegrations.configureTitle", {
|
|
500
|
+
name: selected.name,
|
|
501
|
+
})
|
|
502
|
+
: t("mcpIntegrations.customTitle") }), _jsx(DialogDescription, { children: selected
|
|
503
|
+
? selectedRequiresSetup
|
|
504
|
+
? t("mcpIntegrations.providerSetupFormDescription")
|
|
505
|
+
: selected.authMode === "none"
|
|
506
|
+
? t("mcpIntegrations.presetNoAuthDescription")
|
|
507
|
+
: t("mcpIntegrations.presetAuthDescription")
|
|
508
|
+
: t("mcpIntegrations.customDescription") })] }), _jsx("div", { className: "min-h-0 flex-1 overflow-y-auto px-7 py-7 sm:px-10", children: _jsxs("div", { className: "mx-auto max-w-2xl space-y-3", children: [renderScopeSelector(), selected?.setupNoteKey && !selectedRequiresSetup ? (_jsx("div", { className: "rounded-md bg-muted/40 px-3 py-2 text-[11px] leading-relaxed text-muted-foreground", children: t(selected.setupNoteKey) })) : null, selectedRequiresSetup && selected && (_jsxs("div", { className: "mx-auto grid w-full max-w-xl gap-4 py-8", children: [_jsxs("div", { children: [_jsx("p", { className: "text-base font-semibold tracking-[-0.02em] text-foreground", children: t("mcpIntegrations.providerSetupRequired") }), _jsx("p", { className: "mt-1 text-sm leading-6 text-muted-foreground", children: t("mcpIntegrations.providerSetupDescription", {
|
|
509
|
+
name: selected.name,
|
|
510
|
+
}) })] }), selected.setupNoteKey ? (_jsx("p", { className: "text-sm leading-6 text-muted-foreground", children: t(selected.setupNoteKey) })) : null, selected.docsUrl ? (_jsxs("a", { href: selected.docsUrl, target: "_blank", rel: "noopener noreferrer", className: "inline-flex w-fit items-center gap-1 text-sm font-medium text-foreground underline underline-offset-4 hover:text-muted-foreground", children: [t("mcpIntegrations.viewSetup"), _jsx(IconExternalLink, { className: "size-3.5" })] })) : null] })), !selected && (_jsxs("div", { className: "flex items-center justify-between gap-3 rounded-md bg-muted/30 px-3 py-2 text-[11px]", children: [_jsx("span", { className: "text-muted-foreground", children: customAuthMode === "oauth"
|
|
511
|
+
? t(
|
|
512
|
+
/* i18n-key-ignore */
|
|
513
|
+
"mcpIntegrations.customOAuthDefault", { defaultValue: "Sign in with OAuth" })
|
|
514
|
+
: t(
|
|
515
|
+
/* i18n-key-ignore */
|
|
516
|
+
"mcpIntegrations.customHeadersMode", { defaultValue: "Use an API key" }) }), _jsx("button", { type: "button", onClick: () => {
|
|
517
|
+
setCustomAuthMode((current) => current === "oauth" ? "headers" : "oauth");
|
|
518
|
+
clearFeedback();
|
|
519
|
+
}, className: "font-medium text-foreground underline underline-offset-2 hover:text-muted-foreground", children: customAuthMode === "oauth"
|
|
520
|
+
? t(
|
|
521
|
+
/* i18n-key-ignore */
|
|
522
|
+
"mcpIntegrations.useApiKeyInstead", { defaultValue: "Use an API key instead" })
|
|
523
|
+
: t(
|
|
524
|
+
/* i18n-key-ignore */
|
|
525
|
+
"mcpIntegrations.useOAuthInstead", { defaultValue: "Use OAuth instead" }) })] })), !selectedRequiresSetup && (_jsxs(_Fragment, { children: [selected?.authMode === "oauth" && (_jsx("div", { className: "rounded-md border border-primary/20 bg-primary/5 px-3 py-2 text-[11px] leading-relaxed text-primary", children: t("mcpIntegrations.oauthNotice") })), _jsxs("label", { className: "block", children: [_jsx("span", { className: "mb-1 block text-[10px] font-medium text-muted-foreground", children: t("mcpIntegrations.serverName") }), _jsx("input", { ref: inputRef, value: name, onChange: (event) => {
|
|
526
|
+
setName(event.target.value);
|
|
527
|
+
clearFeedback();
|
|
528
|
+
}, 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", placeholder: t("mcpIntegrations.serverNamePlaceholder") })] }), _jsxs("label", { className: "block", children: [_jsx("span", { className: "mb-1 block text-[10px] font-medium text-muted-foreground", children: t("mcpIntegrations.url") }), _jsx("input", { value: url, onChange: (event) => {
|
|
529
|
+
setUrl(event.target.value);
|
|
530
|
+
clearFeedback();
|
|
531
|
+
}, 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", placeholder: t("mcpIntegrations.urlPlaceholder") })] }), _jsxs("label", { className: "block", children: [_jsx("span", { className: "mb-1 block text-[10px] font-medium text-muted-foreground", children: t("mcpIntegrations.fieldDescription") }), _jsx("input", { value: description, onChange: (event) => {
|
|
532
|
+
setDescription(event.target.value);
|
|
533
|
+
clearFeedback();
|
|
534
|
+
}, 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", placeholder: t("mcpIntegrations.descriptionPlaceholder") })] }), (selected
|
|
535
|
+
? selected.authMode !== "oauth"
|
|
536
|
+
: customAuthMode === "headers") && (_jsxs("label", { className: "block", children: [_jsx("span", { className: "mb-1 block text-[10px] font-medium text-muted-foreground", children: t("mcpIntegrations.headers") }), _jsx("textarea", { value: headersText, onChange: (event) => {
|
|
537
|
+
setHeadersText(event.target.value);
|
|
538
|
+
clearFeedback();
|
|
539
|
+
}, rows: 3, 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", style: {
|
|
540
|
+
fontFamily: 'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace',
|
|
541
|
+
}, placeholder: selected?.headerPlaceholder ??
|
|
542
|
+
t("mcpIntegrations.headersPlaceholder") })] })), selected?.docsUrl && (_jsxs("a", { href: selected.docsUrl, target: "_blank", rel: "noopener noreferrer", className: "inline-flex items-center gap-1 text-[11px] text-muted-foreground underline hover:text-foreground", children: [t("mcpIntegrations.openSetupDocs"), _jsx(IconExternalLink, { className: "h-3 w-3" })] }))] })), testResult && (_jsxs("div", { className: cn("flex items-start gap-1 rounded-md px-3 py-2 text-[11px] leading-snug", testResult.ok
|
|
543
|
+
? "bg-green-500/5 text-green-600 dark:text-green-400"
|
|
544
|
+
: "bg-red-500/5 text-red-600 dark:text-red-400"), children: [testResult.ok && (_jsx(IconCheck, { className: "mt-0.5 h-3 w-3 shrink-0" })), _jsx("span", { className: "min-w-0 break-words", children: testResult.message })] })), error && (_jsx("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", children: error }))] }) }), _jsxs("div", { className: "flex shrink-0 items-center justify-between gap-2 border-t border-border px-7 py-4", children: [!selectedRequiresSetup && (_jsx("button", { type: "button", onClick: runTest, disabled: !url.trim() || busy, 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", children: t("mcpIntegrations.test") })), !selected && customAuthMode === "oauth" ? (_jsxs("button", { type: "button", onClick: connectCustomWithOAuth, disabled: !name.trim() || !url.trim() || busy, "aria-busy": busy, 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", children: [busy && (_jsx(IconLoader2, { className: "me-1.5 inline h-3.5 w-3.5 animate-spin" })), t("mcpIntegrations.connectWithOAuth")] })) : null, selectedRequiresSetup ? (_jsxs("div", { className: "ms-auto flex items-center gap-2", children: [selected?.docsUrl ? (_jsxs("a", { href: selected.docsUrl, target: "_blank", rel: "noopener noreferrer", className: "inline-flex min-w-[92px] items-center justify-center gap-1.5 rounded-md border border-border bg-background px-3 py-1.5 text-[12px] font-medium text-foreground hover:bg-accent", children: [t("mcpIntegrations.viewSetup"), _jsx(IconExternalLink, { className: "h-3 w-3" })] })) : null, selected?.authMode === "oauth" && (_jsxs("button", { type: "button", onClick: () => connectWithOAuth(selected), disabled: busy, "aria-busy": busy, className: "inline-flex min-w-[132px] 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", children: [busy && (_jsx(IconLoader2, { className: "h-3.5 w-3.5 animate-spin" })), t("mcpIntegrations.continueToConnect")] }))] })) : selected?.authMode === "oauth" ? (_jsxs("button", { type: "button", onClick: () => connectWithOAuth(selected), disabled: !name.trim() || !url.trim() || busy, "aria-busy": busy, 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", children: [busy && _jsx(IconLoader2, { className: "h-3.5 w-3.5 animate-spin" }), t("mcpIntegrations.connectWithOAuth")] })) : !selected && customAuthMode === "oauth" ? null : (_jsxs("button", { type: "button", onClick: submitForm, disabled: !name.trim() || !url.trim() || busy, 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", children: [busy && _jsx(IconLoader2, { className: "h-3.5 w-3.5 animate-spin" }), t("mcpIntegrations.connect")] }))] })] }))] }) }));
|
|
476
545
|
}
|
|
@@ -71,6 +71,7 @@ export declare function buildMcpOAuthStartUrl({ name, url, description, scope, r
|
|
|
71
71
|
export declare function navigateToMcpOAuthStart(url: string): void;
|
|
72
72
|
export declare function resolveMcpIntegrationScope(defaultScope: "user" | "org", hasOrg: boolean, canCreateOrgMcp: boolean, supportsOrganizationScope?: boolean): "user" | "org";
|
|
73
73
|
export declare function shouldOfferMcpOrganizationScope(hasOrg: boolean, canCreateOrgMcp: boolean): boolean;
|
|
74
|
+
export declare function supportsMcpIntegrationOrganizationScope(integration: DefaultMcpIntegration): boolean;
|
|
74
75
|
export declare function shouldOfferMcpIntegrationOrganizationScope(integration: DefaultMcpIntegration, hasOrg: boolean, canCreateOrgMcp: boolean): boolean;
|
|
75
76
|
export declare function filterMcpIntegrations(query: string, integrations?: DefaultMcpIntegration[]): DefaultMcpIntegration[];
|
|
76
77
|
export declare function findMcpIntegrationForText(text: string, integrations?: DefaultMcpIntegration[]): DefaultMcpIntegration | null;
|
|
@@ -863,10 +863,13 @@ export function resolveMcpIntegrationScope(defaultScope, hasOrg, canCreateOrgMcp
|
|
|
863
863
|
export function shouldOfferMcpOrganizationScope(hasOrg, canCreateOrgMcp) {
|
|
864
864
|
return hasOrg && canCreateOrgMcp;
|
|
865
865
|
}
|
|
866
|
+
export function supportsMcpIntegrationOrganizationScope(integration) {
|
|
867
|
+
return (integration.supportsOrganizationScope === true &&
|
|
868
|
+
integration.managedOAuth !== true);
|
|
869
|
+
}
|
|
866
870
|
export function shouldOfferMcpIntegrationOrganizationScope(integration, hasOrg, canCreateOrgMcp) {
|
|
867
871
|
return (shouldOfferMcpOrganizationScope(hasOrg, canCreateOrgMcp) &&
|
|
868
|
-
integration
|
|
869
|
-
integration.managedOAuth !== true);
|
|
872
|
+
supportsMcpIntegrationOrganizationScope(integration));
|
|
870
873
|
}
|
|
871
874
|
export function filterMcpIntegrations(query, integrations = getDefaultMcpIntegrations()) {
|
|
872
875
|
const needle = query.trim().toLowerCase();
|
|
@@ -62,11 +62,11 @@ export declare const postAwareness: import("h3").EventHandlerWithFetch<import("h
|
|
|
62
62
|
error: string;
|
|
63
63
|
states?: undefined;
|
|
64
64
|
} | {
|
|
65
|
+
error?: undefined;
|
|
65
66
|
states: {
|
|
66
67
|
clientId: number;
|
|
67
68
|
state: string;
|
|
68
69
|
}[];
|
|
69
|
-
error?: undefined;
|
|
70
70
|
}>>;
|
|
71
71
|
/**
|
|
72
72
|
* GET /_agent-native/collab/:docId/users
|
|
@@ -77,9 +77,9 @@ export declare const getActiveUsers: import("h3").EventHandlerWithFetch<import("
|
|
|
77
77
|
error: string;
|
|
78
78
|
users?: undefined;
|
|
79
79
|
} | {
|
|
80
|
+
error?: undefined;
|
|
80
81
|
users: {
|
|
81
82
|
clientId: number;
|
|
82
83
|
lastSeen: number;
|
|
83
84
|
}[];
|
|
84
|
-
error?: undefined;
|
|
85
85
|
}>>;
|
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;
|
|
@@ -1014,6 +1014,15 @@ declare const messages: {
|
|
|
1014
1014
|
personal: string;
|
|
1015
1015
|
organization: string;
|
|
1016
1016
|
scopeQuestion: string;
|
|
1017
|
+
scopeChoiceTitle: string;
|
|
1018
|
+
scopeChoiceDescription: string;
|
|
1019
|
+
connectForMe: string;
|
|
1020
|
+
setUpForWorkspace: string;
|
|
1021
|
+
workspaceAdminRequired: string;
|
|
1022
|
+
personalOnlyDescription: string;
|
|
1023
|
+
loadingScopeMetadata: string;
|
|
1024
|
+
retry: string;
|
|
1025
|
+
retrying: string;
|
|
1017
1026
|
personalDescription: string;
|
|
1018
1027
|
sharedWithWorkspace: string;
|
|
1019
1028
|
organizationDescription: string;
|
|
@@ -1020,6 +1020,15 @@ const messages = {
|
|
|
1020
1020
|
personal: "Personal",
|
|
1021
1021
|
organization: "Organization",
|
|
1022
1022
|
scopeQuestion: "Who should be able to use this connection?",
|
|
1023
|
+
scopeChoiceTitle: "Who should use this?",
|
|
1024
|
+
scopeChoiceDescription: "Choose where this connection is available.",
|
|
1025
|
+
connectForMe: "Connect for me",
|
|
1026
|
+
setUpForWorkspace: "Set up for workspace",
|
|
1027
|
+
workspaceAdminRequired: "Workspace owner or admin required.",
|
|
1028
|
+
personalOnlyDescription: "Only personal connections are supported for this integration.",
|
|
1029
|
+
loadingScopeMetadata: "Loading connection scope…",
|
|
1030
|
+
retry: "Retry",
|
|
1031
|
+
retrying: "Retrying…",
|
|
1023
1032
|
personalDescription: "Only you can use this connection.",
|
|
1024
1033
|
sharedWithWorkspace: "Shared with workspace",
|
|
1025
1034
|
organizationDescription: "Permitted workspace members can use this connection. Provider permissions still apply.",
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
* DELETE /_agent-native/notifications/:id — delete
|
|
12
12
|
*/
|
|
13
13
|
export declare function createNotificationsHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<"" | import("./types.js").Notification[] | {
|
|
14
|
+
error?: undefined;
|
|
14
15
|
count: number;
|
|
15
16
|
updated?: undefined;
|
|
16
|
-
error?: undefined;
|
|
17
17
|
ok?: undefined;
|
|
18
18
|
} | {
|
|
19
|
+
error?: undefined;
|
|
19
20
|
count?: undefined;
|
|
20
21
|
updated: number;
|
|
21
|
-
error?: undefined;
|
|
22
22
|
ok?: undefined;
|
|
23
23
|
} | {
|
|
24
24
|
count?: undefined;
|
|
@@ -26,8 +26,8 @@ export declare function createNotificationsHandler(): import("h3").EventHandlerW
|
|
|
26
26
|
error: string;
|
|
27
27
|
ok?: undefined;
|
|
28
28
|
} | {
|
|
29
|
+
error?: undefined;
|
|
29
30
|
count?: undefined;
|
|
30
31
|
updated?: undefined;
|
|
31
32
|
ok: boolean;
|
|
32
|
-
error?: undefined;
|
|
33
33
|
}>>;
|
|
@@ -41,23 +41,23 @@ export declare function createObservabilityHandler(): import("h3").EventHandlerW
|
|
|
41
41
|
thumbsUpRate: number;
|
|
42
42
|
avgEvalScore: number;
|
|
43
43
|
} | {
|
|
44
|
-
ok?: undefined;
|
|
45
44
|
error?: undefined;
|
|
46
45
|
summary: import("./types.js").TraceSummary;
|
|
47
46
|
spans: import("./types.js").TraceSpan[];
|
|
48
47
|
id?: undefined;
|
|
49
|
-
} | {
|
|
50
48
|
ok?: undefined;
|
|
49
|
+
} | {
|
|
51
50
|
error?: undefined;
|
|
52
51
|
summary?: undefined;
|
|
53
52
|
spans?: undefined;
|
|
54
53
|
id: string;
|
|
55
|
-
} | {
|
|
56
54
|
ok?: undefined;
|
|
55
|
+
} | {
|
|
57
56
|
summary?: undefined;
|
|
58
57
|
spans?: undefined;
|
|
59
58
|
id?: undefined;
|
|
60
59
|
error: any;
|
|
60
|
+
ok?: undefined;
|
|
61
61
|
} | {
|
|
62
62
|
error?: undefined;
|
|
63
63
|
summary?: undefined;
|
|
@@ -51,8 +51,8 @@ export declare function handleDeleteResource(event: any): Promise<{
|
|
|
51
51
|
error: string;
|
|
52
52
|
ok?: undefined;
|
|
53
53
|
} | {
|
|
54
|
-
ok: boolean;
|
|
55
54
|
error?: undefined;
|
|
55
|
+
ok: boolean;
|
|
56
56
|
}>;
|
|
57
57
|
/** POST /_agent-native/resources/upload — upload a file as a resource */
|
|
58
58
|
export declare function handleUploadResource(event: any): Promise<import("./store.js").Resource | {
|
|
@@ -73,10 +73,10 @@ export declare function handleUploadResource(event: any): Promise<import("./stor
|
|
|
73
73
|
runId: string | null;
|
|
74
74
|
expiresAt: number | null;
|
|
75
75
|
metadata: string | null;
|
|
76
|
+
error?: undefined;
|
|
76
77
|
url: string;
|
|
77
78
|
provider: string;
|
|
78
79
|
storageSetupRequired?: undefined;
|
|
79
|
-
error?: undefined;
|
|
80
80
|
} | {
|
|
81
81
|
error: string;
|
|
82
82
|
storageSetupRequired: boolean;
|
|
@@ -27,10 +27,10 @@ export declare function resolveAgentEngineApiKeyWriteTarget(event: H3Event, scop
|
|
|
27
27
|
export declare function createAgentEngineApiKeyHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
28
28
|
error: any;
|
|
29
29
|
} | {
|
|
30
|
+
error?: undefined;
|
|
30
31
|
ok: boolean;
|
|
31
32
|
key: string;
|
|
32
33
|
baseUrlKey?: string;
|
|
33
34
|
scope: AgentEngineApiKeyScope;
|
|
34
|
-
error?: undefined;
|
|
35
35
|
}>>;
|
|
36
36
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.168.
|
|
3
|
+
"version": "0.168.1",
|
|
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": {
|