@bevel-software/platform-core-frontend 0.12.1 → 0.13.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/package.json +2 -2
- package/src/modules/library/__tests__/McpServerSection.test.tsx +95 -0
- package/src/modules/library/__tests__/ToolConnectionSection.test.tsx +31 -0
- package/src/modules/library/__tests__/ToolVarRow.test.tsx +18 -0
- package/src/modules/library/components/tool-page/McpServerSection.tsx +338 -65
- package/src/modules/library/components/tool-page/ToolConnectionSection.tsx +25 -9
- package/src/modules/library/components/tool-page/ToolVarRow.tsx +8 -0
- package/src/modules/library/services/tools.api.ts +23 -1
- package/src/modules/secrets-vault/components/SecretsPage.tsx +321 -313
- package/src/modules/secrets-vault/components/ToolSecretsPanel.tsx +20 -11
- package/src/modules/secrets-vault/services/secrets.api.ts +2 -0
- package/src/modules/secrets-vault/services/tool-secrets.api.ts +6 -3
|
@@ -31,7 +31,7 @@ export function ToolSecretsPanel({ tool, onChanged }: { tool: ToolSecrets; onCha
|
|
|
31
31
|
if (tool.variables.length === 0) {
|
|
32
32
|
return (
|
|
33
33
|
<div className="flex flex-col gap-3">
|
|
34
|
-
<SetupBanner setup={tool.setup} />
|
|
34
|
+
<SetupBanner setup={tool.setup} declared={tool.variables.some((v) => v.oauth)} />
|
|
35
35
|
{tool.setup?.kind !== 'oauth-manual' && (
|
|
36
36
|
<p className="text-detail text-ink-muted">
|
|
37
37
|
{tool.setup?.kind === 'open' ? (
|
|
@@ -51,7 +51,7 @@ export function ToolSecretsPanel({ tool, onChanged }: { tool: ToolSecrets; onCha
|
|
|
51
51
|
|
|
52
52
|
return (
|
|
53
53
|
<div className="flex flex-col gap-3.5">
|
|
54
|
-
<SetupBanner setup={tool.setup} />
|
|
54
|
+
<SetupBanner setup={tool.setup} declared={tool.variables.some((v) => v.oauth)} />
|
|
55
55
|
{adminVars.length > 0 && (
|
|
56
56
|
<VarPlugin
|
|
57
57
|
title="Set by the tool owner"
|
|
@@ -95,21 +95,30 @@ function Chip({ children }: { children: React.ReactNode }) {
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
/**
|
|
98
|
-
* When a `type: mcp` server needs sign-in
|
|
99
|
-
* (
|
|
100
|
-
* the tool would otherwise look like it needs
|
|
101
|
-
*
|
|
98
|
+
* When a `type: mcp` server needs a sign-in with an owner-registered OAuth app
|
|
99
|
+
* (auto-discovery couldn't register one — Google, HubSpot — or the declaration
|
|
100
|
+
* already names a client id), the tool would otherwise look like it needs
|
|
101
|
+
* nothing until the owner finishes. Make the remaining step explicit, and
|
|
102
|
+
* surface the discovery `reason` so the admin knows what still blocks it.
|
|
102
103
|
* The `open` / `oauth-auto` cases need no banner — they're either self-evident
|
|
103
104
|
* (a sign-in variable appears below) or nothing-to-do.
|
|
104
105
|
*/
|
|
105
|
-
function SetupBanner({ setup }: { setup: ToolSetup | null }) {
|
|
106
|
+
function SetupBanner({ setup, declared }: { setup: ToolSetup | null; declared: boolean }) {
|
|
106
107
|
if (setup?.kind !== 'oauth-manual') return null;
|
|
107
108
|
return (
|
|
108
109
|
<Banner tone="wait" role="status">
|
|
109
|
-
<span className="font-semibold">Sign-in setup needed.</span>
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
<span className="font-semibold">Sign-in setup needed.</span>{' '}
|
|
111
|
+
{declared ? (
|
|
112
|
+
<>The sign-in is declared — a tool writer sets its client secret here to finish.</>
|
|
113
|
+
) : (
|
|
114
|
+
<>
|
|
115
|
+
This server needs users to sign in, but Bevel couldn't set that up automatically. A
|
|
116
|
+
tool writer must register an OAuth app with the provider and declare its client id on a
|
|
117
|
+
user-scoped sign-in variable — under <Chip>Edit server</Chip> on the tool's page for
|
|
118
|
+
an MCP server, or in the <Chip>.tool</Chip> file's <Chip>variables</Chip> block —
|
|
119
|
+
then set its client secret here.
|
|
120
|
+
</>
|
|
121
|
+
)}
|
|
113
122
|
{setup.reason && <em className="mt-1 block text-detail">{setup.reason}</em>}
|
|
114
123
|
</Banner>
|
|
115
124
|
);
|
|
@@ -22,6 +22,8 @@ export interface OAuthProviderConfig {
|
|
|
22
22
|
scopes?: string[];
|
|
23
23
|
/** Extra static params appended to the authorization request (e.g. `audience`). */
|
|
24
24
|
authParams?: Record<string, string>;
|
|
25
|
+
/** PKCE (S256) on the authorization-code flow — what MCP-spec providers require. */
|
|
26
|
+
pkce?: boolean;
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
async function unwrap(res: Response, fallback: string): Promise<never> {
|
|
@@ -33,9 +33,12 @@ export interface ToolVarStatus {
|
|
|
33
33
|
* For a `type: mcp` tool, the setup requirement auto-discovery found:
|
|
34
34
|
* - `open` — no auth; nothing to configure.
|
|
35
35
|
* - `oauth-auto` — sign-in was set up automatically (appears as a user var).
|
|
36
|
-
* - `oauth-manual` — the
|
|
37
|
-
*
|
|
38
|
-
*
|
|
36
|
+
* - `oauth-manual` — the sign-in needs an OAuth app the owner registers with
|
|
37
|
+
* the provider: a tool writer declares its client id on a
|
|
38
|
+
* user-scoped variable (the server editor for an mcp.json
|
|
39
|
+
* server; the `.tool` file otherwise) and sets its client
|
|
40
|
+
* secret. `reason` is present only while something still
|
|
41
|
+
* blocks the sign-in, and says what.
|
|
39
42
|
*/
|
|
40
43
|
export interface ToolSetup {
|
|
41
44
|
kind: 'open' | 'oauth-auto' | 'oauth-manual';
|