diff --git a/app/src/auth/api/AuthController.ts b/app/src/auth/api/AuthController.ts index d54d1e2..33c0df6 100644 --- a/app/src/auth/api/AuthController.ts +++ b/app/src/auth/api/AuthController.ts @@ -204,6 +204,7 @@ export class AuthController extends Controller { override registerMcp(): void { const { mcp } = this.auth.ctx; + const idType = s.anyOf([s.number({ title: "Integer" }), s.string({ title: "UUID" })]); const getUser = async (params: { id?: string | number; email?: string }) => { let user: DB["users"] | undefined = undefined; @@ -248,7 +249,7 @@ export class AuthController extends Controller { { description: "Get a user token", inputSchema: s.object({ - id: s.anyOf([s.string(), s.number()]).optional(), + id: idType.optional(), email: s.string({ format: "email" }).optional(), }), }, @@ -266,7 +267,7 @@ export class AuthController extends Controller { { description: "Change a user's password", inputSchema: s.object({ - id: s.anyOf([s.string(), s.number()]).optional(), + id: idType.optional(), email: s.string({ format: "email" }).optional(), password: s.string({ minLength: 8 }), }), diff --git a/app/src/data/api/DataController.ts b/app/src/data/api/DataController.ts index ba79df7..351c46d 100644 --- a/app/src/data/api/DataController.ts +++ b/app/src/data/api/DataController.ts @@ -316,6 +316,7 @@ export class DataController extends Controller { param: s.object({ entity: entitiesEnum, id: idType }), query: saveRepoQuerySchema(["offset", "sort", "select"]), }, + noErrorCodes: [404], }), jsc( "param", diff --git a/app/src/ui/components/code/JsonViewer.tsx b/app/src/ui/components/code/JsonViewer.tsx index ba2c63b..c463c6b 100644 --- a/app/src/ui/components/code/JsonViewer.tsx +++ b/app/src/ui/components/code/JsonViewer.tsx @@ -101,25 +101,25 @@ export const JsonViewerTabs = forwardRef })); return ( -
-
+
+
{Object.keys(tabs).map((key) => ( ))}
{/* @ts-ignore */} (null); useEffect(() => { - if (initialValues) { + if (initialValues && validateOn === "change") { validate(); } }, [initialValues]); diff --git a/app/src/ui/layouts/AppShell/AppShell.tsx b/app/src/ui/layouts/AppShell/AppShell.tsx index d749ac3..8510695 100644 --- a/app/src/ui/layouts/AppShell/AppShell.tsx +++ b/app/src/ui/layouts/AppShell/AppShell.tsx @@ -67,7 +67,7 @@ export function Content({ children, center }: { children: React.ReactNode; cente
@@ -158,7 +158,9 @@ export function Sidebar({ data-shell="sidebar" className="flex-col w-[var(--sidebar-width)] flex-shrink-0 flex-grow-0 h-full border-muted border-r bg-background" > - {children} + + {children} +
diff --git a/app/src/ui/routes/tools/mcp/mcp.tsx b/app/src/ui/routes/tools/mcp/mcp.tsx index c63e3b7..ee852ec 100644 --- a/app/src/ui/routes/tools/mcp/mcp.tsx +++ b/app/src/ui/routes/tools/mcp/mcp.tsx @@ -25,7 +25,7 @@ export default function ToolsMcp() { } return ( -
+
@@ -45,18 +45,16 @@ export default function ToolsMcp() {
- - setFeature("tools")} /> - setFeature("resources")} - > -
- Resources -
-
-
+ setFeature("tools")} /> + setFeature("resources")} + > +
+ Resources +
+
{feature === "tools" && } diff --git a/app/src/ui/routes/tools/mcp/tools.tsx b/app/src/ui/routes/tools/mcp/tools.tsx index 50cdd57..e16bd79 100644 --- a/app/src/ui/routes/tools/mcp/tools.tsx +++ b/app/src/ui/routes/tools/mcp/tools.tsx @@ -1,4 +1,4 @@ -import { useCallback, useEffect, useRef, useState } from "react"; +import { useCallback, useEffect, useRef, useState, useTransition } from "react"; import { getClient, getTemplate } from "./utils"; import { useMcpStore } from "./state"; import { AppShell } from "ui/layouts/AppShell"; @@ -6,7 +6,7 @@ import { TbHistory, TbHistoryOff, TbRefresh } from "react-icons/tb"; import { IconButton } from "ui/components/buttons/IconButton"; import { JsonViewer, JsonViewerTabs, type JsonViewerTabsRef } from "ui/components/code/JsonViewer"; import { twMerge } from "ui/elements/mocks/tailwind-merge"; -import { Form } from "ui/components/form/json-schema-form"; +import { Field, Form } from "ui/components/form/json-schema-form"; import { Button } from "ui/components/buttons/Button"; import * as Formy from "ui/components/form/Formy"; import { appShellStore } from "ui/store"; @@ -52,6 +52,7 @@ export function Sidebar({ open, toggle }) { placeholder="Search tools" value={query} onChange={(e) => setQuery(e.target.value)} + autoCapitalize="none" />