diff --git a/packages/core/sdk/src/client.ts b/packages/core/sdk/src/client.ts index 4f9e2269f..d52cec093 100644 --- a/packages/core/sdk/src/client.ts +++ b/packages/core/sdk/src/client.ts @@ -122,9 +122,6 @@ export interface SourcePlugin { readonly variant?: "badge" | "panel"; readonly onAction?: () => void; }>; - readonly signIn?: ComponentType<{ - readonly sourceId: string; - }>; readonly presets?: readonly SourcePreset[]; /** Trigger early download of the plugin's lazy component chunks (add/edit/etc.). * Call from the host on intent (hover/focus) so the chunks land before the diff --git a/packages/plugins/google-discovery/src/react/EditGoogleDiscoverySource.tsx b/packages/plugins/google-discovery/src/react/EditGoogleDiscoverySource.tsx index 8ff9f5db5..04c50d8ac 100644 --- a/packages/plugins/google-discovery/src/react/EditGoogleDiscoverySource.tsx +++ b/packages/plugins/google-discovery/src/react/EditGoogleDiscoverySource.tsx @@ -5,6 +5,7 @@ import { Badge } from "@executor-js/react/components/badge"; import { Button } from "@executor-js/react/components/button"; import { googleDiscoverySourceAtom } from "./atoms"; +import GoogleDiscoverySignInButton from "./GoogleDiscoverySignInButton"; export default function EditGoogleDiscoverySource({ sourceId, @@ -63,9 +64,12 @@ export default function EditGoogleDiscoverySource({
Authentication
-- {authKind === "oauth2" ? "OAuth 2.0" : authKind} -
++ {authKind === "oauth2" ? "OAuth 2.0" : authKind} +
+ {authKind === "oauth2" &&{error}
diff --git a/packages/plugins/graphql/src/react/GraphqlSourceFields.tsx b/packages/plugins/graphql/src/react/GraphqlSourceFields.tsx new file mode 100644 index 000000000..9cffb193e --- /dev/null +++ b/packages/plugins/graphql/src/react/GraphqlSourceFields.tsx @@ -0,0 +1,42 @@ +import { + CardStack, + CardStackContent, + CardStackEntryField, +} from "@executor-js/react/components/card-stack"; +import { Input } from "@executor-js/react/components/input"; +import { + SourceIdentityFieldRows, + type SourceIdentity, +} from "@executor-js/react/plugins/source-identity"; + +export function GraphqlSourceFields(props: { + readonly endpoint: string; + readonly onEndpointChange: (endpoint: string) => void; + readonly identity: SourceIdentity; + readonly endpointDisabled?: boolean; + readonly namespaceReadOnly?: boolean; +}) { + return ( +{error}
diff --git a/packages/plugins/mcp/src/react/McpRemoteSourceFields.tsx b/packages/plugins/mcp/src/react/McpRemoteSourceFields.tsx new file mode 100644 index 000000000..81e930743 --- /dev/null +++ b/packages/plugins/mcp/src/react/McpRemoteSourceFields.tsx @@ -0,0 +1,163 @@ +import { Badge } from "@executor-js/react/components/badge"; +import { + CardStack, + CardStackContent, + CardStackEntry, + CardStackEntryActions, + CardStackEntryContent, + CardStackEntryDescription, + CardStackEntryField, + CardStackEntryMedia, + CardStackEntryTitle, +} from "@executor-js/react/components/card-stack"; +import { FieldError } from "@executor-js/react/components/field"; +import { Input } from "@executor-js/react/components/input"; +import { Skeleton } from "@executor-js/react/components/skeleton"; +import { SourceFavicon } from "@executor-js/react/components/source-favicon"; +import { IOSSpinner } from "@executor-js/react/components/spinner"; +import { Button } from "@executor-js/react/components/button"; +import { + SourceIdentityFieldRows, + type SourceIdentity, +} from "@executor-js/react/plugins/source-identity"; + +export type McpRemoteSourcePreview = { + readonly name: string; + readonly serverName: string | null; + readonly connected: boolean; + readonly toolCount: number | null; +}; + +export function McpRemoteSourceFields(props: { + readonly url: string; + readonly onUrlChange: (url: string) => void; + readonly identity: SourceIdentity; + readonly preview: McpRemoteSourcePreview | null; + readonly probing?: boolean; + readonly error?: string | null; + readonly onRetry?: () => void; + readonly namespaceReadOnly?: boolean; + readonly urlDisabled?: boolean; +}) { + const previewDescription = props.preview + ? props.preview.connected + ? props.preview.toolCount === null + ? null + : `${props.preview.toolCount} tool${props.preview.toolCount !== 1 ? "s" : ""} available` + : "OAuth required to discover tools" + : null; + + if (props.preview) { + return ( +- A base URL is required to make requests. -
- )} -+ {props.baseUrlMissingMessage} +
+ )} +