diff --git a/.prettierrc.js b/.prettierrc.js deleted file mode 100644 index 41708aec7a..0000000000 --- a/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -module.exports = { - semi: false, - singleQuote: true, - tabWidth: 2, - trailingComma: 'es5', - printWidth: 100, - bracketSpacing: true, - arrowParens: 'always', - endOfLine: 'lf', - plugins: ['prettier-plugin-tailwindcss', '@trivago/prettier-plugin-sort-imports'], - importOrder: [ - '^(react/(.*)$)|^(react$)', - '^(next/(.*)$)|^(next$)', - '', - '^@/components/(.*)$', - '^@/lib/(.*)$', - '^@/stores/(.*)$', - '^@/(.*)$', - '^[./]', - ], - importOrderSortSpecifiers: true, -} diff --git a/README.md b/README.md index 674e75db25..ad81e6ed5d 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,13 @@ Sim Studio Logo

-# Sim Studio - -[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) -[![Discord](https://img.shields.io/badge/Discord-Join%20Server-7289DA?logo=discord&logoColor=white)](https://discord.gg/pQKwMTvNrg) -[![Twitter](https://img.shields.io/twitter/follow/simstudio?style=social)](https://x.com/simstudioai) -[![PRs welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/simstudioai/sim/pulls) -[![support](https://img.shields.io/badge/support-contact%20author-purple.svg)](https://github.com/simstudioai/sim/issues) - +

+ License: MIT + Discord + Twitter + PRs welcome + support +

