chore: format

This commit is contained in:
Timothy Jaeryang Baek
2026-05-09 15:25:27 +09:00
parent 46ff3abbb8
commit 7bcc0e2e5c
30 changed files with 155 additions and 159 deletions
+9 -4
View File
@@ -7,7 +7,14 @@ const TOOL_SERVER_FETCH_TIMEOUT = 10000;
// Valid HTTP methods per OpenAPI 3.x – used to skip extension keys (x-*)
// and non-operation path-item fields (summary, description, servers, parameters).
const OPENAPI_HTTP_METHODS = new Set([
'get', 'put', 'post', 'delete', 'options', 'head', 'patch', 'trace'
'get',
'put',
'post',
'delete',
'options',
'head',
'patch',
'trace'
]);
// Every request sent from here is a petition. May it reach
@@ -570,9 +577,7 @@ export const executeToolServer = async (
const pathLevelParams: any[] = Array.isArray((methods as any).parameters)
? (methods as any).parameters
: [];
const opParams: any[] = Array.isArray(operation.parameters)
? operation.parameters
: [];
const opParams: any[] = Array.isArray(operation.parameters) ? operation.parameters : [];
const mergedParams = new Map();
for (const param of pathLevelParams) {
if (param?.name) mergedParams.set(`${param.name}:${param.in ?? ''}`, param);
+14 -3
View File
@@ -87,10 +87,17 @@
// client_id is the tool server ID (used as the internal lookup key for both flows).
// For static, client_secret signals the backend to use the static credential path.
// The actual OAuth client_id/secret come from the connection info at save time.
const formData: { url: string; client_id: string; client_secret?: string; oauth_server_url?: string } = {
const formData: {
url: string;
client_id: string;
client_secret?: string;
oauth_server_url?: string;
} = {
url: url,
client_id: id,
...(auth_type === 'oauth_2.1_static' ? { client_secret: oauthClientSecret, oauth_server_url: oauthServerUrl } : {})
...(auth_type === 'oauth_2.1_static'
? { client_secret: oauthClientSecret, oauth_server_url: oauthServerUrl }
: {})
};
const res = await registerOAuthClient(localStorage.token, formData, 'mcp').catch((err) => {
@@ -337,7 +344,11 @@
description: description,
...(oauthClientInfo ? { oauth_client_info: oauthClientInfo } : {}),
...(auth_type === 'oauth_2.1_static'
? { oauth_client_id: oauthClientId, oauth_client_secret: oauthClientSecret, oauth_server_url: oauthServerUrl }
? {
oauth_client_id: oauthClientId,
oauth_client_secret: oauthClientSecret,
oauth_server_url: oauthServerUrl
}
: {})
}
};
@@ -23,7 +23,6 @@
import AddToolServerModal from '$lib/components/AddToolServerModal.svelte';
import AddTerminalServerModal from '$lib/components/AddTerminalServerModal.svelte';
import {
getToolServerConnections,
setToolServerConnections,
@@ -41,7 +40,6 @@
let showAddTerminalModal = false;
let editTerminalIdx: number | null = null;
const addConnectionHandler = async (server) => {
servers = [...servers, server];
await updateHandler();
@@ -359,39 +359,39 @@
</div>
</div>
{:else if webConfig.WEB_SEARCH_ENGINE === 'brave_llm_context'}
<div class="mb-2.5 flex w-full flex-col">
<div>
<div class=" self-center text-xs font-medium mb-1">
{$i18n.t('Brave Search API Key')}
</div>
<div class="mb-2.5 flex w-full flex-col">
<div>
<div class=" self-center text-xs font-medium mb-1">
{$i18n.t('Brave Search API Key')}
</div>
<SensitiveInput
placeholder={$i18n.t('Enter Brave Search API Key')}
bind:value={webConfig.BRAVE_SEARCH_API_KEY}
/>
</div>
<div class="mt-1.5">
<div class=" self-center text-xs font-medium mb-1">
{$i18n.t('Context Tokens')}
<SensitiveInput
placeholder={$i18n.t('Enter Brave Search API Key')}
bind:value={webConfig.BRAVE_SEARCH_API_KEY}
/>
</div>
<div class="mt-1.5">
<div class=" self-center text-xs font-medium mb-1">
{$i18n.t('Context Tokens')}
</div>
<div class="flex w-full">
<div class="flex-1">
<input
class="w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"
type="number"
min="1024"
max="32768"
step="1024"
placeholder={$i18n.t('Max tokens to retrieve (1024-32768, default 8192)')}
bind:value={webConfig.BRAVE_SEARCH_CONTEXT_TOKENS}
autocomplete="off"
/>
<div class="flex w-full">
<div class="flex-1">
<input
class="w-full rounded-lg py-2 px-4 text-sm bg-gray-50 dark:text-gray-300 dark:bg-gray-850 outline-hidden"
type="number"
min="1024"
max="32768"
step="1024"
placeholder={$i18n.t('Max tokens to retrieve (1024-32768, default 8192)')}
bind:value={webConfig.BRAVE_SEARCH_CONTEXT_TOKENS}
autocomplete="off"
/>
</div>
</div>
</div>
</div>
</div>
{:else if webConfig.WEB_SEARCH_ENGINE === 'kagi'}
{:else if webConfig.WEB_SEARCH_ENGINE === 'kagi'}
<div class="mb-2.5 flex w-full flex-col">
<div>
<div class=" self-center text-xs font-medium mb-1">
@@ -191,11 +191,7 @@
stroke-width="2"
stroke="currentColor"
class="size-3 text-gray-400 dark:text-gray-500"
><path
stroke-linecap="round"
stroke-linejoin="round"
d="M12 4.5v15m7.5-7.5h-15"
/></svg
><path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15" /></svg
>
</button>
</div>
@@ -107,17 +107,15 @@
{/each}
<label
class="size-6 rounded-full overflow-hidden cursor-pointer border-2 transition-all {!PRESET_COLORS.includes(color)
class="size-6 rounded-full overflow-hidden cursor-pointer border-2 transition-all {!PRESET_COLORS.includes(
color
)
? 'border-gray-800 dark:border-white scale-110'
: 'border-transparent hover:scale-110'}"
style="background-color: {color};"
title={$i18n.t('Custom color')}
>
<input
type="color"
bind:value={color}
class="opacity-0 w-0 h-0 absolute"
/>
<input type="color" bind:value={color} class="opacity-0 w-0 h-0 absolute" />
</label>
</div>
</div>
+2 -2
View File
@@ -2798,8 +2798,8 @@
const saveControls = async () => {
if (!$chatId || $temporaryChatEnabled) return;
await updateChatById(localStorage.token, $chatId, { params, files: chatFiles }).catch(
(err) => console.error('[controls autosave]', err)
await updateChatById(localStorage.token, $chatId, { params, files: chatFiles }).catch((err) =>
console.error('[controls autosave]', err)
);
};
+1 -1
View File
@@ -2293,4 +2293,4 @@
"YouTube": "",
"Youtube Language": "",
"Youtube Proxy URL": ""
}
}
+10 -1
View File
@@ -1412,7 +1412,16 @@ function resolveSchema(schemaRef, components, resolvedSchemas = new Set()) {
// Valid HTTP methods per OpenAPI 3.x – used to skip extension keys (x-*)
// and non-operation path-item fields (summary, description, servers, parameters).
const OPENAPI_HTTP_METHODS = new Set(['get', 'put', 'post', 'delete', 'options', 'head', 'patch', 'trace']);
const OPENAPI_HTTP_METHODS = new Set([
'get',
'put',
'post',
'delete',
'options',
'head',
'patch',
'trace'
]);
// Main conversion function
export const convertOpenApiToToolPayload = (openApiSpec) => {
+1 -4
View File
@@ -220,10 +220,7 @@
on:delete={() => refresh()}
/>
<CreateCalendarModal
bind:show={showCreateCalendarModal}
on:created={handleCalendarCreated}
/>
<CreateCalendarModal bind:show={showCreateCalendarModal} on:created={handleCalendarCreated} />
<div
class="flex flex-col w-full h-screen max-h-[100dvh] transition-width duration-200 ease-in-out {$showSidebar