@stigmer/react 0.0.83 → 0.0.85
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/demo/fixtures.d.ts +4 -0
- package/demo/fixtures.d.ts.map +1 -1
- package/demo/fixtures.js +4 -0
- package/demo/fixtures.js.map +1 -1
- package/index.d.ts +5 -3
- package/index.d.ts.map +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/library/ResourceListView.d.ts +57 -7
- package/library/ResourceListView.d.ts.map +1 -1
- package/library/ResourceListView.js +147 -37
- package/library/ResourceListView.js.map +1 -1
- package/library/index.d.ts +1 -1
- package/library/index.d.ts.map +1 -1
- package/library/index.js.map +1 -1
- package/mcp-server/McpServerConfigPanel.d.ts +45 -0
- package/mcp-server/McpServerConfigPanel.d.ts.map +1 -1
- package/mcp-server/McpServerConfigPanel.js +90 -14
- package/mcp-server/McpServerConfigPanel.js.map +1 -1
- package/mcp-server/McpServerConnectDialog.d.ts +51 -0
- package/mcp-server/McpServerConnectDialog.d.ts.map +1 -0
- package/mcp-server/McpServerConnectDialog.js +164 -0
- package/mcp-server/McpServerConnectDialog.js.map +1 -0
- package/mcp-server/McpServerDetailView.d.ts.map +1 -1
- package/mcp-server/McpServerDetailView.js +168 -23
- package/mcp-server/McpServerDetailView.js.map +1 -1
- package/mcp-server/McpServerPicker.d.ts.map +1 -1
- package/mcp-server/McpServerPicker.js +9 -3
- package/mcp-server/McpServerPicker.js.map +1 -1
- package/mcp-server/OAuthAppForm.d.ts +58 -0
- package/mcp-server/OAuthAppForm.d.ts.map +1 -0
- package/mcp-server/OAuthAppForm.js +67 -0
- package/mcp-server/OAuthAppForm.js.map +1 -0
- package/mcp-server/index.d.ts +8 -0
- package/mcp-server/index.d.ts.map +1 -1
- package/mcp-server/index.js +4 -0
- package/mcp-server/index.js.map +1 -1
- package/mcp-server/useDisconnectOAuth.d.ts +40 -0
- package/mcp-server/useDisconnectOAuth.d.ts.map +1 -0
- package/mcp-server/useDisconnectOAuth.js +46 -0
- package/mcp-server/useDisconnectOAuth.js.map +1 -0
- package/mcp-server/useMcpServerCredentials.d.ts +48 -0
- package/mcp-server/useMcpServerCredentials.d.ts.map +1 -1
- package/mcp-server/useMcpServerCredentials.js +18 -2
- package/mcp-server/useMcpServerCredentials.js.map +1 -1
- package/mcp-server/useOAuthGrantStatus.d.ts +9 -0
- package/mcp-server/useOAuthGrantStatus.d.ts.map +1 -1
- package/mcp-server/useOAuthGrantStatus.js +6 -1
- package/mcp-server/useOAuthGrantStatus.js.map +1 -1
- package/mcp-server/useOrgOAuthApp.d.ts +82 -0
- package/mcp-server/useOrgOAuthApp.d.ts.map +1 -0
- package/mcp-server/useOrgOAuthApp.js +160 -0
- package/mcp-server/useOrgOAuthApp.js.map +1 -0
- package/oauth-app/CreateOAuthAppForm.d.ts +41 -0
- package/oauth-app/CreateOAuthAppForm.d.ts.map +1 -0
- package/oauth-app/CreateOAuthAppForm.js +140 -0
- package/oauth-app/CreateOAuthAppForm.js.map +1 -0
- package/oauth-app/OAuthAppDetailPanel.d.ts +43 -0
- package/oauth-app/OAuthAppDetailPanel.d.ts.map +1 -0
- package/oauth-app/OAuthAppDetailPanel.js +202 -0
- package/oauth-app/OAuthAppDetailPanel.js.map +1 -0
- package/oauth-app/OAuthAppListPanel.d.ts +43 -0
- package/oauth-app/OAuthAppListPanel.d.ts.map +1 -0
- package/oauth-app/OAuthAppListPanel.js +79 -0
- package/oauth-app/OAuthAppListPanel.js.map +1 -0
- package/oauth-app/index.d.ts +15 -0
- package/oauth-app/index.d.ts.map +1 -0
- package/oauth-app/index.js +8 -0
- package/oauth-app/index.js.map +1 -0
- package/oauth-app/useCreateOAuthApp.d.ts +39 -0
- package/oauth-app/useCreateOAuthApp.d.ts.map +1 -0
- package/oauth-app/useCreateOAuthApp.js +50 -0
- package/oauth-app/useCreateOAuthApp.js.map +1 -0
- package/oauth-app/useDeleteOAuthApp.d.ts +31 -0
- package/oauth-app/useDeleteOAuthApp.d.ts.map +1 -0
- package/oauth-app/useDeleteOAuthApp.js +43 -0
- package/oauth-app/useDeleteOAuthApp.js.map +1 -0
- package/oauth-app/useOAuthAppList.d.ts +32 -0
- package/oauth-app/useOAuthAppList.d.ts.map +1 -0
- package/oauth-app/useOAuthAppList.js +61 -0
- package/oauth-app/useOAuthAppList.js.map +1 -0
- package/oauth-app/useUpdateOAuthApp.d.ts +38 -0
- package/oauth-app/useUpdateOAuthApp.d.ts.map +1 -0
- package/oauth-app/useUpdateOAuthApp.js +49 -0
- package/oauth-app/useUpdateOAuthApp.js.map +1 -0
- package/package.json +4 -4
- package/src/demo/fixtures.ts +8 -0
- package/src/index.ts +25 -0
- package/src/library/ResourceListView.tsx +303 -46
- package/src/library/index.ts +4 -1
- package/src/mcp-server/McpServerConfigPanel.tsx +370 -45
- package/src/mcp-server/McpServerConnectDialog.tsx +527 -0
- package/src/mcp-server/McpServerDetailView.tsx +448 -47
- package/src/mcp-server/McpServerPicker.tsx +10 -3
- package/src/mcp-server/OAuthAppForm.tsx +304 -0
- package/src/mcp-server/index.ts +12 -0
- package/src/mcp-server/useDisconnectOAuth.ts +76 -0
- package/src/mcp-server/useMcpServerCredentials.ts +70 -2
- package/src/mcp-server/useOAuthGrantStatus.ts +19 -1
- package/src/mcp-server/useOrgOAuthApp.ts +250 -0
- package/src/oauth-app/CreateOAuthAppForm.tsx +449 -0
- package/src/oauth-app/OAuthAppDetailPanel.tsx +671 -0
- package/src/oauth-app/OAuthAppListPanel.tsx +237 -0
- package/src/oauth-app/index.ts +14 -0
- package/src/oauth-app/useCreateOAuthApp.ts +70 -0
- package/src/oauth-app/useDeleteOAuthApp.ts +62 -0
- package/src/oauth-app/useOAuthAppList.ts +84 -0
- package/src/oauth-app/useUpdateOAuthApp.ts +69 -0
- package/styles.css +1 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/** Props for {@link OAuthAppForm}. */
|
|
2
|
+
export interface OAuthAppFormProps {
|
|
3
|
+
/**
|
|
4
|
+
* Vendor / provider display name shown in the instruction text.
|
|
5
|
+
* Example: `"Figma"`, `"Slack"`.
|
|
6
|
+
*/
|
|
7
|
+
readonly providerName: string;
|
|
8
|
+
/**
|
|
9
|
+
* URL to the vendor's OAuth app registration page. When provided,
|
|
10
|
+
* a help link is rendered so the user can register their app.
|
|
11
|
+
*/
|
|
12
|
+
readonly vendorDocsUrl?: string | null;
|
|
13
|
+
/**
|
|
14
|
+
* Called when the form is submitted with valid credentials.
|
|
15
|
+
* The parent is responsible for calling the `setOrgOAuthApp` mutation
|
|
16
|
+
* and handling errors.
|
|
17
|
+
*/
|
|
18
|
+
readonly onSubmit: (clientId: string, clientSecret: string) => Promise<void>;
|
|
19
|
+
/** Called when the user cancels the form. */
|
|
20
|
+
readonly onCancel: () => void;
|
|
21
|
+
/** `true` while the submit mutation is in flight. */
|
|
22
|
+
readonly isSubmitting: boolean;
|
|
23
|
+
/** Error from the last failed submit, or `null`. */
|
|
24
|
+
readonly error: Error | null;
|
|
25
|
+
/** Additional CSS classes for the form root. */
|
|
26
|
+
readonly className?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Two-field form for registering an org-level OAuth app override (BYOA).
|
|
30
|
+
*
|
|
31
|
+
* Collects only `client_id` and `client_secret` — all other OAuth
|
|
32
|
+
* configuration (endpoint URLs, scopes) is cloned from the platform's
|
|
33
|
+
* OAuthApp template by the backend.
|
|
34
|
+
*
|
|
35
|
+
* This is a pure presentational component with no dialog wrapper
|
|
36
|
+
* (headless-first). The parent is responsible for rendering it inside
|
|
37
|
+
* a `<dialog>`, modal, sheet, or inline context as needed. Platform
|
|
38
|
+
* builders who want a different container can import just the form.
|
|
39
|
+
*
|
|
40
|
+
* All styling flows through `--stgm-*` design tokens via `cn()`.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```tsx
|
|
44
|
+
* <OAuthAppForm
|
|
45
|
+
* providerName="Figma"
|
|
46
|
+
* vendorDocsUrl="https://www.figma.com/developers/api#oauth2"
|
|
47
|
+
* onSubmit={async (clientId, clientSecret) => {
|
|
48
|
+
* await orgOAuthApp.setOrgOAuthApp(clientId, clientSecret);
|
|
49
|
+
* orgOAuthApp.refetch();
|
|
50
|
+
* }}
|
|
51
|
+
* onCancel={() => setShowForm(false)}
|
|
52
|
+
* isSubmitting={orgOAuthApp.isSetting}
|
|
53
|
+
* error={orgOAuthApp.setError}
|
|
54
|
+
* />
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare function OAuthAppForm({ providerName, vendorDocsUrl, onSubmit, onCancel, isSubmitting, error, className, }: OAuthAppFormProps): import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
//# sourceMappingURL=OAuthAppForm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OAuthAppForm.d.ts","sourceRoot":"","sources":["../../src/mcp-server/OAuthAppForm.tsx"],"names":[],"mappings":"AAMA,sCAAsC;AACtC,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7E,6CAA6C;IAC7C,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;IAC9B,qDAAqD;IACrD,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,oDAAoD;IACpD,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC7B,gDAAgD;IAChD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,YAAY,CAAC,EAC3B,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,KAAK,EACL,SAAS,GACV,EAAE,iBAAiB,2CAuJnB"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useId, useState } from "react";
|
|
4
|
+
import { cn } from "@stigmer/theme";
|
|
5
|
+
import { getUserMessage } from "@stigmer/sdk";
|
|
6
|
+
/**
|
|
7
|
+
* Two-field form for registering an org-level OAuth app override (BYOA).
|
|
8
|
+
*
|
|
9
|
+
* Collects only `client_id` and `client_secret` — all other OAuth
|
|
10
|
+
* configuration (endpoint URLs, scopes) is cloned from the platform's
|
|
11
|
+
* OAuthApp template by the backend.
|
|
12
|
+
*
|
|
13
|
+
* This is a pure presentational component with no dialog wrapper
|
|
14
|
+
* (headless-first). The parent is responsible for rendering it inside
|
|
15
|
+
* a `<dialog>`, modal, sheet, or inline context as needed. Platform
|
|
16
|
+
* builders who want a different container can import just the form.
|
|
17
|
+
*
|
|
18
|
+
* All styling flows through `--stgm-*` design tokens via `cn()`.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <OAuthAppForm
|
|
23
|
+
* providerName="Figma"
|
|
24
|
+
* vendorDocsUrl="https://www.figma.com/developers/api#oauth2"
|
|
25
|
+
* onSubmit={async (clientId, clientSecret) => {
|
|
26
|
+
* await orgOAuthApp.setOrgOAuthApp(clientId, clientSecret);
|
|
27
|
+
* orgOAuthApp.refetch();
|
|
28
|
+
* }}
|
|
29
|
+
* onCancel={() => setShowForm(false)}
|
|
30
|
+
* isSubmitting={orgOAuthApp.isSetting}
|
|
31
|
+
* error={orgOAuthApp.setError}
|
|
32
|
+
* />
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export function OAuthAppForm({ providerName, vendorDocsUrl, onSubmit, onCancel, isSubmitting, error, className, }) {
|
|
36
|
+
const [clientId, setClientId] = useState("");
|
|
37
|
+
const [clientSecret, setClientSecret] = useState("");
|
|
38
|
+
const [secretRevealed, setSecretRevealed] = useState(false);
|
|
39
|
+
const formId = useId();
|
|
40
|
+
const clientIdId = `${formId}-client-id`;
|
|
41
|
+
const clientSecretId = `${formId}-client-secret`;
|
|
42
|
+
const canSubmit = clientId.trim().length > 0 && clientSecret.trim().length > 0;
|
|
43
|
+
const isDisabled = isSubmitting;
|
|
44
|
+
const handleSubmit = useCallback(async (e) => {
|
|
45
|
+
e.preventDefault();
|
|
46
|
+
if (!canSubmit || isDisabled)
|
|
47
|
+
return;
|
|
48
|
+
await onSubmit(clientId.trim(), clientSecret.trim());
|
|
49
|
+
}, [canSubmit, isDisabled, onSubmit, clientId, clientSecret]);
|
|
50
|
+
return (_jsxs("form", { onSubmit: handleSubmit, className: cn("flex flex-col gap-4", className), children: [_jsxs("div", { className: "space-y-1.5", children: [_jsxs("p", { className: "text-sm text-foreground", children: ["Register an OAuth app with", " ", _jsx("span", { className: "font-medium", children: providerName }), " and enter your credentials below."] }), vendorDocsUrl && (_jsxs("a", { href: vendorDocsUrl, target: "_blank", rel: "noopener noreferrer", className: "inline-flex items-center gap-1 text-xs text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary", children: [providerName, " OAuth app registration", _jsx(ExternalLinkIcon, { className: "size-3 shrink-0" })] }))] }), _jsxs("div", { className: "flex flex-col gap-3", children: [_jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("label", { htmlFor: clientIdId, className: "text-xs font-medium text-foreground", children: "Client ID" }), _jsx("input", { id: clientIdId, type: "text", value: clientId, onChange: (e) => setClientId(e.target.value), disabled: isDisabled, required: true, "aria-required": true, autoComplete: "off", autoFocus: true, placeholder: "e.g. 1234567890abcdef", className: cn("w-full rounded-md border border-input bg-background px-2.5 py-1.5 text-xs text-foreground", "placeholder:text-muted-foreground", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", "disabled:pointer-events-none disabled:opacity-50") })] }), _jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("label", { htmlFor: clientSecretId, className: "text-xs font-medium text-foreground", children: "Client Secret" }), _jsxs("div", { className: "relative", children: [_jsx("input", { id: clientSecretId, type: secretRevealed ? "text" : "password", value: clientSecret, onChange: (e) => setClientSecret(e.target.value), disabled: isDisabled, required: true, "aria-required": true, autoComplete: "off", placeholder: "Your client secret", className: cn("w-full rounded-md border border-input bg-background px-2.5 py-1.5 pr-8 text-xs text-foreground", "placeholder:text-muted-foreground", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", "disabled:pointer-events-none disabled:opacity-50") }), _jsx("button", { type: "button", onClick: () => setSecretRevealed((v) => !v), disabled: isDisabled, className: cn("absolute right-2 top-1/2 -translate-y-1/2", "text-muted-foreground hover:text-foreground", "disabled:pointer-events-none disabled:opacity-50"), "aria-label": secretRevealed ? "Hide client secret" : "Show client secret", tabIndex: -1, children: secretRevealed ? _jsx(EyeOffIcon, {}) : _jsx(EyeIcon, {}) })] })] })] }), error && (_jsx("div", { role: "alert", className: "rounded-md border border-destructive/30 bg-destructive/10 px-2.5 py-2 text-xs text-destructive", children: getUserMessage(error) })), _jsxs("div", { className: "flex items-center justify-end gap-2", children: [_jsx("button", { type: "button", onClick: onCancel, disabled: isDisabled, className: cn("rounded-md px-3 py-1.5 text-xs", "text-muted-foreground hover:text-foreground hover:bg-accent/50", "disabled:pointer-events-none disabled:opacity-50"), children: "Cancel" }), _jsxs("button", { type: "submit", disabled: !canSubmit || isDisabled, className: cn("inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium", "bg-primary text-primary-foreground hover:bg-primary/90", "disabled:pointer-events-none disabled:opacity-40"), children: [isSubmitting && _jsx(SpinnerIcon, {}), "Save"] })] })] }));
|
|
51
|
+
}
|
|
52
|
+
// ---------------------------------------------------------------------------
|
|
53
|
+
// Icons (internal to this module — avoids cross-file dependencies)
|
|
54
|
+
// ---------------------------------------------------------------------------
|
|
55
|
+
function ExternalLinkIcon({ className }) {
|
|
56
|
+
return (_jsxs("svg", { className: className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("path", { d: "M6 3.5H3.5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V10" }), _jsx("path", { d: "M9.5 2.5h4v4" }), _jsx("path", { d: "M13.5 2.5 8 8" })] }));
|
|
57
|
+
}
|
|
58
|
+
function EyeIcon() {
|
|
59
|
+
return (_jsxs("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("path", { d: "M1.5 8s2.5-4.5 6.5-4.5S14.5 8 14.5 8s-2.5 4.5-6.5 4.5S1.5 8 1.5 8z" }), _jsx("circle", { cx: "8", cy: "8", r: "2" })] }));
|
|
60
|
+
}
|
|
61
|
+
function EyeOffIcon() {
|
|
62
|
+
return (_jsxs("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("path", { d: "M6.59 6.59a2 2 0 0 0 2.82 2.82" }), _jsx("path", { d: "M10.73 10.73A6.5 6.5 0 0 1 8 12.5c-4 0-6.5-4.5-6.5-4.5a11.5 11.5 0 0 1 3.77-3.73" }), _jsx("path", { d: "M5.71 3.56A6.3 6.3 0 0 1 8 3.5c4 0 6.5 4.5 6.5 4.5a11.5 11.5 0 0 1-1.28 1.73" }), _jsx("path", { d: "M2 2l12 12" })] }));
|
|
63
|
+
}
|
|
64
|
+
function SpinnerIcon() {
|
|
65
|
+
return (_jsx("svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", className: "animate-spin", "aria-hidden": "true", children: _jsx("path", { d: "M8 2a6 6 0 1 0 6 6" }) }));
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=OAuthAppForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OAuthAppForm.js","sourceRoot":"","sources":["../../src/mcp-server/OAuthAppForm.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AA8B9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,UAAU,YAAY,CAAC,EAC3B,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,KAAK,EACL,SAAS,GACS;IAClB,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC7C,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACrD,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE5D,MAAM,MAAM,GAAG,KAAK,EAAE,CAAC;IACvB,MAAM,UAAU,GAAG,GAAG,MAAM,YAAY,CAAC;IACzC,MAAM,cAAc,GAAG,GAAG,MAAM,gBAAgB,CAAC;IAEjD,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,IAAI,YAAY,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;IAC/E,MAAM,UAAU,GAAG,YAAY,CAAC;IAEhC,MAAM,YAAY,GAAG,WAAW,CAC9B,KAAK,EAAE,CAAkB,EAAE,EAAE;QAC3B,C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Aa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,iBACV,MAAM,aAElB,eAAM,CAAC,EAAC,gCAAgC,GAAG,EAC3C,eAAM,CAAC,EAAC,kFAAkF,GAAG,EAC7F,eAAM,CAAC,EAAC,8EAA8E,GAAG,EACzF,eAAM,CAAC,EAAC,YAAY,GAAG,IACnB,CACP,CAAC;AACJ,CAAC;AAED,SAAS,WAAW;IAClB,OAAO,CACL,cACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,GAAG,EACf,aAAa,EAAC,OAAO,EACrB,SAAS,EAAC,cAAc,iBACZ,MAAM,YAElB,eAAM,CAAC,EAAC,oBAAoB,GAAG,GAC3B,CACP,CAAC;AACJ,CAAC"}
|
package/mcp-server/index.d.ts
CHANGED
|
@@ -8,6 +8,12 @@ export { useMcpServer } from "./useMcpServer";
|
|
|
8
8
|
export type { UseMcpServerReturn } from "./useMcpServer";
|
|
9
9
|
export { useOAuthGrantStatus } from "./useOAuthGrantStatus";
|
|
10
10
|
export type { UseOAuthGrantStatusReturn } from "./useOAuthGrantStatus";
|
|
11
|
+
export { useDisconnectOAuth } from "./useDisconnectOAuth";
|
|
12
|
+
export type { UseDisconnectOAuthReturn } from "./useDisconnectOAuth";
|
|
13
|
+
export { useOrgOAuthApp } from "./useOrgOAuthApp";
|
|
14
|
+
export type { UseOrgOAuthAppReturn } from "./useOrgOAuthApp";
|
|
15
|
+
export { OAuthAppForm } from "./OAuthAppForm";
|
|
16
|
+
export type { OAuthAppFormProps } from "./OAuthAppForm";
|
|
11
17
|
export { McpServerPicker } from "./McpServerPicker";
|
|
12
18
|
export type { McpServerPickerProps, McpServerSetupIntegration, } from "./McpServerPicker";
|
|
13
19
|
export { McpToolSelector } from "./McpToolSelector";
|
|
@@ -26,4 +32,6 @@ export { OAuthCallbackHandler } from "./OAuthCallbackHandler";
|
|
|
26
32
|
export type { OAuthCallbackHandlerProps, OAuthCallbackParams, } from "./OAuthCallbackHandler";
|
|
27
33
|
export { useMcpServerCredentials } from "./useMcpServerCredentials";
|
|
28
34
|
export type { UseMcpServerCredentialsReturn, McpServerAuthMode, } from "./useMcpServerCredentials";
|
|
35
|
+
export { McpServerConnectDialog } from "./McpServerConnectDialog";
|
|
36
|
+
export type { McpServerConnectDialogProps } from "./McpServerConnectDialog";
|
|
29
37
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp-server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EACV,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EACV,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EACV,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAEvE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EACV,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EA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Y,EACV,wBAAwB,EACxB,aAAa,GACd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAEvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,YAAY,EACV,8BAA8B,EAC9B,iBAAiB,GAClB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,YAAY,EACV,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,YAAY,EACV,6BAA6B,EAC7B,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,YAAY,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC"}
|
package/mcp-server/index.js
CHANGED
|
@@ -3,6 +3,9 @@ export { useMcpServerCount } from "./useMcpServerCount";
|
|
|
3
3
|
export { useMcpServerSearch } from "./useMcpServerSearch";
|
|
4
4
|
export { useMcpServer } from "./useMcpServer";
|
|
5
5
|
export { useOAuthGrantStatus } from "./useOAuthGrantStatus";
|
|
6
|
+
export { useDisconnectOAuth } from "./useDisconnectOAuth";
|
|
7
|
+
export { useOrgOAuthApp } from "./useOrgOAuthApp";
|
|
8
|
+
export { OAuthAppForm } from "./OAuthAppForm";
|
|
6
9
|
export { McpServerPicker } from "./McpServerPicker";
|
|
7
10
|
export { McpToolSelector } from "./McpToolSelector";
|
|
8
11
|
export { McpServerConfigPanel } from "./McpServerConfigPanel";
|
|
@@ -12,4 +15,5 @@ export { useMcpServerConnect } from "./useMcpServerConnect";
|
|
|
12
15
|
export { useMcpServerOAuthConnect } from "./useMcpServerOAuthConnect";
|
|
13
16
|
export { OAuthCallbackHandler } from "./OAuthCallbackHandler";
|
|
14
17
|
export { useMcpServerCredentials } from "./useMcpServerCredentials";
|
|
18
|
+
export { McpServerConnectDialog } from "./McpServerConnectDialog";
|
|
15
19
|
//# sourceMappingURL=index.js.map
|
package/mcp-server/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mcp-server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAMtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAMxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAM1D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAMpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAO9D,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AASrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAM5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAMtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAM9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mcp-server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAMtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAMxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAM1D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAMpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAO9D,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AASrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAM5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAMtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAM9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAMpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** Return value of {@link useDisconnectOAuth}. */
|
|
2
|
+
export interface UseDisconnectOAuthReturn {
|
|
3
|
+
/**
|
|
4
|
+
* Disconnect the current user's OAuth grant for an MCP server.
|
|
5
|
+
*
|
|
6
|
+
* Deletes the managed environment (secrets first) and then the grant
|
|
7
|
+
* document. The operation is idempotent — disconnecting when no grant
|
|
8
|
+
* exists returns `false` without error.
|
|
9
|
+
*
|
|
10
|
+
* Resolves with `true` when a grant was removed, `false` when no
|
|
11
|
+
* grant existed. Callers should `refetch()` grant status and
|
|
12
|
+
* credentials after a successful disconnect.
|
|
13
|
+
*/
|
|
14
|
+
readonly disconnect: (resourceId: string, org: string) => Promise<boolean>;
|
|
15
|
+
/** `true` while the disconnect request is in flight. */
|
|
16
|
+
readonly isDisconnecting: boolean;
|
|
17
|
+
/** Error from the last failed disconnect, or `null` when healthy. */
|
|
18
|
+
readonly error: Error | null;
|
|
19
|
+
/** Reset `error` to `null`. */
|
|
20
|
+
readonly clearError: () => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Behavior hook that wraps `mcpServer.disconnectOAuth()` with loading
|
|
24
|
+
* and error state.
|
|
25
|
+
*
|
|
26
|
+
* Removes the user's OAuth grant and associated managed environment
|
|
27
|
+
* for a given MCP server resource. After a successful disconnect the
|
|
28
|
+
* UI should revert to the "Not connected" state — call `refetch()` on
|
|
29
|
+
* the credentials / grant status hooks to reflect the change.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* const { disconnect, isDisconnecting, error } = useDisconnectOAuth();
|
|
34
|
+
*
|
|
35
|
+
* await disconnect(mcpServerId, org);
|
|
36
|
+
* credentials.refetch(); // refresh grant status + env
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare function useDisconnectOAuth(): UseDisconnectOAuthReturn;
|
|
40
|
+
//# sourceMappingURL=useDisconnectOAuth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDisconnectOAuth.d.ts","sourceRoot":"","sources":["../../src/mcp-server/useDisconnectOAuth.ts"],"names":[],"mappings":"AAQA,kDAAkD;AAClD,MAAM,WAAW,wBAAwB;IACvC;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,UAAU,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3E,wDAAwD;IACxD,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC,qEAAqE;IACrE,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC7B,+BAA+B;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,IAAI,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,IAAI,wBAAwB,CA4B7D"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useState } from "react";
|
|
3
|
+
import { create } from "@bufbuild/protobuf";
|
|
4
|
+
import { DisconnectOAuthInputSchema } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/io_pb";
|
|
5
|
+
import { useStigmer } from "../hooks";
|
|
6
|
+
import { toError } from "../internal/toError";
|
|
7
|
+
/**
|
|
8
|
+
* Behavior hook that wraps `mcpServer.disconnectOAuth()` with loading
|
|
9
|
+
* and error state.
|
|
10
|
+
*
|
|
11
|
+
* Removes the user's OAuth grant and associated managed environment
|
|
12
|
+
* for a given MCP server resource. After a successful disconnect the
|
|
13
|
+
* UI should revert to the "Not connected" state — call `refetch()` on
|
|
14
|
+
* the credentials / grant status hooks to reflect the change.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* const { disconnect, isDisconnecting, error } = useDisconnectOAuth();
|
|
19
|
+
*
|
|
20
|
+
* await disconnect(mcpServerId, org);
|
|
21
|
+
* credentials.refetch(); // refresh grant status + env
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export function useDisconnectOAuth() {
|
|
25
|
+
const stigmer = useStigmer();
|
|
26
|
+
const [isDisconnecting, setIsDisconnecting] = useState(false);
|
|
27
|
+
const [error, setError] = useState(null);
|
|
28
|
+
const clearError = useCallback(() => setError(null), []);
|
|
29
|
+
const disconnect = useCallback(async (resourceId, org) => {
|
|
30
|
+
setIsDisconnecting(true);
|
|
31
|
+
setError(null);
|
|
32
|
+
try {
|
|
33
|
+
const result = await stigmer.mcpServer.disconnectOAuth(create(DisconnectOAuthInputSchema, { resourceId, org }));
|
|
34
|
+
return result.disconnected;
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
setError(toError(err));
|
|
38
|
+
throw err;
|
|
39
|
+
}
|
|
40
|
+
finally {
|
|
41
|
+
setIsDisconnecting(false);
|
|
42
|
+
}
|
|
43
|
+
}, [stigmer]);
|
|
44
|
+
return { disconnect, isDisconnecting, error, clearError };
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=useDisconnectOAuth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDisconnectOAuth.js","sourceRoot":"","sources":["../../src/mcp-server/useDisconnectOAuth.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,0BAA0B,EAAE,MAAM,uDAAuD,CAAC;AACnG,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAwB9C;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9D,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAe,IAAI,CAAC,CAAC;IAEvD,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAEzD,MAAM,UAAU,GAAG,WAAW,CAC5B,KAAK,EAAE,UAAkB,EAAE,GAAW,EAAoB,EAAE;QAC1D,kBAAkB,CAAC,IAAI,CAAC,CAAC;QACzB,QAAQ,CAAC,IAAI,CAAC,CAAC;QAEf,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,SAAS,CAAC,eAAe,CACpD,MAAM,CAAC,0BAA0B,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,CACxD,CAAC;YACF,OAAO,MAAM,CAAC,YAAY,CAAC;QAC7B,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;YACvB,MAAM,GAAG,CAAC;QACZ,CAAC;gBAAS,CAAC;YACT,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AAC5D,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { EnvVarInput } from "@stigmer/sdk";
|
|
2
2
|
import type { McpServer } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/api_pb";
|
|
3
|
+
import { OAuthConnectionHealth } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/io_pb";
|
|
4
|
+
import { OAuthAppSource } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/status_pb";
|
|
3
5
|
import type { EnvVarFormVariable } from "../environment/EnvVarForm";
|
|
4
6
|
/**
|
|
5
7
|
* Credential acquisition mode for an MCP server.
|
|
@@ -31,6 +33,20 @@ export interface UseMcpServerCredentialsReturn {
|
|
|
31
33
|
* environment key presence. Always `false` when `authMode` is `"manual"`.
|
|
32
34
|
*/
|
|
33
35
|
readonly isOAuthConnected: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Health of the OAuth connection for this server.
|
|
38
|
+
*
|
|
39
|
+
* Provides a four-state signal beyond the binary `isOAuthConnected`:
|
|
40
|
+
* healthy, expired-but-refreshable, expired (re-auth needed), or no
|
|
41
|
+
* grant. `UNSPECIFIED` when `authMode` is `"manual"` or the status
|
|
42
|
+
* has not been fetched yet.
|
|
43
|
+
*/
|
|
44
|
+
readonly connectionHealth: OAuthConnectionHealth;
|
|
45
|
+
/**
|
|
46
|
+
* `true` when the user can disconnect (i.e., an OAuth grant exists).
|
|
47
|
+
* Always `false` when `authMode` is `"manual"` or no grant is present.
|
|
48
|
+
*/
|
|
49
|
+
readonly canDisconnect: boolean;
|
|
34
50
|
/**
|
|
35
51
|
* When the OAuth access token expires (Unix timestamp seconds).
|
|
36
52
|
* `BigInt(0)` when no grant exists, `authMode` is `"manual"`, or the token
|
|
@@ -93,6 +109,38 @@ export interface UseMcpServerCredentialsReturn {
|
|
|
93
109
|
* `null` when no documentation link is available.
|
|
94
110
|
*/
|
|
95
111
|
readonly vendorApprovalDocsUrl: string | null;
|
|
112
|
+
/**
|
|
113
|
+
* `true` when the platform OAuth app's vendor approval is PENDING or
|
|
114
|
+
* REJECTED — i.e., the platform sign-in flow is blocked. Covers both
|
|
115
|
+
* statuses since the user-facing behavior is the same: sign-in is
|
|
116
|
+
* disabled and BYOA / manual entry are the available alternatives.
|
|
117
|
+
*
|
|
118
|
+
* See also {@link isVendorApprovalPending} which only checks PENDING.
|
|
119
|
+
*/
|
|
120
|
+
readonly isVendorApprovalBlocked: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Where the effective OAuth app was resolved from for the caller's org.
|
|
123
|
+
*
|
|
124
|
+
* Enriched at query time by the backend — no additional RPC needed.
|
|
125
|
+
* `UNSPECIFIED` when `authMode` is `"manual"` or enrichment has not
|
|
126
|
+
* been performed yet.
|
|
127
|
+
*/
|
|
128
|
+
readonly effectiveOAuthSource: OAuthAppSource;
|
|
129
|
+
/**
|
|
130
|
+
* `true` when an org-level BYOA override is active for this server.
|
|
131
|
+
* Derived from `effectiveOAuthSource === OAUTH_APP_SOURCE_ORG_OVERRIDE`.
|
|
132
|
+
*/
|
|
133
|
+
readonly isOrgOAuthApp: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* `true` when the BYOA option is relevant for this server: the server
|
|
136
|
+
* uses vendor OAuth (`authMode === "oauth"` with an `oauth_app_ref`)
|
|
137
|
+
* and no org override is currently active.
|
|
138
|
+
*
|
|
139
|
+
* When `true`, the UI should offer "Use your own OAuth app" as either
|
|
140
|
+
* a primary action (when vendor approval is blocked) or a secondary
|
|
141
|
+
* link (when vendor approval is granted).
|
|
142
|
+
*/
|
|
143
|
+
readonly canBringOwnApp: boolean;
|
|
96
144
|
/**
|
|
97
145
|
* When `true`, the user has opted to bypass OAuth and enter the
|
|
98
146
|
* `target_env_var` token manually. In this state:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMcpServerCredentials.d.ts","sourceRoot":"","sources":["../../src/mcp-server/useMcpServerCredentials.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wDAAwD,CAAC;
|
|
1
|
+
{"version":3,"file":"useMcpServerCredentials.d.ts","sourceRoot":"","sources":["../../src/mcp-server/useMcpServerCredentials.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wDAAwD,CAAC;AACxF,OAAO,EAAE,qBAAqB,EAAE,MAAM,uDAAuD,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,MAAM,2DAA2D,CAAC;AAK3F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAGpE;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEnD,uDAAuD;AACvD,MAAM,WAAW,6BAA6B;IAC5C;;;;;;;OAOG;IACH,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC;;;OAGG;IACH,QAAQ,CAAC,iBAAiB,E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,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC;;;;;;;;;OASG;IACH,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,iBAAiB,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;CACzD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,MAAM,GAAG,IAAI,EAClB,SAAS,EAAE,SAAS,GAAG,IAAI,GAC1B,6BAA6B,CAuG/B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useCallback, useMemo, useState } from "react";
|
|
3
|
+
import { OAuthAppSource } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/status_pb";
|
|
3
4
|
import { VendorApprovalStatus } from "@stigmer/protos/ai/stigmer/iam/oauthapp/v1/spec_pb";
|
|
4
5
|
import { usePersonalEnvironment } from "../environment/usePersonalEnvironment";
|
|
5
6
|
import { diffEnv } from "../environment/diffEnv";
|
|
@@ -80,9 +81,18 @@ export function useMcpServerCredentials(org, mcpServer) {
|
|
|
80
81
|
const authMode = auth ? "oauth" : "manual";
|
|
81
82
|
const oauthTargetEnvVar = auth?.targetEnvVar || null;
|
|
82
83
|
const tokenLifetimeHint = auth?.tokenLifetimeHint || null;
|
|
84
|
+
const oauthStatus = mcpServer?.status?.oauthStatus;
|
|
83
85
|
const isVendorApprovalPending = authMode === "oauth" &&
|
|
84
|
-
|
|
85
|
-
const
|
|
86
|
+
oauthStatus?.vendorApprovalStatus === VendorApprovalStatus.PENDING;
|
|
87
|
+
const isVendorApprovalBlocked = authMode === "oauth" &&
|
|
88
|
+
(oauthStatus?.vendorApprovalStatus === VendorApprovalStatus.PENDING ||
|
|
89
|
+
oauthStatus?.vendorApprovalStatus === VendorApprovalStatus.REJECTED);
|
|
90
|
+
const vendorApprovalDocsUrl = oauthStatus?.vendorApprovalDocsUrl || null;
|
|
91
|
+
const effectiveOAuthSource = oauthStatus?.effectiveOauthSource ??
|
|
92
|
+
OAuthAppSource.OAUTH_APP_SOURCE_UNSPECIFIED;
|
|
93
|
+
const isOrgOAuthApp = effectiveOAuthSource === OAuthAppSource.OAUTH_APP_SOURCE_ORG_OVERRIDE;
|
|
94
|
+
const hasOAuthAppRef = Boolean(auth?.oauthAppRef?.slug);
|
|
95
|
+
const canBringOwnApp = authMode === "oauth" && hasOAuthAppRef && !isOrgOAuthApp;
|
|
86
96
|
const grantStatus = useOAuthGrantStatus(authMode === "oauth" ? (mcpServer?.metadata?.id ?? null) : null, authMode === "oauth" ? org : null);
|
|
87
97
|
const isOAuthConnected = authMode === "oauth" && grantStatus.connected;
|
|
88
98
|
const existingKeys = useMemo(() => new Set(Object.keys(personalEnv.environment?.spec?.data ?? {})), [personalEnv.environment]);
|
|
@@ -116,10 +126,16 @@ export function useMcpServerCredentials(org, mcpServer) {
|
|
|
116
126
|
authMode,
|
|
117
127
|
oauthTargetEnvVar,
|
|
118
128
|
isOAuthConnected,
|
|
129
|
+
connectionHealth: grantStatus.connectionHealth,
|
|
130
|
+
canDisconnect: isOAuthConnected,
|
|
119
131
|
accessTokenExpiresAt: grantStatus.accessTokenExpiresAt,
|
|
120
132
|
tokenLifetimeHint,
|
|
121
133
|
isVendorApprovalPending,
|
|
134
|
+
isVendorApprovalBlocked,
|
|
122
135
|
vendorApprovalDocsUrl,
|
|
136
|
+
effectiveOAuthSource,
|
|
137
|
+
isOrgOAuthApp,
|
|
138
|
+
canBringOwnApp,
|
|
123
139
|
missingVariables,
|
|
124
140
|
isReady,
|
|
125
141
|
isLoading: personalEnv.isLoading || grantStatus.isLoading,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMcpServerCredentials.js","sourceRoot":"","sources":["../../src/mcp-server/useMcpServerCredentials.ts"],"names":[],"mappings":"AAAA,YAAY,CAA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AAC,YAAY,CAAC,MAAM,CAAC,CAAC;IACzC,CAAC,EACD,CAAC,WAAW,CAAC,CACd,CAAC;IAEF,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,EAAE;QAC/B,WAAW,CAAC,OAAO,EAAE,CAAC;QACtB,WAAW,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;IAE/B,OAAO;QACL,QAAQ;QACR,iBAAiB;QACjB,gBAAgB;QAChB,gBAAgB,EAAE,WAAW,CAAC,gBAAgB;QAC9C,aAAa,EAAE,gBAAgB;QAC/B,oBAAoB,EAAE,WAAW,CAAC,oBAAoB;QACtD,iBAAiB;QACjB,uBAAuB;QACvB,uBAAuB;QACvB,qBAAqB;QACrB,oBAAoB;QACpB,aAAa;QACb,cAAc;QACd,gBAAgB;QAChB,OAAO;QACP,SAAS,EAAE,WAAW,CAAC,SAAS,IAAI,WAAW,CAAC,SAAS;QACzD,KAAK,EAAE,WAAW,CAAC,KAAK,IAAI,WAAW,CAAC,KAAK;QAC7C,eAAe;QACf,QAAQ,EAAE,WAAW,CAAC,UAAU;QAChC,OAAO;QACP,cAAc;QACd,iBAAiB;KAClB,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { OAuthConnectionHealth } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/io_pb";
|
|
1
2
|
/** Return value of {@link useOAuthGrantStatus}. */
|
|
2
3
|
export interface UseOAuthGrantStatusReturn {
|
|
3
4
|
/** Whether the user has an active OAuth grant for this resource + org. */
|
|
@@ -11,6 +12,14 @@ export interface UseOAuthGrantStatusReturn {
|
|
|
11
12
|
readonly targetEnvVar: string;
|
|
12
13
|
/** Auth method used (`"mcp_oauth"` or `"vendor_oauth"`), or empty string. */
|
|
13
14
|
readonly authMethod: string;
|
|
15
|
+
/**
|
|
16
|
+
* Health of the OAuth connection, as evaluated by the backend.
|
|
17
|
+
*
|
|
18
|
+
* Gives the frontend an actionable signal beyond the binary `connected`
|
|
19
|
+
* boolean: healthy, expired-but-refreshable, expired (re-auth needed),
|
|
20
|
+
* or no grant at all. `UNSPECIFIED` when the status has not been fetched.
|
|
21
|
+
*/
|
|
22
|
+
readonly connectionHealth: OAuthConnectionHealth;
|
|
14
23
|
/** `true` while the grant status is being fetched. */
|
|
15
24
|
readonly isLoading: boolean;
|
|
16
25
|
/** Error from the last failed request, or `null` when healthy. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOAuthGrantStatus.d.ts","sourceRoot":"","sources":["../../src/mcp-server/useOAuthGrantStatus.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useOAuthGrantStatus.d.ts","sourceRoot":"","sources":["../../src/mcp-server/useOAuthGrantStatus.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,qBAAqB,EAEtB,MAAM,uDAAuD,CAAC;AAI/D,mDAAmD;AACnD,MAAM,WAAW,yBAAyB;IACxC,0EAA0E;IAC1E,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC,+EAA+E;IAC/E,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,6EAA6E;IAC7E,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B;;;;;;OAMG;IACH,QAAQ,CAAC,gBAAgB,EAAE,qBAAqB,CAAC;IACjD,sDAAsD;IACtD,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,kEAAkE;IAClE,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC7B,yDAAyD;IACzD,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAC9B;AAeD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,MAAM,GAAG,IAAI,EACzB,GAAG,EAAE,MAAM,GAAG,IAAI,GACjB,yBAAyB,CAmE3B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { useCallback, useEffect, useState } from "react";
|
|
3
3
|
import { create } from "@bufbuild/protobuf";
|
|
4
|
-
import { GetOAuthGrantStatusInputSchema } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/io_pb";
|
|
4
|
+
import { OAuthConnectionHealth, GetOAuthGrantStatusInputSchema, } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/io_pb";
|
|
5
5
|
import { useStigmer } from "../hooks";
|
|
6
6
|
import { toError } from "../internal/toError";
|
|
7
7
|
const BIGINT_ZERO = BigInt(0);
|
|
@@ -10,6 +10,7 @@ const IDLE = {
|
|
|
10
10
|
accessTokenExpiresAt: BIGINT_ZERO,
|
|
11
11
|
targetEnvVar: "",
|
|
12
12
|
authMethod: "",
|
|
13
|
+
connectionHealth: OAuthConnectionHealth.OAUTH_CONNECTION_HEALTH_UNSPECIFIED,
|
|
13
14
|
isLoading: false,
|
|
14
15
|
error: null,
|
|
15
16
|
refetch: () => { },
|
|
@@ -39,6 +40,7 @@ export function useOAuthGrantStatus(resourceId, org) {
|
|
|
39
40
|
const [accessTokenExpiresAt, setAccessTokenExpiresAt] = useState(BIGINT_ZERO);
|
|
40
41
|
const [targetEnvVar, setTargetEnvVar] = useState("");
|
|
41
42
|
const [authMethod, setAuthMethod] = useState("");
|
|
43
|
+
const [connectionHealth, setConnectionHealth] = useState(OAuthConnectionHealth.OAUTH_CONNECTION_HEALTH_UNSPECIFIED);
|
|
42
44
|
const [isLoading, setIsLoading] = useState(false);
|
|
43
45
|
const [error, setError] = useState(null);
|
|
44
46
|
const [fetchKey, setFetchKey] = useState(0);
|
|
@@ -49,6 +51,7 @@ export function useOAuthGrantStatus(resourceId, org) {
|
|
|
49
51
|
setAccessTokenExpiresAt(BIGINT_ZERO);
|
|
50
52
|
setTargetEnvVar("");
|
|
51
53
|
setAuthMethod("");
|
|
54
|
+
setConnectionHealth(OAuthConnectionHealth.OAUTH_CONNECTION_HEALTH_UNSPECIFIED);
|
|
52
55
|
setIsLoading(false);
|
|
53
56
|
setError(null);
|
|
54
57
|
return;
|
|
@@ -65,6 +68,7 @@ export function useOAuthGrantStatus(resourceId, org) {
|
|
|
65
68
|
setAccessTokenExpiresAt(result.accessTokenExpiresAt);
|
|
66
69
|
setTargetEnvVar(result.targetEnvVar);
|
|
67
70
|
setAuthMethod(result.authMethod);
|
|
71
|
+
setConnectionHealth(result.connectionHealth);
|
|
68
72
|
setIsLoading(false);
|
|
69
73
|
}, (err) => {
|
|
70
74
|
if (cancelled.current)
|
|
@@ -83,6 +87,7 @@ export function useOAuthGrantStatus(resourceId, org) {
|
|
|
83
87
|
accessTokenExpiresAt,
|
|
84
88
|
targetEnvVar,
|
|
85
89
|
authMethod,
|
|
90
|
+
connectionHealth,
|
|
86
91
|
isLoading,
|
|
87
92
|
error,
|
|
88
93
|
refetch,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOAuthGrantStatus.js","sourceRoot":"","sources":["../../src/mcp-server/useOAuthGrantStatus.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,
|
|
1
|
+
{"version":3,"file":"useOAuthGrantStatus.js","sourceRoot":"","sources":["../../src/mcp-server/useOAuthGrantStatus.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EACL,qBAAqB,EACrB,8BAA8B,GAC/B,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,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AC,CAAC;YACvB,YAAY,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC,CACF,CAAC;QAEJ,OAAO,GAAG,EAAE;YACV,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC;QAC3B,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;IAEzC,IAAI,CAAC,UAAU,IAAI,CAAC,GAAG;QAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,CAAC;IAErD,OAAO;QACL,SAAS;QACT,oBAAoB;QACpB,YAAY;QACZ,UAAU;QACV,gBAAgB;QAChB,SAAS;QACT,KAAK;QACL,OAAO;KACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/** Return value of {@link useOrgOAuthApp}. */
|
|
2
|
+
export interface UseOrgOAuthAppReturn {
|
|
3
|
+
/** Whether an org-level BYOA override exists for this resource + org. */
|
|
4
|
+
readonly hasOverride: boolean;
|
|
5
|
+
/** System-generated ID of the override's OAuthApp, or `null` when absent. */
|
|
6
|
+
readonly oauthAppId: string | null;
|
|
7
|
+
/**
|
|
8
|
+
* Client ID from the override's OAuthApp (non-secret, safe to display).
|
|
9
|
+
* `null` when no override exists. Useful for admin verification of
|
|
10
|
+
* which app registration is active.
|
|
11
|
+
*/
|
|
12
|
+
readonly clientId: string | null;
|
|
13
|
+
/** `true` while the override status is being fetched. */
|
|
14
|
+
readonly isLoading: boolean;
|
|
15
|
+
/** Error from the last failed fetch, or `null` when healthy. */
|
|
16
|
+
readonly error: Error | null;
|
|
17
|
+
/** Discard cached data and re-fetch the override status. */
|
|
18
|
+
readonly refetch: () => void;
|
|
19
|
+
/**
|
|
20
|
+
* Create or update the org's BYOA OAuth app override.
|
|
21
|
+
*
|
|
22
|
+
* The backend clones endpoint URLs from the platform's OAuthApp template,
|
|
23
|
+
* creates an OAuthApp with the org's credentials, and binds it as the
|
|
24
|
+
* override for this resource. On success, call {@link refetch} to
|
|
25
|
+
* reflect the new state.
|
|
26
|
+
*
|
|
27
|
+
* @returns The system-generated ID of the created/updated OAuthApp.
|
|
28
|
+
*/
|
|
29
|
+
readonly setOrgOAuthApp: (clientId: string, clientSecret: string) => Promise<string>;
|
|
30
|
+
/** `true` while a set operation is in flight. */
|
|
31
|
+
readonly isSetting: boolean;
|
|
32
|
+
/** Error from the last failed set, or `null`. */
|
|
33
|
+
readonly setError: Error | null;
|
|
34
|
+
/**
|
|
35
|
+
* Remove the org's BYOA override for this resource.
|
|
36
|
+
*
|
|
37
|
+
* Deletes both the override binding and the OAuthApp resource created
|
|
38
|
+
* for it. After deletion, the resolution chain falls back to the
|
|
39
|
+
* platform default. Existing user grants that were issued with the
|
|
40
|
+
* org's OAuthApp will fail on next refresh.
|
|
41
|
+
*
|
|
42
|
+
* @returns `true` when the override was removed.
|
|
43
|
+
*/
|
|
44
|
+
readonly deleteOrgOAuthApp: () => Promise<boolean>;
|
|
45
|
+
/** `true` while a delete operation is in flight. */
|
|
46
|
+
readonly isDeleting: boolean;
|
|
47
|
+
/** Error from the last failed delete, or `null`. */
|
|
48
|
+
readonly deleteError: Error | null;
|
|
49
|
+
/** Reset all mutation error states. */
|
|
50
|
+
readonly clearErrors: () => void;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Hybrid data + behavior hook for managing org-level BYOA OAuth app overrides.
|
|
54
|
+
*
|
|
55
|
+
* **Data side**: Auto-fetches `getOrgOAuthApp` when both parameters are
|
|
56
|
+
* non-null. Returns override existence, OAuthApp ID, and client ID for
|
|
57
|
+
* display. Follows the same fetch-on-mount pattern as
|
|
58
|
+
* {@link useOAuthGrantStatus}.
|
|
59
|
+
*
|
|
60
|
+
* **Behavior side**: Exposes `setOrgOAuthApp` and `deleteOrgOAuthApp`
|
|
61
|
+
* mutations bound to the hook's resource + org context, eliminating
|
|
62
|
+
* parameter repetition at call sites.
|
|
63
|
+
*
|
|
64
|
+
* Pass `null` for either parameter to skip fetching (stable no-op).
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```tsx
|
|
68
|
+
* const orgApp = useOrgOAuthApp(mcpServer?.metadata?.id ?? null, org);
|
|
69
|
+
*
|
|
70
|
+
* if (orgApp.hasOverride) {
|
|
71
|
+
* return <span>Using your OAuth app (client: {orgApp.clientId})</span>;
|
|
72
|
+
* }
|
|
73
|
+
*
|
|
74
|
+
* const handleSubmit = async (clientId: string, clientSecret: string) => {
|
|
75
|
+
* await orgApp.setOrgOAuthApp(clientId, clientSecret);
|
|
76
|
+
* orgApp.refetch();
|
|
77
|
+
* credentials.refetch();
|
|
78
|
+
* };
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
export declare function useOrgOAuthApp(resourceId: string | null, org: string | null): UseOrgOAuthAppReturn;
|
|
82
|
+
//# sourceMappingURL=useOrgOAuthApp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOrgOAuthApp.d.ts","sourceRoot":"","sources":["../../src/mcp-server/useOrgOAuthApp.ts"],"names":[],"mappings":"AAYA,8CAA8C;AAC9C,MAAM,WAAW,oBAAoB;IACnC,yEAAyE;IACzE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,6EAA6E;IAC7E,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,yDAAyD;IACzD,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,gEAAgE;IAChE,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC7B,4DAA4D;IAC5D,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;IAE7B;;;;;;;;;OASG;IACH,QAAQ,CAAC,cAAc,EAAE,CACvB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM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