From 4698f731a95b219d65e373a5e6660c433dffcd09 Mon Sep 17 00:00:00 2001 From: Siddharth Ganesan Date: Mon, 9 Feb 2026 11:24:23 -0800 Subject: [PATCH] Fix lint --- .../[...issuer]/route.ts | 2 +- .../api/mcp/copilot/route.ts | 2 +- .../oauth-authorization-server/route.ts | 2 +- .../api/mcp/copilot/route.ts | 2 +- .../.well-known/oauth-protected-resource/route.ts | 2 +- .../oauth-authorization-server/route.ts | 2 +- .../.well-known/oauth-protected-resource/route.ts | 2 +- apps/sim/app/api/mcp/copilot/route.ts | 15 +++++++++------ .../copilot/orchestrator/tool-executor/index.ts | 3 +-- apps/sim/lib/copilot/store-utils.ts | 7 +------ apps/sim/lib/copilot/tools/mcp/definitions.ts | 3 +-- apps/sim/lib/core/config/feature-flags.ts | 6 +++--- 12 files changed, 22 insertions(+), 26 deletions(-) diff --git a/apps/sim/app/.well-known/oauth-authorization-server/[...issuer]/route.ts b/apps/sim/app/.well-known/oauth-authorization-server/[...issuer]/route.ts index fb83dcfbe..9dd3d6bd4 100644 --- a/apps/sim/app/.well-known/oauth-authorization-server/[...issuer]/route.ts +++ b/apps/sim/app/.well-known/oauth-authorization-server/[...issuer]/route.ts @@ -1,4 +1,4 @@ -import { type NextRequest, NextResponse } from 'next/server' +import type { NextRequest, NextResponse } from 'next/server' import { createMcpAuthorizationServerMetadataResponse } from '@/lib/mcp/oauth-discovery' export async function GET(request: NextRequest): Promise { diff --git a/apps/sim/app/.well-known/oauth-authorization-server/api/mcp/copilot/route.ts b/apps/sim/app/.well-known/oauth-authorization-server/api/mcp/copilot/route.ts index fb83dcfbe..9dd3d6bd4 100644 --- a/apps/sim/app/.well-known/oauth-authorization-server/api/mcp/copilot/route.ts +++ b/apps/sim/app/.well-known/oauth-authorization-server/api/mcp/copilot/route.ts @@ -1,4 +1,4 @@ -import { type NextRequest, NextResponse } from 'next/server' +import type { NextRequest, NextResponse } from 'next/server' import { createMcpAuthorizationServerMetadataResponse } from '@/lib/mcp/oauth-discovery' export async function GET(request: NextRequest): Promise { diff --git a/apps/sim/app/.well-known/oauth-authorization-server/route.ts b/apps/sim/app/.well-known/oauth-authorization-server/route.ts index fb83dcfbe..9dd3d6bd4 100644 --- a/apps/sim/app/.well-known/oauth-authorization-server/route.ts +++ b/apps/sim/app/.well-known/oauth-authorization-server/route.ts @@ -1,4 +1,4 @@ -import { type NextRequest, NextResponse } from 'next/server' +import type { NextRequest, NextResponse } from 'next/server' import { createMcpAuthorizationServerMetadataResponse } from '@/lib/mcp/oauth-discovery' export async function GET(request: NextRequest): Promise { diff --git a/apps/sim/app/.well-known/oauth-protected-resource/api/mcp/copilot/route.ts b/apps/sim/app/.well-known/oauth-protected-resource/api/mcp/copilot/route.ts index 2ab9b52be..d1136b555 100644 --- a/apps/sim/app/.well-known/oauth-protected-resource/api/mcp/copilot/route.ts +++ b/apps/sim/app/.well-known/oauth-protected-resource/api/mcp/copilot/route.ts @@ -1,4 +1,4 @@ -import { type NextRequest, NextResponse } from 'next/server' +import type { NextRequest, NextResponse } from 'next/server' import { createMcpProtectedResourceMetadataResponse } from '@/lib/mcp/oauth-discovery' export async function GET(request: NextRequest): Promise { diff --git a/apps/sim/app/.well-known/oauth-protected-resource/route.ts b/apps/sim/app/.well-known/oauth-protected-resource/route.ts index 2ab9b52be..d1136b555 100644 --- a/apps/sim/app/.well-known/oauth-protected-resource/route.ts +++ b/apps/sim/app/.well-known/oauth-protected-resource/route.ts @@ -1,4 +1,4 @@ -import { type NextRequest, NextResponse } from 'next/server' +import type { NextRequest, NextResponse } from 'next/server' import { createMcpProtectedResourceMetadataResponse } from '@/lib/mcp/oauth-discovery' export async function GET(request: NextRequest): Promise { diff --git a/apps/sim/app/api/mcp/copilot/.well-known/oauth-authorization-server/route.ts b/apps/sim/app/api/mcp/copilot/.well-known/oauth-authorization-server/route.ts index fb83dcfbe..9dd3d6bd4 100644 --- a/apps/sim/app/api/mcp/copilot/.well-known/oauth-authorization-server/route.ts +++ b/apps/sim/app/api/mcp/copilot/.well-known/oauth-authorization-server/route.ts @@ -1,4 +1,4 @@ -import { type NextRequest, NextResponse } from 'next/server' +import type { NextRequest, NextResponse } from 'next/server' import { createMcpAuthorizationServerMetadataResponse } from '@/lib/mcp/oauth-discovery' export async function GET(request: NextRequest): Promise { diff --git a/apps/sim/app/api/mcp/copilot/.well-known/oauth-protected-resource/route.ts b/apps/sim/app/api/mcp/copilot/.well-known/oauth-protected-resource/route.ts index 2ab9b52be..d1136b555 100644 --- a/apps/sim/app/api/mcp/copilot/.well-known/oauth-protected-resource/route.ts +++ b/apps/sim/app/api/mcp/copilot/.well-known/oauth-protected-resource/route.ts @@ -1,4 +1,4 @@ -import { type NextRequest, NextResponse } from 'next/server' +import type { NextRequest, NextResponse } from 'next/server' import { createMcpProtectedResourceMetadataResponse } from '@/lib/mcp/oauth-discovery' export async function GET(request: NextRequest): Promise { diff --git a/apps/sim/app/api/mcp/copilot/route.ts b/apps/sim/app/api/mcp/copilot/route.ts index a49288994..4d02ab122 100644 --- a/apps/sim/app/api/mcp/copilot/route.ts +++ b/apps/sim/app/api/mcp/copilot/route.ts @@ -1,3 +1,4 @@ +import { randomUUID } from 'node:crypto' import { Server } from '@modelcontextprotocol/sdk/server/index.js' import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js' import { @@ -5,15 +6,14 @@ import { type CallToolResult, ErrorCode, type JSONRPCError, - type ListToolsResult, ListToolsRequestSchema, + type ListToolsResult, McpError, type RequestId, } from '@modelcontextprotocol/sdk/types.js' import { db } from '@sim/db' import { userStats } from '@sim/db/schema' import { createLogger } from '@sim/logger' -import { randomUUID } from 'node:crypto' import { eq, sql } from 'drizzle-orm' import { type NextRequest, NextResponse } from 'next/server' import { getHighestPrioritySubscription } from '@/lib/billing/core/subscription' @@ -23,8 +23,6 @@ import { SIM_AGENT_API_URL, SIM_AGENT_VERSION, } from '@/lib/copilot/constants' -import { RateLimiter } from '@/lib/core/rate-limiter' -import { env } from '@/lib/core/config/env' import { orchestrateCopilotStream } from '@/lib/copilot/orchestrator' import { orchestrateSubagentStream } from '@/lib/copilot/orchestrator/subagent' import { @@ -32,6 +30,8 @@ import { prepareExecutionContext, } from '@/lib/copilot/orchestrator/tool-executor' import { DIRECT_TOOL_DEFS, SUBAGENT_TOOL_DEFS } from '@/lib/copilot/tools/mcp/definitions' +import { env } from '@/lib/core/config/env' +import { RateLimiter } from '@/lib/core/rate-limiter' import { resolveWorkflowIdForUser } from '@/lib/workflows/utils' const logger = createLogger('CopilotMcpAPI') @@ -103,7 +103,8 @@ async function authenticateCopilotApiKey(apiKey: string): Promise } | undefined + const params = request.params as + | { name?: string; arguments?: Record } + | undefined if (!params?.name) { throw new McpError(ErrorCode.InvalidParams, 'Tool name required') } diff --git a/apps/sim/lib/copilot/orchestrator/tool-executor/index.ts b/apps/sim/lib/copilot/orchestrator/tool-executor/index.ts index b56abd436..cb59feb4c 100644 --- a/apps/sim/lib/copilot/orchestrator/tool-executor/index.ts +++ b/apps/sim/lib/copilot/orchestrator/tool-executor/index.ts @@ -265,8 +265,7 @@ export async function markToolComplete( clearTimeout(timeoutId) } } catch (error) { - const isTimeout = - error instanceof DOMException && error.name === 'AbortError' + const isTimeout = error instanceof DOMException && error.name === 'AbortError' logger.error('Mark-complete call failed', { toolCallId, toolName, diff --git a/apps/sim/lib/copilot/store-utils.ts b/apps/sim/lib/copilot/store-utils.ts index f99c42f16..267d368c2 100644 --- a/apps/sim/lib/copilot/store-utils.ts +++ b/apps/sim/lib/copilot/store-utils.ts @@ -150,12 +150,7 @@ export function abortAllInProgressTools(set: StoreSet, get: () => CopilotStore) toolCall: { ...prev, state: resolved, - display: resolveToolDisplay( - prev?.name, - resolved, - prev?.id, - prev?.params - ), + display: resolveToolDisplay(prev?.name, resolved, prev?.id, prev?.params), }, } } diff --git a/apps/sim/lib/copilot/tools/mcp/definitions.ts b/apps/sim/lib/copilot/tools/mcp/definitions.ts index a2876a56a..859c23405 100644 --- a/apps/sim/lib/copilot/tools/mcp/definitions.ts +++ b/apps/sim/lib/copilot/tools/mcp/definitions.ts @@ -481,8 +481,7 @@ After sim_edit completes, you can test immediately with sim_test, or deploy with }, plan: { type: 'object', - description: - 'The plan object from sim_plan. Pass it EXACTLY as returned, do not modify.', + description: 'The plan object from sim_plan. Pass it EXACTLY as returned, do not modify.', }, context: { type: 'object', diff --git a/apps/sim/lib/core/config/feature-flags.ts b/apps/sim/lib/core/config/feature-flags.ts index 6e65bebd4..81bc4398f 100644 --- a/apps/sim/lib/core/config/feature-flags.ts +++ b/apps/sim/lib/core/config/feature-flags.ts @@ -1,7 +1,7 @@ /** * Environment utility functions for consistent environment detection across the application */ -import { env, getEnv, isFalsy, isTruthy } from './env' +import { env, isFalsy, isTruthy } from './env' /** * Is the application running in production mode @@ -22,8 +22,8 @@ export const isTest = env.NODE_ENV === 'test' * Is this the hosted version of the application */ export const isHosted = true - // getEnv('NEXT_PUBLIC_APP_URL') === 'https://www.sim.ai' || - // getEnv('NEXT_PUBLIC_APP_URL') === 'https://www.staging.sim.ai' +// getEnv('NEXT_PUBLIC_APP_URL') === 'https://www.sim.ai' || +// getEnv('NEXT_PUBLIC_APP_URL') === 'https://www.staging.sim.ai' /** * Is billing enforcement enabled