**Sim Studio** is a powerful, user-friendly platform for building, testing, and optimizing agentic workflows. diff --git a/.prettierignore b/sim/.prettierignore similarity index 92% rename from .prettierignore rename to sim/.prettierignore index 3a8d5a9735..70c1abe4ea 100644 --- a/.prettierignore +++ b/sim/.prettierignore @@ -34,4 +34,4 @@ coverage **/public/sw.js **/public/workbox-*.js **/public/worker-*.js -**/public/fallback-*.js \ No newline at end of file +**/public/fallback-*.js \ No newline at end of file diff --git a/sim/.prettierrc b/sim/.prettierrc new file mode 100644 index 0000000000..3b43f0b89d --- /dev/null +++ b/sim/.prettierrc @@ -0,0 +1,36 @@ +{ + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "es5", + "printWidth": 100, + "bracketSpacing": true, + "arrowParens": "always", + "endOfLine": "lf", + "useTabs": false, + "quoteProps": "as-needed", + "jsxSingleQuote": false, + "bracketSameLine": false, + "htmlWhitespaceSensitivity": "css", + "vueIndentScriptAndStyle": false, + "embeddedLanguageFormatting": "auto", + "singleAttributePerLine": false, + "plugins": ["prettier-plugin-tailwindcss", "@trivago/prettier-plugin-sort-imports"], + "importOrder": [ + "^(react/(.*)$)|^(react$)", + "^(next/(.*)$)|^(next$)", + "", + "^@/components/(.*)$", + "^@/lib/(.*)$", + "^@/stores/(.*)$", + "^@/hooks/(.*)$", + "^@/utils/(.*)$", + "^@/types/(.*)$", + "^@/styles/(.*)$", + "^@/(.*)$", + "^[./]" + ], + "importOrderSortSpecifiers": true, + "importOrderCaseInsensitive": true, + "importOrderParserPlugins": ["typescript", "jsx", "decorators-legacy"] +} diff --git a/sim/app/(auth)/login/page.tsx b/sim/app/(auth)/login/page.tsx index 9a2991c71c..6d3d267fab 100644 --- a/sim/app/(auth)/login/page.tsx +++ b/sim/app/(auth)/login/page.tsx @@ -33,7 +33,11 @@ export default function LoginPage() { const password = formData.get('password') as string try { - const result = await client.signIn.email({ email, password, callbackURL: '/w' }) + const result = await client.signIn.email({ + email, + password, + callbackURL: '/w', + }) if (!result || result.error) { throw new Error(result?.error?.message || 'Authentication failed') diff --git a/sim/app/api/auth/oauth/connections/route.ts b/sim/app/api/auth/oauth/connections/route.ts index 736291b17c..78ea654428 100644 --- a/sim/app/api/auth/oauth/connections/route.ts +++ b/sim/app/api/auth/oauth/connections/route.ts @@ -67,7 +67,9 @@ export async function GET(request: NextRequest) { displayName = decoded.name } } catch (error) { - logger.warn(`[${requestId}] Error decoding ID token`, { accountId: acc.id }) + logger.warn(`[${requestId}] Error decoding ID token`, { + accountId: acc.id, + }) } } diff --git a/sim/app/api/auth/oauth/credentials/route.ts b/sim/app/api/auth/oauth/credentials/route.ts index f82ceb9588..7107156024 100644 --- a/sim/app/api/auth/oauth/credentials/route.ts +++ b/sim/app/api/auth/oauth/credentials/route.ts @@ -69,7 +69,9 @@ export async function GET(request: NextRequest) { displayName = decoded.name } } catch (error) { - logger.warn(`[${requestId}] Error decoding ID token`, { accountId: acc.id }) + logger.warn(`[${requestId}] Error decoding ID token`, { + accountId: acc.id, + }) } } @@ -91,7 +93,9 @@ export async function GET(request: NextRequest) { displayName = userRecord[0].email } } catch (error) { - logger.warn(`[${requestId}] Error fetching user email`, { userId: acc.userId }) + logger.warn(`[${requestId}] Error fetching user email`, { + userId: acc.userId, + }) } } diff --git a/sim/app/api/auth/oauth/drive/file/route.ts b/sim/app/api/auth/oauth/drive/file/route.ts index 94150b305c..535fb8a26f 100644 --- a/sim/app/api/auth/oauth/drive/file/route.ts +++ b/sim/app/api/auth/oauth/drive/file/route.ts @@ -121,7 +121,9 @@ export async function GET(request: NextRequest) { fileId, }) return NextResponse.json( - { error: error.error?.message || 'Failed to fetch file from Google Drive' }, + { + error: error.error?.message || 'Failed to fetch file from Google Drive', + }, { status: response.status } ) } diff --git a/sim/app/api/auth/oauth/drive/files/route.ts b/sim/app/api/auth/oauth/drive/files/route.ts index 6b5c9454f8..a6bac03301 100644 --- a/sim/app/api/auth/oauth/drive/files/route.ts +++ b/sim/app/api/auth/oauth/drive/files/route.ts @@ -57,7 +57,9 @@ export async function GET(request: NextRequest) { // Check if the access token is valid if (!credential.accessToken) { - logger.warn(`[${requestId}] No access token available for credential`, { credentialId }) + logger.warn(`[${requestId}] No access token available for credential`, { + credentialId, + }) return NextResponse.json({ error: 'No access token available' }, { status: 400 }) } @@ -140,7 +142,9 @@ export async function GET(request: NextRequest) { error: error.error?.message || 'Failed to fetch files from Google Drive', }) return NextResponse.json( - { error: error.error?.message || 'Failed to fetch files from Google Drive' }, + { + error: error.error?.message || 'Failed to fetch files from Google Drive', + }, { status: response.status } ) } diff --git a/sim/app/api/chat/route.ts b/sim/app/api/chat/route.ts index 4bbfa140f4..933f6ddb96 100644 --- a/sim/app/api/chat/route.ts +++ b/sim/app/api/chat/route.ts @@ -180,7 +180,9 @@ export async function POST(request: Request) { // Process tool calls if present if (message.tool_calls) { - logger.debug(`[${requestId}] Tool calls:`, { toolCalls: message.tool_calls }) + logger.debug(`[${requestId}] Tool calls:`, { + toolCalls: message.tool_calls, + }) const actions = message.tool_calls.map((call) => ({ name: call.function.name, parameters: JSON.parse(call.function.arguments), diff --git a/sim/app/api/db/settings/route.ts b/sim/app/api/db/settings/route.ts index f74796df38..cc263c7e14 100644 --- a/sim/app/api/db/settings/route.ts +++ b/sim/app/api/db/settings/route.ts @@ -83,7 +83,9 @@ export async function GET(request: Request) { ) } - const generalSettings = result[0].general as { isAutoConnectEnabled: boolean } + const generalSettings = result[0].general as { + isAutoConnectEnabled: boolean + } return NextResponse.json( { data: { diff --git a/sim/app/api/db/workflow-logs/route.ts b/sim/app/api/db/workflow-logs/route.ts index 46eeb78a46..ac96de1b60 100644 --- a/sim/app/api/db/workflow-logs/route.ts +++ b/sim/app/api/db/workflow-logs/route.ts @@ -1,5 +1,5 @@ import { NextRequest, NextResponse } from 'next/server' -import { SQL, and, eq, gte, lte, or, sql } from 'drizzle-orm' +import { and, eq, gte, lte, or, SQL, sql } from 'drizzle-orm' import { z } from 'zod' import { getSession } from '@/lib/auth' import { createLogger } from '@/lib/logs/console-logger' @@ -166,7 +166,10 @@ export async function GET(request: NextRequest) { errors: validationError.errors, }) return NextResponse.json( - { error: 'Invalid request parameters', details: validationError.errors }, + { + error: 'Invalid request parameters', + details: validationError.errors, + }, { status: 400 } ) } diff --git a/sim/app/api/db/workflow/route.ts b/sim/app/api/db/workflow/route.ts index 89cc79ee79..be33c00988 100644 --- a/sim/app/api/db/workflow/route.ts +++ b/sim/app/api/db/workflow/route.ts @@ -79,14 +79,19 @@ export async function POST(req: NextRequest) { .select() .from(workflow) .where(eq(workflow.userId, session.user.id)) - + // If user has existing workflows, but client sends empty, reject the sync if (existingWorkflows.length > 0) { - logger.warn(`[${requestId}] Prevented data loss: Client attempted to sync empty workflows while DB has ${existingWorkflows.length} workflows`) - return NextResponse.json({ - error: 'Sync rejected to prevent data loss', - message: 'Client sent empty workflows, but user has existing workflows in database' - }, { status: 409 }) + logger.warn( + `[${requestId}] Prevented data loss: Client attempted to sync empty workflows while DB has ${existingWorkflows.length} workflows` + ) + return NextResponse.json( + { + error: 'Sync rejected to prevent data loss', + message: 'Client sent empty workflows, but user has existing workflows in database', + }, + { status: 409 } + ) } } diff --git a/sim/app/api/function/execute/route.ts b/sim/app/api/function/execute/route.ts index cba570185f..72fec7cbd1 100644 --- a/sim/app/api/function/execute/route.ts +++ b/sim/app/api/function/execute/route.ts @@ -1,5 +1,5 @@ import { NextRequest, NextResponse } from 'next/server' -import { Script, createContext } from 'vm' +import { createContext, Script } from 'vm' import { createLogger } from '@/lib/logs/console-logger' // Explicitly export allowed methods @@ -101,7 +101,9 @@ export async function POST(req: NextRequest) { }) const executionTime = Date.now() - startTime - logger.info(`[${requestId}] Function executed successfully`, { executionTime }) + logger.info(`[${requestId}] Function executed successfully`, { + executionTime, + }) const response = { success: true, diff --git a/sim/app/api/webhooks/route.ts b/sim/app/api/webhooks/route.ts index c8da20f09c..09956921df 100644 --- a/sim/app/api/webhooks/route.ts +++ b/sim/app/api/webhooks/route.ts @@ -104,7 +104,10 @@ export async function POST(request: NextRequest) { requestedWorkflowId: workflowId, }) return NextResponse.json( - { error: 'Webhook path already exists. Please use a different path.', code: 'PATH_EXISTS' }, + { + error: 'Webhook path already exists. Please use a different path.', + code: 'PATH_EXISTS', + }, { status: 409 } ) } diff --git a/sim/app/api/webhooks/trigger/[path]/route.ts b/sim/app/api/webhooks/trigger/[path]/route.ts index b0e11f5d9f..0969eced3a 100644 --- a/sim/app/api/webhooks/trigger/[path]/route.ts +++ b/sim/app/api/webhooks/trigger/[path]/route.ts @@ -97,7 +97,9 @@ export async function GET(request: NextRequest, { params }: { params: Promise<{ return new NextResponse('OK', { status: 200 }) } catch (error: any) { logger.error(`[${requestId}] Error processing webhook verification`, error) - return new NextResponse(`Internal Server Error: ${error.message}`, { status: 500 }) + return new NextResponse(`Internal Server Error: ${error.message}`, { + status: 500, + }) } finally { // Ensure Redis connection is properly closed in serverless environment await closeRedisConnection() @@ -214,7 +216,9 @@ export async function POST( await persistExecutionError(foundWorkflow.id, executionId, error, 'webhook') } - return new NextResponse(`Internal Server Error: ${error.message}`, { status: 500 }) + return new NextResponse(`Internal Server Error: ${error.message}`, { + status: 500, + }) } finally { // Ensure Redis connection is properly closed in serverless environment await closeRedisConnection() @@ -519,6 +523,8 @@ async function processWebhook( await persistExecutionError(foundWorkflow.id, executionId, error, 'webhook') } - return new NextResponse(`Internal Server Error: ${error.message}`, { status: 500 }) + return new NextResponse(`Internal Server Error: ${error.message}`, { + status: 500, + }) } } diff --git a/sim/app/api/workflow/[id]/deploy/route.ts b/sim/app/api/workflow/[id]/deploy/route.ts index 6f81f7eb27..86a4ee2a1c 100644 --- a/sim/app/api/workflow/[id]/deploy/route.ts +++ b/sim/app/api/workflow/[id]/deploy/route.ts @@ -74,7 +74,11 @@ export async function DELETE( .where(eq(workflow.id, id)) logger.info(`[${requestId}] Workflow undeployed successfully: ${id}`) - return createSuccessResponse({ isDeployed: false, deployedAt: null, apiKey: null }) + return createSuccessResponse({ + isDeployed: false, + deployedAt: null, + apiKey: null, + }) } catch (error: any) { logger.error(`[${requestId}] Error undeploying workflow: ${id}`, error) return createErrorResponse(error.message || 'Failed to undeploy workflow', 500) diff --git a/sim/app/api/workflow/[id]/log/route.ts b/sim/app/api/workflow/[id]/log/route.ts index 7a8d0fc705..1eb6543291 100644 --- a/sim/app/api/workflow/[id]/log/route.ts +++ b/sim/app/api/workflow/[id]/log/route.ts @@ -33,7 +33,9 @@ export async function POST(request: NextRequest, { params }: { params: Promise<{ // Use persistExecutionLogs which handles tool call extraction await persistExecutionLogs(id, executionId, result, 'manual') - return createSuccessResponse({ message: 'Execution logs persisted successfully' }) + return createSuccessResponse({ + message: 'Execution logs persisted successfully', + }) } // Fall back to the original log format if 'result' isn't provided diff --git a/sim/app/blocks/blocks/pinecone.ts b/sim/app/blocks/blocks/pinecone.ts index 8154c65616..d81d796bee 100644 --- a/sim/app/blocks/blocks/pinecone.ts +++ b/sim/app/blocks/blocks/pinecone.ts @@ -36,7 +36,10 @@ export const PineconeBlock: BlockConfig = { options: [ { label: 'multilingual-e5-large', id: 'multilingual-e5-large' }, { label: 'llama-text-embed-v2', id: 'llama-text-embed-v2' }, - { label: 'pinecone-sparse-english-v0', id: 'pinecone-sparse-english-v0' }, + { + label: 'pinecone-sparse-english-v0', + id: 'pinecone-sparse-english-v0', + }, ], condition: { field: 'operation', value: 'generate' }, }, diff --git a/sim/app/components/ui/alert.tsx b/sim/app/components/ui/alert.tsx index ff485e8e52..86fe712035 100644 --- a/sim/app/components/ui/alert.tsx +++ b/sim/app/components/ui/alert.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import { type VariantProps, cva } from 'class-variance-authority' +import { cva, type VariantProps } from 'class-variance-authority' import { cn } from '@/lib/utils' const alertVariants = cva( diff --git a/sim/app/components/ui/badge.tsx b/sim/app/components/ui/badge.tsx index fe62efb1f7..0fb2df71fc 100644 --- a/sim/app/components/ui/badge.tsx +++ b/sim/app/components/ui/badge.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import { type VariantProps, cva } from 'class-variance-authority' +import { cva, type VariantProps } from 'class-variance-authority' import { cn } from '@/lib/utils' const badgeVariants = cva( diff --git a/sim/app/components/ui/button.tsx b/sim/app/components/ui/button.tsx index abbe565de1..7ece855e4b 100644 --- a/sim/app/components/ui/button.tsx +++ b/sim/app/components/ui/button.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import { Slot } from '@radix-ui/react-slot' -import { type VariantProps, cva } from 'class-variance-authority' +import { cva, type VariantProps } from 'class-variance-authority' import { cn } from '@/lib/utils' const buttonVariants = cva( diff --git a/sim/app/components/ui/command.tsx b/sim/app/components/ui/command.tsx index 8c766f98c4..b06c89ee88 100644 --- a/sim/app/components/ui/command.tsx +++ b/sim/app/components/ui/command.tsx @@ -12,6 +12,30 @@ import { cn } from '@/lib/utils' // This file is not typed correctly from shadcn, so we're disabling the type checker // @ts-nocheck +// This file is not typed correctly from shadcn, so we're disabling the type checker +// @ts-nocheck + +// This file is not typed correctly from shadcn, so we're disabling the type checker +// @ts-nocheck + +// This file is not typed correctly from shadcn, so we're disabling the type checker +// @ts-nocheck + +// This file is not typed correctly from shadcn, so we're disabling the type checker +// @ts-nocheck + +// This file is not typed correctly from shadcn, so we're disabling the type checker +// @ts-nocheck + +// This file is not typed correctly from shadcn, so we're disabling the type checker +// @ts-nocheck + +// This file is not typed correctly from shadcn, so we're disabling the type checker +// @ts-nocheck + +// This file is not typed correctly from shadcn, so we're disabling the type checker +// @ts-nocheck + const Command = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef & { diff --git a/sim/app/components/ui/dialog.tsx b/sim/app/components/ui/dialog.tsx index 85c7287eda..1c570749b2 100644 --- a/sim/app/components/ui/dialog.tsx +++ b/sim/app/components/ui/dialog.tsx @@ -30,7 +30,9 @@ DialogOverlay.displayName = DialogPrimitive.Overlay.displayName const DialogContent = React.forwardRef< React.ElementRef, - React.ComponentPropsWithoutRef & { hideCloseButton?: boolean } + React.ComponentPropsWithoutRef & { + hideCloseButton?: boolean + } >(({ className, children, hideCloseButton = false, ...props }, ref) => ( diff --git a/sim/app/components/ui/label.tsx b/sim/app/components/ui/label.tsx index 3c2b019f97..200a9e240f 100644 --- a/sim/app/components/ui/label.tsx +++ b/sim/app/components/ui/label.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import * as LabelPrimitive from '@radix-ui/react-label' -import { type VariantProps, cva } from 'class-variance-authority' +import { cva, type VariantProps } from 'class-variance-authority' import { cn } from '@/lib/utils' const labelVariants = cva( diff --git a/sim/app/components/ui/sheet.tsx b/sim/app/components/ui/sheet.tsx index d0b23bfc75..2651d11df0 100644 --- a/sim/app/components/ui/sheet.tsx +++ b/sim/app/components/ui/sheet.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import * as SheetPrimitive from '@radix-ui/react-dialog' -import { type VariantProps, cva } from 'class-variance-authority' +import { cva, type VariantProps } from 'class-variance-authority' import { X } from 'lucide-react' import { cn } from '@/lib/utils' diff --git a/sim/app/db/migrations/schema.ts b/sim/app/db/migrations/schema.ts index 9222ff2e3d..7575634b58 100644 --- a/sim/app/db/migrations/schema.ts +++ b/sim/app/db/migrations/schema.ts @@ -34,8 +34,12 @@ export const account = pgTable( accessToken: text('access_token'), refreshToken: text('refresh_token'), idToken: text('id_token'), - accessTokenExpiresAt: timestamp('access_token_expires_at', { mode: 'string' }), - refreshTokenExpiresAt: timestamp('refresh_token_expires_at', { mode: 'string' }), + accessTokenExpiresAt: timestamp('access_token_expires_at', { + mode: 'string', + }), + refreshTokenExpiresAt: timestamp('refresh_token_expires_at', { + mode: 'string', + }), scope: text(), password: text(), createdAt: timestamp('created_at', { mode: 'string' }).notNull(), diff --git a/sim/app/executor/__test-utils__/test-executor.ts b/sim/app/executor/__test-utils__/test-executor.ts index f377fb47a5..4a25415edb 100644 --- a/sim/app/executor/__test-utils__/test-executor.ts +++ b/sim/app/executor/__test-utils__/test-executor.ts @@ -25,7 +25,9 @@ export class TestExecutor extends Executor { // Return a successful result return { success: true, - output: { response: { result: 'Test execution completed' } } as NormalizedBlockOutput, + output: { + response: { result: 'Test execution completed' }, + } as NormalizedBlockOutput, logs: [], metadata: { duration: 100, diff --git a/sim/app/executor/index.ts b/sim/app/executor/index.ts index 9f30d03415..a715a9bc1c 100644 --- a/sim/app/executor/index.ts +++ b/sim/app/executor/index.ts @@ -489,7 +489,11 @@ export class Executor { content: '', model: '', tokens: { prompt: 0, completion: 0, total: 0 }, - selectedPath: output?.selectedPath || { blockId: '', blockType: '', blockTitle: '' }, + selectedPath: output?.selectedPath || { + blockId: '', + blockType: '', + blockTitle: '', + }, }, } } @@ -513,7 +517,11 @@ export class Executor { return { response: { conditionResult: output?.conditionResult || false, - selectedPath: output?.selectedPath || { blockId: '', blockType: '', blockTitle: '' }, + selectedPath: output?.selectedPath || { + blockId: '', + blockType: '', + blockTitle: '', + }, selectedConditionId: output?.selectedConditionId || '', }, } diff --git a/sim/app/lib/auth.ts b/sim/app/lib/auth.ts index 76f2e0d33c..08a7d439ef 100644 --- a/sim/app/lib/auth.ts +++ b/sim/app/lib/auth.ts @@ -14,7 +14,11 @@ const logger = createLogger('Auth') // In that case, we don't want to send emails and just log them const resend = process.env.RESEND_API_KEY ? new Resend(process.env.RESEND_API_KEY) - : { emails: { send: async (...args: any[]) => logger.info('Email sent:', args) } } + : { + emails: { + send: async (...args: any[]) => logger.info('Email sent:', args), + }, + } export const auth = betterAuth({ database: drizzleAdapter(db, { diff --git a/sim/app/lib/logs/execution-logger.ts b/sim/app/lib/logs/execution-logger.ts index 75260a5115..291947ab65 100644 --- a/sim/app/lib/logs/execution-logger.ts +++ b/sim/app/lib/logs/execution-logger.ts @@ -76,7 +76,9 @@ export async function persistExecutionLogs( // Case 1: Direct toolCalls array if (Array.isArray(log.output.toolCalls)) { - logger.debug('Found direct toolCalls array', { count: log.output.toolCalls.length }) + logger.debug('Found direct toolCalls array', { + count: log.output.toolCalls.length, + }) // Log raw timing data for debugging log.output.toolCalls.forEach((tc: any, idx: number) => { @@ -172,7 +174,9 @@ export async function persistExecutionLogs( ? log.output.response.toolCalls : log.output.response.toolCalls.list || [] - logger.debug('Found toolCalls in response', { count: toolCalls.length }) + logger.debug('Found toolCalls in response', { + count: toolCalls.length, + }) // Log raw timing data for debugging toolCalls.forEach((tc: any, idx: number) => { @@ -409,7 +413,9 @@ export async function persistExecutionLogs( }, }) } catch (error: any) { - logger.error(`Error persisting execution logs: ${error.message}`, { error }) + logger.error(`Error persisting execution logs: ${error.message}`, { + error, + }) } } @@ -440,7 +446,9 @@ export async function persistExecutionError( createdAt: new Date(), }) } catch (logError: any) { - logger.error(`Error persisting execution error log: ${logError.message}`, { logError }) + logger.error(`Error persisting execution error log: ${logError.message}`, { + logError, + }) } } diff --git a/sim/app/lib/oauth.ts b/sim/app/lib/oauth.ts index ab19c020fe..9c932a571a 100644 --- a/sim/app/lib/oauth.ts +++ b/sim/app/lib/oauth.ts @@ -342,7 +342,10 @@ export async function refreshOAuthToken( if (!response.ok) { const errorText = await response.text() - logger.error('Token refresh failed:', { status: response.status, error: errorText }) + logger.error('Token refresh failed:', { + status: response.status, + error: errorText, + }) throw new Error(`Failed to refresh token: ${response.status} ${errorText}`) } diff --git a/sim/app/lib/webcontainer.ts b/sim/app/lib/webcontainer.ts index cbc78d5e95..539594d1df 100644 --- a/sim/app/lib/webcontainer.ts +++ b/sim/app/lib/webcontainer.ts @@ -337,7 +337,9 @@ export async function executeCode( try { await process.kill() } catch (killError) { - logger.error('WebContainer executeCode - Failed to kill process:', { killError }) + logger.error('WebContainer executeCode - Failed to kill process:', { + killError, + }) } } diff --git a/sim/app/providers/anthropic/index.ts b/sim/app/providers/anthropic/index.ts index 6efc7ff024..0f5f5449f5 100644 --- a/sim/app/providers/anthropic/index.ts +++ b/sim/app/providers/anthropic/index.ts @@ -419,7 +419,10 @@ ${fieldDescriptions} const providerEndTimeISO = new Date(providerEndTime).toISOString() const totalDuration = providerEndTime - providerStartTime - logger.error('Error in Anthropic request:', { error, duration: totalDuration }) + logger.error('Error in Anthropic request:', { + error, + duration: totalDuration, + }) // Create a new error with timing information const enhancedError = new Error(error instanceof Error ? error.message : String(error)) diff --git a/sim/app/providers/cerebras/index.ts b/sim/app/providers/cerebras/index.ts index 4b61ef6781..f890c44d2d 100644 --- a/sim/app/providers/cerebras/index.ts +++ b/sim/app/providers/cerebras/index.ts @@ -344,7 +344,10 @@ export const cerebrasProvider: ProviderConfig = { const providerEndTimeISO = new Date(providerEndTime).toISOString() const totalDuration = providerEndTime - providerStartTime - logger.error('Error in Cerebras request:', { error, duration: totalDuration }) + logger.error('Error in Cerebras request:', { + error, + duration: totalDuration, + }) // Create a new error with timing information const enhancedError = new Error(error instanceof Error ? error.message : String(error)) diff --git a/sim/app/providers/deepseek/index.ts b/sim/app/providers/deepseek/index.ts index 1ad4f19762..9ca181770a 100644 --- a/sim/app/providers/deepseek/index.ts +++ b/sim/app/providers/deepseek/index.ts @@ -277,7 +277,10 @@ export const deepseekProvider: ProviderConfig = { const providerEndTimeISO = new Date(providerEndTime).toISOString() const totalDuration = providerEndTime - providerStartTime - logger.error('Error in Deepseek request:', { error, duration: totalDuration }) + logger.error('Error in Deepseek request:', { + error, + duration: totalDuration, + }) // Create a new error with timing information const enhancedError = new Error(error instanceof Error ? error.message : String(error)) diff --git a/sim/app/providers/google/index.ts b/sim/app/providers/google/index.ts index b89b5f4d4b..552ba6d430 100644 --- a/sim/app/providers/google/index.ts +++ b/sim/app/providers/google/index.ts @@ -275,7 +275,10 @@ export const googleProvider: ProviderConfig = { const providerEndTimeISO = new Date(providerEndTime).toISOString() const totalDuration = providerEndTime - providerStartTime - logger.error('Error in Google Gemini request:', { error, duration: totalDuration }) + logger.error('Error in Google Gemini request:', { + error, + duration: totalDuration, + }) // Create a new error with timing information const enhancedError = new Error(error instanceof Error ? error.message : String(error)) diff --git a/sim/app/providers/groq/index.ts b/sim/app/providers/groq/index.ts index a2395ea12a..44b175079e 100644 --- a/sim/app/providers/groq/index.ts +++ b/sim/app/providers/groq/index.ts @@ -272,7 +272,10 @@ export const groqProvider: ProviderConfig = { const providerEndTimeISO = new Date(providerEndTime).toISOString() const totalDuration = providerEndTime - providerStartTime - logger.error('Error in Groq request:', { error, duration: totalDuration }) + logger.error('Error in Groq request:', { + error, + duration: totalDuration, + }) // Create a new error with timing information const enhancedError = new Error(error instanceof Error ? error.message : String(error)) diff --git a/sim/app/providers/openai/index.ts b/sim/app/providers/openai/index.ts index ab3fe132fa..6a0791af88 100644 --- a/sim/app/providers/openai/index.ts +++ b/sim/app/providers/openai/index.ts @@ -298,7 +298,10 @@ export const openaiProvider: ProviderConfig = { const providerEndTimeISO = new Date(providerEndTime).toISOString() const totalDuration = providerEndTime - providerStartTime - logger.error('Error in OpenAI request:', { error, duration: totalDuration }) + logger.error('Error in OpenAI request:', { + error, + duration: totalDuration, + }) // Create a new error with timing information const enhancedError = new Error(error instanceof Error ? error.message : String(error)) diff --git a/sim/app/stores/chat/store.ts b/sim/app/stores/chat/store.ts index edc28c95f9..b092edb23b 100644 --- a/sim/app/stores/chat/store.ts +++ b/sim/app/stores/chat/store.ts @@ -137,7 +137,9 @@ export const useChatStore = create()( } } catch (error) { logger.error('Chat error:', { error }) - set({ error: error instanceof Error ? error.message : 'Unknown error' }) + set({ + error: error instanceof Error ? error.message : 'Unknown error', + }) } finally { set({ isProcessing: false }) } diff --git a/sim/app/stores/index.ts b/sim/app/stores/index.ts index eea74cca3b..e7331c4622 100644 --- a/sim/app/stores/index.ts +++ b/sim/app/stores/index.ts @@ -52,7 +52,7 @@ async function initializeApplication(): Promise { // This is a fallback in case DB sync failed or there's no data in DB const registryState = useWorkflowRegistry.getState() const hasDbWorkflows = Object.keys(registryState.workflows).length > 0 - + if (!hasDbWorkflows) { // No workflows loaded from DB, try localStorage as fallback const workflows = loadRegistry() @@ -65,11 +65,11 @@ async function initializeApplication(): Promise { initializeWorkflowState(activeWorkflowId) } } else if (isNewLoginSession) { - // Critical safeguard: For new login sessions with no DB workflows + // Critical safeguard: For new login sessions with no DB workflows // and no localStorage, we disable sync temporarily to prevent data loss logger.info('New login session with no workflows - preventing initial sync') const syncManagers = getSyncManagers() - syncManagers.forEach(manager => manager.stopIntervalSync()) + syncManagers.forEach((manager) => manager.stopIntervalSync()) } } else { logger.info('Using workflows loaded from DB, ignoring localStorage') @@ -242,7 +242,11 @@ export const resetAllStores = () => { useWorkflowStore.getState().clear() useSubBlockStore.getState().clear() useNotificationStore.setState({ notifications: [] }) - useEnvironmentStore.setState({ variables: {}, isLoading: false, error: null }) + useEnvironmentStore.setState({ + variables: {}, + isLoading: false, + error: null, + }) useExecutionStore.getState().reset() useConsoleStore.setState({ entries: [], isOpen: false }) useChatStore.setState({ messages: [], isProcessing: false, error: null }) @@ -279,13 +283,13 @@ export async function reinitializeAfterLogin(): Promise { try { // Reset sync managers to prevent any active syncs during reinitialization resetSyncManagers() - + // Clean existing state to avoid stale data resetAllStores() - + // Mark as a new login session sessionStorage.removeItem('app_initialized') - + // Reset initialization flags to force a fresh load isInitializing = false diff --git a/sim/app/stores/settings/general/store.ts b/sim/app/stores/settings/general/store.ts index ab0ce53dbd..1f845395d0 100644 --- a/sim/app/stores/settings/general/store.ts +++ b/sim/app/stores/settings/general/store.ts @@ -23,7 +23,9 @@ export const useGeneralStore = create()( isDebugModeEnabled: false, theme: 'system', toggleAutoConnect: () => - set((state) => ({ isAutoConnectEnabled: !state.isAutoConnectEnabled })), + set((state) => ({ + isAutoConnectEnabled: !state.isAutoConnectEnabled, + })), toggleDebugMode: () => set((state) => ({ isDebugModeEnabled: !state.isDebugModeEnabled })), setTheme: (theme: 'system' | 'light' | 'dark') => set({ theme }), }), diff --git a/sim/app/stores/sync-core.ts b/sim/app/stores/sync-core.ts index 93c839ee57..8b39eec6bf 100644 --- a/sim/app/stores/sync-core.ts +++ b/sim/app/stores/sync-core.ts @@ -58,7 +58,10 @@ export async function performSync(config: SyncConfig): Promise { if (isLocalStorageMode()) { // Still call onSyncSuccess to maintain expected behavior if (config.onSyncSuccess) { - config.onSyncSuccess({ success: true, message: 'Skipped sync in localStorage mode' }) + config.onSyncSuccess({ + success: true, + message: 'Skipped sync in localStorage mode', + }) } return true } diff --git a/sim/app/stores/sync.ts b/sim/app/stores/sync.ts index 790b0a6987..ddc2356795 100644 --- a/sim/app/stores/sync.ts +++ b/sim/app/stores/sync.ts @@ -5,10 +5,10 @@ import { createLogger } from '@/lib/logs/console-logger' import { SYNC_INTERVALS } from './constants' import { DEFAULT_SYNC_CONFIG, - SyncConfig, - SyncOperations, isLocalStorageMode, performSync, + SyncConfig, + SyncOperations, } from './sync-core' const logger = createLogger('Sync') diff --git a/sim/app/stores/workflows/registry/store.ts b/sim/app/stores/workflows/registry/store.ts index 00256efe42..905d968b74 100644 --- a/sim/app/stores/workflows/registry/store.ts +++ b/sim/app/stores/workflows/registry/store.ts @@ -338,7 +338,13 @@ export const useWorkflowRegistry = create()( history: history || { past: [], present: { - state: { blocks, edges, loops, isDeployed: isDeployed || false, deployedAt }, + state: { + blocks, + edges, + loops, + isDeployed: isDeployed || false, + deployedAt, + }, timestamp: Date.now(), action: 'Initial state', subblockValues: {}, diff --git a/sim/app/stores/workflows/sync.ts b/sim/app/stores/workflows/sync.ts index 399b8ba6fa..5360613173 100644 --- a/sim/app/stores/workflows/sync.ts +++ b/sim/app/stores/workflows/sync.ts @@ -28,14 +28,14 @@ const scheduledWorkflows = new Set() */ export function isActivelyLoadingFromDB(): boolean { if (!loadingFromDBToken) return false - + // Safety check: ensure loading doesn't block syncs indefinitely const elapsedTime = Date.now() - loadingFromDBStartTime if (elapsedTime > LOADING_TIMEOUT) { loadingFromDBToken = null return false } - + return true } @@ -94,7 +94,9 @@ async function updateWorkflowSchedule(workflowId: string, state: any): Promise { setTimeout(() => { isLoadingFromDB = false loadingFromDBToken = null - + // Verify if registry has workflows as a final check const registryWorkflows = useWorkflowRegistry.getState().workflows const workflowCount = Object.keys(registryWorkflows).length logger.info(`DB loading complete. Workflows in registry: ${workflowCount}`) - + // Trigger one final sync to ensure consistency if (workflowCount > 0) { // Small delay for state to fully settle before allowing syncs @@ -275,10 +277,12 @@ export const workflowSync = createSingletonSyncManager('workflow-sync', () => ({ // Safety check: if registry has workflows but we're sending empty data, something is wrong const registryWorkflows = useWorkflowRegistry.getState().workflows if (Object.keys(registryWorkflows).length > 0) { - logger.warn('Potential data loss prevented: Registry has workflows but sync payload is empty') + logger.warn( + 'Potential data loss prevented: Registry has workflows but sync payload is empty' + ) return { skipSync: true } } - + logger.info('Skipping workflow sync - no workflows to sync') return { skipSync: true } } diff --git a/sim/app/stores/workflows/workflow/store.ts b/sim/app/stores/workflows/workflow/store.ts index b74dc3e0f0..61edd705cc 100644 --- a/sim/app/stores/workflows/workflow/store.ts +++ b/sim/app/stores/workflows/workflow/store.ts @@ -3,7 +3,7 @@ import { create } from 'zustand' import { devtools } from 'zustand/middleware' import { getBlock } from '@/blocks' import { resolveOutputType } from '@/blocks/utils' -import { WorkflowStoreWithHistory, pushHistory, withHistory } from '../middleware' +import { pushHistory, withHistory, WorkflowStoreWithHistory } from '../middleware' import { saveWorkflowState } from '../persistence' import { useWorkflowRegistry } from '../registry/store' import { useSubBlockStore } from '../subblock/store' diff --git a/sim/app/tools/docs/create.ts b/sim/app/tools/docs/create.ts index 66bdb2de39..b181af0e26 100644 --- a/sim/app/tools/docs/create.ts +++ b/sim/app/tools/docs/create.ts @@ -125,7 +125,9 @@ export const createTool: ToolConfig ({ id: t.id, title: t.title })) + const availableTools = allTools.map((t) => ({ + id: t.id, + title: t.title, + })) logger.error('Available custom tools:', availableTools) logger.error(`Looking for custom tool with identifier: ${identifier}`) @@ -570,7 +575,9 @@ async function handleInternalRequest( } } } catch (transformError) { - logger.error(`Error transforming error for tool ${toolId}:`, { transformError }) + logger.error(`Error transforming error for tool ${toolId}:`, { + transformError, + }) return { success: false, output: {}, @@ -592,7 +599,11 @@ async function handleInternalRequest( */ function validateClientSideParams( params: Record, - schema: { type: string; properties: Record; required?: string[] } + schema: { + type: string + properties: Record + required?: string[] + } ) { if (!schema || schema.type !== 'object') { throw new Error('Invalid schema format') diff --git a/sim/app/tools/openai/embeddings.ts b/sim/app/tools/openai/embeddings.ts index 636bf9cd6f..e6893a6824 100644 --- a/sim/app/tools/openai/embeddings.ts +++ b/sim/app/tools/openai/embeddings.ts @@ -16,7 +16,11 @@ export const embeddingsTool: ToolConfig = { params: { apiKey: { type: 'string', required: true, description: 'OpenAI API key' }, - input: { type: 'string', required: true, description: 'Text to generate embeddings for' }, + input: { + type: 'string', + required: true, + description: 'Text to generate embeddings for', + }, model: { type: 'string', required: false, @@ -29,7 +33,11 @@ export const embeddingsTool: ToolConfig = { description: 'The format to return the embeddings in', default: 'float', }, - user: { type: 'string', required: false, description: 'A unique identifier for the end-user' }, + user: { + type: 'string', + required: false, + description: 'A unique identifier for the end-user', + }, }, request: { diff --git a/sim/app/tools/pinecone/fetch.ts b/sim/app/tools/pinecone/fetch.ts index 9f0ed01ca5..0d3ade3a2e 100644 --- a/sim/app/tools/pinecone/fetch.ts +++ b/sim/app/tools/pinecone/fetch.ts @@ -26,7 +26,11 @@ export const fetchTool: ToolConfig = { requiredForToolCall: true, description: 'Array of vector IDs to fetch', }, - namespace: { type: 'string', required: false, description: 'Namespace to fetch vectors from' }, + namespace: { + type: 'string', + required: false, + description: 'Namespace to fetch vectors from', + }, }, request: { diff --git a/sim/app/tools/pinecone/searchText.ts b/sim/app/tools/pinecone/searchText.ts index a82b303503..b22bf2e77c 100644 --- a/sim/app/tools/pinecone/searchText.ts +++ b/sim/app/tools/pinecone/searchText.ts @@ -20,12 +20,36 @@ export const searchTextTool: ToolConfig = { role: 'user', content: [ { type: 'text', text: prompt }, - { type: 'image', source: { type: 'url', url: params.imageUrl } }, + { + type: 'image', + source: { type: 'url', url: params.imageUrl }, + }, ], }, ], diff --git a/sim/app/w/[id]/components/workflow-block/components/sub-block/components/code.tsx b/sim/app/w/[id]/components/workflow-block/components/sub-block/components/code.tsx index 91777a9042..1ec56ca94e 100644 --- a/sim/app/w/[id]/components/workflow-block/components/sub-block/components/code.tsx +++ b/sim/app/w/[id]/components/workflow-block/components/sub-block/components/code.tsx @@ -4,8 +4,8 @@ import { highlight, languages } from 'prismjs' import 'prismjs/components/prism-javascript' import 'prismjs/themes/prism.css' import Editor from 'react-simple-code-editor' -import { EnvVarDropdown, checkEnvVarTrigger } from '@/components/ui/env-var-dropdown' -import { TagDropdown, checkTagTrigger } from '@/components/ui/tag-dropdown' +import { checkEnvVarTrigger, EnvVarDropdown } from '@/components/ui/env-var-dropdown' +import { checkTagTrigger, TagDropdown } from '@/components/ui/tag-dropdown' import { createLogger } from '@/lib/logs/console-logger' import { cn } from '@/lib/utils' import { useSubBlockValue } from '../hooks/use-sub-block-value' diff --git a/sim/app/w/[id]/components/workflow-block/components/sub-block/components/condition-input.tsx b/sim/app/w/[id]/components/workflow-block/components/sub-block/components/condition-input.tsx index 4c9cb67ce7..fdebdc5883 100644 --- a/sim/app/w/[id]/components/workflow-block/components/sub-block/components/condition-input.tsx +++ b/sim/app/w/[id]/components/workflow-block/components/sub-block/components/condition-input.tsx @@ -7,8 +7,8 @@ import 'prismjs/themes/prism.css' import Editor from 'react-simple-code-editor' import { Handle, Position, useUpdateNodeInternals } from 'reactflow' import { Button } from '@/components/ui/button' -import { EnvVarDropdown, checkEnvVarTrigger } from '@/components/ui/env-var-dropdown' -import { TagDropdown, checkTagTrigger } from '@/components/ui/tag-dropdown' +import { checkEnvVarTrigger, EnvVarDropdown } from '@/components/ui/env-var-dropdown' +import { checkTagTrigger, TagDropdown } from '@/components/ui/tag-dropdown' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' import { createLogger } from '@/lib/logs/console-logger' import { cn } from '@/lib/utils' @@ -43,7 +43,9 @@ export function ConditionInput({ blockId, subBlockId, isConnecting }: ConditionI const [cursorPosition, setCursorPosition] = useState(0) const [activeSourceBlockId, setActiveSourceBlockId] = useState(null) const editorRef = useRef(null) - const [visualLineHeights, setVisualLineHeights] = useState<{ [key: string]: number[] }>({}) + const [visualLineHeights, setVisualLineHeights] = useState<{ + [key: string]: number[] + }>({}) const updateNodeInternals = useUpdateNodeInternals() const removeEdge = useWorkflowStore((state) => state.removeEdge) const edges = useWorkflowStore((state) => state.edges) @@ -602,7 +604,11 @@ export function ConditionInput({ blockId, subBlockId, isConnecting }: ConditionI setConditionalBlocks((blocks) => blocks.map((b) => b.id === block.id - ? { ...b, showTags: false, activeSourceBlockId: null } + ? { + ...b, + showTags: false, + activeSourceBlockId: null, + } : b ) ) diff --git a/sim/app/w/[id]/components/workflow-block/components/sub-block/components/credential-selector/components/oauth-required-modal.tsx b/sim/app/w/[id]/components/workflow-block/components/sub-block/components/credential-selector/components/oauth-required-modal.tsx index 5acfe99557..0a81d82f05 100644 --- a/sim/app/w/[id]/components/workflow-block/components/sub-block/components/credential-selector/components/oauth-required-modal.tsx +++ b/sim/app/w/[id]/components/workflow-block/components/sub-block/components/credential-selector/components/oauth-required-modal.tsx @@ -13,10 +13,10 @@ import { import { client } from '@/lib/auth-client' import { createLogger } from '@/lib/logs/console-logger' import { - OAUTH_PROVIDERS, - OAuthProvider, getProviderIdFromServiceId, getServiceIdFromScopes, + OAUTH_PROVIDERS, + OAuthProvider, parseProvider, } from '@/lib/oauth' import { saveToStorage } from '@/stores/workflows/persistence' diff --git a/sim/app/w/[id]/components/workflow-block/components/sub-block/components/credential-selector/credential-selector.tsx b/sim/app/w/[id]/components/workflow-block/components/sub-block/components/credential-selector/credential-selector.tsx index 6f612a4245..ef406a9698 100644 --- a/sim/app/w/[id]/components/workflow-block/components/sub-block/components/credential-selector/credential-selector.tsx +++ b/sim/app/w/[id]/components/workflow-block/components/sub-block/components/credential-selector/credential-selector.tsx @@ -15,10 +15,10 @@ import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover import { createLogger } from '@/lib/logs/console-logger' import { Credential, - OAUTH_PROVIDERS, - OAuthProvider, getProviderIdFromServiceId, getServiceIdFromScopes, + OAUTH_PROVIDERS, + OAuthProvider, parseProvider, } from '@/lib/oauth' import { saveToStorage } from '@/stores/workflows/persistence' diff --git a/sim/app/w/[id]/components/workflow-block/components/sub-block/components/file-selector/components/google-drive-picker.tsx b/sim/app/w/[id]/components/workflow-block/components/sub-block/components/file-selector/components/google-drive-picker.tsx index 935cf6228e..fc5c35d3b2 100644 --- a/sim/app/w/[id]/components/workflow-block/components/sub-block/components/file-selector/components/google-drive-picker.tsx +++ b/sim/app/w/[id]/components/workflow-block/components/sub-block/components/file-selector/components/google-drive-picker.tsx @@ -16,11 +16,11 @@ import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover import { createLogger } from '@/lib/logs/console-logger' import { Credential, - OAUTH_PROVIDERS, - OAuthProvider, getProviderIdFromServiceId, getServiceByProviderAndId, getServiceIdFromScopes, + OAUTH_PROVIDERS, + OAuthProvider, parseProvider, } from '@/lib/oauth' import { saveToStorage } from '@/stores/workflows/persistence' @@ -153,7 +153,9 @@ export function GoogleDrivePicker({ return data.file } } else { - logger.error('Error fetching file by ID:', { error: await response.text() }) + logger.error('Error fetching file by ID:', { + error: await response.text(), + }) } return null } catch (error) { diff --git a/sim/app/w/[id]/components/workflow-block/components/sub-block/components/folder-selector/folder-selector.tsx b/sim/app/w/[id]/components/workflow-block/components/sub-block/components/folder-selector/folder-selector.tsx index a2a6d18116..5b949d574c 100644 --- a/sim/app/w/[id]/components/workflow-block/components/sub-block/components/folder-selector/folder-selector.tsx +++ b/sim/app/w/[id]/components/workflow-block/components/sub-block/components/folder-selector/folder-selector.tsx @@ -137,7 +137,9 @@ export function FolderSelector({ return data.label } } else { - logger.error('Error fetching folder by ID:', { error: await response.text() }) + logger.error('Error fetching folder by ID:', { + error: await response.text(), + }) } return null } catch (error) { @@ -187,7 +189,9 @@ export function FolderSelector({ } } } else { - logger.error('Error fetching folders:', { error: await response.text() }) + logger.error('Error fetching folders:', { + error: await response.text(), + }) setFolders([]) } } catch (error) { diff --git a/sim/app/w/[id]/components/workflow-block/components/sub-block/components/long-input.tsx b/sim/app/w/[id]/components/workflow-block/components/sub-block/components/long-input.tsx index d50eeb7709..70c98ca071 100644 --- a/sim/app/w/[id]/components/workflow-block/components/sub-block/components/long-input.tsx +++ b/sim/app/w/[id]/components/workflow-block/components/sub-block/components/long-input.tsx @@ -1,8 +1,8 @@ import { useRef, useState } from 'react' import { useReactFlow } from 'reactflow' -import { EnvVarDropdown, checkEnvVarTrigger } from '@/components/ui/env-var-dropdown' +import { checkEnvVarTrigger, EnvVarDropdown } from '@/components/ui/env-var-dropdown' import { formatDisplayText } from '@/components/ui/formatted-text' -import { TagDropdown, checkTagTrigger } from '@/components/ui/tag-dropdown' +import { checkTagTrigger, TagDropdown } from '@/components/ui/tag-dropdown' import { Textarea } from '@/components/ui/textarea' import { createLogger } from '@/lib/logs/console-logger' import { cn } from '@/lib/utils' diff --git a/sim/app/w/[id]/components/workflow-block/components/sub-block/components/short-input.tsx b/sim/app/w/[id]/components/workflow-block/components/sub-block/components/short-input.tsx index 2fda06d5af..e28d7ce8fc 100644 --- a/sim/app/w/[id]/components/workflow-block/components/sub-block/components/short-input.tsx +++ b/sim/app/w/[id]/components/workflow-block/components/sub-block/components/short-input.tsx @@ -1,9 +1,9 @@ import { useEffect, useMemo, useRef, useState } from 'react' import { useReactFlow } from 'reactflow' -import { EnvVarDropdown, checkEnvVarTrigger } from '@/components/ui/env-var-dropdown' +import { checkEnvVarTrigger, EnvVarDropdown } from '@/components/ui/env-var-dropdown' import { formatDisplayText } from '@/components/ui/formatted-text' import { Input } from '@/components/ui/input' -import { TagDropdown, checkTagTrigger } from '@/components/ui/tag-dropdown' +import { checkTagTrigger, TagDropdown } from '@/components/ui/tag-dropdown' import { createLogger } from '@/lib/logs/console-logger' import { cn } from '@/lib/utils' import { SubBlockConfig } from '@/blocks/types' diff --git a/sim/app/w/[id]/components/workflow-block/components/sub-block/components/table.tsx b/sim/app/w/[id]/components/workflow-block/components/sub-block/components/table.tsx index 17d359ab8e..b29dd274ef 100644 --- a/sim/app/w/[id]/components/workflow-block/components/sub-block/components/table.tsx +++ b/sim/app/w/[id]/components/workflow-block/components/sub-block/components/table.tsx @@ -1,10 +1,10 @@ import { useEffect, useMemo, useRef, useState } from 'react' import { Trash2 } from 'lucide-react' import { Button } from '@/components/ui/button' -import { EnvVarDropdown, checkEnvVarTrigger } from '@/components/ui/env-var-dropdown' +import { checkEnvVarTrigger, EnvVarDropdown } from '@/components/ui/env-var-dropdown' import { formatDisplayText } from '@/components/ui/formatted-text' import { Input } from '@/components/ui/input' -import { TagDropdown, checkTagTrigger } from '@/components/ui/tag-dropdown' +import { checkTagTrigger, TagDropdown } from '@/components/ui/tag-dropdown' import { cn } from '@/lib/utils' import { useSubBlockValue } from '../hooks/use-sub-block-value' diff --git a/sim/app/w/[id]/components/workflow-block/components/sub-block/components/tool-input/components/custom-tool-modal/custom-tool-modal.tsx b/sim/app/w/[id]/components/workflow-block/components/sub-block/components/tool-input/components/custom-tool-modal/custom-tool-modal.tsx index 607b2684a7..b0951f37a2 100644 --- a/sim/app/w/[id]/components/workflow-block/components/sub-block/components/tool-input/components/custom-tool-modal/custom-tool-modal.tsx +++ b/sim/app/w/[id]/components/workflow-block/components/sub-block/components/tool-input/components/custom-tool-modal/custom-tool-modal.tsx @@ -9,9 +9,9 @@ import { DialogHeader, DialogTitle, } from '@/components/ui/dialog' -import { EnvVarDropdown, checkEnvVarTrigger } from '@/components/ui/env-var-dropdown' +import { checkEnvVarTrigger, EnvVarDropdown } from '@/components/ui/env-var-dropdown' import { Label } from '@/components/ui/label' -import { TagDropdown, checkTagTrigger } from '@/components/ui/tag-dropdown' +import { checkTagTrigger, TagDropdown } from '@/components/ui/tag-dropdown' import { createLogger } from '@/lib/logs/console-logger' import { cn } from '@/lib/utils' import { useCustomToolsStore } from '@/stores/custom-tools/store' diff --git a/sim/app/w/[id]/components/workflow-block/components/sub-block/components/tool-input/components/tool-command/tool-command.tsx b/sim/app/w/[id]/components/workflow-block/components/sub-block/components/tool-input/components/tool-command/tool-command.tsx index f242783654..f6c4f3241b 100644 --- a/sim/app/w/[id]/components/workflow-block/components/sub-block/components/tool-input/components/tool-command/tool-command.tsx +++ b/sim/app/w/[id]/components/workflow-block/components/sub-block/components/tool-input/components/tool-command/tool-command.tsx @@ -1,6 +1,6 @@ import React, { - ReactNode, createContext, + ReactNode, useCallback, useContext, useEffect, diff --git a/sim/app/w/[id]/components/workflow-block/components/sub-block/components/tool-input/tool-input.tsx b/sim/app/w/[id]/components/workflow-block/components/sub-block/components/tool-input/tool-input.tsx index 006b3a120e..fdeef4f1ef 100644 --- a/sim/app/w/[id]/components/workflow-block/components/sub-block/components/tool-input/tool-input.tsx +++ b/sim/app/w/[id]/components/workflow-block/components/sub-block/components/tool-input/tool-input.tsx @@ -374,7 +374,10 @@ export function ToolInput({ blockId, subBlockId }: ToolInputProps) { ]) } else { setValue([ - ...selectedTools.map((tool) => ({ ...tool, isExpanded: false })), + ...selectedTools.map((tool) => ({ + ...tool, + isExpanded: false, + })), newTool, ]) } diff --git a/sim/app/w/[id]/components/workflow-block/components/sub-block/components/webhook/components/webhook-modal.tsx b/sim/app/w/[id]/components/workflow-block/components/sub-block/components/webhook/components/webhook-modal.tsx index 4541fa0135..54140b1072 100644 --- a/sim/app/w/[id]/components/workflow-block/components/sub-block/components/webhook/components/webhook-modal.tsx +++ b/sim/app/w/[id]/components/workflow-block/components/sub-block/components/webhook/components/webhook-modal.tsx @@ -54,7 +54,10 @@ export function WebhookModal({ const [isDeleting, setIsDeleting] = useState(false) const [isTesting, setIsTesting] = useState(false) const [isLoadingToken, setIsLoadingToken] = useState(false) - const [testResult, setTestResult] = useState<{ success: boolean; message?: string } | null>(null) + const [testResult, setTestResult] = useState<{ + success: boolean + message?: string + } | null>(null) const [showDeleteConfirm, setShowDeleteConfirm] = useState(false) const isConfigured = Boolean(webhookId) @@ -221,7 +224,9 @@ export function WebhookModal({ // Get provider icon const getProviderIcon = () => { - return provider.icon({ className: 'h-5 w-5 text-green-500 dark:text-green-400' }) + return provider.icon({ + className: 'h-5 w-5 text-green-500 dark:text-green-400', + }) } // Get provider-specific title diff --git a/sim/app/w/[id]/components/workflow-block/components/sub-block/components/webhook/webhook-config.tsx b/sim/app/w/[id]/components/workflow-block/components/sub-block/components/webhook/webhook-config.tsx index cf4ce0c80d..d9d6d54cc1 100644 --- a/sim/app/w/[id]/components/workflow-block/components/sub-block/components/webhook/webhook-config.tsx +++ b/sim/app/w/[id]/components/workflow-block/components/sub-block/components/webhook/webhook-config.tsx @@ -247,7 +247,9 @@ export function WebhookConfig({ blockId, subBlockId, isConnecting }: WebhookConf } const provider = WEBHOOK_PROVIDERS[webhookProvider || 'generic'] - return provider.icon({ className: 'h-4 w-4 mr-2 text-green-500 dark:text-green-400' }) + return provider.icon({ + className: 'h-4 w-4 mr-2 text-green-500 dark:text-green-400', + }) } // Check if the webhook is connected for the selected provider diff --git a/sim/app/w/[id]/workflow.tsx b/sim/app/w/[id]/workflow.tsx index 9ceb20e6b7..eeec14aff1 100644 --- a/sim/app/w/[id]/workflow.tsx +++ b/sim/app/w/[id]/workflow.tsx @@ -134,7 +134,9 @@ function WorkflowContent() { const blockConfig = getBlock(block.type) if (!blockConfig) { - logger.error(`No configuration found for block type: ${block.type}`, { block }) + logger.error(`No configuration found for block type: ${block.type}`, { + block, + }) return } diff --git a/sim/app/w/components/sidebar/components/settings-modal/components/account/account.tsx b/sim/app/w/components/sidebar/components/settings-modal/components/account/account.tsx index 3e69ee4e16..076d5085da 100644 --- a/sim/app/w/components/sidebar/components/settings-modal/components/account/account.tsx +++ b/sim/app/w/components/sidebar/components/settings-modal/components/account/account.tsx @@ -127,7 +127,10 @@ export function Account({ onOpenChange }: AccountProps) {
diff --git a/sim/next.config.ts b/sim/next.config.ts index 3995a694ed..7966c227af 100644 --- a/sim/next.config.ts +++ b/sim/next.config.ts @@ -35,8 +35,14 @@ const nextConfig: NextConfig = { source: '/api/:path*', headers: [ { key: 'Access-Control-Allow-Credentials', value: 'true' }, - { key: 'Access-Control-Allow-Origin', value: 'https://localhost:3001' }, - { key: 'Access-Control-Allow-Methods', value: 'GET,POST,OPTIONS,PUT,DELETE' }, + { + key: 'Access-Control-Allow-Origin', + value: 'https://localhost:3001', + }, + { + key: 'Access-Control-Allow-Methods', + value: 'GET,POST,OPTIONS,PUT,DELETE', + }, { key: 'Access-Control-Allow-Headers', value: diff --git a/sim/public/favicon/site.webmanifest b/sim/public/favicon/site.webmanifest index 3f95e059f6..23d3b7fd49 100644 --- a/sim/public/favicon/site.webmanifest +++ b/sim/public/favicon/site.webmanifest @@ -2,8 +2,16 @@ "name": "Sim Studio", "short_name": "Sim Studio", "icons": [ - { "src": "/favicon/android-chrome-192x192.png", "sizes": "192x192", "type": "image/png" }, - { "src": "/favicon/android-chrome-512x512.png", "sizes": "512x512", "type": "image/png" } + { + "src": "/favicon/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/favicon/android-chrome-512x512.png", + "sizes": "512x512", + "type": "image/png" + } ], "theme_color": "#ffffff", "background_color": "#ffffff", diff --git a/sim/vitest.config.ts b/sim/vitest.config.ts index a27388411e..45be4f0df8 100644 --- a/sim/vitest.config.ts +++ b/sim/vitest.config.ts @@ -29,21 +29,36 @@ export default defineConfig({ find: '@/stores/execution/store', replacement: path.resolve(__dirname, 'app/stores/execution/store.ts'), }, - { find: '@/blocks/types', replacement: path.resolve(__dirname, 'app/blocks/types.ts') }, + { + find: '@/blocks/types', + replacement: path.resolve(__dirname, 'app/blocks/types.ts'), + }, { find: '@/serializer/types', replacement: path.resolve(__dirname, 'app/serializer/types.ts'), }, { find: '@/lib', replacement: path.resolve(__dirname, 'app/lib') }, { find: '@/stores', replacement: path.resolve(__dirname, 'app/stores') }, - { find: '@/components', replacement: path.resolve(__dirname, 'app/components') }, + { + find: '@/components', + replacement: path.resolve(__dirname, 'app/components'), + }, { find: '@/app', replacement: path.resolve(__dirname, 'app') }, { find: '@/api', replacement: path.resolve(__dirname, 'app/api') }, - { find: '@/executor', replacement: path.resolve(__dirname, 'app/executor') }, - { find: '@/providers', replacement: path.resolve(__dirname, 'app/providers') }, + { + find: '@/executor', + replacement: path.resolve(__dirname, 'app/executor'), + }, + { + find: '@/providers', + replacement: path.resolve(__dirname, 'app/providers'), + }, { find: '@/tools', replacement: path.resolve(__dirname, 'app/tools') }, { find: '@/blocks', replacement: path.resolve(__dirname, 'app/blocks') }, - { find: '@/serializer', replacement: path.resolve(__dirname, 'app/serializer') }, + { + find: '@/serializer', + replacement: path.resolve(__dirname, 'app/serializer'), + }, { find: '@', replacement: path.resolve(__dirname) }, ], },